@burdenoff/microfe-labsofscience 2026.720.1 → 2026.722.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/labsofscience/LabsOfScienceRoot.js +8 -4
- package/dist/labsofscience/LabsOfScienceRoot.js.map +1 -1
- package/dist/labsofscience/LabsOfScienceRoutes.js.map +1 -1
- package/dist/labsofscience/components/BottomNav.js.map +1 -1
- package/dist/labsofscience/components/DiscussionPanel.js +1 -1
- package/dist/labsofscience/components/DiscussionPanel.js.map +1 -1
- package/dist/labsofscience/components/EmptyState.js.map +1 -1
- package/dist/labsofscience/components/FileAttachment.js.map +1 -1
- package/dist/labsofscience/components/FileUploadField.js.map +1 -1
- package/dist/labsofscience/components/ListSearchInput.js.map +1 -1
- package/dist/labsofscience/components/MetricsCard.js.map +1 -1
- package/dist/labsofscience/components/PageLayout.js.map +1 -1
- package/dist/labsofscience/components/ProvenanceChain.js.map +1 -1
- package/dist/labsofscience/components/QueryStates.js +1 -1
- package/dist/labsofscience/components/QueryStates.js.map +1 -1
- package/dist/labsofscience/components/StatusBadge.js +1 -1
- package/dist/labsofscience/components/StatusBadge.js.map +1 -1
- package/dist/labsofscience/context/LabsOfScienceContext.js +2 -1
- package/dist/labsofscience/context/LabsOfScienceContext.js.map +1 -1
- package/dist/labsofscience/context/index.js +2 -1
- package/dist/labsofscience/hooks/useLabActorNames.js.map +1 -1
- package/dist/labsofscience/hooks/useLabsOfScienceApi.js.map +1 -1
- package/dist/labsofscience/index.js +6 -5
- package/dist/labsofscience/pages/OverviewPage.js.map +1 -1
- package/dist/labsofscience/pages/datasets/AddDatasetVersionDialog.js.map +1 -1
- package/dist/labsofscience/pages/datasets/DatasetDetailPage.js +1 -1
- package/dist/labsofscience/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/datasets/DatasetFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/datasets/DatasetsListPage.js.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js +2 -2
- package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/experiments/RunDialogs.js.map +1 -1
- package/dist/labsofscience/pages/instruments/BookInstrumentDialog.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/inventory/AdjustInventoryDialog.js.map +1 -1
- package/dist/labsofscience/pages/inventory/InventoryDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/inventory/InventoryFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/inventory/InventoryListPage.js.map +1 -1
- package/dist/labsofscience/pages/notebook/NotebookEntryDetailPage.js +2 -2
- package/dist/labsofscience/pages/notebook/NotebookEntryDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/notebook/NotebookEntryFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/notebook/NotebookListPage.js +1 -1
- package/dist/labsofscience/pages/notebook/NotebookListPage.js.map +1 -1
- package/dist/labsofscience/pages/pipelines/PipelineFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/pipelines/PipelinesPage.js.map +1 -1
- package/dist/labsofscience/pages/pipelines/RunPipelineDialog.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -1
- package/dist/labsofscience/pages/protocols/AddProtocolStepDialog.js.map +1 -1
- package/dist/labsofscience/pages/protocols/ProtocolDetailPage.js.map +1 -1
- package/dist/labsofscience/pages/protocols/ProtocolFormDialog.js.map +1 -1
- package/dist/labsofscience/pages/protocols/ProtocolsListPage.js.map +1 -1
- package/dist/labsofscience/pages/shared/DetailComponents.js.map +1 -1
- package/dist/labsofscience/pages/shared/tags.js.map +1 -1
- package/dist/labsofscience/store/index.js +2 -1
- package/dist/labsofscience/store/labsofscienceStore.js.map +1 -1
- package/dist/labsofscience/utils/cn.js +1 -1
- package/dist/labsofscience/utils/cn.js.map +1 -1
- package/dist/labsofscience/utils/formatters.js.map +1 -1
- package/dist/labsofscience/utils/navigation.js.map +1 -1
- package/dist/labsofscience/utils/uploadFile.js +1 -1
- package/dist/labsofscience/utils/uploadFile.js.map +1 -1
- package/dist/labsofscience/utils/useDebouncedValue.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +130 -130
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/utils/pageContext.js +1 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +4 -4
|
@@ -16,7 +16,8 @@ var v = new i({ defaultOptions: { queries: {
|
|
|
16
16
|
return n === e ? t : n;
|
|
17
17
|
}, [S]), w = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
18
18
|
return r(() => {
|
|
19
|
-
if (y) return
|
|
19
|
+
if (!y) return;
|
|
20
|
+
let e = [
|
|
20
21
|
{
|
|
21
22
|
id: "labsofscience-overview",
|
|
22
23
|
label: C("labsofscience.nav.overview", "Overview"),
|
|
@@ -89,19 +90,22 @@ var v = new i({ defaultOptions: { queries: {
|
|
|
89
90
|
order: 31,
|
|
90
91
|
group: "bench"
|
|
91
92
|
}
|
|
92
|
-
]
|
|
93
|
+
];
|
|
94
|
+
return y(e);
|
|
93
95
|
}, [
|
|
94
96
|
y,
|
|
95
97
|
x,
|
|
96
98
|
C
|
|
97
99
|
]), r(() => {
|
|
98
|
-
if (b) return
|
|
100
|
+
if (!b) return;
|
|
101
|
+
let e = [{
|
|
99
102
|
id: "labsofscience-status",
|
|
100
103
|
label: C("labsofscience.footer.ready", "LabsOfScience Ready"),
|
|
101
104
|
type: "status",
|
|
102
105
|
order: 10,
|
|
103
106
|
section: "left"
|
|
104
|
-
}]
|
|
107
|
+
}];
|
|
108
|
+
return b(e);
|
|
105
109
|
}, [b, C]), /* @__PURE__ */ g(a, {
|
|
106
110
|
client: v,
|
|
107
111
|
children: /* @__PURE__ */ g(_, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabsOfScienceRoot.js","names":[],"sources":["../../src/labsofscience/LabsOfScienceRoot.tsx"],"sourcesContent":["/**\n * LabsOfScience Root Component\n * @module labsofscience\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n FolderKanban,\n FlaskConical,\n Database,\n Microscope,\n Cpu,\n Boxes,\n BookOpen,\n GitBranch,\n} from 'lucide-react';\nimport { LabsOfScienceProvider } from './context/LabsOfScienceContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { LabsOfScienceRoutes } from './LabsOfScienceRoutes';\nimport type { LabsOfScienceRootProps, NavItem } from './types';\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const LabsOfScienceRoot: FC<LabsOfScienceRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n // Overview\n {\n id: 'labsofscience-overview',\n label: t('labsofscience.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 1,\n group: 'main',\n },\n\n // Research\n {\n id: 'labsofscience-projects',\n label: t('labsofscience.nav.projects', 'Projects'),\n path: joinPath(basePath, 'projects'),\n icon: <FolderKanban size={20} />,\n order: 10,\n group: 'research',\n },\n {\n id: 'labsofscience-experiments',\n label: t('labsofscience.nav.experiments', 'Experiments'),\n path: joinPath(basePath, 'experiments'),\n icon: <FlaskConical size={20} />,\n order: 11,\n group: 'research',\n },\n {\n id: 'labsofscience-notebook',\n label: t('labsofscience.nav.notebook', 'Notebook'),\n path: joinPath(basePath, 'notebook'),\n icon: <BookOpen size={20} />,\n order: 12,\n group: 'research',\n },\n {\n id: 'labsofscience-protocols',\n label: t('labsofscience.nav.protocols', 'Protocols'),\n path: joinPath(basePath, 'protocols'),\n icon: <Microscope size={20} />,\n order: 13,\n group: 'research',\n },\n\n // Data & analysis\n {\n id: 'labsofscience-datasets',\n label: t('labsofscience.nav.datasets', 'Datasets'),\n path: joinPath(basePath, 'datasets'),\n icon: <Database size={20} />,\n order: 20,\n group: 'data',\n },\n {\n id: 'labsofscience-pipelines',\n label: t('labsofscience.nav.pipelines', 'Pipelines'),\n path: joinPath(basePath, 'pipelines'),\n icon: <GitBranch size={20} />,\n order: 21,\n group: 'data',\n },\n\n // The bench\n {\n id: 'labsofscience-inventory',\n label: t('labsofscience.nav.inventory', 'Inventory'),\n path: joinPath(basePath, 'inventory'),\n icon: <Boxes size={20} />,\n order: 30,\n group: 'bench',\n },\n {\n id: 'labsofscience-instruments',\n label: t('labsofscience.nav.instruments', 'Instruments'),\n path: joinPath(basePath, 'instruments'),\n icon: <Cpu size={20} />,\n order: 31,\n group: 'bench',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, t]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'labsofscience-status',\n label: t('labsofscience.footer.ready', 'LabsOfScience Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <LabsOfScienceProvider {...props}>\n <LabsOfScienceRoutes />\n </LabsOfScienceProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;AA0BA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,MAAS;CACpB,OAAO;
|
|
1
|
+
{"version":3,"file":"LabsOfScienceRoot.js","names":[],"sources":["../../src/labsofscience/LabsOfScienceRoot.tsx"],"sourcesContent":["/**\n * LabsOfScience Root Component\n * @module labsofscience\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n FolderKanban,\n FlaskConical,\n Database,\n Microscope,\n Cpu,\n Boxes,\n BookOpen,\n GitBranch,\n} from 'lucide-react';\nimport { LabsOfScienceProvider } from './context/LabsOfScienceContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { LabsOfScienceRoutes } from './LabsOfScienceRoutes';\nimport type { LabsOfScienceRootProps, NavItem } from './types';\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const LabsOfScienceRoot: FC<LabsOfScienceRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n // Overview\n {\n id: 'labsofscience-overview',\n label: t('labsofscience.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 1,\n group: 'main',\n },\n\n // Research\n {\n id: 'labsofscience-projects',\n label: t('labsofscience.nav.projects', 'Projects'),\n path: joinPath(basePath, 'projects'),\n icon: <FolderKanban size={20} />,\n order: 10,\n group: 'research',\n },\n {\n id: 'labsofscience-experiments',\n label: t('labsofscience.nav.experiments', 'Experiments'),\n path: joinPath(basePath, 'experiments'),\n icon: <FlaskConical size={20} />,\n order: 11,\n group: 'research',\n },\n {\n id: 'labsofscience-notebook',\n label: t('labsofscience.nav.notebook', 'Notebook'),\n path: joinPath(basePath, 'notebook'),\n icon: <BookOpen size={20} />,\n order: 12,\n group: 'research',\n },\n {\n id: 'labsofscience-protocols',\n label: t('labsofscience.nav.protocols', 'Protocols'),\n path: joinPath(basePath, 'protocols'),\n icon: <Microscope size={20} />,\n order: 13,\n group: 'research',\n },\n\n // Data & analysis\n {\n id: 'labsofscience-datasets',\n label: t('labsofscience.nav.datasets', 'Datasets'),\n path: joinPath(basePath, 'datasets'),\n icon: <Database size={20} />,\n order: 20,\n group: 'data',\n },\n {\n id: 'labsofscience-pipelines',\n label: t('labsofscience.nav.pipelines', 'Pipelines'),\n path: joinPath(basePath, 'pipelines'),\n icon: <GitBranch size={20} />,\n order: 21,\n group: 'data',\n },\n\n // The bench\n {\n id: 'labsofscience-inventory',\n label: t('labsofscience.nav.inventory', 'Inventory'),\n path: joinPath(basePath, 'inventory'),\n icon: <Boxes size={20} />,\n order: 30,\n group: 'bench',\n },\n {\n id: 'labsofscience-instruments',\n label: t('labsofscience.nav.instruments', 'Instruments'),\n path: joinPath(basePath, 'instruments'),\n icon: <Cpu size={20} />,\n order: 31,\n group: 'bench',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, t]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'labsofscience-status',\n label: t('labsofscience.footer.ready', 'LabsOfScience Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <LabsOfScienceProvider {...props}>\n <LabsOfScienceRoutes />\n </LabsOfScienceProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabsOfScienceRoutes.js","names":[],"sources":["../../src/labsofscience/LabsOfScienceRoutes.tsx"],"sourcesContent":["/**\n * LabsOfScience Routes\n * @module labsofscience\n *\n * Domain routes for the research microfrontend. The overview is eager-loaded;\n * every other page is lazy-loaded so the host shell only pays for what is\n * navigated to.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { useLabsOfScience } from './context/LabsOfScienceContext';\nimport { BottomNav } from './components/BottomNav';\n\n// Eager-loaded landing page\nimport { OverviewPage } from './pages/OverviewPage';\n\n// Projects\nconst ProjectsListPage = lazy(() =>\n import('./pages/projects/ProjectsListPage').then((m) => ({ default: m.ProjectsListPage }))\n);\nconst ProjectDetailPage = lazy(() =>\n import('./pages/projects/ProjectDetailPage').then((m) => ({ default: m.ProjectDetailPage }))\n);\n\n// Experiments (+ runs)\nconst ExperimentsListPage = lazy(() =>\n import('./pages/experiments/ExperimentsListPage').then((m) => ({\n default: m.ExperimentsListPage,\n }))\n);\nconst ExperimentDetailPage = lazy(() =>\n import('./pages/experiments/ExperimentDetailPage').then((m) => ({\n default: m.ExperimentDetailPage,\n }))\n);\n\n// Datasets\nconst DatasetsListPage = lazy(() =>\n import('./pages/datasets/DatasetsListPage').then((m) => ({ default: m.DatasetsListPage }))\n);\nconst DatasetDetailPage = lazy(() =>\n import('./pages/datasets/DatasetDetailPage').then((m) => ({ default: m.DatasetDetailPage }))\n);\n\n// Protocols\nconst ProtocolsListPage = lazy(() =>\n import('./pages/protocols/ProtocolsListPage').then((m) => ({ default: m.ProtocolsListPage }))\n);\nconst ProtocolDetailPage = lazy(() =>\n import('./pages/protocols/ProtocolDetailPage').then((m) => ({ default: m.ProtocolDetailPage }))\n);\n\n// Instruments\nconst InstrumentsListPage = lazy(() =>\n import('./pages/instruments/InstrumentsListPage').then((m) => ({\n default: m.InstrumentsListPage,\n }))\n);\nconst InstrumentDetailPage = lazy(() =>\n import('./pages/instruments/InstrumentDetailPage').then((m) => ({\n default: m.InstrumentDetailPage,\n }))\n);\n\n// Inventory\nconst InventoryListPage = lazy(() =>\n import('./pages/inventory/InventoryListPage').then((m) => ({ default: m.InventoryListPage }))\n);\nconst InventoryDetailPage = lazy(() =>\n import('./pages/inventory/InventoryDetailPage').then((m) => ({ default: m.InventoryDetailPage }))\n);\n\n// Notebook\nconst NotebookListPage = lazy(() =>\n import('./pages/notebook/NotebookListPage').then((m) => ({ default: m.NotebookListPage }))\n);\nconst NotebookEntryDetailPage = lazy(() =>\n import('./pages/notebook/NotebookEntryDetailPage').then((m) => ({\n default: m.NotebookEntryDetailPage,\n }))\n);\n\n// Pipelines\nconst PipelinesPage = lazy(() =>\n import('./pages/pipelines/PipelinesPage').then((m) => ({ default: m.PipelinesPage }))\n);\n\n// Loading fallback component\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const LabsOfScienceRoutes: FC = () => {\n const { basePath, isStandalone } = useLabsOfScience();\n const location = useLocation();\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: Only render if path matches basePath (when integrated)\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col pb-16 lg:pb-0\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview — eager loaded landing */}\n <Route index element={<OverviewPage />} />\n\n {/* Projects */}\n <Route path=\"projects\" element={<ProjectsListPage />} />\n <Route path=\"projects/:id\" element={<ProjectDetailPage />} />\n\n {/* Experiments (+ runs) */}\n <Route path=\"experiments\" element={<ExperimentsListPage />} />\n <Route path=\"experiments/:id\" element={<ExperimentDetailPage />} />\n\n {/* Datasets */}\n <Route path=\"datasets\" element={<DatasetsListPage />} />\n <Route path=\"datasets/:id\" element={<DatasetDetailPage />} />\n\n {/* Protocols */}\n <Route path=\"protocols\" element={<ProtocolsListPage />} />\n <Route path=\"protocols/:id\" element={<ProtocolDetailPage />} />\n\n {/* Instruments */}\n <Route path=\"instruments\" element={<InstrumentsListPage />} />\n <Route path=\"instruments/:id\" element={<InstrumentDetailPage />} />\n\n {/* Inventory */}\n <Route path=\"inventory\" element={<InventoryListPage />} />\n <Route path=\"inventory/:id\" element={<InventoryDetailPage />} />\n\n {/* Notebook (ELN) */}\n <Route path=\"notebook\" element={<NotebookListPage />} />\n <Route path=\"notebook/:id\" element={<NotebookEntryDetailPage />} />\n\n {/* Analysis pipelines */}\n <Route path=\"pipelines\" element={<PipelinesPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n <BottomNav />\n </div>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAM,IAAmB,QACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"LabsOfScienceRoutes.js","names":[],"sources":["../../src/labsofscience/LabsOfScienceRoutes.tsx"],"sourcesContent":["/**\n * LabsOfScience Routes\n * @module labsofscience\n *\n * Domain routes for the research microfrontend. The overview is eager-loaded;\n * every other page is lazy-loaded so the host shell only pays for what is\n * navigated to.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { useLabsOfScience } from './context/LabsOfScienceContext';\nimport { BottomNav } from './components/BottomNav';\n\n// Eager-loaded landing page\nimport { OverviewPage } from './pages/OverviewPage';\n\n// Projects\nconst ProjectsListPage = lazy(() =>\n import('./pages/projects/ProjectsListPage').then((m) => ({ default: m.ProjectsListPage }))\n);\nconst ProjectDetailPage = lazy(() =>\n import('./pages/projects/ProjectDetailPage').then((m) => ({ default: m.ProjectDetailPage }))\n);\n\n// Experiments (+ runs)\nconst ExperimentsListPage = lazy(() =>\n import('./pages/experiments/ExperimentsListPage').then((m) => ({\n default: m.ExperimentsListPage,\n }))\n);\nconst ExperimentDetailPage = lazy(() =>\n import('./pages/experiments/ExperimentDetailPage').then((m) => ({\n default: m.ExperimentDetailPage,\n }))\n);\n\n// Datasets\nconst DatasetsListPage = lazy(() =>\n import('./pages/datasets/DatasetsListPage').then((m) => ({ default: m.DatasetsListPage }))\n);\nconst DatasetDetailPage = lazy(() =>\n import('./pages/datasets/DatasetDetailPage').then((m) => ({ default: m.DatasetDetailPage }))\n);\n\n// Protocols\nconst ProtocolsListPage = lazy(() =>\n import('./pages/protocols/ProtocolsListPage').then((m) => ({ default: m.ProtocolsListPage }))\n);\nconst ProtocolDetailPage = lazy(() =>\n import('./pages/protocols/ProtocolDetailPage').then((m) => ({ default: m.ProtocolDetailPage }))\n);\n\n// Instruments\nconst InstrumentsListPage = lazy(() =>\n import('./pages/instruments/InstrumentsListPage').then((m) => ({\n default: m.InstrumentsListPage,\n }))\n);\nconst InstrumentDetailPage = lazy(() =>\n import('./pages/instruments/InstrumentDetailPage').then((m) => ({\n default: m.InstrumentDetailPage,\n }))\n);\n\n// Inventory\nconst InventoryListPage = lazy(() =>\n import('./pages/inventory/InventoryListPage').then((m) => ({ default: m.InventoryListPage }))\n);\nconst InventoryDetailPage = lazy(() =>\n import('./pages/inventory/InventoryDetailPage').then((m) => ({ default: m.InventoryDetailPage }))\n);\n\n// Notebook\nconst NotebookListPage = lazy(() =>\n import('./pages/notebook/NotebookListPage').then((m) => ({ default: m.NotebookListPage }))\n);\nconst NotebookEntryDetailPage = lazy(() =>\n import('./pages/notebook/NotebookEntryDetailPage').then((m) => ({\n default: m.NotebookEntryDetailPage,\n }))\n);\n\n// Pipelines\nconst PipelinesPage = lazy(() =>\n import('./pages/pipelines/PipelinesPage').then((m) => ({ default: m.PipelinesPage }))\n);\n\n// Loading fallback component\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const LabsOfScienceRoutes: FC = () => {\n const { basePath, isStandalone } = useLabsOfScience();\n const location = useLocation();\n\n // Normalize base path\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: Only render if path matches basePath (when integrated)\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col pb-16 lg:pb-0\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview — eager loaded landing */}\n <Route index element={<OverviewPage />} />\n\n {/* Projects */}\n <Route path=\"projects\" element={<ProjectsListPage />} />\n <Route path=\"projects/:id\" element={<ProjectDetailPage />} />\n\n {/* Experiments (+ runs) */}\n <Route path=\"experiments\" element={<ExperimentsListPage />} />\n <Route path=\"experiments/:id\" element={<ExperimentDetailPage />} />\n\n {/* Datasets */}\n <Route path=\"datasets\" element={<DatasetsListPage />} />\n <Route path=\"datasets/:id\" element={<DatasetDetailPage />} />\n\n {/* Protocols */}\n <Route path=\"protocols\" element={<ProtocolsListPage />} />\n <Route path=\"protocols/:id\" element={<ProtocolDetailPage />} />\n\n {/* Instruments */}\n <Route path=\"instruments\" element={<InstrumentsListPage />} />\n <Route path=\"instruments/:id\" element={<InstrumentDetailPage />} />\n\n {/* Inventory */}\n <Route path=\"inventory\" element={<InventoryListPage />} />\n <Route path=\"inventory/:id\" element={<InventoryDetailPage />} />\n\n {/* Notebook (ELN) */}\n <Route path=\"notebook\" element={<NotebookListPage />} />\n <Route path=\"notebook/:id\" element={<NotebookEntryDetailPage />} />\n\n {/* Analysis pipelines */}\n <Route path=\"pipelines\" element={<PipelinesPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n <BottomNav />\n </div>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAM,IAAmB,QACvB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC3F,GACM,IAAoB,QACxB,OAAO,wCAAqC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC7F,GAGM,IAAsB,QAC1B,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAC7D,SAAS,EAAE,oBACb,EAAE,CACJ,GACM,IAAuB,QAC3B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAAS,EAAE,qBACb,EAAE,CACJ,GAGM,IAAmB,QACvB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC3F,GACM,IAAoB,QACxB,OAAO,wCAAqC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC7F,GAGM,IAAoB,QACxB,OAAO,yCAAsC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC9F,GACM,IAAqB,QACzB,OAAO,0CAAuC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAChG,GAGM,IAAsB,QAC1B,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAC7D,SAAS,EAAE,oBACb,EAAE,CACJ,GACM,IAAuB,QAC3B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAAS,EAAE,qBACb,EAAE,CACJ,GAGM,IAAoB,QACxB,OAAO,yCAAsC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC9F,GACM,IAAsB,QAC1B,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAClG,GAGM,IAAmB,QACvB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC3F,GACM,IAA0B,QAC9B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAAS,EAAE,wBACb,EAAE,CACJ,GAGM,IAAgB,QACpB,OAAO,qCAAkC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACtF,GAGM,UACJ,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,OAAD,EAAK,WAAU,8DAA+D,CAAA;AAC3E,CAAA,GAGM,UAAgC;CAC3C,IAAM,EAAE,aAAU,oBAAiB,EAAiB,GAC9C,IAAW,EAAY,GAGvB,IAAqB,MAAa,MAAM,MAAM,KAAY,GAAA,CAAI,QAAQ,OAAO,EAAE;CAarF,OAVI,KAAsB,CAAC,KAKrB,EAHF,EAAS,aAAa,KACtB,EAAS,SAAS,WAAW,IAAqB,GAAG,KAG9C,OAKT,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAU,UAAU,kBAAC,GAAD,CAAa,CAAA;aAC/B,kBAAC,GAAD,EAAA,UAAA;IAEE,kBAAC,GAAD;KAAO,OAAA;KAAM,SAAS,kBAAC,GAAD,CAAe,CAAA;IAAI,CAAA;IAGzC,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,CAAmB,CAAA;IAAI,CAAA;IACvD,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,CAAoB,CAAA;IAAI,CAAA;IAG5D,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,CAAsB,CAAA;IAAI,CAAA;IAC7D,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,CAAuB,CAAA;IAAI,CAAA;IAGlE,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,CAAmB,CAAA;IAAI,CAAA;IACvD,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,CAAoB,CAAA;IAAI,CAAA;IAG5D,kBAAC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAAC,GAAD,CAAoB,CAAA;IAAI,CAAA;IACzD,kBAAC,GAAD;KAAO,MAAK;KAAgB,SAAS,kBAAC,GAAD,CAAqB,CAAA;IAAI,CAAA;IAG9D,kBAAC,GAAD;KAAO,MAAK;KAAc,SAAS,kBAAC,GAAD,CAAsB,CAAA;IAAI,CAAA;IAC7D,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,CAAuB,CAAA;IAAI,CAAA;IAGlE,kBAAC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAAC,GAAD,CAAoB,CAAA;IAAI,CAAA;IACzD,kBAAC,GAAD;KAAO,MAAK;KAAgB,SAAS,kBAAC,GAAD,CAAsB,CAAA;IAAI,CAAA;IAG/D,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,CAAmB,CAAA;IAAI,CAAA;IACvD,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,CAA0B,CAAA;IAAI,CAAA;IAGlE,kBAAC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAAC,GAAD,CAAgB,CAAA;IAAI,CAAA;IAGrD,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,GACV,kBAAC,GAAD,CAAY,CAAA,CACT;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomNav.js","names":[],"sources":["../../../src/labsofscience/components/BottomNav.tsx"],"sourcesContent":["/**\n * BottomNav — LabsOfScience's mobile tab bar (BOFF-3982 / BOFF-4199 / BOFF-4642).\n * @module labsofscience/components\n *\n * The Capacitor iOS/Android shell renders this MFE inside a WebView with no\n * layout adaptation of its own: without this component the app shipped the\n * same desktop sidebar-oriented navigation on a phone screen. Mirrors the\n * host shell's own nine registered nav items (see `LabsOfScienceRoot`) but\n * surfaces only the four highest-traffic research destinations directly —\n * Overview / Projects / Experiments / Notebook — plus a \"More\" tab that opens\n * a bottom sheet for the remaining five (Protocols, Datasets, Pipelines,\n * Inventory, Instruments), matching the mobile mocks\n * (`labsofscience-specs/product/mockups/labsci-29-mobile-nav.png`,\n * `labsci-30-mobile-more-sheet.png`).\n *\n * Fixed at the bottom of the viewport, hidden at and above the `lg`\n * breakpoint — the same responsive split the shared `ResponsiveTable` /\n * `ResponsiveDialog` primitives already use throughout this MFE.\n */\n\nimport { type FC, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport {\n LayoutDashboard,\n FolderKanban,\n FlaskConical,\n BookOpen,\n Microscope,\n Database,\n GitBranch,\n Boxes,\n Cpu,\n MoreHorizontal,\n} from 'lucide-react';\nimport {\n BottomSheet,\n BottomSheetContent,\n BottomSheetHeader,\n BottomSheetTitle,\n BottomSheetDescription,\n} from '@burdenoff/fe-libs/ui';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\nimport { cn } from '../utils/cn';\n\ninterface TabDef {\n id: string;\n label: string;\n /** Path relative to basePath, '' for the overview. */\n path: string;\n icon: FC<{ className?: string }>;\n}\n\nconst PRIMARY_TABS: TabDef[] = [\n { id: 'overview', label: 'Overview', path: '', icon: LayoutDashboard },\n { id: 'projects', label: 'Projects', path: 'projects', icon: FolderKanban },\n { id: 'experiments', label: 'Experiments', path: 'experiments', icon: FlaskConical },\n { id: 'notebook', label: 'Notebook', path: 'notebook', icon: BookOpen },\n];\n\nconst MORE_TABS: TabDef[] = [\n { id: 'protocols', label: 'Protocols', path: 'protocols', icon: Microscope },\n { id: 'datasets', label: 'Datasets', path: 'datasets', icon: Database },\n { id: 'pipelines', label: 'Pipelines', path: 'pipelines', icon: GitBranch },\n { id: 'inventory', label: 'Inventory', path: 'inventory', icon: Boxes },\n { id: 'instruments', label: 'Instruments', path: 'instruments', icon: Cpu },\n];\n\nfunction useIsTabActive(getPath: (relativePath: string) => string, path: string): boolean {\n const location = useLocation();\n const target = getPath(path);\n return path === ''\n ? location.pathname === target\n : location.pathname === target || location.pathname.startsWith(`${target}/`);\n}\n\nconst TabButton: FC<{\n tab: TabDef;\n active: boolean;\n onClick: () => void;\n}> = ({ tab, active, onClick }) => {\n const Icon = tab.icon;\n return (\n <li className=\"flex-1\">\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={onClick}\n className={cn(\n 'flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors',\n active ? 'text-accent' : 'text-text-tertiary hover:text-text-secondary'\n )}\n >\n <Icon className={cn('h-5 w-5', active && 'text-accent')} />\n {tab.label}\n </button>\n </li>\n );\n};\n\nexport const BottomNav: FC = () => {\n const { getPath, navigateTo } = useLabsOfScience();\n const location = useLocation();\n const [moreOpen, setMoreOpen] = useState(false);\n\n const moreActive = MORE_TABS.some((tab) => {\n const target = getPath(tab.path);\n return location.pathname === target || location.pathname.startsWith(`${target}/`);\n });\n\n return (\n <>\n <nav\n aria-label=\"LabsOfScience mobile navigation\"\n className={cn(\n 'fixed inset-x-0 bottom-0 z-40 lg:hidden',\n 'border-t border-border-seam bg-bg-surface/95 backdrop-blur-sm',\n 'pb-[max(env(safe-area-inset-bottom),0px)]'\n )}\n >\n <ul className=\"flex\">\n {PRIMARY_TABS.map((tab) => (\n <TabButtonWithActive key={tab.id} tab={tab} onClick={() => navigateTo(tab.path)} />\n ))}\n <li className=\"flex-1\">\n <button\n type=\"button\"\n aria-current={moreActive ? 'page' : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={moreOpen}\n onClick={() => setMoreOpen(true)}\n className={cn(\n 'flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors',\n moreActive ? 'text-accent' : 'text-text-tertiary hover:text-text-secondary'\n )}\n >\n <MoreHorizontal className={cn('h-5 w-5', moreActive && 'text-accent')} />\n More\n </button>\n </li>\n </ul>\n </nav>\n\n <BottomSheet open={moreOpen} onOpenChange={setMoreOpen}>\n <BottomSheetContent className=\"lg:hidden\">\n <BottomSheetHeader>\n <BottomSheetTitle>More</BottomSheetTitle>\n <BottomSheetDescription>\n Protocols, datasets, pipelines, inventory and instruments.\n </BottomSheetDescription>\n </BottomSheetHeader>\n <ul className=\"grid grid-cols-3 gap-3 pb-6\">\n {MORE_TABS.map((tab) => {\n const Icon = tab.icon;\n const target = getPath(tab.path);\n const active =\n location.pathname === target || location.pathname.startsWith(`${target}/`);\n return (\n <li key={tab.id}>\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={() => {\n setMoreOpen(false);\n navigateTo(tab.path);\n }}\n className={cn(\n 'flex w-full flex-col items-center gap-2 rounded-card border border-border-subtle bg-bg-surface p-3 text-xs font-medium transition-colors',\n active\n ? 'border-border-strong text-accent'\n : 'text-text-secondary hover:border-border-strong hover:text-text-primary'\n )}\n >\n <Icon className={cn('h-5 w-5', active && 'text-accent')} />\n {tab.label}\n </button>\n </li>\n );\n })}\n </ul>\n </BottomSheetContent>\n </BottomSheet>\n </>\n );\n};\n\n/** Split out so `useIsTabActive` (which calls `useLocation`) stays a proper hook call per list item. */\nconst TabButtonWithActive: FC<{ tab: TabDef; onClick: () => void }> = ({ tab, onClick }) => {\n const { getPath } = useLabsOfScience();\n const active = useIsTabActive(getPath, tab.path);\n return <TabButton tab={tab} active={active} onClick={onClick} />;\n};\n"],"mappings":";;;;;;;;AAoDA,IAAM,IAAyB;CAC7B;EAAE,IAAI;EAAY,OAAO;EAAY,MAAM;EAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"BottomNav.js","names":[],"sources":["../../../src/labsofscience/components/BottomNav.tsx"],"sourcesContent":["/**\n * BottomNav — LabsOfScience's mobile tab bar (BOFF-3982 / BOFF-4199 / BOFF-4642).\n * @module labsofscience/components\n *\n * The Capacitor iOS/Android shell renders this MFE inside a WebView with no\n * layout adaptation of its own: without this component the app shipped the\n * same desktop sidebar-oriented navigation on a phone screen. Mirrors the\n * host shell's own nine registered nav items (see `LabsOfScienceRoot`) but\n * surfaces only the four highest-traffic research destinations directly —\n * Overview / Projects / Experiments / Notebook — plus a \"More\" tab that opens\n * a bottom sheet for the remaining five (Protocols, Datasets, Pipelines,\n * Inventory, Instruments), matching the mobile mocks\n * (`labsofscience-specs/product/mockups/labsci-29-mobile-nav.png`,\n * `labsci-30-mobile-more-sheet.png`).\n *\n * Fixed at the bottom of the viewport, hidden at and above the `lg`\n * breakpoint — the same responsive split the shared `ResponsiveTable` /\n * `ResponsiveDialog` primitives already use throughout this MFE.\n */\n\nimport { type FC, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport {\n LayoutDashboard,\n FolderKanban,\n FlaskConical,\n BookOpen,\n Microscope,\n Database,\n GitBranch,\n Boxes,\n Cpu,\n MoreHorizontal,\n} from 'lucide-react';\nimport {\n BottomSheet,\n BottomSheetContent,\n BottomSheetHeader,\n BottomSheetTitle,\n BottomSheetDescription,\n} from '@burdenoff/fe-libs/ui';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\nimport { cn } from '../utils/cn';\n\ninterface TabDef {\n id: string;\n label: string;\n /** Path relative to basePath, '' for the overview. */\n path: string;\n icon: FC<{ className?: string }>;\n}\n\nconst PRIMARY_TABS: TabDef[] = [\n { id: 'overview', label: 'Overview', path: '', icon: LayoutDashboard },\n { id: 'projects', label: 'Projects', path: 'projects', icon: FolderKanban },\n { id: 'experiments', label: 'Experiments', path: 'experiments', icon: FlaskConical },\n { id: 'notebook', label: 'Notebook', path: 'notebook', icon: BookOpen },\n];\n\nconst MORE_TABS: TabDef[] = [\n { id: 'protocols', label: 'Protocols', path: 'protocols', icon: Microscope },\n { id: 'datasets', label: 'Datasets', path: 'datasets', icon: Database },\n { id: 'pipelines', label: 'Pipelines', path: 'pipelines', icon: GitBranch },\n { id: 'inventory', label: 'Inventory', path: 'inventory', icon: Boxes },\n { id: 'instruments', label: 'Instruments', path: 'instruments', icon: Cpu },\n];\n\nfunction useIsTabActive(getPath: (relativePath: string) => string, path: string): boolean {\n const location = useLocation();\n const target = getPath(path);\n return path === ''\n ? location.pathname === target\n : location.pathname === target || location.pathname.startsWith(`${target}/`);\n}\n\nconst TabButton: FC<{\n tab: TabDef;\n active: boolean;\n onClick: () => void;\n}> = ({ tab, active, onClick }) => {\n const Icon = tab.icon;\n return (\n <li className=\"flex-1\">\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={onClick}\n className={cn(\n 'flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors',\n active ? 'text-accent' : 'text-text-tertiary hover:text-text-secondary'\n )}\n >\n <Icon className={cn('h-5 w-5', active && 'text-accent')} />\n {tab.label}\n </button>\n </li>\n );\n};\n\nexport const BottomNav: FC = () => {\n const { getPath, navigateTo } = useLabsOfScience();\n const location = useLocation();\n const [moreOpen, setMoreOpen] = useState(false);\n\n const moreActive = MORE_TABS.some((tab) => {\n const target = getPath(tab.path);\n return location.pathname === target || location.pathname.startsWith(`${target}/`);\n });\n\n return (\n <>\n <nav\n aria-label=\"LabsOfScience mobile navigation\"\n className={cn(\n 'fixed inset-x-0 bottom-0 z-40 lg:hidden',\n 'border-t border-border-seam bg-bg-surface/95 backdrop-blur-sm',\n 'pb-[max(env(safe-area-inset-bottom),0px)]'\n )}\n >\n <ul className=\"flex\">\n {PRIMARY_TABS.map((tab) => (\n <TabButtonWithActive key={tab.id} tab={tab} onClick={() => navigateTo(tab.path)} />\n ))}\n <li className=\"flex-1\">\n <button\n type=\"button\"\n aria-current={moreActive ? 'page' : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={moreOpen}\n onClick={() => setMoreOpen(true)}\n className={cn(\n 'flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors',\n moreActive ? 'text-accent' : 'text-text-tertiary hover:text-text-secondary'\n )}\n >\n <MoreHorizontal className={cn('h-5 w-5', moreActive && 'text-accent')} />\n More\n </button>\n </li>\n </ul>\n </nav>\n\n <BottomSheet open={moreOpen} onOpenChange={setMoreOpen}>\n <BottomSheetContent className=\"lg:hidden\">\n <BottomSheetHeader>\n <BottomSheetTitle>More</BottomSheetTitle>\n <BottomSheetDescription>\n Protocols, datasets, pipelines, inventory and instruments.\n </BottomSheetDescription>\n </BottomSheetHeader>\n <ul className=\"grid grid-cols-3 gap-3 pb-6\">\n {MORE_TABS.map((tab) => {\n const Icon = tab.icon;\n const target = getPath(tab.path);\n const active =\n location.pathname === target || location.pathname.startsWith(`${target}/`);\n return (\n <li key={tab.id}>\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={() => {\n setMoreOpen(false);\n navigateTo(tab.path);\n }}\n className={cn(\n 'flex w-full flex-col items-center gap-2 rounded-card border border-border-subtle bg-bg-surface p-3 text-xs font-medium transition-colors',\n active\n ? 'border-border-strong text-accent'\n : 'text-text-secondary hover:border-border-strong hover:text-text-primary'\n )}\n >\n <Icon className={cn('h-5 w-5', active && 'text-accent')} />\n {tab.label}\n </button>\n </li>\n );\n })}\n </ul>\n </BottomSheetContent>\n </BottomSheet>\n </>\n );\n};\n\n/** Split out so `useIsTabActive` (which calls `useLocation`) stays a proper hook call per list item. */\nconst TabButtonWithActive: FC<{ tab: TabDef; onClick: () => void }> = ({ tab, onClick }) => {\n const { getPath } = useLabsOfScience();\n const active = useIsTabActive(getPath, tab.path);\n return <TabButton tab={tab} active={active} onClick={onClick} />;\n};\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscussionPanel.js","names":[],"sources":["../../../src/labsofscience/components/DiscussionPanel.tsx"],"sourcesContent":["/**\n * DiscussionPanel — entity-scoped discussion for a lab record, reusing the\n * platform wspace-conversations-svc widget (no bespoke comment model / UI).\n * @module labsofscience/components\n *\n * The fe-libs `ContextConversationWidget` binds its thread to the page's\n * conversation context. We drive that binding from the MFE via the public\n * `useRegisterPageConversationContext` hook (setting `entityType` + `entityId`),\n * exactly like microfe-cosmicintersection. The widget itself only accepts a\n * `widgetKey`, so the entity is supplied through the register hook rather than\n * props.\n *\n * The widget REQUIRES the host shell's `PageConversationContextProvider` (plus\n * the auth / active-context / gateway providers) to be mounted around the MFE.\n * When the shell has not yet mounted it, those hooks throw during render; the\n * error boundary below catches that and degrades to the working `/conversations`\n * deep-link so a detail page never crashes.\n */\n\nimport { Component, useCallback, useMemo, type ReactNode } from 'react';\nimport { MessagesSquare } from 'lucide-react';\nimport { ContextConversationWidget } from '@burdenoff/fe-libs/shared';\nimport { useRegisterPageConversationContext } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\nimport { DetailSection } from '../pages/shared/DetailComponents';\n\ninterface DiscussionBoundaryProps {\n fallback: ReactNode;\n children: ReactNode;\n}\n\ninterface DiscussionBoundaryState {\n failed: boolean;\n}\n\n/**\n * Renders `fallback` if the embedded conversation widget throws (e.g. the host\n * shell has not mounted the conversation page-context provider yet). The failure\n * is deterministic per mount, so once tripped we stay on the fallback.\n */\nclass DiscussionBoundary extends Component<DiscussionBoundaryProps, DiscussionBoundaryState> {\n state: DiscussionBoundaryState = { failed: false };\n\n static getDerivedStateFromError(): DiscussionBoundaryState {\n return { failed: true };\n }\n\n componentDidCatch(): void {\n // Intentionally swallowed: absence of the shell conversation provider is an\n // expected degradation, surfaced to the user via the deep-link fallback.\n }\n\n render(): ReactNode {\n return this.state.failed ? this.props.fallback : this.props.children;\n }\n}\n\ninterface DiscussionThreadProps {\n entityType: string;\n entityId: string;\n contextTitle: string;\n widgetKey: string;\n}\n\nfunction DiscussionThread({\n entityType,\n entityId,\n contextTitle,\n widgetKey,\n}: DiscussionThreadProps) {\n // Stable object identity: `useRegisterPageConversationContext` keys its effect\n // on this reference, so a fresh inline object each render would loop the shared\n // provider. Memoize on the primitive inputs.\n const conversationContext = useMemo(\n () => ({ entityType, entityId, contextTitle }),\n [entityType, entityId, contextTitle]\n );\n useRegisterPageConversationContext(conversationContext);\n return <ContextConversationWidget widgetKey={widgetKey} />;\n}\n\nexport interface DiscussionPanelProps {\n /** Stable entity-type discriminator, e.g. `lab-experiment`. */\n entityType: string;\n entityId: string;\n /** Section heading; also used as the conversation context label. */\n title?: string;\n}\n\nexport function DiscussionPanel({\n entityType,\n entityId,\n title = 'Discussion',\n}: DiscussionPanelProps) {\n const { navigate, navigateTo } = useLabsOfScience();\n\n // One widget/thread per entity; `entityType` keeps threads distinct when the\n // same id space collides across domains.\n const widgetKey = `${entityType}:${entityId}`;\n\n const openConversations = useCallback(() => {\n // Prefer the shell's absolute navigate when integrated; fall back to the\n // MFE-relative helper in standalone mode.\n if (navigate) {\n navigate('/conversations');\n } else {\n navigateTo('conversations');\n }\n }, [navigate, navigateTo]);\n\n const fallback = (\n <div className=\"flex flex-wrap items-center gap-2 rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary\">\n <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />\n <span>Discuss this with your team.</span>\n <Button variant=\"link\" size=\"sm\" className=\"h-auto px-0\" onClick={openConversations}>\n Open conversations\n </Button>\n </div>\n );\n\n return (\n <DetailSection title=\"Discussion\">\n <DiscussionBoundary fallback={fallback}>\n <DiscussionThread\n entityType={entityType}\n entityId={entityId}\n contextTitle={title}\n widgetKey={widgetKey}\n />\n </DiscussionBoundary>\n </DetailSection>\n );\n}\n\nexport default DiscussionPanel;\n"],"mappings":";;;;;;;;;AAyCA,IAAM,IAAN,cAAiC,EAA4D;CAC3F,QAAiC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"DiscussionPanel.js","names":[],"sources":["../../../src/labsofscience/components/DiscussionPanel.tsx"],"sourcesContent":["/**\n * DiscussionPanel — entity-scoped discussion for a lab record, reusing the\n * platform wspace-conversations-svc widget (no bespoke comment model / UI).\n * @module labsofscience/components\n *\n * The fe-libs `ContextConversationWidget` binds its thread to the page's\n * conversation context. We drive that binding from the MFE via the public\n * `useRegisterPageConversationContext` hook (setting `entityType` + `entityId`),\n * exactly like microfe-cosmicintersection. The widget itself only accepts a\n * `widgetKey`, so the entity is supplied through the register hook rather than\n * props.\n *\n * The widget REQUIRES the host shell's `PageConversationContextProvider` (plus\n * the auth / active-context / gateway providers) to be mounted around the MFE.\n * When the shell has not yet mounted it, those hooks throw during render; the\n * error boundary below catches that and degrades to the working `/conversations`\n * deep-link so a detail page never crashes.\n */\n\nimport { Component, useCallback, useMemo, type ReactNode } from 'react';\nimport { MessagesSquare } from 'lucide-react';\nimport { ContextConversationWidget } from '@burdenoff/fe-libs/shared';\nimport { useRegisterPageConversationContext } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\nimport { DetailSection } from '../pages/shared/DetailComponents';\n\ninterface DiscussionBoundaryProps {\n fallback: ReactNode;\n children: ReactNode;\n}\n\ninterface DiscussionBoundaryState {\n failed: boolean;\n}\n\n/**\n * Renders `fallback` if the embedded conversation widget throws (e.g. the host\n * shell has not mounted the conversation page-context provider yet). The failure\n * is deterministic per mount, so once tripped we stay on the fallback.\n */\nclass DiscussionBoundary extends Component<DiscussionBoundaryProps, DiscussionBoundaryState> {\n state: DiscussionBoundaryState = { failed: false };\n\n static getDerivedStateFromError(): DiscussionBoundaryState {\n return { failed: true };\n }\n\n componentDidCatch(): void {\n // Intentionally swallowed: absence of the shell conversation provider is an\n // expected degradation, surfaced to the user via the deep-link fallback.\n }\n\n render(): ReactNode {\n return this.state.failed ? this.props.fallback : this.props.children;\n }\n}\n\ninterface DiscussionThreadProps {\n entityType: string;\n entityId: string;\n contextTitle: string;\n widgetKey: string;\n}\n\nfunction DiscussionThread({\n entityType,\n entityId,\n contextTitle,\n widgetKey,\n}: DiscussionThreadProps) {\n // Stable object identity: `useRegisterPageConversationContext` keys its effect\n // on this reference, so a fresh inline object each render would loop the shared\n // provider. Memoize on the primitive inputs.\n const conversationContext = useMemo(\n () => ({ entityType, entityId, contextTitle }),\n [entityType, entityId, contextTitle]\n );\n useRegisterPageConversationContext(conversationContext);\n return <ContextConversationWidget widgetKey={widgetKey} />;\n}\n\nexport interface DiscussionPanelProps {\n /** Stable entity-type discriminator, e.g. `lab-experiment`. */\n entityType: string;\n entityId: string;\n /** Section heading; also used as the conversation context label. */\n title?: string;\n}\n\nexport function DiscussionPanel({\n entityType,\n entityId,\n title = 'Discussion',\n}: DiscussionPanelProps) {\n const { navigate, navigateTo } = useLabsOfScience();\n\n // One widget/thread per entity; `entityType` keeps threads distinct when the\n // same id space collides across domains.\n const widgetKey = `${entityType}:${entityId}`;\n\n const openConversations = useCallback(() => {\n // Prefer the shell's absolute navigate when integrated; fall back to the\n // MFE-relative helper in standalone mode.\n if (navigate) {\n navigate('/conversations');\n } else {\n navigateTo('conversations');\n }\n }, [navigate, navigateTo]);\n\n const fallback = (\n <div className=\"flex flex-wrap items-center gap-2 rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary\">\n <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />\n <span>Discuss this with your team.</span>\n <Button variant=\"link\" size=\"sm\" className=\"h-auto px-0\" onClick={openConversations}>\n Open conversations\n </Button>\n </div>\n );\n\n return (\n <DetailSection title=\"Discussion\">\n <DiscussionBoundary fallback={fallback}>\n <DiscussionThread\n entityType={entityType}\n entityId={entityId}\n contextTitle={title}\n widgetKey={widgetKey}\n />\n </DiscussionBoundary>\n </DetailSection>\n );\n}\n\nexport default DiscussionPanel;\n"],"mappings":";;;;;;;;;AAyCA,IAAM,IAAN,cAAiC,EAA4D;CAC3F,QAAiC,EAAE,QAAQ,GAAM;CAEjD,OAAO,2BAAoD;EACzD,OAAO,EAAE,QAAQ,GAAK;CACxB;CAEA,oBAA0B,CAG1B;CAEA,SAAoB;EAClB,OAAO,KAAK,MAAM,SAAS,KAAK,MAAM,WAAW,KAAK,MAAM;CAC9D;AACF;AASA,SAAS,EAAiB,EACxB,eACA,aACA,iBACA,gBACwB;CASxB,OADA,EAJ4B,SACnB;EAAE;EAAY;EAAU;CAAa,IAC5C;EAAC;EAAY;EAAU;CAAY,CAEF,CAAmB,GAC/C,kBAAC,GAAD,EAAsC,aAAY,CAAA;AAC3D;AAUA,SAAgB,EAAgB,EAC9B,eACA,aACA,WAAQ,gBACe;CACvB,IAAM,EAAE,aAAU,kBAAe,EAAiB,GAI5C,IAAY,GAAG,EAAW,GAAG,KAE7B,IAAoB,QAAkB;EAG1C,AAAI,IACF,EAAS,gBAAgB,IAEzB,EAAW,eAAe;CAE9B,GAAG,CAAC,GAAU,CAAU,CAAC;CAYzB,OACE,kBAAC,GAAD;EAAe,OAAM;YACnB,kBAAC,GAAD;GAA8B,UAXhC,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD;MAAgB,WAAU;MAAS,eAAY;KAAQ,CAAA;KACvD,kBAAC,QAAD,EAAA,UAAM,+BAAkC,CAAA;KACxC,kBAAC,GAAD;MAAQ,SAAQ;MAAO,MAAK;MAAK,WAAU;MAAc,SAAS;gBAAmB;KAE7E,CAAA;IACL;IAK2B;aAC5B,kBAAC,GAAD;IACc;IACF;IACV,cAAc;IACH;GACZ,CAAA;EACiB,CAAA;CACP,CAAA;AAEnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/labsofscience/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module labsofscience/components\n *\n * Boff UI 2.0: when an `illustration` name is provided, renders the on-brand\n * IllustratedEmptyState from fe-libs. Falls back to the legacy icon layout to\n * preserve every existing call site.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /** Illustration name → host serves /illustrations/<name>.webp */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n}) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={cn('py-12', className)}\n />\n );\n }\n\n return (\n <div\n className={cn('flex flex-col items-center justify-center px-4 py-12 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 max-w-sm text-sm text-text-secondary\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AAuBA,IAAa,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEI,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACR,WAAW,EAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/labsofscience/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module labsofscience/components\n *\n * Boff UI 2.0: when an `illustration` name is provided, renders the on-brand\n * IllustratedEmptyState from fe-libs. Falls back to the legacy icon layout to\n * preserve every existing call site.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /** Illustration name → host serves /illustrations/<name>.webp */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n}) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={cn('py-12', className)}\n />\n );\n }\n\n return (\n <div\n className={cn('flex flex-col items-center justify-center px-4 py-12 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 max-w-sm text-sm text-text-secondary\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AAuBA,IAAa,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEI,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACR,WAAW,EAAG,SAAS,CAAS;AACjC,CAAA,IAKH,kBAAC,OAAD;CACE,WAAW,EAAG,oEAAoE,CAAS;WAD7F;EAGG,KAAQ,kBAAC,OAAD;GAAK,WAAU;aAAuC;EAAU,CAAA;EACzE,kBAAC,MAAD;GAAI,WAAU;aAAyC;EAAU,CAAA;EAChE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAA6C;EAAe,CAAA;EACxF,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAQ;EAAY,CAAA;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileAttachment.js","names":[],"sources":["../../../src/labsofscience/components/FileAttachment.tsx"],"sourcesContent":["/**\n * File attachment display\n * @module labsofscience/components\n *\n * Renders a single wspace-files-svc file (resolved by id) as a compact row with\n * its name, size, and a TTL-safe download link. Used on the detail pages to\n * surface attachments produced by the inline upload flow.\n */\n\nimport type { FC } from 'react';\nimport { Download, FileText, Loader2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { formatBytes } from '../utils/formatters';\nimport { useFileMeta, useFileDownloadUrl } from '../utils/uploadFile';\n\ninterface FileAttachmentProps {\n fileId: string;\n className?: string;\n}\n\nexport const FileAttachment: FC<FileAttachmentProps> = ({ fileId, className }) => {\n const meta = useFileMeta(fileId);\n const url = useFileDownloadUrl(fileId);\n\n const name = meta.data?.name ?? 'Attachment';\n const size = meta.data ? formatBytes(meta.data.size) : null;\n const href = url.data ?? undefined;\n\n return (\n <div\n className={cn(\n 'flex items-center gap-3 rounded-lg border border-border-seam bg-bg-sunken px-3 py-2',\n className\n )}\n >\n <FileText aria-hidden=\"true\" className=\"h-4 w-4 flex-shrink-0 text-text-tertiary\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm text-text-primary\">\n {meta.isLoading ? 'Loading attachment…' : name}\n </p>\n {size && size !== '—' && <p className=\"text-xs text-text-tertiary\">{size}</p>}\n </div>\n {url.isLoading ? (\n <Loader2 aria-hidden=\"true\" className=\"h-4 w-4 animate-spin text-text-tertiary\" />\n ) : href ? (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-text-link hover:bg-bg-surface\"\n >\n <Download className=\"h-3.5 w-3.5\" />\n Download\n </a>\n ) : (\n <span className=\"text-xs text-text-tertiary\">Unavailable</span>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAoBA,IAAa,KAA2C,EAAE,WAAQ,mBAAgB;CAChF,IAAM,IAAO,EAAY,
|
|
1
|
+
{"version":3,"file":"FileAttachment.js","names":[],"sources":["../../../src/labsofscience/components/FileAttachment.tsx"],"sourcesContent":["/**\n * File attachment display\n * @module labsofscience/components\n *\n * Renders a single wspace-files-svc file (resolved by id) as a compact row with\n * its name, size, and a TTL-safe download link. Used on the detail pages to\n * surface attachments produced by the inline upload flow.\n */\n\nimport type { FC } from 'react';\nimport { Download, FileText, Loader2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { formatBytes } from '../utils/formatters';\nimport { useFileMeta, useFileDownloadUrl } from '../utils/uploadFile';\n\ninterface FileAttachmentProps {\n fileId: string;\n className?: string;\n}\n\nexport const FileAttachment: FC<FileAttachmentProps> = ({ fileId, className }) => {\n const meta = useFileMeta(fileId);\n const url = useFileDownloadUrl(fileId);\n\n const name = meta.data?.name ?? 'Attachment';\n const size = meta.data ? formatBytes(meta.data.size) : null;\n const href = url.data ?? undefined;\n\n return (\n <div\n className={cn(\n 'flex items-center gap-3 rounded-lg border border-border-seam bg-bg-sunken px-3 py-2',\n className\n )}\n >\n <FileText aria-hidden=\"true\" className=\"h-4 w-4 flex-shrink-0 text-text-tertiary\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm text-text-primary\">\n {meta.isLoading ? 'Loading attachment…' : name}\n </p>\n {size && size !== '—' && <p className=\"text-xs text-text-tertiary\">{size}</p>}\n </div>\n {url.isLoading ? (\n <Loader2 aria-hidden=\"true\" className=\"h-4 w-4 animate-spin text-text-tertiary\" />\n ) : href ? (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-text-link hover:bg-bg-surface\"\n >\n <Download className=\"h-3.5 w-3.5\" />\n Download\n </a>\n ) : (\n <span className=\"text-xs text-text-tertiary\">Unavailable</span>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAoBA,IAAa,KAA2C,EAAE,WAAQ,mBAAgB;CAChF,IAAM,IAAO,EAAY,CAAM,GACzB,IAAM,EAAmB,CAAM,GAE/B,IAAO,EAAK,MAAM,QAAQ,cAC1B,IAAO,EAAK,OAAO,EAAY,EAAK,KAAK,IAAI,IAAI,MACjD,IAAO,EAAI,QAAQ,KAAA;CAEzB,OACE,kBAAC,OAAD;EACE,WAAW,EACT,uFACA,CACF;YAJF;GAME,kBAAC,GAAD;IAAU,eAAY;IAAO,WAAU;GAA4C,CAAA;GACnF,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KAAG,WAAU;eACV,EAAK,YAAY,wBAAwB;IACzC,CAAA,GACF,KAAQ,MAAS,OAAO,kBAAC,KAAD;KAAG,WAAU;eAA8B;IAAQ,CAAA,CACzE;;GACJ,EAAI,YACH,kBAAC,GAAD;IAAS,eAAY;IAAO,WAAU;GAA2C,CAAA,IAC/E,IACF,kBAAC,KAAD;IACQ;IACN,QAAO;IACP,KAAI;IACJ,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAU,WAAU,cAAe,CAAA,GAAC,UAEnC;QAEH,kBAAC,QAAD;IAAM,WAAU;cAA6B;GAAiB,CAAA;EAE7D;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadField.js","names":[],"sources":["../../../src/labsofscience/components/FileUploadField.tsx"],"sourcesContent":["/**\n * File upload form control\n * @module labsofscience/components\n *\n * A labelled control that runs the inline wspace-files 3-step upload and hands\n * the resulting `{ fileId, fileName }` back to the form. Supports single-file\n * (dataset version, inventory SDS) and multi-file (notebook attachments) modes.\n */\n\nimport { useId, useRef, useState, type FC } from 'react';\nimport { Paperclip, X, Loader2 } from 'lucide-react';\nimport { Label } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { useFileUpload, type UploadedFile } from '../utils/uploadFile';\n\ninterface FileUploadFieldProps {\n label: string;\n value: UploadedFile[];\n onChange: (files: UploadedFile[]) => void;\n /** Allow attaching more than one file (notebook entries). Defaults to single. */\n multiple?: boolean;\n accept?: string;\n disabled?: boolean;\n /** Optional helper text rendered under the control. */\n hint?: string;\n}\n\nexport const FileUploadField: FC<FileUploadFieldProps> = ({\n label,\n value,\n onChange,\n multiple = false,\n accept,\n disabled = false,\n hint,\n}) => {\n const inputId = useId();\n const inputRef = useRef<HTMLInputElement>(null);\n const { upload, isUploading, progress } = useFileUpload();\n const [error, setError] = useState<string | null>(null);\n\n const handleFiles = async (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return;\n setError(null);\n const picked = multiple ? Array.from(fileList) : [fileList[0]];\n try {\n const uploaded: UploadedFile[] = [];\n for (const file of picked) {\n if (!file) continue;\n uploaded.push(await upload(file));\n }\n onChange(multiple ? [...value, ...uploaded] : uploaded);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'The file could not be uploaded.');\n } finally {\n if (inputRef.current) inputRef.current.value = '';\n }\n };\n\n const removeAt = (fileId: string) => {\n onChange(value.filter((file) => file.fileId !== fileId));\n };\n\n return (\n <div className=\"space-y-1.5\">\n <Label htmlFor={inputId}>{label}</Label>\n\n {value.length > 0 && (\n <ul className=\"space-y-1.5\">\n {value.map((file) => (\n <li\n key={file.fileId}\n className=\"flex items-center gap-2 rounded-lg border border-border-seam bg-bg-sunken px-3 py-1.5\"\n >\n <Paperclip\n aria-hidden=\"true\"\n className=\"h-3.5 w-3.5 flex-shrink-0 text-text-tertiary\"\n />\n <span className=\"min-w-0 flex-1 truncate text-sm text-text-primary\">\n {file.fileName}\n </span>\n <button\n type=\"button\"\n onClick={() => removeAt(file.fileId)}\n disabled={disabled || isUploading}\n aria-label={`Remove ${file.fileName}`}\n className=\"rounded p-0.5 text-text-tertiary hover:text-text-primary disabled:opacity-50\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n\n <div className=\"flex items-center gap-3\">\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled || isUploading}\n onChange={(event) => void handleFiles(event.target.files)}\n className={cn(\n 'block w-full text-sm text-text-secondary',\n 'file:mr-3 file:rounded-md file:border-0 file:bg-bg-sunken file:px-3 file:py-1.5',\n 'file:text-sm file:font-medium file:text-text-primary hover:file:bg-bg-surface',\n 'disabled:opacity-50'\n )}\n />\n {isUploading && (\n <span className=\"inline-flex flex-shrink-0 items-center gap-1.5 text-xs text-text-secondary\">\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n {progress}%\n </span>\n )}\n </div>\n\n {hint && !error && <p className=\"text-xs text-text-tertiary\">{hint}</p>}\n {error && <p className=\"text-xs text-status-error-text\">{error}</p>}\n </div>\n );\n};\n"],"mappings":";;;;;;;AA2BA,IAAa,KAA6C,EACxD,UACA,UACA,aACA,cAAW,IACX,WACA,cAAW,IACX,cACI;CACJ,IAAM,IAAU,
|
|
1
|
+
{"version":3,"file":"FileUploadField.js","names":[],"sources":["../../../src/labsofscience/components/FileUploadField.tsx"],"sourcesContent":["/**\n * File upload form control\n * @module labsofscience/components\n *\n * A labelled control that runs the inline wspace-files 3-step upload and hands\n * the resulting `{ fileId, fileName }` back to the form. Supports single-file\n * (dataset version, inventory SDS) and multi-file (notebook attachments) modes.\n */\n\nimport { useId, useRef, useState, type FC } from 'react';\nimport { Paperclip, X, Loader2 } from 'lucide-react';\nimport { Label } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { useFileUpload, type UploadedFile } from '../utils/uploadFile';\n\ninterface FileUploadFieldProps {\n label: string;\n value: UploadedFile[];\n onChange: (files: UploadedFile[]) => void;\n /** Allow attaching more than one file (notebook entries). Defaults to single. */\n multiple?: boolean;\n accept?: string;\n disabled?: boolean;\n /** Optional helper text rendered under the control. */\n hint?: string;\n}\n\nexport const FileUploadField: FC<FileUploadFieldProps> = ({\n label,\n value,\n onChange,\n multiple = false,\n accept,\n disabled = false,\n hint,\n}) => {\n const inputId = useId();\n const inputRef = useRef<HTMLInputElement>(null);\n const { upload, isUploading, progress } = useFileUpload();\n const [error, setError] = useState<string | null>(null);\n\n const handleFiles = async (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return;\n setError(null);\n const picked = multiple ? Array.from(fileList) : [fileList[0]];\n try {\n const uploaded: UploadedFile[] = [];\n for (const file of picked) {\n if (!file) continue;\n uploaded.push(await upload(file));\n }\n onChange(multiple ? [...value, ...uploaded] : uploaded);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'The file could not be uploaded.');\n } finally {\n if (inputRef.current) inputRef.current.value = '';\n }\n };\n\n const removeAt = (fileId: string) => {\n onChange(value.filter((file) => file.fileId !== fileId));\n };\n\n return (\n <div className=\"space-y-1.5\">\n <Label htmlFor={inputId}>{label}</Label>\n\n {value.length > 0 && (\n <ul className=\"space-y-1.5\">\n {value.map((file) => (\n <li\n key={file.fileId}\n className=\"flex items-center gap-2 rounded-lg border border-border-seam bg-bg-sunken px-3 py-1.5\"\n >\n <Paperclip\n aria-hidden=\"true\"\n className=\"h-3.5 w-3.5 flex-shrink-0 text-text-tertiary\"\n />\n <span className=\"min-w-0 flex-1 truncate text-sm text-text-primary\">\n {file.fileName}\n </span>\n <button\n type=\"button\"\n onClick={() => removeAt(file.fileId)}\n disabled={disabled || isUploading}\n aria-label={`Remove ${file.fileName}`}\n className=\"rounded p-0.5 text-text-tertiary hover:text-text-primary disabled:opacity-50\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n\n <div className=\"flex items-center gap-3\">\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled || isUploading}\n onChange={(event) => void handleFiles(event.target.files)}\n className={cn(\n 'block w-full text-sm text-text-secondary',\n 'file:mr-3 file:rounded-md file:border-0 file:bg-bg-sunken file:px-3 file:py-1.5',\n 'file:text-sm file:font-medium file:text-text-primary hover:file:bg-bg-surface',\n 'disabled:opacity-50'\n )}\n />\n {isUploading && (\n <span className=\"inline-flex flex-shrink-0 items-center gap-1.5 text-xs text-text-secondary\">\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n {progress}%\n </span>\n )}\n </div>\n\n {hint && !error && <p className=\"text-xs text-text-tertiary\">{hint}</p>}\n {error && <p className=\"text-xs text-status-error-text\">{error}</p>}\n </div>\n );\n};\n"],"mappings":";;;;;;;AA2BA,IAAa,KAA6C,EACxD,UACA,UACA,aACA,cAAW,IACX,WACA,cAAW,IACX,cACI;CACJ,IAAM,IAAU,EAAM,GAChB,IAAW,EAAyB,IAAI,GACxC,EAAE,WAAQ,gBAAa,gBAAa,EAAc,GAClD,CAAC,GAAO,KAAY,EAAwB,IAAI,GAEhD,IAAc,OAAO,MAA8B;EACvD,IAAI,CAAC,KAAY,EAAS,WAAW,GAAG;EACxC,EAAS,IAAI;EACb,IAAM,IAAS,IAAW,MAAM,KAAK,CAAQ,IAAI,CAAC,EAAS,EAAE;EAC7D,IAAI;GACF,IAAM,IAA2B,CAAC;GAClC,KAAK,IAAM,KAAQ,GACZ,KACL,EAAS,KAAK,MAAM,EAAO,CAAI,CAAC;GAElC,EAAS,IAAW,CAAC,GAAG,GAAO,GAAG,CAAQ,IAAI,CAAQ;EACxD,SAAS,GAAK;GACZ,EAAS,aAAe,QAAQ,EAAI,UAAU,iCAAiC;EACjF,UAAU;GACR,AAAI,EAAS,YAAS,EAAS,QAAQ,QAAQ;EACjD;CACF,GAEM,KAAY,MAAmB;EACnC,EAAS,EAAM,QAAQ,MAAS,EAAK,WAAW,CAAM,CAAC;CACzD;CAEA,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IAAO,SAAS;cAAU;GAAa,CAAA;GAEtC,EAAM,SAAS,KACd,kBAAC,MAAD;IAAI,WAAU;cACX,EAAM,KAAK,MACV,kBAAC,MAAD;KAEE,WAAU;eAFZ;MAIE,kBAAC,GAAD;OACE,eAAY;OACZ,WAAU;MACX,CAAA;MACD,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAK;MACF,CAAA;MACN,kBAAC,UAAD;OACE,MAAK;OACL,eAAe,EAAS,EAAK,MAAM;OACnC,UAAU,KAAY;OACtB,cAAY,UAAU,EAAK;OAC3B,WAAU;iBAEV,kBAAC,GAAD,EAAG,WAAU,cAAe,CAAA;MACtB,CAAA;KACN;OAnBG,EAAK,MAmBR,CACL;GACC,CAAA;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,SAAD;KACE,KAAK;KACL,IAAI;KACJ,MAAK;KACG;KACE;KACV,UAAU,KAAY;KACtB,WAAW,MAAU,KAAK,EAAY,EAAM,OAAO,KAAK;KACxD,WAAW,EACT,4CACA,mFACA,iFACA,qBACF;IACD,CAAA,GACA,KACC,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,kBAAC,GAAD,EAAS,WAAU,2BAA4B,CAAA;MAC9C;MAAS;KACN;MAEL;;GAEJ,KAAQ,CAAC,KAAS,kBAAC,KAAD;IAAG,WAAU;cAA8B;GAAQ,CAAA;GACrE,KAAS,kBAAC,KAAD;IAAG,WAAU;cAAkC;GAAS,CAAA;EAC/D;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListSearchInput.js","names":[],"sources":["../../../src/labsofscience/components/ListSearchInput.tsx"],"sourcesContent":["/**\n * List search input\n * @module labsofscience/components\n *\n * A labelled, icon-prefixed free-text search box for the list-page filter rows.\n * Debouncing is the caller's responsibility (see `useDebouncedValue`).\n */\n\nimport type { FC } from 'react';\nimport { Search } from 'lucide-react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface ListSearchInputProps {\n value: string;\n onChange: (value: string) => void;\n /** Accessible name for the input (there is no visible label in filter rows). */\n ariaLabel: string;\n placeholder?: string;\n className?: string;\n}\n\nexport const ListSearchInput: FC<ListSearchInputProps> = ({\n value,\n onChange,\n ariaLabel,\n placeholder = 'Search…',\n className,\n}) => (\n <div className={cn('relative w-full min-w-0 flex-1 sm:max-w-xs', className)}>\n <Search\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary\"\n />\n <Input\n type=\"search\"\n aria-label={ariaLabel}\n placeholder={placeholder}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"h-11 pl-9 md:h-10\"\n />\n </div>\n);\n"],"mappings":";;;;;AAsBA,IAAa,KAA6C,EACxD,UACA,aACA,cACA,iBAAc,WACd,mBAEA,kBAAC,OAAD;CAAK,WAAW,EAAG,8CAA8C,
|
|
1
|
+
{"version":3,"file":"ListSearchInput.js","names":[],"sources":["../../../src/labsofscience/components/ListSearchInput.tsx"],"sourcesContent":["/**\n * List search input\n * @module labsofscience/components\n *\n * A labelled, icon-prefixed free-text search box for the list-page filter rows.\n * Debouncing is the caller's responsibility (see `useDebouncedValue`).\n */\n\nimport type { FC } from 'react';\nimport { Search } from 'lucide-react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface ListSearchInputProps {\n value: string;\n onChange: (value: string) => void;\n /** Accessible name for the input (there is no visible label in filter rows). */\n ariaLabel: string;\n placeholder?: string;\n className?: string;\n}\n\nexport const ListSearchInput: FC<ListSearchInputProps> = ({\n value,\n onChange,\n ariaLabel,\n placeholder = 'Search…',\n className,\n}) => (\n <div className={cn('relative w-full min-w-0 flex-1 sm:max-w-xs', className)}>\n <Search\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary\"\n />\n <Input\n type=\"search\"\n aria-label={ariaLabel}\n placeholder={placeholder}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"h-11 pl-9 md:h-10\"\n />\n </div>\n);\n"],"mappings":";;;;;AAsBA,IAAa,KAA6C,EACxD,UACA,aACA,cACA,iBAAc,WACd,mBAEA,kBAAC,OAAD;CAAK,WAAW,EAAG,8CAA8C,CAAS;WAA1E,CACE,kBAAC,GAAD;EACE,eAAY;EACZ,WAAU;CACX,CAAA,GACD,kBAAC,GAAD;EACE,MAAK;EACL,cAAY;EACC;EACN;EACP,WAAW,MAAU,EAAS,EAAM,OAAO,KAAK;EAChD,WAAU;CACX,CAAA,CACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/labsofscience/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module labsofscience/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n /** Promote the single hero KPI on a page to the glass treatment with glow. */\n featured?: boolean;\n className?: string;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-status-success-text' },\n down: { icon: TrendingDown, color: 'text-status-error-text' },\n neutral: { icon: Minus, color: 'text-text-secondary' },\n};\n\nexport const MetricsCard: FC<MetricsCardProps> = ({\n icon,\n value,\n label,\n trend,\n trendValue,\n featured = false,\n className,\n}) => {\n const trendInfo = trend ? trendConfig[trend] : null;\n const TrendIcon = trendInfo?.icon;\n\n return (\n <GlassCard\n treatment={featured ? 'glass' : 'metric'}\n glow={featured}\n className={cn('border-border-seam p-6', className)}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary [&>svg]:h-4 [&>svg]:w-4\">\n {icon}\n </div>\n {trend && trendInfo && TrendIcon && (\n <div className={cn('flex items-center gap-1 text-xs font-medium', trendInfo.color)}>\n <TrendIcon className=\"h-3.5 w-3.5\" />\n {trendValue && <span className=\"tabular-nums\">{trendValue}</span>}\n </div>\n )}\n </div>\n <div className=\"mt-3\">\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">{value}</p>\n <p className=\"mt-1 text-sm text-text-secondary\">{label}</p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAM,IAAkF;CACtF,IAAI;EAAE,MAAM;EAAY,OAAO;
|
|
1
|
+
{"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/labsofscience/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module labsofscience/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n /** Promote the single hero KPI on a page to the glass treatment with glow. */\n featured?: boolean;\n className?: string;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-status-success-text' },\n down: { icon: TrendingDown, color: 'text-status-error-text' },\n neutral: { icon: Minus, color: 'text-text-secondary' },\n};\n\nexport const MetricsCard: FC<MetricsCardProps> = ({\n icon,\n value,\n label,\n trend,\n trendValue,\n featured = false,\n className,\n}) => {\n const trendInfo = trend ? trendConfig[trend] : null;\n const TrendIcon = trendInfo?.icon;\n\n return (\n <GlassCard\n treatment={featured ? 'glass' : 'metric'}\n glow={featured}\n className={cn('border-border-seam p-6', className)}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary [&>svg]:h-4 [&>svg]:w-4\">\n {icon}\n </div>\n {trend && trendInfo && TrendIcon && (\n <div className={cn('flex items-center gap-1 text-xs font-medium', trendInfo.color)}>\n <TrendIcon className=\"h-3.5 w-3.5\" />\n {trendValue && <span className=\"tabular-nums\">{trendValue}</span>}\n </div>\n )}\n </div>\n <div className=\"mt-3\">\n <p className=\"text-2xl font-bold tabular-nums text-text-primary\">{value}</p>\n <p className=\"mt-1 text-sm text-text-secondary\">{label}</p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAM,IAAkF;CACtF,IAAI;EAAE,MAAM;EAAY,OAAO;CAA2B;CAC1D,MAAM;EAAE,MAAM;EAAc,OAAO;CAAyB;CAC5D,SAAS;EAAE,MAAM;EAAO,OAAO;CAAsB;AACvD,GAEa,KAAqC,EAChD,SACA,UACA,UACA,UACA,eACA,cAAW,IACX,mBACI;CACJ,IAAM,IAAY,IAAQ,EAAY,KAAS,MACzC,IAAY,GAAW;CAE7B,OACE,kBAAC,GAAD;EACE,WAAW,IAAW,UAAU;EAChC,MAAM;EACN,WAAW,EAAG,0BAA0B,CAAS;YAHnD,CAKE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cACZ;GACE,CAAA,GACJ,KAAS,KAAa,KACrB,kBAAC,OAAD;IAAK,WAAW,EAAG,+CAA+C,EAAU,KAAK;cAAjF,CACE,kBAAC,GAAD,EAAW,WAAU,cAAe,CAAA,GACnC,KAAc,kBAAC,QAAD;KAAM,WAAU;eAAgB;IAAiB,CAAA,CAC7D;KAEJ;MACL,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAqD;GAAS,CAAA,GAC3E,kBAAC,KAAD;IAAG,WAAU;cAAoC;GAAS,CAAA,CACvD;IACI;;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/labsofscience/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module labsofscience/components\n *\n * Boff UI 2.0: the page header is the MFE's single hero zone. When `hero` is\n * set, the header gains a seamless AuroraBackground backdrop (decorative, never\n * moves content) for a calm glassmorphic depth-of-field.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n /** Render the page header as the MFE hero with an aurora backdrop. */\n hero?: boolean;\n className?: string;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n hero = false,\n className,\n}) => {\n return (\n <div className={cn('flex h-full flex-col', className)}>\n {/* Page Header — single hero zone per MFE */}\n <div\n className={cn(\n 'relative flex flex-col items-start justify-between gap-4 border-b border-border-seam px-4 py-4 sm:flex-row sm:items-center md:px-6',\n hero ? 'overflow-hidden bg-hero-mesh' : 'bg-bg-surface'\n )}\n >\n {hero && <AuroraBackground intensity=\"subtle\" />}\n <div className=\"min-w-0\">\n <h1 className=\"truncate text-2xl font-semibold text-text-primary\">{title}</h1>\n {description && <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>}\n </div>\n {actions && (\n <div className=\"flex w-full flex-shrink-0 flex-wrap items-center gap-3 sm:w-auto sm:justify-end\">\n {actions}\n </div>\n )}\n </div>\n\n {/* Page Content */}\n <div className=\"flex-1 overflow-auto p-4 md:p-6\">{children}</div>\n </div>\n );\n};\n"],"mappings":";;;;AAuBA,IAAa,KAAmC,EAC9C,UACA,gBACA,YACA,aACA,UAAO,IACP,mBAGE,kBAAC,OAAD;CAAK,WAAW,EAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/labsofscience/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module labsofscience/components\n *\n * Boff UI 2.0: the page header is the MFE's single hero zone. When `hero` is\n * set, the header gains a seamless AuroraBackground backdrop (decorative, never\n * moves content) for a calm glassmorphic depth-of-field.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n /** Render the page header as the MFE hero with an aurora backdrop. */\n hero?: boolean;\n className?: string;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n hero = false,\n className,\n}) => {\n return (\n <div className={cn('flex h-full flex-col', className)}>\n {/* Page Header — single hero zone per MFE */}\n <div\n className={cn(\n 'relative flex flex-col items-start justify-between gap-4 border-b border-border-seam px-4 py-4 sm:flex-row sm:items-center md:px-6',\n hero ? 'overflow-hidden bg-hero-mesh' : 'bg-bg-surface'\n )}\n >\n {hero && <AuroraBackground intensity=\"subtle\" />}\n <div className=\"min-w-0\">\n <h1 className=\"truncate text-2xl font-semibold text-text-primary\">{title}</h1>\n {description && <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>}\n </div>\n {actions && (\n <div className=\"flex w-full flex-shrink-0 flex-wrap items-center gap-3 sm:w-auto sm:justify-end\">\n {actions}\n </div>\n )}\n </div>\n\n {/* Page Content */}\n <div className=\"flex-1 overflow-auto p-4 md:p-6\">{children}</div>\n </div>\n );\n};\n"],"mappings":";;;;AAuBA,IAAa,KAAmC,EAC9C,UACA,gBACA,YACA,aACA,UAAO,IACP,mBAGE,kBAAC,OAAD;CAAK,WAAW,EAAG,wBAAwB,CAAS;WAApD,CAEE,kBAAC,OAAD;EACE,WAAW,EACT,sIACA,IAAO,iCAAiC,eAC1C;YAJF;GAMG,KAAQ,kBAAC,GAAD,EAAkB,WAAU,SAAU,CAAA;GAC/C,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eAAqD;IAAU,CAAA,GAC5E,KAAe,kBAAC,KAAD;KAAG,WAAU;eAAoC;IAAe,CAAA,CAC7E;;GACJ,KACC,kBAAC,OAAD;IAAK,WAAU;cACZ;GACE,CAAA;EAEJ;KAGL,kBAAC,OAAD;EAAK,WAAU;EAAmC;CAAc,CAAA,CAC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProvenanceChain.js","names":[],"sources":["../../../src/labsofscience/components/ProvenanceChain.tsx"],"sourcesContent":["/**\n * ProvenanceChain — a reproducibility / lineage strip.\n *\n * Renders an ordered sequence of linked entity nodes (result → run →\n * dataset version → …) as connected cards with a chevron between them, so a\n * researcher can see at a glance exactly which pinned inputs and frozen methods\n * produced a result. Horizontal on desktop, stacks vertically on mobile.\n */\nimport type { ReactNode } from 'react';\nimport { ChevronRight } from 'lucide-react';\n\nexport interface ProvenanceNode {\n /** Short type label, e.g. \"Analysis run\", \"Dataset version\". */\n kind: string;\n /** Human-readable value / name for the node. */\n label: string;\n /** Optional lucide icon element. */\n icon?: ReactNode;\n /** Render the label in a monospace style (ids, checksums). */\n mono?: boolean;\n /** Optional accent tone for the node's icon chip. */\n tone?: 'blue' | 'teal' | 'cyan' | 'violet' | 'neutral';\n}\n\nconst TONE_CLASS: Record<NonNullable<ProvenanceNode['tone']>, string> = {\n blue: 'text-accent-blue-text bg-accent-blue-bg',\n teal: 'text-status-success-text bg-status-success-bg',\n cyan: 'text-accent-cyan-text bg-accent-cyan-bg',\n violet: 'text-accent-violet-text bg-accent-violet-bg',\n neutral: 'text-text-secondary bg-bg-sunken',\n};\n\nexport function ProvenanceChain({ nodes }: { nodes: ProvenanceNode[] }) {\n return (\n <div className=\"flex flex-col gap-2 md:flex-row md:items-stretch md:gap-1\">\n {nodes.map((node, index) => (\n <div\n key={`${node.kind}-${index}`}\n className=\"flex flex-col md:flex-1 md:flex-row md:items-center\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg border border-border-subtle bg-bg-surface p-2.5\">\n {node.icon ? (\n <span\n className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-md ${\n TONE_CLASS[node.tone ?? 'neutral']\n }`}\n >\n {node.icon}\n </span>\n ) : null}\n <div className=\"min-w-0\">\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-tertiary\">\n {node.kind}\n </p>\n <p\n className={`truncate text-xs text-text-primary ${node.mono ? 'font-mono' : 'font-medium'}`}\n title={node.label}\n >\n {node.label}\n </p>\n </div>\n </div>\n {index < nodes.length - 1 ? (\n <ChevronRight\n className=\"mx-auto my-0.5 h-4 w-4 shrink-0 rotate-90 text-text-tertiary md:mx-0.5 md:my-0 md:rotate-0\"\n aria-hidden\n />\n ) : null}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;AAwBA,IAAM,IAAkE;CACtE,MAAM;CACN,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;
|
|
1
|
+
{"version":3,"file":"ProvenanceChain.js","names":[],"sources":["../../../src/labsofscience/components/ProvenanceChain.tsx"],"sourcesContent":["/**\n * ProvenanceChain — a reproducibility / lineage strip.\n *\n * Renders an ordered sequence of linked entity nodes (result → run →\n * dataset version → …) as connected cards with a chevron between them, so a\n * researcher can see at a glance exactly which pinned inputs and frozen methods\n * produced a result. Horizontal on desktop, stacks vertically on mobile.\n */\nimport type { ReactNode } from 'react';\nimport { ChevronRight } from 'lucide-react';\n\nexport interface ProvenanceNode {\n /** Short type label, e.g. \"Analysis run\", \"Dataset version\". */\n kind: string;\n /** Human-readable value / name for the node. */\n label: string;\n /** Optional lucide icon element. */\n icon?: ReactNode;\n /** Render the label in a monospace style (ids, checksums). */\n mono?: boolean;\n /** Optional accent tone for the node's icon chip. */\n tone?: 'blue' | 'teal' | 'cyan' | 'violet' | 'neutral';\n}\n\nconst TONE_CLASS: Record<NonNullable<ProvenanceNode['tone']>, string> = {\n blue: 'text-accent-blue-text bg-accent-blue-bg',\n teal: 'text-status-success-text bg-status-success-bg',\n cyan: 'text-accent-cyan-text bg-accent-cyan-bg',\n violet: 'text-accent-violet-text bg-accent-violet-bg',\n neutral: 'text-text-secondary bg-bg-sunken',\n};\n\nexport function ProvenanceChain({ nodes }: { nodes: ProvenanceNode[] }) {\n return (\n <div className=\"flex flex-col gap-2 md:flex-row md:items-stretch md:gap-1\">\n {nodes.map((node, index) => (\n <div\n key={`${node.kind}-${index}`}\n className=\"flex flex-col md:flex-1 md:flex-row md:items-center\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg border border-border-subtle bg-bg-surface p-2.5\">\n {node.icon ? (\n <span\n className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-md ${\n TONE_CLASS[node.tone ?? 'neutral']\n }`}\n >\n {node.icon}\n </span>\n ) : null}\n <div className=\"min-w-0\">\n <p className=\"text-[10px] font-medium uppercase tracking-wide text-text-tertiary\">\n {node.kind}\n </p>\n <p\n className={`truncate text-xs text-text-primary ${node.mono ? 'font-mono' : 'font-medium'}`}\n title={node.label}\n >\n {node.label}\n </p>\n </div>\n </div>\n {index < nodes.length - 1 ? (\n <ChevronRight\n className=\"mx-auto my-0.5 h-4 w-4 shrink-0 rotate-90 text-text-tertiary md:mx-0.5 md:my-0 md:rotate-0\"\n aria-hidden\n />\n ) : null}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;AAwBA,IAAM,IAAkE;CACtE,MAAM;CACN,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;AACX;AAEA,SAAgB,EAAgB,EAAE,YAAsC;CACtE,OACE,kBAAC,OAAD;EAAK,WAAU;YACZ,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;GAEE,WAAU;aAFZ,CAIE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,EAAK,OACJ,kBAAC,QAAD;KACE,WAAW,gEACT,EAAW,EAAK,QAAQ;eAGzB,EAAK;IACF,CAAA,IACJ,MACJ,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAK;KACL,CAAA,GACH,kBAAC,KAAD;MACE,WAAW,sCAAsC,EAAK,OAAO,cAAc;MAC3E,OAAO,EAAK;gBAEX,EAAK;KACL,CAAA,CACA;MACF;OACJ,IAAQ,EAAM,SAAS,IACtB,kBAAC,GAAD;IACE,WAAU;IACV,eAAA;GACD,CAAA,IACC,IACD;KA/BE,GAAG,EAAK,KAAK,GAAG,GA+BlB,CACN;CACE,CAAA;AAET"}
|
|
@@ -35,6 +35,6 @@ var s = ({ className: t, label: n = "Loading…" }) => /* @__PURE__ */ i("div",
|
|
|
35
35
|
onRetry: a
|
|
36
36
|
}) : /* @__PURE__ */ r(n, { children: l });
|
|
37
37
|
//#endregion
|
|
38
|
-
export { s as LoadingState, l as QueryBoundary };
|
|
38
|
+
export { c as ErrorState, s as LoadingState, l as QueryBoundary };
|
|
39
39
|
|
|
40
40
|
//# sourceMappingURL=QueryStates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryStates.js","names":[],"sources":["../../../src/labsofscience/components/QueryStates.tsx"],"sourcesContent":["/**\n * Query state helpers\n * @module labsofscience/components\n *\n * Small, reusable loading / error scaffolding shared by every list and detail\n * page so the data-fetching states render consistently across the MFE.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { Button, Spinner } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\nexport const LoadingState: FC<{ className?: string; label?: string }> = ({\n className,\n label = 'Loading…',\n}) => (\n <div className={cn('flex min-h-[240px] flex-col items-center justify-center gap-3', className)}>\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\nexport const ErrorState: FC<{\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}> = ({ title = 'Something went wrong', message, onRetry, className }) => (\n <div\n className={cn(\n 'flex min-h-[240px] flex-col items-center justify-center gap-3 px-4 text-center',\n className\n )}\n >\n <div className=\"text-status-error-text\">\n <AlertCircle className=\"h-8 w-8\" />\n </div>\n <div>\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {message && <p className=\"mt-1 max-w-md text-sm text-text-secondary\">{message}</p>}\n </div>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n Try again\n </Button>\n )}\n </div>\n);\n\n/**\n * Render-prop convenience that picks the right state for a React Query result.\n * Returns the matching state element, or `null` once data is ready (the caller\n * then renders `children`).\n */\nexport const QueryBoundary: FC<{\n isLoading: boolean;\n isError: boolean;\n error?: unknown;\n onRetry?: () => void;\n loadingLabel?: string;\n children: ReactNode;\n}> = ({ isLoading, isError, error, onRetry, loadingLabel, children }) => {\n if (isLoading) {\n return <LoadingState label={loadingLabel} />;\n }\n if (isError) {\n const message = error instanceof Error ? error.message : undefined;\n return <ErrorState message={message} onRetry={onRetry} />;\n }\n return <>{children}</>;\n};\n"],"mappings":";;;;;AAaA,IAAa,KAA4D,EACvE,cACA,WAAQ,iBAER,kBAAC,OAAD;CAAK,WAAW,EAAG,iEAAiE,
|
|
1
|
+
{"version":3,"file":"QueryStates.js","names":[],"sources":["../../../src/labsofscience/components/QueryStates.tsx"],"sourcesContent":["/**\n * Query state helpers\n * @module labsofscience/components\n *\n * Small, reusable loading / error scaffolding shared by every list and detail\n * page so the data-fetching states render consistently across the MFE.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { Button, Spinner } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\nexport const LoadingState: FC<{ className?: string; label?: string }> = ({\n className,\n label = 'Loading…',\n}) => (\n <div className={cn('flex min-h-[240px] flex-col items-center justify-center gap-3', className)}>\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\nexport const ErrorState: FC<{\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}> = ({ title = 'Something went wrong', message, onRetry, className }) => (\n <div\n className={cn(\n 'flex min-h-[240px] flex-col items-center justify-center gap-3 px-4 text-center',\n className\n )}\n >\n <div className=\"text-status-error-text\">\n <AlertCircle className=\"h-8 w-8\" />\n </div>\n <div>\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {message && <p className=\"mt-1 max-w-md text-sm text-text-secondary\">{message}</p>}\n </div>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n Try again\n </Button>\n )}\n </div>\n);\n\n/**\n * Render-prop convenience that picks the right state for a React Query result.\n * Returns the matching state element, or `null` once data is ready (the caller\n * then renders `children`).\n */\nexport const QueryBoundary: FC<{\n isLoading: boolean;\n isError: boolean;\n error?: unknown;\n onRetry?: () => void;\n loadingLabel?: string;\n children: ReactNode;\n}> = ({ isLoading, isError, error, onRetry, loadingLabel, children }) => {\n if (isLoading) {\n return <LoadingState label={loadingLabel} />;\n }\n if (isError) {\n const message = error instanceof Error ? error.message : undefined;\n return <ErrorState message={message} onRetry={onRetry} />;\n }\n return <>{children}</>;\n};\n"],"mappings":";;;;;AAaA,IAAa,KAA4D,EACvE,cACA,WAAQ,iBAER,kBAAC,OAAD;CAAK,WAAW,EAAG,iEAAiE,CAAS;WAA7F,CACE,kBAAC,GAAD,EAAS,MAAK,KAAM,CAAA,GACpB,kBAAC,KAAD;EAAG,WAAU;YAA+B;CAAS,CAAA,CAClD;IAGM,KAKP,EAAE,WAAQ,wBAAwB,YAAS,YAAS,mBACxD,kBAAC,OAAD;CACE,WAAW,EACT,kFACA,CACF;WAJF;EAME,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAa,WAAU,UAAW,CAAA;EAC/B,CAAA;EACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAAyC;EAAU,CAAA,GAChE,KAAW,kBAAC,KAAD;GAAG,WAAU;aAA6C;EAAW,CAAA,CAC9E,EAAA,CAAA;EACJ,KACC,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAK,SAAS;aAAS;EAE9C,CAAA;CAEP;IAQM,KAOP,EAAE,cAAW,YAAS,UAAO,YAAS,iBAAc,kBACpD,IACK,kBAAC,GAAD,EAAc,OAAO,EAAe,CAAA,IAEzC,IAEK,kBAAC,GAAD;CAAqB,SADZ,aAAiB,QAAQ,EAAM,UAAU,KAAA;CACX;AAAU,CAAA,IAEnD,kBAAA,GAAA,EAAG,YAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module labsofscience/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotColor: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-status-info-text',\n outline: 'bg-text-secondary',\n};\n\n// Statuses representing a live / active in-flight state get a calm glow-pulse dot.\nconst liveStatuses = new Set(['active', 'running', 'in_progress', 'in_use', 'queued', 'requested']);\n\n// All LabsOfScience domain enums are UPPERCASE on the wire; we normalize to\n// lowercase before lookup, so every key here is lowercase.\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Project lifecycle\n planning: 'secondary',\n active: 'success',\n on_hold: 'warning',\n completed: 'success',\n archived: 'outline',\n\n // Project visibility\n private: 'secondary',\n workspace: 'info',\n public: 'success',\n\n // Experiment lifecycle\n design: 'secondary',\n running: 'info',\n analysis: 'warning',\n complete: 'success',\n abandoned: 'destructive',\n\n // Run / pipeline-run lifecycle\n planned: 'secondary',\n in_progress: 'info',\n succeeded: 'success',\n failed: 'destructive',\n cancelled: 'destructive',\n queued: 'secondary',\n\n // Notebook entry lifecycle\n draft: 'secondary',\n submitted: 'info',\n signed: 'success',\n witnessed: 'success',\n void: 'outline',\n\n // Protocol lifecycle\n published: 'success',\n deprecated: 'outline',\n\n // Dataset lifecycle\n locked: 'warning',\n\n // Inventory derived status\n in_stock: 'success',\n low: 'warning',\n out_of_stock: 'destructive',\n expired: 'destructive',\n quarantined: 'warning',\n\n // Instrument status\n available: 'success',\n in_use: 'info',\n maintenance: 'warning',\n offline: 'destructive',\n\n // Booking status\n requested: 'warning',\n confirmed: 'success',\n};\n\n/**\n * Domain enums arrive UPPERCASE on the wire (see the note on `statusVariantMap`),\n * and the design renders badges UPPERCASE — see the status pills in\n * `labsofscience-specs/product/mockups/labsci-05-experiments-list.png`\n * (\"RUNNING\", \"ANALYSIS\", \"COMPLETE\", \"ABANDONED\"). So the only transform this\n * needs is underscore → space: `IN_PROGRESS` → `IN PROGRESS`.\n *\n * This previously ended in `.replace(/\\b\\w/g, c => c.toUpperCase())`, which read as\n * Title Case but was dead code — the input is already uppercase, so it matched and\n * re-uppercased the same characters and could never change anything. It was removed\n * rather than \"fixed\": title-casing here would silently restyle every badge in the\n * product away from the design. `toUpperCase()` is explicit so a future lowercase\n * caller cannot quietly change the rendering.\n */\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').toUpperCase();\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const normalized = status.toLowerCase();\n const variant = statusVariantMap[normalized] || 'secondary';\n const isLive = liveStatuses.has(normalized);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full motion-safe:animate-vc-glow-pulse',\n dotColor[variant]\n )}\n />\n )}\n {formatStatusLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;AAkBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/labsofscience/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module labsofscience/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-status-info-bg-subtle text-status-info-text',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotColor: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-status-info-text',\n outline: 'bg-text-secondary',\n};\n\n// Statuses representing a live / active in-flight state get a calm glow-pulse dot.\nconst liveStatuses = new Set(['active', 'running', 'in_progress', 'in_use', 'queued', 'requested']);\n\n// All LabsOfScience domain enums are UPPERCASE on the wire; we normalize to\n// lowercase before lookup, so every key here is lowercase.\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Project lifecycle\n planning: 'secondary',\n active: 'success',\n on_hold: 'warning',\n completed: 'success',\n archived: 'outline',\n\n // Project visibility\n private: 'secondary',\n workspace: 'info',\n public: 'success',\n\n // Experiment lifecycle\n design: 'secondary',\n running: 'info',\n analysis: 'warning',\n complete: 'success',\n abandoned: 'destructive',\n\n // Run / pipeline-run lifecycle\n planned: 'secondary',\n in_progress: 'info',\n succeeded: 'success',\n failed: 'destructive',\n cancelled: 'destructive',\n queued: 'secondary',\n\n // Notebook entry lifecycle\n draft: 'secondary',\n submitted: 'info',\n signed: 'success',\n witnessed: 'success',\n void: 'outline',\n\n // Protocol lifecycle\n published: 'success',\n deprecated: 'outline',\n\n // Dataset lifecycle\n locked: 'warning',\n\n // Inventory derived status\n in_stock: 'success',\n low: 'warning',\n out_of_stock: 'destructive',\n expired: 'destructive',\n quarantined: 'warning',\n\n // Instrument status\n available: 'success',\n in_use: 'info',\n maintenance: 'warning',\n offline: 'destructive',\n\n // Booking status\n requested: 'warning',\n confirmed: 'success',\n};\n\n/**\n * Domain enums arrive UPPERCASE on the wire (see the note on `statusVariantMap`),\n * and the design renders badges UPPERCASE — see the status pills in\n * `labsofscience-specs/product/mockups/labsci-05-experiments-list.png`\n * (\"RUNNING\", \"ANALYSIS\", \"COMPLETE\", \"ABANDONED\"). So the only transform this\n * needs is underscore → space: `IN_PROGRESS` → `IN PROGRESS`.\n *\n * This previously ended in `.replace(/\\b\\w/g, c => c.toUpperCase())`, which read as\n * Title Case but was dead code — the input is already uppercase, so it matched and\n * re-uppercased the same characters and could never change anything. It was removed\n * rather than \"fixed\": title-casing here would silently restyle every badge in the\n * product away from the design. `toUpperCase()` is explicit so a future lowercase\n * caller cannot quietly change the rendering.\n */\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').toUpperCase();\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const normalized = status.toLowerCase();\n const variant = statusVariantMap[normalized] || 'secondary';\n const isLive = liveStatuses.has(normalized);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full motion-safe:animate-vc-glow-pulse',\n dotColor[variant]\n )}\n />\n )}\n {formatStatusLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;AAkBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAEM,IAAyC;CAC7C,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAGM,oBAAe,IAAI,IAAI;CAAC;CAAU;CAAW;CAAe;CAAU;CAAU;AAAW,CAAC,GAI5F,IAAiD;CAErD,UAAU;CACV,QAAQ;CACR,SAAS;CACT,WAAW;CACX,UAAU;CAGV,SAAS;CACT,WAAW;CACX,QAAQ;CAGR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU;CACV,WAAW;CAGX,SAAS;CACT,aAAa;CACb,WAAW;CACX,QAAQ;CACR,WAAW;CACX,QAAQ;CAGR,OAAO;CACP,WAAW;CACX,QAAQ;CACR,WAAW;CACX,MAAM;CAGN,WAAW;CACX,YAAY;CAGZ,QAAQ;CAGR,UAAU;CACV,KAAK;CACL,cAAc;CACd,SAAS;CACT,aAAa;CAGb,WAAW;CACX,QAAQ;CACR,aAAa;CACb,SAAS;CAGT,WAAW;CACX,WAAW;AACb;AAgBA,SAAS,EAAkB,GAAwB;CACjD,OAAO,EAAO,QAAQ,MAAM,GAAG,CAAC,CAAC,YAAY;AAC/C;AAEA,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAa,EAAO,YAAY,GAChC,IAAU,EAAiB,MAAe,aAC1C,IAAS,EAAa,IAAI,CAAU;CAE1C,OACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,CACF;YALF,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,8DACA,EAAS,EACX;EACD,CAAA,GAEF,EAAkB,CAAM,CACrB;;AAEV"}
|
|
@@ -11,7 +11,8 @@ function l() {
|
|
|
11
11
|
}
|
|
12
12
|
var u = ({ children: t, basePath: r, currentUser: a, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f }) => {
|
|
13
13
|
let p = o(), m = r || "/", h = n((t) => e(m, t), [m]), g = n((t) => {
|
|
14
|
-
|
|
14
|
+
let n = e(m, t);
|
|
15
|
+
p(n);
|
|
15
16
|
}, [m, p]), _ = i(() => ({
|
|
16
17
|
basePath: m,
|
|
17
18
|
navigate: void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabsOfScienceContext.js","names":[],"sources":["../../../src/labsofscience/context/LabsOfScienceContext.tsx"],"sourcesContent":["/**\n * LabsOfScience Context Provider\n * @module labsofscience/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { LabsOfScienceRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface LabsOfScienceContextValue extends Omit<\n LabsOfScienceRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst LabsOfScienceContext = createContext<LabsOfScienceContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useLabsOfScience(): LabsOfScienceContextValue {\n const context = useContext(LabsOfScienceContext);\n if (!context) {\n throw new Error('useLabsOfScience must be used within a LabsOfScienceProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<LabsOfScienceRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<LabsOfScienceContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <LabsOfScienceContext.Provider value={contextValue}>{children}</LabsOfScienceContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<LabsOfScienceContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <LabsOfScienceContext.Provider value={contextValue}>{children}</LabsOfScienceContext.Provider>\n );\n};\n\nexport const LabsOfScienceProvider: FC<PropsWithChildren<LabsOfScienceRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,
|
|
1
|
+
{"version":3,"file":"LabsOfScienceContext.js","names":[],"sources":["../../../src/labsofscience/context/LabsOfScienceContext.tsx"],"sourcesContent":["/**\n * LabsOfScience Context Provider\n * @module labsofscience/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { LabsOfScienceRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface LabsOfScienceContextValue extends Omit<\n LabsOfScienceRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst LabsOfScienceContext = createContext<LabsOfScienceContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useLabsOfScience(): LabsOfScienceContextValue {\n const context = useContext(LabsOfScienceContext);\n if (!context) {\n throw new Error('useLabsOfScience must be used within a LabsOfScienceProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<LabsOfScienceRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<LabsOfScienceContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <LabsOfScienceContext.Provider value={contextValue}>{children}</LabsOfScienceContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<LabsOfScienceContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <LabsOfScienceContext.Provider value={contextValue}>{children}</LabsOfScienceContext.Provider>\n );\n};\n\nexport const LabsOfScienceProvider: FC<PropsWithChildren<LabsOfScienceRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,IAAI;AAMjF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,CAAoB;CAC/C,IAAI,CAAC,GACH,MAAU,MAAM,8DAA8D;CAEhF,OAAO;AACT;AAWA,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,EAAkB,GACnC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,CAAY,GAClE,CAAC,CAAiB,CACpB,GAEM,IAAa,GAChB,MAAyB;EACxB,IAAM,IAAW,EAAS,GAAmB,CAAY;EACzD,EAAe,CAAQ;CACzB,GACA,CAAC,GAAmB,CAAc,CACpC,GAEM,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;CAAwC,CAAA;AAEjG,GAGM,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,CAAY,GAClE,CAAC,CAAiB,CACpB,GAEM,IAAa,GAChB,MAAyB;EAExB,EADiB,EAAS,GAAmB,CACpC,CAAQ;CACnB,GACA,CAAC,GAAmB,CAAQ,CAC9B,GAEM,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;CAAwC,CAAA;AAEjG,GAEa,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;CAiB/B,OAdsB,IAepB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;CACsB,CAAA,IAZvB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;CACsB,CAAA,EACb,CAAA;AAUpB"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import "./LabsOfScienceContext.js";
|
|
1
|
+
import { LabsOfScienceProvider as e, useLabsOfScience as t } from "./LabsOfScienceContext.js";
|
|
2
|
+
export { e as LabsOfScienceProvider, t as useLabsOfScience };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLabActorNames.js","names":[],"sources":["../../../src/labsofscience/hooks/useLabActorNames.ts"],"sourcesContent":["/**\n * Actor name resolution for LabsOfScience\n * @module labsofscience/hooks\n *\n * Wraps fe-libs' `useActorProfiles` so every list/detail page that surfaces a\n * principal investigator / lead researcher / custodian / performed-by /\n * booked-by actor id resolves it to a human-friendly display name instead of\n * a raw UUID (BOFF-3976). Mirrors the pattern already shipped on\n * `NotebookEntryDetailPage` — this hook exists so every other page reuses it\n * instead of re-deriving the same `nameOf` closure.\n */\n\nimport { useActorProfiles, type ActorProfileMap } from '@burdenoff/fe-libs/shared';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\n\nexport interface UseLabActorNamesResult {\n /** Resolved profiles keyed by actor id, exposed for callers that need more than displayName. */\n profiles: ActorProfileMap;\n /** Human-friendly display name for an actor id; '—' for null/undefined, the raw id while resolving. */\n nameOf: (actorId: string | null | undefined) => string;\n}\n\n/**\n * Resolves a set of user actor ids (PI, lead researcher, custodian, etc.) to\n * display names, scoped to the current workspace. Pass every id a page needs\n * resolved, including nulls — they are filtered before the batch lookup.\n * The underlying hook batches, caches (5 min TTL) and falls back to a\n * humanized id on any resolution failure, so this never throws or blocks\n * render.\n */\nexport function useLabActorNames(\n actorIds: Array<string | null | undefined>\n): UseLabActorNamesResult {\n const { workspaceId } = useLabsOfScience();\n const uniqueIds = [...new Set(actorIds.filter((value): value is string => Boolean(value)))];\n\n const profiles = useActorProfiles(\n uniqueIds.map((actorId) => ({ actorId, actorType: 'user' })),\n { workspaceId }\n );\n\n const nameOf = (actorId: string | null | undefined): string =>\n actorId ? (profiles[actorId]?.displayName ?? actorId) : '—';\n\n return { profiles, nameOf };\n}\n"],"mappings":";;;AA8BA,SAAgB,EACd,GACwB;CACxB,IAAM,EAAE,mBAAgB,
|
|
1
|
+
{"version":3,"file":"useLabActorNames.js","names":[],"sources":["../../../src/labsofscience/hooks/useLabActorNames.ts"],"sourcesContent":["/**\n * Actor name resolution for LabsOfScience\n * @module labsofscience/hooks\n *\n * Wraps fe-libs' `useActorProfiles` so every list/detail page that surfaces a\n * principal investigator / lead researcher / custodian / performed-by /\n * booked-by actor id resolves it to a human-friendly display name instead of\n * a raw UUID (BOFF-3976). Mirrors the pattern already shipped on\n * `NotebookEntryDetailPage` — this hook exists so every other page reuses it\n * instead of re-deriving the same `nameOf` closure.\n */\n\nimport { useActorProfiles, type ActorProfileMap } from '@burdenoff/fe-libs/shared';\nimport { useLabsOfScience } from '../context/LabsOfScienceContext';\n\nexport interface UseLabActorNamesResult {\n /** Resolved profiles keyed by actor id, exposed for callers that need more than displayName. */\n profiles: ActorProfileMap;\n /** Human-friendly display name for an actor id; '—' for null/undefined, the raw id while resolving. */\n nameOf: (actorId: string | null | undefined) => string;\n}\n\n/**\n * Resolves a set of user actor ids (PI, lead researcher, custodian, etc.) to\n * display names, scoped to the current workspace. Pass every id a page needs\n * resolved, including nulls — they are filtered before the batch lookup.\n * The underlying hook batches, caches (5 min TTL) and falls back to a\n * humanized id on any resolution failure, so this never throws or blocks\n * render.\n */\nexport function useLabActorNames(\n actorIds: Array<string | null | undefined>\n): UseLabActorNamesResult {\n const { workspaceId } = useLabsOfScience();\n const uniqueIds = [...new Set(actorIds.filter((value): value is string => Boolean(value)))];\n\n const profiles = useActorProfiles(\n uniqueIds.map((actorId) => ({ actorId, actorType: 'user' })),\n { workspaceId }\n );\n\n const nameOf = (actorId: string | null | undefined): string =>\n actorId ? (profiles[actorId]?.displayName ?? actorId) : '—';\n\n return { profiles, nameOf };\n}\n"],"mappings":";;;AA8BA,SAAgB,EACd,GACwB;CACxB,IAAM,EAAE,mBAAgB,EAAiB,GAGnC,IAAW,EACf,CAHiB,GAAG,IAAI,IAAI,EAAS,QAAQ,MAA2B,EAAQ,CAAM,CAAC,CAGvF,CAAA,CAAU,KAAK,OAAa;EAAE;EAAS,WAAW;CAAO,EAAE,GAC3D,EAAE,eAAY,CAChB;CAKA,OAAO;EAAE;EAAU,SAHH,MACd,IAAW,EAAS,EAAQ,EAAE,eAAe,IAAW;CAEhC;AAC5B"}
|