windmill-components 1.77.0 → 1.79.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 (198) hide show
  1. package/components/ArgInput.svelte +4 -14
  2. package/components/LightweightArgInput.svelte +315 -0
  3. package/components/LightweightArgInput.svelte.d.ts +47 -0
  4. package/components/LightweightSchemaForm.svelte +31 -0
  5. package/components/LightweightSchemaForm.svelte.d.ts +18 -0
  6. package/components/ModulePreview.svelte +1 -0
  7. package/components/Multiselect.svelte.d.ts +2 -2
  8. package/components/Path.svelte +4 -0
  9. package/components/Range.svelte.d.ts +2 -2
  10. package/components/SimpleEditor.svelte +1 -1
  11. package/components/SimpleEditor.svelte.d.ts +2 -0
  12. package/components/TemplateEditor.svelte +3 -0
  13. package/components/TemplateEditor.svelte.d.ts +0 -204
  14. package/components/VariableEditor.svelte +2 -1
  15. package/components/apps/components/buttons/AppButton.svelte +45 -56
  16. package/components/apps/components/buttons/AppButton.svelte.d.ts +6 -4
  17. package/components/apps/components/buttons/AppForm.svelte.d.ts +2 -2
  18. package/components/apps/components/buttons/AppFormButton.svelte +1 -1
  19. package/components/apps/components/buttons/AppFormButton.svelte.d.ts +2 -2
  20. package/components/apps/components/display/AppBarChart.svelte +7 -3
  21. package/components/apps/components/display/AppBarChart.svelte.d.ts +2 -4
  22. package/components/apps/components/display/AppDisplayComponent.svelte +7 -3
  23. package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +0 -2
  24. package/components/apps/components/display/AppHtml.svelte +7 -11
  25. package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
  26. package/components/apps/components/display/AppIcon.svelte +0 -1
  27. package/components/apps/components/display/AppIcon.svelte.d.ts +2 -5
  28. package/components/apps/components/display/AppImage.svelte +0 -1
  29. package/components/apps/components/display/AppImage.svelte.d.ts +2 -5
  30. package/components/apps/components/display/AppMap.svelte +13 -6
  31. package/components/apps/components/display/AppMap.svelte.d.ts +2 -5
  32. package/components/apps/components/display/AppPdf.svelte +8 -3
  33. package/components/apps/components/display/AppPdf.svelte.d.ts +2 -5
  34. package/components/apps/components/display/AppPieChart.svelte +7 -3
  35. package/components/apps/components/display/AppPieChart.svelte.d.ts +2 -4
  36. package/components/apps/components/display/AppScatterChart.svelte +7 -3
  37. package/components/apps/components/display/AppScatterChart.svelte.d.ts +2 -4
  38. package/components/apps/components/display/AppText.svelte +41 -17
  39. package/components/apps/components/display/AppText.svelte.d.ts +2 -4
  40. package/components/apps/components/display/AppTimeseries.svelte +7 -3
  41. package/components/apps/components/display/AppTimeseries.svelte.d.ts +2 -4
  42. package/components/apps/components/display/PlotlyHtml.svelte +9 -4
  43. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
  44. package/components/apps/components/display/VegaLiteHtml.svelte +8 -3
  45. package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +2 -3
  46. package/components/apps/components/display/table/AppAggridTable.svelte +9 -4
  47. package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +2 -3
  48. package/components/apps/components/display/table/AppTable.svelte +91 -36
  49. package/components/apps/components/display/table/AppTable.svelte.d.ts +2 -4
  50. package/components/apps/components/helpers/HiddenComponent.svelte +8 -2
  51. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +0 -2
  52. package/components/apps/components/helpers/InputValue.svelte +5 -1
  53. package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -1
  54. package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -2
  55. package/components/apps/components/helpers/ResizeWrapper.svelte +3 -4
  56. package/components/apps/components/helpers/RunnableComponent.svelte +17 -24
  57. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +0 -1
  58. package/components/apps/components/helpers/RunnableWrapper.svelte +0 -2
  59. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +0 -1
  60. package/components/apps/components/helpers/eval.js +36 -1
  61. package/components/apps/components/inputs/AppCheckbox.svelte +4 -2
  62. package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +2 -5
  63. package/components/apps/components/inputs/AppDateInput.svelte +4 -2
  64. package/components/apps/components/inputs/AppDateInput.svelte.d.ts +2 -5
  65. package/components/apps/components/inputs/AppFileInput.svelte +4 -2
  66. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +2 -5
  67. package/components/apps/components/inputs/AppMultiSelect.svelte +4 -2
  68. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -5
  69. package/components/apps/components/inputs/AppNumberInput.svelte +4 -2
  70. package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +2 -5
  71. package/components/apps/components/inputs/AppRangeInput.svelte +5 -2
  72. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -5
  73. package/components/apps/components/inputs/AppSelect.svelte +5 -2
  74. package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -5
  75. package/components/apps/components/inputs/AppSliderInputs.svelte +4 -2
  76. package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -5
  77. package/components/apps/components/inputs/AppTextInput.svelte +5 -3
  78. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +2 -5
  79. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +5 -2
  80. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +2 -5
  81. package/components/apps/components/layout/AppContainer.svelte +0 -2
  82. package/components/apps/components/layout/AppContainer.svelte.d.ts +0 -4
  83. package/components/apps/components/layout/AppDivider.svelte.d.ts +2 -3
  84. package/components/apps/components/layout/AppDrawer.svelte.d.ts +2 -3
  85. package/components/apps/components/layout/AppSplitpanes.svelte +1 -5
  86. package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +0 -2
  87. package/components/apps/components/layout/AppTabs.svelte +8 -9
  88. package/components/apps/components/layout/AppTabs.svelte.d.ts +2 -5
  89. package/components/apps/editor/AppComponentInput.svelte +2 -1
  90. package/components/apps/editor/AppEditor.svelte +12 -14
  91. package/components/apps/editor/AppEditorHeader.svelte +2 -2
  92. package/components/apps/editor/AppInputs.svelte +13 -14
  93. package/components/apps/editor/AppPreview.svelte +68 -15
  94. package/components/apps/editor/ComponentHeader.svelte +49 -50
  95. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  96. package/components/apps/editor/GridEditor.svelte +6 -27
  97. package/components/apps/editor/GridPanel.svelte +3 -1
  98. package/components/apps/editor/GridViewer.svelte +91 -0
  99. package/components/apps/editor/GridViewer.svelte.d.ts +32 -0
  100. package/components/apps/editor/SettingsPanel.svelte +11 -0
  101. package/components/apps/editor/SubGridEditor.svelte +74 -51
  102. package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -1
  103. package/components/apps/editor/appUtils.d.ts +4 -2
  104. package/components/apps/editor/appUtils.js +26 -19
  105. package/components/apps/editor/component/Component.svelte +16 -53
  106. package/components/apps/editor/component/ComponentNavigation.svelte +28 -13
  107. package/components/apps/editor/component/components.d.ts +3 -2
  108. package/components/apps/editor/component/components.js +63 -79
  109. package/components/apps/editor/componentsPanel/ComponentList.svelte +5 -4
  110. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +1 -1
  111. package/components/apps/editor/contextPanel/ComponentOutput.svelte +23 -33
  112. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +14 -13
  113. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte.d.ts +0 -1
  114. package/components/apps/editor/contextPanel/ContextPanel.svelte +19 -27
  115. package/components/apps/editor/contextPanel/SubGridOutput.svelte +5 -10
  116. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +9 -6
  117. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +0 -1
  118. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +1 -3
  119. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +1 -3
  120. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +73 -42
  121. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +0 -2
  122. package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +2 -4
  123. package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +0 -1
  124. package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +1 -2
  125. package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +0 -1
  126. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +3 -3
  127. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +20 -3
  128. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +5 -7
  129. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
  130. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +31 -41
  131. package/components/apps/editor/settingsPanel/GridPane.svelte +1 -3
  132. package/components/apps/editor/settingsPanel/GridTab.svelte +1 -3
  133. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +109 -13
  134. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +6 -2
  135. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +13 -116
  136. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -2
  137. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +4 -0
  138. package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +2 -2
  139. package/components/apps/editor/settingsPanel/TableActions.svelte +2 -5
  140. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -2
  141. package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +0 -1
  142. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +12 -6
  143. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +81 -0
  144. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +21 -0
  145. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +18 -0
  146. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +17 -0
  147. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +98 -0
  148. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +24 -0
  149. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.d.ts +2 -0
  150. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.js +11 -0
  151. package/components/apps/gridUtils.d.ts +1 -3
  152. package/components/apps/gridUtils.js +1 -15
  153. package/components/apps/inputType.d.ts +11 -2
  154. package/components/apps/rx.d.ts +1 -1
  155. package/components/apps/rx.js +9 -10
  156. package/components/apps/svelte-grid/Grid.svelte +9 -13
  157. package/components/apps/svelte-grid/Grid.svelte.d.ts +0 -2
  158. package/components/apps/svelte-grid/MoveResize.svelte +1 -1
  159. package/components/apps/svelte-grid/types.d.ts +12 -16
  160. package/components/apps/svelte-grid/utils/helper.d.ts +1 -5
  161. package/components/apps/types.d.ts +29 -9
  162. package/components/apps/utils.js +2 -2
  163. package/components/common/button/Button.svelte.d.ts +1 -1
  164. package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
  165. package/components/common/menu/Menu.svelte.d.ts +1 -1
  166. package/components/flows/flowStore.js +1 -1
  167. package/components/graph/FlowGraph.svelte +0 -2
  168. package/components/graph/FlowGraph.svelte.d.ts +0 -1
  169. package/components/graph/svelvet/container/views/GraphView.svelte +3 -28
  170. package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +0 -3
  171. package/components/graph/svelvet/container/views/Svelvet.svelte +1 -17
  172. package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +0 -8
  173. package/components/graph/svelvet/customCss/controllers/getCss.js +0 -11
  174. package/components/graph/svelvet/edges/controllers/util.js +1 -2
  175. package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +2 -2
  176. package/components/graph/svelvet/nodes/controllers/util.js +1 -1
  177. package/components/graph/svelvet/nodes/models/Node.d.ts +0 -4
  178. package/components/graph/svelvet/nodes/models/Node.js +3 -41
  179. package/components/graph/svelvet/store/controllers/storeApi.js +2 -7
  180. package/components/graph/svelvet/store/controllers/util.d.ts +0 -7
  181. package/components/graph/svelvet/store/controllers/util.js +4 -36
  182. package/components/graph/svelvet/store/types/types.d.ts +0 -5
  183. package/components/home/ItemsList.svelte +1 -1
  184. package/components/propertyPicker/ObjectViewer.svelte +1 -1
  185. package/components/propertyPicker/PropPicker.svelte +4 -1
  186. package/package.json +10 -6
  187. package/utils.d.ts +2 -0
  188. package/utils.js +6 -0
  189. package/components/apps/editor/AppComponentInputs.svelte +0 -13
  190. package/components/apps/editor/AppComponentInputs.svelte.d.ts +0 -20
  191. package/components/graph/svelvet/nodes/views/EditNode.svelte +0 -147
  192. package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +0 -33
  193. package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +0 -11
  194. package/components/graph/svelvet/resizableNodes/controllers/util.js +0 -24
  195. package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +0 -33
  196. package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +0 -71
  197. package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +0 -81
  198. package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte.d.ts +0 -20
