windmill-components 1.82.3 → 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.
Files changed (169) hide show
  1. package/common.d.ts +2 -2
  2. package/components/ArgInput.svelte +52 -72
  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 +6 -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 -14
  15. package/components/LightweightArgInput.svelte.d.ts +1 -3
  16. package/components/Multiselect.svelte.d.ts +2 -2
  17. package/components/SimpleEditor.svelte +0 -1
  18. package/components/SimpleEditor.svelte.d.ts +0 -1
  19. package/components/TemplateEditor.svelte +0 -1
  20. package/components/Toggle.svelte +1 -1
  21. package/components/Toggle.svelte.d.ts +0 -1
  22. package/components/apps/components/buttons/AppButton.svelte +3 -17
  23. package/components/apps/components/buttons/AppForm.svelte +2 -10
  24. package/components/apps/components/buttons/AppFormButton.svelte +58 -82
  25. package/components/apps/components/display/AppDisplayComponent.svelte +23 -17
  26. package/components/apps/components/display/AppHtml.svelte +7 -1
  27. package/components/apps/components/display/AppHtml.svelte.d.ts +2 -0
  28. package/components/apps/components/display/AppMap.svelte +1 -1
  29. package/components/apps/components/display/AppPdf.svelte +1 -1
  30. package/components/apps/components/display/PlotlyHtml.svelte +20 -3
  31. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +2 -0
  32. package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
  33. package/components/apps/components/display/table/AppTable.svelte +75 -49
  34. package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
  35. package/components/apps/components/display/table/AppTableFooter.svelte +2 -1
  36. package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +1 -0
  37. package/components/apps/components/display/table/tableOptions.js +1 -1
  38. package/components/apps/components/helpers/DebouncedInput.svelte +1 -0
  39. package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +2 -0
  40. package/components/apps/components/helpers/HiddenComponent.svelte +3 -2
  41. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +2 -1
  42. package/components/apps/components/helpers/InputValue.svelte +3 -3
  43. package/components/apps/components/helpers/RefreshButton.svelte +3 -10
  44. package/components/apps/components/helpers/RefreshButton.svelte.d.ts +1 -0
  45. package/components/apps/components/helpers/RunnableComponent.svelte +19 -15
  46. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
  47. package/components/apps/components/helpers/RunnableWrapper.svelte +3 -1
  48. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
  49. package/components/apps/components/helpers/eval.d.ts +4 -2
  50. package/components/apps/components/helpers/eval.js +6 -4
  51. package/components/apps/components/inputs/AppCheckbox.svelte +0 -4
  52. package/components/apps/components/inputs/AppDateInput.svelte +2 -2
  53. package/components/apps/components/inputs/AppMultiSelect.svelte +13 -5
  54. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +0 -2
  55. package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
  56. package/components/apps/components/inputs/AppSelect.svelte +11 -4
  57. package/components/apps/components/inputs/AppSelect.svelte.d.ts +0 -2
  58. package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
  59. package/components/apps/components/inputs/AppTextInput.svelte +53 -43
  60. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -1
  61. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
  62. package/components/apps/components/layout/AppContainer.svelte +2 -2
  63. package/components/apps/components/layout/AppDrawer.svelte +1 -2
  64. package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
  65. package/components/apps/components/layout/AppTabs.svelte +1 -1
  66. package/components/apps/editor/AppEditor.svelte +49 -21
  67. package/components/apps/editor/AppEditorHeader.svelte +5 -0
  68. package/components/apps/editor/AppPreview.svelte +18 -7
  69. package/components/apps/editor/ComponentHeader.svelte +1 -0
  70. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  71. package/components/apps/editor/GridEditor.svelte +22 -12
  72. package/components/apps/editor/GridViewer.svelte +2 -2
  73. package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
  74. package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
  75. package/components/apps/editor/SettingsPanel.svelte +4 -4
  76. package/components/apps/editor/SubGridEditor.svelte +13 -12
  77. package/components/apps/editor/appUtils.d.ts +1 -0
  78. package/components/apps/editor/appUtils.js +19 -0
  79. package/components/apps/editor/component/Component.svelte +19 -8
  80. package/components/apps/editor/component/Component.svelte.d.ts +1 -1
  81. package/components/apps/editor/component/ComponentNavigation.svelte +55 -46
  82. package/components/apps/editor/component/README.md +4 -0
  83. package/components/apps/editor/component/components.d.ts +45 -28
  84. package/components/apps/editor/component/components.js +41 -27
  85. package/components/apps/editor/component/sets.js +2 -1
  86. package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
  87. package/components/apps/editor/componentsPanel/CssProperty.svelte +62 -48
  88. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +3 -2
  89. package/components/apps/editor/componentsPanel/CssSettings.svelte +1 -0
  90. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +170 -0
  91. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +18 -0
  92. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +130 -0
  93. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +21 -0
  94. package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +535 -0
  95. package/components/apps/editor/componentsPanel/quickStyleProperties.js +598 -0
  96. package/components/apps/editor/componentsPanel/store.js +4 -4
  97. package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -26
  98. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +0 -1
  99. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +8 -6
  100. package/components/apps/editor/contextPanel/ContextPanel.svelte +7 -14
  101. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +2 -25
  102. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +29 -40
  103. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +1 -2
  104. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +2 -7
  105. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
  106. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +10 -11
  107. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +4 -3
  108. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
  109. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +0 -1
  110. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
  111. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +2 -0
  112. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +22 -19
  113. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +42 -13
  114. package/components/apps/editor/settingsPanel/GridTab.svelte +1 -2
  115. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
  116. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +4 -0
  117. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -0
  118. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +1 -2
  119. package/components/apps/editor/settingsPanel/StylePanel.svelte +61 -0
  120. package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +17 -0
  121. package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
  122. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
  123. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +3 -2
  124. package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +5 -1
  125. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
  126. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +3 -2
  127. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +4 -1
  128. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +3 -3
  129. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +47 -0
  130. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +14 -0
  131. package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +2 -0
  132. package/components/apps/editor/settingsPanel/secondaryMenu/index.js +2 -0
  133. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +12 -0
  134. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +10 -0
  135. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
  136. package/components/apps/inputType.d.ts +2 -2
  137. package/components/apps/rx.d.ts +2 -2
  138. package/components/apps/svelte-grid/Grid.svelte +50 -34
  139. package/components/apps/svelte-grid/Grid.svelte.d.ts +14 -9
  140. package/components/apps/svelte-grid/MoveResize.svelte +76 -55
  141. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +15 -9
  142. package/components/apps/svelte-grid/utils/helper.d.ts +0 -1
  143. package/components/apps/svelte-grid/utils/helper.js +0 -3
  144. package/components/apps/types.d.ts +9 -5
  145. package/components/apps/utils.d.ts +2 -0
  146. package/components/apps/utils.js +33 -1
  147. package/components/common/button/ButtonPopup.svelte +5 -2
  148. package/components/common/button/ButtonPopup.svelte.d.ts +5 -1
  149. package/components/common/button/ButtonPopupItem.svelte +2 -1
  150. package/components/common/button/ButtonPopupItem.svelte.d.ts +1 -0
  151. package/components/common/clearableInput/ClearableInput.svelte +56 -0
  152. package/components/common/clearableInput/ClearableInput.svelte.d.ts +28 -0
  153. package/components/common/index.d.ts +1 -0
  154. package/components/common/index.js +1 -0
  155. package/components/common/kbd/Kbd.svelte +4 -1
  156. package/components/common/kbd/Kbd.svelte.d.ts +6 -14
  157. package/components/common/menu/Menu.svelte +8 -2
  158. package/components/common/menu/Menu.svelte.d.ts +4 -1
  159. package/components/common/modal/AlwaysMountedModal.svelte +109 -0
  160. package/components/common/modal/AlwaysMountedModal.svelte.d.ts +22 -0
  161. package/components/flows/map/MapItem.svelte +3 -3
  162. package/components/propertyPicker/ObjectViewer.svelte +0 -3
  163. package/components/scriptEditor/LogPanel.svelte +3 -3
  164. package/infer.js +6 -1
  165. package/package.json +11 -2
  166. package/utils.d.ts +1 -0
  167. package/utils.js +3 -0
  168. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +0 -25
  169. 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
