@burdenoff/microfe-files 2026.1125.1 → 2026.1127.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.
@@ -1,50 +1,55 @@
1
1
  import { BrowserPage as e } from "./pages/BrowserPage.js";
2
2
  import { ShareAccessPage as t } from "./pages/ShareAccessPage.js";
3
- import { useFilesContext as n } from "./providers/FilesProvider.js";
4
- import { Suspense as r, lazy as i } from "react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-router";
7
- import { useWorkspacePagesV2 as d } from "@burdenoff/fe-libs/ui";
3
+ import { FilePreviewPage as n } from "./pages/FilePreviewPage.js";
4
+ import { useFilesContext as r } from "./providers/FilesProvider.js";
5
+ import { Suspense as i, lazy as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { Navigate as c, Route as l, Routes as u, useLocation as d } from "react-router";
8
+ import { useWorkspacePagesV2 as f } from "@burdenoff/fe-libs/ui";
8
9
  // src/files/FilesRoutes.tsx
9
- var f = i(() => import("./v2/FilesV2Routes.js").then((e) => ({ default: e.FilesV2Routes })));
10
- function p() {
11
- let { basePath: i } = n(), p = u(), m = d(), h = i.replace(/\/+$/, "") || "/", g = `${h === "/" ? "" : h}/share/:token`, _ = `${h === "/" ? "" : h}/share/`, v = `${h === "/" ? "" : h}/browse`;
12
- return p.pathname.startsWith(_) ? /* @__PURE__ */ a(t, {}) : m ? /* @__PURE__ */ a(r, {
10
+ var p = a(() => import("./v2/FilesV2Routes.js").then((e) => ({ default: e.FilesV2Routes })));
11
+ function m() {
12
+ let { basePath: a, workspaceId: m, currentUser: h } = r(), g = d(), _ = f(), v = a.replace(/\/+$/, "") || "/", y = `${v === "/" ? "" : v}/share/:token`, b = `${v === "/" ? "" : v}/share/`, x = `${v === "/" ? "" : v}/browse`;
13
+ return g.pathname.startsWith(b) ? /* @__PURE__ */ o(t, {}) : _ ? /* @__PURE__ */ o(i, {
13
14
  fallback: null,
14
- children: /* @__PURE__ */ a(f, {})
15
- }) : /* @__PURE__ */ o(l, { children: [
16
- /* @__PURE__ */ a(c, {
15
+ children: /* @__PURE__ */ o(p, {})
16
+ }) : /* @__PURE__ */ s(u, { children: [
17
+ /* @__PURE__ */ o(l, {
17
18
  index: !0,
18
- element: /* @__PURE__ */ a(s, {
19
- to: v,
19
+ element: /* @__PURE__ */ o(c, {
20
+ to: x,
20
21
  replace: !0
21
22
  })
22
23
  }),
23
- /* @__PURE__ */ a(c, {
24
+ /* @__PURE__ */ o(l, {
24
25
  path: "browse",
25
- element: /* @__PURE__ */ a(e, {})
26
+ element: /* @__PURE__ */ o(e, {})
26
27
  }),
27
- /* @__PURE__ */ a(c, {
28
+ /* @__PURE__ */ o(l, {
28
29
  path: "browse/:folderId",
29
- element: /* @__PURE__ */ a(e, {})
30
+ element: /* @__PURE__ */ o(e, {})
30
31
  }),
31
- /* @__PURE__ */ a(c, {
32
+ /* @__PURE__ */ o(l, {
33
+ path: "preview/:fileId",
34
+ element: /* @__PURE__ */ o(n, {}, `${m}:${h?.id}`)
35
+ }),
36
+ /* @__PURE__ */ o(l, {
32
37
  path: "share/:token",
33
- element: /* @__PURE__ */ a(t, {})
38
+ element: /* @__PURE__ */ o(t, {})
34
39
  }),
35
- /* @__PURE__ */ a(c, {
36
- path: g,
37
- element: /* @__PURE__ */ a(t, {})
40
+ /* @__PURE__ */ o(l, {
41
+ path: y,
42
+ element: /* @__PURE__ */ o(t, {})
38
43
  }),
39
- /* @__PURE__ */ a(c, {
44
+ /* @__PURE__ */ o(l, {
40
45
  path: "*",
41
- element: /* @__PURE__ */ a(s, {
42
- to: v,
46
+ element: /* @__PURE__ */ o(c, {
47
+ to: x,
43
48
  replace: !0
44
49
  })
45
50
  })
46
51
  ] });
47
52
  }
48
- export { p as FilesRoutes };
53
+ export { m as FilesRoutes };
49
54
 
50
55
  //# sourceMappingURL=FilesRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilesRoutes.js","names":["FilesV2Routes","lazy","m","FilesRoutes","useFilesContext","location","useLocation","workspacePagesV2","useWorkspacePagesV2","normalizedBasePath","basePath","absoluteSharePath","absoluteSharePrefix","absoluteBrowsePath","ShareAccessPage","Suspense","Routes","Route","Navigate","BrowserPage"],"sources":["../../src/files/FilesRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { Navigate, Route, Routes, useLocation } from \"react-router\";\nimport { useWorkspacePagesV2 } from \"@burdenoff/fe-libs/ui\";\nimport { BrowserPage } from \"./pages/BrowserPage\";\nimport { ShareAccessPage } from \"./pages/ShareAccessPage\";\nimport { useFilesContext } from \"./providers/FilesProvider\";\n\n// Workspace pages v2 (BOFF-15821): the redesigned Files page, for hosts that opt in.\nconst FilesV2Routes = lazy(() =>\n import(\"./v2/FilesV2Routes\").then((m) => ({ default: m.FilesV2Routes })),\n);\n\n/**\n * Internal router for the Files microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Redirect to browse\n * - /browse → File browser page (root folder) - eager loaded\n * - /browse/:folderId → File browser page (specific folder) - eager loaded\n * - /* → Catch-all redirects to browse\n */\nexport function FilesRoutes() {\n const { basePath } = useFilesContext();\n const location = useLocation();\n // Off everywhere but FluidGrids (AppShellConfig.workspacePagesV2): the routes below, unchanged.\n const workspacePagesV2 = useWorkspacePagesV2();\n const normalizedBasePath = basePath.replace(/\\/+$/, \"\") || \"/\";\n const absoluteSharePath = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/share/:token`;\n const absoluteSharePrefix = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/share/`;\n // Absolute target for default + catch-all redirects. Using a relative `to=\"browse\"`\n // here causes an infinite path-compounding loop when a splat (`path=\"*\"`) matches a\n // host-shell sibling route (e.g. `/files/shared`): React Router resolves the\n // relative path against the splat-matched URL, so each render appends another\n // `/browse` segment (`/files/shared/browse/browse/...`).\n const absoluteBrowsePath = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/browse`;\n\n if (location.pathname.startsWith(absoluteSharePrefix)) {\n return <ShareAccessPage />;\n }\n\n if (workspacePagesV2) {\n return (\n <Suspense fallback={null}>\n <FilesV2Routes />\n </Suspense>\n );\n }\n\n return (\n <Routes>\n {/* Default route - redirect to browse */}\n <Route index element={<Navigate to={absoluteBrowsePath} replace />} />\n\n {/* Main pages - BrowserPage is eager loaded (primary entry point) */}\n <Route path=\"browse\" element={<BrowserPage />} />\n <Route path=\"browse/:folderId\" element={<BrowserPage />} />\n <Route path=\"share/:token\" element={<ShareAccessPage />} />\n <Route path={absoluteSharePath} element={<ShareAccessPage />} />\n\n {/* Catch-all route - redirect to browse (absolute to avoid splat-relative compounding) */}\n <Route path=\"*\" element={<Navigate to={absoluteBrowsePath} replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;AAQA,IAAMA,IAAgBC,QACpB,OAAO,wBAAqB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,cAAc,EAAE,CACzE;AAYA,SAAgBC,IAAc;CAC5B,IAAM,EAAE,gBAAaC,EAAgB,GAC/BC,IAAWC,EAAY,GAEvBC,IAAmBC,EAAoB,GACvCC,IAAqBC,EAAS,QAAQ,QAAQ,EAAE,KAAK,KACrDC,IAAoB,GAAGF,MAAuB,MAAM,KAAKA,EAAmB,gBAC5EG,IAAsB,GAAGH,MAAuB,MAAM,KAAKA,EAAmB,UAM9EI,IAAqB,GAAGJ,MAAuB,MAAM,KAAKA,EAAmB;CAcnF,OAZIJ,EAAS,SAAS,WAAWO,CAAmB,IAC3C,kBAACE,GAAD,CAAkB,CAAA,IAGvBP,IAEA,kBAACQ,GAAD;EAAU,UAAU;EAClB,UAAA,kBAACf,GAAD,CAAgB,CAAA;CACR,CAAA,IAKZ,kBAACgB,GAAD,EAAA,UAAA;EAEE,kBAACC,GAAD;GAAO,OAAA;GAAM,SAAS,kBAACC,GAAD;IAAU,IAAIL;IAAoB,SAAA;GAAS,CAAA;EAAI,CAAA;EAGrE,kBAACI,GAAD;GAAO,MAAK;GAAS,SAAS,kBAACE,GAAD,CAAc,CAAA;EAAI,CAAA;EAChD,kBAACF,GAAD;GAAO,MAAK;GAAmB,SAAS,kBAACE,GAAD,CAAc,CAAA;EAAI,CAAA;EAC1D,kBAACF,GAAD;GAAO,MAAK;GAAe,SAAS,kBAACH,GAAD,CAAkB,CAAA;EAAI,CAAA;EAC1D,kBAACG,GAAD;GAAO,MAAMN;GAAmB,SAAS,kBAACG,GAAD,CAAkB,CAAA;EAAI,CAAA;EAG/D,kBAACG,GAAD;GAAO,MAAK;GAAI,SAAS,kBAACC,GAAD;IAAU,IAAIL;IAAoB,SAAA;GAAS,CAAA;EAAI,CAAA;CAClE,EAAA,CAAA;AAEZ"}
1
+ {"version":3,"file":"FilesRoutes.js","names":["FilesV2Routes","lazy","m","FilesRoutes","useFilesContext","location","useLocation","workspacePagesV2","useWorkspacePagesV2","normalizedBasePath","basePath","absoluteSharePath","absoluteSharePrefix","absoluteBrowsePath","ShareAccessPage","Suspense","Routes","Route","Navigate","BrowserPage","FilePreviewPage","workspaceId","currentUser"],"sources":["../../src/files/FilesRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport { Navigate, Route, Routes, useLocation } from \"react-router\";\nimport { useWorkspacePagesV2 } from \"@burdenoff/fe-libs/ui\";\nimport { BrowserPage } from \"./pages/BrowserPage\";\nimport { ShareAccessPage } from \"./pages/ShareAccessPage\";\nimport { FilePreviewPage } from \"./pages/FilePreviewPage\";\nimport { useFilesContext } from \"./providers/FilesProvider\";\n\n// Workspace pages v2 (BOFF-15821): the redesigned Files page, for hosts that opt in.\nconst FilesV2Routes = lazy(() =>\n import(\"./v2/FilesV2Routes\").then((m) => ({ default: m.FilesV2Routes })),\n);\n\n/**\n * Internal router for the Files microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Redirect to browse\n * - /browse → File browser page (root folder) - eager loaded\n * - /browse/:folderId → File browser page (specific folder) - eager loaded\n * - /* → Catch-all redirects to browse\n */\nexport function FilesRoutes() {\n const { basePath, workspaceId, currentUser } = useFilesContext();\n const location = useLocation();\n // Off everywhere but FluidGrids (AppShellConfig.workspacePagesV2): the routes below, unchanged.\n const workspacePagesV2 = useWorkspacePagesV2();\n const normalizedBasePath = basePath.replace(/\\/+$/, \"\") || \"/\";\n const absoluteSharePath = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/share/:token`;\n const absoluteSharePrefix = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/share/`;\n // Absolute target for default + catch-all redirects. Using a relative `to=\"browse\"`\n // here causes an infinite path-compounding loop when a splat (`path=\"*\"`) matches a\n // host-shell sibling route (e.g. `/files/shared`): React Router resolves the\n // relative path against the splat-matched URL, so each render appends another\n // `/browse` segment (`/files/shared/browse/browse/...`).\n const absoluteBrowsePath = `${normalizedBasePath === \"/\" ? \"\" : normalizedBasePath}/browse`;\n\n if (location.pathname.startsWith(absoluteSharePrefix)) {\n return <ShareAccessPage />;\n }\n\n if (workspacePagesV2) {\n return (\n <Suspense fallback={null}>\n <FilesV2Routes />\n </Suspense>\n );\n }\n\n return (\n <Routes>\n {/* Default route - redirect to browse */}\n <Route index element={<Navigate to={absoluteBrowsePath} replace />} />\n\n {/* Main pages - BrowserPage is eager loaded (primary entry point) */}\n <Route path=\"browse\" element={<BrowserPage />} />\n <Route path=\"browse/:folderId\" element={<BrowserPage />} />\n <Route\n path=\"preview/:fileId\"\n element={<FilePreviewPage key={`${workspaceId}:${currentUser?.id}`} />}\n />\n <Route path=\"share/:token\" element={<ShareAccessPage />} />\n <Route path={absoluteSharePath} element={<ShareAccessPage />} />\n\n {/* Catch-all route - redirect to browse (absolute to avoid splat-relative compounding) */}\n <Route path=\"*\" element={<Navigate to={absoluteBrowsePath} replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;;AASA,IAAMA,IAAgBC,QACpB,OAAO,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