windmill-components 1.75.0 → 1.78.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 (238) hide show
  1. package/components/ArgInput.svelte +4 -14
  2. package/components/DisplayResult.svelte +1 -1
  3. package/components/Dropdown.svelte +14 -4
  4. package/components/FlowGraphViewer.svelte +1 -1
  5. package/components/FolderUsageInfo.svelte +16 -6
  6. package/components/FolderUsageInfo.svelte.d.ts +2 -0
  7. package/components/LightweightArgInput.svelte +315 -0
  8. package/components/LightweightArgInput.svelte.d.ts +47 -0
  9. package/components/LightweightSchemaForm.svelte +31 -0
  10. package/components/LightweightSchemaForm.svelte.d.ts +18 -0
  11. package/components/ModulePreview.svelte +1 -0
  12. package/components/Multiselect.svelte.d.ts +2 -2
  13. package/components/PageHeader.svelte +1 -1
  14. package/components/Path.svelte +26 -3
  15. package/components/Range.svelte.d.ts +2 -2
  16. package/components/ScriptBuilder.svelte +122 -122
  17. package/components/SettingSection.svelte +44 -0
  18. package/components/SettingSection.svelte.d.ts +21 -0
  19. package/components/SimpleEditor.svelte +1 -1
  20. package/components/SimpleEditor.svelte.d.ts +2 -0
  21. package/components/TemplateEditor.svelte +3 -0
  22. package/components/TemplateEditor.svelte.d.ts +0 -204
  23. package/components/Tooltip.svelte +3 -1
  24. package/components/VariableEditor.svelte +2 -1
  25. package/components/WhitelistIp.svelte +1 -3
  26. package/components/apps/components/buttons/AppButton.svelte +16 -8
  27. package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -2
  28. package/components/apps/components/buttons/AppForm.svelte +3 -7
  29. package/components/apps/components/buttons/AppFormButton.svelte +3 -7
  30. package/components/apps/components/display/AppBarChart.svelte +7 -3
  31. package/components/apps/components/display/AppBarChart.svelte.d.ts +0 -2
  32. package/components/apps/components/display/AppDisplayComponent.svelte +7 -3
  33. package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +0 -2
  34. package/components/apps/components/display/AppHtml.svelte +7 -11
  35. package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
  36. package/components/apps/components/display/AppIcon.svelte +0 -1
  37. package/components/apps/components/display/AppIcon.svelte.d.ts +0 -2
  38. package/components/apps/components/display/AppImage.svelte +0 -1
  39. package/components/apps/components/display/AppImage.svelte.d.ts +0 -2
  40. package/components/apps/components/display/AppMap.svelte +10 -3
  41. package/components/apps/components/display/AppMap.svelte.d.ts +0 -2
  42. package/components/apps/components/display/AppPdf.svelte +8 -3
  43. package/components/apps/components/display/AppPdf.svelte.d.ts +0 -2
  44. package/components/apps/components/display/AppPieChart.svelte +7 -3
  45. package/components/apps/components/display/AppPieChart.svelte.d.ts +0 -2
  46. package/components/apps/components/display/AppScatterChart.svelte +7 -3
  47. package/components/apps/components/display/AppScatterChart.svelte.d.ts +0 -2
  48. package/components/apps/components/display/AppText.svelte +41 -17
  49. package/components/apps/components/display/AppText.svelte.d.ts +0 -2
  50. package/components/apps/components/display/AppTimeseries.svelte +7 -3
  51. package/components/apps/components/display/AppTimeseries.svelte.d.ts +0 -2
  52. package/components/apps/components/display/PlotlyHtml.svelte +9 -4
  53. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
  54. package/components/apps/components/display/VegaLiteHtml.svelte +8 -3
  55. package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +0 -2
  56. package/components/apps/components/display/table/AppAggridTable.svelte +13 -5
  57. package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +0 -2
  58. package/components/apps/components/display/table/AppTable.svelte +19 -13
  59. package/components/apps/components/display/table/AppTable.svelte.d.ts +0 -2
  60. package/components/apps/components/helpers/HiddenComponent.svelte +11 -2
  61. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -2
  62. package/components/apps/components/helpers/InputValue.svelte +26 -43
  63. package/components/apps/components/helpers/InputValue.svelte.d.ts +4 -3
  64. package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -2
  65. package/components/apps/components/helpers/RefreshButton.svelte +2 -3
  66. package/components/apps/components/helpers/ResizeWrapper.svelte +3 -4
  67. package/components/apps/components/helpers/RunnableComponent.svelte +63 -51
  68. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
  69. package/components/apps/components/helpers/RunnableWrapper.svelte +2 -2
  70. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -1
  71. package/components/apps/components/helpers/eval.d.ts +5 -0
  72. package/components/apps/components/helpers/eval.js +57 -0
  73. package/components/apps/components/inputs/AppCheckbox.svelte +4 -2
  74. package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +0 -2
  75. package/components/apps/components/inputs/AppDateInput.svelte +4 -2
  76. package/components/apps/components/inputs/AppDateInput.svelte.d.ts +0 -2
  77. package/components/apps/components/inputs/AppFileInput.svelte +4 -2
  78. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +0 -2
  79. package/components/apps/components/inputs/AppMultiSelect.svelte +4 -2
  80. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +0 -2
  81. package/components/apps/components/inputs/AppNumberInput.svelte +4 -2
  82. package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +0 -2
  83. package/components/apps/components/inputs/AppRangeInput.svelte +5 -2
  84. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +0 -2
  85. package/components/apps/components/inputs/AppSelect.svelte +4 -2
  86. package/components/apps/components/inputs/AppSelect.svelte.d.ts +0 -2
  87. package/components/apps/components/inputs/AppSliderInputs.svelte +4 -2
  88. package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +0 -2
  89. package/components/apps/components/inputs/AppTextInput.svelte +5 -3
  90. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +0 -2
  91. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +5 -2
  92. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +0 -2
  93. package/components/apps/components/layout/AppContainer.svelte +1 -7
  94. package/components/apps/components/layout/AppContainer.svelte.d.ts +0 -2
  95. package/components/apps/components/layout/AppDrawer.svelte +0 -3
  96. package/components/apps/components/layout/AppSplitpanes.svelte +1 -6
  97. package/components/apps/components/layout/AppTabs.svelte +62 -34
  98. package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -2
  99. package/components/apps/editor/AppComponentInput.svelte +2 -1
  100. package/components/apps/editor/AppEditor.svelte +145 -143
  101. package/components/apps/editor/AppEditorHeader.svelte +43 -35
  102. package/components/apps/editor/AppPreview.svelte +68 -15
  103. package/components/apps/editor/ComponentHeader.svelte +3 -1
  104. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -0
  105. package/components/apps/editor/GridEditor.svelte +58 -77
  106. package/components/apps/editor/GridPanel.svelte +3 -1
  107. package/components/apps/editor/GridViewer.svelte +91 -0
  108. package/components/apps/editor/GridViewer.svelte.d.ts +32 -0
  109. package/components/apps/editor/RecomputeAllComponents.svelte +7 -1
  110. package/components/apps/editor/SettingsPanel.svelte +23 -10
  111. package/components/apps/editor/SubGridEditor.svelte +95 -68
  112. package/components/apps/editor/SubGridEditor.svelte.d.ts +3 -4
  113. package/components/apps/editor/appUtils.d.ts +13 -3
  114. package/components/apps/editor/appUtils.js +106 -37
  115. package/components/apps/editor/component/Component.svelte +6 -52
  116. package/components/apps/editor/component/ComponentNavigation.svelte +101 -51
  117. package/components/apps/editor/component/components.d.ts +3 -3
  118. package/components/apps/editor/component/components.js +59 -115
  119. package/components/apps/editor/componentsPanel/ComponentList.svelte +5 -4
  120. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -1
  121. package/components/apps/editor/componentsPanel/componentStaticValues.js +1 -0
  122. package/components/apps/editor/contextPanel/ComponentOutput.svelte +67 -0
  123. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +21 -0
  124. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +15 -10
  125. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte.d.ts +0 -1
  126. package/components/apps/editor/contextPanel/ContextPanel.svelte +73 -136
  127. package/components/apps/editor/contextPanel/SubGridOutput.svelte +66 -0
  128. package/components/apps/editor/contextPanel/SubGridOutput.svelte.d.ts +19 -0
  129. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +41 -0
  130. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +18 -0
  131. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +9 -0
  132. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +16 -0
  133. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
  134. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
  135. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +99 -0
  136. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +24 -0
  137. package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +17 -0
  138. package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +17 -0
  139. package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +13 -0
  140. package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +17 -0
  141. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +55 -23
  142. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +74 -44
  143. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +1 -1
  144. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +5 -9
  145. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +2 -2
  146. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +43 -37
  147. package/components/apps/editor/settingsPanel/GridPane.svelte +1 -3
  148. package/components/apps/editor/settingsPanel/GridTab.svelte +5 -15
  149. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -16
  150. package/components/apps/editor/settingsPanel/Recompute.svelte +1 -0
  151. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +6 -0
  152. package/components/apps/editor/settingsPanel/TableActions.svelte +4 -6
  153. package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +2 -8
  154. package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +2 -2
  155. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +58 -46
  156. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +1 -1
  157. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +2 -0
  158. package/components/apps/gridUtils.d.ts +1 -3
  159. package/components/apps/gridUtils.js +1 -15
  160. package/components/apps/rx.d.ts +7 -5
  161. package/components/apps/rx.js +37 -19
  162. package/components/apps/svelte-grid/Grid.svelte +167 -0
  163. package/components/apps/svelte-grid/Grid.svelte.d.ts +45 -0
  164. package/components/apps/svelte-grid/LICENSE +23 -0
  165. package/components/apps/svelte-grid/MoveResize.svelte +328 -0
  166. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +46 -0
  167. package/components/apps/svelte-grid/types.d.ts +21 -0
  168. package/components/apps/svelte-grid/utils/container.d.ts +1 -0
  169. package/components/apps/svelte-grid/utils/container.js +4 -0
  170. package/components/apps/svelte-grid/utils/helper.d.ts +10 -0
  171. package/components/apps/svelte-grid/utils/helper.js +36 -0
  172. package/components/apps/svelte-grid/utils/item.d.ts +14 -0
  173. package/components/apps/svelte-grid/utils/item.js +192 -0
  174. package/components/apps/svelte-grid/utils/matrix.d.ts +6 -0
  175. package/components/apps/svelte-grid/utils/matrix.js +53 -0
  176. package/components/apps/svelte-grid/utils/other.d.ts +3 -0
  177. package/components/apps/svelte-grid/utils/other.js +30 -0
  178. package/components/apps/types.d.ts +19 -14
  179. package/components/apps/utils.d.ts +1 -1
  180. package/components/apps/utils.js +15 -9
  181. package/components/common/CloseButton.svelte +18 -0
  182. package/components/common/CloseButton.svelte.d.ts +27 -0
  183. package/components/common/badge/Badge.svelte +6 -1
  184. package/components/common/badge/Badge.svelte.d.ts +1 -0
  185. package/components/common/button/Button.svelte.d.ts +1 -1
  186. package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
  187. package/components/common/drawer/DrawerContent.svelte +2 -6
  188. package/components/common/languageIcons/JavaScript.svelte +11 -0
  189. package/components/common/languageIcons/JavaScript.svelte.d.ts +25 -0
  190. package/components/common/languageIcons/LanguageIcon.svelte +3 -1
  191. package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
  192. package/components/common/menu/Menu.svelte +1 -1
  193. package/components/common/menu/Menu.svelte.d.ts +1 -1
  194. package/components/common/popup/Popup.svelte +2 -1
  195. package/components/common/popup/Popup.svelte.d.ts +9 -0
  196. package/components/common/table/AppRow.svelte +1 -4
  197. package/components/common/table/FlowRow.svelte +1 -4
  198. package/components/common/table/ScriptRow.svelte +1 -4
  199. package/components/common/tabs/Tab.svelte +1 -0
  200. package/components/common/tabs/Tab.svelte.d.ts +2 -0
  201. package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
  202. package/components/graph/FlowGraph.svelte +1 -1
  203. package/components/propertyPicker/ObjectViewer.svelte +1 -1
  204. package/components/propertyPicker/PropPicker.svelte +4 -1
  205. package/components/sidebar/SidebarContent.svelte +2 -2
  206. package/consts.js +1 -1
  207. package/history.js +8 -1
  208. package/package.json +24 -28
  209. package/utils.js +0 -1
  210. package/components/apps/editor/AppComponentInputs.svelte +0 -13
  211. package/components/apps/editor/AppComponentInputs.svelte.d.ts +0 -20
  212. package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +0 -92
  213. package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +0 -18
  214. package/components/graph/svelvet/d3/controllers/README.md +0 -3
  215. package/components/graph/svelvet/d3/controllers/d3Old.d.ts +0 -1
  216. package/components/graph/svelvet/d3/controllers/d3Old.js +0 -43
  217. package/components/graph/svelvet/docs/CHANGELOG.md +0 -145
  218. package/components/graph/svelvet/docs/DESIGN_PATTERNS.md +0 -44
  219. package/components/graph/svelvet/docs/DOCUMENTATION.md +0 -5
  220. package/components/graph/svelvet/docs/README.md +0 -34
  221. package/components/graph/svelvet/docs/TODO.md +0 -14
  222. package/components/graph/svelvet/docs/Tutorials.md +0 -25
  223. package/components/graph/svelvet/docs/images/css-background-after.png +0 -0
  224. package/components/graph/svelvet/docs/images/css-background-before.png +0 -0
  225. package/components/graph/svelvet/docs/images/custom-edges-after.png +0 -0
  226. package/components/graph/svelvet/docs/images/custom-edges-before.png +0 -0
  227. package/components/graph/svelvet/docs/images/custom-nodes-after.png +0 -0
  228. package/components/graph/svelvet/docs/images/custom-nodes-before.png +0 -0
  229. package/components/graph/svelvet/docs/images/custom-svelte-components-after.png +0 -0
  230. package/components/graph/svelvet/docs/images/custom-svelte-components-before.png +0 -0
  231. package/components/graph/svelvet/docs/images/html-docs-after.png +0 -0
  232. package/components/graph/svelvet/docs/images/html-docs-before.png +0 -0
  233. package/components/graph/svelvet/docs/images/minimap-after.png +0 -0
  234. package/components/graph/svelvet/docs/images/minimap-before.png +0 -0
  235. package/components/graph/svelvet/docs/images/node-classes-after.png +0 -0
  236. package/components/graph/svelvet/docs/images/node-classes-before.png +0 -0
  237. package/components/graph/svelvet/docs/images/node-create-after.png +0 -0
  238. package/components/graph/svelvet/docs/images/node-create-before.png +0 -0
