windmill-components 1.78.0 → 1.82.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 (214) hide show
  1. package/components/ArgInput.svelte +3 -0
  2. package/components/ArgInput.svelte.d.ts +1 -0
  3. package/components/DisplayResult.svelte +18 -15
  4. package/components/SchemaEditor.svelte +15 -10
  5. package/components/SettingSection.svelte +1 -1
  6. package/components/Toggle.svelte +5 -2
  7. package/components/Toggle.svelte.d.ts +1 -0
  8. package/components/apps/components/buttons/AppButton.svelte +50 -70
  9. package/components/apps/components/buttons/AppButton.svelte.d.ts +8 -3
  10. package/components/apps/components/buttons/AppForm.svelte +22 -15
  11. package/components/apps/components/buttons/AppForm.svelte.d.ts +3 -3
  12. package/components/apps/components/buttons/AppFormButton.svelte +32 -24
  13. package/components/apps/components/buttons/AppFormButton.svelte.d.ts +3 -5
  14. package/components/apps/components/display/AppBarChart.svelte +2 -2
  15. package/components/apps/components/display/AppBarChart.svelte.d.ts +3 -3
  16. package/components/apps/components/display/AppDisplayComponent.svelte +2 -2
  17. package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +1 -1
  18. package/components/apps/components/display/AppHtml.svelte +10 -2
  19. package/components/apps/components/display/AppHtml.svelte.d.ts +1 -1
  20. package/components/apps/components/display/AppIcon.svelte +4 -1
  21. package/components/apps/components/display/AppIcon.svelte.d.ts +3 -4
  22. package/components/apps/components/display/AppImage.svelte +28 -15
  23. package/components/apps/components/display/AppImage.svelte.d.ts +3 -4
  24. package/components/apps/components/display/AppMap.svelte +3 -3
  25. package/components/apps/components/display/AppMap.svelte.d.ts +3 -4
  26. package/components/apps/components/display/AppPdf.svelte +3 -2
  27. package/components/apps/components/display/AppPdf.svelte.d.ts +3 -4
  28. package/components/apps/components/display/AppPieChart.svelte +2 -2
  29. package/components/apps/components/display/AppPieChart.svelte.d.ts +3 -3
  30. package/components/apps/components/display/AppScatterChart.svelte +2 -2
  31. package/components/apps/components/display/AppScatterChart.svelte.d.ts +3 -3
  32. package/components/apps/components/display/AppText.svelte +35 -22
  33. package/components/apps/components/display/AppText.svelte.d.ts +3 -3
  34. package/components/apps/components/display/AppTimeseries.svelte +2 -2
  35. package/components/apps/components/display/AppTimeseries.svelte.d.ts +3 -3
  36. package/components/apps/components/display/PlotlyHtml.svelte +2 -2
  37. package/components/apps/components/display/VegaLiteHtml.svelte +2 -2
  38. package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +2 -1
  39. package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
  40. package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +2 -1
  41. package/components/apps/components/display/table/AppTable.svelte +102 -34
  42. package/components/apps/components/display/table/AppTable.svelte.d.ts +3 -3
  43. package/components/apps/components/helpers/HiddenComponent.svelte +6 -3
  44. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -1
  45. package/components/apps/components/helpers/InputValue.svelte +11 -7
  46. package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -1
  47. package/components/apps/components/helpers/Loader.svelte +18 -0
  48. package/components/apps/components/helpers/Loader.svelte.d.ts +18 -0
  49. package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -12
  50. package/components/apps/components/helpers/ResolveConfig.svelte +29 -0
  51. package/components/apps/components/helpers/ResolveConfig.svelte.d.ts +21 -0
  52. package/components/apps/components/helpers/RunnableComponent.svelte +126 -93
  53. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +13 -3
  54. package/components/apps/components/helpers/RunnableWrapper.svelte +48 -9
  55. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +26 -2
  56. package/components/apps/components/helpers/eval.js +36 -1
  57. package/components/apps/components/inputs/AppCheckbox.svelte +1 -1
  58. package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +3 -4
  59. package/components/apps/components/inputs/AppDateInput.svelte.d.ts +3 -4
  60. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +3 -4
  61. package/components/apps/components/inputs/AppMultiSelect.svelte +0 -1
  62. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +3 -4
  63. package/components/apps/components/inputs/AppNumberInput.svelte +1 -1
  64. package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +3 -6
  65. package/components/apps/components/inputs/AppRangeInput.svelte +7 -1
  66. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +4 -4
  67. package/components/apps/components/inputs/AppSelect.svelte +8 -2
  68. package/components/apps/components/inputs/AppSelect.svelte.d.ts +3 -4
  69. package/components/apps/components/inputs/AppSliderInputs.svelte +7 -1
  70. package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +4 -4
  71. package/components/apps/components/inputs/AppTextInput.svelte +4 -4
  72. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +3 -6
  73. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +17 -19
  74. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +3 -4
  75. package/components/apps/components/layout/AppContainer.svelte +7 -5
  76. package/components/apps/components/layout/AppContainer.svelte.d.ts +1 -3
  77. package/components/apps/components/layout/AppDivider.svelte +4 -1
  78. package/components/apps/components/layout/AppDivider.svelte.d.ts +3 -4
  79. package/components/apps/components/layout/AppDrawer.svelte +7 -4
  80. package/components/apps/components/layout/AppDrawer.svelte.d.ts +3 -4
  81. package/components/apps/components/layout/AppSplitpanes.svelte +34 -25
  82. package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +1 -5
  83. package/components/apps/components/layout/AppTabs.svelte +22 -37
  84. package/components/apps/components/layout/AppTabs.svelte.d.ts +3 -5
  85. package/components/apps/editor/AppEditor.svelte +6 -3
  86. package/components/apps/editor/AppEditorHeader.svelte +4 -5
  87. package/components/apps/editor/AppInputs.svelte +13 -14
  88. package/components/apps/editor/AppPreview.svelte +12 -16
  89. package/components/apps/editor/ComponentHeader.svelte +58 -57
  90. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -2
  91. package/components/apps/editor/GridEditor.svelte +21 -50
  92. package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
  93. package/components/apps/editor/RecomputeAllComponents.svelte +13 -2
  94. package/components/apps/editor/SettingsPanel.svelte +104 -30
  95. package/components/apps/editor/SubGridEditor.svelte +34 -43
  96. package/components/apps/editor/SubGridEditor.svelte.d.ts +2 -3
  97. package/components/apps/editor/appUtils.d.ts +49 -6
  98. package/components/apps/editor/appUtils.js +145 -37
  99. package/components/apps/editor/component/Component.svelte +37 -22
  100. package/components/apps/editor/component/Component.svelte.d.ts +1 -2
  101. package/components/apps/editor/component/ComponentNavigation.svelte +28 -12
  102. package/components/apps/editor/component/components.d.ts +1550 -16
  103. package/components/apps/editor/component/components.js +295 -304
  104. package/components/apps/editor/component/default-codes.d.ts +1 -1
  105. package/components/apps/editor/component/default-codes.js +25 -25
  106. package/components/apps/editor/componentsPanel/ComponentList.svelte +18 -3
  107. package/components/apps/editor/componentsPanel/CssProperty.svelte +5 -3
  108. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +3 -1
  109. package/components/apps/editor/componentsPanel/CssSettings.svelte +48 -90
  110. package/components/apps/editor/componentsPanel/ListItem.svelte +3 -0
  111. package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +2 -0
  112. package/components/apps/editor/contextPanel/ContextPanel.svelte +4 -5
  113. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +0 -1
  114. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +1 -3
  115. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +12 -2
  116. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +2 -2
  117. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +158 -129
  118. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +2 -1
  119. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +31 -3
  120. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
  121. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +42 -74
  122. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +68 -18
  123. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +1 -3
  124. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +27 -0
  125. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte.d.ts +17 -0
  126. package/components/apps/editor/inlineScriptsPanel/utils.d.ts +2 -0
  127. package/components/apps/editor/inlineScriptsPanel/utils.js +6 -5
  128. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +10 -2
  129. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +37 -31
  130. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +4 -104
  131. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +108 -87
  132. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +5 -3
  133. package/components/apps/editor/settingsPanel/GridTab.svelte +0 -1
  134. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +128 -13
  135. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +14 -2
  136. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +35 -100
  137. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +3 -2
  138. package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +52 -0
  139. package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte.d.ts +28 -0
  140. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +73 -25
  141. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +2 -0
  142. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +7 -5
  143. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +3 -2
  144. package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +2 -2
  145. package/components/apps/editor/settingsPanel/TableActions.svelte +8 -63
  146. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -2
  147. package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +0 -1
  148. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +2 -4
  149. package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +3 -1
  150. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +2 -4
  151. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +5 -5
  152. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +2 -0
  153. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +59 -37
  154. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +8 -2
  155. package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte +46 -0
  156. package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte.d.ts +20 -0
  157. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +7 -0
  158. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
  159. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +31 -0
  160. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +22 -0
  161. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +24 -0
  162. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +21 -0
  163. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +156 -0
  164. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +22 -0
  165. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.d.ts +2 -0
  166. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.js +11 -0
  167. package/components/apps/gridUtils.js +1 -1
  168. package/components/apps/inputType.d.ts +23 -18
  169. package/components/apps/rx.d.ts +2 -0
  170. package/components/apps/rx.js +10 -3
  171. package/components/apps/svelte-grid/Grid.svelte +1 -5
  172. package/components/apps/svelte-grid/Grid.svelte.d.ts +1 -1
  173. package/components/apps/svelte-grid/MoveResize.svelte +24 -30
  174. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +0 -4
  175. package/components/apps/svelte-grid/types.d.ts +1 -7
  176. package/components/apps/svelte-grid/utils/helper.js +6 -10
  177. package/components/apps/types.d.ts +32 -15
  178. package/components/apps/utils.d.ts +2 -2
  179. package/components/apps/utils.js +13 -11
  180. package/components/common/skeleton/Skeleton.svelte +1 -1
  181. package/components/flows/flowStateUtils.js +8 -1
  182. package/components/flows/flowStore.js +1 -1
  183. package/components/graph/FlowGraph.svelte +0 -2
  184. package/components/graph/FlowGraph.svelte.d.ts +0 -1
  185. package/components/graph/svelvet/container/views/GraphView.svelte +3 -28
  186. package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +0 -3
  187. package/components/graph/svelvet/container/views/Svelvet.svelte +1 -17
  188. package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +0 -8
  189. package/components/graph/svelvet/customCss/controllers/getCss.js +0 -11
  190. package/components/graph/svelvet/edges/controllers/util.js +1 -2
  191. package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +2 -2
  192. package/components/graph/svelvet/nodes/controllers/util.js +1 -1
  193. package/components/graph/svelvet/nodes/models/Node.d.ts +0 -4
  194. package/components/graph/svelvet/nodes/models/Node.js +3 -41
  195. package/components/graph/svelvet/store/controllers/storeApi.js +2 -7
  196. package/components/graph/svelvet/store/controllers/util.d.ts +0 -7
  197. package/components/graph/svelvet/store/controllers/util.js +4 -36
  198. package/components/graph/svelvet/store/types/types.d.ts +0 -5
  199. package/components/home/ItemsList.svelte +1 -1
  200. package/package.json +13 -8
  201. package/utils.d.ts +2 -0
  202. package/utils.js +6 -0
  203. package/components/apps/editor/GridPanel.svelte +0 -31
  204. package/components/apps/editor/GridPanel.svelte.d.ts +0 -18
  205. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +0 -12
  206. package/components/apps/editor/componentsPanel/componentStaticValues.js +0 -25
  207. package/components/graph/svelvet/nodes/views/EditNode.svelte +0 -147
  208. package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +0 -33
  209. package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +0 -11
  210. package/components/graph/svelvet/resizableNodes/controllers/util.js +0 -24
  211. package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +0 -33
  212. package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +0 -71
  213. package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +0 -81
  214. package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte.d.ts +0 -20
