@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,432 @@
|
|
|
1
|
+
import { useEffect, useRef, useMemo, useState } 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, Compartment } from '@codemirror/state';
|
|
10
|
+
import {
|
|
11
|
+
javascript,
|
|
12
|
+
localCompletionSource,
|
|
13
|
+
scopeCompletionSource,
|
|
14
|
+
} from '@codemirror/lang-javascript';
|
|
15
|
+
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
16
|
+
import { bracketMatching, foldGutter, foldKeymap, indentOnInput } from '@codemirror/language';
|
|
17
|
+
import {
|
|
18
|
+
closeBrackets,
|
|
19
|
+
closeBracketsKeymap,
|
|
20
|
+
autocompletion,
|
|
21
|
+
completionKeymap,
|
|
22
|
+
type CompletionContext,
|
|
23
|
+
type CompletionResult,
|
|
24
|
+
type Completion,
|
|
25
|
+
} from '@codemirror/autocomplete';
|
|
26
|
+
import { WrapText, WandSparkles } from 'lucide-react';
|
|
27
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';
|
|
28
|
+
import { cn } from '../../lib/utils';
|
|
29
|
+
import {
|
|
30
|
+
CODEMIRROR_IOSEVKA_FONT_STACK,
|
|
31
|
+
useCodeMirrorVscodePalette,
|
|
32
|
+
useCodeMirrorVscodeTheme,
|
|
33
|
+
} from './codemirror-vscode-theme';
|
|
34
|
+
|
|
35
|
+
interface CodeMirrorJsEditorProps {
|
|
36
|
+
value: string;
|
|
37
|
+
onChange?: (value: string) => void;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Initial height in px (default: 320). */
|
|
41
|
+
defaultHeight?: number;
|
|
42
|
+
/** Minimum resize height in px (default: 120). */
|
|
43
|
+
minHeight?: number;
|
|
44
|
+
/** Maximum resize height in px (default: 600). */
|
|
45
|
+
maxHeight?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Input data available as variables in scope.
|
|
48
|
+
* Top-level keys are variable names; nested object keys drive property completions.
|
|
49
|
+
*/
|
|
50
|
+
inputData?: Record<string, unknown>;
|
|
51
|
+
/** Hide the left gutter (line numbers / fold indicators). Default: false. */
|
|
52
|
+
hideGutter?: boolean;
|
|
53
|
+
/** Hide the top toolbar (word wrap, format buttons). Default: false. */
|
|
54
|
+
hideToolbar?: boolean;
|
|
55
|
+
/** Hide the bottom resize drag handle. Default: false. */
|
|
56
|
+
hideResize?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Build property-path completions from a nested object.
|
|
61
|
+
* Supports one level of nesting: `varName.propPrefix`.
|
|
62
|
+
*/
|
|
63
|
+
function getCompletions(
|
|
64
|
+
inputData: Record<string, unknown>,
|
|
65
|
+
context: CompletionContext,
|
|
66
|
+
): CompletionResult | null {
|
|
67
|
+
// --- Property access: `varName.propPrefix` ---
|
|
68
|
+
const propAccess = context.matchBefore(/[\w$][\w$]*\.[\w$]*/);
|
|
69
|
+
if (propAccess) {
|
|
70
|
+
const dotIdx = propAccess.text.indexOf('.');
|
|
71
|
+
const objName = propAccess.text.slice(0, dotIdx);
|
|
72
|
+
const prefix = propAccess.text.slice(dotIdx + 1);
|
|
73
|
+
const from = propAccess.from + dotIdx + 1;
|
|
74
|
+
|
|
75
|
+
const obj = inputData[objName];
|
|
76
|
+
if (obj && typeof obj === 'object' && !Array.isArray(obj)) {
|
|
77
|
+
const options: Completion[] = Object.keys(obj as Record<string, unknown>)
|
|
78
|
+
.filter((k) => !prefix || k.startsWith(prefix))
|
|
79
|
+
.map((k) => ({ label: k, type: 'property' }));
|
|
80
|
+
if (options.length > 0) {
|
|
81
|
+
return { from, options };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// --- Top-level variable name ---
|
|
88
|
+
const word = context.matchBefore(/[\w$]+/);
|
|
89
|
+
if (!word && !context.explicit) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const from = word?.from ?? context.pos;
|
|
94
|
+
const prefix = word?.text ?? '';
|
|
95
|
+
|
|
96
|
+
const allVars: Completion[] = [
|
|
97
|
+
...Object.keys(inputData).map((k) => ({
|
|
98
|
+
label: k,
|
|
99
|
+
type: 'variable',
|
|
100
|
+
detail: 'input variable',
|
|
101
|
+
})),
|
|
102
|
+
{ label: '$input', type: 'variable', detail: 'full input context' },
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
const filtered = prefix ? allVars.filter((v) => v.label.startsWith(prefix)) : allVars;
|
|
106
|
+
if (filtered.length === 0) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return { from, options: filtered };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function CodeMirrorJsEditor({
|
|
114
|
+
value,
|
|
115
|
+
onChange,
|
|
116
|
+
placeholder,
|
|
117
|
+
className,
|
|
118
|
+
defaultHeight = 320,
|
|
119
|
+
minHeight = 120,
|
|
120
|
+
maxHeight = 600,
|
|
121
|
+
inputData,
|
|
122
|
+
hideGutter = false,
|
|
123
|
+
hideToolbar = false,
|
|
124
|
+
hideResize = false,
|
|
125
|
+
}: CodeMirrorJsEditorProps) {
|
|
126
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
127
|
+
const viewRef = useRef<EditorView | null>(null);
|
|
128
|
+
const onChangeRef = useRef(onChange);
|
|
129
|
+
onChangeRef.current = onChange;
|
|
130
|
+
|
|
131
|
+
// Word wrap — toggled via a Compartment so the editor isn't destroyed on change
|
|
132
|
+
const wrapCompartmentRef = useRef(new Compartment());
|
|
133
|
+
const [wordWrap, setWordWrap] = useState(true);
|
|
134
|
+
const wordWrapRef = useRef(wordWrap);
|
|
135
|
+
wordWrapRef.current = wordWrap;
|
|
136
|
+
|
|
137
|
+
const [isFormatting, setIsFormatting] = useState(false);
|
|
138
|
+
|
|
139
|
+
// Resize state — explicit pixel height controlled by drag
|
|
140
|
+
const [editorHeight, setEditorHeight] = useState(defaultHeight);
|
|
141
|
+
const dragStateRef = useRef<{ startY: number; startH: number } | null>(null);
|
|
142
|
+
|
|
143
|
+
const cmTheme = useCodeMirrorVscodeTheme();
|
|
144
|
+
const palette = useCodeMirrorVscodePalette();
|
|
145
|
+
|
|
146
|
+
// Always reads latest inputData without recreating the editor
|
|
147
|
+
const inputDataRef = useRef<Record<string, unknown>>(inputData ?? {});
|
|
148
|
+
inputDataRef.current = inputData ?? {};
|
|
149
|
+
|
|
150
|
+
// Stable completion source — reads inputData from ref at call time
|
|
151
|
+
const inputDataCompletionSource = useMemo(
|
|
152
|
+
() => (ctx: CompletionContext) => getCompletions(inputDataRef.current, ctx),
|
|
153
|
+
[],
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const baseExtensions = useMemo<Extension[]>(
|
|
157
|
+
() => [
|
|
158
|
+
javascript(),
|
|
159
|
+
highlightActiveLine(),
|
|
160
|
+
highlightSpecialChars(),
|
|
161
|
+
bracketMatching(),
|
|
162
|
+
closeBrackets(),
|
|
163
|
+
indentOnInput(),
|
|
164
|
+
...(hideGutter ? [] : [foldGutter()]),
|
|
165
|
+
history(),
|
|
166
|
+
autocompletion({
|
|
167
|
+
override: [
|
|
168
|
+
localCompletionSource,
|
|
169
|
+
scopeCompletionSource(globalThis),
|
|
170
|
+
inputDataCompletionSource,
|
|
171
|
+
],
|
|
172
|
+
activateOnTyping: true,
|
|
173
|
+
}),
|
|
174
|
+
keymap.of([
|
|
175
|
+
...defaultKeymap,
|
|
176
|
+
...historyKeymap,
|
|
177
|
+
...foldKeymap,
|
|
178
|
+
...closeBracketsKeymap,
|
|
179
|
+
...completionKeymap,
|
|
180
|
+
]),
|
|
181
|
+
EditorView.updateListener.of((update) => {
|
|
182
|
+
if (update.docChanged) {
|
|
183
|
+
onChangeRef.current?.(update.state.doc.toString());
|
|
184
|
+
}
|
|
185
|
+
}),
|
|
186
|
+
...(placeholder ? [cmPlaceholder(placeholder)] : []),
|
|
187
|
+
],
|
|
188
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- inputDataCompletionSource is stable (created once via useMemo)
|
|
189
|
+
[placeholder, inputDataCompletionSource, hideGutter],
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
const themeExtension = useMemo(
|
|
193
|
+
() =>
|
|
194
|
+
EditorView.theme({
|
|
195
|
+
'&': {
|
|
196
|
+
fontFamily: CODEMIRROR_IOSEVKA_FONT_STACK,
|
|
197
|
+
fontSize: '12px',
|
|
198
|
+
height: '100%',
|
|
199
|
+
'--cm-vscode-widget-surface': palette.surface,
|
|
200
|
+
'--cm-vscode-widget-surface-alt': palette.surfaceAlt,
|
|
201
|
+
'--cm-vscode-widget-border': palette.border,
|
|
202
|
+
'--cm-vscode-widget-fg': palette.foreground,
|
|
203
|
+
'--cm-vscode-widget-fg-muted': palette.foregroundMuted,
|
|
204
|
+
'--cm-vscode-widget-fg-inverse': palette.foregroundInverse,
|
|
205
|
+
'--cm-vscode-widget-accent': palette.accent,
|
|
206
|
+
'--cm-vscode-widget-accent-hover': palette.accentHover,
|
|
207
|
+
'--cm-vscode-widget-selection': palette.selection,
|
|
208
|
+
},
|
|
209
|
+
'.cm-scroller, .cm-content, .cm-gutters, .cm-tooltip': {
|
|
210
|
+
fontFamily: CODEMIRROR_IOSEVKA_FONT_STACK,
|
|
211
|
+
},
|
|
212
|
+
'.cm-content': {
|
|
213
|
+
padding: '8px 0',
|
|
214
|
+
minHeight: hideGutter ? null : '120px',
|
|
215
|
+
},
|
|
216
|
+
'.cm-line': {
|
|
217
|
+
padding: '0 8px',
|
|
218
|
+
},
|
|
219
|
+
'.cm-gutters': hideGutter ? { display: 'none' } : { minWidth: '28px' },
|
|
220
|
+
'&.cm-focused': {
|
|
221
|
+
outline: 'none',
|
|
222
|
+
},
|
|
223
|
+
'.cm-scroller': {
|
|
224
|
+
overflow: 'auto',
|
|
225
|
+
height: '100%',
|
|
226
|
+
},
|
|
227
|
+
'.cm-tooltip': {
|
|
228
|
+
backgroundColor: palette.surface,
|
|
229
|
+
border: `1px solid ${palette.border}`,
|
|
230
|
+
color: palette.foreground,
|
|
231
|
+
boxShadow: `0 6px 18px color-mix(in srgb, ${palette.border} 35%, transparent)`,
|
|
232
|
+
},
|
|
233
|
+
'.cm-tooltip-autocomplete ul li[aria-selected]': {
|
|
234
|
+
backgroundColor: palette.selection,
|
|
235
|
+
color: palette.foreground,
|
|
236
|
+
},
|
|
237
|
+
'.cm-completionLabel': {
|
|
238
|
+
fontSize: '12px',
|
|
239
|
+
},
|
|
240
|
+
'.cm-completionMatchedText': {
|
|
241
|
+
fontWeight: '600',
|
|
242
|
+
textDecoration: 'none',
|
|
243
|
+
},
|
|
244
|
+
'.cm-completionDetail': {
|
|
245
|
+
color: palette.foregroundMuted,
|
|
246
|
+
fontSize: '11px',
|
|
247
|
+
},
|
|
248
|
+
}),
|
|
249
|
+
[palette, hideGutter],
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
// Recreate editor when theme or base extensions change
|
|
253
|
+
useEffect(() => {
|
|
254
|
+
if (!containerRef.current) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const state = EditorState.create({
|
|
259
|
+
doc: value,
|
|
260
|
+
extensions: [
|
|
261
|
+
...baseExtensions,
|
|
262
|
+
// Word wrap managed via Compartment so it can be toggled without recreating the editor
|
|
263
|
+
wrapCompartmentRef.current.of(wordWrapRef.current ? EditorView.lineWrapping : []),
|
|
264
|
+
cmTheme,
|
|
265
|
+
themeExtension,
|
|
266
|
+
],
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const view = new EditorView({
|
|
270
|
+
state,
|
|
271
|
+
parent: containerRef.current,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
viewRef.current = view;
|
|
275
|
+
|
|
276
|
+
return () => {
|
|
277
|
+
view.destroy();
|
|
278
|
+
viewRef.current = null;
|
|
279
|
+
};
|
|
280
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- editor is recreated intentionally on theme/extension changes
|
|
281
|
+
}, [cmTheme, baseExtensions, themeExtension]);
|
|
282
|
+
|
|
283
|
+
// Toggle word wrap dynamically via Compartment reconfiguration
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
const view = viewRef.current;
|
|
286
|
+
if (!view) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
view.dispatch({
|
|
290
|
+
effects: wrapCompartmentRef.current.reconfigure(wordWrap ? EditorView.lineWrapping : []),
|
|
291
|
+
});
|
|
292
|
+
}, [wordWrap]);
|
|
293
|
+
|
|
294
|
+
// Sync external value changes without recreating the editor
|
|
295
|
+
useEffect(() => {
|
|
296
|
+
const view = viewRef.current;
|
|
297
|
+
if (!view) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const current = view.state.doc.toString();
|
|
301
|
+
if (current !== value) {
|
|
302
|
+
view.dispatch({
|
|
303
|
+
changes: { from: 0, to: current.length, insert: value },
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}, [value]);
|
|
307
|
+
|
|
308
|
+
const handleFormat = async () => {
|
|
309
|
+
const view = viewRef.current;
|
|
310
|
+
if (!view || isFormatting) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
setIsFormatting(true);
|
|
314
|
+
try {
|
|
315
|
+
const [{ format }, { default: pluginBabel }, { default: pluginEstree }] = await Promise.all([
|
|
316
|
+
import('prettier/standalone'),
|
|
317
|
+
import('prettier/plugins/babel'),
|
|
318
|
+
import('prettier/plugins/estree'),
|
|
319
|
+
]);
|
|
320
|
+
const current = view.state.doc.toString();
|
|
321
|
+
const formatted = await format(current, {
|
|
322
|
+
parser: 'babel',
|
|
323
|
+
plugins: [pluginBabel, pluginEstree],
|
|
324
|
+
semi: true,
|
|
325
|
+
singleQuote: true,
|
|
326
|
+
printWidth: 80,
|
|
327
|
+
tabWidth: 2,
|
|
328
|
+
});
|
|
329
|
+
// Prettier adds a trailing newline — trim it for a clean editor value
|
|
330
|
+
const trimmed = formatted.trimEnd();
|
|
331
|
+
view.dispatch({
|
|
332
|
+
changes: { from: 0, to: view.state.doc.length, insert: trimmed },
|
|
333
|
+
});
|
|
334
|
+
onChangeRef.current?.(trimmed);
|
|
335
|
+
} catch {
|
|
336
|
+
// Silently ignore format errors (e.g. syntax errors in the code)
|
|
337
|
+
} finally {
|
|
338
|
+
setIsFormatting(false);
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
const handleDragHandlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {
|
|
343
|
+
e.preventDefault();
|
|
344
|
+
(e.currentTarget as HTMLDivElement).setPointerCapture(e.pointerId);
|
|
345
|
+
dragStateRef.current = { startY: e.clientY, startH: editorHeight };
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const handleDragHandlePointerMove = (e: React.PointerEvent<HTMLDivElement>) => {
|
|
349
|
+
if (!dragStateRef.current) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const delta = e.clientY - dragStateRef.current.startY;
|
|
353
|
+
const next = Math.max(minHeight, Math.min(maxHeight, dragStateRef.current.startH + delta));
|
|
354
|
+
setEditorHeight(next);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
const handleDragHandlePointerUp = (e: React.PointerEvent<HTMLDivElement>) => {
|
|
358
|
+
(e.currentTarget as HTMLDivElement).releasePointerCapture(e.pointerId);
|
|
359
|
+
dragStateRef.current = null;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
return (
|
|
363
|
+
<div
|
|
364
|
+
className={cn('border rounded-md overflow-hidden bg-background flex flex-col', className)}
|
|
365
|
+
style={{ height: editorHeight }}
|
|
366
|
+
>
|
|
367
|
+
{/* Toolbar */}
|
|
368
|
+
{!hideToolbar && (
|
|
369
|
+
<div className="flex items-center gap-0.5 px-1.5 py-1 border-b border-border bg-muted/40 shrink-0">
|
|
370
|
+
<div className="flex-1" />
|
|
371
|
+
<TooltipProvider delayDuration={300}>
|
|
372
|
+
<Tooltip>
|
|
373
|
+
<TooltipTrigger asChild>
|
|
374
|
+
<button
|
|
375
|
+
type="button"
|
|
376
|
+
onClick={() => setWordWrap((w) => !w)}
|
|
377
|
+
className={cn(
|
|
378
|
+
'flex items-center justify-center w-5 h-5 rounded transition-colors',
|
|
379
|
+
wordWrap
|
|
380
|
+
? 'text-foreground bg-muted'
|
|
381
|
+
: 'text-muted-foreground hover:text-foreground hover:bg-muted',
|
|
382
|
+
)}
|
|
383
|
+
>
|
|
384
|
+
<WrapText className="w-3 h-3" />
|
|
385
|
+
</button>
|
|
386
|
+
</TooltipTrigger>
|
|
387
|
+
<TooltipContent side="bottom" className="text-xs">
|
|
388
|
+
{wordWrap ? 'Disable word wrap' : 'Enable word wrap'}
|
|
389
|
+
</TooltipContent>
|
|
390
|
+
</Tooltip>
|
|
391
|
+
</TooltipProvider>
|
|
392
|
+
<TooltipProvider delayDuration={300}>
|
|
393
|
+
<Tooltip>
|
|
394
|
+
<TooltipTrigger asChild>
|
|
395
|
+
<button
|
|
396
|
+
type="button"
|
|
397
|
+
onClick={handleFormat}
|
|
398
|
+
disabled={isFormatting}
|
|
399
|
+
className="flex items-center justify-center w-5 h-5 rounded transition-colors text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40"
|
|
400
|
+
>
|
|
401
|
+
<WandSparkles className="w-3 h-3" />
|
|
402
|
+
</button>
|
|
403
|
+
</TooltipTrigger>
|
|
404
|
+
<TooltipContent side="bottom" className="text-xs">
|
|
405
|
+
Format code
|
|
406
|
+
</TooltipContent>
|
|
407
|
+
</Tooltip>
|
|
408
|
+
</TooltipProvider>
|
|
409
|
+
</div>
|
|
410
|
+
)}
|
|
411
|
+
|
|
412
|
+
{/* Editor — fills space between toolbar and resize handle */}
|
|
413
|
+
<div ref={containerRef} className="flex-1 min-h-0 overflow-hidden" />
|
|
414
|
+
|
|
415
|
+
{/* Resize drag handle */}
|
|
416
|
+
{!hideResize && (
|
|
417
|
+
<div
|
|
418
|
+
className="shrink-0 h-2 cursor-ns-resize flex items-center justify-center group select-none border-t border-border bg-muted/30 hover:bg-muted/60 transition-colors"
|
|
419
|
+
onPointerDown={handleDragHandlePointerDown}
|
|
420
|
+
onPointerMove={handleDragHandlePointerMove}
|
|
421
|
+
onPointerUp={handleDragHandlePointerUp}
|
|
422
|
+
onPointerCancel={handleDragHandlePointerUp}
|
|
423
|
+
>
|
|
424
|
+
{/* Grip dots */}
|
|
425
|
+
<div className="flex gap-0.5 opacity-40 group-hover:opacity-70 transition-opacity">
|
|
426
|
+
<div className="w-4 h-0.5 rounded-full bg-foreground" />
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
)}
|
|
430
|
+
</div>
|
|
431
|
+
);
|
|
432
|
+
}
|