@@ -1,205 +1 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
5
- conf?: {
6
- wordPattern: RegExp;
7
- comments: {
8
- lineComment: string;
9
- blockComment: [string, string];
10
- };
11
- brackets: [string, string][];
12
- onEnterRules: never[];
13
- autoClosingPairs: ({
14
- open: string;
15
- close: string;
16
- notIn?: undefined;
17
- } | {
18
- open: string;
19
- close: string;
20
- notIn: string[];
21
- })[];
22
- folding: {
23
- markers: {
24
- start: RegExp;
25
- end: RegExp;
26
- };
27
- };
28
- } | undefined;
29
- language?: {
30
- defaultToken: string;
31
- tokenPostfix: string;
32
- keywords: string[];
33
- operators: string[];
34
- symbols: RegExp;
35
- escapes: RegExp;
36
- digits: RegExp;
37
- octaldigits: RegExp;
38
- binarydigits: RegExp;
39
- hexdigits: RegExp;
40
- regexpctl: RegExp;
41
- regexpesc: RegExp;
42
- tokenizer: {
43
- root: ((string | RegExp)[] | (RegExp | {
44
- token: string;
45
- next: string;
46
- })[])[];
47
- common: ((string | RegExp)[] | (RegExp | {
48
- cases: {
49
- '@keywords': string;
50
- '@default': string;
51
- };
52
- })[] | {
53
- include: string;
54
- } | (RegExp | {
55
- token: string;
56
- bracket: string;
57
- next: string;
58
- })[] | (RegExp | {
59
- cases: {
60
- '@operators': string;
61
- '@default': string;
62
- };
63
- })[])[];
64
- whitespace: (string | RegExp)[][];
65
- comment: (string | RegExp)[][];
66
- jsdoc: (string | RegExp)[][];
67
- regexp: ((string | RegExp)[] | (RegExp | (string | {
68
- token: string;
69
- next: string;
70
- })[])[] | (RegExp | (string | {
71
- token: string;
72
- bracket: string;
73
- next: string;
74
- })[])[])[];
75
- regexrange: ((string | RegExp)[] | (RegExp | {
76
- token: string;
77
- next: string;
78
- bracket: string;
79
- })[])[];
80
- string_double: (string | RegExp)[][];
81
- string_single: (string | RegExp)[][];
82
- string_backtick: ((string | RegExp)[] | (RegExp | {
83
- token: string;
84
- next: string;
85
- })[])[];
86
- bracketCounting: ((string | RegExp)[] | {
87
- include: string;
88
- })[];
89
- };
90
- } | undefined;
91
- code?: string | undefined;
92
- hash?: string | undefined;
93
- automaticLayout?: boolean | undefined;
94
- extraLib?: string | undefined;
95
- autoHeight?: boolean | undefined;
96
- fixedOverflowWidgets?: boolean | undefined;
97
- fontSize?: number | undefined;
98
- insertAtCursor?: ((code: string) => void) | undefined;
99
- setCode?: ((ncode: string) => void) | undefined;
100
- getCode?: (() => string) | undefined;
101
- };
102
- events: {
103
- change: CustomEvent<any>;
104
- focus: CustomEvent<any>;
105
- blur: CustomEvent<any>;
106
- } & {
107
- [evt: string]: CustomEvent<any>;
108
- };
109
- slots: {};
110
- };
111
- export type TemplateEditorProps = typeof __propDef.props;
112
- export type TemplateEditorEvents = typeof __propDef.events;
113
- export type TemplateEditorSlots = typeof __propDef.slots;
114
- export default class TemplateEditor extends SvelteComponentTyped<TemplateEditorProps, TemplateEditorEvents, TemplateEditorSlots> {
115
- get conf(): {
116
- wordPattern: RegExp;
117
- comments: {
118
- lineComment: string;
119
- blockComment: [string, string];
120
- };
121
- brackets: [string, string][];
122
- onEnterRules: never[];
123
- autoClosingPairs: ({
124
- open: string;
125
- close: string;
126
- notIn?: undefined;
127
- } | {
128
- open: string;
129
- close: string;
130
- notIn: string[];
131
- })[];
132
- folding: {
133
- markers: {
134
- start: RegExp;
135
- end: RegExp;
136
- };
137
- };
138
- };
139
- get language(): {
140
- defaultToken: string;
141
- tokenPostfix: string;
142
- keywords: string[];
143
- operators: string[];
144
- symbols: RegExp;
145
- escapes: RegExp;
146
- digits: RegExp;
147
- octaldigits: RegExp;
148
- binarydigits: RegExp;
149
- hexdigits: RegExp;
150
- regexpctl: RegExp;
151
- regexpesc: RegExp;
152
- tokenizer: {
153
- root: ((string | RegExp)[] | (RegExp | {
154
- token: string;
155
- next: string;
156
- })[])[];
157
- common: ((string | RegExp)[] | (RegExp | {
158
- cases: {
159
- '@keywords': string;
160
- '@default': string;
161
- };
162
- })[] | {
163
- include: string;
164
- } | (RegExp | {
165
- token: string;
166
- bracket: string;
167
- next: string;
168
- })[] | (RegExp | {
169
- cases: {
170
- '@operators': string;
171
- '@default': string;
172
- };
173
- })[])[];
174
- whitespace: (string | RegExp)[][];
175
- comment: (string | RegExp)[][];
176
- jsdoc: (string | RegExp)[][];
177
- regexp: ((string | RegExp)[] | (RegExp | (string | {
178
- token: string;
179
- next: string;
180
- })[])[] | (RegExp | (string | {
181
- token: string;
182
- bracket: string;
183
- next: string;
184
- })[])[])[];
185
- regexrange: ((string | RegExp)[] | (RegExp | {
186
- token: string;
187
- next: string;
188
- bracket: string;
189
- })[])[];
190
- string_double: (string | RegExp)[][];
191
- string_single: (string | RegExp)[][];
192
- string_backtick: ((string | RegExp)[] | (RegExp | {
193
- token: string;
194
- next: string;
195
- })[])[];
196
- bracketCounting: ((string | RegExp)[] | {
197
- include: string;
198
- })[];
199
- };
200
- };
201
- get insertAtCursor(): (code: string) => void;
202
- get setCode(): (ncode: string) => void;
203
- get getCode(): () => string;
204
- }
205
1
  export {};