@@ -1,9 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { BaseAppComponent } from '../../types';
2
+ import type { RichConfigurations } from '../../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
- inputSpecs: BaseAppComponent['configuration'];
6
+ inputSpecs: RichConfigurations;
7
+ inputSpecsConfiguration?: RichConfigurations | undefined;
7
8
  userInputEnabled?: boolean | undefined;
8
9
  shouldCapitalize?: boolean | undefined;
9
10
  rowColumns?: boolean | undefined;
@@ -0,0 +1,52 @@
1
+ <script>import Tooltip from '../../../Tooltip.svelte';
2
+ import InputsSpecEditor from './InputsSpecEditor.svelte';
3
+ export let key;
4
+ export let oneOf;
5
+ export let inputSpecsConfiguration;
6
+ export let labels;
7
+ export let shouldCapitalize;
8
+ export let id;
9
+ export let resourceOnly;
10
+ export let rowColumns;
11
+ export let tooltip;
12
+ $: if (oneOf.configuration[oneOf.selected] == undefined) {
13
+ oneOf.configuration[oneOf.selected] = {};
14
+ }
15
+ </script>
16
+
17
+ <div class="p-2 border">
18
+ <h4 class="mb-2">{key}&nbsp;<Tooltip>{tooltip}</Tooltip></h4>
19
+ <select
20
+ class="w-full border border-gray-300 rounded-md p-2"
21
+ value={oneOf.selected}
22
+ on:change={(e) => {
23
+ oneOf = { ...oneOf, selected: e?.target?.['value'] }
24
+ }}
25
+ >
26
+ {#each Object.keys(inputSpecsConfiguration ?? {}) as choice}
27
+ <option value={choice}>{labels?.[choice] ?? choice}</option>
28
+ {/each}
29
+ </select>
30
+ <div class="mb-4" />
31
+ <div class="flex flex-col gap-4">
32
+ {#each Object.keys(inputSpecsConfiguration?.[oneOf.selected] ?? {}) as nestedKey}
33
+ {@const config = inputSpecsConfiguration?.[oneOf.selected]?.[nestedKey]}
34
+ {#if config && oneOf.configuration[oneOf.selected]}
35
+ <InputsSpecEditor
36
+ key={nestedKey}
37
+ bind:componentInput={oneOf.configuration[oneOf.selected][nestedKey]}
38
+ {id}
39
+ userInputEnabled={false}
40
+ {shouldCapitalize}
41
+ {resourceOnly}
42
+ hasRows={rowColumns}
43
+ fieldType={config?.['fieldType']}
44
+ subFieldType={config?.['subFieldType']}
45
+ format={config?.['format']}
46
+ selectOptions={config?.['selectOptions']}
47
+ placeholder={config?.['placeholder']}
48
+ />
49
+ {/if}
50
+ {/each}
51
+ </div>
52
+ </div>
@@ -0,0 +1,28 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { RichConfiguration } from '../../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ key: string;
6
+ oneOf: {
7
+ selected: string;
8
+ configuration: RichConfiguration;
9
+ } | any;
10
+ inputSpecsConfiguration: RichConfiguration | any;
11
+ labels: Record<string, string> | undefined;
12
+ shouldCapitalize: boolean;
13
+ id: string;
14
+ resourceOnly: boolean;
15
+ rowColumns: boolean;
16
+ tooltip: string | undefined;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export type OneOfInputSpecsEditorProps = typeof __propDef.props;
24
+ export type OneOfInputSpecsEditorEvents = typeof __propDef.events;
25
+ export type OneOfInputSpecsEditorSlots = typeof __propDef.slots;
26
+ export default class OneOfInputSpecsEditor extends SvelteComponentTyped<OneOfInputSpecsEditorProps, OneOfInputSpecsEditorEvents, OneOfInputSpecsEditorSlots> {
27
+ }
28
+ export {};
@@ -1,17 +1,15 @@
1
1
  <script>import Button from '../../../common/button/Button.svelte';
2
+ import Toggle from '../../../Toggle.svelte';
2
3
  import Tooltip from '../../../Tooltip.svelte';
3
4
  import { faClose, faEdit } from '@fortawesome/free-solid-svg-icons';
5
+ import { includes } from 'lodash';
4
6
  import { getContext } from 'svelte';
5
7
  import { clearResultAppInput } from '../../utils';
6
- import InlineScriptEditorDrawer from '../inlineScriptsPanel/InlineScriptEditorDrawer.svelte';
8
+ import ComponentTriggerList from './triggerLists/ComponentTriggerList.svelte';
7
9
  const { app } = getContext('AppViewerContext');
10
+ const { selectedComponentInEditor } = getContext('AppEditorContext');
8
11
  export let appInput;
9
- let inlineScriptEditorDrawer;
10
- function edit() {
11
- if (appInput.runnable?.type === 'runnableByName') {
12
- inlineScriptEditorDrawer?.openDrawer();
13
- }
14
- }
12
+ export let appComponent;
15
13
  function detach() {
16
14
  if (appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript) {
17
15
  $app.unusedInlineScripts.push({
@@ -27,13 +25,7 @@ function clear() {
27
25
  }
28
26
  </script>
29
27
 
30
- {#if appInput.runnable && appInput.runnable.type === 'runnableByName' && appInput.runnable.inlineScript}
31
- <InlineScriptEditorDrawer
32
- bind:this={inlineScriptEditorDrawer}
33
- bind:inlineScript={appInput.runnable.inlineScript}
34
- />
35
- {/if}
36
- <div class="flex flex-col xl:flex-row justify-between w-full flex-wrap items-center gap-1">
28
+ <div class="flex justify-between w-full items-center gap-1">
37
29
  <span class="text-xs font-semibold truncate">
38
30
  {#if appInput.runnable?.type === 'runnableByName'}
39
31
  {appInput.runnable.name}
@@ -41,13 +33,10 @@ function clear() {
41
33
  {appInput.runnable.path}
42
34
  {/if}
43
35
  </span>
44
- <div class="flex gap-1 flex-wrap justify-center">
36
+ <div class="flex gap-1 justify-center">
45
37
  {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript}
46
- <Button size="xs" color="light" variant="border" startIcon={{ icon: faEdit }} on:click={edit}>
47
- Edit
48
- </Button>
49
38
  <Button size="xs" color="light" variant="border" on:click={detach}>
50
- Detach
39
+ Detach&nbsp;
51
40
  <Tooltip>
52
41
  Detaching an inline script keep it for later to be reused by another component
53
42
  </Tooltip>
@@ -58,14 +47,73 @@ function clear() {
58
47
  </Button>
59
48
  </div>
60
49
  </div>
50
+ <div>
51
+ <div class="w-full"><div class="mx-auto w-0">&downarrow;</div></div>
52
+ <div class="flex gap-1 justify-between items-center">
53
+ <span class="text-xs font-semibold truncate">
54
+ Transformer &nbsp;<Tooltip
55
+ >A transformer is an optional frontend script that is executed right after the component's
56
+ script whose purpose is to do lightweight transformation in the browser. It takes the
57
+ previous computation's result as `result`</Tooltip
58
+ ></span
59
+ >
60
+ <div class="flex gap-1">
61
+ {#if !appInput.transformer}
62
+ <div>
63
+ <Button
64
+ variant="border"
65
+ color="light"
66
+ size="xs"
67
+ on:click={() => {
68
+ appInput.transformer = {
69
+ language: 'frontend',
70
+ content: 'return result'
71
+ }
72
+ $selectedComponentInEditor = appComponent.id + '_transformer'
73
+ }}>Add Transformer</Button
74
+ >
75
+ </div>
76
+ {:else}
77
+ <Button
78
+ size="xs"
79
+ color="red"
80
+ variant="border"
81
+ startIcon={{ icon: faClose }}
82
+ on:click={() => {
83
+ appInput.transformer = undefined
84
+ }}
85
+ >
86
+ Clear
87
+ </Button>
88
+ {/if}
89
+ </div></div
90
+ >
91
+ </div>
92
+
93
+ {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript}
94
+ {#if !['buttoncomponent', 'formbuttoncomponent', 'formcomponent'].includes(appComponent.type)}
95
+ <div class="flex items-center">
96
+ <Toggle
97
+ size="xs"
98
+ color="red"
99
+ bind:checked={appInput.doNotRecomputeOnInputChanged}
100
+ options={{ right: 'do NOT recompute on input changes' }}
101
+ />
102
+ <Tooltip>If not toggled, whenever an input is changed, the script will be re-run.</Tooltip>
103
+ </div>
104
+ {/if}
105
+
106
+ <div>
107
+ <ComponentTriggerList
108
+ bind:runnable={appInput.runnable}
109
+ {appComponent}
110
+ fields={appInput.fields}
111
+ doNotRecomputeOnInputChanged={appInput.doNotRecomputeOnInputChanged}
112
+ />
113
+ </div>
114
+ {/if}
61
115
  {#if appInput.runnable?.type === 'runnableByName' && !appInput.runnable.inlineScript}
62
116
  <span class="text-xs text-gray-500">
63
117
  Please configure the language in the inline script panel
64
118
  </span>
65
119
  {/if}
66
- {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript?.language === 'frontend'}
67
- <span class="text-xs text-gray-500">
68
- If the component is a display component. The script will be recomputed upon any changes to any
69
- output or to the state.
70
- </span>
71
- {/if}
@@ -1,8 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { ResultAppInput } from '../../inputType';
3
+ import type { AppComponent } from '../component';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  appInput: ResultAppInput;
7
+ appComponent: AppComponent;
6
8
  };
7
9
  events: {
8
10
  [evt: string]: CustomEvent<any>;
@@ -1,15 +1,17 @@
1
1
  <script>import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
2
2
  export let value;
3
3
  export let componentInput;
4
+ export let subFieldType;
4
5
  let fakeComponentInput = {
5
6
  ...componentInput,
6
- value,
7
- // We don't support array of arrays
8
- // @ts-ignore
9
- fieldType: componentInput.subFieldType
7
+ value
10
8
  };
11
9
  // Bubble up changes to the real componentInput
12
10
  $: fakeComponentInput && (value = fakeComponentInput.value);
13
11
  </script>
14
12
 
15
- <StaticInputEditor bind:componentInput={fakeComponentInput} />
13
+ <StaticInputEditor
14
+ noVariablePicker
15
+ fieldType={subFieldType}
16
+ bind:componentInput={fakeComponentInput}
17
+ />
@@ -1,9 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { StaticAppInput } from '../../inputType';
2
+ import type { InputType, StaticInput } from '../../inputType';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  value: any;
6
- componentInput: StaticAppInput;
6
+ componentInput: StaticInput<any>;
7
+ subFieldType: InputType | undefined;
7
8
  };
8
9
  events: {
9
10
  [evt: string]: CustomEvent<any>;
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput } from '../../inputType';
2
+ import type { RichConfiguration } from '../../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- componentInput: AppInput | undefined;
5
+ componentInput: RichConfiguration | undefined;
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
@@ -5,82 +5,27 @@ import { classNames } from '../../../../utils';
5
5
  import { faPlus, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
6
6
  import { getContext } from 'svelte';
7
7
  import { Icon } from 'svelte-awesome';
8
+ import { appComponentFromType, clearErrorByComponentId, clearJobsByComponentId } from '../appUtils';
8
9
  import PanelSection from './common/PanelSection.svelte';
9
10
  import TableActionLabel from './TableActionLabel.svelte';
10
11
  export let components;
11
12
  export let id;
12
- const { selectedComponent } = getContext('AppViewerContext');
13
+ const { selectedComponent, app, errorByComponent, jobs } = getContext('AppViewerContext');
13
14
  function addComponent() {
14
15
  const actionId = getNextId(components.map((x) => x.id.split('_')[1]));
15
16
  const newComponent = {
16
- id: `${id}_${actionId}`,
17
- type: 'buttoncomponent',
18
- configuration: {
19
- label: {
20
- type: 'static',
21
- value: 'Action',
22
- fieldType: 'text'
23
- },
24
- color: {
25
- fieldType: 'select',
26
- type: 'static',
27
- value: 'dark',
28
- optionValuesKey: 'buttonColorOptions'
29
- },
30
- size: {
31
- fieldType: 'select',
32
- type: 'static',
33
- value: 'xs',
34
- optionValuesKey: 'buttonSizeOptions'
35
- },
36
- disabled: {
37
- fieldType: 'boolean',
38
- type: 'eval',
39
- expr: 'false',
40
- tooltip: "Disabled based on a predicate. Use `row` to access the current row's data"
41
- },
42
- goto: {
43
- tooltip: 'Go to an url on success if not empty',
44
- fieldType: 'text',
45
- type: 'static',
46
- value: ''
47
- },
48
- gotoNewTab: {
49
- tooltip: 'Go to create a new tab',
50
- fieldType: 'boolean',
51
- type: 'static',
52
- value: true
53
- },
54
- beforeIcon: {
55
- type: 'static',
56
- value: undefined,
57
- fieldType: 'icon-select',
58
- onlyStatic: true
59
- },
60
- afterIcon: {
61
- type: 'static',
62
- value: undefined,
63
- fieldType: 'icon-select',
64
- onlyStatic: true
65
- }
66
- },
67
- componentInput: {
68
- type: 'runnable',
69
- fieldType: 'any',
70
- fields: {},
71
- runnable: undefined,
72
- value: undefined
73
- },
74
- recomputeIds: undefined,
75
- customCss: {
76
- button: { style: '', class: '' }
77
- }
17
+ ...appComponentFromType('buttoncomponent')(`${id}_${actionId}`),
18
+ recomputeIds: []
78
19
  };
79
20
  components = [...components, newComponent];
21
+ $app = $app;
80
22
  }
81
23
  function deleteComponent(cid) {
82
24
  components = components.filter((x) => x.id !== cid);
25
+ $errorByComponent = clearErrorByComponentId(cid, $errorByComponent);
26
+ $jobs = clearJobsByComponentId(cid, $jobs);
83
27
  $selectedComponent = id;
28
+ $app = $app;
84
29
  }
85
30
  </script>
86
31
 
@@ -1,7 +1,6 @@
1
1
  <script>import { classNames } from '../../../../../utils';
2
2
  import Tooltip from '../../../../Tooltip.svelte';
3
3
  export let title;
4
- export let smallPadding = false;
5
4
  export let noPadding = false;
6
5
  export let titlePadding = '';
7
6
  export let tooltip = '';
@@ -11,7 +10,7 @@ export let tooltip = '';
11
10
  class={classNames(
12
11
  $$props.class,
13
12
  'flex flex-col h-full gap-2 items-start',
14
- noPadding ? '' : smallPadding ? 'p-2' : 'p-4'
13
+ noPadding ? '' : 'p-3'
15
14
  )}
16
15
  >
17
16
  <div class="flex justify-between flex-wrap items-center w-full gap-1">
@@ -3,7 +3,6 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  title: string;
6
- smallPadding?: boolean | undefined;
7
6
  noPadding?: boolean | undefined;
8
7
  titlePadding?: string | undefined;
9
8
  tooltip?: string | undefined;
@@ -1,10 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput, StaticInput } from '../../../inputType';
2
+ import type { StaticInput } from '../../../inputType';
3
3
  declare const __propDef: {
4
4
  props: {
5
- componentInput: StaticInput<string> & Extract<AppInput, {
6
- fieldType: 'color';
7
- }>;
5
+ componentInput: StaticInput<string>;
8
6
  };
9
7
  events: {
10
8
  [evt: string]: CustomEvent<any>;
@@ -2,7 +2,7 @@
2
2
  import { faArrowRight, faClose } from '@fortawesome/free-solid-svg-icons';
3
3
  import { getContext } from 'svelte';
4
4
  export let componentInput;
5
- const { connectingInput, app } = getContext('AppViewerContext');
5
+ const { connectingInput, app, worldStore } = getContext('AppViewerContext');
6
6
  function applyConnection() {
7
7
  if (!$connectingInput.opened &&
8
8
  $connectingInput.input !== undefined &&
@@ -14,6 +14,8 @@ function applyConnection() {
14
14
  hoveredComponent: undefined
15
15
  };
16
16
  }
17
+ $app = $app;
18
+ $worldStore = $worldStore;
17
19
  }
18
20
  $: $connectingInput && applyConnection();
19
21
  </script>
@@ -1,10 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput, StaticInput } from '../../../inputType';
2
+ import type { StaticInput } from '../../../inputType';
3
3
  declare const __propDef: {
4
4
  props: {
5
- componentInput: StaticInput<string> & Extract<AppInput, {
6
- fieldType: 'icon-select';
7
- }>;
5
+ componentInput: StaticInput<string>;
8
6
  };
9
7
  events: {
10
8
  keydown: KeyboardEvent;
@@ -3,11 +3,11 @@ import RunnableSelector from '../mainInput/RunnableSelector.svelte';
3
3
  import SelectedRunnable from '../SelectedRunnable.svelte';
4
4
  export let appInput;
5
5
  export let defaultUserInput = false;
6
- $: isRunnableSelected = isScriptByPathDefined(appInput) || isScriptByNameDefined(appInput);
6
+ export let appComponent;
7
7
  </script>
8
8
 
9
- {#if isRunnableSelected}
10
- <SelectedRunnable bind:appInput />
11
- {:else}
12
- <RunnableSelector {defaultUserInput} bind:appInput />
9
+ {#if isScriptByPathDefined(appInput) || isScriptByNameDefined(appInput)}
10
+ <SelectedRunnable {appComponent} bind:appInput />
11
+ {:else if appInput !== undefined}
12
+ <RunnableSelector id={appComponent.id} {defaultUserInput} bind:appInput />
13
13
  {/if}
@@ -1,9 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { ResultAppInput } from '../../../inputType';
3
+ import type { AppComponent } from '../../component';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  appInput: ResultAppInput;
6
7
  defaultUserInput?: boolean | undefined;
8
+ appComponent: AppComponent;
7
9
  };
8
10
  events: {
9
11
  [evt: string]: CustomEvent<any>;
@@ -1,5 +1,4 @@
1
1
  <script>import Toggle from '../../../../Toggle.svelte';
2
- import { staticValues } from '../../componentsPanel/componentStaticValues';
3
2
  import ArrayStaticInputEditor from '../ArrayStaticInputEditor.svelte';
4
3
  import ResourcePicker from '../../../../ResourcePicker.svelte';
5
4
  import JsonEditor from './JsonEditor.svelte';
@@ -8,32 +7,47 @@ import IconSelectInput from './IconSelectInput.svelte';
8
7
  import ColorInput from './ColorInput.svelte';
9
8
  import { Icon } from 'svelte-awesome';
10
9
  import { faDollarSign } from '@fortawesome/free-solid-svg-icons';
10
+ import TabSelectInput from './TabSelectInput.svelte';
11
11
  export let componentInput;
12
+ export let fieldType = undefined;
13
+ export let subFieldType = undefined;
14
+ export let selectOptions = undefined;
15
+ export let placeholder = undefined;
16
+ export let format = undefined;
17
+ export let noVariablePicker = false;
12
18
  const { onchange } = getContext('AppViewerContext');
13
19
  const { pickVariableCallback } = getContext('AppEditorContext');
14
20
  $: componentInput && onchange?.();
15
21
  </script>
16
22
 
17
23
  {#if componentInput?.type === 'static'}
18
- {#if componentInput.fieldType === 'number'}
24
+ {#if fieldType === 'number'}
19
25
  <input on:keydown|stopPropagation type="number" bind:value={componentInput.value} />
20
- {:else if componentInput.fieldType === 'textarea'}
26
+ {:else if fieldType === 'textarea'}
21
27
  <textarea on:keydown|stopPropagation bind:value={componentInput.value} />
22
- {:else if componentInput.fieldType === 'date'}
28
+ {:else if fieldType === 'date'}
23
29
  <input on:keydown|stopPropagation type="date" bind:value={componentInput.value} />
24
- {:else if componentInput.fieldType === 'boolean'}
30
+ {:else if fieldType === 'boolean'}
25
31
  <Toggle bind:checked={componentInput.value} />
26
- {:else if componentInput.fieldType === 'select'}
32
+ {:else if fieldType === 'select' && selectOptions}
27
33
  <select on:keydown|stopPropagation on:keydown|stopPropagation bind:value={componentInput.value}>
28
- {#each staticValues[componentInput.optionValuesKey] || [] as option}
29
- <option value={option}>
30
- {option}
31
- </option>
34
+ {#each selectOptions ?? [] as option}
35
+ {#if typeof option == 'string'}
36
+ <option value={option}>
37
+ {option}
38
+ </option>
39
+ {:else}
40
+ <option value={option.value}>
41
+ {option.label}
42
+ </option>
43
+ {/if}
32
44
  {/each}
33
45
  </select>
34
- {:else if componentInput.fieldType === 'icon-select'}
46
+ {:else if fieldType === 'icon-select'}
35
47
  <IconSelectInput bind:componentInput />
36
- {:else if componentInput.fieldType === 'labeledresource'}
48
+ {:else if fieldType === 'tab-select'}
49
+ <TabSelectInput bind:componentInput />
50
+ {:else if fieldType === 'labeledresource'}
37
51
  {#if componentInput?.value && typeof componentInput?.value == 'object' && 'label' in componentInput?.value}
38
52
  <div class="flex flex-col gap-1 w-full">
39
53
  <input
@@ -46,9 +60,12 @@ $: componentInput && onchange?.();
46
60
  initialValue={componentInput.value?.['value']?.split('$res:')[1] || ''}
47
61
  on:change={(e) => {
48
62
  let path = e.detail
49
-
50
- if (componentInput && path) {
51
- componentInput.value['value'] = `$res:${path}`
63
+ if (componentInput) {
64
+ if (path) {
65
+ componentInput.value['value'] = `$res:${path}`
66
+ } else {
67
+ componentInput.value['value'] = undefined
68
+ }
52
69
  }
53
70
  }}
54
71
  />
@@ -56,21 +73,24 @@ $: componentInput && onchange?.();
56
73
  {:else}
57
74
  Inconsistent labeled resource object
58
75
  {/if}
59
- {:else if componentInput.fieldType === 'color'}
76
+ {:else if fieldType === 'color'}
60
77
  <ColorInput bind:componentInput />
61
- {:else if componentInput.fieldType === 'object'}
62
- {#if componentInput?.format?.startsWith('resource-')}
78
+ {:else if fieldType === 'object'}
79
+ {#if format?.startsWith('resource-')}
63
80
  <ResourcePicker
64
81
  initialValue={componentInput.value?.split('$res:')[1] || ''}
65
82
  on:change={(e) => {
66
83
  let path = e.detail
67
-
68
- if (componentInput && path) {
69
- componentInput.value = `$res:${path}`
84
+ if (componentInput) {
85
+ if (path) {
86
+ componentInput.value = `$res:${path}`
87
+ } else {
88
+ componentInput.value = undefined
89
+ }
70
90
  }
71
91
  }}
72
- resourceType={componentInput.format.split('-').length > 1
73
- ? componentInput.format.substring('resource-'.length)
92
+ resourceType={format.split('-').length > 1
93
+ ? format.substring('resource-'.length)
74
94
  : undefined}
75
95
  />
76
96
  {:else}
@@ -81,28 +101,30 @@ $: componentInput && onchange?.();
81
101
  />
82
102
  </div>
83
103
  {/if}
84
- {:else if componentInput.fieldType === 'array'}
85
- <ArrayStaticInputEditor bind:componentInput on:deleteArrayItem />
104
+ {:else if fieldType === 'array'}
105
+ <ArrayStaticInputEditor {subFieldType} bind:componentInput on:deleteArrayItem />
86
106
  {:else}
87
107
  <div class="flex gap-1">
88
108
  <input
89
109
  on:keydown|stopPropagation
90
110
  type="text"
91
- placeholder="Static value"
111
+ placeholder={placeholder ?? 'Static value'}
92
112
  bind:value={componentInput.value}
93
113
  />
94
- <!-- svelte-ignore a11y-click-events-have-key-events -->
95
- <div
96
- class="min-w-min min-h-[34px] items-center leading-4 px-3 text-gray-600 cursor-pointer border border-gray-700 rounded center-center"
97
- on:click={() => {
98
- $pickVariableCallback = (variable) => {
99
- if (componentInput) {
100
- componentInput.value = `$var:${variable}`
114
+ {#if !noVariablePicker}
115
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
116
+ <div
117
+ class="min-w-min min-h-[34px] items-center leading-4 px-3 text-gray-600 cursor-pointer border border-gray-700 rounded center-center"
118
+ on:click={() => {
119
+ $pickVariableCallback = (variable) => {
120
+ if (componentInput) {
121
+ componentInput.value = `$var:${variable}`
122
+ }
101
123
  }
102
- }
103
- }}
104
- ><Icon data={faDollarSign} />
105
- </div>
124
+ }}
125
+ ><Icon data={faDollarSign} />
126
+ </div>
127
+ {/if}
106
128
  </div>
107
129
  {/if}
108
130
  {/if}
@@ -1,8 +1,14 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { StaticAppInput } from '../../../inputType';
2
+ import type { InputType, StaticInput, StaticOptions } from '../../../inputType';
3
3
  declare const __propDef: {
4
4
  props: {
5
- componentInput: StaticAppInput | undefined;
5
+ componentInput: StaticInput<any> | undefined;
6
+ fieldType?: InputType | undefined;
7
+ subFieldType?: InputType | undefined;
8
+ selectOptions?: StaticOptions['selectOptions'] | undefined;
9
+ placeholder?: string | undefined;
10
+ format?: string | undefined;
11
+ noVariablePicker?: boolean | undefined;
6
12
  };
7
13
  events: {
8
14
  keydown: KeyboardEvent;