@flowdrop/flowdrop 1.0.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/adapters/WorkflowAdapter.d.ts +167 -0
- package/dist/adapters/WorkflowAdapter.js +368 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +626 -0
- package/dist/adapters/agentspec/agentAdapter.d.ts +59 -0
- package/dist/adapters/agentspec/agentAdapter.js +91 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +34 -0
- package/dist/adapters/agentspec/autoLayout.js +127 -0
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
- package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +53 -0
- package/dist/adapters/agentspec/defaultNodeTypes.js +561 -0
- package/dist/adapters/agentspec/index.d.ts +37 -0
- package/dist/adapters/agentspec/index.js +39 -0
- package/dist/adapters/agentspec/validator.d.ts +34 -0
- package/dist/adapters/agentspec/validator.js +169 -0
- package/dist/api/enhanced-client.d.ts +183 -0
- package/dist/api/enhanced-client.js +430 -0
- package/dist/components/App.svelte +981 -0
- package/dist/components/App.svelte.d.ts +54 -0
- package/dist/components/CanvasBanner.stories.svelte +29 -0
- package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
- package/dist/components/CanvasBanner.svelte +57 -0
- package/dist/components/CanvasBanner.svelte.d.ts +8 -0
- package/dist/components/ConfigForm.svelte +1138 -0
- package/dist/components/ConfigForm.svelte.d.ts +44 -0
- package/dist/components/ConfigModal.svelte +188 -0
- package/dist/components/ConfigModal.svelte.d.ts +13 -0
- package/dist/components/ConfigPanel.stories.svelte +47 -0
- package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
- package/dist/components/ConfigPanel.svelte +182 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/EdgeRefresher.svelte +41 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/FlowDropZone.svelte +83 -0
- package/dist/components/FlowDropZone.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.stories.svelte +30 -0
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
- package/dist/components/LoadingSpinner.svelte +36 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +8 -0
- package/dist/components/Logo.stories.svelte +22 -0
- package/dist/components/Logo.stories.svelte.d.ts +27 -0
- package/dist/components/Logo.svelte +102 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +563 -0
- package/dist/components/LogsSidebar.svelte.d.ts +17 -0
- package/dist/components/MarkdownDisplay.stories.svelte +36 -0
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
- package/dist/components/MarkdownDisplay.svelte +29 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.stories.svelte +53 -0
- package/dist/components/Navbar.stories.svelte.d.ts +27 -0
- package/dist/components/Navbar.svelte +726 -0
- package/dist/components/Navbar.svelte.d.ts +29 -0
- package/dist/components/NodeSidebar.svelte +762 -0
- package/dist/components/NodeSidebar.svelte.d.ts +9 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +85 -0
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/PipelineStatus.svelte +314 -0
- package/dist/components/PipelineStatus.svelte.d.ts +20 -0
- package/dist/components/PortCoordinateTracker.svelte +58 -0
- package/dist/components/PortCoordinateTracker.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +170 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/SchemaForm.stories.svelte +116 -0
- package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
- package/dist/components/SchemaForm.svelte +536 -0
- package/dist/components/SchemaForm.svelte.d.ts +83 -0
- package/dist/components/SettingsModal.svelte +279 -0
- package/dist/components/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/SettingsPanel.svelte +638 -0
- package/dist/components/SettingsPanel.svelte.d.ts +21 -0
- package/dist/components/StatusIcon.stories.svelte +60 -0
- package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
- package/dist/components/StatusIcon.svelte +119 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.stories.svelte +17 -0
- package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.stories.svelte +25 -0
- package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
- package/dist/components/ThemeToggle.svelte +185 -0
- package/dist/components/ThemeToggle.svelte.d.ts +14 -0
- package/dist/components/UniversalNode.svelte +155 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +1035 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +23 -0
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormAutocomplete.svelte +1009 -0
- package/dist/components/form/FormAutocomplete.svelte.d.ts +25 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormCheckboxGroup.svelte +155 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +17 -0
- package/dist/components/form/FormCodeEditor.svelte +458 -0
- package/dist/components/form/FormCodeEditor.svelte.d.ts +25 -0
- package/dist/components/form/FormField.svelte +417 -0
- package/dist/components/form/FormField.svelte.d.ts +29 -0
- package/dist/components/form/FormFieldLight.svelte +425 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte +53 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormFieldWrapper.svelte +125 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +752 -0
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +33 -0
- package/dist/components/form/FormNumberField.stories.svelte +36 -0
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormNumberField.svelte +112 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +25 -0
- package/dist/components/form/FormRangeField.stories.svelte +31 -0
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormRangeField.svelte +246 -0
- package/dist/components/form/FormRangeField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.stories.svelte +50 -0
- package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormSelect.svelte +129 -0
- package/dist/components/form/FormSelect.svelte.d.ts +20 -0
- package/dist/components/form/FormTemplateEditor.svelte +825 -0
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +41 -0
- package/dist/components/form/FormTextField.stories.svelte +30 -0
- package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextField.svelte +91 -0
- package/dist/components/form/FormTextField.svelte.d.ts +19 -0
- package/dist/components/form/FormTextarea.stories.svelte +34 -0
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextarea.svelte +97 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +21 -0
- package/dist/components/form/FormToggle.stories.svelte +30 -0
- package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormToggle.svelte +126 -0
- package/dist/components/form/FormToggle.svelte.d.ts +19 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +136 -0
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +32 -0
- package/dist/components/form/index.d.ts +50 -0
- package/dist/components/form/index.js +54 -0
- package/dist/components/form/templateAutocomplete.d.ts +29 -0
- package/dist/components/form/templateAutocomplete.js +254 -0
- package/dist/components/form/types.d.ts +485 -0
- package/dist/components/form/types.js +73 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +52 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +401 -0
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +71 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +292 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +25 -0
- package/dist/components/interrupt/FormPrompt.svelte +236 -0
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/InterruptBubble.svelte +601 -0
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +16 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +67 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -0
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +47 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +346 -0
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/index.d.ts +13 -0
- package/dist/components/interrupt/index.js +15 -0
- package/dist/components/layouts/MainLayout.svelte +718 -0
- package/dist/components/layouts/MainLayout.svelte.d.ts +62 -0
- package/dist/components/nodes/GatewayNode.stories.svelte +108 -0
- package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +591 -0
- package/dist/components/nodes/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/nodes/IdeaNode.stories.svelte +52 -0
- package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/IdeaNode.svelte +455 -0
- package/dist/components/nodes/IdeaNode.svelte.d.ts +24 -0
- package/dist/components/nodes/NotesNode.stories.svelte +76 -0
- package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/NotesNode.svelte +378 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +24 -0
- package/dist/components/nodes/SimpleNode.stories.svelte +159 -0
- package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SimpleNode.svelte +451 -0
- package/dist/components/nodes/SimpleNode.svelte.d.ts +25 -0
- package/dist/components/nodes/SquareNode.stories.svelte +82 -0
- package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SquareNode.svelte +407 -0
- package/dist/components/nodes/SquareNode.svelte.d.ts +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/TerminalNode.svelte +690 -0
- package/dist/components/nodes/TerminalNode.svelte.d.ts +25 -0
- package/dist/components/nodes/ToolNode.stories.svelte +189 -0
- package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/ToolNode.svelte +471 -0
- package/dist/components/nodes/ToolNode.svelte.d.ts +36 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte +55 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/WorkflowNode.svelte +571 -0
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +15 -0
- package/dist/components/playground/ChatPanel.svelte +905 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +46 -0
- package/dist/components/playground/ExecutionLogs.svelte +488 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.stories.svelte +62 -0
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
- package/dist/components/playground/MessageBubble.svelte +633 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +24 -0
- package/dist/components/playground/Playground.svelte +1075 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/PlaygroundModal.svelte +220 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +538 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +31 -0
- package/dist/config/defaultCategories.d.ts +7 -0
- package/dist/config/defaultCategories.js +126 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +201 -0
- package/dist/config/endpoints.d.ts +160 -0
- package/dist/config/endpoints.js +146 -0
- package/dist/config/runtimeConfig.d.ts +47 -0
- package/dist/config/runtimeConfig.js +80 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.js +92 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +95 -0
- package/dist/editor/index.js +138 -0
- package/dist/form/code.d.ts +101 -0
- package/dist/form/code.js +168 -0
- package/dist/form/fieldRegistry.d.ts +169 -0
- package/dist/form/fieldRegistry.js +152 -0
- package/dist/form/full.d.ts +56 -0
- package/dist/form/full.js +80 -0
- package/dist/form/index.d.ts +77 -0
- package/dist/form/index.js +91 -0
- package/dist/form/markdown.d.ts +69 -0
- package/dist/form/markdown.js +103 -0
- package/dist/helpers/nodeLayoutHelper.d.ts +14 -0
- package/dist/helpers/nodeLayoutHelper.js +19 -0
- package/dist/helpers/proximityConnect.d.ts +94 -0
- package/dist/helpers/proximityConnect.js +314 -0
- package/dist/helpers/workflowEditorHelper.d.ts +183 -0
- package/dist/helpers/workflowEditorHelper.js +595 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +64 -0
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +22 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +36 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/playground/index.d.ts +131 -0
- package/dist/playground/index.js +172 -0
- package/dist/playground/mount.d.ts +203 -0
- package/dist/playground/mount.js +235 -0
- package/dist/registry/BaseRegistry.d.ts +92 -0
- package/dist/registry/BaseRegistry.js +124 -0
- package/dist/registry/builtinFormats.d.ts +23 -0
- package/dist/registry/builtinFormats.js +70 -0
- package/dist/registry/builtinNodes.d.ts +77 -0
- package/dist/registry/builtinNodes.js +211 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/nodeComponentRegistry.d.ts +276 -0
- package/dist/registry/nodeComponentRegistry.js +262 -0
- package/dist/registry/plugin.d.ts +215 -0
- package/dist/registry/plugin.js +249 -0
- package/dist/registry/workflowFormatRegistry.d.ts +122 -0
- package/dist/registry/workflowFormatRegistry.js +96 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/index.js +23 -0
- package/dist/schemas/v1/workflow.schema.json +1078 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +334 -0
- package/dist/services/api.d.ts +115 -0
- package/dist/services/api.js +214 -0
- package/dist/services/apiVariableService.d.ts +114 -0
- package/dist/services/apiVariableService.js +338 -0
- package/dist/services/autoSaveService.d.ts +112 -0
- package/dist/services/autoSaveService.js +227 -0
- package/dist/services/categoriesApi.d.ts +14 -0
- package/dist/services/categoriesApi.js +49 -0
- package/dist/services/draftStorage.d.ts +171 -0
- package/dist/services/draftStorage.js +299 -0
- package/dist/services/dynamicSchemaService.d.ts +108 -0
- package/dist/services/dynamicSchemaService.js +444 -0
- package/dist/services/globalSave.d.ts +69 -0
- package/dist/services/globalSave.js +248 -0
- package/dist/services/historyService.d.ts +208 -0
- package/dist/services/historyService.js +321 -0
- package/dist/services/interruptService.d.ts +133 -0
- package/dist/services/interruptService.js +280 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +266 -0
- package/dist/services/playgroundService.d.ts +130 -0
- package/dist/services/playgroundService.js +321 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +54 -0
- package/dist/services/settingsService.d.ts +92 -0
- package/dist/services/settingsService.js +196 -0
- package/dist/services/toastService.d.ts +156 -0
- package/dist/services/toastService.js +265 -0
- package/dist/services/variableService.d.ts +141 -0
- package/dist/services/variableService.js +463 -0
- package/dist/services/workflowStorage.d.ts +37 -0
- package/dist/services/workflowStorage.js +116 -0
- package/dist/settings/index.d.ts +25 -0
- package/dist/settings/index.js +33 -0
- package/dist/stores/categoriesStore.svelte.d.ts +32 -0
- package/dist/stores/categoriesStore.svelte.js +77 -0
- package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
- package/dist/stores/editorStateMachine.svelte.js +132 -0
- package/dist/stores/historyStore.svelte.d.ts +136 -0
- package/dist/stores/historyStore.svelte.js +207 -0
- package/dist/stores/interruptStore.svelte.d.ts +179 -0
- package/dist/stores/interruptStore.svelte.js +346 -0
- package/dist/stores/playgroundStore.svelte.d.ts +230 -0
- package/dist/stores/playgroundStore.svelte.js +515 -0
- package/dist/stores/portCoordinateStore.svelte.d.ts +66 -0
- package/dist/stores/portCoordinateStore.svelte.js +186 -0
- package/dist/stores/settingsStore.svelte.d.ts +158 -0
- package/dist/stores/settingsStore.svelte.js +544 -0
- package/dist/stores/workflowStore.svelte.d.ts +260 -0
- package/dist/stores/workflowStore.svelte.js +649 -0
- package/dist/stories/CanvasDecorator.svelte +49 -0
- package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
- package/dist/stories/NodeDecorator.svelte +73 -0
- package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
- package/dist/stories/utils.d.ts +93 -0
- package/dist/stories/utils.js +122 -0
- package/dist/styles/base.css +1300 -0
- package/dist/styles/toast.css +35 -0
- package/dist/styles/tokens.css +475 -0
- package/dist/svelte-app.d.ts +150 -0
- package/dist/svelte-app.js +295 -0
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/auth.d.ts +263 -0
- package/dist/types/auth.js +229 -0
- package/dist/types/config.d.ts +151 -0
- package/dist/types/config.js +7 -0
- package/dist/types/events.d.ts +190 -0
- package/dist/types/events.js +30 -0
- package/dist/types/index.d.ts +1234 -0
- package/dist/types/index.js +27 -0
- package/dist/types/interrupt.d.ts +390 -0
- package/dist/types/interrupt.js +145 -0
- package/dist/types/interruptState.d.ts +211 -0
- package/dist/types/interruptState.js +308 -0
- package/dist/types/playground.d.ts +351 -0
- package/dist/types/playground.js +95 -0
- package/dist/types/settings.d.ts +189 -0
- package/dist/types/settings.js +97 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/colors.d.ts +288 -0
- package/dist/utils/colors.js +548 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.js +226 -0
- package/dist/utils/connections.d.ts +125 -0
- package/dist/utils/connections.js +414 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/fetchWithAuth.d.ts +25 -0
- package/dist/utils/fetchWithAuth.js +34 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/dist/utils/handlePositioning.d.ts +31 -0
- package/dist/utils/handlePositioning.js +35 -0
- package/dist/utils/icons.d.ts +106 -0
- package/dist/utils/icons.js +157 -0
- package/dist/utils/logger.d.ts +47 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +117 -0
- package/dist/utils/nodeTypes.js +244 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/dist/utils/performanceUtils.d.ts +30 -0
- package/dist/utils/performanceUtils.js +108 -0
- package/dist/utils/sanitize.d.ts +19 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.js +39 -0
- package/package.json +292 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Types for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive type definitions for all user-configurable settings.
|
|
5
|
+
* Supports theme, editor, UI, behavior, and API settings with hybrid persistence.
|
|
6
|
+
*
|
|
7
|
+
* @module types/settings
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* All available settings categories
|
|
11
|
+
*/
|
|
12
|
+
export const SETTINGS_CATEGORIES = ['theme', 'editor', 'ui', 'behavior', 'api'];
|
|
13
|
+
/**
|
|
14
|
+
* Human-readable labels for settings categories
|
|
15
|
+
*/
|
|
16
|
+
export const SETTINGS_CATEGORY_LABELS = {
|
|
17
|
+
theme: 'Theme',
|
|
18
|
+
editor: 'Editor',
|
|
19
|
+
ui: 'UI',
|
|
20
|
+
behavior: 'Behavior',
|
|
21
|
+
api: 'API'
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Icons for settings categories (Iconify icon names)
|
|
25
|
+
*/
|
|
26
|
+
export const SETTINGS_CATEGORY_ICONS = {
|
|
27
|
+
theme: 'mdi:palette',
|
|
28
|
+
editor: 'mdi:grid',
|
|
29
|
+
ui: 'mdi:view-dashboard',
|
|
30
|
+
behavior: 'mdi:cog-play',
|
|
31
|
+
api: 'mdi:api'
|
|
32
|
+
};
|
|
33
|
+
// =========================================================================
|
|
34
|
+
// Default Settings
|
|
35
|
+
// =========================================================================
|
|
36
|
+
/**
|
|
37
|
+
* Default theme settings
|
|
38
|
+
*/
|
|
39
|
+
export const DEFAULT_THEME_SETTINGS = {
|
|
40
|
+
preference: 'dark'
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Default editor settings
|
|
44
|
+
*/
|
|
45
|
+
export const DEFAULT_EDITOR_SETTINGS = {
|
|
46
|
+
showGrid: true,
|
|
47
|
+
snapToGrid: true,
|
|
48
|
+
gridSize: 20,
|
|
49
|
+
showMinimap: true,
|
|
50
|
+
defaultZoom: 1,
|
|
51
|
+
fitViewOnLoad: true,
|
|
52
|
+
proximityConnect: false,
|
|
53
|
+
proximityConnectDistance: 150
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Default UI settings
|
|
57
|
+
*/
|
|
58
|
+
export const DEFAULT_UI_SETTINGS = {
|
|
59
|
+
sidebarWidth: 280,
|
|
60
|
+
sidebarCollapsed: false,
|
|
61
|
+
compactMode: false
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Default behavior settings
|
|
65
|
+
*/
|
|
66
|
+
export const DEFAULT_BEHAVIOR_SETTINGS = {
|
|
67
|
+
autoSave: false,
|
|
68
|
+
autoSaveInterval: 30000,
|
|
69
|
+
undoHistoryLimit: 50,
|
|
70
|
+
confirmDelete: false
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Default API settings
|
|
74
|
+
*/
|
|
75
|
+
export const DEFAULT_API_SETTINGS = {
|
|
76
|
+
timeout: 30000,
|
|
77
|
+
retryEnabled: true,
|
|
78
|
+
retryAttempts: 3,
|
|
79
|
+
cacheEnabled: false
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Complete default settings object
|
|
83
|
+
*/
|
|
84
|
+
export const DEFAULT_SETTINGS = {
|
|
85
|
+
theme: DEFAULT_THEME_SETTINGS,
|
|
86
|
+
editor: DEFAULT_EDITOR_SETTINGS,
|
|
87
|
+
ui: DEFAULT_UI_SETTINGS,
|
|
88
|
+
behavior: DEFAULT_BEHAVIOR_SETTINGS,
|
|
89
|
+
api: DEFAULT_API_SETTINGS
|
|
90
|
+
};
|
|
91
|
+
// =========================================================================
|
|
92
|
+
// Settings Persistence Types
|
|
93
|
+
// =========================================================================
|
|
94
|
+
/**
|
|
95
|
+
* localStorage key for persisting settings
|
|
96
|
+
*/
|
|
97
|
+
export const SETTINGS_STORAGE_KEY = 'flowdrop-settings';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UISchema Types for FlowDrop Form Layout
|
|
3
|
+
*
|
|
4
|
+
* Inspired by JSON Forms (EclipseSource) UISchema specification.
|
|
5
|
+
* Controls how form fields are arranged, grouped, and displayed
|
|
6
|
+
* without modifying the underlying data schema (ConfigSchema).
|
|
7
|
+
*
|
|
8
|
+
* The UISchema is a separate concern from the data schema:
|
|
9
|
+
* - ConfigSchema defines what data is valid (validation)
|
|
10
|
+
* - UISchema defines how the form is rendered (presentation)
|
|
11
|
+
*
|
|
12
|
+
* @see https://jsonforms.io/docs/uischema
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```json
|
|
16
|
+
* {
|
|
17
|
+
* "type": "VerticalLayout",
|
|
18
|
+
* "elements": [
|
|
19
|
+
* { "type": "Control", "scope": "#/properties/model" },
|
|
20
|
+
* {
|
|
21
|
+
* "type": "Group",
|
|
22
|
+
* "label": "Advanced Settings",
|
|
23
|
+
* "collapsible": true,
|
|
24
|
+
* "defaultOpen": false,
|
|
25
|
+
* "elements": [
|
|
26
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
27
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
28
|
+
* ]
|
|
29
|
+
* }
|
|
30
|
+
* ]
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Supported UISchema element types.
|
|
36
|
+
* Designed for future extension with HorizontalLayout, Categorization, etc.
|
|
37
|
+
*/
|
|
38
|
+
export type UISchemaElementType = 'VerticalLayout' | 'Group' | 'Control';
|
|
39
|
+
/**
|
|
40
|
+
* Base interface for all UISchema elements.
|
|
41
|
+
*/
|
|
42
|
+
export interface UISchemaElementBase {
|
|
43
|
+
/** Discriminator for the element type */
|
|
44
|
+
type: UISchemaElementType;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Control element - references a single field in the data schema.
|
|
48
|
+
* Uses JSON Pointer syntax for the scope path.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```json
|
|
52
|
+
* { "type": "Control", "scope": "#/properties/temperature" }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export interface UISchemaControl extends UISchemaElementBase {
|
|
56
|
+
type: 'Control';
|
|
57
|
+
/**
|
|
58
|
+
* JSON Pointer to the property in the data schema.
|
|
59
|
+
* Must follow the format: #/properties/<fieldName>
|
|
60
|
+
*/
|
|
61
|
+
scope: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional label override. If not provided, the field's
|
|
64
|
+
* schema title or key is used.
|
|
65
|
+
*/
|
|
66
|
+
label?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Layout container that arranges its child elements vertically.
|
|
70
|
+
* Can be used as root element or nested inside groups.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```json
|
|
74
|
+
* {
|
|
75
|
+
* "type": "VerticalLayout",
|
|
76
|
+
* "elements": [
|
|
77
|
+
* { "type": "Control", "scope": "#/properties/name" },
|
|
78
|
+
* { "type": "Control", "scope": "#/properties/email" }
|
|
79
|
+
* ]
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export interface UISchemaVerticalLayout extends UISchemaElementBase {
|
|
84
|
+
type: 'VerticalLayout';
|
|
85
|
+
/** Child elements to render vertically */
|
|
86
|
+
elements: UISchemaElement[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Group element - renders a fieldset with a label and optional collapsible behavior.
|
|
90
|
+
* Extends the JSON Forms Group with FlowDrop-specific collapse options.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```json
|
|
94
|
+
* {
|
|
95
|
+
* "type": "Group",
|
|
96
|
+
* "label": "Advanced Settings",
|
|
97
|
+
* "description": "Fine-tuning parameters",
|
|
98
|
+
* "collapsible": true,
|
|
99
|
+
* "defaultOpen": false,
|
|
100
|
+
* "elements": [
|
|
101
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
102
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
103
|
+
* ]
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export interface UISchemaGroup extends UISchemaElementBase {
|
|
108
|
+
type: 'Group';
|
|
109
|
+
/** Display label for the fieldset legend / summary */
|
|
110
|
+
label: string;
|
|
111
|
+
/** Child elements within the group */
|
|
112
|
+
elements: UISchemaElement[];
|
|
113
|
+
/** Optional description displayed below the label */
|
|
114
|
+
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the group can be collapsed.
|
|
117
|
+
* When true, renders as `<details>/<summary>`.
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
120
|
+
collapsible?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the group is initially open (expanded).
|
|
123
|
+
* Only relevant when collapsible is true.
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
defaultOpen?: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Union type of all supported UISchema elements.
|
|
130
|
+
* This is the recursive type used in elements arrays.
|
|
131
|
+
*/
|
|
132
|
+
export type UISchemaElement = UISchemaControl | UISchemaVerticalLayout | UISchemaGroup;
|
|
133
|
+
/**
|
|
134
|
+
* Type guard: checks if element is a Control
|
|
135
|
+
*/
|
|
136
|
+
export declare function isUISchemaControl(element: UISchemaElement): element is UISchemaControl;
|
|
137
|
+
/**
|
|
138
|
+
* Type guard: checks if element is a VerticalLayout
|
|
139
|
+
*/
|
|
140
|
+
export declare function isUISchemaVerticalLayout(element: UISchemaElement): element is UISchemaVerticalLayout;
|
|
141
|
+
/**
|
|
142
|
+
* Type guard: checks if element is a Group
|
|
143
|
+
*/
|
|
144
|
+
export declare function isUISchemaGroup(element: UISchemaElement): element is UISchemaGroup;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UISchema Types for FlowDrop Form Layout
|
|
3
|
+
*
|
|
4
|
+
* Inspired by JSON Forms (EclipseSource) UISchema specification.
|
|
5
|
+
* Controls how form fields are arranged, grouped, and displayed
|
|
6
|
+
* without modifying the underlying data schema (ConfigSchema).
|
|
7
|
+
*
|
|
8
|
+
* The UISchema is a separate concern from the data schema:
|
|
9
|
+
* - ConfigSchema defines what data is valid (validation)
|
|
10
|
+
* - UISchema defines how the form is rendered (presentation)
|
|
11
|
+
*
|
|
12
|
+
* @see https://jsonforms.io/docs/uischema
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```json
|
|
16
|
+
* {
|
|
17
|
+
* "type": "VerticalLayout",
|
|
18
|
+
* "elements": [
|
|
19
|
+
* { "type": "Control", "scope": "#/properties/model" },
|
|
20
|
+
* {
|
|
21
|
+
* "type": "Group",
|
|
22
|
+
* "label": "Advanced Settings",
|
|
23
|
+
* "collapsible": true,
|
|
24
|
+
* "defaultOpen": false,
|
|
25
|
+
* "elements": [
|
|
26
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
27
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
28
|
+
* ]
|
|
29
|
+
* }
|
|
30
|
+
* ]
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Type guard: checks if element is a Control
|
|
36
|
+
*/
|
|
37
|
+
export function isUISchemaControl(element) {
|
|
38
|
+
return element.type === 'Control';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Type guard: checks if element is a VerticalLayout
|
|
42
|
+
*/
|
|
43
|
+
export function isUISchemaVerticalLayout(element) {
|
|
44
|
+
return element.type === 'VerticalLayout';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Type guard: checks if element is a Group
|
|
48
|
+
*/
|
|
49
|
+
export function isUISchemaGroup(element) {
|
|
50
|
+
return element.type === 'Group';
|
|
51
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized color management for FlowDrop
|
|
3
|
+
* Ensures consistent category colors across sidebar and canvas
|
|
4
|
+
* Uses BEM syntax for CSS classes
|
|
5
|
+
*/
|
|
6
|
+
import type { NodeCategory, PortDataTypeConfig } from '../types/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Category color mapping to design tokens (CSS variables)
|
|
9
|
+
* Uses --fd-node-* tokens from tokens.css
|
|
10
|
+
* These serve as static defaults; the categories store provides dynamic overrides.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CATEGORY_COLOR_TOKENS: Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the design token for a category color.
|
|
15
|
+
* Checks the categories store first (which includes API overrides),
|
|
16
|
+
* then falls back to the static CATEGORY_COLOR_TOKENS map, then to slate.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getCategoryColorToken(category: NodeCategory): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get the reference color token for a data type (configurable version)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDataTypeColorToken(dataType: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get data type configuration from port config
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDataTypeConfig(dataType: string): PortDataTypeConfig | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Get all available data types from port configuration
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAvailableDataTypes(): PortDataTypeConfig[];
|
|
31
|
+
/**
|
|
32
|
+
* Default colors for fallback cases
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_COLORS: {
|
|
35
|
+
background: string;
|
|
36
|
+
accent: string;
|
|
37
|
+
text: string;
|
|
38
|
+
border: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Get category colors
|
|
42
|
+
* @param category - The node category
|
|
43
|
+
* @returns The color configuration for the category
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCategoryColors(category: NodeCategory): string;
|
|
46
|
+
/**
|
|
47
|
+
* Get category background color
|
|
48
|
+
* @param category - The node category
|
|
49
|
+
* @returns The background color class
|
|
50
|
+
*/
|
|
51
|
+
export declare function getCategoryBackground(category: NodeCategory): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get category accent color
|
|
54
|
+
* @param category - The node category
|
|
55
|
+
* @returns The accent color class
|
|
56
|
+
*/
|
|
57
|
+
export declare function getCategoryAccent(category: NodeCategory): string;
|
|
58
|
+
/**
|
|
59
|
+
* Get category text color
|
|
60
|
+
* @param category - The node category
|
|
61
|
+
* @returns The text color class
|
|
62
|
+
*/
|
|
63
|
+
export declare function getCategoryText(category: NodeCategory): string;
|
|
64
|
+
/**
|
|
65
|
+
* Get category border color
|
|
66
|
+
* @param category - The node category
|
|
67
|
+
* @returns The border color class
|
|
68
|
+
*/
|
|
69
|
+
export declare function getCategoryBorder(category: NodeCategory): string;
|
|
70
|
+
/**
|
|
71
|
+
* Get node colors based on category and state
|
|
72
|
+
* @param category - The node category
|
|
73
|
+
* @param isError - Whether the node is in error state
|
|
74
|
+
* @param isProcessing - Whether the node is processing
|
|
75
|
+
* @param isSelected - Whether the node is selected
|
|
76
|
+
* @returns The color configuration object
|
|
77
|
+
*/
|
|
78
|
+
export declare function getNodeColors(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): {
|
|
79
|
+
background: string;
|
|
80
|
+
accent: string;
|
|
81
|
+
text: string;
|
|
82
|
+
border: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Get node background color
|
|
86
|
+
* @param category - The node category
|
|
87
|
+
* @param isError - Whether the node is in error state
|
|
88
|
+
* @param isProcessing - Whether the node is processing
|
|
89
|
+
* @param isSelected - Whether the node is selected
|
|
90
|
+
* @returns The background color
|
|
91
|
+
*/
|
|
92
|
+
export declare function getNodeBackground(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
93
|
+
/**
|
|
94
|
+
* Get node accent color
|
|
95
|
+
* @param category - The node category
|
|
96
|
+
* @param isError - Whether the node is in error state
|
|
97
|
+
* @param isProcessing - Whether the node is processing
|
|
98
|
+
* @param isSelected - Whether the node is selected
|
|
99
|
+
* @returns The accent color
|
|
100
|
+
*/
|
|
101
|
+
export declare function getNodeAccent(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
102
|
+
/**
|
|
103
|
+
* Get node text color
|
|
104
|
+
* @param category - The node category
|
|
105
|
+
* @param isError - Whether the node is in error state
|
|
106
|
+
* @param isProcessing - Whether the node is processing
|
|
107
|
+
* @param isSelected - Whether the node is selected
|
|
108
|
+
* @returns The text color
|
|
109
|
+
*/
|
|
110
|
+
export declare function getNodeText(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
111
|
+
/**
|
|
112
|
+
* Get node border color
|
|
113
|
+
* @param category - The node category
|
|
114
|
+
* @param isError - Whether the node is in error state
|
|
115
|
+
* @param isProcessing - Whether the node is processing
|
|
116
|
+
* @param isSelected - Whether the node is selected
|
|
117
|
+
* @returns The border color
|
|
118
|
+
*/
|
|
119
|
+
export declare function getNodeBorder(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
120
|
+
/**
|
|
121
|
+
* Get data type color
|
|
122
|
+
* @param dataType - The data type
|
|
123
|
+
* @returns The color for the data type
|
|
124
|
+
*/
|
|
125
|
+
export declare function getDataTypeColor(dataType: string): string;
|
|
126
|
+
/**
|
|
127
|
+
* Parse typed array notation and get display information
|
|
128
|
+
* @param dataType - The data type (e.g., "string[]", "number", "object[]")
|
|
129
|
+
* @returns Object with display information
|
|
130
|
+
*/
|
|
131
|
+
export declare function parseDataTypeDisplay(dataType: string): {
|
|
132
|
+
baseType: string;
|
|
133
|
+
isArray: boolean;
|
|
134
|
+
displayName: string;
|
|
135
|
+
elementType?: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Get formatted display text for a data type
|
|
139
|
+
* @param dataType - The data type
|
|
140
|
+
* @returns Formatted display text
|
|
141
|
+
*/
|
|
142
|
+
export declare function getDataTypeDisplayText(dataType: string): string;
|
|
143
|
+
/**
|
|
144
|
+
* Check if a data type represents an array
|
|
145
|
+
* @param dataType - The data type
|
|
146
|
+
* @returns True if it's an array type
|
|
147
|
+
*/
|
|
148
|
+
export declare function isArrayDataType(dataType: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Get the element type from an array data type
|
|
151
|
+
* @param arrayDataType - The array data type (e.g., "string[]")
|
|
152
|
+
* @returns The element type (e.g., "string") or null if not an array
|
|
153
|
+
*/
|
|
154
|
+
export declare function getArrayElementType(arrayDataType: string): string | null;
|
|
155
|
+
/**
|
|
156
|
+
* Parse a hex color string to RGB components
|
|
157
|
+
* @param hex - Hex color string (e.g., "#f59e0b" or "f59e0b")
|
|
158
|
+
* @returns Object with r, g, b values (0-255) or null if invalid
|
|
159
|
+
*/
|
|
160
|
+
export declare function hexToRgb(hex: string): {
|
|
161
|
+
r: number;
|
|
162
|
+
g: number;
|
|
163
|
+
b: number;
|
|
164
|
+
} | null;
|
|
165
|
+
/**
|
|
166
|
+
* Calculate the relative luminance of a color
|
|
167
|
+
* Based on WCAG 2.1 guidelines for contrast calculations
|
|
168
|
+
* @param r - Red component (0-255)
|
|
169
|
+
* @param g - Green component (0-255)
|
|
170
|
+
* @param b - Blue component (0-255)
|
|
171
|
+
* @returns Relative luminance value (0-1)
|
|
172
|
+
*/
|
|
173
|
+
export declare function getRelativeLuminance(r: number, g: number, b: number): number;
|
|
174
|
+
/**
|
|
175
|
+
* Determine if a background color is considered "light" (needs dark text)
|
|
176
|
+
* @param hex - Hex color string
|
|
177
|
+
* @returns True if the color is light and needs dark text for contrast
|
|
178
|
+
*/
|
|
179
|
+
export declare function isLightColor(hex: string): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Get the appropriate contrast text color (black or white) for a background
|
|
182
|
+
* @param backgroundColor - Hex color string of the background
|
|
183
|
+
* @returns CSS color value for text that provides good contrast
|
|
184
|
+
*/
|
|
185
|
+
export declare function getContrastTextColor(backgroundColor: string): string;
|
|
186
|
+
/**
|
|
187
|
+
* Resolve a CSS variable token to its hex value
|
|
188
|
+
* @param token - CSS variable token (e.g., "var(--fd-node-amber)")
|
|
189
|
+
* @returns Hex color value or the original value if not a known token
|
|
190
|
+
*/
|
|
191
|
+
export declare function resolveColorToken(token: string): string;
|
|
192
|
+
/**
|
|
193
|
+
* Get the appropriate contrast text color for a data type badge
|
|
194
|
+
* @param dataType - The data type (e.g., "array", "string", "number")
|
|
195
|
+
* @returns CSS color value for text that provides good contrast on the data type's background
|
|
196
|
+
*/
|
|
197
|
+
export declare function getContrastTextColorForDataType(dataType: string): string;
|
|
198
|
+
/**
|
|
199
|
+
* Get the appropriate contrast text color for a category badge
|
|
200
|
+
* @param category - The node category
|
|
201
|
+
* @returns CSS color value for text that provides good contrast on the category's background
|
|
202
|
+
*/
|
|
203
|
+
export declare function getContrastTextColorForCategory(category: NodeCategory): string;
|
|
204
|
+
/**
|
|
205
|
+
* Get a semi-transparent tinted background color for ports
|
|
206
|
+
* Creates a cohesive look with the icon wrapper styling
|
|
207
|
+
* @param dataType - The data type
|
|
208
|
+
* @param opacity - Opacity percentage (default 25%)
|
|
209
|
+
* @returns CSS color-mix expression for the tinted background
|
|
210
|
+
*/
|
|
211
|
+
export declare function getPortBackgroundColor(dataType: string, opacity?: number): string;
|
|
212
|
+
/**
|
|
213
|
+
* Get the border color for ports (solid data type color)
|
|
214
|
+
* @param dataType - The data type
|
|
215
|
+
* @returns CSS color value for the port border
|
|
216
|
+
*/
|
|
217
|
+
export declare function getPortBorderColor(dataType: string): string;
|
|
218
|
+
/**
|
|
219
|
+
* Convert RGB components to hex color string
|
|
220
|
+
* @param r - Red component (0-255)
|
|
221
|
+
* @param g - Green component (0-255)
|
|
222
|
+
* @param b - Blue component (0-255)
|
|
223
|
+
* @returns Hex color string with # prefix
|
|
224
|
+
*/
|
|
225
|
+
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
226
|
+
/**
|
|
227
|
+
* Generate a light tint of a color (similar to Tailwind's -50 shade)
|
|
228
|
+
* Creates a very light background-friendly version of the color for light mode
|
|
229
|
+
* @param hex - Base hex color string
|
|
230
|
+
* @returns Light tint hex color string
|
|
231
|
+
*/
|
|
232
|
+
export declare function getLightTint(hex: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Generate a dark tint of a color for dark mode backgrounds
|
|
235
|
+
* Creates a subtle, muted version of the color that works well on dark backgrounds
|
|
236
|
+
* @param hex - Base hex color string
|
|
237
|
+
* @param opacity - Optional opacity for the color overlay (default 0.15)
|
|
238
|
+
* @returns Dark tint hex color string
|
|
239
|
+
*/
|
|
240
|
+
export declare function getDarkTint(hex: string, opacity?: number): string;
|
|
241
|
+
/**
|
|
242
|
+
* Generate a border tint of a color (similar to Tailwind's -300 shade)
|
|
243
|
+
* Creates a medium-light version suitable for borders in light mode
|
|
244
|
+
* @param hex - Base hex color string
|
|
245
|
+
* @returns Border tint hex color string
|
|
246
|
+
*/
|
|
247
|
+
export declare function getBorderTint(hex: string): string;
|
|
248
|
+
/**
|
|
249
|
+
* Generate a dark border tint of a color for dark mode
|
|
250
|
+
* Creates a medium-dark version suitable for borders in dark mode
|
|
251
|
+
* @param hex - Base hex color string
|
|
252
|
+
* @returns Dark border tint hex color string
|
|
253
|
+
*/
|
|
254
|
+
export declare function getDarkBorderTint(hex: string): string;
|
|
255
|
+
/**
|
|
256
|
+
* Color variants interface for theming components
|
|
257
|
+
*/
|
|
258
|
+
export interface ColorVariants {
|
|
259
|
+
/** Base color value */
|
|
260
|
+
base: string;
|
|
261
|
+
/** Light tint for light mode backgrounds */
|
|
262
|
+
light: string;
|
|
263
|
+
/** Border tint for light mode borders */
|
|
264
|
+
border: string;
|
|
265
|
+
/** Dark tint for dark mode backgrounds */
|
|
266
|
+
darkLight: string;
|
|
267
|
+
/** Dark border tint for dark mode borders */
|
|
268
|
+
darkBorder: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Generate color variants for theming a component
|
|
272
|
+
* Returns variants for both light and dark modes
|
|
273
|
+
* @param baseColor - Base hex color string
|
|
274
|
+
* @returns Object with base, light, border, darkLight, and darkBorder color variants
|
|
275
|
+
*/
|
|
276
|
+
export declare function getColorVariants(baseColor: string): ColorVariants;
|
|
277
|
+
/**
|
|
278
|
+
* Get theme-aware color variants
|
|
279
|
+
* Returns the appropriate light or dark variants based on the theme
|
|
280
|
+
* @param baseColor - Base hex color string
|
|
281
|
+
* @param isDarkMode - Whether dark mode is active
|
|
282
|
+
* @returns Object with base, background, and border colors appropriate for the theme
|
|
283
|
+
*/
|
|
284
|
+
export declare function getThemeAwareColorVariants(baseColor: string, isDarkMode: boolean): {
|
|
285
|
+
base: string;
|
|
286
|
+
background: string;
|
|
287
|
+
border: string;
|
|
288
|
+
};
|