@antelopejs/dms 0.25.7-next.1111.gaba637e → 0.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/README.md +2 -2
- package/data/mockup-spec.schema.json +303 -223
- package/dist/implementations/dms-auth/account-emails.js +2 -2
- package/dist/implementations/dms-auth/account-emails.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +1 -2
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +18 -0
- package/dist/implementations/dms-base/group-order.js +66 -0
- package/dist/implementations/dms-base/group-order.js.map +1 -0
- package/dist/implementations/dms-base/search-route.js +8 -5
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +4 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +5 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +4 -0
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +5 -17
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/index.js +0 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +0 -14
- package/dist/mcp/page-verify/index.js +5 -9
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +1 -2
- package/dist/mcp/page-verify/mockup.js +0 -1
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +4 -22
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +3 -10
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +0 -2
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +0 -1
- package/dist/mcp/tools/page-verify.js +1 -5
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mockup/apply-notes.d.ts +1 -1
- package/dist/mockup/apply-notes.js +2 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +3 -0
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/{fixture-routes.d.ts → capture-routes.d.ts} +6 -11
- package/dist/mockup/capture-routes.js +101 -0
- package/dist/mockup/capture-routes.js.map +1 -0
- package/dist/mockup/capture.d.ts +10 -0
- package/dist/mockup/capture.js +64 -0
- package/dist/mockup/capture.js.map +1 -0
- package/dist/mockup/compile.d.ts +1 -6
- package/dist/mockup/compile.js +25 -29
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +62 -10
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/files.d.ts +2 -2
- package/dist/mockup/files.js +2 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixture-answers.d.ts +0 -1
- package/dist/mockup/fixture-answers.js +1 -1
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +3 -1
- package/dist/mockup/fixtures.js +25 -2
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +10 -1
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/generate.js +1 -4
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/header-action.d.ts +47 -0
- package/dist/mockup/header-action.js +46 -0
- package/dist/mockup/header-action.js.map +1 -0
- package/dist/mockup/history-routes.js +17 -2
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +0 -3
- package/dist/mockup/index.js +0 -3
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-header.d.ts +2 -0
- package/dist/mockup/json-schema-header.js +69 -0
- package/dist/mockup/json-schema-header.js.map +1 -0
- package/dist/mockup/json-schema-layout.d.ts +2 -0
- package/dist/mockup/json-schema-layout.js +61 -0
- package/dist/mockup/json-schema-layout.js.map +1 -0
- package/dist/mockup/json-schema.js +24 -23
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/model.d.ts +255 -106
- package/dist/mockup/model.js +82 -86
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +9 -20
- package/dist/mockup/modules.js +22 -146
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/page-links.d.ts +2 -1
- package/dist/mockup/page-links.js +14 -3
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +1 -4
- package/dist/mockup/refusals.js +1 -15
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +5 -1
- package/dist/mockup/routes.js +171 -9
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sample-rows.js +4 -0
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/store.d.ts +2 -1
- package/dist/mockup/store.js +22 -16
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/{store-summary.js → summary-fields.js} +1 -1
- package/dist/mockup/summary-fields.js.map +1 -0
- package/dist/mockup/table-columns.js +9 -3
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +4 -1
- package/dist/mockup/table-options.js +40 -2
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/table-param-filters.d.ts +52 -0
- package/dist/mockup/table-param-filters.js +83 -0
- package/dist/mockup/table-param-filters.js.map +1 -0
- package/dist/mockup/table-row-actions.d.ts +2 -0
- package/dist/mockup/table-row-actions.js +85 -0
- package/dist/mockup/table-row-actions.js.map +1 -0
- package/dist/mockup/unknown-keys.d.ts +3 -0
- package/dist/mockup/unknown-keys.js +45 -0
- package/dist/mockup/unknown-keys.js.map +1 -0
- package/dist/mockup/validate.d.ts +7 -1
- package/dist/mockup/validate.js +76 -3
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +1 -0
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +2 -0
- package/dist/pages/settings/overview/account-summary.js +17 -8
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +2 -1
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +2 -4
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +7 -1
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +1 -0
- package/dist/utils/account-notifications.js.map +1 -1
- package/dist/utils/email-change-mail.js +2 -2
- package/dist/utils/email-change-mail.js.map +1 -1
- package/dist/utils/email-plain-text.d.ts +1 -0
- package/dist/utils/email-plain-text.js +95 -0
- package/dist/utils/email-plain-text.js.map +1 -0
- package/dist/utils/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/html-email.d.ts +8 -0
- package/dist/utils/html-email.js +9 -0
- package/dist/utils/html-email.js.map +1 -0
- package/dist/utils/image-signatures.d.ts +3 -0
- package/dist/utils/image-signatures.js +22 -0
- package/dist/utils/image-signatures.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/sse-keepalive/index.d.ts +3 -0
- package/dist/utils/sse-keepalive/index.js +8 -0
- package/dist/utils/sse-keepalive/index.js.map +1 -0
- package/dist/validation/allowed-keys.d.ts +2 -0
- package/dist/validation/allowed-keys.js +16 -0
- package/dist/validation/allowed-keys.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/frontend-vue/eslint-globals.generated.mjs +2 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +4 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +17 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +3 -0
- package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +8 -0
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +485 -0
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +27 -0
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +23 -5
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +1 -0
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +12 -443
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +8 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +8 -0
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +7 -4
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +14 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +49 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +2 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +6 -21
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +19 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +9 -110
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +8 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +6 -9
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +6 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +27 -22
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +8 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +39 -3
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +38 -5
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +23 -4
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +39 -31
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +60 -9
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +7 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +14 -1
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +13 -0
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +3 -0
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +1 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +22 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +6 -11
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +125 -182
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +110 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +75 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +114 -12
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +67 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +10 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +8 -76
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +9 -65
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +26 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +247 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +181 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +45 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +46 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +109 -35
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +5 -18
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +0 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +137 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +68 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +17 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +69 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +20 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +21 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +32 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +16 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +67 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +73 -48
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +18 -11
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +35 -124
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +7 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +96 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +84 -149
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +61 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +37 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +279 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +43 -72
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +130 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +8 -92
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +35 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +44 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +3 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +26 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +149 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +42 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +56 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -3
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +4 -7
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +90 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +5 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +2 -20
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +51 -15
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +5 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +2 -28
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +12 -38
- package/frontend-vue/package.json +3 -3
- package/frontend-vue/scripts/check-invariants.mjs +101 -0
- package/package.json +9 -8
- package/skills/dms/SKILL.md +4 -2
- package/skills/dms-module/SKILL.md +3 -0
- package/dist/mcp/mockup-export/capture.d.ts +0 -15
- package/dist/mcp/mockup-export/capture.js +0 -97
- package/dist/mcp/mockup-export/capture.js.map +0 -1
- package/dist/mcp/mockup-export/document.d.ts +0 -4
- package/dist/mcp/mockup-export/document.js +0 -199
- package/dist/mcp/mockup-export/document.js.map +0 -1
- package/dist/mcp/mockup-export/index.d.ts +0 -23
- package/dist/mcp/mockup-export/index.js +0 -90
- package/dist/mcp/mockup-export/index.js.map +0 -1
- package/dist/mcp/mockup-export/plan.d.ts +0 -78
- package/dist/mcp/mockup-export/plan.js +0 -257
- package/dist/mcp/mockup-export/plan.js.map +0 -1
- package/dist/mcp/mockup-export/route.d.ts +0 -13
- package/dist/mcp/mockup-export/route.js +0 -66
- package/dist/mcp/mockup-export/route.js.map +0 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +0 -1
- package/dist/mcp/tools/mockup-export-pdf.js +0 -71
- package/dist/mcp/tools/mockup-export-pdf.js.map +0 -1
- package/dist/mockup/database-manifest.d.ts +0 -2
- package/dist/mockup/database-manifest.js +0 -75
- package/dist/mockup/database-manifest.js.map +0 -1
- package/dist/mockup/entities.d.ts +0 -20
- package/dist/mockup/entities.js +0 -213
- package/dist/mockup/entities.js.map +0 -1
- package/dist/mockup/fixture-routes.js +0 -155
- package/dist/mockup/fixture-routes.js.map +0 -1
- package/dist/mockup/json-schema-entities.d.ts +0 -5
- package/dist/mockup/json-schema-entities.js +0 -141
- package/dist/mockup/json-schema-entities.js.map +0 -1
- package/dist/mockup/json.d.ts +0 -8
- package/dist/mockup/json.js +0 -20
- package/dist/mockup/json.js.map +0 -1
- package/dist/mockup/manifest-blocks.d.ts +0 -19
- package/dist/mockup/manifest-blocks.js +0 -65
- package/dist/mockup/manifest-blocks.js.map +0 -1
- package/dist/mockup/module-manifests.d.ts +0 -22
- package/dist/mockup/module-manifests.js +0 -28
- package/dist/mockup/module-manifests.js.map +0 -1
- package/dist/mockup/modules-schema.d.ts +0 -2
- package/dist/mockup/modules-schema.js +0 -42
- package/dist/mockup/modules-schema.js.map +0 -1
- package/dist/mockup/saas-manifest.d.ts +0 -2
- package/dist/mockup/saas-manifest.js +0 -496
- package/dist/mockup/saas-manifest.js.map +0 -1
- package/dist/mockup/state.d.ts +0 -76
- package/dist/mockup/state.js +0 -22
- package/dist/mockup/state.js.map +0 -1
- package/dist/mockup/store-summary.js.map +0 -1
- package/dist/mockup/tenancy.d.ts +0 -19
- package/dist/mockup/tenancy.js +0 -73
- package/dist/mockup/tenancy.js.map +0 -1
- package/dist/mockup/tenant-rows.d.ts +0 -4
- package/dist/mockup/tenant-rows.js +0 -19
- package/dist/mockup/tenant-rows.js.map +0 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +0 -165
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +0 -48
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +0 -142
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +0 -175
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +0 -76
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +0 -63
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +0 -119
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +0 -80
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +0 -177
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +0 -151
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +0 -23
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +0 -1
- /package/dist/mockup/{store-summary.d.ts → summary-fields.d.ts} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
|
-
import { downloadFile } from "#dms-core/app/utils/downloadFile";
|
|
4
3
|
import { useMockupCatalog } from "../../composables/block-preview/useMockupCatalog";
|
|
5
|
-
import { useMockupDatabase } from "../../composables/block-preview/useMockupDatabase";
|
|
6
4
|
import { useMockupDocument } from "../../composables/block-preview/useMockupDocument";
|
|
7
5
|
import { useMockupEditing } from "../../composables/block-preview/useMockupEditing";
|
|
8
6
|
import { useMockupGridLayout } from "../../composables/block-preview/useMockupGridLayout";
|
|
@@ -10,23 +8,18 @@ import { useMockupLocks } from "../../composables/block-preview/useMockupLocks";
|
|
|
10
8
|
import { useMockupOverview } from "../../composables/block-preview/useMockupOverview";
|
|
11
9
|
import { useMockupPageFrame } from "../../composables/block-preview/useMockupPageFrame";
|
|
12
10
|
import { useMockupPanels } from "../../composables/block-preview/useMockupPanels";
|
|
13
|
-
import { useMockupPdfExport } from "../../composables/block-preview/useMockupPdfExport";
|
|
14
11
|
import { useMockupPins } from "../../composables/block-preview/useMockupPins";
|
|
15
12
|
import { useMockupRealData } from "../../composables/block-preview/useMockupRealData";
|
|
16
13
|
import { useMockupSectionWrites } from "../../composables/block-preview/useMockupSectionWrites";
|
|
17
14
|
import { useMockupSession } from "../../composables/block-preview/useMockupSession";
|
|
18
|
-
import {
|
|
19
|
-
type InitialTenancy,
|
|
20
|
-
useMockupTenancy,
|
|
21
|
-
} from "../../composables/block-preview/useMockupTenancy";
|
|
22
15
|
import { useMockupToolModes } from "../../composables/block-preview/useMockupToolModes";
|
|
23
16
|
import { useMockupViewerHandoff } from "../../composables/block-preview/useMockupViewerHandoff";
|
|
24
17
|
import { useMockupViewerPages } from "../../composables/block-preview/useMockupViewerPages";
|
|
25
18
|
import { useMockupViewerShortcuts } from "../../composables/block-preview/useMockupViewerShortcuts";
|
|
19
|
+
import { dotGridStyle } from "../../utils/dotGrid";
|
|
26
20
|
import type { MockupDataMode, MockupWidth } from "../../utils/mockup";
|
|
27
21
|
import { mockupNavigation } from "../../utils/mockupFrame";
|
|
28
22
|
import { outlineRows } from "../../utils/mockupOutline";
|
|
29
|
-
import { mockupWorkspace } from "../../utils/mockupTenancy";
|
|
30
23
|
import { specCategories } from "../../utils/mockupSections";
|
|
31
24
|
import MockupEditOverlay from "./MockupEditOverlay.vue";
|
|
32
25
|
import MockupEditPanel from "./MockupEditPanel.vue";
|
|
@@ -41,7 +34,6 @@ import MockupReplaceModal from "./MockupReplaceModal.vue";
|
|
|
41
34
|
import MockupSectionDeleteModal from "./MockupSectionDeleteModal.vue";
|
|
42
35
|
import MockupShortcutsModal from "./MockupShortcutsModal.vue";
|
|
43
36
|
import MockupCanvasChrome from "./MockupCanvasChrome.vue";
|
|
44
|
-
import MockupDatabase from "./MockupDatabase.vue";
|
|
45
37
|
import MockupStatusBanners from "./MockupStatusBanners.vue";
|
|
46
38
|
import MockupTopBar from "./MockupTopBar.vue";
|
|
47
39
|
|
|
@@ -65,21 +57,12 @@ import MockupTopBar from "./MockupTopBar.vue";
|
|
|
65
57
|
* page opened from it shows a ✕, which, as Escape once nothing else takes it,
|
|
66
58
|
* goes back to the Overview where it was. Preview hands every click to the
|
|
67
59
|
* page, as the dashboard runs it; Escape leaves it. Each page opened, from
|
|
68
|
-
* the Overview or a link, is a new entry of the browser's history.
|
|
69
|
-
* Database button of the top bar, there while the spec has entities or a
|
|
70
|
-
* connection, puts the DB explorer over the canvas, and no key but its Escape
|
|
71
|
-
* reaches the page behind it. A mockup that lists the `saas` module gets a
|
|
72
|
-
* Single-tenant / SaaS toggle in the top bar: in SaaS mode the frame draws
|
|
73
|
-
* the modules' tenant side in its menu, a workspace switcher over the spec's
|
|
74
|
-
* tenants, and the page's fixtures as the active tenant reads them. Export
|
|
75
|
-
* PDF downloads the mockup printed as `mockup_export_pdf` prints it, with
|
|
76
|
-
* its open annotations, its data model, and the tenant on screen in SaaS mode.
|
|
60
|
+
* the Overview or a link, is a new entry of the browser's history.
|
|
77
61
|
*/
|
|
78
62
|
const props = defineProps<{
|
|
79
63
|
name: string;
|
|
80
64
|
initialWidth?: MockupWidth;
|
|
81
65
|
initialData?: MockupDataMode;
|
|
82
|
-
initialTenancy?: InitialTenancy;
|
|
83
66
|
}>();
|
|
84
67
|
|
|
85
68
|
const { t } = useI18n();
|
|
@@ -116,8 +99,10 @@ const {
|
|
|
116
99
|
categories,
|
|
117
100
|
modules,
|
|
118
101
|
issues,
|
|
102
|
+
warnings,
|
|
119
103
|
requestedPage,
|
|
120
104
|
record,
|
|
105
|
+
query,
|
|
121
106
|
open: openPage,
|
|
122
107
|
currentPage,
|
|
123
108
|
isOverview,
|
|
@@ -125,29 +110,12 @@ const {
|
|
|
125
110
|
isVirtual,
|
|
126
111
|
close: closePage,
|
|
127
112
|
} = useMockupViewerPages({ name: props.name, state, history, spec });
|
|
128
|
-
const database = useMockupDatabase({ shown, openPage });
|
|
129
113
|
const { choice, hasRealData, realData, previewSrc } = useMockupRealData(
|
|
130
114
|
currentPage,
|
|
131
115
|
pages,
|
|
132
116
|
isOverview,
|
|
133
117
|
props.initialData,
|
|
134
118
|
);
|
|
135
|
-
const { hasSaas, isSaas, tenancy, pickTenant } = useMockupTenancy(
|
|
136
|
-
modules,
|
|
137
|
-
computed(() => shown.value?.tenants),
|
|
138
|
-
props.initialTenancy,
|
|
139
|
-
);
|
|
140
|
-
const presenter = useApiErrorPresenter();
|
|
141
|
-
const pdf = useMockupPdfExport({
|
|
142
|
-
name: props.name,
|
|
143
|
-
tenancy,
|
|
144
|
-
fetchRaw: (url, init) => $authFetch.raw(url, init),
|
|
145
|
-
save: downloadFile,
|
|
146
|
-
onFailure: (error) =>
|
|
147
|
-
presenter.presentError(error, {
|
|
148
|
-
fallbackKey: "dms.mockup.export_pdf_failed",
|
|
149
|
-
}),
|
|
150
|
-
});
|
|
151
119
|
const { handoff, runs, handOff, build, resolveComments } =
|
|
152
120
|
useMockupViewerHandoff({
|
|
153
121
|
name: props.name,
|
|
@@ -188,6 +156,7 @@ const overview = useMockupOverview({
|
|
|
188
156
|
isOpen: isOverview,
|
|
189
157
|
pages,
|
|
190
158
|
categories,
|
|
159
|
+
dataMode: choice,
|
|
191
160
|
});
|
|
192
161
|
const pins = useMockupPins({
|
|
193
162
|
session,
|
|
@@ -233,7 +202,6 @@ const canEdit = computed(
|
|
|
233
202
|
!!spec.value &&
|
|
234
203
|
!isReadOnly.value &&
|
|
235
204
|
!isOverview.value &&
|
|
236
|
-
!database.isOpen.value &&
|
|
237
205
|
!isPreviewing.value &&
|
|
238
206
|
!isVirtual.value,
|
|
239
207
|
);
|
|
@@ -245,14 +213,6 @@ const navigation = computed(() =>
|
|
|
245
213
|
active: currentPage.value?.id,
|
|
246
214
|
editable: canEdit.value,
|
|
247
215
|
widgets: shown.value?.sidebar?.widgets,
|
|
248
|
-
modules: modules.value,
|
|
249
|
-
tenancy: tenancy.value,
|
|
250
|
-
workspace: mockupWorkspace(
|
|
251
|
-
shown.value?.tenants,
|
|
252
|
-
tenancy.value,
|
|
253
|
-
shown.value?.entities,
|
|
254
|
-
currentPage.value?.id,
|
|
255
|
-
),
|
|
256
216
|
}),
|
|
257
217
|
);
|
|
258
218
|
const sections = useMockupSectionWrites({
|
|
@@ -268,12 +228,10 @@ const shortcuts = useMockupViewerShortcuts({
|
|
|
268
228
|
history,
|
|
269
229
|
overview,
|
|
270
230
|
isOverview,
|
|
271
|
-
isDatabase: database.isOpen,
|
|
272
231
|
isReadOnly,
|
|
273
232
|
isPreviewing,
|
|
274
233
|
showsShortcuts,
|
|
275
234
|
closePage,
|
|
276
|
-
closeDatabase: database.close,
|
|
277
235
|
});
|
|
278
236
|
|
|
279
237
|
const {
|
|
@@ -289,19 +247,17 @@ const {
|
|
|
289
247
|
toFrame,
|
|
290
248
|
onCanvasClick,
|
|
291
249
|
} = useMockupPageFrame({
|
|
292
|
-
name: props.name,
|
|
293
250
|
editing,
|
|
294
251
|
width,
|
|
295
252
|
shown,
|
|
296
253
|
pages,
|
|
297
254
|
currentPage,
|
|
298
255
|
record,
|
|
256
|
+
query,
|
|
299
257
|
realData,
|
|
300
|
-
tenancy,
|
|
301
258
|
navigation,
|
|
302
259
|
isPreviewing,
|
|
303
260
|
openPage,
|
|
304
|
-
onTenant: pickTenant,
|
|
305
261
|
onSectionEdit: (edit) => sections.write(edit),
|
|
306
262
|
onEscape: () =>
|
|
307
263
|
shortcuts.run(new KeyboardEvent("keydown", { key: "Escape" })),
|
|
@@ -321,27 +277,20 @@ const { showsLeft, showsInspector, gridClass } = useMockupGridLayout({
|
|
|
321
277
|
v-model:real-data="realData"
|
|
322
278
|
v-model:placing="pins.isPlacing.value"
|
|
323
279
|
v-model:previewing="isPreviewing"
|
|
324
|
-
v-model:saas="isSaas"
|
|
325
280
|
:has-real-data="hasRealData"
|
|
326
|
-
:has-saas="hasSaas"
|
|
327
281
|
:title="title"
|
|
328
282
|
:can-undo="editor.canUndo.value && canEdit"
|
|
329
283
|
:can-redo="editor.canRedo.value && canEdit"
|
|
330
284
|
:is-overview="isOverview"
|
|
331
|
-
:has-database="database.isAvailable.value"
|
|
332
|
-
:is-database-open="database.isOpen.value"
|
|
333
285
|
:issue-count="issues.length"
|
|
334
286
|
:is-connected="isConnected"
|
|
335
287
|
:panels="panels.open.value"
|
|
336
288
|
:is-history-open="history.isOpen.value"
|
|
337
289
|
:is-building="runs.isRunning('build')"
|
|
338
|
-
:is-exporting="pdf.isExporting.value"
|
|
339
290
|
@history="history.toggle"
|
|
340
|
-
@database="database.toggle"
|
|
341
291
|
@undo="shortcuts.undo"
|
|
342
292
|
@redo="shortcuts.redo"
|
|
343
293
|
@build="build"
|
|
344
|
-
@export="pdf.run"
|
|
345
294
|
@panel="panels.toggle"
|
|
346
295
|
@rename="(next) => editing.edit({ kind: 'setTitle', title: next })"
|
|
347
296
|
@shortcuts="showsShortcuts = true"
|
|
@@ -375,7 +324,8 @@ const { showsLeft, showsInspector, gridClass } = useMockupGridLayout({
|
|
|
375
324
|
v-show="!isOverview"
|
|
376
325
|
ref="canvas"
|
|
377
326
|
tabindex="-1"
|
|
378
|
-
class="bg-muted absolute inset-0 overflow-auto p-6 pe-20 outline-none"
|
|
327
|
+
class="bg-muted absolute inset-0 overflow-auto bg-local p-6 pe-20 outline-none"
|
|
328
|
+
:style="dotGridStyle()"
|
|
379
329
|
data-dms-mockup-canvas
|
|
380
330
|
@click="onCanvasClick"
|
|
381
331
|
>
|
|
@@ -452,16 +402,10 @@ const { showsLeft, showsInspector, gridClass } = useMockupGridLayout({
|
|
|
452
402
|
:pins="pins"
|
|
453
403
|
:pages="pages"
|
|
454
404
|
:categories="categories"
|
|
455
|
-
:modules="modules"
|
|
456
405
|
:navigation-title="title"
|
|
457
406
|
:data-mode="choice"
|
|
458
407
|
@open="openPage"
|
|
459
408
|
/>
|
|
460
|
-
<MockupDatabase
|
|
461
|
-
v-if="database.isOpen.value"
|
|
462
|
-
class="absolute inset-0 z-40"
|
|
463
|
-
:database="database"
|
|
464
|
-
/>
|
|
465
409
|
<div
|
|
466
410
|
v-if="state && !isConnected"
|
|
467
411
|
class="bg-muted/80 absolute inset-0 z-40 flex items-center justify-center gap-2 backdrop-blur-sm"
|
|
@@ -475,7 +419,6 @@ const { showsLeft, showsInspector, gridClass } = useMockupGridLayout({
|
|
|
475
419
|
<p class="text-muted text-sm">{{ t("dms.mockup.disconnected") }}</p>
|
|
476
420
|
</div>
|
|
477
421
|
<MockupCanvasChrome
|
|
478
|
-
v-if="!database.isOpen.value"
|
|
479
422
|
:has-open-page="!isOverview && pages.length > 0"
|
|
480
423
|
:is-locked="isReadOnly || isPreviewing"
|
|
481
424
|
:pins="pins"
|
|
@@ -503,6 +446,7 @@ const { showsLeft, showsInspector, gridClass } = useMockupGridLayout({
|
|
|
503
446
|
:selection="editing.selection.value"
|
|
504
447
|
:catalog="catalog.byType.value"
|
|
505
448
|
:issues="issues"
|
|
449
|
+
:warnings="warnings"
|
|
506
450
|
:locked-by="locks.blocker.value?.name"
|
|
507
451
|
:sketch-state="
|
|
508
452
|
sketchStates.of(currentPage?.id).get(editing.selection.value ?? '')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends Data">
|
|
2
2
|
import { computed, type Component, type VNodeChild } from "vue";
|
|
3
3
|
import { get } from "@nuxt/ui/runtime/utils/index.js";
|
|
4
|
+
import { isObject } from "#dms-core/app/utils/type-check";
|
|
4
5
|
import DmsKeyValueList, {
|
|
5
6
|
type KeyValueItem,
|
|
6
7
|
} from "../../../components/key-value-list/KeyValueList.vue";
|
|
@@ -17,8 +18,9 @@ import type { Data } from "../table/TableRoot.vue";
|
|
|
17
18
|
/**
|
|
18
19
|
* Detail band of an expanded TableView row: the configured `component`, which
|
|
19
20
|
* draws the whole band, or else the configured `fields` as a label/value list
|
|
20
|
-
* (each value drawn by its column's data type, like a cell
|
|
21
|
-
* `lazyLoad` row loads, or if it fails,
|
|
21
|
+
* (each value drawn by its column's data type, like a cell; a `fullWidth` one
|
|
22
|
+
* in full, over the whole width). While a `lazyLoad` row loads, or if it fails,
|
|
23
|
+
* the band says so in its place.
|
|
22
24
|
*/
|
|
23
25
|
export interface ExpandedRowDetailProps<T extends Data> {
|
|
24
26
|
/** What the band details, as a custom band receives it. */
|
|
@@ -47,12 +49,20 @@ interface DetailField {
|
|
|
47
49
|
column: TableViewColumn;
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
function isEmpty(value: Parameters<typeof isObject>[0]): boolean {
|
|
53
|
+
if (value === null || value === undefined || value === "") return true;
|
|
54
|
+
if (value instanceof Date || !isObject(value)) return false;
|
|
55
|
+
return Object.keys(value).length === 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
50
58
|
const fields = computed<DetailField[]>(() =>
|
|
51
59
|
(props.config.fields ?? []).flatMap((field) => {
|
|
52
60
|
const column = props.rowProps.columns.find(
|
|
53
61
|
(candidate) => candidate.accessorKey === field.key,
|
|
54
62
|
);
|
|
55
63
|
if (!column) return [];
|
|
64
|
+
if (field.hideEmpty && isEmpty(get(props.rowProps.row, column.accessorKey)))
|
|
65
|
+
return [];
|
|
56
66
|
return [
|
|
57
67
|
{
|
|
58
68
|
column,
|
|
@@ -60,6 +70,7 @@ const fields = computed<DetailField[]>(() =>
|
|
|
60
70
|
id: field.key,
|
|
61
71
|
label: processI18n(field.label ?? column.header),
|
|
62
72
|
value: "",
|
|
73
|
+
fullWidth: field.fullWidth,
|
|
63
74
|
},
|
|
64
75
|
},
|
|
65
76
|
];
|
|
@@ -76,16 +87,16 @@ const detailComponent = computed<Component | string | undefined>(() => {
|
|
|
76
87
|
return resolveDmsComponent(name) || name;
|
|
77
88
|
});
|
|
78
89
|
|
|
79
|
-
function renderField(
|
|
90
|
+
function renderField({ id: key, fullWidth }: KeyValueItem): VNodeChild {
|
|
80
91
|
const column = key ? columnByKey.value.get(key) : undefined;
|
|
81
92
|
if (!column) return EMPTY_VALUE;
|
|
82
93
|
const row = props.rowProps.row;
|
|
83
94
|
if (get(row, column.accessorKey) === "") return EMPTY_VALUE;
|
|
84
|
-
return renderColumnValue(column, row, "detail");
|
|
95
|
+
return renderColumnValue(column, row, fullWidth ? "full" : "detail");
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
const FieldValue = (fieldProps: { item: KeyValueItem }) =>
|
|
88
|
-
renderField(fieldProps.item
|
|
99
|
+
renderField(fieldProps.item);
|
|
89
100
|
</script>
|
|
90
101
|
|
|
91
102
|
<template>
|
|
@@ -138,10 +149,19 @@ const FieldValue = (fieldProps: { item: KeyValueItem }) =>
|
|
|
138
149
|
dense
|
|
139
150
|
>
|
|
140
151
|
<template #value="{ item }">
|
|
141
|
-
<
|
|
152
|
+
<div v-if="item.fullWidth" class="text-highlighted min-w-0">
|
|
153
|
+
<FieldValue :item="item" />
|
|
154
|
+
</div>
|
|
155
|
+
<span v-else class="text-highlighted min-w-0 truncate">
|
|
142
156
|
<FieldValue :item="item" />
|
|
143
157
|
</span>
|
|
144
158
|
</template>
|
|
145
159
|
</DmsKeyValueList>
|
|
146
160
|
</section>
|
|
161
|
+
<p
|
|
162
|
+
v-else-if="props.config.fields?.some((field) => field.hideEmpty)"
|
|
163
|
+
class="text-dimmed text-[12.5px]"
|
|
164
|
+
>
|
|
165
|
+
{{ t("dms.form.empty_value") }}
|
|
166
|
+
</p>
|
|
147
167
|
</template>
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { BLOCK_ATTRIBUTES } from "../blocks/blockDataState";
|
|
2
|
+
import {
|
|
3
|
+
fontFaceRules,
|
|
4
|
+
inlineImages,
|
|
5
|
+
loadedFontCss,
|
|
6
|
+
} from "./previewCaptureAssets";
|
|
7
|
+
import { rasterize, type Rasterizer } from "./previewRaster";
|
|
8
|
+
|
|
9
|
+
/** How long the page has to stop loading before the capture gives up. */
|
|
10
|
+
const SETTLE_TIMEOUT_MS = 20_000;
|
|
11
|
+
|
|
12
|
+
/** How long the frame has to keep its markup and its height before it is drawn. */
|
|
13
|
+
const QUIET_MS = 300;
|
|
14
|
+
|
|
15
|
+
/** How long the capture waits for an animation frame a hidden document never runs. */
|
|
16
|
+
const FRAME_FALLBACK_MS = 100;
|
|
17
|
+
|
|
18
|
+
/** How long the capture waits before it asks again whether the blocks have loaded. */
|
|
19
|
+
const POLL_MS = 100;
|
|
20
|
+
|
|
21
|
+
/** The properties of `<body>` the frame inherits from it, which the capture puts on the element it draws the frame in. */
|
|
22
|
+
const BODY_PROPERTIES = [
|
|
23
|
+
"font-family",
|
|
24
|
+
"color",
|
|
25
|
+
"background-color",
|
|
26
|
+
"font-size",
|
|
27
|
+
"line-height",
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
const XHTML = "http://www.w3.org/1999/xhtml";
|
|
31
|
+
const SVG = "http://www.w3.org/2000/svg";
|
|
32
|
+
|
|
33
|
+
const LOADING_BLOCK = `[${BLOCK_ATTRIBUTES.state}="loading"]`;
|
|
34
|
+
|
|
35
|
+
function nextFrame(): Promise<void> {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
const fallback = setTimeout(resolve, FRAME_FALLBACK_MS);
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
clearTimeout(fallback);
|
|
40
|
+
resolve();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Resolves once the fonts have loaded, no data block is still loading its
|
|
47
|
+
* first answer, two frames have been drawn, and `frame` has kept its markup
|
|
48
|
+
* and its height for {@link QUIET_MS}, since a block that mounts late has not
|
|
49
|
+
* said it is loading yet. A frame that never stays still, such as one with a
|
|
50
|
+
* running animation, is drawn as it is at {@link SETTLE_TIMEOUT_MS}; it
|
|
51
|
+
* rejects when blocks are still loading then.
|
|
52
|
+
*/
|
|
53
|
+
async function settled(frame: HTMLElement): Promise<void> {
|
|
54
|
+
const deadline = Date.now() + SETTLE_TIMEOUT_MS;
|
|
55
|
+
let changedAt = Date.now();
|
|
56
|
+
let height = frame.getBoundingClientRect().height;
|
|
57
|
+
const observer = new MutationObserver(() => {
|
|
58
|
+
changedAt = Date.now();
|
|
59
|
+
});
|
|
60
|
+
observer.observe(frame, {
|
|
61
|
+
childList: true,
|
|
62
|
+
subtree: true,
|
|
63
|
+
attributes: true,
|
|
64
|
+
characterData: true,
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
do {
|
|
68
|
+
await document.fonts.ready;
|
|
69
|
+
await nextFrame();
|
|
70
|
+
await nextFrame();
|
|
71
|
+
const next = frame.getBoundingClientRect().height;
|
|
72
|
+
if (next !== height) {
|
|
73
|
+
height = next;
|
|
74
|
+
changedAt = Date.now();
|
|
75
|
+
}
|
|
76
|
+
const isLoading =
|
|
77
|
+
document.fonts.status === "loading" ||
|
|
78
|
+
document.querySelector(LOADING_BLOCK) !== null;
|
|
79
|
+
if (!isLoading && Date.now() - changedAt >= QUIET_MS) return;
|
|
80
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_MS));
|
|
81
|
+
} while (Date.now() < deadline);
|
|
82
|
+
} finally {
|
|
83
|
+
observer.disconnect();
|
|
84
|
+
}
|
|
85
|
+
if (document.querySelector(LOADING_BLOCK) === null) return;
|
|
86
|
+
throw new Error("The page is still loading");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function escapeXml(text: string): string {
|
|
90
|
+
return text.replaceAll("&", "&").replaceAll("<", "<");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function escapeAttribute(text: string): string {
|
|
94
|
+
return escapeXml(text).replaceAll('"', """);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** The style sheets of the document, which the frame is styled by. */
|
|
98
|
+
function styleSheets(): CSSStyleSheet[] {
|
|
99
|
+
return [...document.styleSheets, ...document.adoptedStyleSheets];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The text of every rule of the style sheets but the `@font-face` ones, which {@link loadedFontCss} writes again with their files inside. */
|
|
103
|
+
function rulesText(): string {
|
|
104
|
+
const text: string[] = [];
|
|
105
|
+
for (const sheet of styleSheets()) {
|
|
106
|
+
try {
|
|
107
|
+
for (const rule of sheet.cssRules) {
|
|
108
|
+
if (!(rule instanceof CSSFontFaceRule)) text.push(rule.cssText);
|
|
109
|
+
}
|
|
110
|
+
} catch {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return text.join("\n");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** What `<html>` and `<body>` give the frame, as the declarations of the element it is drawn in: the custom properties the theme sets on `<html>`, and the text and background of `<body>`. */
|
|
118
|
+
function inheritedDeclarations(): string {
|
|
119
|
+
const root = getComputedStyle(document.documentElement);
|
|
120
|
+
const declarations: string[] = [];
|
|
121
|
+
for (const name of root) {
|
|
122
|
+
if (name.startsWith("--")) {
|
|
123
|
+
declarations.push(`${name}:${root.getPropertyValue(name)}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const body = getComputedStyle(document.body);
|
|
127
|
+
for (const name of BODY_PROPERTIES) {
|
|
128
|
+
declarations.push(`${name}:${body.getPropertyValue(name)}`);
|
|
129
|
+
}
|
|
130
|
+
return declarations.join(";");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Replaces each canvas of `clone` with an image of what `frame` has drawn on its own. */
|
|
134
|
+
function replaceCanvases(frame: Element, clone: Element): void {
|
|
135
|
+
const copies = clone.querySelectorAll("canvas");
|
|
136
|
+
frame.querySelectorAll("canvas").forEach((canvas, index) => {
|
|
137
|
+
const copy = copies[index];
|
|
138
|
+
if (!copy) return;
|
|
139
|
+
try {
|
|
140
|
+
const image = document.createElement("img");
|
|
141
|
+
image.src = canvas.toDataURL();
|
|
142
|
+
image.setAttribute("style", canvas.getAttribute("style") ?? "");
|
|
143
|
+
image.width = canvas.width;
|
|
144
|
+
image.height = canvas.height;
|
|
145
|
+
copy.replaceWith(image);
|
|
146
|
+
} catch {
|
|
147
|
+
copy.remove();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Replaces each iframe of `clone`, which an image never draws, with a box of its size and look. */
|
|
153
|
+
function replaceFrames(clone: Element): void {
|
|
154
|
+
for (const iframe of clone.querySelectorAll("iframe")) {
|
|
155
|
+
const box = document.createElement("div");
|
|
156
|
+
box.className = iframe.className;
|
|
157
|
+
box.setAttribute("style", iframe.getAttribute("style") ?? "");
|
|
158
|
+
iframe.replaceWith(box);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** The ids of the elements the `<use>` of `root` point at, and those they point at in turn. */
|
|
163
|
+
function referencedIds(root: Element): Set<string> {
|
|
164
|
+
const ids = new Set<string>();
|
|
165
|
+
const pending = [root];
|
|
166
|
+
while (pending.length > 0) {
|
|
167
|
+
const scope = pending.pop();
|
|
168
|
+
for (const use of scope?.querySelectorAll("use") ?? []) {
|
|
169
|
+
const id = (
|
|
170
|
+
use.getAttribute("href") ??
|
|
171
|
+
use.getAttribute("xlink:href") ??
|
|
172
|
+
""
|
|
173
|
+
).slice(1);
|
|
174
|
+
const target = id ? document.getElementById(id) : null;
|
|
175
|
+
if (target && !ids.has(id)) {
|
|
176
|
+
ids.add(id);
|
|
177
|
+
pending.push(target);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return ids;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** A hidden `<svg>` holding the elements the `<use>` of `clone` point at: icons are a sprite outside the frame, which the image would not reach. */
|
|
185
|
+
function spriteOf(clone: Element): SVGSVGElement {
|
|
186
|
+
const sprite = document.createElementNS(SVG, "svg");
|
|
187
|
+
sprite.setAttribute("style", "display:none");
|
|
188
|
+
for (const id of referencedIds(clone)) {
|
|
189
|
+
const target = document.getElementById(id);
|
|
190
|
+
if (target) sprite.append(target.cloneNode(true));
|
|
191
|
+
}
|
|
192
|
+
return sprite;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** `frame`'s markup as the image draws it: the elements as they are now, their canvases as images, their pictures and icons inside, nothing that runs or loads. */
|
|
196
|
+
async function standaloneClone(frame: HTMLElement): Promise<Element> {
|
|
197
|
+
const clone = frame.cloneNode(true);
|
|
198
|
+
if (!(clone instanceof Element))
|
|
199
|
+
throw new TypeError("The frame is not an element");
|
|
200
|
+
for (const script of clone.querySelectorAll("script")) script.remove();
|
|
201
|
+
replaceCanvases(frame, clone);
|
|
202
|
+
replaceFrames(clone);
|
|
203
|
+
await inlineImages(clone);
|
|
204
|
+
clone.prepend(spriteOf(clone));
|
|
205
|
+
return clone;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** The SVG that draws `frame` in an element of its size, which carries what the document gives the frame. */
|
|
209
|
+
async function frameSvg(
|
|
210
|
+
frame: HTMLElement,
|
|
211
|
+
width: number,
|
|
212
|
+
height: number,
|
|
213
|
+
): Promise<string> {
|
|
214
|
+
const [clone, fontCss] = await Promise.all([
|
|
215
|
+
standaloneClone(frame),
|
|
216
|
+
loadedFontCss(document.fonts, fontFaceRules(styleSheets())),
|
|
217
|
+
]);
|
|
218
|
+
const markup = new XMLSerializer().serializeToString(clone);
|
|
219
|
+
const declarations = `${inheritedDeclarations()};width:${width}px;height:${height}px;overflow:hidden`;
|
|
220
|
+
const html = `<div xmlns="${XHTML}" class="${escapeAttribute(document.documentElement.className)}" style="${escapeAttribute(declarations)}"><style>${escapeXml(`${rulesText()}\n${fontCss}`)}</style>${markup}</div>`;
|
|
221
|
+
const rootSize = getComputedStyle(document.documentElement).fontSize;
|
|
222
|
+
return `<svg xmlns="${SVG}" width="${width}" height="${height}" style="font-size:${escapeAttribute(rootSize)}"><foreignObject width="100%" height="100%">${html}</foreignObject></svg>`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Draws `frame`, as it is on screen now, to an image: a Blob, WebP where the
|
|
227
|
+
* browser encodes it, at half the frame's size. It waits first for the fonts
|
|
228
|
+
* and for every data block to leave `loading`, then clones the frame with
|
|
229
|
+
* the document's style rules, the theme's custom properties and what `<body>`
|
|
230
|
+
* gives its text, the fonts and pictures it uses as data URLs and its icons
|
|
231
|
+
* as an inline sprite, and has the browser draw that markup as an SVG
|
|
232
|
+
* `<foreignObject>`. Capture libraries inline every computed style instead,
|
|
233
|
+
* which takes seconds on a page of this size. A sketch's iframe is drawn as an
|
|
234
|
+
* empty box of its size, and a picture or a style's `url()` that cannot be
|
|
235
|
+
* read is left out. The preview answers a `capture` message with it.
|
|
236
|
+
*/
|
|
237
|
+
export async function capturePreviewFrame(
|
|
238
|
+
frame: HTMLElement,
|
|
239
|
+
draw: Rasterizer = rasterize,
|
|
240
|
+
): Promise<Blob> {
|
|
241
|
+
await settled(frame);
|
|
242
|
+
const rect = frame.getBoundingClientRect();
|
|
243
|
+
const width = Math.ceil(rect.width);
|
|
244
|
+
const height = Math.ceil(rect.height);
|
|
245
|
+
if (width === 0 || height === 0) throw new Error("The frame has no size");
|
|
246
|
+
return draw(await frameSvg(frame, width, height), width, height);
|
|
247
|
+
}
|