windmill-components 1.493.8 → 1.493.10
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/FlowBuilder.svelte +13 -10
- package/package/components/FlowBuilder.svelte.d.ts +17 -9
- package/package/components/ScriptBuilder.svelte +8 -8
- package/package/components/ScriptBuilder.svelte.d.ts +12 -6
- package/package/components/apps/editor/AppEditor.svelte +4 -4
- package/package/components/apps/editor/AppEditor.svelte.d.ts +4 -2
- package/package.json +8 -1
|
@@ -17,7 +17,6 @@ import FlowImportExportMenu from './flows/header/FlowImportExportMenu.svelte';
|
|
|
17
17
|
import FlowPreviewButtons from './flows/header/FlowPreviewButtons.svelte';
|
|
18
18
|
import { cleanInputs, emptyFlowModuleState } from './flows/utils';
|
|
19
19
|
import { Calendar, Pen, Save, DiffIcon, HistoryIcon, FileJson } from 'lucide-svelte';
|
|
20
|
-
import { createEventDispatcher } from 'svelte';
|
|
21
20
|
import Awareness from './Awareness.svelte';
|
|
22
21
|
import { getAllModules } from './flows/flowExplorer';
|
|
23
22
|
import { stepCopilot, glueCopilot } from './copilot/flow';
|
|
@@ -56,6 +55,7 @@ export let version = undefined;
|
|
|
56
55
|
export let setSavedraftCb = undefined;
|
|
57
56
|
export let draftTriggersFromUrl = undefined;
|
|
58
57
|
export let selectedTriggerIndexFromUrl = undefined;
|
|
58
|
+
export let onevent = {};
|
|
59
59
|
let initialPathStore = writable(initialPath);
|
|
60
60
|
$: initialPathStore.set(initialPath);
|
|
61
61
|
// used for new flows for captures
|
|
@@ -111,7 +111,6 @@ async function compareVersions() {
|
|
|
111
111
|
onLatest = true;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
const dispatch = createEventDispatcher();
|
|
115
114
|
const primaryScheduleStore = writable(savedPrimarySchedule); // kept for legacy reasons
|
|
116
115
|
const triggersCount = writable(undefined);
|
|
117
116
|
const simplifiedPoll = writable(false);
|
|
@@ -227,20 +226,20 @@ export async function saveDraft(forceSave = false) {
|
|
|
227
226
|
};
|
|
228
227
|
let savedAtNewPath = false;
|
|
229
228
|
if (newFlow) {
|
|
230
|
-
|
|
229
|
+
onevent.saveInitial?.($pathStore);
|
|
231
230
|
}
|
|
232
231
|
else if (savedFlow?.draft_only && $pathStore !== initialPath) {
|
|
233
232
|
savedAtNewPath = true;
|
|
234
233
|
initialPath = $pathStore;
|
|
235
234
|
// this is so we can use the flow builder outside of sveltekit
|
|
236
|
-
|
|
235
|
+
onevent.saveDraftOnlyAtNewPath?.({ path: $pathStore, selectedId: getSelectedId() });
|
|
237
236
|
}
|
|
238
|
-
|
|
237
|
+
onevent.saveDraft?.({ path: $pathStore, savedAtNewPath, newFlow });
|
|
239
238
|
sendUserToast('Saved as draft');
|
|
240
239
|
}
|
|
241
240
|
catch (error) {
|
|
242
241
|
sendUserToast(`Error while saving the flow as a draft: ${error.body || error.message}`, true);
|
|
243
|
-
|
|
242
|
+
onevent.saveDraftError?.(error);
|
|
244
243
|
}
|
|
245
244
|
loadingDraft = false;
|
|
246
245
|
}
|
|
@@ -380,10 +379,10 @@ async function saveFlow(deploymentMsg, triggersToDeploy) {
|
|
|
380
379
|
};
|
|
381
380
|
setDraftTriggers([]);
|
|
382
381
|
loadingSave = false;
|
|
383
|
-
|
|
382
|
+
onevent.deploy?.($pathStore);
|
|
384
383
|
}
|
|
385
384
|
catch (err) {
|
|
386
|
-
|
|
385
|
+
onevent.deployError?.(err);
|
|
387
386
|
sendUserToast(`The flow could not be saved: ${err.body}`, true);
|
|
388
387
|
loadingSave = false;
|
|
389
388
|
}
|
|
@@ -540,7 +539,7 @@ if (customUi.topBar?.extraDeployOptions != false) {
|
|
|
540
539
|
if (savedFlow?.draft_only === false || savedFlow?.draft_only === undefined) {
|
|
541
540
|
dropdownItems.push({
|
|
542
541
|
label: 'Exit & see details',
|
|
543
|
-
onClick: () =>
|
|
542
|
+
onClick: () => onevent.seeDetails?.($pathStore)
|
|
544
543
|
});
|
|
545
544
|
}
|
|
546
545
|
if (!newFlow) {
|
|
@@ -1034,7 +1033,11 @@ let flowPreviewButtons;
|
|
|
1034
1033
|
{#if !$userStore?.operator}
|
|
1035
1034
|
<FlowCopilotDrawer {getHubCompletions} {genFlow} bind:flowCopilotMode />
|
|
1036
1035
|
{#if $pathStore}
|
|
1037
|
-
<FlowHistory
|
|
1036
|
+
<FlowHistory
|
|
1037
|
+
bind:this={flowHistory}
|
|
1038
|
+
path={$pathStore}
|
|
1039
|
+
on:historyRestore={() => onevent.historyRestore?.()}
|
|
1040
|
+
/>
|
|
1038
1041
|
{/if}
|
|
1039
1042
|
<FlowYamlEditor bind:drawer={yamlEditorDrawer} />
|
|
1040
1043
|
<FlowImportExportMenu bind:drawer={jsonViewerDrawer} />
|
|
@@ -43,6 +43,23 @@ declare const FlowBuilder: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Pro
|
|
|
43
43
|
setSavedraftCb?: ((cb: () => void) => void) | undefined;
|
|
44
44
|
draftTriggersFromUrl?: Trigger[] | undefined;
|
|
45
45
|
selectedTriggerIndexFromUrl?: number | undefined;
|
|
46
|
+
onevent?: {
|
|
47
|
+
deploy?: (path: string) => void;
|
|
48
|
+
deployError?: (error: Error) => void;
|
|
49
|
+
saveInitial?: (path: string) => void;
|
|
50
|
+
saveDraft?: ({ path, savedAtNewPath, newFlow }: {
|
|
51
|
+
path: string;
|
|
52
|
+
savedAtNewPath: boolean;
|
|
53
|
+
newFlow: boolean;
|
|
54
|
+
}) => void;
|
|
55
|
+
saveDraftError?: (error: Error) => void;
|
|
56
|
+
saveDraftOnlyAtNewPath?: ({ path, selectedId }: {
|
|
57
|
+
path: string;
|
|
58
|
+
selectedId: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
seeDetails?: (path: string) => void;
|
|
61
|
+
historyRestore?: () => void;
|
|
62
|
+
};
|
|
46
63
|
getInitialAndModifiedValues?: () => SavedAndModifiedValue;
|
|
47
64
|
setPrimarySchedule?: (schedule: ScheduleTrigger | undefined | false) => void;
|
|
48
65
|
setDraftTriggers?: (triggers: Trigger[] | undefined) => void;
|
|
@@ -57,15 +74,6 @@ declare const FlowBuilder: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Pro
|
|
|
57
74
|
}, {
|
|
58
75
|
default: {};
|
|
59
76
|
}>, {
|
|
60
|
-
historyRestore: CustomEvent<any>;
|
|
61
|
-
saveInitial: CustomEvent<any>;
|
|
62
|
-
saveDraftOnlyAtNewPath: CustomEvent<any>;
|
|
63
|
-
saveDraft: CustomEvent<any>;
|
|
64
|
-
saveDraftError: CustomEvent<any>;
|
|
65
|
-
deploy: CustomEvent<any>;
|
|
66
|
-
deployError: CustomEvent<any>;
|
|
67
|
-
details: CustomEvent<any>;
|
|
68
|
-
} & {
|
|
69
77
|
[evt: string]: CustomEvent<any>;
|
|
70
78
|
}, {
|
|
71
79
|
default: {};
|
|
@@ -27,7 +27,7 @@ import MetadataGen from './copilot/MetadataGen.svelte';
|
|
|
27
27
|
import { writable } from 'svelte/store';
|
|
28
28
|
import { defaultScriptLanguages, processLangs } from '../scripts';
|
|
29
29
|
import DefaultScripts from './DefaultScripts.svelte';
|
|
30
|
-
import {
|
|
30
|
+
import { onMount, setContext } from 'svelte';
|
|
31
31
|
import Summary from './Summary.svelte';
|
|
32
32
|
import DeployOverrideConfirmationModal from './common/confirmationModal/DeployOverrideConfirmationModal.svelte';
|
|
33
33
|
import TriggersEditor from './triggers/TriggersEditor.svelte';
|
|
@@ -53,6 +53,7 @@ export let replaceStateFn = (url) => window.history.replaceState(null, '', url);
|
|
|
53
53
|
export let customUi = {};
|
|
54
54
|
export let savedPrimarySchedule = undefined;
|
|
55
55
|
export let functionExports = undefined;
|
|
56
|
+
export let onevent = {};
|
|
56
57
|
export function getInitialAndModifiedValues() {
|
|
57
58
|
return {
|
|
58
59
|
savedValue: savedScript,
|
|
@@ -109,7 +110,6 @@ export function setDraftTriggers(triggers) {
|
|
|
109
110
|
]);
|
|
110
111
|
loadTriggers();
|
|
111
112
|
}
|
|
112
|
-
const dispatch = createEventDispatcher();
|
|
113
113
|
$: initialPath != '' && loadTriggers();
|
|
114
114
|
onMount(() => {
|
|
115
115
|
if (functionExports) {
|
|
@@ -414,11 +414,11 @@ async function editScript(stay, parentHash, deploymentMsg, triggersToDeploy) {
|
|
|
414
414
|
sendUserToast('Deployed');
|
|
415
415
|
}
|
|
416
416
|
else {
|
|
417
|
-
|
|
417
|
+
onevent.deploy?.(newHash);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
catch (error) {
|
|
421
|
-
|
|
421
|
+
onevent.deployError?.(error);
|
|
422
422
|
sendUserToast(`Error while saving the script: ${error.body || error.message}`, true);
|
|
423
423
|
}
|
|
424
424
|
loadingSave = false;
|
|
@@ -542,14 +542,14 @@ async function saveDraft(forceSave = false) {
|
|
|
542
542
|
if (initialPath == '' || (savedScript?.draft_only && script.path !== initialPath)) {
|
|
543
543
|
savedAtNewPath = true;
|
|
544
544
|
initialPath = script.path;
|
|
545
|
-
|
|
545
|
+
onevent.saveInitial?.(script.path);
|
|
546
546
|
}
|
|
547
|
-
|
|
547
|
+
onevent.saveDraft?.({ path: script.path, savedAtNewPath, script });
|
|
548
548
|
sendUserToast('Saved as draft');
|
|
549
549
|
}
|
|
550
550
|
catch (error) {
|
|
551
551
|
sendUserToast(`Error while saving the script as a draft: ${error.body || error.message}`, true);
|
|
552
|
-
|
|
552
|
+
onevent.saveDraftError?.(error);
|
|
553
553
|
}
|
|
554
554
|
loadingDraft = false;
|
|
555
555
|
}
|
|
@@ -597,7 +597,7 @@ function computeDropdownItems(initialPath, savedScript, diffDrawer) {
|
|
|
597
597
|
{
|
|
598
598
|
label: 'Exit & See details',
|
|
599
599
|
onClick: () => {
|
|
600
|
-
|
|
600
|
+
onevent.seeDetails?.(initialPath);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
]
|
|
@@ -42,6 +42,18 @@ declare const ScriptBuilder: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_P
|
|
|
42
42
|
customUi?: ScriptBuilderWhitelabelCustomUi;
|
|
43
43
|
savedPrimarySchedule?: ScheduleTrigger | undefined;
|
|
44
44
|
functionExports?: ((exports: ScriptBuilderFunctionExports) => void) | undefined;
|
|
45
|
+
onevent?: {
|
|
46
|
+
deploy?: (newHash: string) => void;
|
|
47
|
+
deployError?: (error: Error) => void;
|
|
48
|
+
saveInitial?: (path: string) => void;
|
|
49
|
+
saveDraft?: ({ path, savedAtNewPath, script }: {
|
|
50
|
+
path: string;
|
|
51
|
+
savedAtNewPath: boolean;
|
|
52
|
+
script: NewScript;
|
|
53
|
+
}) => void;
|
|
54
|
+
saveDraftError?: (error: Error) => void;
|
|
55
|
+
seeDetails?: (path: string) => void;
|
|
56
|
+
};
|
|
45
57
|
getInitialAndModifiedValues?: () => SavedAndModifiedValue;
|
|
46
58
|
setPrimarySchedule?: (schedule: ScheduleTrigger | undefined | false) => void;
|
|
47
59
|
setDraftTriggers?: (triggers: Trigger[] | undefined) => void;
|
|
@@ -50,12 +62,6 @@ declare const ScriptBuilder: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_P
|
|
|
50
62
|
default: {};
|
|
51
63
|
}>, {
|
|
52
64
|
focus: FocusEvent;
|
|
53
|
-
deploy: CustomEvent<any>;
|
|
54
|
-
deployError: CustomEvent<any>;
|
|
55
|
-
saveInitial: CustomEvent<any>;
|
|
56
|
-
saveDraft: CustomEvent<any>;
|
|
57
|
-
saveDraftError: CustomEvent<any>;
|
|
58
|
-
seeDetails: CustomEvent<any>;
|
|
59
65
|
} & {
|
|
60
66
|
[evt: string]: CustomEvent<any>;
|
|
61
67
|
}, {
|
|
@@ -44,6 +44,7 @@ export let newApp = false;
|
|
|
44
44
|
export let newPath = undefined;
|
|
45
45
|
export let replaceStateFn = (path) => window.history.replaceState(null, '', path);
|
|
46
46
|
export let gotoFn = (path, opt) => window.history.pushState(null, '', path);
|
|
47
|
+
export let onevent = {};
|
|
47
48
|
migrateApp(app);
|
|
48
49
|
const appStore = writable(app);
|
|
49
50
|
const selectedComponent = writable(undefined);
|
|
@@ -622,8 +623,7 @@ $: $panzoomActive =
|
|
|
622
623
|
$: forceDeactivatePanzoom = isModifierKeyPressed && handMode;
|
|
623
624
|
</script>
|
|
624
625
|
|
|
625
|
-
<svelte:head>
|
|
626
|
-
</svelte:head>
|
|
626
|
+
<svelte:head></svelte:head>
|
|
627
627
|
|
|
628
628
|
<DarkModeObserver on:change={onThemeChange} />
|
|
629
629
|
|
|
@@ -643,7 +643,7 @@ $: forceDeactivatePanzoom = isModifierKeyPressed && handMode;
|
|
|
643
643
|
<AppEditorHeader
|
|
644
644
|
{newPath}
|
|
645
645
|
{newApp}
|
|
646
|
-
on:restore
|
|
646
|
+
on:restore={(e) => onevent.restore?.(e.detail)}
|
|
647
647
|
{policy}
|
|
648
648
|
{fromHub}
|
|
649
649
|
bind:this={appEditorHeader}
|
|
@@ -653,7 +653,7 @@ $: forceDeactivatePanzoom = isModifierKeyPressed && handMode;
|
|
|
653
653
|
leftPanelHidden={leftPanelSize === 0}
|
|
654
654
|
rightPanelHidden={rightPanelSize === 0}
|
|
655
655
|
bottomPanelHidden={runnablePanelSize === 0}
|
|
656
|
-
on:savedNewAppPath
|
|
656
|
+
on:savedNewAppPath={(e) => onevent.savedNewAppPath?.(e.detail)}
|
|
657
657
|
on:showLeftPanel={() => showLeftPanel()}
|
|
658
658
|
on:showRightPanel={() => showRightPanel()}
|
|
659
659
|
on:hideLeftPanel={() => hideLeftPanel()}
|
|
@@ -36,10 +36,12 @@ declare const AppEditor: $$__sveltets_2_IsomorphicComponent<{
|
|
|
36
36
|
newPath?: string | undefined;
|
|
37
37
|
replaceStateFn?: (path: string) => void;
|
|
38
38
|
gotoFn?: (path: string, opt?: Record<string, any> | undefined) => void;
|
|
39
|
+
onevent?: {
|
|
40
|
+
savedNewAppPath?: (path: string) => void;
|
|
41
|
+
restore?: (app: App) => void;
|
|
42
|
+
};
|
|
39
43
|
triggerTutorial?: () => void;
|
|
40
44
|
}, {
|
|
41
|
-
restore: CustomEvent<any>;
|
|
42
|
-
savedNewAppPath: CustomEvent<any>;
|
|
43
45
|
pointerdown: PointerEvent;
|
|
44
46
|
} & {
|
|
45
47
|
[evt: string]: CustomEvent<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windmill-components",
|
|
3
|
-
"version": "1.493.
|
|
3
|
+
"version": "1.493.10",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build",
|
|
@@ -374,6 +374,10 @@
|
|
|
374
374
|
"./tailwindUtils": {
|
|
375
375
|
"types": "./package/components/apps/editor/componentsPanel/tailwindUtils.d.ts",
|
|
376
376
|
"default": "./package/components/apps/editor/componentsPanel/tailwindUtils.js"
|
|
377
|
+
},
|
|
378
|
+
"./components/custom_ui": {
|
|
379
|
+
"types": "./package/components/custom_ui.d.ts",
|
|
380
|
+
"default": "./package/components/custom_ui.js"
|
|
377
381
|
}
|
|
378
382
|
},
|
|
379
383
|
"files": [
|
|
@@ -513,6 +517,9 @@
|
|
|
513
517
|
],
|
|
514
518
|
"tailwindUtils": [
|
|
515
519
|
"./package/components/apps/editor/componentsPanel/tailwindUtils.d.ts"
|
|
520
|
+
],
|
|
521
|
+
"components/custom_ui": [
|
|
522
|
+
"./package/components/custom_ui.d.ts"
|
|
516
523
|
]
|
|
517
524
|
}
|
|
518
525
|
},
|