@@ -6,6 +6,7 @@ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
6
6
  import { loadIcon } from '../icon';
7
7
  import { twMerge } from 'tailwind-merge';
8
8
  import { goto } from '$app/navigation';
9
+ import { initOutput } from '../../editor/appUtils';
9
10
  export let id;
10
11
  export let componentInput;
11
12
  export let configuration;
@@ -17,8 +18,8 @@ export let noWFull = false;
17
18
  export let preclickAction = undefined;
18
19
  export let customCss = undefined;
19
20
  export let render;
20
- export const staticOutputs = ['loading', 'result'];
21
- const { runnableComponents, worldStore, app } = getContext('AppViewerContext');
21
+ export let initializing = true;
22
+ const { worldStore, app } = getContext('AppViewerContext');
22
23
  let labelValue;
23
24
  let color;
24
25
  let size;
@@ -46,12 +47,16 @@ async function handleAfterIcon() {
46
47
  afterIconComponent = await loadIcon(afterIcon);
47
48
  }
48
49
  }
49
- $: outputs = $worldStore?.outputsById[id];
50
+ let outputs = initOutput($worldStore, id, {
51
+ result: undefined,
52
+ loading: false
53
+ });
50
54
  $: triggerOnAppLoad && runnableComponent?.runComponent();
51
55
  $: if (outputs?.loading != undefined) {
52
56
  outputs.loading.set(false, true);
53
57
  }
