@stigmer/react 0.4.8 → 0.5.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/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/composer/ContextChip.d.ts +7 -2
- package/composer/ContextChip.d.ts.map +1 -1
- package/composer/ContextChip.js +2 -1
- package/composer/ContextChip.js.map +1 -1
- package/composer/SessionComposer.d.ts +11 -0
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +33 -4
- package/composer/SessionComposer.js.map +1 -1
- 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/environment/usePersonalEnvironment.d.ts.map +1 -1
- package/environment/usePersonalEnvironment.js +1 -0
- package/environment/usePersonalEnvironment.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 +32 -12
- package/index.d.ts.map +1 -1
- package/index.js +30 -10
- 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 +33 -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/internal/useFetch.js +2 -2
- package/internal/useFetch.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 +235 -43
- 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/ModelRegistryContext.d.ts +2 -0
- package/models/ModelRegistryContext.d.ts.map +1 -1
- package/models/ModelRegistryContext.js +1 -0
- package/models/ModelRegistryContext.js.map +1 -1
- package/models/ModelSelector.d.ts.map +1 -1
- package/models/ModelSelector.js +2 -2
- package/models/ModelSelector.js.map +1 -1
- package/models/__tests__/useModelRegistry.test.js +4 -3
- package/models/__tests__/useModelRegistry.test.js.map +1 -1
- package/models/useModelRegistry.d.ts +2 -0
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +3 -2
- package/models/useModelRegistry.js.map +1 -1
- package/package.json +8 -4
- package/provider.d.ts.map +1 -1
- package/provider.js +69 -22
- 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/session/__tests__/session-spec-converters.test.d.ts +2 -0
- package/session/__tests__/session-spec-converters.test.d.ts.map +1 -0
- package/session/__tests__/session-spec-converters.test.js +162 -0
- package/session/__tests__/session-spec-converters.test.js.map +1 -0
- package/session/__tests__/useNewSessionFlow.test.js +2 -2
- package/session/__tests__/useNewSessionFlow.test.js.map +1 -1
- package/session/__tests__/usePersistedModel.test.js +1 -1
- package/session/__tests__/usePersistedModel.test.js.map +1 -1
- package/session/group-sessions.d.ts +17 -0
- package/session/group-sessions.d.ts.map +1 -1
- package/session/group-sessions.js +46 -0
- package/session/group-sessions.js.map +1 -1
- package/session/index.d.ts +4 -2
- package/session/index.d.ts.map +1 -1
- package/session/index.js +2 -1
- package/session/index.js.map +1 -1
- package/session/session-spec-converters.d.ts +24 -0
- package/session/session-spec-converters.d.ts.map +1 -0
- package/session/session-spec-converters.js +72 -0
- package/session/session-spec-converters.js.map +1 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +1 -56
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +5 -0
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +20 -6
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionSearch.d.ts +57 -0
- package/session/useSessionSearch.d.ts.map +1 -0
- package/session/useSessionSearch.js +94 -0
- package/session/useSessionSearch.js.map +1 -0
- 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/composer/ContextChip.tsx +20 -11
- package/src/composer/SessionComposer.tsx +52 -3
- 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/environment/usePersonalEnvironment.ts +1 -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 +275 -8
- package/src/inline-edit/InlineEditImage.tsx +208 -0
- package/src/inline-edit/InlineEditKeyValue.tsx +301 -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/internal/useFetch.ts +2 -2
- 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 +816 -155
- 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/ModelRegistryContext.ts +3 -0
- package/src/models/ModelSelector.tsx +25 -2
- package/src/models/__tests__/useModelRegistry.test.tsx +5 -3
- package/src/models/useModelRegistry.ts +5 -2
- package/src/provider.tsx +69 -18
- 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/session/__tests__/session-spec-converters.test.ts +185 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +2 -2
- package/src/session/__tests__/usePersistedModel.test.tsx +1 -1
- package/src/session/group-sessions.ts +65 -0
- package/src/session/index.ts +8 -2
- package/src/session/session-spec-converters.ts +86 -0
- package/src/session/useSessionConversation.ts +5 -64
- package/src/session/useSessionPageFlow.ts +28 -7
- package/src/session/useSessionSearch.ts +149 -0
- 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,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
/**
|
|
5
|
+
* Displays active filters as removable chips with a "Clear all" action.
|
|
6
|
+
*
|
|
7
|
+
* The filter bar is a lightweight presentation component — filter state
|
|
8
|
+
* and mutation logic live in {@link useResourceFilters}. The parent
|
|
9
|
+
* `ResourceWorkbench` wires them together.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <FilterBar
|
|
14
|
+
* filters={filtersHook.filters}
|
|
15
|
+
* filterDefs={agentFilterDefs}
|
|
16
|
+
* onRemoveFilter={filtersHook.removeFilter}
|
|
17
|
+
* onClearAll={filtersHook.clearFilters}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function FilterBar({ filters, filterDefs, onRemoveFilter, onClearAll, className, }) {
|
|
22
|
+
if (filters.length === 0)
|
|
23
|
+
return null;
|
|
24
|
+
const defMap = new Map(filterDefs.map((d) => [d.id, d]));
|
|
25
|
+
return (_jsxs("div", { role: "toolbar", "aria-label": "Active filters", className: cn("flex flex-wrap items-center gap-1.5", className), children: [filters.map((filter) => {
|
|
26
|
+
const def = defMap.get(filter.filterId);
|
|
27
|
+
const label = def?.label ?? filter.filterId;
|
|
28
|
+
const displayValue = formatFilterValue(filter, def);
|
|
29
|
+
return (_jsx(FilterChip, { label: label, value: displayValue, onRemove: () => onRemoveFilter(filter.filterId) }, `${filter.filterId}:${filter.operator}`));
|
|
30
|
+
}), filters.length > 1 && (_jsx("button", { type: "button", onClick: onClearAll, className: cn("text-xs text-muted-foreground transition-colors", "hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm"), children: "Clear all" }))] }));
|
|
31
|
+
}
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Internal: Filter chip
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
function FilterChip({ label, value, onRemove, }) {
|
|
36
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs text-muted-foreground"), children: [_jsxs("span", { className: "font-medium", children: [label, ":"] }), _jsx("span", { children: value }), _jsx("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${label} filter`, className: cn("ml-0.5 inline-flex items-center justify-center rounded-sm p-0.5", "text-muted-foreground-subtle hover:text-foreground hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: _jsx(XIcon, {}) })] }));
|
|
37
|
+
}
|
|
38
|
+
function formatFilterValue(filter, def) {
|
|
39
|
+
const { value, operator } = filter;
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
// For multi-select, try to resolve option labels.
|
|
42
|
+
if (def?.options) {
|
|
43
|
+
const optMap = new Map(def.options.map((o) => [o.value, o.label]));
|
|
44
|
+
return value.map((v) => optMap.get(v) ?? v).join(", ");
|
|
45
|
+
}
|
|
46
|
+
return value.join(", ");
|
|
47
|
+
}
|
|
48
|
+
// For select with options, resolve the label.
|
|
49
|
+
if (def?.options) {
|
|
50
|
+
const opt = def.options.find((o) => o.value === value);
|
|
51
|
+
if (opt)
|
|
52
|
+
return opt.label;
|
|
53
|
+
}
|
|
54
|
+
const prefix = operator === "gt"
|
|
55
|
+
? "> "
|
|
56
|
+
: operator === "lt"
|
|
57
|
+
? "< "
|
|
58
|
+
: operator === "gte"
|
|
59
|
+
? ">= "
|
|
60
|
+
: operator === "lte"
|
|
61
|
+
? "<= "
|
|
62
|
+
: operator === "neq"
|
|
63
|
+
? "not "
|
|
64
|
+
: operator === "contains"
|
|
65
|
+
? "~ "
|
|
66
|
+
: "";
|
|
67
|
+
return `${prefix}${value}`;
|
|
68
|
+
}
|
|
69
|
+
function XIcon() {
|
|
70
|
+
return (_jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M2.5 2.5l5 5M7.5 2.5l-5 5" }) }));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=FilterBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../../src/resource-workbench/components/FilterBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAiBpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,OAAO,EACP,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,GACM;IACf,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzD,OAAO,CACL,eACE,IAAI,EAAC,SAAS,gBACH,gBAAgB,EAC3B,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,aAE9D,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACtB,MAAM,GAAG,GAA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C;AAC7B,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,iBACT,MAAM,YAElB,eAAM,CAAC,EAAC,2BAA2B,GAAG,GAClC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Props for {@link ResourceAvatar}. */
|
|
2
|
+
export interface ResourceAvatarProps {
|
|
3
|
+
/** Display name used for the initial fallback. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** Slug used to derive a deterministic background color. */
|
|
6
|
+
readonly slug: string;
|
|
7
|
+
/** Icon URL from the resource's spec. Empty string means no icon. */
|
|
8
|
+
readonly iconUrl?: string;
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, renders nothing — no image, no initial avatar.
|
|
11
|
+
* Used for resource types like skills that don't support icons.
|
|
12
|
+
*/
|
|
13
|
+
readonly hidden?: boolean;
|
|
14
|
+
/** Size variant. @default "md" */
|
|
15
|
+
readonly size?: "sm" | "md";
|
|
16
|
+
/** Additional CSS classes. */
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Compact resource avatar for cards, rows, and detail headers.
|
|
21
|
+
*
|
|
22
|
+
* Renders one of three states:
|
|
23
|
+
* 1. **Image** — when `iconUrl` is a non-empty string
|
|
24
|
+
* 2. **Initial** — colored circle with the first letter of `name`,
|
|
25
|
+
* deterministic color derived from `slug`
|
|
26
|
+
* 3. **Hidden** — nothing (for resource types that don't support icons)
|
|
27
|
+
*/
|
|
28
|
+
export declare function ResourceAvatar({ name, slug, iconUrl, hidden, size, className, }: ResourceAvatarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=ResourceAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceAvatar.d.ts","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceAvatar.tsx"],"names":[],"mappings":"AAIA,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAW,EACX,SAAS,GACV,EAAE,mBAAmB,kDAuCrB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
const AVATAR_COLORS = [
|
|
5
|
+
"bg-[#6366f1]",
|
|
6
|
+
"bg-[#8b5cf6]",
|
|
7
|
+
"bg-[#a855f7]",
|
|
8
|
+
"bg-[#d946ef]",
|
|
9
|
+
"bg-[#ec4899]",
|
|
10
|
+
"bg-[#f43f5e]",
|
|
11
|
+
"bg-[#ef4444]",
|
|
12
|
+
"bg-[#f97316]",
|
|
13
|
+
"bg-[#eab308]",
|
|
14
|
+
"bg-[#22c55e]",
|
|
15
|
+
"bg-[#14b8a6]",
|
|
16
|
+
"bg-[#06b6d4]",
|
|
17
|
+
"bg-[#3b82f6]",
|
|
18
|
+
"bg-[#2563eb]",
|
|
19
|
+
];
|
|
20
|
+
function hashSlug(slug) {
|
|
21
|
+
let h = 0;
|
|
22
|
+
for (let i = 0; i < slug.length; i++) {
|
|
23
|
+
h = ((h << 5) - h + slug.charCodeAt(i)) | 0;
|
|
24
|
+
}
|
|
25
|
+
return Math.abs(h);
|
|
26
|
+
}
|
|
27
|
+
const SIZE_CLASSES = {
|
|
28
|
+
sm: "size-6 text-[10px]",
|
|
29
|
+
md: "size-8 text-xs",
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Compact resource avatar for cards, rows, and detail headers.
|
|
33
|
+
*
|
|
34
|
+
* Renders one of three states:
|
|
35
|
+
* 1. **Image** — when `iconUrl` is a non-empty string
|
|
36
|
+
* 2. **Initial** — colored circle with the first letter of `name`,
|
|
37
|
+
* deterministic color derived from `slug`
|
|
38
|
+
* 3. **Hidden** — nothing (for resource types that don't support icons)
|
|
39
|
+
*/
|
|
40
|
+
export function ResourceAvatar({ name, slug, iconUrl, hidden, size = "md", className, }) {
|
|
41
|
+
if (hidden)
|
|
42
|
+
return null;
|
|
43
|
+
const sizeClass = SIZE_CLASSES[size];
|
|
44
|
+
if (iconUrl) {
|
|
45
|
+
return (_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center rounded-full bg-muted", sizeClass, className), children: _jsx("img", { src: iconUrl, alt: "", className: "size-4/5 object-contain" }) }));
|
|
46
|
+
}
|
|
47
|
+
const initial = (name || slug).charAt(0).toUpperCase();
|
|
48
|
+
const colorClass = AVATAR_COLORS[hashSlug(slug) % AVATAR_COLORS.length];
|
|
49
|
+
return (_jsx("span", { "aria-hidden": "true", className: cn("inline-flex shrink-0 items-center justify-center rounded-full font-medium text-white", sizeClass, colorClass, className), children: initial }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=ResourceAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceAvatar.js","sourceRoot":"","sources":["../../../src/resource-workb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,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACvD,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAExE,OAAO,CACL,8BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CACX,sFAAsF,EACtF,SAAS,EACT,UAAU,EACV,SAAS,CACV,YAEA,OAAO,GACH,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Props for {@link ResourceCards}. */
|
|
3
|
+
export interface ResourceCardsProps<TData> {
|
|
4
|
+
/** Items to render as cards. */
|
|
5
|
+
readonly items: readonly TData[];
|
|
6
|
+
/** Render function for each card's content. */
|
|
7
|
+
readonly renderCard: (item: TData, index: number) => ReactNode;
|
|
8
|
+
/** Whether selection checkboxes are shown on cards. */
|
|
9
|
+
readonly enableSelection?: boolean;
|
|
10
|
+
/** Set of selected item IDs. */
|
|
11
|
+
readonly selectedIds?: ReadonlySet<string>;
|
|
12
|
+
/** Called when an item's selection state is toggled. */
|
|
13
|
+
readonly onToggleSelection?: (id: string) => void;
|
|
14
|
+
/** Extracts a stable unique ID from an item. */
|
|
15
|
+
readonly getItemId?: (item: TData) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Render function for per-card actions (e.g. an `ActionMenu`).
|
|
18
|
+
* Shown in the top-right corner of the card.
|
|
19
|
+
*/
|
|
20
|
+
readonly renderCardAction?: (item: TData) => ReactNode;
|
|
21
|
+
/** Called when a card is clicked (not when a control inside is clicked). */
|
|
22
|
+
readonly onCardClick?: (item: TData) => void;
|
|
23
|
+
/** Accessible label for the card grid region. @default "Resource cards" */
|
|
24
|
+
readonly "aria-label"?: string;
|
|
25
|
+
/** Additional CSS classes for the grid container. */
|
|
26
|
+
readonly className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Card grid view for the resource workbench.
|
|
30
|
+
*
|
|
31
|
+
* Renders items as a responsive grid of cards. Each card supports an
|
|
32
|
+
* optional selection checkbox, an action slot, and click handling.
|
|
33
|
+
* Card content is fully customizable via the `renderCard` prop.
|
|
34
|
+
*
|
|
35
|
+
* This component renders **only the card grid**. Search, filters, and
|
|
36
|
+
* pagination are handled by the parent `ResourceWorkbench`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ResourceCards<TData>({ items, renderCard, enableSelection, selectedIds, onToggleSelection, getItemId, renderCardAction, onCardClick, "aria-label": ariaLabel, className, }: ResourceCardsProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=ResourceCards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceCards.d.ts","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceCards.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,uCAAuC;AACvC,MAAM,WAAW,kBAAkB,CAAC,KAAK;IACvC,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC/D,uDAAuD;IACvD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,gCAAgC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,wDAAwD;IACxD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC;IACvD,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,EACnC,KAAK,EACL,UAAU,EACV,eAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,SAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,YAAY,EAAE,SAA4B,EAC1C,SAAS,GACV,EAAE,kBAAkB,CAAC,KAAK,CAAC,2CAgE3B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { SelectionCheckbox } from "./SelectionCheckbox";
|
|
5
|
+
/**
|
|
6
|
+
* Card grid view for the resource workbench.
|
|
7
|
+
*
|
|
8
|
+
* Renders items as a responsive grid of cards. Each card supports an
|
|
9
|
+
* optional selection checkbox, an action slot, and click handling.
|
|
10
|
+
* Card content is fully customizable via the `renderCard` prop.
|
|
11
|
+
*
|
|
12
|
+
* This component renders **only the card grid**. Search, filters, and
|
|
13
|
+
* pagination are handled by the parent `ResourceWorkbench`.
|
|
14
|
+
*/
|
|
15
|
+
export function ResourceCards({ items, renderCard, enableSelection = false, selectedIds, onToggleSelection, getItemId = defaultGetId, renderCardAction, onCardClick, "aria-label": ariaLabel = "Resource cards", className, }) {
|
|
16
|
+
return (_jsx("div", { role: "list", "aria-label": ariaLabel, className: cn("grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", className), children: items.map((item, index) => {
|
|
17
|
+
const id = getItemId(item);
|
|
18
|
+
const isSelected = selectedIds?.has(id) ?? false;
|
|
19
|
+
const isClickable = !!onCardClick;
|
|
20
|
+
return (_jsxs("div", { role: "listitem", "aria-selected": enableSelection ? isSelected : undefined, onClick: isClickable
|
|
21
|
+
? (e) => {
|
|
22
|
+
const target = e.target;
|
|
23
|
+
if (target.closest("button") ||
|
|
24
|
+
target.closest("input") ||
|
|
25
|
+
target.closest("[role='menu']")) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
onCardClick(item);
|
|
29
|
+
}
|
|
30
|
+
: undefined, className: cn("relative flex rounded-lg border border-border bg-card p-4 transition-colors", isSelected && "border-primary/40 bg-primary-subtle", isClickable && "cursor-pointer hover:border-primary/40 hover:bg-accent-hover", isClickable && "focus-within:ring-2 focus-within:ring-ring"), children: [enableSelection && onToggleSelection && (_jsx("div", { className: "absolute left-2 top-2", children: _jsx(SelectionCheckbox, { checked: isSelected, onChange: () => onToggleSelection(id), "aria-label": `Select item ${id}` }) })), _jsx("div", { className: cn("min-w-0 flex-1", enableSelection && "pl-5"), children: renderCard(item, index) }), renderCardAction && (_jsx("div", { className: "ml-2 shrink-0", onClick: (e) => e.stopPropagation(), children: renderCardAction(item) }))] }, id || `card-${index}`));
|
|
31
|
+
}) }));
|
|
32
|
+
}
|
|
33
|
+
function defaultGetId(item) {
|
|
34
|
+
const r = item;
|
|
35
|
+
if (typeof r.id === "string")
|
|
36
|
+
return r.id;
|
|
37
|
+
if (typeof r.slug === "string")
|
|
38
|
+
return r.slug;
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ResourceCards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceCards.js","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceCards.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,g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C,CAC5D,aAEA,eAAe,IAAI,iBAAiB,IAAI,CACvC,cAAK,SAAS,EAAC,uBAAuB,YACpC,KAAC,iBAAiB,IAChB,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,gBACzB,eAAe,EAAE,EAAE,GAC/B,GACE,CACP,EACD,cAAK,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,eAAe,IAAI,MAAM,CAAC,YAC5D,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,GACpB,EACL,gBAAgB,IAAI,CACnB,cAAK,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAC/D,gBAAgB,CAAC,IAAI,CAAC,GACnB,CACP,KAzCI,EAAE,IAAI,QAAQ,KAAK,EAAE,CA0CtB,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAQ,IAAW;IACtC,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC9C,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Props for {@link ResourceInspector}. */
|
|
3
|
+
export interface ResourceInspectorProps {
|
|
4
|
+
/** Whether the inspector panel is currently visible. */
|
|
5
|
+
readonly open: boolean;
|
|
6
|
+
/** Called when the user closes the inspector (e.g. via the close button). */
|
|
7
|
+
readonly onClose: () => void;
|
|
8
|
+
/** The content to render inside the inspector panel. */
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
/** Accessible label for the panel. @default "Resource inspector" */
|
|
11
|
+
readonly "aria-label"?: string;
|
|
12
|
+
/** Additional CSS classes for the panel. */
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Split-panel inspector that appears to the right of the workbench
|
|
17
|
+
* content area, providing a preview of the focused resource without
|
|
18
|
+
* navigating away from the list.
|
|
19
|
+
*
|
|
20
|
+
* The inspector is a purely presentational shell — what renders inside
|
|
21
|
+
* it is determined by the consumer via the `children` prop. The parent
|
|
22
|
+
* `ResourceWorkbench` manages open/close state and passes the focused
|
|
23
|
+
* item's detail view.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ResourceInspector({ open, onClose, children, "aria-label": ariaLabel, className, }: ResourceInspectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
//# sourceMappingURL=ResourceInspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceInspector.d.ts","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceInspector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,YAAY,EAAE,SAAgC,EAC9C,SAAS,GACV,EAAE,sBAAsB,kDAmCxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
/**
|
|
5
|
+
* Split-panel inspector that appears to the right of the workbench
|
|
6
|
+
* content area, providing a preview of the focused resource without
|
|
7
|
+
* navigating away from the list.
|
|
8
|
+
*
|
|
9
|
+
* The inspector is a purely presentational shell — what renders inside
|
|
10
|
+
* it is determined by the consumer via the `children` prop. The parent
|
|
11
|
+
* `ResourceWorkbench` manages open/close state and passes the focused
|
|
12
|
+
* item's detail view.
|
|
13
|
+
*/
|
|
14
|
+
export function ResourceInspector({ open, onClose, children, "aria-label": ariaLabel = "Resource inspector", className, }) {
|
|
15
|
+
if (!open)
|
|
16
|
+
return null;
|
|
17
|
+
return (_jsxs("aside", { role: "complementary", "aria-label": ariaLabel, className: cn("flex w-80 shrink-0 flex-col border-l border-border bg-card", "lg:w-96", className), children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Preview" }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close inspector", className: cn("inline-flex items-center justify-center rounded-sm p-1", "text-muted-foreground hover:text-foreground hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: _jsx(CloseIcon, {}) })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4", children: children })] }));
|
|
18
|
+
}
|
|
19
|
+
function CloseIcon() {
|
|
20
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ResourceInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceInspector.js","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceInspector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAgBpC;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,YAAY,EAAE,SAAS,GAAG,oBAAoB,EAC9C,SAAS,GACc;IACvB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,CACL,iBACE,IAAI,EAAC,eAAe,gBACR,SAAS,EACrB,SAAS,EAAE,EAAE,CACX,4DAA4D,EAC5D,SAAS,EACT,SAAS,CACV,aAED,eAAK,SAAS,EAAC,oEAAoE,aACjF,eAAM,SAAS,EAAC,2CAA2C,wBAEpD,EACP,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACL,iBAAiB,EAC5B,SAAS,EAAE,EAAE,CACX,wDAAwD,EACxD,mEAAmE,EACnE,yEAAyE,CAC1E,YAED,KAAC,SAAS,KAAG,GACN,IACL,EACN,cAAK,SAAS,EAAC,4BAA4B,YACxC,QAAQ,GACL,IACA,CACT,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,iBACT,MAAM,YAElB,eAAM,CAAC,EAAC,4BAA4B,GAAG,GACnC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Props for {@link ResourceList}. */
|
|
3
|
+
export interface ResourceListProps<TData> {
|
|
4
|
+
/** Items to render as compact list rows. */
|
|
5
|
+
readonly items: readonly TData[];
|
|
6
|
+
/** Render function for each row's content. */
|
|
7
|
+
readonly renderRow: (item: TData, index: number) => ReactNode;
|
|
8
|
+
/** Whether selection checkboxes are shown on rows. */
|
|
9
|
+
readonly enableSelection?: boolean;
|
|
10
|
+
/** Set of selected item IDs. */
|
|
11
|
+
readonly selectedIds?: ReadonlySet<string>;
|
|
12
|
+
/** Called when an item's selection state is toggled. */
|
|
13
|
+
readonly onToggleSelection?: (id: string) => void;
|
|
14
|
+
/** Extracts a stable unique ID from an item. */
|
|
15
|
+
readonly getItemId?: (item: TData) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Render function for per-row actions (e.g. an `ActionMenu`).
|
|
18
|
+
* Shown at the end of the row.
|
|
19
|
+
*/
|
|
20
|
+
readonly renderRowAction?: (item: TData) => ReactNode;
|
|
21
|
+
/** Called when a row is clicked (not when a control inside is clicked). */
|
|
22
|
+
readonly onRowClick?: (item: TData) => void;
|
|
23
|
+
/** Accessible label for the list region. @default "Resource list" */
|
|
24
|
+
readonly "aria-label"?: string;
|
|
25
|
+
/** Additional CSS classes for the list container. */
|
|
26
|
+
readonly className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compact list view for the resource workbench.
|
|
30
|
+
*
|
|
31
|
+
* Renders items as a single-column vertical list of rows. Each row
|
|
32
|
+
* supports selection, an action slot, and click handling. Row content
|
|
33
|
+
* is customizable via the `renderRow` prop.
|
|
34
|
+
*
|
|
35
|
+
* This component renders **only the list**. Search, filters, and
|
|
36
|
+
* pagination are handled by the parent `ResourceWorkbench`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ResourceList<TData>({ items, renderRow, enableSelection, selectedIds, onToggleSelection, getItemId, renderRowAction, onRowClick, "aria-label": ariaLabel, className, }: ResourceListProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=ResourceList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceList.d.ts","sourceR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AAC,2CA2D1B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { SelectionCheckbox } from "./SelectionCheckbox";
|
|
5
|
+
/**
|
|
6
|
+
* Compact list view for the resource workbench.
|
|
7
|
+
*
|
|
8
|
+
* Renders items as a single-column vertical list of rows. Each row
|
|
9
|
+
* supports selection, an action slot, and click handling. Row content
|
|
10
|
+
* is customizable via the `renderRow` prop.
|
|
11
|
+
*
|
|
12
|
+
* This component renders **only the list**. Search, filters, and
|
|
13
|
+
* pagination are handled by the parent `ResourceWorkbench`.
|
|
14
|
+
*/
|
|
15
|
+
export function ResourceList({ items, renderRow, enableSelection = false, selectedIds, onToggleSelection, getItemId = defaultGetId, renderRowAction, onRowClick, "aria-label": ariaLabel = "Resource list", className, }) {
|
|
16
|
+
return (_jsx("div", { role: "list", "aria-label": ariaLabel, className: cn("flex flex-col", className), children: items.map((item, index) => {
|
|
17
|
+
const id = getItemId(item);
|
|
18
|
+
const isSelected = selectedIds?.has(id) ?? false;
|
|
19
|
+
const isClickable = !!onRowClick;
|
|
20
|
+
return (_jsxs("div", { role: "listitem", "aria-selected": enableSelection ? isSelected : undefined, onClick: isClickable
|
|
21
|
+
? (e) => {
|
|
22
|
+
const target = e.target;
|
|
23
|
+
if (target.closest("button") ||
|
|
24
|
+
target.closest("input") ||
|
|
25
|
+
target.closest("[role='menu']")) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
onRowClick(item);
|
|
29
|
+
}
|
|
30
|
+
: undefined, className: cn("flex items-center gap-3 rounded-lg px-3 py-2.5 transition-colors", isSelected && "bg-primary-subtle", isClickable && "cursor-pointer hover:bg-accent-hover", isClickable && "focus-within:ring-2 focus-within:ring-inset focus-within:ring-ring"), children: [enableSelection && onToggleSelection && (_jsx(SelectionCheckbox, { checked: isSelected, onChange: () => onToggleSelection(id), "aria-label": `Select item ${id}` })), _jsx("div", { className: "min-w-0 flex-1", children: renderRow(item, index) }), renderRowAction && (_jsx("div", { className: "ml-auto shrink-0", onClick: (e) => e.stopPropagation(), children: renderRowAction(item) }))] }, id || `row-${index}`));
|
|
31
|
+
}) }));
|
|
32
|
+
}
|
|
33
|
+
function defaultGetId(item) {
|
|
34
|
+
const r = item;
|
|
35
|
+
if (typeof r.id === "string")
|
|
36
|
+
return r.id;
|
|
37
|
+
if (typeof r.slug === "string")
|
|
38
|
+
return r.slug;
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ResourceList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceList.js","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA6BxD;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAQ,EAClC,KAAK,EACL,SAAS,EACT,eAAe,GAAG,KAAK,EACvB,WAAW,EACX,iBAAiB,EACjB,SAAS,GAAG,YAAY,EACxB,eAAe,EACf,UAAU,EACV,YAAY,EAAE,SAAS,GAAG,eAAe,EACzC,SAAS,GACgB;IACzB,OAAO,CACL,cACE,IAAI,EAAC,MAAM,gBACC,SAAS,EACrB,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,YAExC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACzB,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC3B,MAAM,UAAU,GAAG,WAAW,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;YACjD,MAAM,WAAW,GAAG,CAAC,CAAC,UAAU,CAAC;YAEjC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O,CAAC,CAAC,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC9C,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type Table } from "@tanstack/react-table";
|
|
3
|
+
/** Props for {@link ResourceTable}. */
|
|
4
|
+
export interface ResourceTableProps<TData> {
|
|
5
|
+
/** TanStack Table instance from `useResourceCollection`. */
|
|
6
|
+
readonly table: Table<TData>;
|
|
7
|
+
/** Whether row selection is enabled. */
|
|
8
|
+
readonly enableSelection?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Render function for per-row actions (e.g. an `ActionMenu`).
|
|
11
|
+
* Shown in the last column. Omit to hide the actions column.
|
|
12
|
+
*/
|
|
13
|
+
readonly renderRowAction?: (item: TData) => ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Called when a row is clicked (but not when a checkbox or action
|
|
16
|
+
* inside the row is clicked).
|
|
17
|
+
*/
|
|
18
|
+
readonly onRowClick?: (item: TData) => void;
|
|
19
|
+
/** Accessible label for the table. @default "Resources" */
|
|
20
|
+
readonly "aria-label"?: string;
|
|
21
|
+
/** Additional CSS classes for the root container. */
|
|
22
|
+
readonly className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Table view for the resource workbench.
|
|
26
|
+
*
|
|
27
|
+
* Renders a semantic `<table>` element using column definitions and
|
|
28
|
+
* data from a TanStack Table instance. Supports sortable column
|
|
29
|
+
* headers, row selection checkboxes, per-row action menus, and
|
|
30
|
+
* keyboard-navigable rows.
|
|
31
|
+
*
|
|
32
|
+
* This component renders **only the table**. Search, filters, view
|
|
33
|
+
* switching, and pagination are handled by the parent `ResourceWorkbench`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const { table } = useResourceCollection({ ... });
|
|
38
|
+
* <ResourceTable
|
|
39
|
+
* table={table}
|
|
40
|
+
* enableSelection
|
|
41
|
+
* renderRowAction={(item) => <AgentActionMenu item={item} />}
|
|
42
|
+
* onRowClick={(item) => navigate(item.slug)}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function ResourceTable<TData>({ table, enableSelection, renderRowAction, onRowClick, "aria-label": ariaLabel, className, }: ResourceTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=ResourceTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceTable.d.ts","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAc,KAAK,KAAK,EAAY,MAAM,uBAAuB,CAAC;AAMzE,uCAAuC;AACvC,MAAM,WAAW,kBAAkB,CAAC,KAAK;IACvC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC;IACtD;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC5C,2DAA2D;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,EACnC,KAAK,EACL,eAAuB,EACvB,eAAe,EACf,UAAU,EACV,YAAY,EAAE,SAAuB,EACrC,SAAS,GACV,EAAE,kBAAkB,CAAC,KAAK,CAAC,2CAqF3B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender } from "@tanstack/react-table";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { ColumnHeader } from "./ColumnHeader";
|
|
6
|
+
import { SelectionCheckbox } from "./SelectionCheckbox";
|
|
7
|
+
/**
|
|
8
|
+
* Table view for the resource workbench.
|
|
9
|
+
*
|
|
10
|
+
* Renders a semantic `<table>` element using column definitions and
|
|
11
|
+
* data from a TanStack Table instance. Supports sortable column
|
|
12
|
+
* headers, row selection checkboxes, per-row action menus, and
|
|
13
|
+
* keyboard-navigable rows.
|
|
14
|
+
*
|
|
15
|
+
* This component renders **only the table**. Search, filters, view
|
|
16
|
+
* switching, and pagination are handled by the parent `ResourceWorkbench`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { table } = useResourceCollection({ ... });
|
|
21
|
+
* <ResourceTable
|
|
22
|
+
* table={table}
|
|
23
|
+
* enableSelection
|
|
24
|
+
* renderRowAction={(item) => <AgentActionMenu item={item} />}
|
|
25
|
+
* onRowClick={(item) => navigate(item.slug)}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function ResourceTable({ table, enableSelection = false, renderRowAction, onRowClick, "aria-label": ariaLabel = "Resources", className, }) {
|
|
30
|
+
const headerGroups = table.getHeaderGroups();
|
|
31
|
+
const rows = table.getRowModel().rows;
|
|
32
|
+
const allSelected = table.getIsAllRowsSelected();
|
|
33
|
+
const someSelected = table.getIsSomeRowsSelected();
|
|
34
|
+
return (_jsx("div", { className: cn("overflow-x-auto", className), children: _jsxs("table", { role: "table", "aria-label": ariaLabel, className: "w-full border-collapse text-sm", children: [_jsx("thead", { children: headerGroups.map((headerGroup) => (_jsxs("tr", { className: "border-b border-border", children: [enableSelection && (_jsx("th", { scope: "col", className: "w-10 px-3 py-2", children: _jsx(SelectionCheckbox, { checked: allSelected, indeterminate: someSelected && !allSelected, onChange: table.getToggleAllRowsSelectedHandler()
|
|
35
|
+
? () => table.toggleAllRowsSelected(!allSelected)
|
|
36
|
+
: () => { }, "aria-label": allSelected
|
|
37
|
+
? "Deselect all rows"
|
|
38
|
+
: "Select all rows" }) })), headerGroup.headers.map((header) => {
|
|
39
|
+
const canSort = header.column.getCanSort();
|
|
40
|
+
const sorted = header.column.getIsSorted();
|
|
41
|
+
const direction = sorted === "asc"
|
|
42
|
+
? "asc"
|
|
43
|
+
: sorted === "desc"
|
|
44
|
+
? "desc"
|
|
45
|
+
: null;
|
|
46
|
+
return (_jsx(ColumnHeader, { label: typeof header.column.columnDef.header === "string"
|
|
47
|
+
? header.column.columnDef.header
|
|
48
|
+
: header.id, sortable: canSort, sortDirection: direction, onSort: canSort
|
|
49
|
+
? () => header.column.toggleSorting()
|
|
50
|
+
: undefined }, header.id));
|
|
51
|
+
}), renderRowAction && (_jsx("th", { scope: "col", className: "w-10 px-3 py-2", children: _jsx("span", { className: "sr-only", children: "Actions" }) }))] }, headerGroup.id))) }), _jsx("tbody", { children: rows.map((row) => (_jsx(TableRow, { row: row, enableSelection: enableSelection, renderRowAction: renderRowAction, onRowClick: onRowClick }, row.id))) })] }) }));
|
|
52
|
+
}
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Internal: Table row
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
function TableRow({ row, enableSelection, renderRowAction, onRowClick, }) {
|
|
57
|
+
const isSelected = row.getIsSelected();
|
|
58
|
+
const item = row.original;
|
|
59
|
+
const isClickable = !!onRowClick;
|
|
60
|
+
return (_jsxs("tr", { className: cn("border-b border-border-muted transition-colors", isSelected && "bg-primary-subtle", isClickable && "cursor-pointer hover:bg-accent-hover"), onClick: isClickable
|
|
61
|
+
? (e) => {
|
|
62
|
+
// Don't trigger row click when interacting with controls
|
|
63
|
+
const target = e.target;
|
|
64
|
+
if (target.closest("button") ||
|
|
65
|
+
target.closest("input") ||
|
|
66
|
+
target.closest("[role='menu']") ||
|
|
67
|
+
target.closest("[role='menuitem']")) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
onRowClick(item);
|
|
71
|
+
}
|
|
72
|
+
: undefined, "aria-selected": enableSelection ? isSelected : undefined, children: [enableSelection && (_jsx("td", { className: "w-10 px-3 py-2", children: _jsx(SelectionCheckbox, { checked: isSelected, onChange: () => row.toggleSelected(), "aria-label": `Select row ${row.id}` }) })), row.getVisibleCells().map((cell) => (_jsx("td", { className: "px-3 py-2 text-sm text-foreground", style: {
|
|
73
|
+
minWidth: cell.column.columnDef.minSize
|
|
74
|
+
? `${cell.column.columnDef.minSize}px`
|
|
75
|
+
: undefined,
|
|
76
|
+
}, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))), renderRowAction && (_jsx("td", { className: "w-10 px-3 py-2 text-right", children: renderRowAction(item) }))] }));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=ResourceTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceTable.js","sourceRoot":"","sources":["../../../src/resource-workbench/components/ResourceTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAwBxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAAQ,EACnC,KAAK,EACL,eAAe,GAAG,KAAK,EACvB,eAAe,EACf,UAAU,EACV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