@plumile/backoffice-react 0.1.198 → 0.1.200
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/README.md +5 -0
- package/lib/esm/auth/backofficeAuthHeaders.js +18 -0
- package/lib/esm/auth/backofficeAuthHeaders.js.map +1 -0
- package/lib/esm/index.js +76 -75
- package/lib/esm/pages/BackofficeAcceptInvitationPage.js +7 -7
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +6 -4
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeLayoutPage.js +41 -41
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeLoginPage.js +11 -11
- package/lib/esm/pages/BackofficePasswordResetCompletePage.js +14 -14
- package/lib/esm/pages/BackofficeVerifyEmailPage.js +14 -14
- package/lib/esm/provider/BackofficeProvider.js +78 -77
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/provider/useBackofficeAuthRouteGate.js +39 -0
- package/lib/esm/provider/useBackofficeAuthRouteGate.js.map +1 -0
- package/lib/esm/router/backofficeAuthPaths.js +11 -2
- package/lib/esm/router/backofficeAuthPaths.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +4 -4
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/auth/backofficeAuthHeaders.d.ts +5 -0
- package/lib/types/auth/backofficeAuthHeaders.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/useBackofficeAuthRouteGate.d.ts +2 -0
- package/lib/types/provider/useBackofficeAuthRouteGate.d.ts.map +1 -0
- package/lib/types/router/backofficeAuthPaths.d.ts +1 -0
- package/lib/types/router/backofficeAuthPaths.d.ts.map +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -37,6 +37,11 @@ It does not try to become:
|
|
|
37
37
|
npm install @plumile/backoffice-react
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
Use `createBackofficeAuthHeaders({ basePath })` as the Relay
|
|
41
|
+
`getAuthHeaders` callback. It permits anonymous GraphQL requests only from the
|
|
42
|
+
backoffice authentication routes and rejects protected requests before the
|
|
43
|
+
network when the short-lived session has expired.
|
|
44
|
+
|
|
40
45
|
Peer dependencies:
|
|
41
46
|
|
|
42
47
|
```bash
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isBackofficeAuthPath as e } from "../router/backofficeAuthPaths.js";
|
|
2
|
+
import { getShortAccessToken as t } from "@plumile/auth/shortAccessToken.js";
|
|
3
|
+
//#region src/auth/backofficeAuthHeaders.ts
|
|
4
|
+
var n = (n = {}) => {
|
|
5
|
+
let r = n.basePath ?? "/";
|
|
6
|
+
return async () => {
|
|
7
|
+
try {
|
|
8
|
+
return { Authorization: `Bearer ${await t()}` };
|
|
9
|
+
} catch (t) {
|
|
10
|
+
if (typeof window < "u" && e(r, window.location.pathname)) return {};
|
|
11
|
+
throw t;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as createBackofficeAuthHeaders };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=backofficeAuthHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backofficeAuthHeaders.js","names":[],"sources":["../../../src/auth/backofficeAuthHeaders.ts"],"sourcesContent":["import { getShortAccessToken } from '@plumile/auth/shortAccessToken.js';\n\nimport { isBackofficeAuthPath } from '../router/backofficeAuthPaths.js';\n\nexport type BackofficeAuthHeadersOptions = {\n basePath?: string;\n};\n\n/**\n * Builds the auth-header provider used by a backoffice Relay environment.\n *\n * Authentication failures are allowed to become anonymous requests only on\n * the explicit authentication routes. Protected operations reject before the\n * network request is sent, so an expired session cannot reach a private\n * GraphQL subgraph as an anonymous request.\n */\nexport const createBackofficeAuthHeaders = (\n options: BackofficeAuthHeadersOptions = {},\n): (() => Promise<Record<string, string>>) => {\n const basePath = options.basePath ?? '/';\n return async () => {\n try {\n const token = await getShortAccessToken();\n return { Authorization: `Bearer ${token}` };\n } catch (error: unknown) {\n if (\n typeof window !== 'undefined' &&\n isBackofficeAuthPath(basePath, window.location.pathname)\n ) {\n const anonymousHeaders: Record<string, string> = {};\n return anonymousHeaders;\n }\n throw error;\n }\n };\n};\n"],"mappings":";;;AAgBA,IAAa,KACX,IAAwC,CAAC,MACG;CAC5C,IAAM,IAAW,EAAQ,YAAY;CACrC,OAAO,YAAY;EACjB,IAAI;GAEF,OAAO,EAAE,eAAe,UAAU,MADd,EAAoB,IACE;EAC5C,SAAS,GAAgB;GACvB,IACE,OAAO,SAAW,OAClB,EAAqB,GAAU,OAAO,SAAS,QAAQ,GAGvD,OAAO,CAAA;GAET,MAAM;EACR;CACF;AACF"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
1
|
import { AuthRefreshNotice as e, useAuthRefreshStateSnapshot as t } from "./auth/AuthRefreshNotice.js";
|
|
2
2
|
import { TotpQrCode as n, buildTotpOtpAuthUri as r } from "./auth/TotpQrCode.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import be from "./hooks/
|
|
58
|
-
import xe from "./hooks/
|
|
59
|
-
import
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
|
|
3
|
+
import { createBackofficeAuthHeaders as i } from "./auth/backofficeAuthHeaders.js";
|
|
4
|
+
import { LoginFlow as a } from "./auth/login/LoginFlow.js";
|
|
5
|
+
import { synchronizeAuthStatusQuery as o } from "./auth/login/synchronizeAuthStatusQuery.js";
|
|
6
|
+
import { AcceptInvitationScreen as s } from "./auth/pages/AcceptInvitationScreen.js";
|
|
7
|
+
import { PasswordResetCompleteScreen as c } from "./auth/pages/PasswordResetCompleteScreen.js";
|
|
8
|
+
import { PasswordResetRequestScreen as l } from "./auth/pages/PasswordResetRequestScreen.js";
|
|
9
|
+
import { VerifyEmailScreen as u } from "./auth/pages/VerifyEmailScreen.js";
|
|
10
|
+
import { requireField as d, requireLinkedRecordId as f, resolveAgentStartOutcome as p, resolveMutationOutcome as m } from "./relay/mutationResult.js";
|
|
11
|
+
import { useBackofficeConfig as h } from "./provider/BackofficeConfigContext.js";
|
|
12
|
+
import { EntityIdFilterField as g } from "./components/backoffice/filters/EntityIdFilterField.js";
|
|
13
|
+
import { BackofficeErrorBoundary as _ } from "./components/backoffice/errors/BackofficeErrorBoundary.js";
|
|
14
|
+
import { EntityIdPickerDialog as v } from "./components/backoffice/pickers/EntityIdPickerDialog.js";
|
|
15
|
+
import { BackofficeBillingUsageChart as y } from "./components/backoffice/billing/BackofficeBillingUsageChart.js";
|
|
16
|
+
import { resolveBackofficeTargetIcon as b } from "./components/backoffice/links/resolveBackofficeTargetIcon.js";
|
|
17
|
+
import { resolveBackofficeLink as x } from "./components/backoffice/links/resolveBackofficeLink.js";
|
|
18
|
+
import { useBackofficeLink as S } from "./components/backoffice/links/useBackofficeLink.js";
|
|
19
|
+
import { BackofficeInlineLink as C } from "./components/backoffice/links/BackofficeInlineLink.js";
|
|
20
|
+
import { buildDataTableColumns as w } from "./components/backoffice/columns/buildDataTableColumns.js";
|
|
21
|
+
import { BackofficeDetailBadgeRow as T } from "./components/backoffice/detail/BackofficeDetailBadgeRow.js";
|
|
22
|
+
import { BackofficeStatusMetaBadge as E } from "./components/backoffice/detail/BackofficeStatusMetaBadge.js";
|
|
23
|
+
import { BackofficeEntitySummaryHeader as D } from "./components/backoffice/detail/BackofficeEntitySummaryHeader.js";
|
|
24
|
+
import { BackofficeEnumLabel as O } from "./components/backoffice/detail/BackofficeEnumLabel.js";
|
|
25
|
+
import { BackofficeLifecycleTimelineSection as k } from "./components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
|
|
26
|
+
import { BackofficeReferenceValue as A } from "./components/backoffice/detail/BackofficeReferenceValue.js";
|
|
27
|
+
import { BackofficeRelationsSummaryGrid as j } from "./components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
|
|
28
|
+
import { BackofficeStatusGroup as M } from "./components/backoffice/detail/BackofficeStatusGroup.js";
|
|
29
|
+
import { BackofficeTokenUsageBreakdown as N } from "./components/backoffice/detail/BackofficeTokenUsageBreakdown.js";
|
|
30
|
+
import { BackofficeUsageCostBreakdown as P } from "./components/backoffice/detail/BackofficeUsageCostBreakdown.js";
|
|
31
|
+
import { createBackofficeEntityLinkProps as F } from "./components/backoffice/detail/createBackofficeEntityLinkProps.js";
|
|
32
|
+
import { formatListAsMarkdown as I } from "./components/backoffice/detail/detailPayloadUtils.js";
|
|
33
|
+
import { BackofficeFilterAction as L } from "./components/backoffice/filters/BackofficeFilterAction.js";
|
|
34
|
+
import { EntityFilterValue as R, EntityFilterValueText as z } from "./components/backoffice/filters/EntityFilterValue.js";
|
|
35
|
+
import { BackofficeHubTemplate as B } from "./components/backoffice/hub/BackofficeHubTemplate.js";
|
|
36
|
+
import { BackofficeLink as V } from "./components/backoffice/links/BackofficeLink.js";
|
|
37
|
+
import { BackofficeLinkLabel as H } from "./components/backoffice/links/BackofficeLinkLabel.js";
|
|
38
|
+
import { BackofficeRightPageLayout as U } from "./components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js";
|
|
39
|
+
import { BackofficeOverviewLayout as W } from "./components/backoffice/overview/BackofficeOverviewLayout.js";
|
|
40
|
+
import { BackofficeFilterableCell as G } from "./components/backoffice/shared/BackofficeFilterableCell.js";
|
|
41
|
+
import { BackofficeEntityLink as K } from "./components/backoffice/refs/BackofficeEntityLink.js";
|
|
42
|
+
import { BackofficeLazyEntityCount as q } from "./components/backoffice/refs/BackofficeLazyEntityCount.js";
|
|
43
|
+
import { BackofficeRelatedCountLink as J } from "./components/backoffice/refs/BackofficeRelatedCountLink.js";
|
|
44
|
+
import { BackofficeTabbedDetailShell as Y } from "./components/backoffice/scaffolds/BackofficeTabbedDetailShell.js";
|
|
45
|
+
import { BackofficeFormattedCurrency as X } from "./components/backoffice/shared/BackofficeFormattedCurrency.js";
|
|
46
|
+
import { BackofficeFormattedNumber as Z } from "./components/backoffice/shared/BackofficeFormattedNumber.js";
|
|
47
|
+
import { BackofficeInlineFilterRow as Q } from "./components/backoffice/shared/BackofficeInlineFilterRow.js";
|
|
48
|
+
import { BackofficeToolsDocPanel as $ } from "./components/backoffice/tools/BackofficeToolsDocPanel.js";
|
|
49
|
+
import { BackofficeToolsErrorFallback as ee } from "./components/backoffice/tools/BackofficeToolsErrorFallback.js";
|
|
50
|
+
import { BackofficeToolsJsonForm as te } from "./components/backoffice/tools/BackofficeToolsJsonForm.js";
|
|
51
|
+
import { BackofficeToolsQueryBoundary as ne } from "./components/backoffice/tools/BackofficeToolsQueryBoundary.js";
|
|
52
|
+
import { parseToolJson as re } from "./components/backoffice/tools/parseToolJson.js";
|
|
53
|
+
import { configureRelayEnvironment as ie, getEnvironment as ae, getNetwork as oe, getRelayOperationActivitySnapshot as se, getRelayTransportSnapshot as ce, reconnectRelayWebSocket as le, refreshRelayWebSocketAuthentication as ue, resetRelayStore as de, subscribeRelayOperationActivity as fe, subscribeRelayTransport as pe } from "./relay/environment.js";
|
|
54
|
+
import { base64UrlToBuffer as me, bufferToBase64Url as he, mapWebAuthnRegistrationError as ge, parseSignCount as _e } from "./modules/webauthn.js";
|
|
55
|
+
import { createUseAuth as ve } from "./hooks/useAuth.js";
|
|
56
|
+
import { useBackofficeListUrlState as ye } from "./hooks/useBackofficeListUrlState.js";
|
|
57
|
+
import { useConditionalSubscription as be } from "./hooks/useConditionalSubscription.js";
|
|
58
|
+
import xe from "./hooks/useCopyToClipboard.js";
|
|
59
|
+
import Se from "./hooks/useInfiniteConnection.js";
|
|
60
|
+
import { useRefetchNeededReload as Ce } from "./hooks/useRefetchNeededReload.js";
|
|
61
|
+
import { createI18nInstance as we } from "./i18n/createI18nInstance.js";
|
|
62
|
+
import { backofficeReactI18nResources as Te, withBackofficeReactI18nResources as Ee } from "./i18n/resources.js";
|
|
63
|
+
import { useReviewStatusLabel as De } from "./i18n/useReviewStatusLabel.js";
|
|
64
|
+
import { BackofficeProvider as Oe } from "./provider/BackofficeProvider.js";
|
|
65
|
+
import { createBackofficeLazyValue as ke } from "./provider/lazyValue.js";
|
|
66
|
+
import { decodeBase64ToUtf8 as Ae, encodeUtf8ToBase64 as je } from "./modules/base64.js";
|
|
67
|
+
import { formatFileSize as Me } from "./modules/formatFileSize.js";
|
|
68
|
+
import { uploadFilesSequentially as Ne } from "./modules/uploads.js";
|
|
69
|
+
import { resolveVisibleDetailPages as Pe } from "./pages/detail/pageResolution.js";
|
|
70
|
+
import { createInlineDataReader as Fe } from "./relay/createInlineReader.js";
|
|
71
|
+
import { appendNodeToConnections as Ie } from "./relay/connectionUtils.js";
|
|
72
|
+
import { RelayProvider as Le } from "./relay/RelayProvider.js";
|
|
73
|
+
import { useRelayOperationActivity as Re } from "./relay/useRelayOperationActivity.js";
|
|
74
|
+
import { configureBackofficeShortAccessTokenRelayEnvironment as ze, configureShortAccessTokenRelayEnvironment as Be } from "./relay/shortAccessTokenEnvironment.js";
|
|
75
|
+
import { useMutationAction as Ve } from "./relay/useMutationAction.js";
|
|
76
|
+
import { identityView as He } from "./relay/identityView.js";
|
|
77
|
+
import { useCursorResumableSubscription as Ue } from "./subscriptions/useCursorResumableSubscription.js";
|
|
78
|
+
export { s as AcceptInvitationScreen, e as AuthRefreshNotice, y as BackofficeBillingUsageChart, T as BackofficeDetailBadgeRow, K as BackofficeEntityLink, D as BackofficeEntitySummaryHeader, O as BackofficeEnumLabel, _ as BackofficeErrorBoundary, L as BackofficeFilterAction, G as BackofficeFilterableCell, X as BackofficeFormattedCurrency, Z as BackofficeFormattedNumber, B as BackofficeHubTemplate, Q as BackofficeInlineFilterRow, C as BackofficeInlineLink, q as BackofficeLazyEntityCount, k as BackofficeLifecycleTimelineSection, V as BackofficeLink, H as BackofficeLinkLabel, W as BackofficeOverviewLayout, Oe as BackofficeProvider, A as BackofficeReferenceValue, J as BackofficeRelatedCountLink, j as BackofficeRelationGrid, j as BackofficeRelationsSummaryGrid, U as BackofficeRightPageLayout, M as BackofficeStatusGroup, E as BackofficeStatusMetaBadge, Y as BackofficeTabbedDetailShell, N as BackofficeTokenUsageBreakdown, $ as BackofficeToolsDocPanel, ee as BackofficeToolsErrorFallback, te as BackofficeToolsJsonForm, ne as BackofficeToolsQueryBoundary, P as BackofficeUsageCostBreakdown, R as EntityFilterValue, z as EntityFilterValueText, g as EntityIdFilterField, v as EntityIdPickerDialog, a as LoginFlow, c as PasswordResetCompleteScreen, l as PasswordResetRequestScreen, Le as RelayProvider, n as TotpQrCode, u as VerifyEmailScreen, Ie as appendNodeToConnections, Te as backofficeReactI18nResources, me as base64UrlToBuffer, he as bufferToBase64Url, w as buildDataTableColumns, r as buildTotpOtpAuthUri, ze as configureBackofficeShortAccessTokenRelayEnvironment, ie as configureRelayEnvironment, Be as configureShortAccessTokenRelayEnvironment, i as createBackofficeAuthHeaders, F as createBackofficeEntityLinkProps, ke as createBackofficeLazyValue, we as createI18nInstance, Fe as createInlineDataReader, ve as createUseAuth, Ae as decodeBase64ToUtf8, je as encodeUtf8ToBase64, Me as formatFileSize, I as formatListAsMarkdown, ae as getEnvironment, oe as getNetwork, se as getRelayOperationActivitySnapshot, ce as getRelayTransportSnapshot, He as identityView, ge as mapWebAuthnRegistrationError, _e as parseSignCount, re as parseToolJson, le as reconnectRelayWebSocket, ue as refreshRelayWebSocketAuthentication, d as requireField, f as requireLinkedRecordId, de as resetRelayStore, p as resolveAgentStartOutcome, x as resolveBackofficeLink, b as resolveBackofficeTargetIcon, m as resolveMutationOutcome, Pe as resolveVisibleDetailPages, fe as subscribeRelayOperationActivity, pe as subscribeRelayTransport, o as synchronizeAuthStatusQuery, Ne as uploadFilesSequentially, t as useAuthRefreshStateSnapshot, h as useBackofficeConfig, S as useBackofficeLink, ye as useBackofficeListUrlState, be as useConditionalSubscription, xe as useCopyToClipboard, Ue as useCursorResumableSubscription, Se as useInfiniteConnection, Ve as useMutationAction, Ce as useRefetchNeededReload, Re as useRelayOperationActivity, De as useReviewStatusLabel, Ee as withBackofficeReactI18nResources };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { getBackofficeLoginPath as e } from "../router/backofficeAuthPaths.js";
|
|
2
|
+
import { AcceptInvitationScreen as t } from "../auth/pages/AcceptInvitationScreen.js";
|
|
3
|
+
import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
|
|
4
|
+
import { useBackofficeAuth as r } from "../hooks/useBackofficeAuth.js";
|
|
5
5
|
import { useCallback as i, useContext as a } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
7
|
import s from "@plumile/router/routing/RoutingContext.js";
|
|
8
8
|
//#region src/pages/BackofficeAcceptInvitationPage.tsx
|
|
9
9
|
var c = () => {
|
|
10
|
-
let c = a(s), { basePath: l } =
|
|
10
|
+
let c = a(s), { basePath: l } = n(), u = r(), d = i(() => {
|
|
11
11
|
c?.history.push({ pathname: l });
|
|
12
12
|
}, [l, c?.history]), f = i(() => {
|
|
13
|
-
c?.history.push({ pathname:
|
|
13
|
+
c?.history.push({ pathname: e(l) });
|
|
14
14
|
}, [l, c?.history]);
|
|
15
|
-
return /* @__PURE__ */ o(
|
|
15
|
+
return /* @__PURE__ */ o(t, {
|
|
16
16
|
auth: u,
|
|
17
17
|
onSuccessRedirect: d,
|
|
18
18
|
onBackToLogin: f
|
|
@@ -194,10 +194,12 @@ var c = (e, t, n) => {
|
|
|
194
194
|
break;
|
|
195
195
|
case "number": {
|
|
196
196
|
let e = t.value(o), n = null;
|
|
197
|
-
if (e != null)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
if (e != null) {
|
|
198
|
+
if (t.format === "currency") {
|
|
199
|
+
let t = h(e);
|
|
200
|
+
n = s("span", { title: g?.(e) ?? void 0 }, t);
|
|
201
|
+
} else n = t.format === "percent" ? _(e) : m(e);
|
|
202
|
+
}
|
|
201
203
|
T.push({
|
|
202
204
|
id: O,
|
|
203
205
|
label: i(t.label, d),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailPage.view-helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailPage.view-helpers.ts"],"sourcesContent":["/* eslint-disable no-ternary */\nimport type {\n BackofficeBadgeItem,\n BackofficeColumnSpec,\n BackofficeDetailBlockSpec,\n BackofficeDetailFieldSpec,\n BackofficeDetailHeaderConfig,\n BackofficeDetailHeaderMetaSpec,\n BackofficeDetailHeaderStatusSpec,\n BackofficeFieldSize,\n BackofficeFlagVariant,\n BackofficeInlineValueSpec,\n BackofficePayloadFormat,\n BackofficeTone,\n BackofficeValueLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport type { TFunction } from 'i18next';\nimport { Fragment, createElement, type ReactNode } from 'react';\n\nimport {\n isEmptyText,\n resolveLabel,\n resolveBadgeTone,\n resolveValueLabel,\n} from './BackofficeEntityDetailPage.helpers.js';\nimport {\n normalizeTechnicalIdentifier,\n TechnicalIdentifierValue,\n type TechnicalIdentifierVariant,\n} from '../components/backoffice/technical/TechnicalIdentifierValue.js';\n\nexport type ResolvedFieldItem = {\n id: string;\n label: string;\n size: BackofficeFieldSize;\n value: ReactNode;\n copyValue?: string;\n fullWidth?: boolean;\n};\n\nexport type ResolvedHeaderItem = {\n id: string;\n label: string;\n value: ReactNode;\n};\n\nexport type FlagIconName =\n | 'shield-lock'\n | 'shield-off'\n | 'settings-check'\n | 'settings-x'\n | 'x-badge'\n | 'chat-check'\n | 'key'\n | 'key-off'\n | 'lock'\n | 'lock-open'\n | 'robot-check'\n | 'robot-x'\n | 'rocket'\n | 'rocket-off';\n\nexport type ResolvedFlagTag = {\n tone: 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n label: string;\n iconName?: FlagIconName;\n};\n\nexport const resolveFlagTag = (\n variant: BackofficeFlagVariant,\n value: boolean,\n t: TFunction,\n): ResolvedFlagTag => {\n switch (variant) {\n case 'yesNo':\n return value\n ? { tone: 'success', label: t('common.boolean.yes') }\n : { tone: 'neutral', label: t('common.boolean.no') };\n case 'capability':\n return value\n ? {\n tone: 'success',\n label: t('flags.capability.allowed'),\n iconName: 'shield-lock',\n }\n : {\n tone: 'neutral',\n label: t('flags.capability.denied'),\n iconName: 'shield-off',\n };\n case 'enabled':\n return value\n ? {\n tone: 'success',\n label: t('flags.enabled.enabled'),\n iconName: 'settings-check',\n }\n : {\n tone: 'neutral',\n label: t('flags.enabled.disabled'),\n iconName: 'settings-x',\n };\n case 'failure':\n return value\n ? {\n tone: 'danger',\n label: t('flags.failure.failed'),\n iconName: 'x-badge',\n }\n : {\n tone: 'success',\n label: t('flags.failure.ok'),\n iconName: 'chat-check',\n };\n case 'encrypted':\n return value\n ? {\n tone: 'info',\n label: t('flags.encrypted.encrypted'),\n iconName: 'key',\n }\n : {\n tone: 'neutral',\n label: t('flags.encrypted.notEncrypted'),\n iconName: 'key-off',\n };\n case 'locked':\n return value\n ? {\n tone: 'warning',\n label: t('flags.locked.locked'),\n iconName: 'lock',\n }\n : {\n tone: 'success',\n label: t('flags.locked.unlocked'),\n iconName: 'lock-open',\n };\n case 'default':\n return value\n ? { tone: 'info', label: t('flags.default.default') }\n : { tone: 'neutral', label: t('flags.default.notDefault') };\n case 'agentManaged':\n return value\n ? {\n tone: 'info',\n label: t('flags.agentManaged.agentManaged'),\n iconName: 'robot-check',\n }\n : {\n tone: 'neutral',\n label: t('flags.agentManaged.userManaged'),\n iconName: 'robot-x',\n };\n case 'deployedProduction':\n return value\n ? {\n tone: 'success',\n label: t('flags.deployedProduction.deployed'),\n iconName: 'rocket',\n }\n : {\n tone: 'neutral',\n label: t('flags.deployedProduction.notDeployed'),\n iconName: 'rocket-off',\n };\n case 'forced':\n return value\n ? { tone: 'warning', label: t('flags.forced.forced') }\n : { tone: 'neutral', label: t('flags.forced.normal') };\n default:\n throw new Error(`Unsupported flag variant: ${String(variant)}`);\n }\n};\n\nexport const resolveInlineValue = (\n value: BackofficeInlineValueSpec,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n },\n): ReactNode => {\n const { tApp, t, resolveEntityHref, renderLink } = options;\n const fallback = t('common.notAvailable');\n\n if (value.type === 'text') {\n const resolved = resolveValueLabel(value.value, tApp);\n return isEmptyText(resolved) ? fallback : resolved;\n }\n\n if (value.type === 'entityRef') {\n const { id } = value;\n if (id == null || id.trim() === '') {\n return fallback;\n }\n const resolvedLabel = resolveValueLabel(value.label, tApp);\n const label =\n resolvedLabel != null && String(resolvedLabel).trim() !== ''\n ? resolvedLabel\n : null;\n if (label == null) {\n return fallback;\n }\n const href = resolveEntityHref?.(value.entity, id) ?? null;\n return href != null ? renderLink(href, label) : label;\n }\n\n const { href } = value;\n if (href == null || href.trim() === '') {\n return fallback;\n }\n const label = resolveValueLabel(value.label, tApp);\n if (isEmptyText(label)) {\n return fallback;\n }\n return renderLink(href, label);\n};\n\nexport const resolveHeaderMeta = <Node>(\n meta: BackofficeDetailHeaderMetaSpec<Node>,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n },\n): ReactNode => {\n const { tApp, t, resolveEntityHref, renderDate, renderLink } = options;\n const fallback = t('common.notAvailable');\n\n if (meta.type === 'dateTime') {\n return renderDate(meta.value(node), fallback);\n }\n\n if (meta.type === 'entityRef') {\n const idValue = meta.id(node);\n if (idValue == null || idValue.trim() === '') {\n return fallback;\n }\n const labelValue = resolveValueLabel(meta.value?.(node), tApp);\n const label =\n labelValue != null && String(labelValue).trim() !== ''\n ? labelValue\n : null;\n if (label == null) {\n return fallback;\n }\n const href = resolveEntityHref?.(meta.entity, idValue) ?? null;\n return href != null ? renderLink(href, label) : label;\n }\n\n if (meta.type === 'link') {\n const href = meta.href(node);\n const labelValue = resolveValueLabel(meta.value(node), tApp);\n if (href == null || href.trim() === '' || isEmptyText(labelValue)) {\n return fallback;\n }\n return renderLink(href, labelValue);\n }\n\n const value = resolveValueLabel(meta.value(node), tApp);\n return isEmptyText(value) ? fallback : value;\n};\n\nexport const resolveHeaderStatus = <Node>(\n status: BackofficeDetailHeaderStatusSpec<Node>,\n node: Node,\n tApp: TFunction,\n renderers: {\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n },\n): ReactNode | undefined => {\n if (status.type === 'badgeRow') {\n const items = status.items(node).map((item) => {\n const resolvedLabel = resolveValueLabel(item.label, tApp);\n const label = resolvedLabel == null ? '' : String(resolvedLabel);\n return { ...item, label };\n });\n if (items.length === 0) {\n return undefined;\n }\n return renderers.renderBadgeRow(items);\n }\n\n const value = resolveValueLabel(status.value(node), tApp);\n const label = value == null ? '' : String(value);\n if (label.trim() === '') {\n return undefined;\n }\n const tone = resolveBadgeTone(status.tone, node);\n return renderers.renderTag(tone, label);\n};\n\nexport const buildFieldItems = <Node>(\n fields: readonly BackofficeDetailFieldSpec<Node>[],\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n formatNumber: (value: number | null | undefined) => string;\n formatCurrency: (value: number | null | undefined) => string;\n formatCurrencyTitle?: (value: number | null | undefined) => string | null;\n formatPercent: (value: number | null | undefined) => string;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderFlagTag: (tag: ResolvedFlagTag) => ReactNode;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderTaggedValue: (\n tag: {\n label: string;\n tone?: ReturnType<typeof resolveBadgeTone<Node>>;\n } | null,\n value: ReactNode,\n ) => ReactNode;\n wrapCustomNode: (id: string, node: ReactNode) => ReactNode;\n },\n): {\n items: ResolvedFieldItem[];\n customNodes: ReactNode[];\n} => {\n const {\n tApp,\n t,\n resolveEntityHref,\n formatNumber,\n formatCurrency,\n formatCurrencyTitle,\n formatPercent,\n renderTag,\n renderBadgeRow,\n renderDate,\n renderFlagTag,\n renderLink,\n renderTaggedValue,\n wrapCustomNode,\n } = options;\n const items: ResolvedFieldItem[] = [];\n const customNodes: ReactNode[] = [];\n const fallback = t('common.notAvailable');\n\n fields.forEach((field, index) => {\n const id = `${field.type}-${index}`;\n\n switch (field.type) {\n case 'text': {\n const value = resolveValueLabel(field.value(node), tApp);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value,\n copyValue: field.copyValue?.(node) ?? undefined,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'badge': {\n const value = resolveValueLabel(field.value(node), tApp);\n const label = value != null ? String(value) : '';\n const tone = resolveBadgeTone(field.tone, node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: label.trim() !== '' ? renderTag(tone, label) : null,\n });\n break;\n }\n case 'badgeRow': {\n const badgeItems = field.items(node).map((item) => {\n const resolvedLabel = resolveValueLabel(item.label, tApp);\n const label = resolvedLabel == null ? '' : String(resolvedLabel);\n return { ...item, label };\n });\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: badgeItems.length > 0 ? renderBadgeRow(badgeItems) : null,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'dateTime': {\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: renderDate(field.value(node), fallback),\n });\n break;\n }\n case 'number': {\n const value = field.value(node);\n let formatted: ReactNode | null = null;\n if (value != null) {\n if (field.format === 'currency') {\n const label = formatCurrency(value);\n formatted = createElement(\n 'span',\n { title: formatCurrencyTitle?.(value) ?? undefined },\n label,\n );\n } else if (field.format === 'percent') {\n formatted = formatPercent(value);\n } else {\n formatted = formatNumber(value);\n }\n }\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: formatted,\n });\n break;\n }\n case 'flag': {\n const value = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n value != null\n ? renderFlagTag(resolveFlagTag(field.variant, value, t))\n : null,\n });\n break;\n }\n case 'entityRef': {\n const idValue = field.id(node);\n let value: ReactNode | null = null;\n if (idValue != null && idValue.trim() !== '') {\n const labelValue = field.value?.(node);\n const label =\n labelValue != null && labelValue.trim() !== '' ? labelValue : null;\n const href = resolveEntityHref?.(field.entity, idValue) ?? null;\n if (label != null) {\n value = href != null ? renderLink(href, label) : label;\n }\n }\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: value ?? fallback,\n });\n break;\n }\n case 'technicalIdentifier': {\n const value = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n value == null\n ? null\n : createElement(TechnicalIdentifierValue, {\n value,\n copyValue: field.copyValue?.(node) ?? undefined,\n variant: field.variant,\n copyLabel: t('common.actions.copy'),\n }),\n copyValue: field.copyValue?.(node) ?? undefined,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'link': {\n const href = field.href(node);\n const labelValue = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n href != null && href.trim() !== '' && !isEmptyText(labelValue)\n ? renderLink(href, labelValue)\n : null,\n });\n break;\n }\n case 'taggedValue': {\n const tag = field.tag(node);\n const valueNode = resolveInlineValue(field.value(node), {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n });\n const resolvedTag =\n tag == null\n ? null\n : {\n ...tag,\n label: (() => {\n const labelValue = resolveValueLabel(tag.label, tApp);\n return labelValue == null ? '' : String(labelValue);\n })(),\n };\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n resolvedTag != null || valueNode != null\n ? renderTaggedValue(resolvedTag, valueNode)\n : null,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'custom': {\n const custom = field.render(node) as ReactNode;\n if (custom == null) {\n break;\n }\n if (field.label != null) {\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: custom,\n fullWidth: field.fullWidth,\n });\n break;\n }\n customNodes.push(wrapCustomNode(id, custom));\n break;\n }\n default:\n break;\n }\n });\n\n return { items, customNodes };\n};\n\nexport const resolveHeaderItems = <Node>(\n header: BackofficeDetailHeaderConfig<Node>,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n },\n): {\n title: string;\n subtitle?: ReactNode;\n badges?: ReactNode;\n status?: ReactNode;\n items?: readonly ResolvedHeaderItem[];\n} => {\n const {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n renderDate,\n renderTag,\n renderBadgeRow,\n } = options;\n const resolvedTitle =\n header.titleValue?.(node, tApp) ?? resolveLabel(header.title, tApp);\n const rawNodeId =\n node != null &&\n typeof node === 'object' &&\n 'id' in node &&\n typeof node.id === 'string'\n ? node.id.trim()\n : null;\n const title =\n resolvedTitle.trim() === '' ||\n (rawNodeId != null && resolvedTitle.trim() === rawNodeId)\n ? resolveLabel(header.title, tApp)\n : resolvedTitle;\n\n let subtitleNode: ReactNode | undefined;\n if (header.subtitleItems != null && header.subtitleItems.length > 0) {\n const { subtitleItems } = header;\n const separator = header.subtitleSeparator ?? ' / ';\n const parts: ReactNode[] = [];\n subtitleItems.forEach((item, index) => {\n parts.push(\n createElement(\n 'span',\n { key: item.id },\n resolveInlineValue(item.value(node), {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n }),\n ),\n );\n if (index < subtitleItems.length - 1) {\n parts.push(createElement('span', { key: `${item.id}-sep` }, separator));\n }\n });\n subtitleNode = createElement('span', null, ...parts);\n } else {\n const subtitleValue =\n header.subtitleValue?.(node, tApp) ??\n (header.subtitle != null ? resolveLabel(header.subtitle, tApp) : null);\n subtitleNode =\n subtitleValue != null && subtitleValue.trim() !== ''\n ? subtitleValue\n : undefined;\n }\n\n const badgeNodes: ReactNode[] = [];\n header.badges?.forEach((badge, index) => {\n const label = resolveLabel(badge.label, tApp);\n const resolvedValue = resolveValueLabel(badge.value(node), tApp);\n const value = resolvedValue == null ? '' : String(resolvedValue);\n if (value.trim() === '') {\n return;\n }\n badgeNodes.push(\n renderTag(resolveBadgeTone(badge.tone, node), `${label}: ${value}`),\n );\n if (typeof badgeNodes[badgeNodes.length - 1] === 'object') {\n badgeNodes[badgeNodes.length - 1] = createElement(\n Fragment,\n { key: `${label}-${index}` },\n badgeNodes[badgeNodes.length - 1],\n );\n }\n });\n\n const status =\n header.status != null\n ? resolveHeaderStatus(header.status, node, tApp, {\n renderBadgeRow,\n renderTag,\n })\n : undefined;\n\n const items = header.meta?.map((meta, index) => {\n const label = resolveLabel(meta.label, tApp);\n return {\n id: `${label}-${index}`,\n label,\n value: resolveHeaderMeta(meta, node, {\n tApp,\n t,\n resolveEntityHref,\n renderDate,\n renderLink,\n }),\n };\n });\n\n return {\n title,\n subtitle: subtitleNode,\n badges:\n badgeNodes.length > 0\n ? createElement(Fragment, null, ...badgeNodes)\n : undefined,\n status,\n items,\n };\n};\n\nconst renderTimelinePayload = (payload: unknown): ReactNode | undefined => {\n if (payload == null) {\n return undefined;\n }\n if (\n typeof payload === 'string' ||\n typeof payload === 'number' ||\n typeof payload === 'boolean'\n ) {\n return String(payload);\n }\n\n try {\n return createElement('pre', null, JSON.stringify(payload, null, 2));\n } catch {\n const fallback =\n payload instanceof Error ? payload.message : '[unserializable payload]';\n return createElement('pre', null, fallback);\n }\n};\n\nconst resolveTechnicalVariant = (\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text',\n): TechnicalIdentifierVariant | null => {\n if (refKind === 'id' || refKind === 'hash' || refKind === 'external') {\n return refKind;\n }\n return null;\n};\n\nconst renderReferenceValue = (args: {\n value: BackofficeValueLabel;\n href?: string | null;\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text';\n copyValue?: string | null;\n tApp: TFunction;\n t: TFunction;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n}): ReactNode => {\n const { value, href, refKind, copyValue, tApp, t, renderLink } = args;\n const resolvedValue = resolveValueLabel(value, tApp);\n const technicalVariant = resolveTechnicalVariant(refKind);\n if (technicalVariant != null) {\n const normalized = normalizeTechnicalIdentifier(resolvedValue);\n if (normalized == null) {\n return t('common.notAvailable');\n }\n return createElement(TechnicalIdentifierValue, {\n value: normalized,\n copyValue: copyValue ?? normalized,\n variant: technicalVariant,\n copyLabel: t('common.actions.copy'),\n });\n }\n if (href != null && href.trim() !== '' && !isEmptyText(resolvedValue)) {\n return renderLink(href, resolvedValue);\n }\n return resolvedValue ?? t('common.notAvailable');\n};\n\nexport const renderBlocks = <Node>(\n blocks: readonly BackofficeDetailBlockSpec<Node>[] | undefined,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref: (entityId: string, refId: string) => string | null;\n keyPrefix?: string;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderDate: (\n value: string | number | Date | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderTag: (tone: BackofficeTone, label: string) => ReactNode;\n renderMetricGroup: (args: {\n key: string;\n title: string;\n description?: string;\n density?: 'compact' | 'comfortable';\n items: readonly {\n id: string;\n label: string;\n value: ReactNode;\n hint?: ReactNode;\n tone?: BackofficeTone;\n copyValue?: string;\n }[];\n }) => ReactNode;\n renderTimeline: (args: {\n key: string;\n title: string;\n description?: string;\n events: readonly {\n id: string;\n label: string;\n timestamp?: ReactNode;\n description?: ReactNode;\n actor?: ReactNode;\n tone?: BackofficeTone;\n payload?: ReactNode;\n }[];\n }) => ReactNode;\n renderAuditTimeline: (args: {\n key: string;\n title: string;\n description?: string;\n events: readonly {\n id: string;\n title: ReactNode;\n time?: ReactNode;\n actor?: ReactNode;\n source?: ReactNode;\n }[];\n }) => ReactNode;\n renderRelations: (args: {\n key: string;\n title: string;\n description?: string;\n items: readonly {\n id: string;\n label: string;\n count?: ReactNode;\n href?: string;\n description?: ReactNode;\n tone?: BackofficeTone;\n }[];\n }) => ReactNode;\n renderContextStack: (args: {\n key: string;\n title: string;\n items: readonly {\n id: string;\n label: string;\n value: ReactNode | null | undefined;\n }[];\n }) => ReactNode;\n renderCustomSection: (\n key: string,\n title: string,\n child: ReactNode,\n ) => ReactNode;\n wrapCustomNode: (key: string, node: ReactNode) => ReactNode;\n resolveTableColumns: (\n columns: readonly BackofficeColumnSpec[],\n ) => readonly DataTableColumn<unknown>[];\n renderTable: (args: {\n key: string;\n title: string;\n description?: string;\n columns: readonly DataTableColumn<unknown>[];\n rows: readonly unknown[];\n }) => ReactNode;\n renderPayload: (args: {\n key: string;\n title: string;\n description?: string;\n content: unknown;\n format: BackofficePayloadFormat;\n }) => ReactNode;\n renderKeyValueListSection: (args: {\n key: string;\n title: string;\n description?: string;\n items: readonly { id: string; label: string; value: ReactNode }[];\n }) => ReactNode;\n },\n): ReactNode[] => {\n const { tApp, t, keyPrefix } = options;\n if (blocks == null || blocks.length === 0) {\n return [];\n }\n\n return blocks.map((block, index): ReactNode => {\n const key =\n keyPrefix != null\n ? `${keyPrefix}-${block.kind}-${index}`\n : `${block.kind}-${index}`;\n\n if (block.kind === 'custom') {\n const custom = block.render(node) as ReactNode;\n if (custom == null) {\n return null;\n }\n if (block.label != null) {\n return options.renderCustomSection(\n key,\n resolveLabel(block.label, tApp),\n custom,\n );\n }\n return options.wrapCustomNode(key, custom);\n }\n\n const title =\n 'title' in block\n ? resolveLabel(block.title, tApp)\n : resolveLabel(block.label, tApp);\n const description =\n block.description != null\n ? resolveLabel(block.description, tApp)\n : undefined;\n\n if (block.kind === 'summary') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.items.map((item) => {\n const value = resolveValueLabel(item.value(node), tApp);\n const href = item.href?.(node);\n const tone = item.tone?.(node);\n let valueNode: ReactNode = value ?? t('common.notAvailable');\n if (href != null && href.trim() !== '' && !isEmptyText(value)) {\n valueNode = options.renderLink(href, value);\n } else if (tone != null && !isEmptyText(value)) {\n valueNode = options.renderTag(tone, String(value));\n }\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value: valueNode,\n };\n }),\n });\n }\n\n if (block.kind === 'metrics') {\n return options.renderMetricGroup({\n key,\n title,\n description,\n density: block.density,\n items: block.items.map((item) => {\n const formattedValue = item.formattedValue?.(node);\n const value = resolveValueLabel(item.value(node), tApp);\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value: formattedValue ?? value ?? t('common.notAvailable'),\n hint: resolveValueLabel(item.hint?.(node), tApp),\n tone: item.tone?.(node),\n copyValue: item.copyValue?.(node) ?? undefined,\n };\n }),\n });\n }\n\n if (block.kind === 'states') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.states.map((state) => {\n const display = state.getDisplay(state.value(node), node);\n return {\n id: state.id,\n label: resolveLabel(state.label, tApp),\n value: options.renderTag(\n display.tone,\n String(\n resolveValueLabel(display.label, tApp) ??\n t('common.notAvailable'),\n ),\n ),\n };\n }),\n });\n }\n\n if (block.kind === 'context') {\n return options.renderContextStack({\n key,\n title,\n items: block.items.map((item) => {\n const value = resolveValueLabel(item.value(node), tApp);\n const href = item.href?.(node);\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value:\n href != null && href.trim() !== '' && !isEmptyText(value)\n ? options.renderLink(href, value)\n : value,\n };\n }),\n });\n }\n\n if (block.kind === 'relationSummary') {\n return options.renderRelations({\n key,\n title,\n description,\n items: block.items.map((item) => {\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n count: item.count?.(node) ?? null,\n href: item.href?.(node) ?? undefined,\n description: resolveValueLabel(item.description?.(node), tApp),\n tone: item.tone?.(node),\n };\n }),\n });\n }\n\n if (block.kind === 'timeline') {\n return options.renderTimeline({\n key,\n title,\n description,\n events: block.events.map((event) => {\n const state = event.state?.(node);\n const stateLabel =\n state == null ? null : resolveValueLabel(state.label, tApp);\n const stateText = stateLabel == null ? null : String(stateLabel);\n return {\n id: event.id,\n label:\n stateText == null || stateText.trim() === ''\n ? resolveLabel(event.label, tApp)\n : `${resolveLabel(event.label, tApp)}: ${stateText}`,\n timestamp:\n event.timestamp == null\n ? undefined\n : options.renderDate(\n event.timestamp(node),\n t('common.notAvailable'),\n ),\n description: resolveValueLabel(event.description?.(node), tApp),\n actor: resolveValueLabel(event.actor?.(node), tApp),\n tone: state?.tone,\n payload: renderTimelinePayload(event.payload?.(node)),\n };\n }),\n });\n }\n\n if (block.kind === 'audit') {\n return options.renderAuditTimeline({\n key,\n title,\n description,\n events: block.items.map((item) => {\n const actor = resolveValueLabel(item.actor?.(node), tApp);\n const source = resolveValueLabel(item.source?.(node), tApp);\n return {\n id: item.id,\n title: resolveLabel(item.label, tApp),\n time: options.renderDate(\n item.timestamp?.(node),\n t('common.notAvailable'),\n ),\n actor: isEmptyText(actor) ? undefined : actor,\n source: isEmptyText(source) ? undefined : source,\n };\n }),\n });\n }\n\n if (block.kind === 'references') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.references.map((reference) => {\n const href = reference.href?.(node);\n return {\n id: reference.id,\n label: resolveLabel(reference.label, tApp),\n value: renderReferenceValue({\n value: reference.value(node),\n href,\n refKind: reference.refKind ?? 'text',\n copyValue: reference.copyValue?.(node) ?? undefined,\n tApp,\n t,\n renderLink: options.renderLink,\n }),\n };\n }),\n });\n }\n\n if (block.kind === 'actionResult') {\n const items: { id: string; label: string; value: ReactNode }[] = [];\n const status = block.status?.(node);\n if (status != null) {\n items.push({\n id: `${block.id}-status`,\n label: t('detail.actionResult.status'),\n value: options.renderTag(\n status.tone,\n String(\n resolveValueLabel(status.label, tApp) ?? t('common.notAvailable'),\n ),\n ),\n });\n }\n const message = resolveValueLabel(block.message?.(node), tApp);\n if (!isEmptyText(message)) {\n items.push({\n id: `${block.id}-message`,\n label: t('detail.actionResult.message'),\n value: message,\n });\n }\n block.references?.forEach((reference) => {\n items.push({\n id: reference.id,\n label: resolveLabel(reference.label, tApp),\n value: renderReferenceValue({\n value: reference.value(node),\n href: reference.href?.(node),\n refKind: reference.refKind ?? 'text',\n copyValue: reference.copyValue?.(node) ?? undefined,\n tApp,\n t,\n renderLink: options.renderLink,\n }),\n });\n });\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items,\n });\n }\n\n if (block.kind === 'technicalFacts') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.facts.map((fact) => {\n const value = resolveValueLabel(fact.value(node), tApp);\n const href = fact.href?.(node);\n const copyValue = fact.copyValue?.(node) ?? undefined;\n return {\n id: fact.id,\n label: resolveLabel(fact.label, tApp),\n value:\n copyValue != null && copyValue.trim() !== ''\n ? createElement(TechnicalIdentifierValue, {\n value: value ?? copyValue,\n copyValue,\n variant: 'external',\n copyLabel: t('common.actions.copy'),\n })\n : href != null && href.trim() !== '' && !isEmptyText(value)\n ? options.renderLink(href, value)\n : (value ?? t('common.notAvailable')),\n };\n }),\n });\n }\n\n if (block.kind === 'table') {\n return options.renderTable({\n key,\n title,\n description,\n columns: options.resolveTableColumns(block.columns),\n rows: block.rows(node) as readonly unknown[],\n });\n }\n\n return options.renderPayload({\n key,\n title,\n description,\n content: block.value(node),\n format: block.format ?? 'json',\n });\n });\n};\n"],"mappings":";;;;AAqEA,IAAa,KACX,GACA,GACA,MACoB;CACpB,QAAQ,GAAR;EACE,KAAK,SACH,OAAO,IACH;GAAE,MAAM;GAAW,OAAO,EAAE,oBAAoB;EAAE,IAClD;GAAE,MAAM;GAAW,OAAO,EAAE,mBAAmB;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AAC;AACH"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailPage.view-helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailPage.view-helpers.ts"],"sourcesContent":["/* eslint-disable no-ternary */\nimport type {\n BackofficeBadgeItem,\n BackofficeColumnSpec,\n BackofficeDetailBlockSpec,\n BackofficeDetailFieldSpec,\n BackofficeDetailHeaderConfig,\n BackofficeDetailHeaderMetaSpec,\n BackofficeDetailHeaderStatusSpec,\n BackofficeFieldSize,\n BackofficeFlagVariant,\n BackofficeInlineValueSpec,\n BackofficePayloadFormat,\n BackofficeTone,\n BackofficeValueLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport type { TFunction } from 'i18next';\nimport { Fragment, createElement, type ReactNode } from 'react';\n\nimport {\n isEmptyText,\n resolveLabel,\n resolveBadgeTone,\n resolveValueLabel,\n} from './BackofficeEntityDetailPage.helpers.js';\nimport {\n normalizeTechnicalIdentifier,\n TechnicalIdentifierValue,\n type TechnicalIdentifierVariant,\n} from '../components/backoffice/technical/TechnicalIdentifierValue.js';\n\nexport type ResolvedFieldItem = {\n id: string;\n label: string;\n size: BackofficeFieldSize;\n value: ReactNode;\n copyValue?: string;\n fullWidth?: boolean;\n};\n\nexport type ResolvedHeaderItem = {\n id: string;\n label: string;\n value: ReactNode;\n};\n\nexport type FlagIconName =\n | 'shield-lock'\n | 'shield-off'\n | 'settings-check'\n | 'settings-x'\n | 'x-badge'\n | 'chat-check'\n | 'key'\n | 'key-off'\n | 'lock'\n | 'lock-open'\n | 'robot-check'\n | 'robot-x'\n | 'rocket'\n | 'rocket-off';\n\nexport type ResolvedFlagTag = {\n tone: 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n label: string;\n iconName?: FlagIconName;\n};\n\nexport const resolveFlagTag = (\n variant: BackofficeFlagVariant,\n value: boolean,\n t: TFunction,\n): ResolvedFlagTag => {\n switch (variant) {\n case 'yesNo':\n return value\n ? { tone: 'success', label: t('common.boolean.yes') }\n : { tone: 'neutral', label: t('common.boolean.no') };\n case 'capability':\n return value\n ? {\n tone: 'success',\n label: t('flags.capability.allowed'),\n iconName: 'shield-lock',\n }\n : {\n tone: 'neutral',\n label: t('flags.capability.denied'),\n iconName: 'shield-off',\n };\n case 'enabled':\n return value\n ? {\n tone: 'success',\n label: t('flags.enabled.enabled'),\n iconName: 'settings-check',\n }\n : {\n tone: 'neutral',\n label: t('flags.enabled.disabled'),\n iconName: 'settings-x',\n };\n case 'failure':\n return value\n ? {\n tone: 'danger',\n label: t('flags.failure.failed'),\n iconName: 'x-badge',\n }\n : {\n tone: 'success',\n label: t('flags.failure.ok'),\n iconName: 'chat-check',\n };\n case 'encrypted':\n return value\n ? {\n tone: 'info',\n label: t('flags.encrypted.encrypted'),\n iconName: 'key',\n }\n : {\n tone: 'neutral',\n label: t('flags.encrypted.notEncrypted'),\n iconName: 'key-off',\n };\n case 'locked':\n return value\n ? {\n tone: 'warning',\n label: t('flags.locked.locked'),\n iconName: 'lock',\n }\n : {\n tone: 'success',\n label: t('flags.locked.unlocked'),\n iconName: 'lock-open',\n };\n case 'default':\n return value\n ? { tone: 'info', label: t('flags.default.default') }\n : { tone: 'neutral', label: t('flags.default.notDefault') };\n case 'agentManaged':\n return value\n ? {\n tone: 'info',\n label: t('flags.agentManaged.agentManaged'),\n iconName: 'robot-check',\n }\n : {\n tone: 'neutral',\n label: t('flags.agentManaged.userManaged'),\n iconName: 'robot-x',\n };\n case 'deployedProduction':\n return value\n ? {\n tone: 'success',\n label: t('flags.deployedProduction.deployed'),\n iconName: 'rocket',\n }\n : {\n tone: 'neutral',\n label: t('flags.deployedProduction.notDeployed'),\n iconName: 'rocket-off',\n };\n case 'forced':\n return value\n ? { tone: 'warning', label: t('flags.forced.forced') }\n : { tone: 'neutral', label: t('flags.forced.normal') };\n default:\n throw new Error(`Unsupported flag variant: ${String(variant)}`);\n }\n};\n\nexport const resolveInlineValue = (\n value: BackofficeInlineValueSpec,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n },\n): ReactNode => {\n const { tApp, t, resolveEntityHref, renderLink } = options;\n const fallback = t('common.notAvailable');\n\n if (value.type === 'text') {\n const resolved = resolveValueLabel(value.value, tApp);\n return isEmptyText(resolved) ? fallback : resolved;\n }\n\n if (value.type === 'entityRef') {\n const { id } = value;\n if (id == null || id.trim() === '') {\n return fallback;\n }\n const resolvedLabel = resolveValueLabel(value.label, tApp);\n const label =\n resolvedLabel != null && String(resolvedLabel).trim() !== ''\n ? resolvedLabel\n : null;\n if (label == null) {\n return fallback;\n }\n const href = resolveEntityHref?.(value.entity, id) ?? null;\n return href != null ? renderLink(href, label) : label;\n }\n\n const { href } = value;\n if (href == null || href.trim() === '') {\n return fallback;\n }\n const label = resolveValueLabel(value.label, tApp);\n if (isEmptyText(label)) {\n return fallback;\n }\n return renderLink(href, label);\n};\n\nexport const resolveHeaderMeta = <Node>(\n meta: BackofficeDetailHeaderMetaSpec<Node>,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n },\n): ReactNode => {\n const { tApp, t, resolveEntityHref, renderDate, renderLink } = options;\n const fallback = t('common.notAvailable');\n\n if (meta.type === 'dateTime') {\n return renderDate(meta.value(node), fallback);\n }\n\n if (meta.type === 'entityRef') {\n const idValue = meta.id(node);\n if (idValue == null || idValue.trim() === '') {\n return fallback;\n }\n const labelValue = resolveValueLabel(meta.value?.(node), tApp);\n const label =\n labelValue != null && String(labelValue).trim() !== ''\n ? labelValue\n : null;\n if (label == null) {\n return fallback;\n }\n const href = resolveEntityHref?.(meta.entity, idValue) ?? null;\n return href != null ? renderLink(href, label) : label;\n }\n\n if (meta.type === 'link') {\n const href = meta.href(node);\n const labelValue = resolveValueLabel(meta.value(node), tApp);\n if (href == null || href.trim() === '' || isEmptyText(labelValue)) {\n return fallback;\n }\n return renderLink(href, labelValue);\n }\n\n const value = resolveValueLabel(meta.value(node), tApp);\n return isEmptyText(value) ? fallback : value;\n};\n\nexport const resolveHeaderStatus = <Node>(\n status: BackofficeDetailHeaderStatusSpec<Node>,\n node: Node,\n tApp: TFunction,\n renderers: {\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n },\n): ReactNode | undefined => {\n if (status.type === 'badgeRow') {\n const items = status.items(node).map((item) => {\n const resolvedLabel = resolveValueLabel(item.label, tApp);\n const label = resolvedLabel == null ? '' : String(resolvedLabel);\n return { ...item, label };\n });\n if (items.length === 0) {\n return undefined;\n }\n return renderers.renderBadgeRow(items);\n }\n\n const value = resolveValueLabel(status.value(node), tApp);\n const label = value == null ? '' : String(value);\n if (label.trim() === '') {\n return undefined;\n }\n const tone = resolveBadgeTone(status.tone, node);\n return renderers.renderTag(tone, label);\n};\n\nexport const buildFieldItems = <Node>(\n fields: readonly BackofficeDetailFieldSpec<Node>[],\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n formatNumber: (value: number | null | undefined) => string;\n formatCurrency: (value: number | null | undefined) => string;\n formatCurrencyTitle?: (value: number | null | undefined) => string | null;\n formatPercent: (value: number | null | undefined) => string;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderFlagTag: (tag: ResolvedFlagTag) => ReactNode;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderTaggedValue: (\n tag: {\n label: string;\n tone?: ReturnType<typeof resolveBadgeTone<Node>>;\n } | null,\n value: ReactNode,\n ) => ReactNode;\n wrapCustomNode: (id: string, node: ReactNode) => ReactNode;\n },\n): {\n items: ResolvedFieldItem[];\n customNodes: ReactNode[];\n} => {\n const {\n tApp,\n t,\n resolveEntityHref,\n formatNumber,\n formatCurrency,\n formatCurrencyTitle,\n formatPercent,\n renderTag,\n renderBadgeRow,\n renderDate,\n renderFlagTag,\n renderLink,\n renderTaggedValue,\n wrapCustomNode,\n } = options;\n const items: ResolvedFieldItem[] = [];\n const customNodes: ReactNode[] = [];\n const fallback = t('common.notAvailable');\n\n fields.forEach((field, index) => {\n const id = `${field.type}-${index}`;\n\n switch (field.type) {\n case 'text': {\n const value = resolveValueLabel(field.value(node), tApp);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value,\n copyValue: field.copyValue?.(node) ?? undefined,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'badge': {\n const value = resolveValueLabel(field.value(node), tApp);\n const label = value != null ? String(value) : '';\n const tone = resolveBadgeTone(field.tone, node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: label.trim() !== '' ? renderTag(tone, label) : null,\n });\n break;\n }\n case 'badgeRow': {\n const badgeItems = field.items(node).map((item) => {\n const resolvedLabel = resolveValueLabel(item.label, tApp);\n const label = resolvedLabel == null ? '' : String(resolvedLabel);\n return { ...item, label };\n });\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: badgeItems.length > 0 ? renderBadgeRow(badgeItems) : null,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'dateTime': {\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: renderDate(field.value(node), fallback),\n });\n break;\n }\n case 'number': {\n const value = field.value(node);\n let formatted: ReactNode | null = null;\n if (value != null) {\n if (field.format === 'currency') {\n const label = formatCurrency(value);\n formatted = createElement(\n 'span',\n { title: formatCurrencyTitle?.(value) ?? undefined },\n label,\n );\n } else if (field.format === 'percent') {\n formatted = formatPercent(value);\n } else {\n formatted = formatNumber(value);\n }\n }\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: formatted,\n });\n break;\n }\n case 'flag': {\n const value = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n value != null\n ? renderFlagTag(resolveFlagTag(field.variant, value, t))\n : null,\n });\n break;\n }\n case 'entityRef': {\n const idValue = field.id(node);\n let value: ReactNode | null = null;\n if (idValue != null && idValue.trim() !== '') {\n const labelValue = field.value?.(node);\n const label =\n labelValue != null && labelValue.trim() !== '' ? labelValue : null;\n const href = resolveEntityHref?.(field.entity, idValue) ?? null;\n if (label != null) {\n value = href != null ? renderLink(href, label) : label;\n }\n }\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: value ?? fallback,\n });\n break;\n }\n case 'technicalIdentifier': {\n const value = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n value == null\n ? null\n : createElement(TechnicalIdentifierValue, {\n value,\n copyValue: field.copyValue?.(node) ?? undefined,\n variant: field.variant,\n copyLabel: t('common.actions.copy'),\n }),\n copyValue: field.copyValue?.(node) ?? undefined,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'link': {\n const href = field.href(node);\n const labelValue = field.value(node);\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n href != null && href.trim() !== '' && !isEmptyText(labelValue)\n ? renderLink(href, labelValue)\n : null,\n });\n break;\n }\n case 'taggedValue': {\n const tag = field.tag(node);\n const valueNode = resolveInlineValue(field.value(node), {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n });\n const resolvedTag =\n tag == null\n ? null\n : {\n ...tag,\n label: (() => {\n const labelValue = resolveValueLabel(tag.label, tApp);\n return labelValue == null ? '' : String(labelValue);\n })(),\n };\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value:\n resolvedTag != null || valueNode != null\n ? renderTaggedValue(resolvedTag, valueNode)\n : null,\n fullWidth: field.fullWidth,\n });\n break;\n }\n case 'custom': {\n const custom = field.render(node) as ReactNode;\n if (custom == null) {\n break;\n }\n if (field.label != null) {\n items.push({\n id,\n label: resolveLabel(field.label, tApp),\n size: field.size,\n value: custom,\n fullWidth: field.fullWidth,\n });\n break;\n }\n customNodes.push(wrapCustomNode(id, custom));\n break;\n }\n default:\n break;\n }\n });\n\n return { items, customNodes };\n};\n\nexport const resolveHeaderItems = <Node>(\n header: BackofficeDetailHeaderConfig<Node>,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref?: (entityId: string, refId: string) => string | null;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderDate: (\n value: string | number | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderTag: (\n tone: ReturnType<typeof resolveBadgeTone<Node>>,\n label: string,\n ) => ReactNode;\n renderBadgeRow: (items: readonly BackofficeBadgeItem[]) => ReactNode;\n },\n): {\n title: string;\n subtitle?: ReactNode;\n badges?: ReactNode;\n status?: ReactNode;\n items?: readonly ResolvedHeaderItem[];\n} => {\n const {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n renderDate,\n renderTag,\n renderBadgeRow,\n } = options;\n const resolvedTitle =\n header.titleValue?.(node, tApp) ?? resolveLabel(header.title, tApp);\n const rawNodeId =\n node != null &&\n typeof node === 'object' &&\n 'id' in node &&\n typeof node.id === 'string'\n ? node.id.trim()\n : null;\n const title =\n resolvedTitle.trim() === '' ||\n (rawNodeId != null && resolvedTitle.trim() === rawNodeId)\n ? resolveLabel(header.title, tApp)\n : resolvedTitle;\n\n let subtitleNode: ReactNode | undefined;\n if (header.subtitleItems != null && header.subtitleItems.length > 0) {\n const { subtitleItems } = header;\n const separator = header.subtitleSeparator ?? ' / ';\n const parts: ReactNode[] = [];\n subtitleItems.forEach((item, index) => {\n parts.push(\n createElement(\n 'span',\n { key: item.id },\n resolveInlineValue(item.value(node), {\n tApp,\n t,\n resolveEntityHref,\n renderLink,\n }),\n ),\n );\n if (index < subtitleItems.length - 1) {\n parts.push(createElement('span', { key: `${item.id}-sep` }, separator));\n }\n });\n subtitleNode = createElement('span', null, ...parts);\n } else {\n const subtitleValue =\n header.subtitleValue?.(node, tApp) ??\n (header.subtitle != null ? resolveLabel(header.subtitle, tApp) : null);\n subtitleNode =\n subtitleValue != null && subtitleValue.trim() !== ''\n ? subtitleValue\n : undefined;\n }\n\n const badgeNodes: ReactNode[] = [];\n header.badges?.forEach((badge, index) => {\n const label = resolveLabel(badge.label, tApp);\n const resolvedValue = resolveValueLabel(badge.value(node), tApp);\n const value = resolvedValue == null ? '' : String(resolvedValue);\n if (value.trim() === '') {\n return;\n }\n badgeNodes.push(\n renderTag(resolveBadgeTone(badge.tone, node), `${label}: ${value}`),\n );\n if (typeof badgeNodes[badgeNodes.length - 1] === 'object') {\n badgeNodes[badgeNodes.length - 1] = createElement(\n Fragment,\n { key: `${label}-${index}` },\n badgeNodes[badgeNodes.length - 1],\n );\n }\n });\n\n const status =\n header.status != null\n ? resolveHeaderStatus(header.status, node, tApp, {\n renderBadgeRow,\n renderTag,\n })\n : undefined;\n\n const items = header.meta?.map((meta, index) => {\n const label = resolveLabel(meta.label, tApp);\n return {\n id: `${label}-${index}`,\n label,\n value: resolveHeaderMeta(meta, node, {\n tApp,\n t,\n resolveEntityHref,\n renderDate,\n renderLink,\n }),\n };\n });\n\n return {\n title,\n subtitle: subtitleNode,\n badges:\n badgeNodes.length > 0\n ? createElement(Fragment, null, ...badgeNodes)\n : undefined,\n status,\n items,\n };\n};\n\nconst renderTimelinePayload = (payload: unknown): ReactNode | undefined => {\n if (payload == null) {\n return undefined;\n }\n if (\n typeof payload === 'string' ||\n typeof payload === 'number' ||\n typeof payload === 'boolean'\n ) {\n return String(payload);\n }\n\n try {\n return createElement('pre', null, JSON.stringify(payload, null, 2));\n } catch {\n const fallback =\n payload instanceof Error ? payload.message : '[unserializable payload]';\n return createElement('pre', null, fallback);\n }\n};\n\nconst resolveTechnicalVariant = (\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text',\n): TechnicalIdentifierVariant | null => {\n if (refKind === 'id' || refKind === 'hash' || refKind === 'external') {\n return refKind;\n }\n return null;\n};\n\nconst renderReferenceValue = (args: {\n value: BackofficeValueLabel;\n href?: string | null;\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text';\n copyValue?: string | null;\n tApp: TFunction;\n t: TFunction;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n}): ReactNode => {\n const { value, href, refKind, copyValue, tApp, t, renderLink } = args;\n const resolvedValue = resolveValueLabel(value, tApp);\n const technicalVariant = resolveTechnicalVariant(refKind);\n if (technicalVariant != null) {\n const normalized = normalizeTechnicalIdentifier(resolvedValue);\n if (normalized == null) {\n return t('common.notAvailable');\n }\n return createElement(TechnicalIdentifierValue, {\n value: normalized,\n copyValue: copyValue ?? normalized,\n variant: technicalVariant,\n copyLabel: t('common.actions.copy'),\n });\n }\n if (href != null && href.trim() !== '' && !isEmptyText(resolvedValue)) {\n return renderLink(href, resolvedValue);\n }\n return resolvedValue ?? t('common.notAvailable');\n};\n\nexport const renderBlocks = <Node>(\n blocks: readonly BackofficeDetailBlockSpec<Node>[] | undefined,\n node: Node,\n options: {\n tApp: TFunction;\n t: TFunction;\n resolveEntityHref: (entityId: string, refId: string) => string | null;\n keyPrefix?: string;\n renderLink: (href: string, label: ReactNode) => ReactNode;\n renderDate: (\n value: string | number | Date | null | undefined,\n fallback: string,\n ) => ReactNode;\n renderTag: (tone: BackofficeTone, label: string) => ReactNode;\n renderMetricGroup: (args: {\n key: string;\n title: string;\n description?: string;\n density?: 'compact' | 'comfortable';\n items: readonly {\n id: string;\n label: string;\n value: ReactNode;\n hint?: ReactNode;\n tone?: BackofficeTone;\n copyValue?: string;\n }[];\n }) => ReactNode;\n renderTimeline: (args: {\n key: string;\n title: string;\n description?: string;\n events: readonly {\n id: string;\n label: string;\n timestamp?: ReactNode;\n description?: ReactNode;\n actor?: ReactNode;\n tone?: BackofficeTone;\n payload?: ReactNode;\n }[];\n }) => ReactNode;\n renderAuditTimeline: (args: {\n key: string;\n title: string;\n description?: string;\n events: readonly {\n id: string;\n title: ReactNode;\n time?: ReactNode;\n actor?: ReactNode;\n source?: ReactNode;\n }[];\n }) => ReactNode;\n renderRelations: (args: {\n key: string;\n title: string;\n description?: string;\n items: readonly {\n id: string;\n label: string;\n count?: ReactNode;\n href?: string;\n description?: ReactNode;\n tone?: BackofficeTone;\n }[];\n }) => ReactNode;\n renderContextStack: (args: {\n key: string;\n title: string;\n items: readonly {\n id: string;\n label: string;\n value: ReactNode | null | undefined;\n }[];\n }) => ReactNode;\n renderCustomSection: (\n key: string,\n title: string,\n child: ReactNode,\n ) => ReactNode;\n wrapCustomNode: (key: string, node: ReactNode) => ReactNode;\n resolveTableColumns: (\n columns: readonly BackofficeColumnSpec[],\n ) => readonly DataTableColumn<unknown>[];\n renderTable: (args: {\n key: string;\n title: string;\n description?: string;\n columns: readonly DataTableColumn<unknown>[];\n rows: readonly unknown[];\n }) => ReactNode;\n renderPayload: (args: {\n key: string;\n title: string;\n description?: string;\n content: unknown;\n format: BackofficePayloadFormat;\n }) => ReactNode;\n renderKeyValueListSection: (args: {\n key: string;\n title: string;\n description?: string;\n items: readonly { id: string; label: string; value: ReactNode }[];\n }) => ReactNode;\n },\n): ReactNode[] => {\n const { tApp, t, keyPrefix } = options;\n if (blocks == null || blocks.length === 0) {\n return [];\n }\n\n return blocks.map((block, index): ReactNode => {\n const key =\n keyPrefix != null\n ? `${keyPrefix}-${block.kind}-${index}`\n : `${block.kind}-${index}`;\n\n if (block.kind === 'custom') {\n const custom = block.render(node) as ReactNode;\n if (custom == null) {\n return null;\n }\n if (block.label != null) {\n return options.renderCustomSection(\n key,\n resolveLabel(block.label, tApp),\n custom,\n );\n }\n return options.wrapCustomNode(key, custom);\n }\n\n const title =\n 'title' in block\n ? resolveLabel(block.title, tApp)\n : resolveLabel(block.label, tApp);\n const description =\n block.description != null\n ? resolveLabel(block.description, tApp)\n : undefined;\n\n if (block.kind === 'summary') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.items.map((item) => {\n const value = resolveValueLabel(item.value(node), tApp);\n const href = item.href?.(node);\n const tone = item.tone?.(node);\n let valueNode: ReactNode = value ?? t('common.notAvailable');\n if (href != null && href.trim() !== '' && !isEmptyText(value)) {\n valueNode = options.renderLink(href, value);\n } else if (tone != null && !isEmptyText(value)) {\n valueNode = options.renderTag(tone, String(value));\n }\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value: valueNode,\n };\n }),\n });\n }\n\n if (block.kind === 'metrics') {\n return options.renderMetricGroup({\n key,\n title,\n description,\n density: block.density,\n items: block.items.map((item) => {\n const formattedValue = item.formattedValue?.(node);\n const value = resolveValueLabel(item.value(node), tApp);\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value: formattedValue ?? value ?? t('common.notAvailable'),\n hint: resolveValueLabel(item.hint?.(node), tApp),\n tone: item.tone?.(node),\n copyValue: item.copyValue?.(node) ?? undefined,\n };\n }),\n });\n }\n\n if (block.kind === 'states') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.states.map((state) => {\n const display = state.getDisplay(state.value(node), node);\n return {\n id: state.id,\n label: resolveLabel(state.label, tApp),\n value: options.renderTag(\n display.tone,\n String(\n resolveValueLabel(display.label, tApp) ??\n t('common.notAvailable'),\n ),\n ),\n };\n }),\n });\n }\n\n if (block.kind === 'context') {\n return options.renderContextStack({\n key,\n title,\n items: block.items.map((item) => {\n const value = resolveValueLabel(item.value(node), tApp);\n const href = item.href?.(node);\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n value:\n href != null && href.trim() !== '' && !isEmptyText(value)\n ? options.renderLink(href, value)\n : value,\n };\n }),\n });\n }\n\n if (block.kind === 'relationSummary') {\n return options.renderRelations({\n key,\n title,\n description,\n items: block.items.map((item) => {\n return {\n id: item.id,\n label: resolveLabel(item.label, tApp),\n count: item.count?.(node) ?? null,\n href: item.href?.(node) ?? undefined,\n description: resolveValueLabel(item.description?.(node), tApp),\n tone: item.tone?.(node),\n };\n }),\n });\n }\n\n if (block.kind === 'timeline') {\n return options.renderTimeline({\n key,\n title,\n description,\n events: block.events.map((event) => {\n const state = event.state?.(node);\n const stateLabel =\n state == null ? null : resolveValueLabel(state.label, tApp);\n const stateText = stateLabel == null ? null : String(stateLabel);\n return {\n id: event.id,\n label:\n stateText == null || stateText.trim() === ''\n ? resolveLabel(event.label, tApp)\n : `${resolveLabel(event.label, tApp)}: ${stateText}`,\n timestamp:\n event.timestamp == null\n ? undefined\n : options.renderDate(\n event.timestamp(node),\n t('common.notAvailable'),\n ),\n description: resolveValueLabel(event.description?.(node), tApp),\n actor: resolveValueLabel(event.actor?.(node), tApp),\n tone: state?.tone,\n payload: renderTimelinePayload(event.payload?.(node)),\n };\n }),\n });\n }\n\n if (block.kind === 'audit') {\n return options.renderAuditTimeline({\n key,\n title,\n description,\n events: block.items.map((item) => {\n const actor = resolveValueLabel(item.actor?.(node), tApp);\n const source = resolveValueLabel(item.source?.(node), tApp);\n return {\n id: item.id,\n title: resolveLabel(item.label, tApp),\n time: options.renderDate(\n item.timestamp?.(node),\n t('common.notAvailable'),\n ),\n actor: isEmptyText(actor) ? undefined : actor,\n source: isEmptyText(source) ? undefined : source,\n };\n }),\n });\n }\n\n if (block.kind === 'references') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.references.map((reference) => {\n const href = reference.href?.(node);\n return {\n id: reference.id,\n label: resolveLabel(reference.label, tApp),\n value: renderReferenceValue({\n value: reference.value(node),\n href,\n refKind: reference.refKind ?? 'text',\n copyValue: reference.copyValue?.(node) ?? undefined,\n tApp,\n t,\n renderLink: options.renderLink,\n }),\n };\n }),\n });\n }\n\n if (block.kind === 'actionResult') {\n const items: { id: string; label: string; value: ReactNode }[] = [];\n const status = block.status?.(node);\n if (status != null) {\n items.push({\n id: `${block.id}-status`,\n label: t('detail.actionResult.status'),\n value: options.renderTag(\n status.tone,\n String(\n resolveValueLabel(status.label, tApp) ?? t('common.notAvailable'),\n ),\n ),\n });\n }\n const message = resolveValueLabel(block.message?.(node), tApp);\n if (!isEmptyText(message)) {\n items.push({\n id: `${block.id}-message`,\n label: t('detail.actionResult.message'),\n value: message,\n });\n }\n block.references?.forEach((reference) => {\n items.push({\n id: reference.id,\n label: resolveLabel(reference.label, tApp),\n value: renderReferenceValue({\n value: reference.value(node),\n href: reference.href?.(node),\n refKind: reference.refKind ?? 'text',\n copyValue: reference.copyValue?.(node) ?? undefined,\n tApp,\n t,\n renderLink: options.renderLink,\n }),\n });\n });\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items,\n });\n }\n\n if (block.kind === 'technicalFacts') {\n return options.renderKeyValueListSection({\n key,\n title,\n description,\n items: block.facts.map((fact) => {\n const value = resolveValueLabel(fact.value(node), tApp);\n const href = fact.href?.(node);\n const copyValue = fact.copyValue?.(node) ?? undefined;\n return {\n id: fact.id,\n label: resolveLabel(fact.label, tApp),\n value:\n copyValue != null && copyValue.trim() !== ''\n ? createElement(TechnicalIdentifierValue, {\n value: value ?? copyValue,\n copyValue,\n variant: 'external',\n copyLabel: t('common.actions.copy'),\n })\n : href != null && href.trim() !== '' && !isEmptyText(value)\n ? options.renderLink(href, value)\n : (value ?? t('common.notAvailable')),\n };\n }),\n });\n }\n\n if (block.kind === 'table') {\n return options.renderTable({\n key,\n title,\n description,\n columns: options.resolveTableColumns(block.columns),\n rows: block.rows(node) as readonly unknown[],\n });\n }\n\n return options.renderPayload({\n key,\n title,\n description,\n content: block.value(node),\n format: block.format ?? 'json',\n });\n });\n};\n"],"mappings":";;;;AAqEA,IAAa,KACX,GACA,GACA,MACoB;CACpB,QAAQ,GAAR;EACE,KAAK,SACH,OAAO,IACH;GAAE,MAAM;GAAW,OAAO,EAAE,oBAAoB;EAAE,IAClD;GAAE,MAAM;GAAW,O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