@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/previewCaptureAssets.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { isString } from "../../../../../dms-core/app/utils/type-check";
|
|
2
|
+
|
|
3
|
+
const UNICODE_RANGE_ALL = "U+0-10FFFF";
|
|
4
|
+
const FONT_URL = /url\(\s*["']?([^"')\s]+)["']?\s*\)/;
|
|
5
|
+
|
|
6
|
+
const dataUrls = new Map<string, Promise<string>>();
|
|
7
|
+
|
|
8
|
+
function readAsDataUrl(blob: Blob): Promise<string> {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const reader = new FileReader();
|
|
11
|
+
reader.addEventListener("load", () =>
|
|
12
|
+
isString(reader.result)
|
|
13
|
+
? resolve(reader.result)
|
|
14
|
+
: reject(new Error("The file is not readable as a data URL")),
|
|
15
|
+
);
|
|
16
|
+
reader.addEventListener("error", () => reject(reader.error));
|
|
17
|
+
reader.readAsDataURL(blob);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function fetchDataUrl(url: string): Promise<string> {
|
|
22
|
+
const response = await fetch(url);
|
|
23
|
+
if (!response.ok) throw new Error(`${url} answered ${response.status}`);
|
|
24
|
+
return readAsDataUrl(await response.blob());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function fetchDataUrlOnce(url: string): Promise<string> {
|
|
28
|
+
try {
|
|
29
|
+
return await fetchDataUrl(url);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
dataUrls.delete(url);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The file at `url` as a data URL. A captured frame carries its fonts and its
|
|
38
|
+
* pictures inside its own markup, since an image drawn from an SVG loads
|
|
39
|
+
* nothing. Each file is fetched once per document, as this module is
|
|
40
|
+
* evaluated once per document; a failed fetch is tried again on the next ask.
|
|
41
|
+
*/
|
|
42
|
+
export function dataUrlOf(url: string): Promise<string> {
|
|
43
|
+
const known = dataUrls.get(url);
|
|
44
|
+
if (known) return known;
|
|
45
|
+
const fetched = fetchDataUrlOnce(url);
|
|
46
|
+
dataUrls.set(url, fetched);
|
|
47
|
+
return fetched;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function unquoted(value: string): string {
|
|
51
|
+
return value.trim().replace(/^["']|["']$/g, "");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function orNormal(value: string): string {
|
|
55
|
+
return value.trim() === "" ? "normal" : value.trim();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A `unicode-range` as one string whichever way it is spelled: upper case, no spaces, no leading zeros. */
|
|
59
|
+
function rangeKey(value: string): string {
|
|
60
|
+
const range = value.trim() === "" ? UNICODE_RANGE_ALL : value;
|
|
61
|
+
return range
|
|
62
|
+
.split(",")
|
|
63
|
+
.map((part) =>
|
|
64
|
+
part
|
|
65
|
+
.trim()
|
|
66
|
+
.toUpperCase()
|
|
67
|
+
.replace(/^U\+/, "")
|
|
68
|
+
.replace(/\b0+(?=[0-9A-F?])/g, ""),
|
|
69
|
+
)
|
|
70
|
+
.join(",");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What a capture reads of a `@font-face` rule. */
|
|
74
|
+
export interface FontFaceRuleLike {
|
|
75
|
+
style: Pick<CSSStyleDeclaration, "getPropertyValue">;
|
|
76
|
+
parentStyleSheet: Pick<CSSStyleSheet, "href"> | null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** What a capture reads of a loaded font. */
|
|
80
|
+
export type FontFaceLike = Pick<
|
|
81
|
+
FontFace,
|
|
82
|
+
"family" | "style" | "weight" | "unicodeRange" | "status"
|
|
83
|
+
>;
|
|
84
|
+
|
|
85
|
+
/** Whether `rule` declares `face`: the family, style, weight and unicode range all agree, so a subset or an italic never stands for another. */
|
|
86
|
+
export function declares(rule: FontFaceRuleLike, face: FontFaceLike): boolean {
|
|
87
|
+
const { style } = rule;
|
|
88
|
+
return (
|
|
89
|
+
unquoted(style.getPropertyValue("font-family")) === unquoted(face.family) &&
|
|
90
|
+
orNormal(style.getPropertyValue("font-style")) === orNormal(face.style) &&
|
|
91
|
+
orNormal(style.getPropertyValue("font-weight")) === orNormal(face.weight) &&
|
|
92
|
+
rangeKey(style.getPropertyValue("unicode-range")) ===
|
|
93
|
+
rangeKey(face.unicodeRange)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function* ruleLists(sheets: Iterable<CSSStyleSheet>): Generator<CSSRule> {
|
|
98
|
+
const pending: CSSRuleList[] = [];
|
|
99
|
+
for (const sheet of sheets) {
|
|
100
|
+
try {
|
|
101
|
+
pending.push(sheet.cssRules);
|
|
102
|
+
} catch {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
while (pending.length > 0) {
|
|
107
|
+
const rules = pending.shift();
|
|
108
|
+
for (const rule of rules ?? []) {
|
|
109
|
+
yield rule;
|
|
110
|
+
if (rule instanceof CSSGroupingRule) pending.push(rule.cssRules);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Every `@font-face` rule of the document's style sheets, those inside a group rule too. */
|
|
116
|
+
export function fontFaceRules(
|
|
117
|
+
sheets: Iterable<CSSStyleSheet>,
|
|
118
|
+
): CSSFontFaceRule[] {
|
|
119
|
+
return [...ruleLists(sheets)].filter(
|
|
120
|
+
(rule): rule is CSSFontFaceRule => rule instanceof CSSFontFaceRule,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** One `@font-face` rule that draws `rule`'s face from a data URL; undefined when the rule names no file. */
|
|
125
|
+
async function inlinedFace(
|
|
126
|
+
rule: FontFaceRuleLike,
|
|
127
|
+
): Promise<string | undefined> {
|
|
128
|
+
const file = FONT_URL.exec(rule.style.getPropertyValue("src"))?.[1];
|
|
129
|
+
if (!file) return undefined;
|
|
130
|
+
const base = rule.parentStyleSheet?.href ?? document.baseURI;
|
|
131
|
+
const range = rule.style.getPropertyValue("unicode-range");
|
|
132
|
+
const descriptors = [
|
|
133
|
+
`font-family:${JSON.stringify(unquoted(rule.style.getPropertyValue("font-family")))}`,
|
|
134
|
+
`font-style:${orNormal(rule.style.getPropertyValue("font-style"))}`,
|
|
135
|
+
`font-weight:${orNormal(rule.style.getPropertyValue("font-weight"))}`,
|
|
136
|
+
...(range.trim() === "" ? [] : [`unicode-range:${range}`]),
|
|
137
|
+
`src:url(${await dataUrlOf(new URL(file, base).href)})`,
|
|
138
|
+
];
|
|
139
|
+
return `@font-face{${descriptors.join(";")}}`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The `@font-face` rules of the fonts the document has loaded, each with its
|
|
144
|
+
* file as a data URL: a face is matched to its rule on family, style, weight
|
|
145
|
+
* and unicode range, so a page drawing an italic or a subset gets those
|
|
146
|
+
* files. A face with no rule, or whose file cannot be read, is left out.
|
|
147
|
+
*/
|
|
148
|
+
export async function loadedFontCss(
|
|
149
|
+
faces: Iterable<FontFaceLike>,
|
|
150
|
+
rules: Iterable<FontFaceRuleLike>,
|
|
151
|
+
): Promise<string> {
|
|
152
|
+
const declaring = [...rules];
|
|
153
|
+
const declared = [...faces]
|
|
154
|
+
.filter((face) => face.status === "loaded")
|
|
155
|
+
.flatMap((face) => declaring.filter((rule) => declares(rule, face)));
|
|
156
|
+
const inlined = await Promise.all(
|
|
157
|
+
[...new Set(declared)].map((rule) =>
|
|
158
|
+
inlinedFace(rule).catch(() => undefined),
|
|
159
|
+
),
|
|
160
|
+
);
|
|
161
|
+
return inlined.filter((face) => face !== undefined).join("\n");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Replaces the `src` of each `<img>` of `root` with a data URL, so the image draws without a request; an image that cannot be read is left as it is. */
|
|
165
|
+
export async function inlineImages(root: Element): Promise<void> {
|
|
166
|
+
await Promise.all(
|
|
167
|
+
[...root.querySelectorAll("img")].map(async (image) => {
|
|
168
|
+
const src = image.getAttribute("src");
|
|
169
|
+
image.removeAttribute("srcset");
|
|
170
|
+
if (!src || src.startsWith("data:")) return;
|
|
171
|
+
try {
|
|
172
|
+
image.setAttribute(
|
|
173
|
+
"src",
|
|
174
|
+
await dataUrlOf(new URL(src, document.baseURI).href),
|
|
175
|
+
);
|
|
176
|
+
} catch {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
}),
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -2,10 +2,10 @@ import { shallowRef } from "vue";
|
|
|
2
2
|
import {
|
|
3
3
|
previewNavigateMessage,
|
|
4
4
|
previewSectionEditMessage,
|
|
5
|
-
previewTenantMessage,
|
|
6
|
-
type PreviewHeader,
|
|
7
5
|
type PreviewNavigation,
|
|
8
6
|
} from "../../utils/blockPreviewMessages";
|
|
7
|
+
import type { PreviewHeader } from "../../utils/previewHeader";
|
|
8
|
+
import type { PreviewPageLayout } from "../../utils/previewPageLayout";
|
|
9
9
|
import type { MockupSectionEdit } from "../../utils/mockupSections";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -20,6 +20,12 @@ export const previewNavigation = shallowRef<PreviewNavigation>();
|
|
|
20
20
|
*/
|
|
21
21
|
export const previewHeader = shallowRef<PreviewHeader>();
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* The layout the last `render` asked the preview to draw the page in, read by
|
|
25
|
+
* the preview and its layout. Only ever written in the browser, from a message.
|
|
26
|
+
*/
|
|
27
|
+
export const previewPageLayout = shallowRef<PreviewPageLayout>();
|
|
28
|
+
|
|
23
29
|
/** Marks the page header, whose click picks the page while inspecting. */
|
|
24
30
|
export const PREVIEW_HEADER_ATTRIBUTE = "data-dms-preview-header";
|
|
25
31
|
|
|
@@ -40,9 +46,3 @@ export function requestSectionEdit(edit: MockupSectionEdit): void {
|
|
|
40
46
|
if (window.parent === window) return;
|
|
41
47
|
window.parent.postMessage(previewSectionEditMessage(edit), "*");
|
|
42
48
|
}
|
|
43
|
-
|
|
44
|
-
/** Tells the embedding page the workspace switcher picked the tenant `id`. */
|
|
45
|
-
export function requestPreviewTenant(id: string): void {
|
|
46
|
-
if (window.parent === window) return;
|
|
47
|
-
window.parent.postMessage(previewTenantMessage(id), "*");
|
|
48
|
-
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** The factor the image is scaled by: a quarter of the frame's pixels, sharp enough for a zoomed-out canvas. */
|
|
2
|
+
const CAPTURE_SCALE = 0.5;
|
|
3
|
+
|
|
4
|
+
/** The longest side the image takes, which a canvas of every browser holds. */
|
|
5
|
+
const MAX_SIDE_PX = 16_384;
|
|
6
|
+
|
|
7
|
+
const IMAGE_TYPE = "image/webp";
|
|
8
|
+
const IMAGE_QUALITY = 0.8;
|
|
9
|
+
|
|
10
|
+
/** Draws an SVG, `width` by `height` pixels, to an image. */
|
|
11
|
+
export type Rasterizer = (
|
|
12
|
+
svg: string,
|
|
13
|
+
width: number,
|
|
14
|
+
height: number,
|
|
15
|
+
) => Promise<Blob>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Has the browser draw `svg`, `width` by `height` pixels, and encodes it:
|
|
19
|
+
* a Blob, WebP where the browser encodes it, else PNG, at half the size.
|
|
20
|
+
*/
|
|
21
|
+
export async function rasterize(
|
|
22
|
+
svg: string,
|
|
23
|
+
width: number,
|
|
24
|
+
height: number,
|
|
25
|
+
): Promise<Blob> {
|
|
26
|
+
const image = new Image();
|
|
27
|
+
image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
28
|
+
await image.decode();
|
|
29
|
+
const scale = Math.min(CAPTURE_SCALE, MAX_SIDE_PX / Math.max(width, height));
|
|
30
|
+
const canvas = document.createElement("canvas");
|
|
31
|
+
canvas.width = Math.max(1, Math.round(width * scale));
|
|
32
|
+
canvas.height = Math.max(1, Math.round(height * scale));
|
|
33
|
+
const context = canvas.getContext("2d");
|
|
34
|
+
if (!context) throw new Error("A canvas cannot be drawn on");
|
|
35
|
+
context.scale(scale, scale);
|
|
36
|
+
context.drawImage(image, 0, 0);
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
canvas.toBlob(
|
|
39
|
+
(blob) =>
|
|
40
|
+
blob ? resolve(blob) : reject(new Error("The image cannot be encoded")),
|
|
41
|
+
IMAGE_TYPE,
|
|
42
|
+
IMAGE_QUALITY,
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
} from "../../utils/blockPreview";
|
|
16
16
|
import {
|
|
17
17
|
parsePreviewMessage,
|
|
18
|
+
previewCaptureFailedMessage,
|
|
19
|
+
previewCaptureMessage,
|
|
18
20
|
previewErrorMessage,
|
|
19
21
|
previewLayoutMessage,
|
|
20
22
|
previewPressMessage,
|
|
@@ -26,10 +28,12 @@ import {
|
|
|
26
28
|
type PreviewInboundMessage,
|
|
27
29
|
type PreviewOutboundMessage,
|
|
28
30
|
} from "../../utils/blockPreviewMessages";
|
|
31
|
+
import { capturePreviewFrame } from "./previewCapture";
|
|
29
32
|
import { blockRects, documentRect, fontOf } from "./previewGeometry";
|
|
30
33
|
import {
|
|
31
34
|
PREVIEW_FRAME_ATTRIBUTE,
|
|
32
35
|
previewHeader,
|
|
36
|
+
previewPageLayout,
|
|
33
37
|
previewNavigation,
|
|
34
38
|
} from "./previewNavigation";
|
|
35
39
|
import { useBlockInspector } from "./useBlockInspector";
|
|
@@ -49,6 +53,8 @@ export interface BlockPreviewEmbed {
|
|
|
49
53
|
inspecting: Ref<boolean>;
|
|
50
54
|
/** The route parameters the last `render` gave the blocks, for their `{{params.X}}` tokens. */
|
|
51
55
|
params: Ref<Record<string, string> | undefined>;
|
|
56
|
+
/** The query of the page the last `render` drew, for its blocks to read from the route. */
|
|
57
|
+
query: Ref<Record<string, string> | undefined>;
|
|
52
58
|
/** Tells the embedding page what went wrong. */
|
|
53
59
|
reportError: (message: string) => void;
|
|
54
60
|
}
|
|
@@ -62,8 +68,13 @@ interface EmbedOptions {
|
|
|
62
68
|
* puts on its document a policy that refuses every live route.
|
|
63
69
|
*/
|
|
64
70
|
fixturesOnly?: boolean;
|
|
71
|
+
/** Draws the preview's frame to an image, for a `capture` message; {@link capturePreviewFrame} by default. */
|
|
72
|
+
capture?: FrameCapture;
|
|
65
73
|
}
|
|
66
74
|
|
|
75
|
+
/** Draws a frame to an image. */
|
|
76
|
+
export type FrameCapture = (frame: HTMLElement) => Promise<Blob>;
|
|
77
|
+
|
|
67
78
|
function postToParent(message: PreviewOutboundMessage): void {
|
|
68
79
|
if (window.parent === window) return;
|
|
69
80
|
|
|
@@ -89,6 +100,30 @@ function frameOf(root: HTMLElement): HTMLElement {
|
|
|
89
100
|
return root.closest<HTMLElement>(`[${PREVIEW_FRAME_ATTRIBUTE}]`) ?? root;
|
|
90
101
|
}
|
|
91
102
|
|
|
103
|
+
function setMinHeight(root: HTMLElement, height: number): void {
|
|
104
|
+
frameOf(root).style.setProperty(MIN_HEIGHT_PROPERTY, `${height}px`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Answers the `capture` request `id` with the image of the preview's frame, or with why it could not be drawn. */
|
|
108
|
+
function answerCapture(
|
|
109
|
+
{ root, capture = capturePreviewFrame }: EmbedOptions,
|
|
110
|
+
id: number,
|
|
111
|
+
): void {
|
|
112
|
+
const drawn = root.value
|
|
113
|
+
? capture(frameOf(root.value))
|
|
114
|
+
: Promise.reject(new Error("The preview has nothing drawn"));
|
|
115
|
+
drawn.then(
|
|
116
|
+
(image) => postToParent(previewCaptureMessage(id, image)),
|
|
117
|
+
(error: unknown) =>
|
|
118
|
+
postToParent(
|
|
119
|
+
previewCaptureFailedMessage(
|
|
120
|
+
id,
|
|
121
|
+
error instanceof Error ? error.message : String(error),
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
92
127
|
/** Reports the height of the preview's frame on each change. */
|
|
93
128
|
function observeHeight(
|
|
94
129
|
root: HTMLElement,
|
|
@@ -138,7 +173,9 @@ function postText(path: string, element: Element): void {
|
|
|
138
173
|
* where each block sits and the text a double-click lands on.
|
|
139
174
|
*
|
|
140
175
|
* Block positions post at the next frame, only when they differ from the last,
|
|
141
|
-
* except after a render, which the parent waits to see drawn.
|
|
176
|
+
* except after a render, which the parent waits to see drawn. A `capture`
|
|
177
|
+
* message is answered with the image of the preview's frame, or with why it
|
|
178
|
+
* could not be drawn.
|
|
142
179
|
*/
|
|
143
180
|
export function useBlockPreviewEmbed(options: EmbedOptions): BlockPreviewEmbed {
|
|
144
181
|
const tree = ref<PreviewTree | undefined>(options.initialState?.tree);
|
|
@@ -149,6 +186,7 @@ export function useBlockPreviewEmbed(options: EmbedOptions): BlockPreviewEmbed {
|
|
|
149
186
|
const revision = ref(0);
|
|
150
187
|
const inspecting = ref(false);
|
|
151
188
|
const params = ref<Record<string, string>>();
|
|
189
|
+
const query = ref<Record<string, string>>();
|
|
152
190
|
let observer: ResizeObserver | undefined;
|
|
153
191
|
let stopObservingBlocks: (() => void) | undefined;
|
|
154
192
|
let layoutFrame: number | undefined;
|
|
@@ -194,7 +232,8 @@ export function useBlockPreviewEmbed(options: EmbedOptions): BlockPreviewEmbed {
|
|
|
194
232
|
padding.value = message.padding ?? padding.value;
|
|
195
233
|
previewNavigation.value = message.navigation;
|
|
196
234
|
previewHeader.value = message.header;
|
|
197
|
-
|
|
235
|
+
previewPageLayout.value = message.pageLayout;
|
|
236
|
+
[params.value, query.value] = [message.params, message.query];
|
|
198
237
|
revision.value += 1;
|
|
199
238
|
},
|
|
200
239
|
theme: (message) => {
|
|
@@ -207,10 +246,10 @@ export function useBlockPreviewEmbed(options: EmbedOptions): BlockPreviewEmbed {
|
|
|
207
246
|
},
|
|
208
247
|
"min-height": (message) => {
|
|
209
248
|
if (message.type !== "min-height" || !options.root.value) return;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
);
|
|
249
|
+
setMinHeight(options.root.value, message.height);
|
|
250
|
+
},
|
|
251
|
+
capture: (message) => {
|
|
252
|
+
if (message.type === "capture") answerCapture(options, message.id);
|
|
214
253
|
},
|
|
215
254
|
};
|
|
216
255
|
|
|
@@ -263,6 +302,7 @@ export function useBlockPreviewEmbed(options: EmbedOptions): BlockPreviewEmbed {
|
|
|
263
302
|
padding,
|
|
264
303
|
inspecting,
|
|
265
304
|
params,
|
|
305
|
+
query,
|
|
266
306
|
reportError: (message) => postToParent(previewErrorMessage(message)),
|
|
267
307
|
};
|
|
268
308
|
}
|
|
@@ -10,15 +10,24 @@ import {
|
|
|
10
10
|
import { useResizeObserver, useTimeoutFn } from "@vueuse/core";
|
|
11
11
|
import { isReducedMotionActive } from "../../../utils/reducedMotion";
|
|
12
12
|
import type { PreviewBlockRect } from "../../utils/blockPreviewMessages";
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
MockupCategory,
|
|
15
|
+
MockupDataMode,
|
|
16
|
+
MockupPageState,
|
|
17
|
+
} from "../../utils/mockup";
|
|
18
|
+
import {
|
|
19
|
+
mockupCaptures,
|
|
20
|
+
type CapturedLayout,
|
|
21
|
+
type PageCaptures,
|
|
22
|
+
} from "../../utils/mockupCaptures";
|
|
14
23
|
import {
|
|
15
24
|
assignSlots,
|
|
16
25
|
fitCamera,
|
|
17
26
|
framesBounds,
|
|
18
27
|
layoutSections,
|
|
19
|
-
nearbyFrames,
|
|
20
28
|
pageAt,
|
|
21
29
|
revealCamera,
|
|
30
|
+
wantedLivePages,
|
|
22
31
|
zoomAt,
|
|
23
32
|
type OverviewCamera,
|
|
24
33
|
type OverviewFrame,
|
|
@@ -30,9 +39,13 @@ import type { PagePoint, PinCanvas } from "../../utils/mockupPins";
|
|
|
30
39
|
import { groupSections } from "../../utils/mockupSections";
|
|
31
40
|
import { pageForest } from "../../utils/mockupPageTree";
|
|
32
41
|
import type { ClientPoint } from "./useMockupPins";
|
|
42
|
+
import {
|
|
43
|
+
useOverviewCaptures,
|
|
44
|
+
type OverviewCaptures,
|
|
45
|
+
} from "./useOverviewCaptures";
|
|
33
46
|
|
|
34
|
-
/** How many pages the overview draws live at once, each in an iframe of its own. */
|
|
35
|
-
const LIVE_FRAMES =
|
|
47
|
+
/** How many pages the overview draws live at once, each in an iframe of its own: the pages in view at the zoom where a frame is still worth drawing live, and the picked one. The others are shown as images. */
|
|
48
|
+
const LIVE_FRAMES = 5;
|
|
36
49
|
|
|
37
50
|
/** The room kept between the viewport's edges and the frames a fit or a reveal shows, titles included. */
|
|
38
51
|
const FIT_PADDING_PX = 56;
|
|
@@ -66,6 +79,8 @@ interface OverviewOptions {
|
|
|
66
79
|
pages: ComputedRef<readonly MockupPageState[]>;
|
|
67
80
|
/** The sidebar's sections, a row of frames each. */
|
|
68
81
|
categories: ComputedRef<readonly MockupCategory[]>;
|
|
82
|
+
/** The developer's Real data choice, if any: each page draws, and is captured, by it. */
|
|
83
|
+
dataMode: Readonly<Ref<MockupDataMode | undefined>>;
|
|
69
84
|
}
|
|
70
85
|
|
|
71
86
|
/** What labels a section's row: its category, none for the default section. */
|
|
@@ -81,9 +96,26 @@ export interface MockupOverview {
|
|
|
81
96
|
camera: Readonly<Ref<OverviewCamera>>;
|
|
82
97
|
/**
|
|
83
98
|
* The page each live slot draws. A slot is one iframe, kept across the
|
|
84
|
-
* pages it draws; a page without a slot shows
|
|
99
|
+
* pages it draws; a page without a slot shows its capture, or a placeholder
|
|
100
|
+
* while it has none.
|
|
85
101
|
*/
|
|
86
102
|
slots: Readonly<Ref<(string | undefined)[]>>;
|
|
103
|
+
/** The page picked with a click, which stays drawn live until the Overview closes. */
|
|
104
|
+
picked: Readonly<Ref<string | undefined>>;
|
|
105
|
+
/** Picks `page`, or nothing. */
|
|
106
|
+
pick: (page: string | undefined) => void;
|
|
107
|
+
/** Whether the camera is moving: from a move until it has been still for a while. Live frames neither change page nor are captured meanwhile. */
|
|
108
|
+
isMoving: Readonly<Ref<boolean>>;
|
|
109
|
+
/** The key each page's capture is current for, by page id. */
|
|
110
|
+
captureKeys: ComputedRef<ReadonlyMap<string, string>>;
|
|
111
|
+
/** The image each page's live frame drew, by page id, current or out of date. */
|
|
112
|
+
captures: Readonly<Ref<PageCaptures>>;
|
|
113
|
+
/** Whether the page has no capture for `key`, and no failed try for it. */
|
|
114
|
+
needsCapture: (page: string, key: string) => boolean;
|
|
115
|
+
/** Keeps the image the live frame of `page` drew for `key`. */
|
|
116
|
+
capture: (page: string, key: string, image: Blob) => void;
|
|
117
|
+
/** Records that the live frame of `page` could not draw its image for `key`: the page is not drawn again to be captured. */
|
|
118
|
+
captureFailed: (page: string, key: string) => void;
|
|
87
119
|
/** Every page as the pins read it: its blocks, once its live frame reported them, and its frame's size. */
|
|
88
120
|
canvases: ComputedRef<PinCanvas[]>;
|
|
89
121
|
/** Hands the overview the element its frames are drawn in, or null once it is gone. */
|
|
@@ -189,6 +221,7 @@ type Viewport = ReturnType<typeof useViewport>;
|
|
|
189
221
|
* kept per page, so they outlive the iframe that reported them.
|
|
190
222
|
*/
|
|
191
223
|
function usePageReports(options: OverviewOptions) {
|
|
224
|
+
const captured = mockupCaptures(options.name);
|
|
192
225
|
const pages = computed(() =>
|
|
193
226
|
options.pages.value.filter((page) => !page.generated),
|
|
194
227
|
);
|
|
@@ -218,7 +251,8 @@ function usePageReports(options: OverviewOptions) {
|
|
|
218
251
|
])
|
|
219
252
|
.map((page) => ({
|
|
220
253
|
id: page.id,
|
|
221
|
-
height:
|
|
254
|
+
height:
|
|
255
|
+
heights.value.get(page.id) ?? captured.value.get(page.id)?.height,
|
|
222
256
|
})),
|
|
223
257
|
})),
|
|
224
258
|
);
|
|
@@ -229,7 +263,8 @@ function usePageReports(options: OverviewOptions) {
|
|
|
229
263
|
pages.value.flatMap((page) => {
|
|
230
264
|
const frame = frames.value.find((entry) => entry.id === page.id);
|
|
231
265
|
if (!frame) return [];
|
|
232
|
-
const blocks =
|
|
266
|
+
const blocks =
|
|
267
|
+
layouts.value.get(page.id) ?? captured.value.get(page.id)?.blocks ?? [];
|
|
233
268
|
return [
|
|
234
269
|
{ page, blocks, width: frame.rect.width, height: frame.rect.height },
|
|
235
270
|
];
|
|
@@ -241,30 +276,41 @@ function usePageReports(options: OverviewOptions) {
|
|
|
241
276
|
}
|
|
242
277
|
if (blocks) layouts.value = new Map(layouts.value).set(page, blocks);
|
|
243
278
|
}
|
|
244
|
-
return {
|
|
279
|
+
return {
|
|
280
|
+
frames,
|
|
281
|
+
labels,
|
|
282
|
+
canvases,
|
|
283
|
+
report,
|
|
284
|
+
drawnOf: (page: string): CapturedLayout => ({
|
|
285
|
+
height: heights.value.get(page),
|
|
286
|
+
blocks: layouts.value.get(page),
|
|
287
|
+
}),
|
|
288
|
+
};
|
|
245
289
|
}
|
|
246
290
|
|
|
247
|
-
/**
|
|
291
|
+
/** What the live slots are handed out by: where each frame sits, which is picked, and which still need an image. */
|
|
248
292
|
interface LiveSlotPages {
|
|
249
293
|
frames: ComputedRef<OverviewFrame[]>;
|
|
250
|
-
|
|
294
|
+
picked: Readonly<Ref<string | undefined>>;
|
|
295
|
+
captured: OverviewCaptures;
|
|
251
296
|
}
|
|
252
297
|
|
|
253
298
|
/**
|
|
254
|
-
* The pages drawn live while the overview is open: the
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
299
|
+
* The pages drawn live while the overview is open: the picked page, the
|
|
300
|
+
* frames in view while a frame is wide enough to be worth it, and the pages
|
|
301
|
+
* with no current image, in that order, each holding a slot, at most
|
|
302
|
+
* {@link LIVE_FRAMES}. The iframes of the overview share the window's main
|
|
303
|
+
* thread, so the pool grows by one iframe at a time, once every iframe it
|
|
304
|
+
* has booted: the page nearest the middle draws first, and the canvas keeps
|
|
305
|
+
* answering while the others boot. Each page draws once, is captured, and
|
|
306
|
+
* keeps that image for as long as it is not drawn live. While the camera
|
|
261
307
|
* moves, the slots stay as they are, since an iframe drawing another page or
|
|
262
308
|
* booting holds the main thread for a whole frame or more; they follow the
|
|
263
309
|
* camera once it rests.
|
|
264
310
|
*/
|
|
265
311
|
function useLiveSlots(
|
|
266
312
|
isOpen: Readonly<Ref<boolean>>,
|
|
267
|
-
{ frames,
|
|
313
|
+
{ frames, picked, captured }: LiveSlotPages,
|
|
268
314
|
camera: Readonly<Ref<OverviewCamera>>,
|
|
269
315
|
isMoving: Readonly<Ref<boolean>>,
|
|
270
316
|
viewport: Viewport,
|
|
@@ -272,7 +318,18 @@ function useLiveSlots(
|
|
|
272
318
|
const slots = ref<(string | undefined)[]>([]);
|
|
273
319
|
const booted = shallowRef<ReadonlySet<number>>(new Set());
|
|
274
320
|
watch(
|
|
275
|
-
[
|
|
321
|
+
[
|
|
322
|
+
isOpen,
|
|
323
|
+
frames,
|
|
324
|
+
camera,
|
|
325
|
+
isMoving,
|
|
326
|
+
viewport.size,
|
|
327
|
+
booted,
|
|
328
|
+
picked,
|
|
329
|
+
captured.captures,
|
|
330
|
+
captured.keys,
|
|
331
|
+
captured.failed,
|
|
332
|
+
],
|
|
276
333
|
() => {
|
|
277
334
|
if (!isOpen.value) {
|
|
278
335
|
if (slots.value.length) slots.value = [];
|
|
@@ -280,16 +337,16 @@ function useLiveSlots(
|
|
|
280
337
|
return;
|
|
281
338
|
}
|
|
282
339
|
if (!viewport.hasSize.value || isMoving.value) return;
|
|
283
|
-
const
|
|
284
|
-
frames.value,
|
|
285
|
-
camera.value,
|
|
286
|
-
viewport.size.value,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
340
|
+
const wanted = wantedLivePages({
|
|
341
|
+
frames: frames.value,
|
|
342
|
+
camera: camera.value,
|
|
343
|
+
viewport: viewport.size.value,
|
|
344
|
+
picked: picked.value,
|
|
345
|
+
needsCapture: (id) => {
|
|
346
|
+
const key = captured.keys.value.get(id);
|
|
347
|
+
return key !== undefined && captured.needsCapture(id, key);
|
|
348
|
+
},
|
|
349
|
+
});
|
|
293
350
|
const capacity = Math.min(LIVE_FRAMES, booted.value.size + 1);
|
|
294
351
|
const next = assignSlots(slots.value, wanted, capacity);
|
|
295
352
|
if (next.some((id, index) => id !== slots.value[index])) {
|
|
@@ -404,15 +461,17 @@ function useCameraControls(
|
|
|
404
461
|
|
|
405
462
|
/**
|
|
406
463
|
* The overview of a mockup: every page side by side as a frame at its real
|
|
407
|
-
* size, on a canvas the camera pans and zooms.
|
|
408
|
-
*
|
|
409
|
-
* and
|
|
410
|
-
*
|
|
464
|
+
* size, on a canvas the camera pans and zooms. A few frames are drawn live,
|
|
465
|
+
* each in one of a few iframes reused across pages. Every page is drawn live
|
|
466
|
+
* once and captured as an image, which its frame keeps showing whenever the
|
|
467
|
+
* page is not live; the heights and block layouts the live frames report
|
|
468
|
+
* outlive them too, so a frame keeps its size, and its pins their blocks,
|
|
469
|
+
* once its iframe draws another page.
|
|
411
470
|
*/
|
|
412
471
|
export function useMockupOverview(options: OverviewOptions): MockupOverview {
|
|
413
472
|
const { isOpen } = options;
|
|
414
473
|
const viewport = useViewport();
|
|
415
|
-
const { frames, labels, canvases, report,
|
|
474
|
+
const { frames, labels, canvases, report, drawnOf } = usePageReports(options);
|
|
416
475
|
const fitPadding = computed(() =>
|
|
417
476
|
labels.value.length ? SECTIONED_FIT_PADDING_PX : FIT_PADDING_PX,
|
|
418
477
|
);
|
|
@@ -423,9 +482,14 @@ export function useMockupOverview(options: OverviewOptions): MockupOverview {
|
|
|
423
482
|
viewport,
|
|
424
483
|
fitPadding,
|
|
425
484
|
);
|
|
485
|
+
const picked = ref<string>();
|
|
486
|
+
watch(isOpen, (isShown) => {
|
|
487
|
+
if (!isShown) picked.value = undefined;
|
|
488
|
+
});
|
|
489
|
+
const captured = useOverviewCaptures(options, drawnOf);
|
|
426
490
|
const { slots, booted } = useLiveSlots(
|
|
427
491
|
isOpen,
|
|
428
|
-
{ frames,
|
|
492
|
+
{ frames, picked, captured },
|
|
429
493
|
camera,
|
|
430
494
|
isMoving,
|
|
431
495
|
viewport,
|
|
@@ -436,6 +500,16 @@ export function useMockupOverview(options: OverviewOptions): MockupOverview {
|
|
|
436
500
|
labels,
|
|
437
501
|
camera,
|
|
438
502
|
slots,
|
|
503
|
+
picked,
|
|
504
|
+
pick: (page) => {
|
|
505
|
+
picked.value = page;
|
|
506
|
+
},
|
|
507
|
+
isMoving,
|
|
508
|
+
captureKeys: captured.keys,
|
|
509
|
+
captures: captured.captures,
|
|
510
|
+
needsCapture: captured.needsCapture,
|
|
511
|
+
capture: captured.capture,
|
|
512
|
+
captureFailed: captured.captureFailed,
|
|
439
513
|
canvases,
|
|
440
514
|
booted,
|
|
441
515
|
attach: viewport.attach,
|