windmill-components 1.82.4 → 1.82.6

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 +72 -52
  3. package/components/ArgInput.svelte.d.ts +3 -1
  4. package/components/DisplayResult.svelte +17 -17
  5. package/components/Editor.svelte +3 -0
  6. package/components/Editor.svelte.d.ts +1 -0
  7. package/components/FieldHeader.svelte +1 -0
  8. package/components/FieldHeader.svelte.d.ts +4 -0
  9. package/components/FlowBuilder.svelte +0 -6
  10. package/components/FlowStatusViewer.svelte +4 -7
  11. package/components/FlowStatusViewer.svelte.d.ts +0 -1
  12. package/components/FlowViewer.svelte +1 -0
  13. package/components/InputTransformForm.svelte +1 -0
  14. package/components/LightweightArgInput.svelte +14 -1
  15. package/components/LightweightArgInput.svelte.d.ts +3 -1
  16. package/components/Multiselect.svelte.d.ts +2 -2
  17. package/components/SimpleEditor.svelte +1 -0
  18. package/components/SimpleEditor.svelte.d.ts +1 -0
  19. package/components/TemplateEditor.svelte +1 -0
  20. package/components/Toggle.svelte +1 -1
  21. package/components/Toggle.svelte.d.ts +1 -0
  22. package/components/apps/components/buttons/AppButton.svelte +17 -3
  23. package/components/apps/components/buttons/AppForm.svelte +10 -2
  24. package/components/apps/components/buttons/AppFormButton.svelte +82 -58
  25. package/components/apps/components/display/AppDisplayComponent.svelte +17 -23
  26. package/components/apps/components/display/AppHtml.svelte +1 -7
  27. package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
  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 +3 -20
  31. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
  32. package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
  33. package/components/apps/components/display/table/AppTable.svelte +49 -75
  34. package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
  35. package/components/apps/components/display/table/AppTableFooter.svelte +1 -2
  36. package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +0 -1
  37. package/components/apps/components/display/table/tableOptions.js +1 -1
  38. package/components/apps/components/helpers/DebouncedInput.svelte +0 -1
  39. package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +0 -2
  40. package/components/apps/components/helpers/HiddenComponent.svelte +2 -3
  41. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -2
  42. package/components/apps/components/helpers/InputValue.svelte +3 -3
  43. package/components/apps/components/helpers/RefreshButton.svelte +10 -3
  44. package/components/apps/components/helpers/RefreshButton.svelte.d.ts +0 -1
  45. package/components/apps/components/helpers/RunnableComponent.svelte +15 -19
  46. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -2
  47. package/components/apps/components/helpers/RunnableWrapper.svelte +1 -3
  48. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +0 -1
  49. package/components/apps/components/helpers/eval.d.ts +2 -4
  50. package/components/apps/components/helpers/eval.js +4 -6
  51. package/components/apps/components/inputs/AppCheckbox.svelte +4 -0
  52. package/components/apps/components/inputs/AppDateInput.svelte +2 -2
  53. package/components/apps/components/inputs/AppMultiSelect.svelte +5 -13
  54. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -0
  55. package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
  56. package/components/apps/components/inputs/AppSelect.svelte +4 -11
  57. package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -0
  58. package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
  59. package/components/apps/components/inputs/AppTextInput.svelte +43 -53
  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 +2 -1
  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 +21 -49
  67. package/components/apps/editor/AppEditorHeader.svelte +0 -5
  68. package/components/apps/editor/AppPreview.svelte +7 -18
  69. package/components/apps/editor/ComponentHeader.svelte +0 -1
  70. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  71. package/components/apps/editor/GridEditor.svelte +12 -22
  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 +7 -5
  75. package/components/apps/editor/SettingsPanel.svelte +4 -4
  76. package/components/apps/editor/SubGridEditor.svelte +12 -13
  77. package/components/apps/editor/appUtils.d.ts +0 -1
  78. package/components/apps/editor/appUtils.js +0 -19
  79. package/components/apps/editor/component/Component.svelte +8 -19
  80. package/components/apps/editor/component/Component.svelte.d.ts +1 -1
  81. package/components/apps/editor/component/ComponentNavigation.svelte +47 -57
  82. package/components/apps/editor/component/README.md +0 -4
  83. package/components/apps/editor/component/components.d.ts +28 -45
  84. package/components/apps/editor/component/components.js +27 -41
  85. package/components/apps/editor/component/sets.js +1 -2
  86. package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
  87. package/components/apps/editor/componentsPanel/CssProperty.svelte +48 -62
  88. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -3
  89. package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
  90. package/components/apps/editor/componentsPanel/store.js +4 -4
  91. package/components/apps/editor/contextPanel/ComponentOutput.svelte +26 -2
  92. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +1 -0
  93. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +6 -8
  94. package/components/apps/editor/contextPanel/ContextPanel.svelte +14 -7
  95. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +25 -2
  96. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
  97. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
  98. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +40 -29
  99. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +2 -1
  100. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +7 -2
  101. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
  102. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +11 -10
  103. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +3 -4
  104. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +0 -1
  105. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +1 -0
  106. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
  107. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +0 -2
  108. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +19 -22
  109. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +13 -42
  110. package/components/apps/editor/settingsPanel/GridTab.svelte +2 -1
  111. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -2
  112. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -4
  113. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +0 -1
  114. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +2 -1
  115. package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
  116. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
  117. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +2 -3
  118. package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +1 -5
  119. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
  120. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +2 -3
  121. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +1 -4
  122. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +3 -3
  123. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
  124. package/components/apps/inputType.d.ts +2 -2
  125. package/components/apps/rx.d.ts +2 -2
  126. package/components/apps/svelte-grid/Grid.svelte +34 -50
  127. package/components/apps/svelte-grid/Grid.svelte.d.ts +9 -14
  128. package/components/apps/svelte-grid/MoveResize.svelte +55 -76
  129. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +9 -15
  130. package/components/apps/svelte-grid/utils/helper.d.ts +1 -0
  131. package/components/apps/svelte-grid/utils/helper.js +3 -0
  132. package/components/apps/types.d.ts +5 -9
  133. package/components/apps/utils.d.ts +0 -2
  134. package/components/apps/utils.js +1 -33
  135. package/components/common/button/ButtonPopup.svelte +2 -5
  136. package/components/common/button/ButtonPopup.svelte.d.ts +1 -5
  137. package/components/common/button/ButtonPopupItem.svelte +1 -2
  138. package/components/common/button/ButtonPopupItem.svelte.d.ts +0 -1
  139. package/components/common/index.d.ts +0 -1
  140. package/components/common/index.js +0 -1
  141. package/components/common/kbd/Kbd.svelte +1 -4
  142. package/components/common/kbd/Kbd.svelte.d.ts +14 -6
  143. package/components/common/menu/Menu.svelte +2 -8
  144. package/components/common/menu/Menu.svelte.d.ts +1 -4
  145. package/components/flows/map/MapItem.svelte +3 -3
  146. package/components/propertyPicker/ObjectViewer.svelte +3 -0
  147. package/components/scriptEditor/LogPanel.svelte +3 -3
  148. package/infer.js +1 -6
  149. package/package.json +2 -11
  150. package/utils.d.ts +0 -1
  151. package/utils.js +0 -3
  152. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +0 -170
  153. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +0 -18
  154. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +0 -130
  155. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +0 -21
  156. package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +0 -535
  157. package/components/apps/editor/componentsPanel/quickStyleProperties.js +0 -598
  158. package/components/apps/editor/settingsPanel/StylePanel.svelte +0 -61
  159. package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +0 -17
  160. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +0 -47
  161. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +0 -14
  162. package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +0 -2
  163. package/components/apps/editor/settingsPanel/secondaryMenu/index.js +0 -2
  164. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +0 -12
  165. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +0 -10
  166. package/components/common/clearableInput/ClearableInput.svelte +0 -56
  167. package/components/common/clearableInput/ClearableInput.svelte.d.ts +0 -28
  168. package/components/common/modal/AlwaysMountedModal.svelte +0 -109
  169. package/components/common/modal/AlwaysMountedModal.svelte.d.ts +0 -22
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' | 'object';
14
+ type?: 'string' | 'number' | 'bytes';
15
15
  contentEncoding?: 'base64';
