windmill-components 1.56.2 → 1.57.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 (224) hide show
  1. package/assets/app.css +5 -1
  2. package/components/ArgInput.svelte +6 -6
  3. package/components/CenteredModal.svelte +15 -14
  4. package/components/CenteredModal.svelte.d.ts +1 -0
  5. package/components/DisplayResult.svelte +1 -1
  6. package/components/Dropdown.svelte +4 -3
  7. package/components/Dropdown.svelte.d.ts +2 -0
  8. package/components/Editor.svelte +6 -4
  9. package/components/Editor.svelte.d.ts +2 -0
  10. package/components/EditorBar.svelte +15 -1
  11. package/components/FlowBuilder.svelte +18 -10
  12. package/components/FlowPreviewContent.svelte +1 -1
  13. package/components/GroupEditor.svelte +1 -0
  14. package/components/IconedResourceType.svelte +2 -2
  15. package/components/InputTransformForm.svelte +50 -40
  16. package/components/InputTransformForm.svelte.d.ts +1 -0
  17. package/components/ItemPicker.svelte +63 -57
  18. package/components/ItemPicker.svelte.d.ts +1 -2
  19. package/components/LogViewer.svelte +6 -5
  20. package/components/ModulePreview.svelte +20 -22
  21. package/components/MoveDrawer.svelte +40 -16
  22. package/components/MoveDrawer.svelte.d.ts +2 -2
  23. package/components/PageHeader.svelte +1 -1
  24. package/components/Path.svelte +5 -2
  25. package/components/Popover.svelte +14 -20
  26. package/components/Popover.svelte.d.ts +5 -0
  27. package/components/RadioButton.svelte +5 -3
  28. package/components/RadioButton.svelte.d.ts +2 -0
  29. package/components/ResourceEditor.svelte +2 -1
  30. package/components/ResourcePicker.svelte +1 -0
  31. package/components/RunChart.svelte +0 -1
  32. package/components/SchemaEditor.svelte +3 -0
  33. package/components/SchemaForm.svelte +86 -77
  34. package/components/SchemaForm.svelte.d.ts +4 -0
  35. package/components/ScriptBuilder.svelte +2 -1
  36. package/components/ScriptEditor.svelte +88 -77
  37. package/components/ShareModal.svelte.d.ts +2 -2
  38. package/components/SimpleEditor.svelte +17 -0
  39. package/components/Star.svelte +15 -9
  40. package/components/StringTypeNarrowing.svelte +30 -8
  41. package/components/TemplateEditor.svelte +21 -11
  42. package/components/TestJobLoader.svelte +94 -68
  43. package/components/TestJobLoader.svelte.d.ts +10 -8
  44. package/components/Toggle.svelte +30 -7
  45. package/components/Toggle.svelte.d.ts +4 -0
  46. package/components/Tooltip.svelte +1 -1
  47. package/components/VariableEditor.svelte +4 -3
  48. package/components/VariableEditor.svelte.d.ts +2 -2
  49. package/components/apps/components/DisplayComponent.svelte +1 -1
  50. package/components/apps/components/buttons/AppButton.svelte +16 -10
  51. package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -0
  52. package/components/apps/components/dataDisplay/AppBarChart.svelte +17 -8
  53. package/components/apps/components/dataDisplay/AppHtml.svelte +23 -0
  54. package/components/apps/components/dataDisplay/AppHtml.svelte.d.ts +23 -0
  55. package/components/apps/components/dataDisplay/AppPieChart.svelte +11 -7
  56. package/components/apps/components/dataDisplay/AppScatterChart.svelte +46 -0
  57. package/components/apps/components/dataDisplay/AppScatterChart.svelte.d.ts +21 -0
  58. package/components/apps/components/dataDisplay/AppText.svelte +44 -7
  59. package/components/apps/components/dataDisplay/AppText.svelte.d.ts +1 -0
  60. package/components/apps/components/dataDisplay/AppTimeseries.svelte +57 -0
  61. package/components/apps/components/dataDisplay/AppTimeseries.svelte.d.ts +22 -0
  62. package/components/apps/components/form/AppForm.svelte +35 -18
  63. package/components/apps/components/helpers/AlignWrapper.svelte +2 -1
  64. package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +1 -0
  65. package/components/apps/components/helpers/InputValue.svelte +20 -14
  66. package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -0
  67. package/components/apps/components/helpers/NonRunnableComponent.svelte +7 -6
  68. package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -1
  69. package/components/apps/components/helpers/RefreshButton.svelte +16 -11
  70. package/components/apps/components/helpers/RefreshButton.svelte.d.ts +2 -0
  71. package/components/apps/components/helpers/RunnableComponent.svelte +119 -102
  72. package/components/apps/components/helpers/RunnableWrapper.svelte +6 -1
  73. package/components/apps/components/selectInputs/AppCheckbox.svelte +4 -0
  74. package/components/apps/components/selectInputs/AppSelect.svelte +2 -0
  75. package/components/apps/components/table/AppTable.svelte +64 -35
  76. package/components/apps/components/table/AppTableFooter.svelte +2 -1
  77. package/components/apps/components/table/tableOptions.d.ts +2 -9
  78. package/components/apps/components/table/tableOptions.js +5 -2
  79. package/components/apps/components/textInputs/AppTextInput.svelte +7 -4
  80. package/components/apps/editor/AppEditor.svelte +136 -65
  81. package/components/apps/editor/AppEditor.svelte.d.ts +3 -0
  82. package/components/apps/editor/AppEditorHeader.svelte +349 -51
  83. package/components/apps/editor/AppEditorHeader.svelte.d.ts +2 -4
  84. package/components/apps/editor/AppExportButton.svelte +34 -0
  85. package/components/apps/editor/AppExportButton.svelte.d.ts +17 -0
  86. package/components/apps/editor/AppPreview.svelte +20 -7
  87. package/components/apps/editor/AppPreview.svelte.d.ts +6 -0
  88. package/components/apps/editor/AppPublishButton.svelte +53 -0
  89. package/components/apps/editor/AppPublishButton.svelte.d.ts +18 -0
  90. package/components/apps/editor/ComponentEditor.svelte +39 -8
  91. package/components/apps/editor/ComponentEditor.svelte.d.ts +1 -0
  92. package/components/apps/editor/ComponentHeader.svelte +38 -29
  93. package/components/apps/editor/ComponentHeader.svelte.d.ts +3 -1
  94. package/components/apps/editor/GridEditor.svelte +105 -67
  95. package/components/apps/editor/GridEditor.svelte.d.ts +6 -1
  96. package/components/apps/editor/RecomputeAllComponents.svelte +80 -19
  97. package/components/apps/editor/SettingsPanel.svelte +2 -2
  98. package/components/apps/editor/TablePanel.svelte +1 -0
  99. package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -39
  100. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -1
  101. package/components/apps/editor/componentsPanel/componentStaticValues.js +3 -2
  102. package/components/apps/editor/componentsPanel/data.js +201 -91
  103. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +1 -0
  104. package/components/apps/editor/contextPanel/ContextPanel.svelte +69 -47
  105. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +6 -2
  106. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -0
  107. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +56 -20
  108. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +1 -0
  109. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +5 -1
  110. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +2 -0
  111. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +72 -23
  112. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
  113. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +30 -22
  114. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +78 -77
  115. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +38 -33
  116. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +4 -4
  117. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +1 -11
  118. package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +27 -9
  119. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +19 -24
  120. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +1 -0
  121. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +12 -5
  122. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +2 -3
  123. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +59 -33
  124. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +5 -2
  125. package/components/apps/editor/settingsPanel/Recompute.svelte +2 -2
  126. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +21 -3
  127. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -3
  128. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +0 -1
  129. package/components/apps/editor/settingsPanel/TableActions.svelte +27 -18
  130. package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +1 -0
  131. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +10 -2
  132. package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +3 -0
  133. package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +6 -4
  134. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +24 -0
  135. package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +17 -0
  136. package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +6 -0
  137. package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte.d.ts +17 -0
  138. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +11 -21
  139. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +0 -1
  140. package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +1 -2
  141. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +42 -13
  142. package/components/apps/editorUtils.d.ts +1 -0
  143. package/components/apps/editorUtils.js +11 -0
  144. package/components/apps/gridUtils.js +2 -1
  145. package/components/apps/inputType.d.ts +12 -6
  146. package/components/apps/rx.d.ts +3 -3
  147. package/components/apps/rx.js +9 -4
  148. package/components/apps/store.d.ts +2 -0
  149. package/components/apps/store.js +2 -0
  150. package/components/apps/types.d.ts +20 -4
  151. package/components/apps/utils.d.ts +2 -2
  152. package/components/apps/utils.js +25 -9
  153. package/components/common/button/Button.svelte +8 -8
  154. package/components/common/button/Button.svelte.d.ts +2 -0
  155. package/components/common/confirmationModal/ConfirmationModal.svelte +1 -0
  156. package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +4 -1
  157. package/components/common/popup/Popup.svelte +1 -1
  158. package/components/common/table/AppRow.svelte +31 -4
  159. package/components/common/table/AppRow.svelte.d.ts +4 -0
  160. package/components/common/table/FlowRow.svelte +9 -5
  161. package/components/common/table/Row.svelte +10 -8
  162. package/components/common/table/ScriptRow.svelte +15 -13
  163. package/components/common/tabs/Tabs.svelte +1 -1
  164. package/components/common/toggleButton/ToggleButton.svelte +2 -0
  165. package/components/common/toggleButton/ToggleButton.svelte.d.ts +1 -0
  166. package/components/flows/CreateActionsApp.svelte +43 -0
  167. package/components/flows/CreateActionsApp.svelte.d.ts +14 -0
  168. package/components/flows/CreateActionsFlow.svelte +6 -1
  169. package/components/flows/content/DynamicInputHelpBox.svelte +1 -1
  170. package/components/flows/content/FlowConstants.svelte +82 -0
  171. package/components/flows/content/FlowConstants.svelte.d.ts +14 -0
  172. package/components/flows/content/FlowEditorPanel.svelte +3 -0
  173. package/components/flows/content/FlowInputs.svelte +2 -2
  174. package/components/flows/content/FlowModuleComponent.svelte +4 -1
  175. package/components/flows/content/FlowModuleHeader.svelte +41 -89
  176. package/components/flows/content/FlowModuleHeader.svelte.d.ts +2 -2
  177. package/components/flows/content/FlowSettings.svelte +1 -1
  178. package/components/flows/flowStore.d.ts +1 -1
  179. package/components/flows/flowStore.js +8 -8
  180. package/components/flows/header/FlowImportExportMenu.svelte +1 -1
  181. package/components/flows/header/FlowPreviewButtons.svelte +2 -1
  182. package/components/flows/map/FlowConstantsItem.svelte +13 -0
  183. package/components/flows/map/FlowConstantsItem.svelte.d.ts +14 -0
  184. package/components/flows/map/FlowInputsItem.svelte +1 -2
  185. package/components/flows/map/FlowModuleSchemaItem.svelte +34 -25
  186. package/components/flows/map/FlowModuleSchemaMap.svelte +9 -3
  187. package/components/flows/map/FlowSettingsItem.svelte +6 -8
  188. package/components/flows/pickers/PickHubScript.svelte +1 -1
  189. package/components/flows/propPicker/PropPickerWrapper.svelte +42 -31
  190. package/components/home/ItemsList.svelte +6 -4
  191. package/components/icons/ClickhouseIcon.svelte +22 -0
  192. package/components/icons/ClickhouseIcon.svelte.d.ts +17 -0
  193. package/components/icons/FaunadbIcon.svelte +19 -0
  194. package/components/icons/FaunadbIcon.svelte.d.ts +17 -0
  195. package/components/icons/OpenaiIcon.svelte +18 -0
  196. package/components/icons/OpenaiIcon.svelte.d.ts +17 -0
  197. package/components/icons/index.d.ts +7 -1
  198. package/components/icons/index.js +8 -2
  199. package/components/propertyPicker/ObjectViewer.svelte +11 -4
  200. package/components/propertyPicker/PropPicker.svelte +1 -1
  201. package/components/scriptEditor/LogPanel.svelte +26 -22
  202. package/components/sidebar/FavoriteMenu.svelte +23 -19
  203. package/components/sidebar/SidebarContent.svelte +16 -16
  204. package/components/sidebar/WorkspaceMenu.svelte +18 -17
  205. package/components/splitPanes/SplitPanesWrapper.svelte +1 -5
  206. package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +0 -1
  207. package/editorUtils.js +2 -0
  208. package/gen/core/OpenAPI.js +1 -1
  209. package/gen/models/Policy.d.ts +1 -0
  210. package/gen/services/AppService.d.ts +18 -0
  211. package/gen/services/AppService.js +30 -0
  212. package/gen/services/GranularAclService.d.ts +3 -3
  213. package/gen/services/ResourceService.d.ts +15 -0
  214. package/gen/services/ResourceService.js +17 -0
  215. package/infer.js +4 -0
  216. package/logout.d.ts +1 -0
  217. package/logout.js +5 -3
  218. package/package.json +502 -489
  219. package/stores.d.ts +1 -0
  220. package/stores.js +13 -5
  221. package/utils.d.ts +1 -1
  222. package/utils.js +17 -10
  223. package/components/apps/CreateApp.svelte +0 -68
  224. package/components/apps/CreateApp.svelte.d.ts +0 -14
