@burdenoff/microfe-devportal 2026.831.1 → 2026.914.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.
@@ -4,40 +4,53 @@ import { MutationCache as a, QueryClient as o, QueryClientProvider as s } from "
4
4
  import { PermissionProvider as c } from "@burdenoff/fe-libs/shared/providers/shell";
5
5
  import { jsx as l } from "react/jsx-runtime";
6
6
  //#region src/devportal/providers/DevportalProvider.tsx
7
- var u = "devportal_active_org_v1", d = e(null), f = () => {
8
- let e = t(d);
7
+ var u = "devportal_active_org_v1", d = "devportal_active_physical_org_v1", f = e(null), p = () => {
8
+ let e = t(f);
9
9
  if (!e) throw Error("useDevportal must be used within DevportalProvider");
10
10
  return e;
11
- }, p = ({ children: e, basePath: t, navigate: f, currentUser: p, tenantId: m, workspaceId: h, apiGatewayUrl: g, workspacesGatewayUrl: _, authToken: v, workspaceToken: y, getWorkspaceToken: b, registerNavItems: x, registerFooterItems: S, onApplicationSelect: C, onOrganizationSelect: w }) => {
12
- let [T, E] = r(() => {
11
+ }, m = ({ children: e, basePath: t, navigate: p, currentUser: m, tenantId: h, workspaceId: g, apiGatewayUrl: _, workspacesGatewayUrl: v, authToken: y, workspaceToken: b, getWorkspaceToken: x, registerNavItems: S, registerFooterItems: C, onApplicationSelect: w, onOrganizationSelect: T }) => {
12
+ let [E, D] = r(() => {
13
13
  try {
14
14
  return localStorage.getItem(u) ?? null;
15
15
  } catch {
16
16
  return null;
17
17
  }
18
- }), D = {
18
+ }), O = (e) => {
19
+ D(e);
20
+ try {
21
+ e ? localStorage.setItem(u, e) : localStorage.removeItem(u);
22
+ } catch {}
23
+ }, [k, A] = r(() => {
24
+ try {
25
+ return localStorage.getItem(d) ?? null;
26
+ } catch {
27
+ return null;
28
+ }
29
+ }), j = {
19
30
  basePath: t,
20
- navigate: f,
21
- currentUser: p,
22
- tenantId: m,
23
- workspaceId: h,
24
- apiGatewayUrl: g,
25
- workspacesGatewayUrl: _,
26
- authToken: v,
27
- workspaceToken: y,
28
- getWorkspaceToken: b,
29
- registerNavItems: x,
30
- registerFooterItems: S,
31
- onApplicationSelect: C,
32
- onOrganizationSelect: w,
33
- activeOrgId: T,
34
- setActiveOrgId: (e) => {
35
- E(e);
31
+ navigate: p,
32
+ currentUser: m,
33
+ tenantId: h,
34
+ workspaceId: g,
35
+ apiGatewayUrl: _,
36
+ workspacesGatewayUrl: v,
37
+ authToken: y,
38
+ workspaceToken: b,
39
+ getWorkspaceToken: x,
40
+ registerNavItems: S,
41
+ registerFooterItems: C,
42
+ onApplicationSelect: w,
43
+ onOrganizationSelect: T,
44
+ activeOrgId: E,
45
+ setActiveOrgId: O,
46
+ activePhysicalOrgId: k,
47
+ setActivePhysicalOrgId: (e) => {
48
+ A(e);
36
49
  try {
37
- e ? localStorage.setItem(u, e) : localStorage.removeItem(u);
50
+ e ? localStorage.setItem(d, e) : localStorage.removeItem(d);
38
51
  } catch {}
39
52
  }
40
- }, O = n(() => {
53
+ }, M = n(() => {
41
54
  let e = new o({
42
55
  mutationCache: new a({ onSuccess: () => {
43
56
  e.invalidateQueries();
@@ -49,20 +62,20 @@ var u = "devportal_active_org_v1", d = e(null), f = () => {
49
62
  } }
50
63
  });
51
64
  return e;
52
- }, []), k = !!t, A = /* @__PURE__ */ l(s, {
53
- client: O,
54
- children: /* @__PURE__ */ l(d.Provider, {
55
- value: D,
56
- children: k ? /* @__PURE__ */ l(c, {
57
- scopeId: m ?? null,
65
+ }, []), N = !!t, P = /* @__PURE__ */ l(s, {
66
+ client: M,
67
+ children: /* @__PURE__ */ l(f.Provider, {
68
+ value: j,
69
+ children: N ? /* @__PURE__ */ l(c, {
70
+ scopeId: h ?? null,
58
71
  gateway: "global",
59
72
  children: e
60
73
  }) : e
61
74
  })
62
75
  });
63
- return k ? A : /* @__PURE__ */ l(i, { children: A });
76
+ return N ? P : /* @__PURE__ */ l(i, { children: P });
64
77
  };
65
78
  //#endregion
66
- export { p as DevportalProvider, f as useDevportal };
79
+ export { m as DevportalProvider, p as useDevportal };
67
80
 
68
81
  //# sourceMappingURL=DevportalProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevportalProvider.js","names":[],"sources":["../../../src/devportal/providers/DevportalProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo, useState } from \"react\";\nimport { BrowserRouter } from \"react-router\";\nimport {\n MutationCache,\n QueryClient,\n QueryClientProvider,\n} from \"@tanstack/react-query\";\nimport { PermissionProvider } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { DevportalRootProps } from \"../types\";\n\nconst ORG_STORAGE_KEY = \"devportal_active_org_v1\";\n\n/**\n * Context value for Developer Portal microfrontend.\n * Extends root props with org-scoping state shared across all devportal pages.\n */\ntype DevportalContextValue = DevportalRootProps & {\n activeOrgId: string | null;\n setActiveOrgId: (id: string | null) => void;\n};\n\nconst DevportalContext = createContext<DevportalContextValue | null>(null);\n\n/**\n * Hook to access Developer Portal context\n */\nexport const useDevportal = () => {\n const context = useContext(DevportalContext);\n if (!context) {\n throw new Error(\"useDevportal must be used within DevportalProvider\");\n }\n return context;\n};\n\n/**\n * Provider component for Developer Portal microfrontend\n * Sets up routing, context, and React Query client\n */\nexport const DevportalProvider: FC<PropsWithChildren<DevportalRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n workspacesGatewayUrl,\n authToken,\n workspaceToken,\n getWorkspaceToken,\n registerNavItems,\n registerFooterItems,\n onApplicationSelect,\n onOrganizationSelect,\n}) => {\n const [activeOrgId, setActiveOrgIdState] = useState<string | null>(() => {\n try {\n return localStorage.getItem(ORG_STORAGE_KEY) ?? null;\n } catch {\n return null;\n }\n });\n\n const setActiveOrgId = (id: string | null) => {\n setActiveOrgIdState(id);\n try {\n if (id) {\n localStorage.setItem(ORG_STORAGE_KEY, id);\n } else {\n localStorage.removeItem(ORG_STORAGE_KEY);\n }\n } catch {\n // ignore storage errors\n }\n };\n\n const contextValue: DevportalContextValue = {\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n workspacesGatewayUrl,\n authToken,\n workspaceToken,\n getWorkspaceToken,\n registerNavItems,\n registerFooterItems,\n onApplicationSelect,\n onOrganizationSelect,\n activeOrgId,\n setActiveOrgId,\n };\n\n // Create QueryClient instance (memoized to avoid recreation on re-renders)\n const queryClient = useMemo(() => {\n const client = new QueryClient({\n mutationCache: new MutationCache({\n onSuccess: () => {\n void client.invalidateQueries();\n },\n }),\n defaultOptions: {\n queries: {\n retry: 1,\n refetchOnWindowFocus: false,\n staleTime: 5 * 60 * 1000, // 5 minutes\n },\n },\n });\n return client;\n }, []);\n\n // PermissionProvider requires the shell's AuthProvider — only mount it in integrated mode.\n // In standalone/dev mode (MemoryRouter path), there's no AuthProvider, so we skip it\n // and pages will use a fallback that allows access (dev-only behaviour).\n const isIntegrated = !!basePath;\n\n // Wrap content with QueryClientProvider\n const content = (\n <QueryClientProvider client={queryClient}>\n <DevportalContext.Provider value={contextValue}>\n {isIntegrated ? (\n <PermissionProvider scopeId={tenantId ?? null} gateway=\"global\">\n {children}\n </PermissionProvider>\n ) : (\n children\n )}\n </DevportalContext.Provider>\n </QueryClientProvider>\n );\n\n // When integrated into a shell (basePath provided), the shell already has a router\n // so we don't create another one. When standalone (no basePath), use BrowserRouter.\n if (isIntegrated) {\n return content;\n }\n\n // Standalone mode: create BrowserRouter for independent operation\n return <BrowserRouter>{content}</BrowserRouter>;\n};\n"],"mappings":";;;;;;AAWA,IAAM,IAAkB,2BAWlB,IAAmB,EAA4C,KAAK,EAK7D,UAAqB;CAChC,IAAM,IAAU,EAAW,EAAiB;AAC5C,KAAI,CAAC,EACH,OAAU,MAAM,qDAAqD;AAEvE,QAAO;GAOI,KAAgE,EAC3E,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,yBACA,cACA,mBACA,sBACA,qBACA,wBACA,wBACA,8BACI;CACJ,IAAM,CAAC,GAAa,KAAuB,QAA8B;AACvE,MAAI;AACF,UAAO,aAAa,QAAQ,EAAgB,IAAI;UAC1C;AACN,UAAO;;GAET,EAeI,IAAsC;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBA7BsB,MAAsB;AAC5C,KAAoB,EAAG;AACvB,OAAI;AACF,IAAI,IACF,aAAa,QAAQ,GAAiB,EAAG,GAEzC,aAAa,WAAW,EAAgB;WAEpC;;EAsBT,EAGK,IAAc,QAAc;EAChC,IAAM,IAAS,IAAI,EAAY;GAC7B,eAAe,IAAI,EAAc,EAC/B,iBAAiB;AACV,MAAO,mBAAmB;MAElC,CAAC;GACF,gBAAgB,EACd,SAAS;IACP,OAAO;IACP,sBAAsB;IACtB,WAAW,MAAS;IACrB,EACF;GACF,CAAC;AACF,SAAO;IACN,EAAE,CAAC,EAKA,IAAe,CAAC,CAAC,GAGjB,IACJ,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,EAAiB,UAAlB;GAA2B,OAAO;aAC/B,IACC,kBAAC,GAAD;IAAoB,SAAS,KAAY;IAAM,SAAQ;IACpD;IACkB,CAAA,GAErB;GAEwB,CAAA;EACR,CAAA;AAUxB,QALI,IACK,IAIF,kBAAC,GAAD,EAAA,UAAgB,GAAwB,CAAA"}
1
+ {"version":3,"file":"DevportalProvider.js","names":[],"sources":["../../../src/devportal/providers/DevportalProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo, useState } from \"react\";\nimport { BrowserRouter } from \"react-router\";\nimport {\n MutationCache,\n QueryClient,\n QueryClientProvider,\n} from \"@tanstack/react-query\";\nimport { PermissionProvider } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { DevportalRootProps } from \"../types\";\n\nconst ORG_STORAGE_KEY = \"devportal_active_org_v1\";\nconst PHYSICAL_ORG_STORAGE_KEY = \"devportal_active_physical_org_v1\";\n\n/**\n * Context value for Developer Portal microfrontend.\n * Extends root props with org-scoping state shared across all devportal pages.\n */\ntype DevportalContextValue = DevportalRootProps & {\n activeOrgId: string | null;\n setActiveOrgId: (id: string | null) => void;\n /**\n * The seller portal's currently-selected PHYSICAL-kind org. Kept separate\n * from activeOrgId (which the rest of devportal treats as DIGITAL) so\n * switching between the seller portal and the regular devportal never\n * mixes up which kind of org is \"active\" — see DeveloperOrgKind (BOFF-7285).\n */\n activePhysicalOrgId: string | null;\n setActivePhysicalOrgId: (id: string | null) => void;\n};\n\nconst DevportalContext = createContext<DevportalContextValue | null>(null);\n\n/**\n * Hook to access Developer Portal context\n */\nexport const useDevportal = () => {\n const context = useContext(DevportalContext);\n if (!context) {\n throw new Error(\"useDevportal must be used within DevportalProvider\");\n }\n return context;\n};\n\n/**\n * Provider component for Developer Portal microfrontend\n * Sets up routing, context, and React Query client\n */\nexport const DevportalProvider: FC<PropsWithChildren<DevportalRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n workspacesGatewayUrl,\n authToken,\n workspaceToken,\n getWorkspaceToken,\n registerNavItems,\n registerFooterItems,\n onApplicationSelect,\n onOrganizationSelect,\n}) => {\n const [activeOrgId, setActiveOrgIdState] = useState<string | null>(() => {\n try {\n return localStorage.getItem(ORG_STORAGE_KEY) ?? null;\n } catch {\n return null;\n }\n });\n\n const setActiveOrgId = (id: string | null) => {\n setActiveOrgIdState(id);\n try {\n if (id) {\n localStorage.setItem(ORG_STORAGE_KEY, id);\n } else {\n localStorage.removeItem(ORG_STORAGE_KEY);\n }\n } catch {\n // ignore storage errors\n }\n };\n\n const [activePhysicalOrgId, setActivePhysicalOrgIdState] = useState<\n string | null\n >(() => {\n try {\n return localStorage.getItem(PHYSICAL_ORG_STORAGE_KEY) ?? null;\n } catch {\n return null;\n }\n });\n\n const setActivePhysicalOrgId = (id: string | null) => {\n setActivePhysicalOrgIdState(id);\n try {\n if (id) {\n localStorage.setItem(PHYSICAL_ORG_STORAGE_KEY, id);\n } else {\n localStorage.removeItem(PHYSICAL_ORG_STORAGE_KEY);\n }\n } catch {\n // ignore storage errors\n }\n };\n\n const contextValue: DevportalContextValue = {\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n workspacesGatewayUrl,\n authToken,\n workspaceToken,\n getWorkspaceToken,\n registerNavItems,\n registerFooterItems,\n onApplicationSelect,\n onOrganizationSelect,\n activeOrgId,\n setActiveOrgId,\n activePhysicalOrgId,\n setActivePhysicalOrgId,\n };\n\n // Create QueryClient instance (memoized to avoid recreation on re-renders)\n const queryClient = useMemo(() => {\n const client = new QueryClient({\n mutationCache: new MutationCache({\n onSuccess: () => {\n void client.invalidateQueries();\n },\n }),\n defaultOptions: {\n queries: {\n retry: 1,\n refetchOnWindowFocus: false,\n staleTime: 5 * 60 * 1000, // 5 minutes\n },\n },\n });\n return client;\n }, []);\n\n // PermissionProvider requires the shell's AuthProvider — only mount it in integrated mode.\n // In standalone/dev mode (MemoryRouter path), there's no AuthProvider, so we skip it\n // and pages will use a fallback that allows access (dev-only behaviour).\n const isIntegrated = !!basePath;\n\n // Wrap content with QueryClientProvider\n const content = (\n <QueryClientProvider client={queryClient}>\n <DevportalContext.Provider value={contextValue}>\n {isIntegrated ? (\n <PermissionProvider scopeId={tenantId ?? null} gateway=\"global\">\n {children}\n </PermissionProvider>\n ) : (\n children\n )}\n </DevportalContext.Provider>\n </QueryClientProvider>\n );\n\n // When integrated into a shell (basePath provided), the shell already has a router\n // so we don't create another one. When standalone (no basePath), use BrowserRouter.\n if (isIntegrated) {\n return content;\n }\n\n // Standalone mode: create BrowserRouter for independent operation\n return <BrowserRouter>{content}</BrowserRouter>;\n};\n"],"mappings":";;;;;;AAWA,IAAM,IAAkB,2BAClB,IAA2B,oCAmB3B,IAAmB,EAA4C,KAAK,EAK7D,UAAqB;CAChC,IAAM,IAAU,EAAW,EAAiB;AAC5C,KAAI,CAAC,EAC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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-devportal",
3
- "version": "2026.831.1",
3
+ "version": "2026.914.1",
4
4
  "description": "Burdenoff Developer Portal Microfrontend - Complete developer operations interface",
5
5
  "type": "module",
6
6
  "files": [