windmill-components 1.56.1 → 1.56.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.
- package/assets/app.css +54 -0
- package/components/CenteredModal.svelte +3 -2
- package/components/Editor.svelte +29 -29
- package/components/Editor.svelte.d.ts +3 -3
- package/components/FlowPreviewContent.svelte +1 -1
- package/components/InputTransformForm.svelte +2 -1
- package/components/SimpleEditor.svelte +18 -20
- package/components/TemplateEditor.svelte +21 -25
- package/components/TemplateEditor.svelte.d.ts +1 -25
- package/components/apps/components/buttons/AppButton.svelte +10 -5
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +17 -15
- package/components/apps/utils.js +1 -1
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +6 -2
- package/components/common/drawer/Drawer.svelte +6 -3
- package/components/common/menu/Menu.svelte +14 -1
- package/components/common/table/LanguageBadge.svelte.d.ts +6 -13
- package/components/sidebar/MenuLink.svelte +4 -4
- package/components/sidebar/MenuLink.svelte.d.ts +1 -1
- package/package.json +489 -488
- package/stores.js +1 -1
package/assets/app.css
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Write your global styles here, in PostCSS syntax */
|
|
2
|
+
@tailwind base;
|
|
3
|
+
@tailwind components;
|
|
4
|
+
@tailwind utilities;
|
|
5
|
+
|
|
6
|
+
@layer base {
|
|
7
|
+
@font-face {
|
|
8
|
+
font-family: 'Inter';
|
|
9
|
+
src: url('/Inter-Variable.ttf');
|
|
10
|
+
font-weight: 100 900;
|
|
11
|
+
font-display: swap;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.splitpanes--vertical > .splitpanes__pane {
|
|
15
|
+
transition: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.splitpanes--horizontal > .splitpanes__pane {
|
|
19
|
+
transition: none !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.monaco-workbench > .notifications-toasts.visible {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.nowrap pre code.hljs {
|
|
27
|
+
whitespace: normal !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
svelte-virtual-list-row {
|
|
31
|
+
overflow: visible !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
svelte-virtual-list-contents > * + * {
|
|
35
|
+
border-top-width: 1px !important;
|
|
36
|
+
border-bottom-width: 0px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.monaco-editor textarea:focus {
|
|
40
|
+
box-shadow: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.templatable-editor span.mtk20 {
|
|
44
|
+
color: black !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@layer components {
|
|
49
|
+
/* Flow graph viewer -> Svelvet library internal class overwrite */
|
|
50
|
+
.Node {
|
|
51
|
+
display: flex !important;
|
|
52
|
+
cursor: pointer !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script>import { SettingsService } from '../gen';
|
|
2
|
+
import { onMount } from 'svelte';
|
|
2
3
|
import WindmillIcon from './icons/WindmillIcon.svelte';
|
|
3
4
|
export let subtitle = undefined;
|
|
4
5
|
export let title = 'Windmill';
|
|
5
6
|
let version = '';
|
|
6
|
-
|
|
7
|
-
version =
|
|
7
|
+
onMount(async () => {
|
|
8
|
+
version = await SettingsService.backendVersion();
|
|
8
9
|
});
|
|
9
10
|
</script>
|
|
10
11
|
|
package/components/Editor.svelte
CHANGED
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
<script context="module">import
|
|
2
|
-
|
|
3
|
-
target: monaco.languages.typescript.ScriptTarget.Latest,
|
|
4
|
-
allowNonTsExtensions: true,
|
|
5
|
-
noLib: true
|
|
6
|
-
});
|
|
7
|
-
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
8
|
-
noSemanticValidation: true,
|
|
9
|
-
noSuggestionDiagnostics: true,
|
|
10
|
-
noSyntaxValidation: true
|
|
11
|
-
});
|
|
12
|
-
monaco.editor.defineTheme('myTheme', {
|
|
13
|
-
base: 'vs',
|
|
14
|
-
inherit: true,
|
|
15
|
-
rules: [],
|
|
16
|
-
colors: {
|
|
17
|
-
'editorLineNumber.foreground': '#999',
|
|
18
|
-
'editorGutter.background': '#F9FAFB'
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
monaco.editor.setTheme('myTheme');
|
|
1
|
+
<script context="module">import getMessageServiceOverride from 'vscode/service-override/messages';
|
|
2
|
+
import { StandaloneServices } from 'vscode/services';
|
|
22
3
|
try {
|
|
23
|
-
StandaloneServices
|
|
4
|
+
StandaloneServices?.initialize({
|
|
24
5
|
...getMessageServiceOverride(document.body)
|
|
25
6
|
});
|
|
26
7
|
}
|
|
@@ -29,18 +10,37 @@ catch (e) {
|
|
|
29
10
|
}
|
|
30
11
|
</script>
|
|
31
12
|
|
|
32
|
-
<script>import { browser, dev } from '$app/
|
|
13
|
+
<script>import { browser, dev } from '$app/environment';
|
|
33
14
|
import { page } from '$app/stores';
|
|
34
15
|
import { sendUserToast } from '../utils';
|
|
35
16
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
36
17
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
37
18
|
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
38
|
-
import getMessageServiceOverride from 'vscode/service-override/messages';
|
|
39
19
|
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
20
|
+
import { languages, editor as meditor, KeyCode, KeyMod, Uri as mUri } from 'monaco-editor';
|
|
21
|
+
languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
22
|
+
target: languages.typescript.ScriptTarget.Latest,
|
|
23
|
+
allowNonTsExtensions: true,
|
|
24
|
+
noLib: true
|
|
25
|
+
});
|
|
26
|
+
languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
27
|
+
noSemanticValidation: true,
|
|
28
|
+
noSuggestionDiagnostics: true,
|
|
29
|
+
noSyntaxValidation: true
|
|
30
|
+
});
|
|
31
|
+
meditor.defineTheme('myTheme', {
|
|
32
|
+
base: 'vs',
|
|
33
|
+
inherit: true,
|
|
34
|
+
rules: [],
|
|
35
|
+
colors: {
|
|
36
|
+
'editorLineNumber.foreground': '#999',
|
|
37
|
+
'editorGutter.background': '#F9FAFB'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
meditor.setTheme('myTheme');
|
|
40
41
|
import { BASH_INIT_CODE, DENO_INIT_CODE_CLEAR, GO_INIT_CODE, PYTHON_INIT_CODE_CLEAR } from '../script_helpers';
|
|
41
42
|
import { createHash as randomHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
|
|
42
43
|
import { dirtyStore } from './common/confirmationModal/dirtyStore';
|
|
43
|
-
import { StandaloneServices } from 'vscode/services';
|
|
44
44
|
let divEl = null;
|
|
45
45
|
let editor;
|
|
46
46
|
export let lang;
|
|
@@ -352,9 +352,9 @@ async function closeWebsockets() {
|
|
|
352
352
|
websocketInterval && clearInterval(websocketInterval);
|
|
353
353
|
}
|
|
354
354
|
async function loadMonaco() {
|
|
355
|
-
const model =
|
|
355
|
+
const model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
356
356
|
model.updateOptions(updateOptions);
|
|
357
|
-
editor =
|
|
357
|
+
editor = meditor.create(divEl, editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets));
|
|
358
358
|
let timeoutModel = undefined;
|
|
359
359
|
editor.onDidChangeModelContent((event) => {
|
|
360
360
|
$dirtyStore = true;
|
|
@@ -366,11 +366,11 @@ async function loadMonaco() {
|
|
|
366
366
|
});
|
|
367
367
|
editor.onDidFocusEditorText(() => {
|
|
368
368
|
dispatch('focus');
|
|
369
|
-
editor.addCommand(
|
|
369
|
+
editor.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, function () {
|
|
370
370
|
code = getCode();
|
|
371
371
|
shouldBindKey && format && format();
|
|
372
372
|
});
|
|
373
|
-
editor.addCommand(
|
|
373
|
+
editor.addCommand(KeyMod.CtrlCmd | KeyCode.Enter, function () {
|
|
374
374
|
code = getCode();
|
|
375
375
|
shouldBindKey && cmdEnterAction && cmdEnterAction();
|
|
376
376
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import
|
|
2
|
+
import { editor as meditor } from 'monaco-editor';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
@@ -24,7 +24,7 @@ declare const __propDef: {
|
|
|
24
24
|
setCode?: ((ncode: string) => void) | undefined;
|
|
25
25
|
clearContent?: (() => Promise<void>) | undefined;
|
|
26
26
|
reloadWebsocket?: (() => Promise<void>) | undefined;
|
|
27
|
-
addAction?: ((id: string, label: string, callback: (editor:
|
|
27
|
+
addAction?: ((id: string, label: string, callback: (editor: meditor.IStandaloneCodeEditor) => void, keybindings?: number[]) => void) | undefined;
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
30
30
|
change: CustomEvent<any>;
|
|
@@ -46,6 +46,6 @@ export default class Editor extends SvelteComponentTyped<EditorProps, EditorEven
|
|
|
46
46
|
get setCode(): (ncode: string) => void;
|
|
47
47
|
get clearContent(): () => Promise<void>;
|
|
48
48
|
get reloadWebsocket(): () => Promise<void>;
|
|
49
|
-
get addAction(): (id: string, label: string, callback: (editor:
|
|
49
|
+
get addAction(): (id: string, label: string, callback: (editor: meditor.IStandaloneCodeEditor) => void, keybindings?: number[]) => void;
|
|
50
50
|
}
|
|
51
51
|
export {};
|
|
@@ -16,7 +16,7 @@ export let previewMode;
|
|
|
16
16
|
export let open;
|
|
17
17
|
export let jobId = undefined;
|
|
18
18
|
export let job = undefined;
|
|
19
|
-
let isValid =
|
|
19
|
+
let isValid = true;
|
|
20
20
|
let isRunning = false;
|
|
21
21
|
let jobProgressReset;
|
|
22
22
|
const { selectedId, previewArgs } = getContext('FlowEditorContext');
|
|
@@ -8,6 +8,7 @@ import { Button, ToggleButton, ToggleButtonGroup } from './common';
|
|
|
8
8
|
import { faCode } from '@fortawesome/free-solid-svg-icons';
|
|
9
9
|
import TemplateEditor from './TemplateEditor.svelte';
|
|
10
10
|
import Tooltip from './Tooltip.svelte';
|
|
11
|
+
import { setInputCat as computeInputCat } from '../utils';
|
|
11
12
|
export let schema;
|
|
12
13
|
export let arg;
|
|
13
14
|
export let argName;
|
|
@@ -20,7 +21,7 @@ export let itemPicker = undefined;
|
|
|
20
21
|
let monaco = undefined;
|
|
21
22
|
let monacoTemplate = undefined;
|
|
22
23
|
let argInput = undefined;
|
|
23
|
-
let inputCat =
|
|
24
|
+
let inputCat = computeInputCat(schema.properties[argName].type, schema.properties[argName].format, schema.properties[argName].items?.type, schema.properties[argName].enum, schema.properties[argName].contentEncoding);
|
|
24
25
|
let propertyType = getPropertyType(arg);
|
|
25
26
|
function getPropertyType(arg) {
|
|
26
27
|
let type = arg?.type ?? 'static';
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script>import { browser, dev } from '$app/environment';
|
|
2
|
+
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
3
|
+
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
4
|
+
import yamlWorker from 'monaco-yaml/yaml.worker?worker';
|
|
5
|
+
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
6
|
+
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
7
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
8
|
+
import { createHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
|
|
9
|
+
import { languages, editor as meditor, KeyCode, KeyMod, Uri as mUri } from 'monaco-editor';
|
|
2
10
|
import libStdContent from '../es5.d.ts.txt?raw';
|
|
3
|
-
|
|
4
|
-
target:
|
|
11
|
+
languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
12
|
+
target: languages.typescript.ScriptTarget.Latest,
|
|
5
13
|
allowNonTsExtensions: true,
|
|
6
14
|
noLib: true
|
|
7
15
|
});
|
|
8
|
-
|
|
16
|
+
languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
9
17
|
validate: true,
|
|
10
18
|
allowComments: false,
|
|
11
19
|
schemas: [],
|
|
12
20
|
enableSchemaRequest: true
|
|
13
21
|
});
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<script>import { browser, dev } from '$app/env';
|
|
17
|
-
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
18
|
-
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
19
|
-
import yamlWorker from 'monaco-yaml/yaml.worker?worker';
|
|
20
|
-
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
21
|
-
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
22
|
-
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
23
|
-
import { createHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
|
|
24
22
|
let divEl = null;
|
|
25
23
|
let editor;
|
|
26
24
|
let model;
|
|
@@ -86,9 +84,9 @@ function format() {
|
|
|
86
84
|
}
|
|
87
85
|
let width = 0;
|
|
88
86
|
async function loadMonaco() {
|
|
89
|
-
model =
|
|
87
|
+
model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
90
88
|
model.updateOptions(updateOptions);
|
|
91
|
-
editor =
|
|
89
|
+
editor = meditor.create(divEl, editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets));
|
|
92
90
|
let timeoutModel = undefined;
|
|
93
91
|
editor.onDidChangeModelContent((event) => {
|
|
94
92
|
timeoutModel && clearTimeout(timeoutModel);
|
|
@@ -116,11 +114,11 @@ async function loadMonaco() {
|
|
|
116
114
|
updateHeight();
|
|
117
115
|
}
|
|
118
116
|
editor.onDidFocusEditorText(() => {
|
|
119
|
-
editor.addCommand(
|
|
117
|
+
editor.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, function () {
|
|
120
118
|
code = getCode();
|
|
121
119
|
shouldBindKey && format && format();
|
|
122
120
|
});
|
|
123
|
-
editor.addCommand(
|
|
121
|
+
editor.addCommand(KeyMod.CtrlCmd | KeyCode.Enter, function () {
|
|
124
122
|
code = getCode();
|
|
125
123
|
shouldBindKey && cmdEnterAction && cmdEnterAction();
|
|
126
124
|
});
|
|
@@ -133,7 +131,7 @@ async function loadMonaco() {
|
|
|
133
131
|
if (lang == 'javascript') {
|
|
134
132
|
const stdLib = { content: libStdContent, filePath: 'es5.d.ts' };
|
|
135
133
|
if (extraLib != '') {
|
|
136
|
-
|
|
134
|
+
languages.typescript.javascriptDefaults.setExtraLibs([
|
|
137
135
|
{
|
|
138
136
|
content: extraLib,
|
|
139
137
|
filePath: 'windmill.d.ts'
|
|
@@ -142,7 +140,7 @@ async function loadMonaco() {
|
|
|
142
140
|
]);
|
|
143
141
|
}
|
|
144
142
|
else {
|
|
145
|
-
|
|
143
|
+
languages.typescript.javascriptDefaults.setExtraLibs([stdLib]);
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
146
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script>import { browser, dev } from '$app/environment';
|
|
2
|
+
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
3
|
+
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
4
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
5
|
+
import { convertKind, createDocumentationString, createHash, displayPartsToString, editorConfig, updateOptions } from '../editorUtils';
|
|
6
|
+
import { languages, editor as meditor, Uri as mUri, Range } from 'monaco-editor';
|
|
2
7
|
import libStdContent from '../es5.d.ts.txt?raw';
|
|
3
|
-
|
|
4
|
-
target:
|
|
8
|
+
languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
9
|
+
target: languages.typescript.ScriptTarget.Latest,
|
|
5
10
|
allowNonTsExtensions: true,
|
|
6
11
|
noLib: true
|
|
7
12
|
});
|
|
8
|
-
|
|
13
|
+
languages.register({ id: 'template' });
|
|
9
14
|
export const conf = {
|
|
10
15
|
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
11
16
|
comments: {
|
|
@@ -308,19 +313,10 @@ export const language = {
|
|
|
308
313
|
}
|
|
309
314
|
};
|
|
310
315
|
// Register a tokens provider for the language
|
|
311
|
-
|
|
316
|
+
languages.registerTokensProviderFactory('template', {
|
|
312
317
|
create: () => language
|
|
313
318
|
});
|
|
314
|
-
|
|
315
|
-
// monaco.languages.typescript.getTypeScriptWorker()
|
|
316
|
-
// Register a completion item provider for the new language
|
|
317
|
-
</script>
|
|
318
|
-
|
|
319
|
-
<script>import { browser, dev } from '$app/env';
|
|
320
|
-
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
321
|
-
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
322
|
-
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
323
|
-
import { convertKind, createDocumentationString, createHash, displayPartsToString, editorConfig, updateOptions } from '../editorUtils';
|
|
319
|
+
languages.setLanguageConfiguration('template', conf);
|
|
324
320
|
let divEl = null;
|
|
325
321
|
let editor;
|
|
326
322
|
let model;
|
|
@@ -364,9 +360,9 @@ let cip;
|
|
|
364
360
|
let extraModel;
|
|
365
361
|
let width = 0;
|
|
366
362
|
async function loadMonaco() {
|
|
367
|
-
model =
|
|
363
|
+
model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
368
364
|
model.updateOptions(updateOptions);
|
|
369
|
-
editor =
|
|
365
|
+
editor = meditor.create(divEl, {
|
|
370
366
|
...editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets),
|
|
371
367
|
lineNumbers: 'off',
|
|
372
368
|
fontSize: 16,
|
|
@@ -375,7 +371,7 @@ async function loadMonaco() {
|
|
|
375
371
|
});
|
|
376
372
|
const stdLib = { content: libStdContent, filePath: 'es5.d.ts' };
|
|
377
373
|
if (extraLib != '') {
|
|
378
|
-
|
|
374
|
+
languages.typescript.javascriptDefaults.setExtraLibs([
|
|
379
375
|
{
|
|
380
376
|
content: extraLib,
|
|
381
377
|
filePath: 'windmill.d.ts'
|
|
@@ -384,12 +380,12 @@ async function loadMonaco() {
|
|
|
384
380
|
]);
|
|
385
381
|
}
|
|
386
382
|
else {
|
|
387
|
-
|
|
383
|
+
languages.typescript.javascriptDefaults.setExtraLibs([stdLib]);
|
|
388
384
|
}
|
|
389
|
-
extraModel =
|
|
390
|
-
const worker = await
|
|
385
|
+
extraModel = meditor.createModel('`' + model.getValue() + '`', 'javascript');
|
|
386
|
+
const worker = await languages.typescript.getJavaScriptWorker();
|
|
391
387
|
const client = await worker(extraModel.uri);
|
|
392
|
-
cip =
|
|
388
|
+
cip = languages.registerCompletionItemProvider('template', {
|
|
393
389
|
triggerCharacters: ['.'],
|
|
394
390
|
provideCompletionItems: async (model, position) => {
|
|
395
391
|
extraModel.setValue('`' + model.getValue() + '`');
|
|
@@ -399,7 +395,7 @@ async function loadMonaco() {
|
|
|
399
395
|
return { suggestions: [] };
|
|
400
396
|
}
|
|
401
397
|
const wordInfo = model.getWordUntilPosition(position);
|
|
402
|
-
const wordRange = new
|
|
398
|
+
const wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
403
399
|
const suggestions = info.entries
|
|
404
400
|
.filter((x) => x.kind != 'keyword' && x.kind != 'var')
|
|
405
401
|
.map((entry) => {
|
|
@@ -407,11 +403,11 @@ async function loadMonaco() {
|
|
|
407
403
|
if (entry.replacementSpan) {
|
|
408
404
|
const p1 = model.getPositionAt(entry.replacementSpan.start);
|
|
409
405
|
const p2 = model.getPositionAt(entry.replacementSpan.start + entry.replacementSpan.length);
|
|
410
|
-
range = new
|
|
406
|
+
range = new Range(p1.lineNumber, p1.column, p2.lineNumber, p2.column);
|
|
411
407
|
}
|
|
412
408
|
const tags = [];
|
|
413
409
|
if (entry.kindModifiers?.indexOf('deprecated') !== -1) {
|
|
414
|
-
tags.push(
|
|
410
|
+
tags.push(languages.CompletionItemTag.Deprecated);
|
|
415
411
|
}
|
|
416
412
|
return {
|
|
417
413
|
uri: model.uri,
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
wordPattern: RegExp;
|
|
3
|
-
comments: {
|
|
4
|
-
lineComment: string;
|
|
5
|
-
blockComment: [string, string];
|
|
6
|
-
};
|
|
7
|
-
brackets: [string, string][];
|
|
8
|
-
onEnterRules: never[];
|
|
9
|
-
autoClosingPairs: ({
|
|
10
|
-
open: string;
|
|
11
|
-
close: string;
|
|
12
|
-
notIn?: undefined;
|
|
13
|
-
} | {
|
|
14
|
-
open: string;
|
|
15
|
-
close: string;
|
|
16
|
-
notIn: string[];
|
|
17
|
-
})[];
|
|
18
|
-
folding: {
|
|
19
|
-
markers: {
|
|
20
|
-
start: RegExp;
|
|
21
|
-
end: RegExp;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const language: boolean;
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { Button } from '../../../common';
|
|
2
|
-
import { faArrowRight, faRefresh } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { faArrowRight, faRefresh, faSpinner } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
5
5
|
import InputValue from '../helpers/InputValue.svelte';
|
|
@@ -56,12 +56,17 @@ $: loading = isLoading && ownClick;
|
|
|
56
56
|
}}
|
|
57
57
|
{size}
|
|
58
58
|
{color}
|
|
59
|
-
endIcon={
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
endIcon={loading
|
|
60
|
+
? {
|
|
61
|
+
icon: faSpinner,
|
|
62
|
+
classes: 'animate-spin w-4'
|
|
63
|
+
}
|
|
64
|
+
: undefined}
|
|
63
65
|
>
|
|
64
66
|
{labelValue}
|
|
67
|
+
{#if !loading}
|
|
68
|
+
<span class="w-5" />
|
|
69
|
+
{/if}
|
|
65
70
|
</Button>
|
|
66
71
|
</AlignWrapper>
|
|
67
72
|
</RunnableWrapper>
|
|
@@ -6,22 +6,24 @@ export let component;
|
|
|
6
6
|
|
|
7
7
|
{#if component.verticalAlignment !== undefined}
|
|
8
8
|
<PanelSection title="Alignment">
|
|
9
|
-
|
|
9
|
+
{#if component.horizontalAlignment}
|
|
10
|
+
<div class="w-full text-xs font-semibold">Horizontal</div>
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
12
|
+
<div class="w-full">
|
|
13
|
+
<ToggleButtonGroup bind:selected={component.horizontalAlignment}>
|
|
14
|
+
<ToggleButton position="left" value="left" size="xs">
|
|
15
|
+
<AlignStartVertical size={16} />
|
|
16
|
+
</ToggleButton>
|
|
17
|
+
<ToggleButton position="center" value="center" size="xs">
|
|
18
|
+
<AlignCenterVertical size={16} />
|
|
19
|
+
</ToggleButton>
|
|
20
|
+
<ToggleButton position="right" value="right" size="xs">
|
|
21
|
+
<AlignEndVertical size={16} />
|
|
22
|
+
</ToggleButton>
|
|
23
|
+
</ToggleButtonGroup>
|
|
24
|
+
</div>
|
|
25
|
+
{/if}
|
|
26
|
+
{#if component.type !== 'formcomponent' && component.verticalAlignment}
|
|
25
27
|
<div class="w-full text-xs font-semibold">Vertical</div>
|
|
26
28
|
<div class="w-full">
|
|
27
29
|
<ToggleButtonGroup bind:selected={component.verticalAlignment}>
|
package/components/apps/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlowService, ScriptService } from '../../gen';
|
|
2
2
|
import { inferArgs } from '../../infer';
|
|
3
|
-
import { BarChart4, Binary, CircleDot, FormInput, Inspect, List, Monitor, PieChart, Play, Table2, TextCursorInput, Type, Lock, Calendar, ToggleLeft } from 'lucide-svelte';
|
|
3
|
+
import { BarChart4, Binary, CircleDot, FormInput, Inspect, List, Monitor, PieChart, Play, Table2, Image, TextCursorInput, Type, Lock, Calendar, ToggleLeft } from 'lucide-svelte';
|
|
4
4
|
export async function loadSchema(workspace, path, runType) {
|
|
5
5
|
if (runType === 'script') {
|
|
6
6
|
const script = await ScriptService.getScriptByPath({
|
|
@@ -8,8 +8,12 @@ beforeNavigate((newNavigationState) => {
|
|
|
8
8
|
if (!navigationState &&
|
|
9
9
|
$dirtyStore &&
|
|
10
10
|
newNavigationState.to &&
|
|
11
|
-
newNavigationState.to.pathname !== newNavigationState.from.pathname) {
|
|
12
|
-
navigationState =
|
|
11
|
+
newNavigationState.to.url.pathname !== newNavigationState.from?.url.pathname) {
|
|
12
|
+
navigationState = {
|
|
13
|
+
to: newNavigationState.to.url,
|
|
14
|
+
from: newNavigationState.from?.url,
|
|
15
|
+
cancel: newNavigationState.cancel
|
|
16
|
+
};
|
|
13
17
|
newNavigationState.cancel();
|
|
14
18
|
}
|
|
15
19
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { onMount } from 'svelte';
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
|
+
import { browser } from '$app/environment';
|
|
3
4
|
export let open = false;
|
|
4
5
|
export let duration = 0.3;
|
|
5
6
|
export let placement = 'right';
|
|
@@ -25,9 +26,11 @@ let mounted = false;
|
|
|
25
26
|
const dispatch = createEventDispatcher();
|
|
26
27
|
$: style = `--duration: ${duration}s; --size: ${size};`;
|
|
27
28
|
function scrollLock(open) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (browser) {
|
|
30
|
+
const body = document.querySelector('body');
|
|
31
|
+
if (mounted && body) {
|
|
32
|
+
body.style.overflowY = open ? 'hidden' : 'auto';
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
$: scrollLock(open);
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<script context="module">"use strict";
|
|
2
|
+
let current = undefined;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
<script>import { classNames } from '../../../utils';
|
|
2
6
|
import { onMount } from 'svelte';
|
|
3
7
|
export let noMinW = false;
|
|
@@ -37,7 +41,16 @@ const placementsClasses = {
|
|
|
37
41
|
|
|
38
42
|
<div class="relative" bind:this={menu}>
|
|
39
43
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
40
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
on:click|stopPropagation={() => {
|
|
46
|
+
if (!show) {
|
|
47
|
+
current && current()
|
|
48
|
+
current = close
|
|
49
|
+
}
|
|
50
|
+
show = !show
|
|
51
|
+
}}
|
|
52
|
+
class="cursor-pointer hover:bg-gray-100/30"
|
|
53
|
+
>
|
|
41
54
|
<slot class="triggerable" name="trigger" />
|
|
42
55
|
</div>
|
|
43
56
|
{#if show}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} LanguageBadgeProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} LanguageBadgeEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} LanguageBadgeSlots */
|
|
4
|
-
export default class LanguageBadge extends SvelteComponentTyped<{
|
|
5
|
-
language: Script.language;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type LanguageBadgeProps = typeof __propDef.props;
|
|
11
|
-
export type LanguageBadgeEvents = typeof __propDef.events;
|
|
12
|
-
export type LanguageBadgeSlots = typeof __propDef.slots;
|
|
13
|
-
import { Script } from "../../../gen";
|
|
14
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { Script } from '../../../gen';
|
|
15
3
|
declare const __propDef: {
|
|
16
4
|
props: {
|
|
17
5
|
language: Script.language;
|
|
@@ -21,4 +9,9 @@ declare const __propDef: {
|
|
|
21
9
|
};
|
|
22
10
|
slots: {};
|
|
23
11
|
};
|
|
12
|
+
export type LanguageBadgeProps = typeof __propDef.props;
|
|
13
|
+
export type LanguageBadgeEvents = typeof __propDef.events;
|
|
14
|
+
export type LanguageBadgeSlots = typeof __propDef.slots;
|
|
15
|
+
export default class LanguageBadge extends SvelteComponentTyped<LanguageBadgeProps, LanguageBadgeEvents, LanguageBadgeSlots> {
|
|
16
|
+
}
|
|
24
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { classNames } from '../../utils';
|
|
2
|
-
import { navigating } from '$app/stores';
|
|
2
|
+
import { navigating, page } from '$app/stores';
|
|
3
3
|
import Icon from 'svelte-awesome';
|
|
4
4
|
export let label;
|
|
5
5
|
export let href;
|
|
@@ -9,10 +9,10 @@ export let disabled = false;
|
|
|
9
9
|
let isSelected = false;
|
|
10
10
|
navigating.subscribe(() => {
|
|
11
11
|
if (href === '/') {
|
|
12
|
-
isSelected =
|
|
12
|
+
isSelected = $page.url.pathname === href;
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
isSelected =
|
|
15
|
+
isSelected = $page.url.pathname.includes(href);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
</script>
|
|
@@ -41,7 +41,7 @@ navigating.subscribe(() => {
|
|
|
41
41
|
{#if !isCollapsed}
|
|
42
42
|
<span
|
|
43
43
|
class={classNames(
|
|
44
|
-
'whitespace-pre
|
|
44
|
+
'whitespace-pre truncate',
|
|
45
45
|
isSelected ? ' text-gray-700 font-bold' : 'text-white group-hover:text-gray-900'
|
|
46
46
|
)}
|
|
47
47
|
>
|