@stigmer/react 0.4.7 → 0.5.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/action-menu/ActionMenu.d.ts +64 -0
- package/action-menu/ActionMenu.d.ts.map +1 -0
- package/action-menu/ActionMenu.js +78 -0
- package/action-menu/ActionMenu.js.map +1 -0
- package/action-menu/index.d.ts +3 -0
- package/action-menu/index.d.ts.map +1 -0
- package/action-menu/index.js +2 -0
- package/action-menu/index.js.map +1 -0
- package/action-menu/types.d.ts +65 -0
- package/action-menu/types.d.ts.map +1 -0
- package/action-menu/types.js +2 -0
- package/action-menu/types.js.map +1 -0
- package/agent/AgentCreationWizard.d.ts +55 -0
- package/agent/AgentCreationWizard.d.ts.map +1 -0
- package/agent/AgentCreationWizard.js +115 -0
- package/agent/AgentCreationWizard.js.map +1 -0
- package/agent/AgentDetailView.d.ts +77 -9
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +265 -87
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/index.d.ts +8 -0
- package/agent/index.d.ts.map +1 -1
- package/agent/index.js +4 -0
- package/agent/index.js.map +1 -1
- package/agent/internal/agentToInput.d.ts +12 -0
- package/agent/internal/agentToInput.d.ts.map +1 -0
- package/agent/internal/agentToInput.js +72 -0
- package/agent/internal/agentToInput.js.map +1 -0
- package/agent/steps/CapabilitiesStep.d.ts +16 -0
- package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
- package/agent/steps/CapabilitiesStep.js +80 -0
- package/agent/steps/CapabilitiesStep.js.map +1 -0
- package/agent/steps/IdentityStep.d.ts +18 -0
- package/agent/steps/IdentityStep.d.ts.map +1 -0
- package/agent/steps/IdentityStep.js +43 -0
- package/agent/steps/IdentityStep.js.map +1 -0
- package/agent/steps/ReviewStep.d.ts +23 -0
- package/agent/steps/ReviewStep.d.ts.map +1 -0
- package/agent/steps/ReviewStep.js +73 -0
- package/agent/steps/ReviewStep.js.map +1 -0
- package/agent/steps/types.d.ts +35 -0
- package/agent/steps/types.d.ts.map +1 -0
- package/agent/steps/types.js +16 -0
- package/agent/steps/types.js.map +1 -0
- package/agent/useCreateAgent.d.ts +45 -0
- package/agent/useCreateAgent.d.ts.map +1 -0
- package/agent/useCreateAgent.js +50 -0
- package/agent/useCreateAgent.js.map +1 -0
- package/agent/useUpdateAgent.d.ts +24 -0
- package/agent/useUpdateAgent.d.ts.map +1 -0
- package/agent/useUpdateAgent.js +35 -0
- package/agent/useUpdateAgent.js.map +1 -0
- package/dependency-graph/DependencyGraph.d.ts +37 -0
- package/dependency-graph/DependencyGraph.d.ts.map +1 -0
- package/dependency-graph/DependencyGraph.js +88 -0
- package/dependency-graph/DependencyGraph.js.map +1 -0
- package/dependency-graph/DependencyTreeNode.d.ts +23 -0
- package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
- package/dependency-graph/DependencyTreeNode.js +99 -0
- package/dependency-graph/DependencyTreeNode.js.map +1 -0
- package/dependency-graph/index.d.ts +4 -0
- package/dependency-graph/index.d.ts.map +1 -0
- package/dependency-graph/index.js +5 -0
- package/dependency-graph/index.js.map +1 -0
- package/dependency-graph/types.d.ts +130 -0
- package/dependency-graph/types.d.ts.map +1 -0
- package/dependency-graph/types.js +2 -0
- package/dependency-graph/types.js.map +1 -0
- package/dependency-graph/useDependencyGraph.d.ts +27 -0
- package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
- package/dependency-graph/useDependencyGraph.js +129 -0
- package/dependency-graph/useDependencyGraph.js.map +1 -0
- package/empty-state/EmptyState.d.ts +29 -0
- package/empty-state/EmptyState.d.ts.map +1 -0
- package/empty-state/EmptyState.js +45 -0
- package/empty-state/EmptyState.js.map +1 -0
- package/empty-state/index.d.ts +4 -0
- package/empty-state/index.d.ts.map +1 -0
- package/empty-state/index.js +3 -0
- package/empty-state/index.js.map +1 -0
- package/empty-state/types.d.ts +73 -0
- package/empty-state/types.d.ts.map +1 -0
- package/empty-state/types.js +2 -0
- package/empty-state/types.js.map +1 -0
- package/empty-state/useEmptyState.d.ts +18 -0
- package/empty-state/useEmptyState.d.ts.map +1 -0
- package/empty-state/useEmptyState.js +72 -0
- package/empty-state/useEmptyState.js.map +1 -0
- package/execution/MessageThread.d.ts +1 -0
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +22 -12
- package/execution/MessageThread.js.map +1 -1
- package/execution/SetupProgress.d.ts +23 -9
- package/execution/SetupProgress.d.ts.map +1 -1
- package/execution/SetupProgress.js +30 -14
- package/execution/SetupProgress.js.map +1 -1
- package/execution/__tests__/thread-keys.test.js +82 -0
- package/execution/__tests__/thread-keys.test.js.map +1 -1
- package/feedback/StigmerToaster.d.ts +18 -0
- package/feedback/StigmerToaster.d.ts.map +1 -0
- package/feedback/StigmerToaster.js +31 -0
- package/feedback/StigmerToaster.js.map +1 -0
- package/feedback/index.d.ts +4 -0
- package/feedback/index.d.ts.map +1 -0
- package/feedback/index.js +3 -0
- package/feedback/index.js.map +1 -0
- package/feedback/toast.d.ts +14 -0
- package/feedback/toast.d.ts.map +1 -0
- package/feedback/toast.js +14 -0
- package/feedback/toast.js.map +1 -0
- package/feedback/types.d.ts +4 -0
- package/feedback/types.d.ts.map +1 -0
- package/feedback/types.js +2 -0
- package/feedback/types.js.map +1 -0
- package/index.d.ts +30 -10
- package/index.d.ts.map +1 -1
- package/index.js +29 -9
- package/index.js.map +1 -1
- package/inline-edit/InlineEditImage.d.ts +20 -0
- package/inline-edit/InlineEditImage.d.ts.map +1 -0
- package/inline-edit/InlineEditImage.js +85 -0
- package/inline-edit/InlineEditImage.js.map +1 -0
- package/inline-edit/InlineEditKeyValue.d.ts +29 -0
- package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
- package/inline-edit/InlineEditKeyValue.js +67 -0
- package/inline-edit/InlineEditKeyValue.js.map +1 -0
- package/inline-edit/InlineEditResourceList.d.ts +34 -0
- package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
- package/inline-edit/InlineEditResourceList.js +99 -0
- package/inline-edit/InlineEditResourceList.js.map +1 -0
- package/inline-edit/InlineEditSelect.d.ts +18 -0
- package/inline-edit/InlineEditSelect.d.ts.map +1 -0
- package/inline-edit/InlineEditSelect.js +54 -0
- package/inline-edit/InlineEditSelect.js.map +1 -0
- package/inline-edit/InlineEditText.d.ts +23 -0
- package/inline-edit/InlineEditText.d.ts.map +1 -0
- package/inline-edit/InlineEditText.js +79 -0
- package/inline-edit/InlineEditText.js.map +1 -0
- package/inline-edit/InlineEditTextarea.d.ts +22 -0
- package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
- package/inline-edit/InlineEditTextarea.js +83 -0
- package/inline-edit/InlineEditTextarea.js.map +1 -0
- package/inline-edit/index.d.ts +16 -0
- package/inline-edit/index.d.ts.map +1 -0
- package/inline-edit/index.js +8 -0
- package/inline-edit/index.js.map +1 -0
- package/inline-edit/types.d.ts +42 -0
- package/inline-edit/types.d.ts.map +1 -0
- package/inline-edit/types.js +2 -0
- package/inline-edit/types.js.map +1 -0
- package/inline-edit/useInlineFieldSave.d.ts +23 -0
- package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
- package/inline-edit/useInlineFieldSave.js +44 -0
- package/inline-edit/useInlineFieldSave.js.map +1 -0
- package/internal/Tabs.d.ts +4 -38
- package/internal/Tabs.d.ts.map +1 -1
- package/internal/Tabs.js +3 -62
- package/internal/Tabs.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +43 -0
- package/library/ImportResourceDialog.d.ts.map +1 -0
- package/library/ImportResourceDialog.js +90 -0
- package/library/ImportResourceDialog.js.map +1 -0
- package/library/index.d.ts +7 -4
- package/library/index.d.ts.map +1 -1
- package/library/index.js +4 -2
- package/library/index.js.map +1 -1
- package/library/serialize-resource-yaml.d.ts +53 -0
- package/library/serialize-resource-yaml.d.ts.map +1 -1
- package/library/serialize-resource-yaml.js +275 -0
- package/library/serialize-resource-yaml.js.map +1 -1
- package/library/useExportResource.d.ts +56 -0
- package/library/useExportResource.d.ts.map +1 -0
- package/library/useExportResource.js +137 -0
- package/library/useExportResource.js.map +1 -0
- package/library/useImportResource.d.ts +84 -0
- package/library/useImportResource.d.ts.map +1 -0
- package/library/useImportResource.js +188 -0
- package/library/useImportResource.js.map +1 -0
- package/mcp-server/McpServerCreationWizard.d.ts +55 -0
- package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
- package/mcp-server/McpServerCreationWizard.js +121 -0
- package/mcp-server/McpServerCreationWizard.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +21 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +113 -20
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
- package/mcp-server/internal/mcpServerToInput.js +81 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
- package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
- package/mcp-server/steps/IdentityTransportStep.js +73 -0
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts +23 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
- package/mcp-server/steps/ReviewStep.js +137 -0
- package/mcp-server/steps/ReviewStep.js.map +1 -0
- package/mcp-server/steps/types.d.ts +56 -0
- package/mcp-server/steps/types.d.ts.map +1 -0
- package/mcp-server/steps/types.js +27 -0
- package/mcp-server/steps/types.js.map +1 -0
- package/mcp-server/useCreateMcpServer.d.ts +45 -0
- package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
- package/mcp-server/useCreateMcpServer.js +50 -0
- package/mcp-server/useCreateMcpServer.js.map +1 -0
- package/mcp-server/useUpdateMcpServer.d.ts +24 -0
- package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
- package/mcp-server/useUpdateMcpServer.js +35 -0
- package/mcp-server/useUpdateMcpServer.js.map +1 -0
- package/models/registry.d.ts +4 -1
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js +6 -2
- package/models/registry.js.map +1 -1
- package/package.json +8 -4
- package/provider.js +1 -1
- package/provider.js.map +1 -1
- package/resource-creation/CreationPicker.d.ts +60 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -0
- package/resource-creation/CreationPicker.js +74 -0
- package/resource-creation/CreationPicker.js.map +1 -0
- package/resource-creation/StepIndicator.d.ts +28 -0
- package/resource-creation/StepIndicator.d.ts.map +1 -0
- package/resource-creation/StepIndicator.js +40 -0
- package/resource-creation/StepIndicator.js.map +1 -0
- package/resource-creation/TemplateCard.d.ts +24 -0
- package/resource-creation/TemplateCard.d.ts.map +1 -0
- package/resource-creation/TemplateCard.js +68 -0
- package/resource-creation/TemplateCard.js.map +1 -0
- package/resource-creation/TemplateGallery.d.ts +43 -0
- package/resource-creation/TemplateGallery.d.ts.map +1 -0
- package/resource-creation/TemplateGallery.js +78 -0
- package/resource-creation/TemplateGallery.js.map +1 -0
- package/resource-creation/WizardNav.d.ts +31 -0
- package/resource-creation/WizardNav.d.ts.map +1 -0
- package/resource-creation/WizardNav.js +29 -0
- package/resource-creation/WizardNav.js.map +1 -0
- package/resource-creation/WizardShell.d.ts +41 -0
- package/resource-creation/WizardShell.d.ts.map +1 -0
- package/resource-creation/WizardShell.js +55 -0
- package/resource-creation/WizardShell.js.map +1 -0
- package/resource-creation/index.d.ts +21 -0
- package/resource-creation/index.d.ts.map +1 -0
- package/resource-creation/index.js +14 -0
- package/resource-creation/index.js.map +1 -0
- package/resource-creation/templates/agent-templates.d.ts +15 -0
- package/resource-creation/templates/agent-templates.d.ts.map +1 -0
- package/resource-creation/templates/agent-templates.js +148 -0
- package/resource-creation/templates/agent-templates.js.map +1 -0
- package/resource-creation/templates/index.d.ts +5 -0
- package/resource-creation/templates/index.d.ts.map +1 -0
- package/resource-creation/templates/index.js +5 -0
- package/resource-creation/templates/index.js.map +1 -0
- package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
- package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
- package/resource-creation/templates/mcp-server-templates.js +92 -0
- package/resource-creation/templates/mcp-server-templates.js.map +1 -0
- package/resource-creation/templates/types.d.ts +48 -0
- package/resource-creation/templates/types.d.ts.map +1 -0
- package/resource-creation/templates/types.js +16 -0
- package/resource-creation/templates/types.js.map +1 -0
- package/resource-creation/types.d.ts +88 -0
- package/resource-creation/types.d.ts.map +1 -0
- package/resource-creation/types.js +2 -0
- package/resource-creation/types.js.map +1 -0
- package/resource-creation/useTemplateFilter.d.ts +43 -0
- package/resource-creation/useTemplateFilter.d.ts.map +1 -0
- package/resource-creation/useTemplateFilter.js +73 -0
- package/resource-creation/useTemplateFilter.js.map +1 -0
- package/resource-creation/useWizardState.d.ts +67 -0
- package/resource-creation/useWizardState.d.ts.map +1 -0
- package/resource-creation/useWizardState.js +143 -0
- package/resource-creation/useWizardState.js.map +1 -0
- package/resource-detail/ConfirmDialog.d.ts +44 -0
- package/resource-detail/ConfirmDialog.d.ts.map +1 -0
- package/resource-detail/ConfirmDialog.js +62 -0
- package/resource-detail/ConfirmDialog.js.map +1 -0
- package/resource-detail/ResourceActionBar.d.ts +42 -0
- package/resource-detail/ResourceActionBar.d.ts.map +1 -0
- package/resource-detail/ResourceActionBar.js +64 -0
- package/resource-detail/ResourceActionBar.js.map +1 -0
- package/resource-detail/ResourceDetailShell.d.ts +36 -0
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
- package/resource-detail/ResourceDetailShell.js +65 -0
- package/resource-detail/ResourceDetailShell.js.map +1 -0
- package/resource-detail/Section.d.ts +18 -0
- package/resource-detail/Section.d.ts.map +1 -0
- package/resource-detail/Section.js +18 -0
- package/resource-detail/Section.js.map +1 -0
- package/resource-detail/index.d.ts +15 -0
- package/resource-detail/index.d.ts.map +1 -0
- package/resource-detail/index.js +10 -0
- package/resource-detail/index.js.map +1 -0
- package/resource-detail/types.d.ts +146 -0
- package/resource-detail/types.d.ts.map +1 -0
- package/resource-detail/types.js +2 -0
- package/resource-detail/types.js.map +1 -0
- package/resource-detail/useConfirmAction.d.ts +41 -0
- package/resource-detail/useConfirmAction.d.ts.map +1 -0
- package/resource-detail/useConfirmAction.js +30 -0
- package/resource-detail/useConfirmAction.js.map +1 -0
- package/resource-detail/useCopyResource.d.ts +28 -0
- package/resource-detail/useCopyResource.d.ts.map +1 -0
- package/resource-detail/useCopyResource.js +46 -0
- package/resource-detail/useCopyResource.js.map +1 -0
- package/resource-detail/useDeleteResource.d.ts +40 -0
- package/resource-detail/useDeleteResource.d.ts.map +1 -0
- package/resource-detail/useDeleteResource.js +83 -0
- package/resource-detail/useDeleteResource.js.map +1 -0
- package/resource-detail/useDetailTabs.d.ts +46 -0
- package/resource-detail/useDetailTabs.d.ts.map +1 -0
- package/resource-detail/useDetailTabs.js +47 -0
- package/resource-detail/useDetailTabs.js.map +1 -0
- package/resource-workbench/components/BulkActionBar.d.ts +36 -0
- package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
- package/resource-workbench/components/BulkActionBar.js +35 -0
- package/resource-workbench/components/BulkActionBar.js.map +1 -0
- package/resource-workbench/components/ColumnHeader.d.ts +23 -0
- package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
- package/resource-workbench/components/ColumnHeader.js +25 -0
- package/resource-workbench/components/ColumnHeader.js.map +1 -0
- package/resource-workbench/components/FilterBar.d.ts +33 -0
- package/resource-workbench/components/FilterBar.d.ts.map +1 -0
- package/resource-workbench/components/FilterBar.js +72 -0
- package/resource-workbench/components/FilterBar.js.map +1 -0
- package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
- package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
- package/resource-workbench/components/ResourceAvatar.js +51 -0
- package/resource-workbench/components/ResourceAvatar.js.map +1 -0
- package/resource-workbench/components/ResourceCards.d.ts +39 -0
- package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
- package/resource-workbench/components/ResourceCards.js +41 -0
- package/resource-workbench/components/ResourceCards.js.map +1 -0
- package/resource-workbench/components/ResourceInspector.d.ts +26 -0
- package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
- package/resource-workbench/components/ResourceInspector.js +22 -0
- package/resource-workbench/components/ResourceInspector.js.map +1 -0
- package/resource-workbench/components/ResourceList.d.ts +39 -0
- package/resource-workbench/components/ResourceList.d.ts.map +1 -0
- package/resource-workbench/components/ResourceList.js +41 -0
- package/resource-workbench/components/ResourceList.js.map +1 -0
- package/resource-workbench/components/ResourceTable.d.ts +47 -0
- package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
- package/resource-workbench/components/ResourceTable.js +78 -0
- package/resource-workbench/components/ResourceTable.js.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
- package/resource-workbench/components/ResourceWorkbench.js +170 -0
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
- package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
- package/resource-workbench/components/SelectionCheckbox.js +16 -0
- package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
- package/resource-workbench/components/StatusBadge.d.ts +31 -0
- package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
- package/resource-workbench/components/StatusBadge.js +75 -0
- package/resource-workbench/components/StatusBadge.js.map +1 -0
- package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
- package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
- package/resource-workbench/components/ViewSwitcher.js +37 -0
- package/resource-workbench/components/ViewSwitcher.js.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceCollection.js +133 -0
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
- package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceFilters.js +105 -0
- package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
- package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
- package/resource-workbench/hooks/useResourceSelection.js +123 -0
- package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
- package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
- package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
- package/resource-workbench/hooks/useViewPreference.js +60 -0
- package/resource-workbench/hooks/useViewPreference.js.map +1 -0
- package/resource-workbench/index.d.ts +34 -0
- package/resource-workbench/index.d.ts.map +1 -0
- package/resource-workbench/index.js +19 -0
- package/resource-workbench/index.js.map +1 -0
- package/resource-workbench/types.d.ts +165 -0
- package/resource-workbench/types.d.ts.map +1 -0
- package/resource-workbench/types.js +2 -0
- package/resource-workbench/types.js.map +1 -0
- package/runner/RunnerDetailView.d.ts +44 -0
- package/runner/RunnerDetailView.d.ts.map +1 -0
- package/runner/RunnerDetailView.js +154 -0
- package/runner/RunnerDetailView.js.map +1 -0
- package/runner/RunnerListPanel.d.ts +26 -1
- package/runner/RunnerListPanel.d.ts.map +1 -1
- package/runner/RunnerListPanel.js +68 -46
- package/runner/RunnerListPanel.js.map +1 -1
- package/runner/index.d.ts +7 -1
- package/runner/index.d.ts.map +1 -1
- package/runner/index.js +3 -0
- package/runner/index.js.map +1 -1
- package/runner/shared.d.ts +31 -0
- package/runner/shared.d.ts.map +1 -0
- package/runner/shared.js +55 -0
- package/runner/shared.js.map +1 -0
- package/runner/useRunner.d.ts +37 -0
- package/runner/useRunner.d.ts.map +1 -0
- package/runner/useRunner.js +24 -0
- package/runner/useRunner.js.map +1 -0
- package/session/__tests__/group-sessions.test.js +3 -3
- package/session/__tests__/group-sessions.test.js.map +1 -1
- package/skill/SkillDetailView.d.ts +70 -7
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +107 -39
- package/skill/SkillDetailView.js.map +1 -1
- package/skill/SkillDiffDialog.d.ts +42 -0
- package/skill/SkillDiffDialog.d.ts.map +1 -0
- package/skill/SkillDiffDialog.js +72 -0
- package/skill/SkillDiffDialog.js.map +1 -0
- package/skill/SkillFileBrowser.d.ts +31 -0
- package/skill/SkillFileBrowser.d.ts.map +1 -0
- package/skill/SkillFileBrowser.js +105 -0
- package/skill/SkillFileBrowser.js.map +1 -0
- package/skill/SkillUploader.d.ts +39 -0
- package/skill/SkillUploader.d.ts.map +1 -0
- package/skill/SkillUploader.js +141 -0
- package/skill/SkillUploader.js.map +1 -0
- package/skill/index.d.ts +18 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/index.js +9 -0
- package/skill/index.js.map +1 -1
- package/skill/internal/computeArtifactHash.d.ts +9 -0
- package/skill/internal/computeArtifactHash.d.ts.map +1 -0
- package/skill/internal/computeArtifactHash.js +14 -0
- package/skill/internal/computeArtifactHash.js.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
- package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
- package/skill/internal/fetchAndUnpackArtifact.js +34 -0
- package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
- package/skill/usePushSkill.d.ts +53 -0
- package/skill/usePushSkill.d.ts.map +1 -0
- package/skill/usePushSkill.js +57 -0
- package/skill/usePushSkill.js.map +1 -0
- package/skill/useSkillArtifact.d.ts +37 -0
- package/skill/useSkillArtifact.d.ts.map +1 -0
- package/skill/useSkillArtifact.js +76 -0
- package/skill/useSkillArtifact.js.map +1 -0
- package/skill/useSkillDiff.d.ts +31 -0
- package/skill/useSkillDiff.d.ts.map +1 -0
- package/skill/useSkillDiff.js +97 -0
- package/skill/useSkillDiff.js.map +1 -0
- package/skill/useSkillDuplicateCheck.d.ts +34 -0
- package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
- package/skill/useSkillDuplicateCheck.js +58 -0
- package/skill/useSkillDuplicateCheck.js.map +1 -0
- package/skill/useSkillUpload.d.ts +69 -0
- package/skill/useSkillUpload.d.ts.map +1 -0
- package/skill/useSkillUpload.js +157 -0
- package/skill/useSkillUpload.js.map +1 -0
- package/skill/useSkillVersions.d.ts +46 -0
- package/skill/useSkillVersions.d.ts.map +1 -0
- package/skill/useSkillVersions.js +104 -0
- package/skill/useSkillVersions.js.map +1 -0
- package/src/action-menu/ActionMenu.tsx +151 -0
- package/src/action-menu/index.ts +9 -0
- package/src/action-menu/types.ts +70 -0
- package/src/agent/AgentCreationWizard.tsx +201 -0
- package/src/agent/AgentDetailView.tsx +817 -321
- package/src/agent/index.ts +16 -0
- package/src/agent/internal/agentToInput.ts +95 -0
- package/src/agent/steps/CapabilitiesStep.tsx +363 -0
- package/src/agent/steps/IdentityStep.tsx +259 -0
- package/src/agent/steps/ReviewStep.tsx +211 -0
- package/src/agent/steps/types.ts +53 -0
- package/src/agent/useCreateAgent.ts +76 -0
- package/src/agent/useUpdateAgent.ts +55 -0
- package/src/dependency-graph/DependencyGraph.tsx +153 -0
- package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
- package/src/dependency-graph/index.ts +15 -0
- package/src/dependency-graph/types.ts +131 -0
- package/src/dependency-graph/useDependencyGraph.ts +158 -0
- package/src/empty-state/EmptyState.tsx +90 -0
- package/src/empty-state/index.ts +9 -0
- package/src/empty-state/types.ts +81 -0
- package/src/empty-state/useEmptyState.ts +85 -0
- package/src/execution/MessageThread.tsx +26 -15
- package/src/execution/SetupProgress.tsx +35 -14
- package/src/execution/__tests__/thread-keys.test.ts +101 -0
- package/src/feedback/StigmerToaster.tsx +45 -0
- package/src/feedback/index.ts +3 -0
- package/src/feedback/toast.ts +13 -0
- package/src/feedback/types.ts +7 -0
- package/src/index.ts +270 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
- package/src/inline-edit/InlineEditResourceList.tsx +325 -0
- package/src/inline-edit/InlineEditSelect.tsx +150 -0
- package/src/inline-edit/InlineEditText.tsx +211 -0
- package/src/inline-edit/InlineEditTextarea.tsx +209 -0
- package/src/inline-edit/index.ts +28 -0
- package/src/inline-edit/types.ts +47 -0
- package/src/inline-edit/useInlineFieldSave.ts +62 -0
- package/src/internal/Tabs.tsx +4 -164
- package/src/library/ImportResourceDialog.tsx +227 -0
- package/src/library/index.ts +18 -8
- package/src/library/serialize-resource-yaml.ts +356 -0
- package/src/library/useExportResource.ts +183 -0
- package/src/library/useImportResource.ts +253 -0
- package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
- package/src/mcp-server/McpServerDetailView.tsx +392 -105
- package/src/mcp-server/index.ts +16 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
- package/src/mcp-server/steps/ReviewStep.tsx +297 -0
- package/src/mcp-server/steps/types.ts +85 -0
- package/src/mcp-server/useCreateMcpServer.ts +76 -0
- package/src/mcp-server/useUpdateMcpServer.ts +55 -0
- package/src/models/registry.ts +10 -2
- package/src/provider.tsx +1 -1
- package/src/resource-creation/CreationPicker.tsx +292 -0
- package/src/resource-creation/StepIndicator.tsx +156 -0
- package/src/resource-creation/TemplateCard.tsx +143 -0
- package/src/resource-creation/TemplateGallery.tsx +222 -0
- package/src/resource-creation/WizardNav.tsx +163 -0
- package/src/resource-creation/WizardShell.tsx +124 -0
- package/src/resource-creation/index.ts +45 -0
- package/src/resource-creation/templates/agent-templates.ts +160 -0
- package/src/resource-creation/templates/index.ts +7 -0
- package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
- package/src/resource-creation/templates/types.ts +64 -0
- package/src/resource-creation/types.ts +105 -0
- package/src/resource-creation/useTemplateFilter.ts +117 -0
- package/src/resource-creation/useWizardState.ts +223 -0
- package/src/resource-detail/ConfirmDialog.tsx +127 -0
- package/src/resource-detail/ResourceActionBar.tsx +157 -0
- package/src/resource-detail/ResourceDetailShell.tsx +184 -0
- package/src/resource-detail/Section.tsx +78 -0
- package/src/resource-detail/index.ts +34 -0
- package/src/resource-detail/types.ts +177 -0
- package/src/resource-detail/useConfirmAction.ts +70 -0
- package/src/resource-detail/useCopyResource.ts +74 -0
- package/src/resource-detail/useDeleteResource.ts +110 -0
- package/src/resource-detail/useDetailTabs.ts +93 -0
- package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
- package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
- package/src/resource-workbench/components/FilterBar.tsx +173 -0
- package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
- package/src/resource-workbench/components/ResourceCards.tsx +126 -0
- package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
- package/src/resource-workbench/components/ResourceList.tsx +121 -0
- package/src/resource-workbench/components/ResourceTable.tsx +222 -0
- package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
- package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
- package/src/resource-workbench/components/StatusBadge.tsx +119 -0
- package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
- package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
- package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
- package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
- package/src/resource-workbench/index.ts +73 -0
- package/src/resource-workbench/types.ts +220 -0
- package/src/runner/RunnerDetailView.tsx +410 -0
- package/src/runner/RunnerListPanel.tsx +126 -111
- package/src/runner/index.ts +13 -1
- package/src/runner/shared.tsx +124 -0
- package/src/runner/useRunner.ts +59 -0
- package/src/session/__tests__/group-sessions.test.ts +5 -3
- package/src/skill/SkillDetailView.tsx +371 -165
- package/src/skill/SkillDiffDialog.tsx +213 -0
- package/src/skill/SkillFileBrowser.tsx +289 -0
- package/src/skill/SkillUploader.tsx +481 -0
- package/src/skill/index.ts +34 -0
- package/src/skill/internal/computeArtifactHash.ts +13 -0
- package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
- package/src/skill/usePushSkill.ts +101 -0
- package/src/skill/useSkillArtifact.ts +107 -0
- package/src/skill/useSkillDiff.ts +128 -0
- package/src/skill/useSkillDuplicateCheck.ts +92 -0
- package/src/skill/useSkillUpload.ts +231 -0
- package/src/skill/useSkillVersions.ts +165 -0
- package/src/styles.css +28 -0
- package/src/tabs/Tabs.tsx +184 -0
- package/src/tabs/index.ts +2 -0
- package/src/version-history/DiffFileList.tsx +111 -0
- package/src/version-history/DiffSummary.tsx +61 -0
- package/src/version-history/DiffViewer.tsx +163 -0
- package/src/version-history/MultiFileDiffView.tsx +114 -0
- package/src/version-history/VersionTimeline.tsx +232 -0
- package/src/version-history/VersionTimelineEntry.tsx +254 -0
- package/src/version-history/computeDiff.ts +61 -0
- package/src/version-history/computeMultiFileDiff.ts +97 -0
- package/src/version-history/index.ts +22 -0
- package/src/version-history/types.ts +129 -0
- package/styles.css +1 -1
- package/tabs/Tabs.d.ts +58 -0
- package/tabs/Tabs.d.ts.map +1 -0
- package/tabs/Tabs.js +80 -0
- package/tabs/Tabs.js.map +1 -0
- package/tabs/index.d.ts +3 -0
- package/tabs/index.d.ts.map +1 -0
- package/tabs/index.js +2 -0
- package/tabs/index.js.map +1 -0
- package/version-history/DiffFileList.d.ts +22 -0
- package/version-history/DiffFileList.d.ts.map +1 -0
- package/version-history/DiffFileList.js +37 -0
- package/version-history/DiffFileList.js.map +1 -0
- package/version-history/DiffSummary.d.ts +21 -0
- package/version-history/DiffSummary.d.ts.map +1 -0
- package/version-history/DiffSummary.js +16 -0
- package/version-history/DiffSummary.js.map +1 -0
- package/version-history/DiffViewer.d.ts +31 -0
- package/version-history/DiffViewer.d.ts.map +1 -0
- package/version-history/DiffViewer.js +60 -0
- package/version-history/DiffViewer.js.map +1 -0
- package/version-history/MultiFileDiffView.d.ts +30 -0
- package/version-history/MultiFileDiffView.d.ts.map +1 -0
- package/version-history/MultiFileDiffView.js +40 -0
- package/version-history/MultiFileDiffView.js.map +1 -0
- package/version-history/VersionTimeline.d.ts +29 -0
- package/version-history/VersionTimeline.d.ts.map +1 -0
- package/version-history/VersionTimeline.js +87 -0
- package/version-history/VersionTimeline.js.map +1 -0
- package/version-history/VersionTimelineEntry.d.ts +22 -0
- package/version-history/VersionTimelineEntry.d.ts.map +1 -0
- package/version-history/VersionTimelineEntry.js +98 -0
- package/version-history/VersionTimelineEntry.js.map +1 -0
- package/version-history/computeDiff.d.ts +16 -0
- package/version-history/computeDiff.d.ts.map +1 -0
- package/version-history/computeDiff.js +54 -0
- package/version-history/computeDiff.js.map +1 -0
- package/version-history/computeMultiFileDiff.d.ts +15 -0
- package/version-history/computeMultiFileDiff.d.ts.map +1 -0
- package/version-history/computeMultiFileDiff.js +83 -0
- package/version-history/computeMultiFileDiff.js.map +1 -0
- package/version-history/index.d.ts +14 -0
- package/version-history/index.d.ts.map +1 -0
- package/version-history/index.js +9 -0
- package/version-history/index.js.map +1 -0
- package/version-history/types.d.ts +106 -0
- package/version-history/types.d.ts.map +1 -0
- package/version-history/types.js +2 -0
- package/version-history/types.js.map +1 -0
- package/library/ResourceListView.d.ts +0 -174
- package/library/ResourceListView.d.ts.map +0 -1
- package/library/ResourceListView.js +0 -318
- package/library/ResourceListView.js.map +0 -1
- package/src/library/ResourceListView.tsx +0 -956
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { InlineEditBaseProps, SelectOption } from "./types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link InlineEditSelect}. */
|
|
8
|
+
export interface InlineEditSelectProps extends InlineEditBaseProps {
|
|
9
|
+
/** Current selected value. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** Available options. */
|
|
12
|
+
readonly options: readonly SelectOption[];
|
|
13
|
+
/** Called when the user selects a new option. */
|
|
14
|
+
readonly onSave: (newValue: string) => Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Click-to-edit single-choice selector.
|
|
19
|
+
*
|
|
20
|
+
* In read mode, shows the current option label. On click, opens a radio
|
|
21
|
+
* group with all options. Selection triggers immediate save.
|
|
22
|
+
*/
|
|
23
|
+
export function InlineEditSelect({
|
|
24
|
+
value,
|
|
25
|
+
options,
|
|
26
|
+
onSave,
|
|
27
|
+
disabled,
|
|
28
|
+
isSaving,
|
|
29
|
+
error,
|
|
30
|
+
className,
|
|
31
|
+
}: InlineEditSelectProps) {
|
|
32
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
33
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
34
|
+
const currentLabel = options.find((o) => o.value === value)?.label ?? value;
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!isEditing) return;
|
|
38
|
+
const handleClickOutside = (e: MouseEvent) => {
|
|
39
|
+
if (containerRef.current && !containerRef.current.contains(e.target as Node)) {
|
|
40
|
+
setIsEditing(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
44
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
45
|
+
}, [isEditing]);
|
|
46
|
+
|
|
47
|
+
const handleSelect = useCallback(
|
|
48
|
+
async (newValue: string) => {
|
|
49
|
+
if (newValue === value) {
|
|
50
|
+
setIsEditing(false);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const ok = await onSave(newValue);
|
|
54
|
+
if (ok) setIsEditing(false);
|
|
55
|
+
},
|
|
56
|
+
[value, onSave],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
if (disabled || !isEditing) {
|
|
60
|
+
return (
|
|
61
|
+
<div className={cn("group/inline-edit", className)}>
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
onClick={() => { if (!disabled) setIsEditing(true); }}
|
|
65
|
+
disabled={disabled}
|
|
66
|
+
className={cn(
|
|
67
|
+
"inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors",
|
|
68
|
+
!disabled && "hover:bg-accent-hover cursor-pointer",
|
|
69
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
<span className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs font-medium text-foreground">
|
|
73
|
+
{currentLabel}
|
|
74
|
+
</span>
|
|
75
|
+
{!disabled && (
|
|
76
|
+
<ChevronDownIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
|
|
77
|
+
)}
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div ref={containerRef} className={cn("flex flex-col gap-1", className)}>
|
|
85
|
+
<div className="rounded-lg border border-border bg-background p-1" role="radiogroup">
|
|
86
|
+
{options.map((option) => (
|
|
87
|
+
<button
|
|
88
|
+
key={option.value}
|
|
89
|
+
type="button"
|
|
90
|
+
role="radio"
|
|
91
|
+
aria-checked={option.value === value}
|
|
92
|
+
disabled={isSaving}
|
|
93
|
+
onClick={() => handleSelect(option.value)}
|
|
94
|
+
className={cn(
|
|
95
|
+
"flex w-full items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors",
|
|
96
|
+
option.value === value
|
|
97
|
+
? "bg-muted-subtle text-foreground"
|
|
98
|
+
: "hover:bg-accent-hover text-foreground",
|
|
99
|
+
"disabled:opacity-50",
|
|
100
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<div className={cn(
|
|
104
|
+
"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",
|
|
105
|
+
option.value === value
|
|
106
|
+
? "border-primary bg-primary"
|
|
107
|
+
: "border-muted-foreground",
|
|
108
|
+
)}>
|
|
109
|
+
{option.value === value && (
|
|
110
|
+
<div className="size-1.5 rounded-full bg-primary-foreground" />
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
<div className="min-w-0 flex-1">
|
|
114
|
+
<span className="text-sm font-medium">{option.label}</span>
|
|
115
|
+
{option.description && (
|
|
116
|
+
<p className="mt-0.5 text-xs text-muted-foreground">{option.description}</p>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
{isSaving && option.value !== value && (
|
|
120
|
+
<Spinner />
|
|
121
|
+
)}
|
|
122
|
+
</button>
|
|
123
|
+
))}
|
|
124
|
+
</div>
|
|
125
|
+
{error && (
|
|
126
|
+
<p className="px-1 text-xs text-destructive" role="alert">{error}</p>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// Icons
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
function ChevronDownIcon({ className }: { readonly className?: string }) {
|
|
137
|
+
return (
|
|
138
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
139
|
+
<path d="m4 6 4 4 4-4" />
|
|
140
|
+
</svg>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function Spinner() {
|
|
145
|
+
return (
|
|
146
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
|
|
147
|
+
<path d="M8 2a6 6 0 1 0 6 6" />
|
|
148
|
+
</svg>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { InlineEditBaseProps } from "./types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link InlineEditText}. */
|
|
8
|
+
export interface InlineEditTextProps extends InlineEditBaseProps {
|
|
9
|
+
/** Current field value. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** Called with the new value when the user confirms the edit. */
|
|
12
|
+
readonly onSave: (newValue: string) => Promise<boolean>;
|
|
13
|
+
/** Placeholder shown when value is empty (in both read and edit mode). */
|
|
14
|
+
readonly placeholder?: string;
|
|
15
|
+
/** Optional client-side validation. Return an error string to block save. */
|
|
16
|
+
readonly validate?: (value: string) => string | null;
|
|
17
|
+
/** Render as heading text (larger, bolder). */
|
|
18
|
+
readonly variant?: "default" | "heading";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Click-to-edit single-line text field.
|
|
23
|
+
*
|
|
24
|
+
* Displays the value as styled text. On click, transitions to an input
|
|
25
|
+
* with inline confirm/cancel controls. Confirm triggers `onSave`;
|
|
26
|
+
* cancel reverts. Escape key also cancels.
|
|
27
|
+
*/
|
|
28
|
+
export function InlineEditText({
|
|
29
|
+
value,
|
|
30
|
+
onSave,
|
|
31
|
+
placeholder = "Click to edit",
|
|
32
|
+
validate,
|
|
33
|
+
variant = "default",
|
|
34
|
+
disabled,
|
|
35
|
+
isSaving,
|
|
36
|
+
error,
|
|
37
|
+
className,
|
|
38
|
+
}: InlineEditTextProps) {
|
|
39
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
40
|
+
const [draft, setDraft] = useState(value);
|
|
41
|
+
const [localError, setLocalError] = useState<string | null>(null);
|
|
42
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (isEditing) {
|
|
46
|
+
setDraft(value);
|
|
47
|
+
setLocalError(null);
|
|
48
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
49
|
+
}
|
|
50
|
+
}, [isEditing, value]);
|
|
51
|
+
|
|
52
|
+
const handleConfirm = useCallback(async () => {
|
|
53
|
+
const trimmed = draft.trim();
|
|
54
|
+
if (trimmed === value) {
|
|
55
|
+
setIsEditing(false);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (validate) {
|
|
59
|
+
const err = validate(trimmed);
|
|
60
|
+
if (err) {
|
|
61
|
+
setLocalError(err);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const ok = await onSave(trimmed);
|
|
66
|
+
if (ok) setIsEditing(false);
|
|
67
|
+
}, [draft, value, validate, onSave]);
|
|
68
|
+
|
|
69
|
+
const handleCancel = useCallback(() => {
|
|
70
|
+
setIsEditing(false);
|
|
71
|
+
setDraft(value);
|
|
72
|
+
setLocalError(null);
|
|
73
|
+
}, [value]);
|
|
74
|
+
|
|
75
|
+
const handleKeyDown = useCallback(
|
|
76
|
+
(e: React.KeyboardEvent) => {
|
|
77
|
+
if (e.key === "Enter") {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
handleConfirm();
|
|
80
|
+
} else if (e.key === "Escape") {
|
|
81
|
+
handleCancel();
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
[handleConfirm, handleCancel],
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const displayError = localError || error;
|
|
88
|
+
|
|
89
|
+
if (disabled || !isEditing) {
|
|
90
|
+
return (
|
|
91
|
+
<div className={cn("group/inline-edit", className)}>
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
onClick={() => { if (!disabled) setIsEditing(true); }}
|
|
95
|
+
disabled={disabled}
|
|
96
|
+
className={cn(
|
|
97
|
+
"inline-flex w-full items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors",
|
|
98
|
+
!disabled && "hover:bg-accent-hover cursor-pointer",
|
|
99
|
+
disabled && "cursor-default",
|
|
100
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<span
|
|
104
|
+
className={cn(
|
|
105
|
+
"min-w-0 truncate",
|
|
106
|
+
variant === "heading"
|
|
107
|
+
? "text-lg font-semibold text-foreground"
|
|
108
|
+
: "text-sm text-foreground",
|
|
109
|
+
!value && "text-muted-foreground italic",
|
|
110
|
+
)}
|
|
111
|
+
>
|
|
112
|
+
{value || placeholder}
|
|
113
|
+
</span>
|
|
114
|
+
{!disabled && (
|
|
115
|
+
<PencilIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
|
|
116
|
+
)}
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div className={cn("flex flex-col gap-1", className)}>
|
|
124
|
+
<div className="flex items-center gap-1.5">
|
|
125
|
+
<input
|
|
126
|
+
ref={inputRef}
|
|
127
|
+
type="text"
|
|
128
|
+
value={draft}
|
|
129
|
+
onChange={(e) => { setDraft(e.target.value); setLocalError(null); }}
|
|
130
|
+
onKeyDown={handleKeyDown}
|
|
131
|
+
disabled={isSaving}
|
|
132
|
+
placeholder={placeholder}
|
|
133
|
+
className={cn(
|
|
134
|
+
"flex-1 rounded-md border border-border bg-input-bg px-2 py-1 text-sm text-foreground",
|
|
135
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
136
|
+
"disabled:opacity-50",
|
|
137
|
+
variant === "heading" && "text-lg font-semibold",
|
|
138
|
+
displayError && "border-destructive",
|
|
139
|
+
)}
|
|
140
|
+
/>
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
onClick={handleConfirm}
|
|
144
|
+
disabled={isSaving}
|
|
145
|
+
aria-label="Save"
|
|
146
|
+
className={cn(
|
|
147
|
+
"inline-flex size-7 items-center justify-center rounded-md",
|
|
148
|
+
"bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
149
|
+
"disabled:opacity-50",
|
|
150
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
151
|
+
)}
|
|
152
|
+
>
|
|
153
|
+
{isSaving ? <Spinner /> : <CheckIcon className="size-3.5" />}
|
|
154
|
+
</button>
|
|
155
|
+
<button
|
|
156
|
+
type="button"
|
|
157
|
+
onClick={handleCancel}
|
|
158
|
+
disabled={isSaving}
|
|
159
|
+
aria-label="Cancel"
|
|
160
|
+
className={cn(
|
|
161
|
+
"inline-flex size-7 items-center justify-center rounded-md",
|
|
162
|
+
"border border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
163
|
+
"disabled:opacity-50",
|
|
164
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
165
|
+
)}
|
|
166
|
+
>
|
|
167
|
+
<XIcon className="size-3.5" />
|
|
168
|
+
</button>
|
|
169
|
+
</div>
|
|
170
|
+
{displayError && (
|
|
171
|
+
<p className="px-1 text-xs text-destructive" role="alert">{displayError}</p>
|
|
172
|
+
)}
|
|
173
|
+
</div>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
178
|
+
// Icons
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
|
|
181
|
+
function PencilIcon({ className }: { readonly className?: string }) {
|
|
182
|
+
return (
|
|
183
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
184
|
+
<path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
|
|
185
|
+
</svg>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function CheckIcon({ className }: { readonly className?: string }) {
|
|
190
|
+
return (
|
|
191
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
192
|
+
<path d="m3 8.5 3.5 3.5 6.5-8" />
|
|
193
|
+
</svg>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function XIcon({ className }: { readonly className?: string }) {
|
|
198
|
+
return (
|
|
199
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
200
|
+
<path d="m4 4 8 8M12 4l-8 8" />
|
|
201
|
+
</svg>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function Spinner() {
|
|
206
|
+
return (
|
|
207
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
|
|
208
|
+
<path d="M8 2a6 6 0 1 0 6 6" />
|
|
209
|
+
</svg>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import type { InlineEditBaseProps } from "./types";
|
|
6
|
+
|
|
7
|
+
/** Props for {@link InlineEditTextarea}. */
|
|
8
|
+
export interface InlineEditTextareaProps extends InlineEditBaseProps {
|
|
9
|
+
/** Current field value. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** Called with the new value when the user confirms. */
|
|
12
|
+
readonly onSave: (newValue: string) => Promise<boolean>;
|
|
13
|
+
/** Placeholder shown when value is empty. */
|
|
14
|
+
readonly placeholder?: string;
|
|
15
|
+
/** Optional client-side validation. */
|
|
16
|
+
readonly validate?: (value: string) => string | null;
|
|
17
|
+
/** Minimum rows for the textarea. @default 3 */
|
|
18
|
+
readonly minRows?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Click-to-edit multiline text field.
|
|
23
|
+
*
|
|
24
|
+
* In read mode, renders the value as preformatted text with expand/collapse.
|
|
25
|
+
* On click, opens a textarea with confirm/cancel. Ctrl+Enter confirms.
|
|
26
|
+
*/
|
|
27
|
+
export function InlineEditTextarea({
|
|
28
|
+
value,
|
|
29
|
+
onSave,
|
|
30
|
+
placeholder = "Click to edit",
|
|
31
|
+
validate,
|
|
32
|
+
minRows = 3,
|
|
33
|
+
disabled,
|
|
34
|
+
isSaving,
|
|
35
|
+
error,
|
|
36
|
+
className,
|
|
37
|
+
}: InlineEditTextareaProps) {
|
|
38
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
39
|
+
const [draft, setDraft] = useState(value);
|
|
40
|
+
const [localError, setLocalError] = useState<string | null>(null);
|
|
41
|
+
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (isEditing) {
|
|
45
|
+
setDraft(value);
|
|
46
|
+
setLocalError(null);
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
const ta = textareaRef.current;
|
|
49
|
+
if (ta) {
|
|
50
|
+
ta.focus();
|
|
51
|
+
ta.selectionStart = ta.value.length;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, [isEditing, value]);
|
|
56
|
+
|
|
57
|
+
// Auto-resize textarea
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const ta = textareaRef.current;
|
|
60
|
+
if (!ta) return;
|
|
61
|
+
ta.style.height = "auto";
|
|
62
|
+
ta.style.height = `${ta.scrollHeight}px`;
|
|
63
|
+
}, [draft, isEditing]);
|
|
64
|
+
|
|
65
|
+
const handleConfirm = useCallback(async () => {
|
|
66
|
+
if (draft === value) {
|
|
67
|
+
setIsEditing(false);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (validate) {
|
|
71
|
+
const err = validate(draft);
|
|
72
|
+
if (err) {
|
|
73
|
+
setLocalError(err);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const ok = await onSave(draft);
|
|
78
|
+
if (ok) setIsEditing(false);
|
|
79
|
+
}, [draft, value, validate, onSave]);
|
|
80
|
+
|
|
81
|
+
const handleCancel = useCallback(() => {
|
|
82
|
+
setIsEditing(false);
|
|
83
|
+
setDraft(value);
|
|
84
|
+
setLocalError(null);
|
|
85
|
+
}, [value]);
|
|
86
|
+
|
|
87
|
+
const handleKeyDown = useCallback(
|
|
88
|
+
(e: React.KeyboardEvent) => {
|
|
89
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
handleConfirm();
|
|
92
|
+
} else if (e.key === "Escape") {
|
|
93
|
+
handleCancel();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
[handleConfirm, handleCancel],
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const displayError = localError || error;
|
|
100
|
+
|
|
101
|
+
if (disabled || !isEditing) {
|
|
102
|
+
return (
|
|
103
|
+
<div className={cn("group/inline-edit", className)}>
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
onClick={() => { if (!disabled) setIsEditing(true); }}
|
|
107
|
+
disabled={disabled}
|
|
108
|
+
className={cn(
|
|
109
|
+
"w-full rounded-md px-2 py-1.5 text-left transition-colors",
|
|
110
|
+
!disabled && "hover:bg-accent-hover cursor-pointer",
|
|
111
|
+
disabled && "cursor-default",
|
|
112
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
113
|
+
)}
|
|
114
|
+
>
|
|
115
|
+
<div className="flex items-start justify-between gap-2">
|
|
116
|
+
<pre
|
|
117
|
+
className={cn(
|
|
118
|
+
"min-w-0 whitespace-pre-wrap break-words font-mono text-sm text-foreground",
|
|
119
|
+
!value && "text-muted-foreground italic font-sans",
|
|
120
|
+
)}
|
|
121
|
+
>
|
|
122
|
+
{value || placeholder}
|
|
123
|
+
</pre>
|
|
124
|
+
{!disabled && (
|
|
125
|
+
<PencilIcon className="mt-0.5 size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
</button>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<div className={cn("flex flex-col gap-1.5", className)}>
|
|
135
|
+
<textarea
|
|
136
|
+
ref={textareaRef}
|
|
137
|
+
value={draft}
|
|
138
|
+
onChange={(e) => { setDraft(e.target.value); setLocalError(null); }}
|
|
139
|
+
onKeyDown={handleKeyDown}
|
|
140
|
+
disabled={isSaving}
|
|
141
|
+
placeholder={placeholder}
|
|
142
|
+
rows={minRows}
|
|
143
|
+
className={cn(
|
|
144
|
+
"w-full resize-y rounded-md border border-border bg-input-bg px-3 py-2 font-mono text-sm text-foreground",
|
|
145
|
+
"focus:outline-none focus:ring-2 focus:ring-ring",
|
|
146
|
+
"disabled:opacity-50",
|
|
147
|
+
displayError && "border-destructive",
|
|
148
|
+
)}
|
|
149
|
+
/>
|
|
150
|
+
<div className="flex items-center justify-between">
|
|
151
|
+
<span className="text-[10px] text-muted-foreground">
|
|
152
|
+
{isSaving ? "Saving..." : "Ctrl+Enter to save, Escape to cancel"}
|
|
153
|
+
</span>
|
|
154
|
+
<div className="flex items-center gap-1.5">
|
|
155
|
+
<button
|
|
156
|
+
type="button"
|
|
157
|
+
onClick={handleCancel}
|
|
158
|
+
disabled={isSaving}
|
|
159
|
+
className={cn(
|
|
160
|
+
"rounded-md px-2.5 py-1 text-xs font-medium",
|
|
161
|
+
"border border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
162
|
+
"disabled:opacity-50",
|
|
163
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
164
|
+
)}
|
|
165
|
+
>
|
|
166
|
+
Cancel
|
|
167
|
+
</button>
|
|
168
|
+
<button
|
|
169
|
+
type="button"
|
|
170
|
+
onClick={handleConfirm}
|
|
171
|
+
disabled={isSaving}
|
|
172
|
+
className={cn(
|
|
173
|
+
"inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium",
|
|
174
|
+
"bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
175
|
+
"disabled:opacity-50",
|
|
176
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
177
|
+
)}
|
|
178
|
+
>
|
|
179
|
+
{isSaving && <Spinner />}
|
|
180
|
+
Save
|
|
181
|
+
</button>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
{displayError && (
|
|
185
|
+
<p className="px-1 text-xs text-destructive" role="alert">{displayError}</p>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
// Icons
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
function PencilIcon({ className }: { readonly className?: string }) {
|
|
196
|
+
return (
|
|
197
|
+
<svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
198
|
+
<path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
|
|
199
|
+
</svg>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function Spinner() {
|
|
204
|
+
return (
|
|
205
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
|
|
206
|
+
<path d="M8 2a6 6 0 1 0 6 6" />
|
|
207
|
+
</svg>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { InlineEditText } from "./InlineEditText";
|
|
2
|
+
export type { InlineEditTextProps } from "./InlineEditText";
|
|
3
|
+
|
|
4
|
+
export { InlineEditTextarea } from "./InlineEditTextarea";
|
|
5
|
+
export type { InlineEditTextareaProps } from "./InlineEditTextarea";
|
|
6
|
+
|
|
7
|
+
export { InlineEditImage } from "./InlineEditImage";
|
|
8
|
+
export type { InlineEditImageProps } from "./InlineEditImage";
|
|
9
|
+
|
|
10
|
+
export { InlineEditSelect } from "./InlineEditSelect";
|
|
11
|
+
export type { InlineEditSelectProps } from "./InlineEditSelect";
|
|
12
|
+
|
|
13
|
+
export { InlineEditKeyValue } from "./InlineEditKeyValue";
|
|
14
|
+
export type { InlineEditKeyValueProps } from "./InlineEditKeyValue";
|
|
15
|
+
|
|
16
|
+
export { InlineEditResourceList } from "./InlineEditResourceList";
|
|
17
|
+
export type { InlineEditResourceListProps } from "./InlineEditResourceList";
|
|
18
|
+
|
|
19
|
+
export { useInlineFieldSave } from "./useInlineFieldSave";
|
|
20
|
+
export type { UseInlineFieldSaveReturn } from "./useInlineFieldSave";
|
|
21
|
+
|
|
22
|
+
export type {
|
|
23
|
+
InlineEditBaseProps,
|
|
24
|
+
KeyValueRow,
|
|
25
|
+
ResourceRefRow,
|
|
26
|
+
SelectOption,
|
|
27
|
+
InlineFieldSaveResult,
|
|
28
|
+
} from "./types";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/** Shared props for all inline edit components. */
|
|
4
|
+
export interface InlineEditBaseProps {
|
|
5
|
+
/** Whether editing is disabled (component renders as read-only). */
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
/** `true` while a save operation is in flight. */
|
|
8
|
+
readonly isSaving?: boolean;
|
|
9
|
+
/** Error from the last failed save. Shown inline below the field. */
|
|
10
|
+
readonly error?: string | null;
|
|
11
|
+
/** Additional CSS classes for the root container. */
|
|
12
|
+
readonly className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Entry in an inline key-value editor. */
|
|
16
|
+
export interface KeyValueRow {
|
|
17
|
+
readonly key: string;
|
|
18
|
+
readonly value: string;
|
|
19
|
+
/** When `true`, renders a "secret" badge. */
|
|
20
|
+
readonly isSecret?: boolean;
|
|
21
|
+
/** Optional description shown as helper text. */
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
/** When `true`, this row is optional. */
|
|
24
|
+
readonly optional?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Entry in an inline resource reference list (MCP servers, skills, etc.). */
|
|
28
|
+
export interface ResourceRefRow {
|
|
29
|
+
readonly org: string;
|
|
30
|
+
readonly slug: string;
|
|
31
|
+
/** Display label (defaults to slug when omitted). */
|
|
32
|
+
readonly label?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Single option for InlineEditSelect. */
|
|
36
|
+
export interface SelectOption {
|
|
37
|
+
readonly value: string;
|
|
38
|
+
readonly label: string;
|
|
39
|
+
readonly description?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Save result returned to the inline component after a field save. */
|
|
43
|
+
export interface InlineFieldSaveResult<T = unknown> {
|
|
44
|
+
readonly success: boolean;
|
|
45
|
+
readonly data?: T;
|
|
46
|
+
readonly error?: string;
|
|
47
|
+
}
|