@plumile/backoffice-react 0.1.199 → 0.1.201

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.
Files changed (66) hide show
  1. package/README.md +5 -0
  2. package/lib/esm/auth/backofficeAuthHeaders.js +18 -0
  3. package/lib/esm/auth/backofficeAuthHeaders.js.map +1 -0
  4. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
  5. package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
  6. package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
  7. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +1 -1
  8. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
  9. package/lib/esm/index.js +76 -75
  10. package/lib/esm/pages/BackofficeAcceptInvitationPage.js +7 -7
  11. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +1 -1
  12. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
  13. package/lib/esm/pages/BackofficeEntityDetailPage.helpers.js.map +1 -1
  14. package/lib/esm/pages/BackofficeEntityDetailPage.js +169 -169
  15. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  16. package/lib/esm/pages/BackofficeEntityListDataPage.js +1 -1
  17. package/lib/esm/pages/BackofficeEntityListDataPage.js.map +1 -1
  18. package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
  19. package/lib/esm/pages/BackofficeLayoutPage.js +41 -41
  20. package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
  21. package/lib/esm/pages/BackofficeLoginPage.js +11 -11
  22. package/lib/esm/pages/BackofficePasswordResetCompletePage.js +14 -14
  23. package/lib/esm/pages/BackofficeVerifyEmailPage.js +14 -14
  24. package/lib/esm/provider/BackofficeProvider.js +78 -77
  25. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  26. package/lib/esm/provider/entityRegistry.js +39 -36
  27. package/lib/esm/provider/entityRegistry.js.map +1 -1
  28. package/lib/esm/provider/useBackofficeAuthRouteGate.js +39 -0
  29. package/lib/esm/provider/useBackofficeAuthRouteGate.js.map +1 -0
  30. package/lib/esm/relay/createInlineReader.js.map +1 -1
  31. package/lib/esm/relay/envHelpers.js +30 -22
  32. package/lib/esm/relay/envHelpers.js.map +1 -1
  33. package/lib/esm/relay/typedRelayHooks.js +11 -2
  34. package/lib/esm/relay/typedRelayHooks.js.map +1 -1
  35. package/lib/esm/router/backofficeAuthPaths.js +11 -2
  36. package/lib/esm/router/backofficeAuthPaths.js.map +1 -1
  37. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  38. package/lib/types/auth/backofficeAuthHeaders.d.ts +5 -0
  39. package/lib/types/auth/backofficeAuthHeaders.d.ts.map +1 -0
  40. package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts +2 -2
  41. package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
  42. package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
  43. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
  44. package/lib/types/index.d.ts +2 -0
  45. package/lib/types/index.d.ts.map +1 -1
  46. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  47. package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts +3 -3
  48. package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts.map +1 -1
  49. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +2 -2
  50. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
  51. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  52. package/lib/types/provider/entityRegistry.d.ts.map +1 -1
  53. package/lib/types/provider/types.d.ts +1 -1
  54. package/lib/types/provider/types.d.ts.map +1 -1
  55. package/lib/types/provider/useBackofficeAuthRouteGate.d.ts +2 -0
  56. package/lib/types/provider/useBackofficeAuthRouteGate.d.ts.map +1 -0
  57. package/lib/types/relay/createInlineReader.d.ts +4 -1
  58. package/lib/types/relay/createInlineReader.d.ts.map +1 -1
  59. package/lib/types/relay/envHelpers.d.ts.map +1 -1
  60. package/lib/types/relay/typedRelayHooks.d.ts +15 -5
  61. package/lib/types/relay/typedRelayHooks.d.ts.map +1 -1
  62. package/lib/types/router/backofficeAuthPaths.d.ts +1 -0
  63. package/lib/types/router/backofficeAuthPaths.d.ts.map +1 -1
  64. package/lib/types/router/createBackofficeRoutes.d.ts +1 -1
  65. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  66. package/package.json +13 -13
@@ -1,17 +1,17 @@
1
- import { LoginFlow as e } from "../auth/login/LoginFlow.js";
2
- import { synchronizeAuthStatusQuery as t } from "../auth/login/synchronizeAuthStatusQuery.js";
3
- import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
4
- import { useRelayEnvironment as r } from "../relay/useRelayEnvironment.js";
5
- import { useBackofficeAuth as i } from "../hooks/useBackofficeAuth.js";
6
- import { useBackofficeAuthLoginConfig as a } from "../provider/useBackofficeLazyValue.js";
7
- import { getBackofficePasswordResetPath as o } from "../router/backofficeAuthPaths.js";
1
+ import { getBackofficePasswordResetPath as e } from "../router/backofficeAuthPaths.js";
2
+ import { LoginFlow as t } from "../auth/login/LoginFlow.js";
3
+ import { synchronizeAuthStatusQuery as n } from "../auth/login/synchronizeAuthStatusQuery.js";
4
+ import { useBackofficeConfig as r } from "../provider/BackofficeConfigContext.js";
5
+ import { useRelayEnvironment as i } from "../relay/useRelayEnvironment.js";
6
+ import { useBackofficeAuth as a } from "../hooks/useBackofficeAuth.js";
7
+ import { useBackofficeAuthLoginConfig as o } from "../provider/useBackofficeLazyValue.js";
8
8
  import { useCallback as s, useContext as c, useRef as l } from "react";
9
9
  import { jsx as u } from "react/jsx-runtime";
10
10
  import * as d from "react-relay";
11
11
  import f from "@plumile/router/routing/RoutingContext.js";
12
12
  //#region src/pages/BackofficeLoginPage.tsx
