windmill-components 1.60.3 → 1.70.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 (335) hide show
  1. package/assets/app.css +3 -0
  2. package/common.d.ts +5 -1
  3. package/components/ApiConnectForm.svelte +66 -5
  4. package/components/AppConnect.svelte +24 -9
  5. package/components/ArgInput.svelte +1 -1
  6. package/components/CliHelpBox.svelte +49 -0
  7. package/components/CliHelpBox.svelte.d.ts +14 -0
  8. package/components/DisplayResult.svelte +51 -1
  9. package/components/DisplayResult.svelte.d.ts +1 -0
  10. package/components/Editor.svelte +17 -7
  11. package/components/EditorBar.svelte +129 -111
  12. package/components/FlowBuilder.svelte +2 -2
  13. package/components/FlowJobResult.svelte +10 -2
  14. package/components/FlowJobResult.svelte.d.ts +1 -0
  15. package/components/FlowMetadata.svelte +24 -8
  16. package/components/FlowPreviewContent.svelte +3 -4
  17. package/components/FlowStatusViewer.svelte +41 -9
  18. package/components/FolderEditor.svelte +4 -3
  19. package/components/HighlightCode.svelte +7 -1
  20. package/components/InlineCodeCopy.svelte +11 -0
  21. package/components/InlineCodeCopy.svelte.d.ts +16 -0
  22. package/components/InputTransformForm.svelte +9 -5
  23. package/components/LogViewer.svelte +6 -0
  24. package/components/LogViewer.svelte.d.ts +1 -0
  25. package/components/ModulePreview.svelte +11 -2
  26. package/components/MoveDrawer.svelte +1 -1
  27. package/components/Multiselect.svelte.d.ts +2 -2
  28. package/components/ObjectResourceInput.svelte +6 -1
  29. package/components/Path.svelte +14 -5
  30. package/components/Popover.svelte +8 -2
  31. package/components/Popover.svelte.d.ts +1 -0
  32. package/components/Range.svelte.d.ts +2 -2
  33. package/components/ResourceEditor.svelte +39 -16
  34. package/components/ResourcePicker.svelte +0 -1
  35. package/components/RunForm.svelte +26 -2
  36. package/components/RunForm.svelte.d.ts +1 -0
  37. package/components/ScheduleEditor.svelte +1 -1
  38. package/components/SchemaEditor.svelte +2 -2
  39. package/components/SchemaForm.svelte +14 -4
  40. package/components/SchemaForm.svelte.d.ts +1 -0
  41. package/components/ScriptBuilder.svelte +45 -22
  42. package/components/ScriptBuilder.svelte.d.ts +1 -0
  43. package/components/ScriptEditor.svelte +1 -0
  44. package/components/SharedBadge.svelte +5 -5
  45. package/components/Slider.svelte +14 -0
  46. package/components/Slider.svelte.d.ts +19 -0
  47. package/components/StringTypeNarrowing.svelte +0 -1
  48. package/components/SuperadminSettings.svelte +11 -3
  49. package/components/SuperadminSettings.svelte.d.ts +2 -0
  50. package/components/TemplateEditor.svelte.d.ts +204 -0
  51. package/components/TestJobLoader.svelte +3 -3
  52. package/components/Toggle.svelte +1 -2
  53. package/components/UserSettings.svelte +25 -28
  54. package/components/UserSettings.svelte.d.ts +2 -0
  55. package/components/VariableEditor.svelte +1 -1
  56. package/components/WhitelistIp.svelte +23 -0
  57. package/components/WhitelistIp.svelte.d.ts +14 -0
  58. package/components/apps/components/buttons/AppButton.svelte +52 -6
  59. package/components/apps/components/buttons/AppButton.svelte.d.ts +3 -0
  60. package/components/apps/components/{form → buttons}/AppForm.svelte +3 -1
  61. package/components/apps/components/buttons/AppFormButton.svelte +137 -0
  62. package/components/apps/components/buttons/AppFormButton.svelte.d.ts +25 -0
  63. package/components/apps/components/buttons/index.d.ts +3 -0
  64. package/components/apps/components/buttons/index.js +3 -0
  65. package/components/apps/components/{dataDisplay → display}/AppBarChart.svelte +15 -4
  66. package/components/apps/components/{dataDisplay → display}/AppBarChart.svelte.d.ts +1 -0
  67. package/components/apps/components/display/AppDisplayComponent.svelte +31 -0
  68. package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +23 -0
  69. package/components/apps/components/display/AppHtml.svelte +32 -0
  70. package/components/apps/components/{dataDisplay → display}/AppHtml.svelte.d.ts +1 -3
  71. package/components/apps/components/display/AppIcon.svelte +35 -0
  72. package/components/apps/components/display/AppIcon.svelte.d.ts +22 -0
  73. package/components/apps/components/display/AppImage.svelte +27 -0
  74. package/components/apps/components/display/AppImage.svelte.d.ts +22 -0
  75. package/components/apps/components/{dataDisplay → display}/AppPieChart.svelte +2 -1
  76. package/components/apps/components/{dataDisplay → display}/AppPieChart.svelte.d.ts +1 -0
  77. package/components/apps/components/{dataDisplay → display}/AppScatterChart.svelte +2 -1
  78. package/components/apps/components/{dataDisplay → display}/AppScatterChart.svelte.d.ts +1 -0
  79. package/components/apps/components/{dataDisplay → display}/AppText.svelte +16 -14
  80. package/components/apps/components/{dataDisplay → display}/AppText.svelte.d.ts +3 -0
  81. package/components/apps/components/{dataDisplay → display}/AppTimeseries.svelte +3 -2
  82. package/components/apps/components/{dataDisplay → display}/AppTimeseries.svelte.d.ts +1 -0
  83. package/components/apps/components/display/PlotlyHtml.svelte +38 -0
  84. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +24 -0
  85. package/components/apps/components/display/VegaLiteHtml.svelte +52 -0
  86. package/components/apps/components/{dataDisplay → display}/VegaLiteHtml.svelte.d.ts +3 -2
  87. package/components/apps/components/display/index.d.ts +12 -0
  88. package/components/apps/components/display/index.js +12 -0
  89. package/components/apps/components/display/table/AppAggridTable.svelte +83 -0
  90. package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +24 -0
  91. package/components/apps/components/{table → display/table}/AppTable.svelte +44 -23
  92. package/components/apps/components/{table → display/table}/AppTable.svelte.d.ts +4 -2
  93. package/components/apps/components/{table → display/table}/AppTableFooter.svelte +1 -1
  94. package/components/apps/components/helpers/AlignWrapper.svelte +19 -19
  95. package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +4 -2
  96. package/components/apps/components/helpers/HiddenComponent.svelte +22 -0
  97. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +25 -0
  98. package/components/apps/components/helpers/InputDefaultValue.svelte +17 -0
  99. package/components/apps/components/helpers/InputDefaultValue.svelte.d.ts +17 -0
  100. package/components/apps/components/helpers/InputValue.svelte +5 -7
  101. package/components/apps/components/helpers/InputValue.svelte.d.ts +0 -1
  102. package/components/apps/components/helpers/RunnableComponent.svelte +37 -48
  103. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
  104. package/components/apps/components/helpers/RunnableWrapper.svelte +7 -2
  105. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +2 -1
  106. package/components/apps/components/helpers/index.d.ts +10 -0
  107. package/components/apps/components/helpers/index.js +10 -0
  108. package/components/apps/components/icon.d.ts +1 -0
  109. package/components/apps/components/icon.js +18 -0
  110. package/components/apps/components/index.d.ts +5 -0
  111. package/components/apps/components/index.js +5 -0
  112. package/components/apps/components/{selectInputs → inputs}/AppCheckbox.svelte +4 -2
  113. package/components/apps/components/{dateInputs → inputs}/AppDateInput.svelte +6 -0
  114. package/components/apps/components/inputs/AppFileInput.svelte +34 -0
  115. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +20 -0
  116. package/components/apps/components/inputs/AppNumberInput.svelte +48 -0
  117. package/components/apps/components/inputs/AppRangeInput.svelte +44 -0
  118. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +23 -0
  119. package/components/apps/components/inputs/AppSelect.svelte +90 -0
  120. package/components/apps/components/{selectInputs → inputs}/AppSelect.svelte.d.ts +2 -0
  121. package/components/apps/components/{numberInputs → inputs}/AppSliderInputs.svelte +13 -9
  122. package/components/apps/components/{textInputs → inputs}/AppTextInput.svelte +6 -0
  123. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +49 -0
  124. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +21 -0
  125. package/components/apps/components/inputs/currency/CurrencyInput.svelte +181 -0
  126. package/components/apps/components/inputs/currency/CurrencyInput.svelte.d.ts +32 -0
  127. package/components/apps/components/inputs/index.d.ts +9 -0
  128. package/components/apps/components/inputs/index.js +9 -0
  129. package/components/apps/components/layout/AppContainer.svelte +32 -0
  130. package/components/apps/components/layout/AppContainer.svelte.d.ts +21 -0
  131. package/components/apps/components/layout/AppDivider.svelte +20 -0
  132. package/components/apps/components/layout/AppDivider.svelte.d.ts +22 -0
  133. package/components/apps/components/layout/AppTabs.svelte +58 -0
  134. package/components/apps/components/layout/AppTabs.svelte.d.ts +24 -0
  135. package/components/apps/components/layout/index.d.ts +3 -0
  136. package/components/apps/components/layout/index.js +3 -0
  137. package/components/apps/editor/AppComponentInput.svelte +33 -0
  138. package/components/apps/editor/AppComponentInput.svelte.d.ts +18 -0
  139. package/components/apps/editor/AppComponentInputs.svelte +13 -0
  140. package/components/apps/editor/AppComponentInputs.svelte.d.ts +20 -0
  141. package/components/apps/editor/AppEditor.svelte +66 -31
  142. package/components/apps/editor/AppEditor.svelte.d.ts +1 -0
  143. package/components/apps/editor/AppEditorHeader.svelte +74 -18
  144. package/components/apps/editor/AppEditorHeader.svelte.d.ts +1 -0
  145. package/components/apps/editor/AppInputs.svelte +60 -0
  146. package/components/apps/editor/AppInputs.svelte.d.ts +14 -0
  147. package/components/apps/editor/AppPreview.svelte +32 -5
  148. package/components/apps/editor/AppPreview.svelte.d.ts +2 -0
  149. package/components/apps/editor/ComponentHeader.svelte +40 -2
  150. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  151. package/components/apps/editor/GridEditor.svelte +75 -32
  152. package/components/apps/editor/GridEditor.svelte.d.ts +2 -0
  153. package/components/apps/editor/SettingsPanel.svelte +31 -3
  154. package/components/apps/editor/SubGridEditor.svelte +111 -0
  155. package/components/apps/editor/SubGridEditor.svelte.d.ts +24 -0
  156. package/components/apps/editor/TablePanel.svelte +2 -0
  157. package/components/apps/editor/TablePanel.svelte.d.ts +1 -1
  158. package/components/apps/editor/appUtils.d.ts +9 -0
  159. package/components/apps/editor/appUtils.js +141 -0
  160. package/components/apps/editor/component/Component.svelte +209 -0
  161. package/components/apps/editor/component/Component.svelte.d.ts +23 -0
  162. package/components/apps/editor/component/README.md +15 -0
  163. package/components/apps/editor/component/components.d.ts +65 -0
  164. package/components/apps/editor/component/components.js +1102 -0
  165. package/components/apps/editor/component/default-codes.d.ts +3 -0
  166. package/components/apps/editor/component/default-codes.js +322 -0
  167. package/components/apps/editor/component/index.d.ts +4 -0
  168. package/components/apps/editor/component/index.js +4 -0
  169. package/components/apps/editor/component/sets.d.ts +2 -0
  170. package/components/apps/editor/component/sets.js +47 -0
  171. package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -105
  172. package/components/apps/editor/componentsPanel/CssProperty.svelte +31 -0
  173. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +20 -0
  174. package/components/apps/editor/componentsPanel/CssSettings.svelte +141 -0
  175. package/components/apps/editor/componentsPanel/CssSettings.svelte.d.ts +14 -0
  176. package/components/apps/editor/componentsPanel/ListItem.svelte +28 -0
  177. package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +20 -0
  178. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +4 -1
  179. package/components/apps/editor/componentsPanel/componentStaticValues.js +4 -1
  180. package/components/apps/editor/contextPanel/ContextPanel.svelte +8 -6
  181. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +98 -9
  182. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +38 -29
  183. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +21 -1
  184. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +66 -8
  185. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +92 -46
  186. package/components/apps/editor/inlineScriptsPanel/utils.d.ts +5 -1
  187. package/components/apps/editor/inlineScriptsPanel/utils.js +30 -0
  188. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +1 -1
  189. package/components/apps/editor/settingsPanel/AlignmentEditor.svelte.d.ts +1 -1
  190. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +4 -1
  191. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +59 -1
  192. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +64 -34
  193. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +5 -3
  194. package/components/apps/editor/settingsPanel/GridTab.svelte +73 -0
  195. package/components/apps/editor/settingsPanel/GridTab.svelte.d.ts +18 -0
  196. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +3 -0
  197. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +2 -2
  198. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +92 -77
  199. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +1 -0
  200. package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +85 -0
  201. package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +18 -0
  202. package/components/apps/editor/settingsPanel/Recompute.svelte +4 -1
  203. package/components/apps/editor/settingsPanel/TableActions.svelte +17 -6
  204. package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +2 -1
  205. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +5 -3
  206. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +83 -0
  207. package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +19 -0
  208. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +6 -1
  209. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +2 -0
  210. package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte +23 -0
  211. package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte.d.ts +17 -0
  212. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +3 -20
  213. package/components/apps/gridUtils.d.ts +3 -1
  214. package/components/apps/gridUtils.js +5 -3
  215. package/components/apps/inputType.d.ts +33 -6
  216. package/components/apps/types.d.ts +35 -39
  217. package/components/apps/types.js +1 -1
  218. package/components/apps/utils.d.ts +6 -5
  219. package/components/apps/utils.js +90 -90
  220. package/components/common/button/Button.svelte +12 -5
  221. package/components/common/button/Button.svelte.d.ts +3 -1
  222. package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
  223. package/components/common/button/model.d.ts +2 -2
  224. package/components/common/button/model.js +21 -6
  225. package/components/common/confirmationModal/ConfirmationModal.svelte +8 -1
  226. package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +4 -4
  227. package/components/common/drawer/Drawer.svelte +3 -1
  228. package/components/common/fileInput/FileInput.svelte +112 -0
  229. package/components/common/fileInput/FileInput.svelte.d.ts +27 -0
  230. package/components/common/index.d.ts +1 -0
  231. package/components/common/index.js +1 -0
  232. package/components/common/kbd/Kbd.svelte.d.ts +2 -2
  233. package/components/common/modal/Modal.svelte +74 -0
  234. package/components/common/modal/Modal.svelte.d.ts +22 -0
  235. package/components/common/popup/Popup.svelte +34 -17
  236. package/components/common/popup/Popup.svelte.d.ts +11 -4
  237. package/components/common/table/FlowRow.svelte +22 -3
  238. package/components/common/table/LanguageBadge.svelte +10 -4
  239. package/components/common/table/Row.svelte +1 -1
  240. package/components/common/table/ScriptRow.svelte +2 -2
  241. package/components/common/tabs/Tabs.svelte +9 -7
  242. package/components/common/tabs/Tabs.svelte.d.ts +3 -1
  243. package/components/flows/CreateActionsFlow.svelte +2 -3
  244. package/components/flows/content/BranchPredicateEditor.svelte +10 -8
  245. package/components/flows/content/CapturePayload.svelte +3 -3
  246. package/components/flows/content/FlowInputs.svelte +109 -99
  247. package/components/flows/content/FlowLoop.svelte +1 -1
  248. package/components/flows/content/FlowModuleComponent.svelte +3 -2
  249. package/components/flows/content/FlowRetries.svelte +8 -6
  250. package/components/flows/content/FlowSettings.svelte +72 -26
  251. package/components/flows/flowState.d.ts +1 -0
  252. package/components/flows/flowState.js +1 -0
  253. package/components/flows/flowStateUtils.js +4 -2
  254. package/components/flows/flowStore.d.ts +1 -0
  255. package/components/flows/flowStore.js +1 -0
  256. package/components/flows/map/FlowBranchAllMap.svelte +1 -1
  257. package/components/flows/map/FlowBranchOneMap.svelte +2 -2
  258. package/components/flows/map/FlowModuleSchemaItem.svelte +5 -5
  259. package/components/flows/map/FlowModuleSchemaMap.svelte +15 -8
  260. package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -0
  261. package/components/flows/map/InsertModuleButton.svelte +24 -10
  262. package/components/flows/map/InsertModuleButton.svelte.d.ts +1 -0
  263. package/components/flows/map/MapItem.svelte +3 -1
  264. package/components/flows/utils.js +16 -10
  265. package/components/graph/FlowGraph.svelte +38 -15
  266. package/components/graph/FlowGraph.svelte.d.ts +1 -0
  267. package/components/icons/SquareIcon.svelte +9 -0
  268. package/components/icons/SquareIcon.svelte.d.ts +17 -0
  269. package/components/icons/index.d.ts +2 -0
  270. package/components/icons/index.js +2 -0
  271. package/components/jobs/JobDetail.svelte +29 -5
  272. package/components/propertyPicker/ObjectViewer.svelte +8 -5
  273. package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
  274. package/components/propertyPicker/PropPicker.svelte +8 -1
  275. package/components/propertyPicker/PropPickerResult.svelte +1 -1
  276. package/components/random_positive_adjetive.d.ts +1 -0
  277. package/components/random_positive_adjetive.js +961 -0
  278. package/components/scriptEditor/LogPanel.svelte +2 -1
  279. package/components/sidebar/SidebarContent.svelte +1 -1
  280. package/components/sidebar/UserMenu.svelte +46 -16
  281. package/components/sidebar/UserMenu.svelte.d.ts +0 -3
  282. package/components/sidebar/WorkspaceMenu.svelte +3 -1
  283. package/components/sidebar/settings.d.ts +2 -0
  284. package/components/sidebar/settings.js +2 -0
  285. package/gen/core/OpenAPI.js +1 -1
  286. package/gen/models/CompletedJob.d.ts +1 -0
  287. package/gen/models/FlowModule.d.ts +0 -1
  288. package/gen/models/QueuedJob.d.ts +1 -0
  289. package/gen/models/WorkerPing.d.ts +1 -1
  290. package/gen/services/FlowService.d.ts +9 -0
  291. package/gen/services/FlowService.js +15 -0
  292. package/gen/services/JobService.d.ts +97 -15
  293. package/gen/services/JobService.js +74 -15
  294. package/gen/services/ScriptService.d.ts +10 -1
  295. package/gen/services/ScriptService.js +16 -1
  296. package/gen/services/VariableService.d.ts +4 -2
  297. package/gen/services/VariableService.js +8 -2
  298. package/gen/services/WorkspaceService.d.ts +17 -0
  299. package/gen/services/WorkspaceService.js +16 -0
  300. package/infer.js +3 -0
  301. package/init_scripts/python_failure_module.py +10 -0
  302. package/init_scripts/python_init_code.py +37 -0
  303. package/init_scripts/python_init_code_clear.py +5 -0
  304. package/init_scripts/python_init_code_trigger.py +14 -0
  305. package/logout.js +2 -1
  306. package/package.json +577 -522
  307. package/script_helpers.d.ts +6 -5
  308. package/script_helpers.js +7 -73
  309. package/stores.d.ts +5 -1
  310. package/stores.js +8 -1
  311. package/user.d.ts +1 -1
  312. package/user.js +14 -8
  313. package/utils.d.ts +1 -1
  314. package/utils.js +8 -7
  315. package/components/apps/components/DisplayComponent.svelte +0 -16
  316. package/components/apps/components/DisplayComponent.svelte.d.ts +0 -20
  317. package/components/apps/components/dataDisplay/AppHtml.svelte +0 -35
  318. package/components/apps/components/dataDisplay/VegaLiteHtml.svelte +0 -28
  319. package/components/apps/components/numberInputs/AppNumberInput.svelte +0 -33
  320. package/components/apps/components/selectInputs/AppSelect.svelte +0 -47
  321. package/components/apps/editor/ComponentEditor.svelte +0 -138
  322. package/components/apps/editor/ComponentEditor.svelte.d.ts +0 -23
  323. package/components/apps/editor/componentsPanel/data.d.ts +0 -3
  324. package/components/apps/editor/componentsPanel/data.js +0 -465
  325. package/components/apps/editorUtils.d.ts +0 -1
  326. package/components/apps/editorUtils.js +0 -253
  327. /package/components/apps/components/{form → buttons}/AppForm.svelte.d.ts +0 -0
  328. /package/components/apps/components/{table → display/table}/AppTableFooter.svelte.d.ts +0 -0
  329. /package/components/apps/components/{table → display/table}/tableOptions.d.ts +0 -0
  330. /package/components/apps/components/{table → display/table}/tableOptions.js +0 -0
  331. /package/components/apps/components/{selectInputs → inputs}/AppCheckbox.svelte.d.ts +0 -0
  332. /package/components/apps/components/{dateInputs → inputs}/AppDateInput.svelte.d.ts +0 -0
  333. /package/components/apps/components/{numberInputs → inputs}/AppNumberInput.svelte.d.ts +0 -0
  334. /package/components/apps/components/{numberInputs → inputs}/AppSliderInputs.svelte.d.ts +0 -0
  335. /package/components/apps/components/{textInputs → inputs}/AppTextInput.svelte.d.ts +0 -0
