@burdenoff/microfe-adaptercloud 2026.628.1 → 2026.706.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,27 +1,33 @@
1
1
  import { AdapterCloudProvider as e } from "./context/AdapterCloudContext.js";
2
- import { AdapterCloudRoutes as t } from "./AdapterCloudRoutes.js";
3
- import { useCallback as n, useEffect as r } from "react";
4
- import { QueryClient as i, QueryClientProvider as a } from "@tanstack/react-query";
5
- import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
- import { Activity as s, Boxes as c, Cable as l, DollarSign as u, GitCompareArrows as d, LayoutDashboard as f, ScrollText as p, Server as m, ShieldAlert as h } from "lucide-react";
7
- import { jsx as g } from "react/jsx-runtime";
8
- import { FeatureFlagProvider as _ } from "@burdenoff/fe-libs/shared/feature-flags";
2
+ import { notify as t } from "./lib/toast.js";
3
+ import { AdapterCloudRoutes as n } from "./AdapterCloudRoutes.js";
4
+ import { useCallback as r, useEffect as i } from "react";
5
+ import { MutationCache as a, QueryClient as o, QueryClientProvider as s } from "@tanstack/react-query";
6
+ import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { Activity as l, Boxes as u, Cable as d, DollarSign as f, GitCompareArrows as p, LayoutDashboard as m, ScrollText as h, Server as g, ShieldAlert as _ } from "lucide-react";
8
+ import { jsx as v } from "react/jsx-runtime";
9
+ import { FeatureFlagProvider as y } from "@burdenoff/fe-libs/shared/feature-flags";
9
10
  //#region src/adaptercloud/AdapterCloudRoot.tsx
