@plumile/backoffice-react 0.2.3 → 0.2.5
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 +14 -3
- package/lib/esm/auth/AuthRefreshNotice.js +21 -18
- package/lib/esm/auth/AuthRefreshNotice.js.map +1 -1
- package/lib/esm/auth/TotpQrCode.js +20 -12
- package/lib/esm/auth/TotpQrCode.js.map +1 -1
- package/lib/esm/auth/authRefreshNotice.css.js +2 -1
- package/lib/esm/auth/authRefreshNotice.css.js.map +1 -1
- package/lib/esm/auth/login/AuthPanel.js.map +1 -1
- package/lib/esm/auth/login/EmailCapturePanel.js +26 -28
- package/lib/esm/auth/login/EmailCapturePanel.js.map +1 -1
- package/lib/esm/auth/login/LoginFlow.js +11 -11
- package/lib/esm/auth/login/LoginFlow.js.map +1 -1
- package/lib/esm/auth/login/MethodChooser.js +18 -16
- package/lib/esm/auth/login/MethodChooser.js.map +1 -1
- package/lib/esm/auth/login/MfaChallengeForm.js +47 -52
- package/lib/esm/auth/login/MfaChallengeForm.js.map +1 -1
- package/lib/esm/auth/login/OidcButtons.js +3 -2
- package/lib/esm/auth/login/OidcButtons.js.map +1 -1
- package/lib/esm/auth/login/PasskeyLoginForm.js +13 -15
- package/lib/esm/auth/login/PasskeyLoginForm.js.map +1 -1
- package/lib/esm/auth/login/PasswordLoginPanel.js +8 -8
- package/lib/esm/auth/login/PasswordLoginPanel.js.map +1 -1
- package/lib/esm/auth/login/loginPage.css.js +1 -1
- package/lib/esm/auth/login/loginPage.css.js.map +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js +80 -75
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js +31 -31
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js +33 -29
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/auth/pages/VerifyEmailScreen.js +42 -40
- package/lib/esm/auth/pages/VerifyEmailScreen.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +202 -210
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +1 -1
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/actions/toastViewAction.js.map +1 -1
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +36 -30
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js.map +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js.map +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +36 -33
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +24 -20
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js +7 -8
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +49 -45
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js.map +1 -1
- package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js +1 -1
- package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js.map +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js.map +1 -1
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js +15 -15
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js.map +1 -1
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +53 -65
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js.map +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js.map +1 -1
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +2 -2
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js.map +1 -1
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +6 -6
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js.map +1 -1
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +1 -1
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +3 -3
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +152 -172
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js +2 -5
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js.map +1 -1
- package/lib/esm/components/backoffice/layout/sidebarUtils.js +1 -1
- package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +1 -1
- package/lib/esm/components/backoffice/links/backofficeLink.css.js +1 -1
- package/lib/esm/components/backoffice/links/backofficeLink.css.js.map +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js.map +1 -1
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js +1 -1
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js.map +1 -1
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js +1 -1
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +93 -82
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +1 -1
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js +6 -3
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js +7 -7
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js +3 -2
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +314 -309
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js +2 -2
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +5 -5
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +12 -12
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +3 -2
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +15 -19
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js.map +1 -1
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js +17 -9
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js.map +1 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +21 -2
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +21 -2
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +42 -41
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js +291 -255
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +47 -49
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +111 -105
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +213 -213
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListDataPage.js +101 -83
- package/lib/esm/pages/BackofficeEntityListDataPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +10 -4
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.js +55 -54
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListRouteContext.js.map +1 -1
- package/lib/esm/pages/BackofficeHubPage.js +1 -1
- package/lib/esm/pages/BackofficeHubPage.js.map +1 -1
- package/lib/esm/pages/BackofficeLayoutPage.js +64 -56
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/pages/backofficeDashboardPage.css.js +1 -1
- package/lib/esm/pages/backofficeDashboardPage.css.js.map +1 -1
- package/lib/esm/pages/backofficeEntityDetailPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityDetailPage.css.js.map +1 -1
- package/lib/esm/pages/backofficeEntityListPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityListPage.css.js.map +1 -1
- package/lib/esm/pages/detail/BackofficeEntityDetailLayoutContext.js.map +1 -1
- package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js +11 -11
- package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js.map +1 -1
- package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +41 -39
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +23 -23
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/storybook/backofficeDashboardPageStory.css.js +6 -0
- package/lib/esm/storybook/backofficeDashboardPageStory.css.js.map +1 -0
- package/lib/esm/storybook/relay/RelayStory.css.js +1 -1
- package/lib/esm/storybook/relay/RelayStory.css.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/auth/AuthRefreshNotice.d.ts +5 -1
- package/lib/types/auth/AuthRefreshNotice.d.ts.map +1 -1
- package/lib/types/auth/TotpQrCode.d.ts +2 -1
- package/lib/types/auth/TotpQrCode.d.ts.map +1 -1
- package/lib/types/auth/authRefreshNotice.css.d.ts.map +1 -1
- package/lib/types/auth/login/AuthPanel.d.ts.map +1 -1
- package/lib/types/auth/login/EmailCapturePanel.d.ts.map +1 -1
- package/lib/types/auth/login/LoginFlow.d.ts.map +1 -1
- package/lib/types/auth/login/MethodChooser.d.ts.map +1 -1
- package/lib/types/auth/login/MfaChallengeForm.d.ts.map +1 -1
- package/lib/types/auth/login/OidcButtons.d.ts.map +1 -1
- package/lib/types/auth/login/PasskeyLoginForm.d.ts.map +1 -1
- package/lib/types/auth/login/PasswordLoginPanel.d.ts +1 -1
- package/lib/types/auth/login/PasswordLoginPanel.d.ts.map +1 -1
- package/lib/types/auth/login/loginPage.css.d.ts.map +1 -1
- package/lib/types/auth/pages/AcceptInvitationScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetCompleteScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetRequestScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/VerifyEmailScreen.d.ts.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts +3 -3
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/actions/toastViewAction.d.ts +1 -1
- package/lib/types/components/backoffice/actions/toastViewAction.d.ts.map +1 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts +2 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts.map +1 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts +2 -2
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailBadgeRow.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeTokenUsageBreakdown.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts.map +1 -1
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts +1 -1
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/backofficeFilterAction.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/deferredFilterSearchInput.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts +0 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/hub/backofficeHubTemplate.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/backofficeSidebarActions.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +2 -2
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts.map +1 -1
- package/lib/types/components/backoffice/list/RowFlagsCell.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/overview/backofficeOverviewLayout.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts +3 -3
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/backofficeRelatedCountLink.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/routing/BackofficeContentError.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts +2 -2
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/backofficeFilterableCell.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeInfiniteScrollSentinel.d.ts +1 -2
- package/lib/types/hooks/useBackofficeInfiniteScrollSentinel.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +44 -2
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListDataPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +9 -9
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts +2 -2
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts.map +1 -1
- package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/backofficeEntityListPage.css.d.ts.map +1 -1
- package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts +1 -1
- package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts.map +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/types.d.ts +2 -0
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +0 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/lib/types/storybook/backofficeDashboardPageStory.css.d.ts +2 -0
- package/lib/types/storybook/backofficeDashboardPageStory.css.d.ts.map +1 -0
- package/package.json +17 -17
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +0 -2
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +0 -2
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\nimport { resetRelayStore } from '@plumile/relay/environment.js';\n\nimport { AdminShellLayout } from '@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js';\nimport { ToastProvider } from '@plumile/ui/atomic/molecules/toast/ToastProvider.js';\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\nimport { SidebarProfileMenu } from '@plumile/ui/components/navigation/sidebar/SidebarProfileMenu.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const pinningEnabled = sidebar?.pinnedItems?.enabled === true;\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: pinningEnabled,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let sidebarPinnedEntityIds: readonly string[] | undefined;\n let sidebarTogglePin: ((entityId: string) => void) | undefined;\n let sidebarReorderPin: ((fromId: string, toId: string) => void) | undefined;\n if (pinningEnabled) {\n sidebarPinnedEntityIds = pins;\n sidebarTogglePin = togglePin;\n sidebarReorderPin = reorderPin;\n }\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <SidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n const mobileSidebarFooter = (\n <SidebarProfileMenu\n collapsed={false}\n viewer={sidebarProfile}\n labels={{\n sectionTitle: t('sidebar.profile.title'),\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n signOut: t('sidebar.profile.actions.signOut'),\n }}\n onSignOut={handleSignOut}\n isSigningOut={isSigningOut}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n isCollapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseToggleLabel: t('sidebar.actions.collapseSidebar'),\n expandToggleLabel: t('sidebar.actions.expandSidebar'),\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n isCollapsed: false,\n hideCollapseToggle: true,\n navigationAriaLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwEA,IAAM,KAAmC,mCACnC,KAAoC,8BAEpC,MACJ,MAC2C;CAC3C,IAAI,OAAO,SAAW,KACpB,OAAO,CAAC;CAEV,IAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,CAAU;EAClD,IAAI,KAAO,MACT,OAAO,CAAC;EAEV,IAAM,IAAS,KAAK,MAAM,CAAG;EAI7B,OAHK,MAAM,QAAQ,CAAM,IAGlB,EAAO,QAAQ,MAA8C;GAClE,IAAoB,OAAO,KAAS,aAAhC,GACF,OAAO;GAET,IAAM,IAAY;GAClB,QACG,EAAU,SAAS,YAAY,EAAU,SAAS,WACnD,OAAO,EAAU,MAAO,YACxB,OAAO,EAAU,SAAU,YAC3B,OAAO,EAAU,QAAS,YAC1B,OAAO,EAAU,aAAc;EAEnC,CAAC,IAdQ,CAAC;CAeZ,QAAQ;EACN,OAAO,CAAC;CACV;AACF,GAEM,MACJ,GACA,MACS;CACL,aAAO,SAAW,MAGtB,IAAI;EACF,OAAO,aAAa,QAAQ,GAAY,KAAK,UAAU,CAAK,CAAC;CAC/D,QAAQ,CAER;AACF,GAEM,KAAyB,EAC7B,aACA,gBACA,eACA,uBACmC;CACnC,IAAM,EAAE,GAAG,MAAS,GAAe,GAC7B,EAAE,SAAM,EAA8B,GACtC,EAAE,gBAAa,GAAY,GAC3B,IAAU,GAAW,EAAc,GACnC,IAAmB,GAAoB,GACvC,EACJ,MAAM,GACN,aACA,eACA,aACA,eACE,EAAoB,GAClB,CAAC,GAAc,MAAmB,EAAS,EAAE,GAC7C,IACJ,GAAS,aAAa,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AA;CAIpE,IAAM,IACJ,kBAAC,IAAD;EACE,OAAO;EACP,UAAU;EACV,aAAa,EAAE,4BAA4B;EAC3C,WAAW,EAAE,4BAA4B;CAC1C,CAAA;CAGH,OACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD;EACE,SAAS;GACP;GACA,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,mBAAmB;GACnB,qBAAqB,EAAE,iCAAiC;GACxD,mBAAmB,EAAE,+BAA+B;GACpD,qBAAqB,EAAE,6BAA6B;EACtD;EACA,eAAe;GACb,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,oBAAoB;GACpB,qBAAqB,EAAE,6BAA6B;EACtD;EACA,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,EAAkB,CAAA,EAC1C;EACA,mBAAkB;EAElB,UAAA,kBAAC,GAAD;GAA4C;GAC1C,UAAA,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,yBAAyB;IAC7C;IAEC,UAAA;GACoC,CAAA;EACV,CAAA;CACf,CAAA,EACL,CAAA;AAEnB,GAaM,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAC6C;CAC7C,IAAM,IAAc,EAAkB,GAAkB,CAAQ;CAEhE,OACE,kBAAC,GAAD;EACe;EACD;EACG;EAEd;CACoB,CAAA;AAE3B,GAEa,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;AACoB,CAAA,IAKzB,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;AACoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"BackofficeLayoutPage.js","names":[],"sources":["../../../src/pages/BackofficeLayoutPage.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type JSX,\n type ReactNode,\n useCallback,\n useContext,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n commitMutation,\n usePreloadedQuery,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n GraphQLTaggedNode,\n MutationParameters,\n OperationType,\n} from 'relay-runtime';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\nimport { resetRelayStore } from '@plumile/relay/environment.js';\n\nimport {\n AdminShellLayout,\n ToastProvider,\n SidebarProfileMenu,\n} from '@plumile/ui';\n\nimport { GlobalSearchInput } from '@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { LogoutResponse, LogoutVariables } from '../hooks/useAuth.js';\nimport { useBackofficeSidebarPins } from '../hooks/useBackofficeSidebarPins.js';\nimport { useSidebarGroupCollapse } from '../hooks/useSidebarGroupCollapse.js';\nimport { buildSidebarSections } from '../components/backoffice/layout/buildSidebarSections.js';\nimport { BackofficeContentBoundary } from '../components/backoffice/routing/BackofficeContentBoundary.js';\nimport {\n resolveActiveEntityId,\n resolveSidebarGroups,\n resolveVisibleEntityIds,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport { BackofficeTopbarPortalContextProvider } from '../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js';\nimport { BackofficePermissionsProvider } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport {\n mapViewerToSidebarProfileView,\n type BackofficeViewerIdentity,\n} from '../components/backoffice/layout/mapViewerToSidebarProfileView.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { getBackofficeLoginPath } from '../router/backofficeAuthPaths.js';\nimport type { BackofficeSidebarRecentItem } from '../provider/types.js';\n\nexport type BackofficeLayoutPageProps = {\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\ntype LayoutShellProps = {\n children: ReactNode;\n permissions: unknown;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst DEFAULT_RECENT_ITEMS_STORAGE_KEY = 'plumile:backoffice:recent-items';\nconst DEFAULT_SIDEBAR_PREFS_STORAGE_KEY = 'plumile:backoffice:sidebar';\n\nconst readRecentItems = (\n storageKey: string,\n): readonly BackofficeSidebarRecentItem[] => {\n if (typeof window === 'undefined') {\n return [];\n }\n try {\n const raw = window.localStorage.getItem(storageKey);\n if (raw == null) {\n return [];\n }\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter((item): item is BackofficeSidebarRecentItem => {\n if (item == null || typeof item !== 'object') {\n return false;\n }\n const candidate = item as Partial<BackofficeSidebarRecentItem>;\n return (\n (candidate.kind === 'entity' || candidate.kind === 'tool') &&\n typeof candidate.id === 'string' &&\n typeof candidate.label === 'string' &&\n typeof candidate.href === 'string' &&\n typeof candidate.visitedAt === 'number'\n );\n });\n } catch {\n return [];\n }\n};\n\nconst writeRecentItems = (\n storageKey: string,\n items: readonly BackofficeSidebarRecentItem[],\n): void => {\n if (typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(storageKey, JSON.stringify(items));\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n};\n\nconst BackofficeLayoutShell = ({\n children,\n permissions,\n authStatus,\n activeGroupId,\n}: LayoutShellProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const routing = useContext(RoutingContext);\n const relayEnvironment = useRelayEnvironment();\n const {\n auth: authConfig,\n basePath,\n dashboards,\n entities,\n sidebar,\n } = useBackofficeConfig();\n const [sidebarQuery, setSidebarQuery] = useState('');\n const sidebarPreferencesStorageKey =\n sidebar?.preferences?.storageKey ?? DEFAULT_SIDEBAR_PREFS_STORAGE_KEY;\n const persistSidebarCollapsed =\n sidebar?.preferences?.persistCollapsed === true;\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return false;\n }\n try {\n return (\n window.localStorage.getItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n ) === 'true'\n );\n } catch {\n return false;\n }\n });\n const [isSigningOut, setIsSigningOut] = useState(false);\n const [topbarTarget, setTopbarTarget] = useState<HTMLDivElement | null>(null);\n const recentItemsConfig = sidebar?.recentItems;\n const recentItemsEnabled = recentItemsConfig?.enabled === true;\n const recentItemsStorageKey =\n recentItemsConfig?.storageKey ?? DEFAULT_RECENT_ITEMS_STORAGE_KEY;\n const recentItemsMaxItems = recentItemsConfig?.maxItems ?? 8;\n const [recentItems, setRecentItems] = useState<\n readonly BackofficeSidebarRecentItem[]\n >(() => {\n if (!recentItemsEnabled) {\n return [];\n }\n return readRecentItems(recentItemsStorageKey);\n });\n\n useEffect(() => {\n if (!persistSidebarCollapsed || typeof window === 'undefined') {\n return;\n }\n try {\n window.localStorage.setItem(\n `${sidebarPreferencesStorageKey}:collapsed`,\n String(isSidebarCollapsed),\n );\n } catch {\n // Ignore storage quota / privacy mode failures.\n }\n }, [\n isSidebarCollapsed,\n persistSidebarCollapsed,\n sidebarPreferencesStorageKey,\n ]);\n\n const groups = useMemo(() => {\n return resolveSidebarGroups(entities, sidebar);\n }, [entities, sidebar]);\n\n const groupIds = useMemo(() => {\n return Object.keys(groups);\n }, [groups]);\n\n const defaultCollapsedByGroupId = useMemo(() => {\n return Object.fromEntries(\n Object.entries(groups).map(([groupId, group]) => {\n return [groupId, group.behavior?.defaultCollapsed ?? true];\n }),\n );\n }, [groups]);\n\n const visibleEntityIds = useMemo(() => {\n return resolveVisibleEntityIds(groups, entities, sidebar, permissions);\n }, [entities, groups, permissions, sidebar]);\n\n const activeEntityId = useMemo(() => {\n return resolveActiveEntityId(pathname, entities);\n }, [entities, pathname]);\n\n useEffect(() => {\n if (!recentItemsEnabled || activeEntityId == null) {\n return;\n }\n const config = entities[activeEntityId];\n if (config == null) {\n return;\n }\n if (config.kind !== 'tool' && !config.hasList) {\n return;\n }\n const href = config.routes.list;\n let kind: BackofficeSidebarRecentItem['kind'] = 'entity';\n if (config.kind === 'tool') {\n kind = 'tool';\n }\n const item: BackofficeSidebarRecentItem = {\n kind,\n id: activeEntityId,\n label: config.label(tApp),\n href,\n visitedAt: Date.now(),\n };\n setRecentItems((prev) => {\n const next = [\n item,\n ...prev.filter((entry) => {\n return entry.id !== item.id || entry.kind !== item.kind;\n }),\n ].slice(0, recentItemsMaxItems);\n writeRecentItems(recentItemsStorageKey, next);\n return next;\n });\n }, [\n activeEntityId,\n entities,\n recentItemsEnabled,\n recentItemsMaxItems,\n recentItemsStorageKey,\n tApp,\n ]);\n\n const pinningEnabled = sidebar?.pinnedItems?.enabled === true;\n\n const {\n pins,\n toggle: togglePin,\n reorder: reorderPin,\n } = useBackofficeSidebarPins({\n enabled: pinningEnabled,\n storageKey: sidebar?.pinnedItems?.storageKey,\n visibleEntityIds,\n });\n\n let sidebarPinnedEntityIds: readonly string[] | undefined;\n let sidebarTogglePin: ((entityId: string) => void) | undefined;\n let sidebarReorderPin: ((fromId: string, toId: string) => void) | undefined;\n if (pinningEnabled) {\n sidebarPinnedEntityIds = pins;\n sidebarTogglePin = togglePin;\n sidebarReorderPin = reorderPin;\n }\n\n let groupCollapseStorageKey: string | undefined;\n if (sidebar?.preferences?.storageKey != null) {\n groupCollapseStorageKey = `${sidebar.preferences.storageKey}:groups`;\n }\n\n const { collapsedByGroupId, setCollapsed } = useSidebarGroupCollapse({\n groupIds,\n activeGroupId,\n defaultCollapsedByGroupId,\n persist: sidebar?.preferences?.persistGroups === true,\n storageKey: groupCollapseStorageKey,\n });\n\n const sections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const mobileSections = useMemo(() => {\n return buildSidebarSections({\n basePath,\n pathname,\n entities,\n dashboards,\n sidebar,\n permissions,\n searchQuery: sidebarQuery,\n tApp,\n t,\n pinnedEntityIds: sidebarPinnedEntityIds,\n recentItems,\n onTogglePin: sidebarTogglePin,\n onReorderPin: sidebarReorderPin,\n collapsedByGroupId,\n onGroupCollapsedChange: setCollapsed,\n sidebarCollapsed: false,\n });\n }, [\n basePath,\n collapsedByGroupId,\n entities,\n dashboards,\n pathname,\n permissions,\n recentItems,\n setCollapsed,\n sidebar,\n sidebarPinnedEntityIds,\n sidebarQuery,\n sidebarReorderPin,\n sidebarTogglePin,\n t,\n tApp,\n ]);\n\n const handleSignOut = useCallback(() => {\n if (isSigningOut) {\n return;\n }\n\n type LogoutMutation = MutationParameters & {\n response: LogoutResponse;\n variables: LogoutVariables;\n };\n\n setIsSigningOut(true);\n\n const runSignOut = async (): Promise<void> => {\n try {\n const config = await authConfig.logout.load();\n await new Promise<void>((resolve, reject) => {\n commitMutation<LogoutMutation>(relayEnvironment, {\n mutation: config.logoutMutation,\n variables: {},\n onCompleted: () => {\n resolve();\n },\n onError: (error) => {\n reject(error);\n },\n });\n });\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n resetRelayStore();\n routing?.history.push({ pathname: getBackofficeLoginPath(basePath) });\n } finally {\n setIsSigningOut(false);\n }\n };\n\n runSignOut().catch(() => {\n /* noop */\n });\n }, [authConfig.logout, basePath, isSigningOut, relayEnvironment, routing]);\n\n const viewer = authStatus?.me ?? null;\n const sidebarProfile = useMemo(() => {\n return mapViewerToSidebarProfileView({\n viewer,\n unknownUserLabel: t('sidebar.profile.unknownUser'),\n });\n }, [t, viewer]);\n\n const sidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n const mobileSidebarFooter = (\n <SidebarProfileMenu\n viewer={sidebarProfile}\n sectionTitle={t('sidebar.profile.title')}\n labels={{\n menuAriaLabel: t('sidebar.profile.menuAriaLabel'),\n triggerAriaLabel: `${t('sidebar.profile.menuAriaLabel')}: ${sidebarProfile.displayName}`,\n }}\n items={[\n {\n kind: 'action',\n id: 'sign-out',\n label: t('sidebar.profile.actions.signOut'),\n onSelect: handleSignOut,\n disabled: isSigningOut,\n tone: 'danger',\n },\n ]}\n />\n );\n\n let contentNode: JSX.Element | null = null;\n if (topbarTarget != null) {\n contentNode = (\n <BackofficeContentBoundary>{children}</BackofficeContentBoundary>\n );\n }\n\n const sidebarSearchNode = (\n <GlobalSearchInput\n value={sidebarQuery}\n onChange={setSidebarQuery}\n placeholder={t('sidebar.search.placeholder')}\n ariaLabel={t('sidebar.search.placeholder')}\n />\n );\n\n return (\n <ToastProvider>\n <AdminShellLayout\n sidebar={{\n sections,\n search: sidebarSearchNode,\n footer: sidebarFooter,\n collapsed: isSidebarCollapsed,\n onCollapsedChange: setIsSidebarCollapsed,\n collapseLabel: t('sidebar.actions.collapseSidebar'),\n expandLabel: t('sidebar.actions.expandSidebar'),\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n mobileSidebar={{\n sections: mobileSections,\n search: sidebarSearchNode,\n footer: mobileSidebarFooter,\n hideCollapseToggle: true,\n navigationLabel: t('sidebar.navigationAriaLabel'),\n }}\n topbar={{\n breadcrumb: <div ref={setTopbarTarget} />,\n }}\n containedScrollLabel={t('sidebar.contentAriaLabel')}\n contentScrollMode=\"contained\"\n >\n <BackofficePermissionsProvider permissions={permissions}>\n <BackofficeTopbarPortalContextProvider\n value={{\n target: topbarTarget,\n dashboardHref: basePath,\n dashboardLabel: t('sidebar.items.dashboard'),\n }}\n >\n {contentNode}\n </BackofficeTopbarPortalContextProvider>\n </BackofficePermissionsProvider>\n </AdminShellLayout>\n </ToastProvider>\n );\n};\n\ntype LayoutWithPermissionsProps = {\n children: ReactNode;\n permissionsQuery: GraphQLTaggedNode;\n prepared: PreloadedQuery<OperationType>;\n authStatus?: {\n isLoggedIn?: boolean | null;\n me?: BackofficeViewerIdentity | null;\n } | null;\n activeGroupId?: string | null;\n};\n\nconst LayoutWithPermissions = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: LayoutWithPermissionsProps): JSX.Element => {\n const permissions = usePreloadedQuery(permissionsQuery, prepared);\n\n return (\n <BackofficeLayoutShell\n permissions={permissions}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport const BackofficeLayoutPage = ({\n children,\n permissionsQuery,\n prepared,\n authStatus,\n activeGroupId,\n}: BackofficeLayoutPageProps): JSX.Element => {\n if (permissionsQuery != null && prepared != null) {\n return (\n <LayoutWithPermissions\n permissionsQuery={permissionsQuery}\n prepared={prepared}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </LayoutWithPermissions>\n );\n }\n\n return (\n <BackofficeLayoutShell\n permissions={null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutShell>\n );\n};\n\nexport default BackofficeLayoutPage;\n"],"mappings":";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J,kBAAC,IAAD;EACE,OAAO;EACP,UAAU;EACV,aAAa,EAAE,4BAA4B;EAC3C,WAAW,EAAE,4BAA4B;CAC1C,CAAA;CAGH,OACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD;EACE,SAAS;GACP;GACA,QAAQ;GACR,QAAQ;GACR,WAAW;GACX,mBAAmB;GACnB,eAAe,EAAE,iCAAiC;GAClD,aAAa,EAAE,+BAA+B;GAC9C,iBAAiB,EAAE,6BAA6B;EAClD;EACA,eAAe;GACb,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,oBAAoB;GACpB,iBAAiB,EAAE,6BAA6B;EAClD;EACA,QAAQ,EACN,YAAY,kBAAC,OAAD,EAAK,KAAK,EAAkB,CAAA,EAC1C;EACA,sBAAsB,EAAE,0BAA0B;EAClD,mBAAkB;EAElB,UAAA,kBAAC,IAAD;GAA4C;GAC1C,UAAA,kBAAC,GAAD;IACE,OAAO;KACL,QAAQ;KACR,eAAe;KACf,gBAAgB,EAAE,yBAAyB;IAC7C;IAEC,UAAA;GACoC,CAAA;EACV,CAAA;CACf,CAAA,EACL,CAAA;AAEnB,GAaM,KAAyB,EAC7B,aACA,qBACA,aACA,eACA,uBAC6C;CAC7C,IAAM,IAAc,EAAkB,GAAkB,CAAQ;CAEhE,OACE,kBAAC,GAAD;EACe;EACD;EACG;EAEd;CACoB,CAAA;AAE3B,GAEa,KAAwB,EACnC,aACA,qBACA,aACA,eACA,uBAEI,KAAoB,QAAQ,KAAY,OAExC,kBAAC,GAAD;CACoB;CACR;CACE;CACG;CAEd;AACoB,CAAA,IAKzB,kBAAC,GAAD;CACE,aAAa;CACD;CACG;CAEd;AACoB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeDashboardPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5lr txvbqb6m5 txvbqb6rp", t = "txvbqb5lr txvbqb2nn txvbqb6rp txvbqbe8 txvbqb6nj", n = "txvbqb6ox txvbqb1d6 txvbqb1oe";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { t as loadingBody, e as tileBody, n as tileCount };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backofficeDashboardPage.css.js","names":[],"sources":["../../../src/pages/backofficeDashboardPage.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme
|
|
1
|
+
{"version":3,"file":"backofficeDashboardPage.css.js","names":[],"sources":["../../../src/pages/backofficeDashboardPage.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme';\n\nexport const tileBody = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n});\n\nexport const loadingBody = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n color: 'textMuted',\n fontSize: 'sm',\n});\n\nexport const tileCount = sprinkles({\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: 1,\n});\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeEntityDetailPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5lr txvbqb2nn txvbqb8ob txvbqb6rp txvbqb1cu txvbqbe1d", t = "txvbqb5lr txvbqb2nn txvbqb8ob txvbqb6rp txvbqb1cu", n = "txvbqb5lr txvbqb2nn txvbqbgl3 txvbqb3el txvbqb3qv txvbqbmx txvbqbx6", r = "txvbqb5lr txvbqb6m5 txvbqb6rz", i = "txvbqb5lr txvbqb2nn txvbqb6rp txvbqb1cu", a = "txvbqb5lr txvbqb6m5 txvbqb6rp", o = "txvbqb5ml txvbqb2nn txvbqb8o1 txvbqbky9 txvbqb7sx txvbqbe8";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { t as headerActionGroup, e as headerActions, r as headerBlock, i as headerMeta, a as headerMetaList, n as headerRelationGroup, o as relationCountLoading };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backofficeEntityDetailPage.css.js","names":[],"sources":["../../../src/pages/backofficeEntityDetailPage.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme
|
|
1
|
+
{"version":3,"file":"backofficeEntityDetailPage.css.js","names":[],"sources":["../../../src/pages/backofficeEntityDetailPage.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme';\n\nexport const headerActions = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 2,\n flexWrap: 'wrap',\n minWidth: 0,\n});\n\nexport const headerActionGroup = sprinkles({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 2,\n flexWrap: 'wrap',\n});\n\nexport const headerRelationGroup = sprinkles({\n display: 'flex',\n alignItems: 'center',\n paddingInlineStart: {\n md: 2,\n },\n borderInlineStartWidth: {\n base: 0,\n md: 'px',\n },\n borderStyle: 'solid',\n borderInlineStartColor: 'borderSubtle',\n});\n\nexport const headerBlock = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n});\n\nexport const headerMeta = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n flexWrap: 'wrap',\n});\n\nexport const headerMetaList = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n});\n\nexport const relationCountLoading = sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 4,\n height: 4,\n color: 'textMuted',\n});\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/pages/backofficeEntityListPage.css.ts
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "txvbqb5lr txvbqb2nn txvbqb6rp txvbqb1cu", t = "txvbqb8ob", n = "c0tad0 txvbqb5ml txvbqb2nn txvbqb8o1 txvbqbkzd txvbqb7u1 txvbqbe3l txvbqbdc3 txvbqbn1 txvbqb8n txvbqbe7 txvbqb3f txvbqb7n txvbqb78 txvbqb7y txvbqbmcp txvbqbo55 qbwcue5 qbwcue4 txvbqboz8 txvbqbptg qbwcue3";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { n as actionTrigger, t as actionsColumnCell, e as headerActions };
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backofficeEntityListPage.css.js","names":[],"sources":["../../../src/pages/backofficeEntityListPage.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, stateSprinkles
|
|
1
|
+
{"version":3,"file":"backofficeEntityListPage.css.js","names":[],"sources":["../../../src/pages/backofficeEntityListPage.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, stateSprinkles, focusRing } from '@plumile/ui/theme';\n\nexport const headerActions = sprinkles({\n display: 'flex',\n alignItems: 'center',\n gap: 2,\n flexWrap: 'wrap',\n});\n\nexport const actionsColumnCell = sprinkles({\n justifyContent: 'flex-end',\n});\n\nexport const actionTrigger = style([\n sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 8,\n height: 8,\n minWidth: 8,\n minHeight: 8,\n borderRadius: 'md',\n backgroundColor: 'transparent',\n color: 'textSecondary',\n textDecoration: 'none',\n transitionProperty: 'colors',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n }),\n stateSprinkles({\n backgroundColor: { hover: 'surfaceMuted' },\n color: { hover: 'primary' },\n }),\n focusRing,\n]);\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailLayoutContext.js","names":[],"sources":["../../../../src/pages/detail/BackofficeEntityDetailLayoutContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type {\n BackofficeDetailPageRouteSpec,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\nimport type { NavigationTabItem } from '@plumile/ui/
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailLayoutContext.js","names":[],"sources":["../../../../src/pages/detail/BackofficeEntityDetailLayoutContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type {\n BackofficeDetailPageRouteSpec,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\nimport type { NavigationTabItem } from '@plumile/ui/tabs';\n\nexport type BackofficeEntityDetailLayoutContextValue = {\n activePage: BackofficeDetailPageRouteSpec;\n config: BackofficeResolvedDetailLayoutFacetConfigBase;\n entityId: string;\n layoutView: unknown;\n tabsItems: readonly NavigationTabItem[];\n visiblePages: readonly BackofficeDetailPageRouteSpec[];\n};\n\nconst BackofficeEntityDetailLayoutContext =\n createContext<BackofficeEntityDetailLayoutContextValue | null>(null);\n\nexport const BackofficeEntityDetailLayoutContextProvider =\n BackofficeEntityDetailLayoutContext.Provider;\n\nexport const useBackofficeEntityDetailLayoutContext =\n (): BackofficeEntityDetailLayoutContextValue => {\n const context = useContext(BackofficeEntityDetailLayoutContext);\n if (context == null) {\n throw new Error(\n 'BackofficeEntityDetailLayoutContext is missing. Ensure detail pages are rendered under the entity layout route.',\n );\n }\n return context;\n };\n"],"mappings":";;AAgBA,IAAM,IACJ,EAA+D,IAAI,GAExD,IACX,EAAoC,UAEzB,UACqC;CAC9C,IAAM,IAAU,EAAW,CAAmC;CAC9D,IAAI,KAAW,MACb,MAAU,MACR,iHACF;CAEF,OAAO;AACT"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useBackofficeReactTranslation as e } from "../../i18n/useBackofficeReactTranslation.js";
|
|
2
2
|
import { BackofficeRightPageLayout as t } from "../../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js";
|
|
3
3
|
import { BackofficeStaticRouteFallback as n } from "../../components/backoffice/routing/BackofficeRouteFallback.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
8
|
-
import { NavigationTabs as s } from "@plumile/ui/
|
|
4
|
+
import { PageHeader as r } from "@plumile/ui";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { useTranslation as a } from "react-i18next";
|
|
7
|
+
import o from "@plumile/router/routing/useLocation.js";
|
|
8
|
+
import { NavigationTabs as s } from "@plumile/ui/tabs";
|
|
9
9
|
import { DetailPageTemplate as c } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
|
|
10
10
|
//#region src/pages/detail/BackofficeEntityDetailManifestFallback.tsx
|
|
11
11
|
var l = (e) => e.trim().replace(/^\/+|\/+$/g, ""), u = (e, t, n, r, i) => {
|
|
@@ -27,7 +27,7 @@ var l = (e) => e.trim().replace(/^\/+|\/+$/g, ""), u = (e, t, n, r, i) => {
|
|
|
27
27
|
}
|
|
28
28
|
return a.find((t) => t.id === e.defaultDetailPageId) ?? a[0] ?? null;
|
|
29
29
|
}, d = ({ entityManifest: l, id: d, pageId: f, pagePath: p }) => {
|
|
30
|
-
let { t: m } =
|
|
30
|
+
let { t: m } = a(), { t: h } = e(), { pathname: g } = o(), _ = l.label(m), v = l.detailLabel?.(m) ?? h("detail.loadingTitle"), y = u(l, d, f, p, g), b = [{
|
|
31
31
|
kind: "link",
|
|
32
32
|
target: {
|
|
33
33
|
kind: "entity-list",
|
|
@@ -62,7 +62,7 @@ var l = (e) => e.trim().replace(/^\/+|\/+$/g, ""), u = (e, t, n, r, i) => {
|
|
|
62
62
|
label: y.label(m)
|
|
63
63
|
});
|
|
64
64
|
let x = l.detailPages ?? [], S = null;
|
|
65
|
-
return x.length > 1 && y != null && (S = /* @__PURE__ */
|
|
65
|
+
return x.length > 1 && y != null && (S = /* @__PURE__ */ i(s, {
|
|
66
66
|
items: x.map((e) => ({
|
|
67
67
|
id: e.id,
|
|
68
68
|
label: e.label(m),
|
|
@@ -71,13 +71,13 @@ var l = (e) => e.trim().replace(/^\/+|\/+$/g, ""), u = (e, t, n, r, i) => {
|
|
|
71
71
|
})),
|
|
72
72
|
activeId: y.id,
|
|
73
73
|
variant: "underline"
|
|
74
|
-
})), /* @__PURE__ */
|
|
74
|
+
})), /* @__PURE__ */ i(t, {
|
|
75
75
|
breadcrumb: b,
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
headerNode: /* @__PURE__ */ r
|
|
76
|
+
children: /* @__PURE__ */ i(c, {
|
|
77
|
+
headerNode: /* @__PURE__ */ i(r, { title: v }),
|
|
78
78
|
tabsNode: S,
|
|
79
79
|
headerDensity: "compact",
|
|
80
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ i(n, { label: h("common.loading") })
|
|
81
81
|
})
|
|
82
82
|
});
|
|
83
83
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailManifestFallback.js","names":[],"sources":["../../../../src/pages/detail/BackofficeEntityDetailManifestFallback.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport type {\n BackofficeDetailPageManifestItem,\n BackofficeEntityManifestItem,\n} from '@plumile/backoffice-core/types.js';\nimport { NavigationTabs } from '@plumile/ui/
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailManifestFallback.js","names":[],"sources":["../../../../src/pages/detail/BackofficeEntityDetailManifestFallback.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport type {\n BackofficeDetailPageManifestItem,\n BackofficeEntityManifestItem,\n} from '@plumile/backoffice-core/types.js';\nimport { NavigationTabs } from '@plumile/ui/tabs';\nimport { PageHeader } from '@plumile/ui';\nimport { DetailPageTemplate } from '@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js';\n\nimport { BackofficeRightPageLayout } from '../../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport type { BackofficeTopbarBreadcrumbItem } from '../../components/backoffice/layout/breadcrumb/types.js';\nimport { BackofficeStaticRouteFallback } from '../../components/backoffice/routing/BackofficeRouteFallback.js';\nimport { useBackofficeReactTranslation } from '../../i18n/useBackofficeReactTranslation.js';\n\nexport type BackofficeEntityDetailManifestFallbackProps = {\n entityManifest: BackofficeEntityManifestItem;\n id: string;\n pageId?: string | null;\n pagePath?: string | null;\n};\n\nconst normalizePath = (value: string): string => {\n return value.trim().replace(/^\\/+|\\/+$/g, '');\n};\n\nconst resolveManifestPage = (\n entityManifest: BackofficeEntityManifestItem,\n id: string,\n pageId: string | null | undefined,\n pagePath: string | null | undefined,\n currentPathname: string,\n): BackofficeDetailPageManifestItem | null => {\n const pages = entityManifest.detailPages ?? [];\n if (pages.length === 0) {\n return null;\n }\n\n const normalizedPagePath = normalizePath(pagePath ?? '');\n if (normalizedPagePath !== '') {\n const byPath = pages.find((page) => {\n return normalizePath(page.pathSegment) === normalizedPagePath;\n });\n if (byPath != null) {\n return byPath;\n }\n }\n\n const normalizedCurrentPathname = normalizePath(currentPathname);\n if (normalizedCurrentPathname !== '') {\n const byCurrentPathname = pages.find((page) => {\n return (\n normalizePath(entityManifest.routes.detailPage(id, page.id)) ===\n normalizedCurrentPathname\n );\n });\n if (byCurrentPathname != null) {\n return byCurrentPathname;\n }\n }\n\n if (pageId != null) {\n const byId = pages.find((page) => {\n return page.id === pageId;\n });\n if (byId != null) {\n return byId;\n }\n }\n\n const defaultPage = pages.find((page) => {\n return page.id === entityManifest.defaultDetailPageId;\n });\n return defaultPage ?? pages[0] ?? null;\n};\n\nexport const BackofficeEntityDetailManifestFallback = ({\n entityManifest,\n id,\n pageId,\n pagePath,\n}: BackofficeEntityDetailManifestFallbackProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { pathname } = useLocation();\n const listLabel = entityManifest.label(tApp);\n const detailLabel =\n entityManifest.detailLabel?.(tApp) ?? t('detail.loadingTitle');\n const activePage = resolveManifestPage(\n entityManifest,\n id,\n pageId,\n pagePath,\n pathname,\n );\n const breadcrumb: BackofficeTopbarBreadcrumbItem[] = [\n {\n kind: 'link',\n target: {\n kind: 'entity-list',\n entityId: entityManifest.id,\n },\n label: listLabel,\n },\n ];\n\n if (activePage == null) {\n breadcrumb.push({\n kind: 'current',\n target: {\n kind: 'entity-detail',\n entityId: entityManifest.id,\n id,\n },\n label: detailLabel,\n });\n } else {\n breadcrumb.push(\n {\n kind: 'link',\n target: {\n kind: 'entity-detail',\n entityId: entityManifest.id,\n id,\n },\n label: detailLabel,\n },\n {\n kind: 'current',\n target: {\n kind: 'entity-detail-page',\n entityId: entityManifest.id,\n id,\n pageId: activePage.id,\n },\n label: activePage.label(tApp),\n },\n );\n }\n\n const pages = entityManifest.detailPages ?? [];\n let tabsNode: JSX.Element | null = null;\n if (pages.length > 1 && activePage != null) {\n tabsNode = (\n <NavigationTabs\n items={pages.map((page) => {\n return {\n id: page.id,\n label: page.label(tApp),\n preloadOnHover: 'code-and-data',\n to: entityManifest.routes.detailPage(id, page.id),\n };\n })}\n activeId={activePage.id}\n variant=\"underline\"\n />\n );\n }\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <DetailPageTemplate\n headerNode={<PageHeader title={detailLabel} />}\n tabsNode={tabsNode}\n headerDensity=\"compact\"\n >\n <BackofficeStaticRouteFallback label={t('common.loading')} />\n </DetailPageTemplate>\n </BackofficeRightPageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;AAwBA,IAAM,KAAiB,MACd,EAAM,KAAK,CAAC,CAAC,QAAQ,cAAc,EAAE,GAGxC,KACJ,GACA,GACA,GACA,GACA,MAC4C;CAC5C,IAAM,IAAQ,EAAe,eAAe,CAAC;CAC7C,IAAI,EAAM,WAAW,GACnB,OAAO;CAGT,IAAM,IAAqB,EAAc,KAAY,EAAE;CACvD,IAAI,MAAuB,IAAI;EAC7B,IAAM,IAAS,EAAM,MAAM,MAClB,EAAc,EAAK,WAAW,MAAM,CAC5C;EACD,IAAI,KAAU,MACZ,OAAO;CAEX;CAEA,IAAM,IAA4B,EAAc,CAAe;CAC/D,IAAI,MAA8B,IA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IAAI,EAAe,OAAO,WAAW,GAAI,EAAK,EAAE;EAClD,EACD;EACD,UAAU,EAAW;EACrB,SAAQ;CACT,CAAA,IAKH,kBAAC,GAAD;EAAuC;EACrC,UAAA,kBAAC,GAAD;GACE,YAAY,kBAAC,GAAD,EAAY,OAAO,EAAc,CAAA;GACnC;GACV,eAAc;GAEd,UAAA,kBAAC,GAAD,EAA+B,OAAO,EAAE,gBAAgB,EAAI,CAAA;EAC1C,CAAA;CACK,CAAA;AAE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTabsItems.js","names":[],"sources":["../../../../src/pages/detail/buildTabsItems.ts"],"sourcesContent":["import type { BackofficeDetailPageRouteSpec } from '@plumile/backoffice-core/types.js';\nimport type { NavigationTabItem } from '@plumile/ui/
|
|
1
|
+
{"version":3,"file":"buildTabsItems.js","names":[],"sources":["../../../../src/pages/detail/buildTabsItems.ts"],"sourcesContent":["import type { BackofficeDetailPageRouteSpec } from '@plumile/backoffice-core/types.js';\nimport type { NavigationTabItem } from '@plumile/ui/tabs';\nimport type { TFunction } from 'i18next';\n\ntype DetailRoutePage<Node> = BackofficeDetailPageRouteSpec<Node>;\n\nexport const buildTabsItems = <Node>(input: {\n pages: readonly DetailRoutePage<Node>[];\n id: string;\n tApp: TFunction;\n detailPageHref: (id: string, pageId: string) => string;\n}): readonly NavigationTabItem[] => {\n return input.pages.map((page) => {\n return {\n id: page.id,\n label: page.label(input.tApp),\n preloadOnHover: 'code-and-data',\n to: input.detailPageHref(input.id, page.id),\n };\n });\n};\n"],"mappings":";AAMA,IAAa,KAAwB,MAM5B,EAAM,MAAM,KAAK,OACf;CACL,IAAI,EAAK;CACT,OAAO,EAAK,MAAM,EAAM,IAAI;CAC5B,gBAAgB;CAChB,IAAI,EAAM,eAAe,EAAM,IAAI,EAAK,EAAE;AAC5C,EACD"}
|
|
@@ -8,14 +8,13 @@ import { createBackofficeRoutes as s } from "../router/createBackofficeRoutes.js
|
|
|
8
8
|
import { createBackofficeEntityRegistry as c } from "./entityRegistry.js";
|
|
9
9
|
import { useBackofficeAuthRouteGate as l } from "./useBackofficeAuthRouteGate.js";
|
|
10
10
|
import { StrictMode as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { RoutePendingBar as C } from "@plumile/ui/components/routing/RoutePendingBar.js";
|
|
11
|
+
import { BackofficeThemeProvider as h, RoutePendingBar as g } from "@plumile/ui";
|
|
12
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
+
import { I18nextProvider as y } from "react-i18next";
|
|
14
|
+
import b from "@plumile/router/routing/RoutingContext.js";
|
|
15
|
+
import { createInstance as x } from "i18next";
|
|
16
|
+
import S from "@plumile/router/routing/createRouter.js";
|
|
17
|
+
import C from "@plumile/router/routing/RouterRenderer.js";
|
|
19
18
|
import { RelayProvider as w, configureRelayEnvironment as T, useRelayOperationActivity as E } from "@plumile/relay";
|
|
20
19
|
//#region src/provider/BackofficeProvider.tsx
|
|
21
20
|
var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWith("/") ? e.slice(0, -1) : e : `/${e}`, O = (e, t) => {
|
|
@@ -31,7 +30,7 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
31
30
|
}])), A = ({ routes: e, context: t, instrumentations: n }) => {
|
|
32
31
|
let [r, i] = m(null), a = p(null);
|
|
33
32
|
return d(() => {
|
|
34
|
-
let r =
|
|
33
|
+
let r = S(e, {
|
|
35
34
|
context: t,
|
|
36
35
|
instrumentations: n
|
|
37
36
|
});
|
|
@@ -49,36 +48,36 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
49
48
|
context: f(() => ({ relayEnvironment: r }), [r]),
|
|
50
49
|
instrumentations: t
|
|
51
50
|
});
|
|
52
|
-
return o == null ? /* @__PURE__ */
|
|
51
|
+
return o == null ? /* @__PURE__ */ _(n, {}) : /* @__PURE__ */ _(b.Provider, {
|
|
53
52
|
value: o.context,
|
|
54
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ _(C, {
|
|
55
54
|
enableTransition: !0,
|
|
56
55
|
externalPending: a.pendingCount > 0,
|
|
57
|
-
fallback: /* @__PURE__ */
|
|
58
|
-
pending: /* @__PURE__ */
|
|
56
|
+
fallback: /* @__PURE__ */ _(n, {}),
|
|
57
|
+
pending: /* @__PURE__ */ _(g, {})
|
|
59
58
|
})
|
|
60
59
|
});
|
|
61
60
|
}, M = (n) => {
|
|
62
|
-
let i = D(n.basePath ?? "/"), p = l(i),
|
|
61
|
+
let i = D(n.basePath ?? "/"), p = l(i), g = f(() => k(n.entityManifest, i), [i, n.entityManifest]), b = f(() => c(g, { basePath: i }), [i, g]), S = n.graphql, C = f(() => t(n.dashboards), [n.dashboards]);
|
|
63
62
|
d(() => {
|
|
64
|
-
let e =
|
|
63
|
+
let e = S.httpUrl ?? S.endpoint, t = S.wsUrl ?? S.wsEndpoint;
|
|
65
64
|
T({
|
|
66
65
|
httpUrl: e,
|
|
67
66
|
wsUrl: t,
|
|
68
|
-
getDataId:
|
|
69
|
-
logEvents:
|
|
70
|
-
getAuthHeaders:
|
|
67
|
+
getDataId: S.getDataId,
|
|
68
|
+
logEvents: S.logEvents,
|
|
69
|
+
getAuthHeaders: S.getAuthHeaders
|
|
71
70
|
});
|
|
72
71
|
}, [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
S.endpoint,
|
|
73
|
+
S.getAuthHeaders,
|
|
74
|
+
S.getDataId,
|
|
75
|
+
S.httpUrl,
|
|
76
|
+
S.logEvents,
|
|
77
|
+
S.wsEndpoint,
|
|
78
|
+
S.wsUrl
|
|
80
79
|
]);
|
|
81
|
-
let E = f(() => o(n.i18n?.resources ?? {}), [n.i18n?.resources]), O = f(() => n.i18n?.instance ??
|
|
80
|
+
let E = f(() => o(n.i18n?.resources ?? {}), [n.i18n?.resources]), O = f(() => n.i18n?.instance ?? x(), [n.i18n?.instance]), [A, M] = m(O.isInitialized);
|
|
82
81
|
d(() => {
|
|
83
82
|
let e = !0, t = () => {
|
|
84
83
|
e && M(!0);
|
|
@@ -125,8 +124,8 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
125
124
|
]);
|
|
126
125
|
let N = f(() => ({
|
|
127
126
|
basePath: i,
|
|
128
|
-
entities:
|
|
129
|
-
entityManifest:
|
|
127
|
+
entities: g,
|
|
128
|
+
entityManifest: g,
|
|
130
129
|
entityRegistry: b,
|
|
131
130
|
filterColumnAliases: n.filterColumnAliases,
|
|
132
131
|
sidebar: n.sidebar,
|
|
@@ -139,14 +138,14 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
139
138
|
n.auth,
|
|
140
139
|
n.dashboard,
|
|
141
140
|
C,
|
|
142
|
-
|
|
141
|
+
g,
|
|
143
142
|
b,
|
|
144
143
|
n.filterColumnAliases,
|
|
145
144
|
n.graphql,
|
|
146
145
|
n.sidebar
|
|
147
146
|
]), P = f(() => s({
|
|
148
147
|
basePath: i,
|
|
149
|
-
entityManifest:
|
|
148
|
+
entityManifest: g,
|
|
150
149
|
entityRegistry: b,
|
|
151
150
|
sidebar: n.sidebar,
|
|
152
151
|
auth: n.auth,
|
|
@@ -155,21 +154,24 @@ var D = (e) => e.trim() === "" || e === "/" ? "/" : e.startsWith("/") ? e.endsWi
|
|
|
155
154
|
toolsOperationPage: n.toolsOperationPage
|
|
156
155
|
}), [
|
|
157
156
|
i,
|
|
158
|
-
|
|
157
|
+
g,
|
|
159
158
|
b,
|
|
160
159
|
n.auth,
|
|
161
160
|
n.dashboard,
|
|
162
161
|
C,
|
|
163
162
|
n.toolsOperationPage,
|
|
164
163
|
n.sidebar
|
|
165
|
-
]), F = /* @__PURE__ */
|
|
166
|
-
return A && p && (F = /* @__PURE__ */
|
|
167
|
-
|
|
168
|
-
children:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
]), F = /* @__PURE__ */ _(r, { label: "Loading..." });
|
|
165
|
+
return A && p && (F = /* @__PURE__ */ _(h, {
|
|
166
|
+
...n.theme,
|
|
167
|
+
children: /* @__PURE__ */ _(w, { children: /* @__PURE__ */ v(e, {
|
|
168
|
+
value: N,
|
|
169
|
+
children: [n.overlay, /* @__PURE__ */ _(j, {
|
|
170
|
+
routes: P,
|
|
171
|
+
instrumentations: n.instrumentations
|
|
172
|
+
})]
|
|
173
|
+
}) })
|
|
174
|
+
})), /* @__PURE__ */ _(u, { children: /* @__PURE__ */ _(y, {
|
|
173
175
|
i18n: O,
|
|
174
176
|
children: F
|
|
175
177
|
}) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeProvider.js","names":[],"sources":["../../../src/provider/BackofficeProvider.tsx"],"sourcesContent":["import {\n StrictMode,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ContextType,\n type JSX,\n} from 'react';\nimport { createInstance } from 'i18next';\nimport { I18nextProvider } from 'react-i18next';\nimport createRouter from '@plumile/router/routing/createRouter.js';\nimport RouterRenderer from '@plumile/router/routing/RouterRenderer.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { BackofficeThemeProvider } from '@plumile/ui/admin/theme/BackofficeThemeProvider.js';\nimport { RoutePendingBar } from '@plumile/ui/components/routing/RoutePendingBar.js';\n\nimport { type BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\nimport {\n RelayProvider,\n configureRelayEnvironment,\n useRelayOperationActivity,\n} from '@plumile/relay';\n\nimport { createI18nInstance } from '../i18n/createI18nInstance.js';\nimport { withBackofficeReactI18nResources } from '../i18n/resources.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { BackofficeConfigProvider } from './BackofficeConfigContext.js';\nimport {\n createBackofficeRoutes,\n type BackofficeRouterContext,\n} from '../router/createBackofficeRoutes.js';\nimport type { BackofficeProviderProps } from './types.js';\nimport { validateBackofficeDashboardRegistrations } from './dashboardRegistrations.js';\nimport {\n BackofficeRouteFallback,\n BackofficeStaticRouteFallback,\n} from '../components/backoffice/routing/BackofficeRouteFallback.js';\nimport { createBackofficeEntityRegistry } from './entityRegistry.js';\nimport { useBackofficeAuthRouteGate } from './useBackofficeAuthRouteGate.js';\n\nconst normalizeAbsolutePath = (value: string): string => {\n if (value.trim() === '' || value === '/') {\n return '/';\n }\n if (!value.startsWith('/')) {\n return `/${value}`;\n }\n if (value.endsWith('/')) {\n return value.slice(0, -1);\n }\n return value;\n};\n\nconst prefixRoutePath = (basePath: string, value: string): string => {\n const normalizedPath = normalizeAbsolutePath(value);\n const normalizedBasePath = normalizeAbsolutePath(basePath);\n if (normalizedBasePath === '/') {\n return normalizedPath;\n }\n if (\n normalizedPath === normalizedBasePath ||\n normalizedPath.startsWith(`${normalizedBasePath}/`)\n ) {\n return normalizedPath;\n }\n if (normalizedPath === '/') {\n return normalizedBasePath;\n }\n return `${normalizedBasePath}${normalizedPath}`;\n};\n\nconst resolveEntityManifest = (\n manifest: BackofficeEntityManifestMap,\n basePath: string,\n): BackofficeEntityManifestMap => {\n return Object.fromEntries(\n Object.entries(manifest).map(([entityId, item]) => {\n return [\n entityId,\n {\n ...item,\n routes: {\n list: prefixRoutePath(basePath, item.routes.list),\n detail: (id: string) => {\n return prefixRoutePath(basePath, item.routes.detail(id));\n },\n detailPage: (id: string, pageId: string) => {\n return prefixRoutePath(\n basePath,\n item.routes.detailPage(id, pageId),\n );\n },\n },\n } satisfies BackofficeEntityManifestMap[string],\n ] as const;\n }),\n );\n};\n\ntype RouterShellProps = {\n routes: ReturnType<typeof createBackofficeRoutes>;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n};\n\ntype BackofficeRouterInstance = {\n context: NonNullable<ContextType<typeof RoutingContext>>;\n cleanup: () => void;\n};\n\nconst useBackofficeRouterInstance = ({\n routes,\n context,\n instrumentations,\n}: {\n routes: ReturnType<typeof createBackofficeRoutes>;\n context: BackofficeRouterContext;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n}): BackofficeRouterInstance | null => {\n const [router, setRouter] = useState<BackofficeRouterInstance | null>(null);\n const routerRef = useRef<BackofficeRouterInstance | null>(null);\n\n useEffect(() => {\n const nextRouter = createRouter(routes, {\n context,\n instrumentations,\n });\n routerRef.current = nextRouter;\n setRouter(nextRouter);\n\n return () => {\n if (routerRef.current === nextRouter) {\n routerRef.current = null;\n }\n nextRouter.cleanup();\n };\n }, [context, instrumentations, routes]);\n\n return router;\n};\n\nconst RouterShell = ({\n routes,\n instrumentations,\n}: RouterShellProps): JSX.Element => {\n const relayEnvironment = useRelayEnvironment();\n const relayOperationActivity = useRelayOperationActivity();\n\n const routerContext = useMemo(() => {\n return { relayEnvironment };\n }, [relayEnvironment]);\n\n const router = useBackofficeRouterInstance({\n routes,\n context: routerContext,\n instrumentations,\n });\n\n if (router == null) {\n return <BackofficeRouteFallback />;\n }\n\n return (\n <RoutingContext.Provider value={router.context}>\n <RouterRenderer\n enableTransition\n externalPending={relayOperationActivity.pendingCount > 0}\n fallback={<BackofficeRouteFallback />}\n pending={<RoutePendingBar />}\n />\n </RoutingContext.Provider>\n );\n};\n\nexport const BackofficeProvider = (\n props: BackofficeProviderProps,\n): JSX.Element => {\n const basePath = normalizeAbsolutePath(props.basePath ?? '/');\n const canMountRouter = useBackofficeAuthRouteGate(basePath);\n\n const entityManifest = useMemo(() => {\n return resolveEntityManifest(props.entityManifest, basePath);\n }, [basePath, props.entityManifest]);\n const entityRegistry = useMemo(() => {\n return createBackofficeEntityRegistry(entityManifest, { basePath });\n }, [basePath, entityManifest]);\n\n const graphQLConfig = props.graphql;\n const dashboards = useMemo(() => {\n return validateBackofficeDashboardRegistrations(props.dashboards);\n }, [props.dashboards]);\n\n useEffect(() => {\n const httpUrl = graphQLConfig.httpUrl ?? graphQLConfig.endpoint;\n const wsUrl = graphQLConfig.wsUrl ?? graphQLConfig.wsEndpoint;\n configureRelayEnvironment({\n httpUrl,\n wsUrl,\n getDataId: graphQLConfig.getDataId,\n logEvents: graphQLConfig.logEvents,\n getAuthHeaders: graphQLConfig.getAuthHeaders,\n });\n }, [\n graphQLConfig.endpoint,\n graphQLConfig.getAuthHeaders,\n graphQLConfig.getDataId,\n graphQLConfig.httpUrl,\n graphQLConfig.logEvents,\n graphQLConfig.wsEndpoint,\n graphQLConfig.wsUrl,\n ]);\n\n const mergedResources = useMemo(() => {\n return withBackofficeReactI18nResources(props.i18n?.resources ?? {});\n }, [props.i18n?.resources]);\n\n const i18nInstance = useMemo(() => {\n return props.i18n?.instance ?? createInstance();\n }, [props.i18n?.instance]);\n const [isI18nReady, setIsI18nReady] = useState(i18nInstance.isInitialized);\n\n useEffect(() => {\n let isCurrent = true;\n const markI18nReady = (): void => {\n if (isCurrent) {\n setIsI18nReady(true);\n }\n };\n\n i18nInstance.on('initialized', markI18nReady);\n if (i18nInstance.isInitialized) {\n markI18nReady();\n return () => {\n isCurrent = false;\n i18nInstance.off('initialized', markI18nReady);\n };\n }\n\n const readyCheck = globalThis.setTimeout(() => {\n if (i18nInstance.isInitialized) {\n markI18nReady();\n }\n }, 0);\n\n const initOptions = props.i18n?.initOptions ?? {};\n const defaultNs = initOptions.defaultNS ?? 'translations';\n const ns = initOptions.ns ?? ['backofficeReact', 'translations', 'ui'];\n createI18nInstance({\n resources: mergedResources,\n lng: props.i18n?.lng,\n fallbackLng: props.i18n?.fallbackLng,\n initOptions: {\n ...initOptions,\n defaultNS: defaultNs,\n ns,\n react: {\n useSuspense: false,\n ...initOptions.react,\n },\n },\n instance: i18nInstance,\n useLanguageDetector: props.i18n?.useLanguageDetector,\n detection: props.i18n?.detection,\n })\n .then(markI18nReady)\n .catch((error: unknown) => {\n markI18nReady();\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n return () => {\n isCurrent = false;\n globalThis.clearTimeout(readyCheck);\n i18nInstance.off('initialized', markI18nReady);\n };\n }, [\n i18nInstance,\n mergedResources,\n props.i18n?.initOptions,\n props.i18n?.detection,\n props.i18n?.fallbackLng,\n props.i18n?.lng,\n props.i18n?.useLanguageDetector,\n ]);\n\n const configValue = useMemo(() => {\n return {\n basePath,\n entities: entityManifest,\n entityManifest,\n entityRegistry,\n filterColumnAliases: props.filterColumnAliases,\n sidebar: props.sidebar,\n dashboard: props.dashboard,\n dashboards,\n auth: props.auth,\n graphql: props.graphql,\n };\n }, [\n basePath,\n props.auth,\n props.dashboard,\n dashboards,\n entityManifest,\n entityRegistry,\n props.filterColumnAliases,\n props.graphql,\n props.sidebar,\n ]);\n\n const routes = useMemo(() => {\n return createBackofficeRoutes({\n basePath,\n entityManifest,\n entityRegistry,\n sidebar: props.sidebar,\n auth: props.auth,\n dashboard: props.dashboard,\n dashboards,\n toolsOperationPage: props.toolsOperationPage,\n });\n }, [\n basePath,\n entityManifest,\n entityRegistry,\n props.auth,\n props.dashboard,\n dashboards,\n props.toolsOperationPage,\n props.sidebar,\n ]);\n\n let contentNode = <BackofficeStaticRouteFallback label=\"Loading...\" />;\n if (isI18nReady && canMountRouter) {\n contentNode = (\n <BackofficeThemeProvider>\n <RelayProvider>\n <BackofficeConfigProvider value={configValue}>\n {props.overlay}\n <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\n </BackofficeConfigProvider>\n </RelayProvider>\n </BackofficeThemeProvider>\n );\n }\n\n return (\n <StrictMode>\n <I18nextProvider i18n={i18nInstance}>{contentNode}</I18nextProvider>\n </StrictMode>\n );\n};\n\nexport default BackofficeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAM,KAAyB,MACzB,EAAM,KAAK,MAAM,MAAM,MAAU,MAC5B,MAEJ,EAAM,WA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BrE,OAhBI,KAAe,MACjB,IACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAA0B,OAAO;EAAjC,UAAA,CACG,EAAM,SACP,kBAAC,GAAD;GACU;GACR,kBAAkB,EAAM;EACzB,CAAA,CACuB;CACb,CAAA,EAAA,CAAA,EACQ,CAAA,IAK3B,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,MAAM;EAAe,UAAA;CAA6B,CAAA,EACzD,CAAA;AAEhB"}
|
|
1
|
+
{"version":3,"file":"BackofficeProvider.js","names":[],"sources":["../../../src/provider/BackofficeProvider.tsx"],"sourcesContent":["import {\n StrictMode,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ContextType,\n type JSX,\n} from 'react';\nimport { createInstance } from 'i18next';\nimport { I18nextProvider } from 'react-i18next';\nimport createRouter from '@plumile/router/routing/createRouter.js';\nimport RouterRenderer from '@plumile/router/routing/RouterRenderer.js';\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\nimport { BackofficeThemeProvider, RoutePendingBar } from '@plumile/ui';\n\nimport { type BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\nimport {\n RelayProvider,\n configureRelayEnvironment,\n useRelayOperationActivity,\n} from '@plumile/relay';\n\nimport { createI18nInstance } from '../i18n/createI18nInstance.js';\nimport { withBackofficeReactI18nResources } from '../i18n/resources.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\nimport { BackofficeConfigProvider } from './BackofficeConfigContext.js';\nimport {\n createBackofficeRoutes,\n type BackofficeRouterContext,\n} from '../router/createBackofficeRoutes.js';\nimport type { BackofficeProviderProps } from './types.js';\nimport { validateBackofficeDashboardRegistrations } from './dashboardRegistrations.js';\nimport {\n BackofficeRouteFallback,\n BackofficeStaticRouteFallback,\n} from '../components/backoffice/routing/BackofficeRouteFallback.js';\nimport { createBackofficeEntityRegistry } from './entityRegistry.js';\nimport { useBackofficeAuthRouteGate } from './useBackofficeAuthRouteGate.js';\n\nconst normalizeAbsolutePath = (value: string): string => {\n if (value.trim() === '' || value === '/') {\n return '/';\n }\n if (!value.startsWith('/')) {\n return `/${value}`;\n }\n if (value.endsWith('/')) {\n return value.slice(0, -1);\n }\n return value;\n};\n\nconst prefixRoutePath = (basePath: string, value: string): string => {\n const normalizedPath = normalizeAbsolutePath(value);\n const normalizedBasePath = normalizeAbsolutePath(basePath);\n if (normalizedBasePath === '/') {\n return normalizedPath;\n }\n if (\n normalizedPath === normalizedBasePath ||\n normalizedPath.startsWith(`${normalizedBasePath}/`)\n ) {\n return normalizedPath;\n }\n if (normalizedPath === '/') {\n return normalizedBasePath;\n }\n return `${normalizedBasePath}${normalizedPath}`;\n};\n\nconst resolveEntityManifest = (\n manifest: BackofficeEntityManifestMap,\n basePath: string,\n): BackofficeEntityManifestMap => {\n return Object.fromEntries(\n Object.entries(manifest).map(([entityId, item]) => {\n return [\n entityId,\n {\n ...item,\n routes: {\n list: prefixRoutePath(basePath, item.routes.list),\n detail: (id: string) => {\n return prefixRoutePath(basePath, item.routes.detail(id));\n },\n detailPage: (id: string, pageId: string) => {\n return prefixRoutePath(\n basePath,\n item.routes.detailPage(id, pageId),\n );\n },\n },\n } satisfies BackofficeEntityManifestMap[string],\n ] as const;\n }),\n );\n};\n\ntype RouterShellProps = {\n routes: ReturnType<typeof createBackofficeRoutes>;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n};\n\ntype BackofficeRouterInstance = {\n context: NonNullable<ContextType<typeof RoutingContext>>;\n cleanup: () => void;\n};\n\nconst useBackofficeRouterInstance = ({\n routes,\n context,\n instrumentations,\n}: {\n routes: ReturnType<typeof createBackofficeRoutes>;\n context: BackofficeRouterContext;\n instrumentations?: BackofficeProviderProps['instrumentations'];\n}): BackofficeRouterInstance | null => {\n const [router, setRouter] = useState<BackofficeRouterInstance | null>(null);\n const routerRef = useRef<BackofficeRouterInstance | null>(null);\n\n useEffect(() => {\n const nextRouter = createRouter(routes, {\n context,\n instrumentations,\n });\n routerRef.current = nextRouter;\n setRouter(nextRouter);\n\n return () => {\n if (routerRef.current === nextRouter) {\n routerRef.current = null;\n }\n nextRouter.cleanup();\n };\n }, [context, instrumentations, routes]);\n\n return router;\n};\n\nconst RouterShell = ({\n routes,\n instrumentations,\n}: RouterShellProps): JSX.Element => {\n const relayEnvironment = useRelayEnvironment();\n const relayOperationActivity = useRelayOperationActivity();\n\n const routerContext = useMemo(() => {\n return { relayEnvironment };\n }, [relayEnvironment]);\n\n const router = useBackofficeRouterInstance({\n routes,\n context: routerContext,\n instrumentations,\n });\n\n if (router == null) {\n return <BackofficeRouteFallback />;\n }\n\n return (\n <RoutingContext.Provider value={router.context}>\n <RouterRenderer\n enableTransition\n externalPending={relayOperationActivity.pendingCount > 0}\n fallback={<BackofficeRouteFallback />}\n pending={<RoutePendingBar />}\n />\n </RoutingContext.Provider>\n );\n};\n\nexport const BackofficeProvider = (\n props: BackofficeProviderProps,\n): JSX.Element => {\n const basePath = normalizeAbsolutePath(props.basePath ?? '/');\n const canMountRouter = useBackofficeAuthRouteGate(basePath);\n\n const entityManifest = useMemo(() => {\n return resolveEntityManifest(props.entityManifest, basePath);\n }, [basePath, props.entityManifest]);\n const entityRegistry = useMemo(() => {\n return createBackofficeEntityRegistry(entityManifest, { basePath });\n }, [basePath, entityManifest]);\n\n const graphQLConfig = props.graphql;\n const dashboards = useMemo(() => {\n return validateBackofficeDashboardRegistrations(props.dashboards);\n }, [props.dashboards]);\n\n useEffect(() => {\n const httpUrl = graphQLConfig.httpUrl ?? graphQLConfig.endpoint;\n const wsUrl = graphQLConfig.wsUrl ?? graphQLConfig.wsEndpoint;\n configureRelayEnvironment({\n httpUrl,\n wsUrl,\n getDataId: graphQLConfig.getDataId,\n logEvents: graphQLConfig.logEvents,\n getAuthHeaders: graphQLConfig.getAuthHeaders,\n });\n }, [\n graphQLConfig.endpoint,\n graphQLConfig.getAuthHeaders,\n graphQLConfig.getDataId,\n graphQLConfig.httpUrl,\n graphQLConfig.logEvents,\n graphQLConfig.wsEndpoint,\n graphQLConfig.wsUrl,\n ]);\n\n const mergedResources = useMemo(() => {\n return withBackofficeReactI18nResources(props.i18n?.resources ?? {});\n }, [props.i18n?.resources]);\n\n const i18nInstance = useMemo(() => {\n return props.i18n?.instance ?? createInstance();\n }, [props.i18n?.instance]);\n const [isI18nReady, setIsI18nReady] = useState(i18nInstance.isInitialized);\n\n useEffect(() => {\n let isCurrent = true;\n const markI18nReady = (): void => {\n if (isCurrent) {\n setIsI18nReady(true);\n }\n };\n\n i18nInstance.on('initialized', markI18nReady);\n if (i18nInstance.isInitialized) {\n markI18nReady();\n return () => {\n isCurrent = false;\n i18nInstance.off('initialized', markI18nReady);\n };\n }\n\n const readyCheck = globalThis.setTimeout(() => {\n if (i18nInstance.isInitialized) {\n markI18nReady();\n }\n }, 0);\n\n const initOptions = props.i18n?.initOptions ?? {};\n const defaultNs = initOptions.defaultNS ?? 'translations';\n const ns = initOptions.ns ?? ['backofficeReact', 'translations', 'ui'];\n createI18nInstance({\n resources: mergedResources,\n lng: props.i18n?.lng,\n fallbackLng: props.i18n?.fallbackLng,\n initOptions: {\n ...initOptions,\n defaultNS: defaultNs,\n ns,\n react: {\n useSuspense: false,\n ...initOptions.react,\n },\n },\n instance: i18nInstance,\n useLanguageDetector: props.i18n?.useLanguageDetector,\n detection: props.i18n?.detection,\n })\n .then(markI18nReady)\n .catch((error: unknown) => {\n markI18nReady();\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n return () => {\n isCurrent = false;\n globalThis.clearTimeout(readyCheck);\n i18nInstance.off('initialized', markI18nReady);\n };\n }, [\n i18nInstance,\n mergedResources,\n props.i18n?.initOptions,\n props.i18n?.detection,\n props.i18n?.fallbackLng,\n props.i18n?.lng,\n props.i18n?.useLanguageDetector,\n ]);\n\n const configValue = useMemo(() => {\n return {\n basePath,\n entities: entityManifest,\n entityManifest,\n entityRegistry,\n filterColumnAliases: props.filterColumnAliases,\n sidebar: props.sidebar,\n dashboard: props.dashboard,\n dashboards,\n auth: props.auth,\n graphql: props.graphql,\n };\n }, [\n basePath,\n props.auth,\n props.dashboard,\n dashboards,\n entityManifest,\n entityRegistry,\n props.filterColumnAliases,\n props.graphql,\n props.sidebar,\n ]);\n\n const routes = useMemo(() => {\n return createBackofficeRoutes({\n basePath,\n entityManifest,\n entityRegistry,\n sidebar: props.sidebar,\n auth: props.auth,\n dashboard: props.dashboard,\n dashboards,\n toolsOperationPage: props.toolsOperationPage,\n });\n }, [\n basePath,\n entityManifest,\n entityRegistry,\n props.auth,\n props.dashboard,\n dashboards,\n props.toolsOperationPage,\n props.sidebar,\n ]);\n\n let contentNode = <BackofficeStaticRouteFallback label=\"Loading...\" />;\n if (isI18nReady && canMountRouter) {\n contentNode = (\n <BackofficeThemeProvider {...props.theme}>\n <RelayProvider>\n <BackofficeConfigProvider value={configValue}>\n {props.overlay}\n <RouterShell\n routes={routes}\n instrumentations={props.instrumentations}\n />\n </BackofficeConfigProvider>\n </RelayProvider>\n </BackofficeThemeProvider>\n );\n }\n\n return (\n <StrictMode>\n <I18nextProvider i18n={i18nInstance}>{contentNode}</I18nextProvider>\n </StrictMode>\n );\n};\n\nexport default BackofficeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,IAAM,KAAyB,MACzB,EAAM,KAAK,MAAM,MAAM,MAAU,MAC5B,MAEJ,EAAM,WAAW,GAAG,IAGrB,EAAM,SAAS,GAAG,IACb,EAAM,MAAM,GAAG,EAAE,IAEnB,IALE,IAAI,KAQT,KAAmB,GAAkB,MAA0B;CACnE,IAAM,IAAiB,EAAsB,CAAK,GAC5C,IAAqB,EAAsB,CAAQ;CAazD,OAZI,MAAuB,OAIzB,MAAmB,KACnB,EAAe,WAAW,GAAG,EAAmB,EAAE,IAE3C,IAEL,MAAmB,MACd,IAEF,GAAG,IAAqB;AACjC,GAEM,KACJ,GACA,MAEO,OAAO,YACZ,OAAO,QAAQ,CAAQ,CAAC,CAAC,KAAK,CAAC,GA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