windmill-components 1.82.12 → 1.83.0

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.
Files changed (104) hide show
  1. package/common.d.ts +2 -2
  2. package/components/ArgInput.svelte +52 -66
  3. package/components/ArgInput.svelte.d.ts +1 -3
  4. package/components/DisplayResult.svelte +17 -17
  5. package/components/Editor.svelte +0 -3
  6. package/components/Editor.svelte.d.ts +0 -1
  7. package/components/FieldHeader.svelte +0 -1
  8. package/components/FieldHeader.svelte.d.ts +0 -4
  9. package/components/FlowBuilder.svelte +1 -0
  10. package/components/FlowStatusViewer.svelte +7 -4
  11. package/components/FlowStatusViewer.svelte.d.ts +1 -0
  12. package/components/FlowViewer.svelte +0 -1
  13. package/components/InputTransformForm.svelte +0 -1
  14. package/components/LightweightArgInput.svelte +1 -9
  15. package/components/LightweightArgInput.svelte.d.ts +1 -3
  16. package/components/SimpleEditor.svelte +0 -1
  17. package/components/SimpleEditor.svelte.d.ts +0 -1
  18. package/components/TemplateEditor.svelte +0 -1
  19. package/components/apps/components/display/AppDisplayComponent.svelte +23 -17
  20. package/components/apps/components/display/AppHtml.svelte +7 -1
  21. package/components/apps/components/display/AppHtml.svelte.d.ts +2 -0
  22. package/components/apps/components/display/PlotlyHtml.svelte +20 -3
  23. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +2 -0
  24. package/components/apps/components/display/table/AppTable.svelte +54 -35
  25. package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
  26. package/components/apps/components/display/table/AppTableFooter.svelte +2 -1
  27. package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +1 -0
  28. package/components/apps/components/display/table/tableOptions.js +1 -1
  29. package/components/apps/components/helpers/DebouncedInput.svelte +1 -0
  30. package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +2 -0
  31. package/components/apps/components/helpers/InputValue.svelte +3 -3
  32. package/components/apps/components/helpers/RunnableComponent.svelte +2 -2
  33. package/components/apps/components/helpers/RunnableWrapper.svelte +1 -1
  34. package/components/apps/components/helpers/eval.d.ts +4 -2
  35. package/components/apps/components/helpers/eval.js +6 -4
  36. package/components/apps/components/inputs/AppMultiSelect.svelte +11 -3
  37. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +0 -2
  38. package/components/apps/components/inputs/AppSelect.svelte +9 -1
  39. package/components/apps/components/inputs/AppSelect.svelte.d.ts +0 -2
  40. package/components/apps/components/inputs/AppTextInput.svelte +52 -39
  41. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -1
  42. package/components/apps/components/layout/AppContainer.svelte +1 -1
  43. package/components/apps/editor/AppEditor.svelte +31 -4
  44. package/components/apps/editor/AppPreview.svelte +13 -2
  45. package/components/apps/editor/GridEditor.svelte +12 -3
  46. package/components/apps/editor/GridViewer.svelte +2 -2
  47. package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
  48. package/components/apps/editor/SettingsPanel.svelte +1 -1
  49. package/components/apps/editor/SubGridEditor.svelte +3 -2
  50. package/components/apps/editor/appUtils.d.ts +1 -0
  51. package/components/apps/editor/appUtils.js +19 -0
  52. package/components/apps/editor/component/Component.svelte +14 -4
  53. package/components/apps/editor/component/Component.svelte.d.ts +1 -1
  54. package/components/apps/editor/component/components.d.ts +45 -28
  55. package/components/apps/editor/component/components.js +41 -27
  56. package/components/apps/editor/component/sets.js +2 -1
  57. package/components/apps/editor/componentsPanel/CssProperty.svelte +0 -26
  58. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +0 -2
  59. package/components/apps/editor/componentsPanel/CssSettings.svelte +1 -0
  60. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +13 -10
  61. package/components/apps/editor/componentsPanel/quickStyleProperties.js +3 -0
  62. package/components/apps/editor/componentsPanel/store.js +4 -4
  63. package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -26
  64. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +0 -1
  65. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +8 -6
  66. package/components/apps/editor/contextPanel/ContextPanel.svelte +7 -14
  67. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +2 -25
  68. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +28 -42
  69. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +1 -2
  70. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +2 -7
  71. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
  72. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +7 -8
  73. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +4 -3
  74. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
  75. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +0 -1
  76. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +2 -0
  77. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +22 -19
  78. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +18 -3
  79. package/components/apps/editor/settingsPanel/GridTab.svelte +1 -2
  80. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
  81. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +4 -0
  82. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -0
  83. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +1 -2
  84. package/components/apps/editor/settingsPanel/StylePanel.svelte +40 -2
  85. package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +5 -1
  86. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
  87. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +3 -2
  88. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +4 -1
  89. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +2 -2
  90. package/components/apps/inputType.d.ts +2 -2
  91. package/components/apps/rx.d.ts +2 -2
  92. package/components/apps/svelte-grid/Grid.svelte +9 -12
  93. package/components/apps/svelte-grid/Grid.svelte.d.ts +1 -6
  94. package/components/apps/svelte-grid/MoveResize.svelte +3 -2
  95. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +1 -8
  96. package/components/apps/types.d.ts +1 -1
  97. package/components/apps/utils.js +3 -0
  98. package/components/flows/map/MapItem.svelte +3 -3
  99. package/components/propertyPicker/ObjectViewer.svelte +0 -3
  100. package/components/scriptEditor/LogPanel.svelte +3 -3
  101. package/infer.js +3 -0
  102. package/package.json +671 -672
  103. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +0 -25
  104. 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 "./gen";
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, 4);
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} {itemsType} />
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
@@ -222,7 +227,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
222
227
  bind:value
