windmill-components 1.82.2 → 1.82.4
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/common.d.ts +2 -2
- package/components/ArgInput.svelte +52 -72
- package/components/ArgInput.svelte.d.ts +1 -3
- package/components/DisplayResult.svelte +17 -17
- package/components/Editor.svelte +0 -3
- package/components/Editor.svelte.d.ts +0 -1
- package/components/FieldHeader.svelte +0 -1
- package/components/FieldHeader.svelte.d.ts +0 -4
- package/components/FlowBuilder.svelte +6 -0
- package/components/FlowStatusViewer.svelte +7 -4
- package/components/FlowStatusViewer.svelte.d.ts +1 -0
- package/components/FlowViewer.svelte +0 -1
- package/components/InputTransformForm.svelte +0 -1
- package/components/LightweightArgInput.svelte +1 -14
- package/components/LightweightArgInput.svelte.d.ts +1 -3
- package/components/SimpleEditor.svelte +0 -1
- package/components/SimpleEditor.svelte.d.ts +0 -1
- package/components/TemplateEditor.svelte +0 -1
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +0 -1
- package/components/apps/components/buttons/AppButton.svelte +3 -17
- package/components/apps/components/buttons/AppForm.svelte +2 -10
- package/components/apps/components/buttons/AppFormButton.svelte +1 -13
- package/components/apps/components/display/AppDisplayComponent.svelte +23 -17
- package/components/apps/components/display/AppHtml.svelte +7 -1
- package/components/apps/components/display/AppHtml.svelte.d.ts +2 -0
- package/components/apps/components/display/AppMap.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +1 -1
- package/components/apps/components/display/PlotlyHtml.svelte +20 -3
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +2 -0
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +75 -49
- package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
- package/components/apps/components/display/table/AppTableFooter.svelte +2 -1
- package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +1 -0
- package/components/apps/components/display/table/tableOptions.js +1 -1
- package/components/apps/components/helpers/DebouncedInput.svelte +1 -0
- package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +2 -0
- package/components/apps/components/helpers/HiddenComponent.svelte +3 -2
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/InputValue.svelte +3 -3
- package/components/apps/components/helpers/RefreshButton.svelte +3 -10
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +19 -15
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +3 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/eval.d.ts +4 -2
- package/components/apps/components/helpers/eval.js +6 -4
- package/components/apps/components/inputs/AppCheckbox.svelte +0 -4
- package/components/apps/components/inputs/AppDateInput.svelte +2 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte +13 -5
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +0 -2
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +11 -4
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +0 -2
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +53 -43
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -1
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
- package/components/apps/components/layout/AppContainer.svelte +2 -2
- package/components/apps/components/layout/AppDrawer.svelte +1 -2
- package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +36 -10
- package/components/apps/editor/AppEditorHeader.svelte +5 -0
- package/components/apps/editor/AppPreview.svelte +17 -5
- package/components/apps/editor/ComponentHeader.svelte +1 -0
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +22 -12
- package/components/apps/editor/GridViewer.svelte +2 -2
- package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
- package/components/apps/editor/SettingsPanel.svelte +4 -4
- package/components/apps/editor/SubGridEditor.svelte +13 -12
- package/components/apps/editor/appUtils.d.ts +1 -0
- package/components/apps/editor/appUtils.js +19 -0
- package/components/apps/editor/component/Component.svelte +19 -8
- package/components/apps/editor/component/Component.svelte.d.ts +1 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +55 -46
- package/components/apps/editor/component/components.d.ts +45 -28
- package/components/apps/editor/component/components.js +41 -27
- package/components/apps/editor/component/sets.js +2 -1
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/componentsPanel/CssProperty.svelte +0 -26
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +0 -2
- package/components/apps/editor/componentsPanel/CssSettings.svelte +1 -0
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +13 -10
- package/components/apps/editor/componentsPanel/quickStyleProperties.js +3 -0
- package/components/apps/editor/componentsPanel/store.js +4 -4
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -26
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +0 -1
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +8 -6
- package/components/apps/editor/contextPanel/ContextPanel.svelte +7 -14
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +2 -25
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +29 -40
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +1 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +2 -7
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +10 -11
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +4 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +0 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +2 -0
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +22 -19
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +22 -3
- package/components/apps/editor/settingsPanel/GridTab.svelte +1 -2
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +4 -0
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +1 -2
- package/components/apps/editor/settingsPanel/StylePanel.svelte +40 -2
- package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +5 -1
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +3 -2
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +4 -1
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/inputType.d.ts +2 -2
- package/components/apps/rx.d.ts +2 -2
- package/components/apps/svelte-grid/Grid.svelte +50 -34
- package/components/apps/svelte-grid/Grid.svelte.d.ts +14 -9
- package/components/apps/svelte-grid/MoveResize.svelte +76 -55
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +15 -9
- package/components/apps/svelte-grid/utils/helper.d.ts +0 -1
- package/components/apps/svelte-grid/utils/helper.js +0 -3
- package/components/apps/types.d.ts +7 -4
- package/components/apps/utils.d.ts +2 -0
- package/components/apps/utils.js +33 -1
- package/components/flows/map/MapItem.svelte +3 -3
- package/components/propertyPicker/ObjectViewer.svelte +0 -3
- package/components/scriptEditor/LogPanel.svelte +3 -3
- package/infer.js +6 -1
- package/package.json +1 -2
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +0 -25
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +0 -16
package/common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Script } from
|
|
1
|
+
import type { Script } from './gen';
|
|
2
2
|
export type OwnerKind = 'group' | 'user' | 'folder';
|
|
3
3
|
export type ActionKind = 'Create' | 'Update' | 'Delete' | 'Execute';
|
|
4
4
|
export type SupportedLanguage = Script.language;
|
|
@@ -11,7 +11,7 @@ export interface SchemaProperty {
|
|
|
11
11
|
contentEncoding?: 'base64' | 'binary';
|
|
12
12
|
format?: string;
|
|
13
13
|
items?: {
|
|
14
|
-
type?: 'string' | 'number' | 'bytes';
|
|
14
|
+
type?: 'string' | 'number' | 'bytes' | 'object';
|
|
15
15
|
contentEncoding?: 'base64';
|
|
16
16
|
};
|
|
17
17
|
properties?: {
|
|
@@ -15,6 +15,9 @@ import Toggle from './Toggle.svelte';
|
|
|
15
15
|
import Password from './Password.svelte';
|
|
16
16
|
import NumberTypeNarrowing from './NumberTypeNarrowing.svelte';
|
|
17
17
|
import Range from './Range.svelte';
|
|
18
|
+
import JsonEditor from './apps/editor/settingsPanel/inputEditor/JsonEditor.svelte';
|
|
19
|
+
import { fade } from 'svelte/transition';
|
|
20
|
+
import { X } from 'lucide-svelte';
|
|
18
21
|
export let label = '';
|
|
19
22
|
export let value;
|
|
20
23
|
export let defaultValue = undefined;
|
|
@@ -68,7 +71,7 @@ $: {
|
|
|
68
71
|
}
|
|
69
72
|
export function evalValueToRaw() {
|
|
70
73
|
if (value) {
|
|
71
|
-
rawValue = JSON.stringify(value, null,
|
|
74
|
+
rawValue = JSON.stringify(value, null, 2);
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
function fileChanged(e, cb) {
|
|
@@ -136,12 +139,13 @@ $: {
|
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
$: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncoding);
|
|
142
|
+
let redraw = 0;
|
|
139
143
|
</script>
|
|
140
144
|
|
|
141
145
|
<div class="flex flex-col w-full min-w-[250px]">
|
|
142
146
|
<div>
|
|
143
147
|
{#if displayHeader}
|
|
144
|
-
<FieldHeader {label} {required} {type} {contentEncoding} {format}
|
|
148
|
+
<FieldHeader {label} {required} {type} {contentEncoding} {format} />
|
|
145
149
|
{/if}
|
|
146
150
|
{#if editableSchema}
|
|
147
151
|
<div class="p-2 my-1 text-xs border-solid border border-gray-400">
|
|
@@ -164,7 +168,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
164
168
|
use:autosize
|
|
165
169
|
rows="1"
|
|
166
170
|
bind:value={description}
|
|
167
|
-
on:keydown|stopPropagation
|
|
171
|
+
on:keydown|stopPropagation
|
|
168
172
|
placeholder="Field description"
|
|
169
173
|
/>
|
|
170
174
|
{#if type == 'string' && format != 'date-time'}
|
|
@@ -177,6 +181,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
177
181
|
<select bind:value={itemsType}>
|
|
178
182
|
<option value={undefined}>No specific item type</option>
|
|
179
183
|
<option value={{ type: 'string' }}> Items are strings</option>
|
|
184
|
+
<option value={{ type: 'object' }}> Items are objects (JSON)</option>
|
|
180
185
|
<option value={{ type: 'number' }}>Items are numbers</option>
|
|
181
186
|
<option value={{ type: 'string', contentEncoding: 'base64' }}
|
|
182
187
|
>Items are bytes</option
|
|
@@ -211,7 +216,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
211
216
|
<input
|
|
212
217
|
{autofocus}
|
|
213
218
|
on:focus={(e) => {
|
|
214
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
215
219
|
dispatch('focus')
|
|
216
220
|
}}
|
|
217
221
|
{disabled}
|
|
@@ -223,14 +227,12 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
223
227
|
bind:value
|
|
224
228
|
min={extra['min']}
|
|
225
229
|
max={extra['max']}
|
|
226
|
-
on:input={() => dispatch('input', { value, isRaw: true })}
|
|
227
230
|
/>
|
|
228
231
|
{/if}
|
|
229
232
|
{:else if inputCat == 'boolean'}
|
|
230
233
|
<Toggle
|
|
231
234
|
on:pointerdown={(e) => {
|
|
232
235
|
e?.stopPropagation()
|
|
233
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
234
236
|
}}
|
|
235
237
|
{disabled}
|
|
236
238
|
class={valid
|
|
@@ -242,44 +244,46 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
242
244
|
<span> Not set</span>
|
|
243
245
|
{/if}
|
|
244
246
|
{:else if inputCat == 'list'}
|
|
245
|
-
<div>
|
|
246
|
-
<div>
|
|
247
|
-
{#
|
|
248
|
-
|
|
249
|
-
{#
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
247
|
+
<div class="w-full">
|
|
248
|
+
<div class="w-full">
|
|
249
|
+
{#key redraw}
|
|
250
|
+
{#if Array.isArray(value)}
|
|
251
|
+
{#each value ?? [] as v, i}
|
|
252
|
+
<div class="flex max-w-md mt-1 w-full items-center">
|
|
253
|
+
{#if itemsType?.type == 'number'}
|
|
254
|
+
<input type="number" bind:value={v} />
|
|
255
|
+
{:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'}
|
|
256
|
+
<input
|
|
257
|
+
type="file"
|
|
258
|
+
class="my-6"
|
|
259
|
+
on:change={(x) => fileChanged(x, (val) => (value[i] = val))}
|
|
260
|
+
multiple={false}
|
|
261
|
+
/>
|
|
262
|
+
{:else if itemsType?.type == 'object'}
|
|
263
|
+
<JsonEditor code={JSON.stringify(v, null, 2)} bind:value={v} />
|
|
264
|
+
{:else}
|
|
265
|
+
<input type="text" bind:value={v} />
|
|
266
|
+
{/if}
|
|
267
|
+
<button
|
|
268
|
+
transition:fade|local={{ duration: 100 }}
|
|
269
|
+
class="rounded-full p-1 bg-white/60 duration-200 hover:bg-gray-200"
|
|
270
|
+
aria-label="Clear"
|
|
271
|
+
on:click={() => {
|
|
272
|
+
value.splice(i, 1)
|
|
273
|
+
redraw += 1
|
|
274
|
+
}}
|
|
275
|
+
>
|
|
276
|
+
<X size={14} />
|
|
277
|
+
</button>
|
|
278
|
+
</div>
|
|
279
|
+
{/each}
|
|
280
|
+
{/if}
|
|
281
|
+
{/key}
|
|
278
282
|
</div>
|
|
279
283
|
<Button
|
|
280
284
|
variant="border"
|
|
281
|
-
color="
|
|
282
|
-
size="
|
|
285
|
+
color="dark"
|
|
286
|
+
size="xs"
|
|
283
287
|
btnClasses="mt-1"
|
|
284
288
|
on:click={() => {
|
|
285
289
|
if (value == undefined || !Array.isArray(value)) {
|
|
@@ -291,9 +295,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
291
295
|
<Icon data={faPlus} class="mr-2" />
|
|
292
296
|
Add item
|
|
293
297
|
</Button>
|
|
294
|
-
<span class="ml-2">
|
|
295
|
-
{(value ?? []).length} item{(value ?? []).length > 1 ? 's' : ''}
|
|
296
|
-
</span>
|
|
297
298
|
</div>
|
|
298
299
|
{:else if inputCat == 'resource-object'}
|
|
299
300
|
<ObjectResourceInput {format} bind:value />
|
|
@@ -306,32 +307,21 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
306
307
|
bind:args={value}
|
|
307
308
|
/>
|
|
308
309
|
</div>
|
|
310
|
+
{:else if disabled}
|
|
311
|
+
<textarea disabled />
|
|
309
312
|
{:else}
|
|
310
|
-
<
|
|
311
|
-
bind:
|
|
313
|
+
<JsonEditor
|
|
314
|
+
bind:editor
|
|
312
315
|
on:focus={(e) => {
|
|
313
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
314
316
|
dispatch('focus')
|
|
315
317
|
}}
|
|
316
|
-
{
|
|
317
|
-
|
|
318
|
-
use:autosize
|
|
319
|
-
on:keydown|stopPropagation
|
|
320
|
-
style="max-height: {maxHeight}"
|
|
321
|
-
on:input={() => {
|
|
322
|
-
dispatch('input', { rawValue: value, isRaw: false })
|
|
323
|
-
}}
|
|
324
|
-
class="col-span-10 {valid
|
|
325
|
-
? ''
|
|
326
|
-
: 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
|
|
327
|
-
placeholder={defaultValue ? JSON.stringify(defaultValue, null, 4) : ''}
|
|
328
|
-
bind:value={rawValue}
|
|
318
|
+
code={rawValue}
|
|
319
|
+
bind:value
|
|
329
320
|
/>
|
|
330
321
|
{/if}
|
|
331
322
|
{:else if inputCat == 'enum'}
|
|
332
323
|
<select
|
|
333
324
|
on:focus={(e) => {
|
|
334
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
335
325
|
dispatch('focus')
|
|
336
326
|
}}
|
|
337
327
|
{disabled}
|
|
@@ -348,16 +338,11 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
348
338
|
<div class="border my-1 mb-4 w-full border-gray-400">
|
|
349
339
|
<SimpleEditor
|
|
350
340
|
on:focus={(e) => {
|
|
351
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
352
341
|
dispatch('focus')
|
|
353
342
|
}}
|
|
354
|
-
on:blur={() => dispatch('blur')}
|
|
355
343
|
bind:this={editor}
|
|
356
344
|
lang={inputCat}
|
|
357
345
|
bind:code={value}
|
|
358
|
-
on:change={async () => {
|
|
359
|
-
dispatch('input', { rawValue: value, isRaw: false })
|
|
360
|
-
}}
|
|
361
346
|
autoHeight
|
|
362
347
|
/>
|
|
363
348
|
</div>
|
|
@@ -387,12 +372,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
387
372
|
rows="1"
|
|
388
373
|
bind:this={el}
|
|
389
374
|
on:focus={(e) => {
|
|
390
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
391
375
|
dispatch('focus')
|
|
392
376
|
}}
|
|
393
|
-
on:blur={() => dispatch('blur')}
|
|
394
377
|
use:autosize
|
|
395
|
-
on:keydown|stopPropagation
|
|
378
|
+
on:keydown|stopPropagation
|
|
396
379
|
type="text"
|
|
397
380
|
{disabled}
|
|
398
381
|
class="col-span-10 {valid
|
|
@@ -400,9 +383,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
400
383
|
: 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
|
|
401
384
|
placeholder={defaultValue ?? ''}
|
|
402
385
|
bind:value
|
|
403
|
-
on:input={() => {
|
|
404
|
-
dispatch('input', { rawValue: value, isRaw: false })
|
|
405
|
-
}}
|
|
406
386
|
/>
|
|
407
387
|
{#if itemPicker}
|
|
408
388
|
<div class="ml-1 relative">
|
|
@@ -20,7 +20,7 @@ declare const __propDef: {
|
|
|
20
20
|
disabled?: boolean | undefined;
|
|
21
21
|
editableSchema?: boolean | undefined;
|
|
22
22
|
itemsType?: {
|
|
23
|
-
type?: "string" | "number" | "bytes" | undefined;
|
|
23
|
+
type?: "string" | "number" | "object" | "bytes" | undefined;
|
|
24
24
|
contentEncoding?: "base64" | undefined;
|
|
25
25
|
} | undefined;
|
|
26
26
|
displayHeader?: boolean | undefined;
|
|
@@ -42,8 +42,6 @@ declare const __propDef: {
|
|
|
42
42
|
events: {
|
|
43
43
|
keydown: KeyboardEvent;
|
|
44
44
|
focus: CustomEvent<any>;
|
|
45
|
-
input: CustomEvent<any>;
|
|
46
|
-
blur: CustomEvent<any>;
|
|
47
45
|
} & {
|
|
48
46
|
[evt: string]: CustomEvent<any>;
|
|
49
47
|
};
|
|
@@ -75,23 +75,6 @@ let payload = '';
|
|
|
75
75
|
let jsonViewer;
|
|
76
76
|
</script>
|
|
77
77
|
|
|
78
|
-
<Portal>
|
|
79
|
-
<Drawer bind:this={jsonViewer} size="900px">
|
|
80
|
-
<DrawerContent title="Expanded Result" on:close={jsonViewer.closeDrawer}>
|
|
81
|
-
<svelte:fragment slot="actions">
|
|
82
|
-
<Button
|
|
83
|
-
on:click={() => copyToClipboard(JSON.stringify(result, null, 4))}
|
|
84
|
-
color="light"
|
|
85
|
-
size="xs"
|
|
86
|
-
>
|
|
87
|
-
<div class="flex gap-2 items-center">Copy to clipboard <ClipboardCopy /> </div>
|
|
88
|
-
</Button>
|
|
89
|
-
</svelte:fragment>
|
|
90
|
-
<Highlight language={json} code={JSON.stringify(result, null, 4).replace(/\\n/g, '\n')} />
|
|
91
|
-
</DrawerContent>
|
|
92
|
-
</Drawer>
|
|
93
|
-
</Portal>
|
|
94
|
-
|
|
95
78
|
<div class="inline-highlight">
|
|
96
79
|
{#if result != undefined}
|
|
97
80
|
{#if resultKind && resultKind != 'json'}
|
|
@@ -237,3 +220,20 @@ let jsonViewer;
|
|
|
237
220
|
<div class="text-gray-500 text-sm">No result: {JSON.stringify(result)}</div>
|
|
238
221
|
{/if}
|
|
239
222
|
</div>
|
|
223
|
+
|
|
224
|
+
<Portal>
|
|
225
|
+
<Drawer bind:this={jsonViewer} size="900px">
|
|
226
|
+
<DrawerContent title="Expanded Result" on:close={jsonViewer.closeDrawer}>
|
|
227
|
+
<svelte:fragment slot="actions">
|
|
228
|
+
<Button
|
|
229
|
+
on:click={() => copyToClipboard(JSON.stringify(result, null, 4))}
|
|
230
|
+
color="light"
|
|
231
|
+
size="xs"
|
|
232
|
+
>
|
|
233
|
+
<div class="flex gap-2 items-center">Copy to clipboard <ClipboardCopy /> </div>
|
|
234
|
+
</Button>
|
|
235
|
+
</svelte:fragment>
|
|
236
|
+
<Highlight language={json} code={JSON.stringify(result, null, 4).replace(/\\n/g, '\n')} />
|
|
237
|
+
</DrawerContent>
|
|
238
|
+
</Drawer>
|
|
239
|
+
</Portal>
|
package/components/Editor.svelte
CHANGED
|
@@ -6,10 +6,6 @@ declare const __propDef: {
|
|
|
6
6
|
contentEncoding?: string | undefined;
|
|
7
7
|
type?: string | undefined;
|
|
8
8
|
required?: boolean | undefined;
|
|
9
|
-
itemsType?: {
|
|
10
|
-
type?: "string" | "number" | "bytes" | undefined;
|
|
11
|
-
contentEncoding?: "base64" | undefined;
|
|
12
|
-
} | undefined;
|
|
13
9
|
};
|
|
14
10
|
events: {
|
|
15
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -114,6 +114,7 @@ async function saveFlow(leave) {
|
|
|
114
114
|
goto(`/flows/get/${$flowStore.path}?workspace_id=${$workspaceStore}`);
|
|
115
115
|
}
|
|
116
116
|
else if (initialPath !== $flowStore.path) {
|
|
117
|
+
initialPath = $flowStore.path;
|
|
117
118
|
goto(`/flows/edit/${$flowStore.path}?workspace_id=${$workspaceStore}`);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
@@ -175,6 +176,11 @@ $: selectedId && select(selectedId);
|
|
|
175
176
|
$: initialPath && $workspaceStore && loadSchedule();
|
|
176
177
|
loadHubScripts();
|
|
177
178
|
function onKeyDown(event) {
|
|
179
|
+
let classes = event.target?.['className'];
|
|
180
|
+
if ((typeof classes === 'string' && classes.includes('inputarea')) ||
|
|
181
|
+
['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
178
184
|
switch (event.key) {
|
|
179
185
|
case 'Z':
|
|
180
186
|
if (event.ctrlKey) {
|
|
@@ -18,6 +18,7 @@ import SimpleEditor from './SimpleEditor.svelte';
|
|
|
18
18
|
import { Loader2 } from 'lucide-svelte';
|
|
19
19
|
const dispatch = createEventDispatcher();
|
|
20
20
|
export let jobId;
|
|
21
|
+
export let workspaceId = undefined;
|
|
21
22
|
export let flowState = undefined;
|
|
22
23
|
export let flowJobIds = undefined;
|
|
23
24
|
export let job = undefined;
|
|
@@ -73,7 +74,7 @@ function updateInnerModules() {
|
|
|
73
74
|
else if (mod.type === FlowStatusModule.type.WAITING_FOR_EXECUTOR &&
|
|
74
75
|
localFlowModuleStates[mod.id ?? '']?.scheduled_for == undefined) {
|
|
75
76
|
JobService.getJob({
|
|
76
|
-
workspace: $workspaceStore ?? '',
|
|
77
|
+
workspace: workspaceId ?? $workspaceStore ?? '',
|
|
77
78
|
id: mod.job ?? ''
|
|
78
79
|
}).then((job) => {
|
|
79
80
|
localFlowModuleStates[mod.id ?? ''] = {
|
|
@@ -92,7 +93,7 @@ async function loadJobInProgress() {
|
|
|
92
93
|
if (jobId != '00000000-0000-0000-0000-000000000000') {
|
|
93
94
|
try {
|
|
94
95
|
const newJob = await JobService.getJob({
|
|
95
|
-
workspace: $workspaceStore ?? '',
|
|
96
|
+
workspace: workspaceId ?? $workspaceStore ?? '',
|
|
96
97
|
id: jobId ?? ''
|
|
97
98
|
});
|
|
98
99
|
if (JSON.stringify(newJob) !== JSON.stringify(job)) {
|
|
@@ -124,7 +125,7 @@ onDestroy(() => {
|
|
|
124
125
|
timeout && clearTimeout(timeout);
|
|
125
126
|
});
|
|
126
127
|
async function loadOwner(path) {
|
|
127
|
-
is_owner = await isOwner(path, $userStore, $workspaceStore);
|
|
128
|
+
is_owner = await isOwner(path, $userStore, workspaceId ?? $workspaceStore);
|
|
128
129
|
}
|
|
129
130
|
let selected = 'graph';
|
|
130
131
|
let payload = '"a test payload in json"';
|
|
@@ -170,7 +171,7 @@ function isSuccess(arg) {
|
|
|
170
171
|
variant="border"
|
|
171
172
|
on:click={async () =>
|
|
172
173
|
await JobService.resumeSuspendedFlowAsOwner({
|
|
173
|
-
workspace: $workspaceStore ?? '',
|
|
174
|
+
workspace: workspaceId ?? $workspaceStore ?? '',
|
|
174
175
|
id: job?.id ?? '',
|
|
175
176
|
requestBody: JSON.parse(payload)
|
|
176
177
|
})}
|
|
@@ -268,6 +269,7 @@ function isSuccess(arg) {
|
|
|
268
269
|
</Button>
|
|
269
270
|
<div class="border p-6" class:hidden={forloop_selected != loopJobId}>
|
|
270
271
|
<svelte:self
|
|
272
|
+
{workspaceId}
|
|
271
273
|
bind:suspend_status
|
|
272
274
|
bind:retry_status
|
|
273
275
|
bind:flowState
|
|
@@ -342,6 +344,7 @@ function isSuccess(arg) {
|
|
|
342
344
|
<li class="w-full border border-gray-600 p-6 space-y-2 bg-blue-50/50">
|
|
343
345
|
{#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
|
|
344
346
|
<svelte:self
|
|
347
|
+
{workspaceId}
|
|
345
348
|
bind:suspend_status
|
|
346
349
|
bind:retry_status
|
|
347
350
|
bind:flowState
|
|
@@ -52,7 +52,6 @@ function toAny(x) {
|
|
|
52
52
|
type={toAny(v)?.type}
|
|
53
53
|
contentEncoding={toAny(v)?.contentEncoding}
|
|
54
54
|
format={toAny(v)?.format}
|
|
55
|
-
itemsType={toAny(v)?.itemsType}
|
|
56
55
|
/><span class="ml-4 mt-2 text-xs"
|
|
57
56
|
>{toAny(v)?.default != undefined
|
|
58
57
|
? 'default: ' + JSON.stringify(toAny(v)?.default)
|
|
@@ -104,7 +104,6 @@ $: schema.properties[argName].default && setDefaultCode();
|
|
|
104
104
|
contentEncoding={schema.properties[argName].contentEncoding}
|
|
105
105
|
required={schema.required.includes(argName)}
|
|
106
106
|
type={schema.properties[argName].type}
|
|
107
|
-
itemsType={schema.properties[argName].items}
|
|
108
107
|
/>
|
|
109
108
|
|
|
110
109
|
{#if isStaticTemplate(inputCat)}
|
|
@@ -122,7 +122,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
122
122
|
<div class="flex flex-col w-full min-w-[250px]">
|
|
123
123
|
<div>
|
|
124
124
|
{#if displayHeader}
|
|
125
|
-
<FieldHeader {label} {required} {type} {contentEncoding} {format}
|
|
125
|
+
<FieldHeader {label} {required} {type} {contentEncoding} {format} />
|
|
126
126
|
{/if}
|
|
127
127
|
|
|
128
128
|
{#if description}
|
|
@@ -145,7 +145,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
145
145
|
{:else}
|
|
146
146
|
<input
|
|
147
147
|
on:focus={(e) => {
|
|
148
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
149
148
|
dispatch('focus')
|
|
150
149
|
}}
|
|
151
150
|
type="number"
|
|
@@ -156,14 +155,12 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
156
155
|
bind:value
|
|
157
156
|
min={extra['min']}
|
|
158
157
|
max={extra['max']}
|
|
159
|
-
on:input={() => dispatch('input', { value, isRaw: true })}
|
|
160
158
|
/>
|
|
161
159
|
{/if}
|
|
162
160
|
{:else if inputCat == 'boolean'}
|
|
163
161
|
<Toggle
|
|
164
162
|
on:pointerdown={(e) => {
|
|
165
163
|
e?.stopPropagation()
|
|
166
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
167
164
|
}}
|
|
168
165
|
class={valid
|
|
169
166
|
? ''
|
|
@@ -240,14 +237,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
240
237
|
<textarea
|
|
241
238
|
bind:this={el}
|
|
242
239
|
on:focus={(e) => {
|
|
243
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
244
240
|
dispatch('focus')
|
|
245
241
|
}}
|
|
246
242
|
use:autosize
|
|
247
243
|
style="max-height: {maxHeight}"
|
|
248
|
-
on:input={() => {
|
|
249
|
-
dispatch('input', { rawValue: value, isRaw: false })
|
|
250
|
-
}}
|
|
251
244
|
class="col-span-10 {valid
|
|
252
245
|
? ''
|
|
253
246
|
: 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
|
|
@@ -258,7 +251,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
258
251
|
{:else if inputCat == 'enum'}
|
|
259
252
|
<select
|
|
260
253
|
on:focus={(e) => {
|
|
261
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
262
254
|
dispatch('focus')
|
|
263
255
|
}}
|
|
264
256
|
class="px-6"
|
|
@@ -291,10 +283,8 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
291
283
|
rows="1"
|
|
292
284
|
bind:this={el}
|
|
293
285
|
on:focus={(e) => {
|
|
294
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
295
286
|
dispatch('focus')
|
|
296
287
|
}}
|
|
297
|
-
on:blur={() => dispatch('blur')}
|
|
298
288
|
use:autosize
|
|
299
289
|
type="text"
|
|
300
290
|
class="col-span-10 {valid
|
|
@@ -302,9 +292,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
302
292
|
: 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
|
|
303
293
|
placeholder={defaultValue ?? ''}
|
|
304
294
|
bind:value
|
|
305
|
-
on:input={() => {
|
|
306
|
-
dispatch('input', { rawValue: value, isRaw: false })
|
|
307
|
-
}}
|
|
308
295
|
/>
|
|
309
296
|
</div>
|
|
310
297
|
</div>
|
|
@@ -15,7 +15,7 @@ declare const __propDef: {
|
|
|
15
15
|
maxRows?: number | undefined;
|
|
16
16
|
enum_?: string[] | undefined;
|
|
17
17
|
itemsType?: {
|
|
18
|
-
type?: "string" | "number" | "bytes" | undefined;
|
|
18
|
+
type?: "string" | "number" | "object" | "bytes" | undefined;
|
|
19
19
|
contentEncoding?: "base64" | undefined;
|
|
20
20
|
} | undefined;
|
|
21
21
|
displayHeader?: boolean | undefined;
|
|
@@ -28,8 +28,6 @@ declare const __propDef: {
|
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
30
30
|
focus: CustomEvent<any>;
|
|
31
|
-
input: CustomEvent<any>;
|
|
32
|
-
blur: CustomEvent<any>;
|
|
33
31
|
} & {
|
|
34
32
|
[evt: string]: CustomEvent<any>;
|
|
35
33
|
};
|
package/components/Toggle.svelte
CHANGED
|
@@ -32,7 +32,7 @@ const dispatch = createEventDispatcher();
|
|
|
32
32
|
</span>
|
|
33
33
|
{/if}
|
|
34
34
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
35
|
-
<div class="relative" on:
|
|
35
|
+
<div class="relative" on:click|stopPropagation>
|
|
36
36
|
<input
|
|
37
37
|
on:focus
|
|
38
38
|
on:click
|
|
@@ -32,8 +32,6 @@ if (controls) {
|
|
|
32
32
|
$componentControl[id] = controls;
|
|
33
33
|
}
|
|
34
34
|
let runnableComponent;
|
|
35
|
-
let isLoading = false;
|
|
36
|
-
let ownClick = false;
|
|
37
35
|
let beforeIconComponent;
|
|
38
36
|
let afterIconComponent;
|
|
39
37
|
$: resolvedConfig.beforeIcon && handleBeforeIcon();
|
|
@@ -49,19 +47,6 @@ async function handleAfterIcon() {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
$: resolvedConfig?.triggerOnAppLoad && runnableComponent?.runComponent();
|
|
52
|
-
$: if (outputs?.loading != undefined) {
|
|
53
|
-
outputs.loading.set(false, true);
|
|
54
|
-
}
|
|
55
|
-
$: outputs?.loading.subscribe({
|
|
56
|
-
id: 'loading-' + id,
|
|
57
|
-
next: (value) => {
|
|
58
|
-
isLoading = value;
|
|
59
|
-
if (ownClick && !value) {
|
|
60
|
-
ownClick = false;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
$: loading = isLoading && ownClick;
|
|
65
50
|
let errors = {};
|
|
66
51
|
$: errorsMessage = Object.values(errors)
|
|
67
52
|
.filter((x) => x != '')
|
|
@@ -70,11 +55,10 @@ let runnableWrapper;
|
|
|
70
55
|
async function handleClick(event) {
|
|
71
56
|
event?.stopPropagation();
|
|
72
57
|
event?.preventDefault();
|
|
73
|
-
$selectedComponent = id;
|
|
58
|
+
$selectedComponent = [id];
|
|
74
59
|
if (preclickAction) {
|
|
75
60
|
await preclickAction();
|
|
76
61
|
}
|
|
77
|
-
ownClick = true;
|
|
78
62
|
if (!runnableComponent) {
|
|
79
63
|
runnableWrapper.onSuccess();
|
|
80
64
|
}
|
|
@@ -82,6 +66,7 @@ async function handleClick(event) {
|
|
|
82
66
|
await runnableComponent?.runComponent();
|
|
83
67
|
}
|
|
84
68
|
}
|
|
69
|
+
let loading = false;
|
|
85
70
|
</script>
|
|
86
71
|
|
|
87
72
|
{#each Object.keys(components['buttoncomponent'].initialData.configuration) as key (key)}
|
|
@@ -100,6 +85,7 @@ async function handleClick(event) {
|
|
|
100
85
|
bind:this={runnableWrapper}
|
|
101
86
|
{recomputeIds}
|
|
102
87
|
bind:runnableComponent
|
|
88
|
+
bind:loading
|
|
103
89
|
{componentInput}
|
|
104
90
|
doOnSuccess={resolvedConfig.onSuccess}
|
|
105
91
|
{id}
|