@flowdrop/flowdrop 2.13.0 → 2.15.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 +82 -0
- package/dist/commands/executor.js +58 -8
- package/dist/commands/parser.js +3 -3
- package/dist/commands/types.d.ts +8 -2
- package/dist/commands/uiActionTarget.d.ts +24 -0
- package/dist/commands/uiActionTarget.js +31 -0
- package/dist/commands/validate.d.ts +15 -0
- package/dist/commands/validate.js +115 -0
- package/dist/components/App.svelte +44 -2
- package/dist/components/App.svelte.d.ts +3 -1
- package/dist/components/Button.svelte +7 -7
- package/dist/components/Button.svelte.d.ts +10 -0
- package/dist/components/CanvasBanner.svelte +19 -6
- package/dist/components/CanvasBanner.svelte.d.ts +15 -3
- package/dist/components/CanvasContextMenu.svelte +9 -9
- package/dist/components/CanvasContextMenu.svelte.d.ts +10 -0
- package/dist/components/CanvasToolbar.svelte +8 -7
- package/dist/components/CanvasToolbar.svelte.d.ts +10 -0
- package/dist/components/CanvasZoomControls.svelte +10 -9
- package/dist/components/CanvasZoomControls.svelte.d.ts +13 -0
- package/dist/components/ConfigForm.svelte +51 -18
- package/dist/components/ConfigForm.svelte.d.ts +20 -1
- package/dist/components/ConfigPanel.svelte +9 -5
- package/dist/components/ConfigPanel.svelte.d.ts +10 -0
- package/dist/components/EditorStatusBar.svelte +6 -5
- package/dist/components/EditorStatusBar.svelte.d.ts +7 -0
- package/dist/components/ExternalLinkRow.svelte +16 -1
- package/dist/components/ExternalLinkRow.svelte.d.ts +5 -0
- package/dist/components/FlowDropEdge.svelte +15 -12
- package/dist/components/FlowDropEdge.svelte.d.ts +16 -0
- package/dist/components/InterfaceTag.svelte +13 -15
- package/dist/components/InterfaceTag.svelte.d.ts +19 -0
- package/dist/components/LoadingSpinner.svelte +8 -2
- package/dist/components/LoadingSpinner.svelte.d.ts +9 -0
- package/dist/components/Logo.svelte +11 -0
- package/dist/components/Logo.svelte.d.ts +9 -0
- package/dist/components/LogoWordmark.svelte +8 -3
- package/dist/components/LogoWordmark.svelte.d.ts +9 -0
- package/dist/components/LoopbackLanes.svelte +12 -6
- package/dist/components/LoopbackLanes.svelte.d.ts +13 -0
- package/dist/components/MarkdownDisplay.svelte +10 -3
- package/dist/components/MarkdownDisplay.svelte.d.ts +11 -0
- package/dist/components/Navbar.svelte +13 -5
- package/dist/components/Navbar.svelte.d.ts +14 -0
- package/dist/components/NodeInspector.svelte +7 -8
- package/dist/components/NodeInspector.svelte.d.ts +10 -0
- package/dist/components/NodeSidebar.svelte +9 -3
- package/dist/components/NodeSidebar.svelte.d.ts +10 -0
- package/dist/components/NodeStatusOverlay.svelte +30 -19
- package/dist/components/NodeStatusOverlay.svelte.d.ts +19 -0
- package/dist/components/NodeSwapPicker.svelte +1 -1
- package/dist/components/RunBar.svelte +10 -13
- package/dist/components/RunBar.svelte.d.ts +15 -0
- package/dist/components/RunsMenu.svelte +14 -13
- package/dist/components/RunsMenu.svelte.d.ts +15 -0
- package/dist/components/SchemaForm.svelte +10 -13
- package/dist/components/SchemaForm.svelte.d.ts +51 -0
- package/dist/components/SettingsPanel.svelte +5 -5
- package/dist/components/StatusIcon.svelte +14 -3
- package/dist/components/StatusIcon.svelte.d.ts +15 -0
- package/dist/components/StatusLabel.svelte +10 -2
- package/dist/components/StatusLabel.svelte.d.ts +11 -0
- package/dist/components/ThemeToggle.svelte +8 -5
- package/dist/components/ThemeToggle.svelte.d.ts +10 -0
- package/dist/components/UniversalNode.svelte +13 -5
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowInterfaceEntryCard.svelte +1 -1
- package/dist/components/WorkflowInterfaceEntryComposer.svelte +1 -2
- package/dist/components/ZoomTier.svelte +13 -10
- package/dist/components/ZoomTier.svelte.d.ts +14 -0
- package/dist/components/console/CommandConsole.svelte +9 -3
- package/dist/components/console/CommandConsole.svelte.d.ts +10 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +4 -4
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +5 -0
- package/dist/components/console/ConsoleInput.svelte +6 -4
- package/dist/components/console/ConsoleInput.svelte.d.ts +7 -0
- package/dist/components/console/ConsoleOutput.svelte +5 -3
- package/dist/components/console/ConsoleOutput.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleStrip.svelte +9 -5
- package/dist/components/console/ConsoleStrip.svelte.d.ts +10 -0
- package/dist/components/form/FieldFactory.svelte +6 -2
- package/dist/components/form/FieldFactory.svelte.d.ts +46 -0
- package/dist/components/form/FormArray.svelte +9 -16
- package/dist/components/form/FormArray.svelte.d.ts +10 -0
- package/dist/components/form/FormArrayRows.svelte +8 -8
- package/dist/components/form/FormArrayRows.svelte.d.ts +11 -0
- package/dist/components/form/FormAutocomplete.svelte +6 -3
- package/dist/components/form/FormAutocomplete.svelte.d.ts +23 -0
- package/dist/components/form/FormCheckboxGroup.svelte +5 -5
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +6 -0
- package/dist/components/form/FormCodeEditor.svelte +8 -13
- package/dist/components/form/FormCodeEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormField.svelte +7 -8
- package/dist/components/form/FormField.svelte.d.ts +10 -0
- package/dist/components/form/FormFieldLight.svelte +6 -5
- package/dist/components/form/FormFieldLight.svelte.d.ts +8 -0
- package/dist/components/form/FormFieldWrapper.svelte +8 -8
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +9 -0
- package/dist/components/form/FormFieldset.svelte +6 -12
- package/dist/components/form/FormFieldset.svelte.d.ts +7 -0
- package/dist/components/form/FormMarkdownEditor.svelte +8 -15
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormNumberField.svelte +5 -7
- package/dist/components/form/FormNumberField.svelte.d.ts +6 -0
- package/dist/components/form/FormPorts.svelte +133 -27
- package/dist/components/form/FormPorts.svelte.d.ts +19 -0
- package/dist/components/form/FormRangeField.svelte +5 -9
- package/dist/components/form/FormRangeField.svelte.d.ts +6 -0
- package/dist/components/form/FormSelect.svelte +5 -7
- package/dist/components/form/FormSelect.svelte.d.ts +6 -0
- package/dist/components/form/FormTemplateEditor.svelte +8 -16
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormTextField.svelte +5 -7
- package/dist/components/form/FormTextField.svelte.d.ts +6 -0
- package/dist/components/form/FormTextarea.svelte +5 -7
- package/dist/components/form/FormTextarea.svelte.d.ts +6 -0
- package/dist/components/form/FormToggle.svelte +6 -8
- package/dist/components/form/FormToggle.svelte.d.ts +7 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +5 -9
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +7 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +6 -6
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +6 -5
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/FormPrompt.svelte +6 -6
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/InterruptBubble.svelte +10 -9
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +11 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +5 -6
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +6 -6
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +7 -0
- package/dist/components/nodes/AtomNode.svelte +31 -6
- package/dist/components/nodes/AtomNode.svelte.d.ts +15 -0
- package/dist/components/nodes/CaptionNode.svelte +50 -7
- package/dist/components/nodes/CaptionNode.svelte.d.ts +13 -0
- package/dist/components/nodes/GatewayNode.svelte +18 -11
- package/dist/components/nodes/GatewayNode.svelte.d.ts +21 -0
- package/dist/components/nodes/IdeaNode.svelte +47 -6
- package/dist/components/nodes/IdeaNode.svelte.d.ts +17 -0
- package/dist/components/nodes/NodeCard.svelte +26 -18
- package/dist/components/nodes/NodeCard.svelte.d.ts +20 -0
- package/dist/components/nodes/NodeConfigButton.svelte +15 -2
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +11 -0
- package/dist/components/nodes/NodeProblemMark.svelte +15 -10
- package/dist/components/nodes/NodeProblemMark.svelte.d.ts +16 -0
- package/dist/components/nodes/NodeTip.svelte +10 -7
- package/dist/components/nodes/NodeTip.svelte.d.ts +13 -0
- package/dist/components/nodes/NotesNode.svelte +30 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +14 -0
- package/dist/components/nodes/SimpleNode.svelte +35 -8
- package/dist/components/nodes/SimpleNode.svelte.d.ts +17 -0
- package/dist/components/nodes/SquareNode.svelte +38 -8
- package/dist/components/nodes/SquareNode.svelte.d.ts +17 -0
- package/dist/components/nodes/TerminalNode.svelte +24 -10
- package/dist/components/nodes/TerminalNode.svelte.d.ts +17 -0
- package/dist/components/nodes/ToolNode.svelte +14 -5
- package/dist/components/nodes/ToolNode.svelte.d.ts +15 -0
- package/dist/components/nodes/WorkflowNode.svelte +18 -15
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +21 -0
- package/dist/components/playground/ChatBubble.svelte +4 -3
- package/dist/components/playground/ChatBubble.svelte.d.ts +5 -0
- package/dist/components/playground/ChatInput.svelte +11 -6
- package/dist/components/playground/ChatInput.svelte.d.ts +14 -0
- package/dist/components/playground/ChatPanel.svelte +15 -7
- package/dist/components/playground/ChatPanel.svelte.d.ts +17 -0
- package/dist/components/playground/ControlPanel.svelte +26 -9
- package/dist/components/playground/ControlPanel.svelte.d.ts +29 -0
- package/dist/components/playground/DockedPlayground.svelte +7 -10
- package/dist/components/playground/DockedPlayground.svelte.d.ts +10 -0
- package/dist/components/playground/ExecutionConsole.svelte +10 -5
- package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
- package/dist/components/playground/ExecutionList.svelte +13 -0
- package/dist/components/playground/ExecutionList.svelte.d.ts +11 -0
- package/dist/components/playground/ExecutionLogs.svelte +6 -9
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +7 -0
- package/dist/components/playground/HeaderMenu.svelte +6 -8
- package/dist/components/playground/HeaderMenu.svelte.d.ts +9 -0
- package/dist/components/playground/HierarchyTrail.svelte +6 -6
- package/dist/components/playground/HierarchyTrail.svelte.d.ts +8 -0
- package/dist/components/playground/InputCollector.svelte +6 -5
- package/dist/components/playground/InputCollector.svelte.d.ts +7 -0
- package/dist/components/playground/InputFields.svelte +8 -12
- package/dist/components/playground/InputFields.svelte.d.ts +9 -0
- package/dist/components/playground/InterfaceInputForm.svelte +6 -13
- package/dist/components/playground/InterfaceInputForm.svelte.d.ts +9 -0
- package/dist/components/playground/InterfaceJsonInput.svelte +6 -5
- package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +8 -0
- package/dist/components/playground/LogRow.svelte +4 -5
- package/dist/components/playground/LogRow.svelte.d.ts +6 -0
- package/dist/components/playground/MessageBubble.svelte +13 -7
- package/dist/components/playground/MessageBubble.svelte.d.ts +15 -0
- package/dist/components/playground/MessageCard.svelte +5 -2
- package/dist/components/playground/MessageCard.svelte.d.ts +6 -0
- package/dist/components/playground/MessageMarkdown.svelte +8 -9
- package/dist/components/playground/MessageMarkdown.svelte.d.ts +11 -0
- package/dist/components/playground/MessageNotice.svelte +7 -0
- package/dist/components/playground/MessageNotice.svelte.d.ts +5 -0
- package/dist/components/playground/MessageStream.svelte +8 -6
- package/dist/components/playground/MessageStream.svelte.d.ts +11 -0
- package/dist/components/playground/MessageTagChip.svelte +7 -7
- package/dist/components/playground/MessageTagChip.svelte.d.ts +10 -0
- package/dist/components/playground/MessageTagStrip.svelte +6 -3
- package/dist/components/playground/MessageTagStrip.svelte.d.ts +8 -0
- package/dist/components/playground/OriginBadge.svelte +7 -4
- package/dist/components/playground/OriginBadge.svelte.d.ts +8 -0
- package/dist/components/playground/PipelineKanbanView.svelte +14 -0
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +12 -0
- package/dist/components/playground/PipelinePanel.svelte +14 -0
- package/dist/components/playground/PipelinePanel.svelte.d.ts +12 -0
- package/dist/components/playground/PipelineTableView.svelte +14 -0
- package/dist/components/playground/PipelineTableView.svelte.d.ts +12 -0
- package/dist/components/playground/Playground.svelte +17 -11
- package/dist/components/playground/Playground.svelte.d.ts +20 -0
- package/dist/components/playground/PlaygroundApp.svelte +24 -10
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +26 -0
- package/dist/components/playground/PlaygroundHeader.svelte +8 -12
- package/dist/components/playground/PlaygroundHeader.svelte.d.ts +11 -0
- package/dist/components/playground/PlaygroundModal.svelte +6 -8
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +7 -0
- package/dist/components/playground/PlaygroundStudio.svelte +9 -0
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +7 -0
- package/dist/components/playground/PlaygroundSurface.svelte +19 -14
- package/dist/components/playground/PlaygroundSurface.svelte.d.ts +20 -0
- package/dist/components/playground/SessionManager.svelte +6 -5
- package/dist/components/playground/SessionManager.svelte.d.ts +7 -0
- package/dist/components/playground/StepsSummary.svelte +8 -9
- package/dist/components/playground/StepsSummary.svelte.d.ts +10 -0
- package/dist/components/primitives/Button.svelte +15 -7
- package/dist/components/primitives/Button.svelte.d.ts +18 -1
- package/dist/components/primitives/Card.svelte +8 -6
- package/dist/components/primitives/Card.svelte.d.ts +11 -0
- package/dist/components/primitives/Checkbox.svelte +8 -5
- package/dist/components/primitives/Checkbox.svelte.d.ts +11 -0
- package/dist/components/primitives/Chip.svelte +8 -4
- package/dist/components/primitives/Chip.svelte.d.ts +11 -0
- package/dist/components/primitives/Combobox.svelte +27 -18
- package/dist/components/primitives/Combobox.svelte.d.ts +33 -0
- package/dist/components/primitives/Composer.svelte +15 -16
- package/dist/components/primitives/Composer.svelte.d.ts +20 -0
- package/dist/components/primitives/EmptyState.svelte +9 -3
- package/dist/components/primitives/EmptyState.svelte.d.ts +11 -0
- package/dist/components/primitives/Field.svelte +12 -9
- package/dist/components/primitives/Field.svelte.d.ts +16 -0
- package/dist/components/primitives/IconButton.svelte +10 -5
- package/dist/components/primitives/IconButton.svelte.d.ts +13 -0
- package/dist/components/primitives/Menu.svelte +15 -14
- package/dist/components/primitives/Menu.svelte.d.ts +20 -0
- package/dist/components/primitives/Notice.svelte +11 -8
- package/dist/components/primitives/Notice.svelte.d.ts +14 -0
- package/dist/components/primitives/PanelHeader.svelte +10 -7
- package/dist/components/primitives/PanelHeader.svelte.d.ts +13 -0
- package/dist/components/primitives/Segmented.svelte +11 -4
- package/dist/components/primitives/Segmented.svelte.d.ts +14 -0
- package/dist/components/primitives/Select.svelte +13 -16
- package/dist/components/primitives/Select.svelte.d.ts +18 -0
- package/dist/components/primitives/StatusPill.svelte +11 -8
- package/dist/components/primitives/StatusPill.svelte.d.ts +15 -0
- package/dist/components/primitives/Switch.svelte +9 -6
- package/dist/components/primitives/Switch.svelte.d.ts +12 -0
- package/dist/components/primitives/Tabs.svelte +16 -15
- package/dist/components/primitives/Tabs.svelte.d.ts +22 -0
- package/dist/components/primitives/Toolbar.svelte +14 -13
- package/dist/components/primitives/Toolbar.svelte.d.ts +18 -0
- package/dist/components/primitives/ToolbarSeparator.svelte +5 -4
- package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/editor/index.d.ts +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/toWorkflow.d.ts +8 -7
- package/dist/layout/toWorkflow.js +20 -40
- package/dist/messages/defaults.d.ts +24 -0
- package/dist/messages/defaults.js +15 -0
- package/dist/skins/graphite.d.ts +1 -1
- package/dist/skins/graphite.js +1 -1
- package/dist/stores/settingsStore.svelte.js +3 -0
- package/dist/stores/workflowStore.svelte.d.ts +10 -0
- package/dist/stores/workflowStore.svelte.js +65 -20
- package/dist/styles/base.css +2 -126
- package/dist/styles/tokenAliases.js +1 -0
- package/dist/styles/tokens.css +9 -5
- package/dist/svelte-app.d.ts +63 -2
- package/dist/svelte-app.js +144 -1
- package/dist/themes/classic.d.ts +9 -0
- package/dist/themes/classic.js +16 -0
- package/dist/themes/index.d.ts +7 -2
- package/dist/themes/index.js +20 -10
- package/dist/types/events.d.ts +18 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/settings.d.ts +6 -2
- package/dist/types/theme.d.ts +6 -2
- package/dist/utils/externalEdit.svelte.d.ts +48 -0
- package/dist/utils/externalEdit.svelte.js +62 -0
- package/dist/utils/inspectorContext.d.ts +5 -0
- package/dist/utils/playgroundChat.d.ts +10 -0
- package/dist/utils/playgroundChat.js +25 -0
- package/dist/utils/portExposure.d.ts +24 -1
- package/dist/utils/portExposure.js +46 -13
- package/dist/utils/portUtils.d.ts +5 -1
- package/dist/utils/portUtils.js +15 -4
- package/package.json +2 -1
- package/dist/components/IconButton.svelte +0 -80
- package/dist/components/IconButton.svelte.d.ts +0 -30
- package/dist/themes/default.d.ts +0 -2
- package/dist/themes/default.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,88 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.15.0] - 2026-10-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`runCommand` on the object `mountFlowDropApp` and `mountWorkflowEditor` return** (#53).
|
|
13
|
+
`await app.runCommand('layout auto')` runs one Command Console command (a line, or a parsed
|
|
14
|
+
`Command`) against the mount's workflow and resolves with its `CommandResult`. It waits for the
|
|
15
|
+
workflow to load, so it can be called right after mounting, and it is one undo step like the
|
|
16
|
+
console. `{ baseline: true }` makes the result the workflow's clean starting point (not dirty,
|
|
17
|
+
undo history cleared) and is refused with `code: 'DIRTY'` when there are unsaved changes; it does not
|
|
18
|
+
call `onDirtyStateChange` or `onWorkflowChange`, and `undo`/`redo` cannot run as a baseline. A `Command`
|
|
19
|
+
object is checked before it runs: an unknown type or a missing or mistyped field resolves with
|
|
20
|
+
`code: 'INVALID_ARGUMENT'`. The promise never rejects (a command that throws resolves with
|
|
21
|
+
`code: 'INTERNAL_ERROR'`). Works on read-only mounts. A command's UI actions (select, open config, fit/zoom/pan) are applied by the
|
|
22
|
+
`mountFlowDropApp` shell and dropped by `mountWorkflowEditor`.
|
|
23
|
+
- **`onExternalEdit` event handler** (#55). A node's `externalEditLink` can now be handled by the host
|
|
24
|
+
instead of navigating away: the handler receives copies of `(node, link)` and resolves with the node's new config
|
|
25
|
+
(it replaces the config, as one undo step, and is copied) or with nothing to leave the node as it is.
|
|
26
|
+
Field edits still pending in the form are committed before the handler is called. It covers every
|
|
27
|
+
place the link opens: the inspector row ("Runs … ↗"), the form buttons and the empty state. The link
|
|
28
|
+
keeps its `href`, so middle-click and "copy link" still work. `ConfigForm` takes the same `onExternalEdit`
|
|
29
|
+
prop. While the editor is read-only or locked the handler is still called but its result is not written.
|
|
30
|
+
Without the handler nothing changes.
|
|
31
|
+
- **`Command`, `CommandResult`, `CommandErrorCode`, `ConfigValues` and `ExternalEditLink` types** are
|
|
32
|
+
exported from the main entry and `./editor` too, so hosts can type `runCommand` and `onExternalEdit`
|
|
33
|
+
without importing `./core`.
|
|
34
|
+
|
|
35
|
+
### Deprecated
|
|
36
|
+
|
|
37
|
+
- **`ExternalEditLink.callbackUrlParam`.** It never had any effect, because nothing passes a callback URL.
|
|
38
|
+
Use `onExternalEdit` to get the config back from the host's form.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **`mountFlowDropApp` passes `workflowSettingsSchema` on to the editor** (#54). The option existed on
|
|
43
|
+
`App` but the mount function dropped it, so hosts mounting through the public API (the IIFE build
|
|
44
|
+
included) could not add their own Workflow Settings fields. Their values are stored in `workflow.config`.
|
|
45
|
+
|
|
46
|
+
## [2.14.0] - 2026-10-16
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- **Console `clear --all`.** Removes everything `clear` does and also the workflow's interface and the
|
|
51
|
+
Playground chat settings.
|
|
52
|
+
- **`NodePort.exposureLocked`.** Port metadata for a node type that always shows a port: the instance
|
|
53
|
+
`ports` config can't hide it, and `exposedByDefault` is ignored for it. The Ports tab shows the port's
|
|
54
|
+
"on" eye with a lock badge and no toggle.
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- **The "Default" theme is now called "Classic".** It was never the default: the editor opens in
|
|
59
|
+
Graphite. Its id is `'classic'` (`classicTheme`), and Settings → Theme lists Graphite first. A
|
|
60
|
+
settings snapshot or Drupal config that says `'default'` loads as `'classic'`, and
|
|
61
|
+
`resolveTheme('default')` still returns it.
|
|
62
|
+
- **Console `clear` keeps the interface.** Its entries stay, with their bindings dropped, and the Playground
|
|
63
|
+
replies are removed, all in one undo step.
|
|
64
|
+
- **A wired port can't be hidden in the Ports tab.** A shown port that still has connections keeps its eye,
|
|
65
|
+
with a link badge; activating it says to remove the connections on the canvas first. Locked ports use the
|
|
66
|
+
same eye with a lock badge. A port on the workflow interface can't be hidden either: its eye gets a tag
|
|
67
|
+
badge and says to remove it from the interface first.
|
|
68
|
+
|
|
69
|
+
### Deprecated
|
|
70
|
+
|
|
71
|
+
- The theme name `'default'` and the `defaultTheme` export. Use `'classic'` and `classicTheme`;
|
|
72
|
+
the old names are removed in 3.0.
|
|
73
|
+
|
|
74
|
+
### Removed
|
|
75
|
+
|
|
76
|
+
- **The `.flowdrop-btn--icon*` classes in `base.css`.** Every icon button in the library uses the
|
|
77
|
+
`IconButton` primitive, which has its own styles.
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- **Deleting a node drops the Playground replies that named it.** A workflow with such a reply was refused
|
|
82
|
+
when saved. The replies are dropped whichever way the node is removed (canvas, console, `clear`), and when
|
|
83
|
+
that empties the chat settings, the interface's old `turn` marks no longer take over as the chat.
|
|
84
|
+
- **"Hide unconnected ports" no longer counts a locked port.** A port the node type always shows is left
|
|
85
|
+
alone, as in the Ports tab.
|
|
86
|
+
- **Editing ports keeps entries for ports the node doesn't have.** The Ports tab and bulk Show/Hide used to
|
|
87
|
+
drop a stored `ports` entry whose port the node type no longer lists; they now keep it, as Tidy up already
|
|
88
|
+
did. All three write `ports` the same way.
|
|
89
|
+
|
|
8
90
|
## [2.13.0] - 2026-10-14
|
|
9
91
|
|
|
10
92
|
### Added
|
|
@@ -15,6 +15,7 @@ import { applyConnectionStyling } from '../utils/edgeStyling.js';
|
|
|
15
15
|
import { computeSwapPreview, executeSwap } from '../utils/nodeSwap.js';
|
|
16
16
|
import { computeAutoLayout } from '../adapters/agentspec/autoLayout.js';
|
|
17
17
|
import { interfaceTagReserve } from '../utils/interfaceTags.js';
|
|
18
|
+
import { normalizePlaygroundChat, withPlaygroundChat } from '../utils/playgroundChat.js';
|
|
18
19
|
// ============================================================================
|
|
19
20
|
// Internal Helpers
|
|
20
21
|
// ============================================================================
|
|
@@ -1011,7 +1012,11 @@ export const COMMAND_HELP = [
|
|
|
1011
1012
|
syntax: 'help [<command>]',
|
|
1012
1013
|
description: 'Show help for all or a specific command'
|
|
1013
1014
|
},
|
|
1014
|
-
{
|
|
1015
|
+
{
|
|
1016
|
+
name: 'clear',
|
|
1017
|
+
syntax: 'clear [--all]',
|
|
1018
|
+
description: 'Remove all nodes and edges; the interface stays, unbound. --all also removes the interface and the Playground chat settings'
|
|
1019
|
+
},
|
|
1015
1020
|
{
|
|
1016
1021
|
name: 'canvas',
|
|
1017
1022
|
syntax: 'canvas fitview',
|
|
@@ -1089,18 +1094,63 @@ function executeRedo(context) {
|
|
|
1089
1094
|
}
|
|
1090
1095
|
return { ok: true, message: 'Redone' };
|
|
1091
1096
|
}
|
|
1092
|
-
|
|
1097
|
+
/**
|
|
1098
|
+
* Empty the canvas. The interface is the workflow's contract and outlives its
|
|
1099
|
+
* body, so plain `clear` keeps every entry and only unbinds it (the store drops
|
|
1100
|
+
* the Playground replies on the removed nodes). `clear --all` removes the
|
|
1101
|
+
* interface and the Playground chat settings too. Either is one undo step.
|
|
1102
|
+
*/
|
|
1103
|
+
function executeClear(command, context) {
|
|
1093
1104
|
const workflow = context.getWorkflow();
|
|
1094
1105
|
if (!workflow) {
|
|
1095
1106
|
return { ok: false, error: 'No workflow loaded', code: 'NO_WORKFLOW' };
|
|
1096
1107
|
}
|
|
1097
1108
|
const nodeCount = workflow.nodes.length;
|
|
1098
1109
|
const edgeCount = workflow.edges.length;
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1110
|
+
const cleared = `Cleared ${nodeCount} node(s) and ${edgeCount} edge(s)`;
|
|
1111
|
+
const inputs = workflow.interface?.inputs ?? [];
|
|
1112
|
+
const outputs = workflow.interface?.outputs ?? [];
|
|
1113
|
+
if (command.all) {
|
|
1114
|
+
const hadInterface = inputs.length + outputs.length > 0;
|
|
1115
|
+
const hadChat = Boolean(workflow.playground?.chat);
|
|
1116
|
+
context.dispatch.batchUpdate({
|
|
1117
|
+
nodes: [],
|
|
1118
|
+
edges: [],
|
|
1119
|
+
// An empty contract, not `undefined`: a save omits an absent interface,
|
|
1120
|
+
// and the server would keep the stored one.
|
|
1121
|
+
...(hadInterface && { interface: { inputs: [], outputs: [] } }),
|
|
1122
|
+
...(hadChat && { playground: withPlaygroundChat(workflow.playground, null) })
|
|
1123
|
+
});
|
|
1124
|
+
const also = [hadInterface && 'the interface', hadChat && 'the Playground chat settings'];
|
|
1125
|
+
const extra = also.filter(Boolean).join(' and ');
|
|
1126
|
+
return { ok: true, message: extra ? `${cleared}, and removed ${extra}` : cleared };
|
|
1127
|
+
}
|
|
1128
|
+
const unbind = (entry) => entry.bindings.length === 0 ? entry : { ...entry, bindings: [] };
|
|
1129
|
+
const bound = [...inputs, ...outputs].some((entry) => entry.bindings.length > 0);
|
|
1130
|
+
// The store drops the Playground replies on the removed nodes.
|
|
1131
|
+
const hadReplies = normalizePlaygroundChat(workflow.playground?.chat).replies.length > 0;
|
|
1132
|
+
context.dispatch.batchUpdate({
|
|
1133
|
+
nodes: [],
|
|
1134
|
+
edges: [],
|
|
1135
|
+
...(bound && {
|
|
1136
|
+
interface: {
|
|
1137
|
+
...workflow.interface,
|
|
1138
|
+
...(workflow.interface?.inputs && { inputs: workflow.interface.inputs.map(unbind) }),
|
|
1139
|
+
...(workflow.interface?.outputs && { outputs: workflow.interface.outputs.map(unbind) })
|
|
1140
|
+
}
|
|
1141
|
+
})
|
|
1142
|
+
});
|
|
1143
|
+
const notes = [];
|
|
1144
|
+
const kept = inputs.length + outputs.length > 0;
|
|
1145
|
+
if (kept) {
|
|
1146
|
+
notes.push(`Kept the interface (${inputs.length} input(s), ${outputs.length} output(s))` +
|
|
1147
|
+
(bound ? ', now unbound' : ''));
|
|
1148
|
+
}
|
|
1149
|
+
if (hadReplies)
|
|
1150
|
+
notes.push('Dropped the Playground replies');
|
|
1151
|
+
if (kept)
|
|
1152
|
+
notes.push('`clear --all` removes the interface too');
|
|
1153
|
+
return { ok: true, message: [cleared, ...notes].join('. ') };
|
|
1104
1154
|
}
|
|
1105
1155
|
function executeConfigOpen(command, context) {
|
|
1106
1156
|
const workflow = context.getWorkflow();
|
|
@@ -1570,7 +1620,7 @@ export function executeCommand(command, context) {
|
|
|
1570
1620
|
case 'redo':
|
|
1571
1621
|
return executeRedo(context);
|
|
1572
1622
|
case 'clear':
|
|
1573
|
-
return executeClear(context);
|
|
1623
|
+
return executeClear(command, context);
|
|
1574
1624
|
case 'config_open':
|
|
1575
1625
|
return executeConfigOpen(command, context);
|
|
1576
1626
|
case 'select_node':
|
package/dist/commands/parser.js
CHANGED
|
@@ -223,10 +223,10 @@ const rules = [
|
|
|
223
223
|
pattern: /^help$/i,
|
|
224
224
|
parse: () => ({ type: 'help' })
|
|
225
225
|
},
|
|
226
|
-
// clear
|
|
226
|
+
// clear [--all]
|
|
227
227
|
{
|
|
228
|
-
pattern: /^clear
|
|
229
|
-
parse: () => ({ type: 'clear' })
|
|
228
|
+
pattern: /^clear(\s+--all)?$/i,
|
|
229
|
+
parse: (m) => (m[1] ? { type: 'clear', all: true } : { type: 'clear' })
|
|
230
230
|
},
|
|
231
231
|
// swap <nodeId> with <type> (Phase 2)
|
|
232
232
|
{
|
package/dist/commands/types.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ export interface HelpCommand {
|
|
|
101
101
|
}
|
|
102
102
|
export interface ClearCommand {
|
|
103
103
|
type: 'clear';
|
|
104
|
+
/** Also remove the interface and the Playground chat settings. */
|
|
105
|
+
all?: boolean;
|
|
104
106
|
}
|
|
105
107
|
/** Phase 2 commands */
|
|
106
108
|
export interface SwapNodeCommand {
|
|
@@ -185,11 +187,15 @@ export type ParseResult = {
|
|
|
185
187
|
error: string;
|
|
186
188
|
input: string;
|
|
187
189
|
};
|
|
188
|
-
export type CommandErrorCode = 'NODE_NOT_FOUND' | 'NODE_TYPE_NOT_FOUND' | 'PORT_NOT_FOUND' | 'EDGE_NOT_FOUND' | 'INVALID_CONNECTION' | 'CYCLE_DETECTED' | 'NO_WORKFLOW'
|
|
190
|
+
export type CommandErrorCode = 'NODE_NOT_FOUND' | 'NODE_TYPE_NOT_FOUND' | 'PORT_NOT_FOUND' | 'EDGE_NOT_FOUND' | 'INVALID_CONNECTION' | 'CYCLE_DETECTED' | 'NO_WORKFLOW'
|
|
191
|
+
/** `runCommand({ baseline: true })` on a workflow with unsaved changes: nothing was run. */
|
|
192
|
+
| 'DIRTY' | 'PARSE_ERROR'
|
|
189
193
|
/** An argument is out of range, e.g. a layout gap that is not a multiple of the grid. */
|
|
190
194
|
| 'INVALID_ARGUMENT'
|
|
191
195
|
/** The graph is past what the command takes on, e.g. too many nodes to tidy at once. */
|
|
192
|
-
| 'TOO_LARGE' | 'UNKNOWN_COMMAND'
|
|
196
|
+
| 'TOO_LARGE' | 'UNKNOWN_COMMAND'
|
|
197
|
+
/** The command threw instead of returning a result (a bug, not bad input): see the console. */
|
|
198
|
+
| 'INTERNAL_ERROR' | 'CONFIG_KEY_NOT_FOUND'
|
|
193
199
|
/** search_types with a blank query — use list_types for the whole catalog. */
|
|
194
200
|
| 'EMPTY_QUERY' | 'CONFIG_VALIDATION_ERROR' | 'UNDO_UNAVAILABLE' | 'REDO_UNAVAILABLE'
|
|
195
201
|
/** A Console `session` command refused: busy, wrong input mode, nothing to act on. */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the mount API's `runCommand` sends a command's UI actions (select a
|
|
3
|
+
* node, open its config panel, fit/zoom/pan the canvas).
|
|
4
|
+
*
|
|
5
|
+
* The editor shell (`App`) registers its handler for its instance while it is
|
|
6
|
+
* mounted. Kept off `FlowDropInstance` on purpose: it is internal, not
|
|
7
|
+
* exported from any entry point, so hosts cannot replace it.
|
|
8
|
+
*
|
|
9
|
+
* @module commands/uiActionTarget
|
|
10
|
+
*/
|
|
11
|
+
import type { FlowDropInstance } from '../stores/instanceContainer.svelte.js';
|
|
12
|
+
import type { UIAction } from './types.js';
|
|
13
|
+
type UIActionHandler = (action: UIAction) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Make `handler` the instance's UI-action target. The returned release only
|
|
16
|
+
* clears it while `handler` is still the target, so a shell mounted later
|
|
17
|
+
* keeps its own registration when an earlier one goes away.
|
|
18
|
+
*/
|
|
19
|
+
export declare function provideUIActionTarget(instance: FlowDropInstance, handler: UIActionHandler): () => void;
|
|
20
|
+
/** Hand `action` to the instance's target; dropped when there is none. */
|
|
21
|
+
export declare function dispatchUIAction(instance: FlowDropInstance, action: UIAction): void;
|
|
22
|
+
/** Whether a shell has registered a target for the instance (for tests). */
|
|
23
|
+
export declare function hasUIActionTarget(instance: FlowDropInstance): boolean;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the mount API's `runCommand` sends a command's UI actions (select a
|
|
3
|
+
* node, open its config panel, fit/zoom/pan the canvas).
|
|
4
|
+
*
|
|
5
|
+
* The editor shell (`App`) registers its handler for its instance while it is
|
|
6
|
+
* mounted. Kept off `FlowDropInstance` on purpose: it is internal, not
|
|
7
|
+
* exported from any entry point, so hosts cannot replace it.
|
|
8
|
+
*
|
|
9
|
+
* @module commands/uiActionTarget
|
|
10
|
+
*/
|
|
11
|
+
const targets = new WeakMap();
|
|
12
|
+
/**
|
|
13
|
+
* Make `handler` the instance's UI-action target. The returned release only
|
|
14
|
+
* clears it while `handler` is still the target, so a shell mounted later
|
|
15
|
+
* keeps its own registration when an earlier one goes away.
|
|
16
|
+
*/
|
|
17
|
+
export function provideUIActionTarget(instance, handler) {
|
|
18
|
+
targets.set(instance, handler);
|
|
19
|
+
return () => {
|
|
20
|
+
if (targets.get(instance) === handler)
|
|
21
|
+
targets.delete(instance);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Hand `action` to the instance's target; dropped when there is none. */
|
|
25
|
+
export function dispatchUIAction(instance, action) {
|
|
26
|
+
targets.get(instance)?.(action);
|
|
27
|
+
}
|
|
28
|
+
/** Whether a shell has registered a target for the instance (for tests). */
|
|
29
|
+
export function hasUIActionTarget(instance) {
|
|
30
|
+
return targets.has(instance);
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape check for a `Command` object handed in from outside the editor (the
|
|
3
|
+
* mount API's `runCommand`). The parser only ever builds well-formed commands;
|
|
4
|
+
* a host writing the object by hand, from plain JavaScript, may not, and the
|
|
5
|
+
* executor trusts the shape.
|
|
6
|
+
*
|
|
7
|
+
* @module commands/validate
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Check that `value` is a `Command` the executor can run: a known `type`, its
|
|
11
|
+
* required fields present and every field it names of the right kind.
|
|
12
|
+
* Returns the problem, or null when the command is well formed. Fields the
|
|
13
|
+
* command does not define are ignored.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateCommand(value: unknown): string | null;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape check for a `Command` object handed in from outside the editor (the
|
|
3
|
+
* mount API's `runCommand`). The parser only ever builds well-formed commands;
|
|
4
|
+
* a host writing the object by hand, from plain JavaScript, may not, and the
|
|
5
|
+
* executor trusts the shape.
|
|
6
|
+
*
|
|
7
|
+
* @module commands/validate
|
|
8
|
+
*/
|
|
9
|
+
const NODE_ID = { nodeId: 'string' };
|
|
10
|
+
const GAPS = { gapX: 'number', gapY: 'number' };
|
|
11
|
+
const PORTS = {
|
|
12
|
+
sourceNodeId: 'string',
|
|
13
|
+
sourcePort: 'string',
|
|
14
|
+
targetNodeId: 'string',
|
|
15
|
+
targetPort: 'string'
|
|
16
|
+
};
|
|
17
|
+
/** One entry per command type, so a new command cannot be added without its rules. */
|
|
18
|
+
const RULES = {
|
|
19
|
+
add_node: { required: { nodeTypeId: 'string' }, optional: { position: 'point' } },
|
|
20
|
+
delete_node: { required: NODE_ID },
|
|
21
|
+
rename_node: { required: { ...NODE_ID, label: 'string' } },
|
|
22
|
+
set_config: {
|
|
23
|
+
required: { ...NODE_ID, key: 'string', value: 'string' },
|
|
24
|
+
optional: { strict: 'boolean' }
|
|
25
|
+
},
|
|
26
|
+
get_config: { required: NODE_ID, optional: { key: 'string' } },
|
|
27
|
+
connect: { required: PORTS },
|
|
28
|
+
disconnect_ports: { required: PORTS },
|
|
29
|
+
disconnect_node: { required: NODE_ID },
|
|
30
|
+
list_nodes: {},
|
|
31
|
+
list_edges: {},
|
|
32
|
+
list_types: {},
|
|
33
|
+
describe_type: { required: { nodeTypeId: 'string' } },
|
|
34
|
+
search_types: { required: { query: 'string' } },
|
|
35
|
+
info: { required: NODE_ID },
|
|
36
|
+
undo: {},
|
|
37
|
+
redo: {},
|
|
38
|
+
config_open: { required: NODE_ID },
|
|
39
|
+
select_node: { required: NODE_ID },
|
|
40
|
+
help: { optional: { command: 'string' } },
|
|
41
|
+
clear: { optional: { all: 'boolean' } },
|
|
42
|
+
swap_node: { required: { ...NODE_ID, newTypeId: 'string' } },
|
|
43
|
+
move_node: { required: { ...NODE_ID, position: 'point' } },
|
|
44
|
+
auto_layout: { optional: { direction: ['horizontal', 'vertical'] } },
|
|
45
|
+
beautify_layout: { optional: { dryRun: 'boolean', ...GAPS } },
|
|
46
|
+
inspect_node_layout: { required: NODE_ID, optional: GAPS },
|
|
47
|
+
beautify_node: {
|
|
48
|
+
required: NODE_ID,
|
|
49
|
+
optional: {
|
|
50
|
+
strategy: ['column', 'ports', 'align', 'clear', 'all'],
|
|
51
|
+
dryRun: 'boolean',
|
|
52
|
+
...GAPS
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
canvas_fit_view: {},
|
|
56
|
+
canvas_zoom_in: {},
|
|
57
|
+
canvas_zoom_out: {},
|
|
58
|
+
canvas_zoom_to: { required: { level: 'number' } },
|
|
59
|
+
canvas_pan_to: { required: { position: 'point' } },
|
|
60
|
+
canvas_reset_view: {}
|
|
61
|
+
};
|
|
62
|
+
const isFiniteNumber = (value) => typeof value === 'number' && Number.isFinite(value);
|
|
63
|
+
function matches(value, kind) {
|
|
64
|
+
if (Array.isArray(kind))
|
|
65
|
+
return typeof value === 'string' && kind.includes(value);
|
|
66
|
+
switch (kind) {
|
|
67
|
+
case 'string':
|
|
68
|
+
return typeof value === 'string';
|
|
69
|
+
case 'number':
|
|
70
|
+
return isFiniteNumber(value);
|
|
71
|
+
case 'boolean':
|
|
72
|
+
return typeof value === 'boolean';
|
|
73
|
+
case 'point': {
|
|
74
|
+
const point = value;
|
|
75
|
+
return (typeof point === 'object' &&
|
|
76
|
+
point !== null &&
|
|
77
|
+
isFiniteNumber(point.x) &&
|
|
78
|
+
isFiniteNumber(point.y));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
function describe(kind) {
|
|
84
|
+
if (Array.isArray(kind))
|
|
85
|
+
return `one of ${kind.map((k) => `"${k}"`).join(', ')}`;
|
|
86
|
+
return kind === 'point' ? 'an { x, y } object of numbers' : `a ${kind}`;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check that `value` is a `Command` the executor can run: a known `type`, its
|
|
90
|
+
* required fields present and every field it names of the right kind.
|
|
91
|
+
* Returns the problem, or null when the command is well formed. Fields the
|
|
92
|
+
* command does not define are ignored.
|
|
93
|
+
*/
|
|
94
|
+
export function validateCommand(value) {
|
|
95
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
96
|
+
return 'A command is a console line or a Command object.';
|
|
97
|
+
}
|
|
98
|
+
const command = value;
|
|
99
|
+
const type = command.type;
|
|
100
|
+
if (typeof type !== 'string' || !Object.hasOwn(RULES, type)) {
|
|
101
|
+
return `Unknown command type: ${JSON.stringify(type)}.`;
|
|
102
|
+
}
|
|
103
|
+
const rules = RULES[type];
|
|
104
|
+
for (const [field, kind] of Object.entries(rules.required ?? {})) {
|
|
105
|
+
if (!matches(command[field], kind)) {
|
|
106
|
+
return `${type}: "${field}" must be ${describe(kind)}.`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
for (const [field, kind] of Object.entries(rules.optional ?? {})) {
|
|
110
|
+
if (command[field] !== undefined && !matches(command[field], kind)) {
|
|
111
|
+
return `${type}: "${field}" must be ${describe(kind)} when given.`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
@@ -53,7 +53,13 @@
|
|
|
53
53
|
import Navbar from './Navbar.svelte';
|
|
54
54
|
import DoctorMenu from './DoctorMenu.svelte';
|
|
55
55
|
import type { NavbarAction, NavbarBranding } from '../types/navbar.js';
|
|
56
|
-
import type {
|
|
56
|
+
import type {
|
|
57
|
+
NodeMetadata,
|
|
58
|
+
Workflow,
|
|
59
|
+
WorkflowNode,
|
|
60
|
+
ConfigSchema,
|
|
61
|
+
ExternalEditLink
|
|
62
|
+
} from '../types/index.js';
|
|
57
63
|
import type { InteractiveSwapState, SwapEventContext } from '../utils/nodeSwap.js';
|
|
58
64
|
import {
|
|
59
65
|
computeInteractiveState,
|
|
@@ -83,6 +89,8 @@
|
|
|
83
89
|
initializeTheme
|
|
84
90
|
} from '../stores/settingsStore.svelte.js';
|
|
85
91
|
import { logger } from '../utils/logger.js';
|
|
92
|
+
import { runExternalEdit } from '../utils/externalEdit.svelte.js';
|
|
93
|
+
import { provideUIActionTarget } from '../commands/uiActionTarget.js';
|
|
86
94
|
import { themeScope } from '../utils/themeScope.svelte.js';
|
|
87
95
|
import {
|
|
88
96
|
resolveInspectorSurface,
|
|
@@ -210,13 +218,15 @@
|
|
|
210
218
|
onApiError?: FlowDropEventHandlers['onApiError'];
|
|
211
219
|
/** Called after a workflow is loaded/imported. */
|
|
212
220
|
onWorkflowLoad?: FlowDropEventHandlers['onWorkflowLoad'];
|
|
221
|
+
/** Called instead of opening a node's external edit link; resolve with the new config. */
|
|
222
|
+
onExternalEdit?: FlowDropEventHandlers['onExternalEdit'];
|
|
213
223
|
/** Called before a node swap — return false to cancel. */
|
|
214
224
|
onBeforeSwap?: FlowDropEventHandlers['onBeforeSwap'];
|
|
215
225
|
/** Called after a node swap is applied. */
|
|
216
226
|
onAfterSwap?: FlowDropEventHandlers['onAfterSwap'];
|
|
217
227
|
/** Feature configuration */
|
|
218
228
|
features?: FlowDropFeatures;
|
|
219
|
-
/** Visual theme — named built-in ('
|
|
229
|
+
/** Visual theme — named built-in ('graphite' | 'classic' | 'minimal' | 'drafter') or custom theme object */
|
|
220
230
|
theme?: FlowDropTheme | FlowDropThemeName;
|
|
221
231
|
/** Which settings tabs to show in the modal */
|
|
222
232
|
settingsCategories?: SettingsCategory[];
|
|
@@ -283,6 +293,7 @@
|
|
|
283
293
|
onSaveError,
|
|
284
294
|
onApiError,
|
|
285
295
|
onWorkflowLoad,
|
|
296
|
+
onExternalEdit,
|
|
286
297
|
onBeforeSwap,
|
|
287
298
|
onAfterSwap,
|
|
288
299
|
features: propFeatures,
|
|
@@ -1128,6 +1139,33 @@
|
|
|
1128
1139
|
}
|
|
1129
1140
|
});
|
|
1130
1141
|
|
|
1142
|
+
/**
|
|
1143
|
+
* Hand a node's external edit link to the host (`onExternalEdit`) and write
|
|
1144
|
+
* the config it resolves with. Undefined when the host set no handler, so the
|
|
1145
|
+
* link opens as before.
|
|
1146
|
+
*/
|
|
1147
|
+
// Nodes whose host form is open, kept here so reopening the inspector does
|
|
1148
|
+
// not open a second one.
|
|
1149
|
+
const externalEditPending = new Set<string>();
|
|
1150
|
+
const externalEditForConfig = $derived(
|
|
1151
|
+
onExternalEdit
|
|
1152
|
+
? (node: WorkflowNode, link: ExternalEditLink) =>
|
|
1153
|
+
runExternalEdit({
|
|
1154
|
+
node,
|
|
1155
|
+
link,
|
|
1156
|
+
handler: (n, l) => onExternalEdit(n, l),
|
|
1157
|
+
store: fd.workflow,
|
|
1158
|
+
// Read when the host resolves: the editor may have been locked meanwhile.
|
|
1159
|
+
canWrite: () => canvasEditable,
|
|
1160
|
+
pending: externalEditPending,
|
|
1161
|
+
onWritten: (written) => {
|
|
1162
|
+
workflowEditorRef?.updateNodeData(written.id, written.data);
|
|
1163
|
+
void workflowEditorRef?.refreshEdgePositions(written.id);
|
|
1164
|
+
}
|
|
1165
|
+
})
|
|
1166
|
+
: undefined
|
|
1167
|
+
);
|
|
1168
|
+
|
|
1131
1169
|
async function saveWorkflow(): Promise<boolean> {
|
|
1132
1170
|
// Commit any in-flight config edit so the save and its history are
|
|
1133
1171
|
// consistent (the value itself is already live in the store).
|
|
@@ -1660,6 +1698,9 @@
|
|
|
1660
1698
|
}
|
|
1661
1699
|
}
|
|
1662
1700
|
|
|
1701
|
+
// Let the mount API's `runCommand` reach this handler for UI actions.
|
|
1702
|
+
$effect(() => provideUIActionTarget(fd, handleConsoleUIAction));
|
|
1703
|
+
|
|
1663
1704
|
/** Show the Assistant: its tab beside Nodes, or the console group where there is no left slot. */
|
|
1664
1705
|
function openAssistant(): void {
|
|
1665
1706
|
if (chatInConsoleGroup) {
|
|
@@ -1738,6 +1779,7 @@
|
|
|
1738
1779
|
workflowId={fd.workflow.current?.id}
|
|
1739
1780
|
workflowNodes={fd.workflow.current?.nodes}
|
|
1740
1781
|
workflowEdges={fd.workflow.current?.edges}
|
|
1782
|
+
onExternalEdit={externalEditForConfig}
|
|
1741
1783
|
onChange={(updatedConfig, meta) => {
|
|
1742
1784
|
if (!node.id) return;
|
|
1743
1785
|
const updatedData = { ...node.data, config: updatedConfig };
|
|
@@ -124,13 +124,15 @@ interface Props {
|
|
|
124
124
|
onApiError?: FlowDropEventHandlers['onApiError'];
|
|
125
125
|
/** Called after a workflow is loaded/imported. */
|
|
126
126
|
onWorkflowLoad?: FlowDropEventHandlers['onWorkflowLoad'];
|
|
127
|
+
/** Called instead of opening a node's external edit link; resolve with the new config. */
|
|
128
|
+
onExternalEdit?: FlowDropEventHandlers['onExternalEdit'];
|
|
127
129
|
/** Called before a node swap — return false to cancel. */
|
|
128
130
|
onBeforeSwap?: FlowDropEventHandlers['onBeforeSwap'];
|
|
129
131
|
/** Called after a node swap is applied. */
|
|
130
132
|
onAfterSwap?: FlowDropEventHandlers['onAfterSwap'];
|
|
131
133
|
/** Feature configuration */
|
|
132
134
|
features?: FlowDropFeatures;
|
|
133
|
-
/** Visual theme — named built-in ('
|
|
135
|
+
/** Visual theme — named built-in ('graphite' | 'classic' | 'minimal' | 'drafter') or custom theme object */
|
|
134
136
|
theme?: FlowDropTheme | FlowDropThemeName;
|
|
135
137
|
/** Which settings tabs to show in the modal */
|
|
136
138
|
settingsCategories?: SettingsCategory[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
**Legacy.** Use the primitive Button (`components/primitives/Button.svelte`) instead.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
now the control tokens (sm 24px, md 28px), not the old 28/40/48.
|
|
5
|
+
A thin wrapper over the primitive that keeps the original prop API. It maps onto the
|
|
6
|
+
primitive: `outline` becomes `secondary`, and `lg` becomes `md`. So Outline looks the same
|
|
7
|
+
as Secondary, and Large the same as Medium. Heights are the control tokens (sm 24px, md 28px).
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Not exported from the package. New code should use the primitive, which also has `loading`,
|
|
10
|
+
icons and the `danger` variants.
|
|
11
11
|
-->
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
@@ -19,6 +19,16 @@ interface Props {
|
|
|
19
19
|
/** Button contents (icon, label, or both) */
|
|
20
20
|
children: Snippet;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* **Legacy.** Use the primitive Button (`components/primitives/Button.svelte`) instead.
|
|
24
|
+
*
|
|
25
|
+
* A thin wrapper over the primitive that keeps the original prop API. It maps onto the
|
|
26
|
+
* primitive: `outline` becomes `secondary`, and `lg` becomes `md`. So Outline looks the same
|
|
27
|
+
* as Secondary, and Large the same as Medium. Heights are the control tokens (sm 24px, md 28px).
|
|
28
|
+
*
|
|
29
|
+
* Not exported from the package. New code should use the primitive, which also has `loading`,
|
|
30
|
+
* icons and the `danger` variants.
|
|
31
|
+
*/
|
|
22
32
|
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
23
33
|
type Button = ReturnType<typeof Button>;
|
|
24
34
|
export default Button;
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The message in the middle of an empty canvas: an icon, a title and a line of help.
|
|
4
|
+
|
|
5
|
+
It fills the canvas and lets clicks through, so the canvas under it still takes drops. The editor shows it
|
|
6
|
+
while the workflow has no nodes and removes it with the first node.
|
|
7
|
+
|
|
8
|
+
**Use it for** telling a person what to do on a canvas with nothing on it.
|
|
9
|
+
**Not for** errors or progress (use `EditorStatusBar` or a notice).
|
|
10
|
+
-->
|
|
11
|
+
|
|
1
12
|
<script lang="ts">
|
|
2
13
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
icon
|
|
7
|
-
}: {
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
/** The headline, for example "Drag components here to start building". */
|
|
8
17
|
title: string;
|
|
18
|
+
/** One line of help under the title. */
|
|
9
19
|
description: string;
|
|
20
|
+
/** The icon above the title. Nothing is drawn when it is left out. */
|
|
10
21
|
icon?: Snippet;
|
|
11
|
-
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let { title, description, icon }: Props = $props();
|
|
12
25
|
</script>
|
|
13
26
|
|
|
14
27
|
<div class="flowdrop-canvas-banner">
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
/** The headline, for example "Drag components here to start building". */
|
|
3
4
|
title: string;
|
|
5
|
+
/** One line of help under the title. */
|
|
4
6
|
description: string;
|
|
7
|
+
/** The icon above the title. Nothing is drawn when it is left out. */
|
|
5
8
|
icon?: Snippet;
|
|
6
|
-
}
|
|
7
|
-
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The message in the middle of an empty canvas: an icon, a title and a line of help.
|
|
12
|
+
*
|
|
13
|
+
* It fills the canvas and lets clicks through, so the canvas under it still takes drops. The editor shows it
|
|
14
|
+
* while the workflow has no nodes and removes it with the first node.
|
|
15
|
+
*
|
|
16
|
+
* **Use it for** telling a person what to do on a canvas with nothing on it.
|
|
17
|
+
* **Not for** errors or progress (use `EditorStatusBar` or a notice).
|
|
18
|
+
*/
|
|
19
|
+
declare const CanvasBanner: import("svelte").Component<Props, {}, "">;
|
|
8
20
|
type CanvasBanner = ReturnType<typeof CanvasBanner>;
|
|
9
21
|
export default CanvasBanner;
|