Skip to content

Commit 9dcdc3e

Browse files
committed
cleanup
1 parent 09bf482 commit 9dcdc3e

File tree

21 files changed

+156
-323
lines changed

21 files changed

+156
-323
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"arrowParens": "always",
33
"htmlWhitespaceSensitivity": "ignore",
4-
"printWidth": 100,
4+
"printWidth": 120,
55
"semi": true,
66
"singleQuote": true,
77
"tabWidth": 2,

playground/app.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ export const App = (): JSX.Element => {
6464
.catch((e) => console.error('Failed to import browser data', e));
6565
}
6666

67-
const [noHeader, noInteractive, isHorizontal, noEditableTabs] = [
68-
'noHeader',
69-
'noInteractive',
70-
'isHorizontal',
71-
'noEditableTabs',
72-
].map((key) => key in params);
67+
const noHeader = 'noHeader' in params;
68+
const isHorizontal = 'isHorizontal' in params;
7369

7470
if (params.format === 'json') {
7571
exportToJSON(tabs());
@@ -83,8 +79,6 @@ export const App = (): JSX.Element => {
8379
});
8480

8581
const header = !noHeader;
86-
const interactive = !noInteractive;
87-
const editableTabs = !noEditableTabs;
8882

8983
const { zoomState, updateZoomScale } = useZoom();
9084

