@burdenoff/microfe-cosmicintersection 2026.1101.2 → 2026.1102.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/api/cosmicApi.d.ts +33 -0
- package/dist/cosmicintersection/api/cosmicApi.d.ts.map +1 -1
- package/dist/cosmicintersection/api/cosmicApi.js +118 -71
- package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts +17 -0
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +1 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js +791 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -0
- package/dist/cosmicintersection/components/index.d.ts +2 -0
- package/dist/cosmicintersection/components/index.d.ts.map +1 -1
- package/dist/cosmicintersection/components/index.js +2 -0
- package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts +22 -0
- package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/useTrackRecentItem.js +28 -0
- package/dist/cosmicintersection/lib/useTrackRecentItem.js.map +1 -0
- package/dist/cosmicintersection/lib/visualization.d.ts +189 -0
- package/dist/cosmicintersection/lib/visualization.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/visualization.js +298 -0
- package/dist/cosmicintersection/lib/visualization.js.map +1 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts +80 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +1 -0
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +245 -237
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js +101 -93
- package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +82 -74
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js +66 -58
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js +126 -118
- package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +211 -203
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js +92 -84
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js +101 -93
- package/dist/cosmicintersection/pages/sources/SourceDetailPage.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/services/recentItems.d.ts +40 -0
- package/dist/services/recentItems.d.ts.map +1 -0
- package/dist/services/recentItems.js +128 -0
- package/dist/services/recentItems.js.map +1 -0
- package/dist/stories/ScienceCanvas.stories.d.ts +21 -0
- package/dist/stories/ScienceCanvas.stories.d.ts.map +1 -0
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceDetailPage.js","names":[],"sources":["../../../../src/cosmicintersection/pages/sources/SourceDetailPage.tsx"],"sourcesContent":["/**\n * SourceDetailPage — full record for one data source.\n *\n * Mirrors CollectionDetailPage: a header with the source's metadata (type/status\n * badges, endpoint, last-synced, tags) over a table of the datasets ingested from\n * this source. Header actions edit the source, mark it synced\n * (`cosMarkSourceSynced`) or archive it (`cosArchiveSource`). Everything is read\n * from the backend — no fabricated data.\n */\nimport { Database, Download, Pencil, Radio, RefreshCw } from 'lucide-react';\nimport {\n Badge,\n Button,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@burdenoff/fe-libs/ui';\nimport { useParams } from 'react-router';\n\nimport {\n useCosArchiveSourceMutation,\n useCosMarkSourceSyncedMutation,\n useCosSourceQuery,\n} from '../../api/cosmicApi';\nimport {\n ActionMenu,\n EmptyState,\n ErrorState,\n LoadingState,\n PageLayout,\n SafeLink,\n StatusBadge,\n formatEnumLabel,\n} from '../../components';\nimport { useCosmicIntersection } from '../../context/CosmicIntersectionContext';\nimport { notify } from '../../lib/toast';\n\nfunction formatDateTime(value?: string | null): string {\n if (!value) {\n return '—';\n }\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? '—' : date.toLocaleString();\n}\n\nfunction formatDate(value?: string | null): string {\n if (!value) {\n return '—';\n }\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) {\n return '—';\n }\n return parsed.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' });\n}\n\nfunction MetaTile({ label, value }: { label: string; value: React.ReactNode }) {\n return (\n <div className=\"rounded-card border border-border-default bg-bg-elevated p-4\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-secondary\">{label}</p>\n <div className=\"mt-1 text-sm text-text-primary\">{value}</div>\n </div>\n );\n}\n\nexport default function SourceDetailPage() {\n const { id = '' } = useParams<{ id: string }>();\n const { navigate } = useCosmicIntersection();\n\n const { data, loading, error, refetch } = useCosSourceQuery(id);\n const source = data?.cosSource ?? null;\n\n const [markSynced, { loading: syncing }] = useCosMarkSourceSyncedMutation();\n const [archiveSource] = useCosArchiveSourceMutation();\n\n const handleMarkSynced = async () => {\n if (!source) {\n return;\n }\n const response = await markSynced({ variables: { id: source.id } });\n if (response.data?.cosMarkSourceSynced) {\n notify.success('Source marked synced', `“${source.name}” is now up to date.`);\n await refetch();\n }\n };\n\n const handleArchive = async () => {\n if (!source) {\n return;\n }\n const response = await archiveSource({ variables: { id: source.id } });\n if (response.error) {\n throw new Error(response.error.message);\n }\n if (!response.data?.cosArchiveSource) {\n notify.error('Could not archive source', 'The server did not confirm the change.');\n throw new Error('Archive not confirmed');\n }\n notify.success('Source archived');\n navigate('sources');\n };\n\n if (loading) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <LoadingState label=\"Loading source…\" />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <ErrorState message=\"We could not load this source.\" onRetry={() => void refetch()} />\n </PageLayout>\n );\n }\n\n if (!source) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <EmptyState\n icon={Radio}\n title=\"Source not found.\"\n description=\"This source may have been removed or is outside your current scope.\"\n action={\n <Button type=\"button\" onClick={() => navigate('sources')}>\n Back to sources\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const datasets = source.datasets ?? [];\n\n const renderDatasets = () => {\n if (datasets.length === 0) {\n return (\n <EmptyState\n icon={Database}\n title=\"No datasets from this source yet\"\n description=\"Datasets that ingest from this source will be listed here.\"\n />\n );\n }\n return (\n <>\n {/* Desktop / tablet: table */}\n <div className=\"hidden overflow-hidden rounded-card border border-border-default bg-bg-elevated md:block\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Name</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Access</TableHead>\n <TableHead>Rows</TableHead>\n <TableHead>Updated</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {datasets.map((dataset) => (\n <TableRow\n key={dataset.id}\n className=\"cursor-pointer\"\n onClick={() => navigate(`datasets/${dataset.id}`)}\n >\n <TableCell className=\"font-medium text-text-primary\">{dataset.name}</TableCell>\n <TableCell>\n <StatusBadge status={dataset.status} />\n </TableCell>\n <TableCell>\n <StatusBadge status={dataset.accessLevel} />\n </TableCell>\n <TableCell className=\"tabular-nums text-sm text-text-secondary\">\n {Number(dataset.rowCount) > 0 ? Number(dataset.rowCount).toLocaleString() : '—'}\n </TableCell>\n <TableCell className=\"whitespace-nowrap text-sm text-text-secondary\">\n {formatDate(dataset.updatedAt)}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n\n {/* Mobile: stacked cards */}\n <ul className=\"space-y-3 md:hidden\">\n {datasets.map((dataset) => (\n <li key={dataset.id}>\n <div\n role=\"button\"\n tabIndex={0}\n aria-label={`Open ${dataset.name}`}\n onClick={() => navigate(`datasets/${dataset.id}`)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n navigate(`datasets/${dataset.id}`);\n }\n }}\n className=\"flex flex-col gap-2 rounded-card border border-border-default bg-bg-elevated p-4 outline-none transition-colors hover:bg-bg-sunken focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <p className=\"font-medium text-text-primary\">{dataset.name}</p>\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <StatusBadge status={dataset.status} />\n <StatusBadge status={dataset.accessLevel} />\n </div>\n <div className=\"flex items-center justify-between gap-2 text-xs text-text-secondary\">\n <span className=\"tabular-nums\">\n {Number(dataset.rowCount) > 0\n ? `${Number(dataset.rowCount).toLocaleString()} rows`\n : 'No rows'}\n </span>\n <span>{formatDate(dataset.updatedAt)}</span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </>\n );\n };\n\n return (\n <PageLayout\n title={source.name}\n description={source.description ?? undefined}\n backPath=\"sources\"\n actions={\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate(`sources/${source.id}/edit`)}\n >\n <Pencil className=\"size-4\" />\n Edit\n </Button>\n <ActionMenu\n ariaLabel={`Actions for ${source.name}`}\n entityName={source.name}\n onDelete={() => handleArchive()}\n deleteLabel=\"Archive source\"\n extraItems={[\n {\n key: 'mark-synced',\n label: syncing ? 'Marking synced…' : 'Mark synced',\n icon: RefreshCw,\n disabled: syncing,\n onSelect: () => void handleMarkSynced(),\n },\n ]}\n />\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Status + key facts */}\n <div className=\"flex flex-wrap items-center gap-2\">\n <StatusBadge status={source.status} />\n <Badge variant=\"secondary\">{formatEnumLabel(source.type)}</Badge>\n </div>\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n <MetaTile\n label=\"Endpoint\"\n value={\n source.endpoint ? (\n <SafeLink\n href={source.endpoint}\n className=\"inline-flex items-center gap-1.5 truncate text-text-primary underline-offset-2 hover:underline\"\n fallbackClassName=\"truncate text-text-secondary\"\n >\n <Download className=\"size-4 shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n <span className=\"truncate\">{source.endpoint}</span>\n </SafeLink>\n ) : (\n <span className=\"text-text-secondary\">Not set</span>\n )\n }\n />\n <MetaTile\n label=\"Last synced\"\n value={<span>{formatDateTime(source.lastSyncedAt)}</span>}\n />\n <MetaTile label=\"Created\" value={<span>{formatDateTime(source.createdAt)}</span>} />\n <MetaTile label=\"Updated\" value={<span>{formatDateTime(source.updatedAt)}</span>} />\n </div>\n\n {source.tags.length > 0 ? (\n <div className=\"flex flex-wrap gap-1\">\n {source.tags.map((tag) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n ) : null}\n\n {/* Datasets */}\n <section className=\"space-y-3\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Datasets from this source</h2>\n {renderDatasets()}\n </section>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA,SAAS,EAAe,GAA+B;CACrD,IAAI,CAAC,GACH,OAAO;CAET,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AAU;mBAAf,CACE,kBAAC,GAAD,EAAa,QAAQ,EAAQ,OAAS,CAAA,GACtC,kBAAC,GAAD,EAAa,QAAQ,EAAQ,YAAc,CAAA,CACxC;;QACL,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD;UAAM,WAAU;oBACb,OAAO,EAAQ,QAAQ,IAAI,IACxB,GAAG,OAAO,EAAQ,QAAQ,CAAC,CAAC,eAAe,EAAE,SAC7C;SACA,CAAA,GACN,kBAAC,QAAD,EAAA,UAAO,EAAW,EAAQ,SAAS,EAAQ,CAAA,CACxC;;OACF;SACH,GA5BK,EAAQ,EA4Bb,CACL;KACC,CAAA,CACJ,EAAA,CAAA,CAoFS;;GACN;;CACK,CAAA;AAEhB"}
|
|
1
|
+
{"version":3,"file":"SourceDetailPage.js","names":[],"sources":["../../../../src/cosmicintersection/pages/sources/SourceDetailPage.tsx"],"sourcesContent":["/**\n * SourceDetailPage — full record for one data source.\n *\n * Mirrors CollectionDetailPage: a header with the source's metadata (type/status\n * badges, endpoint, last-synced, tags) over a table of the datasets ingested from\n * this source. Header actions edit the source, mark it synced\n * (`cosMarkSourceSynced`) or archive it (`cosArchiveSource`). Everything is read\n * from the backend — no fabricated data.\n */\nimport { Database, Download, Pencil, Radio, RefreshCw } from 'lucide-react';\nimport {\n Badge,\n Button,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@burdenoff/fe-libs/ui';\nimport { useParams } from 'react-router';\n\nimport {\n useCosArchiveSourceMutation,\n useCosMarkSourceSyncedMutation,\n useCosSourceQuery,\n} from '../../api/cosmicApi';\nimport {\n ActionMenu,\n EmptyState,\n ErrorState,\n LoadingState,\n PageLayout,\n SafeLink,\n StatusBadge,\n formatEnumLabel,\n} from '../../components';\nimport { useCosmicIntersection } from '../../context/CosmicIntersectionContext';\nimport { notify } from '../../lib/toast';\nimport { useTrackRecentItem } from '../../lib/useTrackRecentItem';\n\nfunction formatDateTime(value?: string | null): string {\n if (!value) {\n return '—';\n }\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? '—' : date.toLocaleString();\n}\n\nfunction formatDate(value?: string | null): string {\n if (!value) {\n return '—';\n }\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) {\n return '—';\n }\n return parsed.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' });\n}\n\nfunction MetaTile({ label, value }: { label: string; value: React.ReactNode }) {\n return (\n <div className=\"rounded-card border border-border-default bg-bg-elevated p-4\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-secondary\">{label}</p>\n <div className=\"mt-1 text-sm text-text-primary\">{value}</div>\n </div>\n );\n}\n\nexport default function SourceDetailPage() {\n const { id = '' } = useParams<{ id: string }>();\n const { navigate } = useCosmicIntersection();\n\n const { data, loading, error, refetch } = useCosSourceQuery(id);\n const source = data?.cosSource ?? null;\n useTrackRecentItem(\n source\n ? {\n type: 'source',\n id: source.id,\n name: source.name,\n path: `sources/${encodeURIComponent(source.id)}`,\n }\n : null\n );\n\n const [markSynced, { loading: syncing }] = useCosMarkSourceSyncedMutation();\n const [archiveSource] = useCosArchiveSourceMutation();\n\n const handleMarkSynced = async () => {\n if (!source) {\n return;\n }\n const response = await markSynced({ variables: { id: source.id } });\n if (response.data?.cosMarkSourceSynced) {\n notify.success('Source marked synced', `“${source.name}” is now up to date.`);\n await refetch();\n }\n };\n\n const handleArchive = async () => {\n if (!source) {\n return;\n }\n const response = await archiveSource({ variables: { id: source.id } });\n if (response.error) {\n throw new Error(response.error.message);\n }\n if (!response.data?.cosArchiveSource) {\n notify.error('Could not archive source', 'The server did not confirm the change.');\n throw new Error('Archive not confirmed');\n }\n notify.success('Source archived');\n navigate('sources');\n };\n\n if (loading) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <LoadingState label=\"Loading source…\" />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <ErrorState message=\"We could not load this source.\" onRetry={() => void refetch()} />\n </PageLayout>\n );\n }\n\n if (!source) {\n return (\n <PageLayout title=\"Source\" backPath=\"sources\">\n <EmptyState\n icon={Radio}\n title=\"Source not found.\"\n description=\"This source may have been removed or is outside your current scope.\"\n action={\n <Button type=\"button\" onClick={() => navigate('sources')}>\n Back to sources\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const datasets = source.datasets ?? [];\n\n const renderDatasets = () => {\n if (datasets.length === 0) {\n return (\n <EmptyState\n icon={Database}\n title=\"No datasets from this source yet\"\n description=\"Datasets that ingest from this source will be listed here.\"\n />\n );\n }\n return (\n <>\n {/* Desktop / tablet: table */}\n <div className=\"hidden overflow-hidden rounded-card border border-border-default bg-bg-elevated md:block\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Name</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Access</TableHead>\n <TableHead>Rows</TableHead>\n <TableHead>Updated</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {datasets.map((dataset) => (\n <TableRow\n key={dataset.id}\n className=\"cursor-pointer\"\n onClick={() => navigate(`datasets/${dataset.id}`)}\n >\n <TableCell className=\"font-medium text-text-primary\">{dataset.name}</TableCell>\n <TableCell>\n <StatusBadge status={dataset.status} />\n </TableCell>\n <TableCell>\n <StatusBadge status={dataset.accessLevel} />\n </TableCell>\n <TableCell className=\"tabular-nums text-sm text-text-secondary\">\n {Number(dataset.rowCount) > 0 ? Number(dataset.rowCount).toLocaleString() : '—'}\n </TableCell>\n <TableCell className=\"whitespace-nowrap text-sm text-text-secondary\">\n {formatDate(dataset.updatedAt)}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n\n {/* Mobile: stacked cards */}\n <ul className=\"space-y-3 md:hidden\">\n {datasets.map((dataset) => (\n <li key={dataset.id}>\n <div\n role=\"button\"\n tabIndex={0}\n aria-label={`Open ${dataset.name}`}\n onClick={() => navigate(`datasets/${dataset.id}`)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n navigate(`datasets/${dataset.id}`);\n }\n }}\n className=\"flex flex-col gap-2 rounded-card border border-border-default bg-bg-elevated p-4 outline-none transition-colors hover:bg-bg-sunken focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <p className=\"font-medium text-text-primary\">{dataset.name}</p>\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <StatusBadge status={dataset.status} />\n <StatusBadge status={dataset.accessLevel} />\n </div>\n <div className=\"flex items-center justify-between gap-2 text-xs text-text-secondary\">\n <span className=\"tabular-nums\">\n {Number(dataset.rowCount) > 0\n ? `${Number(dataset.rowCount).toLocaleString()} rows`\n : 'No rows'}\n </span>\n <span>{formatDate(dataset.updatedAt)}</span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </>\n );\n };\n\n return (\n <PageLayout\n title={source.name}\n description={source.description ?? undefined}\n backPath=\"sources\"\n actions={\n <div className=\"flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate(`sources/${source.id}/edit`)}\n >\n <Pencil className=\"size-4\" />\n Edit\n </Button>\n <ActionMenu\n ariaLabel={`Actions for ${source.name}`}\n entityName={source.name}\n onDelete={() => handleArchive()}\n deleteLabel=\"Archive source\"\n extraItems={[\n {\n key: 'mark-synced',\n label: syncing ? 'Marking synced…' : 'Mark synced',\n icon: RefreshCw,\n disabled: syncing,\n onSelect: () => void handleMarkSynced(),\n },\n ]}\n />\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Status + key facts */}\n <div className=\"flex flex-wrap items-center gap-2\">\n <StatusBadge status={source.status} />\n <Badge variant=\"secondary\">{formatEnumLabel(source.type)}</Badge>\n </div>\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n <MetaTile\n label=\"Endpoint\"\n value={\n source.endpoint ? (\n <SafeLink\n href={source.endpoint}\n className=\"inline-flex items-center gap-1.5 truncate text-text-primary underline-offset-2 hover:underline\"\n fallbackClassName=\"truncate text-text-secondary\"\n >\n <Download className=\"size-4 shrink-0 text-text-secondary\" aria-hidden=\"true\" />\n <span className=\"truncate\">{source.endpoint}</span>\n </SafeLink>\n ) : (\n <span className=\"text-text-secondary\">Not set</span>\n )\n }\n />\n <MetaTile\n label=\"Last synced\"\n value={<span>{formatDateTime(source.lastSyncedAt)}</span>}\n />\n <MetaTile label=\"Created\" value={<span>{formatDateTime(source.createdAt)}</span>} />\n <MetaTile label=\"Updated\" value={<span>{formatDateTime(source.updatedAt)}</span>} />\n </div>\n\n {source.tags.length > 0 ? (\n <div className=\"flex flex-wrap gap-1\">\n {source.tags.map((tag) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n ) : null}\n\n {/* Datasets */}\n <section className=\"space-y-3\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Datasets from this source</h2>\n {renderDatasets()}\n </section>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,SAAS,EAAe,GAA+B;CACrD,IAAI,CAAC,GACH,OAAO;CAET,IAAM,IAAO,IAAI,KAAK,CAAK;CAC3B,OAAO,OAAO,MAAM,EAAK,QAAQ,CAAC,IAAI,MAAM,EAAK,eAAe;AAClE;AAEA,SAAS,EAAW,GAA+B;CACjD,IAAI,CAAC,GACH,OAAO;CAET,IAAM,IAAS,IAAI,KAAK,CAAK;CAI7B,OAHI,OAAO,MAAM,EAAO,QAAQ,CAAC,IACxB,MAEF,EAAO,mBAAmB,KAAA,GAAW;EAAE,MAAM;EAAW,OAAO;EAAS,KAAK;CAAU,CAAC;AACjG;AAEA,SAAS,EAAS,EAAE,UAAO,YAAoD;CAC7E,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,KAAD;GAAG,WAAU;aAAmE;EAAS,CAAA,GACzF,kBAAC,OAAD;GAAK,WAAU;aAAkC;EAAW,CAAA,CACzD;;AAET;AAEA,SAAwB,IAA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AAA,CAAA,CAoFS;;GACN;;CACK,CAAA;AAEhB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,6 @@ export { CosmicIntersectionRoot } from './cosmicintersection/CosmicIntersectionR
|
|
|
17
17
|
export type { CosmicIntersectionRootProps } from './cosmicintersection/types';
|
|
18
18
|
export * from './services/createSandboxAssistantTransport';
|
|
19
19
|
export { gatherPageContext, resolveCosmicIntersectionConversationContext, } from './utils/pageContext';
|
|
20
|
+
export { COS_RECENT_ENTITY_TYPES, COS_RECENT_ITEMS_EVENT, COS_RECENT_ITEMS_LIMIT, clearRecentItems, readRecentItems, recordRecentItem, recentItemsStorageKey, subscribeRecentItems, useCosRecentItems, } from './services/recentItems';
|
|
21
|
+
export type { CosRecentEntityType, CosRecentItem, CosRecentItemInput, } from './services/recentItems';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAW9E,cAAc,4CAA4C,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,4CAA4C,GAC7C,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAW9E,cAAc,4CAA4C,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,4CAA4C,GAC7C,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CosmicIntersectionRoot as e } from "./cosmicintersection/CosmicIntersectionRoot.js";
|
|
2
2
|
import { gatherPageContext as t, resolveCosmicIntersectionConversationContext as n } from "./utils/pageContext.js";
|
|
3
3
|
import { useSandboxAssistantTransport as r } from "./services/createSandboxAssistantTransport.js";
|
|
4
|
-
|
|
4
|
+
import { COS_RECENT_ENTITY_TYPES as i, COS_RECENT_ITEMS_EVENT as a, COS_RECENT_ITEMS_LIMIT as o, clearRecentItems as s, readRecentItems as c, recentItemsStorageKey as l, recordRecentItem as u, subscribeRecentItems as d, useCosRecentItems as f } from "./services/recentItems.js";
|
|
5
|
+
export { i as COS_RECENT_ENTITY_TYPES, a as COS_RECENT_ITEMS_EVENT, o as COS_RECENT_ITEMS_LIMIT, e as CosmicIntersectionRoot, s as clearRecentItems, t as gatherPageContext, c as readRecentItems, l as recentItemsStorageKey, u as recordRecentItem, n as resolveCosmicIntersectionConversationContext, d as subscribeRecentItems, f as useCosRecentItems, r as useSandboxAssistantTransport };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Entity kinds that can appear in the recent list. */
|
|
2
|
+
export type CosRecentEntityType = 'dataset' | 'source' | 'collection' | 'pipeline' | 'run' | 'notebook' | 'analysis' | 'release';
|
|
3
|
+
export declare const COS_RECENT_ENTITY_TYPES: readonly CosRecentEntityType[];
|
|
4
|
+
/** One recently viewed entity. */
|
|
5
|
+
export interface CosRecentItem {
|
|
6
|
+
readonly type: CosRecentEntityType;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
/** Display name at the time of the visit (dataset name, notebook title, ...). */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** Absolute in-app path of the entity's detail view, e.g. `/cosmicintersection/datasets/ds-1`. */
|
|
11
|
+
readonly href: string;
|
|
12
|
+
/** Epoch milliseconds of the most recent visit. */
|
|
13
|
+
readonly visitedAt: number;
|
|
14
|
+
}
|
|
15
|
+
export type CosRecentItemInput = Omit<CosRecentItem, 'visitedAt'>;
|
|
16
|
+
/** How many entries are kept per workspace. */
|
|
17
|
+
export declare const COS_RECENT_ITEMS_LIMIT = 8;
|
|
18
|
+
/** Window event fired after this tab changes a recent list. */
|
|
19
|
+
export declare const COS_RECENT_ITEMS_EVENT = "cosmicintersection:recent-items-changed";
|
|
20
|
+
/** The `localStorage` key holding one workspace's list. */
|
|
21
|
+
export declare function recentItemsStorageKey(workspaceId?: string | null): string;
|
|
22
|
+
/** The workspace's recent entities, most recent first. */
|
|
23
|
+
export declare function readRecentItems(workspaceId?: string | null): readonly CosRecentItem[];
|
|
24
|
+
/**
|
|
25
|
+
* Move (or add) an entity to the top of the workspace's recent list.
|
|
26
|
+
*
|
|
27
|
+
* Revisiting an entity updates its name and timestamp instead of adding a
|
|
28
|
+
* duplicate, and the list is capped at `COS_RECENT_ITEMS_LIMIT`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function recordRecentItem(workspaceId: string | null | undefined, input: CosRecentItemInput, now?: number): void;
|
|
31
|
+
/** Forget the workspace's whole recent list. */
|
|
32
|
+
export declare function clearRecentItems(workspaceId?: string | null): void;
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to changes of any workspace's recent list, from this tab or
|
|
35
|
+
* another one. Returns the unsubscribe function.
|
|
36
|
+
*/
|
|
37
|
+
export declare function subscribeRecentItems(listener: () => void): () => void;
|
|
38
|
+
/** React hook: the workspace's recent entities, kept in sync with storage. */
|
|
39
|
+
export declare function useCosRecentItems(workspaceId?: string | null): readonly CosRecentItem[];
|
|
40
|
+
//# sourceMappingURL=recentItems.d.ts.map
|
|
@@ -0,0 +1 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I,GAAG,IAAI,CAElE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAerE;AAyBD,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,aAAa,EAAE,CAIvF"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { useCallback as e, useSyncExternalStore as t } from "react";
|
|
2
|
+
//#region src/services/recentItems.ts
|
|
3
|
+
var n = [
|
|
4
|
+
"dataset",
|
|
5
|
+
"source",
|
|
6
|
+
"collection",
|
|
7
|
+
"pipeline",
|
|
8
|
+
"run",
|
|
9
|
+
"notebook",
|
|
10
|
+
"analysis",
|
|
11
|
+
"release"
|
|
12
|
+
], r = 8, i = "cosmicintersection:recent-items:v1:", a = "_none", o = 200, s = 200, c = "cosmicintersection:recent-items-changed", l = Object.freeze([]);
|
|
13
|
+
function u(e) {
|
|
14
|
+
return `${i}${e?.trim() || a}`;
|
|
15
|
+
}
|
|
16
|
+
function d() {
|
|
17
|
+
try {
|
|
18
|
+
return typeof window > "u" ? null : window.localStorage;
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function f(e) {
|
|
24
|
+
return typeof e == "string" && n.includes(e);
|
|
25
|
+
}
|
|
26
|
+
function p(e) {
|
|
27
|
+
return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") && !e.includes("\\") && !m(e);
|
|
28
|
+
}
|
|
29
|
+
function m(e) {
|
|
30
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
31
|
+
let n = e.charCodeAt(t);
|
|
32
|
+
if (n <= 31 || n === 127) return !0;
|
|
33
|
+
}
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
function h(e) {
|
|
37
|
+
if (typeof e != "object" || !e) return null;
|
|
38
|
+
let { type: t, id: n, name: r, href: i, visitedAt: a } = e;
|
|
39
|
+
if (!f(t) || !p(i) || typeof n != "string" || typeof r != "string") return null;
|
|
40
|
+
let c = n.trim(), l = r.trim();
|
|
41
|
+
return !c || !l || c.length > s ? null : {
|
|
42
|
+
type: t,
|
|
43
|
+
id: c,
|
|
44
|
+
name: l.slice(0, o),
|
|
45
|
+
href: i,
|
|
46
|
+
visitedAt: typeof a == "number" && Number.isFinite(a) ? a : 0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function g(e) {
|
|
50
|
+
if (!e) return l;
|
|
51
|
+
try {
|
|
52
|
+
let t = JSON.parse(e);
|
|
53
|
+
if (!Array.isArray(t)) return l;
|
|
54
|
+
let n = [], r = /* @__PURE__ */ new Set();
|
|
55
|
+
for (let e of t) {
|
|
56
|
+
let t = h(e);
|
|
57
|
+
if (!t) continue;
|
|
58
|
+
let i = `${t.type}:${t.id}`;
|
|
59
|
+
if (!r.has(i) && (r.add(i), n.push(t), n.length >= 8)) break;
|
|
60
|
+
}
|
|
61
|
+
return n;
|
|
62
|
+
} catch {
|
|
63
|
+
return l;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function _(e) {
|
|
67
|
+
try {
|
|
68
|
+
return d()?.getItem(e) ?? null;
|
|
69
|
+
} catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function v(e) {
|
|
74
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(c, { detail: { key: e } }));
|
|
75
|
+
}
|
|
76
|
+
function y(e, t) {
|
|
77
|
+
let n = d();
|
|
78
|
+
if (n) {
|
|
79
|
+
try {
|
|
80
|
+
t.length === 0 ? n.removeItem(e) : n.setItem(e, JSON.stringify(t));
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
v(e);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function b(e) {
|
|
88
|
+
return g(_(u(e)));
|
|
89
|
+
}
|
|
90
|
+
function x(e, t, n = Date.now()) {
|
|
91
|
+
let r = h({
|
|
92
|
+
...t,
|
|
93
|
+
visitedAt: n
|
|
94
|
+
});
|
|
95
|
+
if (!r) return;
|
|
96
|
+
let i = u(e);
|
|
97
|
+
y(i, [r, ...g(_(i)).filter((e) => !(e.type === r.type && e.id === r.id))].slice(0, 8));
|
|
98
|
+
}
|
|
99
|
+
function S(e) {
|
|
100
|
+
y(u(e), l);
|
|
101
|
+
}
|
|
102
|
+
function C(e) {
|
|
103
|
+
if (typeof window > "u") return () => void 0;
|
|
104
|
+
let t = (t) => {
|
|
105
|
+
(t.key === null || t.key.startsWith(i)) && e();
|
|
106
|
+
};
|
|
107
|
+
return window.addEventListener(c, e), window.addEventListener("storage", t), () => {
|
|
108
|
+
window.removeEventListener(c, e), window.removeEventListener("storage", t);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
var w = 32, T = /* @__PURE__ */ new Map();
|
|
112
|
+
function E(e) {
|
|
113
|
+
let t = _(e), n = T.get(e);
|
|
114
|
+
if (n && n.raw === t) return n.items;
|
|
115
|
+
let r = g(t);
|
|
116
|
+
return !n && T.size >= w && T.clear(), T.set(e, {
|
|
117
|
+
raw: t,
|
|
118
|
+
items: r
|
|
119
|
+
}), r;
|
|
120
|
+
}
|
|
121
|
+
function D(n) {
|
|
122
|
+
let r = u(n);
|
|
123
|
+
return t(C, e(() => E(r), [r]), () => l);
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { n as COS_RECENT_ENTITY_TYPES, c as COS_RECENT_ITEMS_EVENT, r as COS_RECENT_ITEMS_LIMIT, S as clearRecentItems, b as readRecentItems, u as recentItemsStorageKey, x as recordRecentItem, C as subscribeRecentItems, D as useCosRecentItems };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=recentItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recentItems.js","names":[],"sources":["../../src/services/recentItems.ts"],"sourcesContent":["/**\n * Recently viewed CosmicIntersection entities, per workspace.\n *\n * The detail pages of this microfrontend record every entity the user opens\n * (`recordRecentItem`), and the app shell reads the list back to render the\n * \"Recent\" section of its command palette (`useCosRecentItems`). The list is a\n * per-device convenience, so it lives in `localStorage` under one key per\n * workspace and never leaves the browser: switching workspaces shows that\n * workspace's history, and a blocked or full storage simply yields an empty\n * list instead of an error.\n *\n * The shell imports this module from the dedicated package subpath\n * `@burdenoff/microfe-cosmicintersection/services/recentItems`. Writers and\n * readers can end up in different bundles, so `localStorage` is the single\n * source of truth and changes are broadcast with a window event (same tab) and\n * the native `storage` event (other tabs) rather than an in-memory store.\n */\nimport { useCallback, useSyncExternalStore } from 'react';\n\n/** Entity kinds that can appear in the recent list. */\nexport type CosRecentEntityType =\n 'dataset' | 'source' | 'collection' | 'pipeline' | 'run' | 'notebook' | 'analysis' | 'release';\n\nexport const COS_RECENT_ENTITY_TYPES: readonly CosRecentEntityType[] = [\n 'dataset',\n 'source',\n 'collection',\n 'pipeline',\n 'run',\n 'notebook',\n 'analysis',\n 'release',\n];\n\n/** One recently viewed entity. */\nexport interface CosRecentItem {\n readonly type: CosRecentEntityType;\n readonly id: string;\n /** Display name at the time of the visit (dataset name, notebook title, ...). */\n readonly name: string;\n /** Absolute in-app path of the entity's detail view, e.g. `/cosmicintersection/datasets/ds-1`. */\n readonly href: string;\n /** Epoch milliseconds of the most recent visit. */\n readonly visitedAt: number;\n}\n\nexport type CosRecentItemInput = Omit<CosRecentItem, 'visitedAt'>;\n\n/** How many entries are kept per workspace. */\nexport const COS_RECENT_ITEMS_LIMIT = 8;\n\nconst STORAGE_PREFIX = 'cosmicintersection:recent-items:v1:';\nconst NO_WORKSPACE_KEY = '_none';\nconst MAX_NAME_LENGTH = 200;\nconst MAX_ID_LENGTH = 200;\n\n/** Window event fired after this tab changes a recent list. */\nexport const COS_RECENT_ITEMS_EVENT = 'cosmicintersection:recent-items-changed';\n\nconst EMPTY: readonly CosRecentItem[] = Object.freeze([]);\n\n/** The `localStorage` key holding one workspace's list. */\nexport function recentItemsStorageKey(workspaceId?: string | null): string {\n const workspace = workspaceId?.trim();\n return `${STORAGE_PREFIX}${workspace ? workspace : NO_WORKSPACE_KEY}`;\n}\n\nfunction getStorage(): Storage | null {\n try {\n return typeof window === 'undefined' ? null : window.localStorage;\n } catch {\n // Accessing localStorage throws when site data is blocked.\n return null;\n }\n}\n\nfunction isRecentType(value: unknown): value is CosRecentEntityType {\n return (\n typeof value === 'string' && (COS_RECENT_ENTITY_TYPES as readonly string[]).includes(value)\n );\n}\n\n/**\n * Only same-origin absolute paths are navigable: `/x` is accepted, while\n * protocol-relative `//host`, backslash tricks and ASCII control characters\n * are rejected so a tampered storage entry can never turn a palette click into\n * an off-site redirect. Control characters matter because the WHATWG URL\n * parser strips tab, CR and LF, which would turn `/\\n/evil.example` into the\n * protocol-relative `//evil.example`.\n */\nfunction isSafeHref(value: unknown): value is string {\n return (\n typeof value === 'string' &&\n value.startsWith('/') &&\n !value.startsWith('//') &&\n !value.includes('\\\\') &&\n !hasControlCharacter(value)\n );\n}\n\n/** True when the string contains a C0 control character or DEL. */\nfunction hasControlCharacter(value: string): boolean {\n for (let index = 0; index < value.length; index += 1) {\n const code = value.charCodeAt(index);\n if (code <= 0x1f || code === 0x7f) {\n return true;\n }\n }\n return false;\n}\n\n/** Validate and normalise one stored or incoming entry; null when unusable. */\nfunction sanitizeItem(value: unknown): CosRecentItem | null {\n if (typeof value !== 'object' || value === null) {\n return null;\n }\n const candidate = value as Record<string, unknown>;\n const { type, id, name, href, visitedAt } = candidate;\n if (!isRecentType(type) || !isSafeHref(href)) {\n return null;\n }\n if (typeof id !== 'string' || typeof name !== 'string') {\n return null;\n }\n const trimmedId = id.trim();\n const trimmedName = name.trim();\n if (!trimmedId || !trimmedName || trimmedId.length > MAX_ID_LENGTH) {\n return null;\n }\n return {\n type,\n id: trimmedId,\n name: trimmedName.slice(0, MAX_NAME_LENGTH),\n href,\n visitedAt: typeof visitedAt === 'number' && Number.isFinite(visitedAt) ? visitedAt : 0,\n };\n}\n\nfunction parseItems(raw: string | null): readonly CosRecentItem[] {\n if (!raw) {\n return EMPTY;\n }\n try {\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) {\n return EMPTY;\n }\n const items: CosRecentItem[] = [];\n const seen = new Set<string>();\n for (const entry of parsed) {\n const item = sanitizeItem(entry);\n if (!item) continue;\n const identity = `${item.type}:${item.id}`;\n if (seen.has(identity)) continue;\n seen.add(identity);\n items.push(item);\n if (items.length >= COS_RECENT_ITEMS_LIMIT) break;\n }\n return items;\n } catch {\n return EMPTY;\n }\n}\n\nfunction readRaw(key: string): string | null {\n try {\n return getStorage()?.getItem(key) ?? null;\n } catch {\n return null;\n }\n}\n\nfunction notify(key: string): void {\n if (typeof window === 'undefined') return;\n window.dispatchEvent(new CustomEvent(COS_RECENT_ITEMS_EVENT, { detail: { key } }));\n}\n\nfunction write(key: string, items: readonly CosRecentItem[]): void {\n const storage = getStorage();\n if (!storage) return;\n try {\n if (items.length === 0) {\n storage.removeItem(key);\n } else {\n storage.setItem(key, JSON.stringify(items));\n }\n } catch {\n // Quota exceeded or storage blocked: the recent list is best-effort.\n return;\n }\n notify(key);\n}\n\n/** The workspace's recent entities, most recent first. */\nexport function readRecentItems(workspaceId?: string | null): readonly CosRecentItem[] {\n return parseItems(readRaw(recentItemsStorageKey(workspaceId)));\n}\n\n/**\n * Move (or add) an entity to the top of the workspace's recent list.\n *\n * Revisiting an entity updates its name and timestamp instead of adding a\n * duplicate, and the list is capped at `COS_RECENT_ITEMS_LIMIT`.\n */\nexport function recordRecentItem(\n workspaceId: string | null | undefined,\n input: CosRecentItemInput,\n now: number = Date.now()\n): void {\n const item = sanitizeItem({ ...input, visitedAt: now });\n if (!item) return;\n const key = recentItemsStorageKey(workspaceId);\n // Read-modify-write is not atomic across tabs: two tabs recording in the\n // same instant can drop one entry. That is acceptable for a best-effort\n // convenience list and not worth a cross-tab lock.\n const current = parseItems(readRaw(key));\n const rest = current.filter((entry) => !(entry.type === item.type && entry.id === item.id));\n write(key, [item, ...rest].slice(0, COS_RECENT_ITEMS_LIMIT));\n}\n\n/** Forget the workspace's whole recent list. */\nexport function clearRecentItems(workspaceId?: string | null): void {\n write(recentItemsStorageKey(workspaceId), EMPTY);\n}\n\n/**\n * Subscribe to changes of any workspace's recent list, from this tab or\n * another one. Returns the unsubscribe function.\n */\nexport function subscribeRecentItems(listener: () => void): () => void {\n if (typeof window === 'undefined') {\n return () => undefined;\n }\n const onStorage = (event: StorageEvent): void => {\n if (event.key === null || event.key.startsWith(STORAGE_PREFIX)) {\n listener();\n }\n };\n window.addEventListener(COS_RECENT_ITEMS_EVENT, listener);\n window.addEventListener('storage', onStorage);\n return () => {\n window.removeEventListener(COS_RECENT_ITEMS_EVENT, listener);\n window.removeEventListener('storage', onStorage);\n };\n}\n\n/**\n * `useSyncExternalStore` needs a referentially stable snapshot while the\n * stored value is unchanged, so parsed lists are cached by their raw string.\n */\nconst SNAPSHOT_CACHE_LIMIT = 32;\nconst snapshotCache = new Map<string, { raw: string | null; items: readonly CosRecentItem[] }>();\n\nfunction getSnapshotFor(key: string): readonly CosRecentItem[] {\n const raw = readRaw(key);\n const cached = snapshotCache.get(key);\n if (cached && cached.raw === raw) {\n return cached.items;\n }\n const items = parseItems(raw);\n // One entry per workspace visited this session; bounded so a long-lived tab\n // that hops across many workspaces cannot grow it without limit.\n if (!cached && snapshotCache.size >= SNAPSHOT_CACHE_LIMIT) {\n snapshotCache.clear();\n }\n snapshotCache.set(key, { raw, items });\n return items;\n}\n\n/** React hook: the workspace's recent entities, kept in sync with storage. */\nexport function useCosRecentItems(workspaceId?: string | null): readonly CosRecentItem[] {\n const key = recentItemsStorageKey(workspaceId);\n const getSnapshot = useCallback(() => getSnapshotFor(key), [key]);\n return useSyncExternalStore(subscribeRecentItems, getSnapshot, () => EMPTY);\n}\n"],"mappings":";;AAuBA,IAAa,IAA0D;CACrE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAi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AAW,EAAQ,CAAG,CACzB,CAAA,CAAQ,QAAQ,MAAU,EAAE,EAAM,SAAS,EAAK,QAAQ,EAAM,OAAO,EAAK,GAClE,CAAI,CAAC,CAAC,MAAM,GAAA,CAAyB,CAAC;AAC7D;AAGA,SAAgB,EAAiB,GAAmC;CAClE,EAAM,EAAsB,CAAW,GAAG,CAAK;AACjD;AAMA,SAAgB,EAAqB,GAAkC;CACrE,IAAI,OAAO,SAAW,KACpB,aAAa,KAAA;CAEf,IAAM,KAAa,MAA8B;EAC/C,CAAI,EAAM,QAAQ,QAAQ,EAAM,IAAI,WAAW,CAAc,MAC3D,EAAS;CAEb;CAGA,OAFA,OAAO,iBAAiB,GAAwB,CAAQ,GACxD,OAAO,iBAAiB,WAAW,CAAS,SAC/B;EAEX,AADA,OAAO,oBAAoB,GAAwB,CAAQ,GAC3D,OAAO,oBAAoB,WAAW,CAAS;CACjD;AACF;AAMA,IAAM,IAAuB,IACvB,oBAAgB,IAAI,IAAqE;AAE/F,SAAS,EAAe,GAAuC;CAC7D,IAAM,IAAM,EAAQ,CAAG,GACjB,IAAS,EAAc,IAAI,CAAG;CACpC,IAAI,KAAU,EAAO,QAAQ,GAC3B,OAAO,EAAO;CAEhB,IAAM,IAAQ,EAAW,CAAG;CAO5B,OAJI,CAAC,KAAU,EAAc,QAAQ,KACnC,EAAc,MAAM,GAEtB,EAAc,IAAI,GAAK;EAAE;EAAK;CAAM,CAAC,GAC9B;AACT;AAGA,SAAgB,EAAkB,GAAuD;CACvF,IAAM,IAAM,EAAsB,CAAW;CAE7C,OAAO,EAAqB,GADR,QAAkB,EAAe,CAAG,GAAG,CAAC,CAAG,CACb,SAAmB,CAAK;AAC5E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ScienceCanvas } from '../cosmicintersection/components/ScienceCanvas';
|
|
3
|
+
/**
|
|
4
|
+
* The analyses results canvas (BOFF-3984). Each story feeds one canonical
|
|
5
|
+
* `results.visualization(s)` payload, exactly as `cosCompleteAnalysis` stores it.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof ScienceCanvas>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const SkyMap: Story;
|
|
11
|
+
export declare const Spectrum: Story;
|
|
12
|
+
export declare const LightCurve: Story;
|
|
13
|
+
export declare const Scene3D: Story;
|
|
14
|
+
export declare const MultipleViews: Story;
|
|
15
|
+
/** Legacy free-form results keep rendering through the generic numeric chart. */
|
|
16
|
+
export declare const LegacyNumericSeries: Story;
|
|
17
|
+
/** Scalar-only results fall back to the key/value metrics table. */
|
|
18
|
+
export declare const MetricsOnly: Story;
|
|
19
|
+
/** A 12,000-sample spectrum: thinned for drawing, with its narrow line kept. */
|
|
20
|
+
export declare const LongSpectrumThinned: Story;
|
|
21
|
+
//# sourceMappingURL=ScienceCanvas.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScienceCanvas.stories.d.ts","sourceRoot":"","sources":["../../src/stories/ScienceCanvas.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAQ/E;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAiBpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAExB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,EAAE,KAcjC,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,EAAE,KAqBjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-cosmicintersection",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1102.1",
|
|
4
4
|
"description": "Burdenoff CosmicIntersection Microfrontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"./services/createSandboxAssistantTransport": {
|
|
21
21
|
"types": "./dist/services/createSandboxAssistantTransport.d.ts",
|
|
22
22
|
"import": "./dist/services/createSandboxAssistantTransport.js"
|
|
23
|
+
},
|
|
24
|
+
"./services/recentItems": {
|
|
25
|
+
"types": "./dist/services/recentItems.d.ts",
|
|
26
|
+
"import": "./dist/services/recentItems.js"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"main": "./dist/index.js",
|