@@ -0,0 +1,137 @@
1
+ <script>import { Button } from '../../../common';
2
+ import { faUser } from '@fortawesome/free-solid-svg-icons';
3
+ import { getContext } from 'svelte';
4
+ import { Icon } from 'svelte-awesome';
5
+ import AlignWrapper from '../helpers/AlignWrapper.svelte';
6
+ import InputValue from '../helpers/InputValue.svelte';
7
+ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
8
+ import Portal from 'svelte-portal';
9
+ import Modal from '../../../common/modal/Modal.svelte';
10
+ export let id;
11
+ export let componentInput;
12
+ export let configuration;
13
+ export let recomputeIds = undefined;
14
+ export let extraQueryParams = {};
15
+ export let horizontalAlignment = undefined;
16
+ export let verticalAlignment = undefined;
17
+ export const staticOutputs = ['loading', 'result'];
18
+ const { runnableComponents, worldStore } = getContext('AppEditorContext');
19
+ let labelValue = 'Default label';
20
+ let color;
21
+ let size;
22
+ let runnableComponent;
23
+ let disabled = undefined;
24
+ let isLoading = false;
25
+ let ownClick = false;
26
+ let errors = {};
27
+ $: errorsMessage = Object.values(errors)
28
+ .filter((x) => x != '')
29
+ .join('\n');
30
+ $: noInputs =
31
+ componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0;
32
+ $: outputs = $worldStore?.outputsById[id];
33
+ $: if (outputs?.loading != undefined) {
34
+ outputs.loading.set(false, true);
35
+ }
36
+ $: outputs?.loading.subscribe({
37
+ next: (value) => {
38
+ isLoading = value;
39
+ if (ownClick && !value) {
40
+ ownClick = false;
41
+ }
42
+ }
43
+ });
44
+ $: loading = isLoading && ownClick;
45
+ let open = false;
46
+ </script>
47
+
48
+ <InputValue {id} input={configuration.label} bind:value={labelValue} />
49
+ <InputValue {id} input={configuration.color} bind:value={color} />
50
+ <InputValue {id} input={configuration.size} bind:value={size} />
51
+ <InputValue
52
+ {id}
53
+ input={configuration.disabled}
54
+ bind:value={disabled}
55
+ bind:error={errors.disabled}
56
+ />
57
+
58
+ <Portal>
59
+ <Modal
60
+ {open}
61
+ title={labelValue}
62
+ on:canceled={() => {
63
+ open = false
64
+ }}
65
+ on:confirmed={() => {
66
+ open = false
67
+ }}
68
+ >
69
+ <RunnableWrapper
70
+ defaultUserInput
71
+ bind:runnableComponent
72
+ bind:componentInput
73
+ {id}
74
+ {extraQueryParams}
75
+ autoRefresh={false}
76
+ forceSchemaDisplay={true}
77
+ runnableClass="!block"
78
+ >
79
+ <div class="flex flex-col gap-2 px-4 w-full">
80
+ <div>
81
+ {#if noInputs}
82
+ <div class="text-gray-600 italic text-sm my-4">
83
+ Run forms are associated with a runnable that has user inputs.
84
+ <br />
85
+ Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
86
+ <strong>
87
+ User Input
88
+ <Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
89
+ </strong>
90
+ </div>
91
+ {/if}
92
+ </div>
93
+ <div class="flex justify-end">
94
+ <Button
95
+ {loading}
96
+ btnClasses="my-1"
97
+ on:pointerdown={(e) => {
98
+ e?.stopPropagation()
99
+ window.dispatchEvent(new Event('pointerup'))
100
+ }}
101
+ on:click={async () => {
102
+ await runnableComponent?.runComponent()
103
+
104
+ if (recomputeIds) {
105
+ recomputeIds.forEach((id) => {
106
+ $runnableComponents[id]?.()
107
+ })
108
+ }
109
+
110
+ open = false
111
+ }}
112
+ size="xs"
113
+ color="dark"
114
+ >
115
+ Submit
116
+ </Button>
117
+ </div>
118
+ </div>
119
+ </RunnableWrapper>
120
+ </Modal>
121
+ </Portal>
122
+
123
+ <AlignWrapper {horizontalAlignment} {verticalAlignment}>
124
+ {#if errorsMessage}
125
+ <div class="text-red-500 text-xs">{errorsMessage}</div>
126
+ {/if}
127
+ <Button
128
+ {disabled}
129
+ {size}
130
+ {color}
131
+ on:click={(e) => {
132
+ open = true
133
+ }}
134
+ >
135
+ {labelValue}
136
+ </Button>
137
+ </AlignWrapper>
@@ -0,0 +1,25 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AppInput } from '../../inputType';
3
+ declare const __propDef: {
4
+ props: {
5
+ id: string;
6
+ componentInput: AppInput | undefined;
7
+ configuration: Record<string, AppInput>;
8
+ recomputeIds?: string[] | undefined;
9
+ extraQueryParams?: Record<string, any> | undefined;
10
+ horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
11
+ verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
12
+ staticOutputs?: string[] | undefined;
13
+ };
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export type AppFormButtonProps = typeof __propDef.props;
20
+ export type AppFormButtonEvents = typeof __propDef.events;
21
+ export type AppFormButtonSlots = typeof __propDef.slots;
22
+ export default class AppFormButton extends SvelteComponentTyped<AppFormButtonProps, AppFormButtonEvents, AppFormButtonSlots> {
23
+ get staticOutputs(): string[];
24
+ }
25
+ export {};
@@ -0,0 +1,3 @@
1
+ export { default as AppButton } from './AppButton.svelte';
2
+ export { default as AppForm } from './AppForm.svelte';
3
+ export { default as AppFormButton } from './AppFormButton.svelte';
@@ -0,0 +1,3 @@
1
+ export { default as AppButton } from './AppButton.svelte';
2
+ export { default as AppForm } from './AppForm.svelte';
3
+ export { default as AppFormButton } from './AppFormButton.svelte';
@@ -5,6 +5,7 @@ import InputValue from '../helpers/InputValue.svelte';
5
5
  export let id;
6
6
  export let componentInput;
7
7
  export let configuration;
8
+ export let initializing = undefined;
8
9
  export const staticOutputs = ['loading', 'result'];
9
10
  ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement);
10
11
  let result = undefined;
@@ -17,7 +18,17 @@ $: backgroundColor = {
17
18
  // red theme
18
19
  theme3: ['#e74a3b', '#4e73df', '#1cc88a', '#36b9cc', '#f6c23e']
19
20
  }[theme];
20
- const options = {
21
+ const lineOptions = {
22
+ responsive: true,
23
+ animation: false,
24
+ maintainAspectRatio: false,
25
+ plugins: {
26
+ legend: {
27
+ display: false
28
+ }
29
+ }
30
+ };
31
+ const barOptions = {
21
32
  responsive: true,
22
33
  animation: false,
23
34
  maintainAspectRatio: false,
@@ -41,12 +52,12 @@ $: data = {
41
52
  <InputValue {id} input={configuration.theme} bind:value={theme} />
42
53
  <InputValue {id} input={configuration.line} bind:value={lineChart} />
43
54
 
44
- <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
55
+ <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
45
56
  {#if result}
46
57
  {#if lineChart}
47
- <Line {data} {options} />
58
+ <Line {data} options={lineOptions} />
48
59
  {:else}
49
- <Bar {data} {options} />
60
+ <Bar {data} options={barOptions} />
50
61
  {/if}
51
62
  {/if}
52
63
  </RunnableWrapper>
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  id: string;
6
6
  componentInput: AppInput | undefined;
7
7
  configuration: Record<string, AppInput>;
8
+ initializing?: boolean | undefined;
8
9
  staticOutputs?: string[] | undefined;
9
10
  };
10
11
  events: {
@@ -0,0 +1,31 @@
1
+ <script>import DisplayResult from '../../../DisplayResult.svelte';
2
+ import { getContext } from 'svelte';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { IS_APP_PUBLIC_CONTEXT_KEY } from '../../types';
5
+ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
6
+ export let id;
7
+ export let componentInput;
8
+ export let initializing = undefined;
9
+ export let customCss = undefined;
10
+ const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY);
11
+ const { app } = getContext('AppEditorContext');
12
+ let result = undefined;
13
+ export const staticOutputs = ['result', 'loading'];
14
+ </script>
15
+
16
+ <RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
17
+ <div class={twMerge(
18
+ 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
19
+ $app.css?.['displaycomponent']?.['header']?.class,
20
+ customCss?.header?.class
21
+ )}>
22
+ Results
23
+ </div>
24
+ <div class={twMerge(
25
+ 'p-2',
26
+ $app.css?.['displaycomponent']?.['container']?.class,
27
+ customCss?.container?.class
28
+ )}>
29
+ <DisplayResult {result} {requireHtmlApproval} />
30
+ </div>
31
+ </RunnableWrapper>
@@ -0,0 +1,23 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AppInput } from '../../inputType';
3
+ import { type ComponentCustomCSS } from '../../types';
4
+ declare const __propDef: {
5
+ props: {
6
+ id: string;
7
+ componentInput: AppInput | undefined;
8
+ initializing?: boolean | undefined;
9
+ customCss?: ComponentCustomCSS<'header' | 'container'> | undefined;
10
+ staticOutputs?: string[] | undefined;
11
+ };
12
+ events: {
13
+ [evt: string]: CustomEvent<any>;
14
+ };
15
+ slots: {};
16
+ };
17
+ export type AppDisplayComponentProps = typeof __propDef.props;
18
+ export type AppDisplayComponentEvents = typeof __propDef.events;
19
+ export type AppDisplayComponentSlots = typeof __propDef.slots;
20
+ export default class AppDisplayComponent extends SvelteComponentTyped<AppDisplayComponentProps, AppDisplayComponentEvents, AppDisplayComponentSlots> {
21
+ get staticOutputs(): string[];
22
+ }
23
+ export {};
@@ -0,0 +1,32 @@
1
+ <script>import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
2
+ export let id;
3
+ export let componentInput;
4
+ export let initializing = undefined;
5
+ export const staticOutputs = ['result', 'loading'];
6
+ let result = undefined;
7
+ let h = undefined;
8
+ let w = undefined;
9
+ </script>
10
+
11
+ <div
12
+ on:pointerdown={(e) => {
13
+ e?.preventDefault()
14
+ }}
15
+ class="h-full w-full"
16
+ bind:clientHeight={h}
17
+ bind:clientWidth={w}
18
+ >
19
+ <RunnableWrapper autoRefresh flexWrap bind:componentInput {id} bind:initializing bind:result>
20
+ {#key result}
21
+ <iframe
22
+ frameborder="0"
23
+ style="height: {h}px; width: {w}px"
24
+ class="p-0"
25
+ title="sandbox"
26
+ srcdoc={result
27
+ ? '<scr' + `ipt type="application/javascript" src="/tailwind.js"></script>` + result
28
+ : 'No html'}
29
+ />
30
+ {/key}
31
+ </RunnableWrapper>
32
+ </div>
@@ -4,9 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  componentInput: AppInput | undefined;
7
- horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
8
- verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
9
- configuration: Record<string, AppInput>;
7
+ initializing?: boolean | undefined;
10
8
  staticOutputs?: string[] | undefined;
11
9
  };
12
10
  events: {
@@ -0,0 +1,35 @@
1
+ <script>import { AlignWrapper, InputValue, RunnableWrapper } from '../helpers';
2
+ import { loadIcon } from '../icon';
3
+ export let id;
4
+ export let horizontalAlignment = 'left';
5
+ export let verticalAlignment = undefined;
6
+ export let configuration;
7
+ export const staticOutputs = [];
8
+ let icon = undefined;
9
+ let size;
10
+ let color;
11
+ let strokeWidth;
12
+ let iconComponent;
13
+ $: icon && handleIcon();
14
+ async function handleIcon() {
15
+ if (icon) {
16
+ iconComponent = await loadIcon(icon);
17
+ }
18
+ }
19
+ </script>
20
+
21
+ <InputValue {id} input={configuration.icon} bind:value={icon} />
22
+ <InputValue {id} input={configuration.size} bind:value={size} />
23
+ <InputValue {id} input={configuration.color} bind:value={color} />
24
+ <InputValue {id} input={configuration.strokeWidth} bind:value={strokeWidth} />
25
+
26
+ <AlignWrapper {horizontalAlignment} {verticalAlignment}>
27
+ {#if iconComponent}
28
+ <svelte:component
29
+ this={iconComponent}
30
+ size={size || 24}
31
+ color={color || 'currentColor'}
32
+ strokeWidth={strokeWidth || 2}
33
+ />
34
+ {/if}
35
+ </AlignWrapper>
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AppInput } from '../../inputType';
3
+ declare const __propDef: {
4
+ props: {
5
+ id: string;
6
+ horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
7
+ verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
8
+ configuration: Record<string, AppInput>;
9
+ staticOutputs?: string[] | undefined;
10
+ };
11
+ events: {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export type AppIconProps = typeof __propDef.props;
17
+ export type AppIconEvents = typeof __propDef.events;
18
+ export type AppIconSlots = typeof __propDef.slots;
19
+ export default class AppIcon extends SvelteComponentTyped<AppIconProps, AppIconEvents, AppIconSlots> {
20
+ get staticOutputs(): string[];
21
+ }
22
+ export {};
@@ -0,0 +1,27 @@
1
+ <script>import InputValue from '../helpers/InputValue.svelte';
2
+ export let id;
3
+ export let configuration;
4
+ export const staticOutputs = ['loading'];
5
+ const fit = {
6
+ cover: 'object-cover',
7
+ contain: 'object-contain',
8
+ fill: 'object-fill'
9
+ };
10
+ let source = undefined;
11
+ let imageFit = undefined;
12
+ let altText = undefined;
13
+ let customStyles = undefined;
14
+ </script>
15
+
16
+ <InputValue {id} input={configuration.source} bind:value={source} />
17
+ <InputValue {id} input={configuration.imageFit} bind:value={imageFit} />
18
+ <InputValue {id} input={configuration.altText} bind:value={altText} />
19
+ <InputValue {id} input={configuration.customStyles} bind:value={customStyles} />
20
+
21
+ <img
22
+ on:pointerdown|preventDefault
23
+ src={source}
24
+ alt={altText}
25
+ style={customStyles}
26
+ class="w-full h-full {fit[imageFit || 'cover']}"
27
+ />
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AppInput } from '../../inputType';
3
+ declare const __propDef: {
4
+ props: {
5
+ id: string;
6
+ configuration: Record<string, AppInput>;
7
+ staticOutputs?: string[] | undefined;
8
+ };
9
+ events: {
10
+ pointerdown: PointerEvent;
11
+ } & {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export type AppImageProps = typeof __propDef.props;
17
+ export type AppImageEvents = typeof __propDef.events;
18
+ export type AppImageSlots = typeof __propDef.slots;
19
+ export default class AppImage extends SvelteComponentTyped<AppImageProps, AppImageEvents, AppImageSlots> {
20
+ get staticOutputs(): string[];
21
+ }
22
+ export {};
@@ -5,6 +5,7 @@ import InputValue from '../helpers/InputValue.svelte';
5
5
  export let id;
6
6
  export let componentInput;
7
7
  export let configuration;
8
+ export let initializing = undefined;
8
9
  export const staticOutputs = ['loading', 'result'];
9
10
  ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, ArcElement);
10
11
  let result = undefined;
@@ -36,7 +37,7 @@ $: data = {
36
37
  <InputValue {id} input={configuration.theme} bind:value={theme} />
37
38
  <InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
38
39
 
39
- <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
40
+ <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
40
41
  {#if result}
41
42
  {#if doughnut}
42
43
  <Doughnut {data} {options} />
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  id: string;
6
6
  componentInput: AppInput | undefined;
7
7
  configuration: Record<string, AppInput>;
8
+ initializing?: boolean | undefined;
8
9
  staticOutputs?: string[] | undefined;
9
10
  };
10
11
  events: {
@@ -6,6 +6,7 @@ import InputValue from '../helpers/InputValue.svelte';
6
6
  export let id;
7
7
  export let componentInput;
8
8
  export let configuration;
9
+ export let initializing = undefined;
9
10
  let zoomable = false;
10
11
  let pannable = false;
11
12
  export const staticOutputs = ['loading', 'result'];
@@ -39,7 +40,7 @@ $: data = {
39
40
  <InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
40
41
  <InputValue {id} input={configuration.pannable} bind:value={pannable} />
41
42
 
42
- <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
43
+ <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
43
44
  {#if result}
44
45
  <Scatter {data} {options} />
45
46
  {/if}
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  id: string;
6
6
  componentInput: AppInput | undefined;
7
7
  configuration: Record<string, AppInput>;
8
+ initializing?: boolean | undefined;
8
9
  staticOutputs?: string[] | undefined;
9
10
  };
10
11
  events: {
@@ -5,13 +5,17 @@ import Popover from '../../../Popover.svelte';
5
5
  import AlignWrapper from '../helpers/AlignWrapper.svelte';
6
6
  import InputValue from '../helpers/InputValue.svelte';
7
7
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
8
+ import { twMerge } from 'tailwind-merge';
9
+ import { getContext } from 'svelte';
8
10
  export let id;
9
11
  export let componentInput;
10
12
  export let horizontalAlignment = 'left';
11
13
  export let verticalAlignment = undefined;
12
14
  export let configuration;
15
+ export let initializing = undefined;
16
+ export let customCss = undefined;
13
17
  export const staticOutputs = ['result', 'loading'];
14
- let extraStyle = undefined;
18
+ const { app } = getContext('AppEditorContext');
15
19
  let result = undefined;
16
20
  let style = undefined;
17
21
  let copyButton;
@@ -47,37 +51,35 @@ $: style && (component = getComponent());
47
51
  $: style && (classes = getClasses());
48
52
  </script>
49
53
 
50
- <InputValue {id} input={configuration.extraStyle} bind:value={extraStyle} />
51
54
  <InputValue {id} input={configuration.style} bind:value={style} />
52
55
  <InputValue {id} input={configuration.copyButton} bind:value={copyButton} />
53
56
 
54
- <RunnableWrapper flexWrap bind:componentInput {id} bind:result>
57
+ <RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
55
58
  <AlignWrapper {horizontalAlignment} {verticalAlignment}>
56
59
  {#if !result || result === ''}
57
60
  <div class="text-gray-400 bg-gray-100 flex justify-center items-center h-full w-full">
58
61
  No text
59
62
  </div>
60
63
  {:else}
61
- <div class="flex flex-wrap gap-2">
64
+ <div class="flex flex-wrap gap-2 pb-0.5 overflow-x-auto">
62
65
  <svelte:element
63
66
  this={component}
64
- class="whitespace-pre-wrap {classes}"
65
- style={extraStyle}
67
+ class={twMerge(
68
+ 'whitespace-pre-wrap',
69
+ $app.css?.['textcomponent']?.['text']?.class,
70
+ customCss?.text?.class,
71
+ classes
72
+ )}
73
+ style={[$app.css?.['textcomponent']?.['text']?.style, customCss?.text?.style].join(';')}
66
74
  >
67
75
  {String(result)}
68
76
  </svelte:element>
69
77
  {#if copyButton && result}
70
78
  <Popover notClickable>
71
- <Button
72
- size="xs"
73
- btnClasses="!px-2"
74
- on:click={() => copyToClipboard(result)}
75
- >
79
+ <Button size="xs" btnClasses="!px-2" on:click={() => copyToClipboard(result)}>
76
80
  <Clipboard size={14} strokeWidth={2} />
77
81
  </Button>
78
- <svelte:fragment slot="text">
79
- Copy to clipboard
80
- </svelte:fragment>
82
+ <svelte:fragment slot="text">Copy to clipboard</svelte:fragment>
81
83
  </Popover>
82
84
  {/if}
83
85
  </div>
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
+ import type { ComponentCustomCSS } from '../../types';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  id: string;
@@ -7,6 +8,8 @@ declare const __propDef: {
7
8
  horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
8
9
  verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
9
10
  configuration: Record<string, AppInput>;
11
+ initializing?: boolean | undefined;
12
+ customCss?: ComponentCustomCSS<'text'> | undefined;
10
13
  staticOutputs?: string[] | undefined;
11
14
  };
12
15
  events: {
@@ -2,11 +2,12 @@
2
2
  import 'chartjs-adapter-date-fns';
3
3
  import { Chart as ChartJS, Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement, TimeScale, LogarithmicScale } from 'chart.js';
4
4
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
5
- import Scatter from 'svelte-chartjs/Scatter.svelte';
5
+ import { Scatter } from 'svelte-chartjs';
6
6
  import InputValue from '../helpers/InputValue.svelte';
7
7
  export let id;
8
8
  export let componentInput;
9
9
  export let configuration;
10
+ export let initializing = undefined;
10
11
  export const staticOutputs = ['loading', 'result'];
11
12
  let logarithmicScale = false;
12
13
  let zoomable = false;
@@ -50,7 +51,7 @@ $: data = {
50
51
  <InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
51
52
  <InputValue {id} input={configuration.pannable} bind:value={pannable} />
52
53
 
53
- <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
54
+ <RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
54
55
  {#if result}
55
56
  <Scatter {data} {options} />
56
57
  {/if}
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  id: string;
7
7
  componentInput: AppInput | undefined;
8
8
  configuration: Record<string, AppInput>;
9
+ initializing?: boolean | undefined;
9
10
  staticOutputs?: string[] | undefined;
10
11
  };
11
12
  events: {
@@ -0,0 +1,38 @@
1
+ <script>import { Loader2 } from 'lucide-svelte';
2
+ import { onMount } from 'svelte';
3
+ import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
4
+ export let id;
5
+ export let componentInput;
6
+ export let configuration;
7
+ export let initializing = undefined;
8
+ export const staticOutputs = ['result', 'loading'];
9
+ let result = undefined;
10
+ let divEl = null;
11
+ let Plotly;
12
+ onMount(async () => {
13
+ if (divEl) {
14
+ //@ts-ignore
15
+ await import('https://cdn.plot.ly/plotly-2.18.0.min.js');
16
+ Plotly = window['Plotly'];
17
+ }
18
+ });
19
+ let h = undefined;
20
+ let w = undefined;
21
+ $: Plotly &&
22
+ result &&
23
+ divEl &&
24
+ h &&
25
+ w &&
26
+ Plotly.newPlot(divEl, [result], { width: w, height: h, margin: { l: 40, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
27
+ </script>
28
+
29
+ <div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
30
+ <RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
31
+ {#if !Plotly}
32
+ <div class="p-2">
33
+ <Loader2 class="animate-spin" />
34
+ </div>
35
+ {/if}
36
+ <div on:pointerdown bind:this={divEl} />
37
+ </RunnableWrapper>
38
+ </div>
@@ -0,0 +1,24 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AppInput } from '../../inputType';
3
+ declare const __propDef: {
4
+ props: {
5
+ id: string;
6
+ componentInput: AppInput | undefined;
7
+ configuration: Record<string, AppInput>;
8
+ initializing?: boolean | undefined;
9
+ staticOutputs?: string[] | undefined;
10
+ };
11
+ events: {
12
+ pointerdown: PointerEvent;
13
+ } & {
14
+ [evt: string]: CustomEvent<any>;
15
+ };
16
+ slots: {};
17
+ };
18
+ export type PlotlyHtmlProps = typeof __propDef.props;
19
+ export type PlotlyHtmlEvents = typeof __propDef.events;
20
+ export type PlotlyHtmlSlots = typeof __propDef.slots;
21
+ export default class PlotlyHtml extends SvelteComponentTyped<PlotlyHtmlProps, PlotlyHtmlEvents, PlotlyHtmlSlots> {
22
+ get staticOutputs(): string[];
23
+ }
24
+ export {};