@@ -131,8 +125,6 @@ export const App = (): JSX.Element => {
131125
compiler={compiler}
132126
formatter={formatter}
133127
isHorizontal={isHorizontal}
134-
interactive={interactive}
135-
editableTabs={editableTabs}
136128
dark={dark()}
137129
tabs={tabs()}
138130
setTabs={setTabs}

playground/components/header.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const Header: Component<{
6363

6464
return (
6565
<header
66-
class="p-2 flex text-sm justify-between items-center bg-white dark:bg-solid-darkbg dark:text-white text-black"
66+
class="p-2 flex text-sm justify-between items-center bg-white dark:bg-solid-darkbg dark:text-white text-black border-slate-200 dark:border-neutral-800 border-b-2px"
6767
classList={{ 'md:col-span-3': !props.isHorizontal }}
6868
>
6969
<h1 class="flex items-center space-x-4 uppercase leading-0 tracking-widest pl-1">
@@ -74,7 +74,7 @@ export const Header: Component<{
7474
Solid<b>JS</b> Playground
7575
</span>
7676
</h1>
77-
<div class="flex items-center space-x-2">
77+
<div class="flex items-center">
7878
<Dismiss
7979
classList={{ 'absolute top-[53px] right-[10px] w-[fit-content] z-10': showMenu() }}
8080
menuButton={() => menuBtnEl}
@@ -151,12 +151,8 @@ export const Header: Component<{
151151
</Show>
152152
<span class="sr-only">Show menu</span>
153153
</button>
154-
<div class="-mb-1 leading-snug cursor-pointer">
155-
<a
156-
href={`https://api.solidjs.com/auth/login?redirect=${window.location.origin}/login?auth=success`}
157-
>
158-
Login
159-
</a>
154+
<div class="mx-2 -mb-1 leading-snug cursor-pointer">
155+
<a href={`https://api.solidjs.com/auth/login?redirect=${window.location.origin}/login?auth=success`}>Login</a>
160156
</div>
161157
</div>
162158
</header>

playground/components/update.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ export const Update: Component<Props> = (props) => {
1414
return (
1515
<Portal mount={mount!}>
1616
<div class="bg-blue-200 text-brand-default border border-blue-400 rounded shadow px-6 py-4 z-10 max-w-sm">
17-
<button
18-
title="close"
19-
onClick={props.onDismiss}
20-
class="absolute top-1 right-1 hover:text-blue-900"
21-
>
17+
<button title="close" onClick={props.onDismiss} class="absolute top-1 right-1 hover:text-blue-900">
2218
<Icon path={x} class="h-6" />
2319
</button>
2420
<p class="font-semibold">There's a new update available.</p>
25-
<p class="mt-2">
26-
Refresh your browser or click the button below to get the latest update of the REPL.
27-
</p>
21+
<p class="mt-2">Refresh your browser or click the button below to get the latest update of the REPL.</p>
2822
<button
2923
onClick={() => location.reload()}
3024
class="bg-blue-800 text-blue-200 px-3 py-1 rounded mt-4 text-sm uppercase tracking-wide hover:bg-blue-900"

src/assets/main.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ div[contenteditable='true']:focus {
3535
}
3636
}
3737

38-
.tabs {
39-
@apply relative;
40-
}
41-
42-
.tabs::after {
43-
content: '';
44-
height: 2px;
45-
@apply absolute w-full left-0 bottom-0 bg-slate-200 dark:bg-slate-700 z-0;
46-
}
47-
4838
textarea.monaco-mouse-cursor-text:focus {
4939
box-shadow: unset;
5040
}

src/components/editor/TypeScriptReact.tmLanguage.json

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
"version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/d3c203d25a1df5def83082a47d1fe20fda2e80df",
88
"name": "TypeScriptReact",
99
"scopeName": "source.tsx",
10-
"patterns": [
11-
{ "include": "#directives" },
12-
{ "include": "#statements" },
13-
{ "include": "#shebang" }
14-
],
10+
"patterns": [{ "include": "#directives" }, { "include": "#statements" }, { "include": "#shebang" }],
1511
"repository": {
1612
"shebang": {
1713
"name": "comment.line.shebang.tsx",
@@ -291,11 +287,7 @@
291287
]
292288
},
293289
"var-single-variable-type-annotation": {
294-
"patterns": [
295-
{ "include": "#type-annotation" },
296-
{ "include": "#string" },
297-
{ "include": "#comment" }
298-
]
290+
"patterns": [{ "include": "#type-annotation" }, { "include": "#string" }, { "include": "#comment" }]
299291
},
300292
"destructuring-variable": {
301293
"patterns": [
@@ -351,10 +343,7 @@
351343
{
352344
"begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))",
353345
"end": "(?=,|\\})",
354-
"patterns": [
355-
{ "include": "#object-binding-element-propertyName" },
356-
{ "include": "#binding-element" }
357-
]
346+
"patterns": [{ "include": "#object-binding-element-propertyName" }, { "include": "#binding-element" }]
358347
},
359348
{ "include": "#object-binding-pattern" },
360349
{ "include": "#destructuring-variable-rest" },
@@ -368,10 +357,7 @@
368357
{
369358
"begin": "(?x)(?=((\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))",
370359
"end": "(?=,|\\})",
371-
"patterns": [
372-
{ "include": "#object-binding-element-propertyName" },
373-
{ "include": "#binding-element-const" }
374-
]
360+
"patterns": [{ "include": "#object-binding-element-propertyName" }, { "include": "#binding-element-const" }]
375361
},
376362
{ "include": "#object-binding-pattern-const" },
377363
{ "include": "#destructuring-variable-rest-const" },
@@ -518,10 +504,7 @@
518504
},
519505
"end": "\\]",
520506
"endCaptures": { "0": { "name": "punctuation.definition.binding-pattern.array.tsx" } },
521-
"patterns": [
522-
{ "include": "#parameter-binding-element" },
523-
{ "include": "#punctuation-comma" }
524-
]
507+
"patterns": [{ "include": "#parameter-binding-element" }, { "include": "#punctuation-comma" }]
525508
}
526509
]
527510
},
@@ -2385,11 +2368,7 @@
23852368
}
23862369
},
23872370
"string": {
2388-
"patterns": [
2389-
{ "include": "#qstring-single" },
2390-
{ "include": "#qstring-double" },
2391-
{ "include": "#template" }
2392-
]
2371+
"patterns": [{ "include": "#qstring-single" }, { "include": "#qstring-double" }, { "include": "#template" }]
23932372
},
23942373
"qstring-double": {
23952374
"name": "string.quoted.double.tsx",
@@ -2429,10 +2408,7 @@
24292408
},
24302409
"end": "`",
24312410
"endCaptures": { "0": { "name": "punctuation.definition.string.template.end.tsx" } },
2432-
"patterns": [
2433-
{ "include": "#template-substitution-element" },
2434-
{ "include": "#string-character-escape" }
2435-
]
2411+
"patterns": [{ "include": "#template-substitution-element" }, { "include": "#string-character-escape" }]
24362412
}
24372413
]
24382414
},
@@ -2476,11 +2452,7 @@
24762452
"contentName": "meta.embedded.line.tsx"
24772453
},
24782454
"type-string": {
2479-
"patterns": [
2480-
{ "include": "#qstring-single" },
2481-
{ "include": "#qstring-double" },
2482-
{ "include": "#template-type" }
2483-
]
2455+
"patterns": [{ "include": "#qstring-single" }, { "include": "#qstring-double" }, { "include": "#template-type" }]
24842456
},
24852457
"template-type": {
24862458
"patterns": [
@@ -2494,10 +2466,7 @@
24942466
},
24952467
"end": "`",
24962468
"endCaptures": { "0": { "name": "punctuation.definition.string.template.end.tsx" } },
2497-
"patterns": [
2498-
{ "include": "#template-type-substitution-element" },
2499-
{ "include": "#string-character-escape" }
2500-
]
2469+
"patterns": [{ "include": "#template-type-substitution-element" }, { "include": "#string-character-escape" }]
25012470
}
25022471
]
25032472
},
@@ -2939,10 +2908,7 @@
29392908
]
29402909
},
29412910
"jsx": {
2942-
"patterns": [
2943-
{ "include": "#jsx-tag-without-attributes-in-expression" },
2944-
{ "include": "#jsx-tag-in-expression" }
2945-
]
2911+
"patterns": [{ "include": "#jsx-tag-without-attributes-in-expression" }, { "include": "#jsx-tag-in-expression" }]
29462912
},
29472913
"jsx-tag-without-attributes-in-expression": {
29482914
"begin": "(?<!\\+\\+|--)(?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\\.|-))?\\s*(>))",

src/components/editor/css.tmLanguage.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@
8787
},
8888
"end": "(?!\\G)",
8989
"name": "meta.at-rule.font-face.css",
90-
"patterns": [
91-
{ "include": "#comment-block" },
92-
{ "include": "#escapes" },
93-
{ "include": "#rule-list" }
94-
]
90+
"patterns": [{ "include": "#comment-block" }, { "include": "#escapes" }, { "include": "#rule-list" }]
9591
},
9692
{
9793
"begin": "(?i)(@)page(?=[\\s:{]|/\\*|$)",

src/components/editor/index.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface Props {
99
};
1010
class?: string;
1111
url: string;
12-
disabled: boolean;
12+
disabled?: true;
1313
styles: Record<string, string>;
1414
canFormat?: boolean;
1515
isDark?: boolean;
@@ -107,13 +107,7 @@ const Editor: Component<Props> = (props) => {
107107
});
108108
});
109109