@@ -46,7 +46,8 @@ export async function editVariable(edit_path) {
46
46
  decryptSecret: false
47
47
  });
48
48
  can_write =
49
- getV.workspace_id == $workspaceStore && canWrite(path, getV.extra_perms ?? {}, $userStore);
49
+ getV.workspace_id == $workspaceStore &&
50
+ canWrite(edit_path, getV.extra_perms ?? {}, $userStore);
50
51
  variable = {
51
52
  value: getV.value ?? '',
52
53
  is_secret: getV.is_secret,
@@ -6,6 +6,8 @@ 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';
10
+ import { configurationKeys } from '../../editor/component';
9
11
  export let id;
10
12
  export let componentInput;
11
13
  export let configuration;
@@ -18,37 +20,44 @@ export let preclickAction = undefined;
18
20
  export let customCss = undefined;
19
21
  export let render;
20
22
  export let initializing = true;
21
- export const staticOutputs = ['loading', 'result'];
22
- const { worldStore, app } = getContext('AppViewerContext');
23
- let labelValue;
24
- let color;
25
- let size;
23
+ export let controls = undefined;
24
+ const { worldStore, app, componentControl } = getContext('AppViewerContext');
25
+ if (controls) {
26
+ $componentControl[id] = controls;
27
+ }
26
28
  let runnableComponent;
27
- let disabled = undefined;
28
- let fillContainer = undefined;
29
- let gotoUrl = undefined;
30
- let gotoNewTab = undefined;
29
+ // let labelValue: string
30
+ // let color: ButtonType.Color
31
+ // let size: ButtonType.Size
32
+ // let disabled: boolean | undefined = undefined
33
+ // let fillContainer: boolean | undefined = undefined
34
+ // let gotoUrl: string | undefined = undefined
35
+ // let gotoNewTab: boolean | undefined = undefined
31
36
  let isLoading = false;
32
37
  let ownClick = false;
33
- let triggerOnAppLoad = false;
34
- let beforeIcon = undefined;
35
- let afterIcon = undefined;
38
+ // let beforeIcon: undefined | string = undefined
39
+ // let afterIcon: undefined | string = undefined
40
+ let resolvedConfig = {};
41
+ $: initializing = resolvedConfig?.label == undefined;
36
42
  let beforeIconComponent;
37
43
  let afterIconComponent;
38
- $: beforeIcon && handleBeforeIcon();
39
- $: afterIcon && handleAfterIcon();
44
+ $: resolvedConfig.beforeIcon && handleBeforeIcon();
45
+ $: resolvedConfig.afterIcon && handleAfterIcon();
40
46
  async function handleBeforeIcon() {
41
- if (beforeIcon) {
42
- beforeIconComponent = await loadIcon(beforeIcon);
47
+ if (resolvedConfig.beforeIcon) {
48
+ beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon);
43
49
  }
44
50
  }
45
51
  async function handleAfterIcon() {
46
- if (afterIcon) {
47
- afterIconComponent = await loadIcon(afterIcon);
52
+ if (resolvedConfig.afterIcon) {
53
+ afterIconComponent = await loadIcon(resolvedConfig.afterIcon);
48
54
  }
49
55
  }
50
- $: outputs = $worldStore?.outputsById[id];
51
- $: triggerOnAppLoad && runnableComponent?.runComponent();
56
+ let outputs = initOutput($worldStore, id, {
57
+ result: undefined,
58
+ loading: false
59
+ });
60
+ $: resolvedConfig.triggerOnAppLoad && runnableComponent?.runComponent();
52
61
  $: if (outputs?.loading != undefined) {
53
62
  outputs.loading.set(false, true);
54
63
  }
@@ -74,12 +83,12 @@ async function handleClick(event) {
74
83
  }
75
84
  ownClick = true;
76
85
  if (!runnableComponent) {
77
- if (gotoUrl) {
78
- if (gotoNewTab) {
79
- window.open(gotoUrl, '_blank');
86
+ if (resolvedConfig.gotoUrl) {
87
+ if (resolvedConfig.gotoNewTab) {
88
+ window.open(resolvedConfig.gotoUrl, '_blank');
80
89
  }
81
90
  else {
82
- goto(gotoUrl);
91
+ goto(resolvedConfig.gotoUrl);
83
92
  }
84
93
  }
85
94
  }
@@ -89,39 +98,19 @@ async function handleClick(event) {
89
98
  }
90
99
  </script>
91
100
 
92
- <InputValue
93
- on:done={() => initializing && (initializing = false)}
94
- {id}
95
- input={configuration.label}
96
- bind:value={labelValue}
97
- />
98
- <InputValue {id} input={configuration.goto} bind:value={gotoUrl} />
99
- <InputValue {id} input={configuration.color} bind:value={color} />
100
- <InputValue {id} input={configuration.size} bind:value={size} />
101
- <InputValue {id} input={configuration.beforeIcon} bind:value={beforeIcon} />
102
- <InputValue {id} input={configuration.afterIcon} bind:value={afterIcon} />
103
- <InputValue {id} input={configuration.triggerOnAppLoad} bind:value={triggerOnAppLoad} />
104
-
105
- <InputValue
106
- {id}
107
- input={configuration.disabled}
108
- extraContext={extraQueryParams}
109
- bind:value={disabled}
110
- bind:error={errors.disabled}
111
- />
112
- <InputValue {id} input={configuration.fillContainer} bind:value={fillContainer} />
113
- <InputValue {id} input={configuration.gotoNewTab} bind:value={gotoNewTab} />
101
+ {#each configurationKeys['buttoncomponent'] as key (key)}
102
+ <InputValue {key} {id} input={configuration[key]} bind:value={resolvedConfig[key]} />
103
+ {/each}
114
104
 
115
105
  <RunnableWrapper
116
- flexWrap
117
106
  {recomputeIds}
118
107
  bind:runnableComponent
119
108
  {componentInput}
120
109
  {id}
121
110
  {extraQueryParams}
122
111
  autoRefresh={false}
123
- goto={gotoUrl}
124
- {gotoNewTab}
112
+ goto={resolvedConfig.gotoUrl}
113
+ gotoNewTab={resolvedConfig.gotoNewTab}
125
114
  {render}
126
115
  >
127
116
  <AlignWrapper {noWFull} {horizontalAlignment} {verticalAlignment}>
@@ -132,25 +121,25 @@ async function handleClick(event) {
132
121
  btnClasses={twMerge(
133
122
  $app.css?.['buttoncomponent']?.['button']?.class,
134
123
  customCss?.button.class,
135
- fillContainer ? 'w-full h-full' : ''
124
+ resolvedConfig.fillContainer ? 'w-full h-full' : ''
136
125
  )}
137
126
  style={[$app.css?.['buttoncomponent']?.['button']?.style, customCss?.button.style].join(';')}
138
- {disabled}
127
+ disabled={resolvedConfig.disabled}
139
128
  on:pointerdown={(e) => {
140
129
  e?.stopPropagation()
141
130
  window.dispatchEvent(new Event('pointerup'))
142
131
  }}
143
132
  on:click={handleClick}
144
- {size}
145
- {color}
133
+ size={resolvedConfig.size}
134
+ color={resolvedConfig.color}
146
135
  {loading}
147
136
  >
148
137
  <span class="truncate inline-flex gap-2 items-center">
149
- {#if beforeIcon && beforeIconComponent}
138
+ {#if resolvedConfig.beforeIcon && beforeIconComponent}
150
139
  <svelte:component this={beforeIconComponent} size={14} />
151
140
  {/if}
152
- <div>{labelValue}</div>
153
- {#if afterIcon && afterIconComponent}
141
+ <div>{resolvedConfig.label}</div>
142
+ {#if resolvedConfig.afterIcon && afterIconComponent}
154
143
  <svelte:component this={afterIconComponent} size={14} />
155
144
  {/if}
156
145
  </span>
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
3
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  componentInput: AppInput | undefined;
8
- configuration: Record<string, AppInput>;
8
+ configuration: RichConfigurations;
9
9
  recomputeIds?: string[] | undefined;
10
10
  extraQueryParams?: Record<string, any> | undefined;
11
11
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
@@ -15,7 +15,10 @@ declare const __propDef: {
15
15
  customCss?: ComponentCustomCSS<'button'> | undefined;
16
16
  render: boolean;
17
17
  initializing?: boolean | undefined;
18
- staticOutputs?: string[] | undefined;
18
+ controls?: {
19
+ left: () => boolean;
20
+ right: () => boolean | string;
21
+ } | undefined;
19
22
  };
20
23
  events: {
21
24
  [evt: string]: CustomEvent<any>;
@@ -26,6 +29,5 @@ export type AppButtonProps = typeof __propDef.props;
26
29
  export type AppButtonEvents = typeof __propDef.events;
27
30
  export type AppButtonSlots = typeof __propDef.slots;
28
31
  export default class AppButton extends SvelteComponentTyped<AppButtonProps, AppButtonEvents, AppButtonSlots> {
29
- get staticOutputs(): string[];
30
32
  }
31
33
  export {};
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
3
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  componentInput: AppInput | undefined;
8
- configuration: Record<string, AppInput>;
8
+ configuration: RichConfigurations;
9
9
  recomputeIds?: string[] | undefined;
10
10
  extraQueryParams?: Record<string, any> | undefined;
11
11
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
@@ -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;
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
3
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  componentInput: AppInput | undefined;
8
- configuration: Record<string, AppInput>;
8
+ configuration: RichConfigurations;
9
9
  recomputeIds?: string[] | undefined;
10
10
  extraQueryParams?: Record<string, any> | undefined;
11
11
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
@@ -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}
@@ -1,15 +1,14 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
3
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  id: string;
7
7
  componentInput: AppInput | undefined;
8
- configuration: Record<string, AppInput>;
8
+ configuration: RichConfigurations;
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');
@@ -1,13 +1,11 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
2
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
3
  declare const __propDef: {
5
4
  props: {
6
5
  id: string;
7
6
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
8
7
  verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
9
- configuration: Record<string, AppInput>;
10
- staticOutputs?: string[] | undefined;
8
+ configuration: RichConfigurations;
11
9
  customCss?: ComponentCustomCSS<'container' | 'icon'> | undefined;
12
10
  render: boolean;
13
11
  };
@@ -20,6 +18,5 @@ export type AppIconProps = typeof __propDef.props;
20
18
  export type AppIconEvents = typeof __propDef.events;
21
19
  export type AppIconSlots = typeof __propDef.slots;
22
20
  export default class AppIcon extends SvelteComponentTyped<AppIconProps, AppIconEvents, AppIconSlots> {
23
- get staticOutputs(): string[];
24
21
  }
25
22
  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');
@@ -1,11 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppInput } from '../../inputType';
3
- import type { ComponentCustomCSS } from '../../types';
2
+ import type { ComponentCustomCSS, RichConfigurations } from '../../types';
4
3
  declare const __propDef: {
5
4
  props: {
6
5
  id: string;
7
- configuration: Record<string, AppInput>;
8
- staticOutputs?: string[] | undefined;
6
+ configuration: RichConfigurations;
9
7
  customCss?: ComponentCustomCSS<'image'> | undefined;
10
8
  render: boolean;
11
9
  };
@@ -20,6 +18,5 @@ export type AppImageProps = typeof __propDef.props;
20
18
  export type AppImageEvents = typeof __propDef.events;
21
19
  export type AppImageSlots = typeof __propDef.slots;
22
20
  export default class AppImage extends SvelteComponentTyped<AppImageProps, AppImageEvents, AppImageSlots> {
23
- get staticOutputs(): string[];
24
21
  }
25
22
  export {};