16
16
  };
17
17
  properties?: {
@@ -15,9 +15,6 @@ 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';
21
18
  export let label = '';
22
19
  export let value;
23
20
  export let defaultValue = undefined;
@@ -71,7 +68,7 @@ $: {
71
68
  }
72
69
  export function evalValueToRaw() {
73
70
  if (value) {
74
- rawValue = JSON.stringify(value, null, 2);
71
+ rawValue = JSON.stringify(value, null, 4);
75
72
  }
76
73
  }
77
74
  function fileChanged(e, cb) {
@@ -139,13 +136,12 @@ $: {
139
136
  }
140
137
  }
141
138
  $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncoding);
142
- let redraw = 0;
143
139
  </script>
144
140
 
145
141
  <div class="flex flex-col w-full min-w-[250px]">
146
142
  <div>
147
143
  {#if displayHeader}
148
- <FieldHeader {label} {required} {type} {contentEncoding} {format} />
144
+ <FieldHeader {label} {required} {type} {contentEncoding} {format} {itemsType} />
149
145
  {/if}
150
146
  {#if editableSchema}
151
147
  <div class="p-2 my-1 text-xs border-solid border border-gray-400">
@@ -168,7 +164,7 @@ let redraw = 0;
168
164
  use:autosize
169
165
  rows="1"
170
166
  bind:value={description}
171
- on:keydown|stopPropagation
167
+ on:keydown|stopPropagation
172
168
  placeholder="Field description"
173
169
  />
174
170
  {#if type == 'string' && format != 'date-time'}
@@ -181,7 +177,6 @@ let redraw = 0;
181
177
  <select bind:value={itemsType}>
182
178
  <option value={undefined}>No specific item type</option>
183
179
  <option value={{ type: 'string' }}> Items are strings</option>
184
- <option value={{ type: 'object' }}> Items are objects (JSON)</option>
185
180
  <option value={{ type: 'number' }}>Items are numbers</option>
186
181
  <option value={{ type: 'string', contentEncoding: 'base64' }}
187
182
  >Items are bytes</option
@@ -216,6 +211,7 @@ let redraw = 0;
216
211
  <input
217
212
  {autofocus}
218
213
  on:focus={(e) => {
214
+ window.dispatchEvent(new Event('pointerup'))
219
215
  dispatch('focus')
220
216
  }}
221
217
  {disabled}
@@ -227,12 +223,14 @@ let redraw = 0;
227
223
  bind:value
228
224
  min={extra['min']}
229
225
  max={extra['max']}
226
+ on:input={() => dispatch('input', { value, isRaw: true })}
230
227
  />
231
228
  {/if}
232
229
  {:else if inputCat == 'boolean'}
233
230
  <Toggle
234
231
  on:pointerdown={(e) => {
235
232
  e?.stopPropagation()
233
+ window.dispatchEvent(new Event('pointerup'))
236
234
  }}
237
235
  {disabled}
238
236
  class={valid
@@ -244,46 +242,44 @@ let redraw = 0;
244
242
  <span>&nbsp; Not set</span>
245
243
  {/if}
246
244
  {:else if inputCat == 'list'}
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}
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}
282
278
  </div>
283
279
  <Button
284
280
  variant="border"
285
- color="dark"
286
- size="xs"
281
+ color="blue"
282
+ size="sm"
287
283
  btnClasses="mt-1"
288
284
  on:click={() => {
289
285
  if (value == undefined || !Array.isArray(value)) {
@@ -295,6 +291,9 @@ let redraw = 0;
295
291
  <Icon data={faPlus} class="mr-2" />
296
292
  Add item
297
293
  </Button>
294
+ <span class="ml-2">
295
+ {(value ?? []).length} item{(value ?? []).length > 1 ? 's' : ''}
296
+ </span>
298
297
  </div>
299
298
  {:else if inputCat == 'resource-object'}
300
299
  <ObjectResourceInput {format} bind:value />
@@ -307,21 +306,32 @@ let redraw = 0;
307
306
  bind:args={value}
308
307
  />
309
308
  </div>
310
- {:else if disabled}
311
- <textarea disabled />
312
309
  {:else}
313
- <JsonEditor
314
- bind:editor
310
+ <textarea
311
+ bind:this={el}
315
312
  on:focus={(e) => {
313
+ window.dispatchEvent(new Event('pointerup'))
316
314
  dispatch('focus')
317
315
  }}
318
- code={rawValue}
319
- bind:value
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}
320
329
  />
321
330
  {/if}
322
331
  {:else if inputCat == 'enum'}
323
332
  <select
324
333
  on:focus={(e) => {
334
+ window.dispatchEvent(new Event('pointerup'))
325
335
  dispatch('focus')
326
336
  }}
327
337
  {disabled}
@@ -338,11 +348,16 @@ let redraw = 0;
338
348
  <div class="border my-1 mb-4 w-full border-gray-400">
339
349
  <SimpleEditor
340
350
  on:focus={(e) => {
351
+ window.dispatchEvent(new Event('pointerup'))
341
352
  dispatch('focus')
342
353
  }}
354
+ on:blur={() => dispatch('blur')}
343
355
  bind:this={editor}
344
356
  lang={inputCat}
345
357
  bind:code={value}
358
+ on:change={async () => {
359
+ dispatch('input', { rawValue: value, isRaw: false })
360
+ }}
346
361
  autoHeight
347
362
  />
348
363
  </div>
@@ -372,10 +387,12 @@ let redraw = 0;
372
387
  rows="1"
373
388
  bind:this={el}
374
389
  on:focus={(e) => {
390
+ window.dispatchEvent(new Event('pointerup'))
375
391
  dispatch('focus')
376
392
  }}
393
+ on:blur={() => dispatch('blur')}
377
394
  use:autosize
378
- on:keydown|stopPropagation
395
+ on:keydown|stopPropagation
379
396
  type="text"
380
397
  {disabled}
381
398
  class="col-span-10 {valid
@@ -383,6 +400,9 @@ let redraw = 0;
383
400
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
384
401
  placeholder={defaultValue ?? ''}
385
402
  bind:value
403
+ on:input={() => {
404
+ dispatch('input', { rawValue: value, isRaw: false })
405
+ }}
386
406
  />
387
407
  {#if itemPicker}
388
408
  <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" | "object" | "bytes" | undefined;
23
+ type?: "string" | "number" | "bytes" | undefined;
24
24
  contentEncoding?: "base64" | undefined;
25
25
  } | undefined;
26
26
  displayHeader?: boolean | undefined;
@@ -42,6 +42,8 @@ declare const __propDef: {
42
42
  events: {
43
43
  keydown: KeyboardEvent;
44
44
  focus: CustomEvent<any>;
45
+ input: CustomEvent<any>;
46
+ blur: CustomEvent<any>;
45
47
  } & {
46
48
  [evt: string]: CustomEvent<any>;
47
49
  };
@@ -75,6 +75,23 @@ 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
+
78
95
  <div class="inline-highlight">
79
96
  {#if result != undefined}
80
97
  {#if resultKind && resultKind != 'json'}
@@ -220,20 +237,3 @@ let jsonViewer;
220
237
  <div class="text-gray-500 text-sm">No result: {JSON.stringify(result)}</div>
221
238
  {/if}
222
239
  </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,6 +394,9 @@ async function loadMonaco() {
394
394
  reloadWebsocket();
395
395
  }
396
396
  });
397
+ editor.onDidBlurEditorText(() => {
398
+ dispatch('blur');
399
+ });
397
400
  reloadWebsocket();
398
401
  return () => {
399
402
  try {
@@ -30,6 +30,7 @@ declare const __propDef: {
30
30
  events: {
31
31
  change: CustomEvent<any>;
32
32
  focus: CustomEvent<any>;
33
+ blur: CustomEvent<any>;
33
34
  } & {
34
35
  [evt: string]: CustomEvent<any>;
35
36
  };
@@ -4,6 +4,7 @@ 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;
7
8
  </script>
8
9
 
9
10
  <div class="inline-flex flex-row items-center truncated">
@@ -6,6 +6,10 @@ 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;
9
13
  };
10
14
  events: {
11
15
  [evt: string]: CustomEvent<any>;
@@ -114,7 +114,6 @@ 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;
118
117
  goto(`/flows/edit/${$flowStore.path}?workspace_id=${$workspaceStore}`);
119
118
  }
120
119
  }
@@ -176,11 +175,6 @@ $: selectedId && select(selectedId);
176
175
  $: initialPath && $workspaceStore && loadSchedule();
177
176
  loadHubScripts();
178
177
  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
- }
184
178
  switch (event.key) {
185
179
  case 'Z':
186
180
  if (event.ctrlKey) {
@@ -18,7 +18,6 @@ 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;
22
21
  export let flowState = undefined;
23
22
  export let flowJobIds = undefined;
24
23
  export let job = undefined;
@@ -74,7 +73,7 @@ function updateInnerModules() {
74
73
  else if (mod.type === FlowStatusModule.type.WAITING_FOR_EXECUTOR &&
75
74
  localFlowModuleStates[mod.id ?? '']?.scheduled_for == undefined) {
76
75
  JobService.getJob({
77
- workspace: workspaceId ?? $workspaceStore ?? '',
76
+ workspace: $workspaceStore ?? '',
78
77
  id: mod.job ?? ''
79
78
  }).then((job) => {
80
79
  localFlowModuleStates[mod.id ?? ''] = {
@@ -93,7 +92,7 @@ async function loadJobInProgress() {
93
92
  if (jobId != '00000000-0000-0000-0000-000000000000') {
94
93
  try {
95
94
  const newJob = await JobService.getJob({
96
- workspace: workspaceId ?? $workspaceStore ?? '',
95
+ workspace: $workspaceStore ?? '',
97
96
  id: jobId ?? ''
98
97
  });
99
98
  if (JSON.stringify(newJob) !== JSON.stringify(job)) {
@@ -125,7 +124,7 @@ onDestroy(() => {
125
124
  timeout && clearTimeout(timeout);
126
125
  });
127
126
  async function loadOwner(path) {
128
- is_owner = await isOwner(path, $userStore, workspaceId ?? $workspaceStore);
127
+ is_owner = await isOwner(path, $userStore, $workspaceStore);
129
128
  }
130
129
  let selected = 'graph';
131
130
  let payload = '"a test payload in json"';
@@ -171,7 +170,7 @@ function isSuccess(arg) {
171
170
  variant="border"
172
171
  on:click={async () =>
173
172
  await JobService.resumeSuspendedFlowAsOwner({
174
- workspace: workspaceId ?? $workspaceStore ?? '',
173
+ workspace: $workspaceStore ?? '',
175
174
  id: job?.id ?? '',
176
175
  requestBody: JSON.parse(payload)
177
176
  })}
@@ -269,7 +268,6 @@ function isSuccess(arg) {
269
268
  </Button>
270
269
  <div class="border p-6" class:hidden={forloop_selected != loopJobId}>
271
270
  <svelte:self
272
- {workspaceId}
273
271
  bind:suspend_status
274
272
  bind:retry_status
275
273
  bind:flowState
@@ -344,7 +342,6 @@ function isSuccess(arg) {
344
342
  <li class="w-full border border-gray-600 p-6 space-y-2 bg-blue-50/50">
345
343
  {#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
346
344
  <svelte:self
347
- {workspaceId}
348
345
  bind:suspend_status
349
346
  bind:retry_status
350
347
  bind:flowState
@@ -5,7 +5,6 @@ import { type GraphModuleState } from './graph';
5
5
  declare const __propDef: {
6
6
  props: {
7
7
  jobId: string;
8
- workspaceId?: string | undefined;
9
8
  flowState?: FlowState | undefined;
10
9
  flowJobIds?: {
11
10
  moduleId: string;
@@ -52,6 +52,7 @@ 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}
55
56
  /><span class="ml-4 mt-2 text-xs"
56
57
  >{toAny(v)?.default != undefined
57
58
  ? 'default: ' + JSON.stringify(toAny(v)?.default)
@@ -104,6 +104,7 @@ $: 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}
107
108
  />
108
109
 
109
110
  {#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} {itemsType} />
126
126
  {/if}
127
127
 
128
128
  {#if description}
@@ -145,6 +145,7 @@ $: 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'))
148
149
  dispatch('focus')
149
150
  }}
150
151
  type="number"
@@ -155,12 +156,14 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
155
156
  bind:value
156
157
  min={extra['min']}
157
158
  max={extra['max']}
159
+ on:input={() => dispatch('input', { value, isRaw: true })}
158
160
  />
159
161
  {/if}
160
162
  {:else if inputCat == 'boolean'}
161
163
  <Toggle
162
164
  on:pointerdown={(e) => {
163
165
  e?.stopPropagation()
166
+ window.dispatchEvent(new Event('pointerup'))
164
167
  }}
165
168
  class={valid
166
169
  ? ''
@@ -237,10 +240,14 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
237
240
  <textarea
238
241
  bind:this={el}
239
242
  on:focus={(e) => {
243
+ window.dispatchEvent(new Event('pointerup'))
240
244
  dispatch('focus')
241
245
  }}
242
246
  use:autosize
243
247
  style="max-height: {maxHeight}"
248
+ on:input={() => {
249
+ dispatch('input', { rawValue: value, isRaw: false })
250
+ }}
244
251
  class="col-span-10 {valid
245
252
  ? ''
246
253
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
@@ -251,6 +258,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
251
258
  {:else if inputCat == 'enum'}
252
259
  <select
253
260
  on:focus={(e) => {
261
+ window.dispatchEvent(new Event('pointerup'))
254
262
  dispatch('focus')
255
263
  }}
256
264
  class="px-6"
@@ -283,8 +291,10 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
283
291
  rows="1"
284
292
  bind:this={el}
285
293
  on:focus={(e) => {
294
+ window.dispatchEvent(new Event('pointerup'))
286
295
  dispatch('focus')
287
296
  }}
297
+ on:blur={() => dispatch('blur')}
288
298
  use:autosize
289
299
  type="text"
290
300
  class="col-span-10 {valid
@@ -292,6 +302,9 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
292
302
  : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}"
293
303
  placeholder={defaultValue ?? ''}
294
304
  bind:value
305
+ on:input={() => {
306
+ dispatch('input', { rawValue: value, isRaw: false })
307
+ }}
295
308
  />
296
309
  </div>
297
310
  </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" | "object" | "bytes" | undefined;
18
+ type?: "string" | "number" | "bytes" | undefined;
19
19
  contentEncoding?: "base64" | undefined;
20
20
  } | undefined;
21
21
  displayHeader?: boolean | undefined;
@@ -28,6 +28,8 @@ declare const __propDef: {
28
28
  };
29
29
  events: {
30
30
  focus: CustomEvent<any>;
31
+ input: CustomEvent<any>;
32
+ blur: CustomEvent<any>;
31
33
  } & {
32
34
  [evt: string]: CustomEvent<any>;
33
35
  };
@@ -4,8 +4,8 @@
4
4
  export default class Multiselect extends SvelteComponentTyped<{
5
5
  value?: any[] | undefined;
6
6
  id?: string | undefined;
7
- placeholder?: string | undefined;
8
7
  readonly?: boolean | undefined;
8
+ placeholder?: string | 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
- placeholder?: string | undefined;
24
23
  readonly?: boolean | undefined;
24
+ placeholder?: string | undefined;
25
25
  };
26
26
  events: {
27
27
  [evt: string]: CustomEvent<any>;
@@ -146,6 +146,7 @@ async function loadMonaco() {
146
146
  });
147
147
  editor.onDidBlurEditorText(() => {
148
148
  code = getCode();
149
+ dispatch('blur');
149
150
  });
150
151
  if (lang == 'javascript') {
151
152
  const stdLib = { content: libStdContent, filePath: 'es5.d.ts' };
@@ -21,6 +21,7 @@ declare const __propDef: {
21
21
  events: {
22
22
  change: CustomEvent<any>;
23
23
  focus: CustomEvent<any>;
24
+ blur: CustomEvent<any>;
24
25
  } & {
25
26
  [evt: string]: CustomEvent<any>;
26
27
  };
@@ -495,6 +495,7 @@ async function loadMonaco() {
495
495
  });
496
496
  editor.onDidBlurEditorText(() => {
497
497
  code = getCode();
498
+ dispatch('blur');
498
499
  });
499
500
  }
500
501
  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:click|stopPropagation>
35
+ <div class="relative" on:pointerdown on:click|stopPropagation>
36
36
  <input
37
37
  on:focus
38
38
  on:click
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  size?: "xs" | "sm" | undefined;
15
15
  };
16
16
  events: {
17
+ pointerdown: PointerEvent;
17
18
  click: MouseEvent;
18
19
  focus: FocusEvent;
19
20
  change: CustomEvent<any>;