@burdenoff/microfe-cosmicintersection 2026.1110.1 → 2026.1110.2
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/dist/cosmicintersection/CosmicIntersectionRoot.d.ts +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoot.js +1 -2
- package/dist/cosmicintersection/CosmicIntersectionRoot.js.map +1 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.js +1 -2
- package/dist/cosmicintersection/CosmicIntersectionRoutes.js.map +1 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts +0 -1
- package/dist/cosmicintersection/api/cosmicApi.js +1 -2
- package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
- package/dist/cosmicintersection/api/databricksTransport.d.ts +0 -1
- package/dist/cosmicintersection/api/databricksTransport.js +1 -2
- package/dist/cosmicintersection/api/databricksTransport.js.map +1 -1
- package/dist/cosmicintersection/api/tagsApi.d.ts +0 -1
- package/dist/cosmicintersection/api/tagsApi.js +1 -2
- package/dist/cosmicintersection/api/tagsApi.js.map +1 -1
- package/dist/cosmicintersection/components/ActionMenu.d.ts +0 -1
- package/dist/cosmicintersection/components/ActionMenu.js +1 -2
- package/dist/cosmicintersection/components/ActionMenu.js.map +1 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.js +27 -25
- package/dist/cosmicintersection/components/ActivityFeedPanel.js.map +1 -1
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts +0 -1
- package/dist/cosmicintersection/components/AiRunAttribution.js +1 -2
- package/dist/cosmicintersection/components/AiRunAttribution.js.map +1 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts +0 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.js +1 -2
- package/dist/cosmicintersection/components/DatabricksQueueForm.js.map +1 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.js +1 -2
- package/dist/cosmicintersection/components/DatabricksRunPanel.js.map +1 -1
- package/dist/cosmicintersection/components/DiscussionPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/DiscussionPanel.js +4 -4
- package/dist/cosmicintersection/components/DiscussionPanel.js.map +1 -1
- package/dist/cosmicintersection/components/EmptyState.d.ts +0 -1
- package/dist/cosmicintersection/components/EmptyState.js +1 -2
- package/dist/cosmicintersection/components/EmptyState.js.map +1 -1
- package/dist/cosmicintersection/components/EntityFormShell.d.ts +0 -1
- package/dist/cosmicintersection/components/EntityFormShell.js +1 -2
- package/dist/cosmicintersection/components/EntityFormShell.js.map +1 -1
- package/dist/cosmicintersection/components/EntityTagsField.d.ts +0 -1
- package/dist/cosmicintersection/components/EntityTagsField.js +1 -2
- package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
- package/dist/cosmicintersection/components/ErrorState.d.ts +0 -1
- package/dist/cosmicintersection/components/ErrorState.js +1 -2
- package/dist/cosmicintersection/components/ErrorState.js.map +1 -1
- package/dist/cosmicintersection/components/FacetPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/FacetPanel.js +1 -2
- package/dist/cosmicintersection/components/FacetPanel.js.map +1 -1
- package/dist/cosmicintersection/components/FileUploadField.d.ts +0 -1
- package/dist/cosmicintersection/components/FileUploadField.js +1 -2
- package/dist/cosmicintersection/components/FileUploadField.js.map +1 -1
- package/dist/cosmicintersection/components/LineageGraph.d.ts +0 -1
- package/dist/cosmicintersection/components/LineageGraph.js +7 -12
- package/dist/cosmicintersection/components/LineageGraph.js.map +1 -1
- package/dist/cosmicintersection/components/LoadingState.d.ts +0 -1
- package/dist/cosmicintersection/components/LoadingState.js +1 -2
- package/dist/cosmicintersection/components/LoadingState.js.map +1 -1
- package/dist/cosmicintersection/components/PageLayout.d.ts +0 -1
- package/dist/cosmicintersection/components/PageLayout.js +1 -2
- package/dist/cosmicintersection/components/PageLayout.js.map +1 -1
- package/dist/cosmicintersection/components/Pagination.d.ts +0 -1
- package/dist/cosmicintersection/components/Pagination.js +1 -2
- package/dist/cosmicintersection/components/Pagination.js.map +1 -1
- package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts +0 -1
- package/dist/cosmicintersection/components/ReleaseDraftDialog.js +7 -12
- package/dist/cosmicintersection/components/ReleaseDraftDialog.js.map +1 -1
- package/dist/cosmicintersection/components/ResultsChart.d.ts +0 -1
- package/dist/cosmicintersection/components/ResultsChart.js +4 -8
- package/dist/cosmicintersection/components/ResultsChart.js.map +1 -1
- package/dist/cosmicintersection/components/RunTriageCard.d.ts +0 -1
- package/dist/cosmicintersection/components/RunTriageCard.js +18 -19
- package/dist/cosmicintersection/components/RunTriageCard.js.map +1 -1
- package/dist/cosmicintersection/components/SafeLink.d.ts +0 -1
- package/dist/cosmicintersection/components/SafeLink.js +8 -7
- package/dist/cosmicintersection/components/SafeLink.js.map +1 -1
- package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/SchemaProposalPanel.js +17 -18
- package/dist/cosmicintersection/components/SchemaProposalPanel.js.map +1 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts +0 -1
- package/dist/cosmicintersection/components/ScienceCanvas.js +226 -233
- package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -1
- package/dist/cosmicintersection/components/StatusBadge.d.ts +0 -1
- package/dist/cosmicintersection/components/StatusBadge.js +1 -2
- package/dist/cosmicintersection/components/StatusBadge.js.map +1 -1
- package/dist/cosmicintersection/components/StepDAG.d.ts +0 -1
- package/dist/cosmicintersection/components/StepDAG.js +1 -2
- package/dist/cosmicintersection/components/StepDAG.js.map +1 -1
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts +0 -1
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +1 -2
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js.map +1 -1
- package/dist/cosmicintersection/components/index.d.ts +0 -1
- package/dist/cosmicintersection/components/index.js +14 -14
- package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts +0 -1
- package/dist/cosmicintersection/context/CosmicIntersectionContext.js +2 -7
- package/dist/cosmicintersection/context/CosmicIntersectionContext.js.map +1 -1
- package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksExecutions.js +18 -19
- package/dist/cosmicintersection/hooks/useDatabricksExecutions.js.map +1 -1
- package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js +1 -2
- package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js.map +1 -1
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts +0 -1
- package/dist/cosmicintersection/hooks/useEntityTagSync.js +29 -25
- package/dist/cosmicintersection/hooks/useEntityTagSync.js.map +1 -1
- package/dist/cosmicintersection/index.d.ts +0 -1
- package/dist/cosmicintersection/lib/assistantAwareDialog.d.ts +0 -1
- package/dist/cosmicintersection/lib/assistantAwareDialog.js +1 -2
- package/dist/cosmicintersection/lib/assistantAwareDialog.js.map +1 -1
- package/dist/cosmicintersection/lib/databricksForm.d.ts +0 -1
- package/dist/cosmicintersection/lib/databricksForm.js +1 -2
- package/dist/cosmicintersection/lib/databricksForm.js.map +1 -1
- package/dist/cosmicintersection/lib/databricksIntent.d.ts +0 -1
- package/dist/cosmicintersection/lib/databricksIntent.js +1 -2
- package/dist/cosmicintersection/lib/databricksIntent.js.map +1 -1
- package/dist/cosmicintersection/lib/databricksPresentation.d.ts +0 -1
- package/dist/cosmicintersection/lib/databricksPresentation.js +1 -2
- package/dist/cosmicintersection/lib/databricksPresentation.js.map +1 -1
- package/dist/cosmicintersection/lib/mutationResult.d.ts +0 -1
- package/dist/cosmicintersection/lib/mutationResult.js +1 -2
- package/dist/cosmicintersection/lib/mutationResult.js.map +1 -1
- package/dist/cosmicintersection/lib/toast.d.ts +0 -1
- package/dist/cosmicintersection/lib/toast.js +1 -2
- package/dist/cosmicintersection/lib/toast.js.map +1 -1
- package/dist/cosmicintersection/lib/useSelectedRecord.d.ts +0 -1
- package/dist/cosmicintersection/lib/useSelectedRecord.js +1 -2
- package/dist/cosmicintersection/lib/useSelectedRecord.js.map +1 -1
- package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts +0 -1
- package/dist/cosmicintersection/lib/useTrackRecentItem.js +7 -8
- package/dist/cosmicintersection/lib/useTrackRecentItem.js.map +1 -1
- package/dist/cosmicintersection/lib/visualization.d.ts +0 -1
- package/dist/cosmicintersection/lib/visualization.js +2 -3
- package/dist/cosmicintersection/lib/visualization.js.map +1 -1
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts +0 -1
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/access/AccessPage.js +225 -226
- package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +259 -260
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.d.ts +0 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.js +23 -48
- package/dist/cosmicintersection/pages/archive/ArchivePage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js +32 -33
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +17 -18
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.js +20 -21
- package/dist/cosmicintersection/pages/collections/CollectionsPage.js.map +1 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.js +19 -20
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +64 -75
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +22 -23
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetsPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetsPage.js +207 -208
- package/dist/cosmicintersection/pages/datasets/DatasetsPage.js.map +1 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js +20 -24
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js.map +1 -1
- package/dist/cosmicintersection/pages/lineage/LineagePage.d.ts +0 -1
- package/dist/cosmicintersection/pages/lineage/LineagePage.js +53 -54
- package/dist/cosmicintersection/pages/lineage/LineagePage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js +61 -62
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js +50 -48
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js +28 -29
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js +119 -120
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +41 -42
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js +30 -31
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js +16 -17
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +268 -269
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js +194 -195
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.js +20 -21
- package/dist/cosmicintersection/pages/runs/RunsPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js +31 -32
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js +23 -24
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.js +184 -182
- package/dist/cosmicintersection/pages/sources/SourcesPage.js.map +1 -1
- package/dist/cosmicintersection/types/index.d.ts +0 -1
- package/dist/cosmicintersection/utils/cn.d.ts +0 -1
- package/dist/cosmicintersection/utils/cn.js +1 -2
- package/dist/cosmicintersection/utils/cn.js.map +1 -1
- package/dist/cosmicintersection/utils/i18n.d.ts +0 -1
- package/dist/cosmicintersection/utils/navigation.d.ts +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/generated/global-types.d.ts +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -1
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -3
- package/dist/node_modules/clsx/dist/clsx.js +7 -6
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/services/createSandboxAssistantTransport.js +1 -2
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/services/recentItems.d.ts +0 -1
- package/dist/services/recentItems.js +5 -6
- package/dist/services/recentItems.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +0 -1
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/stories/EmptyState.stories.d.ts +0 -1
- package/dist/stories/LoadingState.stories.d.ts +0 -1
- package/dist/stories/ScienceCanvas.stories.d.ts +0 -1
- package/dist/stories/StatusBadge.stories.d.ts +0 -1
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts +0 -1
- package/dist/test/fakeGateway.d.ts +0 -1
- package/dist/test/fixtures.d.ts +0 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/test/i18nMock.d.ts +13 -1
- package/dist/test/renderWithProviders.d.ts +1 -2
- package/dist/test/storage.d.ts +13 -0
- package/dist/types/assistant.d.ts +0 -1
- package/dist/utils/pageContext.d.ts +0 -1
- package/dist/utils/pageContext.js +1 -2
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +64 -38
- package/dist/cosmicintersection/CosmicIntersectionRoot.d.ts.map +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts.map +0 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts.map +0 -1
- package/dist/cosmicintersection/api/databricksTransport.d.ts.map +0 -1
- package/dist/cosmicintersection/api/tagsApi.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ActionMenu.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DiscussionPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EmptyState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EntityFormShell.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EntityTagsField.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ErrorState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/FacetPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/FileUploadField.d.ts.map +0 -1
- package/dist/cosmicintersection/components/LineageGraph.d.ts.map +0 -1
- package/dist/cosmicintersection/components/LoadingState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/PageLayout.d.ts.map +0 -1
- package/dist/cosmicintersection/components/Pagination.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ResultsChart.d.ts.map +0 -1
- package/dist/cosmicintersection/components/RunTriageCard.d.ts.map +0 -1
- package/dist/cosmicintersection/components/SafeLink.d.ts.map +0 -1
- package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +0 -1
- package/dist/cosmicintersection/components/StatusBadge.d.ts.map +0 -1
- package/dist/cosmicintersection/components/StepDAG.d.ts.map +0 -1
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +0 -1
- package/dist/cosmicintersection/components/index.d.ts.map +0 -1
- package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +0 -1
- package/dist/cosmicintersection/index.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/assistantAwareDialog.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksForm.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksIntent.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksPresentation.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/mutationResult.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/toast.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/useSelectedRecord.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/visualization.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/lineage/LineagePage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/types/index.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/cn.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/i18n.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/navigation.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/services/createSandboxAssistantTransport.d.ts.map +0 -1
- package/dist/services/recentItems.d.ts.map +0 -1
- package/dist/shared/hooks/useTr.d.ts.map +0 -1
- package/dist/stories/EmptyState.stories.d.ts.map +0 -1
- package/dist/stories/LoadingState.stories.d.ts.map +0 -1
- package/dist/stories/ScienceCanvas.stories.d.ts.map +0 -1
- package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +0 -1
- package/dist/test/fakeGateway.d.ts.map +0 -1
- package/dist/test/fixtures.d.ts.map +0 -1
- package/dist/test/i18nMock.d.ts.map +0 -1
- package/dist/test/renderWithProviders.d.ts.map +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.d.ts.map +0 -1
- package/dist/types/assistant.d.ts.map +0 -1
- package/dist/utils/pageContext.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { Inbox as n } from "lucide-react";
|
|
3
|
-
|
|
3
|
+
// src/cosmicintersection/components/EmptyState.tsx
|
|
4
4
|
function r({ icon: r = n, title: i, description: a, action: o, className: s }) {
|
|
5
5
|
return /* @__PURE__ */ t("div", {
|
|
6
6
|
className: `flex min-h-[240px] flex-col items-center justify-center gap-3 rounded-card border border-dashed border-border-default bg-bg-sunken px-6 py-12 text-center ${s ?? ""}`,
|
|
@@ -29,7 +29,6 @@ function r({ icon: r = n, title: i, description: a, action: o, className: s }) {
|
|
|
29
29
|
]
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { r as EmptyState, r as default };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/cosmicintersection/components/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Inbox } from 'lucide-react';\n\nexport interface EmptyStateProps {\n icon?: LucideIcon;\n title: string;\n description?: string;\n /** Primary call-to-action, e.g. a \"Create dataset\" button. */\n action?: ReactNode;\n className?: string;\n}\n\n/**\n * Friendly empty-state for list/detail surfaces with no records yet. Token-styled\n * so it reads correctly in every theme.\n */\nexport function EmptyState({\n icon: Icon = Inbox,\n title,\n description,\n action,\n className,\n}: EmptyStateProps) {\n return (\n <div\n className={`flex min-h-[240px] flex-col items-center justify-center gap-3 rounded-card border border-dashed border-border-default bg-bg-sunken px-6 py-12 text-center ${className ?? ''}`}\n >\n <div className=\"flex size-12 items-center justify-center rounded-full bg-bg-elevated text-text-secondary\">\n <Icon className=\"size-6\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold text-text-primary\">{title}</p>\n {description ? (\n <p className=\"mx-auto max-w-md text-sm text-text-secondary\">{description}</p>\n ) : null}\n </div>\n {action ? <div className=\"mt-1\">{action}</div> : null}\n </div>\n );\n}\n\nexport default EmptyState;\n"],"mappings":";;;AAiBA,
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":["EmptyState","Icon","Inbox","className","title","description","action"],"sources":["../../../src/cosmicintersection/components/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Inbox } from 'lucide-react';\n\nexport interface EmptyStateProps {\n icon?: LucideIcon;\n title: string;\n description?: string;\n /** Primary call-to-action, e.g. a \"Create dataset\" button. */\n action?: ReactNode;\n className?: string;\n}\n\n/**\n * Friendly empty-state for list/detail surfaces with no records yet. Token-styled\n * so it reads correctly in every theme.\n */\nexport function EmptyState({\n icon: Icon = Inbox,\n title,\n description,\n action,\n className,\n}: EmptyStateProps) {\n return (\n <div\n className={`flex min-h-[240px] flex-col items-center justify-center gap-3 rounded-card border border-dashed border-border-default bg-bg-sunken px-6 py-12 text-center ${className ?? ''}`}\n >\n <div className=\"flex size-12 items-center justify-center rounded-full bg-bg-elevated text-text-secondary\">\n <Icon className=\"size-6\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold text-text-primary\">{title}</p>\n {description ? (\n <p className=\"mx-auto max-w-md text-sm text-text-secondary\">{description}</p>\n ) : null}\n </div>\n {action ? <div className=\"mt-1\">{action}</div> : null}\n </div>\n );\n}\n\nexport default EmptyState;\n"],"mappings":";;;AAiBA,SAAgBA,EAAW,EACzB,MAAMC,IAAOC,GACb,UACA,gBACA,WACA,gBACkB;CAClB,OACE,kBAAC,OAAD;EACE,WAAW,6JAA6JC,KAAa;EADvL,UAAA;GAGE,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAACF,GAAD;KAAM,WAAU;KAAS,eAAY;IAAQ,CAAA;GAC1C,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,KAAD;KAAG,WAAU;KAA2C,UAAAG;IAAS,CAAA,GAChEC,IACC,kBAAC,KAAD;KAAG,WAAU;KAAgD,UAAAA;IAAe,CAAA,IAC1E,IACD;;GACJC,IAAS,kBAAC,OAAD;IAAK,WAAU;IAAQ,UAAAA;GAAY,CAAA,IAAI;EAC9C;;AAET"}
|
|
@@ -21,4 +21,3 @@ export interface EntityFormShellProps {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function EntityFormShell({ title, description, purpose, backLabel, onBack, onSubmit, submitLabel, savingLabel: savingLabelProp, saving, submitDisabled, children, }: EntityFormShellProps): import('react').JSX.Element;
|
|
23
23
|
export default EntityFormShell;
|
|
24
|
-
//# sourceMappingURL=EntityFormShell.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Button as r } from "@burdenoff/fe-libs/ui";
|
|
4
4
|
import { ArrowLeft as i, Save as a } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/cosmicintersection/components/EntityFormShell.tsx
|
|
6
6
|
function o({ title: o, description: s, purpose: c, backLabel: l, onBack: u, onSubmit: d, submitLabel: f, savingLabel: p, saving: m = !1, submitDisabled: h = !1, children: g }) {
|
|
7
7
|
let _ = e(), v = p ?? _("cosmicintersection.common.saving", "Saving…");
|
|
8
8
|
return /* @__PURE__ */ n("div", {
|
|
@@ -53,7 +53,6 @@ function o({ title: o, description: s, purpose: c, backLabel: l, onBack: u, onSu
|
|
|
53
53
|
]
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { o as EntityFormShell, o as default };
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=EntityFormShell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFormShell.js","names":[],"sources":["../../../src/cosmicintersection/components/EntityFormShell.tsx"],"sourcesContent":["import type { FormEvent, ReactNode } from 'react';\nimport { ArrowLeft, Save } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface EntityFormShellProps {\n title: string;\n description?: string;\n /** Guidance copy rendered in a token-styled banner above the form. */\n purpose?: ReactNode;\n backLabel: string;\n onBack: () => void;\n onSubmit: (event: FormEvent<HTMLFormElement>) => void;\n submitLabel: string;\n savingLabel?: string;\n saving?: boolean;\n submitDisabled?: boolean;\n children: ReactNode;\n}\n\n/**\n * Shared CRUD form scaffold: a back link + heading, an optional purpose banner,\n * and a token-styled panel wrapping the fields with a consistent Cancel / Save\n * footer. Error handling stays in the page via the `mutationSucceeded` + `notify`\n * helpers; this shell owns layout and the submit/cancel controls only.\n */\nexport function EntityFormShell({\n title,\n description,\n purpose,\n backLabel,\n onBack,\n onSubmit,\n submitLabel,\n savingLabel: savingLabelProp,\n saving = false,\n submitDisabled = false,\n children,\n}: EntityFormShellProps) {\n const tr = useTr();\n const savingLabel = savingLabelProp ?? tr('cosmicintersection.common.saving', 'Saving…');\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onBack}>\n <ArrowLeft className=\"size-4\" />\n {backLabel}\n </Button>\n <h1 className=\"mt-3 text-2xl font-bold text-text-primary\">{title}</h1>\n {description ? <p className=\"mt-1 text-sm text-text-secondary\">{description}</p> : null}\n </div>\n\n {purpose ? (\n <div className=\"rounded-card border border-status-info-border bg-status-info-bg-subtle px-4 py-3 text-sm text-text-secondary\">\n {purpose}\n </div>\n ) : null}\n\n <div className=\"rounded-card border border-border-default bg-bg-elevated p-6\">\n <form onSubmit={onSubmit} className=\"space-y-4\">\n {children}\n <div className=\"flex justify-end gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={onBack} disabled={saving}>\n {tr('cosmicintersection.common.cancel', 'Cancel')}\n </Button>\n <Button type=\"submit\" disabled={saving || submitDisabled}>\n <Save className=\"size-4\" />\n {saving ? savingLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n </div>\n );\n}\n\nexport default EntityFormShell;\n"],"mappings":";;;;;AA0BA,
|
|
1
|
+
{"version":3,"file":"EntityFormShell.js","names":["EntityFormShell","savingLabelProp","tr","useTr","savingLabel","Button","onBack","ArrowLeft","backLabel","title","description","purpose","children","saving","submitDisabled","Save","submitLabel"],"sources":["../../../src/cosmicintersection/components/EntityFormShell.tsx"],"sourcesContent":["import type { FormEvent, ReactNode } from 'react';\nimport { ArrowLeft, Save } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface EntityFormShellProps {\n title: string;\n description?: string;\n /** Guidance copy rendered in a token-styled banner above the form. */\n purpose?: ReactNode;\n backLabel: string;\n onBack: () => void;\n onSubmit: (event: FormEvent<HTMLFormElement>) => void;\n submitLabel: string;\n savingLabel?: string;\n saving?: boolean;\n submitDisabled?: boolean;\n children: ReactNode;\n}\n\n/**\n * Shared CRUD form scaffold: a back link + heading, an optional purpose banner,\n * and a token-styled panel wrapping the fields with a consistent Cancel / Save\n * footer. Error handling stays in the page via the `mutationSucceeded` + `notify`\n * helpers; this shell owns layout and the submit/cancel controls only.\n */\nexport function EntityFormShell({\n title,\n description,\n purpose,\n backLabel,\n onBack,\n onSubmit,\n submitLabel,\n savingLabel: savingLabelProp,\n saving = false,\n submitDisabled = false,\n children,\n}: EntityFormShellProps) {\n const tr = useTr();\n const savingLabel = savingLabelProp ?? tr('cosmicintersection.common.saving', 'Saving…');\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onBack}>\n <ArrowLeft className=\"size-4\" />\n {backLabel}\n </Button>\n <h1 className=\"mt-3 text-2xl font-bold text-text-primary\">{title}</h1>\n {description ? <p className=\"mt-1 text-sm text-text-secondary\">{description}</p> : null}\n </div>\n\n {purpose ? (\n <div className=\"rounded-card border border-status-info-border bg-status-info-bg-subtle px-4 py-3 text-sm text-text-secondary\">\n {purpose}\n </div>\n ) : null}\n\n <div className=\"rounded-card border border-border-default bg-bg-elevated p-6\">\n <form onSubmit={onSubmit} className=\"space-y-4\">\n {children}\n <div className=\"flex justify-end gap-3\">\n <Button type=\"button\" variant=\"outline\" onClick={onBack} disabled={saving}>\n {tr('cosmicintersection.common.cancel', 'Cancel')}\n </Button>\n <Button type=\"submit\" disabled={saving || submitDisabled}>\n <Save className=\"size-4\" />\n {saving ? savingLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n </div>\n );\n}\n\nexport default EntityFormShell;\n"],"mappings":";;;;;AA0BA,SAAgBA,EAAgB,EAC9B,UACA,gBACA,YACA,cACA,WACA,aACA,gBACA,aAAaC,GACb,YAAS,IACT,oBAAiB,IACjB,eACuB;CACvB,IAAMC,IAAKC,EAAM,GACXC,IAAcH,KAAmBC,EAAG,oCAAoC,SAAS;CACvF,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC,OAAD,EAAA,UAAA;IACE,kBAACG,GAAD;KAAQ,MAAK;KAAS,SAAQ;KAAQ,MAAK;KAAK,SAASC;KAAzD,UAAA,CACE,kBAACC,GAAD,EAAW,WAAU,SAAU,CAAA,GAC9BC,CACK;;IACR,kBAAC,MAAD;KAAI,WAAU;KAA6C,UAAAC;IAAU,CAAA;IACpEC,IAAc,kBAAC,KAAD;KAAG,WAAU;KAAoC,UAAAA;IAAe,CAAA,IAAI;GAChF,EAAA,CAAA;GAEJC,IACC,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAA;GACE,CAAA,IACH;GAEJ,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,QAAD;KAAgB;KAAU,WAAU;KAApC,UAAA,CACGC,GACD,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAACP,GAAD;OAAQ,MAAK;OAAS,SAAQ;OAAU,SAASC;OAAQ,UAAUO;OAChE,UAAAX,EAAG,oCAAoC,QAAQ;MAC1C,CAAA,GACR,kBAACG,GAAD;OAAQ,MAAK;OAAS,UAAUQ,KAAUC;OAA1C,UAAA,CACE,kBAACC,GAAD,EAAM,WAAU,SAAU,CAAA,GACzBF,IAAST,IAAcY,CAClB;MACL,CAAA,CAAA;KACD,CAAA,CAAA;;GACH,CAAA;EACF;;AAET"}
|
|
@@ -17,4 +17,3 @@ export interface EntityTagsFieldProps {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function EntityTagsField({ value, onChange, label, placeholder, disabled, className, }: EntityTagsFieldProps): import('react').JSX.Element;
|
|
19
19
|
export default EntityTagsField;
|
|
20
|
-
//# sourceMappingURL=EntityTagsField.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { useState as e } from "react";
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Badge as r, Button as i, Input as a } from "@burdenoff/fe-libs/ui";
|
|
4
4
|
import { Plus as o, Tag as s, X as c } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/cosmicintersection/components/EntityTagsField.tsx
|
|
6
6
|
function l({ value: l, onChange: u, label: d = "Tags", placeholder: f = "Add a tag and press Enter", disabled: p = !1, className: m }) {
|
|
7
7
|
let [h, g] = e(""), _ = () => {
|
|
8
8
|
let e = h.trim();
|
|
@@ -71,7 +71,6 @@ function l({ value: l, onChange: u, label: d = "Tags", placeholder: f = "Add a t
|
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
//#endregion
|
|
75
74
|
export { l as EntityTagsField, l as default };
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=EntityTagsField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTagsField.js","names":[],"sources":["../../../src/cosmicintersection/components/EntityTagsField.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Plus, Tag as TagIcon, X } from 'lucide-react';\nimport { Badge, Button, Input } from '@burdenoff/fe-libs/ui';\n\nexport interface EntityTagsFieldProps {\n /** Current tags (the `tags: [String!]` inline array on the Cos entity). */\n value: string[];\n /** Called with the next tag array whenever a chip is added or removed. */\n onChange: (tags: string[]) => void;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Controlled free-text chips input for plain string arrays (grant scopes,\n * release authors). Entity *tags* use `WorkspaceTagsPicker` instead, which\n * suggests from and writes to the workspace taxonomy; this field never talks to\n * a tag service. The parent form owns the array and passes it straight into the\n * entity's create/update input.\n */\nexport function EntityTagsField({\n value,\n onChange,\n label = 'Tags',\n placeholder = 'Add a tag and press Enter',\n disabled = false,\n className,\n}: EntityTagsFieldProps) {\n const [draft, setDraft] = useState('');\n\n const addTag = () => {\n const trimmed = draft.trim();\n if (!trimmed) {\n return;\n }\n // De-duplicate case-insensitively while preserving the user's casing.\n const exists = value.some((tag) => tag.toLowerCase() === trimmed.toLowerCase());\n if (!exists) {\n onChange([...value, trimmed]);\n }\n setDraft('');\n };\n\n const removeTag = (tag: string) => {\n onChange(value.filter((existing) => existing !== tag));\n };\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n <div className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <TagIcon className=\"size-4 text-text-secondary\" aria-hidden=\"true\" />\n <span>{label}</span>\n </div>\n\n <div className=\"flex flex-wrap gap-2\" role=\"list\" aria-label={label}>\n {value.length === 0 ? (\n <span className=\"text-sm text-text-secondary\">No tags yet.</span>\n ) : (\n value.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"gap-1.5\" role=\"listitem\">\n <span className=\"min-w-0 truncate\">{tag}</span>\n <button\n type=\"button\"\n onClick={() => removeTag(tag)}\n disabled={disabled}\n aria-label={`Remove ${tag}`}\n className=\"rounded-full text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus disabled:opacity-50\"\n >\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n </Badge>\n ))\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n <Input\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n aria-label={`${label} input`}\n disabled={disabled}\n className=\"w-full max-w-xs\"\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n addTag();\n }\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={addTag}\n disabled={disabled || !draft.trim()}\n >\n <Plus className=\"size-4\" />\n Add\n </Button>\n </div>\n </div>\n );\n}\n\nexport default EntityTagsField;\n"],"mappings":";;;;;AAsBA,
|
|
1
|
+
{"version":3,"file":"EntityTagsField.js","names":["TagIcon","EntityTagsField","draft","setDraft","useState","addTag","trimmed","value","tag","onChange","removeTag","existing","className","Tag","label","Badge","X","Input","event","Button","disabled","Plus"],"sources":["../../../src/cosmicintersection/components/EntityTagsField.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Plus, Tag as TagIcon, X } from 'lucide-react';\nimport { Badge, Button, Input } from '@burdenoff/fe-libs/ui';\n\nexport interface EntityTagsFieldProps {\n /** Current tags (the `tags: [String!]` inline array on the Cos entity). */\n value: string[];\n /** Called with the next tag array whenever a chip is added or removed. */\n onChange: (tags: string[]) => void;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Controlled free-text chips input for plain string arrays (grant scopes,\n * release authors). Entity *tags* use `WorkspaceTagsPicker` instead, which\n * suggests from and writes to the workspace taxonomy; this field never talks to\n * a tag service. The parent form owns the array and passes it straight into the\n * entity's create/update input.\n */\nexport function EntityTagsField({\n value,\n onChange,\n label = 'Tags',\n placeholder = 'Add a tag and press Enter',\n disabled = false,\n className,\n}: EntityTagsFieldProps) {\n const [draft, setDraft] = useState('');\n\n const addTag = () => {\n const trimmed = draft.trim();\n if (!trimmed) {\n return;\n }\n // De-duplicate case-insensitively while preserving the user's casing.\n const exists = value.some((tag) => tag.toLowerCase() === trimmed.toLowerCase());\n if (!exists) {\n onChange([...value, trimmed]);\n }\n setDraft('');\n };\n\n const removeTag = (tag: string) => {\n onChange(value.filter((existing) => existing !== tag));\n };\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n <div className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <TagIcon className=\"size-4 text-text-secondary\" aria-hidden=\"true\" />\n <span>{label}</span>\n </div>\n\n <div className=\"flex flex-wrap gap-2\" role=\"list\" aria-label={label}>\n {value.length === 0 ? (\n <span className=\"text-sm text-text-secondary\">No tags yet.</span>\n ) : (\n value.map((tag) => (\n <Badge key={tag} variant=\"secondary\" className=\"gap-1.5\" role=\"listitem\">\n <span className=\"min-w-0 truncate\">{tag}</span>\n <button\n type=\"button\"\n onClick={() => removeTag(tag)}\n disabled={disabled}\n aria-label={`Remove ${tag}`}\n className=\"rounded-full text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus disabled:opacity-50\"\n >\n <X className=\"size-3\" aria-hidden=\"true\" />\n </button>\n </Badge>\n ))\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n <Input\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n aria-label={`${label} input`}\n disabled={disabled}\n className=\"w-full max-w-xs\"\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n addTag();\n }\n }}\n />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={addTag}\n disabled={disabled || !draft.trim()}\n >\n <Plus className=\"size-4\" />\n Add\n </Button>\n </div>\n </div>\n );\n}\n\nexport default EntityTagsField;\n"],"mappings":";;;;;AAsBA,SAAgBC,EAAgB,EAC9B,UACA,aACA,WAAQ,QACR,iBAAc,6BACd,cAAW,IACX,gBACuB;CACvB,IAAM,CAACC,GAAOC,KAAYC,EAAS,EAAE,GAE/BC,UAAe;EACnB,IAAMC,IAAUJ,EAAM,KAAK;EAC3B,AAAKI,MAIUC,EAAM,MAAM,MAAQC,EAAI,YAAY,MAAMF,EAAQ,YAAY,CACxE,KACHG,EAAS,CAAC,GAAGF,GAAOD,CAAO,CAAC,GAE9BH,EAAS,EAAE;CACb,GAEMO,KAAa,MAAgB;EACjC,EAASH,EAAM,QAAQ,MAAaI,MAAaH,CAAG,CAAC;CACvD;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW,aAAaI,KAAa;EAA1C,UAAA;GACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACZ,GAAD;KAAS,WAAU;KAA6B,eAAY;IAAQ,CAAA,GACpE,kBAAC,QAAD,EAAA,UAAOc,EAAY,CAAA,CAChB;;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAuB,MAAK;IAAO,cAAYA;IAC3D,UAAAP,EAAM,WAAW,IAChB,kBAAC,QAAD;KAAM,WAAU;KAA8B,UAAA;IAAkB,CAAA,IAEhEA,EAAM,KAAK,MACT,kBAACQ,GAAD;KAAiB,SAAQ;KAAY,WAAU;KAAU,MAAK;KAA9D,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAAoB,UAAAP;KAAU,CAAA,GAC9C,kBAAC,UAAD;MACE,MAAK;MACL,eAAeE,EAAUF,CAAG;MAClB;MACV,cAAY,UAAUA;MACtB,WAAU;MAEV,UAAA,kBAACQ,GAAD;OAAG,WAAU;OAAS,eAAY;MAAQ,CAAA;KACpC,CAAA,CACH;IAXK,GAAAR,CAWL,CACR;GAEA,CAAA;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACS,GAAD;KACE,OAAOf;KACP,WAAW,MAAUC,EAASe,EAAM,OAAO,KAAK;KACnC;KACb,cAAY,GAAGJ,EAAM;KACX;KACV,WAAU;KACV,YAAY,MAAU;MACpB,AAAII,EAAM,QAAQ,YAChBA,EAAM,eAAe,GACrBb,EAAO;KAEX;IACD,CAAA,GACD,kBAACc,GAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,SAASd;KACT,UAAUe,KAAY,CAAClB,EAAM,KAAK;KALpC,UAAA,CAOE,kBAACmB,GAAD,EAAM,WAAU,SAAU,CAAA,GAAC,KAErB;IACL,CAAA,CAAA;;EACF;;AAET"}
|
|
@@ -11,4 +11,3 @@ export interface ErrorStateProps {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function ErrorState({ title: titleProp, message: messageProp, onRetry, retryLabel: retryLabelProp, className, }: ErrorStateProps): import('react').JSX.Element;
|
|
13
13
|
export default ErrorState;
|
|
14
|
-
//# sourceMappingURL=ErrorState.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Button as r } from "@burdenoff/fe-libs/ui";
|
|
4
4
|
import { AlertTriangle as i } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/cosmicintersection/components/ErrorState.tsx
|
|
6
6
|
function a({ title: a, message: o, onRetry: s, retryLabel: c, className: l }) {
|
|
7
7
|
let u = e(), d = a ?? u("cosmicintersection.common.error", "Something went wrong"), f = o ?? u("cosmicintersection.common.errorDescription", "We could not load this data. Please try again."), p = c ?? u("cosmicintersection.common.retry", "Retry");
|
|
8
8
|
return /* @__PURE__ */ n("div", {
|
|
@@ -36,7 +36,6 @@ function a({ title: a, message: o, onRetry: s, retryLabel: c, className: l }) {
|
|
|
36
36
|
]
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { a as ErrorState, a as default };
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=ErrorState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.js","names":[],"sources":["../../../src/cosmicintersection/components/ErrorState.tsx"],"sourcesContent":["import { AlertTriangle } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface ErrorStateProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n retryLabel?: string;\n className?: string;\n}\n\n/**\n * Token-styled error surface for failed queries. Uses the semantic status-error\n * token family (never raw red) so it stays theme-correct and accessible.\n */\nexport function ErrorState({\n title: titleProp,\n message: messageProp,\n onRetry,\n retryLabel: retryLabelProp,\n className,\n}: ErrorStateProps) {\n const tr = useTr();\n const title = titleProp ?? tr('cosmicintersection.common.error', 'Something went wrong');\n const message =\n messageProp ??\n tr(\n 'cosmicintersection.common.errorDescription',\n 'We could not load this data. Please try again.'\n );\n const retryLabel = retryLabelProp ?? tr('cosmicintersection.common.retry', 'Retry');\n return (\n <div\n role=\"alert\"\n className={`flex min-h-[200px] flex-col items-center justify-center gap-3 rounded-card border border-status-error-border bg-status-error-bg-subtle px-6 py-10 text-center ${className ?? ''}`}\n >\n <div className=\"flex size-12 items-center justify-center rounded-full bg-status-error-bg text-status-error-text\">\n <AlertTriangle className=\"size-6\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold text-status-error-text\">{title}</p>\n <p className=\"mx-auto max-w-md text-sm text-text-secondary\">{message}</p>\n </div>\n {onRetry ? (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={onRetry}>\n {retryLabel}\n </Button>\n ) : null}\n </div>\n );\n}\n\nexport default ErrorState;\n"],"mappings":";;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"ErrorState.js","names":["ErrorState","titleProp","messageProp","retryLabelProp","tr","useTr","title","message","retryLabel","className","AlertTriangle","onRetry","Button"],"sources":["../../../src/cosmicintersection/components/ErrorState.tsx"],"sourcesContent":["import { AlertTriangle } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface ErrorStateProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n retryLabel?: string;\n className?: string;\n}\n\n/**\n * Token-styled error surface for failed queries. Uses the semantic status-error\n * token family (never raw red) so it stays theme-correct and accessible.\n */\nexport function ErrorState({\n title: titleProp,\n message: messageProp,\n onRetry,\n retryLabel: retryLabelProp,\n className,\n}: ErrorStateProps) {\n const tr = useTr();\n const title = titleProp ?? tr('cosmicintersection.common.error', 'Something went wrong');\n const message =\n messageProp ??\n tr(\n 'cosmicintersection.common.errorDescription',\n 'We could not load this data. Please try again.'\n );\n const retryLabel = retryLabelProp ?? tr('cosmicintersection.common.retry', 'Retry');\n return (\n <div\n role=\"alert\"\n className={`flex min-h-[200px] flex-col items-center justify-center gap-3 rounded-card border border-status-error-border bg-status-error-bg-subtle px-6 py-10 text-center ${className ?? ''}`}\n >\n <div className=\"flex size-12 items-center justify-center rounded-full bg-status-error-bg text-status-error-text\">\n <AlertTriangle className=\"size-6\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold text-status-error-text\">{title}</p>\n <p className=\"mx-auto max-w-md text-sm text-text-secondary\">{message}</p>\n </div>\n {onRetry ? (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={onRetry}>\n {retryLabel}\n </Button>\n ) : null}\n </div>\n );\n}\n\nexport default ErrorState;\n"],"mappings":";;;;;AAgBA,SAAgBA,EAAW,EACzB,OAAOC,GACP,SAASC,GACT,YACA,YAAYC,GACZ,gBACkB;CAClB,IAAMC,IAAKC,EAAM,GACXC,IAAQL,KAAaG,EAAG,mCAAmC,sBAAsB,GACjFG,IACJL,KACAE,EACE,8CACA,gDACF,GACII,IAAaL,KAAkBC,EAAG,mCAAmC,OAAO;CAClF,OACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAW,iKAAiKK,KAAa;EAF3L,UAAA;GAIE,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAACC,GAAD;KAAe,WAAU;KAAS,eAAY;IAAQ,CAAA;GACnD,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,KAAD;KAAG,WAAU;KAAgD,UAAAJ;IAAS,CAAA,GACtE,kBAAC,KAAD;KAAG,WAAU;KAAgD,UAAAC;IAAW,CAAA,CACrE;;GACJI,IACC,kBAACC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,MAAK;IAAK,SAASD;IACxD,UAAAH;GACK,CAAA,IACN;EACD;;AAET"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Checkbox as r } from "@burdenoff/fe-libs/ui";
|
|
4
|
-
|
|
4
|
+
// src/cosmicintersection/components/FacetPanel.tsx
|
|
5
5
|
function i({ groups: i, selected: a, onToggle: o, onClear: s, className: c }) {
|
|
6
6
|
let l = Object.values(a).reduce((e, t) => e + t.length, 0);
|
|
7
7
|
return /* @__PURE__ */ n("div", {
|
|
@@ -60,7 +60,6 @@ function i({ groups: i, selected: a, onToggle: o, onClear: s, className: c }) {
|
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { i as FacetPanel, i as default };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=FacetPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetPanel.js","names":[],"sources":["../../../src/cosmicintersection/components/FacetPanel.tsx"],"sourcesContent":["/**\n * FacetPanel — a grouped, multi-select facet filter with live result counts.\n *\n * Presentational only: the parent owns the selection state and computes the\n * per-option counts (typically by cross-filtering the current search pool). Each\n * option renders a checkbox, a label and a right-aligned tabular count. Styling is\n * token-only so it reads correctly in every theme. Zero-count options render\n * disabled + dimmed rather than disappearing, so the facet layout stays stable as\n * the user refines a search.\n *\n * Used by the DiscoveryPage (mockup 05) — Instrument / Access / Format /\n * Mission-Survey groups over the federated dataset catalog.\n */\nimport { Checkbox } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../utils/cn';\n\nexport interface FacetOption {\n value: string;\n label: string;\n count: number;\n}\n\nexport interface FacetGroup {\n key: string;\n label: string;\n options: FacetOption[];\n}\n\nexport interface FacetPanelProps {\n groups: FacetGroup[];\n /** Selected values per group key. */\n selected: Record<string, string[]>;\n onToggle: (groupKey: string, value: string) => void;\n onClear?: () => void;\n className?: string;\n}\n\nexport function FacetPanel({ groups, selected, onToggle, onClear, className }: FacetPanelProps) {\n const totalSelected = Object.values(selected).reduce((sum, values) => sum + values.length, 0);\n\n return (\n <div className={cn('flex flex-col gap-6', className)}>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-semibold uppercase tracking-wide text-text-secondary\">\n Facet\n </span>\n {onClear && totalSelected > 0 ? (\n <button\n type=\"button\"\n onClick={onClear}\n className=\"rounded-button text-xs font-medium text-text-link transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus\"\n >\n Clear ({totalSelected})\n </button>\n ) : null}\n </div>\n\n {groups.map((group) => {\n const groupSelected = selected[group.key] ?? [];\n return (\n <div key={group.key} className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{group.label}</h3>\n {group.options.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">No values yet</p>\n ) : (\n <ul className=\"space-y-0.5\">\n {group.options.map((option) => {\n const checked = groupSelected.includes(option.value);\n const disabled = option.count === 0 && !checked;\n return (\n <li key={option.value}>\n <label\n className={cn(\n 'flex cursor-pointer items-center gap-2 rounded-button px-2 py-1.5 text-sm transition-colors hover:bg-bg-sunken',\n disabled && 'cursor-not-allowed opacity-50 hover:bg-transparent'\n )}\n >\n <Checkbox\n checked={checked}\n disabled={disabled}\n onCheckedChange={() => onToggle(group.key, option.value)}\n aria-label={`${option.label} (${option.count})`}\n />\n <span className=\"min-w-0 flex-1 truncate text-text-primary\">\n {option.label}\n </span>\n <span className=\"shrink-0 tabular-nums text-xs text-text-secondary\">\n {option.count}\n </span>\n </label>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default FacetPanel;\n"],"mappings":";;;;AAsCA,
|
|
1
|
+
{"version":3,"file":"FacetPanel.js","names":["FacetPanel","totalSelected","selected","sum","values","cn","className","onClear","groups","groupSelected","group","checked","option","disabled","Checkbox","onToggle"],"sources":["../../../src/cosmicintersection/components/FacetPanel.tsx"],"sourcesContent":["/**\n * FacetPanel — a grouped, multi-select facet filter with live result counts.\n *\n * Presentational only: the parent owns the selection state and computes the\n * per-option counts (typically by cross-filtering the current search pool). Each\n * option renders a checkbox, a label and a right-aligned tabular count. Styling is\n * token-only so it reads correctly in every theme. Zero-count options render\n * disabled + dimmed rather than disappearing, so the facet layout stays stable as\n * the user refines a search.\n *\n * Used by the DiscoveryPage (mockup 05) — Instrument / Access / Format /\n * Mission-Survey groups over the federated dataset catalog.\n */\nimport { Checkbox } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../utils/cn';\n\nexport interface FacetOption {\n value: string;\n label: string;\n count: number;\n}\n\nexport interface FacetGroup {\n key: string;\n label: string;\n options: FacetOption[];\n}\n\nexport interface FacetPanelProps {\n groups: FacetGroup[];\n /** Selected values per group key. */\n selected: Record<string, string[]>;\n onToggle: (groupKey: string, value: string) => void;\n onClear?: () => void;\n className?: string;\n}\n\nexport function FacetPanel({ groups, selected, onToggle, onClear, className }: FacetPanelProps) {\n const totalSelected = Object.values(selected).reduce((sum, values) => sum + values.length, 0);\n\n return (\n <div className={cn('flex flex-col gap-6', className)}>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-semibold uppercase tracking-wide text-text-secondary\">\n Facet\n </span>\n {onClear && totalSelected > 0 ? (\n <button\n type=\"button\"\n onClick={onClear}\n className=\"rounded-button text-xs font-medium text-text-link transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus\"\n >\n Clear ({totalSelected})\n </button>\n ) : null}\n </div>\n\n {groups.map((group) => {\n const groupSelected = selected[group.key] ?? [];\n return (\n <div key={group.key} className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{group.label}</h3>\n {group.options.length === 0 ? (\n <p className=\"text-xs text-text-secondary\">No values yet</p>\n ) : (\n <ul className=\"space-y-0.5\">\n {group.options.map((option) => {\n const checked = groupSelected.includes(option.value);\n const disabled = option.count === 0 && !checked;\n return (\n <li key={option.value}>\n <label\n className={cn(\n 'flex cursor-pointer items-center gap-2 rounded-button px-2 py-1.5 text-sm transition-colors hover:bg-bg-sunken',\n disabled && 'cursor-not-allowed opacity-50 hover:bg-transparent'\n )}\n >\n <Checkbox\n checked={checked}\n disabled={disabled}\n onCheckedChange={() => onToggle(group.key, option.value)}\n aria-label={`${option.label} (${option.count})`}\n />\n <span className=\"min-w-0 flex-1 truncate text-text-primary\">\n {option.label}\n </span>\n <span className=\"shrink-0 tabular-nums text-xs text-text-secondary\">\n {option.count}\n </span>\n </label>\n </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AAC,QAAD;SAAM,WAAU;SACb,UAAAA,EAAO;QACJ,CAAA;QACN,kBAAC,QAAD;SAAM,WAAU;SACb,UAAAA,EAAO;QACJ,CAAA;OACD;MACL,CAAA,EAAA,GApBKA,EAAO,KAoBZ;KAER,CAAC;IACC,CAAA,CAEH;GAnCK,GAAAF,EAAM,GAmCX;EAET,CAAC,CACE;;AAET"}
|
|
@@ -31,4 +31,3 @@ export interface FileUploadFieldProps {
|
|
|
31
31
|
}
|
|
32
32
|
export declare function FileUploadField({ value, onChange, label, hint, folderId, accept, disabled, className, }: FileUploadFieldProps): import('react').JSX.Element;
|
|
33
33
|
export default FileUploadField;
|
|
34
|
-
//# sourceMappingURL=FileUploadField.d.ts.map
|
|
@@ -6,7 +6,7 @@ import { Button as s } from "@burdenoff/fe-libs/ui";
|
|
|
6
6
|
import { Download as c, FileUp as l, Loader2 as u, Paperclip as d, X as f } from "lucide-react";
|
|
7
7
|
import { gql as p } from "@apollo/client";
|
|
8
8
|
import { useApolloClient as m, useQuery as h } from "@apollo/client/react";
|
|
9
|
-
|
|
9
|
+
// src/cosmicintersection/components/FileUploadField.tsx
|
|
10
10
|
var g = p`
|
|
11
11
|
mutation CosInitiateUpload($input: InitiateUploadInput!) {
|
|
12
12
|
initiateUpload(input: $input) {
|
|
@@ -142,7 +142,6 @@ function x({ value: p, onChange: h, label: v, hint: y, folderId: x, accept: S, d
|
|
|
142
142
|
})]
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
//#endregion
|
|
146
145
|
export { x as FileUploadField, x as default, v as GET_FILE_DOWNLOAD_URL, b as useFileDownloadUrl };
|
|
147
146
|
|
|
148
147
|
//# sourceMappingURL=FileUploadField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadField.js","names":[],"sources":["../../../src/cosmicintersection/components/FileUploadField.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useApolloClient, useQuery } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { Download, FileUp, Loader2, Paperclip, X } from 'lucide-react';\nimport { useId, useRef, useState } from 'react';\n\nimport { notify } from '../lib/toast';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * Generic artifact uploader backed by wspace-files-svc.\n *\n * Dataset/notebook/analysis blobs are NOT stored by this MFE — they live in\n * wspace-files as `File` records, and the Cos entities only hold the returned\n * `fileId` (CosDataset.fileId / CosNotebook.fileId / cosCompleteAnalysis.outputFileId).\n * This control performs the shared 3-step presigned upload (initiateUpload → PUT\n * → completeUpload) inline — the same protocol microfe-files uses — and hands the\n * resulting `fileId` back via `onChange`. It never keeps a local blob store and\n * accepts any file type.\n */\n\n// initiateUpload returns a presigned PUT URL + the upload session id.\nconst INITIATE_UPLOAD = gql`\n mutation CosInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n session {\n id\n }\n uploadUrl\n }\n }\n`;\n\n// completeUpload finalizes the session and returns the committed File id.\nconst COMPLETE_UPLOAD = gql`\n mutation CosCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file {\n id\n }\n }\n }\n`;\n\n// Presigned, time-limited download URL for a stored File — used to render a\n// \"Download\" affordance for an already-attached artifact.\nexport const GET_FILE_DOWNLOAD_URL = gql`\n query CosGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\n// One hour — artifact links are resolved on demand when a detail page renders.\nconst DOWNLOAD_URL_TTL_SECONDS = 3_600;\n\ninterface InitiateUploadResponse {\n initiateUpload?: { session?: { id: string } | null; uploadUrl?: string | null } | null;\n}\n\ninterface CompleteUploadResponse {\n completeUpload?: { fileId?: string | null; file?: { id: string } | null } | null;\n}\n\ninterface DownloadUrlResponse {\n getFileDownloadUrl?: string | null;\n}\n\n/**\n * Resolve a presigned download URL for an attached File id. Skips when no id is\n * present. Detail pages use this to render a \"Download\" link for a dataset/\n * notebook/analysis artifact.\n */\nexport function useFileDownloadUrl(fileId: string | null | undefined) {\n return useQuery<DownloadUrlResponse, { id: string; expiresIn: number }>(GET_FILE_DOWNLOAD_URL, {\n variables: { id: fileId ?? '', expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n skip: !fileId,\n fetchPolicy: 'no-cache',\n });\n}\n\nexport interface FileUploadFieldProps {\n /** Current attached wspace-files File id, if any. */\n value?: string | null;\n /** Called with the new File id once an upload completes, or '' when cleared. */\n onChange: (fileId: string) => void | Promise<void>;\n label: string;\n hint?: string;\n /** Optional wspace-files folder id; when omitted the file lands in the root. */\n folderId?: string;\n /** `accept` attribute for the file input; defaults to any file type. */\n accept?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function FileUploadField({\n value,\n onChange,\n label,\n hint,\n folderId,\n accept,\n disabled = false,\n className,\n}: FileUploadFieldProps) {\n const tr = useTr();\n const client = useApolloClient();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const [uploading, setUploading] = useState(false);\n const [fileName, setFileName] = useState<string | null>(null);\n\n const download = useFileDownloadUrl(uploading ? null : value);\n const downloadUrl = download.data?.getFileDownloadUrl ?? null;\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n // Reset the input so selecting the same file again re-triggers change.\n event.target.value = '';\n if (!file) {\n return;\n }\n\n setUploading(true);\n try {\n const extension = file.name.includes('.')\n ? file.name.substring(file.name.lastIndexOf('.') + 1)\n : '';\n const mimeType = file.type || 'application/octet-stream';\n\n const initiate = await client.mutate<InitiateUploadResponse>({\n mutation: INITIATE_UPLOAD,\n variables: {\n input: {\n fileName: file.name,\n fileSize: String(file.size),\n extension,\n mimeType,\n ...(folderId ? { folderId } : {}),\n },\n },\n });\n const session = initiate.data?.initiateUpload?.session;\n const uploadUrl = initiate.data?.initiateUpload?.uploadUrl;\n if (!session || !uploadUrl) {\n throw new Error(\n initiate.error?.message ??\n tr('cosmicintersection.common.uploadStartError', 'Could not start the upload.')\n );\n }\n\n await new Promise<void>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.addEventListener('load', () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve();\n } else {\n reject(new Error(`Upload failed with status ${xhr.status}`));\n }\n });\n xhr.addEventListener('error', () => reject(new Error('Upload network error')));\n xhr.addEventListener('abort', () => reject(new Error('Upload aborted')));\n xhr.open('PUT', uploadUrl);\n xhr.setRequestHeader('Content-Type', mimeType);\n xhr.send(file);\n });\n\n const complete = await client.mutate<CompleteUploadResponse>({\n mutation: COMPLETE_UPLOAD,\n variables: {\n input: {\n sessionId: session.id,\n fileSize: String(file.size),\n ...(folderId ? { folderId } : {}),\n },\n },\n });\n const uploadedId =\n complete.data?.completeUpload?.fileId ?? complete.data?.completeUpload?.file?.id;\n if (!uploadedId) {\n throw new Error(\n complete.error?.message ??\n tr(\n 'cosmicintersection.common.uploadConfirmError',\n 'The file was uploaded but not confirmed.'\n )\n );\n }\n\n setFileName(file.name);\n await onChange(uploadedId);\n notify.success(tr('cosmicintersection.common.uploadSuccess', 'File uploaded'));\n } catch (error) {\n notify.error(\n tr('cosmicintersection.common.uploadFailed', 'Upload failed'),\n error instanceof Error\n ? error.message\n : tr('cosmicintersection.common.uploadTryAgain', 'Please try again.')\n );\n } finally {\n setUploading(false);\n }\n };\n\n const clear = async () => {\n setFileName(null);\n await onChange('');\n };\n\n return (\n <div className={className}>\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"flex size-12 shrink-0 items-center justify-center rounded-card border border-dashed border-border-default bg-bg-sunken text-text-secondary\">\n <Paperclip className=\"size-5\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={disabled || uploading}\n onClick={() => inputRef.current?.click()}\n >\n {uploading ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <FileUp className=\"size-4\" />\n )}\n {uploading\n ? tr('cosmicintersection.common.uploading', 'Uploading…')\n : value\n ? tr('cosmicintersection.common.replaceFile', 'Replace file')\n : label}\n </Button>\n {value && !uploading ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => void clear()}\n disabled={disabled}\n >\n <X className=\"size-4\" />\n {tr('cosmicintersection.common.remove', 'Remove')}\n </Button>\n ) : null}\n </div>\n {value ? (\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n <span className=\"max-w-[16rem] truncate\">{fileName ?? `File ${value}`}</span>\n {downloadUrl ? (\n <a\n href={downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-text-primary underline-offset-2 hover:underline\"\n >\n <Download className=\"size-3.5\" aria-hidden=\"true\" />\n {tr('cosmicintersection.common.download', 'Download')}\n </a>\n ) : null}\n </div>\n ) : hint ? (\n <p className=\"text-xs text-text-secondary\">{hint}</p>\n ) : null}\n </div>\n </div>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n className=\"sr-only\"\n aria-label={label}\n onChange={(event) => void handleSelect(event)}\n />\n </div>\n );\n}\n\nexport default FileUploadField;\n"],"mappings":";;;;;;;;;AAsBA,IAAM,IAAkB,CAAG;;;;;;;;;GAYrB,IAAkB,CAAG;;;;;;;;;GAad,IAAwB,CAAG;;;;GAOlC,IAA2B;AAmBjC,SAAgB,EAAmB,GAAmC;CACpE,OAAO,EAAiE,GAAuB;EAC7F,WAAW;GAAE,IAAI,KAAU;GAAI,WAAW;EAAyB;EACnE,MAAM,CAAC;EACP,aAAa;CACf,CAAC;AACH;AAiBA,SAAgB,EAAgB,EAC9B,UACA,aACA,UACA,SACA,aACA,WACA,cAAW,IACX,gBACuB;CACvB,IAAM,IAAK,EAAM,GACX,IAAS,EAAgB,GACzB,IAAW,EAAgC,IAAI,GAC/C,IAAU,EAAM,GAChB,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GA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,CAAA,GACtB,EAAG,oCAAoC,QAAQ,CAC1C;UACN,IACD;QACJ,IACC,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD;MAAM,WAAU;gBAA0B,KAAY,QAAQ;KAAc,CAAA,GAC3E,IACC,kBAAC,KAAD;MACE,MAAM;MACN,QAAO;MACP,KAAI;MACJ,WAAU;gBAJZ,CAME,kBAAC,GAAD;OAAU,WAAU;OAAW,eAAY;MAAQ,CAAA,GAClD,EAAG,sCAAsC,UAAU,CACnD;UACD,IACD;SACH,IACF,kBAAC,KAAD;KAAG,WAAU;eAA+B;IAAQ,CAAA,IAClD,IACD;KACF;MACL,kBAAC,SAAD;GACE,KAAK;GACL,IAAI;GACJ,MAAK;GACG;GACR,WAAU;GACV,cAAY;GACZ,WAAW,MAAU,KAAK,EAAa,CAAK;EAC7C,CAAA,CACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"FileUploadField.js","names":["INITIATE_UPLOAD","COMPLETE_UPLOAD","GET_FILE_DOWNLOAD_URL","DOWNLOAD_URL_TTL_SECONDS","useFileDownloadUrl","useQuery","fileId","FileUploadField","tr","useTr","client","useApolloClient","inputRef","useRef","inputId","useId","uploading","setUploading","useState","fileName","setFileName","downloadUrl","value","handleSelect","file","event","extension","mimeType","initiate","folderId","session","uploadUrl","xhr","resolve","reject","complete","uploadedId","onChange","notify","error","clear","Paperclip","Button","disabled","Loader2","FileUp","label","X","Download","hint"],"sources":["../../../src/cosmicintersection/components/FileUploadField.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useApolloClient, useQuery } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { Download, FileUp, Loader2, Paperclip, X } from 'lucide-react';\nimport { useId, useRef, useState } from 'react';\n\nimport { notify } from '../lib/toast';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * Generic artifact uploader backed by wspace-files-svc.\n *\n * Dataset/notebook/analysis blobs are NOT stored by this MFE — they live in\n * wspace-files as `File` records, and the Cos entities only hold the returned\n * `fileId` (CosDataset.fileId / CosNotebook.fileId / cosCompleteAnalysis.outputFileId).\n * This control performs the shared 3-step presigned upload (initiateUpload → PUT\n * → completeUpload) inline — the same protocol microfe-files uses — and hands the\n * resulting `fileId` back via `onChange`. It never keeps a local blob store and\n * accepts any file type.\n */\n\n// initiateUpload returns a presigned PUT URL + the upload session id.\nconst INITIATE_UPLOAD = gql`\n mutation CosInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n session {\n id\n }\n uploadUrl\n }\n }\n`;\n\n// completeUpload finalizes the session and returns the committed File id.\nconst COMPLETE_UPLOAD = gql`\n mutation CosCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file {\n id\n }\n }\n }\n`;\n\n// Presigned, time-limited download URL for a stored File — used to render a\n// \"Download\" affordance for an already-attached artifact.\nexport const GET_FILE_DOWNLOAD_URL = gql`\n query CosGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\n// One hour — artifact links are resolved on demand when a detail page renders.\nconst DOWNLOAD_URL_TTL_SECONDS = 3_600;\n\ninterface InitiateUploadResponse {\n initiateUpload?: { session?: { id: string } | null; uploadUrl?: string | null } | null;\n}\n\ninterface CompleteUploadResponse {\n completeUpload?: { fileId?: string | null; file?: { id: string } | null } | null;\n}\n\ninterface DownloadUrlResponse {\n getFileDownloadUrl?: string | null;\n}\n\n/**\n * Resolve a presigned download URL for an attached File id. Skips when no id is\n * present. Detail pages use this to render a \"Download\" link for a dataset/\n * notebook/analysis artifact.\n */\nexport function useFileDownloadUrl(fileId: string | null | undefined) {\n return useQuery<DownloadUrlResponse, { id: string; expiresIn: number }>(GET_FILE_DOWNLOAD_URL, {\n variables: { id: fileId ?? '', expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n skip: !fileId,\n fetchPolicy: 'no-cache',\n });\n}\n\nexport interface FileUploadFieldProps {\n /** Current attached wspace-files File id, if any. */\n value?: string | null;\n /** Called with the new File id once an upload completes, or '' when cleared. */\n onChange: (fileId: string) => void | Promise<void>;\n label: string;\n hint?: string;\n /** Optional wspace-files folder id; when omitted the file lands in the root. */\n folderId?: string;\n /** `accept` attribute for the file input; defaults to any file type. */\n accept?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function FileUploadField({\n value,\n onChange,\n label,\n hint,\n folderId,\n accept,\n disabled = false,\n className,\n}: FileUploadFieldProps) {\n const tr = useTr();\n const client = useApolloClient();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const [uploading, setUploading] = useState(false);\n const [fileName, setFileName] = useState<string | null>(null);\n\n const download = useFileDownloadUrl(uploading ? null : value);\n const downloadUrl = download.data?.getFileDownloadUrl ?? null;\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n // Reset the input so selecting the same file again re-triggers change.\n event.target.value = '';\n if (!file) {\n return;\n }\n\n setUploading(true);\n try {\n const extension = file.name.includes('.')\n ? file.name.substring(file.name.lastIndexOf('.') + 1)\n : '';\n const mimeType = file.type || 'application/octet-stream';\n\n const initiate = await client.mutate<InitiateUploadResponse>({\n mutation: INITIATE_UPLOAD,\n variables: {\n input: {\n fileName: file.name,\n fileSize: String(file.size),\n extension,\n mimeType,\n ...(folderId ? { folderId } : {}),\n },\n },\n });\n const session = initiate.data?.initiateUpload?.session;\n const uploadUrl = initiate.data?.initiateUpload?.uploadUrl;\n if (!session || !uploadUrl) {\n throw new Error(\n initiate.error?.message ??\n tr('cosmicintersection.common.uploadStartError', 'Could not start the upload.')\n );\n }\n\n await new Promise<void>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.addEventListener('load', () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve();\n } else {\n reject(new Error(`Upload failed with status ${xhr.status}`));\n }\n });\n xhr.addEventListener('error', () => reject(new Error('Upload network error')));\n xhr.addEventListener('abort', () => reject(new Error('Upload aborted')));\n xhr.open('PUT', uploadUrl);\n xhr.setRequestHeader('Content-Type', mimeType);\n xhr.send(file);\n });\n\n const complete = await client.mutate<CompleteUploadResponse>({\n mutation: COMPLETE_UPLOAD,\n variables: {\n input: {\n sessionId: session.id,\n fileSize: String(file.size),\n ...(folderId ? { folderId } : {}),\n },\n },\n });\n const uploadedId =\n complete.data?.completeUpload?.fileId ?? complete.data?.completeUpload?.file?.id;\n if (!uploadedId) {\n throw new Error(\n complete.error?.message ??\n tr(\n 'cosmicintersection.common.uploadConfirmError',\n 'The file was uploaded but not confirmed.'\n )\n );\n }\n\n setFileName(file.name);\n await onChange(uploadedId);\n notify.success(tr('cosmicintersection.common.uploadSuccess', 'File uploaded'));\n } catch (error) {\n notify.error(\n tr('cosmicintersection.common.uploadFailed', 'Upload failed'),\n error instanceof Error\n ? error.message\n : tr('cosmicintersection.common.uploadTryAgain', 'Please try again.')\n );\n } finally {\n setUploading(false);\n }\n };\n\n const clear = async () => {\n setFileName(null);\n await onChange('');\n };\n\n return (\n <div className={className}>\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"flex size-12 shrink-0 items-center justify-center rounded-card border border-dashed border-border-default bg-bg-sunken text-text-secondary\">\n <Paperclip className=\"size-5\" aria-hidden=\"true\" />\n </div>\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={disabled || uploading}\n onClick={() => inputRef.current?.click()}\n >\n {uploading ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <FileUp className=\"size-4\" />\n )}\n {uploading\n ? tr('cosmicintersection.common.uploading', 'Uploading…')\n : value\n ? tr('cosmicintersection.common.replaceFile', 'Replace file')\n : label}\n </Button>\n {value && !uploading ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => void clear()}\n disabled={disabled}\n >\n <X className=\"size-4\" />\n {tr('cosmicintersection.common.remove', 'Remove')}\n </Button>\n ) : null}\n </div>\n {value ? (\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n <span className=\"max-w-[16rem] truncate\">{fileName ?? `File ${value}`}</span>\n {downloadUrl ? (\n <a\n href={downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-text-primary underline-offset-2 hover:underline\"\n >\n <Download className=\"size-3.5\" aria-hidden=\"true\" />\n {tr('cosmicintersection.common.download', 'Download')}\n </a>\n ) : null}\n </div>\n ) : hint ? (\n <p className=\"text-xs text-text-secondary\">{hint}</p>\n ) : null}\n </div>\n </div>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n className=\"sr-only\"\n aria-label={label}\n onChange={(event) => void handleSelect(event)}\n />\n </div>\n );\n}\n\nexport default FileUploadField;\n"],"mappings":";;;;;;;;;AAsBA,IAAMA,IAAkB,CAAG;;;;;;;;;GAYrBC,IAAkB,CAAG;;;;;;;;;GAadC,IAAwB,CAAG;;;;GAOlCC,IAA2B;AAmBjC,SAAgBC,EAAmB,GAAmC;CACpE,OAAOC,EAAiEH,GAAuB;EAC7F,WAAW;GAAE,IAAII,KAAU;GAAI,WAAWH;EAAyB;EACnE,MAAM,CAACG;EACP,aAAa;CACf,CAAC;AACH;AAiBA,SAAgBC,EAAgB,EAC9B,UACA,aACA,UACA,SACA,aACA,WACA,cAAW,IACX,gBACuB;CACvB,IAAMC,IAAKC,EAAM,GACXC,IAASC,EAAgB,GACzBC,IAAWC,EAAgC,IAAI,GAC/CC,IAAUC,EAAM,GAChB,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAACC,GAAUC,KAAeF,EAAwB,IAAI,GAGtDG,IADWjB,EAAmBY,IAAY,OAAOM,CACnC,CAAA,CAAS,MAAM,sBAAsB,MAEnDC,IAAe,OAAO,MAA+C;EACzE,IAAMC,IAAOC,EAAM,OAAO,QAAQ;EAGlC,IADA,EAAM,OAAO,QAAQ,IACh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AG,oCAAoC,QAAQ,CAC1C;KACN,CAAA,IAAA,IACD;IACJ,CAAA,GAAAc,IACC,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAA0B,UAAAH,KAAY,QAAQG;KAAc,CAAA,GAC3ED,IACC,kBAAC,KAAD;MACE,MAAMA;MACN,QAAO;MACP,KAAI;MACJ,WAAU;MAJZ,UAAA,CAME,kBAAC2B,GAAD;OAAU,WAAU;OAAW,eAAY;MAAQ,CAAA,GAClDxC,EAAG,sCAAsC,UAAU,CACnD;KACD,CAAA,IAAA,IACD;IACH,CAAA,IAAAyC,IACF,kBAAC,KAAD;KAAG,WAAU;KAA+B,UAAAA;IAAQ,CAAA,IAClD,IACD;GACF,CAAA,CAAA;EACL,CAAA,GAAA,kBAAC,SAAD;GACE,KAAKrC;GACL,IAAIE;GACJ,MAAK;GACG;GACR,WAAU;GACV,cAAYgC;GACZ,WAAW,MAAU,KAAKvB,EAAaE,CAAK;EAC7C,CAAA,CACE;;AAET"}
|
|
@@ -2,7 +2,7 @@ import { cn as e } from "../utils/cn.js";
|
|
|
2
2
|
import { useId as t, useMemo as n } from "react";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { Boxes as a, Cog as o, Database as s, LineChart as c, NotebookText as l, Radar as u, Tag as d } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/cosmicintersection/components/LineageGraph.tsx
|
|
6
6
|
var f = {
|
|
7
7
|
source: 0,
|
|
8
8
|
collection: 0,
|
|
@@ -22,14 +22,10 @@ var m = class {
|
|
|
22
22
|
edges = [];
|
|
23
23
|
addNode(e) {
|
|
24
24
|
let t = this.nodes.get(e.id);
|
|
25
|
-
|
|
26
|
-
this.nodes.set(e.id, e);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
e.emphasis && !t.emphasis && this.nodes.set(e.id, {
|
|
25
|
+
t ? e.emphasis && !t.emphasis && this.nodes.set(e.id, {
|
|
30
26
|
...t,
|
|
31
27
|
emphasis: !0
|
|
32
|
-
});
|
|
28
|
+
}) : this.nodes.set(e.id, e);
|
|
33
29
|
}
|
|
34
30
|
link(e, t) {
|
|
35
31
|
if (e === t || !this.nodes.has(e) || !this.nodes.has(t)) return;
|
|
@@ -113,7 +109,7 @@ function _(e, t, n) {
|
|
|
113
109
|
}), e.link(r, h.notebook(i.id)));
|
|
114
110
|
for (let i of n.analyses) {
|
|
115
111
|
let n = i.notebookId != null && e.has(h.notebook(i.notebookId));
|
|
116
|
-
i.datasetId
|
|
112
|
+
(i.datasetId === t.id || n) && (e.addNode({
|
|
117
113
|
id: h.analysis(i.id),
|
|
118
114
|
type: "analysis",
|
|
119
115
|
title: i.title,
|
|
@@ -138,7 +134,7 @@ function v(e, t, n = !1) {
|
|
|
138
134
|
}
|
|
139
135
|
function y(e, t) {
|
|
140
136
|
let n = new m(), r = t.datasetsById.get(e);
|
|
141
|
-
return r
|
|
137
|
+
return r && (g(n, r, t, !0), _(n, r, t)), n.build();
|
|
142
138
|
}
|
|
143
139
|
function b(e, t) {
|
|
144
140
|
let n = new m(), r = t.releases.find((t) => t.id === e);
|
|
@@ -320,9 +316,9 @@ function T({ model: a, mode: o = "full", onNavigate: s, className: c }) {
|
|
|
320
316
|
}) }), a.edges.map((e) => {
|
|
321
317
|
let t = d.positions.get(e.from), n = d.positions.get(e.to);
|
|
322
318
|
if (!t || !n) return null;
|
|
323
|
-
let i = t.x + u.nodeW, a = t.y + u.nodeH / 2, s = n.x;
|
|
319
|
+
let i = t.x + u.nodeW, a = t.y + u.nodeH / 2, s = n.x, c = n.y + u.nodeH / 2;
|
|
324
320
|
return /* @__PURE__ */ r("path", {
|
|
325
|
-
d: w(i, a, s,
|
|
321
|
+
d: w(i, a, s, c),
|
|
326
322
|
fill: "none",
|
|
327
323
|
stroke: "currentColor",
|
|
328
324
|
strokeWidth: o === "full" ? 1.5 : 1.25,
|
|
@@ -382,7 +378,6 @@ function T({ model: a, mode: o = "full", onNavigate: s, className: c }) {
|
|
|
382
378
|
})]
|
|
383
379
|
});
|
|
384
380
|
}
|
|
385
|
-
//#endregion
|
|
386
381
|
export { T as LineageGraph, T as default, y as buildDatasetLineage, b as buildReleaseLineage };
|
|
387
382
|
|
|
388
383
|
//# sourceMappingURL=LineageGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineageGraph.js","names":[],"sources":["../../../src/cosmicintersection/components/LineageGraph.tsx"],"sourcesContent":["/**\n * LineageGraph — a reusable, dependency-free provenance DAG for CosmicIntersection.\n *\n * Renders a typed, left-to-right lineage graph (Source → Dataset → Pipeline Run →\n * Notebook / Analysis → Release) as custom inline SVG edges + absolutely-positioned\n * token-styled node cards. No graph library — the layout is a simple column/row\n * solver, edges are cubic-bezier `<path>`s. Every colour comes from fe-libs semantic\n * tokens (bg-*, text-*, border-*, status-*, accent-*) so it renders in every theme.\n *\n * The graph MODEL is derived client-side from existing cos entities by the pure\n * `buildDatasetLineage` / `buildReleaseLineage` builders exported below — the\n * component itself never fetches. Nodes with a `route` are clickable and call\n * `onNavigate` (basePath-relative), matching the rest of the MFE's navigation.\n *\n * Modes:\n * - `full` — page mode (larger cards, legend, dotted canvas). See mockup 20.\n * - `compact` — detail-panel mini map (smaller cards, no legend). See mockup 03.\n */\nimport { useId, useMemo } from 'react';\nimport {\n Boxes,\n Cog,\n Database,\n LineChart,\n NotebookText,\n Radar,\n Tag,\n type LucideIcon,\n} from 'lucide-react';\n\nimport type {\n CosAnalysis,\n CosCollection,\n CosDataset,\n CosNotebook,\n CosPipeline,\n CosPipelineRun,\n CosRelease,\n CosSource,\n} from '../api/cosmicApi';\nimport { cn } from '../utils/cn';\n\n// ============================================================================\n// MODEL\n// ============================================================================\n\nexport type LineageNodeType =\n 'source' | 'collection' | 'dataset' | 'run' | 'notebook' | 'analysis' | 'release';\n\nexport interface LineageNode {\n /** Stable, unique within a model (e.g. `ds:<uuid>`). */\n id: string;\n type: LineageNodeType;\n title: string;\n /** Overrides the default type label (e.g. \"Pipeline Run #340\"). */\n typeLabel?: string;\n /** Small third line — status, version, DOI hint (hidden in compact mode). */\n subtitle?: string;\n /** basePath-relative route; when set (and `onNavigate` given) the node is clickable. */\n route?: string;\n /** Semantic column / layer index, 0 = leftmost (upstream). */\n column: number;\n /** Highlight the graph root (the entity the lineage was requested for). */\n emphasis?: boolean;\n}\n\nexport interface LineageEdge {\n from: string;\n to: string;\n}\n\nexport interface LineageModel {\n nodes: LineageNode[];\n edges: LineageEdge[];\n}\n\n/** Data pools the builders read from — resolved maps + already-filtered lists. */\nexport interface LineageDataPools {\n datasetsById: Map<string, CosDataset>;\n sourcesById: Map<string, CosSource>;\n /**\n * Only the collection's display name is read, so this accepts any collection\n * shape carrying it — including the id-only-`datasets` rows the collections\n * list query returns.\n */\n collectionsById: Map<string, Pick<CosCollection, 'id' | 'name'>>;\n runs: CosPipelineRun[];\n notebooks: CosNotebook[];\n analyses: CosAnalysis[];\n releases: CosRelease[];\n pipelinesById?: Map<string, CosPipeline>;\n}\n\n// ============================================================================\n// BUILDERS (pure — no hooks, no fetching)\n// ============================================================================\n\nconst COLUMN: Record<LineageNodeType, number> = {\n source: 0,\n collection: 0,\n dataset: 1,\n run: 2,\n notebook: 3,\n analysis: 4,\n release: 5,\n};\n\nfunction humanEnum(value: string): string {\n const lower = value.replace(/_/g, ' ').toLowerCase();\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n}\n\n/** Incrementally assembles a de-duplicated node/edge model. */\nclass LineageBuilder {\n private readonly nodes = new Map<string, LineageNode>();\n private readonly edgeKeys = new Set<string>();\n private readonly edges: LineageEdge[] = [];\n\n addNode(node: LineageNode): void {\n const existing = this.nodes.get(node.id);\n if (!existing) {\n this.nodes.set(node.id, node);\n return;\n }\n // Preserve an emphasis flag once set (root wins over a later plain add).\n if (node.emphasis && !existing.emphasis) {\n this.nodes.set(node.id, { ...existing, emphasis: true });\n }\n }\n\n link(from: string, to: string): void {\n if (from === to) {\n return;\n }\n // Only connect endpoints that actually exist in the graph.\n if (!this.nodes.has(from) || !this.nodes.has(to)) {\n return;\n }\n const key = `${from}»${to}`;\n if (this.edgeKeys.has(key)) {\n return;\n }\n this.edgeKeys.add(key);\n this.edges.push({ from, to });\n }\n\n has(id: string): boolean {\n return this.nodes.has(id);\n }\n\n build(): LineageModel {\n return { nodes: [...this.nodes.values()], edges: this.edges };\n }\n}\n\nconst nid = {\n source: (id: string) => `src:${id}`,\n collection: (id: string) => `col:${id}`,\n dataset: (id: string) => `ds:${id}`,\n run: (id: string) => `run:${id}`,\n notebook: (id: string) => `nb:${id}`,\n analysis: (id: string) => `an:${id}`,\n release: (id: string) => `rel:${id}`,\n};\n\n/** Add a dataset node plus its upstream source/collection to the builder. */\nfunction addDatasetUpstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools,\n emphasis: boolean\n): void {\n builder.addNode({\n id: nid.dataset(dataset.id),\n type: 'dataset',\n title: dataset.name,\n subtitle: humanEnum(dataset.status),\n route: `datasets/${dataset.id}`,\n column: COLUMN.dataset,\n emphasis,\n });\n\n if (dataset.sourceId) {\n const source = pools.sourcesById.get(dataset.sourceId);\n builder.addNode({\n id: nid.source(dataset.sourceId),\n type: 'source',\n title: source?.name ?? 'Linked source',\n subtitle: source ? humanEnum(source.type) : undefined,\n route: `sources/${dataset.sourceId}`,\n column: COLUMN.source,\n });\n builder.link(nid.source(dataset.sourceId), nid.dataset(dataset.id));\n }\n\n if (dataset.collectionId) {\n const collection = pools.collectionsById.get(dataset.collectionId);\n builder.addNode({\n id: nid.collection(dataset.collectionId),\n type: 'collection',\n title: collection?.name ?? 'Collection',\n route: `collections/${dataset.collectionId}`,\n column: COLUMN.collection,\n });\n builder.link(nid.collection(dataset.collectionId), nid.dataset(dataset.id));\n }\n}\n\n/** Add the downstream fan for a dataset: runs, notebooks, analyses, releases. */\nfunction addDatasetDownstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools\n): void {\n const datasetNode = nid.dataset(dataset.id);\n\n for (const run of pools.runs) {\n if (run.datasetId !== dataset.id) {\n continue;\n }\n const pipelineName = run.pipelineId\n ? pools.pipelinesById?.get(run.pipelineId)?.name\n : undefined;\n builder.addNode({\n id: nid.run(run.id),\n type: 'run',\n typeLabel: `Pipeline Run #${run.runNumber}`,\n title: pipelineName ?? `Run #${run.runNumber}`,\n subtitle: humanEnum(run.status),\n route: `runs/${run.id}`,\n column: COLUMN.run,\n });\n builder.link(datasetNode, nid.run(run.id));\n }\n\n for (const notebook of pools.notebooks) {\n if (!notebook.datasetIds.includes(dataset.id)) {\n continue;\n }\n builder.addNode({\n id: nid.notebook(notebook.id),\n type: 'notebook',\n title: notebook.title,\n subtitle: humanEnum(notebook.status),\n route: `notebooks/${notebook.id}`,\n column: COLUMN.notebook,\n });\n builder.link(datasetNode, nid.notebook(notebook.id));\n }\n\n for (const analysis of pools.analyses) {\n const linkedToNotebook =\n analysis.notebookId != null && builder.has(nid.notebook(analysis.notebookId));\n if (analysis.datasetId !== dataset.id && !linkedToNotebook) {\n continue;\n }\n builder.addNode({\n id: nid.analysis(analysis.id),\n type: 'analysis',\n title: analysis.title,\n subtitle: humanEnum(analysis.status),\n // No per-analysis detail route exists — land on the analyses list.\n route: 'analyses',\n column: COLUMN.analysis,\n });\n if (linkedToNotebook && analysis.notebookId != null) {\n builder.link(nid.notebook(analysis.notebookId), nid.analysis(analysis.id));\n } else {\n builder.link(datasetNode, nid.analysis(analysis.id));\n }\n }\n\n for (const release of pools.releases) {\n if (!release.datasetIds.includes(dataset.id)) {\n continue;\n }\n addReleaseNode(builder, release);\n builder.link(datasetNode, nid.release(release.id));\n if (release.notebookId != null && builder.has(nid.notebook(release.notebookId))) {\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n }\n }\n}\n\nfunction addReleaseNode(builder: LineageBuilder, release: CosRelease, emphasis = false): void {\n const doiSuffix = release.doi ? ' · DOI' : '';\n builder.addNode({\n id: nid.release(release.id),\n type: 'release',\n title: release.title,\n subtitle: `v${release.version}${doiSuffix}`,\n // No per-release detail route exists — land on the releases list.\n route: 'releases',\n column: COLUMN.release,\n emphasis,\n });\n}\n\n/**\n * Provenance for a single dataset: its upstream (source + collection) and its\n * full downstream fan (runs, notebooks, analyses, releases). The dataset is the\n * emphasised root.\n */\nexport function buildDatasetLineage(datasetId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n return builder.build();\n }\n addDatasetUpstream(builder, dataset, pools, true);\n addDatasetDownstream(builder, dataset, pools);\n return builder.build();\n}\n\n/**\n * Provenance for a release: the release plus its input datasets and notebook,\n * each expanded UPSTREAM (source/collection for datasets; the notebook's own\n * datasets). The release is the emphasised root.\n */\nexport function buildReleaseLineage(releaseId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const release = pools.releases.find((item) => item.id === releaseId);\n if (!release) {\n return builder.build();\n }\n\n addReleaseNode(builder, release, true);\n\n for (const datasetId of release.datasetIds) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.release(release.id));\n }\n\n if (release.notebookId != null) {\n const notebook = pools.notebooks.find((item) => item.id === release.notebookId);\n builder.addNode({\n id: nid.notebook(release.notebookId),\n type: 'notebook',\n title: notebook?.title ?? 'Notebook',\n subtitle: notebook ? humanEnum(notebook.status) : undefined,\n route: `notebooks/${release.notebookId}`,\n column: COLUMN.notebook,\n });\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n\n for (const datasetId of notebook?.datasetIds ?? []) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.notebook(release.notebookId));\n }\n }\n\n return builder.build();\n}\n\n// ============================================================================\n// PRESENTATION\n// ============================================================================\n\ninterface NodeMeta {\n label: string;\n Icon: LucideIcon;\n /** Icon-chip classes (semantic accent tokens only). */\n chip: string;\n /** Card border colour class. */\n border: string;\n}\n\nconst NODE_META: Record<LineageNodeType, NodeMeta> = {\n source: {\n label: 'Source',\n Icon: Radar,\n chip: 'bg-accent-blue-subtle text-accent-blue',\n border: 'border-accent-blue',\n },\n collection: {\n label: 'Collection',\n Icon: Boxes,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n dataset: {\n label: 'Dataset',\n Icon: Database,\n chip: 'bg-accent-indigo-subtle text-accent-indigo',\n border: 'border-accent-indigo',\n },\n run: {\n label: 'Pipeline Run',\n Icon: Cog,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n notebook: {\n label: 'Notebook',\n Icon: NotebookText,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n analysis: {\n label: 'Analysis',\n Icon: LineChart,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n release: {\n label: 'Release',\n Icon: Tag,\n chip: 'bg-status-success-bg-subtle text-status-success-text',\n border: 'border-status-success-border',\n },\n};\n\ninterface Dims {\n nodeW: number;\n nodeH: number;\n colGap: number;\n rowGap: number;\n pad: number;\n iconSize: string;\n showSubtitle: boolean;\n}\n\nconst DIMS: Record<'full' | 'compact', Dims> = {\n full: {\n nodeW: 190,\n nodeH: 78,\n colGap: 74,\n rowGap: 30,\n pad: 32,\n iconSize: 'size-8',\n showSubtitle: true,\n },\n compact: {\n nodeW: 150,\n nodeH: 54,\n colGap: 46,\n rowGap: 18,\n pad: 18,\n iconSize: 'size-6',\n showSubtitle: false,\n },\n};\n\ninterface Positioned {\n node: LineageNode;\n x: number;\n y: number;\n}\n\ninterface Layout {\n positions: Map<string, Positioned>;\n width: number;\n height: number;\n}\n\nfunction computeLayout(model: LineageModel, dims: Dims): Layout {\n const positions = new Map<string, Positioned>();\n if (model.nodes.length === 0) {\n return { positions, width: dims.pad * 2, height: dims.pad * 2 };\n }\n\n // Present columns, remapped to contiguous indices so empty layers collapse.\n const presentCols = [...new Set(model.nodes.map((n) => n.column))].sort((a, b) => a - b);\n const colOrder = new Map(presentCols.map((c, i) => [c, i]));\n\n const byColumn = new Map<number, LineageNode[]>();\n for (const node of model.nodes) {\n const list = byColumn.get(node.column);\n if (list) {\n list.push(node);\n } else {\n byColumn.set(node.column, [node]);\n }\n }\n\n let contentH = dims.nodeH;\n for (const list of byColumn.values()) {\n const h = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n contentH = Math.max(contentH, h);\n }\n\n for (const col of presentCols) {\n const list = byColumn.get(col) ?? [];\n const colH = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n const startY = dims.pad + (contentH - colH) / 2;\n const x = dims.pad + (colOrder.get(col) ?? 0) * (dims.nodeW + dims.colGap);\n list.forEach((node, i) => {\n positions.set(node.id, { node, x, y: startY + i * (dims.nodeH + dims.rowGap) });\n });\n }\n\n const width =\n dims.pad * 2 + presentCols.length * dims.nodeW + (presentCols.length - 1) * dims.colGap;\n const height = dims.pad * 2 + contentH;\n return { positions, width, height };\n}\n\nfunction edgePath(x1: number, y1: number, x2: number, y2: number): string {\n const dx = Math.max(24, (x2 - x1) * 0.5);\n return `M ${x1} ${y1} C ${x1 + dx} ${y1}, ${x2 - dx} ${y2}, ${x2} ${y2}`;\n}\n\nexport interface LineageGraphProps {\n model: LineageModel;\n mode?: 'full' | 'compact';\n onNavigate?: (route: string) => void;\n className?: string;\n}\n\nexport function LineageGraph({ model, mode = 'full', onNavigate, className }: LineageGraphProps) {\n const markerId = `cos-lineage-arrow-${useId().replace(/:/g, '')}`;\n const dims = DIMS[mode];\n\n const layout = useMemo(() => computeLayout(model, dims), [model, dims]);\n\n const legendTypes = useMemo(() => {\n const seen = new Set<LineageNodeType>();\n const ordered: LineageNodeType[] = [];\n for (const node of [...model.nodes].sort((a, b) => a.column - b.column)) {\n if (!seen.has(node.type)) {\n seen.add(node.type);\n ordered.push(node.type);\n }\n }\n return ordered;\n }, [model.nodes]);\n\n if (model.nodes.length === 0) {\n return null;\n }\n\n return (\n <div className={cn('flex flex-col gap-3', className)}>\n {mode === 'full' && legendTypes.length > 0 ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n {legendTypes.map((type) => {\n const meta = NODE_META[type];\n return (\n <span\n key={type}\n className=\"inline-flex items-center gap-1.5 text-xs text-text-secondary\"\n >\n <span\n className={cn(\n 'flex size-5 items-center justify-center rounded-button',\n meta.chip\n )}\n >\n <meta.Icon className=\"size-3\" aria-hidden=\"true\" />\n </span>\n {meta.label}\n </span>\n );\n })}\n </div>\n ) : null}\n\n <div\n className={cn(\n 'overflow-x-auto rounded-card border border-border-seam bg-bg-canvas',\n mode === 'full' ? 'p-1' : 'p-0.5'\n )}\n >\n <div\n className=\"relative\"\n style={{\n width: layout.width,\n height: layout.height,\n minWidth: '100%',\n backgroundImage: 'radial-gradient(var(--color-border-subtle) 1px, transparent 1px)',\n backgroundSize: mode === 'full' ? '20px 20px' : '16px 16px',\n }}\n >\n {/* Edges (behind the node cards). */}\n <svg\n className=\"pointer-events-none absolute inset-0 text-border-strong\"\n width={layout.width}\n height={layout.height}\n viewBox={`0 0 ${layout.width} ${layout.height}`}\n aria-hidden=\"true\"\n >\n <defs>\n <marker\n id={markerId}\n viewBox=\"0 0 8 8\"\n refX=\"6.5\"\n refY=\"4\"\n markerWidth=\"6\"\n markerHeight=\"6\"\n orient=\"auto-start-reverse\"\n >\n <path d=\"M1 1 L7 4 L1 7 z\" fill=\"currentColor\" />\n </marker>\n </defs>\n {model.edges.map((edge) => {\n const from = layout.positions.get(edge.from);\n const to = layout.positions.get(edge.to);\n if (!from || !to) {\n return null;\n }\n const x1 = from.x + dims.nodeW;\n const y1 = from.y + dims.nodeH / 2;\n const x2 = to.x;\n const y2 = to.y + dims.nodeH / 2;\n return (\n <path\n key={`${edge.from}»${edge.to}`}\n d={edgePath(x1, y1, x2, y2)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={mode === 'full' ? 1.5 : 1.25}\n strokeLinecap=\"round\"\n markerEnd={`url(#${markerId})`}\n opacity={0.7}\n />\n );\n })}\n </svg>\n\n {/* Node cards. */}\n {[...layout.positions.values()].map(({ node, x, y }) => {\n const meta = NODE_META[node.type];\n const clickable = Boolean(node.route && onNavigate);\n const content = (\n <div\n className={cn(\n 'flex h-full w-full items-center gap-2.5 rounded-card border bg-bg-elevated px-3 shadow-sm transition-shadow',\n meta.border,\n clickable && 'group-hover:shadow-md',\n node.emphasis && 'ring-1 ring-border-strong'\n )}\n >\n <span\n className={cn(\n 'flex shrink-0 items-center justify-center rounded-button',\n dims.iconSize,\n meta.chip\n )}\n aria-hidden=\"true\"\n >\n <meta.Icon className={mode === 'full' ? 'size-4' : 'size-3.5'} />\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col text-left\">\n <span className=\"truncate text-[10px] font-medium uppercase tracking-wide text-text-tertiary\">\n {node.typeLabel ?? meta.label}\n </span>\n <span\n className={cn(\n 'truncate font-semibold text-text-primary',\n mode === 'full' ? 'text-sm' : 'text-xs'\n )}\n >\n {node.title}\n </span>\n {dims.showSubtitle && node.subtitle ? (\n <span className=\"truncate text-[11px] text-text-secondary\">\n {node.subtitle}\n </span>\n ) : null}\n </span>\n </div>\n );\n\n const style = { left: x, top: y, width: dims.nodeW, height: dims.nodeH } as const;\n\n if (clickable && node.route) {\n const route = node.route;\n return (\n <button\n key={node.id}\n type=\"button\"\n onClick={() => onNavigate?.(route)}\n className=\"group absolute rounded-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n style={style}\n title={`${node.typeLabel ?? meta.label}: ${node.title}`}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div key={node.id} className=\"absolute\" style={style}>\n {content}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nexport default LineageGraph;\n"],"mappings":";;;;;AAiGA,I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AAC,EAAK,MAAN,EAAW,WAAW,MAAS,SAAS,WAAW,WAAa,CAAA;MAC5D,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;iBAAhB;QACE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAK,aAAa,EAAK;QACpB,CAAA;QACN,kBAAC,QAAD;SACE,WAAW,EACT,4CACA,MAAS,SAAS,YAAY,SAChC;mBAEC,EAAK;QACF,CAAA;QACL,EAAK,gBAAgB,EAAK,WACzB,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAK;QACF,CAAA,IACJ;OACA;QACH;SAGD,IAAQ;MAAE,MAAM;MAAG,KAAK;MAAG,OAAO,EAAK;MAAO,QAAQ,EAAK;KAAM;KAEvE,IAAI,KAAa,EAAK,OAAO;MAC3B,IAAM,IAAQ,EAAK;MACnB,OACE,kBAAC,UAAD;OAEE,MAAK;OACL,eAAe,IAAa,CAAK;OACjC,WAAU;OACH;OACP,OAAO,GAAG,EAAK,aAAa,EAAK,MAAM,IAAI,EAAK;iBAE/C;MACK,GARD,EAAK,EAQJ;KAEZ;KAEA,OACE,kBAAC,OAAD;MAAmB,WAAU;MAAkB;gBAC5C;KACE,GAFK,EAAK,EAEV;IAET,CAAC,CACE;;EACF,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"LineageGraph.js","names":["COLUMN","humanEnum","lower","value","LineageBuilder","existing","node","from","to","key","id","nid","addDatasetUpstream","builder","dataset","source","pools","collection","addDatasetDownstream","datasetNode","run","pipelineName","notebook","analysis","linkedToNotebook","release","addReleaseNode","doiSuffix","buildDatasetLineage","datasetId","buildReleaseLineage","item","releaseId","NODE_META","Radar","Boxes","Database","Cog","NotebookText","LineChart","Tag","DIMS","computeLayout","positions","model","dims","presentCols","n","a","b","colOrder","c","i","byColumn","list","contentH","h","col","colH","startY","x","edgePath","dx","x2","x1","y1","y2","LineageGraph","markerId","useId","mode","layout","useMemo","legendTypes","seen","ordered","cn","className","meta","type","edge","clickable","onNavigate","content","style","y","route"],"sources":["../../../src/cosmicintersection/components/LineageGraph.tsx"],"sourcesContent":["/**\n * LineageGraph — a reusable, dependency-free provenance DAG for CosmicIntersection.\n *\n * Renders a typed, left-to-right lineage graph (Source → Dataset → Pipeline Run →\n * Notebook / Analysis → Release) as custom inline SVG edges + absolutely-positioned\n * token-styled node cards. No graph library — the layout is a simple column/row\n * solver, edges are cubic-bezier `<path>`s. Every colour comes from fe-libs semantic\n * tokens (bg-*, text-*, border-*, status-*, accent-*) so it renders in every theme.\n *\n * The graph MODEL is derived client-side from existing cos entities by the pure\n * `buildDatasetLineage` / `buildReleaseLineage` builders exported below — the\n * component itself never fetches. Nodes with a `route` are clickable and call\n * `onNavigate` (basePath-relative), matching the rest of the MFE's navigation.\n *\n * Modes:\n * - `full` — page mode (larger cards, legend, dotted canvas). See mockup 20.\n * - `compact` — detail-panel mini map (smaller cards, no legend). See mockup 03.\n */\nimport { useId, useMemo } from 'react';\nimport {\n Boxes,\n Cog,\n Database,\n LineChart,\n NotebookText,\n Radar,\n Tag,\n type LucideIcon,\n} from 'lucide-react';\n\nimport type {\n CosAnalysis,\n CosCollection,\n CosDataset,\n CosNotebook,\n CosPipeline,\n CosPipelineRun,\n CosRelease,\n CosSource,\n} from '../api/cosmicApi';\nimport { cn } from '../utils/cn';\n\n// ============================================================================\n// MODEL\n// ============================================================================\n\nexport type LineageNodeType =\n 'source' | 'collection' | 'dataset' | 'run' | 'notebook' | 'analysis' | 'release';\n\nexport interface LineageNode {\n /** Stable, unique within a model (e.g. `ds:<uuid>`). */\n id: string;\n type: LineageNodeType;\n title: string;\n /** Overrides the default type label (e.g. \"Pipeline Run #340\"). */\n typeLabel?: string;\n /** Small third line — status, version, DOI hint (hidden in compact mode). */\n subtitle?: string;\n /** basePath-relative route; when set (and `onNavigate` given) the node is clickable. */\n route?: string;\n /** Semantic column / layer index, 0 = leftmost (upstream). */\n column: number;\n /** Highlight the graph root (the entity the lineage was requested for). */\n emphasis?: boolean;\n}\n\nexport interface LineageEdge {\n from: string;\n to: string;\n}\n\nexport interface LineageModel {\n nodes: LineageNode[];\n edges: LineageEdge[];\n}\n\n/** Data pools the builders read from — resolved maps + already-filtered lists. */\nexport interface LineageDataPools {\n datasetsById: Map<string, CosDataset>;\n sourcesById: Map<string, CosSource>;\n /**\n * Only the collection's display name is read, so this accepts any collection\n * shape carrying it — including the id-only-`datasets` rows the collections\n * list query returns.\n */\n collectionsById: Map<string, Pick<CosCollection, 'id' | 'name'>>;\n runs: CosPipelineRun[];\n notebooks: CosNotebook[];\n analyses: CosAnalysis[];\n releases: CosRelease[];\n pipelinesById?: Map<string, CosPipeline>;\n}\n\n// ============================================================================\n// BUILDERS (pure — no hooks, no fetching)\n// ============================================================================\n\nconst COLUMN: Record<LineageNodeType, number> = {\n source: 0,\n collection: 0,\n dataset: 1,\n run: 2,\n notebook: 3,\n analysis: 4,\n release: 5,\n};\n\nfunction humanEnum(value: string): string {\n const lower = value.replace(/_/g, ' ').toLowerCase();\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n}\n\n/** Incrementally assembles a de-duplicated node/edge model. */\nclass LineageBuilder {\n private readonly nodes = new Map<string, LineageNode>();\n private readonly edgeKeys = new Set<string>();\n private readonly edges: LineageEdge[] = [];\n\n addNode(node: LineageNode): void {\n const existing = this.nodes.get(node.id);\n if (!existing) {\n this.nodes.set(node.id, node);\n return;\n }\n // Preserve an emphasis flag once set (root wins over a later plain add).\n if (node.emphasis && !existing.emphasis) {\n this.nodes.set(node.id, { ...existing, emphasis: true });\n }\n }\n\n link(from: string, to: string): void {\n if (from === to) {\n return;\n }\n // Only connect endpoints that actually exist in the graph.\n if (!this.nodes.has(from) || !this.nodes.has(to)) {\n return;\n }\n const key = `${from}»${to}`;\n if (this.edgeKeys.has(key)) {\n return;\n }\n this.edgeKeys.add(key);\n this.edges.push({ from, to });\n }\n\n has(id: string): boolean {\n return this.nodes.has(id);\n }\n\n build(): LineageModel {\n return { nodes: [...this.nodes.values()], edges: this.edges };\n }\n}\n\nconst nid = {\n source: (id: string) => `src:${id}`,\n collection: (id: string) => `col:${id}`,\n dataset: (id: string) => `ds:${id}`,\n run: (id: string) => `run:${id}`,\n notebook: (id: string) => `nb:${id}`,\n analysis: (id: string) => `an:${id}`,\n release: (id: string) => `rel:${id}`,\n};\n\n/** Add a dataset node plus its upstream source/collection to the builder. */\nfunction addDatasetUpstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools,\n emphasis: boolean\n): void {\n builder.addNode({\n id: nid.dataset(dataset.id),\n type: 'dataset',\n title: dataset.name,\n subtitle: humanEnum(dataset.status),\n route: `datasets/${dataset.id}`,\n column: COLUMN.dataset,\n emphasis,\n });\n\n if (dataset.sourceId) {\n const source = pools.sourcesById.get(dataset.sourceId);\n builder.addNode({\n id: nid.source(dataset.sourceId),\n type: 'source',\n title: source?.name ?? 'Linked source',\n subtitle: source ? humanEnum(source.type) : undefined,\n route: `sources/${dataset.sourceId}`,\n column: COLUMN.source,\n });\n builder.link(nid.source(dataset.sourceId), nid.dataset(dataset.id));\n }\n\n if (dataset.collectionId) {\n const collection = pools.collectionsById.get(dataset.collectionId);\n builder.addNode({\n id: nid.collection(dataset.collectionId),\n type: 'collection',\n title: collection?.name ?? 'Collection',\n route: `collections/${dataset.collectionId}`,\n column: COLUMN.collection,\n });\n builder.link(nid.collection(dataset.collectionId), nid.dataset(dataset.id));\n }\n}\n\n/** Add the downstream fan for a dataset: runs, notebooks, analyses, releases. */\nfunction addDatasetDownstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools\n): void {\n const datasetNode = nid.dataset(dataset.id);\n\n for (const run of pools.runs) {\n if (run.datasetId !== dataset.id) {\n continue;\n }\n const pipelineName = run.pipelineId\n ? pools.pipelinesById?.get(run.pipelineId)?.name\n : undefined;\n builder.addNode({\n id: nid.run(run.id),\n type: 'run',\n typeLabel: `Pipeline Run #${run.runNumber}`,\n title: pipelineName ?? `Run #${run.runNumber}`,\n subtitle: humanEnum(run.status),\n route: `runs/${run.id}`,\n column: COLUMN.run,\n });\n builder.link(datasetNode, nid.run(run.id));\n }\n\n for (const notebook of pools.notebooks) {\n if (!notebook.datasetIds.includes(dataset.id)) {\n continue;\n }\n builder.addNode({\n id: nid.notebook(notebook.id),\n type: 'notebook',\n title: notebook.title,\n subtitle: humanEnum(notebook.status),\n route: `notebooks/${notebook.id}`,\n column: COLUMN.notebook,\n });\n builder.link(datasetNode, nid.notebook(notebook.id));\n }\n\n for (const analysis of pools.analyses) {\n const linkedToNotebook =\n analysis.notebookId != null && builder.has(nid.notebook(analysis.notebookId));\n if (analysis.datasetId !== dataset.id && !linkedToNotebook) {\n continue;\n }\n builder.addNode({\n id: nid.analysis(analysis.id),\n type: 'analysis',\n title: analysis.title,\n subtitle: humanEnum(analysis.status),\n // No per-analysis detail route exists — land on the analyses list.\n route: 'analyses',\n column: COLUMN.analysis,\n });\n if (linkedToNotebook && analysis.notebookId != null) {\n builder.link(nid.notebook(analysis.notebookId), nid.analysis(analysis.id));\n } else {\n builder.link(datasetNode, nid.analysis(analysis.id));\n }\n }\n\n for (const release of pools.releases) {\n if (!release.datasetIds.includes(dataset.id)) {\n continue;\n }\n addReleaseNode(builder, release);\n builder.link(datasetNode, nid.release(release.id));\n if (release.notebookId != null && builder.has(nid.notebook(release.notebookId))) {\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n }\n }\n}\n\nfunction addReleaseNode(builder: LineageBuilder, release: CosRelease, emphasis = false): void {\n const doiSuffix = release.doi ? ' · DOI' : '';\n builder.addNode({\n id: nid.release(release.id),\n type: 'release',\n title: release.title,\n subtitle: `v${release.version}${doiSuffix}`,\n // No per-release detail route exists — land on the releases list.\n route: 'releases',\n column: COLUMN.release,\n emphasis,\n });\n}\n\n/**\n * Provenance for a single dataset: its upstream (source + collection) and its\n * full downstream fan (runs, notebooks, analyses, releases). The dataset is the\n * emphasised root.\n */\nexport function buildDatasetLineage(datasetId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n return builder.build();\n }\n addDatasetUpstream(builder, dataset, pools, true);\n addDatasetDownstream(builder, dataset, pools);\n return builder.build();\n}\n\n/**\n * Provenance for a release: the release plus its input datasets and notebook,\n * each expanded UPSTREAM (source/collection for datasets; the notebook's own\n * datasets). The release is the emphasised root.\n */\nexport function buildReleaseLineage(releaseId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const release = pools.releases.find((item) => item.id === releaseId);\n if (!release) {\n return builder.build();\n }\n\n addReleaseNode(builder, release, true);\n\n for (const datasetId of release.datasetIds) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.release(release.id));\n }\n\n if (release.notebookId != null) {\n const notebook = pools.notebooks.find((item) => item.id === release.notebookId);\n builder.addNode({\n id: nid.notebook(release.notebookId),\n type: 'notebook',\n title: notebook?.title ?? 'Notebook',\n subtitle: notebook ? humanEnum(notebook.status) : undefined,\n route: `notebooks/${release.notebookId}`,\n column: COLUMN.notebook,\n });\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n\n for (const datasetId of notebook?.datasetIds ?? []) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.notebook(release.notebookId));\n }\n }\n\n return builder.build();\n}\n\n// ============================================================================\n// PRESENTATION\n// ============================================================================\n\ninterface NodeMeta {\n label: string;\n Icon: LucideIcon;\n /** Icon-chip classes (semantic accent tokens only). */\n chip: string;\n /** Card border colour class. */\n border: string;\n}\n\nconst NODE_META: Record<LineageNodeType, NodeMeta> = {\n source: {\n label: 'Source',\n Icon: Radar,\n chip: 'bg-accent-blue-subtle text-accent-blue',\n border: 'border-accent-blue',\n },\n collection: {\n label: 'Collection',\n Icon: Boxes,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n dataset: {\n label: 'Dataset',\n Icon: Database,\n chip: 'bg-accent-indigo-subtle text-accent-indigo',\n border: 'border-accent-indigo',\n },\n run: {\n label: 'Pipeline Run',\n Icon: Cog,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n notebook: {\n label: 'Notebook',\n Icon: NotebookText,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n analysis: {\n label: 'Analysis',\n Icon: LineChart,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n release: {\n label: 'Release',\n Icon: Tag,\n chip: 'bg-status-success-bg-subtle text-status-success-text',\n border: 'border-status-success-border',\n },\n};\n\ninterface Dims {\n nodeW: number;\n nodeH: number;\n colGap: number;\n rowGap: number;\n pad: number;\n iconSize: string;\n showSubtitle: boolean;\n}\n\nconst DIMS: Record<'full' | 'compact', Dims> = {\n full: {\n nodeW: 190,\n nodeH: 78,\n colGap: 74,\n rowGap: 30,\n pad: 32,\n iconSize: 'size-8',\n showSubtitle: true,\n },\n compact: {\n nodeW: 150,\n nodeH: 54,\n colGap: 46,\n rowGap: 18,\n pad: 18,\n iconSize: 'size-6',\n showSubtitle: false,\n },\n};\n\ninterface Positioned {\n node: LineageNode;\n x: number;\n y: number;\n}\n\ninterface Layout {\n positions: Map<string, Positioned>;\n width: number;\n height: number;\n}\n\nfunction computeLayout(model: LineageModel, dims: Dims): Layout {\n const positions = new Map<string, Positioned>();\n if (model.nodes.length === 0) {\n return { positions, width: dims.pad * 2, height: dims.pad * 2 };\n }\n\n // Present columns, remapped to contiguous indices so empty layers collapse.\n const presentCols = [...new Set(model.nodes.map((n) => n.column))].sort((a, b) => a - b);\n const colOrder = new Map(presentCols.map((c, i) => [c, i]));\n\n const byColumn = new Map<number, LineageNode[]>();\n for (const node of model.nodes) {\n const list = byColumn.get(node.column);\n if (list) {\n list.push(node);\n } else {\n byColumn.set(node.column, [node]);\n }\n }\n\n let contentH = dims.nodeH;\n for (const list of byColumn.values()) {\n const h = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n contentH = Math.max(contentH, h);\n }\n\n for (const col of presentCols) {\n const list = byColumn.get(col) ?? [];\n const colH = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n const startY = dims.pad + (contentH - colH) / 2;\n const x = dims.pad + (colOrder.get(col) ?? 0) * (dims.nodeW + dims.colGap);\n list.forEach((node, i) => {\n positions.set(node.id, { node, x, y: startY + i * (dims.nodeH + dims.rowGap) });\n });\n }\n\n const width =\n dims.pad * 2 + presentCols.length * dims.nodeW + (presentCols.length - 1) * dims.colGap;\n const height = dims.pad * 2 + contentH;\n return { positions, width, height };\n}\n\nfunction edgePath(x1: number, y1: number, x2: number, y2: number): string {\n const dx = Math.max(24, (x2 - x1) * 0.5);\n return `M ${x1} ${y1} C ${x1 + dx} ${y1}, ${x2 - dx} ${y2}, ${x2} ${y2}`;\n}\n\nexport interface LineageGraphProps {\n model: LineageModel;\n mode?: 'full' | 'compact';\n onNavigate?: (route: string) => void;\n className?: string;\n}\n\nexport function LineageGraph({ model, mode = 'full', onNavigate, className }: LineageGraphProps) {\n const markerId = `cos-lineage-arrow-${useId().replace(/:/g, '')}`;\n const dims = DIMS[mode];\n\n const layout = useMemo(() => computeLayout(model, dims), [model, dims]);\n\n const legendTypes = useMemo(() => {\n const seen = new Set<LineageNodeType>();\n const ordered: LineageNodeType[] = [];\n for (const node of [...model.nodes].sort((a, b) => a.column - b.column)) {\n if (!seen.has(node.type)) {\n seen.add(node.type);\n ordered.push(node.type);\n }\n }\n return ordered;\n }, [model.nodes]);\n\n if (model.nodes.length === 0) {\n return null;\n }\n\n return (\n <div className={cn('flex flex-col gap-3', className)}>\n {mode === 'full' && legendTypes.length > 0 ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n {legendTypes.map((type) => {\n const meta = NODE_META[type];\n return (\n <span\n key={type}\n className=\"inline-flex items-center gap-1.5 text-xs text-text-secondary\"\n >\n <span\n className={cn(\n 'flex size-5 items-center justify-center rounded-button',\n meta.chip\n )}\n >\n <meta.Icon className=\"size-3\" aria-hidden=\"true\" />\n </span>\n {meta.label}\n </span>\n );\n })}\n </div>\n ) : null}\n\n <div\n className={cn(\n 'overflow-x-auto rounded-card border border-border-seam bg-bg-canvas',\n mode === 'full' ? 'p-1' : 'p-0.5'\n )}\n >\n <div\n className=\"relative\"\n style={{\n width: layout.width,\n height: layout.height,\n minWidth: '100%',\n backgroundImage: 'radial-gradient(var(--color-border-subtle) 1px, transparent 1px)',\n backgroundSize: mode === 'full' ? '20px 20px' : '16px 16px',\n }}\n >\n {/* Edges (behind the node cards). */}\n <svg\n className=\"pointer-events-none absolute inset-0 text-border-strong\"\n width={layout.width}\n height={layout.height}\n viewBox={`0 0 ${layout.width} ${layout.height}`}\n aria-hidden=\"true\"\n >\n <defs>\n <marker\n id={markerId}\n viewBox=\"0 0 8 8\"\n refX=\"6.5\"\n refY=\"4\"\n markerWidth=\"6\"\n markerHeight=\"6\"\n orient=\"auto-start-reverse\"\n >\n <path d=\"M1 1 L7 4 L1 7 z\" fill=\"currentColor\" />\n </marker>\n </defs>\n {model.edges.map((edge) => {\n const from = layout.positions.get(edge.from);\n const to = layout.positions.get(edge.to);\n if (!from || !to) {\n return null;\n }\n const x1 = from.x + dims.nodeW;\n const y1 = from.y + dims.nodeH / 2;\n const x2 = to.x;\n const y2 = to.y + dims.nodeH / 2;\n return (\n <path\n key={`${edge.from}»${edge.to}`}\n d={edgePath(x1, y1, x2, y2)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={mode === 'full' ? 1.5 : 1.25}\n strokeLinecap=\"round\"\n markerEnd={`url(#${markerId})`}\n opacity={0.7}\n />\n );\n })}\n </svg>\n\n {/* Node cards. */}\n {[...layout.positions.values()].map(({ node, x, y }) => {\n const meta = NODE_META[node.type];\n const clickable = Boolean(node.route && onNavigate);\n const content = (\n <div\n className={cn(\n 'flex h-full w-full items-center gap-2.5 rounded-card border bg-bg-elevated px-3 shadow-sm transition-shadow',\n meta.border,\n clickable && 'group-hover:shadow-md',\n node.emphasis && 'ring-1 ring-border-strong'\n )}\n >\n <span\n className={cn(\n 'flex shrink-0 items-center justify-center rounded-button',\n dims.iconSize,\n meta.chip\n )}\n aria-hidden=\"true\"\n >\n <meta.Icon className={mode === 'full' ? 'size-4' : 'size-3.5'} />\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col text-left\">\n <span className=\"truncate text-[10px] font-medium uppercase tracking-wide text-text-tertiary\">\n {node.typeLabel ?? meta.label}\n </span>\n <span\n className={cn(\n 'truncate font-semibold text-text-primary',\n mode === 'full' ? 'text-sm' : 'text-xs'\n )}\n >\n {node.title}\n </span>\n {dims.showSubtitle && node.subtitle ? (\n <span className=\"truncate text-[11px] text-text-secondary\">\n {node.subtitle}\n </span>\n ) : null}\n </span>\n </div>\n );\n\n const style = { left: x, top: y, width: dims.nodeW, height: dims.nodeH } as const;\n\n if (clickable && node.route) {\n const route = node.route;\n return (\n <button\n key={node.id}\n type=\"button\"\n onClick={() => onNavigate?.(route)}\n className=\"group absolute rounded-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n style={style}\n title={`${node.typeLabel ?? meta.label}: ${node.title}`}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div key={node.id} className=\"absolute\" style={style}>\n {content}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nexport default LineageGraph;\n"],"mappings":";;;;;AAiGA,IAAMA,IAA0C;CAC9C,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,KAAK;CACL,UAAU;CACV,UAAU;CACV,SAAS;AACX;AAEA,SAASC,EAAU,GAAuB;CACxC,IAAMC,IAAQC,EAAM,QAAQ,MAAM,GAAG,CAAC,CAAC,YAAY;CACnD,OAAOD,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAM,MAAM,CAAC;AACtD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1
|
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { Skeleton as r, Spinner as i } from "@burdenoff/fe-libs/ui";
|
|
4
|
-
|
|
4
|
+
// src/cosmicintersection/components/LoadingState.tsx
|
|
5
5
|
function a({ variant: a = "spinner", rows: o = 5, label: s, className: c }) {
|
|
6
6
|
let l = e(), u = s ?? l("cosmicintersection.common.loading", "Loading…");
|
|
7
7
|
return a === "rows" ? /* @__PURE__ */ t("div", {
|
|
@@ -19,7 +19,6 @@ function a({ variant: a = "spinner", rows: o = 5, label: s, className: c }) {
|
|
|
19
19
|
})]
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { a as LoadingState, a as default };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=LoadingState.js.map
|