windmill-components 1.79.0 → 1.82.1

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 (204) 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/Multiselect.svelte.d.ts +2 -2
  5. package/components/SchemaEditor.svelte +15 -10
  6. package/components/SettingSection.svelte +1 -1
  7. package/components/Toggle.svelte +5 -2
  8. package/components/Toggle.svelte.d.ts +1 -0
  9. package/components/apps/components/buttons/AppButton.svelte +35 -56
  10. package/components/apps/components/buttons/AppButton.svelte.d.ts +2 -1
  11. package/components/apps/components/buttons/AppForm.svelte +24 -24
  12. package/components/apps/components/buttons/AppForm.svelte.d.ts +1 -1
  13. package/components/apps/components/buttons/AppFormButton.svelte +79 -94
  14. package/components/apps/components/buttons/AppFormButton.svelte.d.ts +1 -3
  15. package/components/apps/components/display/AppBarChart.svelte +2 -2
  16. package/components/apps/components/display/AppBarChart.svelte.d.ts +1 -1
  17. package/components/apps/components/display/AppDisplayComponent.svelte +2 -2
  18. package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +1 -1
  19. package/components/apps/components/display/AppHtml.svelte +10 -2
  20. package/components/apps/components/display/AppHtml.svelte.d.ts +1 -1
  21. package/components/apps/components/display/AppIcon.svelte +4 -1
  22. package/components/apps/components/display/AppIcon.svelte.d.ts +1 -1
  23. package/components/apps/components/display/AppImage.svelte +28 -15
  24. package/components/apps/components/display/AppImage.svelte.d.ts +1 -1
  25. package/components/apps/components/display/AppMap.svelte.d.ts +1 -1
  26. package/components/apps/components/display/AppPdf.svelte +3 -2
  27. package/components/apps/components/display/AppPdf.svelte.d.ts +1 -1
  28. package/components/apps/components/display/AppPieChart.svelte +2 -2
  29. package/components/apps/components/display/AppPieChart.svelte.d.ts +1 -1
  30. package/components/apps/components/display/AppScatterChart.svelte +2 -2
  31. package/components/apps/components/display/AppScatterChart.svelte.d.ts +1 -1
  32. package/components/apps/components/display/AppText.svelte +35 -22
  33. package/components/apps/components/display/AppText.svelte.d.ts +1 -1
  34. package/components/apps/components/display/AppTimeseries.svelte +2 -2
  35. package/components/apps/components/display/AppTimeseries.svelte.d.ts +1 -1
  36. package/components/apps/components/display/PlotlyHtml.svelte +3 -3
  37. package/components/apps/components/display/VegaLiteHtml.svelte +2 -2
  38. package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
  39. package/components/apps/components/display/table/AppTable.svelte +40 -17
  40. package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
  41. package/components/apps/components/helpers/HiddenComponent.svelte +6 -3
  42. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -1
  43. package/components/apps/components/helpers/InputValue.svelte +9 -9
  44. package/components/apps/components/helpers/Loader.svelte +18 -0
  45. package/components/apps/components/helpers/Loader.svelte.d.ts +18 -0
  46. package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -12
  47. package/components/apps/components/helpers/ResolveConfig.svelte +29 -0
  48. package/components/apps/components/helpers/ResolveConfig.svelte.d.ts +21 -0
  49. package/components/apps/components/helpers/RunnableComponent.svelte +117 -89
  50. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +14 -3
  51. package/components/apps/components/helpers/RunnableWrapper.svelte +50 -9
  52. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +27 -2
  53. package/components/apps/components/inputs/AppCheckbox.svelte +1 -1
  54. package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +1 -1
  55. package/components/apps/components/inputs/AppDateInput.svelte.d.ts +1 -1
  56. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +1 -1
  57. package/components/apps/components/inputs/AppMultiSelect.svelte +0 -1
  58. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +1 -1
  59. package/components/apps/components/inputs/AppNumberInput.svelte +1 -1
  60. package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +1 -3
  61. package/components/apps/components/inputs/AppRangeInput.svelte +7 -1
  62. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -1
  63. package/components/apps/components/inputs/AppSelect.svelte +8 -3
  64. package/components/apps/components/inputs/AppSelect.svelte.d.ts +1 -1
  65. package/components/apps/components/inputs/AppSliderInputs.svelte +7 -1
  66. package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -1
  67. package/components/apps/components/inputs/AppTextInput.svelte +4 -4
  68. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -3
  69. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +17 -19
  70. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +1 -1
  71. package/components/apps/components/layout/AppContainer.svelte +7 -4
  72. package/components/apps/components/layout/AppContainer.svelte.d.ts +1 -1
  73. package/components/apps/components/layout/AppDivider.svelte +4 -1
  74. package/components/apps/components/layout/AppDivider.svelte.d.ts +1 -1
  75. package/components/apps/components/layout/AppDrawer.svelte +7 -4
  76. package/components/apps/components/layout/AppDrawer.svelte.d.ts +1 -1
  77. package/components/apps/components/layout/AppSplitpanes.svelte +34 -21
  78. package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +1 -3
  79. package/components/apps/components/layout/AppTabs.svelte +17 -34
  80. package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -2
  81. package/components/apps/editor/AppEditor.svelte +17 -13
  82. package/components/apps/editor/AppEditorHeader.svelte +2 -3
  83. package/components/apps/editor/AppPreview.svelte +11 -17
  84. package/components/apps/editor/ComponentHeader.svelte +10 -8
  85. package/components/apps/editor/ComponentHeader.svelte.d.ts +0 -1
  86. package/components/apps/editor/GridEditor.svelte +21 -50
  87. package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
  88. package/components/apps/editor/RecomputeAllComponents.svelte +13 -2
  89. package/components/apps/editor/SettingsPanel.svelte +103 -40
  90. package/components/apps/editor/SubGridEditor.svelte +32 -41
  91. package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -2
  92. package/components/apps/editor/appUtils.d.ts +49 -7
  93. package/components/apps/editor/appUtils.js +133 -37
  94. package/components/apps/editor/component/Component.svelte +22 -11
  95. package/components/apps/editor/component/Component.svelte.d.ts +1 -2
  96. package/components/apps/editor/component/ComponentNavigation.svelte +19 -12
  97. package/components/apps/editor/component/README.md +4 -0
  98. package/components/apps/editor/component/components.d.ts +1550 -17
  99. package/components/apps/editor/component/components.js +295 -325
  100. package/components/apps/editor/component/default-codes.d.ts +1 -1
  101. package/components/apps/editor/component/default-codes.js +25 -25
  102. package/components/apps/editor/componentsPanel/ComponentList.svelte +18 -3
  103. package/components/apps/editor/componentsPanel/CssProperty.svelte +92 -50
  104. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +8 -3
  105. package/components/apps/editor/componentsPanel/CssSettings.svelte +48 -90
  106. package/components/apps/editor/componentsPanel/ListItem.svelte +3 -0
  107. package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +2 -0
  108. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +167 -0
  109. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +18 -0
  110. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +130 -0
  111. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +21 -0
  112. package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +535 -0
  113. package/components/apps/editor/componentsPanel/quickStyleProperties.js +595 -0
  114. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +1 -1
  115. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +146 -130
  116. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +2 -1
  117. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +31 -3
  118. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
  119. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +42 -76
  120. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +67 -17
  121. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +1 -3
  122. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +27 -0
  123. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte.d.ts +17 -0
  124. package/components/apps/editor/inlineScriptsPanel/utils.d.ts +2 -0
  125. package/components/apps/editor/inlineScriptsPanel/utils.js +6 -5
  126. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +10 -2
  127. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +37 -31
  128. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +4 -104
  129. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +113 -67
  130. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +5 -3
  131. package/components/apps/editor/settingsPanel/GridTab.svelte +0 -1
  132. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +99 -80
  133. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +8 -0
  134. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +25 -2
  135. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +1 -0
  136. package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +52 -0
  137. package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte.d.ts +28 -0
  138. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +70 -26
  139. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +2 -0
  140. package/components/apps/editor/settingsPanel/StylePanel.svelte +23 -0
  141. package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +17 -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/TableActions.svelte +8 -63
  145. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
  146. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +3 -4
  147. package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +3 -1
  148. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +2 -4
  149. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +5 -5
  150. package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +2 -0
  151. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +48 -32
  152. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +8 -2
  153. package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte +46 -0
  154. package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte.d.ts +20 -0
  155. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +7 -0
  156. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
  157. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +47 -0
  158. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +14 -0
  159. package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +2 -0
  160. package/components/apps/editor/settingsPanel/secondaryMenu/index.js +2 -0
  161. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +12 -0
  162. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +10 -0
  163. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +20 -70
  164. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +1 -0
  165. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +14 -8
  166. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +5 -1
  167. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +85 -27
  168. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +4 -6
  169. package/components/apps/gridUtils.js +1 -1
  170. package/components/apps/inputType.d.ts +12 -16
  171. package/components/apps/rx.d.ts +2 -0
  172. package/components/apps/rx.js +8 -2
  173. package/components/apps/svelte-grid/Grid.svelte +0 -4
  174. package/components/apps/svelte-grid/Grid.svelte.d.ts +1 -1
  175. package/components/apps/svelte-grid/MoveResize.svelte +24 -30
  176. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +0 -4
  177. package/components/apps/svelte-grid/types.d.ts +1 -7
  178. package/components/apps/svelte-grid/utils/helper.js +6 -10
  179. package/components/apps/types.d.ts +22 -22
  180. package/components/apps/utils.d.ts +2 -2
  181. package/components/apps/utils.js +13 -11
  182. package/components/common/button/ButtonPopup.svelte +5 -2
  183. package/components/common/button/ButtonPopup.svelte.d.ts +5 -1
  184. package/components/common/button/ButtonPopupItem.svelte +2 -1
  185. package/components/common/button/ButtonPopupItem.svelte.d.ts +1 -0
  186. package/components/common/clearableInput/ClearableInput.svelte +56 -0
  187. package/components/common/clearableInput/ClearableInput.svelte.d.ts +28 -0
  188. package/components/common/index.d.ts +1 -0
  189. package/components/common/index.js +1 -0
  190. package/components/common/kbd/Kbd.svelte +4 -1
  191. package/components/common/kbd/Kbd.svelte.d.ts +6 -14
  192. package/components/common/menu/Menu.svelte +8 -2
  193. package/components/common/menu/Menu.svelte.d.ts +4 -1
  194. package/components/common/modal/AlwaysMountedModal.svelte +109 -0
  195. package/components/common/modal/AlwaysMountedModal.svelte.d.ts +22 -0
  196. package/components/common/skeleton/Skeleton.svelte +1 -1
  197. package/components/flows/flowStateUtils.js +8 -1
  198. package/package.json +672 -659
  199. package/utils.d.ts +1 -0
  200. package/utils.js +3 -0
  201. package/components/apps/editor/GridPanel.svelte +0 -31
  202. package/components/apps/editor/GridPanel.svelte.d.ts +0 -18
  203. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +0 -12
  204. package/components/apps/editor/componentsPanel/componentStaticValues.js +0 -25
