@burdenoff/microfe-cosmicintersection 2026.1109.7 → 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 +36 -33
- package/dist/cosmicintersection/CosmicIntersectionRoutes.js.map +1 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts +86 -1
- package/dist/cosmicintersection/api/cosmicApi.js +70 -14
- 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 +2 -0
- package/dist/cosmicintersection/pages/archive/ArchivePage.js +256 -0
- package/dist/cosmicintersection/pages/archive/ArchivePage.js.map +1 -0
- 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 +155 -85
- 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/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,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 </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default FacetPanel;\n"],"mappings":";;;;AAsCA,SAAgBA,EAAW,EAAE,WAAQ,aAAU,aAAU,YAAS,gBAA8B;CAC9F,IAAMC,IAAgB,OAAO,OAAOC,CAAQ,CAAC,CAAC,QAAQ,GAAK,MAAWC,IAAMC,EAAO,QAAQ,CAAC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-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,GAAU,KAAe,EAAwB,IAAI,GAGtD,IADW,EAAmB,IAAY,OAAO,CACnC,CAAA,CAAS,MAAM,sBAAsB,MAEnD,IAAe,OAAO,MAA+C;EACzE,IAAM,IAAO,EAAM,OAAO,QAAQ;EAElC,MAAM,OAAO,QAAQ,IAChB,GAIL;KAAa,EAAI;GACjB,IAAI;IACF,IAAM,IAAY,EAAK,KAAK,SAA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AC,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,IAChBD,GAIL;KAAa,EAAI;GACjB,IAAI;IACF,IAAME,IAAYF,EAAK,KAAK,SAAS,GAAG,IACpCA,EAAK,KAAK,UAAUA,EAAK,KAAK,YAAY,GAAG,IAAI,CAAC,IAClD,IACEG,IAAWH,EAAK,QAAQ,4BAExBI,IAAW,MAAMlB,EAAO,OAA+B;KAC3D,UAAUV;KACV,WAAW,EACT,OAAO;M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,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,IAAM,IAA0C;CAC9C,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,KAAK;CACL,UAAU;CACV,UAAU;CACV,SAAS;AACX;AAEA,SAAS,EAAU,GAAuB;CACxC,IAAM,IAAQ,EAAM,QAAQ,MAAM,GAAG,CAAC,CAAC,YAAY;CACnD,OAAO,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAM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EC,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;AAGA,IAAME,IAAN,MAAqB;CACnB,wBAAyB,IAAI,IAAyB;CACtD,2BAA4B,IAAI,IAAY;CAC5C,QAAwC,CAAC;CAEzC,QAAQ,GAAyB;EAC/B,IAAMC,IAAW,KAAK,MAAM,IAAIC,EAAK,EAAE;EACvC,AAAKD,IAKDC,EAAK,YAAY,CAACD,EAAS,YAC7B,KAAK,MAAM,IAAIC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ACE,WAAWsE,EACT,4DACA/B,EAAK,UACLiC,EAAK,IACP;OACA,eAAY;OAEZ,UAAA,kBAACA,EAAK,MAAN,EAAW,WAAWR,MAAS,SAAS,WAAW,WAAa,CAAA;MAC5D,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;OAAhB,UAAA;QACE,kBAAC,QAAD;SAAM,WAAU;SACb,UAAAhE,EAAK,aAAawE,EAAK;QACpB,CAAA;QACN,kBAAC,QAAD;SACE,WAAWF,EACT,4CACAN,MAAS,SAAS,YAAY,SAChC;SAEC,UAAAhE,EAAK;QACF,CAAA;QACLuC,EAAK,gBAAgBvC,EAAK,WACzB,kBAAC,QAAD;SAAM,WAAU;SACb,UAAAA,EAAK;QACF,CAAA,IACJ;OACA;MACH,CAAA,CAAA;K,IAGD8E,IAAQ;MAAE,MAAMxB;MAAG,KAAKyB;MAAG,OAAOxC,EAAK;MAAO,QAAQA,EAAK;KAAM;KAEvE,IAAIoC,KAAa3E,EAAK,OAAO;MAC3B,IAAMgF,IAAQhF,EAAK;MACnB,OACE,kBAAC,UAAD;OAEE,MAAK;OACL,eAAe4E,IAAaI,CAAK;OACjC,WAAU;OACH;OACP,OAAO,GAAGhF,EAAK,aAAawE,EAAK,MAAM,IAAIxE,EAAK;OAE/C,UAAA6E;MACK,GARD7E,EAAK,EAQJ;KAEZ;KAEA,OACE,kBAAC,OAAD;MAAmB,WAAU;MAAkB;MAC5C,UAAA6E;KACE,GAFK7E,EAAK,EAEV;IAET,CAAC,CACE;;EACF,CAAA,CACF;;AAET"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingState.js","names":[],"sources":["../../../src/cosmicintersection/components/LoadingState.tsx"],"sourcesContent":["import { Skeleton, Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface LoadingStateProps {\n /** `spinner` centres a spinner; `rows` renders shimmering list placeholders. */\n variant?: 'spinner' | 'rows';\n /** Number of placeholder rows for the `rows` variant. */\n rows?: number;\n label?: string;\n className?: string;\n}\n\n/**\n * Consistent loading affordance for every CosmicIntersection query surface.\n * Token-styled only — no raw palette colours.\n */\nexport function LoadingState({\n variant = 'spinner',\n rows = 5,\n label: labelProp,\n className,\n}: LoadingStateProps) {\n const tr = useTr();\n const label = labelProp ?? tr('cosmicintersection.common.loading', 'Loading…');\n if (variant === 'rows') {\n return (\n <div className={`space-y-3 ${className ?? ''}`} role=\"status\" aria-label={label}>\n {Array.from({ length: rows }).map((_, index) => (\n <Skeleton key={index} className=\"h-14 w-full rounded-card\" />\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={`flex min-h-[240px] flex-col items-center justify-center gap-3 ${className ?? ''}`}\n role=\"status\"\n aria-label={label}\n >\n <Spinner className=\"size-6 text-text-secondary\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n );\n}\n\nexport default LoadingState;\n"],"mappings":";;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"LoadingState.js","names":["LoadingState","labelProp","tr","useTr","label","variant","className","rows","Skeleton","index","Spinner"],"sources":["../../../src/cosmicintersection/components/LoadingState.tsx"],"sourcesContent":["import { Skeleton, Spinner } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport interface LoadingStateProps {\n /** `spinner` centres a spinner; `rows` renders shimmering list placeholders. */\n variant?: 'spinner' | 'rows';\n /** Number of placeholder rows for the `rows` variant. */\n rows?: number;\n label?: string;\n className?: string;\n}\n\n/**\n * Consistent loading affordance for every CosmicIntersection query surface.\n * Token-styled only — no raw palette colours.\n */\nexport function LoadingState({\n variant = 'spinner',\n rows = 5,\n label: labelProp,\n className,\n}: LoadingStateProps) {\n const tr = useTr();\n const label = labelProp ?? tr('cosmicintersection.common.loading', 'Loading…');\n if (variant === 'rows') {\n return (\n <div className={`space-y-3 ${className ?? ''}`} role=\"status\" aria-label={label}>\n {Array.from({ length: rows }).map((_, index) => (\n <Skeleton key={index} className=\"h-14 w-full rounded-card\" />\n ))}\n </div>\n );\n }\n\n return (\n <div\n className={`flex min-h-[240px] flex-col items-center justify-center gap-3 ${className ?? ''}`}\n role=\"status\"\n aria-label={label}\n >\n <Spinner className=\"size-6 text-text-secondary\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n );\n}\n\nexport default LoadingState;\n"],"mappings":";;;;AAgBA,SAAgBA,EAAa,EAC3B,aAAU,WACV,UAAO,GACP,OAAOC,GACP,gBACoB;CACpB,IAAMC,IAAKC,EAAM,GACXC,IAAQH,KAAaC,EAAG,qCAAqC,UAAU;CAW7E,OAVIG,MAAY,SAEZ,kBAAC,OAAD;EAAK,WAAW,aAAaC,KAAa;EAAM,MAAK;EAAS,cAAYF;EACvE,UAAA,MAAM,KAAK,EAAE,QAAQG,EAAK,CAAC,CAAC,CAAC,KAAK,GAAG,MACpC,kBAACC,GAAD,EAAsB,WAAU,2BAA4B,GAA7CC,CAA6C,CAC7D;CACE,CAAA,IAKP,kBAAC,OAAD;EACE,WAAW,iEAAiEH,KAAa;EACzF,MAAK;EACL,cAAYF;EAHd,UAAA,CAKE,kBAACM,GAAD,EAAS,WAAU,6BAA8B,CAAA,GACjD,kBAAC,KAAD;GAAG,WAAU;GAA+B,UAAAN;EAAS,CAAA,CAClD;;AAET"}
|
|
@@ -3,7 +3,7 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
|
3
3
|
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronLeft as a } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/cosmicintersection/components/PageLayout.tsx
|
|
7
7
|
function o({ title: o, description: s, actions: c, children: l, backPath: u }) {
|
|
8
8
|
let { navigate: d } = e(), f = t();
|
|
9
9
|
return /* @__PURE__ */ i("div", {
|
|
@@ -41,7 +41,6 @@ function o({ title: o, description: s, actions: c, children: l, backPath: u }) {
|
|
|
41
41
|
})]
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { o as PageLayout, o as default };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/cosmicintersection/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { ChevronLeft } from 'lucide-react';\nimport { useCosmicIntersection } from '../context/CosmicIntersectionContext';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n children: ReactNode;\n /** basePath-relative path for the header back button (e.g. \"datasets\"). */\n backPath?: string;\n}\n\n/**\n * Standard page scaffold: a sticky-feeling header (optional back button, title,\n * description, right-aligned actions) over a scrollable content region. Token\n * styling only.\n */\nexport function PageLayout({ title, description, actions, children, backPath }: PageLayoutProps) {\n const { navigate } = useCosmicIntersection();\n const tr = useTr();\n\n return (\n <div className={cn('flex h-full flex-col bg-bg-surface')}>\n <div\n className={cn(\n 'flex items-start justify-between gap-4 border-b border-border-seam bg-bg-surface px-6 py-5'\n )}\n >\n <div className=\"flex min-w-0 flex-col gap-1\">\n {backPath ? (\n <button\n type=\"button\"\n onClick={() => navigate(backPath)}\n className={cn(\n 'flex w-fit items-center gap-1 rounded-button text-sm text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus'\n )}\n >\n <ChevronLeft className=\"size-4\" aria-hidden=\"true\" />\n {tr('cosmicintersection.common.back', 'Back')}\n </button>\n ) : null}\n <h1 className={cn('truncate text-2xl font-semibold text-text-primary')}>{title}</h1>\n {description ? (\n <p className={cn('mt-0.5 text-sm text-text-secondary')}>{description}</p>\n ) : null}\n </div>\n {actions ? <div className=\"flex shrink-0 items-center gap-2\">{actions}</div> : null}\n </div>\n\n <div className={cn('flex-1 overflow-auto p-6')}>{children}</div>\n </div>\n );\n}\n\nexport default PageLayout;\n"],"mappings":";;;;;;AAoBA,
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":["PageLayout","useCosmicIntersection","tr","useTr","cn","backPath","navigate","ChevronLeft","title","description","actions"],"sources":["../../../src/cosmicintersection/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { ChevronLeft } from 'lucide-react';\nimport { useCosmicIntersection } from '../context/CosmicIntersectionContext';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n children: ReactNode;\n /** basePath-relative path for the header back button (e.g. \"datasets\"). */\n backPath?: string;\n}\n\n/**\n * Standard page scaffold: a sticky-feeling header (optional back button, title,\n * description, right-aligned actions) over a scrollable content region. Token\n * styling only.\n */\nexport function PageLayout({ title, description, actions, children, backPath }: PageLayoutProps) {\n const { navigate } = useCosmicIntersection();\n const tr = useTr();\n\n return (\n <div className={cn('flex h-full flex-col bg-bg-surface')}>\n <div\n className={cn(\n 'flex items-start justify-between gap-4 border-b border-border-seam bg-bg-surface px-6 py-5'\n )}\n >\n <div className=\"flex min-w-0 flex-col gap-1\">\n {backPath ? (\n <button\n type=\"button\"\n onClick={() => navigate(backPath)}\n className={cn(\n 'flex w-fit items-center gap-1 rounded-button text-sm text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-focus'\n )}\n >\n <ChevronLeft className=\"size-4\" aria-hidden=\"true\" />\n {tr('cosmicintersection.common.back', 'Back')}\n </button>\n ) : null}\n <h1 className={cn('truncate text-2xl font-semibold text-text-primary')}>{title}</h1>\n {description ? (\n <p className={cn('mt-0.5 text-sm text-text-secondary')}>{description}</p>\n ) : null}\n </div>\n {actions ? <div className=\"flex shrink-0 items-center gap-2\">{actions}</div> : null}\n </div>\n\n <div className={cn('flex-1 overflow-auto p-6')}>{children}</div>\n </div>\n );\n}\n\nexport default PageLayout;\n"],"mappings":";;;;;;AAoBA,SAAgBA,EAAW,EAAE,UAAO,gBAAa,YAAS,aAAU,eAA6B;CAC/F,IAAM,EAAE,gBAAaC,EAAsB,GACrCC,IAAKC,EAAM;CAEjB,OACE,kBAAC,OAAD;EAAK,WAAWC,EAAG,oCAAoC;EAAvD,UAAA,CACE,kBAAC,OAAD;GACE,WAAWA,EACT,4FACF;GAHF,UAAA,CAKE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGC,IACC,kBAAC,UAAD;MACE,MAAK;MACL,eAAeC,EAASD,CAAQ;MAChC,WAAWD,EACT,oMACF;MALF,UAAA,CAOE,kBAACG,GAAD;OAAa,WAAU;OAAS,eAAY;MAAQ,CAAA,GACnDL,EAAG,kCAAkC,MAAM,CACtC;KACN,CAAA,IAAA;KACJ,kBAAC,MAAD;MAAI,WAAWE,EAAG,mDAAmD;MAAI,UAAAI;KAAU,CAAA;KAClFC,IACC,kBAAC,KAAD;MAAG,WAAWL,EAAG,oCAAoC;MAAI,UAAAK;KAAe,CAAA,IACtE;IACD;GACJ,CAAA,GAAAC,IAAU,kBAAC,OAAD;IAAK,WAAU;IAAoC,UAAAA;GAAa,CAAA,IAAI,IAC5E;EAEL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAWN,EAAG,0BAA0B;GAAI;EAAc,CAAA,CAC5D;;AAET"}
|
|
@@ -29,4 +29,3 @@ export interface PaginationProps {
|
|
|
29
29
|
}
|
|
30
30
|
export declare function Pagination({ offset, limit, loadedCount, hasMore, onPrev, onNext, itemLabel, loading, className, }: PaginationProps): import('react').JSX.Element | null;
|
|
31
31
|
export default Pagination;
|
|
32
|
-
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { useState as t } from "react";
|
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { Button as i } from "@burdenoff/fe-libs/ui";
|
|
5
5
|
import { ChevronLeft as a, ChevronRight as o } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/cosmicintersection/components/Pagination.tsx
|
|
7
7
|
var s = 50;
|
|
8
8
|
function c(e = {}) {
|
|
9
9
|
let { pageSize: n = s, resetKey: r } = e, [i, a] = t(0), [o, c] = t(r);
|
|
@@ -62,7 +62,6 @@ function l({ offset: t, limit: s, loadedCount: c, hasMore: l, onPrev: u, onNext:
|
|
|
62
62
|
})]
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
//#endregion
|
|
66
65
|
export { l as Pagination, l as default, c as usePagination };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/cosmicintersection/components/Pagination.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * Offset/limit pagination for the CosmicIntersection list surfaces.\n *\n * The Cos* connection resolvers return `{ items, pageInfo { hasMore, cursor } }`\n * with NO total count, so paging is driven by `offset`/`limit` + the boolean\n * `hasMore` rather than a computable page count. `usePagination` owns the window;\n * the page feeds `limit`/`offset` into `PaginationInput`, then renders\n * `<Pagination>` with `hasMore` so Next gates correctly.\n */\n\nconst DEFAULT_PAGE_SIZE = 50;\n\nexport interface UsePaginationOptions {\n pageSize?: number;\n /** When this changes (a filter/search term), the window resets to page 1. */\n resetKey?: unknown;\n}\n\nexport interface UsePaginationResult {\n limit: number;\n offset: number;\n /** 1-based page index derived from offset/limit. */\n page: number;\n nextPage: () => void;\n prevPage: () => void;\n reset: () => void;\n}\n\nexport function usePagination(options: UsePaginationOptions = {}): UsePaginationResult {\n const { pageSize = DEFAULT_PAGE_SIZE, resetKey } = options;\n const [offset, setOffset] = useState(0);\n\n // Reset to the first page whenever resetKey changes (React's documented\n // derive-state-during-render pattern — no extra effect/render pass).\n const [prevResetKey, setPrevResetKey] = useState(resetKey);\n if (prevResetKey !== resetKey) {\n setPrevResetKey(resetKey);\n if (offset !== 0) {\n setOffset(0);\n }\n }\n\n return {\n limit: pageSize,\n offset,\n page: Math.floor(offset / Math.max(1, pageSize)) + 1,\n nextPage: () => setOffset((current) => current + pageSize),\n prevPage: () => setOffset((current) => Math.max(0, current - pageSize)),\n reset: () => setOffset(0),\n };\n}\n\nexport interface PaginationProps {\n offset: number;\n limit: number;\n /** Number of rows returned for the current page (`items.length`). */\n loadedCount: number;\n /** Whether the backend reports more rows after this page (`pageInfo.hasMore`). */\n hasMore: boolean;\n onPrev: () => void;\n onNext: () => void;\n /** Plural noun for the range label, e.g. \"datasets\". Defaults to \"items\". */\n itemLabel?: string;\n loading?: boolean;\n className?: string;\n}\n\nexport function Pagination({\n offset,\n limit,\n loadedCount,\n hasMore,\n onPrev,\n onNext,\n itemLabel = 'items',\n loading = false,\n className,\n}: PaginationProps) {\n const tr = useTr();\n // Nothing to page through: first page and no more results.\n if (offset === 0 && !hasMore && loadedCount === 0) {\n return null;\n }\n\n const rangeStart = loadedCount === 0 ? 0 : offset + 1;\n const rangeEnd = offset + loadedCount;\n const canPrev = offset > 0;\n const canNext = hasMore;\n const page = Math.floor(offset / Math.max(1, limit)) + 1;\n\n return (\n <div\n className={`flex flex-wrap items-center justify-between gap-3 pt-4 ${className ?? ''}`}\n role=\"navigation\"\n aria-label=\"Pagination\"\n >\n <p className=\"text-xs tabular-nums text-text-secondary\">\n {tr('cosmicintersection.common.showingResults', 'Showing {{from}}–{{to}} {{itemLabel}}', {\n from: rangeStart,\n to: rangeEnd,\n itemLabel,\n })}\n </p>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs tabular-nums text-text-secondary\">\n {tr('cosmicintersection.common.page', 'Page')} {page}\n </span>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={onPrev}\n disabled={!canPrev || loading}\n aria-label={tr('cosmicintersection.common.prev', 'Previous page')}\n >\n <ChevronLeft className=\"size-4\" />\n {tr('cosmicintersection.common.prev', 'Prev')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={onNext}\n disabled={!canNext || loading}\n aria-label={tr('cosmicintersection.common.next', 'Next page')}\n >\n {tr('cosmicintersection.common.next', 'Next')}\n <ChevronRight className=\"size-4\" />\n </Button>\n </div>\n </div>\n );\n}\n\nexport default Pagination;\n"],"mappings":";;;;;;AAeA,
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":["DEFAULT_PAGE_SIZE","usePagination","options","offset","setOffset","useState","prevResetKey","setPrevResetKey","resetKey","pageSize","current","Pagination","tr","useTr","hasMore","loadedCount","rangeStart","rangeEnd","canPrev","canNext","page","limit","className","Button","onPrev","loading","ChevronLeft","onNext","ChevronRight"],"sources":["../../../src/cosmicintersection/components/Pagination.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\n\n/**\n * Offset/limit pagination for the CosmicIntersection list surfaces.\n *\n * The Cos* connection resolvers return `{ items, pageInfo { hasMore, cursor } }`\n * with NO total count, so paging is driven by `offset`/`limit` + the boolean\n * `hasMore` rather than a computable page count. `usePagination` owns the window;\n * the page feeds `limit`/`offset` into `PaginationInput`, then renders\n * `<Pagination>` with `hasMore` so Next gates correctly.\n */\n\nconst DEFAULT_PAGE_SIZE = 50;\n\nexport interface UsePaginationOptions {\n pageSize?: number;\n /** When this changes (a filter/search term), the window resets to page 1. */\n resetKey?: unknown;\n}\n\nexport interface UsePaginationResult {\n limit: number;\n offset: number;\n /** 1-based page index derived from offset/limit. */\n page: number;\n nextPage: () => void;\n prevPage: () => void;\n reset: () => void;\n}\n\nexport function usePagination(options: UsePaginationOptions = {}): UsePaginationResult {\n const { pageSize = DEFAULT_PAGE_SIZE, resetKey } = options;\n const [offset, setOffset] = useState(0);\n\n // Reset to the first page whenever resetKey changes (React's documented\n // derive-state-during-render pattern — no extra effect/render pass).\n const [prevResetKey, setPrevResetKey] = useState(resetKey);\n if (prevResetKey !== resetKey) {\n setPrevResetKey(resetKey);\n if (offset !== 0) {\n setOffset(0);\n }\n }\n\n return {\n limit: pageSize,\n offset,\n page: Math.floor(offset / Math.max(1, pageSize)) + 1,\n nextPage: () => setOffset((current) => current + pageSize),\n prevPage: () => setOffset((current) => Math.max(0, current - pageSize)),\n reset: () => setOffset(0),\n };\n}\n\nexport interface PaginationProps {\n offset: number;\n limit: number;\n /** Number of rows returned for the current page (`items.length`). */\n loadedCount: number;\n /** Whether the backend reports more rows after this page (`pageInfo.hasMore`). */\n hasMore: boolean;\n onPrev: () => void;\n onNext: () => void;\n /** Plural noun for the range label, e.g. \"datasets\". Defaults to \"items\". */\n itemLabel?: string;\n loading?: boolean;\n className?: string;\n}\n\nexport function Pagination({\n offset,\n limit,\n loadedCount,\n hasMore,\n onPrev,\n onNext,\n itemLabel = 'items',\n loading = false,\n className,\n}: PaginationProps) {\n const tr = useTr();\n // Nothing to page through: first page and no more results.\n if (offset === 0 && !hasMore && loadedCount === 0) {\n return null;\n }\n\n const rangeStart = loadedCount === 0 ? 0 : offset + 1;\n const rangeEnd = offset + loadedCount;\n const canPrev = offset > 0;\n const canNext = hasMore;\n const page = Math.floor(offset / Math.max(1, limit)) + 1;\n\n return (\n <div\n className={`flex flex-wrap items-center justify-between gap-3 pt-4 ${className ?? ''}`}\n role=\"navigation\"\n aria-label=\"Pagination\"\n >\n <p className=\"text-xs tabular-nums text-text-secondary\">\n {tr('cosmicintersection.common.showingResults', 'Showing {{from}}–{{to}} {{itemLabel}}', {\n from: rangeStart,\n to: rangeEnd,\n itemLabel,\n })}\n </p>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs tabular-nums text-text-secondary\">\n {tr('cosmicintersection.common.page', 'Page')} {page}\n </span>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={onPrev}\n disabled={!canPrev || loading}\n aria-label={tr('cosmicintersection.common.prev', 'Previous page')}\n >\n <ChevronLeft className=\"size-4\" />\n {tr('cosmicintersection.common.prev', 'Prev')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={onNext}\n disabled={!canNext || loading}\n aria-label={tr('cosmicintersection.common.next', 'Next page')}\n >\n {tr('cosmicintersection.common.next', 'Next')}\n <ChevronRight className=\"size-4\" />\n </Button>\n </div>\n </div>\n );\n}\n\nexport default Pagination;\n"],"mappings":";;;;;;AAeA,IAAMA,IAAoB;AAkB1B,SAAgBC,EAAc,IAAgC,CAAC,GAAwB;CACrF,IAAM,EAAE,cAAWD,GAAmB,gBAAaE,GAC7C,CAACC,GAAQC,KAAaC,EAAS,CAAC,GAIhC,CAACC,GAAcC,KAAmBF,EAASG,CAAQ;CAQzD,OAPIF,MAAiBE,MACnBD,EAAgBC,CAAQ,GACpBL,MAAW,KACbC,EAAU,CAAC,IAIR;EACL,OAAOK;EACP;EACA,MAAM,KAAK,MAAMN,IAAS,KAAK,IAAI,GAAGM,CAAQ,CA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U,SAAU,CAAA,CAC5B;;GACL;EACF,CAAA,CAAA;;AAET"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useCosAiDraftReleaseMutation as e, useCosCreateReleaseMutation as t } from "../api/cosmicApi.js";
|
|
2
|
+
import { useCosmicIntersection as n } from "../context/CosmicIntersectionContext.js";
|
|
3
|
+
import { notify as r } from "../lib/toast.js";
|
|
4
4
|
import { AiGeneratedDisclaimer as i, AiRunAttribution as a } from "./AiRunAttribution.js";
|
|
5
5
|
import { useRef as o, useState as s } from "react";
|
|
6
6
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
import { Button as d, Input as f, Label as p, Textarea as m } from "@burdenoff/fe-libs/ui";
|
|
8
8
|
import { Sparkles as h } from "lucide-react";
|
|
9
|
-
|
|
9
|
+
// src/cosmicintersection/components/ReleaseDraftDialog.tsx
|
|
10
10
|
function g({ notebook: g, open: _, onOpenChange: v }) {
|
|
11
|
-
let { navigate: y } =
|
|
11
|
+
let { navigate: y } = n(), [b, { loading: x }] = e(), [S, { loading: C }] = t(), [w, T] = s(null), [E, D] = s(""), [O, k] = s(""), [A, j] = s(""), [M, N] = s(""), [P, F] = s(""), I = o(null), L = x || C, R = (e) => {
|
|
12
12
|
L || (v(e), e || T(null));
|
|
13
13
|
}, z = () => {
|
|
14
14
|
I.current?.abort(), I.current = null;
|
|
@@ -23,11 +23,7 @@ function g({ notebook: g, open: _, onOpenChange: v }) {
|
|
|
23
23
|
let n = t.data?.cosAiDraftRelease;
|
|
24
24
|
n && (T(n), D(n.title), k(n.abstract), j(n.version), N(n.authors.join(", ")), F(n.license));
|
|
25
25
|
}, V = async () => {
|
|
26
|
-
|
|
27
|
-
t.error("Title is required", "A release needs a title before it can be drafted.");
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
(await S({ variables: { input: {
|
|
26
|
+
E.trim() ? (await S({ variables: { input: {
|
|
31
27
|
title: E.trim(),
|
|
32
28
|
abstract: O.trim() || void 0,
|
|
33
29
|
version: A.trim() || void 0,
|
|
@@ -35,7 +31,7 @@ function g({ notebook: g, open: _, onOpenChange: v }) {
|
|
|
35
31
|
license: P.trim() || void 0,
|
|
36
32
|
datasetIds: w?.datasetIds ?? g.datasetIds,
|
|
37
33
|
notebookId: g.id
|
|
38
|
-
} } })).data?.cosCreateRelease && (
|
|
34
|
+
} } })).data?.cosCreateRelease && (r.success("Draft release created", "Review it on the Releases page before publishing."), R(!1), y("releases")) : r.error("Title is required", "A release needs a title before it can be drafted.");
|
|
39
35
|
};
|
|
40
36
|
return _ ? /* @__PURE__ */ u("div", {
|
|
41
37
|
className: "space-y-4 rounded-card border border-border-default bg-bg-elevated p-5",
|
|
@@ -187,7 +183,6 @@ function g({ notebook: g, open: _, onOpenChange: v }) {
|
|
|
187
183
|
]
|
|
188
184
|
}) : null;
|
|
189
185
|
}
|
|
190
|
-
//#endregion
|
|
191
186
|
export { g as ReleaseDraftDialog };
|
|
192
187
|
|
|
193
188
|
//# sourceMappingURL=ReleaseDraftDialog.js.map
|