windmill-components 1.70.0 → 1.77.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.
- package/assets/app.css +12 -1
- package/components/AppConnect.svelte +4 -3
- package/components/DisplayResult.svelte +28 -10
- package/components/Dropdown.svelte +14 -4
- package/components/FieldHeader.svelte +12 -8
- package/components/FlowBuilder.svelte +107 -39
- package/components/FlowBuilder.svelte.d.ts +5 -0
- package/components/FlowGraphViewer.svelte +6 -5
- package/components/FlowJobResult.svelte +3 -3
- package/components/FlowPreviewContent.svelte +3 -8
- package/components/FlowStatusViewer.svelte +21 -8
- package/components/FolderUsageInfo.svelte +16 -6
- package/components/FolderUsageInfo.svelte.d.ts +2 -0
- package/components/GroupEditor.svelte +8 -0
- package/components/InputTransformForm.svelte +13 -20
- package/components/InputTransformSchemaForm.svelte +103 -0
- package/components/InputTransformSchemaForm.svelte.d.ts +24 -0
- package/components/LogViewer.svelte +1 -1
- package/components/ModulePreview.svelte +3 -2
- package/components/Multiselect.svelte +1 -1
- package/components/PageHeader.svelte +1 -1
- package/components/Path.svelte +35 -12
- package/components/Popover.svelte +2 -13
- package/components/ResourcePicker.svelte +33 -14
- package/components/RunChart.svelte +24 -5
- package/components/RunForm.svelte +5 -6
- package/components/RunForm.svelte.d.ts +1 -0
- package/components/SchemaForm.svelte +59 -57
- package/components/SchemaForm.svelte.d.ts +0 -5
- package/components/ScriptBuilder.svelte +151 -135
- package/components/ScriptPicker.svelte +3 -0
- package/components/SettingSection.svelte +44 -0
- package/components/SettingSection.svelte.d.ts +21 -0
- package/components/SimpleEditor.svelte +4 -1
- package/components/SimpleEditor.svelte.d.ts +2 -0
- package/components/Slider.svelte +6 -1
- package/components/Slider.svelte.d.ts +1 -0
- package/components/TemplateEditor.svelte +1 -1
- package/components/TestJobLoader.svelte +2 -2
- package/components/Toggle.svelte +17 -4
- package/components/Toggle.svelte.d.ts +2 -0
- package/components/Tooltip.svelte +4 -2
- package/components/UserSettings.svelte +2 -0
- package/components/WhitelistIp.svelte +1 -3
- package/components/apps/components/buttons/AppButton.svelte +45 -23
- package/components/apps/components/buttons/AppButton.svelte.d.ts +2 -0
- package/components/apps/components/buttons/AppForm.svelte +18 -12
- package/components/apps/components/buttons/AppForm.svelte.d.ts +3 -0
- package/components/apps/components/buttons/AppFormButton.svelte +14 -10
- package/components/apps/components/buttons/AppFormButton.svelte.d.ts +3 -0
- package/components/apps/components/display/AppBarChart.svelte +15 -7
- package/components/apps/components/display/AppBarChart.svelte.d.ts +3 -0
- package/components/apps/components/display/AppDisplayComponent.svelte +17 -12
- package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +1 -0
- package/components/apps/components/display/AppHtml.svelte +18 -4
- package/components/apps/components/display/AppHtml.svelte.d.ts +3 -0
- package/components/apps/components/display/AppIcon.svelte +20 -8
- package/components/apps/components/display/AppIcon.svelte.d.ts +3 -0
- package/components/apps/components/display/AppImage.svelte +17 -10
- package/components/apps/components/display/AppImage.svelte.d.ts +3 -0
- package/components/apps/components/display/AppMap.svelte +214 -0
- package/components/apps/components/display/AppMap.svelte.d.ts +23 -0
- package/components/apps/components/display/AppPdf.svelte +304 -0
- package/components/apps/components/display/AppPdf.svelte.d.ts +24 -0
- package/components/apps/components/display/AppPieChart.svelte +15 -7
- package/components/apps/components/display/AppPieChart.svelte.d.ts +3 -0
- package/components/apps/components/display/AppScatterChart.svelte +12 -4
- package/components/apps/components/display/AppScatterChart.svelte.d.ts +3 -0
- package/components/apps/components/display/AppText.svelte +38 -32
- package/components/apps/components/display/AppText.svelte.d.ts +1 -0
- package/components/apps/components/display/AppTimeseries.svelte +12 -4
- package/components/apps/components/display/AppTimeseries.svelte.d.ts +3 -0
- package/components/apps/components/display/PlotlyHtml.svelte +8 -14
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +1 -1
- package/components/apps/components/display/VegaLiteHtml.svelte +3 -8
- package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +1 -0
- package/components/apps/components/display/index.d.ts +3 -0
- package/components/apps/components/display/index.js +3 -0
- package/components/apps/components/display/table/AppAggridTable.svelte +20 -8
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +1 -0
- package/components/apps/components/display/table/AppTable.svelte +69 -21
- package/components/apps/components/display/table/AppTable.svelte.d.ts +3 -1
- package/components/apps/components/display/table/AppTableFooter.svelte +8 -1
- package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +2 -0
- package/components/apps/components/helpers/AlignWrapper.svelte +13 -7
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +3 -1
- package/components/apps/components/helpers/HiddenComponent.svelte +5 -1
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/InputValue.svelte +58 -52
- package/components/apps/components/helpers/InputValue.svelte.d.ts +4 -3
- package/components/apps/components/helpers/NonRunnableComponent.svelte +18 -3
- package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RefreshButton.svelte +3 -4
- package/components/apps/components/helpers/ResizeWrapper.svelte +24 -0
- package/components/apps/components/helpers/ResizeWrapper.svelte.d.ts +19 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +126 -91
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +5 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +11 -5
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +4 -1
- package/components/apps/components/helpers/eval.d.ts +5 -0
- package/components/apps/components/helpers/eval.js +57 -0
- package/components/apps/components/inputs/AppCheckbox.svelte +8 -2
- package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +3 -0
- package/components/apps/components/inputs/AppDateInput.svelte +25 -18
- package/components/apps/components/inputs/AppDateInput.svelte.d.ts +6 -1
- package/components/apps/components/inputs/AppFileInput.svelte +22 -14
- package/components/apps/components/inputs/AppFileInput.svelte.d.ts +3 -0
- package/components/apps/components/inputs/AppMultiSelect.svelte +82 -0
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +27 -0
- package/components/apps/components/inputs/AppNumberInput.svelte +20 -16
- package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +5 -0
- package/components/apps/components/inputs/AppRangeInput.svelte +55 -14
- package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +3 -0
- package/components/apps/components/inputs/AppSelect.svelte +58 -21
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +3 -0
- package/components/apps/components/inputs/AppSliderInputs.svelte +41 -9
- package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +3 -0
- package/components/apps/components/inputs/AppTextInput.svelte +53 -19
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +6 -0
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +13 -3
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +3 -0
- package/components/apps/components/inputs/currency/CurrencyInput.svelte +2 -0
- package/components/apps/components/inputs/currency/CurrencyInput.svelte.d.ts +1 -0
- package/components/apps/components/layout/AppContainer.svelte +20 -17
- package/components/apps/components/layout/AppContainer.svelte.d.ts +3 -0
- package/components/apps/components/layout/AppDivider.svelte +24 -4
- package/components/apps/components/layout/AppDivider.svelte.d.ts +3 -1
- package/components/apps/components/layout/AppDrawer.svelte +86 -0
- package/components/apps/components/layout/AppDrawer.svelte.d.ts +24 -0
- package/components/apps/components/layout/AppSplitpanes.svelte +83 -0
- package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +26 -0
- package/components/apps/components/layout/AppTabs.svelte +112 -40
- package/components/apps/components/layout/AppTabs.svelte.d.ts +4 -0
- package/components/apps/components/layout/index.d.ts +2 -0
- package/components/apps/components/layout/index.js +2 -0
- package/components/apps/editor/AppEditor.svelte +201 -132
- package/components/apps/editor/AppEditor.svelte.d.ts +3 -1
- package/components/apps/editor/AppEditorHeader.svelte +149 -66
- package/components/apps/editor/AppInputs.svelte +3 -3
- package/components/apps/editor/AppPreview.svelte +21 -7
- package/components/apps/editor/ComponentHeader.svelte +17 -4
- package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -0
- package/components/apps/editor/GridEditor.svelte +86 -70
- package/components/apps/editor/GridPanel.svelte +29 -0
- package/components/apps/editor/GridPanel.svelte.d.ts +18 -0
- package/components/apps/editor/RecomputeAllComponents.svelte +14 -6
- package/components/apps/editor/SettingsPanel.svelte +30 -27
- package/components/apps/editor/SubGridEditor.svelte +82 -50
- package/components/apps/editor/SubGridEditor.svelte.d.ts +8 -4
- package/components/apps/editor/appUtils.d.ts +22 -3
- package/components/apps/editor/appUtils.js +221 -47
- package/components/apps/editor/component/Component.svelte +281 -61
- package/components/apps/editor/component/Component.svelte.d.ts +3 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +170 -0
- package/components/apps/editor/component/ComponentNavigation.svelte.d.ts +14 -0
- package/components/apps/editor/component/components.d.ts +15 -3
- package/components/apps/editor/component/components.js +409 -54
- package/components/apps/editor/component/default-codes.js +6 -6
- package/components/apps/editor/component/sets.js +11 -3
- package/components/apps/editor/componentsPanel/ComponentList.svelte +72 -29
- package/components/apps/editor/componentsPanel/CssProperty.svelte +59 -23
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -1
- package/components/apps/editor/componentsPanel/CssSettings.svelte +56 -9
- package/components/apps/editor/componentsPanel/ListItem.svelte +23 -12
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.js +15 -2
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +77 -0
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +21 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +10 -6
- package/components/apps/editor/contextPanel/ContextPanel.svelte +81 -91
- package/components/apps/editor/contextPanel/SubGridOutput.svelte +71 -0
- package/components/apps/editor/contextPanel/SubGridOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +38 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +10 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +78 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +26 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +19 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +18 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +14 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +18 -0
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +55 -13
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +126 -62
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +5 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +11 -5
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +26 -17
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +95 -85
- package/components/apps/editor/inlineScriptsPanel/utils.d.ts +5 -9
- package/components/apps/editor/inlineScriptsPanel/utils.js +19 -8
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +10 -9
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +21 -12
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +119 -79
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/GridPane.svelte +75 -0
- package/components/apps/editor/settingsPanel/GridPane.svelte.d.ts +20 -0
- package/components/apps/editor/settingsPanel/GridTab.svelte +9 -17
- package/components/apps/editor/settingsPanel/GridTab.svelte.d.ts +2 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/Recompute.svelte +2 -1
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +7 -1
- package/components/apps/editor/settingsPanel/TableActions.svelte +30 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +2 -2
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +48 -0
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +2 -8
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +77 -41
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +2 -0
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +4 -1
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +54 -6
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte +7 -9
- package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte.d.ts +1 -1
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +1 -0
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +1 -1
- package/components/apps/inputType.d.ts +6 -5
- package/components/apps/rx.d.ts +6 -4
- package/components/apps/rx.js +36 -15
- package/components/apps/store.d.ts +6 -1
- package/components/apps/svelte-grid/Grid.svelte +171 -0
- package/components/apps/svelte-grid/Grid.svelte.d.ts +47 -0
- package/components/apps/svelte-grid/LICENSE +23 -0
- package/components/apps/svelte-grid/MoveResize.svelte +328 -0
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +46 -0
- package/components/apps/svelte-grid/types.d.ts +25 -0
- package/components/apps/svelte-grid/utils/container.d.ts +1 -0
- package/components/apps/svelte-grid/utils/container.js +4 -0
- package/components/apps/svelte-grid/utils/helper.d.ts +14 -0
- package/components/apps/svelte-grid/utils/helper.js +36 -0
- package/components/apps/svelte-grid/utils/item.d.ts +14 -0
- package/components/apps/svelte-grid/utils/item.js +192 -0
- package/components/apps/svelte-grid/utils/matrix.d.ts +6 -0
- package/components/apps/svelte-grid/utils/matrix.js +53 -0
- package/components/apps/svelte-grid/utils/other.d.ts +3 -0
- package/components/apps/svelte-grid/utils/other.js +30 -0
- package/components/apps/types.d.ts +21 -8
- package/components/apps/utils.d.ts +3 -3
- package/components/apps/utils.js +34 -56
- package/components/common/CloseButton.svelte +18 -0
- package/components/common/CloseButton.svelte.d.ts +27 -0
- package/components/common/badge/Badge.svelte +6 -1
- package/components/common/badge/Badge.svelte.d.ts +1 -0
- package/components/common/button/ButtonPopup.svelte +2 -0
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -0
- package/components/common/button/UndoRedo.svelte +32 -0
- package/components/common/button/UndoRedo.svelte.d.ts +20 -0
- package/components/common/drawer/Drawer.svelte +10 -4
- package/components/common/drawer/Drawer.svelte.d.ts +3 -1
- package/components/common/drawer/DrawerContent.svelte +2 -7
- package/components/common/fileInput/FileInput.svelte +47 -21
- package/components/common/fileInput/FileInput.svelte.d.ts +3 -1
- package/components/common/fileInput/model.d.ts +1 -0
- package/components/common/fileInput/model.js +1 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +1 -0
- package/components/common/languageIcons/JavaScript.svelte +11 -0
- package/components/common/languageIcons/JavaScript.svelte.d.ts +25 -0
- package/components/common/languageIcons/LanguageIcon.svelte +3 -1
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
- package/components/common/menu/Menu.svelte +3 -2
- package/components/common/menu/Menu.svelte.d.ts +2 -1
- package/components/common/modal/Modal.svelte +9 -4
- package/components/common/modal/Modal.svelte.d.ts +2 -0
- package/components/common/popup/Popup.svelte +2 -1
- package/components/common/popup/Popup.svelte.d.ts +9 -0
- package/components/common/table/AppRow.svelte +14 -8
- package/components/common/table/AppRow.svelte.d.ts +1 -0
- package/components/common/table/FlowRow.svelte +22 -12
- package/components/common/table/FlowRow.svelte.d.ts +1 -0
- package/components/common/table/ScriptRow.svelte +43 -14
- package/components/common/table/ScriptRow.svelte.d.ts +1 -0
- package/components/common/tabs/Tab.svelte +13 -5
- package/components/common/tabs/Tab.svelte.d.ts +6 -1
- package/components/common/tabs/Tabs.svelte +8 -6
- package/components/common/tabs/Tabs.svelte.d.ts +3 -1
- package/components/flows/FlowEditor.svelte +6 -4
- package/components/flows/common/FlowCardHeader.svelte +4 -1
- package/components/flows/content/BranchPredicateEditor.svelte +3 -4
- package/components/flows/content/CapturePayload.svelte +1 -2
- package/components/flows/content/FlowBranchesAllWrapper.svelte +1 -1
- package/components/flows/content/FlowConstants.svelte +7 -13
- package/components/flows/content/FlowEditorPanel.svelte +4 -3
- package/components/flows/content/FlowFailureModule.svelte +2 -1
- package/components/flows/content/FlowInput.svelte +4 -2
- package/components/flows/content/FlowLoop.svelte +3 -4
- package/components/flows/content/FlowModuleComponent.svelte +23 -11
- package/components/flows/content/FlowModuleEarlyStop.svelte +3 -1
- package/components/flows/content/FlowModuleHeader.svelte +26 -3
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleSleep.svelte +2 -2
- package/components/flows/content/FlowModuleWrapper.svelte +2 -8
- package/components/flows/content/FlowSchedules.svelte +1 -2
- package/components/flows/content/FlowSettings.svelte +17 -37
- package/components/flows/content/ScriptEditorDrawer.svelte +98 -0
- package/components/flows/content/ScriptEditorDrawer.svelte.d.ts +19 -0
- package/components/flows/flowState.d.ts +2 -3
- package/components/flows/flowState.js +1 -4
- package/components/flows/flowStateUtils.d.ts +7 -6
- package/components/flows/flowStateUtils.js +5 -9
- package/components/flows/flowStore.d.ts +5 -4
- package/components/flows/flowStore.js +5 -17
- package/components/flows/header/FlowImportExportMenu.svelte +2 -1
- package/components/flows/map/FlowConstantsItem.svelte +2 -2
- package/components/flows/map/FlowErrorHandlerItem.svelte +12 -13
- package/components/flows/map/FlowInputsItem.svelte +2 -3
- package/components/flows/map/FlowModuleSchemaItem.svelte +88 -91
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +3 -3
- package/components/flows/map/FlowModuleSchemaMap.svelte +164 -138
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -2
- package/components/flows/map/FlowSettingsItem.svelte +5 -4
- package/components/flows/map/InsertModuleButton.svelte +12 -10
- package/components/flows/map/InsertModuleButton.svelte.d.ts +1 -0
- package/components/flows/map/MapItem.svelte +176 -103
- package/components/flows/map/MapItem.svelte.d.ts +20 -2
- package/components/flows/map/VirtualItem.svelte +129 -0
- package/components/flows/map/VirtualItem.svelte.d.ts +44 -0
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/components/flows/pickers/WorkspaceScriptPicker.svelte +1 -1
- package/components/flows/previousResults.d.ts +1 -1
- package/components/flows/previousResults.js +32 -17
- package/components/flows/types.d.ts +13 -1
- package/components/flows/utils.js +1 -1
- package/components/graph/FlowGraph.svelte +227 -167
- package/components/graph/FlowGraph.svelte.d.ts +14 -1
- package/components/graph/model.d.ts +6 -36
- package/components/graph/model.js +1 -1
- package/components/graph/svelvet/LICENSE +21 -0
- package/components/graph/svelvet/collapsible/controllers/util.d.ts +15 -0
- package/components/graph/svelvet/collapsible/controllers/util.js +144 -0
- package/components/graph/svelvet/collapsible/models/Collapsible.d.ts +17 -0
- package/components/graph/svelvet/collapsible/models/Collapsible.js +25 -0
- package/components/graph/svelvet/collapsible/types/types.d.ts +8 -0
- package/components/graph/svelvet/collapsible/types/types.js +1 -0
- package/components/graph/svelvet/container/README.md +7 -0
- package/components/graph/svelvet/container/controllers/middleware.d.ts +18 -0
- package/components/graph/svelvet/container/controllers/middleware.js +101 -0
- package/components/graph/svelvet/container/views/GraphView.svelte +252 -0
- package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +25 -0
- package/components/graph/svelvet/container/views/Svelvet.svelte +131 -0
- package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +41 -0
- package/components/graph/svelvet/customCss/controllers/getCss.d.ts +2 -0
- package/components/graph/svelvet/customCss/controllers/getCss.js +57 -0
- package/components/graph/svelvet/d3/controllers/d3.d.ts +5 -0
- package/components/graph/svelvet/d3/controllers/d3.js +59 -0
- package/components/graph/svelvet/edges/controllers/anchorCbDev.d.ts +4 -0
- package/components/graph/svelvet/edges/controllers/anchorCbDev.js +92 -0
- package/components/graph/svelvet/edges/controllers/anchorCbUser.d.ts +57 -0
- package/components/graph/svelvet/edges/controllers/anchorCbUser.js +73 -0
- package/components/graph/svelvet/edges/controllers/util.d.ts +37 -0
- package/components/graph/svelvet/edges/controllers/util.js +72 -0
- package/components/graph/svelvet/edges/models/Anchor.d.ts +48 -0
- package/components/graph/svelvet/edges/models/Anchor.js +122 -0
- package/components/graph/svelvet/edges/models/Edge.d.ts +47 -0
- package/components/graph/svelvet/edges/models/Edge.js +107 -0
- package/components/graph/svelvet/edges/types/types.d.ts +18 -0
- package/components/graph/svelvet/edges/types/types.js +1 -0
- package/components/graph/svelvet/edges/views/Edges/BaseEdge.svelte +105 -0
- package/components/graph/svelvet/edges/views/Edges/BaseEdge.svelte.d.ts +18 -0
- package/components/graph/svelvet/edges/views/Edges/EdgeAnchor.svelte +12 -0
- package/components/graph/svelvet/edges/views/Edges/EdgeAnchor.svelte.d.ts +17 -0
- package/components/graph/svelvet/edges/views/Edges/EdgeText.svelte +43 -0
- package/components/graph/svelvet/edges/views/Edges/EdgeText.svelte.d.ts +17 -0
- package/components/graph/svelvet/edges/views/Edges/SimpleBezierEdge.svelte +137 -0
- package/components/graph/svelvet/edges/views/Edges/SimpleBezierEdge.svelte.d.ts +17 -0
- package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte +176 -0
- package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +60 -0
- package/components/graph/svelvet/edges/views/Edges/StepEdge.svelte +8 -0
- package/components/graph/svelvet/edges/views/Edges/StepEdge.svelte.d.ts +25 -0
- package/components/graph/svelvet/edges/views/Edges/types.d.ts +52 -0
- package/components/graph/svelvet/edges/views/Edges/types.js +1 -0
- package/components/graph/svelvet/edges/views/Edges/utils.d.ts +33 -0
- package/components/graph/svelvet/edges/views/Edges/utils.js +31 -0
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte +151 -0
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte.d.ts +20 -0
- package/components/graph/svelvet/nodes/controllers/util.d.ts +9 -0
- package/components/graph/svelvet/nodes/controllers/util.js +13 -0
- package/components/graph/svelvet/nodes/models/Node.d.ts +78 -0
- package/components/graph/svelvet/nodes/models/Node.js +195 -0
- package/components/graph/svelvet/nodes/views/EditNode.svelte +147 -0
- package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +33 -0
- package/components/graph/svelvet/nodes/views/Node.svelte +85 -0
- package/components/graph/svelvet/nodes/views/Node.svelte.d.ts +22 -0
- package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +11 -0
- package/components/graph/svelvet/resizableNodes/controllers/util.js +24 -0
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +33 -0
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +71 -0
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +81 -0
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte.d.ts +20 -0
- package/components/graph/svelvet/store/controllers/storeApi.d.ts +32 -0
- package/components/graph/svelvet/store/controllers/storeApi.js +111 -0
- package/components/graph/svelvet/store/controllers/userApi.d.ts +3 -0
- package/components/graph/svelvet/store/controllers/userApi.js +18 -0
- package/components/graph/svelvet/store/controllers/util.d.ts +31 -0
- package/components/graph/svelvet/store/controllers/util.js +180 -0
- package/components/graph/svelvet/store/models/store.d.ts +12 -0
- package/components/graph/svelvet/store/models/store.js +9 -0
- package/components/graph/svelvet/store/types/types.d.ts +134 -0
- package/components/graph/svelvet/store/types/types.js +1 -0
- package/components/graph/svelvet/types/README.md +3 -0
- package/components/graph/svelvet/types/index.d.ts +2 -0
- package/components/graph/svelvet/types/index.js +1 -0
- package/components/graph/svelvet/types/types.d.ts +49 -0
- package/components/graph/svelvet/types/types.js +18 -0
- package/components/graph/util.js +2 -2
- package/components/home/ItemsList.svelte +53 -5
- package/components/home/ItemsList.svelte.d.ts +1 -0
- package/components/home/ListFilters.svelte +7 -2
- package/components/jobs/JobDetail.svelte +12 -1
- package/components/propertyPicker/ObjectViewer.svelte +6 -4
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/consts.d.ts +1 -0
- package/consts.js +1 -0
- package/defaults.d.ts +4 -0
- package/defaults.js +4 -0
- package/history.d.ts +9 -0
- package/history.js +63 -0
- package/package.json +87 -9
- package/script_helpers.d.ts +1 -1
- package/script_helpers.js +1 -0
- package/scripts.d.ts +1 -1
- package/scripts.js +8 -1
- package/utils.d.ts +9 -4
- package/utils.js +43 -8
- package/components/apps/editor/TablePanel.svelte +0 -19
- package/components/apps/editor/TablePanel.svelte.d.ts +0 -17
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +0 -85
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +0 -18
- package/components/flows/map/FlowBranchAllMap.svelte +0 -100
- package/components/flows/map/FlowBranchAllMap.svelte.d.ts +0 -17
- package/components/flows/map/FlowBranchOneMap.svelte +0 -124
- package/components/flows/map/FlowBranchOneMap.svelte.d.ts +0 -17
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script>import { afterUpdate } from 'svelte';
|
|
2
|
+
import { findStore } from '../../store/controllers/storeApi';
|
|
3
|
+
import { forceCssHeightAndWidth } from '../../customCss/controllers/getCss';
|
|
4
|
+
export let node;
|
|
5
|
+
export let canvasId;
|
|
6
|
+
export let nodeId;
|
|
7
|
+
export let isCustom = false;
|
|
8
|
+
const store = findStore(canvasId);
|
|
9
|
+
const { lockedOption } = store;
|
|
10
|
+
// forceCssHeightAndWidth forces the size of the node to be defined by CSS
|
|
11
|
+
afterUpdate(() => {
|
|
12
|
+
if (node.className)
|
|
13
|
+
forceCssHeightAndWidth(store, node);
|
|
14
|
+
});
|
|
15
|
+
const mousedown = (e) => {
|
|
16
|
+
if (node.clickCallback)
|
|
17
|
+
node.clickCallback(node);
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<!-- on:wheel prevents page scroll when using mousewheel in the Node -->
|
|
22
|
+
<div
|
|
23
|
+
on:mousedown={mousedown}
|
|
24
|
+
on:touchstart={mousedown}
|
|
25
|
+
class="{isCustom ? 'CustomNode' : 'Node'} {node.className}"
|
|
26
|
+
style="left: {node.positionX}px;
|
|
27
|
+
top: {node.positionY}px;
|
|
28
|
+
width: {node.width}px;
|
|
29
|
+
height: {node.height}px;
|
|
30
|
+
{isCustom
|
|
31
|
+
? ''
|
|
32
|
+
: `
|
|
33
|
+
background-color: ${node.bgColor ?? 'white'};
|
|
34
|
+
border-color: ${node.borderColor};
|
|
35
|
+
border-radius: ${node.borderRadius}px;
|
|
36
|
+
color: ${node.textColor};
|
|
37
|
+
cursor: ${$lockedOption ? 'default' : 'grab'};`}"
|
|
38
|
+
id="svelvet-{node.id}"
|
|
39
|
+
>
|
|
40
|
+
<!-- This executes if node.image is present without node.label -->
|
|
41
|
+
{#if node.image}
|
|
42
|
+
<img
|
|
43
|
+
src={node.src}
|
|
44
|
+
alt=""
|
|
45
|
+
style="width: {node.width * 0.75}px;
|
|
46
|
+
height: {node.height * 0.75}px;
|
|
47
|
+
overflow: hidden;"
|
|
48
|
+
/>
|
|
49
|
+
{/if}
|
|
50
|
+
<slot />
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.CustomNode {
|
|
55
|
+
position: absolute;
|
|
56
|
+
display: grid;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
text-align: center;
|
|
61
|
+
pointer-events: auto;
|
|
62
|
+
box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.Node {
|
|
66
|
+
position: absolute;
|
|
67
|
+
display: grid;
|
|
68
|
+
-webkit-user-select: none;
|
|
69
|
+
-moz-user-select: none;
|
|
70
|
+
user-select: none;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
overscroll-behavior: auto;
|
|
73
|
+
align-items: center;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
text-align: center;
|
|
76
|
+
border: solid 1px black;
|
|
77
|
+
border-radius: 5px;
|
|
78
|
+
box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.2);
|
|
79
|
+
pointer-events: auto; /* this is needed for pointer events to work since we disable them in graphview */
|
|
80
|
+
}
|
|
81
|
+
/* the default behavior when click/dragging an image is to move it. This interferes with node dragging. We disable pointer events on img to prevent this */
|
|
82
|
+
/* Alternatively, we could use e.preventDefault() on mouseDown. However, this interferes with embedded Svelvet forms */
|
|
83
|
+
img {
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
}</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { NodeType } from '../../store/types/types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
node: NodeType;
|
|
6
|
+
canvasId: string;
|
|
7
|
+
nodeId: string;
|
|
8
|
+
isCustom?: boolean | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type NodeProps = typeof __propDef.props;
|
|
18
|
+
export type NodeEvents = typeof __propDef.events;
|
|
19
|
+
export type NodeSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Node extends SvelteComponentTyped<NodeProps, NodeEvents, NodeSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StoreType, ResizeNodeType } from '../../store/types/types';
|
|
2
|
+
/**
|
|
3
|
+
* Finds all resizeNodes that matches the conditions specified in the filter parameter from a Svelvet store and returns these resizeNodes in an array
|
|
4
|
+
*
|
|
5
|
+
* @param store The Svelvet store containing the state of a Svelvet component
|
|
6
|
+
* @param filter An object to specify conditions.
|
|
7
|
+
* @returns An array of resizeNode objects that matches the conditions specified in filter parameter
|
|
8
|
+
*/
|
|
9
|
+
export declare function getResizeNodes(store: StoreType, filter?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}): ResizeNodeType[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { get } from 'svelte/store';
|
|
2
|
+
/**
|
|
3
|
+
* Finds all resizeNodes that matches the conditions specified in the filter parameter from a Svelvet store and returns these resizeNodes in an array
|
|
4
|
+
*
|
|
5
|
+
* @param store The Svelvet store containing the state of a Svelvet component
|
|
6
|
+
* @param filter An object to specify conditions.
|
|
7
|
+
* @returns An array of resizeNode objects that matches the conditions specified in filter parameter
|
|
8
|
+
*/
|
|
9
|
+
export function getResizeNodes(store, filter) {
|
|
10
|
+
let resizeNodes = Object.values(get(store.resizeNodesStore));
|
|
11
|
+
// filter the array for elements that match filter
|
|
12
|
+
if (filter !== undefined) {
|
|
13
|
+
resizeNodes = resizeNodes.filter((resizeNode) => {
|
|
14
|
+
for (let filterKey in filter) {
|
|
15
|
+
const filterValue = filter[filterKey];
|
|
16
|
+
if (resizeNode[filterKey] !== filterValue)
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
// return list of anchors
|
|
23
|
+
return resizeNodes;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ResizeNodeType } from '../../store/types/types';
|
|
2
|
+
/** A ResizeNode class that implements ResizeNodeType interface
|
|
3
|
+
* @param {string} id The id of the ResizeNode
|
|
4
|
+
* @param {string} canvasId The canvasId of the Svelvet component that the instantiated ResizeNode will be on.
|
|
5
|
+
* @param {string} nodeId The id of the Node that the instantiated ResizedNode will be attached to.
|
|
6
|
+
* @param {number} positionX The X-axis position of the ResizeNode (left top corner of the ResizeNode)
|
|
7
|
+
* @param {number} positionY The Y-axis position of the ResizeNode (left top corner of the ResizeNode)
|
|
8
|
+
*/
|
|
9
|
+
export declare class ResizeNode implements ResizeNodeType {
|
|
10
|
+
id: string;
|
|
11
|
+
canvasId: string;
|
|
12
|
+
nodeId: string;
|
|
13
|
+
positionX: number;
|
|
14
|
+
positionY: number;
|
|
15
|
+
constructor(id: string, canvasId: string, nodeId: string, positionX: number, positionY: number);
|
|
16
|
+
/**
|
|
17
|
+
* setPosition will update the positionX and positionY of the ResizeNode. This will be invoked when the Node that this ResizeNode attached to is moving so that the ResizeNode will follow the Node.
|
|
18
|
+
*
|
|
19
|
+
* @param movementX The mouse movement value on the X-axis
|
|
20
|
+
* @param movementY The mouse movement value on the Y-axis
|
|
21
|
+
*/
|
|
22
|
+
setPosition(movementX: number, movementY: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* setPositionAndCascade will update the positionX and positionY of the ResizeNode and also cascade changes to related Node. This will be invoked when the user drags the ResizeNode so the position of the ResizeNode and the width and height of the Node would change accordingly.
|
|
25
|
+
* @param movementX The mouse movement value on the X-axis
|
|
26
|
+
* @param movementY The mouse movement value on the Y-axis
|
|
27
|
+
*/
|
|
28
|
+
setPositionAndCascade(movementX: number, movementY: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* delete is going to delete the ResizeNode from the resizeNodesStore.
|
|
31
|
+
*/
|
|
32
|
+
delete(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// import { writable, derived, get, readable } from 'svelte/store';
|
|
2
|
+
import { stores } from '../../store/models/store';
|
|
3
|
+
/** A ResizeNode class that implements ResizeNodeType interface
|
|
4
|
+
* @param {string} id The id of the ResizeNode
|
|
5
|
+
* @param {string} canvasId The canvasId of the Svelvet component that the instantiated ResizeNode will be on.
|
|
6
|
+
* @param {string} nodeId The id of the Node that the instantiated ResizedNode will be attached to.
|
|
7
|
+
* @param {number} positionX The X-axis position of the ResizeNode (left top corner of the ResizeNode)
|
|
8
|
+
* @param {number} positionY The Y-axis position of the ResizeNode (left top corner of the ResizeNode)
|
|
9
|
+
*/
|
|
10
|
+
export class ResizeNode {
|
|
11
|
+
id;
|
|
12
|
+
canvasId;
|
|
13
|
+
nodeId;
|
|
14
|
+
positionX;
|
|
15
|
+
positionY;
|
|
16
|
+
constructor(id, canvasId, nodeId, positionX, positionY) {
|
|
17
|
+
this.id = id;
|
|
18
|
+
this.canvasId = canvasId;
|
|
19
|
+
this.nodeId = nodeId;
|
|
20
|
+
this.positionX = positionX;
|
|
21
|
+
this.positionY = positionY;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* setPosition will update the positionX and positionY of the ResizeNode. This will be invoked when the Node that this ResizeNode attached to is moving so that the ResizeNode will follow the Node.
|
|
25
|
+
*
|
|
26
|
+
* @param movementX The mouse movement value on the X-axis
|
|
27
|
+
* @param movementY The mouse movement value on the Y-axis
|
|
28
|
+
*/
|
|
29
|
+
setPosition(movementX, movementY) {
|
|
30
|
+
this.positionX += movementX;
|
|
31
|
+
this.positionY += movementY;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* setPositionAndCascade will update the positionX and positionY of the ResizeNode and also cascade changes to related Node. This will be invoked when the user drags the ResizeNode so the position of the ResizeNode and the width and height of the Node would change accordingly.
|
|
35
|
+
* @param movementX The mouse movement value on the X-axis
|
|
36
|
+
* @param movementY The mouse movement value on the Y-axis
|
|
37
|
+
*/
|
|
38
|
+
setPositionAndCascade(movementX, movementY) {
|
|
39
|
+
//declare variables needed to interact with the corresponding node to this resize anchor
|
|
40
|
+
const nodeId = this.nodeId;
|
|
41
|
+
const { nodesStore } = stores[this.canvasId];
|
|
42
|
+
//Updates the width/height of the corresponding Node
|
|
43
|
+
nodesStore.update((nodes) => {
|
|
44
|
+
const node = nodes[nodeId];
|
|
45
|
+
//sets condition so node cannot be less than 20 px in width or height.
|
|
46
|
+
if (node.width + movementX > 20 && node.height + movementY > 20) {
|
|
47
|
+
//Updates position to this resizeNode anchor. Must be done within the update method so ensure the position doesn't change if the width goes below 20px
|
|
48
|
+
this.positionX += movementX;
|
|
49
|
+
this.positionY += movementY;
|
|
50
|
+
//setSizeFromMovement will then update the anchors position as the width & height changes
|
|
51
|
+
node.setSizeFromMovement(movementX, movementY);
|
|
52
|
+
}
|
|
53
|
+
return { ...nodes };
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* delete is going to delete the ResizeNode from the resizeNodesStore.
|
|
58
|
+
*/
|
|
59
|
+
delete() {
|
|
60
|
+
const store = stores[this.canvasId];
|
|
61
|
+
const { resizeNodesStore } = stores[this.canvasId];
|
|
62
|
+
resizeNodesStore.update((resizeNodes) => {
|
|
63
|
+
for (const resizeNodeId in resizeNodes) {
|
|
64
|
+
if (resizeNodes[resizeNodeId].id === this.id) {
|
|
65
|
+
delete resizeNodes[resizeNodeId];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { ...resizeNodes };
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script>import { findStore } from '../../store/controllers/storeApi';
|
|
2
|
+
import { writable, derived, get, readable } from 'svelte/store';
|
|
3
|
+
export let resizeId;
|
|
4
|
+
export let canvasId;
|
|
5
|
+
const store = findStore(canvasId);
|
|
6
|
+
const { resizeNodesStore, nodeSelected } = store;
|
|
7
|
+
let isSelected = false;
|
|
8
|
+
let reactResizeNode;
|
|
9
|
+
$: reactResizeNode = $resizeNodesStore[resizeId];
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<svelte:window
|
|
13
|
+
on:mousemove={(e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
if (isSelected) {
|
|
16
|
+
resizeNodesStore.update((resNode) => {
|
|
17
|
+
const newResNode = resNode[resizeId];
|
|
18
|
+
const d3Scale = get(store.d3Scale);
|
|
19
|
+
newResNode.setPositionAndCascade(
|
|
20
|
+
e.movementX / d3Scale,
|
|
21
|
+
e.movementY / d3Scale,
|
|
22
|
+
resizeId
|
|
23
|
+
);
|
|
24
|
+
return { ...resNode };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}}
|
|
28
|
+
on:mouseup={(e) => {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
// don't need to set $nodeSelected = false because Node component will do it for you
|
|
31
|
+
isSelected = false;
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
on:mousedown={(e) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
$nodeSelected = true;
|
|
39
|
+
isSelected = true;
|
|
40
|
+
}}
|
|
41
|
+
on:mouseover={(e) => ($nodeSelected = true)}
|
|
42
|
+
on:focus
|
|
43
|
+
on:mouseleave={(e) => ($nodeSelected = false)}
|
|
44
|
+
on:mouseenter={(e) => ($nodeSelected = true)}
|
|
45
|
+
on:wheel|preventDefault
|
|
46
|
+
class="ResizeNode"
|
|
47
|
+
style="
|
|
48
|
+
left: {reactResizeNode.positionX - 10}px;
|
|
49
|
+
top: {reactResizeNode.positionY - 10}px;
|
|
50
|
+
width: {20}px;
|
|
51
|
+
height: {20}px;
|
|
52
|
+
background-color: purple;
|
|
53
|
+
border-color: purple;
|
|
54
|
+
border-radius: 50%;"
|
|
55
|
+
id="svelvet-{resizeId}"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.ResizeNode {
|
|
60
|
+
position: absolute;
|
|
61
|
+
display: grid;
|
|
62
|
+
-webkit-user-select: none;
|
|
63
|
+
-moz-user-select: none;
|
|
64
|
+
user-select: none;
|
|
65
|
+
cursor: move;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
overscroll-behavior: auto;
|
|
68
|
+
align-items: center;
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
text-align: center;
|
|
71
|
+
border: solid 1px black;
|
|
72
|
+
border-radius: 5px;
|
|
73
|
+
box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.2);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
pointer-events: auto; /* this is needed for pointer events to work since we disable them in graphview */
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ResizeNode:hover {
|
|
79
|
+
cursor: nwse-resize;
|
|
80
|
+
opacity: 0.5;
|
|
81
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
resizeId: string;
|
|
5
|
+
canvasId: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
focus: FocusEvent;
|
|
9
|
+
wheel: WheelEvent;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type ResizeNodeProps = typeof __propDef.props;
|
|
16
|
+
export type ResizeNodeEvents = typeof __propDef.events;
|
|
17
|
+
export type ResizeNodeSlots = typeof __propDef.slots;
|
|
18
|
+
export default class ResizeNode extends SvelteComponentTyped<ResizeNodeProps, ResizeNodeEvents, ResizeNodeSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoreType } from '../types/types';
|
|
2
|
+
import type { UserNodeType, UserEdgeType } from '../../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* findStore is going to return the target Svelvet store with the canvasId provided as argument.
|
|
5
|
+
* There can be multiple Svelvet canvases on the same page, and each has their own store with a unique canvasId.
|
|
6
|
+
* @param canvasId The canvasId of a Svelvet component
|
|
7
|
+
* @returns The store of a Svelvet component that matches the canvasId
|
|
8
|
+
*/
|
|
9
|
+
export declare function findStore(canvasId: string): StoreType;
|
|
10
|
+
/**
|
|
11
|
+
* createStoreEmpty will initialize a new Svelvet store with a unique canvasId.
|
|
12
|
+
* If you have multiple Svelvet components on the page, the stores object will look like the following example:
|
|
13
|
+
* const stores = \{
|
|
14
|
+
* canvasId-1: store of Svelvet component 1,
|
|
15
|
+
* canvasId-2: store of Svelvet component 2,
|
|
16
|
+
* canvasId-3: store of Svelvet component 3,
|
|
17
|
+
* \}
|
|
18
|
+
* Notes: This should be called once every time you initialize a new Svelvet canvas, (ie, only in the Svelvet.svelte file).
|
|
19
|
+
* This function will initialize an empty store for the Svelvet component and should be followed by invoking populateSvelvetStoreFromUserInput to populate all the initial state from the user input.
|
|
20
|
+
*
|
|
21
|
+
* @param canvasId The canvasId of the newly created Svelvet component
|
|
22
|
+
* @returns An empty store for the newly created Svelvet component.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createStoreEmpty(canvasId: string): StoreType;
|
|
25
|
+
/**
|
|
26
|
+
* populateSvelvetStoreFromUserInput will populate all the states and set these states into the Svelvet store initialized by invoking createStoreEmpty
|
|
27
|
+
*
|
|
28
|
+
* @param canvasId The canvasId of the Svelvet component you are creating a store for
|
|
29
|
+
* @param nodes This is an array of objects containing node info that is defined by the user. NOTE THAT THE STRUCTURE DIFFERS FROM THE NODES CLASS. The whole point of populateSvelvetStoreFromUserInput is to convert nodes into proper Svelvet Node objects. An example of nodes is in $routes/testingplayground/index.svelte
|
|
30
|
+
* @param edges Same as nodes, this is an array of objects containing edge info THAT IS DIFFERENT FROM THE EDGE CLASS.
|
|
31
|
+
*/
|
|
32
|
+
export declare function populateSvelvetStoreFromUserInput(canvasId: string, nodes: UserNodeType[], edges: UserEdgeType[]): void;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Important functions (in order of how likely I think you are to use them):
|
|
5
|
+
|
|
6
|
+
findStore(canvasId: string)
|
|
7
|
+
- Input: canvasId. There can be multiple Svelvet canvases on the same page, and each has their own store
|
|
8
|
+
- Returns: store
|
|
9
|
+
- Notes: You will need to call this function on every component you make
|
|
10
|
+
|
|
11
|
+
getNodes(store, filter)
|
|
12
|
+
- Description: this function returns of list of Node objects
|
|
13
|
+
- Input: store: the store where you get the list of Node objects from
|
|
14
|
+
- filter: an object where you can filter the array. For example, if you want to find nodes with an id of 'sdf-2d3fs' and positionX=35, then you
|
|
15
|
+
would set filter = {id: 'sdf-2d3fs, positionX: 35}.
|
|
16
|
+
Right now, you can only test for equality.
|
|
17
|
+
- Notes: This is a very mongoose way of retrieving information. Given the relational nature of our stores, maybe it would be better to use an SQL-like syntax
|
|
18
|
+
This array is non-reactive (ie, you cannot use information from this array to force a re-render of a Svelte component)
|
|
19
|
+
|
|
20
|
+
createStoreEmpty(canvasId: string)
|
|
21
|
+
- Input: canvasId.
|
|
22
|
+
- Returns: store
|
|
23
|
+
- Notes. This should be called once every time you initialize a new Svelvet canvas, (ie, only in the Svelvet.svelte file)
|
|
24
|
+
|
|
25
|
+
populateSvelvetStoreFromUserInput(canvasId, nodes, edges)
|
|
26
|
+
- canvasId: this the the canvasId of the Svelvet component you are creating a store for
|
|
27
|
+
- nodes: this is an array of objects containing node info that is defined by the user. NOTE THAT THE STRUCTURE DIFFERS FROM THE NODES CLASS
|
|
28
|
+
The whole point of populateSvelvetStoreFromUserInput is to convert nodes into proper Svelvet Node objects. An example of nodes is in
|
|
29
|
+
$routes/testingplayground/index.svelte
|
|
30
|
+
- edges: same as nodes, this is an array of objects containing edge info THAT IS DIFFERENT FROM THE EDGE CLASS.
|
|
31
|
+
- Returns: store
|
|
32
|
+
*/
|
|
33
|
+
import { stores } from '../models/store';
|
|
34
|
+
import { writable, get } from 'svelte/store';
|
|
35
|
+
import { populateAnchorsStore, populateNodesStore, populateEdgesStore, populateResizeNodeStore, } from './util';
|
|
36
|
+
import { populateCollapsibleStore } from '../../collapsible/controllers/util';
|
|
37
|
+
/**
|
|
38
|
+
* findStore is going to return the target Svelvet store with the canvasId provided as argument.
|
|
39
|
+
* There can be multiple Svelvet canvases on the same page, and each has their own store with a unique canvasId.
|
|
40
|
+
* @param canvasId The canvasId of a Svelvet component
|
|
41
|
+
* @returns The store of a Svelvet component that matches the canvasId
|
|
42
|
+
*/
|
|
43
|
+
export function findStore(canvasId) {
|
|
44
|
+
return stores[canvasId];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* createStoreEmpty will initialize a new Svelvet store with a unique canvasId.
|
|
48
|
+
* If you have multiple Svelvet components on the page, the stores object will look like the following example:
|
|
49
|
+
* const stores = \{
|
|
50
|
+
* canvasId-1: store of Svelvet component 1,
|
|
51
|
+
* canvasId-2: store of Svelvet component 2,
|
|
52
|
+
* canvasId-3: store of Svelvet component 3,
|
|
53
|
+
* \}
|
|
54
|
+
* Notes: This should be called once every time you initialize a new Svelvet canvas, (ie, only in the Svelvet.svelte file).
|
|
55
|
+
* This function will initialize an empty store for the Svelvet component and should be followed by invoking populateSvelvetStoreFromUserInput to populate all the initial state from the user input.
|
|
56
|
+
*
|
|
57
|
+
* @param canvasId The canvasId of the newly created Svelvet component
|
|
58
|
+
* @returns An empty store for the newly created Svelvet component.
|
|
59
|
+
*/
|
|
60
|
+
export function createStoreEmpty(canvasId) {
|
|
61
|
+
stores[canvasId] = {
|
|
62
|
+
nodesStore: writable({}),
|
|
63
|
+
edgesStore: writable({}),
|
|
64
|
+
anchorsStore: writable({}),
|
|
65
|
+
resizeNodesStore: writable({}),
|
|
66
|
+
potentialAnchorsStore: writable({}),
|
|
67
|
+
widthStore: writable(600),
|
|
68
|
+
heightStore: writable(600),
|
|
69
|
+
backgroundStore: writable(false),
|
|
70
|
+
movementStore: writable(true),
|
|
71
|
+
nodeSelected: writable(false),
|
|
72
|
+
nodeIdSelected: writable(-1),
|
|
73
|
+
d3Scale: writable(1),
|
|
74
|
+
options: writable({}),
|
|
75
|
+
temporaryEdgeStore: writable([]),
|
|
76
|
+
nodeCreate: writable(false),
|
|
77
|
+
boundary: writable(false),
|
|
78
|
+
edgeEditModal: writable(null),
|
|
79
|
+
collapsibleStore: writable([]),
|
|
80
|
+
collapsibleOption: writable(false),
|
|
81
|
+
lockedOption: writable(false),
|
|
82
|
+
editableOption: writable(false),
|
|
83
|
+
d3ZoomParameters: writable({}),
|
|
84
|
+
resizableOption: writable(true),
|
|
85
|
+
highlightEdgesOption: writable(true), // option to turn on/off highlightable edges
|
|
86
|
+
};
|
|
87
|
+
return stores[canvasId];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* populateSvelvetStoreFromUserInput will populate all the states and set these states into the Svelvet store initialized by invoking createStoreEmpty
|
|
91
|
+
*
|
|
92
|
+
* @param canvasId The canvasId of the Svelvet component you are creating a store for
|
|
93
|
+
* @param nodes This is an array of objects containing node info that is defined by the user. NOTE THAT THE STRUCTURE DIFFERS FROM THE NODES CLASS. The whole point of populateSvelvetStoreFromUserInput is to convert nodes into proper Svelvet Node objects. An example of nodes is in $routes/testingplayground/index.svelte
|
|
94
|
+
* @param edges Same as nodes, this is an array of objects containing edge info THAT IS DIFFERENT FROM THE EDGE CLASS.
|
|
95
|
+
*/
|
|
96
|
+
export function populateSvelvetStoreFromUserInput(canvasId, nodes, edges) {
|
|
97
|
+
// find the store
|
|
98
|
+
const store = findStore(canvasId);
|
|
99
|
+
// populate store.nodesStore with user nodes
|
|
100
|
+
populateNodesStore(store, nodes, canvasId);
|
|
101
|
+
// populate store.anchorsStore with anchors. Note the userdoes not explictly define anchors; anchors are calculated from the edges
|
|
102
|
+
populateAnchorsStore(store, nodes, edges, canvasId);
|
|
103
|
+
// populate edges
|
|
104
|
+
populateEdgesStore(store, edges, canvasId);
|
|
105
|
+
//populate resize Store
|
|
106
|
+
if (get(store.resizableOption))
|
|
107
|
+
populateResizeNodeStore(store, nodes, canvasId);
|
|
108
|
+
// populatate collapsible objects if "collapsible" feature is turned on
|
|
109
|
+
if (get(store.collapsibleOption))
|
|
110
|
+
populateCollapsibleStore(store, nodes, edges, canvasId);
|
|
111
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { findStore } from './storeApi';
|
|
2
|
+
import { get } from 'svelte/store';
|
|
3
|
+
export function getD3PositionX(canvasId) {
|
|
4
|
+
const store = findStore(canvasId);
|
|
5
|
+
const width = get(store.widthStore);
|
|
6
|
+
const x = width / 2 - get(store.d3ZoomParameters).x; // user input is shifted so that x=0, y=0 occurs in the center
|
|
7
|
+
return x;
|
|
8
|
+
}
|
|
9
|
+
export function getD3PositionY(canvasId) {
|
|
10
|
+
const store = findStore(canvasId);
|
|
11
|
+
const height = get(store.heightStore);
|
|
12
|
+
const y = height / 2 - get(store.d3ZoomParameters).y; // user input is shifted so that x=0, y=0 occurs in the center
|
|
13
|
+
return y;
|
|
14
|
+
}
|
|
15
|
+
export function getD3Zoom(canvasId) {
|
|
16
|
+
const store = findStore(canvasId);
|
|
17
|
+
return get(store.d3ZoomParameters).k;
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StoreType } from '../types/types';
|
|
2
|
+
import type { UserNodeType, UserEdgeType } from '../../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* Populates edgesStore of Edges. This function does not return the edgesStore. Instead it sets the nodesStore of Svelvet store.
|
|
5
|
+
* @param store An object containing the state of the Svelvet component. You can access the following through `store`: nodesStore, edgesStore, anchorsStore, etc.
|
|
6
|
+
* @param edges An edge that the user specifies. This is NOT the same as a Edge object.
|
|
7
|
+
* @param canvasId The canvasId of the Svelvet component that holds the Edges
|
|
8
|
+
*/
|
|
9
|
+
export declare function populateEdgesStore(store: StoreType, edges: UserEdgeType[], canvasId: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Populates the anchorsStore. This will overwrite any data in the AnchorsStore.
|
|
12
|
+
* @param store The Svelvet store containing the state of the Svelvet component
|
|
13
|
+
* @param nodes An array of user specified nodes
|
|
14
|
+
* @param edges An array of user specified edges
|
|
15
|
+
* @param canvasId The canvasId of the Svelvet component that holds the nodes and edges
|
|
16
|
+
*/
|
|
17
|
+
export declare function populateAnchorsStore(store: StoreType, nodes: UserNodeType[], edges: UserEdgeType[], canvasId: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Populates the nodesStore. This will overwrite any data in the nodesStore.
|
|
20
|
+
* @param store The Svelvet store containing the state of the Svelvet component
|
|
21
|
+
* @param nodes An array of user specifed nodes
|
|
22
|
+
* @param canvasId The canvasId of the Svelvet component that holds the nodes
|
|
23
|
+
*/
|
|
24
|
+
export declare function populateNodesStore(store: StoreType, nodes: UserNodeType[], canvasId: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Populates the resizeNodeStore. If a Node is resizable, a small ResizeNode object is going to be attached to the Node's right bottom corner to react to the mouse drag.
|
|
27
|
+
* @param store The Svelvet store containing the state of the Svelvet component
|
|
28
|
+
* @param nodes An array of user specifed nodes (NOT the same as Node)
|
|
29
|
+
* @param canvasId The canvasId of the Svelvet component that holds the resizeNodes
|
|
30
|
+
*/
|
|
31
|
+
export declare function populateResizeNodeStore(store: StoreType, nodes: UserNodeType[], canvasId: string): void;
|