@burdenoff/microfe-files 2026.530.2 → 2026.601.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.
@@ -3,16 +3,21 @@ import { buildGraphQLEndpoint as t, setFilesConfig as n } from "../config/index.
3
3
  import { FilesRoutes as r } from "./FilesRoutes.js";
4
4
  import { useEffect as i } from "react";
5
5
  import { ErrorBoundary as a } from "@burdenoff/fe-libs/shared/components";
6
- import { QueryClient as o, QueryClientProvider as s } from "@tanstack/react-query";
7
- import { FolderOpen as c } from "lucide-react";
8
- import { FeatureFlagProvider as l } from "@burdenoff/fe-libs/shared/feature-flags";
9
- import { jsx as u } from "react/jsx-runtime";
6
+ import { MutationCache as o, QueryClient as s, QueryClientProvider as c } from "@tanstack/react-query";
7
+ import { FolderOpen as l } from "lucide-react";
8
+ import { FeatureFlagProvider as u } from "@burdenoff/fe-libs/shared/feature-flags";
9
+ import { jsx as d } from "react/jsx-runtime";
10
10
  //#region src/files/FilesRoot.tsx
11
- var d = new o({ defaultOptions: { queries: {
12
- staleTime: 1e3 * 60 * 5,
13
- refetchOnWindowFocus: !1
14
- } } }), f = (o) => {
15
- let { registerNavItems: f, registerFooterItems: p, basePath: m = "/", apiGatewayUrl: h, authToken: g, workspaceId: _ } = o;
11
+ var f = new s({
12
+ mutationCache: new o({ onSuccess: () => {
13
+ f.invalidateQueries();
14
+ } }),
15
+ defaultOptions: { queries: {
16
+ staleTime: 1e3 * 60 * 5,
17
+ refetchOnWindowFocus: !1
18
+ } }
19
+ }), p = (o) => {
20
+ let { registerNavItems: s, registerFooterItems: p, basePath: m = "/", apiGatewayUrl: h, authToken: g, workspaceId: _ } = o;
16
21
  i(() => {
17
22
  h && n({
18
23
  apiGatewayUrl: h.includes("/graphql") ? h : t(h, "workspaces"),
@@ -22,15 +27,15 @@ var d = new o({ defaultOptions: { queries: {
22
27
  }, [h, g]);
23
28
  let v = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
24
29
  return i(() => {
25
- if (f) return f([{
30
+ if (s) return s([{
26
31
  id: "files-browse",
27
32
  label: "All Files",
28
33
  path: v(m, "browse"),
29
- icon: /* @__PURE__ */ u(c, { size: 20 }),
34
+ icon: /* @__PURE__ */ d(l, { size: 20 }),
30
35
  order: 10,
31
36
  group: "files"
32
37
  }]);
33
- }, [f, m]), i(() => {
38
+ }, [s, m]), i(() => {
34
39
  if (p) return p([{
35
40
  id: "files-status",
36
41
  label: "Files Ready",
@@ -38,26 +43,26 @@ var d = new o({ defaultOptions: { queries: {
38
43
  order: 10,
39
44
  section: "left"
40
45
  }]);
41
- }, [p]), /* @__PURE__ */ u(a, {
42
- fallback: /* @__PURE__ */ u("div", {
46
+ }, [p]), /* @__PURE__ */ d(a, {
47
+ fallback: /* @__PURE__ */ d("div", {
43
48
  className: "p-6 text-center text-text-secondary",
44
49
  children: "Something went wrong loading this module. Please refresh the page."
45
50
  }),
46
- children: /* @__PURE__ */ u(s, {
47
- client: d,
48
- children: /* @__PURE__ */ u(l, {
51
+ children: /* @__PURE__ */ d(c, {
52
+ client: f,
53
+ children: /* @__PURE__ */ d(u, {
49
54
  workspaceId: _ ?? null,
50
55
  gateway: "global",
51
56
  defaultEnabled: !1,
52
- children: /* @__PURE__ */ u(e, {
57
+ children: /* @__PURE__ */ d(e, {
53
58
  ...o,
54
- children: /* @__PURE__ */ u(r, {})
59
+ children: /* @__PURE__ */ d(r, {})
55
60
  })
56
61
  })
57
62
  })
58
63
  });
59
64
  };
60
65
  //#endregion
61
- export { f as FilesRoot };
66
+ export { p as FilesRoot };
62
67
 
63
68
  //# sourceMappingURL=FilesRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilesRoot.js","names":[],"sources":["../../src/files/FilesRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { ErrorBoundary } from \"@burdenoff/fe-libs/shared/components\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { FolderOpen } from \"lucide-react\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { FilesProvider } from \"./providers/FilesProvider\";\nimport type { NavItem, FilesRootProps } from \"./types\";\nimport { FilesRoutes } from \"./FilesRoutes\";\nimport { setFilesConfig, buildGraphQLEndpoint } from \"../config\";\n\n// Create a query client instance\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 1000 * 60 * 5, // 5 minutes\n refetchOnWindowFocus: false,\n },\n },\n});\n\n/**\n * Root component for the Files microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { FilesRoot } from '@burdenoff/micro-fe/files';\n *\n * function App() {\n * return (\n * <Route path=\"/files/*\" element={\n * <FilesRoot\n * basePath=\"/files\"\n * navigate={navigate}\n * currentUser={user}\n * workspaceId=\"ws-123\"\n * apiGatewayUrl=\"https://api.example.com\"\n * authToken=\"token\"\n * />\n * } />\n * );\n * }\n * ```\n */\nexport const FilesRoot: FC<FilesRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n apiGatewayUrl,\n authToken,\n workspaceId,\n } = props;\n\n // Initialize runtime configuration from props\n useEffect(() => {\n if (apiGatewayUrl) {\n const fullEndpoint = apiGatewayUrl.includes(\"/graphql\")\n ? apiGatewayUrl\n : buildGraphQLEndpoint(apiGatewayUrl, \"workspaces\");\n\n setFilesConfig({\n apiGatewayUrl: fullEndpoint,\n apiGatewayBaseUrl: apiGatewayUrl,\n authToken,\n });\n }\n }, [apiGatewayUrl, authToken]);\n\n // Helper to join paths correctly, avoiding double slashes\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 the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: \"files-browse\",\n label: \"All Files\",\n path: joinPath(basePath, \"browse\"),\n icon: <FolderOpen size={20} />,\n order: 10,\n group: \"files\",\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items (example: storage status in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"files-status\",\n label: \"Files 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]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={false}\n >\n <FilesProvider {...props}>\n <FilesRoutes />\n </FilesProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;AAYA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,MAAO,KAAK;CACvB,sBAAsB;CACvB,EACF,EACF,CAAC,EA6BW,KAAiC,MAAU;CACtD,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,kBACA,cACA,mBACE;AAGJ,SAAgB;AACd,EAAI,KAKF,EAAe;GACb,eALmB,EAAc,SAAS,WAAW,GACnD,IACA,EAAqB,GAAe,aAAa;GAInD,mBAAmB;GACnB;GACD,CAAC;IAEH,CAAC,GAAe,EAAU,CAAC;CAG9B,IAAM,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AA4CtD,QAvCA,QAAgB;AACT,QAiBL,QAHgB,EAZY,CAC1B;GACE,IAAI;GACJ,OAAO;GACP,MAAM,EAAS,GAAU,SAAS;GAClC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;GAC9B,OAAO;GACP,OAAO;GACR,CACF,CAGyC;IAIzC,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAqB,QAAQ;aAC3B,kBAAC,GAAD;IACE,aAAa,KAAe;IAC5B,SAAQ;IACR,gBAAgB;cAEhB,kBAAC,GAAD;KAAe,GAAI;eACjB,kBAAC,GAAD,EAAe,CAAA;KACD,CAAA;IACI,CAAA;GACF,CAAA;EACR,CAAA"}
1
+ {"version":3,"file":"FilesRoot.js","names":[],"sources":["../../src/files/FilesRoot.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { ErrorBoundary } from \"@burdenoff/fe-libs/shared/components\";\nimport {\n MutationCache,\n QueryClient,\n QueryClientProvider,\n} from \"@tanstack/react-query\";\nimport { FolderOpen } from \"lucide-react\";\nimport { FeatureFlagProvider } from \"@burdenoff/fe-libs/shared/feature-flags\";\nimport { FilesProvider } from \"./providers/FilesProvider\";\nimport type { NavItem, FilesRootProps } from \"./types\";\nimport { FilesRoutes } from \"./FilesRoutes\";\nimport { setFilesConfig, buildGraphQLEndpoint } from \"../config\";\n\n// Create a query client instance\nconst queryClient = new QueryClient({\n mutationCache: new MutationCache({\n onSuccess: () => {\n void queryClient.invalidateQueries();\n },\n }),\n defaultOptions: {\n queries: {\n staleTime: 1000 * 60 * 5, // 5 minutes\n refetchOnWindowFocus: false,\n },\n },\n});\n\n/**\n * Root component for the Files microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { FilesRoot } from '@burdenoff/micro-fe/files';\n *\n * function App() {\n * return (\n * <Route path=\"/files/*\" element={\n * <FilesRoot\n * basePath=\"/files\"\n * navigate={navigate}\n * currentUser={user}\n * workspaceId=\"ws-123\"\n * apiGatewayUrl=\"https://api.example.com\"\n * authToken=\"token\"\n * />\n * } />\n * );\n * }\n * ```\n */\nexport const FilesRoot: FC<FilesRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = \"/\",\n apiGatewayUrl,\n authToken,\n workspaceId,\n } = props;\n\n // Initialize runtime configuration from props\n useEffect(() => {\n if (apiGatewayUrl) {\n const fullEndpoint = apiGatewayUrl.includes(\"/graphql\")\n ? apiGatewayUrl\n : buildGraphQLEndpoint(apiGatewayUrl, \"workspaces\");\n\n setFilesConfig({\n apiGatewayUrl: fullEndpoint,\n apiGatewayBaseUrl: apiGatewayUrl,\n authToken,\n });\n }\n }, [apiGatewayUrl, authToken]);\n\n // Helper to join paths correctly, avoiding double slashes\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 the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: \"files-browse\",\n label: \"All Files\",\n path: joinPath(basePath, \"browse\"),\n icon: <FolderOpen size={20} />,\n order: 10,\n group: \"files\",\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items (example: storage status in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: \"files-status\",\n label: \"Files 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]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={false}\n >\n <FilesProvider {...props}>\n <FilesRoutes />\n </FilesProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAc,IAAI,EAAY;CAClC,eAAe,IAAI,EAAc,EAC/B,iBAAiB;AACV,IAAY,mBAAmB;IAEvC,CAAC;CACF,gBAAgB,EACd,SAAS;EACP,WAAW,MAAO,KAAK;EACvB,sBAAsB;EACvB,EACF;CACF,CAAC,EA6BW,KAAiC,MAAU;CACtD,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,kBACA,cACA,mBACE;AAGJ,SAAgB;AACd,EAAI,KAKF,EAAe;GACb,eALmB,EAAc,SAAS,WAAW,GACnD,IACA,EAAqB,GAAe,aAAa;GAInD,mBAAmB;GACnB;GACD,CAAC;IAEH,CAAC,GAAe,EAAU,CAAC;CAG9B,IAAM,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AA4CtD,QAvCA,QAAgB;AACT,QAiBL,QAHgB,EAZY,CAC1B;GACE,IAAI;GACJ,OAAO;GACP,MAAM,EAAS,GAAU,SAAS;GAClC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;GAC9B,OAAO;GACP,OAAO;GACR,CACF,CAGyC;IAIzC,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAqB,QAAQ;aAC3B,kBAAC,GAAD;IACE,aAAa,KAAe;IAC5B,SAAQ;IACR,gBAAgB;cAEhB,kBAAC,GAAD;KAAe,GAAI;eACjB,kBAAC,GAAD,EAAe,CAAA;KACD,CAAA;IACI,CAAA;GACF,CAAA;EACR,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { useCreateFolderShareMutation as e } from "../../generated/wspace-operations.js";
2
2
  //#region src/files/hooks/useCreateFolderShare.ts
3
3
  var t = () => {
4
- let [t, { loading: n, error: r }] = e();
4
+ let [t, { loading: n, error: r }] = e({ refetchQueries: ["GetUserShares"] });
5
5
  return {
6
6
  mutateAsync: async (e) => (await t({ variables: { input: e } })).data?.createFolderShare,
7
7
  isPending: n,
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateFolderShare.js","names":[],"sources":["../../../src/files/hooks/useCreateFolderShare.ts"],"sourcesContent":["import { useCreateFolderShareMutation } from \"../../generated/wspace-operations\";\n\nexport interface CreateFolderShareInput {\n folderId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n}\n\nexport const useCreateFolderShare = () => {\n const [createFolderShareMutation, { loading, error }] =\n useCreateFolderShareMutation();\n\n return {\n mutateAsync: async (input: CreateFolderShareInput) => {\n const result = await createFolderShareMutation({\n variables: { input },\n });\n\n return result.data?.createFolderShare;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAaA,IAAa,UAA6B;CACxC,IAAM,CAAC,GAA2B,EAAE,YAAS,cAC3C,GAA8B;AAEhC,QAAO;EACL,aAAa,OAAO,OACH,MAAM,EAA0B,EAC7C,WAAW,EAAE,UAAO,EACrB,CAAC,EAEY,MAAM;EAEtB,WAAW;EACX;EACD"}
1
+ {"version":3,"file":"useCreateFolderShare.js","names":[],"sources":["../../../src/files/hooks/useCreateFolderShare.ts"],"sourcesContent":["import { useCreateFolderShareMutation } from \"../../generated/wspace-operations\";\n\nexport interface CreateFolderShareInput {\n folderId: string;\n shareType: \"PUBLIC_LINK\" | \"EMAIL_INVITE\" | \"GROUP_SHARE\";\n accessLevel: \"VIEW\" | \"COMMENT\" | \"DOWNLOAD\" | \"EDIT\";\n expiresAt?: string;\n password?: string;\n maxDownloads?: number;\n invitedEmail?: string;\n invitedUserIds?: string[];\n}\n\nexport const useCreateFolderShare = () => {\n const [createFolderShareMutation, { loading, error }] =\n useCreateFolderShareMutation({\n refetchQueries: [\"GetUserShares\"],\n });\n\n return {\n mutateAsync: async (input: CreateFolderShareInput) => {\n const result = await createFolderShareMutation({\n variables: { input },\n });\n\n return result.data?.createFolderShare;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAaA,IAAa,UAA6B;CACxC,IAAM,CAAC,GAA2B,EAAE,YAAS,cAC3C,EAA6B,EAC3B,gBAAgB,CAAC,gBAAgB,EAClC,CAAC;AAEJ,QAAO;EACL,aAAa,OAAO,OACH,MAAM,EAA0B,EAC7C,WAAW,EAAE,UAAO,EACrB,CAAC,EAEY,MAAM;EAEtB,WAAW;EACX;EACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-files",
3
- "version": "2026.530.2",
3
+ "version": "2026.601.1",
4
4
  "description": "Burdenoff Files Microfrontend - Standalone file management module",
5
5
  "type": "module",
6
6
  "imports": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@apollo/client": "^4.0.13",
48
- "@burdenoff/fe-libs": "2026.528.2",
48
+ "@burdenoff/fe-libs": "2026.601.4",
49
49
  "@tanstack/react-query": "^5.90.17",
50
50
  "graphql": "^16.12.0",
51
51
  "lucide-react": "^0.468.0",