@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
|
@@ -2,54 +2,54 @@
|
|
|
2
2
|
* Pads a string to a given width (right-padded with spaces).
|
|
3
3
|
*/
|
|
4
4
|
function pad(str, width) {
|
|
5
|
-
return str.length >= width ? str : str +
|
|
5
|
+
return str.length >= width ? str : str + ' '.repeat(width - str.length);
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Formats a simple table from rows with headers.
|
|
9
9
|
* Each column is auto-sized to fit the widest value.
|
|
10
10
|
*/
|
|
11
11
|
function formatTable(headers, rows) {
|
|
12
|
-
const colWidths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ??
|
|
13
|
-
const headerLine = headers.map((h, i) => pad(h, colWidths[i])).join(
|
|
14
|
-
const separator = colWidths.map((w) =>
|
|
15
|
-
const dataLines = rows.map((row) => row.map((cell, i) => pad(cell, colWidths[i])).join(
|
|
16
|
-
return [headerLine, separator, ...dataLines].join(
|
|
12
|
+
const colWidths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ?? '').length)));
|
|
13
|
+
const headerLine = headers.map((h, i) => pad(h, colWidths[i])).join(' ');
|
|
14
|
+
const separator = colWidths.map((w) => '-'.repeat(w)).join(' ');
|
|
15
|
+
const dataLines = rows.map((row) => row.map((cell, i) => pad(cell, colWidths[i])).join(' '));
|
|
16
|
+
return [headerLine, separator, ...dataLines].join('\n');
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Formats list nodes result as an aligned table: ID, Label, Type.
|
|
20
20
|
*/
|
|
21
21
|
export function formatListNodes(data) {
|
|
22
22
|
if (data.nodes.length === 0) {
|
|
23
|
-
return
|
|
23
|
+
return 'No nodes in workflow';
|
|
24
24
|
}
|
|
25
25
|
const rows = data.nodes.map((n) => [n.nodeId, n.label, n.type]);
|
|
26
|
-
return formatTable([
|
|
26
|
+
return formatTable(['ID', 'Label', 'Type'], rows);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Formats list edges result as a table: Source, Port, ->, Target, Port.
|
|
30
30
|
*/
|
|
31
31
|
export function formatListEdges(data) {
|
|
32
32
|
if (data.edges.length === 0) {
|
|
33
|
-
return
|
|
33
|
+
return 'No edges in workflow';
|
|
34
34
|
}
|
|
35
35
|
const rows = data.edges.map((e) => [
|
|
36
36
|
e.sourceNodeId,
|
|
37
37
|
e.sourcePort,
|
|
38
|
-
|
|
38
|
+
'->',
|
|
39
39
|
e.targetNodeId,
|
|
40
|
-
e.targetPort
|
|
40
|
+
e.targetPort
|
|
41
41
|
]);
|
|
42
|
-
return formatTable([
|
|
42
|
+
return formatTable(['Source', 'Port', '', 'Target', 'Port'], rows);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Formats list types result as a table: Type ID, Name, Category.
|
|
46
46
|
*/
|
|
47
47
|
export function formatListTypes(data) {
|
|
48
48
|
if (data.types.length === 0) {
|
|
49
|
-
return
|
|
49
|
+
return 'No node types available';
|
|
50
50
|
}
|
|
51
51
|
const rows = data.types.map((t) => [t.typeId, t.name, t.category]);
|
|
52
|
-
return formatTable([
|
|
52
|
+
return formatTable(['Type ID', 'Name', 'Category'], rows);
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Formats info result as structured output with header fields,
|
|
@@ -65,27 +65,25 @@ export function formatInfo(data) {
|
|
|
65
65
|
// Config section
|
|
66
66
|
const configEntries = Object.entries(data.config);
|
|
67
67
|
if (configEntries.length > 0) {
|
|
68
|
-
lines.push(
|
|
69
|
-
lines.push(
|
|
68
|
+
lines.push('');
|
|
69
|
+
lines.push('Config:');
|
|
70
70
|
for (const [key, value] of configEntries) {
|
|
71
|
-
const display = typeof value ===
|
|
72
|
-
? `"${value}"`
|
|
73
|
-
: JSON.stringify(value) ?? "null";
|
|
71
|
+
const display = typeof value === 'string' ? `"${value}"` : (JSON.stringify(value) ?? 'null');
|
|
74
72
|
lines.push(` ${key}: ${display}`);
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
// Ports section
|
|
78
76
|
if (data.inputs.length > 0 || data.outputs.length > 0) {
|
|
79
|
-
lines.push(
|
|
80
|
-
lines.push(
|
|
77
|
+
lines.push('');
|
|
78
|
+
lines.push('Ports:');
|
|
81
79
|
if (data.inputs.length > 0) {
|
|
82
|
-
lines.push(
|
|
80
|
+
lines.push(' Inputs:');
|
|
83
81
|
for (const port of data.inputs) {
|
|
84
82
|
lines.push(` ${port.portId} (${port.dataType})`);
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
if (data.outputs.length > 0) {
|
|
88
|
-
lines.push(
|
|
86
|
+
lines.push(' Outputs:');
|
|
89
87
|
for (const port of data.outputs) {
|
|
90
88
|
lines.push(` ${port.portId} (${port.dataType})`);
|
|
91
89
|
}
|
|
@@ -93,10 +91,10 @@ export function formatInfo(data) {
|
|
|
93
91
|
}
|
|
94
92
|
// Connected edges section
|
|
95
93
|
if (data.connectedEdges.length > 0) {
|
|
96
|
-
lines.push(
|
|
97
|
-
lines.push(
|
|
94
|
+
lines.push('');
|
|
95
|
+
lines.push('Edges:');
|
|
98
96
|
for (const edge of data.connectedEdges) {
|
|
99
|
-
if (edge.direction ===
|
|
97
|
+
if (edge.direction === 'incoming') {
|
|
100
98
|
lines.push(` ${edge.remoteNodeId}:${edge.remotePort} -> ${edge.localPort}`);
|
|
101
99
|
}
|
|
102
100
|
else {
|
|
@@ -104,15 +102,15 @@ export function formatInfo(data) {
|
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
|
-
return lines.join(
|
|
105
|
+
return lines.join('\n');
|
|
108
106
|
}
|
|
109
107
|
/**
|
|
110
108
|
* Formats help result as a table: Name, Syntax, Description.
|
|
111
109
|
*/
|
|
112
110
|
export function formatHelp(data) {
|
|
113
111
|
if (data.commands.length === 0) {
|
|
114
|
-
return
|
|
112
|
+
return 'No commands available';
|
|
115
113
|
}
|
|
116
114
|
const rows = data.commands.map((c) => [c.name, c.syntax, c.description]);
|
|
117
|
-
return formatTable([
|
|
115
|
+
return formatTable(['Name', 'Syntax', 'Description'], rows);
|
|
118
116
|
}
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
-->
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
|
-
import Icon from
|
|
22
|
-
import type { FieldSchema } from
|
|
21
|
+
import Icon from '@iconify/svelte';
|
|
22
|
+
import type { FieldSchema } from './types.js';
|
|
23
23
|
|
|
24
24
|
interface Props {
|
|
25
25
|
/** Field identifier */
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
itemSchema,
|
|
47
47
|
minItems = 0,
|
|
48
48
|
maxItems,
|
|
49
|
-
addLabel =
|
|
49
|
+
addLabel = 'Add Item',
|
|
50
50
|
disabled = false,
|
|
51
|
-
onChange
|
|
51
|
+
onChange
|
|
52
52
|
}: Props = $props();
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -59,9 +59,7 @@
|
|
|
59
59
|
/**
|
|
60
60
|
* Check if we can add more items
|
|
61
61
|
*/
|
|
62
|
-
const canAddItem = $derived(
|
|
63
|
-
maxItems === undefined || items.length < maxItems,
|
|
64
|
-
);
|
|
62
|
+
const canAddItem = $derived(maxItems === undefined || items.length < maxItems);
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
65
|
* Check if we can remove items
|
|
@@ -72,10 +70,10 @@
|
|
|
72
70
|
* Determine if items are simple (primitive) or complex (objects)
|
|
73
71
|
*/
|
|
74
72
|
const isSimpleType = $derived(
|
|
75
|
-
itemSchema.type ===
|
|
76
|
-
itemSchema.type ===
|
|
77
|
-
itemSchema.type ===
|
|
78
|
-
itemSchema.type ===
|
|
73
|
+
itemSchema.type === 'string' ||
|
|
74
|
+
itemSchema.type === 'number' ||
|
|
75
|
+
itemSchema.type === 'integer' ||
|
|
76
|
+
itemSchema.type === 'boolean'
|
|
79
77
|
);
|
|
80
78
|
|
|
81
79
|
/**
|
|
@@ -87,14 +85,14 @@
|
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
switch (itemSchema.type) {
|
|
90
|
-
case
|
|
91
|
-
return
|
|
92
|
-
case
|
|
93
|
-
case
|
|
88
|
+
case 'string':
|
|
89
|
+
return '';
|
|
90
|
+
case 'number':
|
|
91
|
+
case 'integer':
|
|
94
92
|
return 0;
|
|
95
|
-
case
|
|
93
|
+
case 'boolean':
|
|
96
94
|
return false;
|
|
97
|
-
case
|
|
95
|
+
case 'object':
|
|
98
96
|
// Create default object from properties
|
|
99
97
|
if (itemSchema.properties) {
|
|
100
98
|
const defaultObj: Record<string, unknown> = {};
|
|
@@ -108,10 +106,10 @@
|
|
|
108
106
|
return defaultObj;
|
|
109
107
|
}
|
|
110
108
|
return {};
|
|
111
|
-
case
|
|
109
|
+
case 'array':
|
|
112
110
|
return [];
|
|
113
111
|
default:
|
|
114
|
-
return
|
|
112
|
+
return '';
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
115
|
|
|
@@ -120,19 +118,19 @@
|
|
|
120
118
|
*/
|
|
121
119
|
function getDefaultForType(type: string | undefined): unknown {
|
|
122
120
|
switch (type) {
|
|
123
|
-
case
|
|
124
|
-
return
|
|
125
|
-
case
|
|
126
|
-
case
|
|
121
|
+
case 'string':
|
|
122
|
+
return '';
|
|
123
|
+
case 'number':
|
|
124
|
+
case 'integer':
|
|
127
125
|
return 0;
|
|
128
|
-
case
|
|
126
|
+
case 'boolean':
|
|
129
127
|
return false;
|
|
130
|
-
case
|
|
128
|
+
case 'object':
|
|
131
129
|
return {};
|
|
132
|
-
case
|
|
130
|
+
case 'array':
|
|
133
131
|
return [];
|
|
134
132
|
default:
|
|
135
|
-
return
|
|
133
|
+
return '';
|
|
136
134
|
}
|
|
137
135
|
}
|
|
138
136
|
|
|
@@ -158,20 +156,14 @@
|
|
|
158
156
|
* Update an item at the specified index
|
|
159
157
|
*/
|
|
160
158
|
function updateItem(index: number, newItemValue: unknown): void {
|
|
161
|
-
const newValue = items.map((item, i) =>
|
|
162
|
-
i === index ? newItemValue : item,
|
|
163
|
-
);
|
|
159
|
+
const newValue = items.map((item, i) => (i === index ? newItemValue : item));
|
|
164
160
|
onChange(newValue);
|
|
165
161
|
}
|
|
166
162
|
|
|
167
163
|
/**
|
|
168
164
|
* Update a property of an object item
|
|
169
165
|
*/
|
|
170
|
-
function updateObjectProperty(
|
|
171
|
-
index: number,
|
|
172
|
-
propertyKey: string,
|
|
173
|
-
propertyValue: unknown,
|
|
174
|
-
): void {
|
|
166
|
+
function updateObjectProperty(index: number, propertyKey: string, propertyValue: unknown): void {
|
|
175
167
|
const currentItem = items[index] as Record<string, unknown>;
|
|
176
168
|
const updatedItem = { ...currentItem, [propertyKey]: propertyValue };
|
|
177
169
|
updateItem(index, updatedItem);
|
|
@@ -183,10 +175,7 @@
|
|
|
183
175
|
function moveItemUp(index: number): void {
|
|
184
176
|
if (index === 0 || disabled) return;
|
|
185
177
|
const newValue = [...items];
|
|
186
|
-
[newValue[index - 1], newValue[index]] = [
|
|
187
|
-
newValue[index],
|
|
188
|
-
newValue[index - 1],
|
|
189
|
-
];
|
|
178
|
+
[newValue[index - 1], newValue[index]] = [newValue[index], newValue[index - 1]];
|
|
190
179
|
onChange(newValue);
|
|
191
180
|
}
|
|
192
181
|
|
|
@@ -196,10 +185,7 @@
|
|
|
196
185
|
function moveItemDown(index: number): void {
|
|
197
186
|
if (index === items.length - 1 || disabled) return;
|
|
198
187
|
const newValue = [...items];
|
|
199
|
-
[newValue[index], newValue[index + 1]] = [
|
|
200
|
-
newValue[index + 1],
|
|
201
|
-
newValue[index],
|
|
202
|
-
];
|
|
188
|
+
[newValue[index], newValue[index + 1]] = [newValue[index + 1], newValue[index]];
|
|
203
189
|
onChange(newValue);
|
|
204
190
|
}
|
|
205
191
|
|
|
@@ -215,10 +201,10 @@
|
|
|
215
201
|
}
|
|
216
202
|
|
|
217
203
|
// For objects, try to find a name/label/title property
|
|
218
|
-
if (typeof item ===
|
|
204
|
+
if (typeof item === 'object' && item !== null) {
|
|
219
205
|
const obj = item as Record<string, unknown>;
|
|
220
206
|
const labelKey = Object.keys(obj).find((k) =>
|
|
221
|
-
[
|
|
207
|
+
['name', 'label', 'title', 'id'].includes(k.toLowerCase())
|
|
222
208
|
);
|
|
223
209
|
if (labelKey && obj[labelKey]) {
|
|
224
210
|
return String(obj[labelKey]);
|
|
@@ -274,19 +260,13 @@
|
|
|
274
260
|
class="form-array__item-toggle"
|
|
275
261
|
onclick={() => toggleCollapse(index)}
|
|
276
262
|
aria-expanded={!isCollapsed(index)}
|
|
277
|
-
aria-label={isCollapsed(index)
|
|
278
|
-
? "Expand item"
|
|
279
|
-
: "Collapse item"}
|
|
263
|
+
aria-label={isCollapsed(index) ? 'Expand item' : 'Collapse item'}
|
|
280
264
|
>
|
|
281
265
|
<Icon
|
|
282
|
-
icon={isCollapsed(index)
|
|
283
|
-
? "heroicons:chevron-right"
|
|
284
|
-
: "heroicons:chevron-down"}
|
|
266
|
+
icon={isCollapsed(index) ? 'heroicons:chevron-right' : 'heroicons:chevron-down'}
|
|
285
267
|
class="form-array__toggle-icon"
|
|
286
268
|
/>
|
|
287
|
-
<span class="form-array__item-label"
|
|
288
|
-
>{getItemLabel(index, item)}</span
|
|
289
|
-
>
|
|
269
|
+
<span class="form-array__item-label">{getItemLabel(index, item)}</span>
|
|
290
270
|
</button>
|
|
291
271
|
{:else}
|
|
292
272
|
<span class="form-array__item-number">#{index + 1}</span>
|
|
@@ -335,17 +315,16 @@
|
|
|
335
315
|
<!-- Item Content -->
|
|
336
316
|
<div
|
|
337
317
|
class="form-array__item-content"
|
|
338
|
-
class:form-array__item-content--collapsed={!isSimpleType &&
|
|
339
|
-
isCollapsed(index)}
|
|
318
|
+
class:form-array__item-content--collapsed={!isSimpleType && isCollapsed(index)}
|
|
340
319
|
>
|
|
341
320
|
{#if isSimpleType}
|
|
342
321
|
<!-- Simple type: render inline input -->
|
|
343
|
-
{#if itemSchema.type ===
|
|
344
|
-
{#if itemSchema.format ===
|
|
322
|
+
{#if itemSchema.type === 'string'}
|
|
323
|
+
{#if itemSchema.format === 'multiline'}
|
|
345
324
|
<textarea
|
|
346
325
|
class="form-array__input form-array__textarea"
|
|
347
|
-
value={String(item ??
|
|
348
|
-
placeholder={itemSchema.placeholder ??
|
|
326
|
+
value={String(item ?? '')}
|
|
327
|
+
placeholder={itemSchema.placeholder ?? ''}
|
|
349
328
|
rows={3}
|
|
350
329
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
351
330
|
{disabled}
|
|
@@ -354,27 +333,27 @@
|
|
|
354
333
|
<input
|
|
355
334
|
type="text"
|
|
356
335
|
class="form-array__input"
|
|
357
|
-
value={String(item ??
|
|
358
|
-
placeholder={itemSchema.placeholder ??
|
|
336
|
+
value={String(item ?? '')}
|
|
337
|
+
placeholder={itemSchema.placeholder ?? ''}
|
|
359
338
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
360
339
|
{disabled}
|
|
361
340
|
/>
|
|
362
341
|
{/if}
|
|
363
|
-
{:else if itemSchema.type ===
|
|
342
|
+
{:else if itemSchema.type === 'number' || itemSchema.type === 'integer'}
|
|
364
343
|
<input
|
|
365
344
|
type="number"
|
|
366
345
|
class="form-array__input form-array__input--number"
|
|
367
346
|
value={item as number}
|
|
368
|
-
placeholder={itemSchema.placeholder ??
|
|
347
|
+
placeholder={itemSchema.placeholder ?? ''}
|
|
369
348
|
min={itemSchema.minimum}
|
|
370
349
|
max={itemSchema.maximum}
|
|
371
350
|
oninput={(e) => {
|
|
372
351
|
const val = e.currentTarget.value;
|
|
373
|
-
updateItem(index, val ===
|
|
352
|
+
updateItem(index, val === '' ? '' : Number(val));
|
|
374
353
|
}}
|
|
375
354
|
{disabled}
|
|
376
355
|
/>
|
|
377
|
-
{:else if itemSchema.type ===
|
|
356
|
+
{:else if itemSchema.type === 'boolean'}
|
|
378
357
|
<label class="form-array__toggle-wrapper">
|
|
379
358
|
<input
|
|
380
359
|
type="checkbox"
|
|
@@ -387,14 +366,14 @@
|
|
|
387
366
|
<span class="form-array__toggle-thumb"></span>
|
|
388
367
|
</span>
|
|
389
368
|
<span class="form-array__toggle-label">
|
|
390
|
-
{item ?
|
|
369
|
+
{item ? 'Yes' : 'No'}
|
|
391
370
|
</span>
|
|
392
371
|
</label>
|
|
393
372
|
{:else if itemSchema.enum}
|
|
394
373
|
<!-- Enum: render select -->
|
|
395
374
|
<select
|
|
396
375
|
class="form-array__select"
|
|
397
|
-
value={String(item ??
|
|
376
|
+
value={String(item ?? '')}
|
|
398
377
|
onchange={(e) => updateItem(index, e.currentTarget.value)}
|
|
399
378
|
{disabled}
|
|
400
379
|
>
|
|
@@ -407,32 +386,26 @@
|
|
|
407
386
|
<input
|
|
408
387
|
type="text"
|
|
409
388
|
class="form-array__input"
|
|
410
|
-
value={String(item ??
|
|
411
|
-
placeholder={itemSchema.placeholder ??
|
|
389
|
+
value={String(item ?? '')}
|
|
390
|
+
placeholder={itemSchema.placeholder ?? ''}
|
|
412
391
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
413
392
|
{disabled}
|
|
414
393
|
/>
|
|
415
394
|
{/if}
|
|
416
|
-
{:else if itemSchema.type ===
|
|
395
|
+
{:else if itemSchema.type === 'object' && itemSchema.properties}
|
|
417
396
|
<!-- Complex type: render sub-form for object properties -->
|
|
418
397
|
{#if !isCollapsed(index)}
|
|
419
398
|
<div class="form-array__subform">
|
|
420
399
|
{#each Object.entries(itemSchema.properties) as [propKey, propSchema], propIndex (propKey)}
|
|
421
|
-
{@const propValue = (item as Record<string, unknown>)?.[
|
|
422
|
-
|
|
423
|
-
]}
|
|
424
|
-
{@const isRequired =
|
|
425
|
-
itemSchema.required?.includes(propKey) ?? false}
|
|
400
|
+
{@const propValue = (item as Record<string, unknown>)?.[propKey]}
|
|
401
|
+
{@const isRequired = itemSchema.required?.includes(propKey) ?? false}
|
|
426
402
|
{@const propFieldSchema = propSchema as FieldSchema}
|
|
427
403
|
|
|
428
404
|
<div
|
|
429
405
|
class="form-array__subform-field"
|
|
430
406
|
style="animation-delay: {propIndex * 20}ms"
|
|
431
407
|
>
|
|
432
|
-
<label
|
|
433
|
-
class="form-array__subform-label"
|
|
434
|
-
for="{id}-{index}-{propKey}"
|
|
435
|
-
>
|
|
408
|
+
<label class="form-array__subform-label" for="{id}-{index}-{propKey}">
|
|
436
409
|
<span class="form-array__subform-label-text">
|
|
437
410
|
{propFieldSchema.title ?? propKey}
|
|
438
411
|
</span>
|
|
@@ -446,71 +419,53 @@
|
|
|
446
419
|
<select
|
|
447
420
|
id="{id}-{index}-{propKey}"
|
|
448
421
|
class="form-array__select"
|
|
449
|
-
value={String(propValue ??
|
|
422
|
+
value={String(propValue ?? '')}
|
|
450
423
|
onchange={(e) =>
|
|
451
|
-
updateObjectProperty(
|
|
452
|
-
index,
|
|
453
|
-
propKey,
|
|
454
|
-
e.currentTarget.value,
|
|
455
|
-
)}
|
|
424
|
+
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
456
425
|
{disabled}
|
|
457
426
|
>
|
|
458
427
|
{#each propFieldSchema.enum as option}
|
|
459
|
-
<option value={String(option)}
|
|
460
|
-
>{String(option)}</option
|
|
461
|
-
>
|
|
428
|
+
<option value={String(option)}>{String(option)}</option>
|
|
462
429
|
{/each}
|
|
463
430
|
</select>
|
|
464
|
-
{:else if propFieldSchema.type ===
|
|
431
|
+
{:else if propFieldSchema.type === 'string' && propFieldSchema.format === 'multiline'}
|
|
465
432
|
<textarea
|
|
466
433
|
id="{id}-{index}-{propKey}"
|
|
467
434
|
class="form-array__input form-array__textarea"
|
|
468
|
-
value={String(propValue ??
|
|
469
|
-
placeholder={propFieldSchema.placeholder ??
|
|
435
|
+
value={String(propValue ?? '')}
|
|
436
|
+
placeholder={propFieldSchema.placeholder ?? ''}
|
|
470
437
|
rows={3}
|
|
471
438
|
oninput={(e) =>
|
|
472
|
-
updateObjectProperty(
|
|
473
|
-
index,
|
|
474
|
-
propKey,
|
|
475
|
-
e.currentTarget.value,
|
|
476
|
-
)}
|
|
439
|
+
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
477
440
|
{disabled}
|
|
478
441
|
></textarea>
|
|
479
|
-
{:else if propFieldSchema.type ===
|
|
442
|
+
{:else if propFieldSchema.type === 'string'}
|
|
480
443
|
<input
|
|
481
444
|
id="{id}-{index}-{propKey}"
|
|
482
445
|
type="text"
|
|
483
446
|
class="form-array__input"
|
|
484
|
-
value={String(propValue ??
|
|
485
|
-
placeholder={propFieldSchema.placeholder ??
|
|
447
|
+
value={String(propValue ?? '')}
|
|
448
|
+
placeholder={propFieldSchema.placeholder ?? ''}
|
|
486
449
|
oninput={(e) =>
|
|
487
|
-
updateObjectProperty(
|
|
488
|
-
index,
|
|
489
|
-
propKey,
|
|
490
|
-
e.currentTarget.value,
|
|
491
|
-
)}
|
|
450
|
+
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
492
451
|
{disabled}
|
|
493
452
|
/>
|
|
494
|
-
{:else if propFieldSchema.type ===
|
|
453
|
+
{:else if propFieldSchema.type === 'number' || propFieldSchema.type === 'integer'}
|
|
495
454
|
<input
|
|
496
455
|
id="{id}-{index}-{propKey}"
|
|
497
456
|
type="number"
|
|
498
457
|
class="form-array__input form-array__input--number"
|
|
499
458
|
value={propValue as number}
|
|
500
|
-
placeholder={propFieldSchema.placeholder ??
|
|
459
|
+
placeholder={propFieldSchema.placeholder ?? ''}
|
|
501
460
|
min={propFieldSchema.minimum}
|
|
502
461
|
max={propFieldSchema.maximum}
|
|
503
462
|
oninput={(e) => {
|
|
504
463
|
const val = e.currentTarget.value;
|
|
505
|
-
updateObjectProperty(
|
|
506
|
-
index,
|
|
507
|
-
propKey,
|
|
508
|
-
val === "" ? "" : Number(val),
|
|
509
|
-
);
|
|
464
|
+
updateObjectProperty(index, propKey, val === '' ? '' : Number(val));
|
|
510
465
|
}}
|
|
511
466
|
{disabled}
|
|
512
467
|
/>
|
|
513
|
-
{:else if propFieldSchema.type ===
|
|
468
|
+
{:else if propFieldSchema.type === 'boolean'}
|
|
514
469
|
<label class="form-array__toggle-wrapper">
|
|
515
470
|
<input
|
|
516
471
|
id="{id}-{index}-{propKey}"
|
|
@@ -518,18 +473,14 @@
|
|
|
518
473
|
class="form-array__checkbox-input"
|
|
519
474
|
checked={Boolean(propValue)}
|
|
520
475
|
onchange={(e) =>
|
|
521
|
-
updateObjectProperty(
|
|
522
|
-
index,
|
|
523
|
-
propKey,
|
|
524
|
-
e.currentTarget.checked,
|
|
525
|
-
)}
|
|
476
|
+
updateObjectProperty(index, propKey, e.currentTarget.checked)}
|
|
526
477
|
{disabled}
|
|
527
478
|
/>
|
|
528
479
|
<span class="form-array__toggle-track">
|
|
529
480
|
<span class="form-array__toggle-thumb"></span>
|
|
530
481
|
</span>
|
|
531
482
|
<span class="form-array__toggle-label">
|
|
532
|
-
{propValue ?
|
|
483
|
+
{propValue ? 'Yes' : 'No'}
|
|
533
484
|
</span>
|
|
534
485
|
</label>
|
|
535
486
|
{:else}
|
|
@@ -537,14 +488,10 @@
|
|
|
537
488
|
id="{id}-{index}-{propKey}"
|
|
538
489
|
type="text"
|
|
539
490
|
class="form-array__input"
|
|
540
|
-
value={String(propValue ??
|
|
541
|
-
placeholder={propFieldSchema.placeholder ??
|
|
491
|
+
value={String(propValue ?? '')}
|
|
492
|
+
placeholder={propFieldSchema.placeholder ?? ''}
|
|
542
493
|
oninput={(e) =>
|
|
543
|
-
updateObjectProperty(
|
|
544
|
-
index,
|
|
545
|
-
propKey,
|
|
546
|
-
e.currentTarget.value,
|
|
547
|
-
)}
|
|
494
|
+
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
548
495
|
{disabled}
|
|
549
496
|
/>
|
|
550
497
|
{/if}
|
|
@@ -594,9 +541,7 @@
|
|
|
594
541
|
<!-- Item count and limits -->
|
|
595
542
|
{#if minItems > 0 || maxItems !== undefined}
|
|
596
543
|
<div class="form-array__info">
|
|
597
|
-
<span class="form-array__count"
|
|
598
|
-
>{items.length} item{items.length !== 1 ? "s" : ""}</span
|
|
599
|
-
>
|
|
544
|
+
<span class="form-array__count">{items.length} item{items.length !== 1 ? 's' : ''}</span>
|
|
600
545
|
{#if minItems > 0}
|
|
601
546
|
<span class="form-array__limit">Min: {minItems}</span>
|
|
602
547
|
{/if}
|
|
@@ -932,9 +877,7 @@
|
|
|
932
877
|
background-color: var(--fd-primary);
|
|
933
878
|
}
|
|
934
879
|
|
|
935
|
-
.form-array__checkbox-input:checked
|
|
936
|
-
+ .form-array__toggle-track
|
|
937
|
-
.form-array__toggle-thumb {
|
|
880
|
+
.form-array__checkbox-input:checked + .form-array__toggle-track .form-array__toggle-thumb {
|
|
938
881
|
transform: translateX(1rem);
|
|
939
882
|
}
|
|
940
883
|
|