@plumile/backoffice-react 0.1.178 → 0.1.181
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.
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -0
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js.map +1 -1
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +1 -1
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js.map +1 -1
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +2 -0
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +0 -2
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +0 -1
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js +2 -2
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js.map +1 -1
- package/lib/esm/components/backoffice/links/BackofficeLink.js +2 -2
- package/lib/esm/components/backoffice/links/BackofficeLink.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +241 -228
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +2 -2
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
- package/lib/esm/hooks/useBackofficeListRefetch.js +18 -16
- package/lib/esm/hooks/useBackofficeListRefetch.js.map +1 -1
- package/lib/esm/hooks/useBackofficeListUrlState.js +23 -21
- package/lib/esm/hooks/useBackofficeListUrlState.js.map +1 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +1 -0
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +1 -0
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/index.js +26 -25
- package/lib/esm/pages/BackofficeEntityDetailFramePage.js +45 -0
- package/lib/esm/pages/BackofficeEntityDetailFramePage.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +74 -60
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +3 -3
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListDataPage.js +146 -0
- package/lib/esm/pages/BackofficeEntityListDataPage.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityListPage.js +121 -132
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListRouteContext.js +15 -0
- package/lib/esm/pages/BackofficeEntityListRouteContext.js.map +1 -0
- package/lib/esm/pages/detail/buildTabsItems.js +1 -1
- package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +63 -63
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/relay/RelayProvider.js +2 -13
- package/lib/esm/relay/environment.js +2 -463
- package/lib/esm/relay/shortAccessTokenEnvironment.js +2 -15
- package/lib/esm/relay/useRelayOperationActivity.js +2 -0
- package/lib/esm/router/createBackofficeRoutes.js +169 -119
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts +3 -2
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts +3 -2
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts +1 -0
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeListRefetch.d.ts +5 -4
- package/lib/types/hooks/useBackofficeListRefetch.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeListUrlState.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +2 -0
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +3 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailFramePage.d.ts +14 -0
- package/lib/types/pages/BackofficeEntityDetailFramePage.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts +2 -2
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts +2 -11
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListDataPage.d.ts +8 -0
- package/lib/types/pages/BackofficeEntityListDataPage.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityListPage.d.ts +5 -4
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts +22 -0
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts.map +1 -0
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/relay/RelayProvider.d.ts +1 -6
- package/lib/types/relay/RelayProvider.d.ts.map +1 -1
- package/lib/types/relay/environment.d.ts +1 -119
- package/lib/types/relay/environment.d.ts.map +1 -1
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts +4 -3
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +1 -1
- package/lib/types/relay/useRelayOperationActivity.d.ts +2 -0
- package/lib/types/relay/useRelayOperationActivity.d.ts.map +1 -0
- package/lib/types/router/createBackofficeRoutes.d.ts +2 -0
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +14 -12
- package/lib/esm/relay/RelayProvider.js.map +0 -1
- package/lib/esm/relay/environment.js.map +0 -1
- package/lib/esm/relay/shortAccessTokenEnvironment.js.map +0 -1
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import { BackofficeConfigProvider as e } from "./BackofficeConfigContext.js";
|
|
2
2
|
import { validateBackofficeDashboardRegistrations as t } from "./dashboardRegistrations.js";
|
|
3
3
|
import { BackofficeRouteFallback as n, BackofficeStaticRouteFallback as r } from "../components/backoffice/routing/BackofficeRouteFallback.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import { I18nextProvider as y } from "react-i18next";
|
|
15
|
-
import b from "@plumile/router/routing/RoutingContext.js";
|
|
4
|
+
import { useRelayEnvironment as i } from "../relay/useRelayEnvironment.js";
|
|
5
|
+
import { createI18nInstance as a } from "../i18n/createI18nInstance.js";
|
|
6
|
+
import { withBackofficeReactI18nResources as o } from "../i18n/resources.js";
|
|
7
|
+
import { createBackofficeRoutes as s } from "../router/createBackofficeRoutes.js";
|
|
8
|
+
import { createBackofficeEntityRegistry as c } from "./entityRegistry.js";
|
|
9
|
+
import { StrictMode as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { I18nextProvider as g } from "react-i18next";
|
|
12
|
+
import _ from "@plumile/router/routing/RoutingContext.js";
|
|
13
|
+
import { RelayProvider as v, configureRelayEnvironment as y, useRelayOperationActivity as b } from "@plumile/relay";
|
|
16
14
|
import { createInstance as x } from "i18next";
|
|
17
15
|
import S from "@plumile/router/routing/createRouter.js";
|
|
18
16
|
import C from "@plumile/router/routing/RouterRenderer.js";
|
|
19
17
|
import { BackofficeThemeProvider as w } from "@plumile/ui/admin/theme/BackofficeThemeProvider.js";
|
|
18
|
+
import { RoutePendingBar as T } from "@plumile/ui/components/routing/RoutePendingBar.js";
|
|
20
19
|
//#region src/provider/BackofficeProvider.tsx
|
|
21
|
-
var
|
|
22
|
-
let n =
|
|
20
|
+
var E = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, D = (e, t) => {
|
|
21
|
+
let n = E(t), r = E(e);
|
|
23
22
|
return r === "/" || n === r || n.startsWith(`${r}/`) ? n : n === "/" ? r : `${r}${n}`;
|
|
24
|
-
},
|
|
23
|
+
}, O = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
|
|
25
24
|
...n,
|
|
26
25
|
routes: {
|
|
27
|
-
list:
|
|
28
|
-
detail: (e) =>
|
|
29
|
-
detailPage: (e, r) =>
|
|
26
|
+
list: D(t, n.routes.list),
|
|
27
|
+
detail: (e) => D(t, n.routes.detail(e)),
|
|
28
|
+
detailPage: (e, r) => D(t, n.routes.detailPage(e, r))
|
|
30
29
|
}
|
|
31
|
-
}])),
|
|
32
|
-
let [r, i] =
|
|
33
|
-
return
|
|
30
|
+
}])), k = ({ routes: e, context: t, instrumentations: n }) => {
|
|
31
|
+
let [r, i] = p(null), a = f(null);
|
|
32
|
+
return u(() => {
|
|
34
33
|
let r = S(e, {
|
|
35
34
|
context: t,
|
|
36
35
|
instrumentations: n
|
|
@@ -43,24 +42,25 @@ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
43
42
|
n,
|
|
44
43
|
e
|
|
45
44
|
]), r;
|
|
46
|
-
},
|
|
47
|
-
let r =
|
|
45
|
+
}, A = ({ routes: e, instrumentations: t }) => {
|
|
46
|
+
let r = i(), a = b(), o = k({
|
|
48
47
|
routes: e,
|
|
49
|
-
context:
|
|
48
|
+
context: d(() => ({ relayEnvironment: r }), [r]),
|
|
50
49
|
instrumentations: t
|
|
51
50
|
});
|
|
52
|
-
return
|
|
53
|
-
value:
|
|
54
|
-
children: /* @__PURE__ */
|
|
51
|
+
return o == null ? /* @__PURE__ */ m(n, {}) : /* @__PURE__ */ m(_.Provider, {
|
|
52
|
+
value: o.context,
|
|
53
|
+
children: /* @__PURE__ */ m(C, {
|
|
55
54
|
enableTransition: !0,
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
externalPending: a.pendingCount > 0,
|
|
56
|
+
fallback: /* @__PURE__ */ m(n, {}),
|
|
57
|
+
pending: /* @__PURE__ */ m(T, {})
|
|
58
58
|
})
|
|
59
59
|
});
|
|
60
|
-
},
|
|
61
|
-
let i =
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
}, j = (n) => {
|
|
61
|
+
let i = E(n.basePath ?? "/"), f = d(() => O(n.entityManifest, i), [i, n.entityManifest]), _ = d(() => c(f, { basePath: i }), [i, f]), b = n.graphql, S = d(() => t(n.dashboards), [n.dashboards]);
|
|
62
|
+
u(() => {
|
|
63
|
+
y({
|
|
64
64
|
httpUrl: b.httpUrl ?? b.endpoint,
|
|
65
65
|
wsUrl: b.wsUrl ?? b.wsEndpoint,
|
|
66
66
|
getDataId: b.getDataId,
|
|
@@ -76,44 +76,44 @@ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
76
76
|
b.wsEndpoint,
|
|
77
77
|
b.wsUrl
|
|
78
78
|
]);
|
|
79
|
-
let C =
|
|
80
|
-
|
|
79
|
+
let C = d(() => o(n.i18n?.resources ?? {}), [n.i18n?.resources]), T = d(() => n.i18n?.instance ?? x(), [n.i18n?.instance]), [D, k] = p(T.isInitialized);
|
|
80
|
+
u(() => {
|
|
81
81
|
let e = !0, t = () => {
|
|
82
|
-
e &&
|
|
82
|
+
e && k(!0);
|
|
83
83
|
};
|
|
84
|
-
if (
|
|
85
|
-
e = !1,
|
|
84
|
+
if (T.on("initialized", t), T.isInitialized) return t(), () => {
|
|
85
|
+
e = !1, T.off("initialized", t);
|
|
86
86
|
};
|
|
87
87
|
let r = globalThis.setTimeout(() => {
|
|
88
|
-
|
|
89
|
-
}, 0), i = n.i18n?.initOptions ?? {},
|
|
88
|
+
T.isInitialized && t();
|
|
89
|
+
}, 0), i = n.i18n?.initOptions ?? {}, o = i.defaultNS ?? "translations", s = i.ns ?? [
|
|
90
90
|
"backofficeReact",
|
|
91
91
|
"translations",
|
|
92
92
|
"ui"
|
|
93
93
|
];
|
|
94
|
-
return
|
|
94
|
+
return a({
|
|
95
95
|
resources: C,
|
|
96
96
|
lng: n.i18n?.lng,
|
|
97
97
|
fallbackLng: n.i18n?.fallbackLng,
|
|
98
98
|
initOptions: {
|
|
99
99
|
...i,
|
|
100
|
-
defaultNS:
|
|
101
|
-
ns:
|
|
100
|
+
defaultNS: o,
|
|
101
|
+
ns: s,
|
|
102
102
|
react: {
|
|
103
103
|
useSuspense: !1,
|
|
104
104
|
...i.react
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
instance:
|
|
107
|
+
instance: T,
|
|
108
108
|
useLanguageDetector: n.i18n?.useLanguageDetector,
|
|
109
109
|
detection: n.i18n?.detection
|
|
110
110
|
}).then(t).catch((e) => {
|
|
111
111
|
t(), console.error(e);
|
|
112
112
|
}), () => {
|
|
113
|
-
e = !1, globalThis.clearTimeout(r),
|
|
113
|
+
e = !1, globalThis.clearTimeout(r), T.off("initialized", t);
|
|
114
114
|
};
|
|
115
115
|
}, [
|
|
116
|
-
|
|
116
|
+
T,
|
|
117
117
|
C,
|
|
118
118
|
n.i18n?.initOptions,
|
|
119
119
|
n.i18n?.detection,
|
|
@@ -121,11 +121,11 @@ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
121
121
|
n.i18n?.lng,
|
|
122
122
|
n.i18n?.useLanguageDetector
|
|
123
123
|
]);
|
|
124
|
-
let j =
|
|
124
|
+
let j = d(() => ({
|
|
125
125
|
basePath: i,
|
|
126
|
-
entities:
|
|
127
|
-
entityManifest:
|
|
128
|
-
entityRegistry:
|
|
126
|
+
entities: f,
|
|
127
|
+
entityManifest: f,
|
|
128
|
+
entityRegistry: _,
|
|
129
129
|
filterColumnAliases: n.filterColumnAliases,
|
|
130
130
|
sidebar: n.sidebar,
|
|
131
131
|
dashboard: n.dashboard,
|
|
@@ -137,15 +137,15 @@ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
137
137
|
n.auth,
|
|
138
138
|
n.dashboard,
|
|
139
139
|
S,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
f,
|
|
141
|
+
_,
|
|
142
142
|
n.filterColumnAliases,
|
|
143
143
|
n.graphql,
|
|
144
144
|
n.sidebar
|
|
145
|
-
]), M =
|
|
145
|
+
]), M = d(() => s({
|
|
146
146
|
basePath: i,
|
|
147
|
-
entityManifest:
|
|
148
|
-
entityRegistry:
|
|
147
|
+
entityManifest: f,
|
|
148
|
+
entityRegistry: _,
|
|
149
149
|
sidebar: n.sidebar,
|
|
150
150
|
auth: n.auth,
|
|
151
151
|
dashboard: n.dashboard,
|
|
@@ -153,26 +153,26 @@ var T = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
153
153
|
toolsOperationPage: n.toolsOperationPage
|
|
154
154
|
}), [
|
|
155
155
|
i,
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
f,
|
|
157
|
+
_,
|
|
158
158
|
n.auth,
|
|
159
159
|
n.dashboard,
|
|
160
160
|
S,
|
|
161
161
|
n.toolsOperationPage,
|
|
162
162
|
n.sidebar
|
|
163
|
-
]), N = /* @__PURE__ */
|
|
164
|
-
return
|
|
163
|
+
]), N = /* @__PURE__ */ m(r, { label: "Loading..." });
|
|
164
|
+
return D && (N = /* @__PURE__ */ m(w, { children: /* @__PURE__ */ m(v, { children: /* @__PURE__ */ h(e, {
|
|
165
165
|
value: j,
|
|
166
|
-
children: [n.overlay, /* @__PURE__ */
|
|
166
|
+
children: [n.overlay, /* @__PURE__ */ m(A, {
|
|
167
167
|
routes: M,
|
|
168
168
|
instrumentations: n.instrumentations
|
|
169
169
|
})]
|
|
170
|
-
}) }) })), /* @__PURE__ */
|
|
171
|
-
i18n:
|
|
170
|
+
}) }) })), /* @__PURE__ */ m(l, { children: /* @__PURE__ */ m(g, {
|
|
171
|
+
i18n: T,
|
|
172
172
|
children: N
|
|
173
173
|
}) });
|
|
174
174
|
};
|
|
175
175
|
//#endregion
|
|
176
|
-
export {
|
|
176
|
+
export { j as BackofficeProvider, j as default };
|
|
177
177
|
|
|
178
178
|
//# 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';\n\nimport { type BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\n\nimport { createI18nInstance } from '../i18n/createI18nInstance.js';\nimport { withBackofficeReactI18nResources } from '../i18n/resources.js';\nimport { RelayProvider } from '../relay/RelayProvider.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { configureRelayEnvironment } from '../relay/environment.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 { BackofficeRoutePendingBar } from '../components/backoffice/routing/BackofficeRoutePendingBar.js';\nimport { createBackofficeEntityRegistry } from './entityRegistry.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\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 fallback={<BackofficeRouteFallback />}\n pending={<BackofficeRoutePendingBar />}\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 <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\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":";;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,KAAyB,MACzB,EAAM,KAAK,MAAM,MAAM,MAAU,MAC5B,MAEJ,EAAM,WAAW,GAAG,IAGrB,E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GACU;GACR,kBAAkB,EAAM;EACzB,CAAA,CACuB;IACb,CAAA,EACQ,CAAA,IAK3B,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,MAAM;YAAe;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';\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 <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\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":";;;;;;;;;;;;;;;;;;;AAwCA,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,IAAM,IAAiB,EAAsB,CAAK,GAC5C,IAAqB,EAAsB,CAAQ;CAazD,OAZI,MAAuB,OAIzB,MAAmB,KACnB,EAAe,WAAW,GAAG,EAAmB,EAAE,IAE3C,IAEL,MAAmB,MACd,IAEF,GAAG,IAAqB;AACjC,GAEM,KACJ,GACA,MAEO,OAAO,YACZ,OAAO,QAAQ,CAAQ,EAAE,KAAK,CAAC,GAAU,OAChC,CACL,GACA;CACE,GAAG;CACH,QAAQ;EACN,MAAM,EAAgB,GAAU,EAAK,OAAO,IAAI;EAChD,SAAS,MACA,EAAgB,GAAU,EAAK,OAAO,OAAO,CAAE,CAAC;EAEzD,aAAa,GAAY,MAChB,EACL,GACA,EAAK,OAAO,WAAW,GAAI,CAA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,MAAM;EACZ,EAAM,MAAM;EACZ,EAAM,MAAM;EACZ,EAAM,MAAM;EACZ,EAAM,MAAM;CACd,CAAC;CAED,IAAM,IAAc,SACX;EACL;EACA,UAAU;EACV;EACA;EACA,qBAAqB,EAAM;EAC3B,SAAS,EAAM;EACf,WAAW,EAAM;EACjB;EACA,MAAM,EAAM;EACZ,SAAS,EAAM;CACjB,IACC;EACD;EACA,EAAM;EACN,EAAM;EACN;EACA;EACA;EACA,EAAM;EACN,EAAM;EACN,EAAM;CACR,CAAC,GAEK,IAAS,QACN,EAAuB;EAC5B;EACA;EACA;EACA,SAAS,EAAM;EACf,MAAM,EAAM;EACZ,WAAW,EAAM;EACjB;EACA,oBAAoB,EAAM;CAC5B,CAAC,GACA;EACD;EACA;EACA;EACA,EAAM;EACN,EAAM;EACN;EACA,EAAM;EACN,EAAM;CACR,CAAC,GAEG,IAAc,kBAAC,GAAD,EAA+B,OAAM,aAAc,CAAA;CAiBrE,OAhBI,MACF,IACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAA0B,OAAO;YAAjC,CACG,EAAM,SACP,kBAAC,GAAD;GACU;GACR,kBAAkB,EAAM;EACzB,CAAA,CACuB;IACb,CAAA,EACQ,CAAA,IAK3B,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,MAAM;YAAe;CAA6B,CAAA,EACzD,CAAA;AAEhB"}
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
-
import * as a from "react-relay";
|
|
5
|
-
//#region src/relay/RelayProvider.tsx
|
|
6
|
-
var { RelayEnvironmentProvider: o } = a, s = ({ children: a }) => (r(n, () => t().generation, () => t().generation), /* @__PURE__ */ i(o, {
|
|
7
|
-
environment: e(),
|
|
8
|
-
children: a
|
|
9
|
-
}));
|
|
10
|
-
//#endregion
|
|
11
|
-
export { s as RelayProvider, s as default };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=RelayProvider.js.map
|
|
1
|
+
import { RelayProvider as e } from "@plumile/relay";
|
|
2
|
+
export { e as RelayProvider };
|