@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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Notice — inline message (info / success / warning / error) with optional
|
|
3
|
+
title, body, actions and a dismiss button.
|
|
4
|
+
|
|
5
|
+
ARIA: error and warning use role="alert" (assertive: the user has to act or
|
|
6
|
+
has just lost something); info and success use role="status" (polite: nothing
|
|
7
|
+
to interrupt for). Override with `role` when a notice that is rendered on
|
|
8
|
+
load (a persistent warning, say) should not be announced: pass "status" or
|
|
9
|
+
"note".
|
|
10
|
+
|
|
11
|
+
@internal Not exported from any package entry; the API may still change.
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import type { Snippet } from 'svelte';
|
|
16
|
+
import Icon from '@iconify/svelte';
|
|
17
|
+
import { getMessages } from '../../messages/context.js';
|
|
18
|
+
import IconButton from './IconButton.svelte';
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
/** Semantic tone; selects colour, icon and default ARIA role. */
|
|
22
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
23
|
+
/** Bold first line. */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Body text / markup. */
|
|
26
|
+
children?: Snippet;
|
|
27
|
+
/** Action buttons under the body. */
|
|
28
|
+
actions?: Snippet;
|
|
29
|
+
/** When set, a dismiss (x) button is shown and calls this. */
|
|
30
|
+
ondismiss?: () => void;
|
|
31
|
+
/** Accessible label of the dismiss button. Defaults to the localized "Dismiss". */
|
|
32
|
+
dismissLabel?: string;
|
|
33
|
+
/** Override the default ARIA role (alert for error/warning, status otherwise). */
|
|
34
|
+
role?: 'alert' | 'status' | 'note';
|
|
35
|
+
/** Extra classes on the root. */
|
|
36
|
+
class?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let {
|
|
40
|
+
tone = 'info',
|
|
41
|
+
title,
|
|
42
|
+
children,
|
|
43
|
+
actions,
|
|
44
|
+
ondismiss,
|
|
45
|
+
dismissLabel,
|
|
46
|
+
role,
|
|
47
|
+
class: className = ''
|
|
48
|
+
}: Props = $props();
|
|
49
|
+
|
|
50
|
+
const getMsgs = getMessages();
|
|
51
|
+
|
|
52
|
+
const ICONS = {
|
|
53
|
+
info: 'heroicons:information-circle',
|
|
54
|
+
success: 'heroicons:check-circle',
|
|
55
|
+
warning: 'heroicons:exclamation-triangle',
|
|
56
|
+
error: 'heroicons:exclamation-circle'
|
|
57
|
+
} as const;
|
|
58
|
+
|
|
59
|
+
const resolvedRole = $derived(
|
|
60
|
+
role ?? (tone === 'error' || tone === 'warning' ? 'alert' : 'status')
|
|
61
|
+
);
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<div class="flowdrop-ui-notice flowdrop-ui-notice--{tone} {className}" role={resolvedRole}>
|
|
65
|
+
<span class="flowdrop-ui-notice__icon" aria-hidden="true">
|
|
66
|
+
<Icon icon={ICONS[tone]} />
|
|
67
|
+
</span>
|
|
68
|
+
<div class="flowdrop-ui-notice__content">
|
|
69
|
+
{#if title}
|
|
70
|
+
<p class="flowdrop-ui-notice__title">{title}</p>
|
|
71
|
+
{/if}
|
|
72
|
+
{#if children}
|
|
73
|
+
<div class="flowdrop-ui-notice__body">{@render children()}</div>
|
|
74
|
+
{/if}
|
|
75
|
+
{#if actions}
|
|
76
|
+
<div class="flowdrop-ui-notice__actions">{@render actions()}</div>
|
|
77
|
+
{/if}
|
|
78
|
+
</div>
|
|
79
|
+
{#if ondismiss}
|
|
80
|
+
<IconButton
|
|
81
|
+
size="sm"
|
|
82
|
+
class="flowdrop-ui-notice__dismiss"
|
|
83
|
+
ariaLabel={dismissLabel ?? getMsgs().notice.dismiss}
|
|
84
|
+
onclick={ondismiss}
|
|
85
|
+
>
|
|
86
|
+
<Icon icon="heroicons:x-mark" />
|
|
87
|
+
</IconButton>
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<style>
|
|
92
|
+
.flowdrop-ui-notice {
|
|
93
|
+
--_fg: var(--fd-info);
|
|
94
|
+
--_bg: var(--fd-info-muted);
|
|
95
|
+
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: flex-start;
|
|
98
|
+
gap: var(--fd-space-xs);
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: var(--fd-space-xs) var(--fd-space-md);
|
|
101
|
+
border: 1px solid color-mix(in srgb, var(--_fg) 35%, transparent);
|
|
102
|
+
border-radius: var(--fd-radius-lg);
|
|
103
|
+
background: var(--_bg);
|
|
104
|
+
color: var(--fd-foreground);
|
|
105
|
+
font-family: var(--fd-font-sans);
|
|
106
|
+
font-size: var(--fd-text-xsm);
|
|
107
|
+
line-height: 1.4;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.flowdrop-ui-notice--success {
|
|
111
|
+
--_fg: var(--fd-success);
|
|
112
|
+
--_bg: var(--fd-success-muted);
|
|
113
|
+
}
|
|
114
|
+
.flowdrop-ui-notice--warning {
|
|
115
|
+
--_fg: var(--fd-warning);
|
|
116
|
+
--_bg: var(--fd-warning-muted);
|
|
117
|
+
}
|
|
118
|
+
.flowdrop-ui-notice--error {
|
|
119
|
+
--_fg: var(--fd-error);
|
|
120
|
+
--_bg: var(--fd-error-muted);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.flowdrop-ui-notice__icon {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
flex: none;
|
|
126
|
+
margin-top: 1px;
|
|
127
|
+
color: var(--_fg);
|
|
128
|
+
font-size: var(--fd-text-base);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.flowdrop-ui-notice__content {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
gap: var(--fd-space-3xs);
|
|
135
|
+
min-width: 0;
|
|
136
|
+
flex: 1 1 auto;
|
|
137
|
+
overflow-wrap: anywhere;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.flowdrop-ui-notice__title {
|
|
141
|
+
margin: 0;
|
|
142
|
+
font-weight: 600;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.flowdrop-ui-notice__body {
|
|
146
|
+
color: var(--fd-foreground);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.flowdrop-ui-notice__actions {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-wrap: wrap;
|
|
152
|
+
gap: var(--fd-space-xs);
|
|
153
|
+
margin-top: var(--fd-space-3xs);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* The dismiss button hugs the corner: negative margin keeps the 24px target inside the padding. */
|
|
157
|
+
.flowdrop-ui-notice :global(.flowdrop-ui-notice__dismiss) {
|
|
158
|
+
flex: none;
|
|
159
|
+
margin: calc(var(--fd-space-3xs) * -1) calc(var(--fd-space-3xs) * -1) 0 0;
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Semantic tone; selects colour, icon and default ARIA role. */
|
|
4
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
/** Bold first line. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Body text / markup. */
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
/** Action buttons under the body. */
|
|
10
|
+
actions?: Snippet;
|
|
11
|
+
/** When set, a dismiss (x) button is shown and calls this. */
|
|
12
|
+
ondismiss?: () => void;
|
|
13
|
+
/** Accessible label of the dismiss button. Defaults to the localized "Dismiss". */
|
|
14
|
+
dismissLabel?: string;
|
|
15
|
+
/** Override the default ARIA role (alert for error/warning, status otherwise). */
|
|
16
|
+
role?: 'alert' | 'status' | 'note';
|
|
17
|
+
/** Extra classes on the root. */
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const Notice: import("svelte").Component<Props, {}, "">;
|
|
21
|
+
type Notice = ReturnType<typeof Notice>;
|
|
22
|
+
export default Notice;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
PanelHeader — the 40px strip at the top of a panel (docked Playground, AI
|
|
3
|
+
chat, Console, inspector/settings sheet).
|
|
4
|
+
|
|
5
|
+
Left: a `title` string or a free-form `leading` snippet (a workflow chip, a
|
|
6
|
+
back button...). Right: an `actions` snippet. An optional `subtitle` sits
|
|
7
|
+
under the title in smaller muted type. The title is a real heading
|
|
8
|
+
(`as`, default h2) styled small, so panels stay navigable by heading.
|
|
9
|
+
|
|
10
|
+
@internal Not exported from any package entry; the API may still change.
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import type { Snippet } from 'svelte';
|
|
15
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
16
|
+
|
|
17
|
+
interface Props extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title' | 'children'> {
|
|
18
|
+
/** Heading text. Not rendered when `leading` is given. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** Muted second line under the title. */
|
|
21
|
+
subtitle?: string;
|
|
22
|
+
/** `id` on the heading, for a dialog's `aria-labelledby`. */
|
|
23
|
+
titleId?: string;
|
|
24
|
+
/** Heading element for the title. Visual size is the same for all levels. */
|
|
25
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
26
|
+
/** Replaces the title block on the left (chip, back button, ...). */
|
|
27
|
+
leading?: Snippet;
|
|
28
|
+
/** Right-aligned controls (icon buttons, segmented, ...). */
|
|
29
|
+
actions?: Snippet;
|
|
30
|
+
/** Hide the bottom border (when the panel supplies its own divider). */
|
|
31
|
+
borderless?: boolean;
|
|
32
|
+
/** Extra classes on the root. */
|
|
33
|
+
class?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let {
|
|
37
|
+
title,
|
|
38
|
+
subtitle,
|
|
39
|
+
titleId,
|
|
40
|
+
as = 'h2',
|
|
41
|
+
leading,
|
|
42
|
+
actions,
|
|
43
|
+
borderless = false,
|
|
44
|
+
class: className = '',
|
|
45
|
+
...rest
|
|
46
|
+
}: Props = $props();
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<header
|
|
50
|
+
{...rest}
|
|
51
|
+
class="flowdrop-ui-panel-header {className}"
|
|
52
|
+
class:flowdrop-ui-panel-header--borderless={borderless}
|
|
53
|
+
>
|
|
54
|
+
<div class="flowdrop-ui-panel-header__lead">
|
|
55
|
+
{#if leading}
|
|
56
|
+
{@render leading()}
|
|
57
|
+
{:else if title}
|
|
58
|
+
<div class="flowdrop-ui-panel-header__text">
|
|
59
|
+
<svelte:element this={as} id={titleId} class="flowdrop-ui-panel-header__title"
|
|
60
|
+
>{title}</svelte:element
|
|
61
|
+
>
|
|
62
|
+
{#if subtitle}
|
|
63
|
+
<span class="flowdrop-ui-panel-header__subtitle">{subtitle}</span>
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
</div>
|
|
68
|
+
{#if actions}
|
|
69
|
+
<div class="flowdrop-ui-panel-header__actions">
|
|
70
|
+
{@render actions()}
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
73
|
+
</header>
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
.flowdrop-ui-panel-header {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
gap: var(--fd-space-xs);
|
|
81
|
+
flex: none;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
height: var(--fd-panel-header);
|
|
84
|
+
padding-inline: var(--fd-space-md);
|
|
85
|
+
border-bottom: 1px solid var(--fd-border);
|
|
86
|
+
background: var(--fd-panel-bg);
|
|
87
|
+
color: var(--fd-foreground);
|
|
88
|
+
font-family: var(--fd-font-sans);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.flowdrop-ui-panel-header--borderless {
|
|
92
|
+
border-bottom-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.flowdrop-ui-panel-header__lead {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: var(--fd-space-xs);
|
|
99
|
+
min-width: 0;
|
|
100
|
+
flex: 1 1 auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.flowdrop-ui-panel-header__text {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
min-width: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.flowdrop-ui-panel-header__title {
|
|
110
|
+
margin: 0;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
font-size: var(--fd-text-sm);
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
line-height: 1.2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.flowdrop-ui-panel-header__subtitle {
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
color: var(--fd-muted-foreground);
|
|
124
|
+
font-size: var(--fd-text-2xs);
|
|
125
|
+
line-height: 1.2;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.flowdrop-ui-panel-header__actions {
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: var(--fd-space-3xs);
|
|
132
|
+
flex: none;
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title' | 'children'> {
|
|
4
|
+
/** Heading text. Not rendered when `leading` is given. */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** Muted second line under the title. */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** `id` on the heading, for a dialog's `aria-labelledby`. */
|
|
9
|
+
titleId?: string;
|
|
10
|
+
/** Heading element for the title. Visual size is the same for all levels. */
|
|
11
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
12
|
+
/** Replaces the title block on the left (chip, back button, ...). */
|
|
13
|
+
leading?: Snippet;
|
|
14
|
+
/** Right-aligned controls (icon buttons, segmented, ...). */
|
|
15
|
+
actions?: Snippet;
|
|
16
|
+
/** Hide the bottom border (when the panel supplies its own divider). */
|
|
17
|
+
borderless?: boolean;
|
|
18
|
+
/** Extra classes on the root. */
|
|
19
|
+
class?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const PanelHeader: import("svelte").Component<Props, {}, "">;
|
|
22
|
+
type PanelHeader = ReturnType<typeof PanelHeader>;
|
|
23
|
+
export default PanelHeader;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Segmented primitive — a single-choice switch (e.g. Edit | Test).
|
|
3
|
+
|
|
4
|
+
role="radiogroup" with role="radio" items and a roving tabindex: Tab enters on
|
|
5
|
+
the selected option, Left/Right (Up/Down) move and select, Home/End jump.
|
|
6
|
+
|
|
7
|
+
@internal Not exported from any package entry; not public API yet.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import Icon from '@iconify/svelte';
|
|
12
|
+
|
|
13
|
+
interface SegmentedOption {
|
|
14
|
+
/** Value written to `value` when chosen */
|
|
15
|
+
value: string;
|
|
16
|
+
/** Visible label */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Optional Iconify icon name, e.g. `mdi:pencil` */
|
|
19
|
+
icon?: string;
|
|
20
|
+
/** Tooltip text */
|
|
21
|
+
title?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface Props {
|
|
25
|
+
/** Options, in order */
|
|
26
|
+
options: SegmentedOption[];
|
|
27
|
+
/** Selected option value (bindable) */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Called with the new value after the user changes the selection */
|
|
30
|
+
onchange?: (value: string) => void;
|
|
31
|
+
/** Height: `sm` = 24, `md` = 28 */
|
|
32
|
+
size?: 'sm' | 'md';
|
|
33
|
+
/** Accessible name of the group */
|
|
34
|
+
ariaLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* Float: the switch is itself a floating control (surface, rule and float
|
|
37
|
+
* elevation), as in the canvas toolbar. Look comes from `--fd-toolbar-segmented-*`.
|
|
38
|
+
*/
|
|
39
|
+
float?: boolean;
|
|
40
|
+
/** Extra classes appended to the root */
|
|
41
|
+
class?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let {
|
|
45
|
+
options,
|
|
46
|
+
value = $bindable(),
|
|
47
|
+
onchange,
|
|
48
|
+
size = 'md',
|
|
49
|
+
ariaLabel,
|
|
50
|
+
float = false,
|
|
51
|
+
class: className = ''
|
|
52
|
+
}: Props = $props();
|
|
53
|
+
|
|
54
|
+
let buttons: HTMLButtonElement[] = $state([]);
|
|
55
|
+
|
|
56
|
+
// The tab stop: the selected option, or the first when nothing is selected.
|
|
57
|
+
const tabStop = $derived(
|
|
58
|
+
options.some((o) => o.value === value) ? value : (options[0]?.value ?? undefined)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
function select(index: number, focus: boolean): void {
|
|
62
|
+
const next = options[index];
|
|
63
|
+
if (!next) return;
|
|
64
|
+
if (next.value !== value) {
|
|
65
|
+
value = next.value;
|
|
66
|
+
onchange?.(next.value);
|
|
67
|
+
}
|
|
68
|
+
if (focus) buttons[index]?.focus();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function onkeydown(event: KeyboardEvent, index: number): void {
|
|
72
|
+
const last = options.length - 1;
|
|
73
|
+
let target: number | null = null;
|
|
74
|
+
switch (event.key) {
|
|
75
|
+
case 'ArrowRight':
|
|
76
|
+
case 'ArrowDown':
|
|
77
|
+
target = index === last ? 0 : index + 1;
|
|
78
|
+
break;
|
|
79
|
+
case 'ArrowLeft':
|
|
80
|
+
case 'ArrowUp':
|
|
81
|
+
target = index === 0 ? last : index - 1;
|
|
82
|
+
break;
|
|
83
|
+
case 'Home':
|
|
84
|
+
target = 0;
|
|
85
|
+
break;
|
|
86
|
+
case 'End':
|
|
87
|
+
target = last;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (target === null) return;
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
select(target, true);
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<div
|
|
97
|
+
class="flowdrop-ui-segmented flowdrop-ui-segmented--{size} {className}"
|
|
98
|
+
class:flowdrop-ui-segmented--float={float}
|
|
99
|
+
role="radiogroup"
|
|
100
|
+
aria-label={ariaLabel}
|
|
101
|
+
>
|
|
102
|
+
{#each options as option, index (option.value)}
|
|
103
|
+
<button
|
|
104
|
+
bind:this={buttons[index]}
|
|
105
|
+
type="button"
|
|
106
|
+
role="radio"
|
|
107
|
+
class="flowdrop-ui-segmented__item"
|
|
108
|
+
class:flowdrop-ui-segmented__item--selected={option.value === value}
|
|
109
|
+
aria-checked={option.value === value}
|
|
110
|
+
tabindex={option.value === tabStop ? 0 : -1}
|
|
111
|
+
title={option.title}
|
|
112
|
+
onclick={() => select(index, false)}
|
|
113
|
+
onkeydown={(e) => onkeydown(e, index)}
|
|
114
|
+
>
|
|
115
|
+
{#if option.icon}
|
|
116
|
+
<Icon icon={option.icon} aria-hidden="true" />
|
|
117
|
+
{/if}
|
|
118
|
+
<span>{option.label}</span>
|
|
119
|
+
</button>
|
|
120
|
+
{/each}
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<style>
|
|
124
|
+
.flowdrop-ui-segmented {
|
|
125
|
+
display: inline-flex;
|
|
126
|
+
align-items: stretch;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
padding: var(--fd-space-3xs);
|
|
129
|
+
gap: var(--fd-space-3xs);
|
|
130
|
+
background-color: var(--fd-muted);
|
|
131
|
+
border: 1px solid var(--fd-border-muted);
|
|
132
|
+
border-radius: var(--fd-control-radius);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.flowdrop-ui-segmented__item {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
gap: var(--fd-space-2xs);
|
|
140
|
+
border: 0;
|
|
141
|
+
border-radius: var(--fd-radius-md);
|
|
142
|
+
background: transparent;
|
|
143
|
+
color: var(--fd-muted-foreground);
|
|
144
|
+
font-family: inherit;
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
line-height: 1;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
transition:
|
|
150
|
+
background-color var(--fd-transition-fast),
|
|
151
|
+
color var(--fd-transition-fast);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.flowdrop-ui-segmented--md .flowdrop-ui-segmented__item {
|
|
155
|
+
/* Control height minus the container padding and border */
|
|
156
|
+
height: calc(var(--fd-control-md) - var(--fd-space-2xs) - 2px);
|
|
157
|
+
padding: 0 var(--fd-space-md);
|
|
158
|
+
font-size: var(--fd-text-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.flowdrop-ui-segmented--sm .flowdrop-ui-segmented__item {
|
|
162
|
+
height: calc(var(--fd-control-sm) - var(--fd-space-2xs) - 2px);
|
|
163
|
+
padding: 0 var(--fd-space-xs);
|
|
164
|
+
font-size: var(--fd-text-xs);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Floating switch: a surface of its own over the canvas. */
|
|
168
|
+
.flowdrop-ui-segmented--float {
|
|
169
|
+
padding: 2px;
|
|
170
|
+
gap: 2px;
|
|
171
|
+
background-color: var(--fd-toolbar-segmented-bg);
|
|
172
|
+
border-color: var(--fd-toolbar-segmented-border);
|
|
173
|
+
border-radius: var(--fd-toolbar-segmented-radius);
|
|
174
|
+
box-shadow: var(--fd-elevation-float);
|
|
175
|
+
}
|
|
176
|
+
.flowdrop-ui-segmented--float .flowdrop-ui-segmented__item {
|
|
177
|
+
border-radius: var(--fd-toolbar-segment-radius);
|
|
178
|
+
}
|
|
179
|
+
.flowdrop-ui-segmented--float.flowdrop-ui-segmented--md .flowdrop-ui-segmented__item {
|
|
180
|
+
/* The switch is one canvas control tall: 2px padding and a 1px border each side */
|
|
181
|
+
height: calc(var(--fd-canvas-control) - 6px);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.flowdrop-ui-segmented__item:hover:not(.flowdrop-ui-segmented__item--selected) {
|
|
185
|
+
color: var(--fd-foreground);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.flowdrop-ui-segmented__item--selected {
|
|
189
|
+
background-color: var(--fd-background);
|
|
190
|
+
color: var(--fd-foreground);
|
|
191
|
+
box-shadow: var(--fd-shadow-sm);
|
|
192
|
+
}
|
|
193
|
+
.flowdrop-ui-segmented--float .flowdrop-ui-segmented__item--selected {
|
|
194
|
+
background-color: var(--fd-toolbar-segmented-selected-bg);
|
|
195
|
+
color: var(--fd-toolbar-segmented-selected-fg);
|
|
196
|
+
box-shadow: var(--fd-toolbar-segmented-selected-shadow);
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface SegmentedOption {
|
|
2
|
+
/** Value written to `value` when chosen */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Visible label */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Optional Iconify icon name, e.g. `mdi:pencil` */
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** Tooltip text */
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
/** Options, in order */
|
|
13
|
+
options: SegmentedOption[];
|
|
14
|
+
/** Selected option value (bindable) */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** Called with the new value after the user changes the selection */
|
|
17
|
+
onchange?: (value: string) => void;
|
|
18
|
+
/** Height: `sm` = 24, `md` = 28 */
|
|
19
|
+
size?: 'sm' | 'md';
|
|
20
|
+
/** Accessible name of the group */
|
|
21
|
+
ariaLabel: string;
|
|
22
|
+
/**
|
|
23
|
+
* Float: the switch is itself a floating control (surface, rule and float
|
|
24
|
+
* elevation), as in the canvas toolbar. Look comes from `--fd-toolbar-segmented-*`.
|
|
25
|
+
*/
|
|
26
|
+
float?: boolean;
|
|
27
|
+
/** Extra classes appended to the root */
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
30
|
+
declare const Segmented: import("svelte").Component<Props, {}, "value">;
|
|
31
|
+
type Segmented = ReturnType<typeof Segmented>;
|
|
32
|
+
export default Segmented;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Select — typed wrapper over the shared `.flowdrop-input` system (base.css).
|
|
3
|
+
|
|
4
|
+
One API, two renderings. Give it `options` and it picks: a short, flat list of
|
|
5
|
+
plain options (10 or fewer, no groups, no descriptions) is the browser's own
|
|
6
|
+
`<select>`; anything longer, grouped or described is a searchable `Combobox`
|
|
7
|
+
(filter as you type, highlighted matches, "n of m", grouped). `searchable`
|
|
8
|
+
forces one rendering or the other. See `utils/selectOptions.ts`.
|
|
9
|
+
|
|
10
|
+
Native rendering: the field shell (`.flowdrop-input .flowdrop-input--select`)
|
|
11
|
+
plus a built-in chevron overlay (`.flowdrop-select-wrap`), so selects match the
|
|
12
|
+
exact look of Input/Textarea. Where the browser supports
|
|
13
|
+
`appearance: base-select` its list is styled to match (base.css); elsewhere
|
|
14
|
+
it keeps the platform's list, which follows the editor's `color-scheme`.
|
|
15
|
+
Native attributes (value, disabled, id, aria-*, onchange…) forward to the
|
|
16
|
+
underlying <select>.
|
|
17
|
+
|
|
18
|
+
Without `options`, pass <option>/<optgroup> as children: that is always the
|
|
19
|
+
native rendering (there is nothing to search).
|
|
20
|
+
|
|
21
|
+
Internal for now; see Button.svelte / Input.svelte for the pattern.
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import type { Snippet } from 'svelte';
|
|
26
|
+
import type { HTMLSelectAttributes } from 'svelte/elements';
|
|
27
|
+
import Combobox from './Combobox.svelte';
|
|
28
|
+
import { selectRendering, type SelectOption } from '../../utils/selectOptions.js';
|
|
29
|
+
|
|
30
|
+
// Omit native numeric `size` so our design-token size (matching Button) wins.
|
|
31
|
+
interface Props extends Omit<HTMLSelectAttributes, 'size' | 'children' | 'value'> {
|
|
32
|
+
/** Size — `md` is the base; `sm`/`lg` add a modifier */
|
|
33
|
+
size?: 'sm' | 'md' | 'lg';
|
|
34
|
+
/** Renders the error-border state */
|
|
35
|
+
invalid?: boolean;
|
|
36
|
+
/** Extra classes appended to the <select> */
|
|
37
|
+
class?: string;
|
|
38
|
+
/** The <option>/<optgroup> elements (when `options` is not given) */
|
|
39
|
+
children?: Snippet;
|
|
40
|
+
/** The options as data; lets the Select choose its rendering. */
|
|
41
|
+
options?: SelectOption[];
|
|
42
|
+
/** Force the searchable rendering (true) or the native one (false). Default: from the options. */
|
|
43
|
+
searchable?: boolean;
|
|
44
|
+
/** Selected value. */
|
|
45
|
+
value?: HTMLSelectAttributes['value'];
|
|
46
|
+
/** Runs with the new value when the user picks an option (either rendering). */
|
|
47
|
+
onValueChange?: (value: string) => void;
|
|
48
|
+
/** Shown in the closed field when nothing is selected. */
|
|
49
|
+
placeholder?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let {
|
|
53
|
+
size = 'md',
|
|
54
|
+
invalid = false,
|
|
55
|
+
class: className = '',
|
|
56
|
+
children,
|
|
57
|
+
options,
|
|
58
|
+
searchable,
|
|
59
|
+
value,
|
|
60
|
+
onValueChange,
|
|
61
|
+
placeholder,
|
|
62
|
+
...rest
|
|
63
|
+
}: Props = $props();
|
|
64
|
+
|
|
65
|
+
const rendering = $derived(options ? selectRendering(options, searchable) : 'native');
|
|
66
|
+
const hasValue = $derived(options?.some((o) => o.value === value) ?? false);
|
|
67
|
+
|
|
68
|
+
const selectClass = $derived(
|
|
69
|
+
[
|
|
70
|
+
'flowdrop-input',
|
|
71
|
+
'flowdrop-input--select',
|
|
72
|
+
size === 'md' ? '' : `flowdrop-input--${size}`,
|
|
73
|
+
invalid ? 'flowdrop-input--invalid' : '',
|
|
74
|
+
className
|
|
75
|
+
]
|
|
76
|
+
.filter(Boolean)
|
|
77
|
+
.join(' ')
|
|
78
|
+
);
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
{#if options && rendering === 'combobox'}
|
|
82
|
+
<Combobox
|
|
83
|
+
{options}
|
|
84
|
+
value={value == null ? '' : String(value)}
|
|
85
|
+
{onValueChange}
|
|
86
|
+
{size}
|
|
87
|
+
{invalid}
|
|
88
|
+
{placeholder}
|
|
89
|
+
class={className}
|
|
90
|
+
id={rest.id ?? undefined}
|
|
91
|
+
name={rest.name ?? undefined}
|
|
92
|
+
disabled={rest.disabled ?? false}
|
|
93
|
+
aria-label={rest['aria-label'] ?? undefined}
|
|
94
|
+
aria-labelledby={rest['aria-labelledby'] ?? undefined}
|
|
95
|
+
aria-describedby={rest['aria-describedby'] ?? undefined}
|
|
96
|
+
aria-required={rest['aria-required'] ?? undefined}
|
|
97
|
+
/>
|
|
98
|
+
{:else}
|
|
99
|
+
<div class="flowdrop-select-wrap">
|
|
100
|
+
<select
|
|
101
|
+
class={selectClass}
|
|
102
|
+
{...rest}
|
|
103
|
+
{...value !== undefined ? { value } : {}}
|
|
104
|
+
onchange={(event) => {
|
|
105
|
+
// `rest.onchange` is the caller's handler (an event handler, or a list of them).
|
|
106
|
+
const handler = rest.onchange as ((e: Event) => void) | null | undefined;
|
|
107
|
+
handler?.(event);
|
|
108
|
+
onValueChange?.(event.currentTarget.value);
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{#if options}
|
|
112
|
+
{#if placeholder !== undefined && !hasValue}
|
|
113
|
+
<option value="" disabled hidden selected>{placeholder}</option>
|
|
114
|
+
{/if}
|
|
115
|
+
{#each options as option (option.value)}
|
|
116
|
+
<option value={option.value} disabled={option.disabled} selected={option.value === value}>
|
|
117
|
+
{option.label}
|
|
118
|
+
</option>
|
|
119
|
+
{/each}
|
|
120
|
+
{:else}
|
|
121
|
+
{@render children?.()}
|
|
122
|
+
{/if}
|
|
123
|
+
</select>
|
|
124
|
+
<span class="flowdrop-select-wrap__icon" aria-hidden="true">
|
|
125
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
126
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 9l6 6 6-6" />
|
|
127
|
+
</svg>
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
{/if}
|