54
58
  $: outputs?.loading.subscribe({
59
+ id: 'loading-' + id,
55
60
  next: (value) => {
56
61
  isLoading = value;
57
62
  if (ownClick && !value) {
@@ -84,13 +89,15 @@ async function handleClick(event) {
84
89
  else {
85
90
  await runnableComponent?.runComponent();
86
91
  }
87
- if (recomputeIds) {
88
- await Promise.all(recomputeIds.map((id) => $runnableComponents?.[id]?.()));
89
- }
90
92
  }
91
93
  </script>
92
94
 
93
- <InputValue {id} input={configuration.label} bind:value={labelValue} />
95
+ <InputValue
96
+ on:done={() => initializing && (initializing = false)}
97
+ {id}
98
+ input={configuration.label}
99
+ bind:value={labelValue}
100
+ />
94
101
  <InputValue {id} input={configuration.goto} bind:value={gotoUrl} />
95
102
  <InputValue {id} input={configuration.color} bind:value={color} />
96
103
  <InputValue {id} input={configuration.size} bind:value={size} />
@@ -101,6 +108,7 @@ async function handleClick(event) {
101
108
  <InputValue
102
109
  {id}
103
110
  input={configuration.disabled}
111
+ extraContext={extraQueryParams}
104
112
  bind:value={disabled}
105
113
  bind:error={errors.disabled}
106
114
  />
@@ -108,7 +116,7 @@ async function handleClick(event) {
108
116
  <InputValue {id} input={configuration.gotoNewTab} bind:value={gotoNewTab} />
109
117
 
110
118
  <RunnableWrapper
111
- flexWrap
119
+ {recomputeIds}
112
120
  bind:runnableComponent
113
121
  {componentInput}
114
122
  {id}
@@ -14,7 +14,7 @@ declare const __propDef: {
14
14
  preclickAction?: (() => Promise<void>) | undefined;
15
15
  customCss?: ComponentCustomCSS<'button'> | undefined;
16
16
  render: boolean;
17
- staticOutputs?: string[] | undefined;
17
+ initializing?: boolean | undefined;
18
18
  };
19
19
  events: {
20
20
  [evt: string]: CustomEvent<any>;
@@ -25,6 +25,5 @@ export type AppButtonProps = typeof __propDef.props;
25
25
  export type AppButtonEvents = typeof __propDef.events;
26
26
  export type AppButtonSlots = typeof __propDef.slots;
27
27
  export default class AppButton extends SvelteComponentTyped<AppButtonProps, AppButtonEvents, AppButtonSlots> {
28
- get staticOutputs(): string[];
29
28
  }
30
29
  export {};
@@ -15,7 +15,7 @@ export let horizontalAlignment = undefined;
15
15
  export let customCss = undefined;
16
16
  export let render;
17
17
  export const staticOutputs = ['loading', 'result'];
18
- const { app, runnableComponents, worldStore, stateId } = getContext('AppViewerContext');
18
+ const { app, worldStore, stateId } = getContext('AppViewerContext');
19
19
  let labelValue = 'Default label';
20
20
  let color;
21
21
  let size;
@@ -30,6 +30,7 @@ $: if (outputs?.loading != undefined) {
30
30
  outputs.loading.set(false, true);
31
31
  }
32
32
  $: outputs?.loading.subscribe({
33
+ id: 'loading-' + id,
33
34
  next: (value) => {
34
35
  isLoading = value;
35
36
  }
@@ -43,6 +44,7 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
43
44
  <InputValue {id} input={configuration.size} bind:value={size} />
44
45
 
45
46
  <RunnableWrapper
47
+ {recomputeIds}
46
48
  {render}
47
49
  bind:runnableComponent
48
50
  {componentInput}
@@ -84,12 +86,6 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
84
86
  }}
85
87
  on:click={() => {
86
88
  runnableComponent?.runComponent()
87
-
88
- if (recomputeIds) {
89
- recomputeIds.forEach((id) => {
90
- $runnableComponents[id]?.()
91
- })
92
- }
93
89
  }}
94
90
  {size}
95
91
  {color}
@@ -18,7 +18,7 @@ export let verticalAlignment = undefined;
18
18
  export let customCss = undefined;
19
19
  export let render;
20
20
  export const staticOutputs = ['loading', 'result'];
21
- const { app, runnableComponents, worldStore } = getContext('AppViewerContext');
21
+ const { app, worldStore } = getContext('AppViewerContext');
22
22
  let labelValue = 'Default label';
23
23
  let color;
24
24
  let size;
@@ -38,6 +38,7 @@ $: if (outputs?.loading != undefined) {
38
38
  outputs.loading.set(false, true);
39
39
  }
40
40
  $: outputs?.loading.subscribe({
41
+ id: 'loading-' + id,
41
42
  next: (value) => {
42
43
  isLoading = value;
43
44
  if (ownClick && !value) {
@@ -73,6 +74,7 @@ $: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
73
74
  }}
74
75
  >
75
76
  <RunnableWrapper
77
+ {recomputeIds}
76
78
  {render}
77
79
  bind:runnableComponent
78
80
  {componentInput}
@@ -107,12 +109,6 @@ $: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
107
109
  on:click={async () => {
108
110
  await runnableComponent?.runComponent()
109
111
 
110
- if (recomputeIds) {
111
- recomputeIds.forEach((id) => {
112
- $runnableComponents[id]?.()
113
- })
114
- }
115
-
116
112
  open = false
117
113
  }}
118
114
  size="xs"
@@ -4,14 +4,18 @@ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
4
4
  import InputValue from '../helpers/InputValue.svelte';
5
5
  import { concatCustomCss } from '../../utils';
6
6
  import { getContext } from 'svelte';
7
+ import { initOutput } from '../../editor/appUtils';
7
8
  export let id;
8
9
  export let componentInput;
9
10
  export let configuration;
10
11
  export let initializing = undefined;
11
12
  export let customCss = undefined;
12
13
  export let render;
13
- export const staticOutputs = ['loading', 'result'];
14
- const { app } = getContext('AppViewerContext');
14
+ const { app, worldStore } = getContext('AppViewerContext');
15
+ initOutput($worldStore, id, {
16
+ result: undefined,
17
+ loading: false
18
+ });
15
19
  ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement);
16
20
  let result = undefined;
17
21
  let theme = 'theme1';
@@ -58,7 +62,7 @@ $: css = concatCustomCss($app.css?.barchartcomponent, customCss);
58
62
  <InputValue {id} input={configuration.theme} bind:value={theme} />
59
63
  <InputValue {id} input={configuration.line} bind:value={lineChart} />
60
64
 
61
- <RunnableWrapper {render} flexWrap autoRefresh {componentInput} {id} bind:initializing bind:result>
65
+ <RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
62
66
  <div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
63
67
  {#if result}
64
68
  {#if lineChart}
@@ -9,7 +9,6 @@ declare const __propDef: {
9
9
  initializing?: boolean | undefined;
10
10
  customCss?: ComponentCustomCSS<'container'> | undefined;
11
11
  render: boolean;
12
- staticOutputs?: string[] | undefined;
13
12
  };
14
13
  events: {
15
14
  [evt: string]: CustomEvent<any>;
@@ -20,6 +19,5 @@ export type AppBarChartProps = typeof __propDef.props;
20
19
  export type AppBarChartEvents = typeof __propDef.events;
21
20
  export type AppBarChartSlots = typeof __propDef.slots;
22
21
  export default class AppBarChart extends SvelteComponentTyped<AppBarChartProps, AppBarChartEvents, AppBarChartSlots> {
23
- get staticOutputs(): string[];
24
22
  }
25
23
  export {};
@@ -1,6 +1,7 @@
1
1
  <script>import DisplayResult from '../../../DisplayResult.svelte';
2
2
  import { getContext } from 'svelte';
3
3
  import { twMerge } from 'tailwind-merge';
4
+ import { initOutput } from '../../editor/appUtils';
4
5
  import { IS_APP_PUBLIC_CONTEXT_KEY } from '../../types';
5
6
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
6
7
  export let id;
@@ -9,12 +10,15 @@ export let initializing = undefined;
9
10
  export let customCss = undefined;
10
11
  export let render;
11
12
  const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY);
12
- const { app } = getContext('AppViewerContext');
13
+ const { app, worldStore } = getContext('AppViewerContext');
13
14
  let result = undefined;
14
- export const staticOutputs = ['result', 'loading'];
15
+ initOutput($worldStore, id, {
16
+ result: undefined,
17
+ loading: false
18
+ });
15
19
  </script>
16
20
 
17
- <RunnableWrapper {render} flexWrap {componentInput} {id} bind:initializing bind:result>
21
+ <RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
18
22
  <div
19
23
  class={twMerge(
20
24
  'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
@@ -8,7 +8,6 @@ declare const __propDef: {
8
8
  initializing?: boolean | undefined;
9
9
  customCss?: ComponentCustomCSS<'header' | 'container'> | undefined;
10
10
  render: boolean;
11
- staticOutputs?: string[] | undefined;
12
11
  };
13
12
  events: {
14
13
  [evt: string]: CustomEvent<any>;
@@ -19,6 +18,5 @@ export type AppDisplayComponentProps = typeof __propDef.props;
19
18
  export type AppDisplayComponentEvents = typeof __propDef.events;
20
19
  export type AppDisplayComponentSlots = typeof __propDef.slots;
21
20
  export default class AppDisplayComponent extends SvelteComponentTyped<AppDisplayComponentProps, AppDisplayComponentEvents, AppDisplayComponentSlots> {
22
- get staticOutputs(): string[];
23
21
  }
24
22
  export {};
@@ -1,4 +1,5 @@
1
1
  <script>import { getContext } from 'svelte';
2
+ import { initOutput } from '../../editor/appUtils';
2
3
  import { concatCustomCss } from '../../utils';
3
4
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
4
5
  export let id;
@@ -6,8 +7,11 @@ export let componentInput;
6
7
  export let initializing = undefined;
7
8
  export let customCss = undefined;
8
9
  export let render;
9
- export const staticOutputs = ['result', 'loading'];
10
- const { app } = getContext('AppViewerContext');
10
+ const { app, worldStore } = getContext('AppViewerContext');
11
+ initOutput($worldStore, id, {
12
+ result: undefined,
13
+ loading: false
14
+ });
11
15
  let result = undefined;
12
16
  let h = undefined;
13
17
  let w = undefined;
@@ -22,15 +26,7 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
22
26
  bind:clientHeight={h}
23
27
  bind:clientWidth={w}
24
28
  >
25
- <RunnableWrapper
26
- {render}
27
- autoRefresh
28
- flexWrap
29
- {componentInput}
30
- {id}
31
- bind:initializing
32
- bind:result
33
- >
29
+ <RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
34
30
  {#key result}
35
31
  <iframe
36
32
  frameborder="0"
@@ -8,7 +8,6 @@ declare const __propDef: {
8
8
  initializing?: boolean | undefined;
9
9
  customCss?: ComponentCustomCSS<'container'> | undefined;
10
10
  render: boolean;
11
- staticOutputs?: string[] | undefined;
12
11
  };
13
12
  events: {
14
13
  [evt: string]: CustomEvent<any>;
@@ -19,6 +18,5 @@ export type AppHtmlProps = typeof __propDef.props;
19
18
  export type AppHtmlEvents = typeof __propDef.events;
20
19
  export type AppHtmlSlots = typeof __propDef.slots;
21
20
  export default class AppHtml extends SvelteComponentTyped<AppHtmlProps, AppHtmlEvents, AppHtmlSlots> {
22
- get staticOutputs(): string[];
23
21
  }
24
22
  export {};
@@ -6,7 +6,6 @@ export let id;
6
6
  export let horizontalAlignment = 'left';
7
7
  export let verticalAlignment = undefined;
8
8
  export let configuration;
9
- export const staticOutputs = [];
10
9
  export let customCss = undefined;
11
10
  export let render;
12
11
  const { app } = getContext('AppViewerContext');
@@ -7,7 +7,6 @@ declare const __propDef: {
7
7
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
8
8
  verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
9
9
  configuration: Record<string, AppInput>;
10
- staticOutputs?: string[] | undefined;
11
10
  customCss?: ComponentCustomCSS<'container' | 'icon'> | undefined;
12
11
  render: boolean;
13
12
  };
@@ -20,6 +19,5 @@ export type AppIconProps = typeof __propDef.props;
20
19
  export type AppIconEvents = typeof __propDef.events;
21
20
  export type AppIconSlots = typeof __propDef.slots;
22
21
  export default class AppIcon extends SvelteComponentTyped<AppIconProps, AppIconEvents, AppIconSlots> {
23
- get staticOutputs(): string[];
24
22
  }
25
23
  export {};
@@ -4,7 +4,6 @@ import { concatCustomCss } from '../../utils';
4
4
  import InputValue from '../helpers/InputValue.svelte';
5
5
  export let id;
6
6
  export let configuration;
7
- export const staticOutputs = ['loading'];
8
7
  export let customCss = undefined;
9
8
  export let render;
10
9
  const { app } = getContext('AppViewerContext');
@@ -5,7 +5,6 @@ declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  configuration: Record<string, AppInput>;
8
- staticOutputs?: string[] | undefined;
9
8
  customCss?: ComponentCustomCSS<'image'> | undefined;
10
9
  render: boolean;
11
10
  };
@@ -20,6 +19,5 @@ export type AppImageProps = typeof __propDef.props;
20
19
  export type AppImageEvents = typeof __propDef.events;
21
20
  export type AppImageSlots = typeof __propDef.slots;
22
21
  export default class AppImage extends SvelteComponentTyped<AppImageProps, AppImageEvents, AppImageSlots> {
23
- get staticOutputs(): string[];
24
22
  }
25
23
  export {};
@@ -8,17 +8,21 @@ import { OSM, Vector as VectorSource } from 'ol/source';
8
8
  import { Vector as VectorLayer, Tile as TileLayer } from 'ol/layer';
9
9
  import { Point } from 'ol/geom';
10
10
  import { defaults as defaultControls } from 'ol/control';
11
- import { findGridItem } from '../../editor/appUtils';
11
+ import { findGridItem, initOutput } from '../../editor/appUtils';
12
12
  const LAYER_NAME = {
13
13
  MARKER: 'Marker'
14
14
  };
15
15
  export let id;
16
16
  export let configuration;
17
- export const staticOutputs = ['mapRegion'];
18
17
  export let customCss = undefined;
19
18
  export let render;
20
19
  const { app, worldStore, selectedComponent, connectingInput, focusedGrid, mode } = getContext('AppViewerContext');
21
- $: outputs = $worldStore?.outputsById[id];
20
+ let outputs = initOutput($worldStore, id, {
21
+ mapRegion: {
22
+ topLeft: { lat: 0, lon: 0 },
23
+ bottomRight: { lat: 0, lon: 0 }
24
+ }
25
+ });
22
26
  let map;
23
27
  let mapElement;
24
28
  let longitude = undefined;
@@ -134,6 +138,7 @@ function handleSyncRegion() {
134
138
  const z = map.getView().getZoom();
135
139
  updateRegionOutput();
136
140
  if (z) {
141
+ //@ts-ignore
137
142
  gridItem.data.configuration.zoom.value = z;
138
143
  }
139
144
  const center = map.getView().getCenter();
@@ -141,7 +146,9 @@ function handleSyncRegion() {
141
146
  return;
142
147
  }
143
148
  if (gridItem) {
149
+ //@ts-ignore
144
150
  gridItem.data.configuration.longitude.value = center[0];
151
+ //@ts-ignore
145
152
  gridItem.data.configuration.latitude.value = center[1];
146
153
  }
147
154
  }
@@ -5,7 +5,6 @@ declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  configuration: Record<string, AppInput>;
8
- staticOutputs?: string[] | undefined;
9
8
  customCss?: ComponentCustomCSS<'map'> | undefined;
10
9
  render: boolean;
11
10
  };
@@ -18,6 +17,5 @@ export type AppMapProps = typeof __propDef.props;
18
17
  export type AppMapEvents = typeof __propDef.events;
19
18
  export type AppMapSlots = typeof __propDef.slots;
20
19
  export default class AppMap extends SvelteComponentTyped<AppMapProps, AppMapEvents, AppMapSlots> {
21
- get staticOutputs(): string[];
22
20
  }
23
21
  export {};
@@ -8,13 +8,16 @@ import { throttle } from '../../../../utils';
8
8
  import { Button } from '../../../common';
9
9
  import { Download, Loader2, MoveHorizontal, ZoomIn, ZoomOut } from 'lucide-svelte';
10
10
  import { fade } from 'svelte/transition';
11
- import { findGridItem } from '../../editor/appUtils';
11
+ import { findGridItem, initOutput } from '../../editor/appUtils';
12
12
  export let id;
13
13
  export let configuration;
14
- export const staticOutputs = ['loading'];
15
14
  export let customCss = undefined;
16
15
  export let render;
17
- const { app, mode, selectedComponent } = getContext('AppViewerContext');
16
+ const { app, mode, worldStore, selectedComponent } = getContext('AppViewerContext');
17
+ initOutput($worldStore, id, {
18
+ result: undefined,
19
+ loading: false
20
+ });
18
21
  let source = undefined;
19
22
  let wrapper = undefined;
20
23
  let error = undefined;
@@ -136,7 +139,9 @@ function onScroll() {
136
139
  }
137
140
  function syncZoomValue() {
138
141
  const gridItem = findGridItem($app, id);
142
+ //@ts-ignore
139
143
  if (gridItem && gridItem.data.configuration.zoom.value !== zoom) {
144
+ //@ts-ignore
140
145
  gridItem.data.configuration.zoom.value = zoom;
141
146
  }
142
147
  $app = $app;
@@ -6,7 +6,6 @@ declare const __propDef: {
6
6
  props: {
7
7
  id: string;
8
8
  configuration: Record<string, AppInput>;
9
- staticOutputs?: string[] | undefined;
10
9
  customCss?: ComponentCustomCSS<'container'> | undefined;
11
10
  render: boolean;
12
11
  };
@@ -19,6 +18,5 @@ export type AppPdfProps = typeof __propDef.props;
19
18
  export type AppPdfEvents = typeof __propDef.events;
20
19
  export type AppPdfSlots = typeof __propDef.slots;
21
20
  export default class AppPdf extends SvelteComponentTyped<AppPdfProps, AppPdfEvents, AppPdfSlots> {
22
- get staticOutputs(): string[];
23
21
  }
24
22
  export {};
@@ -4,14 +4,18 @@ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
4
4
  import InputValue from '../helpers/InputValue.svelte';
5
5
  import { concatCustomCss } from '../../utils';
6
6
  import { getContext } from 'svelte';
7
+ import { initOutput } from '../../editor/appUtils';
7
8
  export let id;
8
9
  export let componentInput;
9
10
  export let configuration;
10
11
  export let initializing = undefined;
11
12
  export let customCss = undefined;
12
13
  export let render;
13
- export const staticOutputs = ['loading', 'result'];
14
- const { app } = getContext('AppViewerContext');
14
+ const { app, worldStore } = getContext('AppViewerContext');
15
+ initOutput($worldStore, id, {
16
+ result: undefined,
17
+ loading: false
18
+ });
15
19
  ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, ArcElement);
16
20
  let result = undefined;
17
21
  let theme = 'theme1';
@@ -43,7 +47,7 @@ $: css = concatCustomCss($app.css?.piechartcomponent, customCss);
43
47
  <InputValue {id} input={configuration.theme} bind:value={theme} />
44
48
  <InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
45
49
 
46
- <RunnableWrapper {render} flexWrap autoRefresh {componentInput} {id} bind:initializing bind:result>
50
+ <RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
47
51
  <div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
48
52
  {#if result}
49
53
  {#if doughnut}
@@ -9,7 +9,6 @@ declare const __propDef: {
9
9
  initializing?: boolean | undefined;
10
10
  customCss?: ComponentCustomCSS<'container'> | undefined;
11
11
  render: boolean;
12
- staticOutputs?: string[] | undefined;
13
12
  };
14
13
  events: {
15
14
  [evt: string]: CustomEvent<any>;
@@ -20,6 +19,5 @@ export type AppPieChartProps = typeof __propDef.props;
20
19
  export type AppPieChartEvents = typeof __propDef.events;
21
20
  export type AppPieChartSlots = typeof __propDef.slots;
22
21
  export default class AppPieChart extends SvelteComponentTyped<AppPieChartProps, AppPieChartEvents, AppPieChartSlots> {
23
- get staticOutputs(): string[];
24
22
  }
25
23
  export {};
@@ -5,6 +5,7 @@ import Scatter from 'svelte-chartjs/Scatter.svelte';
5
5
  import InputValue from '../helpers/InputValue.svelte';
6
6
  import { concatCustomCss } from '../../utils';
7
7
  import { getContext } from 'svelte';
8
+ import { initOutput } from '../../editor/appUtils';
8
9
  export let id;
9
10
  export let componentInput;
10
11
  export let configuration;
@@ -13,8 +14,11 @@ export let customCss = undefined;
13
14
  export let render;
14
15
  let zoomable = false;
15
16
  let pannable = false;
16
- export const staticOutputs = ['loading', 'result'];
17
- const { app } = getContext('AppViewerContext');
17
+ const { app, worldStore } = getContext('AppViewerContext');
18
+ initOutput($worldStore, id, {
19
+ result: undefined,
20
+ loading: false
21
+ });
18
22
  ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement, zoomPlugin);
19
23
  let result = undefined;
20
24
  $: options = {
@@ -46,7 +50,7 @@ $: css = concatCustomCss($app.css?.scatterchartcomponent, customCss);
46
50
  <InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
47
51
  <InputValue {id} input={configuration.pannable} bind:value={pannable} />
48
52
 
49
- <RunnableWrapper {render} flexWrap autoRefresh {componentInput} {id} bind:initializing bind:result>
53
+ <RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
50
54
  <div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
51
55
  {#if result}
52
56
  <Scatter {data} {options} />
@@ -9,7 +9,6 @@ declare const __propDef: {
9
9
  initializing?: boolean | undefined;
10
10
  customCss?: ComponentCustomCSS<'container'> | undefined;
11
11
  render: boolean;
12
- staticOutputs?: string[] | undefined;
13
12
  };
14
13
  events: {
15
14
  [evt: string]: CustomEvent<any>;
@@ -20,6 +19,5 @@ export type AppScatterChartProps = typeof __propDef.props;
20
19
  export type AppScatterChartEvents = typeof __propDef.events;
21
20
  export type AppScatterChartSlots = typeof __propDef.slots;
22
21
  export default class AppScatterChart extends SvelteComponentTyped<AppScatterChartProps, AppScatterChartEvents, AppScatterChartSlots> {
23
- get staticOutputs(): string[];
24
22
  }
25
23
  export {};
@@ -7,7 +7,8 @@ import InputValue from '../helpers/InputValue.svelte';
7
7
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
8
8
  import { twMerge } from 'tailwind-merge';
9
9
  import { getContext } from 'svelte';
10
- import ResizeWrapper from '../helpers/ResizeWrapper.svelte';
10
+ import { initOutput } from '../../editor/appUtils';
11
+ import Tooltip from '../../../Tooltip.svelte';
11
12
  export let id;
12
13
  export let componentInput;
13
14
  export let horizontalAlignment = 'left';
@@ -16,12 +17,16 @@ export let configuration;
16
17
  export let initializing = undefined;
17
18
  export let customCss = undefined;
18
19
  export let render;
19
- export const staticOutputs = ['result', 'loading'];
20
- const { app } = getContext('AppViewerContext');
20
+ const { app, worldStore, mode } = getContext('AppViewerContext');
21
+ const { ontextfocus } = getContext('AppEditorContext');
22
+ initOutput($worldStore, id, {
23
+ result: undefined,
24
+ loading: false
25
+ });
21
26
  let result = undefined;
22
27
  let style = undefined;
23
28
  let copyButton;
24
- let fitContent = false;
29
+ let tooltip = '';
25
30
  function getComponent() {
26
31
  switch (style) {
27
32
  case 'Title':
@@ -56,17 +61,27 @@ $: style && (classes = getClasses());
56
61
 
57
62
  <InputValue {id} input={configuration.style} bind:value={style} />
58
63
  <InputValue {id} input={configuration.copyButton} bind:value={copyButton} />
59
- <InputValue {id} input={configuration.fitContent} bind:value={fitContent} />
64
+ <InputValue {id} input={configuration.tooltip} bind:value={tooltip} />
60
65
 
61
- <RunnableWrapper {render} flexWrap {componentInput} {id} bind:initializing bind:result>
62
- <ResizeWrapper {id} shouldWrap={fitContent}>
66
+ <RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
67
+ <div class="h-full w-full overflow-hidden">
63
68
  <AlignWrapper {horizontalAlignment} {verticalAlignment}>
64
69
  {#if !result || result === ''}
65
70
  <div class="text-gray-400 bg-gray-100 flex justify-center items-center h-full w-full">
66
71
  No text
67
72
  </div>
68
73
  {:else}
69
- <div class="flex flex-wrap gap-2 pb-0.5 overflow-x-auto">
74
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
75
+ <div
76
+ class="flex flex-wrap gap-2 pb-0.5 {$mode === 'dnd' && componentInput?.type == 'template'
77
+ ? 'cursor-text'
78
+ : ''}"
79
+ on:click={() => {
80
+ if ($mode === 'dnd' && componentInput?.type == 'template') {
81
+ $ontextfocus?.()
82
+ }
83
+ }}
84
+ >
70
85
  <svelte:element
71
86
  this={component}
72
87
  class={twMerge(
@@ -78,17 +93,26 @@ $: style && (classes = getClasses());
78
93
  style={[$app.css?.['textcomponent']?.['text']?.style, customCss?.text?.style].join(';')}
79
94
  >
80
95
  {String(result)}
96
+ {#if tooltip != ''}
97
+ <Tooltip>{tooltip}</Tooltip>
98
+ {/if}
99
+ {#if copyButton && result}
100
+ <Popover notClickable>
101
+ <Button
102
+ variant="border"
103
+ size="xs"
104
+ color="dark"
105
+ btnClasses="!p-1"
106
+ on:click={() => copyToClipboard(result)}
107
+ >
108
+ <Clipboard size={14} strokeWidth={2} />
109
+ </Button>
110
+ <svelte:fragment slot="text">Copy to clipboard</svelte:fragment>
111
+ </Popover>
112
+ {/if}
81
113
  </svelte:element>
82
- {#if copyButton && result}
83
- <Popover notClickable>
84
- <Button size="xs" btnClasses="!px-2" on:click={() => copyToClipboard(result)}>
85
- <Clipboard size={14} strokeWidth={2} />
86
- </Button>
87
- <svelte:fragment slot="text">Copy to clipboard</svelte:fragment>
88
- </Popover>
89
- {/if}
90
114
  </div>
91
115
  {/if}
92
116
  </AlignWrapper>
93
- </ResizeWrapper>
117
+ </div>
94
118
  </RunnableWrapper>