@@ -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,18 +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';
7
8
  import ComponentTriggerList from './triggerLists/ComponentTriggerList.svelte';
8
9
  const { app } = getContext('AppViewerContext');
10
+ const { selectedComponentInEditor } = getContext('AppEditorContext');
9
11
  export let appInput;
10
- let inlineScriptEditorDrawer;
11
- function edit() {
12
- if (appInput.runnable?.type === 'runnableByName') {
13
- inlineScriptEditorDrawer?.openDrawer();
14
- }
15
- }
12
+ export let appComponent;
16
13
  function detach() {
17
14
  if (appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript) {
18
15
  $app.unusedInlineScripts.push({
@@ -28,13 +25,7 @@ function clear() {
28
25
  }
29
26
  </script>
30
27
 
31
- {#if appInput.runnable && appInput.runnable.type === 'runnableByName' && appInput.runnable.inlineScript}
32
- <InlineScriptEditorDrawer
33
- bind:this={inlineScriptEditorDrawer}
34
- bind:inlineScript={appInput.runnable.inlineScript}
35
- />
36
- {/if}
37
- <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">
38
29
  <span class="text-xs font-semibold truncate">
39
30
  {#if appInput.runnable?.type === 'runnableByName'}
40
31
  {appInput.runnable.name}
@@ -42,13 +33,10 @@ function clear() {
42
33
  {appInput.runnable.path}
43
34
  {/if}
44
35
  </span>
45
- <div class="flex gap-1 flex-wrap justify-center">
36
+ <div class="flex gap-1 justify-center">
46
37
  {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript}
47
- <Button size="xs" color="light" variant="border" startIcon={{ icon: faEdit }} on:click={edit}>
48
- Edit
49
- </Button>
50
38
  <Button size="xs" color="light" variant="border" on:click={detach}>
51
- Detach
39
+ Detach&nbsp;
52
40
  <Tooltip>
53
41
  Detaching an inline script keep it for later to be reused by another component
54
42
  </Tooltip>
@@ -59,17 +47,73 @@ function clear() {
59
47
  </Button>
60
48
  </div>
61
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
+
62
93
  {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript}
63
- <ComponentTriggerList fields={appInput.fields} />
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>
64
114
  {/if}
65
115
  {#if appInput.runnable?.type === 'runnableByName' && !appInput.runnable.inlineScript}
66
116
  <span class="text-xs text-gray-500">
67
117
  Please configure the language in the inline script panel
68
118
  </span>
69
119
  {/if}
70
- {#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript?.language === 'frontend'}
71
- <span class="text-xs text-gray-500">
72
- If the component is a display component. The script will be recomputed upon any changes to any
73
- output or to the state.
74
- </span>
75
- {/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>;
@@ -0,0 +1,23 @@
1
+ <script>import { getContext } from 'svelte';
2
+ import { ccomponents } from '../component';
3
+ import CssProperty from '../componentsPanel/CssProperty.svelte';
4
+ import { quickStyleProperties } from '../componentsPanel/quickStyleProperties';
5
+ export let component;
6
+ const { app } = getContext('AppViewerContext');
7
+ </script>
8
+
9
+ {#if component && component.customCss !== undefined}
10
+ {#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
11
+ <div class="w-full">
12
+ <CssProperty
13
+ quickStyleProperties={quickStyleProperties?.[component.type]?.[name]}
14
+ forceStyle={ccomponents[component.type].customCss[name].style !== undefined}
15
+ forceClass={ccomponents[component.type].customCss[name].class !== undefined}
16
+ {name}
17
+ componentType={component.type}
18
+ bind:value={component.customCss[name]}
19
+ on:change={() => app.set($app)}
20
+ />
21
+ </div>
22
+ {/each}
23
+ {/if}
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import { type AppComponent } from '../component';
3
+ declare const __propDef: {
4
+ props: {
5
+ component: AppComponent | undefined;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export type StylePanelProps = typeof __propDef.props;
13
+ export type StylePanelEvents = typeof __propDef.events;
14
+ export type StylePanelSlots = typeof __propDef.slots;
15
+ export default class StylePanel extends SvelteComponentTyped<StylePanelProps, StylePanelEvents, StylePanelSlots> {
16
+ }
17
+ export {};
@@ -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>;
@@ -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,19 +1,18 @@
1
- <script>import ColorPicker, { ChromeVariant } from 'svelte-awesome-color-picker';
2
- export let componentInput;
1
+ <script>import { createEventDispatcher } from 'svelte';
2
+ import ColorPicker, { ChromeVariant } from 'svelte-awesome-color-picker';
3
+ import { ClearableInput } from '../../../../common';
4
+ export let value = '#fff';
5
+ const dispatch = createEventDispatcher();
3
6
  let isOpen = false;
7
+ $: dispatch('change', value);
4
8
  </script>
5
9
 
6
- <div class="color-picker-input">
7
- <input
8
- type="text"
9
- readonly
10
- value={componentInput.value}
11
- on:focus|preventDefault|stopPropagation={() => (isOpen = true)}
12
- />
10
+ <div class="color-picker-input grow">
11
+ <ClearableInput readonly bind:value on:focus={() => (isOpen = true)} />
13
12
  <ColorPicker
14
13
  bind:isOpen
15
- bind:hex={componentInput.value}
16
- label={componentInput.value}
14
+ bind:hex={value}
15
+ label={value}
17
16
  canChangeMode={false}
18
17
  components={ChromeVariant}
19
18
  toRight
@@ -22,7 +21,7 @@ let isOpen = false;
22
21
  </div>
23
22
 
24
23
  <style global>
25
- :global(.color-picker-input) :global(span) > :global(label.svelte-rogbpz) {
24
+ :global(.color-picker-input) :global(span) > :global(label) {
26
25
  display: none;
27
26
  }
28
27
 
@@ -30,6 +29,7 @@ let isOpen = false;
30
29
  box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.25) !important;
31
30
  border-style: none !important;
32
31
  border-radius: 0.375rem !important;
32
+ z-index: 20;
33
33
  }
34
34
 
35
35
  :global(.color-picker-input) :global(.slider-wrapper) {
@@ -1,12 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput, StaticInput } from '../../../inputType';
3
2
  declare const __propDef: {
4
3
  props: {
5
- componentInput: StaticInput<string> & Extract<AppInput, {
6
- fieldType: 'color';
7
- }>;
4
+ value?: string | undefined;
8
5
  };
9
6
  events: {
7
+ change: CustomEvent<any>;
8
+ } & {
10
9
  [evt: string]: CustomEvent<any>;
11
10
  };
12
11
  slots: {};
@@ -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
@@ -59,10 +73,10 @@ $: componentInput && onchange?.();
59
73
  {:else}
60
74
  Inconsistent labeled resource object
61
75
  {/if}
62
- {:else if componentInput.fieldType === 'color'}
63
- <ColorInput bind:componentInput />
64
- {:else if componentInput.fieldType === 'object'}
65
- {#if componentInput?.format?.startsWith('resource-')}
76
+ {:else if fieldType === 'color'}
77
+ <ColorInput bind:value={componentInput.value} />
78
+ {:else if fieldType === 'object'}
79
+ {#if format?.startsWith('resource-')}
66
80
  <ResourcePicker
67
81
  initialValue={componentInput.value?.split('$res:')[1] || ''}
68
82
  on:change={(e) => {
@@ -75,8 +89,8 @@ $: componentInput && onchange?.();
75
89
  }
76
90
  }
77
91
  }}
78
- resourceType={componentInput.format.split('-').length > 1
79
- ? componentInput.format.substring('resource-'.length)
92
+ resourceType={format.split('-').length > 1
93
+ ? format.substring('resource-'.length)
80
94
  : undefined}
81
95
  />
82
96
  {:else}
@@ -87,28 +101,30 @@ $: componentInput && onchange?.();
87
101
  />
88
102
  </div>
89
103
  {/if}
90
- {:else if componentInput.fieldType === 'array'}
91
- <ArrayStaticInputEditor bind:componentInput on:deleteArrayItem />
104
+ {:else if fieldType === 'array'}
105
+ <ArrayStaticInputEditor {subFieldType} bind:componentInput on:deleteArrayItem />
92
106
  {:else}
93
107
  <div class="flex gap-1">
94
108
  <input
95
109
  on:keydown|stopPropagation
96
110
  type="text"
97
- placeholder="Static value"
111
+ placeholder={placeholder ?? 'Static value'}
98
112
  bind:value={componentInput.value}
99
113
  />
100
- <!-- svelte-ignore a11y-click-events-have-key-events -->
101
- <div
102
- 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"
103
- on:click={() => {
104
- $pickVariableCallback = (variable) => {
105
- if (componentInput) {
106
- 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
+ }
107
123
  }
108
- }
109
- }}
110
- ><Icon data={faDollarSign} />
111
- </div>
124
+ }}
125
+ ><Icon data={faDollarSign} />
126
+ </div>
127
+ {/if}
112
128
  </div>
113
129
  {/if}
114
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;