@plumile/backoffice-react 0.1.201 → 0.1.205
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 +4 -4
- package/lib/esm/auth/login/LoginFlow.js.map +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +28 -28
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +183 -183
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/hooks/useAuth.js +56 -56
- package/lib/esm/hooks/useAuth.js.map +1 -1
- package/lib/esm/hooks/useConditionalSubscription.js +18 -18
- package/lib/esm/hooks/useConditionalSubscription.js.map +1 -1
- package/lib/esm/index.js +49 -57
- package/lib/esm/pages/BackofficeEntityDetailPage.js +97 -97
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeLayoutPage.js +19 -19
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +33 -33
- package/lib/esm/router/createBackofficeRoutes.js +26 -28
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/storybook/relay/RelayStory.js +32 -32
- package/lib/esm/storybook/relay/RelayStory.js.map +1 -1
- package/lib/esm/storybook/relay/mockResolvers.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts.map +1 -1
- package/lib/types/hooks/useAuth.d.ts.map +1 -1
- package/lib/types/hooks/useConditionalSubscription.d.ts.map +1 -1
- package/lib/types/i18n/locales/en/backofficeReact.d.ts +5 -0
- package/lib/types/i18n/locales/fr/backofficeReact.d.ts +5 -0
- package/lib/types/index.d.ts +1 -9
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +3 -3
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/lib/types/storybook/relay/RelayStory.d.ts +1 -1
- package/lib/types/storybook/relay/RelayStory.d.ts.map +1 -1
- package/lib/types/storybook/relay/mockResolvers.d.ts +9 -1
- package/lib/types/storybook/relay/mockResolvers.d.ts.map +1 -1
- package/package.json +12 -15
- package/lib/esm/_virtual/_rolldown/runtime.js +0 -7
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js +0 -13
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js.map +0 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js +0 -12
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js.map +0 -1
- package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js +0 -16
- package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js.map +0 -1
- package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js +0 -17
- package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js.map +0 -1
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js +0 -8
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js.map +0 -1
- package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js +0 -16
- package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js.map +0 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +0 -6
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js.map +0 -1
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +0 -6
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js.map +0 -1
- package/lib/esm/components/backoffice/routing/BackofficeRoutePendingBar.js +0 -12
- package/lib/esm/components/backoffice/routing/BackofficeRoutePendingBar.js.map +0 -1
- package/lib/esm/components/backoffice/routing/backofficeRoutePendingBar.css.js +0 -7
- package/lib/esm/components/backoffice/routing/backofficeRoutePendingBar.css.js.map +0 -1
- package/lib/esm/modules/base64.js +0 -21
- package/lib/esm/modules/base64.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +0 -15
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayLikeToArray.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +0 -15
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/defineProperty.js +0 -20
- package/lib/esm/node_modules/@babel/runtime/helpers/defineProperty.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -13
- package/lib/esm/node_modules/@babel/runtime/helpers/interopRequireDefault.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/iterableToArray.js +0 -13
- package/lib/esm/node_modules/@babel/runtime/helpers/iterableToArray.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/nonIterableSpread.js +0 -13
- package/lib/esm/node_modules/@babel/runtime/helpers/nonIterableSpread.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/objectSpread2.js +0 -33
- package/lib/esm/node_modules/@babel/runtime/helpers/objectSpread2.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -19
- package/lib/esm/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/toConsumableArray.js +0 -18
- package/lib/esm/node_modules/@babel/runtime/helpers/toConsumableArray.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -22
- package/lib/esm/node_modules/@babel/runtime/helpers/toPrimitive.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -17
- package/lib/esm/node_modules/@babel/runtime/helpers/toPropertyKey.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/typeof.js +0 -18
- package/lib/esm/node_modules/@babel/runtime/helpers/typeof.js.map +0 -1
- package/lib/esm/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -19
- package/lib/esm/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js.map +0 -1
- package/lib/esm/node_modules/fbjs/lib/areEqual.js +0 -42
- package/lib/esm/node_modules/fbjs/lib/areEqual.js.map +0 -1
- package/lib/esm/node_modules/invariant/browser.js +0 -30
- package/lib/esm/node_modules/invariant/browser.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/index.js +0 -11
- package/lib/esm/node_modules/relay-test-utils/index.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/lib/RelayMockPayloadGenerator.js +0 -288
- package/lib/esm/node_modules/relay-test-utils/lib/RelayMockPayloadGenerator.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js +0 -183
- package/lib/esm/node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/lib/RelayResolverTestUtils.js +0 -19
- package/lib/esm/node_modules/relay-test-utils/lib/RelayResolverTestUtils.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/lib/index.js +0 -21
- package/lib/esm/node_modules/relay-test-utils/lib/index.js.map +0 -1
- package/lib/esm/node_modules/relay-test-utils/lib/unwrapContainer.js +0 -16
- package/lib/esm/node_modules/relay-test-utils/lib/unwrapContainer.js.map +0 -1
- package/lib/esm/relay/RelayProvider.js +0 -2
- package/lib/esm/relay/envHelpers.js +0 -63
- package/lib/esm/relay/envHelpers.js.map +0 -1
- package/lib/esm/relay/environment.js +0 -2
- package/lib/esm/relay/shortAccessTokenEnvironment.js +0 -2
- package/lib/esm/relay/useRelayOperationActivity.js +0 -2
- package/lib/esm/storybook/relay/relay-test-utils.d.js +0 -0
- package/lib/types/auth/AuthFlows.stories.d.ts +0 -19
- package/lib/types/auth/AuthFlows.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts +0 -41
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts +0 -11
- package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailPrimitives.stories.d.ts +0 -17
- package/lib/types/components/backoffice/detail/BackofficeDetailPrimitives.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailTaggedValue.d.ts +0 -13
- package/lib/types/components/backoffice/detail/BackofficeDetailTaggedValue.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeEnumLabel.d.ts +0 -9
- package/lib/types/components/backoffice/detail/BackofficeEnumLabel.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts +0 -10
- package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts +0 -8
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts +0 -11
- package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts.map +0 -1
- package/lib/types/components/backoffice/detail/backofficeDetailRelationLink.css.d.ts +0 -6
- package/lib/types/components/backoffice/detail/backofficeDetailRelationLink.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.stories.d.ts +0 -12
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/filters/EntityIdFilterField.stories.d.ts +0 -12
- package/lib/types/components/backoffice/filters/EntityIdFilterField.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/hub/BackofficeHubTemplate.stories.d.ts +0 -49
- package/lib/types/components/backoffice/hub/BackofficeHubTemplate.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/overview/BackofficeOverviewLayout.stories.d.ts +0 -11
- package/lib/types/components/backoffice/overview/BackofficeOverviewLayout.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.stories.d.ts +0 -12
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/refs/backofficeEntityIdRef.css.d.ts +0 -2
- package/lib/types/components/backoffice/refs/backofficeEntityIdRef.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/routing/BackofficeRoutePendingBar.d.ts +0 -4
- package/lib/types/components/backoffice/routing/BackofficeRoutePendingBar.d.ts.map +0 -1
- package/lib/types/components/backoffice/routing/backofficeRoutePendingBar.css.d.ts +0 -3
- package/lib/types/components/backoffice/routing/backofficeRoutePendingBar.css.d.ts.map +0 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.stories.d.ts +0 -11
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.stories.d.ts.map +0 -1
- package/lib/types/components/backoffice/tools/BackofficeTools.stories.d.ts +0 -17
- package/lib/types/components/backoffice/tools/BackofficeTools.stories.d.ts.map +0 -1
- package/lib/types/modules/base64.d.ts +0 -3
- package/lib/types/modules/base64.d.ts.map +0 -1
- package/lib/types/pages/BackofficeDashboardPage.stories.d.ts +0 -9
- package/lib/types/pages/BackofficeDashboardPage.stories.d.ts.map +0 -1
- package/lib/types/relay/RelayProvider.d.ts +0 -2
- package/lib/types/relay/RelayProvider.d.ts.map +0 -1
- package/lib/types/relay/envHelpers.d.ts +0 -25
- package/lib/types/relay/envHelpers.d.ts.map +0 -1
- package/lib/types/relay/environment.d.ts +0 -2
- package/lib/types/relay/environment.d.ts.map +0 -1
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts +0 -5
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +0 -1
- package/lib/types/relay/useRelayOperationActivity.d.ts +0 -2
- package/lib/types/relay/useRelayOperationActivity.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useContext,\n useEffect,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\nimport {\n getResourcePage,\n type ResourcePage,\n} from '@plumile/router/ResourcePage.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { r } from '@plumile/router/tools.js';\nimport {\n type AnyRoute,\n type Route,\n type RouteFallbackArgs,\n} from '@plumile/router/types.js';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n Variables,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeDashboardConfig,\n BackofficeDetailPageManifestItem,\n BackofficeEntityManifestItem,\n BackofficeEntityManifestMap,\n I18nLabel,\n BackofficePreparedDetailFrameRoute,\n BackofficePreparedDetailLayoutDataRoute,\n BackofficePreparedDetailPageConfigRoute,\n BackofficePreparedDetailPageDataRoute,\n BackofficePreparedDetailShellRoute,\n BackofficePreparedDetailUnknownPageRoute,\n BackofficePreparedListDataRoute,\n BackofficePreparedListLayoutRoute,\n BackofficePreparedListShellRoute,\n BackofficePreparedToolConfigRoute,\n BackofficePreparedToolRoute,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardRegistration,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\nimport { validateBackofficeDashboardRegistrations } from '../provider/dashboardRegistrations.js';\nimport { BackofficeEntityDetailManifestFallback } from '../pages/detail/BackofficeEntityDetailManifestFallback.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n dashboards?: readonly BackofficeDashboardRegistration[];\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui/pages/WrapperPage.js')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityListShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListShellPage.js'),\n );\n\nexport const BackofficeEntityListDataPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListDataPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListDataPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailFramePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailFramePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailFramePage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailPageConfigPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPageConfigPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPageConfigPage.js'),\n );\n\nexport const BackofficeEntityDetailShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailShellPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeDashboardShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardShellPage.js'),\n );\n\nexport const BackofficeToolShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeToolShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeToolShellPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\nexport type BackofficePreparedDashboardShellRoute = {\n dashboardId: string | null;\n label?: I18nLabel;\n};\n\nexport type BackofficePreparedDashboardRoute =\n BackofficePreparedDashboardShellRoute & {\n config: BackofficeDashboardConfig;\n };\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeHistoryRedirect = ({\n pathname,\n}: {\n pathname: string;\n}): null => {\n const router = useContext(RoutingContext);\n\n useEffect(() => {\n router?.history.set({\n pathname,\n });\n }, [pathname, router]);\n\n return null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n return <BackofficeHistoryRedirect pathname={loginRedirectPath} />;\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst normalizePagePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst resolveDetailPageManifestByPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): BackofficeDetailPageManifestItem | null => {\n const pagePath = normalizePagePath(rawPagePath);\n return (\n entityManifestItem.detailPages?.find((page) => {\n return normalizePagePath(page.pathSegment) === pagePath;\n }) ?? null\n );\n};\n\nconst resolveDetailPageIdForPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): string => {\n return (\n resolveDetailPageManifestByPath(entityManifestItem, rawPagePath)?.id ??\n rawPagePath\n );\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, unknown>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const dashboards = validateBackofficeDashboardRegistrations(input.dashboards);\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const prepareRootDashboard =\n async (): Promise<BackofficePreparedDashboardRoute | null> => {\n if (dashboard == null) {\n return null;\n }\n const config = await dashboard.load();\n return {\n dashboardId: 'dashboard',\n config,\n };\n };\n const prepareRootDashboardShell =\n (): BackofficePreparedDashboardShellRoute | null => {\n if (dashboard == null) {\n return null;\n }\n return {\n dashboardId: 'dashboard',\n };\n };\n const renderDashboard = ({\n prepared,\n Component,\n }: {\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardComponent = Component as ComponentType<{\n prepared?: unknown;\n }>;\n return <DashboardComponent prepared={prepared} />;\n };\n const renderDashboardShell = ({\n children: dashboardChildren,\n prepared,\n Component,\n }: {\n children: ReactNode;\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardShellComponent = Component as ComponentType<{\n children?: ReactNode;\n prepared?: BackofficePreparedDashboardShellRoute | null;\n }>;\n return (\n <DashboardShellComponent\n prepared={prepared as BackofficePreparedDashboardShellRoute | null}\n >\n {dashboardChildren}\n </DashboardShellComponent>\n );\n };\n\n const dashboardConfigRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: prepareRootDashboardShell,\n render: renderDashboardShell,\n children: [dashboardConfigRoute],\n });\n const dashboardAliasConfigRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: prepareRootDashboardShell,\n render: renderDashboardShell,\n children: [dashboardAliasConfigRoute],\n });\n const secondaryDashboardRoutes = dashboards.map((registration) => {\n const dashboardConfigChildRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n const config = await registration.module.load();\n return {\n dashboardId: registration.id,\n label: registration.label,\n config,\n } satisfies BackofficePreparedDashboardRoute;\n },\n render: renderDashboard,\n });\n return rBackoffice({\n path: `dashboard/${registration.id}`,\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: () => {\n return {\n dashboardId: registration.id,\n label: registration.label,\n } satisfies BackofficePreparedDashboardShellRoute;\n },\n render: renderDashboardShell,\n children: [dashboardConfigChildRoute],\n });\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<unknown, unknown>[] = [];\n const renderDetailRouteFallback = ({\n match,\n }: RouteFallbackArgs<BackofficeRouterContext>): JSX.Element => {\n const rawId = String(match?.params.id ?? '');\n const rawPagePath =\n typeof match?.params.pagePath === 'string'\n ? match.params.pagePath\n : null;\n const pageId =\n rawPagePath == null\n ? entityManifestItem.defaultDetailPageId\n : resolveDetailPageIdForPath(entityManifestItem, rawPagePath);\n return (\n <BackofficeEntityDetailManifestFallback\n entityManifest={entityManifestItem}\n id={rawId}\n pageId={pageId}\n pagePath={rawPagePath}\n />\n );\n };\n\n if (entityManifestItem.hasList) {\n const listDataRoute = rBackoffice({\n path: '',\n querySchema: entityManifestItem.listNavigation.querySchema,\n resourcePage: BackofficeEntityListDataPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, filters, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list } = config;\n const { defaults: listDefaults } = entityManifestItem.listNavigation;\n const navigationQuery: { sort?: string } = {};\n if (typeof query.sort === 'string') {\n navigationQuery.sort = query.sort;\n }\n const navigationFilters = filters as Parameters<\n typeof entityManifestItem.listNavigation.decode\n >[0]['filters'];\n const state = entityManifestItem.listNavigation.decode({\n filters: navigationFilters,\n query: navigationQuery,\n });\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListDataRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListDataRoute;\n return <Component prepared={preparedRoute} />;\n },\n });\n routeEntityIdMap.set(listDataRoute, entityManifestItem.id);\n\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async () => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const prepared: BackofficePreparedListLayoutRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n };\n return prepared;\n },\n render: ({ children: listChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {listChildren}\n </Component>\n );\n },\n children: [listDataRoute],\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n\n const listShellRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListShellPageResource,\n prepareSearchBehavior: 'path',\n prepare: () => {\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n } satisfies BackofficePreparedListShellRoute;\n },\n render: ({ children: listShellChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListShellRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {listShellChildren}\n </Component>\n );\n },\n children: [listRoute],\n });\n routeEntityIdMap.set(listShellRoute, entityManifestItem.id);\n children.push(listShellRoute);\n }\n\n const detailPageRoutes = entityManifestItem.detailPages.map(\n (pageManifest) => {\n const pageDataRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as Variables,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageDataRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageDataRoute;\n return <Component prepared={preparedRoute} />;\n },\n });\n routeEntityIdMap.set(pageDataRoute, entityManifestItem.id);\n\n const pageConfigRoute = rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageConfigPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ variables }) => {\n const rawId = String(variables.id ?? '');\n const [pageModule, layoutModule] = await Promise.all([\n entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n ),\n entityRegistry.loadDetailLayoutEntity(entityManifestItem.id),\n ]);\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: layoutModule.config,\n id: rawId,\n pageConfig: pageModule.config,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageConfigRoute;\n },\n render: ({ children: pageChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageConfigRoute;\n return (\n <Component\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {pageChildren}\n </Component>\n );\n },\n children: [pageDataRoute],\n });\n routeEntityIdMap.set(pageConfigRoute, entityManifestItem.id);\n return pageConfigRoute;\n },\n );\n\n const detailLayoutDataRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as Variables,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutDataRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailLayoutDataRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId,\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n return <BackofficeHistoryRedirect pathname={redirectTo} />;\n },\n }),\n ...detailPageRoutes,\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n } satisfies BackofficePreparedDetailUnknownPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail =\n prepared as BackofficePreparedDetailUnknownPageRoute;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutDataRoute, entityManifestItem.id);\n\n const detailShellRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailShellPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '');\n const rawPagePath =\n typeof variables.pagePath === 'string' ? variables.pagePath : null;\n const pageId =\n rawPagePath == null\n ? entityManifestItem.defaultDetailPageId\n : resolveDetailPageIdForPath(entityManifestItem, rawPagePath);\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n id: rawId,\n pageId,\n pagePath: rawPagePath,\n } satisfies BackofficePreparedDetailShellRoute;\n },\n render: ({ children: shellChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailShellRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {shellChildren}\n </Component>\n );\n },\n children: [detailLayoutDataRoute],\n });\n routeEntityIdMap.set(detailShellRoute, entityManifestItem.id);\n\n const detailFrameRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailFramePageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '');\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n id: rawId,\n } satisfies BackofficePreparedDetailFrameRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailFrameRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [detailShellRoute],\n });\n routeEntityIdMap.set(detailFrameRoute, entityManifestItem.id);\n children.push(detailFrameRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n suspenseBoundary: 'segment',\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolConfigRoute = rBackoffice({\n path: '',\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolConfigRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolConfigRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolConfigRoute, toolManifest.id);\n\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: BackofficeToolShellPageResource,\n prepare: () => {\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ children: toolChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n prepared={preparedTool}\n >\n {toolChildren}\n </Component>\n );\n },\n children: [toolConfigRoute],\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n suspenseBoundary: 'segment',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n ...secondaryDashboardRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, unknown>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n resolveDetailPageIdForPath,\n resolveDetailPageManifestByPath,\n validateBackofficeDashboardRegistrations,\n BackofficeLayoutRouteWithAuthStatus,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;;;;;;AAgEA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAiB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,oCAAA,CAAqC,YAC9D,EACF,GAEa,IACX,EACE,wBAEA,YAAY,OAAO,mCACrB,GAEW,IACX,EACE,4BAEA,YAAY,OAAO,uCACrB,GAEW,IACX,EACE,iCAEA,YAAY,OAAO,4CACrB,GAEW,IACX,EACE,gCAEA,YAAY,OAAO,2CACrB,GAEW,KACX,EACE,8BAEA,YAAY,OAAO,yCACrB,GAEW,IACX,EACE,mCAEA,YAAY,OAAO,8CACrB,GAEW,IACX,EACE,oCAEA,YAAY,OAAO,+CACrB,GAEW,IACX,EACE,wCAEA,YAAY,OAAO,mDACrB,GAEW,IACX,EACE,mCAEA,YAAY,OAAO,8CACrB,GAEW,IACX,EACE,6CAEA,YAAY,OAAO,wDACrB,GAEW,IACX,EACE,2BAEA,YAAY,OAAO,sCACrB,GAEW,IACX,EACE,gCAEA,YAAY,OAAO,2CACrB,GAEW,IACX,EACE,2BAEA,YAAY,OAAO,sCACrB,GAEW,IAAiD,EAC5D,qBAEA,YAAY,OAAO,gCACrB,GAEa,KAAmD,EAC9D,uBAEA,YAAY,OAAO,kCACrB,GAEa,KACX,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AAK;IAMxC,OAAO,EAAE,OALQ,EACf,EAAQ,kBACR,EAAU,YACV,CAAC,CAEa,EAAS;GAC3B;GACA,SAAS,EAAE,aAAU,mBACf,KAAa,OACR,OAEF,kBAAC,GAAD,EAAqB,YAAW,CAAA;EAE3C,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,qBAAqB,KAAK,GAC9B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,sBAAsB,KAAK,GAC/B;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;EACD,EAAY;GACV,MAAM;GACN,cAAc;GACd,SAAS,aACP,MAAM,EAAK,YAAY,KAAK,GACrB;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;CACH;CAuBA,QArBI,EAAK,wBAAwB,MAAQ,EAAK,oBAAoB,SAChE,EAAO,KACL,EAAY;EACV,MAAM;EACN,cAAc;EACd,SAAS,aACP,MAAM,EAAK,kBAAkB,KAAK,GAC3B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;CAEvB,CAAC,CACH,GAGF,EAAO,KAAK,EAAW,GAEhB;AACT;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useContext,\n useEffect,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\nimport {\n getResourcePage,\n type ResourcePage,\n} from '@plumile/router/ResourcePage.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { r } from '@plumile/router/tools.js';\nimport {\n type RouteNode,\n type Route,\n type RouteFallbackArgs,\n} from '@plumile/router/types.js';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n Variables,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeDashboardConfig,\n BackofficeDetailPageManifestItem,\n BackofficeEntityManifestItem,\n BackofficeEntityManifestMap,\n I18nLabel,\n BackofficePreparedDetailFrameRoute,\n BackofficePreparedDetailLayoutDataRoute,\n BackofficePreparedDetailPageConfigRoute,\n BackofficePreparedDetailPageDataRoute,\n BackofficePreparedDetailShellRoute,\n BackofficePreparedDetailUnknownPageRoute,\n BackofficePreparedListDataRoute,\n BackofficePreparedListLayoutRoute,\n BackofficePreparedListShellRoute,\n BackofficePreparedToolConfigRoute,\n BackofficePreparedToolRoute,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardRegistration,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\nimport { validateBackofficeDashboardRegistrations } from '../provider/dashboardRegistrations.js';\nimport { BackofficeEntityDetailManifestFallback } from '../pages/detail/BackofficeEntityDetailManifestFallback.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n dashboards?: readonly BackofficeDashboardRegistration[];\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\n/** @deprecated Structural routes no longer need a page resource. */\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui/pages/WrapperPage.js')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityListShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListShellPage.js'),\n );\n\nexport const BackofficeEntityListDataPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListDataPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListDataPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailFramePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailFramePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailFramePage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailPageConfigPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPageConfigPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPageConfigPage.js'),\n );\n\nexport const BackofficeEntityDetailShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailShellPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeDashboardShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardShellPage.js'),\n );\n\nexport const BackofficeToolShellPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeToolShellPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeToolShellPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\nexport type BackofficePreparedDashboardShellRoute = {\n dashboardId: string | null;\n label?: I18nLabel;\n};\n\nexport type BackofficePreparedDashboardRoute =\n BackofficePreparedDashboardShellRoute & {\n config: BackofficeDashboardConfig;\n };\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeHistoryRedirect = ({\n pathname,\n}: {\n pathname: string;\n}): null => {\n const router = useContext(RoutingContext);\n\n useEffect(() => {\n router?.history.set({\n pathname,\n });\n }, [pathname, router]);\n\n return null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n return <BackofficeHistoryRedirect pathname={loginRedirectPath} />;\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst normalizePagePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: RouteNode[] } | null,\n routeEntityIdMap: WeakMap<RouteNode, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst resolveDetailPageManifestByPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): BackofficeDetailPageManifestItem | null => {\n const pagePath = normalizePagePath(rawPagePath);\n return (\n entityManifestItem.detailPages?.find((page) => {\n return normalizePagePath(page.pathSegment) === pagePath;\n }) ?? null\n );\n};\n\nconst resolveDetailPageIdForPath = (\n entityManifestItem: BackofficeEntityManifestItem,\n rawPagePath: string,\n): string => {\n return (\n resolveDetailPageManifestByPath(entityManifestItem, rawPagePath)?.id ??\n rawPagePath\n );\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, unknown>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const dashboards = validateBackofficeDashboardRegistrations(input.dashboards);\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<RouteNode, string>();\n const routeGroupIdMap = new WeakMap<RouteNode, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const prepareRootDashboard =\n async (): Promise<BackofficePreparedDashboardRoute | null> => {\n if (dashboard == null) {\n return null;\n }\n const config = await dashboard.load();\n return {\n dashboardId: 'dashboard',\n config,\n };\n };\n const prepareRootDashboardShell =\n (): BackofficePreparedDashboardShellRoute | null => {\n if (dashboard == null) {\n return null;\n }\n return {\n dashboardId: 'dashboard',\n };\n };\n const renderDashboard = ({\n prepared,\n Component,\n }: {\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardComponent = Component as ComponentType<{\n prepared?: unknown;\n }>;\n return <DashboardComponent prepared={prepared} />;\n };\n const renderDashboardShell = ({\n children: dashboardChildren,\n prepared,\n Component,\n }: {\n children: ReactNode;\n prepared: unknown;\n Component?: ComponentType<Record<string, unknown>> | null;\n }): JSX.Element | null => {\n if (Component == null) {\n return null;\n }\n const DashboardShellComponent = Component as ComponentType<{\n children?: ReactNode;\n prepared?: BackofficePreparedDashboardShellRoute | null;\n }>;\n return (\n <DashboardShellComponent\n prepared={prepared as BackofficePreparedDashboardShellRoute | null}\n >\n {dashboardChildren}\n </DashboardShellComponent>\n );\n };\n\n const dashboardConfigRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: prepareRootDashboardShell,\n render: renderDashboardShell,\n children: [dashboardConfigRoute],\n });\n const dashboardAliasConfigRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: prepareRootDashboard,\n render: renderDashboard,\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: prepareRootDashboardShell,\n render: renderDashboardShell,\n children: [dashboardAliasConfigRoute],\n });\n const secondaryDashboardRoutes = dashboards.map((registration) => {\n const dashboardConfigChildRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n const config = await registration.module.load();\n return {\n dashboardId: registration.id,\n label: registration.label,\n config,\n } satisfies BackofficePreparedDashboardRoute;\n },\n render: renderDashboard,\n });\n return rBackoffice({\n path: `dashboard/${registration.id}`,\n resourcePage: BackofficeDashboardShellPageResource,\n prepare: () => {\n return {\n dashboardId: registration.id,\n label: registration.label,\n } satisfies BackofficePreparedDashboardShellRoute;\n },\n render: renderDashboardShell,\n children: [dashboardConfigChildRoute],\n });\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<unknown, unknown>[] = [];\n const renderDetailRouteFallback = ({\n match,\n }: RouteFallbackArgs<BackofficeRouterContext>): JSX.Element => {\n const rawId = String(match?.params.id ?? '');\n const rawPagePath =\n typeof match?.params.pagePath === 'string'\n ? match.params.pagePath\n : null;\n const pageId =\n rawPagePath == null\n ? entityManifestItem.defaultDetailPageId\n : resolveDetailPageIdForPath(entityManifestItem, rawPagePath);\n return (\n <BackofficeEntityDetailManifestFallback\n entityManifest={entityManifestItem}\n id={rawId}\n pageId={pageId}\n pagePath={rawPagePath}\n />\n );\n };\n\n if (entityManifestItem.hasList) {\n const listDataRoute = rBackoffice({\n path: '',\n querySchema: entityManifestItem.listNavigation.querySchema,\n resourcePage: BackofficeEntityListDataPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, filters, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list } = config;\n const { defaults: listDefaults } = entityManifestItem.listNavigation;\n const navigationQuery: { sort?: string } = {};\n if (typeof query.sort === 'string') {\n navigationQuery.sort = query.sort;\n }\n const navigationFilters = filters as Parameters<\n typeof entityManifestItem.listNavigation.decode\n >[0]['filters'];\n const state = entityManifestItem.listNavigation.decode({\n filters: navigationFilters,\n query: navigationQuery,\n });\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListDataRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListDataRoute;\n return <Component prepared={preparedRoute} />;\n },\n });\n routeEntityIdMap.set(listDataRoute, entityManifestItem.id);\n\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async () => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const prepared: BackofficePreparedListLayoutRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n };\n return prepared;\n },\n render: ({ children: listChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {listChildren}\n </Component>\n );\n },\n children: [listDataRoute],\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n\n const listShellRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListShellPageResource,\n prepareSearchBehavior: 'path',\n prepare: () => {\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n } satisfies BackofficePreparedListShellRoute;\n },\n render: ({ children: listShellChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListShellRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {listShellChildren}\n </Component>\n );\n },\n children: [listRoute],\n });\n routeEntityIdMap.set(listShellRoute, entityManifestItem.id);\n children.push(listShellRoute);\n }\n\n const detailPageRoutes = entityManifestItem.detailPages.map(\n (pageManifest) => {\n const pageDataRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as Variables,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageDataRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageDataRoute;\n return <Component prepared={preparedRoute} />;\n },\n });\n routeEntityIdMap.set(pageDataRoute, entityManifestItem.id);\n\n const pageConfigRoute = rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageConfigPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ variables }) => {\n const rawId = String(variables.id ?? '');\n const [pageModule, layoutModule] = await Promise.all([\n entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n ),\n entityRegistry.loadDetailLayoutEntity(entityManifestItem.id),\n ]);\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: layoutModule.config,\n id: rawId,\n pageConfig: pageModule.config,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageConfigRoute;\n },\n render: ({ children: pageChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageConfigRoute;\n return (\n <Component\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {pageChildren}\n </Component>\n );\n },\n children: [pageDataRoute],\n });\n routeEntityIdMap.set(pageConfigRoute, entityManifestItem.id);\n return pageConfigRoute;\n },\n );\n\n const detailLayoutDataRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as Variables,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutDataRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailLayoutDataRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId,\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n return <BackofficeHistoryRedirect pathname={redirectTo} />;\n },\n }),\n ...detailPageRoutes,\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n } satisfies BackofficePreparedDetailUnknownPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail =\n prepared as BackofficePreparedDetailUnknownPageRoute;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutDataRoute, entityManifestItem.id);\n\n const detailShellRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityDetailShellPageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '');\n const rawPagePath =\n typeof variables.pagePath === 'string' ? variables.pagePath : null;\n const pageId =\n rawPagePath == null\n ? entityManifestItem.defaultDetailPageId\n : resolveDetailPageIdForPath(entityManifestItem, rawPagePath);\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n id: rawId,\n pageId,\n pagePath: rawPagePath,\n } satisfies BackofficePreparedDetailShellRoute;\n },\n render: ({ children: shellChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailShellRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {shellChildren}\n </Component>\n );\n },\n children: [detailLayoutDataRoute],\n });\n routeEntityIdMap.set(detailShellRoute, entityManifestItem.id);\n\n const detailFrameRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailFramePageResource,\n suspenseBoundary: 'segment',\n fallback: renderDetailRouteFallback,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '');\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n id: rawId,\n } satisfies BackofficePreparedDetailFrameRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailFrameRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [detailShellRoute],\n });\n routeEntityIdMap.set(detailFrameRoute, entityManifestItem.id);\n children.push(detailFrameRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n suspenseBoundary: 'segment',\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolConfigRoute = rBackoffice({\n path: '',\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolConfigRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolConfigRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolConfigRoute, toolManifest.id);\n\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: BackofficeToolShellPageResource,\n prepare: () => {\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ children: toolChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n prepared={preparedTool}\n >\n {toolChildren}\n </Component>\n );\n },\n children: [toolConfigRoute],\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n suspenseBoundary: 'segment',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n ...secondaryDashboardRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, unknown>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n resolveDetailPageIdForPath,\n resolveDetailPageManifestByPath,\n validateBackofficeDashboardRegistrations,\n BackofficeLayoutRouteWithAuthStatus,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;;;;;;AAgEA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAkB5B,IAA2C,EACtD,eAEA,aAAa,EACX,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AAY,KAAK,GACrB;GAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;EAEvB,CAAC;CACH;CAuBA,QArBI,EAAK,wBAAwB,MAAQ,EAAK,oBAAoB,SAChE,EAAO,KACL,EAAY;EACV,MAAM;EACN,cAAc;EACd,SAAS,aACP,MAAM,EAAK,kBAAkB,KAAK,GAC3B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,CAAY,CAAA;CAEvB,CAAC,CACH,GAGF,EAAO,KAAK,EAAW,GAEhB;AACT;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { BackofficeErrorBoundary as e } from "../../components/backoffice/errors/BackofficeErrorBoundary.js";
|
|
2
2
|
import { errorAction as t, errorContainer as n, errorMessage as r, errorTitle as i } from "./RelayStory.css.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { createBackofficeMockResolvers as a } from "./mockResolvers.js";
|
|
4
|
+
import { Suspense as o } from "react";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { RelayEnvironmentProvider as u, loadQuery as d, useLazyLoadQuery as f } from "react-relay";
|
|
7
|
+
import { MockPayloadGenerator as p, createMockEnvironment as m } from "relay-test-utils";
|
|
8
8
|
//#region src/storybook/relay/RelayStory.tsx
|
|
9
|
-
var
|
|
9
|
+
var h = ({ nodeType: e, mockResolvers: t }) => {
|
|
10
10
|
let n = {
|
|
11
|
-
...
|
|
11
|
+
...a(),
|
|
12
12
|
...t ?? {}
|
|
13
13
|
};
|
|
14
14
|
return e != null && (n.Node = () => ({ __typename: e })), n;
|
|
15
15
|
}, g = ({ error: e, reset: a }) => {
|
|
16
16
|
let o = "Unknown error";
|
|
17
|
-
return o = e instanceof Error ? e.message : String(e), /* @__PURE__ */
|
|
17
|
+
return o = e instanceof Error ? e.message : String(e), /* @__PURE__ */ l("div", {
|
|
18
18
|
className: n,
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ c("div", {
|
|
21
21
|
className: i,
|
|
22
22
|
children: "Unable to render story"
|
|
23
23
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ c("div", {
|
|
25
25
|
className: r,
|
|
26
26
|
children: o
|
|
27
27
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ c("button", {
|
|
29
29
|
type: "button",
|
|
30
30
|
onClick: () => {
|
|
31
31
|
a();
|
|
@@ -36,17 +36,17 @@ var m = a(), h = ({ nodeType: e, mockResolvers: t }) => {
|
|
|
36
36
|
]
|
|
37
37
|
});
|
|
38
38
|
}, _ = ({ query: e, variables: t, render: n }) => {
|
|
39
|
-
let r =
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
let r = f(e, t);
|
|
40
|
+
return /* @__PURE__ */ c(s, { children: n(r) });
|
|
41
41
|
}, v = (t) => {
|
|
42
|
-
let n =
|
|
43
|
-
return n.mock.queueOperationResolver((e) => r == null ?
|
|
42
|
+
let n = m(), r = h(t);
|
|
43
|
+
return n.mock.queueOperationResolver((e) => r == null ? p.generate(e) : p.generate(e, r)), n.mock.queuePendingOperation(t.query, t.variables), /* @__PURE__ */ c(u, {
|
|
44
44
|
environment: n,
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
fallback: t.fallback ?? /* @__PURE__ */
|
|
47
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ c(o, {
|
|
46
|
+
fallback: t.fallback ?? /* @__PURE__ */ c("div", { children: "Loading..." }),
|
|
47
|
+
children: /* @__PURE__ */ c(e, {
|
|
48
48
|
fallback: g,
|
|
49
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ c(_, {
|
|
50
50
|
query: t.query,
|
|
51
51
|
variables: t.variables,
|
|
52
52
|
render: t.render
|
|
@@ -55,28 +55,28 @@ var m = a(), h = ({ nodeType: e, mockResolvers: t }) => {
|
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}, y = (t) => {
|
|
58
|
-
let n =
|
|
59
|
-
return n.mock.queueOperationResolver((e) => r == null ?
|
|
58
|
+
let n = m(), r = h(t);
|
|
59
|
+
return n.mock.queueOperationResolver((e) => r == null ? p.generate(e) : p.generate(e, r)), t.pendingOperations?.forEach((e) => {
|
|
60
60
|
n.mock.queuePendingOperation(e.query, e.variables);
|
|
61
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ c(u, {
|
|
62
62
|
environment: n,
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
fallback: t.fallback ?? /* @__PURE__ */
|
|
65
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ c(o, {
|
|
64
|
+
fallback: t.fallback ?? /* @__PURE__ */ c("div", { children: "Loading..." }),
|
|
65
|
+
children: /* @__PURE__ */ c(e, {
|
|
66
66
|
fallback: g,
|
|
67
67
|
children: t.children
|
|
68
68
|
})
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
71
|
}, b = (t) => {
|
|
72
|
-
let n =
|
|
73
|
-
n.mock.queueOperationResolver((e) => r == null ?
|
|
74
|
-
let i = { query:
|
|
75
|
-
return /* @__PURE__ */
|
|
72
|
+
let n = m(), r = h(t);
|
|
73
|
+
n.mock.queueOperationResolver((e) => r == null ? p.generate(e) : p.generate(e, r)), n.mock.queuePendingOperation(t.query, t.variables);
|
|
74
|
+
let i = { query: d(n, t.query, t.variables) };
|
|
75
|
+
return /* @__PURE__ */ c(u, {
|
|
76
76
|
environment: n,
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
fallback: t.fallback ?? /* @__PURE__ */
|
|
79
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ c(o, {
|
|
78
|
+
fallback: t.fallback ?? /* @__PURE__ */ c("div", { children: "Loading..." }),
|
|
79
|
+
children: /* @__PURE__ */ c(e, {
|
|
80
80
|
fallback: g,
|
|
81
81
|
children: t.render(i)
|
|
82
82
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelayStory.js","names":[],"sources":["../../../../src/storybook/relay/RelayStory.tsx"],"sourcesContent":["import { Suspense, type JSX, type ReactNode } from 'react';\nimport {\n RelayEnvironmentProvider,\n loadQuery,\n useLazyLoadQuery,\n type GraphQLTaggedNode,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n OperationDescriptor,\n OperationType,\n Variables,\n} from 'relay-runtime';\nimport {
|
|
1
|
+
{"version":3,"file":"RelayStory.js","names":[],"sources":["../../../../src/storybook/relay/RelayStory.tsx"],"sourcesContent":["import { Suspense, type JSX, type ReactNode } from 'react';\nimport {\n RelayEnvironmentProvider,\n loadQuery,\n useLazyLoadQuery,\n type GraphQLTaggedNode,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n OperationDescriptor,\n OperationType,\n Variables,\n} from 'relay-runtime';\nimport { createMockEnvironment, MockPayloadGenerator } from 'relay-test-utils';\n\nimport { BackofficeErrorBoundary } from '../../components/backoffice/errors/BackofficeErrorBoundary.js';\nimport {\n createBackofficeMockResolvers,\n type MockResolvers,\n} from './mockResolvers.js';\nimport * as styles from './RelayStory.css.js';\n\ntype RelayMockOptions = {\n nodeType?: string;\n mockResolvers?: MockResolvers;\n};\n\nconst buildMockResolvers = ({\n nodeType,\n mockResolvers,\n}: RelayMockOptions): MockResolvers | undefined => {\n const baseResolvers = createBackofficeMockResolvers();\n\n const resolved: MockResolvers = {\n ...baseResolvers,\n ...(mockResolvers ?? {}),\n };\n\n if (nodeType != null) {\n resolved.Node = () => {\n return { __typename: nodeType };\n };\n }\n\n return resolved;\n};\n\nconst StoryErrorFallback = ({\n error,\n reset,\n}: {\n error: unknown;\n reset: () => void;\n}): JSX.Element => {\n let message = 'Unknown error';\n if (error instanceof Error) {\n message = error.message;\n } else {\n message = String(error);\n }\n\n return (\n <div className={styles.errorContainer}>\n <div className={styles.errorTitle}>Unable to render story</div>\n <div className={styles.errorMessage}>{message}</div>\n <button\n type=\"button\"\n onClick={() => {\n reset();\n }}\n className={styles.errorAction}\n >\n Retry\n </button>\n </div>\n );\n};\n\ntype RelayQueryRendererProps<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (data: Query['response']) => ReactNode;\n};\n\nconst RelayQueryRenderer = <Query extends OperationType>({\n query,\n variables,\n render,\n}: RelayQueryRendererProps<Query>): JSX.Element => {\n const data = useLazyLoadQuery<Query>(query, variables);\n return <>{render(data)}</>;\n};\n\ntype RelayLazyLoadStoryOptions<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (data: Query['response']) => ReactNode;\n fallback?: ReactNode;\n} & RelayMockOptions;\n\nexport const renderRelayLazyLoadStory = <Query extends OperationType>(\n options: RelayLazyLoadStoryOptions<Query>,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n environment.mock.queuePendingOperation(options.query, options.variables);\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n <RelayQueryRenderer\n query={options.query}\n variables={options.variables}\n render={options.render}\n />\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n\ntype RelayProviderStoryOptions = {\n children: ReactNode;\n fallback?: ReactNode;\n pendingOperations?: readonly {\n query: GraphQLTaggedNode;\n variables: Variables;\n }[];\n} & RelayMockOptions;\n\nexport const renderRelayProviderStory = (\n options: RelayProviderStoryOptions,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n\n options.pendingOperations?.forEach((pending) => {\n environment.mock.queuePendingOperation(pending.query, pending.variables);\n });\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n {options.children}\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n\ntype RelayPreloadedStoryOptions<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (prepared: { query: PreloadedQuery<Query> }) => ReactNode;\n fallback?: ReactNode;\n} & RelayMockOptions;\n\nexport const renderRelayPreloadedStory = <Query extends OperationType>(\n options: RelayPreloadedStoryOptions<Query>,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n environment.mock.queuePendingOperation(options.query, options.variables);\n\n const prepared = {\n query: loadQuery<Query>(environment, options.query, options.variables),\n };\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n {options.render(prepared)}\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n"],"mappings":";;;;;;;;AA2BA,IAAM,KAAsB,EAC1B,aACA,uBACiD;CAGjD,IAAM,IAA0B;EAC9B,GAHoB,EAGjB;EACH,GAAI,KAAiB,CAAC;CACxB;CAQA,OANI,KAAY,SACd,EAAS,c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,CAC1D,GAED,EAAQ,mBAAmB,SAAS,MAAY;EAC9C,EAAY,KAAK,sBAAsB,EAAQ,OAAO,EAAQ,SAAS;CACzE,CAAC,GAGC,kBAAC,GAAD;EAAuC;EACrC,UAAA,kBAAC,GAAD;GAAU,UAAU,EAAQ,YAAY,kBAAC,OAAD,EAAA,UAAK,aAAe,CAAA;GAC1D,UAAA,kBAAC,GAAD;IAAyB,UAAU;IAChC,UAAA,EAAQ;GACc,CAAA;EACjB,CAAA;CACc,CAAA;AAE9B,GASa,KACX,MACgB;CAChB,IAAM,IAAc,EAAsB,GACpC,IAAY,EAAmB,CAAO;CAQ5C,AANA,EAAY,KAAK,wBAAwB,MACnC,KAAa,OACR,EAAqB,SAAS,CAAS,IAEzC,EAAqB,SAAS,GAAW,CAAS,CAC1D,GACD,EAAY,KAAK,sBAAsB,EAAQ,OAAO,EAAQ,SAAS;CAEvE,IAAM,IAAW,EACf,OAAO,EAAiB,GAAa,EAAQ,OAAO,EAAQ,SAAS,EACvE;CAEA,OACE,kBAAC,GAAD;EAAuC;EACrC,UAAA,kBAAC,GAAD;GAAU,UAAU,EAAQ,YAAY,kBAAC,OAAD,EAAA,UAAK,aAAe,CAAA;GAC1D,UAAA,kBAAC,GAAD;IAAyB,UAAU;IAChC,UAAA,EAAQ,OAAO,CAAQ;GACD,CAAA;EACjB,CAAA;CACc,CAAA;AAE9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResolvers.js","names":[],"sources":["../../../../src/storybook/relay/mockResolvers.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"mockResolvers.js","names":[],"sources":["../../../../src/storybook/relay/mockResolvers.ts"],"sourcesContent":["export type MockResolverContext = {\n parentType?: string;\n name?: string;\n alias?: string;\n path?: readonly (string | number)[];\n args?: Record<string, unknown> | null;\n};\n\nexport type MockResolver = (\n context: MockResolverContext,\n generateId: () => string,\n) => unknown;\n\nexport type MockResolvers = Record<string, MockResolver>;\n\n/**\n *\n */\nfunction toLabel(value: string): string {\n const withSpaces = value\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim();\n if (withSpaces === '') {\n return value;\n }\n return withSpaces;\n}\n\n/**\n *\n */\nfunction toSlug(value: string): string {\n return value\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[_\\s]+/g, '-')\n .toLowerCase();\n}\n\n/**\n *\n */\nfunction createCounter(): (key: string) => number {\n const counts = new Map<string, number>();\n return (key: string) => {\n const next = (counts.get(key) ?? 0) + 1;\n counts.set(key, next);\n return next;\n };\n}\n\nconst FIRST_NAMES = ['Avery', 'Jordan', 'Taylor', 'Morgan', 'Casey'] as const;\nconst LAST_NAMES = ['Lee', 'Parker', 'Carter', 'Nguyen', 'Patel'] as const;\n\n/**\n *\n */\nfunction pickName(list: readonly string[], index: number): string {\n const candidate = list[(index - 1) % list.length];\n if (candidate == null) {\n return 'User';\n }\n return candidate;\n}\n\n/**\n *\n */\nexport function createBackofficeMockResolvers(): MockResolvers {\n const next = createCounter();\n const baseDate = Date.parse('2024-01-15T09:30:00.000Z');\n\n /**\n *\n */\n function stringResolver(context: MockResolverContext): string {\n const fieldName = context.alias ?? context.name ?? 'value';\n const parentType = context.parentType ?? 'Item';\n const label = toLabel(parentType);\n const key = `${parentType}.${fieldName}`;\n const index = next(key);\n\n switch (fieldName) {\n case 'name':\n case 'title':\n case 'label':\n return `${label} ${index}`;\n case 'firstName':\n return pickName(FIRST_NAMES, index);\n case 'lastName':\n return pickName(LAST_NAMES, index);\n case 'initials':\n return 'JD';\n case 'email':\n return `user${index}@example.com`;\n case 'slug':\n case 'handle':\n return `${toSlug(label)}-${index}`;\n case 'url':\n case 'uri':\n case 'avatarUrl':\n case 'imageUrl':\n case 'iconUrl':\n return `https://example.com/${toSlug(label)}/${index}`;\n case 'description':\n case 'summary':\n case 'content':\n case 'body':\n case 'notes':\n case 'message':\n return `Sample ${fieldName} for ${label}.`;\n case 'markdown':\n case 'summaryMarkdown':\n case 'notesForDev':\n case 'descriptionMarkdown':\n case 'suggestedFixMarkdown':\n return `Sample ${fieldName} for ${label}.`;\n default:\n return `${label} ${fieldName} ${index}`;\n }\n }\n\n /**\n *\n */\n function resolveId(context: MockResolverContext): string {\n const parentType = context.parentType ?? 'node';\n const index = next(`${parentType}.id`);\n return `${toSlug(parentType)}-${index}`;\n }\n\n /**\n *\n */\n function resolveInt(context: MockResolverContext): number {\n const key = `${context.parentType ?? 'value'}.${context.name ?? 'int'}`;\n return next(key);\n }\n\n /**\n *\n */\n function resolveFloat(context: MockResolverContext): number {\n const key = `${context.parentType ?? 'value'}.${context.name ?? 'float'}`;\n return Number((next(key) * 1.25).toFixed(2));\n }\n\n /**\n *\n */\n function resolveBoolean(): boolean {\n return true;\n }\n\n /**\n *\n */\n function resolveDateTime(): string {\n const index = next('datetime');\n const value = new Date(baseDate + index * 86400000);\n return value.toISOString();\n }\n\n /**\n *\n */\n function resolveJson(context: MockResolverContext): { note: string } {\n const label = toLabel(context.parentType ?? 'Item');\n return { note: `Sample JSON for ${label}.` };\n }\n\n return {\n ID: resolveId,\n String: stringResolver,\n Int: resolveInt,\n Float: resolveFloat,\n Boolean: resolveBoolean,\n DateTime: resolveDateTime,\n JSON: resolveJson,\n };\n}\n"],"mappings":";AAkBA,SAAS,EAAQ,GAAuB;CACtC,IAAM,IAAa,EAChB,QAAQ,sBAAsB,OAAO,CAAC,CACtC,QAAQ,UAAU,GAAG,CAAC,CACtB,KAAK;CAIR,OAHI,MAAe,KACV,IAEF;AACT;AAKA,SAAS,EAAO,GAAuB;CACrC,OAAO,EACJ,QAAQ,sBAAsB,OAAO,CAAC,CACtC,QAAQ,WAAW,GAAG,CAAC,CACvB,YAAY;AACjB;AAKA,SAAS,IAAyC;CAChD,IAAM,oBAAS,IAAI,IAAoB;CACvC,QAAQ,MAAgB;EACtB,IAAM,KAAQ,EAAO,IAAI,CAAG,KAAK,KAAK;EAEtC,OADA,EAAO,IAAI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,CAAU,EAAE,GAAG;CAClC;CAKA,SAAS,EAAW,GAAsC;EACxD,IAAM,IAAM,GAAG,EAAQ,cAAc,QAAQ,GAAG,EAAQ,QAAQ;EAChE,OAAO,EAAK,CAAG;CACjB;CAKA,SAAS,EAAa,GAAsC;EAC1D,IAAM,IAAM,GAAG,EAAQ,cAAc,QAAQ,GAAG,EAAQ,QAAQ;EAChE,OAAO,QAAQ,EAAK,CAAG,IAAI,KAAA,CAAM,QAAQ,CAAC,CAAC;CAC7C;CAKA,SAAS,IAA0B;EACjC,OAAO;CACT;CAKA,SAAS,IAA0B;EACjC,IAAM,IAAQ,EAAK,UAAU;EAE7B,OAAO,IADW,KAAK,IAAW,IAAQ,KACnC,CAAA,CAAM,YAAY;CAC3B;CAKA,SAAS,EAAY,GAAgD;EAEnE,OAAO,EAAE,MAAM,mBADD,EAAQ,EAAQ,cAAc,MACV,EAAM,GAAG;CAC7C;CAEA,OAAO;EACL,IAAI;EACJ,QAAQ;EACR,KAAK;EACL,OAAO;EACP,SAAS;EACT,UAAU;EACV,MAAM;CACR;AACF"}
|
package/lib/esm/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.w8yhmy1:hover:not(:disabled){background-color:var(--_1ie8xnc5d);color:var(--_1ie8xnc5e);border-color:var(--_1ie8xnc5f)}.oa1uye0{column-gap:var(--_1ie8xnc2f);grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"content pickAction clearAction";width:100%;min-height:2.5rem}.oa1uye0:hover{background-color:var(--_1ie8xnc4l)}.oa1uye1{grid-area:content;min-height:100%}.oa1uye1:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.oa1uye1:disabled{cursor:not-allowed;opacity:.65}.oa1uye2:hover:not(:disabled){color:var(--_1ie8xnc4r);background-color:var(--_1ie8xnc4l)}.oa1uye2:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.oa1uye2:disabled{cursor:not-allowed;opacity:.65}.oa1uye3{grid-area:pickAction}.oa1uye4{grid-area:clearAction}._13200uy0{grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,auto))}.ds2thc0{min-width:3.75rem}.ds2thc1:hover:not(:disabled){color:var(--_1ie8xnc4r);background-color:var(--_1ie8xnc4l)}.ds2thc1:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.ds2thc1:disabled{cursor:not-allowed;opacity:.45}.u4nszr0{min-height:92px}.u4nszr0:hover{border-color:var(--_1ie8xnc59);background-color:var(--_1ie8xnc4l);transform:translateY(-1px)}.u4nszr0:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}._1xws1b00{color:var(--_1ie8xnc1cu)}._1xws1b00:hover:not(:disabled){background-color:var(--_1ie8xnc1cv);color:var(--_1ie8xnc1cw)}._1xws1b00:focus-visible{box-shadow:var(--_1ie8xnc1cx);outline:none}._1xws1b00:disabled{cursor:not-allowed;opacity:.6}._80s44h0{font-size:var(--_1ie8xnc1ce)}@media screen and (width<=1023px){._1f81p5z0{grid-template-columns:minmax(0,1fr)}}._1q232kj0{grid-template-columns:auto minmax(0,1fr);display:inline-grid}qbwcuem qbwcuek txvbqb10mx txvbqb11ki txvbqb12hq txvbqbxtt txvbqbfqq txvbqbey txvbqbls4 txvbqbhd8 txvbqbvb6 txvbqb1bgr txvbqb1b8r txvbqb1d9 txvbqb2sj txvbqb29r txvbqb2wi txvbqbhbf txvbqbo4m txvbqb3f txvbqb7g txvbqb75 txvbqb7t qbwcuel txvbqb1euf txvbqb1ctj txvbqb1du7 txvbqb1e3b qbwcue0 txvbqb1fgi txvbqb1gaq:hover .kk18lv0{color:var(--_1ie8xnc6b)}
|
|
1
|
+
.w8yhmy1:hover:not(:disabled){background-color:var(--_1ie8xnc5d);color:var(--_1ie8xnc5e);border-color:var(--_1ie8xnc5f)}.oa1uye0{column-gap:var(--_1ie8xnc2f);grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"content pickAction clearAction";width:100%;min-height:2.5rem}.oa1uye0:hover{background-color:var(--_1ie8xnc4l)}.oa1uye1{grid-area:content;min-height:100%}.oa1uye1:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.oa1uye1:disabled{cursor:not-allowed;opacity:.65}.oa1uye2:hover:not(:disabled){color:var(--_1ie8xnc4r);background-color:var(--_1ie8xnc4l)}.oa1uye2:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.oa1uye2:disabled{cursor:not-allowed;opacity:.65}.oa1uye3{grid-area:pickAction}.oa1uye4{grid-area:clearAction}._13200uy0{grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,auto))}.ds2thc0{min-width:3.75rem}.ds2thc1:hover:not(:disabled){color:var(--_1ie8xnc4r);background-color:var(--_1ie8xnc4l)}.ds2thc1:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}.ds2thc1:disabled{cursor:not-allowed;opacity:.45}.u4nszr0{min-height:92px}.u4nszr0:hover{border-color:var(--_1ie8xnc59);background-color:var(--_1ie8xnc4l);transform:translateY(-1px)}.u4nszr0:focus-visible{outline:2px solid var(--_1ie8xnc4e);outline-offset:2px}._1xws1b00{color:var(--_1ie8xnc1cu)}._1xws1b00:hover:not(:disabled){background-color:var(--_1ie8xnc1cv);color:var(--_1ie8xnc1cw)}._1xws1b00:focus-visible{box-shadow:var(--_1ie8xnc1cx);outline:none}._1xws1b00:disabled{cursor:not-allowed;opacity:.6}._80s44h0{font-size:var(--_1ie8xnc1ce)}@media screen and (width<=1023px){._1f81p5z0{grid-template-columns:minmax(0,1fr)}}._1q232kj0{grid-template-columns:auto minmax(0,1fr);display:inline-grid}qbwcuem qbwcuek txvbqb10mx txvbqb11ki txvbqb12hq txvbqbxtt txvbqbfqq txvbqbey txvbqbls4 txvbqbhd8 txvbqbvb6 txvbqb1bgr txvbqb1b8r txvbqb1d9 txvbqb2sj txvbqb29r txvbqb2wi txvbqbhbf txvbqbo4m txvbqb3f txvbqb7g txvbqb75 txvbqb7t qbwcuel txvbqb1euf txvbqb1ctj txvbqb1du7 txvbqb1e3b qbwcue0 txvbqb1fgi txvbqb1gaq:hover .kk18lv0{color:var(--_1ie8xnc6b)}._8o9eh80:focus-visible{box-shadow:inset 0 0 0 2px var(--_1ie8xnc4e);outline:none}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX, type ReactNode } from 'react';
|
|
2
|
-
import { type BackofficeStatusMetaTone } from '
|
|
2
|
+
import { type BackofficeStatusMetaTone } from '@plumile/ui/backoffice/molecules/backoffice_status_meta_badge/BackofficeStatusMetaBadge.js';
|
|
3
3
|
export type BackofficeEntitySummaryHeaderTone = BackofficeStatusMetaTone;
|
|
4
4
|
export type BackofficeEntitySummaryHeaderMetaItem = {
|
|
5
5
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntitySummaryHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/detail/BackofficeEntitySummaryHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BackofficeEntitySummaryHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/detail/BackofficeEntitySummaryHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,4FAA4F,CAAC;AAKpG,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAEzE,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAA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AAE,CACnB,KAAK,EAAE,MAAM,KACV,OAAO,CAAC;QAAE,OAAO,EAAE,UAAU,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACpE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB;AAUD,eAAO,MAAM,aAAa,cAAe,iBAAiB,WAC7C,aA6zBZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConditionalSubscription.d.ts","sourceRoot":"","sources":["../../../src/hooks/useConditionalSubscription.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useConditionalSubscription.d.ts","sourceRoot":"","sources":["../../../src/hooks/useConditionalSubscription.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E,KAAK,kBAAkB,CAAC,CAAC,SAAS,aAAa,IAAI;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC;CACrC,CAAC;AAEF,KAAK,gCAAgC,GAAG;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAkBF,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,aAAa,EAChE,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,EACpC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,gCAAgC,CAyGlC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -35,12 +35,8 @@ export { BackofficeFormattedCurrency, type BackofficeFormattedCurrencyProps, } f
|
|
|
35
35
|
export { BackofficeFormattedNumber, type BackofficeFormattedNumberProps, } from './components/backoffice/shared/BackofficeFormattedNumber.js';
|
|
36
36
|
export { BackofficeDetailBadgeRow } from './components/backoffice/detail/BackofficeDetailBadgeRow.js';
|
|
37
37
|
export { BackofficeEntitySummaryHeader, type BackofficeEntitySummaryHeaderAction, type BackofficeEntitySummaryHeaderMetaItem, type BackofficeEntitySummaryHeaderProps, type BackofficeEntitySummaryHeaderTone, } from './components/backoffice/detail/BackofficeEntitySummaryHeader.js';
|
|
38
|
-
export { BackofficeEnumLabel, type BackofficeEnumLabelProps, } from './components/backoffice/detail/BackofficeEnumLabel.js';
|
|
39
38
|
export { BackofficeLifecycleTimelineSection, type BackofficeLifecycleEvent, type BackofficeLifecycleEventTone, type BackofficeLifecycleTimelineSectionProps, } from './components/backoffice/detail/BackofficeLifecycleTimelineSection.js';
|
|
40
|
-
export { BackofficeReferenceValue, type BackofficeReferenceValueProps, } from './components/backoffice/detail/BackofficeReferenceValue.js';
|
|
41
39
|
export { BackofficeRelationsSummaryGrid, type BackofficeRelationSummaryItem, type BackofficeRelationsSummaryGridProps, } from './components/backoffice/detail/BackofficeRelationsSummaryGrid.js';
|
|
42
|
-
export { BackofficeStatusMetaBadge, type BackofficeStatusMeta, type BackofficeStatusMetaBadgeProps, type BackofficeStatusMetaTone, } from './components/backoffice/detail/BackofficeStatusMetaBadge.js';
|
|
43
|
-
export { BackofficeStatusGroup, type BackofficeStatusGroupProps, } from './components/backoffice/detail/BackofficeStatusGroup.js';
|
|
44
40
|
export { BackofficeTokenUsageBreakdown, type BackofficeTokenUsageBreakdownProps, } from './components/backoffice/detail/BackofficeTokenUsageBreakdown.js';
|
|
45
41
|
export { BackofficeUsageCostBreakdown, type BackofficeMoneyValue, type BackofficeUsageCostBreakdownProps, type BackofficeUsageCostBreakdownRow, type BackofficeUsageCostBreakdownTotal, } from './components/backoffice/detail/BackofficeUsageCostBreakdown.js';
|
|
46
42
|
export { BackofficeRelationsSummaryGrid as BackofficeRelationGrid, type BackofficeRelationsSummaryGridProps as BackofficeRelationGridProps, } from './components/backoffice/detail/BackofficeRelationsSummaryGrid.js';
|
|
@@ -61,7 +57,7 @@ export { useRefetchNeededReload } from './hooks/useRefetchNeededReload.js';
|
|
|
61
57
|
export { createI18nInstance } from './i18n/createI18nInstance.js';
|
|
62
58
|
export { backofficeReactI18nResources, withBackofficeReactI18nResources, } from './i18n/resources.js';
|
|
63
59
|
export { useReviewStatusLabel } from './i18n/useReviewStatusLabel.js';
|
|
64
|
-
export { decodeBase64ToUtf8, encodeUtf8ToBase64 } from '
|
|
60
|
+
export { decodeBase64ToUtf8, encodeUtf8ToBase64, } from '@plumile/backoffice-core/base64.js';
|
|
65
61
|
export { formatFileSize } from './modules/formatFileSize.js';
|
|
66
62
|
export { uploadFilesSequentially, type SequentialFileUploadFailure, type SequentialFileUploadResult, type SequentialFileUploadSuccess, type UploadFilesSequentiallyOptions, } from './modules/uploads.js';
|
|
67
63
|
export { base64UrlToBuffer, bufferToBase64Url, mapWebAuthnRegistrationError, parseSignCount, type WebAuthnRegistrationErrorKind, } from './modules/webauthn.js';
|
|
@@ -73,10 +69,6 @@ export { EntityIdPickerDialog } from './components/backoffice/pickers/EntityIdPi
|
|
|
73
69
|
export { createInlineDataReader } from './relay/createInlineReader.js';
|
|
74
70
|
export type { BackofficeRelayKey, BackofficeRelayKeyData, } from './relay/typedRelayHooks.js';
|
|
75
71
|
export { appendNodeToConnections, type AppendNodeToConnectionsOptions, } from './relay/connectionUtils.js';
|
|
76
|
-
export { RelayProvider } from './relay/RelayProvider.js';
|
|
77
|
-
export { configureRelayEnvironment, getEnvironment, getNetwork, getRelayOperationActivitySnapshot, getRelayTransportSnapshot, reconnectRelayWebSocket, refreshRelayWebSocketAuthentication, resetRelayStore, subscribeRelayOperationActivity, subscribeRelayTransport, type RelayOperationActivitySnapshot, type RelayOperationKind, type RelayPendingOperation, type RelayAuthRefreshOptions, type RelayReconnectOptions, type RelayTransportSnapshot, type RelayTransportStatus, } from './relay/environment.js';
|
|
78
|
-
export { useRelayOperationActivity } from './relay/useRelayOperationActivity.js';
|
|
79
|
-
export { configureShortAccessTokenRelayEnvironment, configureBackofficeShortAccessTokenRelayEnvironment, type ConfigureShortAccessTokenRelayEnvironmentOptions, type ConfigureBackofficeShortAccessTokenRelayEnvironmentInput, } from './relay/shortAccessTokenEnvironment.js';
|
|
80
72
|
export { useMutationAction, type MutationActionRunner, type UseMutationActionOptions, type UseMutationActionResult, } from './relay/useMutationAction.js';
|
|
81
73
|
export { identityView } from './relay/identityView.js';
|
|
82
74
|
export { requireField, requireLinkedRecordId, resolveAgentStartOutcome, resolveMutationOutcome, } from './relay/mutationResult.js';
|