Skip to content

Commit 6d21ed1

Browse files
authored
Merge pull request #71 from modderme123/m
Update to the latest version of monaco-editor
2 parents 3fc5835 + 01031e3 commit 6d21ed1

38 files changed

+203
-322
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
"babel-preset-solid": "1.2.6",
4444
"dedent": "^0.7.0",
4545
"mitt": "^3.0.0",
46-
"monaco-editor": "^0.30.1",
46+
"monaco-editor": "^0.31.1",
4747
"monaco-editor-textmate": "^3.0.0",
4848
"monaco-textmate": "^3.0.1",
4949
"onigasm": "^2.2.5",
5050
"prettier": "^2.5.1",
5151
"register-service-worker": "^1.7.2",
5252
"rollup": "^2.62.0",
5353
"solid-dismiss": "^1.0.26",
54-
"solid-heroicons": "^1.1.0",
54+
"solid-heroicons": "^1.1.1",
5555
"solid-js": "1.2.6"
5656
}
5757
}

playground/app.tsx

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const App = (): JSX.Element => {
5353
const initialTabs = parseHash(url.hash && url.hash.slice(1), defaultTabs) || defaultTabs;
5454
const [tabs, setTabs] = createTabList(initialTabs);
5555
const [current, setCurrent] = createSignal('main.tsx');
56-
const [isReady, setIsReady] = createSignal(false);
5756

5857
const params = Object.fromEntries(url.searchParams.entries());
5958
const [version, setVersion] = createSignal(params.version || pkg.dependencies['solid-js']);
@@ -75,17 +74,13 @@ export const App = (): JSX.Element => {
7574
.then((data) => {
7675
setTabs(processImport(data));
7776
})
78-
.then(() => setIsReady(true))
7977
.catch((e) => console.error('Failed to import browser data', e));
80-
} else {
81-
setIsReady(true);
8278
}
8379

84-
const [noHeader, noInteractive, isHorizontal, noActionBar, noEditableTabs] = [
80+
const [noHeader, noInteractive, isHorizontal, noEditableTabs] = [
8581
'noHeader',
8682
'noInteractive',
8783
'isHorizontal',
88-
'noActionBar',
8984
'noEditableTabs',
9085
].map((key) => key in params);
9186

@@ -98,7 +93,6 @@ export const App = (): JSX.Element => {
9893

9994
const header = !noHeader;
10095
const interactive = !noInteractive;
101-
const actionBar = !noActionBar;
10296
const editableTabs = !noEditableTabs;
10397

10498
const { zoomState, updateZoomScale } = useZoom();
@@ -144,23 +138,20 @@ export const App = (): JSX.Element => {
144138
fallback={<div classList={{ 'md:col-span-2': !isHorizontal }}></div>}
145139
/>
146140

147-
<Show when={isReady()}>
148-
<Repl
149-
compiler={compiler}
150-
formatter={formatter}
151-
isHorizontal={isHorizontal}
152-
interactive={interactive}
153-
actionBar={actionBar}
154-
editableTabs={editableTabs}
155-
dark={dark()}
156-
tabs={tabs()}
157-
setTabs={setTabs}
158-
current={current()}
159-
setCurrent={setCurrent}
160-
version={version()}
161-
id="repl"
162-
/>
163-
</Show>
141+
<Repl
142+
compiler={compiler}
143+
formatter={formatter}
144+
isHorizontal={isHorizontal}
145+
interactive={interactive}
146+
editableTabs={editableTabs}
147+
dark={dark()}
148+
tabs={tabs()}
149+
setTabs={setTabs}
150+
current={current()}
151+
setCurrent={setCurrent}
152+
version={version()}
153+
id="repl"
154+
/>
164155

165156
<Show when={newUpdate()} children={<Update onDismiss={() => setNewUpdate(false)} />} />
166157
</div>

playground/components/header.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Header: Component<{
3131
window.removeEventListener('resize', closeMobileMenu);
3232
});
3333

34-
function closeMobileMenu(event: any) {
34+
function closeMobileMenu() {
3535
setShowMenu(false);
3636
}
3737

@@ -69,7 +69,7 @@ export const Header: Component<{
6969

7070
return (
7171
<header
72-
class="p-2 flex text-sm justify-between items-center bg-brand-default text-white z-20"
72+
class="p-2 flex text-sm justify-between items-center bg-brand-default text-white"
7373
classList={{ 'md:col-span-3': !props.isHorizontal }}
7474
>
7575
<h1 class="flex items-center space-x-4 uppercase leading-0 tracking-widest">
@@ -80,7 +80,6 @@ export const Header: Component<{
8080
</h1>
8181
<div class="flex items-center space-x-2">
8282
<Dismiss
83-
class="z-10"
8483
classList={{ 'absolute top-[53px] right-[10px] w-[fit-content]': showMenu() }}
8584
menuButton={() => menuBtnEl}
8685
open={showMenu}
@@ -183,7 +182,7 @@ export const Header: Component<{
183182
classList={{
184183
'border-white border': showMenu(),
185184
}}
186-
class="z-40 px-3 py-2 focus:outline-none focus:ring-1 rounded text-white opacity-80 hover:opacity-100 visible relative md:hidden m-0 mr-[10px]"
185+
class="px-3 py-2 focus:outline-none focus:ring-1 rounded text-white opacity-80 hover:opacity-100 visible relative md:hidden m-0 mr-[10px]"
187186
title="Mobile Menu Button"
188187
ref={menuBtnEl}
189188
>
@@ -195,7 +194,7 @@ export const Header: Component<{
195194
<select
196195
name="version"
197196
id="version"
198-
onClick={(e) => setShowMenu(false)}
197+
onClick={() => setShowMenu(false)}
199198
class="-mb-1 leading-snug text-white bg-transparent border-transparent hover:border-white cursor-pointer"
200199
style={`background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`}
201200
onChange={(e) => props.onVersionChange(e.currentTarget.value)}

playground/components/update.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from 'solid-js';
1+
import type { Component } from 'solid-js';
22
import { Portal } from 'solid-js/web';
33

44
import { Icon } from 'solid-heroicons';

playground/utils/exportToCsb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pkg from '../../package.json';
2-
import { Tab } from '../../src';
2+
import type { Tab } from '../../src';
33
import { compressToBase64 } from '@amoutonbrady/lz-string';
44

55
type IFiles = Record<string, { content: string | Record<string, any>; isBinary: boolean }>;

playground/utils/exportToJson.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Tab } from '../../src';
1+
import type { Tab } from '../../src';
22

33
/**
44
* This function will convert the tabs of the playground

pnpm-lock.yaml

Lines changed: 24 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Binary file not shown.

0 commit comments

Comments
 (0)