@invect/ui 0.0.1
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 +77 -0
- package/dist/Invect-CWpIwZ5F.js +92738 -0
- package/dist/Invect.d.ts +25 -0
- package/dist/InvectShell.d.ts +14 -0
- package/dist/api/agent-tools.api.d.ts +1 -0
- package/dist/api/client.d.ts +207 -0
- package/dist/api/credentials.api.d.ts +47 -0
- package/dist/api/executions.api.d.ts +43 -0
- package/dist/api/flows.api.d.ts +100 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/node-data.api.d.ts +66 -0
- package/dist/api/query-keys.d.ts +22 -0
- package/dist/api/triggers.api.d.ts +44 -0
- package/dist/api/types.d.ts +147 -0
- package/dist/api/use-flow-run-stream.d.ts +12 -0
- package/dist/assets/invect-branding.d.ts +4 -0
- package/dist/assets/provider-icons/index.d.ts +8 -0
- package/dist/babel-C9OtljFZ.js +9721 -0
- package/dist/components/PageLayout.d.ts +17 -0
- package/dist/components/chat/ChatInput.d.ts +17 -0
- package/dist/components/chat/ChatMessageList.d.ts +14 -0
- package/dist/components/chat/ChatModelSelector.d.ts +11 -0
- package/dist/components/chat/ChatPanel.d.ts +19 -0
- package/dist/components/chat/ChatPromptOverlay.d.ts +13 -0
- package/dist/components/chat/ChatProviderSelector.d.ts +9 -0
- package/dist/components/chat/ChatSettingsPanel.d.ts +11 -0
- package/dist/components/chat/InlineCredentialSetup.d.ts +9 -0
- package/dist/components/chat/MarkdownRenderer.d.ts +7 -0
- package/dist/components/chat/chat-memory.d.ts +21 -0
- package/dist/components/chat/chat.store.d.ts +416 -0
- package/dist/components/chat/index.d.ts +5 -0
- package/dist/components/chat/use-chat.d.ts +28 -0
- package/dist/components/credentials/CreateCredentialModal.d.ts +13 -0
- package/dist/components/credentials/CredentialDetailDialog.d.ts +17 -0
- package/dist/components/credentials/EditCredentialModal.d.ts +11 -0
- package/dist/components/credentials/OAuth2ConnectButton.d.ts +38 -0
- package/dist/components/credentials/OAuth2ProviderSelector.d.ts +15 -0
- package/dist/components/credentials/credential-utils.d.ts +12 -0
- package/dist/components/credentials/index.d.ts +9 -0
- package/dist/components/dashboard/FailedRunsAlert.d.ts +3 -0
- package/dist/components/dashboard/FlowCard.d.ts +7 -0
- package/dist/components/dashboard/RecentActivityTable.d.ts +9 -0
- package/dist/components/dashboard/StatCard.d.ts +10 -0
- package/dist/components/dashboard/index.d.ts +5 -0
- package/dist/components/dashboard/status-helpers.d.ts +5 -0
- package/dist/components/flow-editor/ActionsSidebar.d.ts +2 -0
- package/dist/components/flow-editor/FlowEditor.d.ts +21 -0
- package/dist/components/flow-editor/FlowHeader.d.ts +9 -0
- package/dist/components/flow-editor/FlowLayout.d.ts +24 -0
- package/dist/components/flow-editor/ModeSwitcher.d.ts +7 -0
- package/dist/components/flow-editor/NodeSidebar.d.ts +24 -0
- package/dist/components/flow-editor/RunControls.d.ts +12 -0
- package/dist/components/flow-editor/ToolConfigPanel.d.ts +16 -0
- package/dist/components/flow-editor/ValidationPanel.d.ts +5 -0
- package/dist/components/flow-editor/flow-editor.store.d.ts +1 -0
- package/dist/components/flow-editor/index.d.ts +6 -0
- package/dist/components/flow-editor/inline-edit.d.ts +10 -0
- package/dist/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.d.ts +26 -0
- package/dist/components/flow-editor/node-config-panel/CredentialCombobox.d.ts +21 -0
- package/dist/components/flow-editor/node-config-panel/CredentialsSection.d.ts +19 -0
- package/dist/components/flow-editor/node-config-panel/DroppableInput.d.ts +20 -0
- package/dist/components/flow-editor/node-config-panel/DynamicSelectField.d.ts +22 -0
- package/dist/components/flow-editor/node-config-panel/JsonPreviewPanel.d.ts +25 -0
- package/dist/components/flow-editor/node-config-panel/NodeConfigPanel.d.ts +14 -0
- package/dist/components/flow-editor/node-config-panel/NodeConfigPanelHeader.d.ts +15 -0
- package/dist/components/flow-editor/node-config-panel/ParametersSection.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/SearchableSelectField.d.ts +17 -0
- package/dist/components/flow-editor/node-config-panel/SwitchCasesField.d.ts +18 -0
- package/dist/components/flow-editor/node-config-panel/hooks/index.d.ts +2 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.d.ts +24 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-node-execution.d.ts +46 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-upstream-slots.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/panels/AgentToolsPanel.d.ts +18 -0
- package/dist/components/flow-editor/node-config-panel/panels/ConfigurationPanel.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/panels/DataMapperPane.d.ts +40 -0
- package/dist/components/flow-editor/node-config-panel/panels/InputPanel.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/panels/OutputPanel.d.ts +7 -0
- package/dist/components/flow-editor/node-config-panel/panels/index.d.ts +4 -0
- package/dist/components/flow-editor/node-config-panel/types.d.ts +19 -0
- package/dist/components/flow-editor/node-config-panel/use-node-config-panel-store.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/use-node-config-state.d.ts +26 -0
- package/dist/components/flow-editor/node-config-panel/use-run-node.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/utils.d.ts +9 -0
- package/dist/components/flow-editor/serialize-to-sdk.d.ts +20 -0
- package/dist/components/flow-editor/toolbar-context.d.ts +2 -0
- package/dist/components/flow-editor/use-copy-paste.d.ts +7 -0
- package/dist/components/flow-editor/use-copy-paste.types.d.ts +38 -0
- package/dist/components/flow-editor/use-flow-editor.d.ts +44 -0
- package/dist/components/flow-runs-table/FlowRunsTable.d.ts +6 -0
- package/dist/components/flow-runs-table/index.d.ts +1 -0
- package/dist/components/flow-viewer/FlowRunsView.d.ts +7 -0
- package/dist/components/flow-viewer/FlowStatusView.d.ts +21 -0
- package/dist/components/flow-viewer/RunSelector.d.ts +13 -0
- package/dist/components/flow-viewer/RunsSidebar.d.ts +14 -0
- package/dist/components/flow-viewer/agent-tool-executions-list.d.ts +7 -0
- package/dist/components/flow-viewer/index.d.ts +1 -0
- package/dist/components/flow-viewer/logs-panel.d.ts +18 -0
- package/dist/components/flow-viewer/use-execution-log-data.d.ts +113 -0
- package/dist/components/graph/BatchFlowEdge.d.ts +33 -0
- package/dist/components/graph/LayoutSelector.d.ts +9 -0
- package/dist/components/graph/index.d.ts +47 -0
- package/dist/components/graph/styleUtils.d.ts +124 -0
- package/dist/components/nodes/AgentConfigPanel.d.ts +24 -0
- package/dist/components/nodes/AgentNode.d.ts +8 -0
- package/dist/components/nodes/AgentToolsBox.d.ts +41 -0
- package/dist/components/nodes/NodeAppendix.d.ts +19 -0
- package/dist/components/nodes/NodeStatusIndicator.d.ts +30 -0
- package/dist/components/nodes/NodeViewContext.d.ts +18 -0
- package/dist/components/nodes/ToolParamField.d.ts +28 -0
- package/dist/components/nodes/ToolSelectorModal.d.ts +80 -0
- package/dist/components/nodes/ToolSelectorParts.d.ts +30 -0
- package/dist/components/nodes/UniversalNode.d.ts +2 -0
- package/dist/components/nodes/createContextAwareNodes.d.ts +6 -0
- package/dist/components/nodes/index.d.ts +22 -0
- package/dist/components/nodes/nodeRegistry.d.ts +13 -0
- package/dist/components/nodes/withNodeContext.d.ts +7 -0
- package/dist/components/shared/InvectLoader.d.ts +8 -0
- package/dist/components/shared/InvectLogo.d.ts +9 -0
- package/dist/components/shared/ProviderIcon.d.ts +23 -0
- package/dist/components/side-menu/side-menu.d.ts +4 -0
- package/dist/components/sidebar/BaseSidebar.d.ts +17 -0
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/triggers/CronPreview.d.ts +12 -0
- package/dist/components/triggers/index.d.ts +1 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/codemirror-js-editor.d.ts +25 -0
- package/dist/components/ui/codemirror-json-editor.d.ts +18 -0
- package/dist/components/ui/codemirror-nunjucks-editor.d.ts +13 -0
- package/dist/components/ui/codemirror-vscode-theme.d.ts +24 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/empty-state.d.ts +21 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tree-view.d.ts +107 -0
- package/dist/contexts/AgentToolCallbacksContext.d.ts +23 -0
- package/dist/contexts/ApiContext.d.ts +11 -0
- package/dist/contexts/FlowDataContext.d.ts +9 -0
- package/dist/contexts/NodeRegistryContext.d.ts +14 -0
- package/dist/contexts/PluginRegistryContext.d.ts +39 -0
- package/dist/contexts/ThemeProvider.d.ts +18 -0
- package/dist/contexts/ValidationContext.d.ts +22 -0
- package/dist/demo/DemoInvect.d.ts +11 -0
- package/dist/demo/FlowViewer.d.ts +31 -0
- package/dist/demo/demo-api-client.d.ts +33 -0
- package/dist/demo/index.d.ts +6 -0
- package/dist/demo/sample-data.d.ts +1538 -0
- package/dist/demo.d.ts +2 -0
- package/dist/demo.js +2774 -0
- package/dist/estree-ClbRfS-1.js +7076 -0
- package/dist/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/iosevka-latin-400-normal.woff2 +0 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-document-title.d.ts +1 -0
- package/dist/hooks/use-flow-data.d.ts +22 -0
- package/dist/hooks/use-invect-portal-class.d.ts +21 -0
- package/dist/hooks/useFlowEditorStore.d.ts +1 -0
- package/dist/index.css +3 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +717 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/prettier.d.ts +13 -0
- package/dist/routes/all-flow-runs.d.ts +5 -0
- package/dist/routes/credentials.d.ts +5 -0
- package/dist/routes/flow-route-layout.d.ts +19 -0
- package/dist/routes/flow-runs.d.ts +5 -0
- package/dist/routes/flow.d.ts +5 -0
- package/dist/routes/home.d.ts +5 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/standalone-C3Df7W52.js +3463 -0
- package/dist/stores/executionViewStore.d.ts +64 -0
- package/dist/stores/flow-editor.store.d.ts +137 -0
- package/dist/stores/flowEditorStore.d.ts +1 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/uiStore.d.ts +45 -0
- package/dist/types/agent-tools.types.d.ts +53 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/node-definition.types.d.ts +85 -0
- package/dist/types/plugin.types.d.ts +100 -0
- package/dist/utils/credentialBranding.d.ts +8 -0
- package/dist/utils/credentialFiltering.d.ts +20 -0
- package/dist/utils/flowTransformations.d.ts +16 -0
- package/dist/utils/layoutUtils.d.ts +23 -0
- package/dist/utils/nodeReferenceUtils.d.ts +37 -0
- package/dist/vendor.d.ts +5 -0
- package/package.json +130 -0
- package/src/.DS_Store +0 -0
- package/src/Invect.tsx +229 -0
- package/src/InvectShell.tsx +55 -0
- package/src/api/agent-tools.api.ts +23 -0
- package/src/api/client.ts +899 -0
- package/src/api/credentials.api.ts +197 -0
- package/src/api/executions.api.ts +228 -0
- package/src/api/flows.api.ts +195 -0
- package/src/api/index.ts +17 -0
- package/src/api/node-data.api.ts +167 -0
- package/src/api/query-keys.ts +44 -0
- package/src/api/triggers.api.ts +120 -0
- package/src/api/types.ts +212 -0
- package/src/api/use-flow-run-stream.ts +206 -0
- package/src/app.css +560 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/favicon.ico +0 -0
- package/src/assets/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/src/assets/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/src/assets/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/src/assets/fonts/iosevka-latin-400-normal.woff2 +0 -0
- package/src/assets/invect-branding.ts +51 -0
- package/src/assets/provider-icons/anthropic.svg +1 -0
- package/src/assets/provider-icons/anthropic_light.svg +1 -0
- package/src/assets/provider-icons/github.svg +1 -0
- package/src/assets/provider-icons/github_light.svg +1 -0
- package/src/assets/provider-icons/gmail.svg +1 -0
- package/src/assets/provider-icons/google_calendar.svg +1 -0
- package/src/assets/provider-icons/google_docs.svg +1 -0
- package/src/assets/provider-icons/google_drive.svg +1 -0
- package/src/assets/provider-icons/google_sheets.svg +1 -0
- package/src/assets/provider-icons/index.ts +55 -0
- package/src/assets/provider-icons/linear.svg +1 -0
- package/src/assets/provider-icons/openai.svg +1 -0
- package/src/assets/provider-icons/postgres.svg +1 -0
- package/src/assets/provider-icons/slack.svg +1 -0
- package/src/assets/small-loader-dark.svg +22 -0
- package/src/assets/small-loader-light.svg +22 -0
- package/src/assets/small.svg +7 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/PageLayout.tsx +55 -0
- package/src/components/chat/ChatInput.tsx +115 -0
- package/src/components/chat/ChatMessageList.tsx +788 -0
- package/src/components/chat/ChatModelSelector.tsx +208 -0
- package/src/components/chat/ChatPanel.tsx +243 -0
- package/src/components/chat/ChatPromptOverlay.tsx +150 -0
- package/src/components/chat/ChatProviderSelector.tsx +135 -0
- package/src/components/chat/ChatSettingsPanel.tsx +277 -0
- package/src/components/chat/InlineCredentialSetup.tsx +343 -0
- package/src/components/chat/MarkdownRenderer.tsx +140 -0
- package/src/components/chat/chat-memory.ts +88 -0
- package/src/components/chat/chat.store.ts +479 -0
- package/src/components/chat/index.ts +5 -0
- package/src/components/chat/use-chat.ts +473 -0
- package/src/components/credentials/CreateCredentialModal.tsx +609 -0
- package/src/components/credentials/CredentialDetailDialog.tsx +882 -0
- package/src/components/credentials/EditCredentialModal.tsx +399 -0
- package/src/components/credentials/OAuth2ConnectButton.tsx +288 -0
- package/src/components/credentials/OAuth2ProviderSelector.tsx +360 -0
- package/src/components/credentials/credential-utils.ts +99 -0
- package/src/components/credentials/index.ts +10 -0
- package/src/components/dashboard/FailedRunsAlert.tsx +67 -0
- package/src/components/dashboard/FlowCard.tsx +64 -0
- package/src/components/dashboard/RecentActivityTable.tsx +92 -0
- package/src/components/dashboard/StatCard.tsx +32 -0
- package/src/components/dashboard/index.ts +5 -0
- package/src/components/dashboard/status-helpers.tsx +102 -0
- package/src/components/flow-editor/ActionsSidebar.tsx +503 -0
- package/src/components/flow-editor/FlowEditor.tsx +1002 -0
- package/src/components/flow-editor/FlowHeader.tsx +87 -0
- package/src/components/flow-editor/FlowLayout.tsx +117 -0
- package/src/components/flow-editor/ModeSwitcher.tsx +49 -0
- package/src/components/flow-editor/NodeSidebar.tsx +343 -0
- package/src/components/flow-editor/RunControls.tsx +109 -0
- package/src/components/flow-editor/ToolConfigPanel.tsx +434 -0
- package/src/components/flow-editor/ValidationPanel.tsx +167 -0
- package/src/components/flow-editor/flow-editor.store.ts +2 -0
- package/src/components/flow-editor/index.ts +6 -0
- package/src/components/flow-editor/inline-edit.tsx +111 -0
- package/src/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.tsx +334 -0
- package/src/components/flow-editor/node-config-panel/CredentialCombobox.tsx +217 -0
- package/src/components/flow-editor/node-config-panel/CredentialsSection.tsx +154 -0
- package/src/components/flow-editor/node-config-panel/DroppableInput.tsx +45 -0
- package/src/components/flow-editor/node-config-panel/DynamicSelectField.tsx +223 -0
- package/src/components/flow-editor/node-config-panel/JsonPreviewPanel.tsx +134 -0
- package/src/components/flow-editor/node-config-panel/NodeConfigPanel.tsx +650 -0
- package/src/components/flow-editor/node-config-panel/NodeConfigPanelHeader.tsx +91 -0
- package/src/components/flow-editor/node-config-panel/ParametersSection.tsx +144 -0
- package/src/components/flow-editor/node-config-panel/SearchableSelectField.tsx +126 -0
- package/src/components/flow-editor/node-config-panel/SwitchCasesField.tsx +212 -0
- package/src/components/flow-editor/node-config-panel/hooks/index.ts +2 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.ts +284 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-node-execution.ts +287 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-upstream-slots.ts +310 -0
- package/src/components/flow-editor/node-config-panel/panels/AgentToolsPanel.tsx +837 -0
- package/src/components/flow-editor/node-config-panel/panels/ConfigurationPanel.tsx +383 -0
- package/src/components/flow-editor/node-config-panel/panels/DataMapperPane.tsx +456 -0
- package/src/components/flow-editor/node-config-panel/panels/InputPanel.tsx +338 -0
- package/src/components/flow-editor/node-config-panel/panels/OutputPanel.tsx +109 -0
- package/src/components/flow-editor/node-config-panel/panels/index.ts +4 -0
- package/src/components/flow-editor/node-config-panel/types.ts +20 -0
- package/src/components/flow-editor/node-config-panel/use-node-config-panel-store.ts +283 -0
- package/src/components/flow-editor/node-config-panel/use-node-config-state.ts +172 -0
- package/src/components/flow-editor/node-config-panel/use-run-node.ts +147 -0
- package/src/components/flow-editor/node-config-panel/utils.ts +73 -0
- package/src/components/flow-editor/serialize-to-sdk.ts +204 -0
- package/src/components/flow-editor/toolbar-context.ts +9 -0
- package/src/components/flow-editor/use-copy-paste.ts +575 -0
- package/src/components/flow-editor/use-copy-paste.types.ts +35 -0
- package/src/components/flow-editor/use-flow-editor.ts +241 -0
- package/src/components/flow-runs-table/FlowRunsTable.tsx +631 -0
- package/src/components/flow-runs-table/index.ts +1 -0
- package/src/components/flow-viewer/FlowRunsView.tsx +268 -0
- package/src/components/flow-viewer/FlowStatusView.tsx +351 -0
- package/src/components/flow-viewer/RunSelector.tsx +422 -0
- package/src/components/flow-viewer/RunsSidebar.tsx +125 -0
- package/src/components/flow-viewer/agent-tool-executions-list.tsx +298 -0
- package/src/components/flow-viewer/index.ts +1 -0
- package/src/components/flow-viewer/logs-panel.tsx +567 -0
- package/src/components/flow-viewer/use-execution-log-data.ts +374 -0
- package/src/components/graph/BatchFlowEdge.tsx +229 -0
- package/src/components/graph/LayoutSelector.tsx +42 -0
- package/src/components/graph/index.ts +61 -0
- package/src/components/graph/styleUtils.ts +375 -0
- package/src/components/nodes/.DS_Store +0 -0
- package/src/components/nodes/AgentConfigPanel.tsx +1033 -0
- package/src/components/nodes/AgentNode.tsx +298 -0
- package/src/components/nodes/AgentToolsBox.tsx +193 -0
- package/src/components/nodes/NodeAppendix.tsx +98 -0
- package/src/components/nodes/NodeStatusIndicator.tsx +74 -0
- package/src/components/nodes/NodeViewContext.tsx +45 -0
- package/src/components/nodes/ToolParamField.tsx +282 -0
- package/src/components/nodes/ToolSelectorModal.tsx +648 -0
- package/src/components/nodes/ToolSelectorParts.tsx +505 -0
- package/src/components/nodes/UniversalNode.tsx +356 -0
- package/src/components/nodes/createContextAwareNodes.ts +19 -0
- package/src/components/nodes/index.ts +45 -0
- package/src/components/nodes/nodeRegistry.ts +50 -0
- package/src/components/nodes/withNodeContext.tsx +55 -0
- package/src/components/shared/InvectLoader.tsx +59 -0
- package/src/components/shared/InvectLogo.tsx +59 -0
- package/src/components/shared/ProviderIcon.tsx +115 -0
- package/src/components/side-menu/side-menu.tsx +267 -0
- package/src/components/sidebar/BaseSidebar.tsx +148 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/triggers/CronPreview.tsx +243 -0
- package/src/components/triggers/index.ts +1 -0
- package/src/components/ui/alert-dialog.tsx +152 -0
- package/src/components/ui/badge.tsx +39 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +75 -0
- package/src/components/ui/codemirror-js-editor.tsx +432 -0
- package/src/components/ui/codemirror-json-editor.tsx +816 -0
- package/src/components/ui/codemirror-nunjucks-editor.tsx +451 -0
- package/src/components/ui/codemirror-vscode-theme.ts +243 -0
- package/src/components/ui/collapsible.tsx +12 -0
- package/src/components/ui/command.tsx +162 -0
- package/src/components/ui/dialog.tsx +140 -0
- package/src/components/ui/dropdown-menu.tsx +232 -0
- package/src/components/ui/empty-state.tsx +93 -0
- package/src/components/ui/input.tsx +26 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/popover.tsx +53 -0
- package/src/components/ui/resizable.tsx +61 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/select.tsx +179 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/slider.tsx +58 -0
- package/src/components/ui/switch.tsx +22 -0
- package/src/components/ui/table.tsx +90 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/components/ui/tree-view.tsx +574 -0
- package/src/contexts/AgentToolCallbacksContext.tsx +31 -0
- package/src/contexts/ApiContext.tsx +51 -0
- package/src/contexts/FlowDataContext.tsx +21 -0
- package/src/contexts/NodeRegistryContext.tsx +54 -0
- package/src/contexts/PluginRegistryContext.tsx +182 -0
- package/src/contexts/ThemeProvider.tsx +106 -0
- package/src/contexts/ValidationContext.tsx +122 -0
- package/src/demo/DemoInvect.tsx +42 -0
- package/src/demo/FlowViewer.tsx +294 -0
- package/src/demo/demo-api-client.ts +246 -0
- package/src/demo/index.ts +28 -0
- package/src/demo/sample-data.ts +1980 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-document-title.ts +8 -0
- package/src/hooks/use-flow-data.ts +144 -0
- package/src/hooks/use-invect-portal-class.ts +27 -0
- package/src/hooks/useFlowEditorStore.ts +2 -0
- package/src/index.ts +70 -0
- package/src/lib/utils.ts +6 -0
- package/src/prettier.d.ts +13 -0
- package/src/routes/all-flow-runs.tsx +27 -0
- package/src/routes/credentials.tsx +362 -0
- package/src/routes/flow-route-layout.tsx +113 -0
- package/src/routes/flow-runs.tsx +22 -0
- package/src/routes/flow.tsx +22 -0
- package/src/routes/home.tsx +282 -0
- package/src/services/index.ts +6 -0
- package/src/stores/executionViewStore.ts +211 -0
- package/src/stores/flow-editor.store.ts +738 -0
- package/src/stores/flowEditorStore.ts +2 -0
- package/src/stores/index.ts +10 -0
- package/src/stores/uiStore.ts +189 -0
- package/src/types/agent-tools.types.ts +64 -0
- package/src/types/index.ts +5 -0
- package/src/types/node-definition.types.ts +104 -0
- package/src/types/plugin.types.ts +123 -0
- package/src/utils/credentialBranding.ts +116 -0
- package/src/utils/credentialFiltering.ts +68 -0
- package/src/utils/flowTransformations.ts +137 -0
- package/src/utils/layoutUtils.ts +127 -0
- package/src/utils/nodeReferenceUtils.ts +135 -0
- package/src/vendor.d.ts +7 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
EditorView,
|
|
4
|
+
keymap,
|
|
5
|
+
highlightActiveLine,
|
|
6
|
+
highlightSpecialChars,
|
|
7
|
+
placeholder as cmPlaceholder,
|
|
8
|
+
} from '@codemirror/view';
|
|
9
|
+
import { EditorState, type Extension } from '@codemirror/state';
|
|
10
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
11
|
+
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
12
|
+
import { bracketMatching, foldGutter, foldKeymap, indentOnInput } from '@codemirror/language';
|
|
13
|
+
import {
|
|
14
|
+
closeBrackets,
|
|
15
|
+
closeBracketsKeymap,
|
|
16
|
+
autocompletion,
|
|
17
|
+
completionKeymap,
|
|
18
|
+
} from '@codemirror/autocomplete';
|
|
19
|
+
import { ScrollArea } from '../../../ui/scroll-area';
|
|
20
|
+
import { Label } from '../../../ui/label';
|
|
21
|
+
import { Badge } from '../../../ui/badge';
|
|
22
|
+
import { Button } from '../../../ui/button';
|
|
23
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../../ui/tooltip';
|
|
24
|
+
import { Play, Loader2, HelpCircle, AlertCircle, CheckCircle2 } from 'lucide-react';
|
|
25
|
+
import {
|
|
26
|
+
useCodeMirrorVscodeTheme,
|
|
27
|
+
CODEMIRROR_IOSEVKA_FONT_STACK,
|
|
28
|
+
} from '../../../ui/codemirror-vscode-theme';
|
|
29
|
+
|
|
30
|
+
/* ------------------------------------------------------------------ */
|
|
31
|
+
/* Types */
|
|
32
|
+
/* ------------------------------------------------------------------ */
|
|
33
|
+
|
|
34
|
+
interface MapperConfig {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
expression: string;
|
|
37
|
+
mode: 'auto' | 'iterate' | 'reshape';
|
|
38
|
+
outputMode: 'array' | 'object' | 'first' | 'last' | 'concat';
|
|
39
|
+
keyField?: string;
|
|
40
|
+
// TODO: Move concurrency into the shared node settings panel.
|
|
41
|
+
concurrency: number;
|
|
42
|
+
onEmpty: 'skip' | 'error';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface MapperPreviewResult {
|
|
46
|
+
success: boolean;
|
|
47
|
+
result?: unknown;
|
|
48
|
+
resultType?: 'array' | 'object' | 'primitive';
|
|
49
|
+
itemCount?: number;
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface DataMapperPaneProps {
|
|
54
|
+
/** Current mapper config from form state */
|
|
55
|
+
value: MapperConfig | undefined;
|
|
56
|
+
/** Called when any mapper field changes */
|
|
57
|
+
onChange: (config: MapperConfig | undefined) => void;
|
|
58
|
+
/** Available upstream variable names (for hints) */
|
|
59
|
+
availableVariables?: string[];
|
|
60
|
+
/** Callback to test the mapper expression against live data */
|
|
61
|
+
onTestMapper?: (request: {
|
|
62
|
+
expression: string;
|
|
63
|
+
incomingData: Record<string, unknown>;
|
|
64
|
+
mode?: 'auto' | 'iterate' | 'reshape';
|
|
65
|
+
}) => void;
|
|
66
|
+
/** Result from the last test */
|
|
67
|
+
previewResult?: MapperPreviewResult | null;
|
|
68
|
+
/** Whether test is in progress */
|
|
69
|
+
isTestingMapper?: boolean;
|
|
70
|
+
/** Current input data JSON for passing to the test API */
|
|
71
|
+
inputData?: Record<string, unknown>;
|
|
72
|
+
/** Portal container for dropdowns */
|
|
73
|
+
portalContainer?: HTMLElement | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ------------------------------------------------------------------ */
|
|
77
|
+
/* Constants */
|
|
78
|
+
/* ------------------------------------------------------------------ */
|
|
79
|
+
|
|
80
|
+
const _DEFAULT_MAPPER_CONFIG: MapperConfig = {
|
|
81
|
+
enabled: true,
|
|
82
|
+
expression: '',
|
|
83
|
+
mode: 'auto',
|
|
84
|
+
outputMode: 'array',
|
|
85
|
+
concurrency: 1,
|
|
86
|
+
onEmpty: 'skip',
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const MODE_OPTIONS = [
|
|
90
|
+
{
|
|
91
|
+
value: 'auto',
|
|
92
|
+
label: 'Auto',
|
|
93
|
+
description: 'Infer from result: array → iterate, object → single',
|
|
94
|
+
},
|
|
95
|
+
{ value: 'iterate', label: 'Iterate', description: 'Assert result is an array, fail otherwise' },
|
|
96
|
+
{ value: 'reshape', label: 'Reshape', description: 'Single execution, never iterate' },
|
|
97
|
+
] as const;
|
|
98
|
+
|
|
99
|
+
/* ------------------------------------------------------------------ */
|
|
100
|
+
/* Subcomponents */
|
|
101
|
+
/* ------------------------------------------------------------------ */
|
|
102
|
+
|
|
103
|
+
function FieldTooltip({ content }: { content: string }) {
|
|
104
|
+
return (
|
|
105
|
+
<TooltipProvider delayDuration={200}>
|
|
106
|
+
<Tooltip>
|
|
107
|
+
<TooltipTrigger asChild>
|
|
108
|
+
<HelpCircle className="w-3 h-3 text-muted-foreground cursor-help" />
|
|
109
|
+
</TooltipTrigger>
|
|
110
|
+
<TooltipContent side="right" className="max-w-[250px] text-xs">
|
|
111
|
+
{content}
|
|
112
|
+
</TooltipContent>
|
|
113
|
+
</Tooltip>
|
|
114
|
+
</TooltipProvider>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ------------------------------------------------------------------ */
|
|
119
|
+
/* JS Expression Editor (CodeMirror) */
|
|
120
|
+
/* ------------------------------------------------------------------ */
|
|
121
|
+
|
|
122
|
+
function JsExpressionEditor({
|
|
123
|
+
value,
|
|
124
|
+
onChange,
|
|
125
|
+
placeholderText,
|
|
126
|
+
}: {
|
|
127
|
+
value: string;
|
|
128
|
+
onChange: (value: string) => void;
|
|
129
|
+
placeholderText?: string;
|
|
130
|
+
}) {
|
|
131
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
132
|
+
const viewRef = useRef<EditorView | null>(null);
|
|
133
|
+
const onChangeRef = useRef(onChange);
|
|
134
|
+
onChangeRef.current = onChange;
|
|
135
|
+
const cmTheme = useCodeMirrorVscodeTheme();
|
|
136
|
+
|
|
137
|
+
// Stable extensions (created once)
|
|
138
|
+
const baseExtensions = useMemo<Extension[]>(
|
|
139
|
+
() => [
|
|
140
|
+
javascript(),
|
|
141
|
+
highlightActiveLine(),
|
|
142
|
+
highlightSpecialChars(),
|
|
143
|
+
bracketMatching(),
|
|
144
|
+
closeBrackets(),
|
|
145
|
+
autocompletion(),
|
|
146
|
+
indentOnInput(),
|
|
147
|
+
foldGutter(),
|
|
148
|
+
history(),
|
|
149
|
+
keymap.of([
|
|
150
|
+
...defaultKeymap,
|
|
151
|
+
...historyKeymap,
|
|
152
|
+
...foldKeymap,
|
|
153
|
+
...closeBracketsKeymap,
|
|
154
|
+
...completionKeymap,
|
|
155
|
+
]),
|
|
156
|
+
EditorView.lineWrapping,
|
|
157
|
+
EditorView.updateListener.of((update) => {
|
|
158
|
+
if (update.docChanged) {
|
|
159
|
+
onChangeRef.current(update.state.doc.toString());
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
...(placeholderText ? [cmPlaceholder(placeholderText)] : []),
|
|
163
|
+
EditorView.theme({
|
|
164
|
+
'&': {
|
|
165
|
+
fontFamily: CODEMIRROR_IOSEVKA_FONT_STACK,
|
|
166
|
+
fontSize: '12px',
|
|
167
|
+
},
|
|
168
|
+
'.cm-content': {
|
|
169
|
+
padding: '8px 0',
|
|
170
|
+
minHeight: '80px',
|
|
171
|
+
},
|
|
172
|
+
'.cm-line': {
|
|
173
|
+
padding: '0 8px',
|
|
174
|
+
},
|
|
175
|
+
'.cm-gutters': {
|
|
176
|
+
minWidth: '28px',
|
|
177
|
+
},
|
|
178
|
+
'.cm-scroller': {
|
|
179
|
+
overflow: 'auto',
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
],
|
|
183
|
+
[placeholderText],
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// Recreate editor when theme changes (same pattern as CodeMirrorJsonEditor)
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
if (!containerRef.current) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const state = EditorState.create({
|
|
193
|
+
doc: value,
|
|
194
|
+
extensions: [...baseExtensions, cmTheme],
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const view = new EditorView({
|
|
198
|
+
state,
|
|
199
|
+
parent: containerRef.current,
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
viewRef.current = view;
|
|
203
|
+
|
|
204
|
+
return () => {
|
|
205
|
+
view.destroy();
|
|
206
|
+
viewRef.current = null;
|
|
207
|
+
};
|
|
208
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
209
|
+
}, [cmTheme, baseExtensions]);
|
|
210
|
+
|
|
211
|
+
// Sync external value changes (e.g., reset)
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
const view = viewRef.current;
|
|
214
|
+
if (!view) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const currentDoc = view.state.doc.toString();
|
|
218
|
+
if (currentDoc !== value) {
|
|
219
|
+
view.dispatch({
|
|
220
|
+
changes: { from: 0, to: currentDoc.length, insert: value },
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}, [value]);
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<div
|
|
227
|
+
ref={containerRef}
|
|
228
|
+
className="border rounded-md overflow-hidden bg-background min-h-[80px] max-h-[200px]"
|
|
229
|
+
/>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* ------------------------------------------------------------------ */
|
|
234
|
+
/* Preview Panel */
|
|
235
|
+
/* ------------------------------------------------------------------ */
|
|
236
|
+
|
|
237
|
+
function MapperPreview({
|
|
238
|
+
result,
|
|
239
|
+
isLoading,
|
|
240
|
+
mode,
|
|
241
|
+
}: {
|
|
242
|
+
result: MapperPreviewResult | null | undefined;
|
|
243
|
+
isLoading: boolean;
|
|
244
|
+
mode: 'auto' | 'iterate' | 'reshape';
|
|
245
|
+
}) {
|
|
246
|
+
if (isLoading) {
|
|
247
|
+
return (
|
|
248
|
+
<div className="flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground">
|
|
249
|
+
<Loader2 className="w-3 h-3 animate-spin" />
|
|
250
|
+
Evaluating…
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (!result) {
|
|
256
|
+
return (
|
|
257
|
+
<div className="px-3 py-2 text-xs italic text-muted-foreground">
|
|
258
|
+
Write an expression and press Preview to see results.
|
|
259
|
+
</div>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (!result.success) {
|
|
264
|
+
return (
|
|
265
|
+
<div className="flex items-start gap-2 px-3 py-2">
|
|
266
|
+
<AlertCircle className="w-3.5 h-3.5 text-destructive mt-0.5 shrink-0" />
|
|
267
|
+
<span className="font-mono text-xs break-all text-destructive">{result.error}</span>
|
|
268
|
+
</div>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const isArray = result.resultType === 'array';
|
|
273
|
+
const willIterate = mode === 'iterate' || (mode === 'auto' && isArray);
|
|
274
|
+
const itemCount = result.itemCount ?? 0;
|
|
275
|
+
|
|
276
|
+
return (
|
|
277
|
+
<div className="space-y-2">
|
|
278
|
+
{/* Behavior summary */}
|
|
279
|
+
<div className="flex items-center gap-2 px-3 py-1.5">
|
|
280
|
+
<CheckCircle2 className="w-3.5 h-3.5 text-green-600 shrink-0" />
|
|
281
|
+
<span className="text-xs">
|
|
282
|
+
Returns:{' '}
|
|
283
|
+
<Badge variant="secondary" className="text-[10px] px-1 py-0">
|
|
284
|
+
{result.resultType}
|
|
285
|
+
</Badge>
|
|
286
|
+
{willIterate ? (
|
|
287
|
+
<>
|
|
288
|
+
{' '}
|
|
289
|
+
— Node will execute <strong>{itemCount}</strong> time{itemCount !== 1 ? 's' : ''}
|
|
290
|
+
</>
|
|
291
|
+
) : (
|
|
292
|
+
<>
|
|
293
|
+
{' '}
|
|
294
|
+
— Node will execute <strong>once</strong> with mapped data
|
|
295
|
+
</>
|
|
296
|
+
)}
|
|
297
|
+
</span>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{/* Abbreviated result preview */}
|
|
301
|
+
<div className="px-3 pb-2">
|
|
302
|
+
<pre className="text-[11px] font-mono text-muted-foreground bg-muted/50 rounded p-2 overflow-auto max-h-[120px] whitespace-pre-wrap break-all">
|
|
303
|
+
{formatPreviewResult(result.result)}
|
|
304
|
+
</pre>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function formatPreviewResult(value: unknown): string {
|
|
311
|
+
if (value === undefined || value === null) {
|
|
312
|
+
return String(value);
|
|
313
|
+
}
|
|
314
|
+
try {
|
|
315
|
+
const json = JSON.stringify(value, null, 2);
|
|
316
|
+
// Truncate long outputs (show first ~60 lines)
|
|
317
|
+
const lines = json.split('\n');
|
|
318
|
+
if (lines.length > 60) {
|
|
319
|
+
return lines.slice(0, 60).join('\n') + '\n… (' + lines.length + ' lines total)';
|
|
320
|
+
}
|
|
321
|
+
return json;
|
|
322
|
+
} catch {
|
|
323
|
+
return String(value);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* ------------------------------------------------------------------ */
|
|
328
|
+
/* Main Component */
|
|
329
|
+
/* ------------------------------------------------------------------ */
|
|
330
|
+
|
|
331
|
+
export function DataMapperPane({
|
|
332
|
+
value,
|
|
333
|
+
onChange,
|
|
334
|
+
availableVariables = [],
|
|
335
|
+
onTestMapper,
|
|
336
|
+
previewResult,
|
|
337
|
+
isTestingMapper = false,
|
|
338
|
+
inputData,
|
|
339
|
+
portalContainer: _portalContainer,
|
|
340
|
+
}: DataMapperPaneProps) {
|
|
341
|
+
const enabled = value?.enabled ?? false;
|
|
342
|
+
|
|
343
|
+
const updateField = useCallback(
|
|
344
|
+
<K extends keyof MapperConfig>(key: K, newValue: MapperConfig[K]) => {
|
|
345
|
+
if (!value) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
onChange({ ...value, [key]: newValue });
|
|
349
|
+
},
|
|
350
|
+
[value, onChange],
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
const handleTestPreview = useCallback(() => {
|
|
354
|
+
if (!value?.expression || !onTestMapper) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
onTestMapper({
|
|
358
|
+
expression: value.expression,
|
|
359
|
+
incomingData: inputData ?? {},
|
|
360
|
+
mode: value.mode,
|
|
361
|
+
});
|
|
362
|
+
}, [value, onTestMapper, inputData]);
|
|
363
|
+
|
|
364
|
+
// Variable hints
|
|
365
|
+
const variablesHint = useMemo(() => {
|
|
366
|
+
if (availableVariables.length === 0) {
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
return availableVariables.slice(0, 5).join(', ');
|
|
370
|
+
}, [availableVariables]);
|
|
371
|
+
|
|
372
|
+
return (
|
|
373
|
+
<div className="flex flex-col h-full overflow-hidden bg-background">
|
|
374
|
+
{/* Content */}
|
|
375
|
+
<ScrollArea className="flex-1 h-full min-h-0">
|
|
376
|
+
<div className="p-3 space-y-3 text-xs">
|
|
377
|
+
{!enabled ? (
|
|
378
|
+
<p className="text-muted-foreground">
|
|
379
|
+
Enable the data mapper to transform or iterate over upstream data before this node
|
|
380
|
+
executes.
|
|
381
|
+
</p>
|
|
382
|
+
) : (
|
|
383
|
+
<>
|
|
384
|
+
{/* JS Expression Editor */}
|
|
385
|
+
<div className="space-y-1.5">
|
|
386
|
+
<div className="flex items-center gap-1.5">
|
|
387
|
+
<Label className="text-xs font-medium">Expression</Label>
|
|
388
|
+
<FieldTooltip content="JavaScript expression evaluated in a sandbox. Upstream node outputs are available as local variables. Return an array to iterate, or an object for a single run." />
|
|
389
|
+
</div>
|
|
390
|
+
<JsExpressionEditor
|
|
391
|
+
value={value?.expression ?? ''}
|
|
392
|
+
onChange={(v) => updateField('expression', v)}
|
|
393
|
+
placeholderText="users.filter(u => u.active)"
|
|
394
|
+
/>
|
|
395
|
+
{variablesHint && (
|
|
396
|
+
<p className="text-[10px] text-muted-foreground">
|
|
397
|
+
Available: <span className="font-mono">{variablesHint}</span>
|
|
398
|
+
</p>
|
|
399
|
+
)}
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
{/* Mode */}
|
|
403
|
+
<div className="space-y-1.5">
|
|
404
|
+
<div className="flex items-center gap-1.5">
|
|
405
|
+
<Label className="text-xs font-medium">Mode</Label>
|
|
406
|
+
<FieldTooltip content="Auto: infer iterate/single from result type. Iterate: assert array result. Reshape: always single execution." />
|
|
407
|
+
</div>
|
|
408
|
+
<div className="flex gap-1">
|
|
409
|
+
{MODE_OPTIONS.map((opt) => (
|
|
410
|
+
<Button
|
|
411
|
+
key={opt.value}
|
|
412
|
+
variant={value?.mode === opt.value ? 'default' : 'outline'}
|
|
413
|
+
size="sm"
|
|
414
|
+
className="h-6 px-2 text-[10px] flex-1"
|
|
415
|
+
onClick={() => updateField('mode', opt.value)}
|
|
416
|
+
>
|
|
417
|
+
{opt.label}
|
|
418
|
+
</Button>
|
|
419
|
+
))}
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
{/* Preview */}
|
|
424
|
+
<div className="space-y-1.5">
|
|
425
|
+
<div className="flex items-center justify-between">
|
|
426
|
+
<Label className="text-xs font-medium">Preview</Label>
|
|
427
|
+
<Button
|
|
428
|
+
variant="ghost"
|
|
429
|
+
size="sm"
|
|
430
|
+
className="h-5 px-2 gap-1 text-[10px]"
|
|
431
|
+
onClick={handleTestPreview}
|
|
432
|
+
disabled={!value?.expression || isTestingMapper}
|
|
433
|
+
>
|
|
434
|
+
{isTestingMapper ? (
|
|
435
|
+
<Loader2 className="w-3 h-3 animate-spin" />
|
|
436
|
+
) : (
|
|
437
|
+
<Play className="w-3 h-3" />
|
|
438
|
+
)}
|
|
439
|
+
Preview
|
|
440
|
+
</Button>
|
|
441
|
+
</div>
|
|
442
|
+
<div className="border rounded-md bg-muted/30 min-h-[60px]">
|
|
443
|
+
<MapperPreview
|
|
444
|
+
result={previewResult}
|
|
445
|
+
isLoading={isTestingMapper}
|
|
446
|
+
mode={value?.mode ?? 'auto'}
|
|
447
|
+
/>
|
|
448
|
+
</div>
|
|
449
|
+
</div>
|
|
450
|
+
</>
|
|
451
|
+
)}
|
|
452
|
+
</div>
|
|
453
|
+
</ScrollArea>
|
|
454
|
+
</div>
|
|
455
|
+
);
|
|
456
|
+
}
|