110-
return (
111-
<div
112-
class={`p-0 dark:text-white ${props.class || ''}`}
113-
classList={props.classList}
114-
ref={parent}
115-
/>
116-
);
110+
return <div class={`p-0 dark:text-white ${props.class || ''}`} classList={props.classList} ref={parent} />;
117111
};
118112

119113
export default Editor;

src/components/editor/monacoTabs.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ const MonacoTabs: Component<{ folder: string; tabs: Tab[]; compiled: string }> =
1212
const model = editor.createModel('', 'typescript', fileUri);
1313

1414
createEffect(() => {
15-
model.setValue(
16-
props.compiled.replace(/(https:\/\/cdn.skypack.dev\/)|(@[0-9][0-9.\-a-z]+)/g, ''),
17-
);
15+
model.setValue(props.compiled.replace(/(https:\/\/cdn.skypack.dev\/)|(@[0-9][0-9.\-a-z]+)/g, ''));
1816
});
1917
onCleanup(() => model.dispose());
2018

@@ -25,11 +23,7 @@ const MonacoTabs: Component<{ folder: string; tabs: Tab[]; compiled: string }> =
2523
},
2624
children: (tab) => {
2725
const uri = Uri.parse(`file:///${props.folder}/${tab().name}.${tab().type}`);
28-
const model = editor.createModel(
29-
tab().source,
30-
tab().type === 'tsx' ? 'typescript' : 'css',
31-
uri,
32-
);
26+
const model = editor.createModel(tab().source, tab().type === 'tsx' ? 'typescript' : 'css', uri);
3327

3428
let first = true;
3529
createEffect(() => {

src/components/editor/setupSolid.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ editor.defineTheme('vs-light-plus', vsLight as editor.IStandaloneThemeData);
9696

9797
const hookLanguages = languages.setLanguageConfiguration;
9898

99-
languages.setLanguageConfiguration = (
100-
languageId: string,
101-
configuration: languages.LanguageConfiguration,
102-
) => {
99+
languages.setLanguageConfiguration = (languageId: string, configuration: languages.LanguageConfiguration) => {
103100
liftOff();
104101
return hookLanguages(languageId, configuration);
105102
};

0 commit comments

Comments
 (0)