@flowdrop/flowdrop 2.11.0 → 2.13.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/CHANGELOG.md +233 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +18 -36
- package/dist/adapters/agentspec/autoLayout.js +75 -93
- package/dist/chat/activity.d.ts +49 -0
- package/dist/chat/activity.js +65 -0
- package/dist/chat/commandClassifier.js +2 -1
- package/dist/commands/executor.js +186 -27
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/parser.js +43 -3
- package/dist/commands/session.d.ts +60 -0
- package/dist/commands/session.js +332 -0
- package/dist/commands/storeIntegration.svelte.js +18 -1
- package/dist/commands/types.d.ts +77 -4
- package/dist/components/App.svelte +976 -226
- package/dist/components/App.svelte.d.ts +34 -2
- package/dist/components/BindablePortListbox.svelte +68 -369
- package/dist/components/Button.svelte +17 -14
- package/dist/components/Button.svelte.d.ts +2 -2
- package/dist/components/CanvasContextMenu.svelte +31 -10
- package/dist/components/CanvasController.svelte +146 -3
- package/dist/components/CanvasController.svelte.d.ts +25 -33
- package/dist/components/CanvasIconButton.svelte +6 -6
- package/dist/components/CanvasToolbar.svelte +103 -0
- package/dist/components/CanvasToolbar.svelte.d.ts +23 -0
- package/dist/components/CanvasZoomControls.svelte +122 -0
- package/dist/components/CanvasZoomControls.svelte.d.ts +15 -0
- package/dist/components/ConfigForm.svelte +159 -121
- package/dist/components/ConfigModal.svelte +11 -54
- package/dist/components/ConfigPanel.svelte +98 -228
- package/dist/components/ConfigPanel.svelte.d.ts +2 -2
- package/dist/components/ConnectPortPicker.svelte +153 -0
- package/dist/components/ConnectPortPicker.svelte.d.ts +22 -0
- package/dist/components/DoctorMenu.svelte +422 -0
- package/dist/components/DoctorMenu.svelte.d.ts +7 -0
- package/dist/components/ExternalLinkRow.svelte +82 -0
- package/dist/components/ExternalLinkRow.svelte.d.ts +14 -0
- package/dist/components/FlowDropEdge.svelte +52 -2
- package/dist/components/FlowDropEdge.svelte.d.ts +5 -1
- package/dist/components/InterfaceNameInput.svelte +103 -0
- package/dist/components/InterfaceNameInput.svelte.d.ts +13 -0
- package/dist/components/InterfaceTag.svelte +215 -0
- package/dist/components/InterfaceTag.svelte.d.ts +20 -0
- package/dist/components/InterfaceTagAnchor.svelte +103 -0
- package/dist/components/InterfaceTagAnchor.svelte.d.ts +12 -0
- package/dist/components/InterfaceTagLayer.svelte +314 -0
- package/dist/components/InterfaceTagLayer.svelte.d.ts +28 -0
- package/dist/components/LogsSidebar.svelte +43 -43
- package/dist/components/LoopbackLanes.svelte +54 -0
- package/dist/components/LoopbackLanes.svelte.d.ts +8 -0
- package/dist/components/Navbar.svelte +539 -169
- package/dist/components/Navbar.svelte.d.ts +20 -1
- package/dist/components/NodeInspector.svelte +153 -0
- package/dist/components/NodeInspector.svelte.d.ts +19 -0
- package/dist/components/NodeLastRun.svelte +212 -0
- package/dist/components/NodeLastRun.svelte.d.ts +13 -0
- package/dist/components/NodeSidebar.svelte +279 -23
- package/dist/components/NodeSidebar.svelte.d.ts +11 -0
- package/dist/components/NodeStatusOverlay.svelte +144 -353
- package/dist/components/NodeStatusOverlay.svelte.d.ts +4 -1
- package/dist/components/PortMappingRow.svelte +28 -44
- package/dist/components/PortPickerListbox.svelte +475 -0
- package/dist/components/PortPickerListbox.svelte.d.ts +73 -0
- package/dist/components/ReadOnlyDetails.svelte +52 -89
- package/dist/components/RunBar.svelte +222 -0
- package/dist/components/RunBar.svelte.d.ts +20 -0
- package/dist/components/RunsMenu.svelte +649 -0
- package/dist/components/RunsMenu.svelte.d.ts +14 -0
- package/dist/components/SettingsModal.svelte +27 -59
- package/dist/components/SettingsPanel.svelte +515 -241
- package/dist/components/StraightGuides.svelte +46 -0
- package/dist/components/StraightGuides.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.svelte +14 -4
- package/dist/components/UniversalNode.svelte +152 -51
- package/dist/components/WebMCPBridgeMenu.svelte +336 -0
- package/dist/components/WebMCPBridgeMenu.svelte.d.ts +3 -0
- package/dist/components/WorkflowEditor.svelte +789 -136
- package/dist/components/WorkflowEditor.svelte.d.ts +43 -1
- package/dist/components/WorkflowInterfaceEditor.svelte +63 -92
- package/dist/components/WorkflowInterfaceEntryCard.svelte +478 -549
- package/dist/components/WorkflowInterfaceEntryComposer.svelte +23 -67
- package/dist/components/WorkflowPlaygroundSettings.svelte +48 -85
- package/dist/components/WorkflowSettingsPanel.svelte +311 -0
- package/dist/components/WorkflowSettingsPanel.svelte.d.ts +20 -0
- package/dist/components/ZoomTier.svelte +56 -0
- package/dist/components/ZoomTier.svelte.d.ts +4 -0
- package/dist/components/chat/AIChatPanel.svelte +463 -312
- package/dist/components/chat/ActivityList.svelte +130 -0
- package/dist/components/chat/ActivityList.svelte.d.ts +11 -0
- package/dist/components/chat/ActivityRow.svelte +179 -0
- package/dist/components/chat/ActivityRow.svelte.d.ts +16 -0
- package/dist/components/chat/CommandPreview.svelte +42 -64
- package/dist/components/console/CommandConsole.svelte +106 -41
- package/dist/components/console/CommandConsole.svelte.d.ts +2 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +14 -13
- package/dist/components/console/ConsoleInput.svelte +60 -27
- package/dist/components/console/ConsoleOutput.svelte +86 -24
- package/dist/components/console/ConsoleStrip.svelte +80 -0
- package/dist/components/console/ConsoleStrip.svelte.d.ts +13 -0
- package/dist/components/form/FieldFactory.svelte +30 -4
- package/dist/components/form/FormArray.svelte +306 -339
- package/dist/components/form/FormArray.svelte.d.ts +10 -0
- package/dist/components/form/FormArrayRows.svelte +443 -0
- package/dist/components/form/FormArrayRows.svelte.d.ts +18 -0
- package/dist/components/form/FormAutocomplete.svelte +2 -2
- package/dist/components/form/FormCheckboxGroup.svelte +10 -85
- package/dist/components/form/FormCodeEditor.svelte +3 -3
- package/dist/components/form/FormFieldWrapper.svelte +98 -18
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +10 -0
- package/dist/components/form/FormFieldset.svelte +44 -28
- package/dist/components/form/FormMarkdownEditor.svelte +6 -6
- package/dist/components/form/FormPorts.svelte +437 -141
- package/dist/components/form/FormSelect.svelte +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +22 -26
- package/dist/components/form/FormToggle.svelte +15 -106
- package/dist/components/form/FormToggle.svelte.d.ts +3 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +38 -3
- package/dist/components/form/humanizeKey.d.ts +7 -0
- package/dist/components/form/humanizeKey.js +21 -0
- package/dist/components/form/types.d.ts +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte +8 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +51 -152
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +0 -2
- package/dist/components/interrupt/ConfirmationPrompt.svelte +18 -201
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +0 -4
- package/dist/components/interrupt/FormPrompt.svelte +22 -147
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +0 -4
- package/dist/components/interrupt/InterruptBubble.svelte +198 -355
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +0 -2
- package/dist/components/interrupt/ReviewPrompt.svelte +0 -10
- package/dist/components/interrupt/TextInputPrompt.svelte +23 -120
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +0 -2
- package/dist/components/layouts/MainLayout.svelte +110 -75
- package/dist/components/layouts/MainLayout.svelte.d.ts +17 -0
- package/dist/components/nodes/CaptionNode.svelte +7 -0
- package/dist/components/nodes/GatewayNode.svelte +66 -431
- package/dist/components/nodes/IdeaNode.svelte +6 -5
- package/dist/components/nodes/NodeCard.svelte +1051 -0
- package/dist/components/nodes/NodeCard.svelte.d.ts +30 -0
- package/dist/components/nodes/NodeConfigButton.svelte +28 -9
- package/dist/components/nodes/NodeProblemMark.svelte +113 -0
- package/dist/components/nodes/NodeProblemMark.svelte.d.ts +8 -0
- package/dist/components/nodes/NodeTip.svelte +104 -0
- package/dist/components/nodes/NodeTip.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +183 -150
- package/dist/components/nodes/SimpleNode.svelte +176 -44
- package/dist/components/nodes/SquareNode.svelte +127 -34
- package/dist/components/nodes/TerminalNode.svelte +232 -88
- package/dist/components/nodes/ToolNode.svelte +49 -381
- package/dist/components/nodes/WorkflowNode.svelte +40 -399
- package/dist/components/playground/ChatBubble.svelte +248 -62
- package/dist/components/playground/ChatInput.svelte +134 -297
- package/dist/components/playground/ChatInput.svelte.d.ts +17 -0
- package/dist/components/playground/ControlPanel.svelte +290 -190
- package/dist/components/playground/ControlPanel.svelte.d.ts +10 -2
- package/dist/components/playground/DockedPlayground.svelte +82 -0
- package/dist/components/playground/DockedPlayground.svelte.d.ts +30 -0
- package/dist/components/playground/ExecutionConsole.svelte +54 -36
- package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
- package/dist/components/playground/ExecutionLogs.svelte +4 -0
- package/dist/components/playground/HeaderMenu.svelte +170 -0
- package/dist/components/playground/HeaderMenu.svelte.d.ts +22 -0
- package/dist/components/playground/InputCollector.svelte +8 -32
- package/dist/components/playground/InputFields.svelte +246 -0
- package/dist/components/playground/InputFields.svelte.d.ts +16 -0
- package/dist/components/playground/InterfaceInputForm.svelte +285 -30
- package/dist/components/playground/InterfaceInputForm.svelte.d.ts +20 -0
- package/dist/components/playground/InterfaceJsonInput.svelte +92 -0
- package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +10 -0
- package/dist/components/playground/LogRow.svelte +12 -12
- package/dist/components/playground/MessageMarkdown.svelte +11 -11
- package/dist/components/playground/MessageStream.svelte +154 -182
- package/dist/components/playground/Playground.svelte +17 -1139
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +2 -1
- package/dist/components/playground/PlaygroundHeader.svelte +309 -0
- package/dist/components/playground/PlaygroundHeader.svelte.d.ts +22 -0
- package/dist/components/playground/PlaygroundModal.svelte +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +30 -32
- package/dist/components/playground/PlaygroundSurface.svelte +648 -0
- package/dist/components/playground/PlaygroundSurface.svelte.d.ts +79 -0
- package/dist/components/playground/StepsSummary.svelte +312 -0
- package/dist/components/playground/StepsSummary.svelte.d.ts +11 -0
- package/dist/components/playground/messageDisplay.d.ts +9 -0
- package/dist/components/playground/messageDisplay.js +24 -2
- package/dist/components/playground/stepSummary.d.ts +71 -0
- package/dist/components/playground/stepSummary.js +152 -0
- package/dist/components/ports/PortTypeBadge.svelte +13 -1
- package/dist/components/primitives/Button.svelte +226 -0
- package/dist/components/primitives/Button.svelte.d.ts +31 -0
- package/dist/components/primitives/Card.svelte +110 -0
- package/dist/components/primitives/Card.svelte.d.ts +20 -0
- package/dist/components/primitives/Checkbox.svelte +126 -0
- package/dist/components/primitives/Checkbox.svelte.d.ts +15 -0
- package/dist/components/primitives/Chip.svelte +143 -0
- package/dist/components/primitives/Chip.svelte.d.ts +22 -0
- package/dist/components/primitives/Combobox.svelte +444 -0
- package/dist/components/primitives/Combobox.svelte.d.ts +22 -0
- package/dist/components/primitives/Composer.svelte +293 -0
- package/dist/components/primitives/Composer.svelte.d.ts +47 -0
- package/dist/components/primitives/EmptyState.svelte +113 -0
- package/dist/components/primitives/EmptyState.svelte.d.ts +18 -0
- package/dist/components/primitives/Field.svelte +178 -0
- package/dist/components/primitives/Field.svelte.d.ts +30 -0
- package/dist/components/primitives/IconButton.svelte +156 -0
- package/dist/components/primitives/IconButton.svelte.d.ts +27 -0
- package/dist/components/primitives/Menu.svelte +435 -0
- package/dist/components/primitives/Menu.svelte.d.ts +61 -0
- package/dist/components/primitives/Notice.svelte +161 -0
- package/dist/components/primitives/Notice.svelte.d.ts +22 -0
- package/dist/components/primitives/PanelHeader.svelte +134 -0
- package/dist/components/primitives/PanelHeader.svelte.d.ts +23 -0
- package/dist/components/primitives/Segmented.svelte +198 -0
- package/dist/components/primitives/Segmented.svelte.d.ts +32 -0
- package/dist/components/primitives/Select.svelte +130 -0
- package/dist/components/primitives/Select.svelte.d.ts +26 -0
- package/dist/components/primitives/StatusPill.svelte +218 -0
- package/dist/components/primitives/StatusPill.svelte.d.ts +24 -0
- package/dist/components/primitives/Switch.svelte +113 -0
- package/dist/components/primitives/Switch.svelte.d.ts +14 -0
- package/dist/components/primitives/Tabs.svelte +209 -0
- package/dist/components/primitives/Tabs.svelte.d.ts +32 -0
- package/dist/components/primitives/Toolbar.svelte +94 -0
- package/dist/components/primitives/Toolbar.svelte.d.ts +14 -0
- package/dist/components/primitives/ToolbarSeparator.svelte +40 -0
- package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte +10 -40
- package/dist/components/surfaces/TabbedSurface.svelte +49 -39
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +8 -0
- package/dist/components/toast/DismissibleToast.svelte +94 -32
- package/dist/components/toast/DismissibleToast.svelte.d.ts +17 -7
- package/dist/config/endpoints.d.ts +43 -1
- package/dist/config/endpoints.js +21 -3
- package/dist/core/index.d.ts +8 -5
- package/dist/core/index.js +1 -1
- package/dist/editor/connectCandidates.d.ts +56 -0
- package/dist/editor/connectCandidates.js +131 -0
- package/dist/editor/contextMenu.d.ts +31 -2
- package/dist/editor/contextMenu.js +96 -9
- package/dist/editor/index.d.ts +4 -1
- package/dist/editor/index.js +1 -0
- package/dist/editor/interfaceMenu.d.ts +35 -0
- package/dist/editor/interfaceMenu.js +47 -0
- package/dist/editor/portMenu.d.ts +23 -0
- package/dist/editor/portMenu.js +34 -0
- package/dist/editor/tidy.d.ts +30 -0
- package/dist/editor/tidy.js +66 -0
- package/dist/helpers/workflowEditorHelper.d.ts +3 -0
- package/dist/helpers/workflowEditorHelper.js +8 -3
- package/dist/layout/fromWorkflow.d.ts +42 -0
- package/dist/layout/fromWorkflow.js +135 -0
- package/dist/layout/geometry.d.ts +102 -0
- package/dist/layout/geometry.js +317 -0
- package/dist/layout/index.d.ts +21 -0
- package/dist/layout/index.js +14 -0
- package/dist/layout/inspect.d.ts +18 -0
- package/dist/layout/inspect.js +81 -0
- package/dist/layout/lanePath.d.ts +23 -0
- package/dist/layout/lanePath.js +47 -0
- package/dist/layout/measure.d.ts +141 -0
- package/dist/layout/measure.js +477 -0
- package/dist/layout/primitives.d.ts +124 -0
- package/dist/layout/primitives.js +461 -0
- package/dist/layout/sweep.d.ts +59 -0
- package/dist/layout/sweep.js +257 -0
- package/dist/layout/toWorkflow.d.ts +43 -0
- package/dist/layout/toWorkflow.js +131 -0
- package/dist/layout/types.d.ts +93 -0
- package/dist/layout/types.js +35 -0
- package/dist/messages/defaults.d.ts +641 -26
- package/dist/messages/defaults.js +578 -25
- package/dist/messages/types.d.ts +21 -1
- package/dist/openapi/v1/openapi.yaml +109 -0
- package/dist/playground/index.d.ts +28 -1
- package/dist/playground/index.js +29 -0
- package/dist/playground/mount.d.ts +28 -2
- package/dist/playground/mount.js +41 -15
- package/dist/playground/runAction.d.ts +29 -0
- package/dist/playground/runAction.js +38 -0
- package/dist/services/doctorService.d.ts +52 -0
- package/dist/services/doctorService.js +113 -0
- package/dist/services/globalSave.js +12 -29
- package/dist/services/nodeExecutionService.d.ts +12 -1
- package/dist/services/nodeExecutionService.js +58 -58
- package/dist/services/playgroundService.d.ts +17 -2
- package/dist/services/playgroundService.js +48 -5
- package/dist/services/runsService.d.ts +42 -0
- package/dist/services/runsService.js +87 -0
- package/dist/services/toastQueue.d.ts +33 -0
- package/dist/services/toastQueue.js +38 -0
- package/dist/services/toastService.d.ts +30 -9
- package/dist/services/toastService.js +81 -46
- package/dist/settings/index.d.ts +1 -0
- package/dist/skins/graphite.d.ts +26 -0
- package/dist/skins/graphite.js +473 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/skins/slate.js +4 -4
- package/dist/stores/attachedRunStore.svelte.d.ts +35 -0
- package/dist/stores/attachedRunStore.svelte.js +47 -0
- package/dist/stores/connectDragStore.svelte.d.ts +39 -0
- package/dist/stores/connectDragStore.svelte.js +42 -0
- package/dist/stores/doctorStore.svelte.d.ts +79 -0
- package/dist/stores/doctorStore.svelte.js +244 -0
- package/dist/stores/editedNodesStore.svelte.d.ts +42 -0
- package/dist/stores/editedNodesStore.svelte.js +84 -0
- package/dist/stores/editorModeStore.svelte.d.ts +34 -0
- package/dist/stores/editorModeStore.svelte.js +55 -0
- package/dist/stores/instanceContainer.svelte.d.ts +53 -0
- package/dist/stores/instanceContainer.svelte.js +38 -1
- package/dist/stores/loopbackLanesStore.svelte.d.ts +18 -0
- package/dist/stores/loopbackLanesStore.svelte.js +25 -0
- package/dist/stores/nodeHighlightStore.svelte.d.ts +34 -0
- package/dist/stores/nodeHighlightStore.svelte.js +56 -0
- package/dist/stores/playgroundStore.svelte.d.ts +66 -2
- package/dist/stores/playgroundStore.svelte.js +164 -2
- package/dist/stores/runController.svelte.d.ts +382 -0
- package/dist/stores/runController.svelte.js +1217 -0
- package/dist/stores/settingsStore.svelte.d.ts +80 -18
- package/dist/stores/settingsStore.svelte.js +180 -62
- package/dist/stores/workflowStore.svelte.d.ts +14 -0
- package/dist/stores/workflowStore.svelte.js +22 -1
- package/dist/styles/base.css +286 -25
- package/dist/styles/fonts/Inter-LICENSE.txt +93 -0
- package/dist/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/styles/fonts/inter.css +19 -0
- package/dist/styles/toast.css +100 -20
- package/dist/styles/tokenAliases.js +118 -1
- package/dist/styles/tokens.css +586 -14
- package/dist/svelte-app.d.ts +47 -5
- package/dist/svelte-app.js +15 -3
- package/dist/themes/graphite.d.ts +2 -0
- package/dist/themes/graphite.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +22 -3
- package/dist/themes/minimal.js +10 -0
- package/dist/themes/scopedSkinCss.d.ts +22 -5
- package/dist/themes/scopedSkinCss.js +136 -11
- package/dist/types/chat.d.ts +6 -0
- package/dist/types/doctor.d.ts +82 -0
- package/dist/types/doctor.js +11 -0
- package/dist/types/events.d.ts +35 -0
- package/dist/types/events.js +4 -1
- package/dist/types/index.d.ts +17 -2
- package/dist/types/navbar.d.ts +36 -0
- package/dist/types/playground.d.ts +75 -0
- package/dist/types/settings.d.ts +120 -7
- package/dist/types/settings.js +35 -3
- package/dist/types/skin.d.ts +21 -8
- package/dist/types/theme.d.ts +40 -2
- package/dist/utils/appearance.d.ts +19 -0
- package/dist/utils/appearance.js +13 -0
- package/dist/utils/canvasFit.d.ts +41 -0
- package/dist/utils/canvasFit.js +44 -0
- package/dist/utils/chipTitles.d.ts +9 -0
- package/dist/utils/chipTitles.js +19 -0
- package/dist/utils/connections.js +8 -0
- package/dist/utils/consoleHighlight.d.ts +28 -0
- package/dist/utils/consoleHighlight.js +269 -0
- package/dist/utils/deprecation.d.ts +17 -0
- package/dist/utils/deprecation.js +29 -0
- package/dist/utils/doctorOperations.d.ts +40 -0
- package/dist/utils/doctorOperations.js +237 -0
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +40 -0
- package/dist/utils/inspectorContext.d.ts +19 -0
- package/dist/utils/inspectorContext.js +12 -0
- package/dist/utils/inspectorSections.d.ts +20 -0
- package/dist/utils/inspectorSections.js +44 -0
- package/dist/utils/inspectorSurface.d.ts +46 -0
- package/dist/utils/inspectorSurface.js +51 -0
- package/dist/utils/interfaceTags.d.ts +102 -0
- package/dist/utils/interfaceTags.js +211 -0
- package/dist/utils/itemRef.d.ts +86 -0
- package/dist/utils/itemRef.js +106 -0
- package/dist/utils/lastRun.d.ts +35 -0
- package/dist/utils/lastRun.js +73 -0
- package/dist/utils/messageNodeLink.d.ts +17 -0
- package/dist/utils/messageNodeLink.js +16 -0
- package/dist/utils/minimapVisibility.d.ts +28 -0
- package/dist/utils/minimapVisibility.js +34 -0
- package/dist/utils/nodeAriaLabel.d.ts +12 -0
- package/dist/utils/nodeAriaLabel.js +17 -0
- package/dist/utils/nodeFingerprint.d.ts +27 -0
- package/dist/utils/nodeFingerprint.js +66 -0
- package/dist/utils/nodeFormSchema.d.ts +10 -0
- package/dist/utils/nodeFormSchema.js +2 -2
- package/dist/utils/nodeGeometry.d.ts +168 -0
- package/dist/utils/nodeGeometry.js +204 -0
- package/dist/utils/nodeProblem.d.ts +19 -0
- package/dist/utils/nodeProblem.js +9 -0
- package/dist/utils/nodeStatus.d.ts +38 -3
- package/dist/utils/nodeStatus.js +67 -39
- package/dist/utils/nodeSwap.js +9 -1
- package/dist/utils/nodeWrapper.d.ts +1 -0
- package/dist/utils/playgroundHistory.d.ts +48 -0
- package/dist/utils/playgroundHistory.js +38 -0
- package/dist/utils/playgroundInputRuns.d.ts +26 -0
- package/dist/utils/playgroundInputRuns.js +50 -0
- package/dist/utils/portExposure.d.ts +49 -0
- package/dist/utils/portExposure.js +122 -0
- package/dist/utils/portUtils.d.ts +16 -0
- package/dist/utils/portUtils.js +37 -0
- package/dist/utils/portal.d.ts +0 -19
- package/dist/utils/portal.js +8 -1
- package/dist/utils/reservedPorts.d.ts +59 -0
- package/dist/utils/reservedPorts.js +60 -0
- package/dist/utils/runEdges.d.ts +24 -0
- package/dist/utils/runEdges.js +35 -0
- package/dist/utils/runsList.d.ts +69 -0
- package/dist/utils/runsList.js +134 -0
- package/dist/utils/selectOptions.d.ts +62 -0
- package/dist/utils/selectOptions.js +137 -0
- package/dist/utils/sessionRuns.d.ts +62 -0
- package/dist/utils/sessionRuns.js +123 -0
- package/dist/utils/sheetWidths.d.ts +29 -0
- package/dist/utils/sheetWidths.js +41 -0
- package/dist/utils/sidebarWidths.d.ts +34 -0
- package/dist/utils/sidebarWidths.js +47 -0
- package/dist/utils/straightWires.d.ts +73 -0
- package/dist/utils/straightWires.js +99 -0
- package/dist/utils/themeScope.svelte.d.ts +10 -0
- package/dist/utils/themeScope.svelte.js +80 -0
- package/dist/utils/wiredHandles.d.ts +10 -0
- package/dist/utils/wiredHandles.js +14 -0
- package/dist/utils/workflowDraft.d.ts +9 -0
- package/dist/utils/workflowDraft.js +39 -0
- package/dist/utils/workflowInterface.d.ts +40 -7
- package/dist/utils/workflowInterface.js +66 -16
- package/dist/utils/zoomTier.d.ts +43 -0
- package/dist/utils/zoomTier.js +107 -0
- package/dist/utils/zoomTierRows.d.ts +41 -0
- package/dist/utils/zoomTierRows.js +103 -0
- package/dist/webmcp/WebMCPConfirm.svelte +1 -1
- package/dist/webmcp/bridge.d.ts +5 -0
- package/dist/webmcp/bridge.js +8 -0
- package/dist/webmcp/bridgeController.svelte.d.ts +84 -0
- package/dist/webmcp/bridgeController.svelte.js +224 -0
- package/dist/webmcp/descriptors.d.ts +1 -1
- package/dist/webmcp/descriptors.js +66 -5
- package/dist/webmcp/fakeWidget.d.ts +34 -0
- package/dist/webmcp/fakeWidget.js +75 -0
- package/dist/webmcp/gate.js +4 -0
- package/dist/webmcp/index.d.ts +2 -0
- package/dist/webmcp/index.js +1 -0
- package/dist/webmcp/runtime.js +4 -1
- package/dist/webmcp/types.d.ts +2 -0
- package/dist/webmcp/validate.js +5 -1
- package/package.json +8 -2
- package/dist/components/Select.svelte +0 -53
- package/dist/components/Select.svelte.d.ts +0 -15
- package/dist/components/icons/CommandLineIcon.svelte +0 -15
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +0 -26
- package/dist/components/toast/WarningIcon.svelte +0 -28
- package/dist/components/toast/WarningIcon.svelte.d.ts +0 -26
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module stores/settingsStore
|
|
11
11
|
*/
|
|
12
|
-
import type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, PartialSettings, SyncStatus, ResolvedTheme, ThemePreference, SettingsChangeCallback, SettingsCategory } from '../types/settings.js';
|
|
13
|
-
export type { ThemePreference, ResolvedTheme } from '../types/settings.js';
|
|
12
|
+
import type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, PartialSettings, SyncStatus, ResolvedTheme, ThemePreference, ColorSchemeOption, HostColorSchemeValue, SettingsChangeCallback, SettingsCategory } from '../types/settings.js';
|
|
13
|
+
export type { ThemePreference, ResolvedTheme, ColorSchemeOption, HostColorSchemeValue } from '../types/settings.js';
|
|
14
14
|
/**
|
|
15
15
|
* Get current settings (replaces settingsStore derived store)
|
|
16
16
|
*/
|
|
@@ -44,15 +44,55 @@ export declare function getBehaviorSettings(): BehaviorSettings;
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function getApiSettings(): ApiSettings;
|
|
46
46
|
/**
|
|
47
|
-
* Get theme preference
|
|
47
|
+
* Get the theme preference in effect.
|
|
48
|
+
*
|
|
49
|
+
* `'host'` is only returned while a host colour scheme is registered
|
|
50
|
+
* ({@link setHostColorScheme}); a stored `'host'` without one is reported as
|
|
51
|
+
* `'auto'` so older or different hosts never see a choice that does not exist.
|
|
48
52
|
*/
|
|
49
53
|
export declare function getTheme(): ThemePreference;
|
|
50
54
|
/**
|
|
51
|
-
* Get resolved theme - the actual theme applied ('light' or 'dark')
|
|
52
|
-
*
|
|
53
|
-
*
|
|
55
|
+
* Get resolved theme - the actual theme applied ('light' or 'dark').
|
|
56
|
+
* 'auto' follows the operating system; 'host' follows the host's reported
|
|
57
|
+
* scheme, and when that is itself 'auto' the operating system as well
|
|
58
|
+
* (replaces resolvedTheme derived store).
|
|
54
59
|
*/
|
|
55
60
|
export declare function getResolvedTheme(): ResolvedTheme;
|
|
61
|
+
/**
|
|
62
|
+
* Pure resolution of a preference to the applied scheme.
|
|
63
|
+
*
|
|
64
|
+
* @param preference - The effective preference (a 'host' with no host value counts as 'auto')
|
|
65
|
+
* @param hostValue - What the host reports, or null when no host scheme is given
|
|
66
|
+
* @param system - The operating system's scheme
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveColorScheme(preference: ThemePreference, hostValue: HostColorSchemeValue | null, system: ResolvedTheme): ResolvedTheme;
|
|
69
|
+
/**
|
|
70
|
+
* What the host's colour scheme resolves to right now, for the "currently …"
|
|
71
|
+
* hint. Null when no host scheme is registered.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getHostColorScheme(): {
|
|
74
|
+
label: string;
|
|
75
|
+
value: HostColorSchemeValue;
|
|
76
|
+
resolved: ResolvedTheme;
|
|
77
|
+
} | null;
|
|
78
|
+
/**
|
|
79
|
+
* Register (or clear) the host colour scheme given through the `colorScheme`
|
|
80
|
+
* mount option. The scheme is page-wide like the rest of the settings, so the
|
|
81
|
+
* last registration wins. With `subscribe`, live host changes re-resolve.
|
|
82
|
+
*
|
|
83
|
+
* @param option - The mount option, or null/undefined to clear it
|
|
84
|
+
*/
|
|
85
|
+
export declare function setHostColorScheme(option: ColorSchemeOption | null | undefined): void;
|
|
86
|
+
/**
|
|
87
|
+
* The id of the current host colour scheme registration, for a mount to hand
|
|
88
|
+
* back to {@link releaseHostColorScheme} when it is destroyed.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getHostColorSchemeRegistration(): number;
|
|
91
|
+
/**
|
|
92
|
+
* Release the host colour scheme (and its `subscribe`) if `registration` is
|
|
93
|
+
* still the current one. A no-op when a later mount has registered its own.
|
|
94
|
+
*/
|
|
95
|
+
export declare function releaseHostColorScheme(registration: number): void;
|
|
56
96
|
/**
|
|
57
97
|
* Get system theme state (for internal use)
|
|
58
98
|
*/
|
|
@@ -83,6 +123,21 @@ export declare function seedUiDefaults(partial: Partial<UISettings>): void;
|
|
|
83
123
|
* @param partial - Partial settings to merge
|
|
84
124
|
*/
|
|
85
125
|
export declare function updateSettings(partial: PartialSettings): void;
|
|
126
|
+
/**
|
|
127
|
+
* Migration of a saved theme when a host colour scheme is given: a saved
|
|
128
|
+
* `'auto'` the user never chose (no `explicit` marker) becomes `'host'`; an
|
|
129
|
+
* explicit choice, and any saved Light or Dark, is kept.
|
|
130
|
+
*
|
|
131
|
+
* Heuristic, and why: the whole snapshot is persisted on every settings change,
|
|
132
|
+
* so a stored `'auto'` may only be the old default riding along with some other
|
|
133
|
+
* setting. The marker is set when the user changes the preference. Snapshots
|
|
134
|
+
* from before the marker existed carry none, so an `'auto'` the user did pick
|
|
135
|
+
* once moves to the host scheme a single time; picking Auto again sticks.
|
|
136
|
+
*
|
|
137
|
+
* @param raw - The persisted snapshot
|
|
138
|
+
* @param hasHost - Whether a host colour scheme is registered
|
|
139
|
+
*/
|
|
140
|
+
export declare function migrateSavedTheme(raw: Partial<FlowDropSettings>, hasHost: boolean): Partial<FlowDropSettings>;
|
|
86
141
|
/**
|
|
87
142
|
* Reset settings to defaults
|
|
88
143
|
*
|
|
@@ -101,7 +156,8 @@ export declare function setTheme(newTheme: ThemePreference): void;
|
|
|
101
156
|
*/
|
|
102
157
|
export declare function toggleTheme(): void;
|
|
103
158
|
/**
|
|
104
|
-
* Cycle through theme options: light -> dark -> auto
|
|
159
|
+
* Cycle through theme options: light -> dark -> host (or auto without a host
|
|
160
|
+
* scheme) -> light
|
|
105
161
|
*/
|
|
106
162
|
export declare function cycleTheme(): void;
|
|
107
163
|
/**
|
|
@@ -114,23 +170,20 @@ export declare function cleanupThemeSubscription(): void;
|
|
|
114
170
|
* Initialize the theme system
|
|
115
171
|
* Called on app startup; safe to call more than once (idempotent) — the
|
|
116
172
|
* mount functions call it before mounting and <App> calls it on mount so
|
|
117
|
-
* direct component embeds
|
|
118
|
-
*
|
|
119
|
-
* This function:
|
|
120
|
-
* 1. Applies the current resolved theme to the document
|
|
121
|
-
* 2. Sets up reactivity to apply theme changes
|
|
122
|
-
* 3. Subscribes to the system color-scheme so 'auto' tracks it live
|
|
173
|
+
* direct component embeds track the system scheme too.
|
|
123
174
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
175
|
+
* It subscribes to the system color-scheme so 'auto' tracks it live. It does
|
|
176
|
+
* not touch the document: the resolved scheme is `data-theme` on each editor's
|
|
177
|
+
* scope element (see utils/themeScope.ts), which is the source. Mounted editors
|
|
178
|
+
* also mirror it onto `<html data-theme>` as a deprecated 2.11.0 compatibility
|
|
179
|
+
* behaviour (removed in 3.0).
|
|
127
180
|
*/
|
|
128
181
|
export declare function initializeTheme(): void;
|
|
129
182
|
/**
|
|
130
183
|
* Check if theme system is initialized
|
|
131
184
|
* Useful for SSR scenarios
|
|
132
185
|
*
|
|
133
|
-
* @returns true
|
|
186
|
+
* @returns true once initializeTheme() has wired the system-scheme listener
|
|
134
187
|
*/
|
|
135
188
|
export declare function isThemeInitialized(): boolean;
|
|
136
189
|
/**
|
|
@@ -140,7 +193,11 @@ export declare function isThemeInitialized(): boolean;
|
|
|
140
193
|
*/
|
|
141
194
|
export declare function setSettingsService(service: {
|
|
142
195
|
savePreferences: (settings: FlowDropSettings) => Promise<void>;
|
|
143
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Returns the saved settings. A partial object is enough: anything missing (including
|
|
198
|
+
* settings added after 2.11.0) falls back to the defaults.
|
|
199
|
+
*/
|
|
200
|
+
getPreferences: () => Promise<FlowDropSettings | PartialSettings>;
|
|
144
201
|
} | null): void;
|
|
145
202
|
/**
|
|
146
203
|
* Sync current settings to the backend API
|
|
@@ -171,4 +228,9 @@ export declare function initializeSettings(options?: {
|
|
|
171
228
|
defaults?: PartialSettings;
|
|
172
229
|
/** Enable API sync on initialization */
|
|
173
230
|
apiSync?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* The host's colour scheme (mount option `colorScheme`). Makes `'host'` a
|
|
233
|
+
* preference and its default; see {@link ColorSchemeOption}.
|
|
234
|
+
*/
|
|
235
|
+
colorScheme?: ColorSchemeOption;
|
|
174
236
|
}): Promise<void>;
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module stores/settingsStore
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { untrack } from 'svelte';
|
|
13
|
+
import { DEFAULT_SETTINGS, SETTINGS_STORAGE_KEY, normalizeGridSize, normalizeLayoutGap } from '../types/settings.js';
|
|
14
|
+
import { DEFAULT_LAYOUT_GAP_X, DEFAULT_LAYOUT_GAP_Y } from '../layout/types.js';
|
|
13
15
|
import { logger } from '../utils/logger.js';
|
|
14
16
|
// =========================================================================
|
|
15
17
|
// Internal State
|
|
@@ -104,6 +106,13 @@ function deepMergeSettings(target, source) {
|
|
|
104
106
|
// Merge UI settings
|
|
105
107
|
if (source.ui) {
|
|
106
108
|
result.ui = { ...result.ui, ...source.ui };
|
|
109
|
+
// Per-tab widths merge key by key, so saving one tab keeps the other
|
|
110
|
+
if (source.ui.sidebarWidths) {
|
|
111
|
+
result.ui.sidebarWidths = { ...target.ui.sidebarWidths, ...source.ui.sidebarWidths };
|
|
112
|
+
}
|
|
113
|
+
if (source.ui.sheetWidths) {
|
|
114
|
+
result.ui.sheetWidths = { ...target.ui.sheetWidths, ...source.ui.sheetWidths };
|
|
115
|
+
}
|
|
107
116
|
}
|
|
108
117
|
// Merge behavior settings
|
|
109
118
|
if (source.behavior) {
|
|
@@ -113,6 +122,16 @@ function deepMergeSettings(target, source) {
|
|
|
113
122
|
if (source.api) {
|
|
114
123
|
result.api = { ...result.api, ...source.api };
|
|
115
124
|
}
|
|
125
|
+
// Grid size is 10 or 20 (D3): migrates any other stored value to 20.
|
|
126
|
+
if (result.editor.gridSize !== normalizeGridSize(result.editor.gridSize)) {
|
|
127
|
+
result.editor.gridSize = normalizeGridSize(result.editor.gridSize);
|
|
128
|
+
}
|
|
129
|
+
// Layout gaps: at least 0, a multiple of the grid.
|
|
130
|
+
result.editor.layoutGapX = normalizeLayoutGap(result.editor.layoutGapX, DEFAULT_LAYOUT_GAP_X);
|
|
131
|
+
result.editor.layoutGapY = normalizeLayoutGap(result.editor.layoutGapY, DEFAULT_LAYOUT_GAP_Y);
|
|
132
|
+
// `loopbackLanes` was a setting in pre-release builds; loopbacks are always return lanes now,
|
|
133
|
+
// so drop the stale key from saved settings.
|
|
134
|
+
delete result.editor.loopbackLanes;
|
|
116
135
|
return result;
|
|
117
136
|
}
|
|
118
137
|
// =========================================================================
|
|
@@ -137,6 +156,15 @@ let storeState = $state({
|
|
|
137
156
|
* Updates when system preference changes
|
|
138
157
|
*/
|
|
139
158
|
let systemThemeState = $state(typeof window !== 'undefined' ? getSystemTheme() : 'light');
|
|
159
|
+
/**
|
|
160
|
+
* The host's colour scheme (mount option `colorScheme.host`), or null.
|
|
161
|
+
* Its presence is what makes the 'host' preference exist.
|
|
162
|
+
*/
|
|
163
|
+
let hostScheme = $state(null);
|
|
164
|
+
let hostUnsubscribe = null;
|
|
165
|
+
// Which setHostColorScheme() call owns the registration; lets a mount release
|
|
166
|
+
// its own without clearing one a later mount registered.
|
|
167
|
+
let hostRegistration = 0;
|
|
140
168
|
// =========================================================================
|
|
141
169
|
// Getter Functions (replacing derived stores)
|
|
142
170
|
// =========================================================================
|
|
@@ -187,21 +215,93 @@ export function getApiSettings() {
|
|
|
187
215
|
return storeState.settings.api;
|
|
188
216
|
}
|
|
189
217
|
/**
|
|
190
|
-
* Get theme preference
|
|
218
|
+
* Get the theme preference in effect.
|
|
219
|
+
*
|
|
220
|
+
* `'host'` is only returned while a host colour scheme is registered
|
|
221
|
+
* ({@link setHostColorScheme}); a stored `'host'` without one is reported as
|
|
222
|
+
* `'auto'` so older or different hosts never see a choice that does not exist.
|
|
191
223
|
*/
|
|
192
224
|
export function getTheme() {
|
|
193
|
-
|
|
225
|
+
const preference = storeState.settings.theme.preference;
|
|
226
|
+
return preference === 'host' && !hostScheme ? 'auto' : preference;
|
|
194
227
|
}
|
|
195
228
|
/**
|
|
196
|
-
* Get resolved theme - the actual theme applied ('light' or 'dark')
|
|
197
|
-
*
|
|
198
|
-
*
|
|
229
|
+
* Get resolved theme - the actual theme applied ('light' or 'dark').
|
|
230
|
+
* 'auto' follows the operating system; 'host' follows the host's reported
|
|
231
|
+
* scheme, and when that is itself 'auto' the operating system as well
|
|
232
|
+
* (replaces resolvedTheme derived store).
|
|
199
233
|
*/
|
|
200
234
|
export function getResolvedTheme() {
|
|
201
|
-
|
|
202
|
-
|
|
235
|
+
return resolveColorScheme(getTheme(), hostScheme?.value ?? null, systemThemeState);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Pure resolution of a preference to the applied scheme.
|
|
239
|
+
*
|
|
240
|
+
* @param preference - The effective preference (a 'host' with no host value counts as 'auto')
|
|
241
|
+
* @param hostValue - What the host reports, or null when no host scheme is given
|
|
242
|
+
* @param system - The operating system's scheme
|
|
243
|
+
*/
|
|
244
|
+
export function resolveColorScheme(preference, hostValue, system) {
|
|
245
|
+
const value = preference;
|
|
246
|
+
const scheme = value === 'host' ? (hostValue ?? 'auto') : value;
|
|
247
|
+
return scheme === 'auto' ? system : scheme;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* What the host's colour scheme resolves to right now, for the "currently …"
|
|
251
|
+
* hint. Null when no host scheme is registered.
|
|
252
|
+
*/
|
|
253
|
+
export function getHostColorScheme() {
|
|
254
|
+
if (!hostScheme)
|
|
255
|
+
return null;
|
|
256
|
+
return {
|
|
257
|
+
label: hostScheme.label,
|
|
258
|
+
value: hostScheme.value,
|
|
259
|
+
resolved: hostScheme.value === 'auto' ? systemThemeState : hostScheme.value
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Register (or clear) the host colour scheme given through the `colorScheme`
|
|
264
|
+
* mount option. The scheme is page-wide like the rest of the settings, so the
|
|
265
|
+
* last registration wins. With `subscribe`, live host changes re-resolve.
|
|
266
|
+
*
|
|
267
|
+
* @param option - The mount option, or null/undefined to clear it
|
|
268
|
+
*/
|
|
269
|
+
export function setHostColorScheme(option) {
|
|
270
|
+
hostRegistration++;
|
|
271
|
+
hostUnsubscribe?.();
|
|
272
|
+
hostUnsubscribe = null;
|
|
273
|
+
const host = option?.host;
|
|
274
|
+
if (!host) {
|
|
275
|
+
hostScheme = null;
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
hostScheme = { label: host.label, value: host.value };
|
|
279
|
+
if (host.subscribe) {
|
|
280
|
+
try {
|
|
281
|
+
hostUnsubscribe = host.subscribe((value) => {
|
|
282
|
+
if (hostScheme)
|
|
283
|
+
hostScheme = { ...hostScheme, value };
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
logger.warn('colorScheme.host.subscribe failed:', error);
|
|
288
|
+
}
|
|
203
289
|
}
|
|
204
|
-
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The id of the current host colour scheme registration, for a mount to hand
|
|
293
|
+
* back to {@link releaseHostColorScheme} when it is destroyed.
|
|
294
|
+
*/
|
|
295
|
+
export function getHostColorSchemeRegistration() {
|
|
296
|
+
return hostRegistration;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Release the host colour scheme (and its `subscribe`) if `registration` is
|
|
300
|
+
* still the current one. A no-op when a later mount has registered its own.
|
|
301
|
+
*/
|
|
302
|
+
export function releaseHostColorScheme(registration) {
|
|
303
|
+
if (registration === hostRegistration)
|
|
304
|
+
setHostColorScheme(null);
|
|
205
305
|
}
|
|
206
306
|
/**
|
|
207
307
|
* Get system theme state (for internal use)
|
|
@@ -306,8 +406,19 @@ export function seedUiDefaults(partial) {
|
|
|
306
406
|
* @param partial - Partial settings to merge
|
|
307
407
|
*/
|
|
308
408
|
export function updateSettings(partial) {
|
|
409
|
+
// A write never subscribes its caller: an effect that calls this must not
|
|
410
|
+
// track the settings it reads to merge, or every update re-runs the effect.
|
|
411
|
+
untrack(() => applySettingsUpdate(partial));
|
|
412
|
+
}
|
|
413
|
+
function applySettingsUpdate(partial) {
|
|
309
414
|
const previousSettings = storeState.settings;
|
|
310
415
|
const newSettings = deepMergeSettings(storeState.settings, partial);
|
|
416
|
+
// A colour scheme the user picked is remembered as such, so a later default
|
|
417
|
+
// (the host scheme) never replaces it. See migrateSavedTheme().
|
|
418
|
+
if (partial.theme?.preference !== undefined &&
|
|
419
|
+
partial.theme.preference !== previousSettings.theme.preference) {
|
|
420
|
+
newSettings.theme = { ...newSettings.theme, explicit: true };
|
|
421
|
+
}
|
|
311
422
|
// Persist to localStorage immediately
|
|
312
423
|
saveToStorage(newSettings);
|
|
313
424
|
// Notify listeners for each changed category
|
|
@@ -328,6 +439,34 @@ export function updateSettings(partial) {
|
|
|
328
439
|
settings: newSettings
|
|
329
440
|
};
|
|
330
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* The library defaults, with the host colour scheme as the default preference
|
|
444
|
+
* when one is registered.
|
|
445
|
+
*/
|
|
446
|
+
function defaultSettings() {
|
|
447
|
+
return hostScheme
|
|
448
|
+
? { ...DEFAULT_SETTINGS, theme: { ...DEFAULT_SETTINGS.theme, preference: 'host' } }
|
|
449
|
+
: DEFAULT_SETTINGS;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Migration of a saved theme when a host colour scheme is given: a saved
|
|
453
|
+
* `'auto'` the user never chose (no `explicit` marker) becomes `'host'`; an
|
|
454
|
+
* explicit choice, and any saved Light or Dark, is kept.
|
|
455
|
+
*
|
|
456
|
+
* Heuristic, and why: the whole snapshot is persisted on every settings change,
|
|
457
|
+
* so a stored `'auto'` may only be the old default riding along with some other
|
|
458
|
+
* setting. The marker is set when the user changes the preference. Snapshots
|
|
459
|
+
* from before the marker existed carry none, so an `'auto'` the user did pick
|
|
460
|
+
* once moves to the host scheme a single time; picking Auto again sticks.
|
|
461
|
+
*
|
|
462
|
+
* @param raw - The persisted snapshot
|
|
463
|
+
* @param hasHost - Whether a host colour scheme is registered
|
|
464
|
+
*/
|
|
465
|
+
export function migrateSavedTheme(raw, hasHost) {
|
|
466
|
+
if (!hasHost || raw.theme?.preference !== 'auto' || raw.theme.explicit)
|
|
467
|
+
return raw;
|
|
468
|
+
return { ...raw, theme: { ...raw.theme, preference: 'host' } };
|
|
469
|
+
}
|
|
331
470
|
/**
|
|
332
471
|
* Reset settings to defaults
|
|
333
472
|
*
|
|
@@ -337,15 +476,16 @@ export function resetSettings(categories) {
|
|
|
337
476
|
if (categories && categories.length > 0) {
|
|
338
477
|
const partial = {};
|
|
339
478
|
for (const category of categories) {
|
|
340
|
-
partial[category] =
|
|
479
|
+
partial[category] = defaultSettings()[category];
|
|
341
480
|
}
|
|
342
481
|
updateSettings(partial);
|
|
343
482
|
}
|
|
344
483
|
else {
|
|
345
|
-
|
|
484
|
+
const defaults = defaultSettings();
|
|
485
|
+
saveToStorage(defaults);
|
|
346
486
|
storeState = {
|
|
347
487
|
...storeState,
|
|
348
|
-
settings:
|
|
488
|
+
settings: defaults
|
|
349
489
|
};
|
|
350
490
|
}
|
|
351
491
|
}
|
|
@@ -358,7 +498,7 @@ export function resetSettings(categories) {
|
|
|
358
498
|
* @param newTheme - The new theme preference ('light', 'dark', or 'auto')
|
|
359
499
|
*/
|
|
360
500
|
export function setTheme(newTheme) {
|
|
361
|
-
updateSettings({ theme: { preference: newTheme } });
|
|
501
|
+
updateSettings({ theme: { preference: newTheme, explicit: true } });
|
|
362
502
|
}
|
|
363
503
|
/**
|
|
364
504
|
* Toggle between light and dark themes
|
|
@@ -367,7 +507,7 @@ export function setTheme(newTheme) {
|
|
|
367
507
|
export function toggleTheme() {
|
|
368
508
|
const currentTheme = getTheme();
|
|
369
509
|
const currentResolved = getResolvedTheme();
|
|
370
|
-
if (currentTheme === 'auto') {
|
|
510
|
+
if (currentTheme === 'auto' || currentTheme === 'host') {
|
|
371
511
|
setTheme(currentResolved === 'dark' ? 'light' : 'dark');
|
|
372
512
|
}
|
|
373
513
|
else {
|
|
@@ -375,7 +515,8 @@ export function toggleTheme() {
|
|
|
375
515
|
}
|
|
376
516
|
}
|
|
377
517
|
/**
|
|
378
|
-
* Cycle through theme options: light -> dark -> auto
|
|
518
|
+
* Cycle through theme options: light -> dark -> host (or auto without a host
|
|
519
|
+
* scheme) -> light
|
|
379
520
|
*/
|
|
380
521
|
export function cycleTheme() {
|
|
381
522
|
const currentTheme = getTheme();
|
|
@@ -384,24 +525,14 @@ export function cycleTheme() {
|
|
|
384
525
|
setTheme('dark');
|
|
385
526
|
break;
|
|
386
527
|
case 'dark':
|
|
387
|
-
setTheme('auto');
|
|
528
|
+
setTheme(hostScheme ? 'host' : 'auto');
|
|
388
529
|
break;
|
|
389
530
|
case 'auto':
|
|
531
|
+
case 'host':
|
|
390
532
|
setTheme('light');
|
|
391
533
|
break;
|
|
392
534
|
}
|
|
393
535
|
}
|
|
394
|
-
/**
|
|
395
|
-
* Apply theme to the document
|
|
396
|
-
*
|
|
397
|
-
* @param resolved - The resolved theme to apply
|
|
398
|
-
*/
|
|
399
|
-
function applyTheme(resolved) {
|
|
400
|
-
if (typeof document === 'undefined') {
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
document.documentElement.setAttribute('data-theme', resolved);
|
|
404
|
-
}
|
|
405
536
|
/**
|
|
406
537
|
* Stored cleanup function for the theme effect.
|
|
407
538
|
* Retained so it can be called by cleanupThemeSubscription().
|
|
@@ -422,51 +553,30 @@ export function cleanupThemeSubscription() {
|
|
|
422
553
|
* Initialize the theme system
|
|
423
554
|
* Called on app startup; safe to call more than once (idempotent) — the
|
|
424
555
|
* mount functions call it before mounting and <App> calls it on mount so
|
|
425
|
-
* direct component embeds
|
|
426
|
-
*
|
|
427
|
-
* This function:
|
|
428
|
-
* 1. Applies the current resolved theme to the document
|
|
429
|
-
* 2. Sets up reactivity to apply theme changes
|
|
430
|
-
* 3. Subscribes to the system color-scheme so 'auto' tracks it live
|
|
556
|
+
* direct component embeds track the system scheme too.
|
|
431
557
|
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
558
|
+
* It subscribes to the system color-scheme so 'auto' tracks it live. It does
|
|
559
|
+
* not touch the document: the resolved scheme is `data-theme` on each editor's
|
|
560
|
+
* scope element (see utils/themeScope.ts), which is the source. Mounted editors
|
|
561
|
+
* also mirror it onto `<html data-theme>` as a deprecated 2.11.0 compatibility
|
|
562
|
+
* behaviour (removed in 3.0).
|
|
435
563
|
*/
|
|
436
564
|
export function initializeTheme() {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
// Already wired (theme is page-global) — don't stack effect roots or
|
|
440
|
-
// media-query listeners on repeated mounts.
|
|
565
|
+
// Already wired (the system scheme is page-global) — don't stack media-query
|
|
566
|
+
// listeners on repeated mounts.
|
|
441
567
|
if (themeEffectCleanup) {
|
|
442
568
|
return;
|
|
443
569
|
}
|
|
444
|
-
|
|
445
|
-
const stopThemeListener = initThemeListener();
|
|
446
|
-
// Create a standalone reactive root to watch for theme changes.
|
|
447
|
-
// $effect.root returns a cleanup function.
|
|
448
|
-
const stopEffectRoot = $effect.root(() => {
|
|
449
|
-
$effect(() => {
|
|
450
|
-
const currentResolved = getResolvedTheme();
|
|
451
|
-
applyTheme(currentResolved);
|
|
452
|
-
});
|
|
453
|
-
});
|
|
454
|
-
themeEffectCleanup = () => {
|
|
455
|
-
stopThemeListener();
|
|
456
|
-
stopEffectRoot();
|
|
457
|
-
};
|
|
570
|
+
themeEffectCleanup = initThemeListener();
|
|
458
571
|
}
|
|
459
572
|
/**
|
|
460
573
|
* Check if theme system is initialized
|
|
461
574
|
* Useful for SSR scenarios
|
|
462
575
|
*
|
|
463
|
-
* @returns true
|
|
576
|
+
* @returns true once initializeTheme() has wired the system-scheme listener
|
|
464
577
|
*/
|
|
465
578
|
export function isThemeInitialized() {
|
|
466
|
-
|
|
467
|
-
return false;
|
|
468
|
-
}
|
|
469
|
-
return document.documentElement.hasAttribute('data-theme');
|
|
579
|
+
return themeEffectCleanup !== null;
|
|
470
580
|
}
|
|
471
581
|
// =========================================================================
|
|
472
582
|
// API Sync Functions
|
|
@@ -587,10 +697,18 @@ export async function initializeSettings(options) {
|
|
|
587
697
|
// snapshot and re-saved it, which reset e.g. the user's dark-mode
|
|
588
698
|
// preference on every page load for hosts passing a `settings` mount
|
|
589
699
|
// option.
|
|
590
|
-
if (options
|
|
591
|
-
|
|
700
|
+
if (options && 'colorScheme' in options && options.colorScheme !== undefined) {
|
|
701
|
+
setHostColorScheme(options.colorScheme);
|
|
702
|
+
}
|
|
703
|
+
if (options?.defaults || options?.colorScheme) {
|
|
704
|
+
const hostDefaults = hostScheme && options.defaults?.theme?.preference === undefined
|
|
705
|
+
? { ...options.defaults, theme: { ...options.defaults?.theme, preference: 'host' } }
|
|
706
|
+
: options.defaults;
|
|
707
|
+
const seeded = deepMergeSettings(DEFAULT_SETTINGS, (hostDefaults ?? {}));
|
|
592
708
|
const raw = loadRawFromStorage();
|
|
593
|
-
const withDefaults = raw
|
|
709
|
+
const withDefaults = raw
|
|
710
|
+
? deepMergeSettings(seeded, migrateSavedTheme(raw, hostScheme !== null))
|
|
711
|
+
: seeded;
|
|
594
712
|
storeState = {
|
|
595
713
|
...storeState,
|
|
596
714
|
settings: withDefaults
|
|
@@ -15,6 +15,7 @@ import type { WorkflowChangeType } from '../types/events.js';
|
|
|
15
15
|
import type { HistoryService } from '../services/historyService.js';
|
|
16
16
|
import type { PortMapping } from '../utils/nodeSwap.js';
|
|
17
17
|
import type { WorkflowInterfaceEntry } from '../types/index.js';
|
|
18
|
+
import { type InterfaceInputEdit } from '../utils/playgroundChat.js';
|
|
18
19
|
type WorkflowMetadata = Workflow['metadata'];
|
|
19
20
|
/**
|
|
20
21
|
* Loosely-typed shape a workflow may arrive in before healing — a 1.x document
|
|
@@ -75,6 +76,7 @@ export interface WorkflowStoreActions {
|
|
|
75
76
|
/** The workflow's Playground settings. Omit to leave them untouched. */
|
|
76
77
|
playground?: Workflow['playground'];
|
|
77
78
|
}) => void;
|
|
79
|
+
editInterface: (next: Workflow['interface'], edit?: InterfaceInputEdit) => void;
|
|
78
80
|
swapNode: (updates: {
|
|
79
81
|
nodes: WorkflowNode[];
|
|
80
82
|
edges: WorkflowEdge[];
|
|
@@ -298,6 +300,18 @@ export declare class WorkflowStore {
|
|
|
298
300
|
interface?: Workflow['interface'];
|
|
299
301
|
playground?: Workflow['playground'];
|
|
300
302
|
}): void;
|
|
303
|
+
/**
|
|
304
|
+
* Replace the workflow's public contract after an edit: the one path every
|
|
305
|
+
* interface edit takes (the Interface tab, the canvas tags, the Ports tab),
|
|
306
|
+
* so each is one undo step and marks the workflow dirty.
|
|
307
|
+
*
|
|
308
|
+
* `edit` says an input id was renamed or removed. The chat binding in the
|
|
309
|
+
* Playground settings names inputs by id, so it follows in the same update
|
|
310
|
+
* and never names an input the interface no longer has. Settings that bind
|
|
311
|
+
* nothing any more must not fall back to `turn` marks left on the
|
|
312
|
+
* interface, which go in the same update.
|
|
313
|
+
*/
|
|
314
|
+
editInterface(next: Workflow['interface'], edit?: InterfaceInputEdit): void;
|
|
301
315
|
/**
|
|
302
316
|
* Swap a node — atomically replaces nodes and edges with a descriptive history entry.
|
|
303
317
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
|
|
14
14
|
import { WORKFLOW_SCHEMA_VERSION } from '../schemas/index.js';
|
|
15
15
|
import { interfaceBoundHandles, rewriteInterfaceBindings } from '../utils/workflowInterface.js';
|
|
16
|
-
import { rewritePlaygroundReplies } from '../utils/playgroundChat.js';
|
|
16
|
+
import { followInterfaceInputEdit, rewritePlaygroundReplies, withoutInterfaceTurns } from '../utils/playgroundChat.js';
|
|
17
17
|
/**
|
|
18
18
|
* Safely build updated workflow metadata, providing defaults for required fields.
|
|
19
19
|
*
|
|
@@ -171,6 +171,7 @@ export class WorkflowStore {
|
|
|
171
171
|
clear: this.clear.bind(this),
|
|
172
172
|
updateMetadata: this.updateMetadata.bind(this),
|
|
173
173
|
batchUpdate: this.batchUpdate.bind(this),
|
|
174
|
+
editInterface: this.editInterface.bind(this),
|
|
174
175
|
swapNode: this.swapNode.bind(this),
|
|
175
176
|
pushHistory: this.pushHistory.bind(this)
|
|
176
177
|
});
|
|
@@ -695,6 +696,26 @@ export class WorkflowStore {
|
|
|
695
696
|
this.#bumpVersion();
|
|
696
697
|
this.#notifyWorkflowChange('metadata');
|
|
697
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Replace the workflow's public contract after an edit: the one path every
|
|
701
|
+
* interface edit takes (the Interface tab, the canvas tags, the Ports tab),
|
|
702
|
+
* so each is one undo step and marks the workflow dirty.
|
|
703
|
+
*
|
|
704
|
+
* `edit` says an input id was renamed or removed. The chat binding in the
|
|
705
|
+
* Playground settings names inputs by id, so it follows in the same update
|
|
706
|
+
* and never names an input the interface no longer has. Settings that bind
|
|
707
|
+
* nothing any more must not fall back to `turn` marks left on the
|
|
708
|
+
* interface, which go in the same update.
|
|
709
|
+
*/
|
|
710
|
+
editInterface(next, edit) {
|
|
711
|
+
const playground = this.#workflow?.playground;
|
|
712
|
+
const followed = edit ? followInterfaceInputEdit(playground, edit) : playground;
|
|
713
|
+
const cleared = followed !== playground && followed?.chat === null;
|
|
714
|
+
this.batchUpdate({
|
|
715
|
+
interface: cleared ? withoutInterfaceTurns(next) : next,
|
|
716
|
+
...(followed !== playground && { playground: followed })
|
|
717
|
+
});
|
|
718
|
+
}
|
|
698
719
|
/**
|
|
699
720
|
* Swap a node — atomically replaces nodes and edges with a descriptive history entry.
|
|
700
721
|
*
|