13
13
  var { usePreloadedQuery: p } = d, m = ({ prepared: d }) => {
14
- let m = c(f), { auth: h, basePath: g } = n(), _ = a(), v = i(), y = r(), b = l(!1), x = p(_.loginQuery, d.query).oidcProviders ?? [], S = s(() => {
14
+ let m = c(f), { auth: h, basePath: g } = r(), _ = o(), v = a(), y = i(), b = l(!1), x = p(_.loginQuery, d.query).oidcProviders ?? [], S = s(() => {
15
15
  b.current || (b.current = !0, (async () => {
16
16
  try {
17
17
  let e = await h.session.load();
@@ -19,7 +19,7 @@ var { usePreloadedQuery: p } = d, m = ({ prepared: d }) => {
19
19
  m?.history.push({ pathname: g });
20
20
  return;
21
21
  }
22
- if (await h.lifecycle?.onLoginSuccess?.(), !await t(y, e.authStatusQuery)) return;
22
+ if (await h.lifecycle?.onLoginSuccess?.(), !await n(y, e.authStatusQuery)) return;
23
23
  m?.history.push({ pathname: g });
24
24
  } catch {} finally {
25
25
  b.current = !1;
@@ -32,9 +32,9 @@ var { usePreloadedQuery: p } = d, m = ({ prepared: d }) => {
32
32
  y,
33
33
  m?.history
34
34
  ]), C = s(() => {
35
- m?.history.push({ pathname: o(g) });
35
+ m?.history.push({ pathname: e(g) });
36
36
  }, [g, m?.history]);
37
- return /* @__PURE__ */ u(e, {
37
+ return /* @__PURE__ */ u(t, {
38
38
  auth: v,
39
39
  oidcProviders: x,
40
40
  onLoginSuccess: S,
@@ -1,25 +1,25 @@
1
- import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
2
- import { PasswordResetCompleteScreen as t } from "../auth/pages/PasswordResetCompleteScreen.js";
3
- import { requireField as n, resolveMutationOutcome as r } from "../relay/mutationResult.js";
4
- import { useBackofficeConfig as i } from "../provider/BackofficeConfigContext.js";
5
- import { useBackofficeAuthPasswordResetCompleteConfig as a } from "../provider/useBackofficeLazyValue.js";
6
- import { getBackofficeLoginPath as o } from "../router/backofficeAuthPaths.js";
1
+ import { getBackofficeLoginPath as e } from "../router/backofficeAuthPaths.js";
2
+ import { useBackofficeReactTranslation as t } from "../i18n/useBackofficeReactTranslation.js";
3
+ import { PasswordResetCompleteScreen as n } from "../auth/pages/PasswordResetCompleteScreen.js";
4
+ import { requireField as r, resolveMutationOutcome as i } from "../relay/mutationResult.js";
5
+ import { useBackofficeConfig as a } from "../provider/BackofficeConfigContext.js";
6
+ import { useBackofficeAuthPasswordResetCompleteConfig as o } from "../provider/useBackofficeLazyValue.js";
7
7
  import { useCallback as s, useContext as c } from "react";
8
8
  import { jsx as l } from "react/jsx-runtime";
9
9
  import * as u from "react-relay";
10
10
  import d from "@plumile/router/routing/RoutingContext.js";
11
11
  //#region src/pages/BackofficePasswordResetCompletePage.tsx
12
12
  var { useMutation: f } = u, p = () => {
13
- let u = c(d), { basePath: p } = i(), m = a(), { t: h } = e(), [g] = f(m.completePasswordResetMutation), _ = s(() => {
14
- u?.history.push({ pathname: o(p) });
13
+ let u = c(d), { basePath: p } = a(), m = o(), { t: h } = t(), [g] = f(m.completePasswordResetMutation), _ = s(() => {
14
+ u?.history.push({ pathname: e(p) });
15
15
  }, [p, u?.history]), v = s(async (e) => {
16
- let t = h("auth.passwordResetComplete.errors.invalid"), i = t;
16
+ let t = h("auth.passwordResetComplete.errors.invalid"), n = t;
17
17
  return new Promise((a, o) => {
18
18
  g({
19
19
  variables: { input: e },
20
20
  onCompleted: (e) => {
21
- let s = r(e.completePasswordReset ?? null, {
22
- defaultErrorMessage: i,
21
+ let s = i(e.completePasswordReset ?? null, {
22
+ defaultErrorMessage: n,
23
23
  mapReason: (e) => {
24
24
  switch (e) {
25
25
  case "INVALID_TOKEN": return t;
@@ -34,7 +34,7 @@ var { useMutation: f } = u, p = () => {
34
34
  o(Error(s.message));
35
35
  return;
36
36
  }
37
- let c = n(s.payload.success ?? null, i);
37
+ let c = r(s.payload.success ?? null, n);
38
38
  if (!c.ok) {
39
39
  o(Error(c.message));
40
40
  return;
@@ -42,12 +42,12 @@ var { useMutation: f } = u, p = () => {
42
42
  a(c.value);
43
43
  },
44
44
  onError: () => {
45
- o(Error(i));
45
+ o(Error(n));
46
46
  }
47
47
  });
48
48
  });
49
49
  }, [g, h]);
50
- return /* @__PURE__ */ l(t, {
50
+ return /* @__PURE__ */ l(n, {
51
51
  onBackToLogin: _,
52
52
  onCompletePasswordReset: v
53
53
  });
@@ -1,25 +1,25 @@
1
- import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
2
- import { VerifyEmailScreen as t } from "../auth/pages/VerifyEmailScreen.js";
3
- import { requireField as n, resolveMutationOutcome as r } from "../relay/mutationResult.js";
4
- import { useBackofficeConfig as i } from "../provider/BackofficeConfigContext.js";
5
- import { useBackofficeAuthVerifyEmailConfig as a } from "../provider/useBackofficeLazyValue.js";
6
- import { getBackofficeLoginPath as o } from "../router/backofficeAuthPaths.js";
1
+ import { getBackofficeLoginPath as e } from "../router/backofficeAuthPaths.js";
2
+ import { useBackofficeReactTranslation as t } from "../i18n/useBackofficeReactTranslation.js";
3
+ import { VerifyEmailScreen as n } from "../auth/pages/VerifyEmailScreen.js";
4
+ import { requireField as r, resolveMutationOutcome as i } from "../relay/mutationResult.js";
5
+ import { useBackofficeConfig as a } from "../provider/BackofficeConfigContext.js";
6
+ import { useBackofficeAuthVerifyEmailConfig as o } from "../provider/useBackofficeLazyValue.js";
7
7
  import { useCallback as s, useContext as c } from "react";
8
8
  import { jsx as l } from "react/jsx-runtime";
9
9
  import * as u from "react-relay";
10
10
  import d from "@plumile/router/routing/RoutingContext.js";
11
11
  //#region src/pages/BackofficeVerifyEmailPage.tsx
12
12
  var { useMutation: f } = u, p = () => {
13
- let u = c(d), { basePath: p } = i(), m = a(), { t: h } = e(), [g] = f(m.verifyEmailMutation), _ = s(() => {
14
- u?.history.push({ pathname: o(p) });
13
+ let u = c(d), { basePath: p } = a(), m = o(), { t: h } = t(), [g] = f(m.verifyEmailMutation), _ = s(() => {
14
+ u?.history.push({ pathname: e(p) });
15
15
  }, [p, u?.history]), v = s(async (e) => {
16
- let t = h("auth.verifyEmail.errors.invalid"), i = t;
16
+ let t = h("auth.verifyEmail.errors.invalid"), n = t;
17
17
  return new Promise((a, o) => {
18
18
  g({
19
19
  variables: { input: e },
20
20
  onCompleted: (e) => {
21
- let s = r(e.verifyEmail ?? null, {
22
- defaultErrorMessage: i,
21
+ let s = i(e.verifyEmail ?? null, {
22
+ defaultErrorMessage: n,
23
23
  mapReason: (e) => {
24
24
  switch (e) {
25
25
  case "INVALID_TOKEN": return t;
@@ -34,7 +34,7 @@ var { useMutation: f } = u, p = () => {
34
34
  o(Error(s.message));
35
35
  return;
36
36
  }
37
- let c = n(s.payload.success ?? null, i);
37
+ let c = r(s.payload.success ?? null, n);
38
38
  if (!c.ok) {
39
39
  o(Error(c.message));
40
40
  return;
@@ -42,12 +42,12 @@ var { useMutation: f } = u, p = () => {
42
42
  a(c.value);
43
43
  },
44
44
  onError: () => {
45
- o(Error(i));
45
+ o(Error(n));
46
46
  }
47
47
  });
48
48
  });
49
49
  }, [g, h]);
50
- return /* @__PURE__ */ l(t, {
50
+ return /* @__PURE__ */ l(n, {
51
51
  onBackToLogin: _,
52
52
  onVerifyEmail: v
53
53
  });
@@ -7,31 +7,32 @@ import { withBackofficeReactI18nResources as o } from "../i18n/resources.js";
7
7
  import { createBackofficeRoutes as s } from "../router/createBackofficeRoutes.js";
8
8
  import { createBackofficeEntityRegistry as c } from "./entityRegistry.js";
9
9
  import { BackofficeListUiStateProvider as l } from "./BackofficeListUiStateContext.js";
10
- import { StrictMode as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
11
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
- import { I18nextProvider as _ } from "react-i18next";
13
- import v from "@plumile/router/routing/RoutingContext.js";
14
- import { RelayProvider as y, configureRelayEnvironment as b, useRelayOperationActivity as x } from "@plumile/relay";
15
- import { createInstance as S } from "i18next";
16
- import C from "@plumile/router/routing/createRouter.js";
17
- import w from "@plumile/router/routing/RouterRenderer.js";
18
- import { BackofficeThemeProvider as T } from "@plumile/ui/admin/theme/BackofficeThemeProvider.js";
19
- import { RoutePendingBar as E } from "@plumile/ui/components/routing/RoutePendingBar.js";
10
+ import { useBackofficeAuthRouteGate as u } from "./useBackofficeAuthRouteGate.js";
11
+ import { StrictMode as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
12
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
+ import { I18nextProvider as v } from "react-i18next";
14
+ import y from "@plumile/router/routing/RoutingContext.js";
15
+ import { RelayProvider as b, configureRelayEnvironment as x, useRelayOperationActivity as S } from "@plumile/relay";
16
+ import { createInstance as C } from "i18next";
17
+ import w from "@plumile/router/routing/createRouter.js";
18
+ import T from "@plumile/router/routing/RouterRenderer.js";
19
+ import { BackofficeThemeProvider as E } from "@plumile/ui/admin/theme/BackofficeThemeProvider.js";
20
+ import { RoutePendingBar as D } from "@plumile/ui/components/routing/RoutePendingBar.js";
20
21
  //#region src/provider/BackofficeProvider.tsx
21
- var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, O = (e, t) => {
22
- let n = D(t), r = D(e);
22
+ var O = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, k = (e, t) => {
23
+ let n = O(t), r = O(e);
23
24
  return r === "/" || n === r || n.startsWith(`${r}/`) ? n : n === "/" ? r : `${r}${n}`;
24
- }, k = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
25
+ }, A = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
25
26
  ...n,
26
27
  routes: {
27
- list: O(t, n.routes.list),
28
- detail: (e) => O(t, n.routes.detail(e)),
29
- detailPage: (e, r) => O(t, n.routes.detailPage(e, r))
28
+ list: k(t, n.routes.list),
29
+ detail: (e) => k(t, n.routes.detail(e)),
30
+ detailPage: (e, r) => k(t, n.routes.detailPage(e, r))
30
31
  }
31
- }])), A = ({ routes: e, context: t, instrumentations: n }) => {
32
- let [r, i] = m(null), a = p(null);
33
- return d(() => {
34
- let r = C(e, {
32
+ }])), j = ({ routes: e, context: t, instrumentations: n }) => {
33
+ let [r, i] = h(null), a = m(null);
34
+ return f(() => {
35
+ let r = w(e, {
35
36
  context: t,
36
37
  instrumentations: n
37
38
  });
@@ -43,58 +44,58 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
43
44
  n,
44
45
  e
45
46
  ]), r;
46
- }, j = ({ routes: e, instrumentations: t }) => {
47
- let r = i(), a = x(), o = A({
47
+ }, M = ({ routes: e, instrumentations: t }) => {
48
+ let r = i(), a = S(), o = j({
48
49
  routes: e,
49
- context: f(() => ({ relayEnvironment: r }), [r]),
50
+ context: p(() => ({ relayEnvironment: r }), [r]),
50
51
  instrumentations: t
51
52
  });
52
- return o == null ? /* @__PURE__ */ h(n, {}) : /* @__PURE__ */ h(v.Provider, {
53
+ return o == null ? /* @__PURE__ */ g(n, {}) : /* @__PURE__ */ g(y.Provider, {
53
54
  value: o.context,
54
- children: /* @__PURE__ */ h(w, {
55
+ children: /* @__PURE__ */ g(T, {
55
56
  enableTransition: !0,
56
57
  externalPending: a.pendingCount > 0,
57
- fallback: /* @__PURE__ */ h(n, {}),
58
- pending: /* @__PURE__ */ h(E, {})
58
+ fallback: /* @__PURE__ */ g(n, {}),
59
+ pending: /* @__PURE__ */ g(D, {})
59
60
  })
60
61
  });
61
- }, M = (n) => {
62
- let i = D(n.basePath ?? "/"), p = f(() => k(n.entityManifest, i), [i, n.entityManifest]), v = f(() => c(p, { basePath: i }), [i, p]), x = n.graphql, C = f(() => t(n.dashboards), [n.dashboards]);
63
- d(() => {
64
- let e = x.httpUrl ?? x.endpoint, t = x.wsUrl ?? x.wsEndpoint;
65
- b({
62
+ }, N = (n) => {
63
+ let i = O(n.basePath ?? "/"), m = u(i), y = p(() => A(n.entityManifest, i), [i, n.entityManifest]), S = p(() => c(y, { basePath: i }), [i, y]), w = n.graphql, T = p(() => t(n.dashboards), [n.dashboards]);
64
+ f(() => {
65
+ let e = w.httpUrl ?? w.endpoint, t = w.wsUrl ?? w.wsEndpoint;
66
+ x({
66
67
  httpUrl: e,
67
68
  wsUrl: t,
68
- getDataId: x.getDataId,
69
- logEvents: x.logEvents,
70
- getAuthHeaders: x.getAuthHeaders
69
+ getDataId: w.getDataId,
70
+ logEvents: w.logEvents,
71
+ getAuthHeaders: w.getAuthHeaders
71
72
  });
72
73
  }, [
73
- x.endpoint,
74
- x.getAuthHeaders,
75
- x.getDataId,
76
- x.httpUrl,
77
- x.logEvents,
78
- x.wsEndpoint,
79
- x.wsUrl
74
+ w.endpoint,
75
+ w.getAuthHeaders,
76
+ w.getDataId,
77
+ w.httpUrl,
78
+ w.logEvents,
79
+ w.wsEndpoint,
80
+ w.wsUrl
80
81
  ]);
81
- let w = f(() => o(n.i18n?.resources ?? {}), [n.i18n?.resources]), E = f(() => n.i18n?.instance ?? S(), [n.i18n?.instance]), [O, A] = m(E.isInitialized);
82
- d(() => {
82
+ let D = p(() => o(n.i18n?.resources ?? {}), [n.i18n?.resources]), k = p(() => n.i18n?.instance ?? C(), [n.i18n?.instance]), [j, N] = h(k.isInitialized);
83
+ f(() => {
83
84
  let e = !0, t = () => {
84
- e && A(!0);
85
+ e && N(!0);
85
86
  };
86
- if (E.on("initialized", t), E.isInitialized) return t(), () => {
87
- e = !1, E.off("initialized", t);
87
+ if (k.on("initialized", t), k.isInitialized) return t(), () => {
88
+ e = !1, k.off("initialized", t);
88
89
  };
89
90
  let r = globalThis.setTimeout(() => {
90
- E.isInitialized && t();
91
+ k.isInitialized && t();
91
92
  }, 0), i = n.i18n?.initOptions ?? {}, o = i.defaultNS ?? "translations", s = i.ns ?? [
92
93
  "backofficeReact",
93
94
  "translations",
94
95
  "ui"
95
96
  ];
96
97
  return a({
97
- resources: w,
98
+ resources: D,
98
99
  lng: n.i18n?.lng,
99
100
  fallbackLng: n.i18n?.fallbackLng,
100
101
  initOptions: {
@@ -106,75 +107,75 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
106
107
  ...i.react
107
108
  }
108
109
  },
109
- instance: E,
110
+ instance: k,
110
111
  useLanguageDetector: n.i18n?.useLanguageDetector,
111
112
  detection: n.i18n?.detection
112
113
  }).then(t).catch((e) => {
113
114
  t(), console.error(e);
114
115
  }), () => {
115
- e = !1, globalThis.clearTimeout(r), E.off("initialized", t);
116
+ e = !1, globalThis.clearTimeout(r), k.off("initialized", t);
116
117
  };
117
118
  }, [
118
- E,
119
- w,
119
+ k,
120
+ D,
120
121
  n.i18n?.initOptions,
121
122
  n.i18n?.detection,
122
123
  n.i18n?.fallbackLng,
123
124
  n.i18n?.lng,
124
125
  n.i18n?.useLanguageDetector
125
126
  ]);
126
- let M = f(() => ({
127
+ let P = p(() => ({
127
128
  basePath: i,
128
- entities: p,
129
- entityManifest: p,
130
- entityRegistry: v,
129
+ entities: y,
130
+ entityManifest: y,
131
+ entityRegistry: S,
131
132
  filterColumnAliases: n.filterColumnAliases,
132
133
  sidebar: n.sidebar,
133
134
  dashboard: n.dashboard,
134
- dashboards: C,
135
+ dashboards: T,
135
136
  auth: n.auth,
136
137
  graphql: n.graphql
137
138
  }), [
138
139
  i,
139
140
  n.auth,
140
141
  n.dashboard,
141
- C,
142
- p,
143
- v,
142
+ T,
143
+ y,
144
+ S,
144
145
  n.filterColumnAliases,
145
146
  n.graphql,
146
147
  n.sidebar
147
- ]), N = f(() => s({
148
+ ]), F = p(() => s({
148
149
  basePath: i,
149
- entityManifest: p,
150
- entityRegistry: v,
150
+ entityManifest: y,
151
+ entityRegistry: S,
151
152
  sidebar: n.sidebar,
152
153
  auth: n.auth,
153
154
  dashboard: n.dashboard,
154
- dashboards: C,
155
+ dashboards: T,
155
156
  toolsOperationPage: n.toolsOperationPage
156
157
  }), [
157
158
  i,
158
- p,
159
- v,
159
+ y,
160
+ S,
160
161
  n.auth,
161
162
  n.dashboard,
162
- C,
163
+ T,
163
164
  n.toolsOperationPage,
164
165
  n.sidebar
165
- ]), P = /* @__PURE__ */ h(r, { label: "Loading..." });
166
- return O && (P = /* @__PURE__ */ h(T, { children: /* @__PURE__ */ h(y, { children: /* @__PURE__ */ g(e, {
167
- value: M,
168
- children: [n.overlay, /* @__PURE__ */ h(l, { children: /* @__PURE__ */ h(j, {
169
- routes: N,
166
+ ]), I = /* @__PURE__ */ g(r, { label: "Loading..." });
167
+ return j && m && (I = /* @__PURE__ */ g(E, { children: /* @__PURE__ */ g(b, { children: /* @__PURE__ */ _(e, {
168
+ value: P,
169
+ children: [n.overlay, /* @__PURE__ */ g(l, { children: /* @__PURE__ */ g(M, {
170
+ routes: F,
170
171
  instrumentations: n.instrumentations
171
172
  }) })]
172
- }) }) })), /* @__PURE__ */ h(u, { children: /* @__PURE__ */ h(_, {
173
- i18n: E,
174
- children: P
173
+ }) }) })), /* @__PURE__ */ g(d, { children: /* @__PURE__ */ g(v, {
174
+ i18n: k,
175
+ children: I
175
176
  }) });
176
177
  };
177
178
  //#endregion
178
- export { M as BackofficeProvider, M as default };
179
+ export { N as BackofficeProvider, N as default };
179
180
 
180
181
  //# sourceMappingURL=BackofficeProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackofficeProvider.js","names":[],"sources":["../../../src/provider/BackofficeProvider.tsx"],"sourcesContent":["import {\n StrictMode,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ContextType,\n type JSX,\n} from 'react';\nimport { createInstance } from 'i18next';\nimport { I18nextProvider } from 'react-i18next';\nimport createRouter from '@plumile/router/routing/createRouter.js';\nimport RouterRenderer from '@plumile/router/routing/RouterRenderer.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { BackofficeThemeProvider } from '@plumile/ui/admin/theme/BackofficeThemeProvider.js';\nimport { RoutePendingBar } from '@plumile/ui/components/routing/RoutePendingBar.js';\n\nimport { type BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\nimport {\n RelayProvider,\n configureRelayEnvironment,\n useRelayOperationActivity,\n} from '@plumile/relay';\n\nimport { createI18nInstance } from '../i18n/createI18nInstance.js';\nimport { withBackofficeReactI18nResources } from '../i18n/resources.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { BackofficeConfigProvider } from './BackofficeConfigContext.js';\nimport {\n createBackofficeRoutes,\n type BackofficeRouterContext,\n} from '../router/createBackofficeRoutes.js';\nimport type { BackofficeProviderProps } from './types.js';\nimport { validateBackofficeDashboardRegistrations } from './dashboardRegistrations.js';\nimport {\n BackofficeRouteFallback,\n BackofficeStaticRouteFallback,\n} from '../components/backoffice/routing/BackofficeRouteFallback.js';\nimport { createBackofficeEntityRegistry } from './entityRegistry.js';\nimport { BackofficeListUiStateProvider } from './BackofficeListUiStateContext.js';\n\nconst normalizeAbsolutePath = (value: string): string => {\n if (value.trim() === '' || value === '/') {\n return '/';\n }\n if (!value.startsWith('/')) {\n return `/${value}`;\n }\n if (value.endsWith('/')) {\n return value.slice(0, -1);\n }\n return value;\n};\n\nconst prefixRoutePath = (basePath: string, value: string): string => {\n const normalizedPath = normalizeAbsolutePath(value);\n const normalizedBasePath = normalizeAbsolutePath(basePath);\n if (normalizedBasePath === '/') {\n return normalizedPath;\n }\n if (\n normalizedPath === normalizedBasePath ||\n normalizedPath.startsWith(`${normalizedBasePath}/`)\n ) {\n return normalizedPath;\n }\n if (normalizedPath === '/') {\n return normalizedBasePath;\n }\n return `${normalizedBasePath}${normalizedPath}`;\n};\n\nconst resolveEntityManifest = (\n manifest: BackofficeEntityManifestMap,\n basePath: string,\n): BackofficeEntityManifestMap => {\n return Object.fromEntries(\n Object.entries(manifest).map(([entityId, item]) => {\n return [\n entityId,\n {\n ...item,\n routes: {\n list: prefixRoutePath(basePath, item.routes.list),\n detail: (id: string) => {\n return prefixRoutePath(basePath, item.routes.detail(id));\n },\n detailPage: (id: string, pageId: string) => {\n return prefixRoutePath(\n basePath,\n item.routes.detailPage(id, pageId),\n );\n },\n },\n } satisfies BackofficeEntityManifestMap[string],\n ] as const;\n }),\n );\n};\n\ntype RouterShellProps = {\n routes: ReturnType<typeof createBackofficeRoutes>;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n};\n\ntype BackofficeRouterInstance = {\n context: NonNullable<ContextType<typeof RoutingContext>>;\n cleanup: () => void;\n};\n\nconst useBackofficeRouterInstance = ({\n routes,\n context,\n instrumentations,\n}: {\n routes: ReturnType<typeof createBackofficeRoutes>;\n context: BackofficeRouterContext;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n}): BackofficeRouterInstance | null => {\n const [router, setRouter] = useState<BackofficeRouterInstance | null>(null);\n const routerRef = useRef<BackofficeRouterInstance | null>(null);\n\n useEffect(() => {\n const nextRouter = createRouter(routes, {\n context,\n instrumentations,\n });\n routerRef.current = nextRouter;\n setRouter(nextRouter);\n\n return () => {\n if (routerRef.current === nextRouter) {\n routerRef.current = null;\n }\n nextRouter.cleanup();\n };\n }, [context, instrumentations, routes]);\n\n return router;\n};\n\nconst RouterShell = ({\n routes,\n instrumentations,\n}: RouterShellProps): JSX.Element => {\n const relayEnvironment = useRelayEnvironment();\n const relayOperationActivity = useRelayOperationActivity();\n\n const routerContext = useMemo(() => {\n return { relayEnvironment };\n }, [relayEnvironment]);\n\n const router = useBackofficeRouterInstance({\n routes,\n context: routerContext,\n instrumentations,\n });\n\n if (router == null) {\n return <BackofficeRouteFallback />;\n }\n\n return (\n <RoutingContext.Provider value={router.context}>\n <RouterRenderer\n enableTransition\n externalPending={relayOperationActivity.pendingCount > 0}\n fallback={<BackofficeRouteFallback />}\n pending={<RoutePendingBar />}\n />\n </RoutingContext.Provider>\n );\n};\n\nexport const BackofficeProvider = (\n props: BackofficeProviderProps,\n): JSX.Element => {\n const basePath = normalizeAbsolutePath(props.basePath ?? '/');\n\n const entityManifest = useMemo(() => {\n return resolveEntityManifest(props.entityManifest, basePath);\n }, [basePath, props.entityManifest]);\n const entityRegistry = useMemo(() => {\n return createBackofficeEntityRegistry(entityManifest, { basePath });\n }, [basePath, entityManifest]);\n\n const graphQLConfig = props.graphql;\n const dashboards = useMemo(() => {\n return validateBackofficeDashboardRegistrations(props.dashboards);\n }, [props.dashboards]);\n\n useEffect(() => {\n const httpUrl = graphQLConfig.httpUrl ?? graphQLConfig.endpoint;\n const wsUrl = graphQLConfig.wsUrl ?? graphQLConfig.wsEndpoint;\n configureRelayEnvironment({\n httpUrl,\n wsUrl,\n getDataId: graphQLConfig.getDataId,\n logEvents: graphQLConfig.logEvents,\n getAuthHeaders: graphQLConfig.getAuthHeaders,\n });\n }, [\n graphQLConfig.endpoint,\n graphQLConfig.getAuthHeaders,\n graphQLConfig.getDataId,\n graphQLConfig.httpUrl,\n graphQLConfig.logEvents,\n graphQLConfig.wsEndpoint,\n graphQLConfig.wsUrl,\n ]);\n\n const mergedResources = useMemo(() => {\n return withBackofficeReactI18nResources(props.i18n?.resources ?? {});\n }, [props.i18n?.resources]);\n\n const i18nInstance = useMemo(() => {\n return props.i18n?.instance ?? createInstance();\n }, [props.i18n?.instance]);\n const [isI18nReady, setIsI18nReady] = useState(i18nInstance.isInitialized);\n\n useEffect(() => {\n let isCurrent = true;\n const markI18nReady = (): void => {\n if (isCurrent) {\n setIsI18nReady(true);\n }\n };\n\n i18nInstance.on('initialized', markI18nReady);\n if (i18nInstance.isInitialized) {\n markI18nReady();\n return () => {\n isCurrent = false;\n i18nInstance.off('initialized', markI18nReady);\n };\n }\n\n const readyCheck = globalThis.setTimeout(() => {\n if (i18nInstance.isInitialized) {\n markI18nReady();\n }\n }, 0);\n\n const initOptions = props.i18n?.initOptions ?? {};\n const defaultNs = initOptions.defaultNS ?? 'translations';\n const ns = initOptions.ns ?? ['backofficeReact', 'translations', 'ui'];\n createI18nInstance({\n resources: mergedResources,\n lng: props.i18n?.lng,\n fallbackLng: props.i18n?.fallbackLng,\n initOptions: {\n ...initOptions,\n defaultNS: defaultNs,\n ns,\n react: {\n useSuspense: false,\n ...initOptions.react,\n },\n },\n instance: i18nInstance,\n useLanguageDetector: props.i18n?.useLanguageDetector,\n detection: props.i18n?.detection,\n })\n .then(markI18nReady)\n .catch((error: unknown) => {\n markI18nReady();\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n return () => {\n isCurrent = false;\n globalThis.clearTimeout(readyCheck);\n i18nInstance.off('initialized', markI18nReady);\n };\n }, [\n i18nInstance,\n mergedResources,\n props.i18n?.initOptions,\n props.i18n?.detection,\n props.i18n?.fallbackLng,\n props.i18n?.lng,\n props.i18n?.useLanguageDetector,\n ]);\n\n const configValue = useMemo(() => {\n return {\n basePath,\n entities: entityManifest,\n entityManifest,\n entityRegistry,\n filterColumnAliases: props.filterColumnAliases,\n sidebar: props.sidebar,\n dashboard: props.dashboard,\n dashboards,\n auth: props.auth,\n graphql: props.graphql,\n };\n }, [\n basePath,\n props.auth,\n props.dashboard,\n dashboards,\n entityManifest,\n entityRegistry,\n props.filterColumnAliases,\n props.graphql,\n props.sidebar,\n ]);\n\n const routes = useMemo(() => {\n return createBackofficeRoutes({\n basePath,\n entityManifest,\n entityRegistry,\n sidebar: props.sidebar,\n auth: props.auth,\n dashboard: props.dashboard,\n dashboards,\n toolsOperationPage: props.toolsOperationPage,\n });\n }, [\n basePath,\n entityManifest,\n entityRegistry,\n props.auth,\n props.dashboard,\n dashboards,\n props.toolsOperationPage,\n props.sidebar,\n ]);\n\n let contentNode = <BackofficeStaticRouteFallback label=\"Loading...\" />;\n if (isI18nReady) {\n contentNode = (\n <BackofficeThemeProvider>\n <RelayProvider>\n <BackofficeConfigProvider value={configValue}>\n {props.overlay}\n <BackofficeListUiStateProvider>\n <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\n </BackofficeListUiStateProvider>\n </BackofficeConfigProvider>\n </RelayProvider>\n </BackofficeThemeProvider>\n );\n }\n\n return (\n <StrictMode>\n <I18nextProvider i18n={i18nInstance}>{contentNode}</I18nextProvider>\n </StrictMode>\n );\n};\n\nexport default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EAAM;EACN;EACA,EAAM;EACN,EAAM;CACR,CAAC,GAEG,IAAc,kBAAC,GAAD,EAA+B,OAAM,aAAc,CAAA;CAmBrE,OAlBI,MACF,IACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAA0B,OAAO;EAAjC,UAAA,CACG,EAAM,SACP,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GACU;GACR,kBAAkB,EAAM;EACzB,CAAA,EAC4B,CAAA,CACP;CACb,CAAA,EAAA,CAAA,EACQ,CAAA,IAK3B,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,MAAM;EAAe,UAAA;CAA6B,CAAA,EACzD,CAAA;AAEhB"}
1
+ {"version":3,"file":"BackofficeProvider.js","names":[],"sources":["../../../src/provider/BackofficeProvider.tsx"],"sourcesContent":["import {\n StrictMode,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ContextType,\n type JSX,\n} from 'react';\nimport { createInstance } from 'i18next';\nimport { I18nextProvider } from 'react-i18next';\nimport createRouter from '@plumile/router/routing/createRouter.js';\nimport RouterRenderer from '@plumile/router/routing/RouterRenderer.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { BackofficeThemeProvider } from '@plumile/ui/admin/theme/BackofficeThemeProvider.js';\nimport { RoutePendingBar } from '@plumile/ui/components/routing/RoutePendingBar.js';\n\nimport { type BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\nimport {\n RelayProvider,\n configureRelayEnvironment,\n useRelayOperationActivity,\n} from '@plumile/relay';\n\nimport { createI18nInstance } from '../i18n/createI18nInstance.js';\nimport { withBackofficeReactI18nResources } from '../i18n/resources.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { BackofficeConfigProvider } from './BackofficeConfigContext.js';\nimport {\n createBackofficeRoutes,\n type BackofficeRouterContext,\n} from '../router/createBackofficeRoutes.js';\nimport type { BackofficeProviderProps } from './types.js';\nimport { validateBackofficeDashboardRegistrations } from './dashboardRegistrations.js';\nimport {\n BackofficeRouteFallback,\n BackofficeStaticRouteFallback,\n} from '../components/backoffice/routing/BackofficeRouteFallback.js';\nimport { createBackofficeEntityRegistry } from './entityRegistry.js';\nimport { BackofficeListUiStateProvider } from './BackofficeListUiStateContext.js';\nimport { useBackofficeAuthRouteGate } from './useBackofficeAuthRouteGate.js';\n\nconst normalizeAbsolutePath = (value: string): string => {\n if (value.trim() === '' || value === '/') {\n return '/';\n }\n if (!value.startsWith('/')) {\n return `/${value}`;\n }\n if (value.endsWith('/')) {\n return value.slice(0, -1);\n }\n return value;\n};\n\nconst prefixRoutePath = (basePath: string, value: string): string => {\n const normalizedPath = normalizeAbsolutePath(value);\n const normalizedBasePath = normalizeAbsolutePath(basePath);\n if (normalizedBasePath === '/') {\n return normalizedPath;\n }\n if (\n normalizedPath === normalizedBasePath ||\n normalizedPath.startsWith(`${normalizedBasePath}/`)\n ) {\n return normalizedPath;\n }\n if (normalizedPath === '/') {\n return normalizedBasePath;\n }\n return `${normalizedBasePath}${normalizedPath}`;\n};\n\nconst resolveEntityManifest = (\n manifest: BackofficeEntityManifestMap,\n basePath: string,\n): BackofficeEntityManifestMap => {\n return Object.fromEntries(\n Object.entries(manifest).map(([entityId, item]) => {\n return [\n entityId,\n {\n ...item,\n routes: {\n list: prefixRoutePath(basePath, item.routes.list),\n detail: (id: string) => {\n return prefixRoutePath(basePath, item.routes.detail(id));\n },\n detailPage: (id: string, pageId: string) => {\n return prefixRoutePath(\n basePath,\n item.routes.detailPage(id, pageId),\n );\n },\n },\n } satisfies BackofficeEntityManifestMap[string],\n ] as const;\n }),\n );\n};\n\ntype RouterShellProps = {\n routes: ReturnType<typeof createBackofficeRoutes>;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n};\n\ntype BackofficeRouterInstance = {\n context: NonNullable<ContextType<typeof RoutingContext>>;\n cleanup: () => void;\n};\n\nconst useBackofficeRouterInstance = ({\n routes,\n context,\n instrumentations,\n}: {\n routes: ReturnType<typeof createBackofficeRoutes>;\n context: BackofficeRouterContext;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n}): BackofficeRouterInstance | null => {\n const [router, setRouter] = useState<BackofficeRouterInstance | null>(null);\n const routerRef = useRef<BackofficeRouterInstance | null>(null);\n\n useEffect(() => {\n const nextRouter = createRouter(routes, {\n context,\n instrumentations,\n });\n routerRef.current = nextRouter;\n setRouter(nextRouter);\n\n return () => {\n if (routerRef.current === nextRouter) {\n routerRef.current = null;\n }\n nextRouter.cleanup();\n };\n }, [context, instrumentations, routes]);\n\n return router;\n};\n\nconst RouterShell = ({\n routes,\n instrumentations,\n}: RouterShellProps): JSX.Element => {\n const relayEnvironment = useRelayEnvironment();\n const relayOperationActivity = useRelayOperationActivity();\n\n const routerContext = useMemo(() => {\n return { relayEnvironment };\n }, [relayEnvironment]);\n\n const router = useBackofficeRouterInstance({\n routes,\n context: routerContext,\n instrumentations,\n });\n\n if (router == null) {\n return <BackofficeRouteFallback />;\n }\n\n return (\n <RoutingContext.Provider value={router.context}>\n <RouterRenderer\n enableTransition\n externalPending={relayOperationActivity.pendingCount > 0}\n fallback={<BackofficeRouteFallback />}\n pending={<RoutePendingBar />}\n />\n </RoutingContext.Provider>\n );\n};\n\nexport const BackofficeProvider = (\n props: BackofficeProviderProps,\n): JSX.Element => {\n const basePath = normalizeAbsolutePath(props.basePath ?? '/');\n const canMountRouter = useBackofficeAuthRouteGate(basePath);\n\n const entityManifest = useMemo(() => {\n return resolveEntityManifest(props.entityManifest, basePath);\n }, [basePath, props.entityManifest]);\n const entityRegistry = useMemo(() => {\n return createBackofficeEntityRegistry(entityManifest, { basePath });\n }, [basePath, entityManifest]);\n\n const graphQLConfig = props.graphql;\n const dashboards = useMemo(() => {\n return validateBackofficeDashboardRegistrations(props.dashboards);\n }, [props.dashboards]);\n\n useEffect(() => {\n const httpUrl = graphQLConfig.httpUrl ?? graphQLConfig.endpoint;\n const wsUrl = graphQLConfig.wsUrl ?? graphQLConfig.wsEndpoint;\n configureRelayEnvironment({\n httpUrl,\n wsUrl,\n getDataId: graphQLConfig.getDataId,\n logEvents: graphQLConfig.logEvents,\n getAuthHeaders: graphQLConfig.getAuthHeaders,\n });\n }, [\n graphQLConfig.endpoint,\n graphQLConfig.getAuthHeaders,\n graphQLConfig.getDataId,\n graphQLConfig.httpUrl,\n graphQLConfig.logEvents,\n graphQLConfig.wsEndpoint,\n graphQLConfig.wsUrl,\n ]);\n\n const mergedResources = useMemo(() => {\n return withBackofficeReactI18nResources(props.i18n?.resources ?? {});\n }, [props.i18n?.resources]);\n\n const i18nInstance = useMemo(() => {\n return props.i18n?.instance ?? createInstance();\n }, [props.i18n?.instance]);\n const [isI18nReady, setIsI18nReady] = useState(i18nInstance.isInitialized);\n\n useEffect(() => {\n let isCurrent = true;\n const markI18nReady = (): void => {\n if (isCurrent) {\n setIsI18nReady(true);\n }\n };\n\n i18nInstance.on('initialized', markI18nReady);\n if (i18nInstance.isInitialized) {\n markI18nReady();\n return () => {\n isCurrent = false;\n i18nInstance.off('initialized', markI18nReady);\n };\n }\n\n const readyCheck = globalThis.setTimeout(() => {\n if (i18nInstance.isInitialized) {\n markI18nReady();\n }\n }, 0);\n\n const initOptions = props.i18n?.initOptions ?? {};\n const defaultNs = initOptions.defaultNS ?? 'translations';\n const ns = initOptions.ns ?? ['backofficeReact', 'translations', 'ui'];\n createI18nInstance({\n resources: mergedResources,\n lng: props.i18n?.lng,\n fallbackLng: props.i18n?.fallbackLng,\n initOptions: {\n ...initOptions,\n defaultNS: defaultNs,\n ns,\n react: {\n useSuspense: false,\n ...initOptions.react,\n },\n },\n instance: i18nInstance,\n useLanguageDetector: props.i18n?.useLanguageDetector,\n detection: props.i18n?.detection,\n })\n .then(markI18nReady)\n .catch((error: unknown) => {\n markI18nReady();\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n return () => {\n isCurrent = false;\n globalThis.clearTimeout(readyCheck);\n i18nInstance.off('initialized', markI18nReady);\n };\n }, [\n i18nInstance,\n mergedResources,\n props.i18n?.initOptions,\n props.i18n?.detection,\n props.i18n?.fallbackLng,\n props.i18n?.lng,\n props.i18n?.useLanguageDetector,\n ]);\n\n const configValue = useMemo(() => {\n return {\n basePath,\n entities: entityManifest,\n entityManifest,\n entityRegistry,\n filterColumnAliases: props.filterColumnAliases,\n sidebar: props.sidebar,\n dashboard: props.dashboard,\n dashboards,\n auth: props.auth,\n graphql: props.graphql,\n };\n }, [\n basePath,\n props.auth,\n props.dashboard,\n dashboards,\n entityManifest,\n entityRegistry,\n props.filterColumnAliases,\n props.graphql,\n props.sidebar,\n ]);\n\n const routes = useMemo(() => {\n return createBackofficeRoutes({\n basePath,\n entityManifest,\n entityRegistry,\n sidebar: props.sidebar,\n auth: props.auth,\n dashboard: props.dashboard,\n dashboards,\n toolsOperationPage: props.toolsOperationPage,\n });\n }, [\n basePath,\n entityManifest,\n entityRegistry,\n props.auth,\n props.dashboard,\n dashboards,\n props.toolsOperationPage,\n props.sidebar,\n ]);\n\n let contentNode = <BackofficeStaticRouteFallback label=\"Loading...\" />;\n if (isI18nReady && canMountRouter) {\n contentNode = (\n <BackofficeThemeProvider>\n <RelayProvider>\n <BackofficeConfigProvider value={configValue}>\n {props.overlay}\n <BackofficeListUiStateProvider>\n <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\n </BackofficeListUiStateProvider>\n </BackofficeConfigProvider>\n </RelayProvider>\n </BackofficeThemeProvider>\n );\n }\n\n return (\n <StrictMode>\n <I18nextProvider i18n={i18nInstance}>{contentNode}</I18nextProvider>\n </StrictMode>\n );\n};\n\nexport default BackofficeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0CA,IAAM,KAAyB,MACzB,EAAM,KAAK,MAAM,MAAM,MAAU,MAC5B,MAEJ,EAAM,WAAW,GAAG,IAGrB,EAAM,SAAS,GAAG,IACb,EAAM,MAAM,GAAG,EAAE,IAEnB,IALE,IAAI,KAQT,KAAmB,GAAkB,MAA0B;CACnE,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,CACG,EAAM,SACP,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GACU;GACR,kBAAkB,EAAM;EACzB,CAAA,EAC4B,CAAA,CACP;CACb,CAAA,EAAA,CAAA,EACQ,CAAA,IAK3B,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,MAAM;EAAe,UAAA;CAA6B,CAAA,EACzD,CAAA;AAEhB"}
@@ -1,95 +1,98 @@
1
1
  import { resolveBackofficeLoadedFacetModule as e } from "@plumile/backoffice-core/resolve.js";
2
2
  //#region src/provider/entityRegistry.ts
3
- var t = "cache-first", n = "detail-page", r = "detail-layout", i = "list", a = "picker", o = "tool", s = (e) => e.kind === "list-detail", c = (e) => e.kind === "tool", l = (e, t, r) => t === n ? `${e}:${t}:${r ?? ""}` : `${e}:${t}`, u = (e) => e instanceof Error ? e : Error(String(e)), d = (e) => e?.status !== "loaded" || e.module == null ? null : e.module, f = (e, t) => {
3
+ var t = "cache-first", n = "detail-page", r = "detail-layout", i = "list", a = "picker", o = "tool", s = (e) => e.kind === "list-detail", c = (e) => e.kind === "tool", l = (e, t, r) => t === n ? `${e}:${t}:${r ?? ""}` : `${e}:${t}`, u = (e) => e instanceof Error ? e : Error(String(e)), d = (e, t) => e.kind === t, f = (e, t) => e?.status !== "loaded" || e.module == null ? null : d(e.module, t) ? e.module : null, p = (e, t) => {
4
4
  let n = e[t];
5
5
  if (n == null) throw Error(`Unknown backoffice entity: ${t}`);
6
6
  return n;
7
- }, p = (p, m) => {
8
- let h = /* @__PURE__ */ new Map(), g = (e) => p[e] ?? null, _ = async (e, n, r) => {
9
- if ((n?.mode ?? t) === "cache-first") {
10
- let t = d(h.get(e));
7
+ }, m = (m, h) => {
8
+ let g = /* @__PURE__ */ new Map(), _ = (e) => m[e] ?? null, v = async (e, n, r, i) => {
9
+ if ((r?.mode ?? t) === "cache-first") {
10
+ let t = f(g.get(e), n);
11
11
  if (t != null) return t;
12
- let n = h.get(e);
13
- if (n?.status === "loading" && n.promise != null) return n.promise;
12
+ let r = g.get(e);
13
+ if (r?.status === "loading" && r.promise != null) return r.promise.then((e) => {
14
+ if (!d(e, n)) throw Error(`Cached backoffice facet kind mismatch: ${n}`);
15
+ return e;
16
+ });
14
17
  }
15
- let i = r().then((t) => (h.set(e, {
18
+ let a = i().then((t) => (g.set(e, {
16
19
  status: "loaded",
17
20
  module: t
18
21
  }), t)).catch((t) => {
19
22
  let n = u(t);
20
- throw h.set(e, {
23
+ throw g.set(e, {
21
24
  status: "error",
22
25
  error: n
23
26
  }), n;
24
27
  });
25
- return h.set(e, {
28
+ return g.set(e, {
26
29
  status: "loading",
27
- promise: i
28
- }), i;
30
+ promise: a
31
+ }), a;
29
32
  };
30
33
  return {
31
- getManifest: g,
32
- getLoadedListEntity: (e) => d(h.get(l(e, i))),
33
- getLoadedPickerEntity: (e) => d(h.get(l(e, a))),
34
- getLoadedDetailLayoutEntity: (e) => d(h.get(l(e, r))),
35
- getLoadedDetailPageEntity: (e, t) => d(h.get(l(e, n, t))),
36
- getLoadedToolEntity: (e) => d(h.get(l(e, o))),
34
+ getManifest: _,
35
+ getLoadedListEntity: (e) => f(g.get(l(e, i)), i),
36
+ getLoadedPickerEntity: (e) => f(g.get(l(e, a)), a),
37
+ getLoadedDetailLayoutEntity: (e) => f(g.get(l(e, r)), r),
38
+ getLoadedDetailPageEntity: (e, t) => f(g.get(l(e, n, t)), n),
39
+ getLoadedToolEntity: (e) => f(g.get(l(e, o)), o),
37
40
  loadListEntity: async (t, n) => {
38
- let r = f(p, t);
41
+ let r = p(m, t);
39
42
  if (!s(r)) throw Error(`Backoffice entity ${t} does not expose a list facet.`);
40
43
  let a = r.facets.list;
41
44
  if (a == null) throw Error(`Backoffice entity ${t} does not expose a list facet.`);
42
- return _(l(t, i), n, async () => {
43
- let n = await a(), o = e(r, n, m);
45
+ return v(l(t, i), i, n, async () => {
46
+ let n = await a(), o = e(r, n, h);
44
47
  if (o.kind !== i) throw Error(`Backoffice entity ${t} did not resolve to a list facet.`);
45
48
  return o;
46
49
  });
47
50
  },
48
51
  loadPickerEntity: async (t, n) => {
49
- let r = f(p, t);
52
+ let r = p(m, t);
50
53
  if (!s(r)) throw Error(`Backoffice entity ${t} does not expose a picker facet.`);
51
54
  let i = r.facets.picker;
52
55
  if (i == null) throw Error(`Backoffice entity ${t} does not expose a picker facet.`);
53
- return _(l(t, a), n, async () => {
54
- let n = await i(), o = e(r, n, m);
56
+ return v(l(t, a), a, n, async () => {
57
+ let n = await i(), o = e(r, n, h);
55
58
  if (o.kind !== a) throw Error(`Backoffice entity ${t} did not resolve to a picker facet.`);
56
59
  return o;
57
60
  });
58
61
  },
59
62
  loadDetailLayoutEntity: async (t, n) => {
60
- let i = f(p, t);
63
+ let i = p(m, t);
61
64
  if (!s(i)) throw Error(`Backoffice entity ${t} does not expose a detail-layout facet.`);
62
- return _(l(t, r), n, async () => {
63
- let n = await i.facets.detailLayout(), a = e(i, n, m);
65
+ return v(l(t, r), r, n, async () => {
66
+ let n = await i.facets.detailLayout(), a = e(i, n, h);
64
67
  if (a.kind !== r) throw Error(`Backoffice entity ${t} did not resolve to a detail-layout facet.`);
65
68
  return a;
66
69
  });
67
70
  },
68
71
  loadDetailPageEntity: async (t, r, i) => {
69
- let a = f(p, t);
72
+ let a = p(m, t);
70
73
  if (!s(a)) throw Error(`Backoffice entity ${t} does not expose a detail-page facet.`);
71
- return _(l(t, n, r), i, async () => {
72
- let i = await a.facets.detailPage(r), o = e(a, i, m);
74
+ return v(l(t, n, r), n, i, async () => {
75
+ let i = await a.facets.detailPage(r), o = e(a, i, h);
73
76
  if (o.kind !== n) throw Error(`Backoffice entity ${t} did not resolve to a detail-page facet.`);
74
77
  return o;
75
78
  });
76
79
  },
77
80
  loadToolEntity: async (t, n) => {
78
- let r = f(p, t);
81
+ let r = p(m, t);
79
82
  if (!c(r)) throw Error(`Backoffice entity ${t} does not expose a tool facet.`);
80
- return _(l(t, o), n, async () => {
81
- let n = await r.facets.tool(), i = e(r, n, m);
83
+ return v(l(t, o), o, n, async () => {
84
+ let n = await r.facets.tool(), i = e(r, n, h);
82
85
  if (i.kind !== o) throw Error(`Backoffice entity ${t} did not resolve to a tool facet.`);
83
86
  return i;
84
87
  });
85
88
  }
86
89
  };
87
- }, m = {
90
+ }, h = {
88
91
  buildFacetCacheKey: l,
89
- resolveManifest: f,
92
+ resolveManifest: p,
90
93
  toError: u
91
94
  };
92
95
  //#endregion
93
- export { m as __test, p as createBackofficeEntityRegistry, p as default };
96
+ export { h as __test, m as createBackofficeEntityRegistry, m as default };
94
97
 
95
98
  //# sourceMappingURL=entityRegistry.js.map