windmill-components 1.382.7 → 1.383.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/package/components/Dev.svelte +2 -1
  2. package/package/components/DiffDrawer.svelte +2 -0
  3. package/package/components/DiffEditor.svelte +12 -12
  4. package/package/components/DiffEditor.svelte.d.ts +5 -6
  5. package/package/components/Editor.svelte +78 -63
  6. package/package/components/Editor.svelte.d.ts +4 -11
  7. package/package/components/EditorTheme.svelte +2 -2
  8. package/package/components/ScriptEditor.svelte +1 -6
  9. package/package/components/SimpleEditor.svelte +40 -28
  10. package/package/components/SimpleEditor.svelte.d.ts +5 -8
  11. package/package/components/TemplateEditor.svelte +6 -4
  12. package/package/components/TemplateEditor.svelte.d.ts +3 -3
  13. package/package/components/apps/components/display/AppNavbarItem.svelte +1 -1
  14. package/package/components/apps/editor/AppEditor.svelte +34 -3
  15. package/package/components/apps/editor/AppEditorHeader.svelte +17 -7
  16. package/package/components/apps/editor/AppPreview.svelte +4 -1
  17. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +2 -1
  18. package/package/components/apps/types.d.ts +1 -0
  19. package/package/components/build_workers.d.ts +1 -1
  20. package/package/components/build_workers.js +146 -51
  21. package/package/components/common/toggleButton-v2/ToggleEnable.svelte +34 -0
  22. package/package/components/common/toggleButton-v2/ToggleEnable.svelte.d.ts +23 -0
  23. package/package/components/flows/content/FlowModuleComponent.svelte +2 -1
  24. package/package/components/flows/content/FlowModuleScript.svelte +1 -0
  25. package/package/components/flows/idUtils.js +2 -1
  26. package/package/components/vscode.d.ts +2 -1
  27. package/package/components/vscode.js +22 -8
  28. package/package/editorUtils.d.ts +6 -1
  29. package/package/editorUtils.js +6 -1
  30. package/package.json +18 -19
@@ -371,7 +371,8 @@ setContext('FlowEditorContext', {
371
371
  testStepStore,
372
372
  saveDraft: () => { },
373
373
  initialPath: '',
374
- flowInputsStore: writable({})
374
+ flowInputsStore: writable({}),
375
+ customUi: {}
375
376
  });
376
377
  $: updateFlow($flowStore);
377
378
  let lastSent = undefined;
