@flowdrop/flowdrop 1.0.1 → 1.2.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 +50 -50
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +25 -25
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/AgentSpecAdapter.js +133 -122
- 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 +2 -2
- 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 +22 -20
- package/dist/api/enhanced-client.d.ts +3 -3
- package/dist/api/enhanced-client.js +73 -72
- package/dist/components/App.svelte +1090 -961
- package/dist/components/App.svelte.d.ts +9 -6
- package/dist/components/CanvasBanner.stories.svelte +23 -20
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/CanvasBanner.svelte +52 -46
- package/dist/components/ConfigForm.svelte +1164 -1065
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigModal.svelte +180 -180
- package/dist/components/ConfigModal.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +35 -35
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.svelte +178 -167
- package/dist/components/ConfigPanel.svelte.d.ts +1 -1
- package/dist/components/ConnectionLine.svelte +25 -25
- package/dist/components/EdgeRefresher.svelte +26 -26
- package/dist/components/FlowDropEdge.stories.svelte +179 -143
- package/dist/components/FlowDropEdge.svelte +147 -147
- package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
- package/dist/components/FlowDropZone.svelte +63 -60
- package/dist/components/FlowDropZone.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +19 -19
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.svelte +21 -21
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +13 -13
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +101 -95
- package/dist/components/LogsSidebar.svelte +553 -546
- package/dist/components/LogsSidebar.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +29 -23
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.svelte +16 -14
- package/dist/components/Navbar.stories.svelte +43 -38
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +760 -706
- package/dist/components/Navbar.svelte.d.ts +1 -1
- package/dist/components/NodeSidebar.svelte +905 -746
- package/dist/components/NodeSidebar.svelte.d.ts +5 -1
- package/dist/components/NodeStatusOverlay.stories.svelte +82 -70
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +295 -280
- package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
- package/dist/components/PipelineStatus.svelte +326 -300
- package/dist/components/PipelineStatus.svelte.d.ts +4 -4
- package/dist/components/PortCoordinateTracker.svelte +49 -47
- package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
- package/dist/components/ReadOnlyDetails.svelte +156 -156
- package/dist/components/SchemaForm.stories.svelte +106 -98
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +490 -463
- package/dist/components/SchemaForm.svelte.d.ts +2 -2
- package/dist/components/SettingsModal.svelte +226 -223
- package/dist/components/SettingsModal.svelte.d.ts +1 -1
- package/dist/components/SettingsPanel.svelte +637 -601
- package/dist/components/SettingsPanel.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.stories.svelte +62 -49
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +87 -87
- package/dist/components/StatusIcon.svelte.d.ts +2 -2
- package/dist/components/StatusLabel.stories.svelte +12 -12
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/StatusLabel.svelte +19 -19
- package/dist/components/ThemeToggle.stories.svelte +16 -16
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.svelte +180 -169
- package/dist/components/ThemeToggle.svelte.d.ts +1 -1
- package/dist/components/UniversalNode.svelte +150 -138
- package/dist/components/UniversalNode.svelte.d.ts +3 -3
- package/dist/components/WorkflowEditor.svelte +1069 -1014
- package/dist/components/WorkflowEditor.svelte.d.ts +4 -4
- package/dist/components/form/FormArray.svelte +1034 -973
- package/dist/components/form/FormArray.svelte.d.ts +1 -1
- package/dist/components/form/FormAutocomplete.svelte +1021 -978
- package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.stories.svelte +23 -20
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.svelte +136 -136
- package/dist/components/form/FormCodeEditor.svelte +452 -434
- package/dist/components/form/FormField.svelte +366 -355
- package/dist/components/form/FormField.svelte.d.ts +2 -2
- package/dist/components/form/FormFieldLight.svelte +400 -384
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.stories.svelte +42 -42
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.svelte +100 -93
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldset.svelte +108 -108
- package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
- package/dist/components/form/FormMarkdownEditor.svelte +758 -725
- package/dist/components/form/FormNumberField.stories.svelte +25 -25
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +88 -88
- package/dist/components/form/FormRangeField.stories.svelte +20 -20
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.svelte +234 -226
- package/dist/components/form/FormSelect.stories.svelte +38 -38
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.svelte +101 -101
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +847 -798
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.stories.svelte +29 -23
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +68 -68
- package/dist/components/form/FormTextarea.stories.svelte +28 -25
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.svelte +74 -74
- package/dist/components/form/FormToggle.stories.svelte +23 -20
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.svelte +98 -98
- package/dist/components/form/FormUISchemaRenderer.svelte +120 -113
- 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 +64 -55
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.js +9 -4
- package/dist/components/icons/AlertCircleIcon.svelte +11 -0
- package/dist/components/icons/AlertCircleIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CogIcon.svelte +11 -0
- package/dist/components/icons/CogIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +54 -38
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +407 -383
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +48 -48
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.svelte +280 -274
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/FormPrompt.svelte +223 -218
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/InterruptBubble.svelte +617 -583
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +66 -56
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -841
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +38 -33
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +333 -328
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/index.d.ts +5 -5
- package/dist/components/interrupt/index.js +5 -5
- package/dist/components/layouts/MainLayout.svelte +724 -691
- package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
- package/dist/components/nodes/GatewayNode.stories.svelte +100 -99
- package/dist/components/nodes/GatewayNode.svelte +605 -571
- package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
- package/dist/components/nodes/IdeaNode.stories.svelte +44 -43
- package/dist/components/nodes/IdeaNode.svelte +451 -437
- package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
- package/dist/components/nodes/NotesNode.stories.svelte +65 -64
- package/dist/components/nodes/NotesNode.svelte +380 -369
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SimpleNode.stories.svelte +145 -144
- package/dist/components/nodes/SimpleNode.svelte +486 -424
- package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SquareNode.stories.svelte +73 -73
- package/dist/components/nodes/SquareNode.svelte +439 -380
- package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
- package/dist/components/nodes/TerminalNode.stories.svelte +13 -13
- package/dist/components/nodes/TerminalNode.svelte +709 -670
- package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
- package/dist/components/nodes/ToolNode.stories.svelte +181 -180
- package/dist/components/nodes/ToolNode.svelte +505 -447
- package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.stories.svelte +70 -46
- package/dist/components/nodes/WorkflowNode.svelte +621 -551
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
- package/dist/components/playground/ChatPanel.svelte +945 -889
- package/dist/components/playground/ExecutionLogs.svelte +495 -472
- package/dist/components/playground/InputCollector.svelte +449 -428
- package/dist/components/playground/MessageBubble.stories.svelte +47 -47
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/MessageBubble.svelte +626 -610
- package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +1088 -1057
- package/dist/components/playground/Playground.svelte.d.ts +3 -3
- package/dist/components/playground/PlaygroundModal.svelte +208 -204
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
- package/dist/components/playground/SessionManager.svelte +527 -521
- 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 +65 -65
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +63 -59
- package/dist/core/index.js +35 -33
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +62 -62
- package/dist/editor/index.js +53 -53
- 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 +11 -9
- 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 +34 -32
- package/dist/helpers/workflowEditorHelper.d.ts +5 -5
- package/dist/helpers/workflowEditorHelper.js +108 -96
- 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 +9 -9
- package/dist/mocks/app-navigation.js +11 -11
- package/dist/mocks/app-stores.js +8 -8
- 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 +11 -9
- 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 +59 -55
- 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 +41 -34
- 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/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 +41 -39
- package/dist/services/globalSave.d.ts +2 -2
- package/dist/services/globalSave.js +41 -38
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/historyService.js +8 -8
- package/dist/services/interruptService.d.ts +1 -1
- package/dist/services/interruptService.js +35 -29
- package/dist/services/nodeExecutionService.d.ts +1 -1
- package/dist/services/nodeExecutionService.js +45 -44
- 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 +25 -19
- 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 +2 -0
- package/dist/skins/default.js +1 -0
- package/dist/skins/index.d.ts +13 -0
- package/dist/skins/index.js +30 -0
- package/dist/skins/slate.d.ts +2 -0
- package/dist/skins/slate.js +78 -0
- 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 +65 -33
- 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 +25 -18
- package/dist/stores/portCoordinateStore.svelte.d.ts +2 -2
- package/dist/stores/portCoordinateStore.svelte.js +15 -8
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +62 -57
- package/dist/stores/workflowStore.svelte.d.ts +3 -3
- package/dist/stores/workflowStore.svelte.js +50 -47
- package/dist/stories/CanvasDecorator.svelte +35 -32
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/EdgeDecorator.svelte +102 -99
- package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
- package/dist/stories/NodeDecorator.svelte +59 -53
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +105 -67
- package/dist/styles/base.css +599 -595
- package/dist/styles/toast.css +14 -14
- package/dist/styles/tokens.css +409 -378
- package/dist/svelte-app.d.ts +12 -9
- package/dist/svelte-app.js +40 -39
- package/dist/themes/default.d.ts +2 -0
- package/dist/themes/default.js +9 -0
- package/dist/themes/index.d.ts +13 -0
- package/dist/themes/index.js +44 -0
- package/dist/themes/minimal.d.ts +2 -0
- package/dist/themes/minimal.js +11 -0
- 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/config.d.ts +6 -6
- package/dist/types/events.d.ts +2 -2
- 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 +5 -3
- package/dist/types/settings.js +25 -18
- package/dist/types/skin.d.ts +31 -0
- package/dist/types/skin.js +1 -0
- package/dist/types/theme.d.ts +35 -0
- package/dist/types/theme.js +1 -0
- 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 +97 -95
- 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/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/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeTypes.d.ts +1 -1
- package/dist/utils/nodeTypes.js +21 -20
- package/dist/utils/nodeWrapper.d.ts +7 -7
- package/dist/utils/nodeWrapper.js +21 -19
- package/dist/utils/performanceUtils.d.ts +1 -1
- package/dist/utils/performanceUtils.js +2 -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 +20 -8
- package/package.json +1 -1
package/dist/utils/nodeStatus.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export function getStatusColor(status) {
|
|
9
9
|
const statusColors = {
|
|
10
|
-
idle:
|
|
11
|
-
pending:
|
|
12
|
-
running:
|
|
13
|
-
completed:
|
|
14
|
-
failed:
|
|
15
|
-
cancelled:
|
|
16
|
-
skipped:
|
|
10
|
+
idle: "#6b7280", // gray
|
|
11
|
+
pending: "#f59e0b", // amber
|
|
12
|
+
running: "#3b82f6", // blue
|
|
13
|
+
completed: "#10b981", // emerald
|
|
14
|
+
failed: "#ef4444", // red
|
|
15
|
+
cancelled: "#6b7280", // gray
|
|
16
|
+
skipped: "#8b5cf6", // violet
|
|
17
17
|
};
|
|
18
18
|
return statusColors[status] || statusColors.idle;
|
|
19
19
|
}
|
|
@@ -22,13 +22,13 @@ export function getStatusColor(status) {
|
|
|
22
22
|
*/
|
|
23
23
|
export function getStatusIcon(status) {
|
|
24
24
|
const statusIcons = {
|
|
25
|
-
idle:
|
|
26
|
-
pending:
|
|
27
|
-
running:
|
|
28
|
-
completed:
|
|
29
|
-
failed:
|
|
30
|
-
cancelled:
|
|
31
|
-
skipped:
|
|
25
|
+
idle: "mdi:circle-outline",
|
|
26
|
+
pending: "mdi:clock-outline",
|
|
27
|
+
running: "mdi:loading",
|
|
28
|
+
completed: "mdi:check-circle",
|
|
29
|
+
failed: "mdi:alert-circle",
|
|
30
|
+
cancelled: "mdi:cancel",
|
|
31
|
+
skipped: "mdi:skip-next",
|
|
32
32
|
};
|
|
33
33
|
return statusIcons[status] || statusIcons.idle;
|
|
34
34
|
}
|
|
@@ -37,13 +37,13 @@ export function getStatusIcon(status) {
|
|
|
37
37
|
*/
|
|
38
38
|
export function getStatusLabel(status) {
|
|
39
39
|
const statusLabels = {
|
|
40
|
-
idle:
|
|
41
|
-
pending:
|
|
42
|
-
running:
|
|
43
|
-
completed:
|
|
44
|
-
failed:
|
|
45
|
-
cancelled:
|
|
46
|
-
skipped:
|
|
40
|
+
idle: "Idle",
|
|
41
|
+
pending: "Pending",
|
|
42
|
+
running: "Running",
|
|
43
|
+
completed: "Completed",
|
|
44
|
+
failed: "Failed",
|
|
45
|
+
cancelled: "Cancelled",
|
|
46
|
+
skipped: "Skipped",
|
|
47
47
|
};
|
|
48
48
|
return statusLabels[status] || statusLabels.idle;
|
|
49
49
|
}
|
|
@@ -52,13 +52,13 @@ export function getStatusLabel(status) {
|
|
|
52
52
|
*/
|
|
53
53
|
export function getStatusBackgroundColor(status) {
|
|
54
54
|
const statusBackgroundColors = {
|
|
55
|
-
idle:
|
|
56
|
-
pending:
|
|
57
|
-
running:
|
|
58
|
-
completed:
|
|
59
|
-
failed:
|
|
60
|
-
cancelled:
|
|
61
|
-
skipped:
|
|
55
|
+
idle: "#f9fafb", // light gray
|
|
56
|
+
pending: "#fef3c7", // light amber
|
|
57
|
+
running: "#dbeafe", // light blue
|
|
58
|
+
completed: "#d1fae5", // light emerald
|
|
59
|
+
failed: "#fee2e2", // light red
|
|
60
|
+
cancelled: "#f3f4f6", // light gray
|
|
61
|
+
skipped: "#ede9fe", // light violet
|
|
62
62
|
};
|
|
63
63
|
return statusBackgroundColors[status] || statusBackgroundColors.idle;
|
|
64
64
|
}
|
|
@@ -67,13 +67,13 @@ export function getStatusBackgroundColor(status) {
|
|
|
67
67
|
*/
|
|
68
68
|
export function getStatusTextColor(status) {
|
|
69
69
|
const statusTextColors = {
|
|
70
|
-
idle:
|
|
71
|
-
pending:
|
|
72
|
-
running:
|
|
73
|
-
completed:
|
|
74
|
-
failed:
|
|
75
|
-
cancelled:
|
|
76
|
-
skipped:
|
|
70
|
+
idle: "#6b7280", // gray
|
|
71
|
+
pending: "#d97706", // amber
|
|
72
|
+
running: "#1d4ed8", // blue
|
|
73
|
+
completed: "#059669", // emerald
|
|
74
|
+
failed: "#dc2626", // red
|
|
75
|
+
cancelled: "#6b7280", // gray
|
|
76
|
+
skipped: "#7c3aed", // violet
|
|
77
77
|
};
|
|
78
78
|
return statusTextColors[status] || statusTextColors.idle;
|
|
79
79
|
}
|
|
@@ -82,9 +82,9 @@ export function getStatusTextColor(status) {
|
|
|
82
82
|
*/
|
|
83
83
|
export function createDefaultExecutionInfo() {
|
|
84
84
|
return {
|
|
85
|
-
status:
|
|
85
|
+
status: "idle",
|
|
86
86
|
executionCount: 0,
|
|
87
|
-
isExecuting: false
|
|
87
|
+
isExecuting: false,
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -93,8 +93,8 @@ export function createDefaultExecutionInfo() {
|
|
|
93
93
|
export function updateExecutionStart(executionInfo) {
|
|
94
94
|
return {
|
|
95
95
|
...executionInfo,
|
|
96
|
-
status:
|
|
97
|
-
isExecuting: true
|
|
96
|
+
status: "running",
|
|
97
|
+
isExecuting: true,
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
@@ -103,12 +103,12 @@ export function updateExecutionStart(executionInfo) {
|
|
|
103
103
|
export function updateExecutionComplete(executionInfo, duration) {
|
|
104
104
|
return {
|
|
105
105
|
...executionInfo,
|
|
106
|
-
status:
|
|
106
|
+
status: "completed",
|
|
107
107
|
executionCount: executionInfo.executionCount + 1,
|
|
108
108
|
lastExecuted: new Date().toISOString(),
|
|
109
109
|
lastExecutionDuration: duration,
|
|
110
110
|
isExecuting: false,
|
|
111
|
-
lastError: undefined // Clear any previous error
|
|
111
|
+
lastError: undefined, // Clear any previous error
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -117,12 +117,12 @@ export function updateExecutionComplete(executionInfo, duration) {
|
|
|
117
117
|
export function updateExecutionFailed(executionInfo, error, duration) {
|
|
118
118
|
return {
|
|
119
119
|
...executionInfo,
|
|
120
|
-
status:
|
|
120
|
+
status: "failed",
|
|
121
121
|
executionCount: executionInfo.executionCount + 1,
|
|
122
122
|
lastExecuted: new Date().toISOString(),
|
|
123
123
|
lastExecutionDuration: duration,
|
|
124
124
|
isExecuting: false,
|
|
125
|
-
lastError: error
|
|
125
|
+
lastError: error,
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
@@ -131,9 +131,9 @@ export function updateExecutionFailed(executionInfo, error, duration) {
|
|
|
131
131
|
export function resetExecutionInfo(executionInfo) {
|
|
132
132
|
return {
|
|
133
133
|
...executionInfo,
|
|
134
|
-
status:
|
|
134
|
+
status: "idle",
|
|
135
135
|
isExecuting: false,
|
|
136
|
-
lastError: undefined
|
|
136
|
+
lastError: undefined,
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
@@ -141,7 +141,7 @@ export function resetExecutionInfo(executionInfo) {
|
|
|
141
141
|
*/
|
|
142
142
|
export function formatExecutionDuration(duration) {
|
|
143
143
|
if (!duration)
|
|
144
|
-
return
|
|
144
|
+
return "N/A";
|
|
145
145
|
if (duration < 1000) {
|
|
146
146
|
return `${Math.round(duration)}ms`;
|
|
147
147
|
}
|
|
@@ -159,13 +159,13 @@ export function formatExecutionDuration(duration) {
|
|
|
159
159
|
*/
|
|
160
160
|
export function formatLastExecuted(timestamp) {
|
|
161
161
|
if (!timestamp)
|
|
162
|
-
return
|
|
162
|
+
return "Never";
|
|
163
163
|
const date = new Date(timestamp);
|
|
164
164
|
const now = new Date();
|
|
165
165
|
const diffMs = now.getTime() - date.getTime();
|
|
166
166
|
if (diffMs < 60000) {
|
|
167
167
|
// Less than 1 minute
|
|
168
|
-
return
|
|
168
|
+
return "Just now";
|
|
169
169
|
}
|
|
170
170
|
else if (diffMs < 3600000) {
|
|
171
171
|
// Less than 1 hour
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Works with both built-in types and custom registered types.
|
|
11
11
|
*/
|
|
12
|
-
import type { NodeType, NodeMetadata } from
|
|
12
|
+
import type { NodeType, NodeMetadata } from "../types/index.js";
|
|
13
13
|
/**
|
|
14
14
|
* Gets the SvelteFlow component name for a given NodeType.
|
|
15
15
|
* Uses the node component registry to resolve types.
|
package/dist/utils/nodeTypes.js
CHANGED
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Works with both built-in types and custom registered types.
|
|
11
11
|
*/
|
|
12
|
-
import { nodeComponentRegistry } from
|
|
13
|
-
import { resolveBuiltinAlias, isBuiltinType } from
|
|
12
|
+
import { nodeComponentRegistry } from "../registry/nodeComponentRegistry.js";
|
|
13
|
+
import { resolveBuiltinAlias, isBuiltinType, } from "../registry/builtinNodes.js";
|
|
14
14
|
/**
|
|
15
15
|
* Display names for built-in node types.
|
|
16
16
|
*/
|
|
17
17
|
const TYPE_DISPLAY_NAMES = {
|
|
18
|
-
note:
|
|
19
|
-
simple:
|
|
20
|
-
square:
|
|
21
|
-
tool:
|
|
22
|
-
gateway:
|
|
23
|
-
terminal:
|
|
24
|
-
default:
|
|
18
|
+
note: "Note (sticky note style)",
|
|
19
|
+
simple: "Simple (compact layout)",
|
|
20
|
+
square: "Square (geometric layout)",
|
|
21
|
+
tool: "Tool (specialized for agent tools)",
|
|
22
|
+
gateway: "Gateway (branching control flow)",
|
|
23
|
+
terminal: "Terminal (start/end/exit)",
|
|
24
|
+
default: "Default (standard workflow node)",
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Gets the SvelteFlow component name for a given NodeType.
|
|
@@ -38,7 +38,7 @@ export function getComponentNameForNodeType(nodeType) {
|
|
|
38
38
|
return resolvedType;
|
|
39
39
|
}
|
|
40
40
|
// Unknown type - return workflowNode as default
|
|
41
|
-
return
|
|
41
|
+
return "workflowNode";
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Gets the available node types for a given NodeMetadata.
|
|
@@ -54,7 +54,7 @@ export function getAvailableNodeTypes(metadata) {
|
|
|
54
54
|
if (metadata.type) {
|
|
55
55
|
return [metadata.type];
|
|
56
56
|
}
|
|
57
|
-
return [
|
|
57
|
+
return ["default"];
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Gets the primary (default) node type for a given NodeMetadata.
|
|
@@ -92,7 +92,8 @@ export function resolveNodeType(metadata, configNodeType) {
|
|
|
92
92
|
return configNodeType;
|
|
93
93
|
}
|
|
94
94
|
// Check if it's a registered custom type
|
|
95
|
-
if (nodeComponentRegistry.has(configNodeType) ||
|
|
95
|
+
if (nodeComponentRegistry.has(configNodeType) ||
|
|
96
|
+
nodeComponentRegistry.has(resolvedConfig)) {
|
|
96
97
|
return configNodeType;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
@@ -171,7 +172,7 @@ export function getNodeTypeOneOfOptions(metadata, includeCustomTypes = false) {
|
|
|
171
172
|
// Optionally include all registered custom types
|
|
172
173
|
if (includeCustomTypes) {
|
|
173
174
|
const registrations = nodeComponentRegistry.filter({
|
|
174
|
-
predicate: (reg) => !isBuiltinType(reg.type) && !includedTypes.has(reg.type)
|
|
175
|
+
predicate: (reg) => !isBuiltinType(reg.type) && !includedTypes.has(reg.type),
|
|
175
176
|
});
|
|
176
177
|
for (const reg of registrations) {
|
|
177
178
|
options.push({ const: reg.type, title: reg.displayName });
|
|
@@ -194,11 +195,11 @@ export function createNodeTypeConfigProperty(metadata, defaultType) {
|
|
|
194
195
|
const oneOf = getNodeTypeOneOfOptions(metadata);
|
|
195
196
|
const primaryType = defaultType ?? getPrimaryNodeType(metadata);
|
|
196
197
|
return {
|
|
197
|
-
type:
|
|
198
|
-
title:
|
|
199
|
-
description:
|
|
198
|
+
type: "string",
|
|
199
|
+
title: "Node Type",
|
|
200
|
+
description: "Choose the visual representation for this node",
|
|
200
201
|
default: primaryType,
|
|
201
|
-
oneOf
|
|
202
|
+
oneOf,
|
|
202
203
|
};
|
|
203
204
|
}
|
|
204
205
|
/**
|
|
@@ -226,12 +227,12 @@ export function getAllNodeTypes() {
|
|
|
226
227
|
*/
|
|
227
228
|
function formatTypeName(type) {
|
|
228
229
|
// Handle namespaced types (e.g., "mylib:fancy" -> "Mylib: Fancy")
|
|
229
|
-
if (type.includes(
|
|
230
|
-
const [namespace, name] = type.split(
|
|
230
|
+
if (type.includes(":")) {
|
|
231
|
+
const [namespace, name] = type.split(":");
|
|
231
232
|
return `${capitalize(namespace)}: ${capitalize(name)}`;
|
|
232
233
|
}
|
|
233
234
|
// Capitalize and add spaces for camelCase
|
|
234
|
-
return capitalize(type.replace(/([A-Z])/g,
|
|
235
|
+
return capitalize(type.replace(/([A-Z])/g, " $1").trim());
|
|
235
236
|
}
|
|
236
237
|
/**
|
|
237
238
|
* Capitalize the first letter of a string.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Node Wrapper Utilities
|
|
3
3
|
* Provides utilities for wrapping nodes with status overlays
|
|
4
4
|
*/
|
|
5
|
-
import type { NodeExecutionInfo } from
|
|
5
|
+
import type { NodeExecutionInfo } from "../types/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Configuration for node status overlay
|
|
8
8
|
*/
|
|
9
9
|
export interface NodeStatusConfig {
|
|
10
|
-
position?:
|
|
11
|
-
size?:
|
|
10
|
+
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
12
|
showDetails?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -21,8 +21,8 @@ export declare const DEFAULT_NODE_STATUS_CONFIG: NodeStatusConfig;
|
|
|
21
21
|
export declare function createNodeWrapperConfig(nodeId: string, executionInfo?: NodeExecutionInfo, config?: NodeStatusConfig): {
|
|
22
22
|
nodeId: string;
|
|
23
23
|
executionInfo?: NodeExecutionInfo;
|
|
24
|
-
statusPosition: NodeStatusConfig[
|
|
25
|
-
statusSize: NodeStatusConfig[
|
|
24
|
+
statusPosition: NodeStatusConfig["position"];
|
|
25
|
+
statusSize: NodeStatusConfig["size"];
|
|
26
26
|
showStatusDetails: boolean;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -32,8 +32,8 @@ export declare function shouldShowNodeStatus(executionInfo?: NodeExecutionInfo):
|
|
|
32
32
|
/**
|
|
33
33
|
* Get optimal status position based on node type
|
|
34
34
|
*/
|
|
35
|
-
export declare function getOptimalStatusPosition(nodeType: string): NodeStatusConfig[
|
|
35
|
+
export declare function getOptimalStatusPosition(nodeType: string): NodeStatusConfig["position"];
|
|
36
36
|
/**
|
|
37
37
|
* Get optimal status size based on node type
|
|
38
38
|
*/
|
|
39
|
-
export declare function getOptimalStatusSize(nodeType: string): NodeStatusConfig[
|
|
39
|
+
export declare function getOptimalStatusSize(nodeType: string): NodeStatusConfig["size"];
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Default configuration for node status overlays
|
|
7
7
|
*/
|
|
8
8
|
export const DEFAULT_NODE_STATUS_CONFIG = {
|
|
9
|
-
position:
|
|
10
|
-
size:
|
|
11
|
-
showDetails: true
|
|
9
|
+
position: "top-right",
|
|
10
|
+
size: "md",
|
|
11
|
+
showDetails: true,
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Create a node wrapper configuration
|
|
@@ -19,7 +19,7 @@ export function createNodeWrapperConfig(nodeId, executionInfo, config = {}) {
|
|
|
19
19
|
executionInfo,
|
|
20
20
|
statusPosition: config.position || DEFAULT_NODE_STATUS_CONFIG.position,
|
|
21
21
|
statusSize: config.size || DEFAULT_NODE_STATUS_CONFIG.size,
|
|
22
|
-
showStatusDetails: config.showDetails ?? DEFAULT_NODE_STATUS_CONFIG.showDetails ?? true
|
|
22
|
+
showStatusDetails: config.showDetails ?? DEFAULT_NODE_STATUS_CONFIG.showDetails ?? true,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -28,21 +28,23 @@ export function createNodeWrapperConfig(nodeId, executionInfo, config = {}) {
|
|
|
28
28
|
export function shouldShowNodeStatus(executionInfo) {
|
|
29
29
|
if (!executionInfo)
|
|
30
30
|
return false;
|
|
31
|
-
return (executionInfo.status !==
|
|
31
|
+
return (executionInfo.status !== "idle" ||
|
|
32
|
+
executionInfo.executionCount > 0 ||
|
|
33
|
+
executionInfo.isExecuting);
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Get optimal status position based on node type
|
|
35
37
|
*/
|
|
36
38
|
export function getOptimalStatusPosition(nodeType) {
|
|
37
39
|
switch (nodeType) {
|
|
38
|
-
case
|
|
39
|
-
return
|
|
40
|
-
case
|
|
41
|
-
return
|
|
42
|
-
case
|
|
43
|
-
case
|
|
40
|
+
case "tool":
|
|
41
|
+
return "top-left";
|
|
42
|
+
case "note":
|
|
43
|
+
return "bottom-right";
|
|
44
|
+
case "simple":
|
|
45
|
+
case "square":
|
|
44
46
|
default:
|
|
45
|
-
return
|
|
47
|
+
return "top-right";
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
@@ -50,13 +52,13 @@ export function getOptimalStatusPosition(nodeType) {
|
|
|
50
52
|
*/
|
|
51
53
|
export function getOptimalStatusSize(nodeType) {
|
|
52
54
|
switch (nodeType) {
|
|
53
|
-
case
|
|
54
|
-
return
|
|
55
|
-
case
|
|
56
|
-
return
|
|
57
|
-
case
|
|
58
|
-
case
|
|
55
|
+
case "tool":
|
|
56
|
+
return "sm";
|
|
57
|
+
case "note":
|
|
58
|
+
return "sm";
|
|
59
|
+
case "simple":
|
|
60
|
+
case "square":
|
|
59
61
|
default:
|
|
60
|
-
return
|
|
62
|
+
return "md";
|
|
61
63
|
}
|
|
62
64
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Performance Utilities
|
|
3
3
|
* Helper functions for optimizing performance in the FlowDrop app
|
|
4
4
|
*/
|
|
5
|
-
import type { WorkflowNode, WorkflowEdge } from
|
|
5
|
+
import type { WorkflowNode, WorkflowEdge } from "../types/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Fast shallow comparison for workflow nodes
|
|
8
8
|
* Avoids expensive JSON.stringify operations
|
|
@@ -16,7 +16,8 @@ export function areNodeArraysEqual(nodes1, nodes2) {
|
|
|
16
16
|
if (node1?.id !== node2?.id)
|
|
17
17
|
return false;
|
|
18
18
|
// Check position (most common change during drag)
|
|
19
|
-
if (node1?.position?.x !== node2?.position?.x ||
|
|
19
|
+
if (node1?.position?.x !== node2?.position?.x ||
|
|
20
|
+
node1?.position?.y !== node2?.position?.y) {
|
|
20
21
|
return false;
|
|
21
22
|
}
|
|
22
23
|
// Check selected state
|
package/dist/utils/sanitize.js
CHANGED
package/dist/utils/uischema.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Functions for resolving JSON Pointer scope strings to property keys,
|
|
5
5
|
* and for generating default UISchema from a ConfigSchema.
|
|
6
6
|
*/
|
|
7
|
-
import type { ConfigSchema } from
|
|
8
|
-
import type { UISchemaElement, UISchemaVerticalLayout } from
|
|
7
|
+
import type { ConfigSchema } from "../types/index.js";
|
|
8
|
+
import type { UISchemaElement, UISchemaVerticalLayout } from "../types/uischema.js";
|
|
9
9
|
/**
|
|
10
10
|
* Resolve a JSON Pointer scope string to a property key.
|
|
11
11
|
*
|
package/dist/utils/uischema.js
CHANGED
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export function resolveScopeToKey(scope) {
|
|
23
|
-
const prefix =
|
|
23
|
+
const prefix = "#/properties/";
|
|
24
24
|
if (!scope.startsWith(prefix)) {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
const key = scope.slice(prefix.length);
|
|
28
28
|
// Only support single-level property references (no nested paths)
|
|
29
|
-
if (key.includes(
|
|
29
|
+
if (key.includes("/") || key.length === 0) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
return key;
|
|
@@ -53,12 +53,12 @@ export function keyToScope(key) {
|
|
|
53
53
|
*/
|
|
54
54
|
export function generateDefaultUISchema(schema) {
|
|
55
55
|
const elements = Object.keys(schema.properties).map((key) => ({
|
|
56
|
-
type:
|
|
57
|
-
scope: keyToScope(key)
|
|
56
|
+
type: "Control",
|
|
57
|
+
scope: keyToScope(key),
|
|
58
58
|
}));
|
|
59
59
|
return {
|
|
60
|
-
type:
|
|
61
|
-
elements
|
|
60
|
+
type: "VerticalLayout",
|
|
61
|
+
elements,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
@@ -72,12 +72,12 @@ export function generateDefaultUISchema(schema) {
|
|
|
72
72
|
export function collectReferencedKeys(element) {
|
|
73
73
|
const keys = new Set();
|
|
74
74
|
function walk(el) {
|
|
75
|
-
if (el.type ===
|
|
75
|
+
if (el.type === "Control") {
|
|
76
76
|
const key = resolveScopeToKey(el.scope);
|
|
77
77
|
if (key)
|
|
78
78
|
keys.add(key);
|
|
79
79
|
}
|
|
80
|
-
else if (el.type ===
|
|
80
|
+
else if (el.type === "VerticalLayout" || el.type === "Group") {
|
|
81
81
|
for (const child of el.elements) {
|
|
82
82
|
walk(child);
|
|
83
83
|
}
|
package/dist/utils/validation.js
CHANGED
|
@@ -19,21 +19,33 @@
|
|
|
19
19
|
* @returns A `WorkflowValidationResult` indicating whether the data is valid.
|
|
20
20
|
*/
|
|
21
21
|
export function validateWorkflowData(data) {
|
|
22
|
-
if (data === null || typeof data !==
|
|
23
|
-
return { valid: false, error:
|
|
22
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
23
|
+
return { valid: false, error: "Workflow must be a JSON object." };
|
|
24
24
|
}
|
|
25
25
|
const obj = data;
|
|
26
|
-
if (typeof obj.id !==
|
|
27
|
-
return {
|
|
26
|
+
if (typeof obj.id !== "string" || obj.id.trim() === "") {
|
|
27
|
+
return {
|
|
28
|
+
valid: false,
|
|
29
|
+
error: 'Workflow JSON must contain a non-empty string "id" field.',
|
|
30
|
+
};
|
|
28
31
|
}
|
|
29
|
-
if (typeof obj.name !==
|
|
30
|
-
return {
|
|
32
|
+
if (typeof obj.name !== "string" || obj.name.trim() === "") {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
error: 'Workflow JSON must contain a non-empty string "name" field.',
|
|
36
|
+
};
|
|
31
37
|
}
|
|
32
38
|
if (!Array.isArray(obj.nodes)) {
|
|
33
|
-
return {
|
|
39
|
+
return {
|
|
40
|
+
valid: false,
|
|
41
|
+
error: 'Workflow JSON must contain a "nodes" array.',
|
|
42
|
+
};
|
|
34
43
|
}
|
|
35
44
|
if (!Array.isArray(obj.edges)) {
|
|
36
|
-
return {
|
|
45
|
+
return {
|
|
46
|
+
valid: false,
|
|
47
|
+
error: 'Workflow JSON must contain an "edges" array.',
|
|
48
|
+
};
|
|
37
49
|
}
|
|
38
50
|
return { valid: true };
|
|
39
51
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A drop-in visual workflow editor for any web application. You own the backend. You own the data. You own the orchestration.",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.0
|
|
6
|
+
"version": "1.2.0",
|
|
7
7
|
"author": "Shibin Das (D34dMan)",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/flowdrop-io/flowdrop/issues"
|