@@ -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>&nbsp; Not set</span>
243
245
  {/if}
244
246
  {:else if inputCat == 'list'}
245
- <div>
246
- <div>
247
- {#each value ?? [] as v, i}
248
- <div class="flex flex-row max-w-md mt-1">
249
- {#if itemsType?.type == 'number'}
250
- <input autofocus={autofocus && i == 0} type="number" bind:value={v} />
251
- {:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'}
252
- <input
253
- autofocus={autofocus && i == 0}
254
- type="file"
255
- class="my-6"
256
- on:change={(x) => fileChanged(x, (val) => (value[i] = val))}
257
- multiple={false}
258
- />
259
- {:else}
260
- <input autofocus={autofocus && i == 0} type="text" bind:value={v} />
261
- {/if}
262
- <Button
263
- variant="border"
264
- color="red"
265
- size="sm"
266
- btnClasses="mx-6"
267
- on:click={() => {
268
- value = value.filter((el) => el != v)
269
- if (value.length == 0) {
270
- value = []
271
- }
272
- }}
273
- >
274
- <Icon data={faMinus} />
275
- </Button>
276
- </div>
277
- {/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}
278
282
  </div>
279
283
  <Button
280
284
  variant="border"
281
- color="blue"
282
- size="sm"
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
- <textarea
311
- bind:this={el}
313
+ <JsonEditor
314
+ bind:editor
312
315
  on:focus={(e) => {
313
- window.dispatchEvent(new Event('pointerup'))
314
316
  dispatch('focus')
315
317
  }}
316
- {autofocus}
317
- {disabled}
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>
@@ -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
  }
@@ -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
@@ -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}
@@ -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
  };
@@ -4,8 +4,8 @@
4
4
  export default class Multiselect extends SvelteComponentTyped<{
5
5
  value?: any[] | undefined;
6
6
  id?: string | undefined;
7
- readonly?: boolean | undefined;
8
7
  placeholder?: string | undefined;
8
+ readonly?: boolean | undefined;
9
9
  }, {
10
10
  [evt: string]: CustomEvent<any>;
11
11
  }, {
@@ -20,8 +20,8 @@ declare const __propDef: {
20
20
  props: {
21
21
  value?: any[] | undefined;
22
22
  id?: string | undefined;
23
- readonly?: boolean | undefined;
24
23
  placeholder?: string | undefined;
24
+ readonly?: boolean | undefined;
25
25
  };
26
26
  events: {
27
27
  [evt: string]: CustomEvent<any>;
@@ -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() {
@@ -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:pointerdown on:click|stopPropagation>
35
+ <div class="relative" on:click|stopPropagation>
36
36
  <input
37
37
  on:focus
38
38
  on:click
@@ -14,7 +14,6 @@ declare const __propDef: {
14
14
  size?: "xs" | "sm" | undefined;
15
15
  };
16
16
  events: {
17
- pointerdown: PointerEvent;
18
17
  click: MouseEvent;
19
18
  focus: FocusEvent;
20
19
  change: CustomEvent<any>;