@flowdrop/flowdrop 1.5.0 → 1.6.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/README.md +46 -47
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +26 -26
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/AgentSpecAdapter.js +122 -133
- package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/agentAdapter.js +10 -10
- package/dist/adapters/agentspec/autoLayout.d.ts +1 -1
- package/dist/adapters/agentspec/autoLayout.js +7 -9
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +1 -1
- package/dist/adapters/agentspec/componentTypeDefaults.js +120 -120
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +2 -2
- package/dist/adapters/agentspec/defaultNodeTypes.js +307 -307
- package/dist/adapters/agentspec/index.d.ts +10 -10
- package/dist/adapters/agentspec/index.js +6 -6
- package/dist/adapters/agentspec/validator.d.ts +2 -2
- package/dist/adapters/agentspec/validator.js +20 -22
- package/dist/api/enhanced-client.d.ts +3 -3
- package/dist/api/enhanced-client.js +72 -73
- package/dist/chat/commandClassifier.js +6 -6
- package/dist/chat/index.d.ts +5 -5
- package/dist/chat/index.js +4 -4
- package/dist/chat/responseParser.d.ts +6 -6
- package/dist/chat/responseParser.js +28 -24
- package/dist/commands/batch.d.ts +1 -1
- package/dist/commands/batch.js +5 -7
- package/dist/commands/executor.d.ts +2 -2
- package/dist/commands/executor.js +320 -231
- package/dist/commands/index.d.ts +6 -6
- package/dist/commands/index.js +5 -5
- package/dist/commands/parser.d.ts +1 -1
- package/dist/commands/parser.js +91 -74
- package/dist/commands/positioner.d.ts +2 -2
- package/dist/commands/positioner.js +1 -1
- package/dist/commands/storeIntegration.svelte.d.ts +2 -2
- package/dist/commands/storeIntegration.svelte.js +5 -5
- package/dist/commands/types.d.ts +42 -42
- package/dist/commands/types.js +2 -2
- package/dist/components/App.svelte +240 -294
- package/dist/components/App.svelte.d.ts +9 -9
- package/dist/components/CanvasBanner.stories.svelte +10 -16
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/CanvasBanner.svelte +2 -2
- package/dist/components/CanvasBanner.svelte.d.ts +1 -1
- package/dist/components/CanvasController.svelte +3 -4
- package/dist/components/ConfigForm.svelte +118 -256
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigMappingRow.svelte +7 -9
- package/dist/components/ConfigMappingRow.svelte.d.ts +1 -1
- package/dist/components/ConfigModal.svelte +3 -3
- package/dist/components/ConfigModal.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +19 -19
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.svelte +9 -20
- package/dist/components/ConfigPanel.svelte.d.ts +1 -1
- package/dist/components/ConnectionLine.svelte +4 -4
- package/dist/components/EdgeRefresher.svelte +1 -1
- package/dist/components/FlowDropEdge.stories.svelte +110 -110
- package/dist/components/FlowDropEdge.svelte +9 -9
- package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
- package/dist/components/FlowDropZone.svelte +6 -9
- package/dist/components/FlowDropZone.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +13 -13
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.svelte +3 -3
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +4 -4
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +3 -9
- package/dist/components/LogsSidebar.svelte +41 -48
- package/dist/components/LogsSidebar.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +10 -14
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.svelte +4 -6
- package/dist/components/Navbar.stories.svelte +19 -19
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +28 -49
- package/dist/components/Navbar.svelte.d.ts +2 -2
- package/dist/components/NodeSidebar.svelte +42 -88
- package/dist/components/NodeSidebar.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.stories.svelte +19 -31
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +40 -55
- package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
- package/dist/components/NodeSwapPicker.svelte +20 -64
- package/dist/components/NodeSwapPicker.svelte.d.ts +1 -1
- package/dist/components/PipelineStatus.svelte +63 -89
- package/dist/components/PipelineStatus.svelte.d.ts +4 -4
- package/dist/components/PortCoordinateTracker.svelte +5 -7
- package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
- package/dist/components/PortMappingRow.svelte +20 -24
- package/dist/components/PortMappingRow.svelte.d.ts +2 -2
- package/dist/components/ReadOnlyDetails.svelte +1 -1
- package/dist/components/SchemaForm.stories.svelte +53 -53
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +24 -51
- package/dist/components/SchemaForm.svelte.d.ts +2 -2
- package/dist/components/SettingsModal.svelte +6 -9
- package/dist/components/SettingsModal.svelte.d.ts +1 -1
- package/dist/components/SettingsPanel.svelte +138 -158
- package/dist/components/SettingsPanel.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.stories.svelte +16 -29
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +19 -19
- package/dist/components/StatusIcon.svelte.d.ts +2 -2
- package/dist/components/StatusLabel.stories.svelte +8 -8
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/SwapMappingEditor.svelte +35 -56
- package/dist/components/SwapMappingEditor.svelte.d.ts +2 -2
- package/dist/components/ThemeToggle.stories.svelte +10 -10
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.svelte +22 -33
- package/dist/components/ThemeToggle.svelte.d.ts +1 -1
- package/dist/components/UniversalNode.svelte +29 -41
- package/dist/components/UniversalNode.svelte.d.ts +3 -3
- package/dist/components/WorkflowEditor.svelte +113 -168
- package/dist/components/WorkflowEditor.svelte.d.ts +4 -4
- package/dist/components/chat/AIChatPanel.svelte +272 -133
- package/dist/components/chat/AIChatPanel.svelte.d.ts +3 -3
- package/dist/components/chat/CommandPreview.svelte +74 -24
- package/dist/components/chat/CommandPreview.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.stories.svelte +71 -53
- package/dist/components/console/CommandConsole.stories.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.svelte +39 -35
- package/dist/components/console/CommandConsole.svelte.d.ts +2 -2
- package/dist/components/console/ConsoleAutocomplete.svelte +6 -3
- package/dist/components/console/ConsoleInput.svelte +148 -89
- package/dist/components/console/ConsoleInput.svelte.d.ts +1 -1
- package/dist/components/console/ConsoleOutput.svelte +5 -10
- package/dist/components/console/ConsoleOutput.svelte.d.ts +1 -1
- package/dist/components/console/formatters.d.ts +1 -1
- package/dist/components/console/formatters.js +27 -29
- package/dist/components/form/FormArray.svelte +75 -132
- package/dist/components/form/FormArray.svelte.d.ts +1 -1
- package/dist/components/form/FormAutocomplete.svelte +65 -108
- package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -16
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.svelte +2 -2
- package/dist/components/form/FormCodeEditor.svelte +42 -56
- package/dist/components/form/FormField.svelte +79 -90
- package/dist/components/form/FormField.svelte.d.ts +2 -2
- package/dist/components/form/FormFieldLight.svelte +72 -88
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.stories.svelte +14 -14
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.svelte +2 -9
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldset.svelte +3 -3
- package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
- package/dist/components/form/FormMarkdownEditor.svelte +123 -156
- package/dist/components/form/FormNumberField.stories.svelte +18 -18
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +6 -6
- package/dist/components/form/FormRangeField.stories.svelte +13 -13
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.svelte +4 -12
- package/dist/components/form/FormSelect.stories.svelte +21 -21
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.svelte +5 -5
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +126 -175
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.stories.svelte +17 -23
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +4 -4
- package/dist/components/form/FormTextarea.stories.svelte +18 -21
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.svelte +4 -4
- package/dist/components/form/FormToggle.stories.svelte +13 -16
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.svelte +3 -3
- package/dist/components/form/FormUISchemaRenderer.svelte +12 -19
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +3 -3
- package/dist/components/form/index.d.ts +19 -19
- package/dist/components/form/index.js +18 -18
- package/dist/components/form/templateAutocomplete.d.ts +2 -2
- package/dist/components/form/templateAutocomplete.js +55 -64
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.js +4 -9
- package/dist/components/icons/AlertCircleIcon.svelte +1 -6
- package/dist/components/icons/CogIcon.svelte +1 -6
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +27 -27
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +17 -41
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +17 -17
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.svelte +10 -16
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/FormPrompt.svelte +10 -15
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/InterruptBubble.svelte +87 -121
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +37 -37
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +55 -75
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +16 -17
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +13 -18
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/index.d.ts +6 -6
- package/dist/components/interrupt/index.js +6 -6
- package/dist/components/layouts/MainLayout.svelte +46 -84
- package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
- package/dist/components/nodes/GatewayNode.stories.svelte +64 -65
- package/dist/components/nodes/GatewayNode.svelte +37 -70
- package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
- package/dist/components/nodes/IdeaNode.stories.svelte +25 -26
- package/dist/components/nodes/IdeaNode.svelte +22 -36
- package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
- package/dist/components/nodes/NotesNode.stories.svelte +37 -38
- package/dist/components/nodes/NotesNode.svelte +28 -39
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SimpleNode.stories.svelte +137 -138
- package/dist/components/nodes/SimpleNode.svelte +44 -74
- package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SquareNode.stories.svelte +75 -75
- package/dist/components/nodes/SquareNode.svelte +42 -68
- package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
- package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
- package/dist/components/nodes/TerminalNode.svelte +74 -112
- package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
- package/dist/components/nodes/ToolNode.stories.svelte +115 -116
- package/dist/components/nodes/ToolNode.svelte +31 -64
- package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.stories.svelte +84 -89
- package/dist/components/nodes/WorkflowNode.svelte +50 -103
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
- package/dist/components/playground/ChatPanel.svelte +47 -103
- package/dist/components/playground/ExecutionLogs.svelte +45 -68
- package/dist/components/playground/InputCollector.svelte +32 -51
- package/dist/components/playground/MessageBubble.stories.svelte +25 -25
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/MessageBubble.svelte +54 -70
- package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +60 -91
- package/dist/components/playground/Playground.svelte.d.ts +3 -3
- package/dist/components/playground/PlaygroundModal.svelte +8 -12
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
- package/dist/components/playground/SessionManager.svelte +34 -40
- package/dist/components/playground/SessionManager.svelte.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.js +20 -20
- package/dist/config/constants.js +2 -2
- package/dist/config/defaultCategories.d.ts +1 -1
- package/dist/config/defaultCategories.js +86 -86
- package/dist/config/defaultPortConfig.d.ts +1 -1
- package/dist/config/defaultPortConfig.js +144 -144
- package/dist/config/endpoints.d.ts +4 -4
- package/dist/config/endpoints.js +68 -68
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +68 -68
- package/dist/core/index.js +38 -38
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +64 -64
- package/dist/editor/index.js +54 -54
- package/dist/form/code.d.ts +5 -5
- package/dist/form/code.js +14 -14
- package/dist/form/fieldRegistry.d.ts +3 -3
- package/dist/form/fieldRegistry.js +9 -11
- package/dist/form/full.d.ts +8 -8
- package/dist/form/full.js +9 -9
- package/dist/form/index.d.ts +18 -18
- package/dist/form/index.js +16 -16
- package/dist/form/markdown.d.ts +4 -4
- package/dist/form/markdown.js +8 -8
- package/dist/helpers/proximityConnect.d.ts +3 -3
- package/dist/helpers/proximityConnect.js +32 -34
- package/dist/helpers/workflowEditorHelper.d.ts +6 -6
- package/dist/helpers/workflowEditorHelper.js +64 -68
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/mocks/app-environment.js +2 -2
- package/dist/mocks/app-forms.js +1 -1
- package/dist/mocks/app-navigation.js +2 -2
- package/dist/mocks/app-stores.js +3 -3
- package/dist/playground/index.d.ts +19 -19
- package/dist/playground/index.js +16 -16
- package/dist/playground/mount.d.ts +3 -3
- package/dist/playground/mount.js +24 -24
- package/dist/registry/builtinFormats.js +13 -13
- package/dist/registry/builtinNodes.d.ts +2 -2
- package/dist/registry/builtinNodes.js +77 -77
- package/dist/registry/index.d.ts +4 -4
- package/dist/registry/index.js +4 -4
- package/dist/registry/nodeComponentRegistry.d.ts +8 -8
- package/dist/registry/nodeComponentRegistry.js +9 -11
- package/dist/registry/plugin.d.ts +2 -2
- package/dist/registry/plugin.js +11 -11
- package/dist/registry/workflowFormatRegistry.d.ts +3 -3
- package/dist/registry/workflowFormatRegistry.js +2 -2
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/services/agentSpecExecutionService.d.ts +3 -3
- package/dist/services/agentSpecExecutionService.js +55 -56
- package/dist/services/api.d.ts +2 -2
- package/dist/services/api.js +37 -37
- package/dist/services/apiVariableService.d.ts +1 -1
- package/dist/services/apiVariableService.js +34 -41
- package/dist/services/autoSaveService.js +8 -8
- package/dist/services/categoriesApi.d.ts +2 -2
- package/dist/services/categoriesApi.js +8 -8
- package/dist/services/chatService.d.ts +1 -1
- package/dist/services/chatService.js +18 -18
- package/dist/services/draftStorage.d.ts +1 -1
- package/dist/services/draftStorage.js +11 -11
- package/dist/services/dynamicSchemaService.d.ts +1 -1
- package/dist/services/dynamicSchemaService.js +39 -41
- package/dist/services/globalSave.d.ts +2 -2
- package/dist/services/globalSave.js +38 -41
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/historyService.js +10 -10
- package/dist/services/interruptService.d.ts +1 -1
- package/dist/services/interruptService.js +29 -35
- package/dist/services/nodeExecutionService.d.ts +1 -1
- package/dist/services/nodeExecutionService.js +44 -45
- package/dist/services/playgroundService.d.ts +1 -1
- package/dist/services/playgroundService.js +29 -29
- package/dist/services/portConfigApi.d.ts +2 -2
- package/dist/services/portConfigApi.js +8 -8
- package/dist/services/settingsService.d.ts +2 -2
- package/dist/services/settingsService.js +19 -25
- package/dist/services/toastService.d.ts +4 -4
- package/dist/services/toastService.js +33 -33
- package/dist/services/variableService.d.ts +1 -1
- package/dist/services/variableService.js +36 -36
- package/dist/services/workflowStorage.d.ts +2 -2
- package/dist/services/workflowStorage.js +13 -13
- package/dist/settings/index.d.ts +7 -7
- package/dist/settings/index.js +6 -6
- package/dist/skins/default.d.ts +1 -1
- package/dist/skins/default.js +1 -1
- package/dist/skins/index.d.ts +3 -3
- package/dist/skins/index.js +7 -7
- package/dist/skins/slate.d.ts +1 -1
- package/dist/skins/slate.js +69 -69
- package/dist/stores/categoriesStore.svelte.d.ts +1 -1
- package/dist/stores/categoriesStore.svelte.js +5 -5
- package/dist/stores/editorStateMachine.svelte.d.ts +2 -2
- package/dist/stores/editorStateMachine.svelte.js +34 -34
- package/dist/stores/historyStore.svelte.d.ts +4 -4
- package/dist/stores/historyStore.svelte.js +4 -4
- package/dist/stores/interruptStore.svelte.d.ts +3 -3
- package/dist/stores/interruptStore.svelte.js +21 -21
- package/dist/stores/playgroundStore.svelte.d.ts +2 -2
- package/dist/stores/playgroundStore.svelte.js +18 -21
- package/dist/stores/portCoordinateStore.svelte.d.ts +2 -2
- package/dist/stores/portCoordinateStore.svelte.js +10 -13
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +57 -62
- package/dist/stores/workflowStore.svelte.d.ts +3 -3
- package/dist/stores/workflowStore.svelte.js +46 -47
- package/dist/stories/CanvasDecorator.svelte +7 -10
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/EdgeDecorator.svelte +28 -31
- package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
- package/dist/stories/NodeDecorator.svelte +14 -20
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +89 -93
- package/dist/styles/base.css +16 -50
- package/dist/styles/tokens.css +10 -28
- package/dist/svelte-app.d.ts +10 -10
- package/dist/svelte-app.js +39 -39
- package/dist/themes/default.d.ts +1 -1
- package/dist/themes/default.js +4 -4
- package/dist/themes/index.d.ts +3 -3
- package/dist/themes/index.js +11 -11
- package/dist/themes/minimal.d.ts +1 -1
- package/dist/themes/minimal.js +5 -5
- package/dist/types/agentspec.d.ts +18 -18
- package/dist/types/agentspec.js +2 -2
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/auth.js +6 -6
- package/dist/types/chat.d.ts +2 -2
- package/dist/types/config.d.ts +6 -6
- package/dist/types/events.d.ts +3 -3
- package/dist/types/events.js +2 -2
- package/dist/types/index.d.ts +32 -32
- package/dist/types/index.js +6 -6
- package/dist/types/interrupt.d.ts +6 -6
- package/dist/types/interrupt.js +21 -21
- package/dist/types/interruptState.d.ts +12 -12
- package/dist/types/interruptState.js +66 -66
- package/dist/types/playground.d.ts +7 -7
- package/dist/types/playground.js +14 -14
- package/dist/types/settings.d.ts +7 -5
- package/dist/types/settings.js +19 -24
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +2 -2
- package/dist/types/uischema.d.ts +4 -4
- package/dist/types/uischema.js +3 -3
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.js +95 -97
- package/dist/utils/config.d.ts +2 -2
- package/dist/utils/config.js +48 -48
- package/dist/utils/connections.d.ts +2 -2
- package/dist/utils/connections.js +15 -15
- package/dist/utils/edgeStyling.d.ts +2 -2
- package/dist/utils/edgeStyling.js +36 -39
- package/dist/utils/errors.js +3 -3
- package/dist/utils/fetchWithAuth.d.ts +1 -1
- package/dist/utils/fetchWithAuth.js +2 -2
- package/dist/utils/handleIds.d.ts +2 -2
- package/dist/utils/handleIds.js +8 -8
- package/dist/utils/handlePositioning.d.ts +1 -1
- package/dist/utils/handlePositioning.js +2 -2
- package/dist/utils/icons.d.ts +1 -1
- package/dist/utils/icons.js +74 -74
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.js +7 -7
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeSwap.d.ts +9 -9
- package/dist/utils/nodeSwap.js +52 -58
- package/dist/utils/nodeTypes.d.ts +1 -1
- package/dist/utils/nodeTypes.js +20 -21
- package/dist/utils/nodeWrapper.d.ts +7 -7
- package/dist/utils/nodeWrapper.js +19 -21
- package/dist/utils/performanceUtils.d.ts +1 -1
- package/dist/utils/performanceUtils.js +1 -2
- package/dist/utils/portUtils.d.ts +2 -2
- package/dist/utils/portUtils.js +1 -1
- package/dist/utils/sanitize.js +1 -1
- package/dist/utils/uischema.d.ts +2 -2
- package/dist/utils/uischema.js +8 -8
- package/dist/utils/validation.js +8 -8
- package/package.json +7 -11
|
@@ -17,27 +17,14 @@
|
|
|
17
17
|
-->
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import { onMount, onDestroy } from
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
history,
|
|
30
|
-
historyKeymap,
|
|
31
|
-
defaultKeymap,
|
|
32
|
-
indentWithTab,
|
|
33
|
-
} from "@codemirror/commands";
|
|
34
|
-
import { highlightSpecialChars, highlightActiveLine } from "@codemirror/view";
|
|
35
|
-
import {
|
|
36
|
-
syntaxHighlighting,
|
|
37
|
-
defaultHighlightStyle,
|
|
38
|
-
} from "@codemirror/language";
|
|
39
|
-
import { markdown } from "@codemirror/lang-markdown";
|
|
40
|
-
import { oneDark } from "@codemirror/theme-one-dark";
|
|
20
|
+
import { onMount, onDestroy } from 'svelte';
|
|
21
|
+
import { EditorView, lineNumbers, drawSelection, keymap } from '@codemirror/view';
|
|
22
|
+
import { EditorState, Compartment } from '@codemirror/state';
|
|
23
|
+
import { history, historyKeymap, defaultKeymap, indentWithTab } from '@codemirror/commands';
|
|
24
|
+
import { highlightSpecialChars, highlightActiveLine } from '@codemirror/view';
|
|
25
|
+
import { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
|
|
26
|
+
import { markdown } from '@codemirror/lang-markdown';
|
|
27
|
+
import { oneDark } from '@codemirror/theme-one-dark';
|
|
41
28
|
|
|
42
29
|
interface Props {
|
|
43
30
|
/** Field identifier */
|
|
@@ -72,10 +59,10 @@
|
|
|
72
59
|
|
|
73
60
|
let {
|
|
74
61
|
id,
|
|
75
|
-
value =
|
|
76
|
-
placeholder =
|
|
62
|
+
value = '',
|
|
63
|
+
placeholder = 'Write your markdown here...',
|
|
77
64
|
required = false,
|
|
78
|
-
height =
|
|
65
|
+
height = '300px',
|
|
79
66
|
showToolbar = true,
|
|
80
67
|
showStatusBar = true,
|
|
81
68
|
spellChecker = false,
|
|
@@ -84,7 +71,7 @@
|
|
|
84
71
|
disabled = false,
|
|
85
72
|
darkTheme = false,
|
|
86
73
|
ariaDescribedBy,
|
|
87
|
-
onChange
|
|
74
|
+
onChange
|
|
88
75
|
}: Props = $props();
|
|
89
76
|
|
|
90
77
|
/** Reference to the editor container element */
|
|
@@ -128,22 +115,20 @@
|
|
|
128
115
|
image:
|
|
129
116
|
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="16" height="16"><path fill-rule="evenodd" d="M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0L2.5 11.06Zm6.5-3.31a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z" clip-rule="evenodd"/></svg>',
|
|
130
117
|
table:
|
|
131
|
-
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="16" height="16"><path fill-rule="evenodd" d="M.99 5.24A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm8.26 4.51v3.75h1.5v-3.75h-1.5Zm1.5-1.5v-3.75h-1.5v3.75h1.5Zm-3-3.75H3.25a.75.75 0 0 0-.75.75v3h5.25v-3.75Zm-5.25 5.25v3.75c0 .414.336.75.75.75h4.5v-4.5H2.5Zm14.5 0h-5.25v4.5h4.5a.75.75 0 0 0 .75-.75v-3.75Zm0-1.5v-3a.75.75 0 0 0-.75-.75h-4.5v3.75H17Z" clip-rule="evenodd"/></svg>'
|
|
118
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" width="16" height="16"><path fill-rule="evenodd" d="M.99 5.24A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm8.26 4.51v3.75h1.5v-3.75h-1.5Zm1.5-1.5v-3.75h-1.5v3.75h1.5Zm-3-3.75H3.25a.75.75 0 0 0-.75.75v3h5.25v-3.75Zm-5.25 5.25v3.75c0 .414.336.75.75.75h4.5v-4.5H2.5Zm14.5 0h-5.25v4.5h4.5a.75.75 0 0 0 .75-.75v-3.75Zm0-1.5v-3a.75.75 0 0 0-.75-.75h-4.5v3.75H17Z" clip-rule="evenodd"/></svg>'
|
|
132
119
|
};
|
|
133
120
|
|
|
134
121
|
function wrapSelection(before: string, after: string) {
|
|
135
122
|
if (!editorView) return;
|
|
136
123
|
const { from, to } = editorView.state.selection.main;
|
|
137
124
|
const selected = editorView.state.sliceDoc(from, to);
|
|
138
|
-
const replacement = `${before}${selected ||
|
|
125
|
+
const replacement = `${before}${selected || 'text'}${after}`;
|
|
139
126
|
editorView.dispatch({
|
|
140
127
|
changes: { from, to, insert: replacement },
|
|
141
128
|
selection: {
|
|
142
129
|
anchor: selected ? from + before.length : from + before.length,
|
|
143
|
-
head: selected
|
|
144
|
-
|
|
145
|
-
: from + before.length + 4,
|
|
146
|
-
},
|
|
130
|
+
head: selected ? from + before.length + selected.length : from + before.length + 4
|
|
131
|
+
}
|
|
147
132
|
});
|
|
148
133
|
editorView.focus();
|
|
149
134
|
}
|
|
@@ -157,14 +142,14 @@
|
|
|
157
142
|
// If already has this prefix, remove it (toggle)
|
|
158
143
|
if (currentText.startsWith(prefix)) {
|
|
159
144
|
editorView.dispatch({
|
|
160
|
-
changes: { from: line.from, to: line.from + prefix.length, insert:
|
|
145
|
+
changes: { from: line.from, to: line.from + prefix.length, insert: '' }
|
|
161
146
|
});
|
|
162
147
|
} else {
|
|
163
148
|
// Remove any existing heading prefix before adding new one
|
|
164
149
|
const headingMatch = currentText.match(/^#{1,6}\s/);
|
|
165
150
|
const removeLen = headingMatch ? headingMatch[0].length : 0;
|
|
166
151
|
editorView.dispatch({
|
|
167
|
-
changes: { from: line.from, to: line.from + removeLen, insert: prefix }
|
|
152
|
+
changes: { from: line.from, to: line.from + removeLen, insert: prefix }
|
|
168
153
|
});
|
|
169
154
|
}
|
|
170
155
|
editorView.focus();
|
|
@@ -175,110 +160,108 @@
|
|
|
175
160
|
const { from, to } = editorView.state.selection.main;
|
|
176
161
|
editorView.dispatch({
|
|
177
162
|
changes: { from, to, insert: text },
|
|
178
|
-
selection: { anchor: from + text.length }
|
|
163
|
+
selection: { anchor: from + text.length }
|
|
179
164
|
});
|
|
180
165
|
editorView.focus();
|
|
181
166
|
}
|
|
182
167
|
|
|
183
|
-
const toolbarActions: (ToolbarAction |
|
|
168
|
+
const toolbarActions: (ToolbarAction | '|')[] = [
|
|
184
169
|
{
|
|
185
|
-
id:
|
|
186
|
-
label:
|
|
187
|
-
icon:
|
|
188
|
-
shortcut:
|
|
189
|
-
action: () => wrapSelection(
|
|
170
|
+
id: 'bold',
|
|
171
|
+
label: 'Bold',
|
|
172
|
+
icon: 'B',
|
|
173
|
+
shortcut: 'Mod-b',
|
|
174
|
+
action: () => wrapSelection('**', '**')
|
|
190
175
|
},
|
|
191
176
|
{
|
|
192
|
-
id:
|
|
193
|
-
label:
|
|
194
|
-
icon:
|
|
195
|
-
shortcut:
|
|
196
|
-
action: () => wrapSelection(
|
|
177
|
+
id: 'italic',
|
|
178
|
+
label: 'Italic',
|
|
179
|
+
icon: 'I',
|
|
180
|
+
shortcut: 'Mod-i',
|
|
181
|
+
action: () => wrapSelection('_', '_')
|
|
197
182
|
},
|
|
198
183
|
{
|
|
199
|
-
id:
|
|
200
|
-
label:
|
|
201
|
-
icon:
|
|
202
|
-
action: () => wrapSelection(
|
|
184
|
+
id: 'strikethrough',
|
|
185
|
+
label: 'Strikethrough',
|
|
186
|
+
icon: 'S',
|
|
187
|
+
action: () => wrapSelection('~~', '~~')
|
|
203
188
|
},
|
|
204
|
-
|
|
189
|
+
'|',
|
|
205
190
|
{
|
|
206
|
-
id:
|
|
207
|
-
label:
|
|
208
|
-
icon:
|
|
209
|
-
action: () => prefixLine(
|
|
191
|
+
id: 'heading-1',
|
|
192
|
+
label: 'Heading 1',
|
|
193
|
+
icon: 'H1',
|
|
194
|
+
action: () => prefixLine('# ')
|
|
210
195
|
},
|
|
211
196
|
{
|
|
212
|
-
id:
|
|
213
|
-
label:
|
|
214
|
-
icon:
|
|
215
|
-
action: () => prefixLine(
|
|
197
|
+
id: 'heading-2',
|
|
198
|
+
label: 'Heading 2',
|
|
199
|
+
icon: 'H2',
|
|
200
|
+
action: () => prefixLine('## ')
|
|
216
201
|
},
|
|
217
202
|
{
|
|
218
|
-
id:
|
|
219
|
-
label:
|
|
220
|
-
icon:
|
|
221
|
-
action: () => prefixLine(
|
|
203
|
+
id: 'heading-3',
|
|
204
|
+
label: 'Heading 3',
|
|
205
|
+
icon: 'H3',
|
|
206
|
+
action: () => prefixLine('### ')
|
|
222
207
|
},
|
|
223
|
-
|
|
208
|
+
'|',
|
|
224
209
|
{
|
|
225
|
-
id:
|
|
226
|
-
label:
|
|
210
|
+
id: 'quote',
|
|
211
|
+
label: 'Quote',
|
|
227
212
|
icon: '"',
|
|
228
|
-
action: () => prefixLine(
|
|
213
|
+
action: () => prefixLine('> ')
|
|
229
214
|
},
|
|
230
215
|
{
|
|
231
|
-
id:
|
|
232
|
-
label:
|
|
233
|
-
icon:
|
|
234
|
-
action: () => prefixLine(
|
|
216
|
+
id: 'unordered-list',
|
|
217
|
+
label: 'Unordered List',
|
|
218
|
+
icon: '•',
|
|
219
|
+
action: () => prefixLine('- ')
|
|
235
220
|
},
|
|
236
221
|
{
|
|
237
|
-
id:
|
|
238
|
-
label:
|
|
239
|
-
icon:
|
|
240
|
-
action: () => prefixLine(
|
|
222
|
+
id: 'ordered-list',
|
|
223
|
+
label: 'Ordered List',
|
|
224
|
+
icon: '1.',
|
|
225
|
+
action: () => prefixLine('1. ')
|
|
241
226
|
},
|
|
242
|
-
|
|
227
|
+
'|',
|
|
243
228
|
{
|
|
244
|
-
id:
|
|
245
|
-
label:
|
|
229
|
+
id: 'link',
|
|
230
|
+
label: 'Link',
|
|
246
231
|
icon: icons.link,
|
|
247
232
|
isSvg: true,
|
|
248
|
-
shortcut:
|
|
233
|
+
shortcut: 'Mod-k',
|
|
249
234
|
action: () => {
|
|
250
235
|
if (!editorView) return;
|
|
251
236
|
const { from, to } = editorView.state.selection.main;
|
|
252
237
|
const selected = editorView.state.sliceDoc(from, to);
|
|
253
|
-
const text = selected ||
|
|
238
|
+
const text = selected || 'link text';
|
|
254
239
|
const replacement = `[${text}](url)`;
|
|
255
240
|
editorView.dispatch({
|
|
256
241
|
changes: { from, to, insert: replacement },
|
|
257
242
|
selection: {
|
|
258
243
|
anchor: from + text.length + 3,
|
|
259
|
-
head: from + text.length + 6
|
|
260
|
-
}
|
|
244
|
+
head: from + text.length + 6
|
|
245
|
+
}
|
|
261
246
|
});
|
|
262
247
|
editorView.focus();
|
|
263
|
-
}
|
|
248
|
+
}
|
|
264
249
|
},
|
|
265
250
|
{
|
|
266
|
-
id:
|
|
267
|
-
label:
|
|
251
|
+
id: 'image',
|
|
252
|
+
label: 'Image',
|
|
268
253
|
icon: icons.image,
|
|
269
254
|
isSvg: true,
|
|
270
|
-
action: () => insertAtCursor(
|
|
255
|
+
action: () => insertAtCursor('')
|
|
271
256
|
},
|
|
272
257
|
{
|
|
273
|
-
id:
|
|
274
|
-
label:
|
|
258
|
+
id: 'table',
|
|
259
|
+
label: 'Table',
|
|
275
260
|
icon: icons.table,
|
|
276
261
|
isSvg: true,
|
|
277
262
|
action: () =>
|
|
278
|
-
insertAtCursor(
|
|
279
|
-
|
|
280
|
-
),
|
|
281
|
-
},
|
|
263
|
+
insertAtCursor('\n| Header | Header |\n| ------ | ------ |\n| Cell | Cell |\n')
|
|
264
|
+
}
|
|
282
265
|
];
|
|
283
266
|
|
|
284
267
|
// ── CM6 Keyboard shortcuts for toolbar actions ───────────
|
|
@@ -286,50 +269,48 @@
|
|
|
286
269
|
function createToolbarKeymap() {
|
|
287
270
|
return keymap.of([
|
|
288
271
|
{
|
|
289
|
-
key:
|
|
272
|
+
key: 'Mod-b',
|
|
290
273
|
run: () => {
|
|
291
|
-
wrapSelection(
|
|
274
|
+
wrapSelection('**', '**');
|
|
292
275
|
return true;
|
|
293
|
-
}
|
|
276
|
+
}
|
|
294
277
|
},
|
|
295
278
|
{
|
|
296
|
-
key:
|
|
279
|
+
key: 'Mod-i',
|
|
297
280
|
run: () => {
|
|
298
|
-
wrapSelection(
|
|
281
|
+
wrapSelection('_', '_');
|
|
299
282
|
return true;
|
|
300
|
-
}
|
|
283
|
+
}
|
|
301
284
|
},
|
|
302
285
|
{
|
|
303
|
-
key:
|
|
286
|
+
key: 'Mod-k',
|
|
304
287
|
run: () => {
|
|
305
|
-
const action = toolbarActions.find(
|
|
306
|
-
|
|
307
|
-
);
|
|
308
|
-
if (action && action !== "|") action.action();
|
|
288
|
+
const action = toolbarActions.find((a) => a !== '|' && a.id === 'link');
|
|
289
|
+
if (action && action !== '|') action.action();
|
|
309
290
|
return true;
|
|
310
|
-
}
|
|
291
|
+
}
|
|
311
292
|
},
|
|
312
293
|
{
|
|
313
|
-
key:
|
|
294
|
+
key: 'Mod-h',
|
|
314
295
|
run: () => {
|
|
315
|
-
prefixLine(
|
|
296
|
+
prefixLine('## ');
|
|
316
297
|
return true;
|
|
317
|
-
}
|
|
298
|
+
}
|
|
318
299
|
},
|
|
319
300
|
{
|
|
320
301
|
key: "Mod-'",
|
|
321
302
|
run: () => {
|
|
322
|
-
prefixLine(
|
|
303
|
+
prefixLine('> ');
|
|
323
304
|
return true;
|
|
324
|
-
}
|
|
305
|
+
}
|
|
325
306
|
},
|
|
326
307
|
{
|
|
327
|
-
key:
|
|
308
|
+
key: 'Mod-l',
|
|
328
309
|
run: () => {
|
|
329
|
-
prefixLine(
|
|
310
|
+
prefixLine('- ');
|
|
330
311
|
return true;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
333
314
|
]);
|
|
334
315
|
}
|
|
335
316
|
|
|
@@ -358,14 +339,12 @@
|
|
|
358
339
|
: [
|
|
359
340
|
history(),
|
|
360
341
|
keymap.of([...defaultKeymap, ...historyKeymap, indentWithTab]),
|
|
361
|
-
createToolbarKeymap()
|
|
342
|
+
createToolbarKeymap()
|
|
362
343
|
]),
|
|
363
344
|
|
|
364
345
|
// Theme
|
|
365
346
|
themeCompartment.of(
|
|
366
|
-
darkTheme
|
|
367
|
-
? oneDark
|
|
368
|
-
: syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
|
347
|
+
darkTheme ? oneDark : syntaxHighlighting(defaultHighlightStyle, { fallback: true })
|
|
369
348
|
),
|
|
370
349
|
|
|
371
350
|
// Markdown language support
|
|
@@ -396,30 +375,29 @@
|
|
|
396
375
|
|
|
397
376
|
// Custom theme
|
|
398
377
|
EditorView.theme({
|
|
399
|
-
|
|
378
|
+
'&': {
|
|
400
379
|
height: height,
|
|
401
|
-
fontSize:
|
|
402
|
-
fontFamily:
|
|
403
|
-
"'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', monospace",
|
|
404
|
-
},
|
|
405
|
-
".cm-scroller": {
|
|
406
|
-
overflow: "auto",
|
|
380
|
+
fontSize: 'var(--fd-text-sm, 0.8125rem)',
|
|
381
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', monospace"
|
|
407
382
|
},
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
padding: "0.5rem 0",
|
|
383
|
+
'.cm-scroller': {
|
|
384
|
+
overflow: 'auto'
|
|
411
385
|
},
|
|
412
|
-
|
|
413
|
-
|
|
386
|
+
'.cm-content': {
|
|
387
|
+
minHeight: '100px',
|
|
388
|
+
padding: '0.5rem 0'
|
|
414
389
|
},
|
|
390
|
+
'&.cm-focused': {
|
|
391
|
+
outline: 'none'
|
|
392
|
+
}
|
|
415
393
|
}),
|
|
416
394
|
EditorView.lineWrapping,
|
|
417
395
|
|
|
418
396
|
// Accessibility
|
|
419
397
|
EditorView.contentAttributes.of({
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
})
|
|
398
|
+
'aria-label': 'Markdown editor',
|
|
399
|
+
'aria-multiline': 'true'
|
|
400
|
+
})
|
|
423
401
|
];
|
|
424
402
|
|
|
425
403
|
return extensions;
|
|
@@ -445,9 +423,9 @@
|
|
|
445
423
|
editorView = new EditorView({
|
|
446
424
|
state: EditorState.create({
|
|
447
425
|
doc: initialContent,
|
|
448
|
-
extensions: createExtensions()
|
|
426
|
+
extensions: createExtensions()
|
|
449
427
|
}),
|
|
450
|
-
parent: containerRef
|
|
428
|
+
parent: containerRef
|
|
451
429
|
});
|
|
452
430
|
|
|
453
431
|
updateStats(editorView.state.doc);
|
|
@@ -477,8 +455,8 @@
|
|
|
477
455
|
changes: {
|
|
478
456
|
from: 0,
|
|
479
457
|
to: editorView.state.doc.length,
|
|
480
|
-
insert: value
|
|
481
|
-
}
|
|
458
|
+
insert: value
|
|
459
|
+
}
|
|
482
460
|
});
|
|
483
461
|
isInternalUpdate = false;
|
|
484
462
|
updateStats(editorView.state.doc);
|
|
@@ -503,35 +481,26 @@
|
|
|
503
481
|
|
|
504
482
|
<!-- Toolbar -->
|
|
505
483
|
{#if showToolbar && !disabled}
|
|
506
|
-
<div
|
|
507
|
-
class="form-markdown-editor__toolbar"
|
|
508
|
-
role="toolbar"
|
|
509
|
-
aria-label="Markdown formatting"
|
|
510
|
-
>
|
|
484
|
+
<div class="form-markdown-editor__toolbar" role="toolbar" aria-label="Markdown formatting">
|
|
511
485
|
{#each toolbarActions as item}
|
|
512
|
-
{#if item ===
|
|
486
|
+
{#if item === '|'}
|
|
513
487
|
<span class="form-markdown-editor__separator"></span>
|
|
514
488
|
{:else}
|
|
515
489
|
<button
|
|
516
490
|
type="button"
|
|
517
491
|
class="form-markdown-editor__btn"
|
|
518
|
-
title="{item.label}{item.shortcut
|
|
519
|
-
? ` (${item.shortcut.replace('Mod', '⌘')})`
|
|
520
|
-
: ''}"
|
|
492
|
+
title="{item.label}{item.shortcut ? ` (${item.shortcut.replace('Mod', '⌘')})` : ''}"
|
|
521
493
|
onclick={item.action}
|
|
522
494
|
>
|
|
523
495
|
{#if item.isSvg}
|
|
524
|
-
<span class="form-markdown-editor__btn-svg"
|
|
525
|
-
>{@html item.icon}</span
|
|
526
|
-
>
|
|
496
|
+
<span class="form-markdown-editor__btn-svg">{@html item.icon}</span>
|
|
527
497
|
{:else}
|
|
528
498
|
<span
|
|
529
499
|
class="form-markdown-editor__btn-icon"
|
|
530
|
-
class:form-markdown-editor__btn-icon--bold={item.id ===
|
|
531
|
-
class:form-markdown-editor__btn-icon--italic={item.id ===
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
"strikethrough"}>{item.icon}</span
|
|
500
|
+
class:form-markdown-editor__btn-icon--bold={item.id === 'bold'}
|
|
501
|
+
class:form-markdown-editor__btn-icon--italic={item.id === 'italic'}
|
|
502
|
+
class:form-markdown-editor__btn-icon--strike={item.id === 'strikethrough'}
|
|
503
|
+
>{item.icon}</span
|
|
535
504
|
>
|
|
536
505
|
{/if}
|
|
537
506
|
</button>
|
|
@@ -661,14 +630,12 @@
|
|
|
661
630
|
}
|
|
662
631
|
|
|
663
632
|
/* When no toolbar, body gets top radius */
|
|
664
|
-
.form-markdown-editor:not(:has(.form-markdown-editor__toolbar))
|
|
665
|
-
.form-markdown-editor__body {
|
|
633
|
+
.form-markdown-editor:not(:has(.form-markdown-editor__toolbar)) .form-markdown-editor__body {
|
|
666
634
|
border-radius: var(--fd-radius-lg) var(--fd-radius-lg) 0 0;
|
|
667
635
|
}
|
|
668
636
|
|
|
669
637
|
/* When no status bar, body gets bottom radius */
|
|
670
|
-
.form-markdown-editor:not(:has(.form-markdown-editor__status))
|
|
671
|
-
.form-markdown-editor__body {
|
|
638
|
+
.form-markdown-editor:not(:has(.form-markdown-editor__status)) .form-markdown-editor__body {
|
|
672
639
|
border-radius: 0 0 var(--fd-radius-lg) var(--fd-radius-lg);
|
|
673
640
|
}
|
|
674
641
|
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormNumberField from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormNumberField',
|
|
8
8
|
component: FormNumberField,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control:
|
|
12
|
-
placeholder: { control:
|
|
13
|
-
min: { control:
|
|
14
|
-
max: { control:
|
|
15
|
-
step: { control:
|
|
16
|
-
required: { control:
|
|
17
|
-
disabled: { control:
|
|
11
|
+
value: { control: 'number' },
|
|
12
|
+
placeholder: { control: 'text' },
|
|
13
|
+
min: { control: 'number' },
|
|
14
|
+
max: { control: 'number' },
|
|
15
|
+
step: { control: 'number' },
|
|
16
|
+
required: { control: 'boolean' },
|
|
17
|
+
disabled: { control: 'boolean' }
|
|
18
18
|
},
|
|
19
19
|
args: {
|
|
20
|
-
id:
|
|
21
|
-
value:
|
|
22
|
-
onChange: fn()
|
|
23
|
-
}
|
|
20
|
+
id: 'demo-number-field',
|
|
21
|
+
value: '',
|
|
22
|
+
onChange: fn()
|
|
23
|
+
}
|
|
24
24
|
});
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
<Story name="Default" args={{ placeholder:
|
|
27
|
+
<Story name="Default" args={{ placeholder: 'Enter a number...' }} />
|
|
28
28
|
|
|
29
29
|
<Story name="With Value" args={{ value: 42 }} />
|
|
30
30
|
|
|
31
31
|
<Story
|
|
32
32
|
name="With Constraints"
|
|
33
|
-
args={{ value: 50, min: 0, max: 100, step: 5, placeholder:
|
|
33
|
+
args={{ value: 50, min: 0, max: 100, step: 5, placeholder: '0-100, step 5' }}
|
|
34
34
|
/>
|
|
35
35
|
|
|
36
36
|
<Story name="Disabled" args={{ value: 10, disabled: true }} />
|
|
@@ -11,7 +11,7 @@ declare const FormNumberField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormNumberField from
|
|
14
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
|
|
35
35
|
let {
|
|
36
36
|
id,
|
|
37
|
-
value =
|
|
38
|
-
placeholder =
|
|
37
|
+
value = '',
|
|
38
|
+
placeholder = '',
|
|
39
39
|
min,
|
|
40
40
|
max,
|
|
41
41
|
step,
|
|
42
42
|
required = false,
|
|
43
43
|
disabled = false,
|
|
44
44
|
ariaDescribedBy,
|
|
45
|
-
onChange
|
|
45
|
+
onChange
|
|
46
46
|
}: Props = $props();
|
|
47
47
|
|
|
48
48
|
/**
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
const target = event.currentTarget as HTMLInputElement;
|
|
54
54
|
const inputValue = target.value;
|
|
55
55
|
|
|
56
|
-
if (inputValue ===
|
|
57
|
-
onChange(
|
|
56
|
+
if (inputValue === '') {
|
|
57
|
+
onChange('');
|
|
58
58
|
} else {
|
|
59
59
|
const numValue = Number(inputValue);
|
|
60
60
|
onChange(isNaN(numValue) ? inputValue : numValue);
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
{id}
|
|
67
67
|
type="number"
|
|
68
68
|
class="form-number-field"
|
|
69
|
-
value={value ??
|
|
69
|
+
value={value ?? ''}
|
|
70
70
|
{placeholder}
|
|
71
71
|
{min}
|
|
72
72
|
{max}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormRangeField from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormRangeField',
|
|
8
8
|
component: FormRangeField,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control: { type:
|
|
12
|
-
min: { control:
|
|
13
|
-
max: { control:
|
|
14
|
-
step: { control:
|
|
15
|
-
disabled: { control:
|
|
11
|
+
value: { control: { type: 'number' } },
|
|
12
|
+
min: { control: 'number' },
|
|
13
|
+
max: { control: 'number' },
|
|
14
|
+
step: { control: 'number' },
|
|
15
|
+
disabled: { control: 'boolean' }
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
|
-
id:
|
|
18
|
+
id: 'demo-range-field',
|
|
19
19
|
value: 50,
|
|
20
|
-
onChange: fn()
|
|
21
|
-
}
|
|
20
|
+
onChange: fn()
|
|
21
|
+
}
|
|
22
22
|
});
|
|
23
23
|
</script>
|
|
24
24
|
|
|
@@ -11,7 +11,7 @@ declare const FormRangeField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormRangeField from
|
|
14
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|