@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
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts
CHANGED
|
@@ -10,11 +10,6 @@ import type {
|
|
|
10
10
|
MockupWidth,
|
|
11
11
|
} from "../../utils/mockup";
|
|
12
12
|
import { mockupPageRender } from "../../utils/mockupFrame";
|
|
13
|
-
import {
|
|
14
|
-
type MockupTenancy,
|
|
15
|
-
tenantOf,
|
|
16
|
-
withTenantFixtures,
|
|
17
|
-
} from "../../utils/mockupTenancy";
|
|
18
13
|
import { followedRecord, mockupPageParams } from "../../utils/mockupLinks";
|
|
19
14
|
import type { PagePoint } from "../../utils/mockupPins";
|
|
20
15
|
import type { MockupSectionEdit } from "../../utils/mockupSections";
|
|
@@ -25,8 +20,6 @@ import { useMockupSketchStates } from "./useMockupSketchStates";
|
|
|
25
20
|
import { usePreviewFrame } from "./usePreviewFrame";
|
|
26
21
|
|
|
27
22
|
interface PageFrameOptions {
|
|
28
|
-
/** The mockup's folder name, which its fixture routes are under. */
|
|
29
|
-
name: string;
|
|
30
23
|
editing: MockupEditing;
|
|
31
24
|
width: Readonly<Ref<MockupWidth>>;
|
|
32
25
|
/** The state the canvas draws. */
|
|
@@ -35,15 +28,13 @@ interface PageFrameOptions {
|
|
|
35
28
|
currentPage: Readonly<Ref<MockupPageState | undefined>>;
|
|
36
29
|
/** The row the page shows. */
|
|
37
30
|
record: Readonly<Ref<string | undefined>>;
|
|
31
|
+
/** The query of the page, as its URL gives it. */
|
|
32
|
+
query: Readonly<Ref<Record<string, string> | undefined>>;
|
|
38
33
|
realData: Readonly<Ref<boolean>>;
|
|
39
|
-
/** How the mockup is seen: in SaaS mode the page reads its fixtures as the active tenant. */
|
|
40
|
-
tenancy: Readonly<Ref<MockupTenancy>>;
|
|
41
34
|
navigation: Readonly<Ref<PreviewNavigation>>;
|
|
42
35
|
isPreviewing: Readonly<Ref<boolean>>;
|
|
43
36
|
/** Opens the page `id`, on the row `record` when a link names one. */
|
|
44
37
|
openPage: (id: string, record?: string) => void;
|
|
45
|
-
/** The preview's workspace switcher picked the tenant `id`. */
|
|
46
|
-
onTenant: (id: string) => void;
|
|
47
38
|
onSectionEdit: (edit: MockupSectionEdit) => void;
|
|
48
39
|
/** Escape was pressed in the preview, and nothing of its page took it. */
|
|
49
40
|
onEscape: () => void;
|
|
@@ -66,16 +57,13 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
66
57
|
function sync(): void {
|
|
67
58
|
const page = options.currentPage.value;
|
|
68
59
|
if (!page) return;
|
|
69
|
-
const tree = sketchStates.treeOf(page, options.realData.value);
|
|
70
|
-
const tenant = tenantOf(options.tenancy.value);
|
|
71
60
|
bridge.post(
|
|
72
61
|
mockupPageRender(
|
|
73
62
|
page,
|
|
74
|
-
|
|
75
|
-
? tree
|
|
76
|
-
: withTenantFixtures(tree, options.name, tenant),
|
|
63
|
+
sketchStates.treeOf(page, options.realData.value),
|
|
77
64
|
options.navigation.value,
|
|
78
65
|
mockupPageParams(page, options.record.value),
|
|
66
|
+
options.query.value,
|
|
79
67
|
),
|
|
80
68
|
);
|
|
81
69
|
bridge.post(previewInspectMessage(!options.isPreviewing.value));
|
|
@@ -111,7 +99,6 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
111
99
|
options.record.value,
|
|
112
100
|
),
|
|
113
101
|
),
|
|
114
|
-
onTenant: options.onTenant,
|
|
115
102
|
onEscape: options.onEscape,
|
|
116
103
|
onSectionEdit: options.onSectionEdit,
|
|
117
104
|
});
|
|
@@ -126,9 +113,9 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
126
113
|
options.shown,
|
|
127
114
|
() => options.currentPage.value?.id,
|
|
128
115
|
options.realData,
|
|
129
|
-
options.tenancy,
|
|
130
116
|
options.navigation,
|
|
131
117
|
options.record,
|
|
118
|
+
options.query,
|
|
132
119
|
],
|
|
133
120
|
sync,
|
|
134
121
|
);
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, type WritableComputedRef, type ComputedRef } from "vue";
|
|
2
2
|
import { readQueryValue } from "../../utils/mockup";
|
|
3
|
-
import { RECORD_QUERY } from "../../utils/mockupLinks";
|
|
3
|
+
import { mockupPageQuery, RECORD_QUERY } from "../../utils/mockupLinks";
|
|
4
4
|
import { detach } from "../detach";
|
|
5
5
|
|
|
6
6
|
const PAGE_QUERY = "page";
|
|
@@ -11,6 +11,8 @@ export interface MockupRoutePage {
|
|
|
11
11
|
page: WritableComputedRef<string | undefined>;
|
|
12
12
|
/** The row a link from a row passed the page. */
|
|
13
13
|
record: ComputedRef<string | undefined>;
|
|
14
|
+
/** The query of the page on screen: the URL's, without what the viewer reads itself. */
|
|
15
|
+
query: ComputedRef<Record<string, string> | undefined>;
|
|
14
16
|
/** Opens the page `id`, on the row `record` when a link names one; no `id` opens the Overview. */
|
|
15
17
|
open: (id: string | undefined, record?: string) => void;
|
|
16
18
|
}
|
|
@@ -47,6 +49,7 @@ export function useMockupRoutePage(): MockupRoutePage {
|
|
|
47
49
|
set: (id) => open(id),
|
|
48
50
|
}),
|
|
49
51
|
record: computed(() => readQueryValue(route.query[RECORD_QUERY])),
|
|
52
|
+
query: computed(() => mockupPageQuery(route.query)),
|
|
50
53
|
open,
|
|
51
54
|
};
|
|
52
55
|
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface ViewerPagesOptions {
|
|
|
22
22
|
* Overview, is a new entry of the browser's history.
|
|
23
23
|
*/
|
|
24
24
|
export function useMockupViewerPages(options: ViewerPagesOptions) {
|
|
25
|
-
const { page: requestedPage, record, open } = useMockupRoutePage();
|
|
25
|
+
const { page: requestedPage, record, query, open } = useMockupRoutePage();
|
|
26
26
|
const shown = computed(
|
|
27
27
|
() => options.history.previewing.value?.state ?? options.state.value,
|
|
28
28
|
);
|
|
@@ -52,8 +52,10 @@ export function useMockupViewerPages(options: ViewerPagesOptions) {
|
|
|
52
52
|
categories: computed(() => shown.value?.categories ?? []),
|
|
53
53
|
modules: computed(() => shown.value?.modules ?? []),
|
|
54
54
|
issues: computed(() => shown.value?.issues ?? []),
|
|
55
|
+
warnings: computed(() => shown.value?.warnings ?? []),
|
|
55
56
|
requestedPage,
|
|
56
57
|
record,
|
|
58
|
+
query,
|
|
57
59
|
open,
|
|
58
60
|
currentPage,
|
|
59
61
|
isOverview: computed(
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts
CHANGED
|
@@ -21,15 +21,11 @@ interface ViewerShortcutsOptions {
|
|
|
21
21
|
history: MockupVersions;
|
|
22
22
|
overview: MockupOverview;
|
|
23
23
|
isOverview: Readonly<Ref<boolean>>;
|
|
24
|
-
/** Whether the DB explorer is over the canvas: no key reaches the page behind it. */
|
|
25
|
-
isDatabase: Readonly<Ref<boolean>>;
|
|
26
24
|
isReadOnly: Readonly<Ref<boolean>>;
|
|
27
25
|
isPreviewing: Ref<boolean>;
|
|
28
26
|
showsShortcuts: Ref<boolean>;
|
|
29
27
|
/** Closes the page on screen, back to the Overview. */
|
|
30
28
|
closePage: () => void;
|
|
31
|
-
/** Closes the DB explorer, back to the canvas. */
|
|
32
|
-
closeDatabase: () => void;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
/** What the viewer's shortcuts and its top bar do and share. */
|
|
@@ -112,11 +108,9 @@ export function useMockupViewerShortcuts(
|
|
|
112
108
|
() => (options.isPreviewing.value = !options.isPreviewing.value),
|
|
113
109
|
),
|
|
114
110
|
close_preview: always(() => (options.isPreviewing.value = false)),
|
|
115
|
-
close_database: always(options.closeDatabase),
|
|
116
111
|
};
|
|
117
112
|
|
|
118
113
|
const view = computed((): MockupView => {
|
|
119
|
-
if (options.isDatabase.value) return "database";
|
|
120
114
|
if (options.isOverview.value) {
|
|
121
115
|
return options.isReadOnly.value ? "overview_version" : "overview";
|
|
122
116
|
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, shallowRef, watch, type Ref } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
MOCKUP_CAPTURE_SUFFIX,
|
|
4
|
+
mockupEndpoint,
|
|
5
|
+
type MockupDataMode,
|
|
6
|
+
type MockupPageState,
|
|
7
|
+
} from "../../utils/mockup";
|
|
8
|
+
import {
|
|
9
|
+
captureKey,
|
|
10
|
+
claimCaptureUpload,
|
|
11
|
+
mockupCaptures,
|
|
12
|
+
releaseCaptureUpload,
|
|
13
|
+
storePageCapture,
|
|
14
|
+
type CapturedLayout,
|
|
15
|
+
} from "../../utils/mockupCaptures";
|
|
16
|
+
import { readsRealData } from "../../utils/mockupRealData";
|
|
17
|
+
|
|
18
|
+
/** How long a page whose capture failed waits before its live frame is asked again: a slow page or a busy machine may draw it next time. */
|
|
19
|
+
const CAPTURE_RETRY_MS = 60_000;
|
|
20
|
+
|
|
21
|
+
/** What the captures of an Overview are kept by. */
|
|
22
|
+
export interface OverviewCaptureOptions {
|
|
23
|
+
/** The mockup's name, which the captures are kept under. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Whether the Overview is on screen: opening it again asks again for the captures that failed. */
|
|
26
|
+
isOpen: Readonly<Ref<boolean>>;
|
|
27
|
+
/** The pages, whose keys the captures are current for. */
|
|
28
|
+
pages: Readonly<Ref<readonly MockupPageState[]>>;
|
|
29
|
+
/** The developer's Real data choice, if any: each page is captured by it. */
|
|
30
|
+
dataMode: Readonly<Ref<MockupDataMode | undefined>>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The images of the pages, which show a page whose frame is not drawn live:
|
|
35
|
+
* kept by mockup, outside the viewer, which the dashboard builds again on a
|
|
36
|
+
* step of the browser's history, so a viewer built again finds them, with
|
|
37
|
+
* the height and blocks each page had when it was captured. A capture is
|
|
38
|
+
* current while its key is the page's own, which leaves out the sidebar, so
|
|
39
|
+
* changing one page recaptures that page alone. A page whose live frame could
|
|
40
|
+
* not draw its image is not asked again for the same key until
|
|
41
|
+
* {@link CAPTURE_RETRY_MS} passed, or the Overview opens again. The capture
|
|
42
|
+
* of the first page, once current and drawn from fixtures, is also sent to
|
|
43
|
+
* the server, which keeps it beside the spec for the cards of the Mockups
|
|
44
|
+
* page. A drawing of real rows is never sent, since `mockups/` is committed
|
|
45
|
+
* and read by the AI. A newer capture cancels the send of an older one, a
|
|
46
|
+
* failed send is dropped, and a send outlives the Overview.
|
|
47
|
+
*/
|
|
48
|
+
export function useOverviewCaptures(
|
|
49
|
+
options: OverviewCaptureOptions,
|
|
50
|
+
drawnOf: (page: string) => CapturedLayout,
|
|
51
|
+
) {
|
|
52
|
+
const captures = mockupCaptures(options.name);
|
|
53
|
+
const { $authFetch } = useAuthFetch();
|
|
54
|
+
let upload: AbortController | undefined;
|
|
55
|
+
const failed = shallowRef<ReadonlyMap<string, string>>(new Map());
|
|
56
|
+
const retries = new Set<ReturnType<typeof setTimeout>>();
|
|
57
|
+
function forget(page: string, key: string): void {
|
|
58
|
+
if (failed.value.get(page) !== key) return;
|
|
59
|
+
const next = new Map(failed.value);
|
|
60
|
+
next.delete(page);
|
|
61
|
+
failed.value = next;
|
|
62
|
+
}
|
|
63
|
+
watch(options.isOpen, () => {
|
|
64
|
+
if (failed.value.size) failed.value = new Map();
|
|
65
|
+
});
|
|
66
|
+
onBeforeUnmount(() => {
|
|
67
|
+
for (const retry of retries) clearTimeout(retry);
|
|
68
|
+
});
|
|
69
|
+
const keys = computed(
|
|
70
|
+
() =>
|
|
71
|
+
new Map(
|
|
72
|
+
options.pages.value.map((page) => [
|
|
73
|
+
page.id,
|
|
74
|
+
captureKey(page, readsRealData(page, options.dataMode.value)),
|
|
75
|
+
]),
|
|
76
|
+
),
|
|
77
|
+
);
|
|
78
|
+
const firstCapture = computed(() => {
|
|
79
|
+
const first = options.pages.value[0];
|
|
80
|
+
if (!first || readsRealData(first, options.dataMode.value))
|
|
81
|
+
return undefined;
|
|
82
|
+
const page = first.id;
|
|
83
|
+
const key = keys.value.get(page);
|
|
84
|
+
return key !== undefined && captures.value.get(page)?.key === key
|
|
85
|
+
? { page, key }
|
|
86
|
+
: undefined;
|
|
87
|
+
});
|
|
88
|
+
function send(page: string, key: string): void {
|
|
89
|
+
const url = captures.value.get(page)?.url;
|
|
90
|
+
if (!url || !claimCaptureUpload(options.name, page, key)) return;
|
|
91
|
+
upload?.abort();
|
|
92
|
+
const current = new AbortController();
|
|
93
|
+
upload = current;
|
|
94
|
+
fetch(url, { signal: current.signal })
|
|
95
|
+
.then((response) => response.blob())
|
|
96
|
+
.then((image) =>
|
|
97
|
+
$authFetch(mockupEndpoint(options.name, MOCKUP_CAPTURE_SUFFIX), {
|
|
98
|
+
method: "PUT",
|
|
99
|
+
query: { page },
|
|
100
|
+
body: image,
|
|
101
|
+
signal: current.signal,
|
|
102
|
+
}),
|
|
103
|
+
)
|
|
104
|
+
.catch(() => releaseCaptureUpload(options.name, page, key));
|
|
105
|
+
}
|
|
106
|
+
watch(
|
|
107
|
+
() => {
|
|
108
|
+
const first = firstCapture.value;
|
|
109
|
+
return first && JSON.stringify([first.page, first.key]);
|
|
110
|
+
},
|
|
111
|
+
() => {
|
|
112
|
+
const first = firstCapture.value;
|
|
113
|
+
if (first) send(first.page, first.key);
|
|
114
|
+
},
|
|
115
|
+
{ immediate: true },
|
|
116
|
+
);
|
|
117
|
+
return {
|
|
118
|
+
captures,
|
|
119
|
+
failed,
|
|
120
|
+
keys,
|
|
121
|
+
needsCapture: (page: string, key: string) =>
|
|
122
|
+
captures.value.get(page)?.key !== key && failed.value.get(page) !== key,
|
|
123
|
+
capture: (page: string, key: string, image: Blob) =>
|
|
124
|
+
storePageCapture(options.name, page, key, image, drawnOf(page)),
|
|
125
|
+
captureFailed: (page: string, key: string) => {
|
|
126
|
+
failed.value = new Map(failed.value).set(page, key);
|
|
127
|
+
const retry = setTimeout(() => {
|
|
128
|
+
retries.delete(retry);
|
|
129
|
+
forget(page, key);
|
|
130
|
+
}, CAPTURE_RETRY_MS);
|
|
131
|
+
retries.add(retry);
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** The captures of an Overview's pages, and what records them. */
|
|
137
|
+
export type OverviewCaptures = ReturnType<typeof useOverviewCaptures>;
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
10
10
|
import {
|
|
11
11
|
parsePreviewOutboundMessage,
|
|
12
|
+
previewCaptureRequestMessage,
|
|
12
13
|
type PreviewBlockRect,
|
|
13
14
|
type PreviewInboundMessage,
|
|
14
15
|
type PreviewOutboundMessage,
|
|
@@ -30,8 +31,6 @@ interface PreviewFrameOptions {
|
|
|
30
31
|
onText?: (text: PreviewTextMessage) => void;
|
|
31
32
|
/** An entry of the preview's sidebar, or a link to a page of the mockup, was picked: the page's id, and the row a link from a row passes. */
|
|
32
33
|
onNavigate?: (id: string, record?: string) => void;
|
|
33
|
-
/** The preview's workspace switcher picked a tenant, by its id. */
|
|
34
|
-
onTenant?: (id: string) => void;
|
|
35
34
|
/** Escape was pressed in the preview, and nothing of its page took it. */
|
|
36
35
|
onEscape?: () => void;
|
|
37
36
|
/** The preview's sidebar changed its sections. */
|
|
@@ -45,6 +44,21 @@ export interface PreviewFrame {
|
|
|
45
44
|
isReady: Ref<boolean>;
|
|
46
45
|
/** Hands the preview a message; dropped until the preview is ready. */
|
|
47
46
|
post: (message: PreviewInboundMessage) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Has the preview draw its frame to an image, as it is now. It rejects when
|
|
49
|
+
* the preview is not ready, fails to draw, is replaced or goes away, or
|
|
50
|
+
* does not answer within {@link CAPTURE_TIMEOUT_MS}.
|
|
51
|
+
*/
|
|
52
|
+
capture: () => Promise<Blob>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** How long a capture waits for the preview's answer: its page may still be loading data, which it waits for. */
|
|
56
|
+
export const CAPTURE_TIMEOUT_MS = 30_000;
|
|
57
|
+
|
|
58
|
+
/** A `capture` request waiting for its answer. */
|
|
59
|
+
interface PendingCapture {
|
|
60
|
+
resolve: (image: Blob) => void;
|
|
61
|
+
reject: (reason: Error) => void;
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
/**
|
|
@@ -58,6 +72,13 @@ export interface PreviewFrame {
|
|
|
58
72
|
export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
59
73
|
const height = ref<number>();
|
|
60
74
|
const isReady = ref(false);
|
|
75
|
+
const pending = new Map<number, PendingCapture>();
|
|
76
|
+
let lastCaptureId = 0;
|
|
77
|
+
|
|
78
|
+
function settleCaptures(reason: Error): void {
|
|
79
|
+
for (const capture of pending.values()) capture.reject(reason);
|
|
80
|
+
pending.clear();
|
|
81
|
+
}
|
|
61
82
|
|
|
62
83
|
const handlers: Record<
|
|
63
84
|
PreviewOutboundMessage["type"],
|
|
@@ -71,6 +92,13 @@ export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
|
71
92
|
if (message.type === "resize") height.value = message.height;
|
|
72
93
|
},
|
|
73
94
|
error: () => {},
|
|
95
|
+
capture: (message) => {
|
|
96
|
+
if (message.type !== "capture") return;
|
|
97
|
+
const waiting = pending.get(message.id);
|
|
98
|
+
pending.delete(message.id);
|
|
99
|
+
if ("image" in message) waiting?.resolve(message.image);
|
|
100
|
+
else waiting?.reject(new Error(message.error));
|
|
101
|
+
},
|
|
74
102
|
select: (message) => {
|
|
75
103
|
if (message.type === "select") options.onSelect(message.path);
|
|
76
104
|
},
|
|
@@ -86,9 +114,6 @@ export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
|
86
114
|
options.onNavigate?.(message.id, message.record);
|
|
87
115
|
}
|
|
88
116
|
},
|
|
89
|
-
tenant: (message) => {
|
|
90
|
-
if (message.type === "tenant") options.onTenant?.(message.id);
|
|
91
|
-
},
|
|
92
117
|
escape: () => options.onEscape?.(),
|
|
93
118
|
"section-edit": (message) => {
|
|
94
119
|
if (message.type === "section-edit")
|
|
@@ -111,19 +136,49 @@ export function usePreviewFrame(options: PreviewFrameOptions): PreviewFrame {
|
|
|
111
136
|
|
|
112
137
|
watch(options.frame, () => {
|
|
113
138
|
isReady.value = false;
|
|
139
|
+
settleCaptures(new Error("The preview was replaced"));
|
|
114
140
|
});
|
|
115
141
|
onMounted(() => window.addEventListener("message", onMessage));
|
|
116
|
-
onBeforeUnmount(() =>
|
|
142
|
+
onBeforeUnmount(() => {
|
|
143
|
+
window.removeEventListener("message", onMessage);
|
|
144
|
+
settleCaptures(new Error("The preview is gone"));
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
function post(message: PreviewInboundMessage): void {
|
|
148
|
+
if (!isReady.value) return;
|
|
149
|
+
options.frame.value?.contentWindow?.postMessage(
|
|
150
|
+
message,
|
|
151
|
+
window.location.origin,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
117
154
|
|
|
118
155
|
return {
|
|
119
156
|
height,
|
|
120
157
|
isReady,
|
|
121
|
-
post
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
158
|
+
post,
|
|
159
|
+
capture: () =>
|
|
160
|
+
new Promise<Blob>((resolve, reject) => {
|
|
161
|
+
if (!isReady.value) {
|
|
162
|
+
reject(new Error("The preview is not ready"));
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
lastCaptureId += 1;
|
|
166
|
+
const id = lastCaptureId;
|
|
167
|
+
const timer = setTimeout(() => {
|
|
168
|
+
pending.delete(id);
|
|
169
|
+
reject(new Error("The preview did not answer"));
|
|
170
|
+
}, CAPTURE_TIMEOUT_MS);
|
|
171
|
+
pending.set(id, {
|
|
172
|
+
resolve: (image) => {
|
|
173
|
+
clearTimeout(timer);
|
|
174
|
+
resolve(image);
|
|
175
|
+
},
|
|
176
|
+
reject: (reason) => {
|
|
177
|
+
clearTimeout(timer);
|
|
178
|
+
reject(reason);
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
post(previewCaptureRequestMessage(id));
|
|
182
|
+
}),
|
|
128
183
|
};
|
|
129
184
|
}
|
|
@@ -33,11 +33,19 @@ function isRecord(
|
|
|
33
33
|
return isObject(value) && value !== null;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/** The
|
|
37
|
-
|
|
36
|
+
/** The part of an Inertia visit the frame reads, from its `before` event. */
|
|
37
|
+
interface PendingVisit {
|
|
38
|
+
url: URL;
|
|
39
|
+
/** Set when the router fetches the page ahead, on hover, without opening it. */
|
|
40
|
+
prefetch: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The visit an Inertia `before` event announces. */
|
|
44
|
+
function visitOf(event: Event): PendingVisit | undefined {
|
|
38
45
|
if (!(event instanceof CustomEvent) || !isRecord(event.detail)) return;
|
|
39
46
|
const visit = event.detail.visit;
|
|
40
|
-
|
|
47
|
+
if (!isRecord(visit) || !(visit.url instanceof URL)) return;
|
|
48
|
+
return { url: visit.url, prefetch: visit.prefetch === true };
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
/** The page of the mockup the link under `target` opens, when it is one. */
|
|
@@ -61,7 +69,8 @@ function isPlainClick(event: MouseEvent): boolean {
|
|
|
61
69
|
/**
|
|
62
70
|
* Keeps the preview on its page, as a frame of the mockup viewer: a visit to
|
|
63
71
|
* another page is cancelled, and when it goes to a page of the mockup, the
|
|
64
|
-
* embedding page opens that page instead. A
|
|
72
|
+
* embedding page opens that page instead. A prefetch of a hovered link is
|
|
73
|
+
* cancelled and opens nothing. A plain click on a link to a page of
|
|
65
74
|
* the mockup does the same while the page is not inspected; an Inertia link
|
|
66
75
|
* would visit it, a plain anchor would load it in the frame. Escape is handed
|
|
67
76
|
* to the embedding page when no menu or dialog of the page is open.
|
|
@@ -72,10 +81,11 @@ export function usePreviewLinks(options: PreviewLinksOptions): PreviewLinks {
|
|
|
72
81
|
}
|
|
73
82
|
|
|
74
83
|
function onVisit(event: Event): void {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
84
|
+
const visit = visitOf(event);
|
|
85
|
+
if (!visit || visit.url.pathname === window.location.pathname) return;
|
|
77
86
|
event.preventDefault();
|
|
78
|
-
|
|
87
|
+
if (visit.prefetch) return;
|
|
88
|
+
const link = mockupLinkOf(visit.url.href, window.location.href);
|
|
79
89
|
if (link) follow(link);
|
|
80
90
|
}
|
|
81
91
|
|
|
@@ -45,6 +45,12 @@ const REQUEST_FREE_INPUTS: ReadonlyMap<string, ReadonlySet<string>> = new Map(
|
|
|
45
45
|
"dms-input-number": NUMBER_KEYS,
|
|
46
46
|
"dms-input-percentage": NUMBER_KEYS,
|
|
47
47
|
"dms-input-phone": ["placeholder", "requiredPrefix", "defaultCountry"],
|
|
48
|
+
"dms-input-identifier": [
|
|
49
|
+
"identifier",
|
|
50
|
+
"placeholder",
|
|
51
|
+
"defaultCountry",
|
|
52
|
+
"country",
|
|
53
|
+
],
|
|
48
54
|
"dms-input-password": [
|
|
49
55
|
"placeholder",
|
|
50
56
|
"minLength",
|
package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts
CHANGED
|
@@ -12,6 +12,10 @@ export const CascaderPath = defineAsyncComponent(
|
|
|
12
12
|
() => import("../../../components/table-view/CascaderPath.vue"),
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
+
export const RepeaterTable = defineAsyncComponent(
|
|
16
|
+
() => import("../../../components/form/components/RepeaterTable.vue"),
|
|
17
|
+
);
|
|
18
|
+
|
|
15
19
|
export const DisplayRichText = defineAsyncComponent(
|
|
16
20
|
() => import("../../../components/form/components/DisplayRichText.vue"),
|
|
17
21
|
);
|
package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts
CHANGED
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
import { formatDuration } from "#dms-core/app/utils/formatter";
|
|
13
13
|
import { withNumberSuffix } from "./numberSuffix";
|
|
14
14
|
import { formatPhone } from "../../utils/phoneNumber";
|
|
15
|
+
import {
|
|
16
|
+
formatIdentifier,
|
|
17
|
+
type IdentifierKind,
|
|
18
|
+
} from "../../utils/legalIdentifier";
|
|
15
19
|
import { DMS_TONE_TEXT } from "../../utils/tone";
|
|
16
20
|
import { getAppTranslation } from "../../../../../dms-core/app/composables/translation/useTranslation";
|
|
17
21
|
|
|
@@ -100,6 +104,31 @@ function renderText(
|
|
|
100
104
|
return h("span", { class: DMS_TONE_TEXT[tone] }, [childOf(value)]);
|
|
101
105
|
}
|
|
102
106
|
|
|
107
|
+
const IDENTIFIER_KINDS: readonly IdentifierKind[] = [
|
|
108
|
+
"iban",
|
|
109
|
+
"bic",
|
|
110
|
+
"vat_number",
|
|
111
|
+
"company_number",
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* An identifier as it is printed (an IBAN in groups of four, a company
|
|
116
|
+
* number as its country writes it), read with its input's `country`.
|
|
117
|
+
*/
|
|
118
|
+
function formatIdentifierCell(
|
|
119
|
+
value: CellValue,
|
|
120
|
+
identifier: IdentifierKind,
|
|
121
|
+
options: CellOptions,
|
|
122
|
+
): ReturnType<DataTypeFormatter> {
|
|
123
|
+
if (value === "") return null;
|
|
124
|
+
if (!isString(value)) return value;
|
|
125
|
+
const country =
|
|
126
|
+
isObject(options) && isString(options.country)
|
|
127
|
+
? options.country
|
|
128
|
+
: undefined;
|
|
129
|
+
return formatIdentifier(value, { identifier, country });
|
|
130
|
+
}
|
|
131
|
+
|
|
103
132
|
export const registerPrimitiveTypes = (
|
|
104
133
|
registerDataType: (dataType: DataType) => void,
|
|
105
134
|
) => {
|
|
@@ -121,6 +150,15 @@ export const registerPrimitiveTypes = (
|
|
|
121
150
|
},
|
|
122
151
|
},
|
|
123
152
|
});
|
|
153
|
+
for (const identifier of IDENTIFIER_KINDS) {
|
|
154
|
+
registerDataType({
|
|
155
|
+
id: identifier,
|
|
156
|
+
formatter: {
|
|
157
|
+
default: (value, _locale, options) =>
|
|
158
|
+
formatIdentifierCell(value, identifier, options),
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
124
162
|
registerDataType({
|
|
125
163
|
id: "price",
|
|
126
164
|
formatter: { default: withNumberSuffix(formatPrice) },
|
|
@@ -4,6 +4,14 @@ import type {
|
|
|
4
4
|
DataTypeFormatter,
|
|
5
5
|
} from "#dms-core/app/composables/data-types/useDataType";
|
|
6
6
|
import { isObject, isString } from "#dms-core/app/utils/type-check";
|
|
7
|
+
import { processFieldI18n } from "../../utils/fieldOptionsI18n";
|
|
8
|
+
import {
|
|
9
|
+
type KeyValueColumnOptions,
|
|
10
|
+
keyValueColumns,
|
|
11
|
+
keyValueRows,
|
|
12
|
+
} from "../form/keyValueRows";
|
|
13
|
+
import type { RepeaterTableColumn } from "../form/repeaterTable";
|
|
14
|
+
import { RepeaterTable } from "./defaultDisplayComponents";
|
|
7
15
|
import { getAppTranslation } from "../../../../../dms-core/app/composables/translation/useTranslation";
|
|
8
16
|
|
|
9
17
|
const SECRET_TAIL = 4;
|
|
@@ -12,6 +20,8 @@ const TAG_CLASS =
|
|
|
12
20
|
"inline-flex h-5 items-center rounded-[5px] border border-default bg-elevated px-1.5 text-[11.5px]";
|
|
13
21
|
const TAGS_CLASS = "inline-flex flex-wrap items-center gap-1";
|
|
14
22
|
const CODE_CLASS = "font-mono text-[12px] truncate";
|
|
23
|
+
const CODE_FULL_CLASS =
|
|
24
|
+
"font-mono text-[12px] wrap-anywhere whitespace-pre-wrap";
|
|
15
25
|
|
|
16
26
|
const countOf = (value: Parameters<DataTypeFormatter>[0]): number => {
|
|
17
27
|
if (Array.isArray(value)) return value.length;
|
|
@@ -27,6 +37,49 @@ function renderCount(key: string) {
|
|
|
27
37
|
};
|
|
28
38
|
}
|
|
29
39
|
|
|
40
|
+
/** The options of a field's control, with their texts in the reader's language. */
|
|
41
|
+
function translatedOptions<O extends object>(options: O): O {
|
|
42
|
+
const { processI18n } = getAppTranslation();
|
|
43
|
+
return processFieldI18n({ component: { options } }, processI18n).component
|
|
44
|
+
.options;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const renderArrayCount = renderCount("dms.form.repeater.count");
|
|
48
|
+
const renderPairCount = renderCount("dms.form.key_value.count");
|
|
49
|
+
|
|
50
|
+
function isRow(
|
|
51
|
+
item: Parameters<DataTypeFormatter>[0],
|
|
52
|
+
): item is NonNullable<Parameters<DataTypeFormatter>[3]> {
|
|
53
|
+
return !!item && isObject(item);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function renderArrayRows(
|
|
57
|
+
value: Parameters<DataTypeFormatter>[0],
|
|
58
|
+
options: Parameters<DataTypeFormatter>[2],
|
|
59
|
+
) {
|
|
60
|
+
const { columns }: { columns?: RepeaterTableColumn[] } = translatedOptions(
|
|
61
|
+
options ?? {},
|
|
62
|
+
);
|
|
63
|
+
const rows = Array.isArray(value) ? value.filter(isRow) : [];
|
|
64
|
+
if (!columns || rows.length === 0) return renderArrayCount(value);
|
|
65
|
+
return h(RepeaterTable, { columns, rows });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function renderPairs(
|
|
69
|
+
value: Parameters<DataTypeFormatter>[0],
|
|
70
|
+
options: Parameters<DataTypeFormatter>[2],
|
|
71
|
+
) {
|
|
72
|
+
const { value: valueField, ...rest }: Partial<KeyValueColumnOptions> =
|
|
73
|
+
translatedOptions(options ?? {});
|
|
74
|
+
if (!valueField || !value || !isObject(value) || countOf(value) === 0)
|
|
75
|
+
return renderPairCount(value);
|
|
76
|
+
const { t } = getAppTranslation();
|
|
77
|
+
return h(RepeaterTable, {
|
|
78
|
+
columns: keyValueColumns({ ...rest, value: valueField }, t),
|
|
79
|
+
rows: keyValueRows(value, rest.toggleable).map((row) => ({ ...row })),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
30
83
|
function renderSecret(value: Parameters<DataTypeFormatter>[0]): string {
|
|
31
84
|
return isString(value) && value
|
|
32
85
|
? `${SECRET_MASK}${value.slice(-SECRET_TAIL)}`
|
|
@@ -39,6 +92,10 @@ function renderCode(value: Parameters<DataTypeFormatter>[0]) {
|
|
|
39
92
|
return h("span", { class: CODE_CLASS, title: value }, firstLine);
|
|
40
93
|
}
|
|
41
94
|
|
|
95
|
+
function renderFullCode(value: Parameters<DataTypeFormatter>[0]) {
|
|
96
|
+
return isString(value) ? h("pre", { class: CODE_FULL_CLASS }, value) : "";
|
|
97
|
+
}
|
|
98
|
+
|
|
42
99
|
function renderTags(value: Parameters<DataTypeFormatter>[0]) {
|
|
43
100
|
if (!Array.isArray(value)) return "";
|
|
44
101
|
return h(
|
|
@@ -54,13 +111,22 @@ export function registerFieldTypes(
|
|
|
54
111
|
): void {
|
|
55
112
|
registerDataType({
|
|
56
113
|
id: "array",
|
|
57
|
-
formatter: {
|
|
114
|
+
formatter: {
|
|
115
|
+
default: renderArrayCount,
|
|
116
|
+
full: (value, _locale, options) => renderArrayRows(value, options),
|
|
117
|
+
},
|
|
58
118
|
});
|
|
59
119
|
registerDataType({
|
|
60
120
|
id: "key_value",
|
|
61
|
-
formatter: {
|
|
121
|
+
formatter: {
|
|
122
|
+
default: renderPairCount,
|
|
123
|
+
full: (value, _locale, options) => renderPairs(value, options),
|
|
124
|
+
},
|
|
62
125
|
});
|
|
63
126
|
registerDataType({ id: "secret", formatter: { default: renderSecret } });
|
|
64
|
-
registerDataType({
|
|
127
|
+
registerDataType({
|
|
128
|
+
id: "code",
|
|
129
|
+
formatter: { default: renderCode, full: renderFullCode },
|
|
130
|
+
});
|
|
65
131
|
registerDataType({ id: "tags", formatter: { default: renderTags } });
|
|
66
132
|
}
|