@@ -3,30 +3,55 @@ const inputs = {
3
3
  title: 'Inputs',
4
4
  components: [
5
5
  {
6
+ softWrap: true,
6
7
  verticalAlignment: 'center',
7
8
  id: 'textinputcomponent',
8
9
  type: 'textinputcomponent',
9
10
  componentInput: undefined,
10
- configuration: {},
11
+ configuration: {
12
+ placeholder: {
13
+ type: 'static',
14
+ value: 'Type...',
15
+ fieldType: 'text',
16
+ onlyStatic: true,
17
+ },
18
+ },
11
19
  card: false
12
20
  },
13
21
  {
22
+ softWrap: true,
14
23
  verticalAlignment: 'center',
15
24
  id: 'passwordinputcomponent',
16
25
  type: 'passwordinputcomponent',
17
26
  componentInput: undefined,
18
- configuration: {},
27
+ configuration: {
28
+ placeholder: {
29
+ type: 'static',
30
+ value: 'Password',
31
+ fieldType: 'text',
32
+ onlyStatic: true,
33
+ },
34
+ },
19
35
  card: false
20
36
  },
21
37
  {
38
+ softWrap: true,
22
39
  verticalAlignment: 'center',
23
40
  id: 'numberinputcomponent',
24
41
  type: 'numberinputcomponent',
25
42
  componentInput: undefined,
26
- configuration: {},
43
+ configuration: {
44
+ placeholder: {
45
+ type: 'static',
46
+ value: 'Type...',
47
+ fieldType: 'text',
48
+ onlyStatic: true,
49
+ },
50
+ },
27
51
  card: false
28
52
  },
29
53
  {
54
+ softWrap: true,
30
55
  verticalAlignment: 'center',
31
56
  id: 'dateinputcomponent',
32
57
  type: 'dateinputcomponent',
@@ -34,34 +59,28 @@ const inputs = {
34
59
  configuration: {
35
60
  minDate: {
36
61
  type: 'static',
37
- visible: false,
38
62
  value: '',
39
63
  fieldType: 'date',
40
- defaultValue: ''
41
64
  },
42
65
  maxDate: {
43
66
  type: 'static',
44
- visible: false,
45
67
  value: '',
46
68
  fieldType: 'date',
47
- defaultValue: ''
48
69
  }
49
70
  },
50
71
  card: false,
51
- softWrap: true
52
72
  },
53
73
  {
54
74
  ...defaultAlignement,
75
+ softWrap: true,
55
76
  id: 'checkboxcomponent',
56
77
  type: 'checkboxcomponent',
57
78
  componentInput: undefined,
58
79
  configuration: {
59
80
  label: {
60
81
  type: 'static',
61
- visible: true,
62
82
  value: 'Label',
63
- fieldType: 'textarea',
64
- defaultValue: 'Label'
83
+ fieldType: 'text',
65
84
  }
66
85
  },
67
86
  card: false
@@ -76,10 +95,6 @@ const inputs = {
76
95
  type: 'static',
77
96
  fieldType: 'array',
78
97
  subFieldType: 'object',
79
- defaultValue: [
80
- { value: 'foo', label: 'Foo' },
81
- { value: 'bar', label: 'Bar' }
82
- ],
83
98
  value: [
84
99
  { value: 'foo', label: 'Foo' },
85
100
  { value: 'bar', label: 'Bar' }
@@ -88,7 +103,6 @@ const inputs = {
88
103
  itemKey: {
89
104
  type: 'static',
90
105
  fieldType: 'text',
91
- defaultValue: 'value',
92
106
  value: 'value'
93
107
  }
94
108
  },
@@ -102,6 +116,7 @@ const buttons = {
102
116
  components: [
103
117
  {
104
118
  ...defaultAlignement,
119
+ softWrap: true,
105
120
  id: 'buttoncomponent',
106
121
  type: 'buttoncomponent',
107
122
  componentInput: {
@@ -109,32 +124,27 @@ const buttons = {
109
124
  fieldType: 'any',
110
125
  fields: {},
111
126
  runnable: undefined,
112
- defaultValue: undefined
113
127
  },
114
128
  recomputeIds: undefined,
115
129
  configuration: {
116
130
  label: {
117
131
  type: 'static',
118
- visible: true,
119
- value: 'Lorem ipsum',
120
- fieldType: 'textarea',
121
- defaultValue: 'Lorem ipsum'
132
+ fieldType: 'text',
133
+ value: 'Press me'
122
134
  },
123
135
  color: {
124
136
  fieldType: 'select',
125
137
  type: 'static',
126
- visible: true,
127
- value: 'blue',
138
+ onlyStatic: true,
128
139
  optionValuesKey: 'buttonColorOptions',
129
- defaultValue: 'blue'
140
+ value: 'blue'
130
141
  },
131
142
  size: {
132
143
  fieldType: 'select',
133
144
  type: 'static',
134
- visible: true,
135
- value: 'xs',
145
+ onlyStatic: true,
136
146
  optionValuesKey: 'buttonSizeOptions',
137
- defaultValue: 'xs'
147
+ value: 'xs'
138
148
  }
139
149
  },
140
150
  card: false
@@ -148,32 +158,27 @@ const buttons = {
148
158
  fieldType: 'any',
149
159
  fields: {},
150
160
  runnable: undefined,
151
- defaultValue: undefined
152
161
  },
153
162
  recomputeIds: undefined,
154
163
  configuration: {
155
164
  label: {
156
165
  type: 'static',
157
- visible: true,
158
166
  value: 'Submit',
159
- fieldType: 'textarea',
160
- defaultValue: 'formcomponent'
167
+ fieldType: 'text',
161
168
  },
162
169
  color: {
163
170
  fieldType: 'select',
164
171
  type: 'static',
165
- visible: true,
172
+ onlyStatic: true,
166
173
  value: 'dark',
167
174
  optionValuesKey: 'buttonColorOptions',
168
- defaultValue: 'dark'
169
175
  },
170
176
  size: {
171
177
  fieldType: 'select',
172
178
  type: 'static',
173
- visible: true,
174
179
  value: 'xs',
180
+ onlyStatic: true,
175
181
  optionValuesKey: 'buttonSizeOptions',
176
- defaultValue: 'xs'
177
182
  }
178
183
  },
179
184
  card: true
@@ -184,17 +189,48 @@ const display = {
184
189
  title: 'Display',
185
190
  components: [
186
191
  {
187
- ...defaultAlignement,
192
+ softWrap: false,
193
+ id: 'htmlcomponent',
194
+ type: 'htmlcomponent',
195
+ componentInput: {
196
+ type: 'static',
197
+ fieldType: 'template',
198
+ value: `<img
199
+ src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;ixlib=rb-1.2.1&amp;auto=format&amp;fit=crop&amp;w=1024&amp;h=1280&amp;q=80"
200
+ >
201
+ <div class="absolute top-4 left-2 text-white">
202
+ Hello \${ctx.username}
203
+ </div>
204
+ `,
205
+ },
206
+ configuration: {},
207
+ card: false
208
+ },
209
+ {
210
+ softWrap: true,
211
+ horizontalAlignment: 'left',
212
+ verticalAlignment: 'top',
188
213
  id: 'textcomponent',
189
214
  type: 'textcomponent',
190
215
  componentInput: {
191
216
  type: 'static',
192
- visible: true,
193
- value: 'Lorem ipsum',
194
- fieldType: 'textarea',
195
- defaultValue: 'Lorem ipsum'
217
+ fieldType: 'template',
218
+ value: 'Hello ${ctx.username}',
219
+ },
220
+ configuration: {
221
+ style: {
222
+ fieldType: 'select',
223
+ type: 'static',
224
+ onlyStatic: true,
225
+ optionValuesKey: 'textStyleOptions',
226
+ value: 'Body'
227
+ },
228
+ extraStyle: {
229
+ type: 'static',
230
+ fieldType: 'text',
231
+ value: '',
232
+ },
196
233
  },
197
- configuration: {},
198
234
  card: false
199
235
  },
200
236
  {
@@ -204,46 +240,27 @@ const display = {
204
240
  search: {
205
241
  fieldType: 'select',
206
242
  type: 'static',
207
- value: 'Disabled',
243
+ onlyStatic: true,
208
244
  optionValuesKey: 'tableSearchOptions',
209
- defaultValue: 'Disabled'
210
- },
211
- pagination: {
212
- type: 'static',
213
- value: false,
214
- fieldType: 'boolean',
215
- visible: true,
216
- defaultValue: false
245
+ value: 'Disabled'
217
246
  }
218
247
  },
219
248
  componentInput: {
220
249
  type: 'static',
221
250
  fieldType: 'array',
222
251
  subFieldType: 'object',
223
- defaultValue: [
224
- {
225
- id: 1,
226
- name: 'Lorem ipsum',
227
- age: 42
228
- },
229
- {
230
- id: 2,
231
- name: 'Lorem ipsum',
232
- age: 42
233
- }
234
- ],
235
252
  value: [
236
253
  {
237
254
  id: 1,
238
- name: 'Lorem ipsum',
255
+ name: 'A cell with a long name',
239
256
  age: 42
240
257
  },
241
258
  {
242
259
  id: 2,
243
- name: 'Lorem ipsum',
244
- age: 42
260
+ name: 'A briefer cell',
261
+ age: 84
245
262
  }
246
- ]
263
+ ],
247
264
  },
248
265
  card: true,
249
266
  actionButtons: []
@@ -254,25 +271,22 @@ const display = {
254
271
  configuration: {
255
272
  theme: {
256
273
  type: 'static',
257
- value: 'theme1',
274
+ onlyStatic: true,
258
275
  fieldType: 'select',
259
276
  optionValuesKey: 'chartThemeOptions',
260
- defaultValue: 'theme1'
277
+ value: 'theme1'
261
278
  },
262
- labels: {
279
+ doughnutStyle: {
263
280
  type: 'static',
264
- value: ['First', 'Second', 'Third'],
265
- fieldType: 'array',
266
- subFieldType: 'text',
267
- defaultValue: ['First', 'Second', 'Third']
281
+ onlyStatic: true,
282
+ fieldType: 'boolean',
283
+ value: false
268
284
  }
269
285
  },
270
286
  componentInput: {
271
287
  type: 'static',
272
- fieldType: 'array',
273
- subFieldType: 'number',
274
- defaultValue: [25, 50, 25],
275
- value: [25, 50, 25]
288
+ fieldType: 'object',
289
+ value: { data: [25, 50, 25], labels: ['Pie', 'Charts', '<3'] }
276
290
  },
277
291
  card: true
278
292
  },
@@ -282,25 +296,122 @@ const display = {
282
296
  configuration: {
283
297
  theme: {
284
298
  type: 'static',
285
- value: 'theme1',
299
+ onlyStatic: true,
286
300
  fieldType: 'select',
287
301
  optionValuesKey: 'chartThemeOptions',
288
- defaultValue: 'theme1'
302
+ value: 'theme1'
289
303
  },
290
- labels: {
304
+ line: {
291
305
  type: 'static',
292
- value: ['Lorem ipsum', 'Lorem ipsum', 'Lorem ipsum'],
293
- fieldType: 'array',
294
- subFieldType: 'text',
295
- defaultValue: ['Lorem ipsum', 'Lorem ipsum', 'Lorem ipsum']
306
+ onlyStatic: true,
307
+ fieldType: 'boolean',
308
+ value: false
296
309
  }
297
310
  },
311
+ componentInput: {
312
+ type: 'static',
313
+ fieldType: 'object',
314
+ value: { data: [25, 50, 25], labels: ['Bar', 'Charts', '<3'] }
315
+ },
316
+ card: true
317
+ },
318
+ {
319
+ id: 'scatterchartcomponent',
320
+ type: 'scatterchartcomponent',
321
+ configuration: {
322
+ zoomable: {
323
+ type: 'static',
324
+ onlyStatic: true,
325
+ fieldType: 'boolean',
326
+ value: false
327
+ },
328
+ pannable: {
329
+ type: 'static',
330
+ onlyStatic: true,
331
+ fieldType: 'boolean',
332
+ value: false
333
+ },
334
+ },
298
335
  componentInput: {
299
336
  type: 'static',
300
337
  fieldType: 'array',
301
- subFieldType: 'number',
302
- defaultValue: [25, 50, 25],
303
- value: [25, 50, 25]
338
+ subFieldType: 'object',
339
+ value: [{
340
+ label: 'foo',
341
+ data: [
342
+ { x: 25, y: 50 },
343
+ { x: 23, y: 23 },
344
+ { x: 12, y: 37 }
345
+ ],
346
+ backgroundColor: 'rgb(255, 12, 137)'
347
+ },
348
+ {
349
+ label: 'foobar',
350
+ data: [
351
+ { x: 32, y: 32 },
352
+ { x: 25, y: 42 },
353
+ { x: 3, y: 27 }
354
+ ],
355
+ backgroundColor: 'orange'
356
+ }]
357
+ },
358
+ card: true
359
+ },
360
+ {
361
+ id: 'timeseriescomponent',
362
+ type: 'timeseriescomponent',
363
+ configuration: {
364
+ logarithmicScale: {
365
+ type: 'static',
366
+ onlyStatic: true,
367
+ fieldType: 'boolean',
368
+ value: false
369
+ },
370
+ zoomable: {
371
+ type: 'static',
372
+ onlyStatic: true,
373
+ fieldType: 'boolean',
374
+ value: false
375
+ },
376
+ pannable: {
377
+ type: 'static',
378
+ onlyStatic: true,
379
+ fieldType: 'boolean',
380
+ value: false
381
+ },
382
+ },
383
+ componentInput: {
384
+ type: 'static',
385
+ fieldType: 'array',
386
+ subFieldType: 'object',
387
+ value: [{
388
+ label: 'foo',
389
+ data: [{
390
+ x: '2021-11-06 23:39:30',
391
+ y: 50
392
+ }, {
393
+ x: '2021-11-07 01:00:28',
394
+ y: 60
395
+ }, {
396
+ x: '2021-11-07 09:00:28',
397
+ y: 20
398
+ }],
399
+ backgroundColor: 'rgb(255, 12, 137)'
400
+ },
401
+ {
402
+ label: 'foobar',
403
+ data: [{
404
+ x: '2021-11-06 23:39:30',
405
+ y: 20
406
+ }, {
407
+ x: '2021-11-07 01:00:28',
408
+ y: 13
409
+ }, {
410
+ x: '2021-11-07 09:00:28',
411
+ y: 45
412
+ }],
413
+ backgroundColor: 'orange'
414
+ }]
304
415
  },
305
416
  card: true
306
417
  },
@@ -309,13 +420,12 @@ const display = {
309
420
  type: 'displaycomponent',
310
421
  componentInput: {
311
422
  type: 'static',
312
- fieldType: 'text',
313
- defaultValue: 'Lorem Ipsum',
314
- value: 'Lorem Ipsum'
423
+ fieldType: 'object',
424
+ value: { "foo": 42 },
315
425
  },
316
426
  configuration: {},
317
427
  card: false
318
- }
428
+ },
319
429
  ]
320
430
  };
321
431
  const componentSets = [buttons, inputs, display];
@@ -7,6 +7,7 @@ let object = {};
7
7
  function subscribeToAllOutputs(observableOutputs) {
8
8
  if (observableOutputs) {
9
9
  outputs.forEach((output) => {
10
+ object[output] = undefined;
10
11
  observableOutputs[output]?.subscribe({
11
12
  next: (value) => {
12
13
  object[output] = value;
@@ -1,5 +1,6 @@
1
1
  <script>import { classNames } from '../../../../utils';
2
2
  import { getContext } from 'svelte';
3
+ import { key } from 'svelte-awesome/icons';
3
4
  import { displayData } from '../../utils';
4
5
  import PanelSection from '../settingsPanel/common/PanelSection.svelte';
5
6
  import ComponentOutputViewer from './ComponentOutputViewer.svelte';
@@ -14,65 +15,86 @@ function connectInput(componentId, path) {
14
15
  path
15
16
  },
16
17
  type: 'connected'
17
- }
18
+ },
19
+ hoveredComponent: undefined
18
20
  };
19
21
  }
20
22
  }
21
23
  function getComponentNameById(componentId) {
22
- const component = $app.grid.find((c) => c.data.id === componentId);
24
+ const component = $app.grid.find((c) => c?.data?.id === componentId);
23
25
  if (component?.data.type) {
24
26
  return displayData[component?.data.type].name;
25
27
  }
28
+ else if (componentId == 'ctx') {
29
+ return 'Context';
30
+ }
26
31
  else {
27
32
  return 'Table action';
28
33
  }
29
34
  }
35
+ $: panels = [['ctx', ['email', 'username']]].concat(Object.entries($staticOutputs));
30
36
  </script>
31
37
 
32
- <PanelSection title="Outputs">
33
- {#each Object.entries($staticOutputs) as [componentId, outputs] (componentId)}
34
- {#if outputs.length > 0 && $worldStore?.outputsById[componentId]}
35
- <div class="flex flex-row justify-between w-full -mb-2 ">
36
- <button
37
- on:click={() => ($selectedComponent = componentId)}
38
- class={classNames(
39
- 'px-2 text-2xs py-0.5 font-bold rounded-t-sm w-fit',
40
- $selectedComponent === componentId
41
- ? ' bg-indigo-500 text-white'
42
- : 'bg-gray-200 text-gray-500'
43
- )}
44
- >
45
- {componentId}
46
- </button>
47
- <span
48
- class={classNames(
49
- 'px-1 text-2xs py-0.5 font-bold rounded-t-sm w-fit',
50
- 'bg-gray-500 text-white'
51
- )}
52
- >
53
- {getComponentNameById(componentId)}
54
- </span>
55
- </div>
38
+ <PanelSection noPadding titlePadding="px-4 pt-2" title="Outputs">
39
+ <div
40
+ class="overflow-auto min-w-[150px] border-t w-full relative flex flex-col gap-4 px-2 pt-4 pb-2"
41
+ >
42
+ {#each panels as [componentId, outputs] (componentId)}
43
+ {#if outputs.length > 0 && $worldStore?.outputsById[componentId]}
44
+ <div>
45
+ <div
46
+ class="flex {$connectingInput?.opened
47
+ ? 'bg-white z-50'
48
+ : ''} flex-row justify-between w-full"
49
+ >
50
+ <button
51
+ on:click|stopPropagation|preventDefault={$connectingInput.opened
52
+ ? undefined
53
+ : () => ($selectedComponent = componentId)}
54
+ class={classNames(
55
+ 'px-2 text-2xs py-0.5 border border-gray-300 font-bold rounded-t-sm w-fit',
56
+ $selectedComponent === componentId
57
+ ? ' bg-indigo-500 text-white'
58
+ : 'bg-gray-200 text-gray-500'
59
+ )}
60
+ >
61
+ {componentId}
62
+ </button>
63
+ <span
64
+ class={classNames(
65
+ 'px-1 text-2xs py-0.5 font-bold rounded-t-sm w-fit',
66
+ 'bg-gray-500 text-white'
67
+ )}
68
+ >
69
+ {getComponentNameById(componentId)}
70
+ </span>
71
+ </div>
56
72
 
57
- <!-- svelte-ignore a11y-click-events-have-key-events -->
58
- <div
59
- on:click={() => ($selectedComponent = componentId)}
60
- class={classNames(
61
- 'w-full py-2 border relative',
62
- $selectedComponent === componentId ? 'border border-blue-500 ' : 'cursor-pointer'
63
- )}
64
- >
65
- {#if $selectedComponent === componentId && $connectingInput?.opened}
66
- <div class="absolute top-0 left-0 w-full h-full bg-gray-500 bg-opacity-50 z-10" />
67
- {/if}
68
- <ComponentOutputViewer
69
- {outputs}
70
- {componentId}
71
- on:select={({ detail }) => {
72
- connectInput(componentId, detail)
73
- }}
74
- />
75
- </div>
76
- {/if}
77
- {/each}
73
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
74
+ <div
75
+ class={classNames(
76
+ $connectingInput?.opened ? 'bg-white z-50' : '',
77
+ `w-full py-2 grow border relative break-all `,
78
+ $selectedComponent === componentId ? 'border border-blue-500 ' : '',
79
+ $connectingInput.hoveredComponent === componentId ? 'outline outline-blue-500' : ''
80
+ )}
81
+ >
82
+ {#key $selectedComponent}
83
+ {#key $connectingInput?.opened}
84
+ <ComponentOutputViewer
85
+ outputs={$connectingInput?.opened && $selectedComponent === componentId
86
+ ? ['search']
87
+ : outputs}
88
+ {componentId}
89
+ on:select={({ detail }) => {
90
+ connectInput(componentId, detail)
91
+ }}
92
+ />
93
+ {/key}
94
+ {/key}
95
+ </div>
96
+ </div>
97
+ {/if}
98
+ {/each}
99
+ </div>
78
100
  </PanelSection>
@@ -5,8 +5,10 @@ import { initialCode } from '../../../../script_helpers';
5
5
  import { emptySchema } from '../../../../utils';
6
6
  import { createEventDispatcher, getContext } from 'svelte';
7
7
  import { fly } from 'svelte/transition';
8
+ import { defaultCode } from '../../editorUtils';
8
9
  export let name;
9
- const { appPath } = getContext('AppEditorContext');
10
+ export let id;
11
+ const { appPath, app } = getContext('AppEditorContext');
10
12
  const dispatch = createEventDispatcher();
11
13
  async function inferInlineScriptSchema(language, content, schema) {
12
14
  try {
@@ -18,8 +20,10 @@ async function inferInlineScriptSchema(language, content, schema) {
18
20
  return schema;
19
21
  }
20
22
  async function createInlineScriptByLanguage(language, path, subkind = undefined) {
23
+ const componentType = $app.grid.find((c) => c.data.id === id)?.data?.type;
21
24
  const fullPath = `${appPath}/inline-script/${path}`;
22
- const content = initialCode(language, Script.kind.SCRIPT, subkind ?? 'flow');
25
+ const content = defaultCode(componentType, language) ??
26
+ initialCode(language, Script.kind.SCRIPT, subkind ?? 'flow');
23
27
  let schema = emptySchema();
24
28
  schema = await inferInlineScriptSchema(language, content, schema);
25
29
  const newInlineScript = {
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  name: string;
5
+ id: string;
5
6
  };
6
7
  events: {
7
8
  new: CustomEvent<any>;