windmill-components 1.35.42 → 1.35.43
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/components/ArgInput.svelte +19 -19
- package/components/ArgInput.svelte.d.ts +1 -1
- package/components/DisplayResult.svelte +73 -67
- package/components/Editor.svelte +177 -164
- package/components/Editor.svelte.d.ts +4 -2
- package/components/EditorBar.svelte +58 -45
- package/components/EditorBar.svelte.d.ts +2 -1
- package/components/FlowBuilder.svelte +113 -121
- package/components/FlowJobResult.svelte +4 -5
- package/components/FlowModulesViewer.svelte +89 -7
- package/components/FlowModulesViewer.svelte.d.ts +1 -0
- package/components/FlowPreviewContent.svelte +56 -15
- package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/components/FlowStatusViewer.svelte +42 -24
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +7 -3
- package/components/HighlightCode.svelte +21 -0
- package/components/HighlightCode.svelte.d.ts +17 -0
- package/components/IconedPath.svelte +9 -7
- package/components/InputTransformForm.svelte +87 -106
- package/components/InputTransformForm.svelte.d.ts +0 -1
- package/components/ItemPicker.svelte +2 -2
- package/components/LogViewer.svelte +23 -0
- package/components/LogViewer.svelte.d.ts +19 -0
- package/components/ModulePreview.svelte +108 -0
- package/components/ModulePreview.svelte.d.ts +24 -0
- package/components/RunForm.svelte +29 -18
- package/components/RunForm.svelte.d.ts +6 -2
- package/components/SchemaEditor.svelte +3 -1
- package/components/SchemaForm.svelte +0 -2
- package/components/SchemaForm.svelte.d.ts +0 -1
- package/components/ScriptBuilder.svelte +77 -66
- package/components/ScriptBuilder.svelte.d.ts +2 -4
- package/components/ScriptEditor.svelte +69 -142
- package/components/ScriptEditor.svelte.d.ts +0 -5
- package/components/ScriptPicker.svelte +3 -3
- package/components/ScriptPicker.svelte.d.ts +2 -1
- package/components/SharedBadge.svelte +5 -13
- package/components/SimpleEditor.svelte +4 -0
- package/components/TestJobLoader.svelte +98 -0
- package/components/TestJobLoader.svelte.d.ts +26 -0
- package/components/Tooltip.svelte +2 -1
- package/components/common/actionRow/ActionRow.svelte +26 -0
- package/components/common/actionRow/ActionRow.svelte.d.ts +21 -0
- package/components/common/alert/Alert.svelte +53 -0
- package/components/common/alert/Alert.svelte.d.ts +20 -0
- package/components/common/alert/model.d.ts +1 -0
- package/components/common/alert/model.js +1 -0
- package/components/common/badge/Badge.svelte +82 -0
- package/components/common/badge/Badge.svelte.d.ts +28 -0
- package/components/common/badge/model.d.ts +8 -0
- package/components/common/badge/model.js +1 -0
- package/components/common/button/Button.svelte +107 -0
- package/components/common/button/Button.svelte.d.ts +37 -0
- package/components/common/button/model.d.ts +6 -0
- package/components/common/button/model.js +1 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +55 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +23 -0
- package/components/common/drawer/Drawer.svelte +3 -0
- package/components/common/drawer/Drawer.svelte.d.ts +2 -0
- package/components/common/index.d.ts +14 -0
- package/components/common/index.js +14 -0
- package/components/common/tabs/TabContent.svelte +3 -2
- package/components/common/tabs/TabContent.svelte.d.ts +1 -0
- package/components/common/tabs/Tabs.svelte +8 -1
- package/components/common/tabs/Tabs.svelte.d.ts +2 -0
- package/components/common/toggleButton/ToggleButton.svelte +20 -0
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +19 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte +33 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +24 -0
- package/components/flows/FlowEditor.svelte +30 -0
- package/components/{FlowEditor.svelte.d.ts → flows/FlowEditor.svelte.d.ts} +1 -8
- package/components/flows/common/FlowCard.svelte +9 -0
- package/components/flows/common/FlowCard.svelte.d.ts +21 -0
- package/components/flows/common/FlowCardHeader.svelte +39 -0
- package/components/flows/common/FlowCardHeader.svelte.d.ts +20 -0
- package/components/flows/content/CopyFirstStepSchema.svelte +13 -0
- package/components/flows/{CopyFirstStepSchema.svelte.d.ts → content/CopyFirstStepSchema.svelte.d.ts} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte → content/DynamicInputHelpBox.svelte} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte.d.ts → content/DynamicInputHelpBox.svelte.d.ts} +0 -0
- package/components/flows/content/FlowEditorPanel.svelte +26 -0
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +14 -0
- package/components/flows/content/FlowFailureModule.svelte +17 -0
- package/components/flows/content/FlowFailureModule.svelte.d.ts +14 -0
- package/components/flows/content/FlowInput.svelte +22 -0
- package/components/flows/{FlowInput.svelte.d.ts → content/FlowInput.svelte.d.ts} +0 -0
- package/components/flows/{FlowInputs.svelte → content/FlowInputs.svelte} +24 -13
- package/components/flows/{FlowInputs.svelte.d.ts → content/FlowInputs.svelte.d.ts} +0 -0
- package/components/flows/content/FlowLoop.svelte +38 -0
- package/components/flows/content/FlowLoop.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +190 -0
- package/components/flows/content/FlowModule.svelte.d.ts +29 -0
- package/components/flows/content/FlowModuleAdvancedSettings.svelte +64 -0
- package/components/flows/content/FlowModuleAdvancedSettings.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +68 -0
- package/components/flows/{FlowModuleHeader.svelte.d.ts → content/FlowModuleHeader.svelte.d.ts} +2 -3
- package/components/flows/content/FlowModuleScript.svelte +21 -0
- package/components/flows/content/FlowModuleScript.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleWrapper.svelte +47 -0
- package/components/flows/content/FlowModuleWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowRetries.svelte +80 -0
- package/components/flows/content/FlowRetries.svelte.d.ts +14 -0
- package/components/flows/content/FlowSchedules.svelte +18 -0
- package/components/flows/content/FlowSchedules.svelte.d.ts +14 -0
- package/components/flows/content/FlowSettings.svelte +51 -0
- package/components/flows/{FlowSettings.svelte.d.ts → content/FlowSettings.svelte.d.ts} +1 -6
- package/components/flows/content/RemoveStepConfirmationModal.svelte +32 -0
- package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +19 -0
- package/components/flows/flowState.d.ts +8 -7
- package/components/flows/flowState.js +25 -46
- package/components/flows/flowStateUtils.d.ts +15 -13
- package/components/flows/flowStateUtils.js +80 -72
- package/components/flows/flowStore.js +7 -4
- package/components/flows/header/FlowEditorHeader.svelte +23 -0
- package/components/flows/header/FlowEditorHeader.svelte.d.ts +14 -0
- package/components/flows/header/FlowImportExportMenu.svelte +56 -0
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +14 -0
- package/components/flows/header/FlowPreviewButtons.svelte +49 -0
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +14 -0
- package/components/flows/header/FlowStatus.svelte +36 -0
- package/components/flows/header/FlowStatus.svelte.d.ts +14 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +54 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +58 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +27 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte +161 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +4 -3
- package/components/flows/pickers/PickHubScript.svelte.d.ts +2 -1
- package/components/flows/pickers/PickScript.svelte +4 -12
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte +42 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +31 -0
- package/components/flows/scheduleUtils.d.ts +0 -1
- package/components/flows/scheduleUtils.js +0 -1
- package/components/flows/types.d.ts +9 -0
- package/components/flows/types.js +1 -0
- package/components/flows/utils.d.ts +1 -1
- package/components/flows/utils.js +8 -11
- package/components/icons/HatIcon.svelte +19 -0
- package/components/icons/HatIcon.svelte.d.ts +16 -0
- package/components/landing/FlowGettingStarted.svelte +22 -68
- package/components/landing/FlowLandingBox.svelte +1 -1
- package/components/landing/RessourceGettingStarted.svelte +7 -37
- package/components/landing/ScriptBox.svelte +33 -60
- package/components/landing/ScriptGettingStarted.svelte +23 -69
- package/components/propertyPicker/ObjectViewer.svelte +16 -7
- package/components/propertyPicker/PropPicker.svelte +38 -12
- package/components/propertyPicker/WarningMessage.svelte +2 -15
- package/components/script_editor/LogPanel.svelte +108 -119
- package/components/script_editor/LogPanel.svelte.d.ts +2 -0
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/gen/models/CompletedJob.d.ts +2 -1
- package/gen/models/CompletedJob.js +1 -0
- package/gen/models/FlowModule.d.ts +1 -0
- package/gen/models/FlowStatus.d.ts +3 -0
- package/gen/models/FlowStatusModule.d.ts +1 -1
- package/gen/models/FlowValue.d.ts +11 -0
- package/gen/models/Preview.d.ts +2 -1
- package/gen/models/Preview.js +1 -0
- package/gen/models/QueuedJob.d.ts +2 -1
- package/gen/models/QueuedJob.js +1 -0
- package/gen/models/RawScript.d.ts +2 -1
- package/gen/models/RawScript.js +1 -0
- package/gen/models/Script.d.ts +9 -2
- package/gen/models/Script.js +8 -0
- package/gen/services/JobService.d.ts +40 -0
- package/gen/services/JobService.js +70 -0
- package/gen/services/ScriptService.d.ts +14 -3
- package/gen/services/ScriptService.js +13 -0
- package/infer.d.ts +1 -1
- package/infer.js +6 -1
- package/package.json +65 -35
- package/script_helpers.d.ts +5 -2
- package/script_helpers.js +41 -13
- package/stores.d.ts +1 -1
- package/utils.d.ts +6 -4
- package/utils.js +27 -4
- package/components/FlowEditor.svelte +0 -55
- package/components/FlowPreview.svelte +0 -107
- package/components/FlowPreview.svelte.d.ts +0 -23
- package/components/ModuleStep.svelte +0 -131
- package/components/ModuleStep.svelte.d.ts +0 -25
- package/components/flows/CopyFirstStepSchema.svelte +0 -13
- package/components/flows/FlowBox.svelte +0 -16
- package/components/flows/FlowBox.svelte.d.ts +0 -23
- package/components/flows/FlowBoxHeader.svelte +0 -16
- package/components/flows/FlowBoxHeader.svelte.d.ts +0 -21
- package/components/flows/FlowInput.svelte +0 -22
- package/components/flows/FlowModuleHeader.svelte +0 -109
- package/components/flows/FlowSettings.svelte +0 -165
- package/components/flows/FlowTimeline.svelte +0 -169
- package/components/flows/FlowTimeline.svelte.d.ts +0 -21
- package/components/flows/stepOpenedStore.d.ts +0 -1
- package/components/flows/stepOpenedStore.js +0 -6
- package/components/propertyPicker/OverlayPropertyPicker.svelte +0 -69
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +0 -24
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import FlowModuleSchemaItem from './FlowModuleSchemaItem.svelte';
|
|
3
|
+
import Icon from 'svelte-awesome';
|
|
4
|
+
import { faPen, faPlus, faSliders } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { emptyFlowModuleState, isEmptyFlowModule } from '../flowStateUtils';
|
|
6
|
+
import { classNames, emptyModule } from '../../../utils';
|
|
7
|
+
import FlowErrorHandlerItem from './FlowErrorHandlerItem.svelte';
|
|
8
|
+
import RemoveStepConfirmationModal from '../content/RemoveStepConfirmationModal.svelte';
|
|
9
|
+
export let prefix = undefined;
|
|
10
|
+
export let modules;
|
|
11
|
+
export let moduleStates;
|
|
12
|
+
const { select, selectedId } = getContext('FlowEditorContext');
|
|
13
|
+
function insertAtIndex(index) {
|
|
14
|
+
moduleStates.splice(index, 0, emptyFlowModuleState());
|
|
15
|
+
modules.splice(index, 0, emptyModule());
|
|
16
|
+
moduleStates = moduleStates;
|
|
17
|
+
modules = modules;
|
|
18
|
+
select([prefix, String(index)].filter(Boolean).join('-'));
|
|
19
|
+
}
|
|
20
|
+
function removeAtIndex(index) {
|
|
21
|
+
select('settings');
|
|
22
|
+
modules.splice(index, 1);
|
|
23
|
+
moduleStates.splice(index, 1);
|
|
24
|
+
moduleStates = moduleStates;
|
|
25
|
+
modules = modules;
|
|
26
|
+
}
|
|
27
|
+
let indexToRemove = undefined;
|
|
28
|
+
$: confirmationModalOpen = indexToRemove !== undefined;
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="flex flex-col justify-between h-full">
|
|
32
|
+
<ul class="w-full">
|
|
33
|
+
{#if prefix === undefined}
|
|
34
|
+
<div
|
|
35
|
+
on:click={() => select('settings')}
|
|
36
|
+
class={classNames(
|
|
37
|
+
'border w-full rounded-md p-2 bg-white text-sm cursor-pointer flex items-center mb-4',
|
|
38
|
+
$selectedId.includes('settings')
|
|
39
|
+
? 'outline outline-offset-1 outline-2 outline-slate-900'
|
|
40
|
+
: ''
|
|
41
|
+
)}
|
|
42
|
+
>
|
|
43
|
+
<Icon data={faSliders} class="mr-2" />
|
|
44
|
+
<span class="font-bold">Settings</span>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<FlowModuleSchemaItem
|
|
48
|
+
on:click={() => select('inputs')}
|
|
49
|
+
isFirst
|
|
50
|
+
hasLine
|
|
51
|
+
selected={$selectedId === 'inputs'}
|
|
52
|
+
>
|
|
53
|
+
<div slot="icon">
|
|
54
|
+
<Icon data={faPen} scale={0.8} />
|
|
55
|
+
</div>
|
|
56
|
+
<div slot="content">
|
|
57
|
+
<span>Inputs</span>
|
|
58
|
+
</div>
|
|
59
|
+
</FlowModuleSchemaItem>
|
|
60
|
+
{/if}
|
|
61
|
+
|
|
62
|
+
{#each modules as mod, index (index)}
|
|
63
|
+
<button
|
|
64
|
+
on:click={() => insertAtIndex(index)}
|
|
65
|
+
type="button"
|
|
66
|
+
class="text-gray-900 m-0.5 my-0.5 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-full text-sm w-6 h-6 flex items-center justify-center"
|
|
67
|
+
>
|
|
68
|
+
<Icon data={faPlus} scale={0.8} />
|
|
69
|
+
</button>
|
|
70
|
+
{#if mod.value.type === 'forloopflow'}
|
|
71
|
+
<li>
|
|
72
|
+
<FlowModuleSchemaItem
|
|
73
|
+
deletable
|
|
74
|
+
on:delete={() => removeAtIndex(index)}
|
|
75
|
+
on:click={() => select(['loop', String(index)].join('-'))}
|
|
76
|
+
selected={$selectedId === ['loop', String(index)].join('-')}
|
|
77
|
+
>
|
|
78
|
+
<div slot="icon">
|
|
79
|
+
<span>{index + 1}</span>
|
|
80
|
+
</div>
|
|
81
|
+
<div slot="content">
|
|
82
|
+
<span>For loop</span>
|
|
83
|
+
</div>
|
|
84
|
+
</FlowModuleSchemaItem>
|
|
85
|
+
|
|
86
|
+
<div class="flex text-xs">
|
|
87
|
+
<div class="line mr-2 w-8" />
|
|
88
|
+
|
|
89
|
+
<div class="w-full mb-2">
|
|
90
|
+
{#if moduleStates[index]?.childFlowModules}
|
|
91
|
+
<svelte:self
|
|
92
|
+
prefix={String(index)}
|
|
93
|
+
moduleStates={moduleStates[index].childFlowModules}
|
|
94
|
+
modules={mod.value.modules}
|
|
95
|
+
/>
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="italic text-xs pl-10 text-gray-600">
|
|
101
|
+
The loop's result is the list of every iteration's result.
|
|
102
|
+
</div>
|
|
103
|
+
</li>
|
|
104
|
+
{:else}
|
|
105
|
+
<li>
|
|
106
|
+
<FlowModuleSchemaItem
|
|
107
|
+
on:click={() => select([prefix, String(index)].filter(Boolean).join('-'))}
|
|
108
|
+
color={prefix ? 'orange' : 'blue'}
|
|
109
|
+
isLast={index === modules.length - 1}
|
|
110
|
+
selected={$selectedId === [prefix, String(index)].filter(Boolean).join('-')}
|
|
111
|
+
deletable
|
|
112
|
+
on:delete={(event) => {
|
|
113
|
+
if (event.detail.event.shiftKey || isEmptyFlowModule(mod)) {
|
|
114
|
+
removeAtIndex(index)
|
|
115
|
+
} else {
|
|
116
|
+
indexToRemove = index
|
|
117
|
+
}
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<div slot="icon">
|
|
121
|
+
<span>{index + 1}</span>
|
|
122
|
+
</div>
|
|
123
|
+
<div slot="content" class="w-full truncate block">
|
|
124
|
+
<span
|
|
125
|
+
>{mod.summary ||
|
|
126
|
+
mod.value.path ||
|
|
127
|
+
(mod.value.type === 'rawscript'
|
|
128
|
+
? `Inline ${mod.value.language}`
|
|
129
|
+
: 'Select a script')}</span
|
|
130
|
+
>
|
|
131
|
+
</div>
|
|
132
|
+
</FlowModuleSchemaItem>
|
|
133
|
+
</li>
|
|
134
|
+
{/if}
|
|
135
|
+
{/each}
|
|
136
|
+
|
|
137
|
+
<button
|
|
138
|
+
on:click={() => insertAtIndex(modules.length)}
|
|
139
|
+
type="button"
|
|
140
|
+
class="text-gray-900 bg-white border m-0.5 border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-full text-sm w-6 h-6 flex items-center justify-center"
|
|
141
|
+
>
|
|
142
|
+
<Icon data={faPlus} scale={0.8} />
|
|
143
|
+
</button>
|
|
144
|
+
</ul>
|
|
145
|
+
{#if prefix === undefined}
|
|
146
|
+
<FlowErrorHandlerItem />
|
|
147
|
+
{/if}
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<RemoveStepConfirmationModal
|
|
151
|
+
bind:open={confirmationModalOpen}
|
|
152
|
+
on:canceled={() => {
|
|
153
|
+
indexToRemove = undefined
|
|
154
|
+
}}
|
|
155
|
+
on:confirmed={() => {
|
|
156
|
+
if (indexToRemove !== undefined) {
|
|
157
|
+
removeAtIndex(indexToRemove)
|
|
158
|
+
indexToRemove = undefined
|
|
159
|
+
}
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { FlowModuleState } from '../flowState';
|
|
3
|
+
import type { FlowModule } from '../../../gen';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
prefix?: string | undefined;
|
|
7
|
+
modules: FlowModule[];
|
|
8
|
+
moduleStates: FlowModuleState[];
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export declare type FlowModuleSchemaMapProps = typeof __propDef.props;
|
|
16
|
+
export declare type FlowModuleSchemaMapEvents = typeof __propDef.events;
|
|
17
|
+
export declare type FlowModuleSchemaMapSlots = typeof __propDef.slots;
|
|
18
|
+
export default class FlowModuleSchemaMap extends SvelteComponentTyped<FlowModuleSchemaMapProps, FlowModuleSchemaMapEvents, FlowModuleSchemaMapSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -3,9 +3,10 @@ import FlowScriptPicker from './FlowScriptPicker.svelte';
|
|
|
3
3
|
import ItemPicker from '../../ItemPicker.svelte';
|
|
4
4
|
import { hubScripts } from '../../../stores';
|
|
5
5
|
import { createEventDispatcher } from 'svelte';
|
|
6
|
-
|
|
6
|
+
import { Script } from '../../../gen';
|
|
7
|
+
export let kind;
|
|
7
8
|
let items;
|
|
8
|
-
$: items = $hubScripts?.filter((x) => x.
|
|
9
|
+
$: items = $hubScripts?.filter((x) => x.kind == kind) ?? [];
|
|
9
10
|
let itemPicker;
|
|
10
11
|
const dispatch = createEventDispatcher();
|
|
11
12
|
</script>
|
|
@@ -23,7 +24,7 @@ const dispatch = createEventDispatcher();
|
|
|
23
24
|
/>
|
|
24
25
|
|
|
25
26
|
<FlowScriptPicker
|
|
26
|
-
label={`Pick a ${
|
|
27
|
+
label={`Pick a ${kind == Script.kind.SCRIPT ? '' : kind} script from the Hub`}
|
|
27
28
|
icon={faUserGroup}
|
|
28
29
|
iconColor="text-blue-500"
|
|
29
30
|
on:click={() => itemPicker.openModal()}
|
|
@@ -4,17 +4,11 @@ import { ScriptService } from '../../../gen';
|
|
|
4
4
|
import { workspaceStore } from '../../../stores';
|
|
5
5
|
import { createEventDispatcher } from 'svelte';
|
|
6
6
|
import FlowScriptPicker from './FlowScriptPicker.svelte';
|
|
7
|
-
export let
|
|
8
|
-
let items = [];
|
|
7
|
+
export let kind;
|
|
9
8
|
let itemPicker;
|
|
10
9
|
const dispatch = createEventDispatcher();
|
|
11
10
|
async function loadItems() {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
$: {
|
|
15
|
-
if ($workspaceStore) {
|
|
16
|
-
loadItems();
|
|
17
|
-
}
|
|
11
|
+
return await ScriptService.listScripts({ workspace: $workspaceStore, kind });
|
|
18
12
|
}
|
|
19
13
|
</script>
|
|
20
14
|
|
|
@@ -25,13 +19,11 @@ $: {
|
|
|
25
19
|
}}
|
|
26
20
|
itemName={'Script'}
|
|
27
21
|
extraField="summary"
|
|
28
|
-
loadItems
|
|
29
|
-
return items
|
|
30
|
-
}}
|
|
22
|
+
{loadItems}
|
|
31
23
|
/>
|
|
32
24
|
|
|
33
25
|
<FlowScriptPicker
|
|
34
|
-
label={`Pick a ${
|
|
26
|
+
label={`Pick a ${kind == 'script' ? '' : kind} script from your workspace`}
|
|
35
27
|
icon={faUserGroup}
|
|
36
28
|
iconColor="text-blue-500"
|
|
37
29
|
on:click={() => itemPicker.openModal()}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script context="module">export {};
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script>import PropPicker from '../../propertyPicker/PropPicker.svelte';
|
|
5
|
+
import { setContext } from 'svelte';
|
|
6
|
+
import { HSplitPane } from 'svelte-split-pane';
|
|
7
|
+
import { writable } from 'svelte/store';
|
|
8
|
+
export let pickableProperties = {};
|
|
9
|
+
const propPickerConfig = writable(undefined);
|
|
10
|
+
setContext('PropPickerWrapper', {
|
|
11
|
+
propPickerConfig,
|
|
12
|
+
focusProp: (propName, insertionMode, onSelect) => {
|
|
13
|
+
propPickerConfig.set({
|
|
14
|
+
propName,
|
|
15
|
+
insertionMode,
|
|
16
|
+
onSelect
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
clearFocus: () => {
|
|
20
|
+
propPickerConfig.set(undefined);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<HSplitPane leftPaneSize="50%" rightPaneSize="50%" minLeftPaneSize="20%" minRightPaneSize="20%">
|
|
26
|
+
<left slot="left" class="relative">
|
|
27
|
+
<div class="overflow-auto h-full p-4">
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
</left>
|
|
31
|
+
<right slot="right">
|
|
32
|
+
<div class="overflow-auto h-full">
|
|
33
|
+
<PropPicker
|
|
34
|
+
{pickableProperties}
|
|
35
|
+
on:select={({ detail }) => {
|
|
36
|
+
$propPickerConfig?.onSelect(detail)
|
|
37
|
+
propPickerConfig.set(undefined)
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</right>
|
|
42
|
+
</HSplitPane>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare type InsertionMode = 'append' | 'connect' | 'insert';
|
|
3
|
+
declare type SelectCallback = (path: string) => void;
|
|
4
|
+
declare type PropPickerConfig = {
|
|
5
|
+
insertionMode: InsertionMode;
|
|
6
|
+
propName: string;
|
|
7
|
+
onSelect: SelectCallback;
|
|
8
|
+
};
|
|
9
|
+
export declare type PropPickerWrapperContext = {
|
|
10
|
+
propPickerConfig: Writable<PropPickerConfig | undefined>;
|
|
11
|
+
focusProp: (propName: string, insertionMode: InsertionMode, onSelect: SelectCallback) => void;
|
|
12
|
+
clearFocus: () => void;
|
|
13
|
+
};
|
|
14
|
+
import { type Writable } from 'svelte/store';
|
|
15
|
+
declare const __propDef: {
|
|
16
|
+
props: {
|
|
17
|
+
pickableProperties?: Object | undefined;
|
|
18
|
+
};
|
|
19
|
+
events: {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
};
|
|
22
|
+
slots: {
|
|
23
|
+
default: {};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare type PropPickerWrapperProps = typeof __propDef.props;
|
|
27
|
+
export declare type PropPickerWrapperEvents = typeof __propDef.events;
|
|
28
|
+
export declare type PropPickerWrapperSlots = typeof __propDef.slots;
|
|
29
|
+
export default class PropPickerWrapper extends SvelteComponentTyped<PropPickerWrapperProps, PropPickerWrapperEvents, PropPickerWrapperSlots> {
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Writable } from 'svelte/store';
|
|
2
|
+
import type { Schedule } from './scheduleUtils';
|
|
3
|
+
export declare type FlowEditorContext = {
|
|
4
|
+
selectedId: Writable<string>;
|
|
5
|
+
select: (id: string) => void;
|
|
6
|
+
schedule: Writable<Schedule>;
|
|
7
|
+
path: string;
|
|
8
|
+
previewArgs: Writable<Record<string, any>>;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,6 @@ import type { Schema } from '../../common';
|
|
|
2
2
|
import { type Flow, type FlowModule, type InputTransform, type Job } from '../../gen';
|
|
3
3
|
export declare function cleanInputs(flow: Flow | any): Flow;
|
|
4
4
|
export declare function getTypeAsString(arg: any): string;
|
|
5
|
-
export declare function scrollIntoView(element: any): void;
|
|
6
5
|
export declare function loadSchemaFromModule(module: FlowModule): Promise<{
|
|
7
6
|
input_transforms: Record<string, InputTransform>;
|
|
8
7
|
schema: Schema;
|
|
@@ -12,3 +11,4 @@ export declare function getDefaultExpr(importPath?: string | undefined, key?: st
|
|
|
12
11
|
export declare function jobsToResults(jobs: Job[]): any;
|
|
13
12
|
export declare function runFlowPreview(args: Record<string, any>, flow: Flow): Promise<string>;
|
|
14
13
|
export declare function codeToStaticTemplate(code?: string): string | undefined;
|
|
14
|
+
export declare function getIndexes(parentIndex: number | undefined, childIndex: number): number[];
|
|
@@ -35,17 +35,6 @@ export function getTypeAsString(arg) {
|
|
|
35
35
|
}
|
|
36
36
|
return typeof arg;
|
|
37
37
|
}
|
|
38
|
-
export function scrollIntoView(element) {
|
|
39
|
-
if (!element)
|
|
40
|
-
return;
|
|
41
|
-
var headerOffset = 45;
|
|
42
|
-
var elementPosition = element.getBoundingClientRect().top;
|
|
43
|
-
var offsetPosition = elementPosition + window.pageYOffset - headerOffset;
|
|
44
|
-
window.scrollTo({
|
|
45
|
-
top: offsetPosition,
|
|
46
|
-
behavior: 'smooth'
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
38
|
export async function loadSchemaFromModule(module) {
|
|
50
39
|
const mod = module.value;
|
|
51
40
|
if (mod.type == 'rawscript' || mod.type === 'script') {
|
|
@@ -134,3 +123,11 @@ export function codeToStaticTemplate(code) {
|
|
|
134
123
|
}
|
|
135
124
|
return undefined;
|
|
136
125
|
}
|
|
126
|
+
export function getIndexes(parentIndex, childIndex) {
|
|
127
|
+
const indexes = [];
|
|
128
|
+
if (parentIndex !== undefined) {
|
|
129
|
+
indexes.push(parentIndex);
|
|
130
|
+
}
|
|
131
|
+
indexes.push(childIndex);
|
|
132
|
+
return indexes;
|
|
133
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>let clazz = '';
|
|
2
|
+
export { clazz as class };
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
class={clazz}
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
><path d="M12 14l9-5-9-5-9 5 9 5z" /><path
|
|
12
|
+
d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
|
|
13
|
+
/><path
|
|
14
|
+
stroke-linecap="round"
|
|
15
|
+
stroke-linejoin="round"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
class?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export declare type HatIconProps = typeof __propDef.props;
|
|
12
|
+
export declare type HatIconEvents = typeof __propDef.events;
|
|
13
|
+
export declare type HatIconSlots = typeof __propDef.slots;
|
|
14
|
+
export default class HatIcon extends SvelteComponentTyped<HatIconProps, HatIconEvents, HatIconSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { goto } from '$app/navigation'
|
|
3
|
+
import { faExternalLink, faFile, faPlus } from '@fortawesome/free-solid-svg-icons'
|
|
4
|
+
import Button from '../common/button/Button.svelte'
|
|
5
|
+
import HatIcon from '../icons/HatIcon.svelte'
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<div class="p-4 border border-gray-300 rounded-md bg-gray-50 ">
|
|
6
9
|
<div class="flex items-center">
|
|
7
10
|
<h3 class="inline-flex items-center text-lg font-medium text-gray-700 ">
|
|
8
|
-
<
|
|
9
|
-
class="w-6 h-6 mr-2"
|
|
10
|
-
fill="none"
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
viewBox="0 0 24 24"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
><path d="M12 14l9-5-9-5-9 5 9 5z" /><path
|
|
15
|
-
d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
|
|
16
|
-
/><path
|
|
17
|
-
stroke-linecap="round"
|
|
18
|
-
stroke-linejoin="round"
|
|
19
|
-
stroke-width="2"
|
|
20
|
-
d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
11
|
+
<HatIcon class="w-6 h-6 mr-2" />
|
|
23
12
|
Getting started
|
|
24
13
|
</h3>
|
|
25
14
|
</div>
|
|
@@ -29,67 +18,32 @@
|
|
|
29
18
|
the Hub!
|
|
30
19
|
</div>
|
|
31
20
|
<div class="inline-flex flex-wrap gap-y-2">
|
|
32
|
-
<
|
|
33
|
-
type="button"
|
|
21
|
+
<Button
|
|
34
22
|
on:click={() => goto('flows/add')}
|
|
35
|
-
|
|
23
|
+
color="dark"
|
|
24
|
+
size="xs"
|
|
25
|
+
btnClasses="mr-2"
|
|
26
|
+
startIcon={{ icon: faPlus }}
|
|
36
27
|
>
|
|
37
|
-
<svg
|
|
38
|
-
class="w-4 h-4 mr-2"
|
|
39
|
-
fill="none"
|
|
40
|
-
stroke="currentColor"
|
|
41
|
-
viewBox="0 0 24 24"
|
|
42
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
-
><path
|
|
44
|
-
stroke-linecap="round"
|
|
45
|
-
stroke-linejoin="round"
|
|
46
|
-
stroke-width="2"
|
|
47
|
-
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
48
|
-
/></svg
|
|
49
|
-
>
|
|
50
28
|
Create flow
|
|
51
|
-
</
|
|
52
|
-
<
|
|
29
|
+
</Button>
|
|
30
|
+
<Button
|
|
53
31
|
on:click={() => goto('https://docs.windmill.dev/docs/getting_started/flows')}
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
color="blue"
|
|
33
|
+
size="xs"
|
|
34
|
+
btnClasses="mr-2"
|
|
35
|
+
startIcon={{ icon: faFile }}
|
|
56
36
|
>
|
|
57
|
-
<svg
|
|
58
|
-
class="w-4 h-4 mr-2"
|
|
59
|
-
fill="none"
|
|
60
|
-
stroke="currentColor"
|
|
61
|
-
viewBox="0 0 24 24"
|
|
62
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
-
><path
|
|
64
|
-
stroke-linecap="round"
|
|
65
|
-
stroke-linejoin="round"
|
|
66
|
-
stroke-width="2"
|
|
67
|
-
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
68
|
-
/>
|
|
69
|
-
</svg>
|
|
70
37
|
Flow documentation
|
|
71
|
-
</
|
|
72
|
-
<
|
|
73
|
-
type="button"
|
|
74
|
-
class="inline-flex items-center text-gray-700 bg-transparent border border-gray-700 hover:bg-gray-800 hover:text-white focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center "
|
|
75
|
-
data-dismiss-target="#alert-additional-content-5"
|
|
76
|
-
aria-label="Close"
|
|
38
|
+
</Button>
|
|
39
|
+
<Button
|
|
77
40
|
on:click={() => goto('https://hub.windmill.dev/')}
|
|
41
|
+
color="light"
|
|
42
|
+
variant="border"
|
|
43
|
+
size="xs"
|
|
44
|
+
startIcon={{ icon: faExternalLink }}
|
|
78
45
|
>
|
|
79
|
-
<svg
|
|
80
|
-
class="w-4 h-4 mr-2"
|
|
81
|
-
fill="none"
|
|
82
|
-
stroke="currentColor"
|
|
83
|
-
viewBox="0 0 24 24"
|
|
84
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
-
><path
|
|
86
|
-
stroke-linecap="round"
|
|
87
|
-
stroke-linejoin="round"
|
|
88
|
-
stroke-width="2"
|
|
89
|
-
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
90
|
-
/>
|
|
91
|
-
</svg>
|
|
92
46
|
Explore community flows on WindmillHub
|
|
93
|
-
</
|
|
47
|
+
</Button>
|
|
94
48
|
</div>
|
|
95
49
|
</div>
|
|
@@ -16,7 +16,7 @@ export let flow;
|
|
|
16
16
|
class="inline-flex space-x-2 space-x-reverse flex-row-reverse w-full bottom-4 right-4 flex-wrap"
|
|
17
17
|
>
|
|
18
18
|
<button
|
|
19
|
-
on:click|stopPropagation={() => goto(`/flows/edit/${flow.path}
|
|
19
|
+
on:click|stopPropagation={() => goto(`/flows/edit/${flow.path}`)}
|
|
20
20
|
type="button"
|
|
21
21
|
class="inline-flex items-center text-gray-700 bg-transparent border border-gray-700 hover:bg-gray-800 hover:text-white focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
|
|
22
22
|
data-dismiss-target="#alert-additional-content-5"
|
|
@@ -1,51 +1,21 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { goto } from '$app/navigation'
|
|
3
|
+
import { faLink } from '@fortawesome/free-solid-svg-icons'
|
|
4
|
+
import Button from '../common/button/Button.svelte'
|
|
5
|
+
import HatIcon from '../icons/HatIcon.svelte'
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<div class="p-4 border border-gray-300 rounded-md bg-gray-50 dark:border-gray-600 dark:bg-gray-700">
|
|
6
9
|
<div class="flex items-center">
|
|
7
10
|
<h3 class="inline-flex items-center text-lg font-medium text-gray-700 ">
|
|
8
|
-
<
|
|
9
|
-
class="w-6 h-6 mr-2"
|
|
10
|
-
fill="none"
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
viewBox="0 0 24 24"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
><path d="M12 14l9-5-9-5-9 5 9 5z" /><path
|
|
15
|
-
d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
|
|
16
|
-
/><path
|
|
17
|
-
stroke-linecap="round"
|
|
18
|
-
stroke-linejoin="round"
|
|
19
|
-
stroke-width="2"
|
|
20
|
-
d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
11
|
+
<HatIcon class="w-6 h-6 mr-2" />
|
|
23
12
|
Getting started
|
|
24
13
|
</h3>
|
|
25
14
|
</div>
|
|
26
15
|
<div class="mt-2 mb-4 text-sm text-gray-700 dark:text-gray-300">
|
|
27
16
|
Connect to apps like Slack, Google Drive or Airtable using OAuth.
|
|
28
17
|
</div>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type="button"
|
|
33
|
-
class="inline-flex items-center text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center dark:bg-gray-600 dark:hover:bg-gray-500 dark:focus:ring-gray-600"
|
|
34
|
-
>
|
|
35
|
-
<svg
|
|
36
|
-
class="w-4 h-4 mr-2"
|
|
37
|
-
fill="none"
|
|
38
|
-
stroke="currentColor"
|
|
39
|
-
viewBox="0 0 24 24"
|
|
40
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
-
><path
|
|
42
|
-
stroke-linecap="round"
|
|
43
|
-
stroke-linejoin="round"
|
|
44
|
-
stroke-width="2"
|
|
45
|
-
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
|
46
|
-
/>
|
|
47
|
-
</svg>
|
|
48
|
-
Connect an API
|
|
49
|
-
</button>
|
|
50
|
-
</div>
|
|
18
|
+
<Button on:click={() => goto('resources')} color="dark" startIcon={{ icon: faLink }} size="xs">
|
|
19
|
+
Connect an API
|
|
20
|
+
</Button>
|
|
51
21
|
</div>
|