windmill-components 1.382.3 → 1.383.1
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.
- package/package/components/Dev.svelte +2 -1
- package/package/components/DiffDrawer.svelte +2 -0
- package/package/components/DiffEditor.svelte +12 -12
- package/package/components/DiffEditor.svelte.d.ts +5 -6
- package/package/components/Editor.svelte +78 -63
- package/package/components/Editor.svelte.d.ts +4 -11
- package/package/components/EditorTheme.svelte +2 -2
- package/package/components/FlowViewer.svelte +4 -45
- package/package/components/FlowViewerInner.svelte +109 -0
- package/package/components/FlowViewerInner.svelte.d.ts +22 -0
- package/package/components/ScriptBuilder.svelte +6 -4
- package/package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/package/components/ScriptEditor.svelte +1 -6
- package/package/components/SimpleEditor.svelte +40 -28
- package/package/components/SimpleEditor.svelte.d.ts +5 -8
- package/package/components/TemplateEditor.svelte +6 -4
- package/package/components/TemplateEditor.svelte.d.ts +3 -3
- package/package/components/apps/components/display/AppNavbarItem.svelte +1 -1
- package/package/components/apps/editor/AppEditor.svelte +34 -3
- package/package/components/apps/editor/AppEditorHeader.svelte +17 -7
- package/package/components/apps/editor/AppPreview.svelte +4 -1
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +2 -1
- package/package/components/apps/types.d.ts +1 -0
- package/package/components/build_workers.d.ts +1 -1
- package/package/components/build_workers.js +146 -51
- package/package/components/common/toggleButton-v2/ToggleEnable.svelte +34 -0
- package/package/components/common/toggleButton-v2/ToggleEnable.svelte.d.ts +23 -0
- package/package/components/details/DetailPageDetailPanel.svelte +4 -38
- package/package/components/flows/content/FlowModuleComponent.svelte +2 -1
- package/package/components/flows/content/FlowModuleScript.svelte +1 -0
- package/package/components/flows/idUtils.js +2 -1
- package/package/components/vscode.d.ts +2 -1
- package/package/components/vscode.js +22 -8
- package/package/editorUtils.d.ts +6 -1
- package/package/editorUtils.js +6 -1
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +12 -0
- package/package/gen/schemas.gen.js +12 -0
- package/package/gen/services.gen.d.ts +4 -3
- package/package/gen/services.gen.js +7 -5
- package/package/gen/types.gen.d.ts +16 -8
- package/package.json +18 -19
|
@@ -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(
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
})
|
|
117
|
-
languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
})
|
|
123
|
-
languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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-
|
|
4
|
-
import 'monaco-
|
|
5
|
-
import 'monaco-
|
|
6
|
-
import 'monaco-
|
|
7
|
-
import '
|
|
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-
|
|
9
|
-
import 'monaco-
|
|
10
|
-
import '
|
|
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
|
-
|
|
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-
|
|
3
|
-
import 'monaco-
|
|
4
|
-
import '
|
|
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(
|
|
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 =
|
|
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="
|
|
1169
|
-
icon={
|
|
1170
|
-
value=
|
|
1169
|
+
tooltip="Computer View"
|
|
1170
|
+
icon={Laptop2}
|
|
1171
|
+
value={'lg'}
|
|
1171
1172
|
iconProps={{ size: 16 }}
|
|
1172
1173
|
/>
|
|
1173
1174
|
<ToggleButton
|
|
1174
|
-
tooltip="
|
|
1175
|
-
icon={
|
|
1176
|
-
value=
|
|
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 =
|
|
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');
|
|
@@ -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(
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
|
|
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 {};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
<script>import { Tabs, Tab, TabContent
|
|
2
|
-
import {
|
|
3
|
-
import { CalendarCheck2, Clipboard, MailIcon, Terminal, Webhook } from 'lucide-svelte';
|
|
4
|
-
import { Highlight } from 'svelte-highlight';
|
|
5
|
-
import { yaml } from 'svelte-highlight/languages';
|
|
6
|
-
import json from 'svelte-highlight/languages/json';
|
|
1
|
+
<script>import { Tabs, Tab, TabContent } from '../common';
|
|
2
|
+
import { CalendarCheck2, MailIcon, Terminal, Webhook } from 'lucide-svelte';
|
|
7
3
|
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
8
|
-
import YAML from 'yaml';
|
|
9
4
|
import HighlightTheme from '../HighlightTheme.svelte';
|
|
5
|
+
import FlowViewerInner from '../FlowViewerInner.svelte';
|
|
10
6
|
export let triggerSelected = 'webhooks';
|
|
11
7
|
export let flow_json = undefined;
|
|
12
8
|
export let hasStepDetails = false;
|
|
13
9
|
export let isOperator = false;
|
|
14
10
|
export let selected;
|
|
15
|
-
let rawType = 'yaml';
|
|
16
11
|
$: if (hasStepDetails) {
|
|
17
12
|
selected = 'flow_step';
|
|
18
13
|
}
|
|
@@ -90,36 +85,7 @@ $: !hasStepDetails && selected === 'flow_step' && (selected = 'saved_inputs');
|
|
|
90
85
|
</Splitpanes>
|
|
91
86
|
</TabContent>
|
|
92
87
|
<TabContent value="raw" class="flex flex-col flex-1 h-full overflow-auto">
|
|
93
|
-
<
|
|
94
|
-
<Tab value="yaml">YAML</Tab>
|
|
95
|
-
<Tab value="json">JSON</Tab>
|
|
96
|
-
<svelte:fragment slot="content">
|
|
97
|
-
<div class="relative pt-2">
|
|
98
|
-
<Button
|
|
99
|
-
on:click={() =>
|
|
100
|
-
copyToClipboard(
|
|
101
|
-
rawType === 'yaml'
|
|
102
|
-
? YAML.stringify(flow_json)
|
|
103
|
-
: JSON.stringify(flow_json, null, 4)
|
|
104
|
-
)}
|
|
105
|
-
color="light"
|
|
106
|
-
variant="border"
|
|
107
|
-
size="xs"
|
|
108
|
-
startIcon={{ icon: Clipboard }}
|
|
109
|
-
btnClasses="absolute top-2 right-2 w-min"
|
|
110
|
-
>
|
|
111
|
-
Copy content
|
|
112
|
-
</Button>
|
|
113
|
-
<Highlight
|
|
114
|
-
class="overflow-auto px-1"
|
|
115
|
-
language={rawType === 'yaml' ? yaml : json}
|
|
116
|
-
code={rawType === 'yaml'
|
|
117
|
-
? YAML.stringify(flow_json)
|
|
118
|
-
: JSON.stringify(flow_json, null, 4)}
|
|
119
|
-
/>
|
|
120
|
-
</div>
|
|
121
|
-
</svelte:fragment>
|
|
122
|
-
</Tabs>
|
|
88
|
+
<FlowViewerInner flow={flow_json} />
|
|
123
89
|
</TabContent>
|
|
124
90
|
<TabContent value="flow_step" class="flex flex-col flex-1 h-full">
|
|
125
91
|
<slot name="flow_step" />
|