@burdenoff/microfe-cosmicintersection 2026.1110.1 → 2026.1111.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cosmicintersection/CosmicIntersectionRoot.d.ts +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoot.js +1 -2
- package/dist/cosmicintersection/CosmicIntersectionRoot.js.map +1 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.js +1 -2
- package/dist/cosmicintersection/CosmicIntersectionRoutes.js.map +1 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts +0 -1
- package/dist/cosmicintersection/api/cosmicApi.js +1 -2
- package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
- package/dist/cosmicintersection/api/databricksTransport.d.ts +0 -1
- package/dist/cosmicintersection/api/databricksTransport.js +1 -2
- package/dist/cosmicintersection/api/databricksTransport.js.map +1 -1
- package/dist/cosmicintersection/api/tagsApi.d.ts +0 -1
- package/dist/cosmicintersection/api/tagsApi.js +1 -2
- package/dist/cosmicintersection/api/tagsApi.js.map +1 -1
- package/dist/cosmicintersection/components/ActionMenu.d.ts +0 -1
- package/dist/cosmicintersection/components/ActionMenu.js +1 -2
- package/dist/cosmicintersection/components/ActionMenu.js.map +1 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.js +27 -25
- package/dist/cosmicintersection/components/ActivityFeedPanel.js.map +1 -1
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts +0 -1
- package/dist/cosmicintersection/components/AiRunAttribution.js +1 -2
- package/dist/cosmicintersection/components/AiRunAttribution.js.map +1 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts +0 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.js +1 -2
- package/dist/cosmicintersection/components/DatabricksQueueForm.js.map +1 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.js +1 -2
- package/dist/cosmicintersection/components/DatabricksRunPanel.js.map +1 -1
- package/dist/cosmicintersection/components/DiscussionPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/DiscussionPanel.js +4 -4
- package/dist/cosmicintersection/components/DiscussionPanel.js.map +1 -1
- package/dist/cosmicintersection/components/EmptyState.d.ts +0 -1
- package/dist/cosmicintersection/components/EmptyState.js +1 -2
- package/dist/cosmicintersection/components/EmptyState.js.map +1 -1
- package/dist/cosmicintersection/components/EntityFormShell.d.ts +0 -1
- package/dist/cosmicintersection/components/EntityFormShell.js +1 -2
- package/dist/cosmicintersection/components/EntityFormShell.js.map +1 -1
- package/dist/cosmicintersection/components/EntityTagsField.d.ts +0 -1
- package/dist/cosmicintersection/components/EntityTagsField.js +1 -2
- package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
- package/dist/cosmicintersection/components/ErrorState.d.ts +0 -1
- package/dist/cosmicintersection/components/ErrorState.js +1 -2
- package/dist/cosmicintersection/components/ErrorState.js.map +1 -1
- package/dist/cosmicintersection/components/FacetPanel.d.ts +0 -1
- package/dist/cosmicintersection/components/FacetPanel.js +1 -2
- package/dist/cosmicintersection/components/FacetPanel.js.map +1 -1
- package/dist/cosmicintersection/components/FileUploadField.d.ts +5 -2
- package/dist/cosmicintersection/components/FileUploadField.js +80 -76
- 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/uploadAudience.d.ts +4 -0
- package/dist/cosmicintersection/lib/uploadAudience.js +17 -0
- package/dist/cosmicintersection/lib/uploadAudience.js.map +1 -0
- 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 +260 -260
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.d.ts +0 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.js +23 -48
- package/dist/cosmicintersection/pages/archive/ArchivePage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js +32 -33
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +17 -18
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.js +20 -21
- package/dist/cosmicintersection/pages/collections/CollectionsPage.js.map +1 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.js +19 -20
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +64 -75
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +131 -119
- 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 +154 -149
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js +28 -29
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js +119 -120
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +41 -42
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js +30 -31
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js +16 -17
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +268 -269
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js +194 -195
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.js +20 -21
- package/dist/cosmicintersection/pages/runs/RunsPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js +31 -32
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js +23 -24
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts +0 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.js +184 -182
- package/dist/cosmicintersection/pages/sources/SourcesPage.js.map +1 -1
- package/dist/cosmicintersection/types/index.d.ts +0 -1
- package/dist/cosmicintersection/utils/cn.d.ts +0 -1
- package/dist/cosmicintersection/utils/cn.js +1 -2
- package/dist/cosmicintersection/utils/cn.js.map +1 -1
- package/dist/cosmicintersection/utils/i18n.d.ts +0 -1
- package/dist/cosmicintersection/utils/navigation.d.ts +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/generated/global-types.d.ts +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -1
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -3
- package/dist/node_modules/clsx/dist/clsx.js +7 -6
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/services/createSandboxAssistantTransport.js +1 -2
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/services/recentItems.d.ts +0 -1
- package/dist/services/recentItems.js +5 -6
- package/dist/services/recentItems.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +0 -1
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/stories/EmptyState.stories.d.ts +0 -1
- package/dist/stories/LoadingState.stories.d.ts +0 -1
- package/dist/stories/ScienceCanvas.stories.d.ts +0 -1
- package/dist/stories/StatusBadge.stories.d.ts +0 -1
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts +0 -1
- package/dist/test/fakeGateway.d.ts +0 -1
- package/dist/test/fixtures.d.ts +0 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/test/i18nMock.d.ts +13 -1
- package/dist/test/renderWithProviders.d.ts +1 -2
- package/dist/test/storage.d.ts +13 -0
- package/dist/types/assistant.d.ts +0 -1
- package/dist/utils/pageContext.d.ts +0 -1
- package/dist/utils/pageContext.js +1 -2
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +64 -38
- package/dist/cosmicintersection/CosmicIntersectionRoot.d.ts.map +0 -1
- package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts.map +0 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts.map +0 -1
- package/dist/cosmicintersection/api/databricksTransport.d.ts.map +0 -1
- package/dist/cosmicintersection/api/tagsApi.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ActionMenu.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/DiscussionPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EmptyState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EntityFormShell.d.ts.map +0 -1
- package/dist/cosmicintersection/components/EntityTagsField.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ErrorState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/FacetPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/FileUploadField.d.ts.map +0 -1
- package/dist/cosmicintersection/components/LineageGraph.d.ts.map +0 -1
- package/dist/cosmicintersection/components/LoadingState.d.ts.map +0 -1
- package/dist/cosmicintersection/components/PageLayout.d.ts.map +0 -1
- package/dist/cosmicintersection/components/Pagination.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ResultsChart.d.ts.map +0 -1
- package/dist/cosmicintersection/components/RunTriageCard.d.ts.map +0 -1
- package/dist/cosmicintersection/components/SafeLink.d.ts.map +0 -1
- package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts.map +0 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +0 -1
- package/dist/cosmicintersection/components/StatusBadge.d.ts.map +0 -1
- package/dist/cosmicintersection/components/StepDAG.d.ts.map +0 -1
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +0 -1
- package/dist/cosmicintersection/components/index.d.ts.map +0 -1
- package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts.map +0 -1
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +0 -1
- package/dist/cosmicintersection/index.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/assistantAwareDialog.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksForm.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksIntent.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/databricksPresentation.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/mutationResult.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/toast.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/useSelectedRecord.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/visualization.d.ts.map +0 -1
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/archive/ArchivePage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/datasets/DatasetsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/lineage/LineagePage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/runs/RunsPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +0 -1
- package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts.map +0 -1
- package/dist/cosmicintersection/types/index.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/cn.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/i18n.d.ts.map +0 -1
- package/dist/cosmicintersection/utils/navigation.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/services/createSandboxAssistantTransport.d.ts.map +0 -1
- package/dist/services/recentItems.d.ts.map +0 -1
- package/dist/shared/hooks/useTr.d.ts.map +0 -1
- package/dist/stories/EmptyState.stories.d.ts.map +0 -1
- package/dist/stories/LoadingState.stories.d.ts.map +0 -1
- package/dist/stories/ScienceCanvas.stories.d.ts.map +0 -1
- package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +0 -1
- package/dist/test/fakeGateway.d.ts.map +0 -1
- package/dist/test/fixtures.d.ts.map +0 -1
- package/dist/test/i18nMock.d.ts.map +0 -1
- package/dist/test/renderWithProviders.d.ts.map +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.d.ts.map +0 -1
- package/dist/types/assistant.d.ts.map +0 -1
- package/dist/utils/pageContext.d.ts.map +0 -1
|
@@ -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,MAAM,CAAC;AACtD;AAGA,IAAM,IAAN,MAAqB;CACnB,wBAAyB,IAAI,IAAyB;CACtD,2BAA4B,IAAI,IAAY;CAC5C,QAAwC,CAAC;CAEzC,QAAQ,GAAyB;EAC/B,IAAM,IAAW,KAAK,MAAM,IAAI,EAAK,EAAE;EACvC,IAAI,CAAC,GAAU;GACb,KAAK,MAAM,IAAI,EAAK,IAAI,CAAI;GAC5B;EACF;EAEA,AAAI,EAAK,YAAY,CAAC,EAAS,YAC7B,KAAK,MAAM,IAAI,EAAK,IAAI;GAAE,GAAG;GAAU,UAAU;EAAK,CAAC;CAE3D;CAEA,KAAK,GAAc,GAAkB;EAKnC,IAJI,MAAS,KAIT,CAAC,KAAK,MAAM,IAAI,CAAI,KAAK,CAAC,KAAK,MAAM,IAAI,CAAE,GAC7C;EAEF,IAAM,IAAM,GAAG,EAAK,GAAG;EACnB,KAAK,SAAS,IAAI,CAAG,MAGzB,KAAK,SAAS,IAAI,CAAG,GACrB,KAAK,MAAM,KAAK;GAAE;GAAM;EAAG,CAAC;CAC9B;CAEA,IAAI,GAAqB;EACvB,OAAO,KAAK,MAAM,IAAI,CAAE;CAC1B;CAEA,QAAsB;EACpB,OAAO;GAAE,OAAO,CAAC,GAAG,KAAK,MAAM,OAAO,CAAC;GAAG,OAAO,KAAK;EAAM;CAC9D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,OAAD;MACE,WAAW,EACT,+GACA,EAAK,QACL,KAAa,yBACb,EAAK,YAAY,2BACnB;gBANF,CAQE,kBAAC,QAAD;OACE,WAAW,EACT,4DACA,EAAK,UACL,EAAK,IACP;OACA,eAAY;iBAEZ,kBAAC,EAAK,MAAN,EAAW,WAAW,MAAS,SAAS,WAAW,WAAa,CAAA;MAC5D,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;iBAAhB;QACE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAK,aAAa,EAAK;QACpB,CAAA;QACN,kBAAC,QAAD;SACE,WAAW,EACT,4CACA,MAAS,SAAS,YAAY,SAChC;mBAEC,EAAK;QACF,CAAA;QACL,EAAK,gBAAgB,EAAK,WACzB,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAK;QACF,CAAA,IACJ;OACA;QACH;SAGD,IAAQ;MAAE,MAAM;MAAG,KAAK;MAAG,OAAO,EAAK;MAAO,QAAQ,EAAK;KAAM;KAEvE,IAAI,KAAa,EAAK,OAAO;MAC3B,IAAM,IAAQ,EAAK;MACnB,OACE,kBAAC,UAAD;OAEE,MAAK;OACL,eAAe,IAAa,CAAK;OACjC,WAAU;OACH;OACP,OAAO,GAAG,EAAK,aAAa,EAAK,MAAM,IAAI,EAAK;iBAE/C;MACK,GARD,EAAK,EAQJ;KAEZ;KAEA,OACE,kBAAC,OAAD;MAAmB,WAAU;MAAkB;gBAC5C;KACE,GAFK,EAAK,EAEV;IAET,CAAC,CACE;;EACF,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"LineageGraph.js","names":["COLUMN","humanEnum","lower","value","LineageBuilder","existing","node","from","to","key","id","nid","addDatasetUpstream","builder","dataset","source","pools","collection","addDatasetDownstream","datasetNode","run","pipelineName","notebook","analysis","linkedToNotebook","release","addReleaseNode","doiSuffix","buildDatasetLineage","datasetId","buildReleaseLineage","item","releaseId","NODE_META","Radar","Boxes","Database","Cog","NotebookText","LineChart","Tag","DIMS","computeLayout","positions","model","dims","presentCols","n","a","b","colOrder","c","i","byColumn","list","contentH","h","col","colH","startY","x","edgePath","dx","x2","x1","y1","y2","LineageGraph","markerId","useId","mode","layout","useMemo","legendTypes","seen","ordered","cn","className","meta","type","edge","clickable","onNavigate","content","style","y","route"],"sources":["../../../src/cosmicintersection/components/LineageGraph.tsx"],"sourcesContent":["/**\n * LineageGraph — a reusable, dependency-free provenance DAG for CosmicIntersection.\n *\n * Renders a typed, left-to-right lineage graph (Source → Dataset → Pipeline Run →\n * Notebook / Analysis → Release) as custom inline SVG edges + absolutely-positioned\n * token-styled node cards. No graph library — the layout is a simple column/row\n * solver, edges are cubic-bezier `<path>`s. Every colour comes from fe-libs semantic\n * tokens (bg-*, text-*, border-*, status-*, accent-*) so it renders in every theme.\n *\n * The graph MODEL is derived client-side from existing cos entities by the pure\n * `buildDatasetLineage` / `buildReleaseLineage` builders exported below — the\n * component itself never fetches. Nodes with a `route` are clickable and call\n * `onNavigate` (basePath-relative), matching the rest of the MFE's navigation.\n *\n * Modes:\n * - `full` — page mode (larger cards, legend, dotted canvas). See mockup 20.\n * - `compact` — detail-panel mini map (smaller cards, no legend). See mockup 03.\n */\nimport { useId, useMemo } from 'react';\nimport {\n Boxes,\n Cog,\n Database,\n LineChart,\n NotebookText,\n Radar,\n Tag,\n type LucideIcon,\n} from 'lucide-react';\n\nimport type {\n CosAnalysis,\n CosCollection,\n CosDataset,\n CosNotebook,\n CosPipeline,\n CosPipelineRun,\n CosRelease,\n CosSource,\n} from '../api/cosmicApi';\nimport { cn } from '../utils/cn';\n\n// ============================================================================\n// MODEL\n// ============================================================================\n\nexport type LineageNodeType =\n 'source' | 'collection' | 'dataset' | 'run' | 'notebook' | 'analysis' | 'release';\n\nexport interface LineageNode {\n /** Stable, unique within a model (e.g. `ds:<uuid>`). */\n id: string;\n type: LineageNodeType;\n title: string;\n /** Overrides the default type label (e.g. \"Pipeline Run #340\"). */\n typeLabel?: string;\n /** Small third line — status, version, DOI hint (hidden in compact mode). */\n subtitle?: string;\n /** basePath-relative route; when set (and `onNavigate` given) the node is clickable. */\n route?: string;\n /** Semantic column / layer index, 0 = leftmost (upstream). */\n column: number;\n /** Highlight the graph root (the entity the lineage was requested for). */\n emphasis?: boolean;\n}\n\nexport interface LineageEdge {\n from: string;\n to: string;\n}\n\nexport interface LineageModel {\n nodes: LineageNode[];\n edges: LineageEdge[];\n}\n\n/** Data pools the builders read from — resolved maps + already-filtered lists. */\nexport interface LineageDataPools {\n datasetsById: Map<string, CosDataset>;\n sourcesById: Map<string, CosSource>;\n /**\n * Only the collection's display name is read, so this accepts any collection\n * shape carrying it — including the id-only-`datasets` rows the collections\n * list query returns.\n */\n collectionsById: Map<string, Pick<CosCollection, 'id' | 'name'>>;\n runs: CosPipelineRun[];\n notebooks: CosNotebook[];\n analyses: CosAnalysis[];\n releases: CosRelease[];\n pipelinesById?: Map<string, CosPipeline>;\n}\n\n// ============================================================================\n// BUILDERS (pure — no hooks, no fetching)\n// ============================================================================\n\nconst COLUMN: Record<LineageNodeType, number> = {\n source: 0,\n collection: 0,\n dataset: 1,\n run: 2,\n notebook: 3,\n analysis: 4,\n release: 5,\n};\n\nfunction humanEnum(value: string): string {\n const lower = value.replace(/_/g, ' ').toLowerCase();\n return lower.charAt(0).toUpperCase() + lower.slice(1);\n}\n\n/** Incrementally assembles a de-duplicated node/edge model. */\nclass LineageBuilder {\n private readonly nodes = new Map<string, LineageNode>();\n private readonly edgeKeys = new Set<string>();\n private readonly edges: LineageEdge[] = [];\n\n addNode(node: LineageNode): void {\n const existing = this.nodes.get(node.id);\n if (!existing) {\n this.nodes.set(node.id, node);\n return;\n }\n // Preserve an emphasis flag once set (root wins over a later plain add).\n if (node.emphasis && !existing.emphasis) {\n this.nodes.set(node.id, { ...existing, emphasis: true });\n }\n }\n\n link(from: string, to: string): void {\n if (from === to) {\n return;\n }\n // Only connect endpoints that actually exist in the graph.\n if (!this.nodes.has(from) || !this.nodes.has(to)) {\n return;\n }\n const key = `${from}»${to}`;\n if (this.edgeKeys.has(key)) {\n return;\n }\n this.edgeKeys.add(key);\n this.edges.push({ from, to });\n }\n\n has(id: string): boolean {\n return this.nodes.has(id);\n }\n\n build(): LineageModel {\n return { nodes: [...this.nodes.values()], edges: this.edges };\n }\n}\n\nconst nid = {\n source: (id: string) => `src:${id}`,\n collection: (id: string) => `col:${id}`,\n dataset: (id: string) => `ds:${id}`,\n run: (id: string) => `run:${id}`,\n notebook: (id: string) => `nb:${id}`,\n analysis: (id: string) => `an:${id}`,\n release: (id: string) => `rel:${id}`,\n};\n\n/** Add a dataset node plus its upstream source/collection to the builder. */\nfunction addDatasetUpstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools,\n emphasis: boolean\n): void {\n builder.addNode({\n id: nid.dataset(dataset.id),\n type: 'dataset',\n title: dataset.name,\n subtitle: humanEnum(dataset.status),\n route: `datasets/${dataset.id}`,\n column: COLUMN.dataset,\n emphasis,\n });\n\n if (dataset.sourceId) {\n const source = pools.sourcesById.get(dataset.sourceId);\n builder.addNode({\n id: nid.source(dataset.sourceId),\n type: 'source',\n title: source?.name ?? 'Linked source',\n subtitle: source ? humanEnum(source.type) : undefined,\n route: `sources/${dataset.sourceId}`,\n column: COLUMN.source,\n });\n builder.link(nid.source(dataset.sourceId), nid.dataset(dataset.id));\n }\n\n if (dataset.collectionId) {\n const collection = pools.collectionsById.get(dataset.collectionId);\n builder.addNode({\n id: nid.collection(dataset.collectionId),\n type: 'collection',\n title: collection?.name ?? 'Collection',\n route: `collections/${dataset.collectionId}`,\n column: COLUMN.collection,\n });\n builder.link(nid.collection(dataset.collectionId), nid.dataset(dataset.id));\n }\n}\n\n/** Add the downstream fan for a dataset: runs, notebooks, analyses, releases. */\nfunction addDatasetDownstream(\n builder: LineageBuilder,\n dataset: CosDataset,\n pools: LineageDataPools\n): void {\n const datasetNode = nid.dataset(dataset.id);\n\n for (const run of pools.runs) {\n if (run.datasetId !== dataset.id) {\n continue;\n }\n const pipelineName = run.pipelineId\n ? pools.pipelinesById?.get(run.pipelineId)?.name\n : undefined;\n builder.addNode({\n id: nid.run(run.id),\n type: 'run',\n typeLabel: `Pipeline Run #${run.runNumber}`,\n title: pipelineName ?? `Run #${run.runNumber}`,\n subtitle: humanEnum(run.status),\n route: `runs/${run.id}`,\n column: COLUMN.run,\n });\n builder.link(datasetNode, nid.run(run.id));\n }\n\n for (const notebook of pools.notebooks) {\n if (!notebook.datasetIds.includes(dataset.id)) {\n continue;\n }\n builder.addNode({\n id: nid.notebook(notebook.id),\n type: 'notebook',\n title: notebook.title,\n subtitle: humanEnum(notebook.status),\n route: `notebooks/${notebook.id}`,\n column: COLUMN.notebook,\n });\n builder.link(datasetNode, nid.notebook(notebook.id));\n }\n\n for (const analysis of pools.analyses) {\n const linkedToNotebook =\n analysis.notebookId != null && builder.has(nid.notebook(analysis.notebookId));\n if (analysis.datasetId !== dataset.id && !linkedToNotebook) {\n continue;\n }\n builder.addNode({\n id: nid.analysis(analysis.id),\n type: 'analysis',\n title: analysis.title,\n subtitle: humanEnum(analysis.status),\n // No per-analysis detail route exists — land on the analyses list.\n route: 'analyses',\n column: COLUMN.analysis,\n });\n if (linkedToNotebook && analysis.notebookId != null) {\n builder.link(nid.notebook(analysis.notebookId), nid.analysis(analysis.id));\n } else {\n builder.link(datasetNode, nid.analysis(analysis.id));\n }\n }\n\n for (const release of pools.releases) {\n if (!release.datasetIds.includes(dataset.id)) {\n continue;\n }\n addReleaseNode(builder, release);\n builder.link(datasetNode, nid.release(release.id));\n if (release.notebookId != null && builder.has(nid.notebook(release.notebookId))) {\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n }\n }\n}\n\nfunction addReleaseNode(builder: LineageBuilder, release: CosRelease, emphasis = false): void {\n const doiSuffix = release.doi ? ' · DOI' : '';\n builder.addNode({\n id: nid.release(release.id),\n type: 'release',\n title: release.title,\n subtitle: `v${release.version}${doiSuffix}`,\n // No per-release detail route exists — land on the releases list.\n route: 'releases',\n column: COLUMN.release,\n emphasis,\n });\n}\n\n/**\n * Provenance for a single dataset: its upstream (source + collection) and its\n * full downstream fan (runs, notebooks, analyses, releases). The dataset is the\n * emphasised root.\n */\nexport function buildDatasetLineage(datasetId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n return builder.build();\n }\n addDatasetUpstream(builder, dataset, pools, true);\n addDatasetDownstream(builder, dataset, pools);\n return builder.build();\n}\n\n/**\n * Provenance for a release: the release plus its input datasets and notebook,\n * each expanded UPSTREAM (source/collection for datasets; the notebook's own\n * datasets). The release is the emphasised root.\n */\nexport function buildReleaseLineage(releaseId: string, pools: LineageDataPools): LineageModel {\n const builder = new LineageBuilder();\n const release = pools.releases.find((item) => item.id === releaseId);\n if (!release) {\n return builder.build();\n }\n\n addReleaseNode(builder, release, true);\n\n for (const datasetId of release.datasetIds) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.release(release.id));\n }\n\n if (release.notebookId != null) {\n const notebook = pools.notebooks.find((item) => item.id === release.notebookId);\n builder.addNode({\n id: nid.notebook(release.notebookId),\n type: 'notebook',\n title: notebook?.title ?? 'Notebook',\n subtitle: notebook ? humanEnum(notebook.status) : undefined,\n route: `notebooks/${release.notebookId}`,\n column: COLUMN.notebook,\n });\n builder.link(nid.notebook(release.notebookId), nid.release(release.id));\n\n for (const datasetId of notebook?.datasetIds ?? []) {\n const dataset = pools.datasetsById.get(datasetId);\n if (!dataset) {\n continue;\n }\n addDatasetUpstream(builder, dataset, pools, false);\n builder.link(nid.dataset(dataset.id), nid.notebook(release.notebookId));\n }\n }\n\n return builder.build();\n}\n\n// ============================================================================\n// PRESENTATION\n// ============================================================================\n\ninterface NodeMeta {\n label: string;\n Icon: LucideIcon;\n /** Icon-chip classes (semantic accent tokens only). */\n chip: string;\n /** Card border colour class. */\n border: string;\n}\n\nconst NODE_META: Record<LineageNodeType, NodeMeta> = {\n source: {\n label: 'Source',\n Icon: Radar,\n chip: 'bg-accent-blue-subtle text-accent-blue',\n border: 'border-accent-blue',\n },\n collection: {\n label: 'Collection',\n Icon: Boxes,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n dataset: {\n label: 'Dataset',\n Icon: Database,\n chip: 'bg-accent-indigo-subtle text-accent-indigo',\n border: 'border-accent-indigo',\n },\n run: {\n label: 'Pipeline Run',\n Icon: Cog,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n notebook: {\n label: 'Notebook',\n Icon: NotebookText,\n chip: 'bg-accent-teal-subtle text-accent-teal',\n border: 'border-accent-teal',\n },\n analysis: {\n label: 'Analysis',\n Icon: LineChart,\n chip: 'bg-accent-purple-subtle text-accent-purple',\n border: 'border-accent-purple',\n },\n release: {\n label: 'Release',\n Icon: Tag,\n chip: 'bg-status-success-bg-subtle text-status-success-text',\n border: 'border-status-success-border',\n },\n};\n\ninterface Dims {\n nodeW: number;\n nodeH: number;\n colGap: number;\n rowGap: number;\n pad: number;\n iconSize: string;\n showSubtitle: boolean;\n}\n\nconst DIMS: Record<'full' | 'compact', Dims> = {\n full: {\n nodeW: 190,\n nodeH: 78,\n colGap: 74,\n rowGap: 30,\n pad: 32,\n iconSize: 'size-8',\n showSubtitle: true,\n },\n compact: {\n nodeW: 150,\n nodeH: 54,\n colGap: 46,\n rowGap: 18,\n pad: 18,\n iconSize: 'size-6',\n showSubtitle: false,\n },\n};\n\ninterface Positioned {\n node: LineageNode;\n x: number;\n y: number;\n}\n\ninterface Layout {\n positions: Map<string, Positioned>;\n width: number;\n height: number;\n}\n\nfunction computeLayout(model: LineageModel, dims: Dims): Layout {\n const positions = new Map<string, Positioned>();\n if (model.nodes.length === 0) {\n return { positions, width: dims.pad * 2, height: dims.pad * 2 };\n }\n\n // Present columns, remapped to contiguous indices so empty layers collapse.\n const presentCols = [...new Set(model.nodes.map((n) => n.column))].sort((a, b) => a - b);\n const colOrder = new Map(presentCols.map((c, i) => [c, i]));\n\n const byColumn = new Map<number, LineageNode[]>();\n for (const node of model.nodes) {\n const list = byColumn.get(node.column);\n if (list) {\n list.push(node);\n } else {\n byColumn.set(node.column, [node]);\n }\n }\n\n let contentH = dims.nodeH;\n for (const list of byColumn.values()) {\n const h = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n contentH = Math.max(contentH, h);\n }\n\n for (const col of presentCols) {\n const list = byColumn.get(col) ?? [];\n const colH = list.length * dims.nodeH + (list.length - 1) * dims.rowGap;\n const startY = dims.pad + (contentH - colH) / 2;\n const x = dims.pad + (colOrder.get(col) ?? 0) * (dims.nodeW + dims.colGap);\n list.forEach((node, i) => {\n positions.set(node.id, { node, x, y: startY + i * (dims.nodeH + dims.rowGap) });\n });\n }\n\n const width =\n dims.pad * 2 + presentCols.length * dims.nodeW + (presentCols.length - 1) * dims.colGap;\n const height = dims.pad * 2 + contentH;\n return { positions, width, height };\n}\n\nfunction edgePath(x1: number, y1: number, x2: number, y2: number): string {\n const dx = Math.max(24, (x2 - x1) * 0.5);\n return `M ${x1} ${y1} C ${x1 + dx} ${y1}, ${x2 - dx} ${y2}, ${x2} ${y2}`;\n}\n\nexport interface LineageGraphProps {\n model: LineageModel;\n mode?: 'full' | 'compact';\n onNavigate?: (route: string) => void;\n className?: string;\n}\n\nexport function LineageGraph({ model, mode = 'full', onNavigate, className }: LineageGraphProps) {\n const markerId = `cos-lineage-arrow-${useId().replace(/:/g, '')}`;\n const dims = DIMS[mode];\n\n const layout = useMemo(() => computeLayout(model, dims), [model, dims]);\n\n const legendTypes = useMemo(() => {\n const seen = new Set<LineageNodeType>();\n const ordered: LineageNodeType[] = [];\n for (const node of [...model.nodes].sort((a, b) => a.column - b.column)) {\n if (!seen.has(node.type)) {\n seen.add(node.type);\n ordered.push(node.type);\n }\n }\n return ordered;\n }, [model.nodes]);\n\n if (model.nodes.length === 0) {\n return null;\n }\n\n return (\n <div className={cn('flex flex-col gap-3', className)}>\n {mode === 'full' && legendTypes.length > 0 ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n {legendTypes.map((type) => {\n const meta = NODE_META[type];\n return (\n <span\n key={type}\n className=\"inline-flex items-center gap-1.5 text-xs text-text-secondary\"\n >\n <span\n className={cn(\n 'flex size-5 items-center justify-center rounded-button',\n meta.chip\n )}\n >\n <meta.Icon className=\"size-3\" aria-hidden=\"true\" />\n </span>\n {meta.label}\n </span>\n );\n })}\n </div>\n ) : null}\n\n <div\n className={cn(\n 'overflow-x-auto rounded-card border border-border-seam bg-bg-canvas',\n mode === 'full' ? 'p-1' : 'p-0.5'\n )}\n >\n <div\n className=\"relative\"\n style={{\n width: layout.width,\n height: layout.height,\n minWidth: '100%',\n backgroundImage: 'radial-gradient(var(--color-border-subtle) 1px, transparent 1px)',\n backgroundSize: mode === 'full' ? '20px 20px' : '16px 16px',\n }}\n >\n {/* Edges (behind the node cards). */}\n <svg\n className=\"pointer-events-none absolute inset-0 text-border-strong\"\n width={layout.width}\n height={layout.height}\n viewBox={`0 0 ${layout.width} ${layout.height}`}\n aria-hidden=\"true\"\n >\n <defs>\n <marker\n id={markerId}\n viewBox=\"0 0 8 8\"\n refX=\"6.5\"\n refY=\"4\"\n markerWidth=\"6\"\n markerHeight=\"6\"\n orient=\"auto-start-reverse\"\n >\n <path d=\"M1 1 L7 4 L1 7 z\" fill=\"currentColor\" />\n </marker>\n </defs>\n {model.edges.map((edge) => {\n const from = layout.positions.get(edge.from);\n const to = layout.positions.get(edge.to);\n if (!from || !to) {\n return null;\n }\n const x1 = from.x + dims.nodeW;\n const y1 = from.y + dims.nodeH / 2;\n const x2 = to.x;\n const y2 = to.y + dims.nodeH / 2;\n return (\n <path\n key={`${edge.from}»${edge.to}`}\n d={edgePath(x1, y1, x2, y2)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={mode === 'full' ? 1.5 : 1.25}\n strokeLinecap=\"round\"\n markerEnd={`url(#${markerId})`}\n opacity={0.7}\n />\n );\n })}\n </svg>\n\n {/* Node cards. */}\n {[...layout.positions.values()].map(({ node, x, y }) => {\n const meta = NODE_META[node.type];\n const clickable = Boolean(node.route && onNavigate);\n const content = (\n <div\n className={cn(\n 'flex h-full w-full items-center gap-2.5 rounded-card border bg-bg-elevated px-3 shadow-sm transition-shadow',\n meta.border,\n clickable && 'group-hover:shadow-md',\n node.emphasis && 'ring-1 ring-border-strong'\n )}\n >\n <span\n className={cn(\n 'flex shrink-0 items-center justify-center rounded-button',\n dims.iconSize,\n meta.chip\n )}\n aria-hidden=\"true\"\n >\n <meta.Icon className={mode === 'full' ? 'size-4' : 'size-3.5'} />\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col text-left\">\n <span className=\"truncate text-[10px] font-medium uppercase tracking-wide text-text-tertiary\">\n {node.typeLabel ?? meta.label}\n </span>\n <span\n className={cn(\n 'truncate font-semibold text-text-primary',\n mode === 'full' ? 'text-sm' : 'text-xs'\n )}\n >\n {node.title}\n </span>\n {dims.showSubtitle && node.subtitle ? (\n <span className=\"truncate text-[11px] text-text-secondary\">\n {node.subtitle}\n </span>\n ) : null}\n </span>\n </div>\n );\n\n const style = { left: x, top: y, width: dims.nodeW, height: dims.nodeH } as const;\n\n if (clickable && node.route) {\n const route = node.route;\n return (\n <button\n key={node.id}\n type=\"button\"\n onClick={() => onNavigate?.(route)}\n className=\"group absolute rounded-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n style={style}\n title={`${node.typeLabel ?? meta.label}: ${node.title}`}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div key={node.id} className=\"absolute\" style={style}>\n {content}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nexport default LineageGraph;\n"],"mappings":";;;;;AAiGA,IAAMA,IAA0C;CAC9C,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,KAAK;CACL,UAAU;CACV,UAAU;CACV,SAAS;AACX;AAEA,S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;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\"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;MAAE;MAAEQ;KAC5C;;IACN,kBAACG,GAAD;KACE,MAAK;KACL,SAAQ;KACR,SAASC;KACT,UAAU,CAACN,KAAWO;KACtB,cAAYb,EAAG,kCAAkC,eAAe;KALlE,UAAA,CAOE,kBAACc,GAAD,EAAa,WAAU,SAAU,CAAA,GAChCd,EAAG,kCAAkC,MAAM,CACtC;;IACR,kBAACW,GAAD;KACE,MAAK;KACL,SAAQ;KACR,SAASI;KACT,UAAU,CAACR,KAAWM;KACtB,cAAYb,EAAG,kCAAkC,WAAW;KAL9D,UAAA,CAOGA,EAAG,kCAAkC,MAAM,GAC5C,kBAACgB,GAAD,EAAc,WAAU,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseDraftDialog.js","names":[],"sources":["../../../src/cosmicintersection/components/ReleaseDraftDialog.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { Sparkles } from 'lucide-react';\nimport { Button, Input, Label, Textarea } from '@burdenoff/fe-libs/ui';\n\nimport {\n useCosAiDraftReleaseMutation,\n useCosCreateReleaseMutation,\n type CosNotebook,\n type CosReleaseDraft,\n} from '../api/cosmicApi';\nimport { useCosmicIntersection } from '../context/CosmicIntersectionContext';\nimport { notify } from '../lib/toast';\nimport { AiGeneratedDisclaimer, AiRunAttribution } from './AiRunAttribution';\n\n/**\n * Release draft review (BOFF-3814) — \"a citable record is never minted by an\n * agent.\" `cosAiDraftRelease` drafts title/abstract/authors/license from the\n * notebook's own records and writes nothing. The scientist edits every field,\n * then explicitly creates a DRAFT release (`cosCreateRelease`). Publishing —\n * which mints the persistent identifier — stays on the Releases page behind\n * its own confirmation dialog and is untouched here.\n */\nexport function ReleaseDraftDialog({\n notebook,\n open,\n onOpenChange,\n}: {\n notebook: CosNotebook;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const { navigate } = useCosmicIntersection();\n const [draft, { loading: drafting }] = useCosAiDraftReleaseMutation();\n const [createRelease, { loading: creating }] = useCosCreateReleaseMutation();\n\n const [proposal, setProposal] = useState<CosReleaseDraft | null>(null);\n const [title, setTitle] = useState('');\n const [abstract, setAbstract] = useState('');\n const [version, setVersion] = useState('');\n const [authors, setAuthors] = useState('');\n const [license, setLicense] = useState('');\n const abortRef = useRef<AbortController | null>(null);\n\n const busy = drafting || creating;\n\n const close = (next: boolean) => {\n if (busy) return;\n onOpenChange(next);\n if (!next) {\n setProposal(null);\n }\n };\n\n const cancelDraft = () => {\n abortRef.current?.abort();\n abortRef.current = null;\n };\n\n const runDraft = async () => {\n const controller = new AbortController();\n abortRef.current = controller;\n const response = await draft({\n variables: { notebookId: notebook.id },\n context: { fetchOptions: { signal: controller.signal } },\n });\n abortRef.current = null;\n const next = response.data?.cosAiDraftRelease;\n if (next) {\n setProposal(next);\n setTitle(next.title);\n setAbstract(next.abstract);\n setVersion(next.version);\n setAuthors(next.authors.join(', '));\n setLicense(next.license);\n }\n };\n\n const submit = async () => {\n if (!title.trim()) {\n notify.error('Title is required', 'A release needs a title before it can be drafted.');\n return;\n }\n const response = await createRelease({\n variables: {\n input: {\n title: title.trim(),\n abstract: abstract.trim() || undefined,\n version: version.trim() || undefined,\n authors: authors\n .split(',')\n .map((author) => author.trim())\n .filter(Boolean),\n license: license.trim() || undefined,\n datasetIds: proposal?.datasetIds ?? notebook.datasetIds,\n notebookId: notebook.id,\n },\n },\n });\n if (response.data?.cosCreateRelease) {\n notify.success('Draft release created', 'Review it on the Releases page before publishing.');\n close(false);\n navigate('releases');\n }\n };\n\n if (!open) {\n return null;\n }\n\n return (\n <div className=\"space-y-4 rounded-card border border-border-default bg-bg-elevated p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Draft release with AI</h2>\n <p className=\"text-sm text-text-secondary\">\n Drafted from “{notebook.title}” and its completed analyses. Nothing is created until you\n confirm, and publishing always stays a separate, explicit step.\n </p>\n </div>\n {proposal ? null : drafting ? (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={cancelDraft}>\n Cancel\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => void runDraft()}>\n <Sparkles className=\"size-4\" />\n Draft from notebook\n </Button>\n )}\n </div>\n\n {drafting ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Reading the notebook, its analyses and its lineage…\n </p>\n ) : null}\n\n {proposal ? (\n <>\n {proposal.warnings.length > 0 ? (\n <ul className=\"space-y-1 rounded-card border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text\">\n {proposal.warnings.map((warning) => (\n <li key={warning}>{warning}</li>\n ))}\n </ul>\n ) : null}\n\n {proposal.authorSuggestions.length > 0 ? (\n <p className=\"text-xs text-text-tertiary\">\n Contribution hints:{' '}\n {proposal.authorSuggestions\n .map((suggestion) => `${suggestion.actorId} (${suggestion.contributions})`)\n .join(', ')}\n . Edit the author list below to change who is credited.\n </p>\n ) : null}\n\n <AiGeneratedDisclaimer />\n\n <div className=\"space-y-3\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-title\">Title</Label>\n <Input\n id=\"cos-draft-title\"\n value={title}\n onChange={(event) => setTitle(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-abstract\">Abstract</Label>\n <Textarea\n id=\"cos-draft-abstract\"\n value={abstract}\n onChange={(event) => setAbstract(event.target.value)}\n rows={6}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-version\">Version</Label>\n <Input\n id=\"cos-draft-version\"\n value={version}\n onChange={(event) => setVersion(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-license\">License</Label>\n <Input\n id=\"cos-draft-license\"\n value={license}\n onChange={(event) => setLicense(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-authors\">Authors (comma-separated)</Label>\n <Input\n id=\"cos-draft-authors\"\n value={authors}\n onChange={(event) => setAuthors(event.target.value)}\n />\n </div>\n </div>\n {proposal.licenseRationale ? (\n <p className=\"text-xs text-text-tertiary\">\n License rationale: {proposal.licenseRationale}\n </p>\n ) : null}\n </div>\n\n <AiRunAttribution\n method={proposal.method}\n agentRunId={proposal.agentRunId}\n generatedAt={proposal.generatedAt}\n />\n\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-default pt-4\">\n <Button type=\"button\" onClick={() => void submit()} disabled={busy}>\n {creating ? 'Creating draft…' : 'Create draft release'}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={() => close(false)} disabled={busy}>\n Discard\n </Button>\n <span className=\"text-xs text-text-tertiary\">\n Creates a DRAFT release only — publishing mints the persistent identifier and asks\n again.\n </span>\n </div>\n </>\n ) : null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S,gBAC5B;WACD;KACD;;IAEL,kBAAC,GAAD;KACE,QAAQ,EAAS;KACjB,YAAY,EAAS;KACrB,aAAa,EAAS;IACvB,CAAA;IAED,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD;OAAQ,MAAK;OAAS,eAAe,KAAK,EAAO;OAAG,UAAU;iBAC3D,IAAW,oBAAoB;MAC1B,CAAA;MACR,kBAAC,GAAD;OAAQ,MAAK;OAAS,SAAQ;OAAU,eAAe,EAAM,EAAK;OAAG,UAAU;iBAAM;MAE7E,CAAA;MACR,kBAAC,QAAD;OAAM,WAAU;iBAA6B;MAGvC,CAAA;KACH;;GACL,EAAA,CAAA,IACA;EACD;MA5HE;AA8HX"}
|
|
1
|
+
{"version":3,"file":"ReleaseDraftDialog.js","names":["_Fragment","Fragment$1","ReleaseDraftDialog","useCosmicIntersection","draft","drafting","useCosAiDraftReleaseMutation","createRelease","creating","useCosCreateReleaseMutation","proposal","setProposal","useState","title","setTitle","abstract","setAbstract","version","setVersion","authors","setAuthors","license","setLicense","abortRef","useRef","busy","close","onOpenChange","next","cancelDraft","runDraft","controller","response","notebook","submit","author","notify","navigate","open","Button","Sparkles","warning","suggestion","AiGeneratedDisclaimer","Label","Input","event","Textarea","AiRunAttribution"],"sources":["../../../src/cosmicintersection/components/ReleaseDraftDialog.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { Sparkles } from 'lucide-react';\nimport { Button, Input, Label, Textarea } from '@burdenoff/fe-libs/ui';\n\nimport {\n useCosAiDraftReleaseMutation,\n useCosCreateReleaseMutation,\n type CosNotebook,\n type CosReleaseDraft,\n} from '../api/cosmicApi';\nimport { useCosmicIntersection } from '../context/CosmicIntersectionContext';\nimport { notify } from '../lib/toast';\nimport { AiGeneratedDisclaimer, AiRunAttribution } from './AiRunAttribution';\n\n/**\n * Release draft review (BOFF-3814) — \"a citable record is never minted by an\n * agent.\" `cosAiDraftRelease` drafts title/abstract/authors/license from the\n * notebook's own records and writes nothing. The scientist edits every field,\n * then explicitly creates a DRAFT release (`cosCreateRelease`). Publishing —\n * which mints the persistent identifier — stays on the Releases page behind\n * its own confirmation dialog and is untouched here.\n */\nexport function ReleaseDraftDialog({\n notebook,\n open,\n onOpenChange,\n}: {\n notebook: CosNotebook;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const { navigate } = useCosmicIntersection();\n const [draft, { loading: drafting }] = useCosAiDraftReleaseMutation();\n const [createRelease, { loading: creating }] = useCosCreateReleaseMutation();\n\n const [proposal, setProposal] = useState<CosReleaseDraft | null>(null);\n const [title, setTitle] = useState('');\n const [abstract, setAbstract] = useState('');\n const [version, setVersion] = useState('');\n const [authors, setAuthors] = useState('');\n const [license, setLicense] = useState('');\n const abortRef = useRef<AbortController | null>(null);\n\n const busy = drafting || creating;\n\n const close = (next: boolean) => {\n if (busy) return;\n onOpenChange(next);\n if (!next) {\n setProposal(null);\n }\n };\n\n const cancelDraft = () => {\n abortRef.current?.abort();\n abortRef.current = null;\n };\n\n const runDraft = async () => {\n const controller = new AbortController();\n abortRef.current = controller;\n const response = await draft({\n variables: { notebookId: notebook.id },\n context: { fetchOptions: { signal: controller.signal } },\n });\n abortRef.current = null;\n const next = response.data?.cosAiDraftRelease;\n if (next) {\n setProposal(next);\n setTitle(next.title);\n setAbstract(next.abstract);\n setVersion(next.version);\n setAuthors(next.authors.join(', '));\n setLicense(next.license);\n }\n };\n\n const submit = async () => {\n if (!title.trim()) {\n notify.error('Title is required', 'A release needs a title before it can be drafted.');\n return;\n }\n const response = await createRelease({\n variables: {\n input: {\n title: title.trim(),\n abstract: abstract.trim() || undefined,\n version: version.trim() || undefined,\n authors: authors\n .split(',')\n .map((author) => author.trim())\n .filter(Boolean),\n license: license.trim() || undefined,\n datasetIds: proposal?.datasetIds ?? notebook.datasetIds,\n notebookId: notebook.id,\n },\n },\n });\n if (response.data?.cosCreateRelease) {\n notify.success('Draft release created', 'Review it on the Releases page before publishing.');\n close(false);\n navigate('releases');\n }\n };\n\n if (!open) {\n return null;\n }\n\n return (\n <div className=\"space-y-4 rounded-card border border-border-default bg-bg-elevated p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Draft release with AI</h2>\n <p className=\"text-sm text-text-secondary\">\n Drafted from “{notebook.title}” and its completed analyses. Nothing is created until you\n confirm, and publishing always stays a separate, explicit step.\n </p>\n </div>\n {proposal ? null : drafting ? (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={cancelDraft}>\n Cancel\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => void runDraft()}>\n <Sparkles className=\"size-4\" />\n Draft from notebook\n </Button>\n )}\n </div>\n\n {drafting ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Reading the notebook, its analyses and its lineage…\n </p>\n ) : null}\n\n {proposal ? (\n <>\n {proposal.warnings.length > 0 ? (\n <ul className=\"space-y-1 rounded-card border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text\">\n {proposal.warnings.map((warning) => (\n <li key={warning}>{warning}</li>\n ))}\n </ul>\n ) : null}\n\n {proposal.authorSuggestions.length > 0 ? (\n <p className=\"text-xs text-text-tertiary\">\n Contribution hints:{' '}\n {proposal.authorSuggestions\n .map((suggestion) => `${suggestion.actorId} (${suggestion.contributions})`)\n .join(', ')}\n . Edit the author list below to change who is credited.\n </p>\n ) : null}\n\n <AiGeneratedDisclaimer />\n\n <div className=\"space-y-3\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-title\">Title</Label>\n <Input\n id=\"cos-draft-title\"\n value={title}\n onChange={(event) => setTitle(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-abstract\">Abstract</Label>\n <Textarea\n id=\"cos-draft-abstract\"\n value={abstract}\n onChange={(event) => setAbstract(event.target.value)}\n rows={6}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-version\">Version</Label>\n <Input\n id=\"cos-draft-version\"\n value={version}\n onChange={(event) => setVersion(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-license\">License</Label>\n <Input\n id=\"cos-draft-license\"\n value={license}\n onChange={(event) => setLicense(event.target.value)}\n />\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"cos-draft-authors\">Authors (comma-separated)</Label>\n <Input\n id=\"cos-draft-authors\"\n value={authors}\n onChange={(event) => setAuthors(event.target.value)}\n />\n </div>\n </div>\n {proposal.licenseRationale ? (\n <p className=\"text-xs text-text-tertiary\">\n License rationale: {proposal.licenseRationale}\n </p>\n ) : null}\n </div>\n\n <AiRunAttribution\n method={proposal.method}\n agentRunId={proposal.agentRunId}\n generatedAt={proposal.generatedAt}\n />\n\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-default pt-4\">\n <Button type=\"button\" onClick={() => void submit()} disabled={busy}>\n {creating ? 'Creating draft…' : 'Create draft release'}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={() => close(false)} disabled={busy}>\n Discard\n </Button>\n <span className=\"text-xs text-text-tertiary\">\n Creates a DRAFT release only — publishing mints the persistent identifier and asks\n again.\n </span>\n </div>\n </>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgBE,EAAmB,EACjC,aACA,SACA,mBAKC;CACD,IAAM,EAAE,gBAAaC,EAAsB,GACrC,CAACC,GAAO,EAAE,SAASC,OAAcC,EAA6B,GAC9D,CAACC,GAAe,EAAE,SAASC,OAAcC,EAA4B,GAErE,CAACC,GAAUC,KAAeC,EAAiC,IAAI,GAC/D,CAACC,GAAOC,KAAYF,EAAS,EAAE,GAC/B,CAACG,GAAUC,KAAeJ,EAAS,EAAE,GACrC,CAACK,GAASC,KAAcN,EAAS,EAAE,GACnC,CAACO,GAASC,KAAcR,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;IACvB,CAAA;IAED,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAAC6B,GAAD;OAAQ,MAAK;OAAS,eAAe,KAAKL,EAAO;OAAG,UAAUT;OAC3D,UAAAjB,IAAW,oBAAoB;MAC1B,CAAA;MACR,kBAAC+B,GAAD;OAAQ,MAAK;OAAS,SAAQ;OAAU,eAAeb,EAAM,EAAK;OAAG,UAAUD;OAAM,UAAA;MAE7E,CAAA;MACR,kBAAC,QAAD;OAAM,WAAU;OAA6B,UAAA;MAGvC,CAAA;KACH;;GACL,EAAA,CAAA,IACA;EACD;C,KA5HE;AA8HX"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { useMemo as t } from "react";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/cosmicintersection/components/ResultsChart.tsx
|
|
5
5
|
var i = [
|
|
6
6
|
1,
|
|
7
7
|
2,
|
|
@@ -75,11 +75,8 @@ function f(e) {
|
|
|
75
75
|
});
|
|
76
76
|
}, o = e.series;
|
|
77
77
|
if (Array.isArray(o) && o.forEach((e, t) => {
|
|
78
|
-
if (Array.isArray(e)) {
|
|
79
|
-
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (e && typeof e == "object") {
|
|
78
|
+
if (Array.isArray(e)) a(e, `Series ${t + 1}`, "line");
|
|
79
|
+
else if (e && typeof e == "object") {
|
|
83
80
|
let n = e, r = n.points ?? n.data ?? n.values;
|
|
84
81
|
if (!Array.isArray(r)) return;
|
|
85
82
|
let i = typeof n.name == "string" && n.name.trim() ? n.name : typeof n.label == "string" && n.label.trim() ? n.label : `Series ${t + 1}`, o = [
|
|
@@ -284,7 +281,7 @@ function w({ results: i, className: a }) {
|
|
|
284
281
|
}),
|
|
285
282
|
/* @__PURE__ */ n("text", {
|
|
286
283
|
x: v.left + y / 2,
|
|
287
|
-
y:
|
|
284
|
+
y: 334,
|
|
288
285
|
textAnchor: "middle",
|
|
289
286
|
fontSize: 12,
|
|
290
287
|
fill: "var(--color-text-secondary)",
|
|
@@ -324,7 +321,6 @@ function w({ results: i, className: a }) {
|
|
|
324
321
|
}) : null]
|
|
325
322
|
});
|
|
326
323
|
}
|
|
327
|
-
//#endregion
|
|
328
324
|
export { w as ResultsChart, w as default };
|
|
329
325
|
|
|
330
326
|
//# sourceMappingURL=ResultsChart.js.map
|