223
228
  min={extra['min']}
224
229
  max={extra['max']}
225
- on:input={() => dispatch('input', { value, isRaw: true })}
226
230
  />
227
231
  {/if}
228
232
  {:else if inputCat == 'boolean'}
@@ -240,44 +244,46 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
240
244
  <span>&nbsp; Not set</span>
241
245
  {/if}
242
246
  {:else if inputCat == 'list'}
243
- <div>
244
- <div>
245
- {#each value ?? [] as v, i}
246
- <div class="flex flex-row max-w-md mt-1">
247
- {#if itemsType?.type == 'number'}
248
- <input autofocus={autofocus && i == 0} type="number" bind:value={v} />
249
- {:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'}
250
- <input
251
- autofocus={autofocus && i == 0}
252
- type="file"
253
- class="my-6"
254
- on:change={(x) => fileChanged(x, (val) => (value[i] = val))}
255
- multiple={false}
256
- />
257
- {:else}
258
- <input autofocus={autofocus && i == 0} type="text" bind:value={v} />
259
- {/if}
260
- <Button
261
- variant="border"
262
- color="red"
263
- size="sm"
264
- btnClasses="mx-6"
265
- on:click={() => {
266
- value = value.filter((el) => el != v)
267
- if (value.length == 0) {
268
- value = []
269
- }
270
- }}
271
- >
272
- <Icon data={faMinus} />
273
- </Button>
274
- </div>
275
- {/each}
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}
276
282
  </div>
277
283
  <Button
278
284
  variant="border"
279
- color="blue"
280
- size="sm"
285
+ color="dark"
286
+ size="xs"
281
287
  btnClasses="mt-1"
282
288
  on:click={() => {
283
289
  if (value == undefined || !Array.isArray(value)) {
@@ -289,9 +295,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
289
295
  <Icon data={faPlus} class="mr-2" />
290
296
  Add item
291
297
  </Button>
292
- <span class="ml-2">
293
- {(value ?? []).length} item{(value ?? []).length > 1 ? 's' : ''}
294
- </span>
295
298
  </div>
296
299
  {:else if inputCat == 'resource-object'}
297
300
  <ObjectResourceInput {format} bind:value />
@@ -304,25 +307,16 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
304
307
  bind:args={value}
305
308
  />
306
309
  </div>
310
+ {:else if disabled}
311
+ <textarea disabled />
307
312
  {:else}
308
- <textarea
309
- bind:this={el}
313
+ <JsonEditor
314
+ bind:editor
310
315
  on:focus={(e) => {
311
316
  dispatch('focus')
312
317
  }}
313
- {autofocus}
314
- {disabled}
315
- use:autosize
316
- on:keydown|stopPropagation
317
- style="max-height: {maxHeight}"
318
- on:input={() => {
319
- dispatch('input', { rawValue: value, isRaw: false })
320
- }}
321
- class="col-span-10 {valid
322
- ? ''
323
- : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
324
- placeholder={defaultValue ? JSON.stringify(defaultValue, null, 4) : ''}
325
- bind:value={rawValue}
318
+ code={rawValue}
319
+ bind:value
326
320
  />
327
321
  {/if}
328
322
  {:else if inputCat == 'enum'}
@@ -346,13 +340,9 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
346
340
  on:focus={(e) => {
347
341
  dispatch('focus')
348
342
  }}
349
- on:blur={() => dispatch('blur')}
350
343
  bind:this={editor}
351
344
  lang={inputCat}
352
345
  bind:code={value}
353
- on:change={async () => {
354
- dispatch('input', { rawValue: value, isRaw: false })
355
- }}
356
346
  autoHeight
357
347
  />
358
348
  </div>
@@ -384,9 +374,8 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
384
374
  on:focus={(e) => {
385
375
  dispatch('focus')
386
376
  }}
387
- on:blur={() => dispatch('blur')}
388
377
  use:autosize
389
- on:keydown|stopPropagation
378
+ on:keydown|stopPropagation
390
379
  type="text"
391
380
  {disabled}
392
381
  class="col-span-10 {valid
@@ -394,9 +383,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
394
383
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
395
384
  placeholder={defaultValue ?? ''}
396
385
  bind:value
397
- on:input={() => {
398
- dispatch('input', { rawValue: value, isRaw: false })
399
- }}
400
386
  />
401
387
  {#if itemPicker}
402
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>
@@ -394,9 +394,6 @@ async function loadMonaco() {
394
394
  reloadWebsocket();
395
395
  }
396
396
  });
397
- editor.onDidBlurEditorText(() => {
398
- dispatch('blur');
399
- });
400
397
  reloadWebsocket();
401
398
  return () => {
402
399
  try {
@@ -30,7 +30,6 @@ declare const __propDef: {
30
30
  events: {
31
31
  change: CustomEvent<any>;
32
32
  focus: CustomEvent<any>;
33
- blur: CustomEvent<any>;
34
33
  } & {
35
34
  [evt: string]: CustomEvent<any>;
36
35
  };
@@ -4,7 +4,6 @@ export let format = '';
4
4
  export let contentEncoding = '';
5
5
  export let type = undefined;
6
6
  export let required = false;
7
- export let itemsType = undefined;
8
7
  </script>
9
8
 
10
9
  <div class="inline-flex flex-row items-center truncated">
@@ -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
  }
@@ -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
@@ -5,6 +5,7 @@ import { type GraphModuleState } from './graph';
5
5
  declare const __propDef: {
6
6
  props: {
7
7
  jobId: string;
8
+ workspaceId?: string | undefined;
8
9
  flowState?: FlowState | undefined;
9
10
  flowJobIds?: {
10
11
  moduleId: string;
@@ -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} {itemsType} />
125
+ <FieldHeader {label} {required} {type} {contentEncoding} {format} />
126
126
  {/if}
127
127
 
128
128
  {#if description}
@@ -155,7 +155,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
155
155
  bind:value
156
156
  min={extra['min']}
157
157
  max={extra['max']}
158
- on:input={() => dispatch('input', { value, isRaw: true })}
159
158
  />
160
159
  {/if}
161
160
  {:else if inputCat == 'boolean'}
@@ -242,9 +241,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
242
241
  }}
243
242
  use:autosize
244
243
  style="max-height: {maxHeight}"
245
- on:input={() => {
246
- dispatch('input', { rawValue: value, isRaw: false })
247
- }}
248
244
  class="col-span-10 {valid
249
245
  ? ''
250
246
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
@@ -289,7 +285,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
289
285
  on:focus={(e) => {
290
286
  dispatch('focus')
291
287
  }}
292
- on:blur={() => dispatch('blur')}
293
288
  use:autosize
294
289
  type="text"
295
290
  class="col-span-10 {valid
@@ -297,9 +292,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
297
292
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
298
293
  placeholder={defaultValue ?? ''}
299
294
  bind:value
300
- on:input={() => {
301
- dispatch('input', { rawValue: value, isRaw: false })
302
- }}
303
295
  />
304
296
  </div>
305
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
  };
@@ -146,7 +146,6 @@ async function loadMonaco() {
146
146
  });
147
147
  editor.onDidBlurEditorText(() => {
148
148
  code = getCode();
149
- dispatch('blur');
150
149
  });
151
150
  if (lang == 'javascript') {
152
151
  const stdLib = { content: libStdContent, filePath: 'es5.d.ts' };
@@ -21,7 +21,6 @@ declare const __propDef: {
21
21
  events: {
22
22
  change: CustomEvent<any>;
23
23
  focus: CustomEvent<any>;
24
- blur: CustomEvent<any>;
25
24
  } & {
26
25
  [evt: string]: CustomEvent<any>;
27
26
  };
@@ -495,7 +495,6 @@ async function loadMonaco() {
495
495
  });
496
496
  editor.onDidBlurEditorText(() => {
497
497
  code = getCode();
498
- dispatch('blur');
499
498
  });
500
499
  }
501
500
  export function focus() {
@@ -19,22 +19,28 @@ const outputs = initOutput($worldStore, id, {
19
19
  </script>
20
20
 
21
21
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
22
- <div
23
- class={twMerge(
24
- 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
25
- $app.css?.['displaycomponent']?.['header']?.class,
26
- customCss?.header?.class
27
- )}
28
- >
29
- Results
30
- </div>
31
- <div
32
- class={twMerge(
33
- 'p-2',
34
- $app.css?.['displaycomponent']?.['container']?.class,
35
- customCss?.container?.class
36
- )}
37
- >
38
- <DisplayResult {result} {requireHtmlApproval} />
22
+ <div class="flex flex-col w-full h-full">
23
+ <div
24
+ class={twMerge(
25
+ 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
26
+ $app.css?.['displaycomponent']?.['header']?.class,
27
+ customCss?.header?.class
28
+ )}
29
+ >
30
+ Results
31
+ </div>
32
+ <div
33
+ style={twMerge(
34
+ $app.css?.['displaycomponent']?.['container']?.style,
35
+ customCss?.container?.style
36
+ )}
37
+ class={twMerge(
38
+ 'p-2 grow',
39
+ $app.css?.['displaycomponent']?.['container']?.class,
40
+ customCss?.container?.class
41
+ )}
42
+ >
43
+ <DisplayResult {result} {requireHtmlApproval} />
44
+ </div>
39
45
  </div>
40
46
  </RunnableWrapper>
@@ -7,7 +7,7 @@ export let componentInput;
7
7
  export let initializing = undefined;
8
8
  export let customCss = undefined;
9
9
  export let render;
10
- const { app, worldStore } = getContext('AppViewerContext');
10
+ const { app, worldStore, selectedComponent } = getContext('AppViewerContext');
11
11
  const outputs = initOutput($worldStore, id, {
12
12
  result: undefined,
13
13
  loading: false
@@ -26,6 +26,10 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
26
26
  bind:clientHeight={h}
27
27
  bind:clientWidth={w}
28
28
  >
29
+ <button
30
+ class="absolute bottom-0 left-0 text-xs border px-2 py-0.5 bg-white/80"
31
+ on:click={() => ($selectedComponent = [id])}>Select</button
32
+ >
29
33
  <RunnableWrapper
30
34
  {outputs}
31
35
  {render}
@@ -46,5 +50,7 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
46
50
  : 'No html'}
47
51
  />
48
52
  {/key}
53
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
54
+ <div on:click|stopPropagation class="absolute top-0 h-full w-full" />
49
55
  </RunnableWrapper>
50
56
  </div>
@@ -10,6 +10,8 @@ declare const __propDef: {
10
10
  render: boolean;
11
11
  };
12
12
  events: {
13
+ click: MouseEvent;
14
+ } & {
13
15
  [evt: string]: CustomEvent<any>;
14
16
  };
15
17
  slots: {};
@@ -1,12 +1,15 @@
1
1
  <script>import { getContext, onMount } from 'svelte';
2
- import { initOutput } from '../../editor/appUtils';
2
+ import { initConfig, initOutput } from '../../editor/appUtils';
3
+ import { components } from '../../editor/component';
4
+ import ResolveConfig from '../helpers/ResolveConfig.svelte';
3
5
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
4
6
  export let id;
5
7
  export let componentInput;
6
- // export let configuration: Record<string, AppInput>
8
+ export let configuration;
7
9
  export let initializing = undefined;
8
10
  export let render;
9
11
  const { worldStore } = getContext('AppViewerContext');
12
+ let resolvedConfig = initConfig(components['plotlycomponent'].initialData.configuration, configuration);
10
13
  const outputs = initOutput($worldStore, id, {
11
14
  result: undefined,
12
15
  loading: false
@@ -27,9 +30,23 @@ $: Plotly &&
27
30
  divEl &&
28
31
  h &&
29
32
  w &&
30
- Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
33
+ Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], {
34
+ width: w,
35
+ height: h,
36
+ margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 },
37
+ ...resolvedConfig.layout
38
+ }, { responsive: true, displayModeBar: false });
31
39
  </script>
32
40
 
41
+ {#each Object.keys(components['plotlycomponent'].initialData.configuration) as key (key)}
42
+ <ResolveConfig
43
+ {id}
44
+ {key}
45
+ bind:resolvedConfig={resolvedConfig[key]}
46
+ configuration={configuration[key]}
47
+ />
48
+ {/each}
49
+
33
50
  <div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
34
51
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
35
52
  <div on:pointerdown bind:this={divEl} />
@@ -1,9 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
+ import type { RichConfigurations } from '../../types';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  id: string;
6
7
  componentInput: AppInput | undefined;
8
+ configuration: RichConfigurations;
7
9
  initializing?: boolean | undefined;
8
10
  render: boolean;
9
11
  };