@@ -158,6 +158,7 @@ $: updateContentType(data, diffType);
158
158
  {#key diffType}
159
159
  {#if contentType === 'content'}
160
160
  <DiffEditor
161
+ open={true}
161
162
  automaticLayout
162
163
  class="h-full"
163
164
  defaultLang={lang}
@@ -168,6 +169,7 @@ $: updateContentType(data, diffType);
168
169
  />
169
170
  {:else if contentType === 'metadata'}
170
171
  <DiffEditor
172
+ open={true}
171
173
  automaticLayout
172
174
  class="h-full"
173
175
  defaultLang="yaml"
@@ -1,12 +1,10 @@
1
1
  <script>import { BROWSER } from 'esm-env';
2
2
  import { onMount } from 'svelte';
3
+ import '@codingame/monaco-vscode-standalone-languages';
4
+ import '@codingame/monaco-vscode-standalone-json-language-features';
5
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
3
6
  import { editor as meditor } from 'monaco-editor';
4
- import 'monaco-editor/esm/vs/basic-languages/python/python.contribution';
5
- import 'monaco-editor/esm/vs/basic-languages/go/go.contribution';
6
- import 'monaco-editor/esm/vs/basic-languages/shell/shell.contribution';
7
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
8
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
9
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
7
+ import 'vscode/localExtensionHost';
10
8
  import { initializeVscode } from './vscode';
11
9
  import EditorTheme from './EditorTheme.svelte';
12
10
  import { buildWorkerDefinition } from './build_workers';
@@ -22,6 +20,7 @@ export let readOnly = false;
22
20
  let diffEditor;
23
21
  let diffDivEl = null;
24
22
  let editorWidth = SIDE_BY_SIDE_MIN_WIDTH;
23
+ export let open = false;
25
24
  async function loadDiffEditor() {
26
25
  await initializeVscode();
27
26
  if (!diffDivEl) {
@@ -72,18 +71,18 @@ export function getModified() {
72
71
  return diffEditor?.getModel()?.modified.getValue() ?? '';
73
72
  }
74
73
  export function show() {
75
- diffDivEl?.classList.remove('hidden');
74
+ open = true;
76
75
  }
77
76
  export function hide() {
78
- diffDivEl?.classList.add('hidden');
77
+ open = false;
79
78
  }
80
79
  function onWidthChange(editorWidth) {
81
80
  diffEditor?.updateOptions({ renderSideBySide: editorWidth >= SIDE_BY_SIDE_MIN_WIDTH });
82
81
  }
83
82
  $: onWidthChange(editorWidth);
83
+ $: open && diffDivEl && loadDiffEditor();
84
84
  onMount(() => {
85
85
  if (BROWSER) {
86
- loadDiffEditor();
87
86
  return () => {
88
87
  diffEditor?.dispose();
89
88
  };
@@ -91,6 +90,7 @@ onMount(() => {
91
90
  });
92
91
  </script>
93
92
 
94
- <EditorTheme />
95
-
96
- <div bind:this={diffDivEl} class="{$$props.class} editor" bind:clientWidth={editorWidth} />
93
+ {#if open}
94
+ <EditorTheme />
95
+ <div bind:this={diffDivEl} class="{$$props.class} editor" bind:clientWidth={editorWidth} />
96
+ {/if}
@@ -1,10 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import 'monaco-editor/esm/vs/basic-languages/python/python.contribution';
3
- import 'monaco-editor/esm/vs/basic-languages/go/go.contribution';
4
- import 'monaco-editor/esm/vs/basic-languages/shell/shell.contribution';
5
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
6
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
7
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
2
+ import '@codingame/monaco-vscode-standalone-languages';
3
+ import '@codingame/monaco-vscode-standalone-json-language-features';
4
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
5
+ import 'vscode/localExtensionHost';
8
6
  declare const __propDef: {
9
7
  props: {
10
8
  [x: string]: any;
@@ -15,6 +13,7 @@ declare const __propDef: {
15
13
  defaultOriginal?: string | undefined;
16
14
  defaultModified?: string | undefined;
17
15
  readOnly?: boolean | undefined;
16
+ open?: boolean | undefined;
18
17
  setupModel?: ((lang: string, original?: string, modified?: string, modifiedLang?: string) => void) | undefined;
19
18
  setOriginal?: ((code: string) => void) | undefined;
20
19
  getOriginal?: (() => string) | undefined;
@@ -1,21 +1,18 @@
1
+ <!-- <script lang="ts"></script> -->
2
+
1
3
  <script>import { BROWSER } from 'esm-env';
2
4
  import { sendUserToast } from '../toast';
3
5
  import { createEventDispatcher, onDestroy, onMount } from 'svelte';
6
+ import libStdContent from '../es6.d.ts.txt?raw';
7
+ import domContent from '../dom.d.ts.txt?raw';
8
+ import denoFetchContent from '../deno_fetch.d.ts.txt?raw';
9
+ import '@codingame/monaco-vscode-standalone-languages';
10
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
11
+ import 'vscode/localExtensionHost';
4
12
  import * as vscode from 'vscode';
5
- import { editor as meditor, languages, KeyCode, KeyMod, Uri as mUri } from 'monaco-editor';
6
- import 'monaco-editor/esm/vs/basic-languages/python/python.contribution';
7
- import 'monaco-editor/esm/vs/basic-languages/go/go.contribution';
8
- import 'monaco-editor/esm/vs/basic-languages/shell/shell.contribution';
9
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
10
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
11
- import 'monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution';
12
- import 'monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution';
13
- import 'monaco-editor/esm/vs/basic-languages/php/php.contribution';
14
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
15
- import 'monaco-editor/esm/vs/basic-languages/css/css.contribution';
16
- // import libStdContent from '../es6.d.ts.txt?raw'
17
- // import domContent from '../dom.d.ts.txt?raw'
18
- // import denoFetchContent from '../deno_fetch.d.ts.txt?raw'
13
+ // import '@codingame/monaco-vscode-typescript-basics-default-extension'
14
+ // import '@codingame/monaco-vscode-typescript-language-features-default-extension'
15
+ // import 'vscode/localExtensionHost'
19
16
  import processStdContent from '../process.d.ts.txt?raw';
20
17
  import windmillFetchContent from '../windmill_fetch.d.ts.txt?raw';
21
18
  import { MonacoLanguageClient } from 'monaco-languageclient';
@@ -27,17 +24,18 @@ import { createHash as randomHash, editorConfig, langToExt, updateOptions } from
27
24
  import { buildWorkerDefinition } from './build_workers';
28
25
  import { workspaceStore } from '../stores';
29
26
  import { UserService } from '../gen';
30
- import { initializeMode } from 'monaco-graphql/esm/initializeMode.js';
27
+ import { initializeVscode } from './vscode';
28
+ // import { initializeMode } from 'monaco-graphql/esm/initializeMode.js'
31
29
  import { sleep } from '../utils';
32
30
  import { editorCodeCompletion } from './copilot/completion';
33
- import { initializeVscode } from './vscode';
31
+ import { editor as meditor, languages, KeyCode, KeyMod, Uri as mUri } from 'monaco-editor';
34
32
  import EditorTheme from './EditorTheme.svelte';
35
33
  import { BIGQUERY_TYPES, MSSQL_TYPES, MYSQL_TYPES, POSTGRES_TYPES, SNOWFLAKE_TYPES } from '../consts';
36
34
  import { setupTypeAcquisition } from '../ata/index';
37
35
  import { initWasm, parseDeps } from '../infer';
38
36
  // import EditorTheme from './EditorTheme.svelte'
39
37
  let divEl = null;
40
- let editor;
38
+ let editor = null;
41
39
  export let lang;
42
40
  export let code = '';
43
41
  export let cmdEnterAction = undefined;
@@ -91,6 +89,7 @@ const uri = lang != 'go' && lang != 'typescript' && lang != 'python'
91
89
  : `file:///tmp/monaco/${randomHash()}.${langToExt(lang)}`;
92
90
  console.log('uri', uri);
93
91
  buildWorkerDefinition('../../../workers', import.meta.url, false);
92
+ // buildWorkerDefinition()
94
93
  export function getCode() {
95
94
  return editor?.getValue() ?? '';
96
95
  }
@@ -283,13 +282,13 @@ function addDBSchemaCompletions() {
283
282
  return;
284
283
  }
285
284
  if (schemaLang === 'graphql') {
286
- graphqlService ||= initializeMode();
287
- graphqlService?.setSchemaConfig([
288
- {
289
- uri: 'my-schema.graphql',
290
- introspectionJSON: schema
291
- }
292
- ]);
285
+ // graphqlService ||= initializeMode()
286
+ // graphqlService?.setSchemaConfig([
287
+ // {
288
+ // uri: 'my-schema.graphql',
289
+ // introspectionJSON: schema
290
+ // }
291
+ // ])
293
292
  }
294
293
  else {
295
294
  if (sqlSchemaCompletor) {
@@ -765,7 +764,8 @@ let ata = undefined;
765
764
  async function loadMonaco() {
766
765
  try {
767
766
  console.log("Loading Monaco's language client");
768
- await initializeVscode();
767
+ await initializeVscode('editor');
768
+ console.log('done loading Monaco and vscode');
769
769
  }
770
770
  catch (e) {
771
771
  console.log('error initializing services', e);
@@ -773,32 +773,6 @@ async function loadMonaco() {
773
773
  // console.log('bef ready')
774
774
  // console.log('af ready')
775
775
  initialized = true;
776
- languages.typescript.typescriptDefaults.setCompilerOptions({
777
- target: languages.typescript.ScriptTarget.Latest,
778
- allowNonTsExtensions: true,
779
- noSemanticValidation: false,
780
- noSyntaxValidation: false,
781
- completionItems: true,
782
- hovers: true,
783
- documentSymbols: true,
784
- definitions: true,
785
- references: true,
786
- documentHighlights: true,
787
- rename: true,
788
- diagnostics: true,
789
- documentRangeFormattingEdits: true,
790
- signatureHelp: true,
791
- onTypeFormattingEdits: true,
792
- codeActions: true,
793
- inlayHints: true,
794
- checkJs: true,
795
- allowJs: true,
796
- noUnusedLocals: true,
797
- strict: true,
798
- noLib: false,
799
- allowImportingTsExtensions: true,
800
- moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
801
- });
802
776
  languages.typescript.typescriptDefaults.addExtraLib(processStdContent, 'process.d.ts');
803
777
  languages.typescript.javascriptDefaults.setModeConfiguration({
804
778
  completionItems: true,
@@ -844,6 +818,32 @@ async function loadMonaco() {
844
818
  noSuggestionDiagnostics: false,
845
819
  diagnosticCodesToIgnore: [1108]
846
820
  });
821
+ languages.typescript.typescriptDefaults.setCompilerOptions({
822
+ target: languages.typescript.ScriptTarget.Latest,
823
+ allowNonTsExtensions: true,
824
+ noSemanticValidation: false,
825
+ noSyntaxValidation: false,
826
+ completionItems: true,
827
+ hovers: true,
828
+ documentSymbols: true,
829
+ definitions: true,
830
+ references: true,
831
+ documentHighlights: true,
832
+ rename: true,
833
+ diagnostics: true,
834
+ documentRangeFormattingEdits: true,
835
+ signatureHelp: true,
836
+ onTypeFormattingEdits: true,
837
+ codeActions: true,
838
+ inlayHints: true,
839
+ checkJs: true,
840
+ allowJs: true,
841
+ noUnusedLocals: true,
842
+ strict: true,
843
+ noLib: false,
844
+ allowImportingTsExtensions: true,
845
+ moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
846
+ });
847
847
  languages.typescript.javascriptDefaults.setCompilerOptions({
848
848
  target: languages.typescript.ScriptTarget.Latest,
849
849
  allowNonTsExtensions: true,
@@ -878,9 +878,24 @@ async function loadMonaco() {
878
878
  tabSize: lang == 'python' ? 4 : 2,
879
879
  folding
880
880
  });
881
+ // const wrapper = new MonacoEditorLanguageClientWrapper()
882
+ // const userConfig: UserConfig = {
883
+ // wrapperConfig: {
884
+ // editorAppConfig: {
885
+ // $type: 'classic',
886
+ // codeResources: {
887
+ // main: {
888
+ // text: 'console.log("FOO")")',
889
+ // uri: '/workspace/hello.ts'
890
+ // }
891
+ // }
892
+ // }
893
+ // }
894
+ // }
895
+ // await wrapper.initAndStart(userConfig, divEl)
881
896
  let timeoutModel = undefined;
882
897
  let ataModel = undefined;
883
- editor.onDidChangeModelContent((event) => {
898
+ editor?.onDidChangeModelContent((event) => {
884
899
  timeoutModel && clearTimeout(timeoutModel);
885
900
  timeoutModel = setTimeout(() => {
886
901
  let ncode = getCode();
@@ -894,20 +909,20 @@ async function loadMonaco() {
894
909
  ata?.(getCode());
895
910
  }, 1000);
896
911
  });
897
- editor.onDidBlurEditorText(() => {
912
+ editor?.onDidBlurEditorText(() => {
898
913
  dispatch('blur');
899
914
  });
900
- editor.onDidFocusEditorText(() => {
915
+ editor?.onDidFocusEditorText(() => {
901
916
  dispatch('focus');
902
- editor.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, function () {
917
+ editor?.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, function () {
903
918
  code = getCode();
904
919
  shouldBindKey && format && format();
905
920
  });
906
- editor.addCommand(KeyMod.CtrlCmd | KeyCode.Enter, function () {
921
+ editor?.addCommand(KeyMod.CtrlCmd | KeyCode.Enter, function () {
907
922
  code = getCode();
908
923
  shouldBindKey && cmdEnterAction && cmdEnterAction();
909
924
  });
910
- editor.addCommand(KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Digit7, function () {
925
+ editor?.addCommand(KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Digit7, function () {
911
926
  // CMD + slash (toggle comment) on some EU keyboards
912
927
  editor?.trigger('keyboard', 'editor.action.commentLine', {});
913
928
  });
@@ -941,15 +956,15 @@ async function loadMonaco() {
941
956
  async function setTypescriptExtraLibs() {
942
957
  if (lang === 'typescript' && scriptLang != 'deno') {
943
958
  const hostname = getHostname();
944
- // const stdLib = { content: libStdContent, filePath: 'es6.d.ts' }
959
+ const stdLib = { content: libStdContent, filePath: 'es6.d.ts' };
945
960
  if (scriptLang == 'bun' || scriptLang == 'bunnative') {
946
- // const processLib = { content: processStdContent, filePath: 'process.d.ts' }
947
- // const domLib = { content: domContent, filePath: 'dom.d.ts' }
948
- // languages.typescript.typescriptDefaults.setExtraLibs([stdLib, domLib, processLib])
961
+ const processLib = { content: processStdContent, filePath: 'process.d.ts' };
962
+ const domLib = { content: domContent, filePath: 'dom.d.ts' };
963
+ languages.typescript.typescriptDefaults.setExtraLibs([stdLib, domLib, processLib]);
949
964
  }
950
965
  else {
951
- // const denoFetch = { content: denoFetchContent, filePath: 'deno_fetch.d.ts' }
952
- // languages.typescript.typescriptDefaults.setExtraLibs([stdLib, denoFetch])
966
+ const denoFetch = { content: denoFetchContent, filePath: 'deno_fetch.d.ts' };
967
+ languages.typescript.typescriptDefaults.setExtraLibs([stdLib, denoFetch]);
953
968
  let localContent = windmillFetchContent;
954
969
  let p = '/tmp/monaco/windmill.d.ts';
955
970
  let nuri = mUri.parse(p);
@@ -1,17 +1,10 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { editor as meditor } from 'monaco-editor';
3
- import 'monaco-editor/esm/vs/basic-languages/python/python.contribution';
4
- import 'monaco-editor/esm/vs/basic-languages/go/go.contribution';
5
- import 'monaco-editor/esm/vs/basic-languages/shell/shell.contribution';
6
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
7
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
8
- import 'monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution';
9
- import 'monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution';
10
- import 'monaco-editor/esm/vs/basic-languages/php/php.contribution';
11
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
12
- import 'monaco-editor/esm/vs/basic-languages/css/css.contribution';
2
+ import '@codingame/monaco-vscode-standalone-languages';
3
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
4
+ import 'vscode/localExtensionHost';
13
5
  import { type Preview } from '../gen';
14
6
  import type { Text } from 'yjs';
7
+ import { editor as meditor } from 'monaco-editor';
15
8
  declare const __propDef: {
16
9
  props: {
17
10
  [x: string]: any;
@@ -1,7 +1,7 @@
1
- <script>import { editor as meditor } from 'monaco-editor/esm/vs/editor/editor.api';
1
+ <script>import { isInitialized } from './vscode';
2
+ import { editor as meditor } from 'monaco-editor/esm/vs/editor/editor.api';
2
3
  import { onMount } from 'svelte';
3
4
  import DarkModeObserver from './DarkModeObserver.svelte';
4
- import { isInitialized } from './vscode';
5
5
  function onThemeChange() {
6
6
  if (isInitialized) {
7
7
  if (document.documentElement.classList.contains('dark')) {
@@ -277,12 +277,7 @@ function collabUrl() {
277
277
  {fixedOverflowWidgets}
278
278
  {args}
279
279
  />
280
- <DiffEditor
281
- bind:this={diffEditor}
282
- automaticLayout
283
- {fixedOverflowWidgets}
284
- class="hidden h-full"
285
- />
280
+ <DiffEditor bind:this={diffEditor} automaticLayout {fixedOverflowWidgets} />
286
281
  {/key}
287
282
  </div>
288
283
  </Pane>
@@ -6,14 +6,20 @@
6
6
  <script>import { BROWSER } from 'esm-env';
7
7
  import { createHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
8
8
  import { editor as meditor, KeyCode, KeyMod, Uri as mUri, languages } from 'monaco-editor';
9
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
10
- import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution';
11
- import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
12
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
13
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
14
- import 'monaco-editor/esm/vs/language/json/monaco.contribution';
15
- import 'monaco-editor/esm/vs/basic-languages/css/css.contribution';
16
- import 'monaco-editor/esm/vs/language/css/monaco.contribution';
9
+ // import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution'
10
+ // import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution'
11
+ // import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'
12
+ // import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution'
13
+ // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'
14
+ // import 'monaco-editor/esm/vs/language/json/monaco.contribution'
15
+ // import 'monaco-editor/esm/vs/basic-languages/css/css.contribution'
16
+ // import 'monaco-editor/esm/vs/language/css/monaco.contribution'
17
+ import '@codingame/monaco-vscode-standalone-languages';
18
+ import '@codingame/monaco-vscode-standalone-json-language-features';
19
+ import '@codingame/monaco-vscode-standalone-css-language-features';
20
+ // import '@codingame/monaco-vscode-standalone-yaml-language-features'
21
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
22
+ import 'vscode/localExtensionHost';
17
23
  import { allClasses } from './apps/editor/componentsPanel/cssUtils';
18
24
  import { createEventDispatcher, onDestroy, onMount } from 'svelte';
19
25
  import libStdContent from '../es6.d.ts.txt?raw';
@@ -43,7 +49,13 @@ export let domLib = false;
43
49
  export let autofocus = false;
44
50
  const dispatch = createEventDispatcher();
45
51
  const uri = `file:///${hash}.${langToExt(lang)}`;
46
- buildWorkerDefinition('../../../workers', import.meta.url, false);
52
+ buildWorkerDefinition();
53
+ // monaco.languages.register({
54
+ // id: 'json',
55
+ // extensions: ['.json', '.jsonc'],
56
+ // aliases: ['JSON', 'json'],
57
+ // mimetypes: ['application/json']
58
+ // })
47
59
  export function getCode() {
48
60
  return editor?.getValue() ?? '';
49
61
  }
@@ -107,25 +119,25 @@ $: disableTabCond?.set(!code && !!suggestion);
107
119
  async function loadMonaco() {
108
120
  await initializeVscode();
109
121
  initialized = true;
110
- languages.typescript.javascriptDefaults.setCompilerOptions({
111
- target: languages.typescript.ScriptTarget.Latest,
112
- allowNonTsExtensions: true,
113
- noSemanticValidation: false,
114
- noLib: true,
115
- moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
116
- });
117
- languages.typescript.javascriptDefaults.setDiagnosticsOptions({
118
- noSemanticValidation: false,
119
- noSyntaxValidation: false,
120
- noSuggestionDiagnostics: false,
121
- diagnosticCodesToIgnore: [1108]
122
- });
123
- languages.json.jsonDefaults.setDiagnosticsOptions({
124
- validate: true,
125
- allowComments: false,
126
- schemas: [],
127
- enableSchemaRequest: true
128
- });
122
+ // languages.typescript.javascriptDefaults.setCompilerOptions({
123
+ // target: languages.typescript.ScriptTarget.Latest,
124
+ // allowNonTsExtensions: true,
125
+ // noSemanticValidation: false,
126
+ // noLib: true,
127
+ // moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
128
+ // })
129
+ // languages.typescript.javascriptDefaults.setDiagnosticsOptions({
130
+ // noSemanticValidation: false,
131
+ // noSyntaxValidation: false,
132
+ // noSuggestionDiagnostics: false,
133
+ // diagnosticCodesToIgnore: [1108]
134
+ // })
135
+ // languages.json.jsonDefaults.setDiagnosticsOptions({
136
+ // validate: true,
137
+ // allowComments: false,
138
+ // schemas: [],
139
+ // enableSchemaRequest: true
140
+ // })
129
141
  try {
130
142
  model = meditor.createModel(code, lang, mUri.parse(uri));
131
143
  }
@@ -1,13 +1,10 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import { editor as meditor } from 'monaco-editor';
3
- import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
4
- import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution';
5
- import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
6
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
7
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
8
- import 'monaco-editor/esm/vs/language/json/monaco.contribution';
9
- import 'monaco-editor/esm/vs/basic-languages/css/css.contribution';
10
- import 'monaco-editor/esm/vs/language/css/monaco.contribution';
3
+ import '@codingame/monaco-vscode-standalone-languages';
4
+ import '@codingame/monaco-vscode-standalone-json-language-features';
5
+ import '@codingame/monaco-vscode-standalone-css-language-features';
6
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
7
+ import 'vscode/localExtensionHost';
11
8
  declare const __propDef: {
12
9
  props: {
13
10
  [x: string]: any;
@@ -5,9 +5,9 @@ import { editor as meditor, Uri as mUri, languages, Range, KeyMod, KeyCode } fro
5
5
  import { createEventDispatcher, getContext, onDestroy, onMount } from 'svelte';
6
6
  import { writable } from 'svelte/store';
7
7
  import { buildWorkerDefinition } from './build_workers';
8
- import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
9
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
10
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
8
+ import '@codingame/monaco-vscode-standalone-languages';
9
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
10
+ import 'vscode/localExtensionHost';
11
11
  import { initializeVscode } from './vscode';
12
12
  import EditorTheme from './EditorTheme.svelte';
13
13
  export const conf = {
@@ -359,7 +359,9 @@ let width = 0;
359
359
  let initialized = false;
360
360
  let jsLoader = undefined;
361
361
  async function loadMonaco() {
362
- await initializeVscode();
362
+ console.log('init template');
363
+ await initializeVscode('templateEditor');
364
+ console.log('initialized');
363
365
  initialized = true;
364
366
  languages.typescript.javascriptDefaults.setCompilerOptions({
365
367
  target: languages.typescript.ScriptTarget.Latest,
@@ -1,7 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
3
- import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
4
- import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
2
+ import '@codingame/monaco-vscode-standalone-languages';
3
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
4
+ import 'vscode/localExtensionHost';
5
5
  declare const __propDef: {
6
6
  props: {
7
7
  [x: string]: any;
@@ -55,7 +55,7 @@ function getButtonProps(resolvedPath) {
55
55
  const hash = url.hash;
56
56
  replaceStateFn?.(`${window.location.pathname}${queryParams}${hash}`);
57
57
  $worldStore.outputsById['ctx'].query.set(Object.fromEntries(new URLSearchParams(queryParams).entries()));
58
- $worldStore.outputsById['ctx'].hash.set(url.hash);
58
+ $worldStore.outputsById['ctx'].hash.set(hash.substring(1));
59
59
  $selected = resolvedPath === extractPathDetails() ? resolvedPath : undefined;
60
60
  },
61
61
  href: undefined,
@@ -20,7 +20,7 @@ import ItemPicker from '../../ItemPicker.svelte';
20
20
  import VariableEditor from '../../VariableEditor.svelte';
21
21
  import { VariableService } from '../../../gen';
22
22
  import { initHistory } from '../../../history';
23
- import { Component, Minus, Paintbrush, Plus } from 'lucide-svelte';
23
+ import { Component, Minus, Paintbrush, Plus, Smartphone } from 'lucide-svelte';
24
24
  import { findGridItem, findGridItemParentGrid } from './appUtils';
25
25
  import ComponentNavigation from './component/ComponentNavigation.svelte';
26
26
  import CssSettings from './componentsPanel/CssSettings.svelte';
@@ -69,7 +69,7 @@ let context = {
69
69
  groups: $userStore?.groups,
70
70
  username: $userStore?.username,
71
71
  query: Object.fromEntries($page.url.searchParams.entries()),
72
- hash: $page.url.hash,
72
+ hash: $page.url.hash.substring(1),
73
73
  workspace: $workspaceStore,
74
74
  mode: 'editor',
75
75
  summary: $summaryStore,
@@ -159,7 +159,10 @@ function hashchange(e) {
159
159
  context = context;
160
160
  }
161
161
  $: context.mode = $mode == 'dnd' ? 'editor' : 'viewer';
162
- $: width = $breakpoint === 'sm' ? 'min-w-[400px] max-w-[656px]' : 'min-w-[710px] w-full';
162
+ $: width =
163
+ $breakpoint === 'sm' && $appStore?.mobileViewOnSmallerScreens !== false
164
+ ? 'min-w-[400px] max-w-[656px]'
165
+ : 'min-w-[710px] w-full';
163
166
  let selectedTab = 'insert';
164
167
  let befSelected = undefined;
165
168
  $: if ($selectedComponent?.[0] != befSelected) {
@@ -537,6 +540,34 @@ let stillInJobEnter = false;
537
540
  <GridEditor {policy} />
538
541
  </div>
539
542
  {/if}
543
+ {#if !$appStore?.mobileViewOnSmallerScreens && $breakpoint === 'sm'}
544
+ <div
545
+ class="absolute inset-0 flex bg-surface center-center z-10000 bg-opacity-60"
546
+ >
547
+ <div
548
+ class="bg-surface shadow-md rounded-md p-4 max-w-sm flex flex-col gap-2"
549
+ >
550
+ <div class="text-sm font-semibold"> Mobile View </div>
551
+ <div class="text-xs">
552
+ Enabling mobile view allows you to adjust component placement for
553
+ smaller screens.
554
+ </div>
555
+ <Button
556
+ color="light"
557
+ variant="border"
558
+ size="xs"
559
+ on:click={() => {
560
+ $appStore.mobileViewOnSmallerScreens = true
561
+ }}
562
+ startIcon={{
563
+ icon: Smartphone
564
+ }}
565
+ >
566
+ Add mobile view on smaller screens
567
+ </Button>
568
+ </div>
569
+ </div>
570
+ {/if}
540
571
  </div>
541
572
  </div>
542
573
  </Pane>
@@ -46,6 +46,7 @@ import { getUpdateInput } from '../components/display/dbtable/queries/update';
46
46
  import { getDeleteInput } from '../components/display/dbtable/queries/delete';
47
47
  import { collectOneOfFields } from './appUtils';
48
48
  import Summary from '../../Summary.svelte';
49
+ import ToggleEnable from '../../common/toggleButton-v2/ToggleEnable.svelte';
49
50
  async function hash(message) {
50
51
  try {
51
52
  const msgUint8 = new TextEncoder().encode(message); // encode as (utf-8) Uint8Array
@@ -1162,20 +1163,29 @@ export function openTroubleshootPanel() {
1162
1163
  />
1163
1164
  </ToggleButtonGroup>
1164
1165
  {/if}
1165
- <div>
1166
+ <div class="flex flex-row gap-2">
1166
1167
  <ToggleButtonGroup class="h-[30px]" bind:selected={$breakpoint}>
1167
1168
  <ToggleButton
1168
- tooltip="Mobile View"
1169
- icon={Smartphone}
1170
- value="sm"
1169
+ tooltip="Computer View"
1170
+ icon={Laptop2}
1171
+ value={'lg'}
1171
1172
  iconProps={{ size: 16 }}
1172
1173
  />
1173
1174
  <ToggleButton
1174
- tooltip="Computer View"
1175
- icon={Laptop2}
1176
- value="lg"
1175
+ tooltip="Mobile View"
1176
+ icon={Smartphone}
1177
+ value={'sm'}
1177
1178
  iconProps={{ size: 16 }}
1178
1179
  />
1180
+ {#if $breakpoint === 'sm'}
1181
+ <ToggleEnable
1182
+ tooltip="Desktop view is enabled by default. Enable this to customize the layout of the components for the mobile view"
1183
+ label="Enable mobile view for smaller screens"
1184
+ bind:checked={$app.mobileViewOnSmallerScreens}
1185
+ iconProps={{ size: 16 }}
1186
+ iconOnly={false}
1187
+ />
1188
+ {/if}
1179
1189
  </ToggleButtonGroup>
1180
1190
  </div>
1181
1191
  </div>
@@ -122,7 +122,10 @@ $: if (!deepEqual(previousSelectedIds, $selectedComponent)) {
122
122
  .flatMap((id) => dfs(app.grid, id, app.subgrids ?? {}))
123
123
  .filter((x) => x != undefined);
124
124
  }
125
- $: width = $breakpoint === 'sm' ? 'max-w-[640px]' : 'w-full min-w-[768px]';
125
+ $: width =
126
+ $breakpoint === 'sm' && $appStore?.mobileViewOnSmallerScreens !== false
127
+ ? 'max-w-[640px]'
128
+ : 'w-full min-w-[768px]';
126
129
  $: lockedClasses = isLocked ? '!max-h-[400px] overflow-hidden pointer-events-none' : '';
127
130
  function onThemeChange() {
128
131
  $darkMode = document.documentElement.classList.contains('dark');
@@ -327,8 +327,9 @@ async function inferSuggestions(code) {
327
327
  {/if}
328
328
 
329
329
  <DiffEditor
330
+ open={false}
330
331
  bind:this={diffEditor}
331
- class="hidden h-full"
332
+ class="h-full"
332
333
  automaticLayout
333
334
  fixedOverflowWidgets
334
335
  />
@@ -107,6 +107,7 @@ export type App = {
107
107
  subgrids?: Record<string, GridItem[]>;
108
108
  theme: AppTheme | undefined;
109
109
  hideLegacyTopBar?: boolean | undefined;
110
+ mobileViewOnSmallerScreens?: boolean | undefined;
110
111
  };
111
112
  export type ConnectingInput = {
112
113
  opened: boolean;
@@ -1 +1 @@
1
- export declare function buildWorkerDefinition(workerPath: string, basePath: string, useModuleWorker: boolean): void;
1
+ export declare function buildWorkerDefinition(...args: any[]): void;
@@ -4,57 +4,152 @@
4
4
  // import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline'
5
5
  // import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker&inline'
6
6
  // import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker&inline'
7
- import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
8
- import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
9
- import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
10
- import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
11
- import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
12
- export function buildWorkerDefinition(workerPath, basePath, useModuleWorker) {
13
- const monWin = self;
14
- const workerOverrideGlobals = {
15
- basePath: basePath,
16
- workerPath: workerPath,
17
- workerOptions: {
18
- type: useModuleWorker ? 'module' : 'classic'
19
- }
20
- };
21
- if (!monWin.MonacoEnvironment) {
22
- monWin.MonacoEnvironment = {
23
- workerOverrideGlobals: workerOverrideGlobals,
24
- createTrustedTypesPolicy: (_policyName) => {
25
- return undefined;
26
- }
27
- };
28
- }
29
- const monEnv = monWin.MonacoEnvironment;
30
- monEnv.workerOverrideGlobals = workerOverrideGlobals;
31
- const getWorker = (_, label) => {
32
- console.log('getWorker: workerId: ' + _ + ' label: ' + label);
33
- switch (label) {
34
- case 'template':
35
- case 'typescript':
36
- case 'javascript':
37
- return new tsWorker();
38
- case 'html':
39
- case 'handlebars':
40
- case 'razor':
41
- return new htmlWorker();
42
- case 'css':
43
- case 'scss':
44
- case 'less':
45
- return new cssWorker();
46
- case 'json':
47
- return new jsonWorker();
48
- case 'graphql':
49
- const workerFilename = `graphql.worker.bundle.js`;
50
- const workerPathLocal = `${workerOverrideGlobals.workerPath}/${workerFilename}`;
51
- const workerUrl = new URL(workerPathLocal, workerOverrideGlobals.basePath);
52
- return new Worker(workerUrl.href, {
53
- name: label
7
+ // import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
8
+ // import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
9
+ // import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
10
+ // import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
11
+ // import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
12
+ // import type { Environment } from 'monaco-editor/esm/vs/editor/editor.api.js'
13
+ // interface MonacoEnvironmentEnhanced extends Environment {
14
+ // workerOverrideGlobals: WorkerOverrideGlobals
15
+ // }
16
+ // type WorkerOverrideGlobals = {
17
+ // basePath: string
18
+ // workerPath: string
19
+ // workerOptions: WorkerOptions
20
+ // }
21
+ // export function buildWorkerDefinition(
22
+ // workerPath: string,
23
+ // basePath: string,
24
+ // useModuleWorker: boolean
25
+ // ) {
26
+ // const monWin = self as Window
27
+ // const workerOverrideGlobals: WorkerOverrideGlobals = {
28
+ // basePath: basePath,
29
+ // workerPath: workerPath,
30
+ // workerOptions: {
31
+ // type: useModuleWorker ? 'module' : 'classic'
32
+ // }
33
+ // }
34
+ // if (!monWin.MonacoEnvironment) {
35
+ // monWin.MonacoEnvironment = {
36
+ // workerOverrideGlobals: workerOverrideGlobals,
37
+ // createTrustedTypesPolicy: (_policyName: string) => {
38
+ // return undefined
39
+ // }
40
+ // } as MonacoEnvironmentEnhanced
41
+ // }
42
+ // const monEnv = monWin.MonacoEnvironment as MonacoEnvironmentEnhanced
43
+ // monEnv.workerOverrideGlobals = workerOverrideGlobals
44
+ // const getWorker = (_: string, label: string) => {
45
+ // console.log('getWorker: workerId: ' + _ + ' label: ' + label)
46
+ // switch (label) {
47
+ // case 'template':
48
+ // case 'typescript':
49
+ // case 'javascript':
50
+ // return new tsWorker()
51
+ // case 'html':
52
+ // case 'handlebars':
53
+ // case 'razor':
54
+ // return new htmlWorker()
55
+ // case 'css':
56
+ // case 'scss':
57
+ // case 'less':
58
+ // return new cssWorker()
59
+ // case 'json':
60
+ // return new jsonWorker()
61
+ // case 'graphql':
62
+ // const workerFilename = `graphql.worker.bundle.js`
63
+ // const workerPathLocal = `${workerOverrideGlobals.workerPath}/${workerFilename}`
64
+ // const workerUrl = new URL(workerPathLocal, workerOverrideGlobals.basePath)
65
+ // return new Worker(workerUrl.href, {
66
+ // name: label
67
+ // })
68
+ // default:
69
+ // return new editorWorker()
70
+ // }
71
+ // }
72
+ // monWin.MonacoEnvironment.getWorker = getWorker
73
+ // }
74
+ // //
75
+ // export type WorkerLoader = () => Worker
76
+ // const workerLoaders: Partial<Record<string, WorkerLoader>> = {
77
+ // editorWorkerService: () =>
78
+ // new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), {
79
+ // type: 'module'
80
+ // }),
81
+ // textMateWorker: () =>
82
+ // new Worker(
83
+ // new URL('@codingame/monaco-vscode-textmate-service-override/worker', import.meta.url),
84
+ // { type: 'module' }
85
+ // ),
86
+ // languageDetectionWorkerService: () =>
87
+ // new Worker(
88
+ // new URL(
89
+ // '@codingame/monaco-vscode-language-detection-worker-service-override/worker',
90
+ // import.meta.url
91
+ // ),
92
+ // { type: 'module' }
93
+ // )
94
+ // }
95
+ // export function registerWorkerLoader(label: string, workerLoader: WorkerLoader): void {
96
+ // workerLoaders[label] = workerLoader
97
+ // }
98
+ // export function buildWorkerDefinition() {
99
+ // // Do not use monaco-editor-webpack-plugin because it doesn't handle properly cross origin workers
100
+ // window.MonacoEnvironment = {
101
+ // getWorker: function (moduleId, label) {
102
+ // console.log('LOAD')
103
+ // const workerFactory = workerLoaders[label]
104
+ // if (workerFactory != null) {
105
+ // return workerFactory()
106
+ // }
107
+ // throw new Error(`Unimplemented worker ${label} (${moduleId})`)
108
+ // }
109
+ // }
110
+ // }
111
+ import { graphql } from 'graphql';
112
+ import { useWorkerFactory } from 'monaco-editor-wrapper/workerFactory';
113
+ export function buildWorkerDefinition(...args) {
114
+ useWorkerFactory({
115
+ ignoreMapping: true,
116
+ workerLoaders: {
117
+ editorWorkerService: () => {
118
+ console.log('editorWorkerService');
119
+ return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), {
120
+ type: 'module'
121
+ });
122
+ },
123
+ javascript: () => {
124
+ console.log('javascript');
125
+ return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
126
+ type: 'module'
127
+ });
128
+ },
129
+ typescript: () => {
130
+ console.log('typescript');
131
+ return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
132
+ type: 'module'
54
133
  });
55
- default:
56
- return new editorWorker();
134
+ },
135
+ json: () => {
136
+ console.log('json');
137
+ return new Worker(new URL('monaco-editor-wrapper/workers/module/json', import.meta.url), {
138
+ type: 'module'
139
+ });
140
+ },
141
+ html: () => {
142
+ console.log('html');
143
+ return new Worker(new URL('monaco-editor-wrapper/workers/module/html', import.meta.url), {
144
+ type: 'module'
145
+ });
146
+ },
147
+ css: () => {
148
+ console.log('html');
149
+ return new Worker(new URL('monaco-editor-wrapper/workers/module/css', import.meta.url), {
150
+ type: 'module'
151
+ });
152
+ }
57
153
  }
58
- };
59
- monWin.MonacoEnvironment.getWorker = getWorker;
154
+ });
60
155
  }
@@ -0,0 +1,34 @@
1
+ <script>import { Tab } from '@rgossiaux/svelte-headlessui';
2
+ import { twMerge } from 'tailwind-merge';
3
+ import Toggle from '../../Toggle.svelte';
4
+ export let label = undefined;
5
+ export let tooltip = undefined;
6
+ export let disabled = false;
7
+ export let small = false;
8
+ export let light = false;
9
+ export let checked = false;
10
+ export let id = undefined;
11
+ </script>
12
+
13
+ <div {id} class="flex">
14
+ <Tab
15
+ {disabled}
16
+ class={twMerge(
17
+ ' rounded-md transition-all text-xs flex gap-1 flex-row items-center',
18
+ small ? 'px-1.5 py-0.5 text-2xs' : 'px-2 py-1',
19
+ light ? 'font-medium' : '',
20
+ 'bg-surface-secondary ',
21
+ $$props.class
22
+ )}
23
+ >
24
+ <Toggle
25
+ size="xs"
26
+ options={{
27
+ right: label,
28
+ rightTooltip: tooltip
29
+ }}
30
+ textClass="text-2xs whitespace-nowrap white !w-full"
31
+ bind:checked
32
+ />
33
+ </Tab>
34
+ </div>
@@ -0,0 +1,23 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ label?: string | undefined;
6
+ tooltip?: string | undefined;
7
+ disabled?: boolean | undefined;
8
+ small?: boolean | undefined;
9
+ light?: boolean | undefined;
10
+ checked?: boolean | undefined;
11
+ id?: string | undefined;
12
+ };
13
+ events: {
14
+ [evt: string]: CustomEvent<any>;
15
+ };
16
+ slots: {};
17
+ };
18
+ export type ToggleEnableProps = typeof __propDef.props;
19
+ export type ToggleEnableEvents = typeof __propDef.events;
20
+ export type ToggleEnableSlots = typeof __propDef.slots;
21
+ export default class ToggleEnable extends SvelteComponent<ToggleEnableProps, ToggleEnableEvents, ToggleEnableSlots> {
22
+ }
23
+ export {};
@@ -284,10 +284,11 @@ function setFlowInput(argName) {
284
284
  )}
285
285
  />
286
286
  <DiffEditor
287
+ open={false}
287
288
  bind:this={diffEditor}
288
289
  automaticLayout
289
290
  fixedOverflowWidgets
290
- class="hidden h-full"
291
+ class="h-full"
291
292
  />
292
293
  {/key}
293
294
  {/if}
@@ -61,6 +61,7 @@ export let showDiff = false;
61
61
  {#if showDiff}
62
62
  {#key previousCode + code}
63
63
  <DiffEditor
64
+ open={true}
64
65
  class="h-screen"
65
66
  readOnly
66
67
  automaticLayout
@@ -9,7 +9,8 @@ export const forbiddenIds = [
9
9
  'for',
10
10
  'delete',
11
11
  'while',
12
- 'new'
12
+ 'new',
13
+ 'in'
13
14
  ];
14
15
  export function numberToChars(n) {
15
16
  if (n < 0) {
@@ -1,3 +1,4 @@
1
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
1
2
  export declare let isInitialized: boolean;
2
3
  export declare let isInitializing: boolean;
3
- export declare function initializeVscode(): Promise<void>;
4
+ export declare function initializeVscode(caller?: string): Promise<void>;
@@ -1,18 +1,30 @@
1
- import { initServices } from 'monaco-languageclient';
2
- import { LogLevel } from 'vscode/services';
1
+ import { initServices } from 'monaco-languageclient/vscode/services';
2
+ // import getThemeServiceOverride from '@codingame/monaco-vscode-theme-service-override'
3
+ // import getTextmateServiceOverride from '@codingame/monaco-vscode-textmate-service-override'
4
+ import getMonarchServiceOverride from '@codingame/monaco-vscode-monarch-service-override';
5
+ import '@codingame/monaco-vscode-standalone-typescript-language-features';
3
6
  import { editor as meditor } from 'monaco-editor/esm/vs/editor/editor.api';
7
+ import { is } from 'date-fns/locale';
4
8
  export let isInitialized = false;
5
9
  export let isInitializing = false;
6
- export async function initializeVscode() {
7
- if (!isInitialized) {
10
+ export async function initializeVscode(caller) {
11
+ if (!isInitialized && !isInitializing) {
12
+ console.log(`Initializing vscode-api from ${caller ?? 'unknown'}`);
8
13
  isInitializing = true;
9
- isInitialized = true;
10
14
  try {
11
15
  // init vscode-api
12
16
  await initServices({
13
- debugLogging: true,
14
- logLevel: LogLevel.Info
17
+ serviceConfig: {
18
+ userServices: {
19
+ // ...getThemeServiceOverride(),
20
+ // ...getTextmateServiceOverride()
21
+ ...getMonarchServiceOverride()
22
+ },
23
+ debugLogging: true,
24
+ enableExtHostWorker: true
25
+ }
15
26
  });
27
+ isInitialized = true;
16
28
  meditor.defineTheme('nord', {
17
29
  base: 'vs-dark',
18
30
  inherit: true,
@@ -123,13 +135,15 @@ export async function initializeVscode() {
123
135
  }
124
136
  }
125
137
  catch (e) {
138
+ console.error('Failed to initialize monaco services', e);
126
139
  }
127
140
  finally {
141
+ isInitialized = true;
128
142
  isInitializing = false;
129
143
  }
130
144
  }
131
145
  else {
132
- while (isInitializing) {
146
+ while (isInitializing && !isInitialized) {
133
147
  console.log('Waiting for initialization of monaco services');
134
148
  await new Promise((resolve) => setTimeout(resolve, 100));
135
149
  }
@@ -1,3 +1,4 @@
1
+ import { ShowLightbulbIconMode } from 'vscode/vscode/vs/editor/common/config/editorOptions';
1
2
  export declare function editorConfig(code: string, lang: string, automaticLayout: boolean, fixedOverflowWidgets: boolean): {
2
3
  value: string;
3
4
  language: string;
@@ -15,7 +16,7 @@ export declare function editorConfig(code: string, lang: string, automaticLayout
15
16
  enabled: boolean;
16
17
  };
17
18
  lightbulb: {
18
- enabled: boolean;
19
+ enabled: ShowLightbulbIconMode;
19
20
  };
20
21
  suggest: {
21
22
  showKeywords: boolean;
@@ -23,6 +24,10 @@ export declare function editorConfig(code: string, lang: string, automaticLayout
23
24
  bracketPairColorization: {
24
25
  enabled: boolean;
25
26
  };
27
+ 'workbench.colorTheme': string;
28
+ workbench: {
29
+ colorTheme: string;
30
+ };
26
31
  'bracketPairColorization.enabled': boolean;
27
32
  matchBrackets: "always";
28
33
  };
@@ -1,4 +1,5 @@
1
1
  import { languages } from 'monaco-editor/esm/vs/editor/editor.api';
2
+ import { ShowLightbulbIconMode } from 'vscode/vscode/vs/editor/common/config/editorOptions';
2
3
  export function editorConfig(code, lang, automaticLayout, fixedOverflowWidgets) {
3
4
  return {
4
5
  value: code,
@@ -16,7 +17,7 @@ export function editorConfig(code, lang, automaticLayout, fixedOverflowWidgets)
16
17
  enabled: false
17
18
  },
18
19
  lightbulb: {
19
- enabled: true
20
+ enabled: ShowLightbulbIconMode.On
20
21
  },
21
22
  suggest: {
22
23
  showKeywords: true
@@ -24,6 +25,10 @@ export function editorConfig(code, lang, automaticLayout, fixedOverflowWidgets)
24
25
  bracketPairColorization: {
25
26
  enabled: true
26
27
  },
28
+ 'workbench.colorTheme': 'Default Dark Modern',
29
+ workbench: {
30
+ colorTheme: 'Default Dark Modern'
31
+ },
27
32
  'bracketPairColorization.enabled': true,
28
33
  matchBrackets: 'always'
29
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.382.7",
3
+ "version": "1.383.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",
@@ -17,6 +17,7 @@
17
17
  "filter-classes": "node filterTailwindClasses.js"
18
18
  },
19
19
  "devDependencies": {
20
+ "@windmill-labs/esbuild-import-meta-url-plugin": "0.0.0-semantic-release",
20
21
  "@floating-ui/core": "^1.3.1",
21
22
  "@hey-api/openapi-ts": "^0.43.0",
22
23
  "@playwright/test": "^1.34.3",
@@ -72,25 +73,22 @@
72
73
  "@rgossiaux/svelte-headlessui": {
73
74
  "svelte": "$svelte"
74
75
  },
75
- "ag-grid-svelte": {
76
- "svelte": "$svelte"
77
- },
78
76
  "svelte-chartjs": {
79
77
  "svelte": "$svelte"
80
- },
81
- "svelte-timezone-picker": {
82
- "svelte": "$svelte"
83
- },
84
- "monaco-editor": "$monaco-editor",
85
- "vscode": "$vscode"
86
- },
87
- "resolutions": {
88
- "monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.5 <1.84.0",
89
- "vscode": "npm:@codingame/monaco-vscode-api@>=1.83.5 <1.84.0"
78
+ }
90
79
  },
91
80
  "type": "module",
92
81
  "dependencies": {
93
82
  "@aws-crypto/sha256-js": "^4.0.0",
83
+ "@codingame/monaco-vscode-configuration-service-override": "~8.0.2",
84
+ "@codingame/monaco-vscode-files-service-override": "~8.0.2",
85
+ "@codingame/monaco-vscode-keybindings-service-override": "~8.0.2",
86
+ "@codingame/monaco-vscode-lifecycle-service-override": "~8.0.2",
87
+ "@codingame/monaco-vscode-localization-service-override": "~8.0.2",
88
+ "@codingame/monaco-vscode-standalone-json-language-features": "~8.0.2",
89
+ "@codingame/monaco-vscode-standalone-languages": "~8.0.2",
90
+ "@codingame/monaco-vscode-standalone-css-language-features": "~8.0.2",
91
+ "@codingame/monaco-vscode-standalone-typescript-language-features": "~8.0.2",
94
92
  "@json2csv/plainjs": "^7.0.6",
95
93
  "@leeoniya/ufuzzy": "^1.0.8",
96
94
  "@popperjs/core": "^2.11.6",
@@ -117,9 +115,10 @@
117
115
  "highlight.js": "^11.8.0",
118
116
  "lucide-svelte": "^0.293.0",
119
117
  "minimatch": "^10.0.1",
120
- "monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.5 <1.84.0",
121
- "monaco-graphql": "^1.5.1",
122
- "monaco-languageclient": "~7.0.1",
118
+ "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~8.0.2",
119
+ "monaco-editor-wrapper": "^5.5.2",
120
+ "monaco-graphql": "^1.6.0",
121
+ "monaco-languageclient": "~8.8.2",
123
122
  "ol": "^7.4.0",
124
123
  "openai": "^4.47.1",
125
124
  "p-limit": "^6.1.0",
@@ -132,10 +131,10 @@
132
131
  "svelte-infinite-loading": "^1.3.8",
133
132
  "svelte-tiny-virtual-list": "^2.0.5",
134
133
  "tailwind-merge": "^1.13.2",
135
- "vscode": "npm:@codingame/monaco-vscode-api@>=1.83.5 <1.84.0",
134
+ "vscode": "npm:@codingame/monaco-vscode-api@~8.0.2",
136
135
  "vscode-languageclient": "~9.0.1",
137
136
  "vscode-uri": "~3.0.8",
138
- "vscode-ws-jsonrpc": "~3.1.0",
137
+ "vscode-ws-jsonrpc": "~3.3.2",
139
138
  "windmill-parser-wasm": "^1.367.2",
140
139
  "windmill-sql-datatype-parser-wasm": "^1.318.0",
141
140
  "y-monaco": "^0.1.4",