@plumile/backoffice-react 0.1.105 → 0.1.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/_virtual/_rolldown/runtime.js +7 -0
- package/lib/esm/auth/AuthRefreshNotice.js +38 -0
- package/lib/esm/auth/AuthRefreshNotice.js.map +1 -0
- package/lib/esm/auth/TotpQrCode.js +28 -0
- package/lib/esm/auth/TotpQrCode.js.map +1 -0
- package/lib/esm/auth/authRefreshNotice.css.js +7 -0
- package/lib/esm/auth/authRefreshNotice.css.js.map +1 -0
- package/lib/esm/{AuthPanel-BaIRFGbX.js → auth/login/AuthPanel.js} +7 -7
- package/lib/esm/auth/login/AuthPanel.js.map +1 -0
- package/lib/esm/auth/login/EmailCapturePanel.js +50 -0
- package/lib/esm/auth/login/EmailCapturePanel.js.map +1 -0
- package/lib/esm/auth/login/LoginFlow.js +130 -0
- package/lib/esm/auth/login/LoginFlow.js.map +1 -0
- package/lib/esm/auth/login/MethodChooser.js +49 -0
- package/lib/esm/auth/login/MethodChooser.js.map +1 -0
- package/lib/esm/auth/login/MfaChallengeForm.js +80 -0
- package/lib/esm/auth/login/MfaChallengeForm.js.map +1 -0
- package/lib/esm/auth/login/OidcButtons.js +29 -0
- package/lib/esm/auth/login/OidcButtons.js.map +1 -0
- package/lib/esm/auth/login/PasskeyLoginForm.js +81 -0
- package/lib/esm/auth/login/PasskeyLoginForm.js.map +1 -0
- package/lib/esm/auth/login/PasswordLoginPanel.js +37 -0
- package/lib/esm/auth/login/PasswordLoginPanel.js.map +1 -0
- package/lib/esm/auth/login/loginPage.css.js +7 -0
- package/lib/esm/auth/login/loginPage.css.js.map +1 -0
- package/lib/esm/auth/login/synchronizeAuthStatusQuery.js +10 -0
- package/lib/esm/auth/login/synchronizeAuthStatusQuery.js.map +1 -0
- package/lib/esm/{AcceptInvitationScreen-VaWXQPHp.js → auth/pages/AcceptInvitationScreen.js} +11 -11
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -0
- package/lib/esm/{PasswordResetCompleteScreen-Cgg96DPo.js → auth/pages/PasswordResetCompleteScreen.js} +10 -10
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -0
- package/lib/esm/{PasswordResetRequestScreen-I1nFvGLd.js → auth/pages/PasswordResetRequestScreen.js} +10 -10
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -0
- package/lib/esm/{VerifyEmailScreen-Br5KyHjg.js → auth/pages/VerifyEmailScreen.js} +7 -7
- package/lib/esm/auth/pages/VerifyEmailScreen.js.map +1 -0
- package/lib/esm/{BackofficeEntityActionFormDialog-DrZxuytz.js → components/backoffice/actions/BackofficeEntityActionFormDialog.js} +123 -121
- package/lib/esm/{BackofficeEntityActionFormDialog-DrZxuytz.js.map → components/backoffice/actions/BackofficeEntityActionFormDialog.js.map} +1 -1
- package/lib/esm/components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js +26 -0
- package/lib/esm/components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js.map +1 -0
- package/lib/esm/{backofficeEntityActionFormDialog.css-DJgEKwaA.js → components/backoffice/actions/backofficeEntityActionFormDialog.css.js} +3 -2
- package/lib/esm/{backofficeEntityActionFormDialog.css-DJgEKwaA.js.map → components/backoffice/actions/backofficeEntityActionFormDialog.css.js.map} +1 -1
- package/lib/esm/{toastViewAction-DQYlcGOL.js → components/backoffice/actions/toastViewAction.js} +2 -2
- package/lib/esm/{toastViewAction-DQYlcGOL.js.map → components/backoffice/actions/toastViewAction.js.map} +1 -1
- package/lib/esm/{buildDataTableColumns-DdmF-EYq.js → components/backoffice/columns/buildDataTableColumns.js} +18 -18
- package/lib/esm/{buildDataTableColumns-DdmF-EYq.js.map → components/backoffice/columns/buildDataTableColumns.js.map} +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeAuditMetadataPanel.js +31 -0
- package/lib/esm/components/backoffice/detail/BackofficeAuditMetadataPanel.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js +22 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js +40 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailField.js +30 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailField.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js +7 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js +24 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailLayout.js +20 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailLayout.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPayload.js +18 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPayload.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js +56 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationList.js +11 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationList.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +123 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailSection.js +36 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailSection.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js +18 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeEntityRefLink.js +17 -0
- package/lib/esm/components/backoffice/detail/BackofficeEntityRefLink.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +72 -0
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js +11 -0
- package/lib/esm/components/backoffice/detail/BackofficeEnumLabel.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeKpiStrip.js +35 -0
- package/lib/esm/components/backoffice/detail/BackofficeKpiStrip.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeLifecycleTimelineSection.js +37 -0
- package/lib/esm/components/backoffice/detail/BackofficeLifecycleTimelineSection.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficePayloadInspectorSection.js +36 -0
- package/lib/esm/components/backoffice/detail/BackofficePayloadInspectorSection.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js +22 -0
- package/lib/esm/components/backoffice/detail/BackofficeReferenceValue.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +43 -0
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeScopeStack.js +28 -0
- package/lib/esm/components/backoffice/detail/BackofficeScopeStack.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js +27 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusMetaBadge.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js +37 -0
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +84 -0
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeAuditMetadataPanel.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeAuditMetadataPanel.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailField.css.js +15 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailField.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailSection.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailSection.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailTaggedValue.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailTaggedValue.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeKpiStrip.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeKpiStrip.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeLifecycleTimelineSection.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeLifecycleTimelineSection.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficePayloadInspectorSection.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficePayloadInspectorSection.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeReferenceValue.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeReferenceValue.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeScopeStack.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeScopeStack.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeStatusMetaBadge.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeStatusMetaBadge.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +7 -0
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js.map +1 -0
- package/lib/esm/components/backoffice/detail/createBackofficeEntityLinkProps.js +21 -0
- package/lib/esm/components/backoffice/detail/createBackofficeEntityLinkProps.js.map +1 -0
- package/lib/esm/components/backoffice/detail/detailPayloadUtils.js +17 -0
- package/lib/esm/components/backoffice/detail/detailPayloadUtils.js.map +1 -0
- package/lib/esm/{BackofficeErrorBoundary-BwRVSDHU.js → components/backoffice/errors/BackofficeErrorBoundary.js} +2 -2
- package/lib/esm/{BackofficeErrorBoundary-BwRVSDHU.js.map → components/backoffice/errors/BackofficeErrorBoundary.js.map} +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js +46 -0
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js.map +1 -0
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js +67 -0
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js.map +1 -0
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js +46 -0
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js.map +1 -0
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +65 -0
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js.map +1 -0
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +7 -0
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -0
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +7 -0
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js.map +1 -0
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +7 -0
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js.map +1 -0
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +83 -0
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js.map +1 -0
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +7 -0
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js.map +1 -0
- package/lib/esm/{BackofficePermissionsContext-C2bdxy2z.js → components/backoffice/layout/BackofficePermissionsContext.js} +2 -2
- package/lib/esm/{BackofficePermissionsContext-C2bdxy2z.js.map → components/backoffice/layout/BackofficePermissionsContext.js.map} +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +7 -0
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js +10 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +69 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortal.js +12 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortal.js.map +1 -0
- package/lib/esm/{BackofficeTopbarPortalContext-Da5XFatM.js → components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js} +2 -2
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js +16 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +7 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js.map +1 -0
- package/lib/esm/{buildBreadcrumbs-C5St167Y.js → components/backoffice/layout/breadcrumb/buildBreadcrumbs.js} +7 -3
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/types.js +0 -0
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +301 -0
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -0
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js +18 -0
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js.map +1 -0
- package/lib/esm/{sidebarUtils-BgCBLJLv.js → components/backoffice/layout/sidebarUtils.js} +32 -22
- package/lib/esm/{sidebarUtils-BgCBLJLv.js.map → components/backoffice/layout/sidebarUtils.js.map} +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +7 -0
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js.map +1 -0
- package/lib/esm/components/backoffice/list/RowFlagsCell.js +37 -0
- package/lib/esm/components/backoffice/list/RowFlagsCell.js.map +1 -0
- package/lib/esm/components/backoffice/lists/BackofficeListToolbar.js +33 -0
- package/lib/esm/components/backoffice/lists/BackofficeListToolbar.js.map +1 -0
- package/lib/esm/components/backoffice/lists/backofficeListToolbar.css.js +13 -0
- package/lib/esm/components/backoffice/lists/backofficeListToolbar.css.js.map +1 -0
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js +31 -0
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js.map +1 -0
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js +7 -0
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +117 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +7 -0
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js +27 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerRowBase.js +23 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerRowBase.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerShell.js +28 -0
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerShell.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/types.js +0 -0
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js +35 -0
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js.map +1 -0
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +30 -0
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -0
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js +65 -0
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js.map +1 -0
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +7 -0
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js.map +1 -0
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +7 -0
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js.map +1 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentBoundary.js +24 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentBoundary.js.map +1 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js +27 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js.map +1 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentFallback.js +47 -0
- package/lib/esm/components/backoffice/routing/BackofficeContentFallback.js.map +1 -0
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js +25 -0
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js.map +1 -0
- package/lib/esm/components/backoffice/routing/BackofficeRoutePendingBar.js +12 -0
- package/lib/esm/components/backoffice/routing/BackofficeRoutePendingBar.js.map +1 -0
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +7 -0
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js.map +1 -0
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +7 -0
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js.map +1 -0
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +7 -0
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js.map +1 -0
- package/lib/esm/components/backoffice/routing/backofficeRouteFallback.css.js +7 -0
- package/lib/esm/components/backoffice/routing/backofficeRouteFallback.css.js.map +1 -0
- package/lib/esm/components/backoffice/routing/backofficeRoutePendingBar.css.js +7 -0
- package/lib/esm/components/backoffice/routing/backofficeRoutePendingBar.css.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js +12 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +506 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeListFilterContext.js +40 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeListFilterContext.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +24 -0
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +7 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js +7 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js.map +1 -0
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js +41 -0
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js.map +1 -0
- package/lib/esm/components/backoffice/shared/BackofficeFormattedCurrency.js +17 -0
- package/lib/esm/components/backoffice/shared/BackofficeFormattedCurrency.js.map +1 -0
- package/lib/esm/components/backoffice/shared/BackofficeFormattedNumber.js +17 -0
- package/lib/esm/components/backoffice/shared/BackofficeFormattedNumber.js.map +1 -0
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +12 -0
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -0
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +16 -0
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js.map +1 -0
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +7 -0
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +41 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js.map +1 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +48 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +1 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +63 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js.map +1 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js +35 -0
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js.map +1 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +7 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js.map +1 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +7 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js.map +1 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +7 -0
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js.map +1 -0
- package/lib/esm/components/backoffice/tools/parseToolJson.js +13 -0
- package/lib/esm/components/backoffice/tools/parseToolJson.js.map +1 -0
- package/lib/esm/filters/filterHelpers.js +26 -0
- package/lib/esm/filters/filterHelpers.js.map +1 -0
- package/lib/esm/hooks/useAuth.js +444 -0
- package/lib/esm/hooks/useAuth.js.map +1 -0
- package/lib/esm/hooks/useBackofficeAuth.js +89 -0
- package/lib/esm/hooks/useBackofficeAuth.js.map +1 -0
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js +39 -0
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js.map +1 -0
- package/lib/esm/hooks/useBackofficeListRefetch.js +50 -0
- package/lib/esm/hooks/useBackofficeListRefetch.js.map +1 -0
- package/lib/esm/{useBackofficeListUrlState-Ca6d7uIN.js → hooks/useBackofficeListUrlState.js} +2 -2
- package/lib/esm/hooks/useBackofficeListUrlState.js.map +1 -0
- package/lib/esm/hooks/useBackofficeLoadMore.js +18 -0
- package/lib/esm/hooks/useBackofficeLoadMore.js.map +1 -0
- package/lib/esm/hooks/useBackofficeSessionAuth.js +33 -0
- package/lib/esm/hooks/useBackofficeSessionAuth.js.map +1 -0
- package/lib/esm/hooks/useBackofficeSidebarPins.js +89 -0
- package/lib/esm/hooks/useBackofficeSidebarPins.js.map +1 -0
- package/lib/esm/hooks/useConditionalSubscription.js +63 -0
- package/lib/esm/hooks/useConditionalSubscription.js.map +1 -0
- package/lib/esm/hooks/useCopyToClipboard.js +31 -0
- package/lib/esm/hooks/useCopyToClipboard.js.map +1 -0
- package/lib/esm/hooks/useInfiniteConnection.js +95 -0
- package/lib/esm/hooks/useInfiniteConnection.js.map +1 -0
- package/lib/esm/hooks/useRefetchNeededReload.js +23 -0
- package/lib/esm/hooks/useRefetchNeededReload.js.map +1 -0
- package/lib/esm/hooks/useSidebarGroupCollapse.js +70 -0
- package/lib/esm/hooks/useSidebarGroupCollapse.js.map +1 -0
- package/lib/esm/i18n/createI18nInstance.js +68 -0
- package/lib/esm/i18n/createI18nInstance.js.map +1 -0
- package/lib/esm/i18n/locales/en/backofficeReact.js +436 -0
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -0
- package/lib/esm/i18n/locales/fr/backofficeReact.js +439 -0
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -0
- package/lib/esm/i18n/mergeResourceLanguages.js +22 -0
- package/lib/esm/i18n/mergeResourceLanguages.js.map +1 -0
- package/lib/esm/i18n/resources.js +23 -0
- package/lib/esm/i18n/resources.js.map +1 -0
- package/lib/esm/i18n/useBackofficeFormats.js +23 -0
- package/lib/esm/i18n/useBackofficeFormats.js.map +1 -0
- package/lib/esm/i18n/useBackofficeReactTranslation.js +9 -0
- package/lib/esm/i18n/useBackofficeReactTranslation.js.map +1 -0
- package/lib/esm/i18n/useReviewStatusLabel.js +19 -0
- package/lib/esm/i18n/useReviewStatusLabel.js.map +1 -0
- package/lib/esm/index.js +73 -0
- package/lib/esm/modules/base64.js +21 -0
- package/lib/esm/modules/base64.js.map +1 -0
- package/lib/esm/modules/formatFileSize.js +28 -0
- package/lib/esm/modules/formatFileSize.js.map +1 -0
- package/lib/esm/modules/sharedSchemaTypes.js +0 -0
- package/lib/esm/modules/webauthn.js +33 -0
- package/lib/esm/modules/webauthn.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +15 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayLikeToArray.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +15 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/defineProperty.js +20 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/defineProperty.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/interopRequireDefault.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/iterableToArray.js +13 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/iterableToArray.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/nonIterableSpread.js +13 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/nonIterableSpread.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/objectSpread2.js +33 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/objectSpread2.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +19 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toConsumableArray.js +18 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toConsumableArray.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toPrimitive.js +22 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toPrimitive.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toPropertyKey.js +17 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/toPropertyKey.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/typeof.js +18 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/typeof.js.map +1 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +19 -0
- package/lib/esm/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js.map +1 -0
- package/lib/esm/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +80 -0
- package/lib/esm/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js.map +1 -0
- package/lib/esm/node_modules/fbjs/lib/areEqual.js +42 -0
- package/lib/esm/node_modules/fbjs/lib/areEqual.js.map +1 -0
- package/lib/esm/node_modules/invariant/browser.js +30 -0
- package/lib/esm/node_modules/invariant/browser.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/index.js +11 -0
- package/lib/esm/node_modules/relay-test-utils/index.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayMockPayloadGenerator.js +288 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayMockPayloadGenerator.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js +183 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayResolverTestUtils.js +19 -0
- package/lib/esm/node_modules/relay-test-utils/lib/RelayResolverTestUtils.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/lib/index.js +21 -0
- package/lib/esm/node_modules/relay-test-utils/lib/index.js.map +1 -0
- package/lib/esm/node_modules/relay-test-utils/lib/unwrapContainer.js +16 -0
- package/lib/esm/node_modules/relay-test-utils/lib/unwrapContainer.js.map +1 -0
- package/lib/esm/pages/BackofficeAcceptInvitationPage.js +24 -0
- package/lib/esm/pages/BackofficeAcceptInvitationPage.js.map +1 -0
- package/lib/esm/pages/BackofficeDashboardPage.helpers.js +18 -0
- package/lib/esm/pages/BackofficeDashboardPage.helpers.js.map +1 -0
- package/lib/esm/pages/BackofficeDashboardPage.js +266 -0
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +18 -0
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.helpers.js +14 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.helpers.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.js +474 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +414 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -0
- package/lib/esm/{BackofficeEntityDetailUnknownPageRedirect-Iu4R3WvX.js → pages/BackofficeEntityDetailUnknownPageRedirect.js} +3 -3
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +37 -0
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityListPage.js +381 -0
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -0
- package/lib/esm/{BackofficeHubPage-DOePQ8Fc.js → pages/BackofficeHubPage.js} +29 -28
- package/lib/esm/pages/BackofficeHubPage.js.map +1 -0
- package/lib/esm/pages/BackofficeLayoutPage.js +273 -0
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -0
- package/lib/esm/pages/BackofficeLoginPage.js +47 -0
- package/lib/esm/pages/BackofficeLoginPage.js.map +1 -0
- package/lib/esm/{BackofficePasswordResetCompletePage-Cit5sdDm.js → pages/BackofficePasswordResetCompletePage.js} +16 -15
- package/lib/esm/pages/BackofficePasswordResetCompletePage.js.map +1 -0
- package/lib/esm/{BackofficePasswordResetRequestPage-B_TurHev.js → pages/BackofficePasswordResetRequestPage.js} +12 -12
- package/lib/esm/pages/BackofficePasswordResetRequestPage.js.map +1 -0
- package/lib/esm/{BackofficeVerifyEmailPage-DQbFIob1.js → pages/BackofficeVerifyEmailPage.js} +16 -15
- package/lib/esm/pages/BackofficeVerifyEmailPage.js.map +1 -0
- package/lib/esm/pages/backofficeDashboardPage.css.js +7 -0
- package/lib/esm/pages/backofficeDashboardPage.css.js.map +1 -0
- package/lib/esm/pages/backofficeEntityDetailPage.css.js +7 -0
- package/lib/esm/pages/backofficeEntityDetailPage.css.js.map +1 -0
- package/lib/esm/pages/backofficeEntityListPage.css.js +7 -0
- package/lib/esm/pages/backofficeEntityListPage.css.js.map +1 -0
- package/lib/esm/pages/dashboard/DashboardMetricGroup.js +25 -0
- package/lib/esm/pages/dashboard/DashboardMetricGroup.js.map +1 -0
- package/lib/esm/pages/dashboard/DashboardPanel.js +15 -0
- package/lib/esm/pages/dashboard/DashboardPanel.js.map +1 -0
- package/lib/esm/pages/dashboard/DashboardQuickActions.js +27 -0
- package/lib/esm/pages/dashboard/DashboardQuickActions.js.map +1 -0
- package/lib/esm/pages/dashboard/DashboardStatusList.js +28 -0
- package/lib/esm/pages/dashboard/DashboardStatusList.js.map +1 -0
- package/lib/esm/pages/dashboard/dashboardMetricGroup.css.js +8 -0
- package/lib/esm/pages/dashboard/dashboardMetricGroup.css.js.map +1 -0
- package/lib/esm/pages/dashboard/dashboardPanel.css.js +7 -0
- package/lib/esm/pages/dashboard/dashboardPanel.css.js.map +1 -0
- package/lib/esm/pages/dashboard/dashboardQuickActions.css.js +7 -0
- package/lib/esm/pages/dashboard/dashboardQuickActions.css.js.map +1 -0
- package/lib/esm/pages/dashboard/dashboardStatusList.css.js +7 -0
- package/lib/esm/pages/dashboard/dashboardStatusList.css.js.map +1 -0
- package/lib/esm/{BackofficeEntityDetailLayoutContext-C5G-PH28.js → pages/detail/BackofficeEntityDetailLayoutContext.js} +2 -2
- package/lib/esm/pages/detail/BackofficeEntityDetailLayoutContext.js.map +1 -0
- package/lib/esm/pages/detail/buildTabsItems.js +10 -0
- package/lib/esm/pages/detail/buildTabsItems.js.map +1 -0
- package/lib/esm/{pageResolution-CUaTq4Ql.js → pages/detail/pageResolution.js} +2 -2
- package/lib/esm/pages/detail/pageResolution.js.map +1 -0
- package/lib/esm/provider/BackofficeConfigContext.js +12 -0
- package/lib/esm/provider/BackofficeConfigContext.js.map +1 -0
- package/lib/esm/provider/BackofficeProvider.js +171 -0
- package/lib/esm/provider/BackofficeProvider.js.map +1 -0
- package/lib/esm/provider/entityRegistry.js +95 -0
- package/lib/esm/provider/entityRegistry.js.map +1 -0
- package/lib/esm/provider/lazyValue.js +14 -0
- package/lib/esm/provider/lazyValue.js.map +1 -0
- package/lib/esm/provider/types.js +0 -0
- package/lib/esm/provider/useBackofficeEntityLoader.js +141 -0
- package/lib/esm/provider/useBackofficeEntityLoader.js.map +1 -0
- package/lib/esm/{useBackofficeLazyValue-CW9xfRzQ.js → provider/useBackofficeLazyValue.js} +15 -7
- package/lib/esm/provider/useBackofficeLazyValue.js.map +1 -0
- package/lib/esm/relay/RelayProvider.js +13 -0
- package/lib/esm/relay/RelayProvider.js.map +1 -0
- package/lib/esm/relay/connectionUtils.js +19 -0
- package/lib/esm/relay/connectionUtils.js.map +1 -0
- package/lib/esm/relay/createInlineDataReader.js +2 -0
- package/lib/esm/relay/createInlineReader.js +7 -0
- package/lib/esm/relay/createInlineReader.js.map +1 -0
- package/lib/esm/relay/envHelpers.js +55 -0
- package/lib/esm/relay/envHelpers.js.map +1 -0
- package/lib/esm/{environment-DQfVyWHJ.js → relay/environment.js} +90 -100
- package/lib/esm/relay/environment.js.map +1 -0
- package/lib/esm/relay/identityView.js +6 -0
- package/lib/esm/relay/identityView.js.map +1 -0
- package/lib/esm/{mutationResult-C2Vb_vPt.js → relay/mutationResult.js} +2 -2
- package/lib/esm/relay/mutationResult.js.map +1 -0
- package/lib/esm/{useRelayEnvironment-vQ86aW-n.js → relay/useRelayEnvironment.js} +2 -2
- package/lib/esm/relay/useRelayEnvironment.js.map +1 -0
- package/lib/esm/{backofficeAuthPaths-2hHNn8D3.js → router/backofficeAuthPaths.js} +2 -2
- package/lib/esm/router/backofficeAuthPaths.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +322 -0
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -0
- package/lib/esm/storybook/relay/RelayStory.css.js +7 -0
- package/lib/esm/storybook/relay/RelayStory.css.js.map +1 -0
- package/lib/esm/storybook/relay/RelayStory.js +86 -0
- package/lib/esm/storybook/relay/RelayStory.js.map +1 -0
- package/lib/esm/storybook/relay/mockResolvers.js +99 -0
- package/lib/esm/storybook/relay/mockResolvers.js.map +1 -0
- package/lib/esm/storybook/relay/relay-test-utils.d.js +0 -0
- package/lib/esm/style.css +1 -1
- package/lib/esm/style.js +1 -0
- package/lib/esm/subscriptions/useCursorResumableSubscription.js +29 -0
- package/lib/esm/subscriptions/useCursorResumableSubscription.js.map +1 -0
- package/lib/types/auth/AuthRefreshNotice.d.ts +14 -0
- package/lib/types/auth/AuthRefreshNotice.d.ts.map +1 -0
- package/lib/types/auth/TotpQrCode.d.ts +17 -0
- package/lib/types/auth/TotpQrCode.d.ts.map +1 -0
- package/lib/types/auth/authRefreshNotice.css.d.ts +4 -0
- package/lib/types/auth/authRefreshNotice.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeAuditMetadataPanel.d.ts +19 -0
- package/lib/types/components/backoffice/detail/BackofficeAuditMetadataPanel.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeEntityRefLink.d.ts +15 -0
- package/lib/types/components/backoffice/detail/BackofficeEntityRefLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts +34 -0
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeEnumLabel.d.ts +9 -0
- package/lib/types/components/backoffice/detail/BackofficeEnumLabel.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeKpiStrip.d.ts +17 -0
- package/lib/types/components/backoffice/detail/BackofficeKpiStrip.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeLifecycleTimelineSection.d.ts +20 -0
- package/lib/types/components/backoffice/detail/BackofficeLifecycleTimelineSection.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficePayloadInspectorSection.d.ts +15 -0
- package/lib/types/components/backoffice/detail/BackofficePayloadInspectorSection.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts +9 -0
- package/lib/types/components/backoffice/detail/BackofficeReferenceValue.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts +17 -0
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeScopeStack.d.ts +13 -0
- package/lib/types/components/backoffice/detail/BackofficeScopeStack.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts +13 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusMetaBadge.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeTokenUsageBreakdown.d.ts +18 -0
- package/lib/types/components/backoffice/detail/BackofficeTokenUsageBreakdown.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts +31 -0
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeAuditMetadataPanel.css.d.ts +5 -0
- package/lib/types/components/backoffice/detail/backofficeAuditMetadataPanel.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeEntitySummaryHeader.css.d.ts +12 -0
- package/lib/types/components/backoffice/detail/backofficeEntitySummaryHeader.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeKpiStrip.css.d.ts +5 -0
- package/lib/types/components/backoffice/detail/backofficeKpiStrip.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeLifecycleTimelineSection.css.d.ts +3 -0
- package/lib/types/components/backoffice/detail/backofficeLifecycleTimelineSection.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficePayloadInspectorSection.css.d.ts +4 -0
- package/lib/types/components/backoffice/detail/backofficePayloadInspectorSection.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeReferenceValue.css.d.ts +3 -0
- package/lib/types/components/backoffice/detail/backofficeReferenceValue.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeRelationsSummaryGrid.css.d.ts +6 -0
- package/lib/types/components/backoffice/detail/backofficeRelationsSummaryGrid.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeScopeStack.css.d.ts +5 -0
- package/lib/types/components/backoffice/detail/backofficeScopeStack.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeStatusMetaBadge.css.d.ts +2 -0
- package/lib/types/components/backoffice/detail/backofficeStatusMetaBadge.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/backofficeUsageCostBreakdown.css.d.ts +7 -0
- package/lib/types/components/backoffice/detail/backofficeUsageCostBreakdown.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/createBackofficeEntityLinkProps.d.ts +30 -0
- package/lib/types/components/backoffice/detail/createBackofficeEntityLinkProps.d.ts.map +1 -0
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.stories.d.ts +12 -0
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/filters/EntityIdFilterField.stories.d.ts +12 -0
- package/lib/types/components/backoffice/filters/EntityIdFilterField.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/overview/BackofficeOverviewLayout.stories.d.ts +11 -0
- package/lib/types/components/backoffice/overview/BackofficeOverviewLayout.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/refs/BackofficeEntityLink.d.ts +15 -0
- package/lib/types/components/backoffice/refs/BackofficeEntityLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.stories.d.ts +11 -0
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/shared/BackofficeFormattedCurrency.d.ts +9 -0
- package/lib/types/components/backoffice/shared/BackofficeFormattedCurrency.d.ts.map +1 -0
- package/lib/types/components/backoffice/shared/BackofficeFormattedNumber.d.ts +9 -0
- package/lib/types/components/backoffice/shared/BackofficeFormattedNumber.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsDocPanel.d.ts +11 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsDocPanel.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts +8 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts +15 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsQueryBoundary.d.ts +7 -0
- package/lib/types/components/backoffice/tools/BackofficeToolsQueryBoundary.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts +8 -0
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/backofficeToolsForm.css.d.ts +7 -0
- package/lib/types/components/backoffice/tools/backofficeToolsForm.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/backofficeToolsJsonForm.css.d.ts +4 -0
- package/lib/types/components/backoffice/tools/backofficeToolsJsonForm.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/tools/parseToolJson.d.ts +2 -0
- package/lib/types/components/backoffice/tools/parseToolJson.d.ts.map +1 -0
- package/lib/types/hooks/useInfiniteConnection.d.ts +37 -0
- package/lib/types/hooks/useInfiniteConnection.d.ts.map +1 -0
- package/lib/types/i18n/resources.d.ts +54 -0
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +28 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/relay/connectionUtils.d.ts +10 -0
- package/lib/types/relay/connectionUtils.d.ts.map +1 -0
- package/lib/types/storybook/relay/RelayStory.css.d.ts +5 -0
- package/lib/types/storybook/relay/RelayStory.css.d.ts.map +1 -0
- package/lib/types/storybook/relay/RelayStory.d.ts +35 -0
- package/lib/types/storybook/relay/RelayStory.d.ts.map +1 -0
- package/lib/types/storybook/relay/mockResolvers.d.ts +3 -0
- package/lib/types/storybook/relay/mockResolvers.d.ts.map +1 -0
- package/lib/types/subscriptions/useCursorResumableSubscription.d.ts +16 -0
- package/lib/types/subscriptions/useCursorResumableSubscription.d.ts.map +1 -0
- package/package.json +24 -9
- package/lib/esm/AcceptInvitationScreen-VaWXQPHp.js.map +0 -1
- package/lib/esm/AuthPanel-BaIRFGbX.js.map +0 -1
- package/lib/esm/BackofficeAcceptInvitationPage-tpfBfhT9.js +0 -24
- package/lib/esm/BackofficeAcceptInvitationPage-tpfBfhT9.js.map +0 -1
- package/lib/esm/BackofficeDashboardPage-D5W36DY-.js +0 -329
- package/lib/esm/BackofficeDashboardPage-D5W36DY-.js.map +0 -1
- package/lib/esm/BackofficeDetailPayload-CZcsDv2w.js +0 -98
- package/lib/esm/BackofficeDetailPayload-CZcsDv2w.js.map +0 -1
- package/lib/esm/BackofficeEntityDetailLayoutContext-C5G-PH28.js.map +0 -1
- package/lib/esm/BackofficeEntityDetailLayoutPage-BSgGBzSL.js +0 -18
- package/lib/esm/BackofficeEntityDetailLayoutPage-BSgGBzSL.js.map +0 -1
- package/lib/esm/BackofficeEntityDetailPage-LB1uEJVM.js +0 -1061
- package/lib/esm/BackofficeEntityDetailPage-LB1uEJVM.js.map +0 -1
- package/lib/esm/BackofficeEntityDetailUnknownPageRedirect-Iu4R3WvX.js.map +0 -1
- package/lib/esm/BackofficeEntityListPage-D_zL-qRb.js +0 -432
- package/lib/esm/BackofficeEntityListPage-D_zL-qRb.js.map +0 -1
- package/lib/esm/BackofficeHubPage-DOePQ8Fc.js.map +0 -1
- package/lib/esm/BackofficeHubTemplate-C6K55egX.js +0 -82
- package/lib/esm/BackofficeHubTemplate-C6K55egX.js.map +0 -1
- package/lib/esm/BackofficeLayoutPage-Bq2bKkYF.js +0 -783
- package/lib/esm/BackofficeLayoutPage-Bq2bKkYF.js.map +0 -1
- package/lib/esm/BackofficeListToolbar-loFfIPtP.js +0 -109
- package/lib/esm/BackofficeListToolbar-loFfIPtP.js.map +0 -1
- package/lib/esm/BackofficeLoginPage-DIlcOueK.js +0 -46
- package/lib/esm/BackofficeLoginPage-DIlcOueK.js.map +0 -1
- package/lib/esm/BackofficePasswordResetCompletePage-Cit5sdDm.js.map +0 -1
- package/lib/esm/BackofficePasswordResetRequestPage-B_TurHev.js.map +0 -1
- package/lib/esm/BackofficeRightPageLayout-CfNkrMvH.js +0 -83
- package/lib/esm/BackofficeRightPageLayout-CfNkrMvH.js.map +0 -1
- package/lib/esm/BackofficeTopbarPortalContext-Da5XFatM.js.map +0 -1
- package/lib/esm/BackofficeVerifyEmailPage-DQbFIob1.js.map +0 -1
- package/lib/esm/EntityIdPickerDialog-BSn0v3bv.js +0 -340
- package/lib/esm/EntityIdPickerDialog-BSn0v3bv.js.map +0 -1
- package/lib/esm/LazyBackofficeEntityActionFormDialog-oRd_WHAK.js +0 -670
- package/lib/esm/LazyBackofficeEntityActionFormDialog-oRd_WHAK.js.map +0 -1
- package/lib/esm/PasswordResetCompleteScreen-Cgg96DPo.js.map +0 -1
- package/lib/esm/PasswordResetRequestScreen-I1nFvGLd.js.map +0 -1
- package/lib/esm/VerifyEmailScreen-Br5KyHjg.js.map +0 -1
- package/lib/esm/backoffice-react.js +0 -1925
- package/lib/esm/backoffice-react.js.map +0 -1
- package/lib/esm/backofficeAuthPaths-2hHNn8D3.js.map +0 -1
- package/lib/esm/buildBreadcrumbs-C5St167Y.js.map +0 -1
- package/lib/esm/environment-DQfVyWHJ.js.map +0 -1
- package/lib/esm/loginPage.css-B7Io_DuU.js +0 -6
- package/lib/esm/loginPage.css-B7Io_DuU.js.map +0 -1
- package/lib/esm/mutationResult-C2Vb_vPt.js.map +0 -1
- package/lib/esm/pageResolution-CUaTq4Ql.js.map +0 -1
- package/lib/esm/synchronizeAuthStatusQuery-DNJR5MfH.js +0 -323
- package/lib/esm/synchronizeAuthStatusQuery-DNJR5MfH.js.map +0 -1
- package/lib/esm/useAuth-CWf8ZspF.js +0 -548
- package/lib/esm/useAuth-CWf8ZspF.js.map +0 -1
- package/lib/esm/useBackofficeAuth-Da7FPNys.js +0 -89
- package/lib/esm/useBackofficeAuth-Da7FPNys.js.map +0 -1
- package/lib/esm/useBackofficeLazyValue-CW9xfRzQ.js.map +0 -1
- package/lib/esm/useBackofficeListUrlState-Ca6d7uIN.js.map +0 -1
- package/lib/esm/useBackofficeReactTranslation-Btt58EIo.js +0 -18
- package/lib/esm/useBackofficeReactTranslation-Btt58EIo.js.map +0 -1
- package/lib/esm/useRelayEnvironment-vQ86aW-n.js.map +0 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { buildEntityGroupLookup as e, resolveSidebarGroups as t, resolveSidebarHubEntries as n } from "../components/backoffice/layout/sidebarUtils.js";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import * as i from "react-relay";
|
|
4
|
+
import { HttpRedirect as a, getResourcePage as o, r as s } from "@plumile/router";
|
|
5
|
+
import { BACKOFFICE_LIST_DEFAULTS as c } from "@plumile/backoffice-core/constants.js";
|
|
6
|
+
//#region src/router/createBackofficeRoutes.tsx
|
|
7
|
+
var { loadQuery: l, usePreloadedQuery: u } = i, d = o("WrapperPage", async () => ({ default: (await import("@plumile/ui")).WrapperPage })), f = o("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), p = o("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), m = o("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), h = o("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), g = o("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), _ = o("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), v = o("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), y = o("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), b = o("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), x = o("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), S = o("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), C = o("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), w = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: i, activeGroupId: a }) => /* @__PURE__ */ r(t, {
|
|
8
|
+
permissionsQuery: i,
|
|
9
|
+
prepared: n?.permissionsQuery ?? null,
|
|
10
|
+
authStatus: null,
|
|
11
|
+
activeGroupId: a,
|
|
12
|
+
children: e
|
|
13
|
+
}), T = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: i, activeGroupId: o, authStatusQuery: s, authStatusPrepared: c, loginRedirectPath: l }) => {
|
|
14
|
+
let d = u(s, c);
|
|
15
|
+
if (d?.isLoggedIn !== !0) throw new a(l);
|
|
16
|
+
return /* @__PURE__ */ r(t, {
|
|
17
|
+
permissionsQuery: i,
|
|
18
|
+
prepared: n?.permissionsQuery ?? null,
|
|
19
|
+
authStatus: d,
|
|
20
|
+
activeGroupId: o,
|
|
21
|
+
children: e
|
|
22
|
+
});
|
|
23
|
+
}, E = (e) => {
|
|
24
|
+
let t = e.trim();
|
|
25
|
+
return t === "" || t === "/" ? "" : t.replace(/^\/+|\/+$/g, "");
|
|
26
|
+
}, D = (e) => {
|
|
27
|
+
let t = e.trim();
|
|
28
|
+
return t === "" ? "/" : `/${t}`.replace(/\/+/g, "/");
|
|
29
|
+
}, O = (e, t) => {
|
|
30
|
+
let n = t.replace(/^\/+|\/+$/g, "");
|
|
31
|
+
return e === "" ? n : n === "" ? e : `${e}/${n}`;
|
|
32
|
+
}, k = (e, t) => D(O(e, t)), A = (e, t) => {
|
|
33
|
+
let n = D(e), r = t === "" ? "" : `/${t}`;
|
|
34
|
+
return r !== "" && n.startsWith(r) ? n.slice(r.length).replace(/^\/+/, "") : n.replace(/^\/+/, "");
|
|
35
|
+
}, j = (e, t) => {
|
|
36
|
+
if (e?.routes == null) return null;
|
|
37
|
+
for (let n = e.routes.length - 1; n >= 0; --n) {
|
|
38
|
+
let r = e.routes[n];
|
|
39
|
+
if (r != null) {
|
|
40
|
+
let e = t.get(r);
|
|
41
|
+
if (e != null) return e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}, M = (e) => {
|
|
46
|
+
let t = new URLSearchParams();
|
|
47
|
+
return Object.entries(e).forEach(([e, n]) => {
|
|
48
|
+
if (n != null) {
|
|
49
|
+
if (Array.isArray(n)) {
|
|
50
|
+
n.forEach((n) => {
|
|
51
|
+
n != null && t.append(e, String(n));
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
t.set(e, String(n));
|
|
56
|
+
}
|
|
57
|
+
}), t;
|
|
58
|
+
}, N = s;
|
|
59
|
+
function P(i) {
|
|
60
|
+
let { basePath: o, entityManifest: s, entityRegistry: u, sidebar: D, auth: P, dashboard: F } = i, I = E(o), L = O(I, "login"), R = O(I, "login/reset"), z = O(I, "login/reset/complete"), B = O(I, "verify-email"), V = O(I, "accept-invitation"), H = k(I, "login"), U = t(s, D), W = n(U, D), G = e(U, D), K = /* @__PURE__ */ new Map();
|
|
61
|
+
G.forEach((e, t) => {
|
|
62
|
+
K.set(t, e.groupId);
|
|
63
|
+
});
|
|
64
|
+
let q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = D?.permissionsQuery, X = async ({ context: e }) => {
|
|
65
|
+
let t = await P.session.load();
|
|
66
|
+
return {
|
|
67
|
+
permissionsQuery: Y == null ? null : l(e.relayEnvironment, Y, {}),
|
|
68
|
+
authStatusQuery: t.authStatusQuery == null ? null : l(e.relayEnvironment, t.authStatusQuery, {}, { fetchPolicy: "network-only" })
|
|
69
|
+
};
|
|
70
|
+
}, Z = N({
|
|
71
|
+
path: "",
|
|
72
|
+
resourcePage: _,
|
|
73
|
+
prepare: async () => (F == null || await F.load(), null),
|
|
74
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
75
|
+
}), Q = N({
|
|
76
|
+
path: "dashboard",
|
|
77
|
+
resourcePage: _,
|
|
78
|
+
prepare: async () => (F == null || await F.load(), null),
|
|
79
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
80
|
+
}), ee = Object.values(s).filter((e) => e.kind === "list-detail"), te = W.map((e) => {
|
|
81
|
+
let t = N({
|
|
82
|
+
path: A(e.hub.href, I),
|
|
83
|
+
resourcePage: v,
|
|
84
|
+
prepare: () => ({
|
|
85
|
+
hubId: e.hub.id,
|
|
86
|
+
hub: e.hub
|
|
87
|
+
}),
|
|
88
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ r(t, { prepared: e })
|
|
89
|
+
});
|
|
90
|
+
return e.groupId != null && J.set(t, e.groupId), t;
|
|
91
|
+
}), ne = ee.map((e) => {
|
|
92
|
+
let t = e.routes.list, n = A(t, I), i = [];
|
|
93
|
+
if (e.hasList) {
|
|
94
|
+
let t = N({
|
|
95
|
+
path: "",
|
|
96
|
+
resourcePage: p,
|
|
97
|
+
prepareSearchBehavior: "path",
|
|
98
|
+
prepare: async ({ context: t, query: n }) => {
|
|
99
|
+
let { config: r } = await u.loadListEntity(e.id), { list: i, listUrlCodec: a, listDefaults: o } = r;
|
|
100
|
+
if (a == null || o == null) throw Error(`Backoffice entity ${e.id} does not expose a list configuration.`);
|
|
101
|
+
let s = M(n), d = a.parse(s), { pageSize: f } = c, p = {
|
|
102
|
+
where: d.where,
|
|
103
|
+
sort: d.sort ?? o.sort,
|
|
104
|
+
count: f,
|
|
105
|
+
cursor: null
|
|
106
|
+
}, m = i.buildQueryVariables(p), h = l(t.relayEnvironment, i.query, m);
|
|
107
|
+
return {
|
|
108
|
+
entityId: e.id,
|
|
109
|
+
entityManifest: e,
|
|
110
|
+
entityConfig: r,
|
|
111
|
+
query: h
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
render: ({ prepared: e, Component: t }) => {
|
|
115
|
+
if (t == null) return null;
|
|
116
|
+
let n = e;
|
|
117
|
+
return /* @__PURE__ */ r(t, {
|
|
118
|
+
entityManifest: n.entityManifest,
|
|
119
|
+
config: n.entityConfig,
|
|
120
|
+
prepared: n
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
q.set(t, e.id), i.push(t);
|
|
125
|
+
}
|
|
126
|
+
let o = N({
|
|
127
|
+
path: ":id",
|
|
128
|
+
resourcePage: h,
|
|
129
|
+
prepare: async ({ context: t, variables: n }) => {
|
|
130
|
+
let { config: r } = await u.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o = l(t.relayEnvironment, r.layoutPage.query, a.variables);
|
|
131
|
+
return {
|
|
132
|
+
entityId: e.id,
|
|
133
|
+
entityManifest: e,
|
|
134
|
+
entityConfig: r,
|
|
135
|
+
layoutQuery: o,
|
|
136
|
+
id: i
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
render: ({ children: e, prepared: t, Component: n }) => {
|
|
140
|
+
if (n == null) return null;
|
|
141
|
+
let i = t;
|
|
142
|
+
return /* @__PURE__ */ r(n, {
|
|
143
|
+
entityManifest: i.entityManifest,
|
|
144
|
+
config: i.entityConfig,
|
|
145
|
+
prepared: i,
|
|
146
|
+
children: e
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
children: [
|
|
150
|
+
N({
|
|
151
|
+
path: "",
|
|
152
|
+
resourcePage: d,
|
|
153
|
+
prepare: ({ variables: t }) => {
|
|
154
|
+
let n = String(t.id ?? "").trim();
|
|
155
|
+
return { redirectTo: n === "" ? null : e.routes.detailPage(n, e.defaultDetailPageId ?? "overview") };
|
|
156
|
+
},
|
|
157
|
+
render: ({ prepared: e }) => {
|
|
158
|
+
let t = e.redirectTo ?? null;
|
|
159
|
+
if (t == null) return null;
|
|
160
|
+
throw new a(t);
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
...(e.detailPages ?? []).map((t) => N({
|
|
164
|
+
path: t.pathSegment,
|
|
165
|
+
resourcePage: m,
|
|
166
|
+
prepare: async ({ context: n, variables: r }) => {
|
|
167
|
+
let i = String(r.id ?? ""), a = await u.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s = l(n.relayEnvironment, a.config.page.query, o.variables);
|
|
168
|
+
return {
|
|
169
|
+
entityId: e.id,
|
|
170
|
+
entityManifest: e,
|
|
171
|
+
entityConfig: a.config,
|
|
172
|
+
detailId: o.detailId,
|
|
173
|
+
id: i,
|
|
174
|
+
pageConfig: a.config,
|
|
175
|
+
pageQuery: s,
|
|
176
|
+
pageId: t.id,
|
|
177
|
+
pagePath: t.pathSegment
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
render: ({ prepared: e, Component: t }) => {
|
|
181
|
+
if (t == null) return null;
|
|
182
|
+
let n = e;
|
|
183
|
+
return /* @__PURE__ */ r(t, {
|
|
184
|
+
entityManifest: n.entityManifest,
|
|
185
|
+
config: n.entityConfig,
|
|
186
|
+
prepared: n
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
})),
|
|
190
|
+
N({
|
|
191
|
+
path: ":pagePath",
|
|
192
|
+
resourcePage: g,
|
|
193
|
+
prepare: async ({ variables: t }) => {
|
|
194
|
+
let n = await u.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
|
|
195
|
+
return {
|
|
196
|
+
entityManifest: e,
|
|
197
|
+
entityConfig: n.config,
|
|
198
|
+
id: r,
|
|
199
|
+
pagePath: i
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
render: ({ prepared: e, Component: t }) => {
|
|
203
|
+
if (t == null) return null;
|
|
204
|
+
let n = e;
|
|
205
|
+
return /* @__PURE__ */ r(t, {
|
|
206
|
+
entityManifest: n.entityManifest,
|
|
207
|
+
config: n.entityConfig,
|
|
208
|
+
prepared: n
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
return q.set(o, e.id), i.push(o), N({
|
|
215
|
+
path: n,
|
|
216
|
+
children: i,
|
|
217
|
+
resourcePage: d
|
|
218
|
+
});
|
|
219
|
+
}), re = Object.values(s).filter((e) => e.kind === "tool").map((e) => {
|
|
220
|
+
let t = N({
|
|
221
|
+
path: A(e.routes.list, I),
|
|
222
|
+
resourcePage: i.toolsOperationPage ?? null,
|
|
223
|
+
prepare: async () => {
|
|
224
|
+
let t = await u.loadToolEntity(e.id);
|
|
225
|
+
return {
|
|
226
|
+
entityId: e.id,
|
|
227
|
+
entityManifest: e,
|
|
228
|
+
entityConfig: t.config
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
render: ({ prepared: e, Component: t }) => {
|
|
232
|
+
if (t == null) return null;
|
|
233
|
+
let n = e;
|
|
234
|
+
return /* @__PURE__ */ r(t, {
|
|
235
|
+
entityManifest: n.entityManifest,
|
|
236
|
+
operation: n.entityConfig.tool.operation,
|
|
237
|
+
toolId: n.entityConfig.id
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
return q.set(t, e.id), t;
|
|
242
|
+
}), ie = N({
|
|
243
|
+
path: I,
|
|
244
|
+
resourcePage: f,
|
|
245
|
+
prepareSearchBehavior: "path",
|
|
246
|
+
prepare: X,
|
|
247
|
+
render: ({ children: e, prepared: t, route: n, Component: i }) => {
|
|
248
|
+
if (i == null) return null;
|
|
249
|
+
let a = t, o = j(n, q), s = o == null ? j(n, J) : K.get(o) ?? null, c = i, l = P.session.get()?.authStatusQuery ?? null;
|
|
250
|
+
return l != null && a?.authStatusQuery != null ? /* @__PURE__ */ r(T, {
|
|
251
|
+
Component: c,
|
|
252
|
+
preparedLayout: a,
|
|
253
|
+
permissionsQuery: D?.permissionsQuery,
|
|
254
|
+
activeGroupId: s,
|
|
255
|
+
authStatusQuery: l,
|
|
256
|
+
authStatusPrepared: a.authStatusQuery,
|
|
257
|
+
loginRedirectPath: H,
|
|
258
|
+
children: e
|
|
259
|
+
}) : /* @__PURE__ */ r(w, {
|
|
260
|
+
Component: c,
|
|
261
|
+
preparedLayout: a,
|
|
262
|
+
permissionsQuery: D?.permissionsQuery,
|
|
263
|
+
activeGroupId: s,
|
|
264
|
+
children: e
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
children: [
|
|
268
|
+
Z,
|
|
269
|
+
...te,
|
|
270
|
+
...ne,
|
|
271
|
+
...re,
|
|
272
|
+
Q
|
|
273
|
+
]
|
|
274
|
+
}), $ = [
|
|
275
|
+
N({
|
|
276
|
+
path: L,
|
|
277
|
+
resourcePage: y,
|
|
278
|
+
prepare: async ({ context: e }) => {
|
|
279
|
+
let t = await P.login.load();
|
|
280
|
+
return { query: l(e.relayEnvironment, t.loginQuery, {}) };
|
|
281
|
+
},
|
|
282
|
+
render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ r(t, { prepared: e })
|
|
283
|
+
}),
|
|
284
|
+
N({
|
|
285
|
+
path: R,
|
|
286
|
+
resourcePage: b,
|
|
287
|
+
prepare: async () => (await P.passwordResetRequest.load(), null),
|
|
288
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
289
|
+
}),
|
|
290
|
+
N({
|
|
291
|
+
path: z,
|
|
292
|
+
resourcePage: x,
|
|
293
|
+
prepare: async () => (await P.passwordResetComplete.load(), null),
|
|
294
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
295
|
+
}),
|
|
296
|
+
N({
|
|
297
|
+
path: B,
|
|
298
|
+
resourcePage: S,
|
|
299
|
+
prepare: async () => (await P.verifyEmail.load(), null),
|
|
300
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
301
|
+
})
|
|
302
|
+
];
|
|
303
|
+
return (P.hasAcceptInvitation === !0 || P.acceptInvitation != null) && $.push(N({
|
|
304
|
+
path: V,
|
|
305
|
+
resourcePage: C,
|
|
306
|
+
prepare: async () => (await P.acceptInvitation?.load(), null),
|
|
307
|
+
render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ r(e, {})
|
|
308
|
+
})), $.push(ie), $;
|
|
309
|
+
}
|
|
310
|
+
var F = {
|
|
311
|
+
normalizeBaseSegment: E,
|
|
312
|
+
normalizePath: D,
|
|
313
|
+
buildScopedPath: O,
|
|
314
|
+
buildScopedAbsolutePath: k,
|
|
315
|
+
buildRelativePath: A,
|
|
316
|
+
resolveActiveEntityIdFromRoute: j,
|
|
317
|
+
toSearchParams: M
|
|
318
|
+
};
|
|
319
|
+
//#endregion
|
|
320
|
+
export { C as BackofficeAcceptInvitationPageResource, _ as BackofficeDashboardPageResource, h as BackofficeEntityDetailLayoutPageResource, m as BackofficeEntityDetailPageResource, g as BackofficeEntityDetailUnknownPageRedirectResource, p as BackofficeEntityListPageResource, v as BackofficeHubPageResource, f as BackofficeLayoutPageResource, y as BackofficeLoginPageResource, x as BackofficePasswordResetCompletePageResource, b as BackofficePasswordResetRequestPageResource, S as BackofficeVerifyEmailPageResource, d as WrapperPageResource, F as __test, P as createBackofficeRoutes, P as default };
|
|
321
|
+
|
|
322
|
+
//# sourceMappingURL=createBackofficeRoutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBackofficeRoutes.js","names":[],"sources":["../../../src/router/createBackofficeRoutes.tsx"],"sourcesContent":["/* eslint-disable no-ternary */\nimport { type ComponentType, type JSX, type ReactNode } from 'react';\nimport {\n getResourcePage,\n HttpRedirect,\n r,\n type AnyRoute,\n type ResourcePage,\n type Route,\n} from '@plumile/router';\nimport * as ReactRelay from 'react-relay';\nimport type { PreloadedQuery } from 'react-relay';\nimport type {\n Environment,\n GraphQLTaggedNode,\n OperationType,\n} from 'relay-runtime';\n\nimport { BACKOFFICE_LIST_DEFAULTS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeEntityManifestMap,\n BackofficePreparedDetailLayoutRoute,\n BackofficePreparedDetailPageRoute,\n BackofficePreparedListRoute,\n BackofficePreparedToolRoute,\n BackofficeResolvedDetailLayoutFacetConfigBase,\n} from '@plumile/backoffice-core/types.js';\n\nimport type {\n BackofficeAuthConfig,\n BackofficeDashboardModule,\n BackofficeResolvedSidebarHubConfig,\n BackofficeSidebarConfig,\n} from '../provider/types.js';\nimport {\n buildEntityGroupLookup,\n resolveSidebarHubEntries,\n resolveSidebarGroups,\n} from '../components/backoffice/layout/sidebarUtils.js';\nimport type { BackofficeEntityRegistry } from '../provider/entityRegistry.js';\n\nconst { loadQuery, usePreloadedQuery } = ReactRelay;\n\nexport type CreateBackofficeRoutesInput = {\n basePath: string;\n entityManifest: BackofficeEntityManifestMap;\n entityRegistry: BackofficeEntityRegistry;\n sidebar?: BackofficeSidebarConfig;\n auth: BackofficeAuthConfig;\n dashboard?: BackofficeDashboardModule;\n toolsOperationPage?: ResourcePage | null;\n};\n\nexport type BackofficeRouterContext = {\n relayEnvironment: Environment;\n};\n\nexport const WrapperPageResource: ResourcePage | null = getResourcePage(\n 'WrapperPage',\n // eslint-disable-next-line arrow-body-style\n async () => ({\n default: (await import('@plumile/ui')).WrapperPage,\n }),\n);\n\nexport const BackofficeLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLayoutPage.js'),\n );\n\nexport const BackofficeEntityListPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityListPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityListPage.js'),\n );\n\nexport const BackofficeEntityDetailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailPage.js'),\n );\n\nexport const BackofficeEntityDetailLayoutPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailLayoutPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailLayoutPage.js'),\n );\n\nexport const BackofficeEntityDetailUnknownPageRedirectResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeEntityDetailUnknownPageRedirect',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeEntityDetailUnknownPageRedirect.js'),\n );\n\nexport const BackofficeDashboardPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeDashboardPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeDashboardPage.js'),\n );\n\nexport const BackofficeHubPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeHubPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeHubPage.js'),\n);\n\nexport const BackofficeLoginPageResource: ResourcePage | null = getResourcePage(\n 'BackofficeLoginPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeLoginPage.js'),\n);\n\nexport const BackofficePasswordResetRequestPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetRequestPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetRequestPage.js'),\n );\n\nexport const BackofficePasswordResetCompletePageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficePasswordResetCompletePage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficePasswordResetCompletePage.js'),\n );\n\nexport const BackofficeVerifyEmailPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeVerifyEmailPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeVerifyEmailPage.js'),\n );\n\nexport const BackofficeAcceptInvitationPageResource: ResourcePage | null =\n getResourcePage(\n 'BackofficeAcceptInvitationPage',\n // eslint-disable-next-line arrow-body-style\n async () => import('../pages/BackofficeAcceptInvitationPage.js'),\n );\n\ntype PreparedDetailUnknownPage = {\n id: string;\n pagePath: string;\n entityManifest: BackofficeEntityManifestMap[string];\n entityConfig: BackofficeResolvedDetailLayoutFacetConfigBase;\n};\n\ntype PreparedLayout = {\n permissionsQuery: PreloadedQuery<OperationType> | null;\n authStatusQuery: PreloadedQuery<OperationType> | null;\n};\n\ntype LayoutAuthStatus = {\n isLoggedIn?: boolean | null;\n me?: {\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n initials: string;\n } | null;\n} | null;\n\ntype LayoutRouteComponent = ComponentType<{\n children: ReactNode;\n permissionsQuery?: GraphQLTaggedNode;\n prepared?: PreloadedQuery<OperationType> | null;\n authStatus?: LayoutAuthStatus;\n activeGroupId?: string | null;\n}>;\n\ntype LayoutRouteRenderProps = {\n children: ReactNode;\n Component: LayoutRouteComponent;\n preparedLayout: PreparedLayout | undefined;\n permissionsQuery: GraphQLTaggedNode | undefined;\n activeGroupId: string | null;\n};\n\nconst BackofficeLayoutRouteWithoutAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n}: LayoutRouteRenderProps): JSX.Element => {\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={null}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nconst BackofficeLayoutRouteWithAuthStatus = ({\n children,\n Component,\n preparedLayout,\n permissionsQuery,\n activeGroupId,\n authStatusQuery,\n authStatusPrepared,\n loginRedirectPath,\n}: LayoutRouteRenderProps & {\n authStatusQuery: GraphQLTaggedNode;\n authStatusPrepared: PreloadedQuery<OperationType>;\n loginRedirectPath: string;\n}): JSX.Element => {\n const data = usePreloadedQuery(authStatusQuery, authStatusPrepared);\n const authStatus = data as LayoutAuthStatus;\n\n if (authStatus?.isLoggedIn !== true) {\n throw new HttpRedirect(loginRedirectPath);\n }\n\n return (\n <Component\n permissionsQuery={permissionsQuery}\n prepared={preparedLayout?.permissionsQuery ?? null}\n authStatus={authStatus}\n activeGroupId={activeGroupId}\n >\n {children}\n </Component>\n );\n};\n\nexport type BackofficePreparedHubRoute = {\n hubId: string;\n hub: BackofficeResolvedSidebarHubConfig;\n};\n\nconst normalizeBaseSegment = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '' || trimmed === '/') {\n return '';\n }\n return trimmed.replace(/^\\/+|\\/+$/g, '');\n};\n\nconst normalizePath = (value: string): string => {\n const trimmed = value.trim();\n if (trimmed === '') {\n return '/';\n }\n return `/${trimmed}`.replace(/\\/+/g, '/');\n};\n\nconst buildScopedPath = (baseSegment: string, path: string): string => {\n const normalizedPath = path.replace(/^\\/+|\\/+$/g, '');\n if (baseSegment === '') {\n return normalizedPath;\n }\n if (normalizedPath === '') {\n return baseSegment;\n }\n return `${baseSegment}/${normalizedPath}`;\n};\n\nconst buildScopedAbsolutePath = (baseSegment: string, path: string): string => {\n return normalizePath(buildScopedPath(baseSegment, path));\n};\n\nconst buildRelativePath = (\n absolutePath: string,\n baseSegment: string,\n): string => {\n const normalized = normalizePath(absolutePath);\n const basePrefix = baseSegment === '' ? '' : `/${baseSegment}`;\n if (basePrefix !== '' && normalized.startsWith(basePrefix)) {\n return normalized.slice(basePrefix.length).replace(/^\\/+/, '');\n }\n return normalized.replace(/^\\/+/, '');\n};\n\nconst resolveActiveEntityIdFromRoute = (\n route: { routes: AnyRoute[] } | null,\n routeEntityIdMap: WeakMap<AnyRoute, string>,\n): string | null => {\n if (route?.routes == null) {\n return null;\n }\n for (let index = route.routes.length - 1; index >= 0; index -= 1) {\n const routeEntry = route.routes[index];\n if (routeEntry != null) {\n const entityId = routeEntityIdMap.get(routeEntry);\n if (entityId != null) {\n return entityId;\n }\n }\n }\n return null;\n};\n\nconst toSearchParams = (query: Record<string, unknown>): URLSearchParams => {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value == null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => {\n if (entry == null) {\n return;\n }\n params.append(key, String(entry));\n });\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n params.set(key, String(value));\n });\n return params;\n};\n\nconst rBackoffice = r<BackofficeRouterContext>;\n\n/**\n * Creates backoffice routes based on the provided configuration\n */\nexport function createBackofficeRoutes(\n input: CreateBackofficeRoutesInput,\n): Route<BackofficeRouterContext, any>[] {\n const { basePath, entityManifest, entityRegistry, sidebar, auth, dashboard } =\n input;\n const baseSegment = normalizeBaseSegment(basePath);\n const loginPath = buildScopedPath(baseSegment, 'login');\n const passwordResetRequestPath = buildScopedPath(baseSegment, 'login/reset');\n const passwordResetCompletePath = buildScopedPath(\n baseSegment,\n 'login/reset/complete',\n );\n const verifyEmailPath = buildScopedPath(baseSegment, 'verify-email');\n const acceptInvitationPath = buildScopedPath(\n baseSegment,\n 'accept-invitation',\n );\n const loginRedirectPath = buildScopedAbsolutePath(baseSegment, 'login');\n const entities = entityManifest;\n const groups = resolveSidebarGroups(entities, sidebar);\n const hubEntries = resolveSidebarHubEntries(groups, sidebar);\n const entityGroupLookup = buildEntityGroupLookup(groups, sidebar);\n const entityIdToGroupId = new Map<string, string>();\n entityGroupLookup.forEach((value, entityId) => {\n entityIdToGroupId.set(entityId, value.groupId);\n });\n const routeEntityIdMap = new WeakMap<AnyRoute, string>();\n const routeGroupIdMap = new WeakMap<AnyRoute, string>();\n\n const permissionsQuery = sidebar?.permissionsQuery;\n const layoutPrepare = async ({\n context,\n }: {\n context: BackofficeRouterContext;\n }) => {\n const sessionAuth = await auth.session.load();\n const permissionsQueryRef =\n permissionsQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n permissionsQuery,\n {},\n )\n : null;\n const authStatusQueryRef =\n sessionAuth.authStatusQuery != null\n ? loadQuery<OperationType>(\n context.relayEnvironment,\n sessionAuth.authStatusQuery,\n {},\n { fetchPolicy: 'network-only' },\n )\n : null;\n return {\n permissionsQuery: permissionsQueryRef,\n authStatusQuery: authStatusQueryRef,\n };\n };\n\n const dashboardRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n const dashboardAliasRoute = rBackoffice({\n path: 'dashboard',\n resourcePage: BackofficeDashboardPageResource,\n prepare: async () => {\n if (dashboard == null) {\n return null;\n }\n await dashboard.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n });\n\n const listEntityEntries = Object.values(entityManifest).filter((entity) => {\n return entity.kind === 'list-detail';\n });\n\n const hubRoutes = hubEntries.map((entry) => {\n const hubRelative = buildRelativePath(entry.hub.href, baseSegment);\n const hubRoute = rBackoffice({\n path: hubRelative,\n resourcePage: BackofficeHubPageResource,\n prepare: () => {\n return {\n hubId: entry.hub.id,\n hub: entry.hub,\n } satisfies BackofficePreparedHubRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n });\n if (entry.groupId != null) {\n routeGroupIdMap.set(hubRoute, entry.groupId);\n }\n return hubRoute;\n });\n\n const entityRoutes = listEntityEntries.map((entityManifestItem) => {\n const listPath = entityManifestItem.routes.list;\n const listRelative = buildRelativePath(listPath, baseSegment);\n const children: Route<any, any>[] = [];\n\n if (entityManifestItem.hasList) {\n const listRoute = rBackoffice({\n path: '',\n resourcePage: BackofficeEntityListPageResource,\n prepareSearchBehavior: 'path',\n prepare: async ({ context, query }) => {\n const entityModule = await entityRegistry.loadListEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const { list, listUrlCodec, listDefaults } = config;\n if (listUrlCodec == null || listDefaults == null) {\n throw new Error(\n `Backoffice entity ${entityManifestItem.id} does not expose a list configuration.`,\n );\n }\n const params = toSearchParams(query);\n const state = listUrlCodec.parse(params);\n const { pageSize } = BACKOFFICE_LIST_DEFAULTS;\n const variablesBase = {\n where: state.where,\n sort: state.sort ?? listDefaults.sort,\n count: pageSize,\n cursor: null,\n };\n const variables = list.buildQueryVariables(variablesBase);\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n list.query,\n variables,\n );\n const prepared: BackofficePreparedListRoute = {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n query: queryRef,\n };\n return prepared;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedListRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n routeEntityIdMap.set(listRoute, entityManifestItem.id);\n children.push(listRoute);\n }\n\n const detailLayoutRoute = rBackoffice({\n path: ':id',\n resourcePage: BackofficeEntityDetailLayoutPageResource,\n prepare: async ({ context, variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const { config } = entityModule;\n const rawId = String(variables.id ?? '');\n const layoutBuildResult =\n config.layoutPage.buildVariables != null\n ? config.layoutPage.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const layoutQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n config.layoutPage.query,\n layoutBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig: config,\n layoutQuery: layoutQueryRef,\n id: rawId,\n } satisfies BackofficePreparedDetailLayoutRoute;\n },\n render: ({ children: detailChildren, prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute = prepared as BackofficePreparedDetailLayoutRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n >\n {detailChildren}\n </Component>\n );\n },\n children: [\n rBackoffice({\n path: '',\n resourcePage: WrapperPageResource,\n prepare: ({ variables }) => {\n const rawId = String(variables.id ?? '').trim();\n return {\n redirectTo:\n rawId === ''\n ? null\n : entityManifestItem.routes.detailPage(\n rawId,\n entityManifestItem.defaultDetailPageId ?? 'overview',\n ),\n };\n },\n render: ({ prepared }) => {\n const redirectTo =\n (prepared as { redirectTo?: string | null }).redirectTo ?? null;\n if (redirectTo == null) {\n return null;\n }\n throw new HttpRedirect(redirectTo);\n },\n }),\n ...(entityManifestItem.detailPages ?? []).map((pageManifest) => {\n return rBackoffice({\n path: pageManifest.pathSegment,\n resourcePage: BackofficeEntityDetailPageResource,\n prepare: async ({ context, variables }) => {\n const rawId = String(variables.id ?? '');\n const pageModule = await entityRegistry.loadDetailPageEntity(\n entityManifestItem.id,\n pageManifest.id,\n );\n const pageBuildResult =\n pageModule.config.page.buildVariables != null\n ? pageModule.config.page.buildVariables({\n id: rawId,\n })\n : { variables: { id: rawId } };\n const pageQueryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n pageModule.config.page.query,\n pageBuildResult.variables as never,\n );\n return {\n entityId: entityManifestItem.id,\n entityManifest: entityManifestItem,\n entityConfig:\n pageModule.config as unknown as BackofficeResolvedDetailLayoutFacetConfigBase,\n detailId: pageBuildResult.detailId,\n id: rawId,\n pageConfig: pageModule.config,\n pageQuery: pageQueryRef,\n pageId: pageManifest.id,\n pagePath: pageManifest.pathSegment,\n } satisfies BackofficePreparedDetailPageRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedRoute =\n prepared as BackofficePreparedDetailPageRoute;\n return (\n <Component\n entityManifest={preparedRoute.entityManifest}\n config={preparedRoute.entityConfig}\n prepared={preparedRoute}\n />\n );\n },\n });\n }),\n rBackoffice({\n path: ':pagePath',\n resourcePage: BackofficeEntityDetailUnknownPageRedirectResource,\n prepare: async ({ variables }) => {\n const entityModule = await entityRegistry.loadDetailLayoutEntity(\n entityManifestItem.id,\n );\n const rawId = String(variables.id ?? '');\n const rawPagePath = String(variables.pagePath ?? '');\n return {\n entityManifest: entityManifestItem,\n entityConfig: entityModule.config,\n id: rawId,\n pagePath: rawPagePath,\n };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedDetail = prepared as PreparedDetailUnknownPage;\n return (\n <Component\n entityManifest={preparedDetail.entityManifest}\n config={preparedDetail.entityConfig}\n prepared={preparedDetail}\n />\n );\n },\n }),\n ],\n });\n routeEntityIdMap.set(detailLayoutRoute, entityManifestItem.id);\n children.push(detailLayoutRoute);\n\n return rBackoffice({\n path: listRelative,\n children,\n resourcePage: WrapperPageResource,\n });\n });\n\n const toolsRoutes = Object.values(entityManifest)\n .filter((entity) => {\n return entity.kind === 'tool';\n })\n .map((toolManifest) => {\n const toolRelative = buildRelativePath(\n toolManifest.routes.list,\n baseSegment,\n );\n const toolRoute = rBackoffice({\n path: toolRelative,\n resourcePage: input.toolsOperationPage ?? null,\n prepare: async () => {\n const toolModule = await entityRegistry.loadToolEntity(\n toolManifest.id,\n );\n return {\n entityId: toolManifest.id,\n entityManifest: toolManifest,\n entityConfig: toolModule.config,\n } satisfies BackofficePreparedToolRoute;\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedTool = prepared as BackofficePreparedToolRoute;\n return (\n <Component\n entityManifest={preparedTool.entityManifest}\n operation={preparedTool.entityConfig.tool.operation}\n toolId={preparedTool.entityConfig.id}\n />\n );\n },\n });\n routeEntityIdMap.set(toolRoute, toolManifest.id);\n return toolRoute;\n });\n\n const layoutRoute = rBackoffice({\n path: baseSegment,\n resourcePage: BackofficeLayoutPageResource,\n prepareSearchBehavior: 'path',\n prepare: layoutPrepare,\n render: ({ children, prepared, route, Component }) => {\n if (Component == null) {\n return null;\n }\n const preparedLayout = prepared as PreparedLayout | undefined;\n const activeEntityId = resolveActiveEntityIdFromRoute(\n route,\n routeEntityIdMap,\n );\n const activeGroupId =\n activeEntityId != null\n ? (entityIdToGroupId.get(activeEntityId) ?? null)\n : resolveActiveEntityIdFromRoute(route, routeGroupIdMap);\n const LayoutComponent = Component as LayoutRouteComponent;\n const authStatusQuery = auth.session.get()?.authStatusQuery ?? null;\n if (authStatusQuery != null && preparedLayout?.authStatusQuery != null) {\n return (\n <BackofficeLayoutRouteWithAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n authStatusQuery={authStatusQuery}\n authStatusPrepared={preparedLayout.authStatusQuery}\n loginRedirectPath={loginRedirectPath}\n >\n {children}\n </BackofficeLayoutRouteWithAuthStatus>\n );\n }\n return (\n <BackofficeLayoutRouteWithoutAuthStatus\n Component={LayoutComponent}\n preparedLayout={preparedLayout}\n permissionsQuery={sidebar?.permissionsQuery}\n activeGroupId={activeGroupId}\n >\n {children}\n </BackofficeLayoutRouteWithoutAuthStatus>\n );\n },\n children: [\n dashboardRoute,\n ...hubRoutes,\n ...entityRoutes,\n ...toolsRoutes,\n dashboardAliasRoute,\n ],\n });\n\n const routes: Route<BackofficeRouterContext, any>[] = [\n rBackoffice({\n path: loginPath,\n resourcePage: BackofficeLoginPageResource,\n prepare: async ({ context }) => {\n const loginAuth = await auth.login.load();\n const queryRef = loadQuery<OperationType>(\n context.relayEnvironment,\n loginAuth.loginQuery,\n {},\n );\n return { query: queryRef };\n },\n render: ({ prepared, Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component prepared={prepared} />;\n },\n }),\n rBackoffice({\n path: passwordResetRequestPath,\n resourcePage: BackofficePasswordResetRequestPageResource,\n prepare: async () => {\n await auth.passwordResetRequest.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: passwordResetCompletePath,\n resourcePage: BackofficePasswordResetCompletePageResource,\n prepare: async () => {\n await auth.passwordResetComplete.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n rBackoffice({\n path: verifyEmailPath,\n resourcePage: BackofficeVerifyEmailPageResource,\n prepare: async () => {\n await auth.verifyEmail.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n ];\n\n if (auth.hasAcceptInvitation === true || auth.acceptInvitation != null) {\n routes.push(\n rBackoffice({\n path: acceptInvitationPath,\n resourcePage: BackofficeAcceptInvitationPageResource,\n prepare: async () => {\n await auth.acceptInvitation?.load();\n return null;\n },\n render: ({ Component }) => {\n if (Component == null) {\n return null;\n }\n return <Component />;\n },\n }),\n );\n }\n\n routes.push(layoutRoute);\n\n return routes;\n}\n\nexport const __test = {\n normalizeBaseSegment,\n normalizePath,\n buildScopedPath,\n buildScopedAbsolutePath,\n buildRelativePath,\n resolveActiveEntityIdFromRoute,\n toSearchParams,\n} as const;\n\nexport default createBackofficeRoutes;\n"],"mappings":";;;;;;AAyCA,IAAM,EAAE,WAAA,GAAW,mBAAA,MAAsB,GAgB5B,IAA2C,EACtD,eAEA,aAAa,EACX,UAAU,MAAM,OAAO,gBAAgB,aACxC,EACF,EAEY,IACX,EACE,wBAEA,YAAY,OAAO,oCACpB,EAEU,IACX,EACE,4BAEA,YAAY,OAAO,wCACpB,EAEU,IACX,EACE,8BAEA,YAAY,OAAO,0CACpB,EAEU,IACX,EACE,oCAEA,YAAY,OAAO,gDACpB,EAEU,IACX,EACE,6CAEA,YAAY,OAAO,yDACpB,EAEU,IACX,EACE,2BAEA,YAAY,OAAO,uCACpB,EAEU,IAAiD,EAC5D,qBAEA,YAAY,OAAO,iCACpB,EAEY,IAAmD,EAC9D,uBAEA,YAAY,OAAO,mCACpB,EAEY,IACX,EACE,sCAEA,YAAY,OAAO,kDACpB,EAEU,IACX,EACE,uCAEA,YAAY,OAAO,mDACpB,EAEU,IACX,EACE,6BAEA,YAAY,OAAO,yCACpB,EAEU,IACX,EACE,kCAEA,YAAY,OAAO,8CACpB,EAyCG,KAA0C,EAC9C,aACA,cACA,mBACA,qBAC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AAM,EAAK,kBAAkB,MAAM,EAC5B;EAET,SAAS,EAAE,mBACL,KAAa,OACR,OAEF,kBAAC,GAAD,EAAa,CAAA;EAEvB,CAAC,CACH,EAGH,EAAO,KAAK,GAAY,EAEjB;;AAGT,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
//#region src/storybook/relay/RelayStory.css.ts
|
|
3
|
+
var e = "txvbqblbg", t = "txvbqbamp", n = "txvbqb8p txvbqbvc5", r = "txvbqbhy7";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { r as errorAction, e as errorContainer, n as errorMessage, t as errorTitle };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=RelayStory.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelayStory.css.js","names":[],"sources":["../../../../src/storybook/relay/RelayStory.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui';\n\nexport const errorContainer = sprinkles({\n padding: 4,\n});\n\nexport const errorTitle = sprinkles({\n fontWeight: 'semibold',\n});\n\nexport const errorMessage = sprinkles({\n fontSize: 'xs',\n opacity: 70,\n});\n\nexport const errorAction = sprinkles({\n marginTop: 2,\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BackofficeErrorBoundary as e } from "../../components/backoffice/errors/BackofficeErrorBoundary.js";
|
|
2
|
+
import { errorAction as t, errorContainer as n, errorMessage as r, errorTitle as i } from "./RelayStory.css.js";
|
|
3
|
+
import { require_relay_test_utils as a } from "../../node_modules/relay-test-utils/index.js";
|
|
4
|
+
import { createBackofficeMockResolvers as o } from "./mockResolvers.js";
|
|
5
|
+
import { Suspense as s } from "react";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { RelayEnvironmentProvider as d, loadQuery as f, useLazyLoadQuery as p } from "react-relay";
|
|
8
|
+
//#region src/storybook/relay/RelayStory.tsx
|
|
9
|
+
var m = a(), h = ({ nodeType: e, mockResolvers: t }) => {
|
|
10
|
+
let n = {
|
|
11
|
+
...o(),
|
|
12
|
+
...t ?? {}
|
|
13
|
+
};
|
|
14
|
+
return e != null && (n.Node = () => ({ __typename: e })), n;
|
|
15
|
+
}, g = ({ error: e, reset: a }) => {
|
|
16
|
+
let o = "Unknown error";
|
|
17
|
+
return o = e instanceof Error ? e.message : String(e), /* @__PURE__ */ u("div", {
|
|
18
|
+
className: n,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ l("div", {
|
|
21
|
+
className: i,
|
|
22
|
+
children: "Unable to render story"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ l("div", {
|
|
25
|
+
className: r,
|
|
26
|
+
children: o
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ l("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
onClick: () => {
|
|
31
|
+
a();
|
|
32
|
+
},
|
|
33
|
+
className: t,
|
|
34
|
+
children: "Retry"
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}, _ = ({ query: e, variables: t, render: n }) => /* @__PURE__ */ l(c, { children: n(p(e, t)) }), v = (t) => {
|
|
39
|
+
let n = (0, m.createMockEnvironment)(), r = h(t);
|
|
40
|
+
return n.mock.queueOperationResolver((e) => r == null ? m.MockPayloadGenerator.generate(e) : m.MockPayloadGenerator.generate(e, r)), n.mock.queuePendingOperation(t.query, t.variables), /* @__PURE__ */ l(d, {
|
|
41
|
+
environment: n,
|
|
42
|
+
children: /* @__PURE__ */ l(s, {
|
|
43
|
+
fallback: t.fallback ?? /* @__PURE__ */ l("div", { children: "Loading..." }),
|
|
44
|
+
children: /* @__PURE__ */ l(e, {
|
|
45
|
+
fallback: g,
|
|
46
|
+
children: /* @__PURE__ */ l(_, {
|
|
47
|
+
query: t.query,
|
|
48
|
+
variables: t.variables,
|
|
49
|
+
render: t.render
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}, y = (t) => {
|
|
55
|
+
let n = (0, m.createMockEnvironment)(), r = h(t);
|
|
56
|
+
return n.mock.queueOperationResolver((e) => r == null ? m.MockPayloadGenerator.generate(e) : m.MockPayloadGenerator.generate(e, r)), t.pendingOperations?.forEach((e) => {
|
|
57
|
+
n.mock.queuePendingOperation(e.query, e.variables);
|
|
58
|
+
}), /* @__PURE__ */ l(d, {
|
|
59
|
+
environment: n,
|
|
60
|
+
children: /* @__PURE__ */ l(s, {
|
|
61
|
+
fallback: t.fallback ?? /* @__PURE__ */ l("div", { children: "Loading..." }),
|
|
62
|
+
children: /* @__PURE__ */ l(e, {
|
|
63
|
+
fallback: g,
|
|
64
|
+
children: t.children
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}, b = (t) => {
|
|
69
|
+
let n = (0, m.createMockEnvironment)(), r = h(t);
|
|
70
|
+
n.mock.queueOperationResolver((e) => r == null ? m.MockPayloadGenerator.generate(e) : m.MockPayloadGenerator.generate(e, r)), n.mock.queuePendingOperation(t.query, t.variables);
|
|
71
|
+
let i = { query: f(n, t.query, t.variables) };
|
|
72
|
+
return /* @__PURE__ */ l(d, {
|
|
73
|
+
environment: n,
|
|
74
|
+
children: /* @__PURE__ */ l(s, {
|
|
75
|
+
fallback: t.fallback ?? /* @__PURE__ */ l("div", { children: "Loading..." }),
|
|
76
|
+
children: /* @__PURE__ */ l(e, {
|
|
77
|
+
fallback: g,
|
|
78
|
+
children: t.render(i)
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { v as renderRelayLazyLoadStory, b as renderRelayPreloadedStory, y as renderRelayProviderStory };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=RelayStory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelayStory.js","names":[],"sources":["../../../../src/storybook/relay/RelayStory.tsx"],"sourcesContent":["import { Suspense, type JSX, type ReactNode } from 'react';\nimport {\n RelayEnvironmentProvider,\n loadQuery,\n useLazyLoadQuery,\n type GraphQLTaggedNode,\n type PreloadedQuery,\n} from 'react-relay';\nimport type {\n OperationDescriptor,\n OperationType,\n Variables,\n} from 'relay-runtime';\nimport {\n createMockEnvironment,\n MockPayloadGenerator,\n type MockResolvers,\n} from 'relay-test-utils';\n\nimport { BackofficeErrorBoundary } from '../../components/backoffice/errors/BackofficeErrorBoundary.js';\nimport { createBackofficeMockResolvers } from './mockResolvers.js';\nimport * as styles from './RelayStory.css.js';\n\ntype RelayMockOptions = {\n nodeType?: string;\n mockResolvers?: MockResolvers;\n};\n\nconst buildMockResolvers = ({\n nodeType,\n mockResolvers,\n}: RelayMockOptions): MockResolvers | undefined => {\n const baseResolvers = createBackofficeMockResolvers();\n\n const resolved: MockResolvers = {\n ...baseResolvers,\n ...(mockResolvers ?? {}),\n };\n\n if (nodeType != null) {\n resolved.Node = () => {\n return { __typename: nodeType };\n };\n }\n\n return resolved;\n};\n\nconst StoryErrorFallback = ({\n error,\n reset,\n}: {\n error: unknown;\n reset: () => void;\n}): JSX.Element => {\n let message = 'Unknown error';\n if (error instanceof Error) {\n message = error.message;\n } else {\n message = String(error);\n }\n\n return (\n <div className={styles.errorContainer}>\n <div className={styles.errorTitle}>Unable to render story</div>\n <div className={styles.errorMessage}>{message}</div>\n <button\n type=\"button\"\n onClick={() => {\n reset();\n }}\n className={styles.errorAction}\n >\n Retry\n </button>\n </div>\n );\n};\n\ntype RelayQueryRendererProps<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (data: Query['response']) => ReactNode;\n};\n\nconst RelayQueryRenderer = <Query extends OperationType>({\n query,\n variables,\n render,\n}: RelayQueryRendererProps<Query>): JSX.Element => {\n const data = useLazyLoadQuery<Query>(query, variables);\n return <>{render(data)}</>;\n};\n\ntype RelayLazyLoadStoryOptions<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (data: Query['response']) => ReactNode;\n fallback?: ReactNode;\n} & RelayMockOptions;\n\nexport const renderRelayLazyLoadStory = <Query extends OperationType>(\n options: RelayLazyLoadStoryOptions<Query>,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n environment.mock.queuePendingOperation(options.query, options.variables);\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n <RelayQueryRenderer\n query={options.query}\n variables={options.variables}\n render={options.render}\n />\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n\ntype RelayProviderStoryOptions = {\n children: ReactNode;\n fallback?: ReactNode;\n pendingOperations?: readonly {\n query: GraphQLTaggedNode;\n variables: Variables;\n }[];\n} & RelayMockOptions;\n\nexport const renderRelayProviderStory = (\n options: RelayProviderStoryOptions,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n\n options.pendingOperations?.forEach((pending) => {\n environment.mock.queuePendingOperation(pending.query, pending.variables);\n });\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n {options.children}\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n\ntype RelayPreloadedStoryOptions<Query extends OperationType> = {\n query: GraphQLTaggedNode;\n variables: Query['variables'];\n render: (prepared: { query: PreloadedQuery<Query> }) => ReactNode;\n fallback?: ReactNode;\n} & RelayMockOptions;\n\nexport const renderRelayPreloadedStory = <Query extends OperationType>(\n options: RelayPreloadedStoryOptions<Query>,\n): JSX.Element => {\n const environment = createMockEnvironment();\n const resolvers = buildMockResolvers(options);\n\n environment.mock.queueOperationResolver((operation: OperationDescriptor) => {\n if (resolvers == null) {\n return MockPayloadGenerator.generate(operation);\n }\n return MockPayloadGenerator.generate(operation, resolvers);\n });\n environment.mock.queuePendingOperation(options.query, options.variables);\n\n const prepared = {\n query: loadQuery<Query>(environment, options.query, options.variables),\n };\n\n return (\n <RelayEnvironmentProvider environment={environment}>\n <Suspense fallback={options.fallback ?? <div>Loading...</div>}>\n <BackofficeErrorBoundary fallback={StoryErrorFallback}>\n {options.render(prepared)}\n </BackofficeErrorBoundary>\n </Suspense>\n </RelayEnvironmentProvider>\n );\n};\n"],"mappings":";;;;;;;;aA4BM,KAAsB,EAC1B,aACA,uBACiD;CAGjD,IAAM,IAA0B;EAC9B,GAHoB,GAGjB;EACH,GAAI,KAAiB,EAAE;EACxB;CAQD,OANI,KAAY,SACd,EAAS,cACA,EAAE,YAAY,GAAU,IAI5B;GAGH,KAAsB,EAC1B,UACA,eAIiB;CACjB,IAAI,IAAU;CAOd,OANA,AAGE,IAHE,aAAiB,QACT,EAAM,UAEN,OAAO,EAAM,EAIvB,kBAAC,OAAD;EAAK,WAAW;YAAhB;GACE,kBAAC,OAAD;IAAK,WAAW;cAAmB;IAA4B,CAAA;GAC/D,kBAAC,OAAD;IAAK,WAAW;cAAsB;IAAc,CAAA;GACpD,kBAAC,UAAD;IACE,MAAK;IACL,eAAe;KACb,GAAO;;IAET,WAAW;cACZ;IAEQ,CAAA;GACL;;GAUJ,KAAmD,EACvD,UACA,cACA,gBAGO,kBAAA,GAAA,EAAA,UAAG,EADG,EAAwB,GAAO,EAC3B,CAAK,EAAI,CAAA,EAUf,KACX,MACgB;C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,OAAO,EAAQ,UAAU;CAExE,IAAM,IAAW,EACf,OAAO,EAAiB,GAAa,EAAQ,OAAO,EAAQ,UAAU,EACvE;CAED,OACE,kBAAC,GAAD;EAAuC;YACrC,kBAAC,GAAD;GAAU,UAAU,EAAQ,YAAY,kBAAC,OAAD,EAAA,UAAK,cAAgB,CAAA;aAC3D,kBAAC,GAAD;IAAyB,UAAU;cAChC,EAAQ,OAAO,EAAS;IACD,CAAA;GACjB,CAAA;EACc,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//#region src/storybook/relay/mockResolvers.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
4
|
+
return t === "" ? e : t;
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function n() {
|
|
10
|
+
let e = /* @__PURE__ */ new Map();
|
|
11
|
+
return (t) => {
|
|
12
|
+
let n = (e.get(t) ?? 0) + 1;
|
|
13
|
+
return e.set(t, n), n;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var r = [
|
|
17
|
+
"Avery",
|
|
18
|
+
"Jordan",
|
|
19
|
+
"Taylor",
|
|
20
|
+
"Morgan",
|
|
21
|
+
"Casey"
|
|
22
|
+
], i = [
|
|
23
|
+
"Lee",
|
|
24
|
+
"Parker",
|
|
25
|
+
"Carter",
|
|
26
|
+
"Nguyen",
|
|
27
|
+
"Patel"
|
|
28
|
+
];
|
|
29
|
+
function a(e, t) {
|
|
30
|
+
return e[(t - 1) % e.length] ?? "User";
|
|
31
|
+
}
|
|
32
|
+
function o() {
|
|
33
|
+
let o = n(), s = Date.parse("2024-01-15T09:30:00.000Z");
|
|
34
|
+
function c(n) {
|
|
35
|
+
let s = n.alias ?? n.name ?? "value", c = n.parentType ?? "Item", l = e(c), u = o(`${c}.${s}`);
|
|
36
|
+
switch (s) {
|
|
37
|
+
case "name":
|
|
38
|
+
case "title":
|
|
39
|
+
case "label": return `${l} ${u}`;
|
|
40
|
+
case "firstName": return a(r, u);
|
|
41
|
+
case "lastName": return a(i, u);
|
|
42
|
+
case "initials": return "JD";
|
|
43
|
+
case "email": return `user${u}@example.com`;
|
|
44
|
+
case "slug":
|
|
45
|
+
case "handle": return `${t(l)}-${u}`;
|
|
46
|
+
case "url":
|
|
47
|
+
case "uri":
|
|
48
|
+
case "avatarUrl":
|
|
49
|
+
case "imageUrl":
|
|
50
|
+
case "iconUrl": return `https://example.com/${t(l)}/${u}`;
|
|
51
|
+
case "description":
|
|
52
|
+
case "summary":
|
|
53
|
+
case "content":
|
|
54
|
+
case "body":
|
|
55
|
+
case "notes":
|
|
56
|
+
case "message": return `Sample ${s} for ${l}.`;
|
|
57
|
+
case "markdown":
|
|
58
|
+
case "summaryMarkdown":
|
|
59
|
+
case "notesForDev":
|
|
60
|
+
case "descriptionMarkdown":
|
|
61
|
+
case "suggestedFixMarkdown": return `Sample ${s} for ${l}.`;
|
|
62
|
+
default: return `${l} ${s} ${u}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function l(e) {
|
|
66
|
+
let n = e.parentType ?? "node", r = o(`${n}.id`);
|
|
67
|
+
return `${t(n)}-${r}`;
|
|
68
|
+
}
|
|
69
|
+
function u(e) {
|
|
70
|
+
return o(`${e.parentType ?? "value"}.${e.name ?? "int"}`);
|
|
71
|
+
}
|
|
72
|
+
function d(e) {
|
|
73
|
+
let t = `${e.parentType ?? "value"}.${e.name ?? "float"}`;
|
|
74
|
+
return Number((o(t) * 1.25).toFixed(2));
|
|
75
|
+
}
|
|
76
|
+
function f() {
|
|
77
|
+
return !0;
|
|
78
|
+
}
|
|
79
|
+
function p() {
|
|
80
|
+
let e = o("datetime");
|
|
81
|
+
return new Date(s + e * 864e5).toISOString();
|
|
82
|
+
}
|
|
83
|
+
function m(t) {
|
|
84
|
+
return { note: `Sample JSON for ${e(t.parentType ?? "Item")}.` };
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
ID: l,
|
|
88
|
+
String: c,
|
|
89
|
+
Int: u,
|
|
90
|
+
Float: d,
|
|
91
|
+
Boolean: f,
|
|
92
|
+
DateTime: p,
|
|
93
|
+
JSON: m
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { o as createBackofficeMockResolvers };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=mockResolvers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockResolvers.js","names":[],"sources":["../../../../src/storybook/relay/mockResolvers.ts"],"sourcesContent":["import type { MockResolverContext, MockResolvers } from 'relay-test-utils';\n\n/**\n *\n */\nfunction toLabel(value: string): string {\n const withSpaces = value\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim();\n if (withSpaces === '') {\n return value;\n }\n return withSpaces;\n}\n\n/**\n *\n */\nfunction toSlug(value: string): string {\n return value\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[_\\s]+/g, '-')\n .toLowerCase();\n}\n\n/**\n *\n */\nfunction createCounter(): (key: string) => number {\n const counts = new Map<string, number>();\n return (key: string) => {\n const next = (counts.get(key) ?? 0) + 1;\n counts.set(key, next);\n return next;\n };\n}\n\nconst FIRST_NAMES = ['Avery', 'Jordan', 'Taylor', 'Morgan', 'Casey'] as const;\nconst LAST_NAMES = ['Lee', 'Parker', 'Carter', 'Nguyen', 'Patel'] as const;\n\n/**\n *\n */\nfunction pickName(list: readonly string[], index: number): string {\n const candidate = list[(index - 1) % list.length];\n if (candidate == null) {\n return 'User';\n }\n return candidate;\n}\n\n/**\n *\n */\nexport function createBackofficeMockResolvers(): MockResolvers {\n const next = createCounter();\n const baseDate = Date.parse('2024-01-15T09:30:00.000Z');\n\n /**\n *\n */\n function stringResolver(context: MockResolverContext): string {\n const fieldName = context.alias ?? context.name ?? 'value';\n const parentType = context.parentType ?? 'Item';\n const label = toLabel(parentType);\n const key = `${parentType}.${fieldName}`;\n const index = next(key);\n\n switch (fieldName) {\n case 'name':\n case 'title':\n case 'label':\n return `${label} ${index}`;\n case 'firstName':\n return pickName(FIRST_NAMES, index);\n case 'lastName':\n return pickName(LAST_NAMES, index);\n case 'initials':\n return 'JD';\n case 'email':\n return `user${index}@example.com`;\n case 'slug':\n case 'handle':\n return `${toSlug(label)}-${index}`;\n case 'url':\n case 'uri':\n case 'avatarUrl':\n case 'imageUrl':\n case 'iconUrl':\n return `https://example.com/${toSlug(label)}/${index}`;\n case 'description':\n case 'summary':\n case 'content':\n case 'body':\n case 'notes':\n case 'message':\n return `Sample ${fieldName} for ${label}.`;\n case 'markdown':\n case 'summaryMarkdown':\n case 'notesForDev':\n case 'descriptionMarkdown':\n case 'suggestedFixMarkdown':\n return `Sample ${fieldName} for ${label}.`;\n default:\n return `${label} ${fieldName} ${index}`;\n }\n }\n\n /**\n *\n */\n function resolveId(context: MockResolverContext): string {\n const parentType = context.parentType ?? 'node';\n const index = next(`${parentType}.id`);\n return `${toSlug(parentType)}-${index}`;\n }\n\n /**\n *\n */\n function resolveInt(context: MockResolverContext): number {\n const key = `${context.parentType ?? 'value'}.${context.name ?? 'int'}`;\n return next(key);\n }\n\n /**\n *\n */\n function resolveFloat(context: MockResolverContext): number {\n const key = `${context.parentType ?? 'value'}.${context.name ?? 'float'}`;\n return Number((next(key) * 1.25).toFixed(2));\n }\n\n /**\n *\n */\n function resolveBoolean(): boolean {\n return true;\n }\n\n /**\n *\n */\n function resolveDateTime(): string {\n const index = next('datetime');\n const value = new Date(baseDate + index * 86400000);\n return value.toISOString();\n }\n\n /**\n *\n */\n function resolveJson(context: MockResolverContext): { note: string } {\n const label = toLabel(context.parentType ?? 'Item');\n return { note: `Sample JSON for ${label}.` };\n }\n\n return {\n ID: resolveId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