@antelopejs/dms 0.25.7-next.1111.gaba637e → 0.25.7
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/CHANGELOG.md +73 -0
- package/README.md +2 -2
- package/data/mockup-spec.schema.json +303 -223
- package/dist/implementations/dms-auth/account-emails.js +2 -2
- package/dist/implementations/dms-auth/account-emails.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +1 -2
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +18 -0
- package/dist/implementations/dms-base/group-order.js +66 -0
- package/dist/implementations/dms-base/group-order.js.map +1 -0
- package/dist/implementations/dms-base/search-route.js +8 -5
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +4 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +5 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +4 -0
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +5 -17
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/index.js +0 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +0 -14
- package/dist/mcp/page-verify/index.js +5 -9
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +1 -2
- package/dist/mcp/page-verify/mockup.js +0 -1
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +4 -22
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +3 -10
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +0 -2
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +0 -1
- package/dist/mcp/tools/page-verify.js +1 -5
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mockup/apply-notes.d.ts +1 -1
- package/dist/mockup/apply-notes.js +2 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +3 -0
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/{fixture-routes.d.ts → capture-routes.d.ts} +6 -11
- package/dist/mockup/capture-routes.js +101 -0
- package/dist/mockup/capture-routes.js.map +1 -0
- package/dist/mockup/capture.d.ts +10 -0
- package/dist/mockup/capture.js +64 -0
- package/dist/mockup/capture.js.map +1 -0
- package/dist/mockup/compile.d.ts +1 -6
- package/dist/mockup/compile.js +25 -29
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +62 -10
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/files.d.ts +2 -2
- package/dist/mockup/files.js +2 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixture-answers.d.ts +0 -1
- package/dist/mockup/fixture-answers.js +1 -1
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +3 -1
- package/dist/mockup/fixtures.js +25 -2
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +10 -1
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/generate.js +1 -4
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/header-action.d.ts +47 -0
- package/dist/mockup/header-action.js +46 -0
- package/dist/mockup/header-action.js.map +1 -0
- package/dist/mockup/history-routes.js +17 -2
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +0 -3
- package/dist/mockup/index.js +0 -3
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-header.d.ts +2 -0
- package/dist/mockup/json-schema-header.js +69 -0
- package/dist/mockup/json-schema-header.js.map +1 -0
- package/dist/mockup/json-schema-layout.d.ts +2 -0
- package/dist/mockup/json-schema-layout.js +61 -0
- package/dist/mockup/json-schema-layout.js.map +1 -0
- package/dist/mockup/json-schema.js +24 -23
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/model.d.ts +255 -106
- package/dist/mockup/model.js +82 -86
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +9 -20
- package/dist/mockup/modules.js +22 -146
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/page-links.d.ts +2 -1
- package/dist/mockup/page-links.js +14 -3
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +1 -4
- package/dist/mockup/refusals.js +1 -15
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +5 -1
- package/dist/mockup/routes.js +171 -9
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sample-rows.js +4 -0
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/store.d.ts +2 -1
- package/dist/mockup/store.js +22 -16
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/{store-summary.js → summary-fields.js} +1 -1
- package/dist/mockup/summary-fields.js.map +1 -0
- package/dist/mockup/table-columns.js +9 -3
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +4 -1
- package/dist/mockup/table-options.js +40 -2
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/table-param-filters.d.ts +52 -0
- package/dist/mockup/table-param-filters.js +83 -0
- package/dist/mockup/table-param-filters.js.map +1 -0
- package/dist/mockup/table-row-actions.d.ts +2 -0
- package/dist/mockup/table-row-actions.js +85 -0
- package/dist/mockup/table-row-actions.js.map +1 -0
- package/dist/mockup/unknown-keys.d.ts +3 -0
- package/dist/mockup/unknown-keys.js +45 -0
- package/dist/mockup/unknown-keys.js.map +1 -0
- package/dist/mockup/validate.d.ts +7 -1
- package/dist/mockup/validate.js +76 -3
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +1 -0
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +2 -0
- package/dist/pages/settings/overview/account-summary.js +17 -8
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +2 -1
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +2 -4
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +7 -1
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +1 -0
- package/dist/utils/account-notifications.js.map +1 -1
- package/dist/utils/email-change-mail.js +2 -2
- package/dist/utils/email-change-mail.js.map +1 -1
- package/dist/utils/email-plain-text.d.ts +1 -0
- package/dist/utils/email-plain-text.js +95 -0
- package/dist/utils/email-plain-text.js.map +1 -0
- package/dist/utils/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/html-email.d.ts +8 -0
- package/dist/utils/html-email.js +9 -0
- package/dist/utils/html-email.js.map +1 -0
- package/dist/utils/image-signatures.d.ts +3 -0
- package/dist/utils/image-signatures.js +22 -0
- package/dist/utils/image-signatures.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/sse-keepalive/index.d.ts +3 -0
- package/dist/utils/sse-keepalive/index.js +8 -0
- package/dist/utils/sse-keepalive/index.js.map +1 -0
- package/dist/validation/allowed-keys.d.ts +2 -0
- package/dist/validation/allowed-keys.js +16 -0
- package/dist/validation/allowed-keys.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/frontend-vue/eslint-globals.generated.mjs +2 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +4 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +17 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +3 -0
- package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +8 -0
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +485 -0
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +27 -0
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +23 -5
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +1 -0
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +12 -443
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +8 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +8 -0
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +7 -4
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +14 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +49 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +2 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +6 -21
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +19 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +9 -110
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +8 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +6 -9
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +6 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +27 -22
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +8 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +39 -3
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +38 -5
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +23 -4
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +39 -31
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +60 -9
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +7 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +14 -1
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +13 -0
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +3 -0
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +1 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +22 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +6 -11
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +125 -182
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +110 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +75 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +114 -12
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +67 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +10 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +8 -76
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +9 -65
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +26 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +247 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +181 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +45 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +46 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +109 -35
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +5 -18
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +0 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +137 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +68 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +17 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +69 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +20 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +21 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +32 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +16 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +67 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +73 -48
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +18 -11
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +35 -124
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +7 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +96 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +84 -149
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +61 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +37 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +279 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +43 -72
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +130 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +8 -92
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +35 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +44 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +3 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +26 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +149 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +42 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +56 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -3
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +4 -7
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +90 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +5 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +2 -20
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +51 -15
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +5 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +2 -28
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +12 -38
- package/frontend-vue/package.json +3 -3
- package/frontend-vue/scripts/check-invariants.mjs +101 -0
- package/package.json +9 -8
- package/skills/dms/SKILL.md +4 -2
- package/skills/dms-module/SKILL.md +3 -0
- package/dist/mcp/mockup-export/capture.d.ts +0 -15
- package/dist/mcp/mockup-export/capture.js +0 -97
- package/dist/mcp/mockup-export/capture.js.map +0 -1
- package/dist/mcp/mockup-export/document.d.ts +0 -4
- package/dist/mcp/mockup-export/document.js +0 -199
- package/dist/mcp/mockup-export/document.js.map +0 -1
- package/dist/mcp/mockup-export/index.d.ts +0 -23
- package/dist/mcp/mockup-export/index.js +0 -90
- package/dist/mcp/mockup-export/index.js.map +0 -1
- package/dist/mcp/mockup-export/plan.d.ts +0 -78
- package/dist/mcp/mockup-export/plan.js +0 -257
- package/dist/mcp/mockup-export/plan.js.map +0 -1
- package/dist/mcp/mockup-export/route.d.ts +0 -13
- package/dist/mcp/mockup-export/route.js +0 -66
- package/dist/mcp/mockup-export/route.js.map +0 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +0 -1
- package/dist/mcp/tools/mockup-export-pdf.js +0 -71
- package/dist/mcp/tools/mockup-export-pdf.js.map +0 -1
- package/dist/mockup/database-manifest.d.ts +0 -2
- package/dist/mockup/database-manifest.js +0 -75
- package/dist/mockup/database-manifest.js.map +0 -1
- package/dist/mockup/entities.d.ts +0 -20
- package/dist/mockup/entities.js +0 -213
- package/dist/mockup/entities.js.map +0 -1
- package/dist/mockup/fixture-routes.js +0 -155
- package/dist/mockup/fixture-routes.js.map +0 -1
- package/dist/mockup/json-schema-entities.d.ts +0 -5
- package/dist/mockup/json-schema-entities.js +0 -141
- package/dist/mockup/json-schema-entities.js.map +0 -1
- package/dist/mockup/json.d.ts +0 -8
- package/dist/mockup/json.js +0 -20
- package/dist/mockup/json.js.map +0 -1
- package/dist/mockup/manifest-blocks.d.ts +0 -19
- package/dist/mockup/manifest-blocks.js +0 -65
- package/dist/mockup/manifest-blocks.js.map +0 -1
- package/dist/mockup/module-manifests.d.ts +0 -22
- package/dist/mockup/module-manifests.js +0 -28
- package/dist/mockup/module-manifests.js.map +0 -1
- package/dist/mockup/modules-schema.d.ts +0 -2
- package/dist/mockup/modules-schema.js +0 -42
- package/dist/mockup/modules-schema.js.map +0 -1
- package/dist/mockup/saas-manifest.d.ts +0 -2
- package/dist/mockup/saas-manifest.js +0 -496
- package/dist/mockup/saas-manifest.js.map +0 -1
- package/dist/mockup/state.d.ts +0 -76
- package/dist/mockup/state.js +0 -22
- package/dist/mockup/state.js.map +0 -1
- package/dist/mockup/store-summary.js.map +0 -1
- package/dist/mockup/tenancy.d.ts +0 -19
- package/dist/mockup/tenancy.js +0 -73
- package/dist/mockup/tenancy.js.map +0 -1
- package/dist/mockup/tenant-rows.d.ts +0 -4
- package/dist/mockup/tenant-rows.js +0 -19
- package/dist/mockup/tenant-rows.js.map +0 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +0 -165
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +0 -48
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +0 -142
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +0 -175
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +0 -76
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +0 -63
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +0 -119
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +0 -80
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +0 -177
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +0 -151
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +0 -23
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +0 -1
- /package/dist/mockup/{store-summary.d.ts → summary-fields.d.ts} +0 -0
|
@@ -1,444 +1,13 @@
|
|
|
1
1
|
import { nextTick, reactive } from "vue";
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { resolveApiErrorMessage } from "./resolveApiError";
|
|
3
|
+
import { isString } from "../utils/type-check";
|
|
4
|
+
import {
|
|
5
|
+
fieldErrorMessage,
|
|
6
|
+
resolveFieldErrors,
|
|
7
|
+
type FieldErrorCode,
|
|
8
|
+
} from "../build/composables/field-errors";
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
export interface ApiFieldError {
|
|
8
|
-
/** Id of the field, as the form names it (the request body key). */
|
|
9
|
-
field: string;
|
|
10
|
-
/** Server translation key, resolved by the API error presenter. */
|
|
11
|
-
message: string;
|
|
12
|
-
/** Caller key used only when the server's message is not translated. */
|
|
13
|
-
fallbackKey?: string;
|
|
14
|
-
/** The values of the field the error names (addresses of a list…). */
|
|
15
|
-
values?: string[];
|
|
16
|
-
/**
|
|
17
|
-
* Values filling the placeholders of the translated message: a body
|
|
18
|
-
* `{ field: "budget", message: "$page.error.budget_max", params: { max: 5000 } }`
|
|
19
|
-
* shows "At most 5000" for a translation `"At most {max}"`.
|
|
20
|
-
*/
|
|
21
|
-
params?: ApiFieldErrorParams;
|
|
22
|
-
/**
|
|
23
|
-
* The part of the field the error names, as a dotted path from the field
|
|
24
|
-
* (`address.streetName`, `title.fr`); absent when it names the field.
|
|
25
|
-
*/
|
|
26
|
-
path?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Placeholder values of a field error's message. */
|
|
30
|
-
export type ApiFieldErrorParams = Record<string, string | number | boolean>;
|
|
31
|
-
|
|
32
|
-
/** A code the API answers with that belongs to a field. */
|
|
33
|
-
export type FieldErrorCode<F extends string = string> =
|
|
34
|
-
| F
|
|
35
|
-
| {
|
|
36
|
-
field: F;
|
|
37
|
-
/** Shown instead of the code's own text. */
|
|
38
|
-
message: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export interface ResolveFieldErrorsOptions<F extends string = string> {
|
|
42
|
-
/**
|
|
43
|
-
* The fields of the form. An error naming another field (or none) is not
|
|
44
|
-
* one the form can show: it stays a toast.
|
|
45
|
-
*/
|
|
46
|
-
fields: readonly F[];
|
|
47
|
-
/** API error codes (`error.xxx`, `$page.…`) that belong to a field. */
|
|
48
|
-
codes?: Readonly<Record<string, FieldErrorCode<NoInfer<F>>>>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface FieldErrorResolution {
|
|
52
|
-
/** Errors to show under their field. */
|
|
53
|
-
fields: ApiFieldError[];
|
|
54
|
-
/**
|
|
55
|
-
* The error also carries something no field of the form can show (a
|
|
56
|
-
* validation issue on an unknown key): a toast tells about it.
|
|
57
|
-
*/
|
|
58
|
-
hasUnmatched: boolean;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface FetchErrorLike {
|
|
62
|
-
statusCode?: number;
|
|
63
|
-
status?: number;
|
|
64
|
-
response?: { status?: number };
|
|
65
|
-
data?: unknown;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
interface FieldErrorBody {
|
|
69
|
-
field?: unknown;
|
|
70
|
-
message?: unknown;
|
|
71
|
-
values?: unknown;
|
|
72
|
-
params?: unknown;
|
|
73
|
-
code?: unknown;
|
|
74
|
-
fields?: unknown;
|
|
75
|
-
issues?: unknown;
|
|
76
|
-
errors?: unknown;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** A zod issue, as the API serializes it or as zod hands it to an error map. */
|
|
80
|
-
export interface ValidationIssue {
|
|
81
|
-
path?: unknown;
|
|
82
|
-
message?: unknown;
|
|
83
|
-
code?: unknown;
|
|
84
|
-
format?: unknown;
|
|
85
|
-
minimum?: unknown;
|
|
86
|
-
origin?: unknown;
|
|
87
|
-
/** zod 3's `origin`, in an issue list a module still on zod 3 sends. */
|
|
88
|
-
type?: unknown;
|
|
89
|
-
/** zod 3's `format`, in an issue list a module still on zod 3 sends. */
|
|
90
|
-
validation?: unknown;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** What a size issue measured, as zod 4 (`origin`) or zod 3 (`type`) names it. */
|
|
94
|
-
function sizeOrigin(issue: ValidationIssue): string | undefined {
|
|
95
|
-
const origin = issue.origin ?? issue.type;
|
|
96
|
-
return origin === undefined ? undefined : String(origin);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const HTTP_BAD_REQUEST = 400;
|
|
100
|
-
const HTTP_CONFLICT = 409;
|
|
101
|
-
const HTTP_UNPROCESSABLE = 422;
|
|
102
|
-
const HTTP_FORBIDDEN = 403;
|
|
103
|
-
const HTTP_TOO_MANY_REQUESTS = 429;
|
|
104
|
-
const HTTP_CLIENT_ERROR_MIN = 400;
|
|
105
|
-
const HTTP_CLIENT_ERROR_MAX = 499;
|
|
106
|
-
|
|
107
|
-
/** Statuses whose body may name the field it refuses. */
|
|
108
|
-
const VALIDATION_STATUSES = new Set([
|
|
109
|
-
HTTP_BAD_REQUEST,
|
|
110
|
-
HTTP_CONFLICT,
|
|
111
|
-
HTTP_UNPROCESSABLE,
|
|
112
|
-
]);
|
|
113
|
-
|
|
114
|
-
/** Never about a field, whatever the body says. */
|
|
115
|
-
const GLOBAL_STATUSES = new Set([HTTP_FORBIDDEN, HTTP_TOO_MANY_REQUESTS]);
|
|
116
|
-
|
|
117
|
-
const FIELD_ERROR_KEYS = {
|
|
118
|
-
required: "$dms.field_errors.required",
|
|
119
|
-
invalid: "$dms.field_errors.invalid",
|
|
120
|
-
invalidEmail: "$dms.field_errors.invalid_email",
|
|
121
|
-
tooLong: "$dms.field_errors.too_long",
|
|
122
|
-
tooShort: "$dms.field_errors.too_short",
|
|
123
|
-
tooSmall: "$dms.field_errors.too_small",
|
|
124
|
-
tooLarge: "$dms.field_errors.too_large",
|
|
125
|
-
} as const;
|
|
126
|
-
|
|
127
|
-
/** Issue origins whose size is a count (characters, items), not a value. */
|
|
128
|
-
const COUNTED_ORIGINS = new Set(["string", "array", "set"]);
|
|
129
|
-
|
|
130
|
-
const DATA_API_CODES: Readonly<
|
|
131
|
-
Record<ReturnType<typeof resolveApiErrorMessage>, ApiFieldError["message"]>
|
|
132
|
-
> = {
|
|
133
|
-
missing_mandatory_fields: FIELD_ERROR_KEYS.required,
|
|
134
|
-
invalid_field_types: FIELD_ERROR_KEYS.invalid,
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const NAMED_FIELD_ERROR_KEYS: Readonly<
|
|
138
|
-
Record<ApiFieldError["message"], Parameters<I18nTranslate>[0]>
|
|
139
|
-
> = {
|
|
140
|
-
[FIELD_ERROR_KEYS.required]: "dms.field_errors.named_required",
|
|
141
|
-
[FIELD_ERROR_KEYS.invalid]: "dms.field_errors.named_invalid",
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const FIELD_PREFIXED_MESSAGE = /^([\w.]+):\s+(\S.*|\s)$/s;
|
|
145
|
-
|
|
146
|
-
const BARE_I18N_KEY = /^\w+(?:\.\w+)+$/;
|
|
147
|
-
|
|
148
|
-
/** The HTTP status of a fetch error; undefined for a network failure. */
|
|
149
|
-
export function apiErrorStatus(
|
|
150
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
151
|
-
): number | undefined {
|
|
152
|
-
if (!isObject(error) || error === null) return undefined;
|
|
153
|
-
const { statusCode, status, response }: FetchErrorLike = error;
|
|
154
|
-
return statusCode ?? status ?? response?.status;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/** The error body, parsed when the server sent JSON as plain text. */
|
|
158
|
-
function bodyOf(
|
|
159
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
160
|
-
): FetchErrorLike["data"] {
|
|
161
|
-
if (!isObject(error) || error === null) return undefined;
|
|
162
|
-
const { data } = error;
|
|
163
|
-
if (!isString(data)) return data;
|
|
164
|
-
const text = data.trim();
|
|
165
|
-
if (!text.startsWith("[") && !text.startsWith("{")) return data;
|
|
166
|
-
try {
|
|
167
|
-
return JSON.parse(text);
|
|
168
|
-
} catch {
|
|
169
|
-
return data;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** Whether a message is an i18n key rather than (English) prose. */
|
|
174
|
-
function isI18nKey(message: string): boolean {
|
|
175
|
-
return message.startsWith("$") || BARE_I18N_KEY.test(message);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/** A zod issue's own message when it is a key, else a generic one. */
|
|
179
|
-
function tooSmallMessage(issue: ValidationIssue): string {
|
|
180
|
-
const origin = sizeOrigin(issue);
|
|
181
|
-
if (origin !== undefined && !COUNTED_ORIGINS.has(origin)) {
|
|
182
|
-
return FIELD_ERROR_KEYS.tooSmall;
|
|
183
|
-
}
|
|
184
|
-
return isNumber(issue.minimum) && issue.minimum <= 1
|
|
185
|
-
? FIELD_ERROR_KEYS.required
|
|
186
|
-
: FIELD_ERROR_KEYS.tooShort;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* The message of a zod issue: its own when it is an i18n key, else a generic
|
|
191
|
-
* `$dms.field_errors.*` key by issue code (zod words its own in English).
|
|
192
|
-
*/
|
|
193
|
-
export function validationIssueMessage(issue: ValidationIssue): string {
|
|
194
|
-
if (isString(issue.message) && isI18nKey(issue.message)) {
|
|
195
|
-
return issue.message;
|
|
196
|
-
}
|
|
197
|
-
switch (issue.code) {
|
|
198
|
-
case "too_small":
|
|
199
|
-
return tooSmallMessage(issue);
|
|
200
|
-
case "too_big": {
|
|
201
|
-
const origin = sizeOrigin(issue);
|
|
202
|
-
return origin !== undefined && !COUNTED_ORIGINS.has(origin)
|
|
203
|
-
? FIELD_ERROR_KEYS.tooLarge
|
|
204
|
-
: FIELD_ERROR_KEYS.tooLong;
|
|
205
|
-
}
|
|
206
|
-
case "invalid_format":
|
|
207
|
-
case "invalid_string":
|
|
208
|
-
return (issue.format ?? issue.validation) === "email"
|
|
209
|
-
? FIELD_ERROR_KEYS.invalidEmail
|
|
210
|
-
: FIELD_ERROR_KEYS.invalid;
|
|
211
|
-
default:
|
|
212
|
-
return FIELD_ERROR_KEYS.invalid;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
type PathedIssue = ValidationIssue & { path: unknown[] };
|
|
217
|
-
|
|
218
|
-
function isIssueList(
|
|
219
|
-
body: ReturnType<typeof bodyOf>,
|
|
220
|
-
): body is [PathedIssue, ...PathedIssue[]] {
|
|
221
|
-
return (
|
|
222
|
-
Array.isArray(body) &&
|
|
223
|
-
body.length > 0 &&
|
|
224
|
-
body.every(
|
|
225
|
-
(issue) => isObject(issue) && issue !== null && Array.isArray(issue.path),
|
|
226
|
-
)
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/** `field.part.0` for a path reaching into a field, else undefined. */
|
|
231
|
-
function partPath(path: readonly unknown[]): string | undefined {
|
|
232
|
-
if (path.length < 2) return undefined;
|
|
233
|
-
return path.every((step) => isString(step) || isNumber(step))
|
|
234
|
-
? path.join(".")
|
|
235
|
-
: undefined;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function fromIssues(issues: PathedIssue[]): ApiFieldError[] {
|
|
239
|
-
return issues.map((issue) => {
|
|
240
|
-
const path = issue.path;
|
|
241
|
-
const [field] = path;
|
|
242
|
-
const part = partPath(path);
|
|
243
|
-
return {
|
|
244
|
-
field: isString(field) ? field : "",
|
|
245
|
-
message: validationIssueMessage(issue),
|
|
246
|
-
...(part && { path: part }),
|
|
247
|
-
};
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/** The placeholder values of a body, keeping only the plain ones. */
|
|
252
|
-
function paramsOf(
|
|
253
|
-
params: FieldErrorBody["params"],
|
|
254
|
-
): ApiFieldErrorParams | undefined {
|
|
255
|
-
if (!isObject(params) || params === null || Array.isArray(params)) {
|
|
256
|
-
return undefined;
|
|
257
|
-
}
|
|
258
|
-
const entries = Object.entries(params).filter(
|
|
259
|
-
(entry): entry is [string, ApiFieldErrorParams[string]] =>
|
|
260
|
-
isString(entry[1]) || isNumber(entry[1]) || isBoolean(entry[1]),
|
|
261
|
-
);
|
|
262
|
-
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/** `{ field, message, values?, params? }`, the shape the DMS answers with. */
|
|
266
|
-
function fromFieldObject(body: FieldErrorBody): ApiFieldError[] {
|
|
267
|
-
const { field, message, values, params } = body;
|
|
268
|
-
if (!isString(field) || !isString(message)) return [];
|
|
269
|
-
const placeholders = paramsOf(params);
|
|
270
|
-
return [
|
|
271
|
-
{
|
|
272
|
-
field,
|
|
273
|
-
message,
|
|
274
|
-
values: Array.isArray(values) ? values.filter(isString) : undefined,
|
|
275
|
-
...(placeholders && { params: placeholders }),
|
|
276
|
-
},
|
|
277
|
-
];
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/** `{ code, fields }`, the data API's refusal of a body; undefined otherwise. */
|
|
281
|
-
function fromCodedFields(body: FieldErrorBody): ApiFieldError[] | undefined {
|
|
282
|
-
const { code, fields } = body;
|
|
283
|
-
const message = isString(code) ? DATA_API_CODES[code] : undefined;
|
|
284
|
-
if (!message || !Array.isArray(fields)) return undefined;
|
|
285
|
-
return fields.filter(isString).map((field) => ({ field, message }));
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function fromText(text: string): ApiFieldError[] {
|
|
289
|
-
const prefixed = FIELD_PREFIXED_MESSAGE.exec(text);
|
|
290
|
-
if (prefixed) {
|
|
291
|
-
const [, field = "", message = ""] = prefixed;
|
|
292
|
-
const path = field.split(".");
|
|
293
|
-
const part = partPath(path);
|
|
294
|
-
return [
|
|
295
|
-
{
|
|
296
|
-
field: path[0] ?? field,
|
|
297
|
-
message: isI18nKey(message) ? message : FIELD_ERROR_KEYS.invalid,
|
|
298
|
-
...(part && { path: part }),
|
|
299
|
-
},
|
|
300
|
-
];
|
|
301
|
-
}
|
|
302
|
-
return [];
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/** The text code of an error body: the body itself or its `message`. */
|
|
306
|
-
function codeOf(body: ReturnType<typeof bodyOf>): string | undefined {
|
|
307
|
-
if (isString(body)) return body;
|
|
308
|
-
if (isObject(body) && body !== null && !Array.isArray(body)) {
|
|
309
|
-
const { message } = body;
|
|
310
|
-
return isString(message) ? message : undefined;
|
|
311
|
-
}
|
|
312
|
-
return undefined;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
function lookupCode<F extends string>(
|
|
316
|
-
code: string | undefined,
|
|
317
|
-
codes: Readonly<Record<string, FieldErrorCode<F>>> | undefined,
|
|
318
|
-
): ApiFieldError | undefined {
|
|
319
|
-
if (!code || !codes) return undefined;
|
|
320
|
-
const bare = code.startsWith("$") ? code.slice(1) : code;
|
|
321
|
-
const own = (key: string) =>
|
|
322
|
-
Object.hasOwn(codes, key) ? codes[key] : undefined;
|
|
323
|
-
const entry = own(code) ?? own(bare) ?? own(`$${bare}`);
|
|
324
|
-
if (!entry) return undefined;
|
|
325
|
-
return isString(entry)
|
|
326
|
-
? { field: entry, message: code }
|
|
327
|
-
: { field: entry.field, message: code, fallbackKey: entry.message };
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
function fromBody(body: ReturnType<typeof bodyOf>): ApiFieldError[] {
|
|
331
|
-
if (isIssueList(body)) return fromIssues(body);
|
|
332
|
-
if (isString(body)) return fromText(body);
|
|
333
|
-
if (!isObject(body) || body === null) return [];
|
|
334
|
-
const record: FieldErrorBody = body;
|
|
335
|
-
if (isIssueList(record.issues)) return fromIssues(record.issues);
|
|
336
|
-
if (isIssueList(record.errors)) return fromIssues(record.errors);
|
|
337
|
-
return fromCodedFields(record) ?? fromFieldObject(record);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function isClientError(status: number | undefined): status is number {
|
|
341
|
-
return (
|
|
342
|
-
status !== undefined &&
|
|
343
|
-
status >= HTTP_CLIENT_ERROR_MIN &&
|
|
344
|
-
status <= HTTP_CLIENT_ERROR_MAX &&
|
|
345
|
-
!GLOBAL_STATUSES.has(status)
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Splits what a request threw into the errors its form shows under fields.
|
|
351
|
-
*
|
|
352
|
-
* Read, in order: a code the form maps to a field (`codes`, for any 4xx), a
|
|
353
|
-
* zod issue list (what `assertValidation` answers), a `{ field, message }`
|
|
354
|
-
* body (with optional `values` and `params`), the data API's
|
|
355
|
-
* `{ code, fields }` and a `field: message` text. A network failure, a 403, a 429
|
|
356
|
-
* or a 5xx never resolves to a field.
|
|
357
|
-
*
|
|
358
|
-
* @returns The field errors, one per field (the first issue wins), and
|
|
359
|
-
* whether part of the error belongs to no field of the form
|
|
360
|
-
*/
|
|
361
|
-
export function resolveFieldErrors<F extends string>(
|
|
362
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
363
|
-
options: ResolveFieldErrorsOptions<F>,
|
|
364
|
-
): FieldErrorResolution {
|
|
365
|
-
const status = apiErrorStatus(error);
|
|
366
|
-
if (!isClientError(status)) return { fields: [], hasUnmatched: true };
|
|
367
|
-
const body = bodyOf(error);
|
|
368
|
-
const mapped = lookupCode(codeOf(body), options.codes);
|
|
369
|
-
const candidates = mapped
|
|
370
|
-
? [mapped]
|
|
371
|
-
: VALIDATION_STATUSES.has(status)
|
|
372
|
-
? fromBody(body)
|
|
373
|
-
: [];
|
|
374
|
-
const known = new Set<string>(options.fields);
|
|
375
|
-
const fields: ApiFieldError[] = [];
|
|
376
|
-
let hasUnmatched = candidates.length === 0;
|
|
377
|
-
for (const candidate of candidates) {
|
|
378
|
-
if (!known.has(candidate.field)) {
|
|
379
|
-
hasUnmatched = true;
|
|
380
|
-
continue;
|
|
381
|
-
}
|
|
382
|
-
if (fields.some((entry) => entry.field === candidate.field)) continue;
|
|
383
|
-
fields.push(candidate);
|
|
384
|
-
}
|
|
385
|
-
return { fields, hasUnmatched: hasUnmatched || fields.length === 0 };
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* The data API's refusal of a body (`{ code, fields }`) as one sentence per
|
|
390
|
-
* field naming it, translated: "Loss reason is required." Undefined for any
|
|
391
|
-
* other error. `labelOf` gives a field's label, translated; the field's id
|
|
392
|
-
* stands in for one it does not know.
|
|
393
|
-
*/
|
|
394
|
-
export function describeFieldErrors(
|
|
395
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
396
|
-
translate: I18nTranslate,
|
|
397
|
-
labelOf: (field: string) => string | undefined,
|
|
398
|
-
): string | undefined {
|
|
399
|
-
const status = apiErrorStatus(error);
|
|
400
|
-
if (status === undefined || !VALIDATION_STATUSES.has(status)) {
|
|
401
|
-
return undefined;
|
|
402
|
-
}
|
|
403
|
-
const body = bodyOf(error);
|
|
404
|
-
if (!isObject(body) || body === null || Array.isArray(body)) {
|
|
405
|
-
return undefined;
|
|
406
|
-
}
|
|
407
|
-
const entries = fromCodedFields(body);
|
|
408
|
-
if (!entries?.length) return undefined;
|
|
409
|
-
return entries
|
|
410
|
-
.map(({ field, message }) =>
|
|
411
|
-
translate(NAMED_FIELD_ERROR_KEYS[message] ?? message, {
|
|
412
|
-
field: labelOf(field) ?? field,
|
|
413
|
-
}),
|
|
414
|
-
)
|
|
415
|
-
.join(" ");
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* The message of an error that belongs to no field, for its toast: the API's
|
|
420
|
-
* message key, the first validation issue's (or a generic one), else the
|
|
421
|
-
* generic server error.
|
|
422
|
-
*/
|
|
423
|
-
export function describeApiError(
|
|
424
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
425
|
-
): string {
|
|
426
|
-
return apiErrorText(error) ?? resolveApiErrorMessage(error);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* The message an error body carries (its text, its `message`, or its first
|
|
431
|
-
* validation issue's), or `undefined` when it carries none (a network
|
|
432
|
-
* failure).
|
|
433
|
-
*/
|
|
434
|
-
export function apiErrorText(
|
|
435
|
-
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
436
|
-
): string | undefined {
|
|
437
|
-
const body = bodyOf(error);
|
|
438
|
-
if (isIssueList(body)) return validationIssueMessage(body[0]);
|
|
439
|
-
const text = codeOf(body);
|
|
440
|
-
return text || undefined;
|
|
441
|
-
}
|
|
10
|
+
export * from "../build/composables/field-errors";
|
|
442
11
|
|
|
443
12
|
/** Id of the element holding a field's inline error. */
|
|
444
13
|
export function fieldErrorId(controlId: string): string {
|
|
@@ -555,10 +124,10 @@ export function useFieldErrors<F extends string>(
|
|
|
555
124
|
clear();
|
|
556
125
|
for (const entry of fields) {
|
|
557
126
|
if (!isField(entry.field)) continue;
|
|
558
|
-
errors[entry.field] =
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
127
|
+
errors[entry.field] = fieldErrorMessage(
|
|
128
|
+
entry,
|
|
129
|
+
errorPresenter.resolveError,
|
|
130
|
+
);
|
|
562
131
|
}
|
|
563
132
|
if (isField(first.field)) await focus(first.field);
|
|
564
133
|
return !hasUnmatched;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../build/composables/useHydrated";
|
|
@@ -412,6 +412,10 @@
|
|
|
412
412
|
"invalid": "This value isn’t valid.",
|
|
413
413
|
"invalid_email": "Enter a valid email address.",
|
|
414
414
|
"invalid_phone": "Enter a valid phone number, with its country.",
|
|
415
|
+
"invalid_iban": "Enter a valid IBAN, and check it for a typo.",
|
|
416
|
+
"invalid_bic": "Enter a valid BIC, 8 or 11 letters and digits.",
|
|
417
|
+
"invalid_vat_number": "Enter a valid VAT number, starting with its country code.",
|
|
418
|
+
"invalid_company_number": "Enter a valid company registration number.",
|
|
415
419
|
"too_long": "This value is too long.",
|
|
416
420
|
"too_short": "This value is too short.",
|
|
417
421
|
"too_small": "This value is too small.",
|
|
@@ -705,6 +709,10 @@
|
|
|
705
709
|
"row_not_found": "Row not found",
|
|
706
710
|
"route_not_found": "Route not found",
|
|
707
711
|
"lock_not_found": "Lock not found",
|
|
712
|
+
"capture_not_found": "This mockup has no captured image",
|
|
713
|
+
"capture_not_image": "The body is not a WebP or PNG image",
|
|
714
|
+
"capture_not_first_page": "The image is not of the first page of the mockup",
|
|
715
|
+
"capture_page_missing": "Give the page the image shows in the page query",
|
|
708
716
|
"spec_not_object": "spec.json holds no JSON object",
|
|
709
717
|
"spec_changed": "spec.json changed since it was read",
|
|
710
718
|
"lock_spec_changed": "spec.json changed since it was read, so the pointer may name another block: read it again and retake the lock",
|
|
@@ -412,6 +412,10 @@
|
|
|
412
412
|
"invalid": "Cette valeur n’est pas valide.",
|
|
413
413
|
"invalid_email": "Saisissez une adresse e-mail valide.",
|
|
414
414
|
"invalid_phone": "Saisissez un numéro de téléphone valide, avec son pays.",
|
|
415
|
+
"invalid_iban": "Saisissez un IBAN valide, sans faute de frappe.",
|
|
416
|
+
"invalid_bic": "Saisissez un BIC valide, de 8 ou 11 lettres et chiffres.",
|
|
417
|
+
"invalid_vat_number": "Saisissez un numéro de TVA valide, précédé du code de son pays.",
|
|
418
|
+
"invalid_company_number": "Saisissez un numéro d’entreprise valide.",
|
|
415
419
|
"too_long": "Cette valeur est trop longue.",
|
|
416
420
|
"too_short": "Cette valeur est trop courte.",
|
|
417
421
|
"too_small": "Cette valeur est trop petite.",
|
|
@@ -705,6 +709,10 @@
|
|
|
705
709
|
"row_not_found": "Ligne introuvable",
|
|
706
710
|
"route_not_found": "Route introuvable",
|
|
707
711
|
"lock_not_found": "Verrou introuvable",
|
|
712
|
+
"capture_not_found": "Cette maquette n'a aucune image capturée",
|
|
713
|
+
"capture_not_image": "Le corps n'est pas une image WebP ou PNG",
|
|
714
|
+
"capture_not_first_page": "L'image n'est pas celle de la première page de la maquette",
|
|
715
|
+
"capture_page_missing": "Indiquez la page que montre l'image dans le paramètre page",
|
|
708
716
|
"spec_not_object": "spec.json ne contient aucun objet JSON",
|
|
709
717
|
"spec_changed": "spec.json a changé depuis sa lecture",
|
|
710
718
|
"lock_spec_changed": "spec.json a changé depuis sa lecture, le pointeur peut donc désigner un autre bloc : relisez-le et reprenez le verrou",
|
|
@@ -14,6 +14,7 @@ import { usePageRecordLabel } from "#dms-core/app/composables/page/usePageRecord
|
|
|
14
14
|
import type { CategoryInfo } from "#dms-core/app/types/page";
|
|
15
15
|
import { resolveModuleLandingSlug } from "../../../utils/moduleLanding";
|
|
16
16
|
import {
|
|
17
|
+
crumbLabel,
|
|
17
18
|
foldBreadcrumb,
|
|
18
19
|
isFoldedCrumbs,
|
|
19
20
|
withParentCrumb,
|
|
@@ -181,8 +182,12 @@ const breadcrumb = computed((): BreadcrumbItem[] => {
|
|
|
181
182
|
const to = `/${paths.slice(0, index + 1).join("/")}`;
|
|
182
183
|
|
|
183
184
|
const matchingRoute = siteLayout.findMatchingRouteOrCategory(to);
|
|
185
|
+
const label = crumbLabel(
|
|
186
|
+
matchingRoute?.metadata.displayName,
|
|
187
|
+
processI18n,
|
|
188
|
+
);
|
|
184
189
|
|
|
185
|
-
if (!matchingRoute) {
|
|
190
|
+
if (!matchingRoute || !label) {
|
|
186
191
|
return null;
|
|
187
192
|
}
|
|
188
193
|
|
|
@@ -195,9 +200,7 @@ const breadcrumb = computed((): BreadcrumbItem[] => {
|
|
|
195
200
|
route.query,
|
|
196
201
|
);
|
|
197
202
|
|
|
198
|
-
const crumb: BreadcrumbItem = {
|
|
199
|
-
label: processI18n(matchingRoute.metadata?.displayName || path),
|
|
200
|
-
};
|
|
203
|
+
const crumb: BreadcrumbItem = { label };
|
|
201
204
|
if (target) crumb.to = target;
|
|
202
205
|
return crumb;
|
|
203
206
|
})
|
|
@@ -15,19 +15,16 @@ import { useMediaQuery } from "@vueuse/core";
|
|
|
15
15
|
import DmsSidebarUserMenu from "./SidebarUserMenu.vue";
|
|
16
16
|
import MockupSidebarMenu from "./MockupSidebarMenu.vue";
|
|
17
17
|
import BlockPreviewSketch from "#dms-ui/app/entries/components/block-preview/BlockPreviewSketch";
|
|
18
|
-
import MockupWorkspaceSwitcher from "#dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher";
|
|
19
18
|
import { useInstalledModuleCount } from "../../../composables/page/useInstalledModules";
|
|
20
19
|
import type { PreviewNavigation } from "#dms-ui/app/entries/utils/blockPreview";
|
|
21
20
|
import { PREVIEW_NAVIGATION_ATTRIBUTE } from "#dms-ui/app/entries/composables/block-preview/previewNavigation";
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* The dashboard's sidebar: the brand, the sidebar widgets, the search, the
|
|
25
|
-
* menu and the account. Given a mockup's `navigation`,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* SaaS mode its workspace switcher takes the place of dms-saas's own;
|
|
30
|
-
* everything else is drawn as in the dashboard and acts on nothing. With `lockedCollapsed` it
|
|
24
|
+
* menu and the account. Given a mockup's `navigation`, its menu is the
|
|
25
|
+
* mockup's own sections, none of the app's entries or favorites, and the
|
|
26
|
+
* mockup's widget sketches follow the app's widgets; everything else
|
|
27
|
+
* is drawn as in the dashboard and acts on nothing. With `lockedCollapsed` it
|
|
31
28
|
* is the real sidebar fixed to its icon rail: no fold control, the size and
|
|
32
29
|
* the mobile menu ignored, and the dashboard's persisted collapsed state read
|
|
33
30
|
* and written by no one.
|
|
@@ -39,9 +36,6 @@ const props = defineProps<{
|
|
|
39
36
|
|
|
40
37
|
const MODULES_PATH = "/modules";
|
|
41
38
|
|
|
42
|
-
/** The sidebar widget of dms-saas a mockup in SaaS mode replaces with its own switcher. */
|
|
43
|
-
const SAAS_SWITCHER_WIDGET = "saas:workspace-switcher";
|
|
44
|
-
|
|
45
39
|
const MODULES_FULL_ID = "modules";
|
|
46
40
|
const MODULES_TREE_KEY = "modules";
|
|
47
41
|
const MODULES_ICON = "i-ph-squares-four-light";
|
|
@@ -146,12 +140,8 @@ const widgetsAtPosition = (position: SidebarWidgetPosition) =>
|
|
|
146
140
|
(widget) => resolveSidebarWidgetPosition(widget) === position,
|
|
147
141
|
),
|
|
148
142
|
);
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
widgetsAtTop.value.filter(
|
|
152
|
-
(widget) =>
|
|
153
|
-
!(props.navigation?.workspace && widget.id === SAAS_SWITCHER_WIDGET),
|
|
154
|
-
),
|
|
143
|
+
const widgetsAboveSearchBar = widgetsAtPosition(
|
|
144
|
+
SidebarWidgetPosition.ABOVE_SEARCH_BAR,
|
|
155
145
|
);
|
|
156
146
|
const widgetsBelowSearchBar = widgetsAtPosition(
|
|
157
147
|
SidebarWidgetPosition.BELOW_SEARCH_BAR,
|
|
@@ -260,7 +250,7 @@ const moduleCount = isMockup.value
|
|
|
260
250
|
? computed(() => 0)
|
|
261
251
|
: useInstalledModuleCount();
|
|
262
252
|
|
|
263
|
-
/** A mockup's sidebar
|
|
253
|
+
/** A mockup's sidebar is the spec's own menu: the app's favorites stay out of it. */
|
|
264
254
|
const shownFavoriteItems = computed(() =>
|
|
265
255
|
isMockup.value ? [] : favoriteItems.value,
|
|
266
256
|
);
|
|
@@ -367,11 +357,6 @@ const footerGroups = computed((): NavigationMenuItem[][] =>
|
|
|
367
357
|
</template>
|
|
368
358
|
|
|
369
359
|
<template #default="{ collapsed: sidebarRail }">
|
|
370
|
-
<MockupWorkspaceSwitcher
|
|
371
|
-
v-if="navigation?.workspace"
|
|
372
|
-
:workspace="navigation.workspace"
|
|
373
|
-
:collapsed="isRail(sidebarRail)"
|
|
374
|
-
/>
|
|
375
360
|
<component
|
|
376
361
|
:is="widget.component"
|
|
377
362
|
v-for="widget in widgetsAboveSearchBar"
|
|
@@ -440,19 +425,19 @@ const footerGroups = computed((): NavigationMenuItem[][] =>
|
|
|
440
425
|
orientation="vertical"
|
|
441
426
|
/>
|
|
442
427
|
|
|
443
|
-
<DmsNavigationMenu
|
|
444
|
-
v-model="openCategories"
|
|
445
|
-
v-bind="chromeAttrs"
|
|
446
|
-
:collapsed="isRail(sidebarRail)"
|
|
447
|
-
:items="items"
|
|
448
|
-
orientation="vertical"
|
|
449
|
-
/>
|
|
450
428
|
<MockupSidebarMenu
|
|
451
429
|
v-if="navigation"
|
|
452
430
|
v-model:open="openCategories"
|
|
453
431
|
:navigation="navigation"
|
|
454
432
|
:collapsed="isRail(sidebarRail)"
|
|
455
433
|
/>
|
|
434
|
+
<DmsNavigationMenu
|
|
435
|
+
v-else
|
|
436
|
+
v-model="openCategories"
|
|
437
|
+
:collapsed="isRail(sidebarRail)"
|
|
438
|
+
:items="items"
|
|
439
|
+
orientation="vertical"
|
|
440
|
+
/>
|
|
456
441
|
</template>
|
|
457
442
|
|
|
458
443
|
<template #footer="{ collapsed: sidebarRail }">
|