10
- var v = new i({ defaultOptions: { queries: {
11
- staleTime: 300 * 1e3,
12
- retry: 1
13
- } } }), y = (i) => {
14
- let { registerNavItems: y, registerFooterItems: b, basePath: x = "/" } = i, { t: S } = o(), C = n((e, t) => {
11
+ var b = new o({
12
+ mutationCache: new a({ onError: (e) => {
13
+ t.error("Something went wrong", e instanceof Error ? e.message : "Please try again.");
14
+ } }),
15
+ defaultOptions: { queries: {
16
+ staleTime: 300 * 1e3,
17
+ retry: 1
18
+ } }
19
+ }), x = (t) => {
20
+ let { registerNavItems: a, registerFooterItems: o, basePath: x = "/" } = t, { t: S } = c(), C = r((e, t) => {
15
21
  let n = S(e);
16
22
  return n === e ? t : n;
17
23
  }, [S]), w = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
18
- return r(() => {
19
- if (y) return y([
24
+ return i(() => {
25
+ if (a) return a([
20
26
  {
21
27
  id: "adaptercloud-overview",
22
28
  label: C("adaptercloud.nav.overview", "Overview"),
23
29
  path: w(x, ""),
24
- icon: /* @__PURE__ */ g(f, { size: 20 }),
30
+ icon: /* @__PURE__ */ v(m, { size: 20 }),
25
31
  order: 1,
26
32
  group: "main"
27
33
  },
@@ -29,7 +35,7 @@ var v = new i({ defaultOptions: { queries: {
29
35
  id: "adaptercloud-adapters",
30
36
  label: C("adaptercloud.nav.adapters", "Adapters"),
31
37
  path: w(x, "adapters"),
32
- icon: /* @__PURE__ */ g(c, { size: 20 }),
38
+ icon: /* @__PURE__ */ v(u, { size: 20 }),
33
39
  order: 10,
34
40
  group: "fabric"
35
41
  },
@@ -37,7 +43,7 @@ var v = new i({ defaultOptions: { queries: {
37
43
  id: "adaptercloud-connections",
38
44
  label: C("adaptercloud.nav.connections", "Connections"),
39
45
  path: w(x, "connections"),
40
- icon: /* @__PURE__ */ g(l, { size: 20 }),
46
+ icon: /* @__PURE__ */ v(d, { size: 20 }),
41
47
  order: 11,
42
48
  group: "fabric"
43
49
  },
@@ -45,7 +51,7 @@ var v = new i({ defaultOptions: { queries: {
45
51
  id: "adaptercloud-resources",
46
52
  label: C("adaptercloud.nav.resources", "Resources"),
47
53
  path: w(x, "resources"),
48
- icon: /* @__PURE__ */ g(m, { size: 20 }),
54
+ icon: /* @__PURE__ */ v(g, { size: 20 }),
49
55
  order: 12,
50
56
  group: "fabric"
51
57
  },
@@ -53,7 +59,7 @@ var v = new i({ defaultOptions: { queries: {
53
59
  id: "adaptercloud-policies",
54
60
  label: C("adaptercloud.nav.policies", "Policies"),
55
61
  path: w(x, "policies"),
56
- icon: /* @__PURE__ */ g(p, { size: 20 }),
62
+ icon: /* @__PURE__ */ v(h, { size: 20 }),
57
63
  order: 20,
58
64
  group: "governance"
59
65
  },
@@ -61,7 +67,7 @@ var v = new i({ defaultOptions: { queries: {
61
67
  id: "adaptercloud-violations",
62
68
  label: C("adaptercloud.nav.violations", "Violations"),
63
69
  path: w(x, "violations"),
64
- icon: /* @__PURE__ */ g(h, { size: 20 }),
70
+ icon: /* @__PURE__ */ v(_, { size: 20 }),
65
71
  order: 21,
66
72
  group: "governance"
67
73
  },
@@ -69,7 +75,7 @@ var v = new i({ defaultOptions: { queries: {
69
75
  id: "adaptercloud-drift",
70
76
  label: C("adaptercloud.nav.drift", "Drift"),
71
77
  path: w(x, "drift"),
72
- icon: /* @__PURE__ */ g(d, { size: 20 }),
78
+ icon: /* @__PURE__ */ v(p, { size: 20 }),
73
79
  order: 22,
74
80
  group: "governance"
75
81
  },
@@ -77,7 +83,7 @@ var v = new i({ defaultOptions: { queries: {
77
83
  id: "adaptercloud-sync-runs",
78
84
  label: C("adaptercloud.nav.syncRuns", "Sync Runs"),
79
85
  path: w(x, "sync-runs"),
80
- icon: /* @__PURE__ */ g(s, { size: 20 }),
86
+ icon: /* @__PURE__ */ v(l, { size: 20 }),
81
87
  order: 30,
82
88
  group: "operations"
83
89
  },
@@ -85,37 +91,37 @@ var v = new i({ defaultOptions: { queries: {
85
91
  id: "adaptercloud-costs",
86
92
  label: C("adaptercloud.nav.finops", "FinOps"),
87
93
  path: w(x, "costs"),
88
- icon: /* @__PURE__ */ g(u, { size: 20 }),
94
+ icon: /* @__PURE__ */ v(f, { size: 20 }),
89
95
  order: 31,
90
96
  group: "operations"
91
97
  }
92
98
  ]);
93
99
  }, [
94
- y,
100
+ a,
95
101
  x,
96
102
  C
97
- ]), r(() => {
98
- if (b) return b([{
103
+ ]), i(() => {
104
+ if (o) return o([{
99
105
  id: "adaptercloud-status",
100
106
  label: C("adaptercloud.footer.ready", "AdapterCloud Ready"),
101
107
  type: "status",
102
108
  order: 10,
103
109
  section: "left"
104
110
  }]);
105
- }, [b, C]), /* @__PURE__ */ g(a, {
106
- client: v,
107
- children: /* @__PURE__ */ g(_, {
111
+ }, [o, C]), /* @__PURE__ */ v(s, {
112
+ client: b,
113
+ children: /* @__PURE__ */ v(y, {
108
114
  workspaceId: null,
109
115
  gateway: "global",
110
116
  defaultEnabled: !0,
111
- children: /* @__PURE__ */ g(e, {
112
- ...i,
113
- children: /* @__PURE__ */ g(t, {})
117
+ children: /* @__PURE__ */ v(e, {
118
+ ...t,
119
+ children: /* @__PURE__ */ v(n, {})
114
120
  })
115
121
  })
116
122
  });
117
123
  };
118
124
  //#endregion
119
- export { y as AdapterCloudRoot };
125
+ export { x as AdapterCloudRoot };
120
126
 
121
127
  //# sourceMappingURL=AdapterCloudRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdapterCloudRoot.js","names":[],"sources":["../../src/adaptercloud/AdapterCloudRoot.tsx"],"sourcesContent":["/**\n * AdapterCloud Root Component\n * @module adaptercloud\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 Boxes,\n Cable,\n Server,\n ScrollText,\n ShieldAlert,\n GitCompareArrows,\n Activity,\n DollarSign,\n} from 'lucide-react';\nimport { AdapterCloudProvider } from './context/AdapterCloudContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AdapterCloudRoutes } from './AdapterCloudRoutes';\nimport type { AdapterCloudRootProps, 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 AdapterCloudRoot: FC<AdapterCloudRootProps> = (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: 'adaptercloud-overview',\n label: t('adaptercloud.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 1,\n group: 'main',\n },\n\n // Fabric\n {\n id: 'adaptercloud-adapters',\n label: t('adaptercloud.nav.adapters', 'Adapters'),\n path: joinPath(basePath, 'adapters'),\n icon: <Boxes size={20} />,\n order: 10,\n group: 'fabric',\n },\n {\n id: 'adaptercloud-connections',\n label: t('adaptercloud.nav.connections', 'Connections'),\n path: joinPath(basePath, 'connections'),\n icon: <Cable size={20} />,\n order: 11,\n group: 'fabric',\n },\n {\n id: 'adaptercloud-resources',\n label: t('adaptercloud.nav.resources', 'Resources'),\n path: joinPath(basePath, 'resources'),\n icon: <Server size={20} />,\n order: 12,\n group: 'fabric',\n },\n\n // Governance\n {\n id: 'adaptercloud-policies',\n label: t('adaptercloud.nav.policies', 'Policies'),\n path: joinPath(basePath, 'policies'),\n icon: <ScrollText size={20} />,\n order: 20,\n group: 'governance',\n },\n {\n id: 'adaptercloud-violations',\n label: t('adaptercloud.nav.violations', 'Violations'),\n path: joinPath(basePath, 'violations'),\n icon: <ShieldAlert size={20} />,\n order: 21,\n group: 'governance',\n },\n {\n id: 'adaptercloud-drift',\n label: t('adaptercloud.nav.drift', 'Drift'),\n path: joinPath(basePath, 'drift'),\n icon: <GitCompareArrows size={20} />,\n order: 22,\n group: 'governance',\n },\n\n // Operations\n {\n id: 'adaptercloud-sync-runs',\n label: t('adaptercloud.nav.syncRuns', 'Sync Runs'),\n path: joinPath(basePath, 'sync-runs'),\n icon: <Activity size={20} />,\n order: 30,\n group: 'operations',\n },\n {\n id: 'adaptercloud-costs',\n label: t('adaptercloud.nav.finops', 'FinOps'),\n path: joinPath(basePath, 'costs'),\n icon: <DollarSign size={20} />,\n order: 31,\n group: 'operations',\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: 'adaptercloud-status',\n label: t('adaptercloud.footer.ready', 'AdapterCloud 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 <AdapterCloudProvider {...props}>\n <AdapterCloudRoutes />\n </AdapterCloudProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;AA0BA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,MAAS;CACpB,OAAO;CACR,EACF,EACF,CAAC,EAEW,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,MAAc,GAAS,EAC5B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAU,CACZ,EAGK,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAgHtD,QA3G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AAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,2BAA2B,SAAS;IAC7C,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GACF,CAEyC;IAEzC;EAAC;EAAkB;EAAU;EAAE,CAAC,EAGnC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,6BAA6B,qBAAqB;GAC3D,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAsB,GAAI;cACxB,kBAAC,GAAD,EAAsB,CAAA;IACD,CAAA;GACH,CAAA;EACF,CAAA"}
1
+ {"version":3,"file":"AdapterCloudRoot.js","names":[],"sources":["../../src/adaptercloud/AdapterCloudRoot.tsx"],"sourcesContent":["/**\n * AdapterCloud Root Component\n * @module adaptercloud\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { MutationCache, QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n Boxes,\n Cable,\n Server,\n ScrollText,\n ShieldAlert,\n GitCompareArrows,\n Activity,\n DollarSign,\n} from 'lucide-react';\nimport { AdapterCloudProvider } from './context/AdapterCloudContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AdapterCloudRoutes } from './AdapterCloudRoutes';\nimport { notify } from './lib/toast';\nimport type { AdapterCloudRootProps, NavItem } from './types';\n\n// Create a query client for this microfrontend. A shared MutationCache surfaces\n// every failed write as a toast, so no mutation can fail silently with only\n// inline error state (the <Toaster> is owned by the host app shell).\nconst queryClient = new QueryClient({\n mutationCache: new MutationCache({\n onError: (error) => {\n notify.error(\n 'Something went wrong',\n error instanceof Error ? error.message : 'Please try again.'\n );\n },\n }),\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const AdapterCloudRoot: FC<AdapterCloudRootProps> = (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: 'adaptercloud-overview',\n label: t('adaptercloud.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 1,\n group: 'main',\n },\n\n // Fabric\n {\n id: 'adaptercloud-adapters',\n label: t('adaptercloud.nav.adapters', 'Adapters'),\n path: joinPath(basePath, 'adapters'),\n icon: <Boxes size={20} />,\n order: 10,\n group: 'fabric',\n },\n {\n id: 'adaptercloud-connections',\n label: t('adaptercloud.nav.connections', 'Connections'),\n path: joinPath(basePath, 'connections'),\n icon: <Cable size={20} />,\n order: 11,\n group: 'fabric',\n },\n {\n id: 'adaptercloud-resources',\n label: t('adaptercloud.nav.resources', 'Resources'),\n path: joinPath(basePath, 'resources'),\n icon: <Server size={20} />,\n order: 12,\n group: 'fabric',\n },\n\n // Governance\n {\n id: 'adaptercloud-policies',\n label: t('adaptercloud.nav.policies', 'Policies'),\n path: joinPath(basePath, 'policies'),\n icon: <ScrollText size={20} />,\n order: 20,\n group: 'governance',\n },\n {\n id: 'adaptercloud-violations',\n label: t('adaptercloud.nav.violations', 'Violations'),\n path: joinPath(basePath, 'violations'),\n icon: <ShieldAlert size={20} />,\n order: 21,\n group: 'governance',\n },\n {\n id: 'adaptercloud-drift',\n label: t('adaptercloud.nav.drift', 'Drift'),\n path: joinPath(basePath, 'drift'),\n icon: <GitCompareArrows size={20} />,\n order: 22,\n group: 'governance',\n },\n\n // Operations\n {\n id: 'adaptercloud-sync-runs',\n label: t('adaptercloud.nav.syncRuns', 'Sync Runs'),\n path: joinPath(basePath, 'sync-runs'),\n icon: <Activity size={20} />,\n order: 30,\n group: 'operations',\n },\n {\n id: 'adaptercloud-costs',\n label: t('adaptercloud.nav.finops', 'FinOps'),\n path: joinPath(basePath, 'costs'),\n icon: <DollarSign size={20} />,\n order: 31,\n group: 'operations',\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: 'adaptercloud-status',\n label: t('adaptercloud.footer.ready', 'AdapterCloud 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 <AdapterCloudProvider {...props}>\n <AdapterCloudRoutes />\n </AdapterCloudProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AA6BA,IAAM,IAAc,IAAI,EAAY;CAClC,eAAe,IAAI,EAAc,EAC/B,UAAU,MAAU;AAClB,IAAO,MACL,wBACA,aAAiB,QAAQ,EAAM,UAAU,oBAC1C;IAEJ,CAAC;CACF,gBAAgB,EACd,SAAS;EACP,WAAW,MAAS;EACpB,OAAO;EACR,EACF;CACF,CAAC,EAEW,KAA+C,MAAU;CACpE,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MAAM,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA;IAC/B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,0BAA0B,QAAQ;IAC3C,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAkB,MAAM,IAAM,CAAA;IACpC,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ,OAAO,EAAE,6BAA6B,YAAY;IAClD,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,2BAA2B,SAAS;IAC7C,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GACF,CAEyC;IAEzC;EAAC;EAAkB;EAAU;EAAE,CAAC,EAGnC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,6BAA6B,qBAAqB;GAC3D,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAsB,GAAI;cACxB,kBAAC,GAAD,EAAsB,CAAA;IACD,CAAA;GACH,CAAA;EACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdapterCloudContext.js","names":[],"sources":["../../../src/adaptercloud/context/AdapterCloudContext.tsx"],"sourcesContent":["/**\n * AdapterCloud Context Provider\n * @module adaptercloud/context\n *\n * Provides the host-passed integration props (basePath / currentUser /\n * apiGatewayUrl / tenantId / workspaceId / authToken) plus navigation helpers to\n * the AdapterCloud pages. Standalone mode wraps a MemoryRouter; integrated mode\n * uses the shell-provided `navigate`.\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 { AdapterCloudRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface AdapterCloudContextValue\n extends Omit<AdapterCloudRootProps, 'registerNavItems' | 'registerFooterItems' | 'navigate'> {\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 AdapterCloudContext = createContext<AdapterCloudContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useAdapterCloud(): AdapterCloudContextValue {\n const context = useContext(AdapterCloudContext);\n if (!context) {\n throw new Error('useAdapterCloud must be used within a AdapterCloudProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<AdapterCloudRootProps, '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<AdapterCloudContextValue>(\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 <AdapterCloudContext.Provider value={contextValue}>{children}</AdapterCloudContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({ children, basePath, navigate, currentUser, tenantId, workspaceId, apiGatewayUrl, authToken }) => {\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<AdapterCloudContextValue>(\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 <AdapterCloudContext.Provider value={contextValue}>{children}</AdapterCloudContext.Provider>\n );\n};\n\nexport const AdapterCloudProvider: FC<PropsWithChildren<AdapterCloudRootProps>> = (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 </IntegratedPro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iB;EAAU,cAAc;EACnE;EACuB,CAAA,GAZxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
1
+ {"version":3,"file":"AdapterCloudContext.js","names":[],"sources":["../../../src/adaptercloud/context/AdapterCloudContext.tsx"],"sourcesContent":["/**\n * AdapterCloud Context Provider\n * @module adaptercloud/context\n *\n * Provides the host-passed integration props (basePath / currentUser /\n * apiGatewayUrl / tenantId / workspaceId / authToken) plus navigation helpers to\n * the AdapterCloud pages. Standalone mode wraps a MemoryRouter; integrated mode\n * uses the shell-provided `navigate`.\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 { AdapterCloudRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface AdapterCloudContextValue extends Omit<\n AdapterCloudRootProps,\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 AdapterCloudContext = createContext<AdapterCloudContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useAdapterCloud(): AdapterCloudContextValue {\n const context = useContext(AdapterCloudContext);\n if (!context) {\n throw new Error('useAdapterCloud must be used within a AdapterCloudProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<AdapterCloudRootProps, '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<AdapterCloudContextValue>(\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 <AdapterCloudContext.Provider value={contextValue}>{children}</AdapterCloudContext.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<AdapterCloudContextValue>(\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 <AdapterCloudContext.Provider value={contextValue}>{children}</AdapterCloudContext.Provider>\n );\n};\n\nexport const AdapterCloudProvider: FC<PropsWithChildren<AdapterCloudRootProps>> = (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":";;;;;AAiCA,IAAM,IAAsB,EAA+C,KAAK;AAMhF,SAAgB,IAA4C;CAC1D,IAAM,IAAU,EAAW,EAAoB;AAC/C,KAAI,CAAC,EACH,OAAU,MAAM,6DAA6D;AAE/E,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAoB,UAArB;EAA8B,OAAO;EAAe;EAAwC,CAAA;GAK1F,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EA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