@plumile/backoffice-react 0.2.10 → 0.2.12
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 +7 -0
- package/lib/esm/auth/authRefreshNotice.css.js +1 -1
- package/lib/esm/auth/login/OidcButtons.js +16 -15
- package/lib/esm/auth/login/OidcButtons.js.map +1 -1
- package/lib/esm/auth/login/loginPage.css.js +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js +7 -9
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js +7 -9
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +1 -1
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +1 -1
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +71 -68
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +6 -6
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +21 -18
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +1 -1
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js.map +1 -1
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +1 -1
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +5 -5
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +2 -2
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +1 -1
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +1 -1
- package/lib/esm/components/backoffice/links/backofficeLink.css.js +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -1
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +1 -1
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js +1 -1
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +5 -5
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +2 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +1 -1
- package/lib/esm/hooks/useBackofficeSidebarPins.js +1 -1
- package/lib/esm/hooks/useBackofficeSidebarPins.js.map +1 -1
- package/lib/esm/hooks/useSidebarGroupCollapse.js +1 -1
- package/lib/esm/hooks/useSidebarGroupCollapse.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +54 -52
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +67 -64
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +10 -9
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeLayoutPage.js +2 -2
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/pages/backofficeDashboardPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityDetailPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityListPage.css.js +1 -1
- package/lib/esm/storybook/backofficeDashboardPageStory.css.js +1 -1
- package/lib/esm/storybook/relay/RelayStory.css.js +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/auth/login/OidcButtons.d.ts.map +1 -1
- package/lib/types/auth/pages/AcceptInvitationScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetCompleteScreen.d.ts.map +1 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts +8 -4
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/deferredFilterSearchInput.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +4 -3
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailLayoutPage.tsx"],"sourcesContent":["import { Suspense, type JSX, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport * as ReactRelay from 'react-relay';\nimport Link from '@plumile/router/routing/Link.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport { BACKOFFICE_DATE_TIME_OPTIONS } from '@plumile/backoffice-core/constants.js';\nimport { setWhereValue } from '@plumile/backoffice-core/filters/where.js';\nimport type {\n BackofficeEntityManifestItem,\n BackofficePreparedDetailLayoutDataRoute,\n BackofficeResolvedDetailLayoutFacetConfig,\n} from '@plumile/backoffice-core/types.js';\nimport { FormattedDate, PageHeader, PropertyList } from '@plumile/ui';\nimport { NavigationTabs } from '@plumile/ui/tabs';\nimport { Tag } from '@plumile/ui/backoffice/atoms/tag/Tag.js';\n\nimport {\n BackofficeRelationsMenu,\n type BackofficeRelationsMenuItem,\n} from '@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js';\nimport { Spinner } from '@plumile/ui/backoffice/atoms/spinner/Spinner.js';\nimport { DetailPageTemplate } from '@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js';\n\nimport { BackofficeDetailBadgeRow } from '../components/backoffice/detail/BackofficeDetailBadgeRow.js';\nimport { BackofficeLazyEntityCount } from '../components/backoffice/refs/BackofficeLazyEntityCount.js';\nimport { BackofficeEntityDetailNotFound } from '../components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildEntityDetailBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport { useBackofficeRuntimeFragment } from '../relay/typedRelayHooks.js';\nimport * as pageStyles from './backofficeEntityDetailPage.css.js';\nimport {\n resolveLabel,\n resolveRelationValue,\n} from './BackofficeEntityDetailPage.helpers.js';\nimport { resolveHeaderItems } from './BackofficeEntityDetailPage.view-helpers.js';\nimport { BackofficeEntityDetailLayoutContextProvider } from './detail/BackofficeEntityDetailLayoutContext.js';\nimport { buildTabsItems } from './detail/buildTabsItems.js';\nimport { resolveVisibleDetailPages } from './detail/pageResolution.js';\nimport { BackofficeRedirect } from './BackofficeRedirect.js';\n\nconst { usePreloadedQuery } = ReactRelay;\n\nconst normalizePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst resolveActivePagePath = (\n pathname: string,\n id: string,\n config: BackofficeResolvedDetailLayoutFacetConfig,\n): string => {\n const pages = [config.pages.mainPage, ...(config.pages.subPages ?? [])];\n const activePage = pages.find((page) => {\n return pathname === config.routes.detailPage(id, page.id);\n });\n return activePage?.path ?? '';\n};\n\nconst RelationCountLoading = (): JSX.Element => {\n return (\n <span className={pageStyles.relationCountLoading}>\n <Spinner size={12} />\n </span>\n );\n};\n\nconst DetailPageContentLoading = (): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n return (\n <div role=\"status\" aria-live=\"polite\" aria-busy=\"true\">\n <Spinner size={20} ariaLabel={t('common.loading')} />\n </div>\n );\n};\n\nexport type BackofficeEntityDetailLayoutPageProps = {\n entityManifest: BackofficeEntityManifestItem;\n config: BackofficeResolvedDetailLayoutFacetConfig;\n prepared: BackofficePreparedDetailLayoutDataRoute;\n children?: ReactNode;\n};\n\ntype BackofficeEntityDetailLayoutPageContentProps = {\n config: BackofficeResolvedDetailLayoutFacetConfig;\n prepared: BackofficePreparedDetailLayoutDataRoute;\n layoutNodeRef: unknown;\n children?: ReactNode;\n};\n\nconst BackofficeEntityDetailLayoutPageContent = ({\n config,\n prepared,\n layoutNodeRef,\n children,\n}: BackofficeEntityDetailLayoutPageContentProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities } = useBackofficeConfig();\n const { pathname } = useLocation();\n const layoutNode = useBackofficeRuntimeFragment(\n config.layoutPage.fragment,\n layoutNodeRef,\n );\n\n const layoutView = config.layoutPage.toView(layoutNode);\n const activePagePath = resolveActivePagePath(pathname, prepared.id, config);\n const resolvedPages = resolveVisibleDetailPages({\n mainPage: config.pages.mainPage,\n subPages: config.pages.subPages,\n activePagePath,\n node: layoutView,\n });\n\n if (!resolvedPages.hasVisiblePages || resolvedPages.activePage == null) {\n return <BackofficeRedirect to={config.routes.list} />;\n }\n\n const { activePage } = resolvedPages;\n if (\n activePagePath !== '' &&\n normalizePath(activePage.path) !== normalizePath(activePagePath)\n ) {\n return (\n <BackofficeRedirect\n to={config.routes.detailPage(prepared.id, activePage.id)}\n />\n );\n }\n\n const tabsItems = buildTabsItems({\n pages: resolvedPages.pages,\n id: prepared.id,\n tApp,\n detailPageHref: config.routes.detailPage,\n });\n const resolveEntityHref = (entityId: string, refId: string) => {\n const entityConfig = entities[entityId];\n if (entityConfig == null) {\n return null;\n }\n return entityConfig.routes.detail(refId);\n };\n const header = resolveHeaderItems(config.header, layoutView, {\n tApp,\n t,\n resolveEntityHref,\n renderLink: (href, label) => {\n return (\n <Link to={href} preloadOnHover=\"code-and-data\">\n {label}\n </Link>\n );\n },\n renderDate: (value, fallback) => {\n return (\n <FormattedDate\n value={value}\n options={BACKOFFICE_DATE_TIME_OPTIONS}\n fallback={fallback}\n />\n );\n },\n renderTag: (tone, label) => {\n return <Tag tone={tone}>{label}</Tag>;\n },\n renderBadgeRow: (items) => {\n return <BackofficeDetailBadgeRow items={items} />;\n },\n });\n const relationMenuItems: BackofficeRelationsMenuItem[] = (\n config.relations ?? []\n ).flatMap((relation) => {\n const { path, target, whereKey } = relation;\n const value = resolveRelationValue(relation.value(layoutView));\n if (value == null) {\n return [];\n }\n\n const entityManifest = entities[target];\n if (entityManifest?.hasList !== true) {\n return [];\n }\n\n const where = setWhereValue(null, whereKey, value, path);\n if (where == null) {\n return [];\n }\n\n const encoded = entityManifest.listNavigation.encode({ where });\n\n return [\n {\n id: relation.id,\n label: resolveLabel(relation.label, tApp),\n count: (\n <BackofficeLazyEntityCount\n entity={target}\n loadingFallback={<RelationCountLoading />}\n where={where}\n />\n ),\n destination: {\n pathname: entityManifest.routes.list,\n filters: encoded.filters,\n query: encoded.query,\n },\n },\n ];\n });\n const breadcrumb = buildEntityDetailBreadcrumb({\n config,\n tApp,\n entityId: prepared.id,\n layoutView,\n pageLabel: activePage.label(tApp),\n pageId: activePage.id,\n });\n let headerMetaNode: JSX.Element | undefined;\n if (header.status != null || header.badges != null) {\n headerMetaNode = (\n <div className={pageStyles.headerMeta}>\n {header.status}\n {header.badges}\n </div>\n );\n }\n let headerItemsNode: JSX.Element | null = null;\n if (header.items != null && header.items.length > 0) {\n headerItemsNode = (\n <div className={pageStyles.headerMetaList}>\n <PropertyList items={header.items} />\n </div>\n );\n }\n let headerActionsNode: JSX.Element | undefined;\n if (relationMenuItems.length > 0) {\n headerActionsNode = (\n <div className={pageStyles.headerRelationGroup}>\n <BackofficeRelationsMenu\n label={t('relations.menu.label')}\n items={relationMenuItems}\n />\n </div>\n );\n }\n\n const headerNode = (\n <div className={pageStyles.headerBlock}>\n <PageHeader\n title={header.title}\n description={header.subtitle}\n meta={headerMetaNode}\n actions={headerActionsNode}\n />\n {headerItemsNode}\n </div>\n );\n let tabsNode: JSX.Element | null = null;\n if (resolvedPages.pages.length > 1) {\n tabsNode = (\n <NavigationTabs\n items={tabsItems}\n activeId={activePage.id}\n variant=\"underline\"\n />\n );\n }\n\n return (\n <BackofficeEntityDetailLayoutContextProvider\n value={{\n activePage,\n config,\n entityId: prepared.id,\n layoutView,\n tabsItems,\n visiblePages: resolvedPages.pages,\n }}\n >\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <DetailPageTemplate\n headerNode={headerNode}\n tabsNode={tabsNode}\n headerDensity=\"compact\"\n >\n <Suspense fallback={<DetailPageContentLoading />}>\n {children}\n </Suspense>\n </DetailPageTemplate>\n </BackofficeRightPageLayout>\n </BackofficeEntityDetailLayoutContextProvider>\n );\n};\n\nexport const BackofficeEntityDetailLayoutPage = ({\n config,\n prepared,\n children,\n}: BackofficeEntityDetailLayoutPageProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const layoutQueryData = usePreloadedQuery(\n config.layoutPage.query,\n prepared.layoutQuery,\n );\n const layoutNodeRef = config.layoutPage.resolveNode(layoutQueryData, {\n id: prepared.id,\n });\n\n if (layoutNodeRef == null) {\n return (\n <BackofficeRightPageLayout\n breadcrumb={[\n {\n kind: 'link',\n target: {\n kind: 'entity-list',\n entityId: config.id,\n },\n label: config.label(tApp),\n },\n {\n kind: 'current',\n target: {\n kind: 'entity-detail',\n entityId: config.id,\n id: prepared.id,\n },\n label: t('detail.notFound'),\n },\n ]}\n >\n <BackofficeEntityDetailNotFound listHref={config.routes.list} />\n </BackofficeRightPageLayout>\n );\n }\n\n return (\n <BackofficeEntityDetailLayoutPageContent\n config={config}\n prepared={prepared}\n layoutNodeRef={layoutNodeRef}\n >\n {children}\n </BackofficeEntityDetailLayoutPageContent>\n );\n};\n\nexport default BackofficeEntityDetailLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;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B,GACtC,IAAkB,EACtB,EAAO,WAAW,OAClB,EAAS,WACX,GACM,IAAgB,EAAO,WAAW,YAAY,GAAiB,EACnE,IAAI,EAAS,GACf,CAAC;CA8BD,OA5BI,KAAiB,OAEjB,kBAAC,GAAD;EACE,YAAY,CACV;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAO;GACnB;GACA,OAAO,EAAO,MAAM,CAAI;EAC1B,GACA;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAO;IACjB,IAAI,EAAS;GACf;GACA,OAAO,EAAE,iBAAiB;EAC5B,CACF;EAEA,UAAA,kBAAC,GAAD,EAAgC,UAAU,EAAO,OAAO,KAAO,CAAA;CACtC,CAAA,IAK7B,kBAAC,GAAD;EACU;EACE;EACK;EAEd;CACsC,CAAA;AAE7C"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailLayoutPage.tsx"],"sourcesContent":["import { Suspense, type JSX, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport * as ReactRelay from 'react-relay';\nimport Link from '@plumile/router/routing/Link.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport { BACKOFFICE_DATE_TIME_OPTIONS } from '@plumile/backoffice-core/constants.js';\nimport { setWhereValue } from '@plumile/backoffice-core/filters/where.js';\nimport type {\n BackofficeEntityManifestItem,\n BackofficePreparedDetailLayoutDataRoute,\n BackofficeResolvedDetailLayoutFacetConfig,\n} from '@plumile/backoffice-core/types.js';\nimport { FormattedDate, PageHeader, PropertyList } from '@plumile/ui';\nimport { NavigationTabs } from '@plumile/ui/tabs';\nimport { Tag } from '@plumile/ui/backoffice/atoms/tag/Tag.js';\n\nimport {\n BackofficeRelationsMenu,\n type BackofficeRelationsMenuItem,\n} from '@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js';\nimport { Spinner } from '@plumile/ui/backoffice/atoms/spinner/Spinner.js';\nimport { DetailPageTemplate } from '@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js';\n\nimport { BackofficeDetailBadgeRow } from '../components/backoffice/detail/BackofficeDetailBadgeRow.js';\nimport { BackofficeLazyEntityCount } from '../components/backoffice/refs/BackofficeLazyEntityCount.js';\nimport { BackofficeEntityDetailNotFound } from '../components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildEntityDetailBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport { useBackofficeRuntimeFragment } from '../relay/typedRelayHooks.js';\nimport * as pageStyles from './backofficeEntityDetailPage.css.js';\nimport {\n resolveLabel,\n resolveRelationValue,\n} from './BackofficeEntityDetailPage.helpers.js';\nimport { resolveHeaderItems } from './BackofficeEntityDetailPage.view-helpers.js';\nimport { BackofficeEntityDetailLayoutContextProvider } from './detail/BackofficeEntityDetailLayoutContext.js';\nimport { buildTabsItems } from './detail/buildTabsItems.js';\nimport { resolveVisibleDetailPages } from './detail/pageResolution.js';\nimport { BackofficeRedirect } from './BackofficeRedirect.js';\n\nconst { usePreloadedQuery } = ReactRelay;\n\nconst normalizePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst resolveActivePagePath = (\n pathname: string,\n id: string,\n config: BackofficeResolvedDetailLayoutFacetConfig,\n): string => {\n const pages = [config.pages.mainPage, ...(config.pages.subPages ?? [])];\n const activePage = pages.find((page) => {\n return pathname === config.routes.detailPage(id, page.id);\n });\n return activePage?.path ?? '';\n};\n\nconst RelationCountLoading = (): JSX.Element => {\n return (\n <span className={pageStyles.relationCountLoading}>\n <Spinner size={12} />\n </span>\n );\n};\n\nconst DetailPageContentLoading = (): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n return (\n <div role=\"status\" aria-live=\"polite\" aria-busy=\"true\">\n <Spinner size={20} ariaLabel={t('common.loading')} />\n </div>\n );\n};\n\nexport type BackofficeEntityDetailLayoutPageProps = {\n entityManifest: BackofficeEntityManifestItem;\n config: BackofficeResolvedDetailLayoutFacetConfig;\n prepared: BackofficePreparedDetailLayoutDataRoute;\n children?: ReactNode;\n};\n\ntype BackofficeEntityDetailLayoutPageContentProps = {\n config: BackofficeResolvedDetailLayoutFacetConfig;\n prepared: BackofficePreparedDetailLayoutDataRoute;\n layoutNodeRef: unknown;\n children?: ReactNode;\n};\n\nconst BackofficeEntityDetailLayoutPageContent = ({\n config,\n prepared,\n layoutNodeRef,\n children,\n}: BackofficeEntityDetailLayoutPageContentProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities } = useBackofficeConfig();\n const { pathname } = useLocation();\n const layoutNode = useBackofficeRuntimeFragment(\n config.layoutPage.fragment,\n layoutNodeRef,\n );\n\n const layoutView = config.layoutPage.toView(layoutNode);\n const activePagePath = resolveActivePagePath(pathname, prepared.id, config);\n const resolvedPages = resolveVisibleDetailPages({\n mainPage: config.pages.mainPage,\n subPages: config.pages.subPages,\n activePagePath,\n node: layoutView,\n });\n\n if (!resolvedPages.hasVisiblePages || resolvedPages.activePage == null) {\n return <BackofficeRedirect to={config.routes.list} />;\n }\n\n const { activePage } = resolvedPages;\n if (\n activePagePath !== '' &&\n normalizePath(activePage.path) !== normalizePath(activePagePath)\n ) {\n return (\n <BackofficeRedirect\n to={config.routes.detailPage(prepared.id, activePage.id)}\n />\n );\n }\n\n const tabsItems = buildTabsItems({\n pages: resolvedPages.pages,\n id: prepared.id,\n tApp,\n detailPageHref: config.routes.detailPage,\n });\n const resolveEntityHref = (entityId: string, refId: string) => {\n const entityConfig = entities[entityId];\n if (entityConfig == null) {\n return null;\n }\n return entityConfig.routes.detail(refId);\n };\n const header = resolveHeaderItems(config.header, layoutView, {\n tApp,\n t,\n resolveEntityHref,\n renderLink: (href, label) => {\n return (\n <Link to={href} preloadOnHover=\"code-and-data\">\n {label}\n </Link>\n );\n },\n renderDate: (value, fallback) => {\n return (\n <FormattedDate\n value={value}\n options={BACKOFFICE_DATE_TIME_OPTIONS}\n fallback={fallback}\n />\n );\n },\n renderTag: (tone, label) => {\n return <Tag tone={tone}>{label}</Tag>;\n },\n renderBadgeRow: (items) => {\n return <BackofficeDetailBadgeRow items={items} />;\n },\n });\n const relationMenuItems: BackofficeRelationsMenuItem[] = (\n config.relations ?? []\n ).flatMap((relation) => {\n const { path, target, whereKey } = relation;\n const value = resolveRelationValue(relation.value(layoutView));\n if (value == null) {\n return [];\n }\n\n const entityManifest = entities[target];\n if (entityManifest?.hasList !== true) {\n return [];\n }\n\n const where = setWhereValue(null, whereKey, value, path);\n if (where == null) {\n return [];\n }\n\n const encoded = entityManifest.listNavigation.encode({ where });\n\n return [\n {\n id: relation.id,\n label: resolveLabel(relation.label, tApp),\n count: (\n <BackofficeLazyEntityCount\n entity={target}\n loadingFallback={<RelationCountLoading />}\n where={where}\n />\n ),\n destination: {\n pathname: entityManifest.routes.list,\n filters: encoded.filters,\n query: encoded.query,\n },\n },\n ];\n });\n const breadcrumb = buildEntityDetailBreadcrumb({\n config,\n tApp,\n entityId: prepared.id,\n layoutView,\n pageLabel: activePage.label(tApp),\n pageId: activePage.id,\n });\n let headerMetaNode: JSX.Element | undefined;\n if (\n header.subtitleItems != null ||\n header.status != null ||\n header.badges != null\n ) {\n headerMetaNode = (\n <div className={pageStyles.headerMetaList}>\n {header.subtitleItems}\n {(header.status != null || header.badges != null) && (\n <div className={pageStyles.headerMeta}>\n {header.status}\n {header.badges}\n </div>\n )}\n </div>\n );\n }\n let headerItemsNode: JSX.Element | null = null;\n if (header.items != null && header.items.length > 0) {\n headerItemsNode = (\n <div className={pageStyles.headerMetaList}>\n <PropertyList items={header.items} />\n </div>\n );\n }\n let headerActionsNode: JSX.Element | undefined;\n if (relationMenuItems.length > 0) {\n headerActionsNode = (\n <div className={pageStyles.headerRelationGroup}>\n <BackofficeRelationsMenu\n label={t('relations.menu.label')}\n items={relationMenuItems}\n />\n </div>\n );\n }\n\n const headerNode = (\n <div className={pageStyles.headerBlock}>\n <PageHeader\n title={header.title}\n description={header.subtitle}\n meta={headerMetaNode}\n actions={headerActionsNode}\n />\n {headerItemsNode}\n </div>\n );\n let tabsNode: JSX.Element | null = null;\n if (resolvedPages.pages.length > 1) {\n tabsNode = (\n <NavigationTabs\n items={tabsItems}\n activeId={activePage.id}\n variant=\"underline\"\n />\n );\n }\n\n return (\n <BackofficeEntityDetailLayoutContextProvider\n value={{\n activePage,\n config,\n entityId: prepared.id,\n layoutView,\n tabsItems,\n visiblePages: resolvedPages.pages,\n }}\n >\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <DetailPageTemplate\n headerNode={headerNode}\n tabsNode={tabsNode}\n headerDensity=\"compact\"\n >\n <Suspense fallback={<DetailPageContentLoading />}>\n {children}\n </Suspense>\n </DetailPageTemplate>\n </BackofficeRightPageLayout>\n </BackofficeEntityDetailLayoutContextProvider>\n );\n};\n\nexport const BackofficeEntityDetailLayoutPage = ({\n config,\n prepared,\n children,\n}: BackofficeEntityDetailLayoutPageProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const layoutQueryData = usePreloadedQuery(\n config.layoutPage.query,\n prepared.layoutQuery,\n );\n const layoutNodeRef = config.layoutPage.resolveNode(layoutQueryData, {\n id: prepared.id,\n });\n\n if (layoutNodeRef == null) {\n return (\n <BackofficeRightPageLayout\n breadcrumb={[\n {\n kind: 'link',\n target: {\n kind: 'entity-list',\n entityId: config.id,\n },\n label: config.label(tApp),\n },\n {\n kind: 'current',\n target: {\n kind: 'entity-detail',\n entityId: config.id,\n id: prepared.id,\n },\n label: t('detail.notFound'),\n },\n ]}\n >\n <BackofficeEntityDetailNotFound listHref={config.routes.list} />\n </BackofficeRightPageLayout>\n );\n }\n\n return (\n <BackofficeEntityDetailLayoutPageContent\n config={config}\n prepared={prepared}\n layoutNodeRef={layoutNodeRef}\n >\n {children}\n </BackofficeEntityDetailLayoutPageContent>\n );\n};\n\nexport default BackofficeEntityDetailLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,EAAE,mBAAA,MAAsB,GAExB,KAAiB,MACd,EAAM,KAAK,CAAC,CAAC,QAAQ,cAAc,EAAE,GAGxC,KACJ,GACA,GACA,MAGmB,CADJ,EAAO,MAAM,UAAU,GAAI,EAAO,MAAM,YAAY,CAAC,CACjD,CAAA,CAAM,MAAM,MACtB,MAAa,EAAO,OAAO,WAAW,GAAI,EAAK,EAAE,CAEnD,CAAA,EAAY,QAAQ,IAGvB,UAEF,kBAAC,QAAD;CAAM,WAAW;CACf,UAAA,kBAAC,GAAD,EAAS,MAAM,GAAK,CAAA;AAChB,CAAA,GAIJ,UAA8C;CAClD,IAAM,EAAE,MAAM,EAA8B;CAC5C,OACE,kBAAC,OAAD;EAAK,MAAK;EAAS,aAAU;EAAS,aAAU;EAC9C,UAAA,kBAAC,GAAD;GAAS,MAAM;GAAI,WAAW,EAAE,gBAAgB;EAAI,CAAA;CACjD,CAAA;AAET,GAgBM,KAA2C,EAC/C,WACA,aACA,kBACA,kBAC+D;CAC/D,IAAM,EAAE,GAAG,MAAS,EAAe,GAC7B,EAAE,SAAM,EAA8B,GACtC,EAAE,gBAAa,EAAoB,GACnC,EAAE,gBAAa,GAAY,GAC3B,IAAa,EACjB,EAAO,WAAW,UAClB,CACF,GAEM,IAAa,EAAO,WAAW,OAAO,CAAU,GAChD,IAAiB,EAAsB,GAAU,EAAS,IAAI,CAAM,GACpE,IAAgB,EAA0B;EAC9C,UAAU,EAAO,MAAM;EACvB,UAAU,EAAO,MAAM;EACvB;EACA,MAAM;CACR,CAAC;CAED,IAAI,CAAC,EAAc,mBAAmB,EAAc,cAAc,MAChE,OAAO,kBAA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ACA;GACA,cAAc,EAAc;EAC9B;EAEA,UAAA,kBAAC,GAAD;GAAuC;GACrC,UAAA,kBAAC,GAAD;IACc;IACF;IACV,eAAc;IAEd,UAAA,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,CAA2B,CAAA;KAC5C;IACO,CAAA;GACQ,CAAA;EACK,CAAA;CACgB,CAAA;AAEjD,GAEa,KAAoC,EAC/C,WACA,aACA,kBACwD;CACxD,IAAM,EAAE,GAAG,MAAS,EAAe,GAC7B,EAAE,SAAM,EAA8B,GACtC,IAAkB,EACtB,EAAO,WAAW,OAClB,EAAS,WACX,GACM,IAAgB,EAAO,WAAW,YAAY,GAAiB,EACnE,IAAI,EAAS,GACf,CAAC;CA8BD,OA5BI,KAAiB,OAEjB,kBAAC,GAAD;EACE,YAAY,CACV;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAO;GACnB;GACA,OAAO,EAAO,MAAM,CAAI;EAC1B,GACA;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAO;IACjB,IAAI,EAAS;GACf;GACA,OAAO,EAAE,iBAAiB;EAC5B,CACF;EAEA,UAAA,kBAAC,GAAD,EAAgC,UAAU,EAAO,OAAO,KAAO,CAAA;CACtC,CAAA,IAK7B,kBAAC,GAAD;EACU;EACE;EACK;EAEd;CACsC,CAAA;AAE7C"}
|
|
@@ -303,7 +303,7 @@ var c = (e, t, n) => {
|
|
|
303
303
|
customNodes: E
|
|
304
304
|
};
|
|
305
305
|
}, p = (e, o, s) => {
|
|
306
|
-
let { tApp: c, t: f, resolveEntityHref: p, renderLink: m, renderDate: h, renderTag: g, renderBadgeRow: _ } = s, v = e.titleValue?.(o, c) ?? n(e.title, c), y = typeof o == "object" && o && "id" in o && typeof o.id == "string" ? o.id.trim() : null, b = v.trim() === "" || y != null && v.trim() === y ? n(e.title, c) : v, x;
|
|
306
|
+
let { tApp: c, t: f, resolveEntityHref: p, renderLink: m, renderDate: h, renderTag: g, renderBadgeRow: _ } = s, v = e.titleValue?.(o, c) ?? n(e.title, c), y = typeof o == "object" && o && "id" in o && typeof o.id == "string" ? o.id.trim() : null, b = v.trim() === "" || y != null && v.trim() === y ? n(e.title, c) : v, x, S;
|
|
307
307
|
if (e.subtitleItems != null && e.subtitleItems.length > 0) {
|
|
308
308
|
let { subtitleItems: t } = e, n = e.subtitleSeparator ?? " / ", r = [];
|
|
309
309
|
t.forEach((e, i) => {
|
|
@@ -313,20 +313,20 @@ var c = (e, t, n) => {
|
|
|
313
313
|
resolveEntityHref: p,
|
|
314
314
|
renderLink: m
|
|
315
315
|
}))), i < t.length - 1 && r.push(a("span", { key: `${e.id}-sep` }, n));
|
|
316
|
-
}),
|
|
316
|
+
}), S = a("span", null, ...r);
|
|
317
317
|
} else {
|
|
318
318
|
let t = e.subtitleValue?.(o, c) ?? (e.subtitle == null ? null : n(e.subtitle, c));
|
|
319
319
|
x = t != null && t.trim() !== "" ? t : void 0;
|
|
320
320
|
}
|
|
321
|
-
let
|
|
321
|
+
let C = [];
|
|
322
322
|
e.badges?.forEach((e, s) => {
|
|
323
323
|
let l = n(e.label, c), u = r(e.value(o), c), d = u == null ? "" : String(u);
|
|
324
|
-
d.trim() !== "" && (
|
|
324
|
+
d.trim() !== "" && (C.push(g(t(e.tone, o), `${l}: ${d}`)), typeof C[C.length - 1] == "object" && (C[C.length - 1] = a(i, { key: `${l}-${s}` }, C[C.length - 1])));
|
|
325
325
|
});
|
|
326
|
-
let
|
|
326
|
+
let w = e.status == null ? void 0 : d(e.status, o, c, {
|
|
327
327
|
renderBadgeRow: _,
|
|
328
328
|
renderTag: g
|
|
329
|
-
}),
|
|
329
|
+
}), T = e.meta?.map((e, t) => {
|
|
330
330
|
let r = n(e.label, c);
|
|
331
331
|
return {
|
|
332
332
|
id: `${r}-${t}`,
|
|
@@ -343,9 +343,10 @@ var c = (e, t, n) => {
|
|
|
343
343
|
return {
|
|
344
344
|
title: b,
|
|
345
345
|
subtitle: x,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
subtitleItems: S,
|
|
347
|
+
badges: C.length > 0 ? a(i, null, ...C) : void 0,
|
|
348
|
+
status: w,
|
|
349
|
+
items: T
|
|
349
350
|
};
|
|
350
351
|
}, m = (e) => {
|
|
351
352
|
if (e != null) {
|
|
@@ -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 {\n normalizeTechnicalIdentifier,\n TechnicalIdentifierValue,\n type DataTableColumn,\n type TechnicalIdentifierAbbreviation,\n} from '@plumile/ui';\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';\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 abbreviation: field.abbreviation,\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 resolveTechnicalAbbreviation = (\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text',\n): TechnicalIdentifierAbbreviation | null => {\n if (refKind === 'id' || refKind === 'hash' || refKind === 'external') {\n return 'middle';\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 technicalAbbreviation = resolveTechnicalAbbreviation(refKind);\n if (technicalAbbreviation != 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 abbreviation: technicalAbbreviation,\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 abbreviation: 'middle',\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;EAAE;EACvD,KAAK,cACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,0BAA0B;GACnC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,yBAAyB;GAClC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,uBAAuB;GAChC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,wBAAwB;GACjC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,sBAAsB;GAC/B,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,kBAAkB;GAC3B,UAAU;EACZ;EACN,KAAK,aACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,2BAA2B;GACpC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,8BAA8B;GACvC,UAAU;EACZ;EACN,KAAK,UACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,qBAAqB;GAC9B,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,uBAAuB;GAChC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GAAE,MAAM;GAAQ,OAAO,EAAE,uBAAuB;EAAE,IAClD;GAAE,MAAM;GAAW,OAAO,EAAE,0BAA0B;EAAE;EAC9D,KAAK,gBACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,iCAAiC;GAC1C,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,gCAAgC;GACzC,UAAU;EACZ;EACN,KAAK,sBACH,OAAO,IACH;GACE,MAAM;GACN,OAA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,EAAQ,YAAY;GACzB;GACA;GACA;GACA,SAAS,EAAQ,oBAAoB,EAAM,OAAO;GAClD,MAAM,EAAM,KAAK,CAAI;EACvB,CAAC,IAGI,EAAQ,cAAc;GAC3B;GACA;GACA;GACA,SAAS,EAAM,MAAM,CAAI;GACzB,QAAQ,EAAM,UAAU;EAC1B,CAAC;CACH,CAAC;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 {\n normalizeTechnicalIdentifier,\n TechnicalIdentifierValue,\n type DataTableColumn,\n type UiText,\n type TechnicalIdentifierAbbreviation,\n} from '@plumile/ui';\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';\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 abbreviation: field.abbreviation,\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?: string;\n subtitleItems?: 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 subtitle: string | undefined;\n let subtitleItemsNode: ReactNode;\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 subtitleItemsNode = createElement('span', null, ...parts);\n } else {\n const subtitleValue =\n header.subtitleValue?.(node, tApp) ??\n (header.subtitle != null ? resolveLabel(header.subtitle, tApp) : null);\n subtitle =\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,\n subtitleItems: subtitleItemsNode,\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 resolveTechnicalAbbreviation = (\n refKind: 'id' | 'slug' | 'path' | 'url' | 'hash' | 'external' | 'text',\n): TechnicalIdentifierAbbreviation | null => {\n if (refKind === 'id' || refKind === 'hash' || refKind === 'external') {\n return 'middle';\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 technicalAbbreviation = resolveTechnicalAbbreviation(refKind);\n if (technicalAbbreviation != 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 abbreviation: technicalAbbreviation,\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: UiText;\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 abbreviation: 'middle',\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":";;;;AAsEA,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;EAAE;EACvD,KAAK,cACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,0BAA0B;GACnC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,yBAAyB;GAClC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,uBAAuB;GAChC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,wBAAwB;GACjC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,sBAAsB;GAC/B,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,kBAAkB;GAC3B,UAAU;EACZ;EACN,KAAK,aACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,2BAA2B;GACpC,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,8BAA8B;GACvC,UAAU;EACZ;EACN,KAAK,UACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,qBAAqB;GAC9B,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,uBAAuB;GAChC,UAAU;EACZ;EACN,KAAK,WACH,OAAO,IACH;GAAE,MAAM;GAAQ,OAAO,EAAE,uBAAuB;EAAE,IAClD;GAAE,MAAM;GAAW,OAAO,EAAE,0BAA0B;EAAE;EAC9D,KAAK,gBACH,OAAO,IACH;GACE,MAAM;GACN,OAAO,EAAE,iCAAiC;GAC1C,UAAU;EACZ,IACA;GACE,MAAM;GACN,OAAO,EAAE,gC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AAK,IAC7B,KAAS,EAAE,qBAAqB;IAC3C;GACF,CAAC;EACH,CAAC,IAGC,EAAM,SAAS,UACV,EAAQ,YAAY;GACzB;GACA;GACA;GACA,SAAS,EAAQ,oBAAoB,EAAM,OAAO;GAClD,MAAM,EAAM,KAAK,CAAI;EACvB,CAAC,IAGI,EAAQ,cAAc;GAC3B;GACA;GACA;GACA,SAAS,EAAM,MAAM,CAAI;GACzB,QAAQ,EAAM,UAAU;EAC1B,CAAC;CACH,CAAC;AACH"}
|
|
@@ -35,7 +35,7 @@ var _e = "plumile:backoffice:recent-items", ve = "plumile:backoffice:sidebar", y
|
|
|
35
35
|
return [];
|
|
36
36
|
}
|
|
37
37
|
}, p = (e, t) => {
|
|
38
|
-
if (
|
|
38
|
+
if (typeof window < "u") try {
|
|
39
39
|
window.localStorage.setItem(e, JSON.stringify(t));
|
|
40
40
|
} catch {}
|
|
41
41
|
}, m = ({ children: f, permissions: m, authStatus: h, activeGroupId: g }) => {
|
|
@@ -48,7 +48,7 @@ var _e = "plumile:backoffice:recent-items", ve = "plumile:backoffice:sidebar", y
|
|
|
48
48
|
}
|
|
49
49
|
}), [j, M] = l(!1), [N, P] = l(null), F = E?.recentItems, I = F?.enabled === !0, L = F?.storageKey ?? _e, R = F?.maxItems ?? 8, [z, Se] = l(() => I ? ye(L) : []);
|
|
50
50
|
s(() => {
|
|
51
|
-
if (
|
|
51
|
+
if (k && typeof window < "u") try {
|
|
52
52
|
window.localStorage.setItem(`${O}:collapsed`, String(A));
|
|
53
53
|
} catch {}
|
|
54
54
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\nimport { resetRelayStore } from '@plumile/relay/environment.js';\n\nimport {\n AdminShellLayout,\n ToastProvider,\n SidebarProfileMenu,\n} from '@plumile/ui';\n\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const pinningEnabled = sidebar?.pinnedItems?.enabled === true;\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: pinningEnabled,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let sidebarPinnedEntityIds: readonly string[] | undefined;\n let sidebarTogglePin: ((entityId: string) => void) | undefined;\n let sidebarReorderPin: ((fromId: string, toId: string) => void) | undefined;\n if (pinningEnabled) {\n sidebarPinnedEntityIds = pins;\n sidebarTogglePin = togglePin;\n sidebarReorderPin = reorderPin;\n }\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n const mobileSidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n collapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseLabel: t('sidebar.actions.collapseSidebar'),\n expandLabel: t('sidebar.actions.expandSidebar'),\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n hideCollapseToggle: true,\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n containedScrollLabel={t('sidebar.contentAriaLabel')}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,IAAM,KAAmC,mCACnC,KAA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BAA4B;EAC3C,WAAW,EAAE,4BAA4B;CAC1C,CAAA;CAGH,OACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD;EACE,SAAS;GACP;GACA,QAAQ;GACR,QAAQ;GACR,WAAW;GACX,mBAAmB;GACnB,eAAe,EAAE,iCAAiC;GAClD,aAAa,EAAE,+BAA+B;GAC9C,iBAAiB,EAAE,6BAA6B;EAClD;EACA,eAAe;GACb,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,oBAAoB;GACpB,iBAAiB,EAAE,6BAA6B;EAClD;EACA,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,EAAkB,CAAA,EAC1C;EACA,sBAAsB,EAAE,0BAA0B;EAClD,mBAAkB;EAElB,UAAA,kBAAC,IAAD;GAA4C;GAC1C,UAAA,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,yBAAyB;IAC7C;IAEC,UAAA;GACoC,CAAA;EACV,CAAA;CACf,CAAA,EACL,CAAA;AAEnB,GAaM,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAC6C;CAC7C,IAAM,IAAc,EAAkB,GAAkB,CAAQ;CAEhE,OACE,kBAAC,GAAD;EACe;EACD;EACG;EAEd;CACoB,CAAA;AAE3B,GAEa,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;AACoB,CAAA,IAKzB,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;AACoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\nimport { resetRelayStore } from '@plumile/relay/environment.js';\n\nimport {\n AdminShellLayout,\n ToastProvider,\n SidebarProfileMenu,\n} from '@plumile/ui';\n\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const pinningEnabled = sidebar?.pinnedItems?.enabled === true;\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: pinningEnabled,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let sidebarPinnedEntityIds: readonly string[] | undefined;\n let sidebarTogglePin: ((entityId: string) => void) | undefined;\n let sidebarReorderPin: ((fromId: string, toId: string) => void) | undefined;\n if (pinningEnabled) {\n sidebarPinnedEntityIds = pins;\n sidebarTogglePin = togglePin;\n sidebarReorderPin = reorderPin;\n }\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n const mobileSidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n collapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseLabel: t('sidebar.actions.collapseSidebar'),\n expandLabel: t('sidebar.actions.expandSidebar'),\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n hideCollapseToggle: true,\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n containedScrollLabel={t('sidebar.contentAriaLabel')}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,IAAM,KAAmC,mCACnC,KAAoC,8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B;EAC3C,WAAW,EAAE,4BAA4B;CAC1C,CAAA;CAGH,OACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD;EACE,SAAS;GACP;GACA,QAAQ;GACR,QAAQ;GACR,WAAW;GACX,mBAAmB;GACnB,eAAe,EAAE,iCAAiC;GAClD,aAAa,EAAE,+BAA+B;GAC9C,iBAAiB,EAAE,6BAA6B;EAClD;EACA,eAAe;GACb,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,oBAAoB;GACpB,iBAAiB,EAAE,6BAA6B;EAClD;EACA,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,EAAkB,CAAA,EAC1C;EACA,sBAAsB,EAAE,0BAA0B;EAClD,mBAAkB;EAElB,UAAA,kBAAC,IAAD;GAA4C;GAC1C,UAAA,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,yBAAyB;IAC7C;IAEC,UAAA;GACoC,CAAA;EACV,CAAA;CACf,CAAA,EACL,CAAA;AAEnB,GAaM,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAC6C;CAC7C,IAAM,IAAc,EAAkB,GAAkB,CAAQ;CAEhE,OACE,kBAAC,GAAD;EACe;EACD;EACG;EAEd;CACoB,CAAA;AAE3B,GAEa,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;AACoB,CAAA,IAKzB,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;AACoB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeDashboardPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5m2 txvbqb6mq txvbqb6sa", t = "txvbqb5m2 txvbqb2ny txvbqb6sa txvbqbej txvbqb6o4", n = "txvbqb6pi txvbqb1dh txvbqb1op";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { t as loadingBody, e as tileBody, n as tileCount };
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeEntityDetailPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5m2 txvbqb2ny txvbqb8ow txvbqb6sa txvbqb1d5 txvbqbe1y", t = "txvbqb5m2 txvbqb2ny txvbqb8ow txvbqb6sa txvbqb1d5", n = "txvbqb5m2 txvbqb2ny txvbqbglo txvbqb3ew txvbqb3r6 txvbqbn8 txvbqbxh", r = "txvbqb5m2 txvbqb6mq txvbqb6sk", i = "txvbqb5m2 txvbqb2ny txvbqb6sa txvbqb1d5", a = "txvbqb5m2 txvbqb6mq txvbqb6sa", o = "txvbqb5mw txvbqb2ny txvbqb8om txvbqbkyu txvbqb7ti txvbqbej";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { t as headerActionGroup, e as headerActions, r as headerBlock, i as headerMeta, a as headerMetaList, n as headerRelationGroup, o as relationCountLoading };
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeEntityListPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5m2 txvbqb2ny txvbqb6sa txvbqb1d5", t = "txvbqb8ow", n = "c0tad0 txvbqb5mw txvbqb2ny txvbqb8om txvbqbkzy txvbqb7um txvbqbe46 txvbqbdco txvbqbnc txvbqb8y txvbqbei txvbqb3p txvbqb7y txvbqb7j txvbqb89 txvbqbmda txvbqbo5q qbwcue5 qbwcue4 txvbqbozt txvbqbpu1 qbwcue3";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { n as actionTrigger, t as actionsColumnCell, e as headerActions };
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/storybook/relay/RelayStory.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqbf6i", t = "txvbqb1dg", n = "txvbqb6nu txvbqbgk", r = "txvbqbawc";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { r as errorAction, e as errorContainer, n as errorMessage, t as errorTitle };
|
|
5
5
|
|
package/lib/esm/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.tc0xii0{width:auto;max-width:var(--_1ie8xnc16o)}.w8yhmy1:hover:not(:disabled){background-color:var(--_1ie8xnc5n);color:var(--_1ie8xnc5o);border-color:var(--_1ie8xnc5p)}.oa1uye0{column-gap:var(--_1ie8xnc2f);grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"picker clearAction";width:100%;min-height:2.5rem}.oa1uye0:hover{background-color:var(--_1ie8xnc4v)}.oa1uye1{column-gap:var(--_1ie8xnc2f);grid-area:picker;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:100%}.oa1uye1:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}.oa1uye1:disabled{cursor:not-allowed;opacity:.65}.oa1uye2:hover:not(:disabled){color:var(--_1ie8xnc51);background-color:var(--_1ie8xnc4v)}.oa1uye2:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}.oa1uye2:disabled{cursor:not-allowed;opacity:.65}.oa1uye3{grid-area:clearAction}._13200uy0{grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,auto))}.ds2thc0
|
|
1
|
+
.tc0xii0{width:auto;max-width:var(--_1ie8xnc16o)}.w8yhmy1:hover:not(:disabled){background-color:var(--_1ie8xnc5n);color:var(--_1ie8xnc5o);border-color:var(--_1ie8xnc5p)}.oa1uye0{column-gap:var(--_1ie8xnc2f);grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"picker clearAction";width:100%;min-height:2.5rem}.oa1uye0:hover{background-color:var(--_1ie8xnc4v)}.oa1uye1{column-gap:var(--_1ie8xnc2f);grid-area:picker;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:100%}.oa1uye1:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}.oa1uye1:disabled{cursor:not-allowed;opacity:.65}.oa1uye2:hover:not(:disabled){color:var(--_1ie8xnc51);background-color:var(--_1ie8xnc4v)}.oa1uye2:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}.oa1uye2:disabled{cursor:not-allowed;opacity:.65}.oa1uye3{grid-area:clearAction}._13200uy0{grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,auto))}.ds2thc0:hover:not(:disabled){color:var(--_1ie8xnc51);background-color:var(--_1ie8xnc4v)}.ds2thc0:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}.ds2thc0:disabled{cursor:not-allowed;opacity:.45}.u4nszr0{min-height:92px}.u4nszr0:hover{border-color:var(--_1ie8xnc5j);background-color:var(--_1ie8xnc4v);transform:translateY(-1px)}.u4nszr0:focus-visible{outline:2px solid var(--_1ie8xnc4o);outline-offset:2px}._1xws1b00{color:var(--_1ie8xnc1d4)}._1xws1b00:hover:not(:disabled){background-color:var(--_1ie8xnc1d5);color:var(--_1ie8xnc1d6)}._1xws1b00:focus-visible{box-shadow:var(--_1ie8xnc1d7);outline:none}._1xws1b00:disabled{cursor:not-allowed;opacity:.6}@media (forced-colors:active){._1xws1b00:focus-visible{box-shadow:none;outline-offset:2px;outline:2px solid highlight}}._80s44h0{font-size:var(--_1ie8xnc1co)}@media screen and (width>=64em){._1f81p5z0{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}}._1q232kj0{grid-template-columns:auto minmax(0,1fr);display:inline-grid}qbwcuex qbwcuev txvbqb5mw txvbqb2ny txvbqb8om txvbqb6s0 txvbqbe4g txvbqbir4 txvbqbjgo txvbqbeh txvbqbal txvbqbja txvbqbn8 txvbqbls txvbqbnj txvbqb1dg txvbqb1rv txvbqb3p txvbqb7x txvbqb7h txvbqb89 qbwcuew txvbqbodq txvbqbmcu txvbqbndi txvbqbnmm qbwcue5 qbwcue4 txvbqbozt txvbqbpu1 qbwcue3:hover .kk18lv0{color:var(--_1ie8xnc6l)}._8o9eh80:focus-visible{box-shadow:inset 0 0 0 2px var(--_1ie8xnc4o);outline:none}@media (forced-colors:active){._8o9eh80:focus-visible{box-shadow:none;outline-offset:2px;outline:2px solid highlight}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcButtons.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/OidcButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OidcButtons.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/OidcButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAO3E,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,WAAW,kBAAmB,KAAK,KAAG,GAAG,CAAC,OAAO,GAAG,IAoChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptInvitationScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/AcceptInvitationScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,sBAAsB,uDAKhC,KAAK,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"AcceptInvitationScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/AcceptInvitationScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,sBAAsB,uDAKhC,KAAK,KAAG,GAAG,CAAC,OA4Md,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordResetCompleteScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/PasswordResetCompleteScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAYf,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,uBAAuB,EAAE,CAAC,KAAK,EAAE;QAC/B,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,2BAA2B,uDAIrC,KAAK,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"PasswordResetCompleteScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/PasswordResetCompleteScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAYf,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,uBAAuB,EAAE,CAAC,KAAK,EAAE;QAC/B,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,2BAA2B,uDAIrC,KAAK,KAAG,GAAG,CAAC,OAwKd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDataTableColumns.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/columns/buildDataTableColumns.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAGpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,aAAa,CAAC;AAuBrB,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,SAAS,CAAC;IAChB,CAAC,EAAE,SAAS,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,8BAA8B,CAAC,GAAG,IAC5C,0BAA0B,CAAC,GAAG,CAAC,GAAG;IAChC,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"buildDataTableColumns.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/columns/buildDataTableColumns.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EAGpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,aAAa,CAAC;AAuBrB,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,SAAS,CAAC;IAChB,CAAC,EAAE,SAAS,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,8BAA8B,CAAC,GAAG,IAC5C,0BAA0B,CAAC,GAAG,CAAC,GAAG;IAChC,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAmCJ,wBAAgB,qBAAqB,CAAC,GAAG,EACvC,OAAO,EAAE,SAAS,oBAAoB,CAAC,GAAG,CAAC,EAAE,EAC7C,OAAO,EAAE,4BAA4B,GACpC,SAAS,8BAA8B,CAAC,GAAG,CAAC,EAAE,CA2GhD"}
|