@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
|
@@ -6,10 +6,12 @@ import { badgeOf, stageOf } from "../utils/mockupCard";
|
|
|
6
6
|
import MockupThumbnail from "./MockupThumbnail.vue";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* One mockup of the Mockups page
|
|
10
|
-
*
|
|
11
|
-
* menu to open, rename, copy or delete
|
|
12
|
-
*
|
|
9
|
+
* One mockup of the Mockups page, laid out as a template card of the mailing
|
|
10
|
+
* module: the stored image of its first page (an icon when it has none), its
|
|
11
|
+
* stage over the image, its title with a menu to open, rename, copy or delete
|
|
12
|
+
* it, where it came from, its open comments, and when it last changed. The
|
|
13
|
+
* whole card opens the viewer, and a built mockup lists the real pages it
|
|
14
|
+
* made, each a link of its own.
|
|
13
15
|
*/
|
|
14
16
|
const props = defineProps<{
|
|
15
17
|
mockup: MockupSummary;
|
|
@@ -36,6 +38,9 @@ const SOURCE_KEYS: Record<MockupSource, string> = {
|
|
|
36
38
|
const { t, locale } = useI18n();
|
|
37
39
|
|
|
38
40
|
const badge = computed(() => badgeOf(stageOf(props.mockup)));
|
|
41
|
+
const statusLabel = computed(() =>
|
|
42
|
+
t(`dms.mockup.${badge.value.key}`, badge.value.params ?? {}),
|
|
43
|
+
);
|
|
39
44
|
const label = computed(() => props.mockup.title || props.mockup.name);
|
|
40
45
|
const viewerLink = computed(
|
|
41
46
|
() => `${VIEWER_PATH}?name=${encodeURIComponent(props.mockup.name)}`,
|
|
@@ -89,17 +94,54 @@ const menu = computed(() => [
|
|
|
89
94
|
</script>
|
|
90
95
|
|
|
91
96
|
<template>
|
|
92
|
-
<
|
|
93
|
-
|
|
97
|
+
<DmsCardPanel
|
|
98
|
+
as="li"
|
|
99
|
+
:padded="false"
|
|
100
|
+
interactive
|
|
101
|
+
class="focus-within:outline-primary relative flex flex-col overflow-hidden focus-within:outline-2"
|
|
94
102
|
:data-dms-mockup-card="mockup.name"
|
|
95
103
|
>
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
104
|
+
<div class="relative">
|
|
105
|
+
<MockupThumbnail :name="mockup.name" :captured-at="mockup.capturedAt" />
|
|
106
|
+
<span
|
|
107
|
+
class="bg-default pointer-events-none absolute top-2.5 left-2.5 z-10 rounded-full"
|
|
108
|
+
>
|
|
109
|
+
<DmsStatusPill
|
|
110
|
+
:tone="badge.color"
|
|
111
|
+
:label="statusLabel"
|
|
112
|
+
size="sm"
|
|
113
|
+
data-dms-mockup-status
|
|
114
|
+
/>
|
|
115
|
+
</span>
|
|
116
|
+
<UBadge
|
|
117
|
+
v-if="mockup.openComments > 0"
|
|
118
|
+
color="primary"
|
|
119
|
+
variant="subtle"
|
|
120
|
+
size="sm"
|
|
121
|
+
icon="i-lucide-message-square"
|
|
122
|
+
class="pointer-events-none absolute top-2.5 right-2.5 z-10"
|
|
123
|
+
data-dms-mockup-comments
|
|
124
|
+
>
|
|
125
|
+
{{
|
|
126
|
+
t(
|
|
127
|
+
"dms.mockup.card_comments",
|
|
128
|
+
{ count: mockup.openComments },
|
|
129
|
+
mockup.openComments,
|
|
130
|
+
)
|
|
131
|
+
}}
|
|
132
|
+
</UBadge>
|
|
133
|
+
</div>
|
|
134
|
+
<div
|
|
135
|
+
class="border-default flex flex-1 flex-col gap-1.5 border-t px-3.5 pt-3 pb-3"
|
|
136
|
+
>
|
|
137
|
+
<div class="flex min-w-0 items-center gap-2">
|
|
138
|
+
<h3
|
|
139
|
+
class="text-highlighted min-w-0 flex-1 truncate text-[13.5px] font-semibold"
|
|
140
|
+
:title="label"
|
|
141
|
+
>
|
|
100
142
|
<DmsLink
|
|
101
143
|
:to="viewerLink"
|
|
102
|
-
class="
|
|
144
|
+
class="outline-none after:absolute after:inset-0"
|
|
103
145
|
data-dms-mockup-open
|
|
104
146
|
>
|
|
105
147
|
{{ label }}
|
|
@@ -111,50 +153,22 @@ const menu = computed(() => [
|
|
|
111
153
|
color="neutral"
|
|
112
154
|
variant="ghost"
|
|
113
155
|
size="xs"
|
|
114
|
-
|
|
156
|
+
square
|
|
157
|
+
class="relative shrink-0"
|
|
115
158
|
:aria-label="t('dms.mockup.card_actions', { name: label })"
|
|
116
159
|
data-dms-mockup-menu
|
|
117
160
|
/>
|
|
118
161
|
</UDropdownMenu>
|
|
119
162
|
</div>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
data-dms-mockup-status
|
|
126
|
-
>
|
|
127
|
-
{{ t(`dms.mockup.${badge.key}`, badge.params ?? {}) }}
|
|
128
|
-
</UBadge>
|
|
129
|
-
<UBadge
|
|
130
|
-
v-if="mockup.openComments > 0"
|
|
131
|
-
color="primary"
|
|
132
|
-
variant="subtle"
|
|
133
|
-
size="sm"
|
|
134
|
-
icon="i-lucide-message-square"
|
|
135
|
-
data-dms-mockup-comments
|
|
136
|
-
>
|
|
137
|
-
{{
|
|
138
|
-
t(
|
|
139
|
-
"dms.mockup.card_comments",
|
|
140
|
-
{ count: mockup.openComments },
|
|
141
|
-
mockup.openComments,
|
|
142
|
-
)
|
|
143
|
-
}}
|
|
144
|
-
</UBadge>
|
|
145
|
-
</div>
|
|
146
|
-
<p class="text-muted text-xs" data-dms-mockup-meta>{{ meta }}</p>
|
|
147
|
-
<p class="text-dimmed text-xs">
|
|
148
|
-
<time
|
|
149
|
-
:datetime="mockup.updatedAt"
|
|
150
|
-
:title="updatedExact"
|
|
151
|
-
data-dms-mockup-updated
|
|
152
|
-
v-text="updated"
|
|
153
|
-
/>
|
|
163
|
+
<p
|
|
164
|
+
class="text-dimmed truncate font-mono text-[11.5px]"
|
|
165
|
+
data-dms-mockup-meta
|
|
166
|
+
>
|
|
167
|
+
{{ meta }}
|
|
154
168
|
</p>
|
|
155
169
|
<ul
|
|
156
170
|
v-if="mockup.status === 'built'"
|
|
157
|
-
class="
|
|
171
|
+
class="flex flex-wrap gap-x-3 gap-y-1"
|
|
158
172
|
:aria-label="t('dms.mockup.built_pages')"
|
|
159
173
|
>
|
|
160
174
|
<li
|
|
@@ -182,6 +196,17 @@ const menu = computed(() => [
|
|
|
182
196
|
</button>
|
|
183
197
|
</li>
|
|
184
198
|
</ul>
|
|
199
|
+
<div
|
|
200
|
+
class="border-default text-muted mt-auto flex items-center gap-3 border-t pt-2 font-mono text-[11.5px]"
|
|
201
|
+
>
|
|
202
|
+
<time
|
|
203
|
+
class="truncate"
|
|
204
|
+
:datetime="mockup.updatedAt"
|
|
205
|
+
:title="updatedExact"
|
|
206
|
+
data-dms-mockup-updated
|
|
207
|
+
v-text="updated"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
185
210
|
</div>
|
|
186
|
-
</
|
|
211
|
+
</DmsCardPanel>
|
|
187
212
|
</template>
|
|
@@ -24,7 +24,7 @@ import { resyncFromPage } from "./resync";
|
|
|
24
24
|
*/
|
|
25
25
|
const props = defineProps<{ context: TableViewDisplayContext }>();
|
|
26
26
|
|
|
27
|
-
const SKELETON_COUNT =
|
|
27
|
+
const SKELETON_COUNT = 6;
|
|
28
28
|
const VIEWER_PATH = "/mockup";
|
|
29
29
|
const STARTER_ELLIPSIS = " …";
|
|
30
30
|
|
|
@@ -122,20 +122,27 @@ async function remove(mockup: MockupSummary): Promise<void> {
|
|
|
122
122
|
<div>
|
|
123
123
|
<ul
|
|
124
124
|
v-if="context.firstPageLoading"
|
|
125
|
-
class="grid grid-cols-
|
|
125
|
+
class="grid grid-cols-[repeat(auto-fill,minmax(272px,1fr))] gap-4 p-4"
|
|
126
126
|
aria-hidden="true"
|
|
127
127
|
>
|
|
128
|
-
<
|
|
128
|
+
<DmsCardPanel
|
|
129
129
|
v-for="index in SKELETON_COUNT"
|
|
130
130
|
:key="index"
|
|
131
|
-
|
|
131
|
+
as="li"
|
|
132
|
+
:padded="false"
|
|
133
|
+
class="flex flex-col overflow-hidden"
|
|
132
134
|
>
|
|
133
|
-
<USkeleton class="
|
|
134
|
-
<div
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
<USkeleton class="h-[172px] rounded-none" />
|
|
136
|
+
<div
|
|
137
|
+
class="border-default flex flex-1 flex-col gap-1.5 border-t px-3.5 pt-3 pb-3"
|
|
138
|
+
>
|
|
139
|
+
<USkeleton class="h-6 w-2/3" />
|
|
140
|
+
<USkeleton class="h-[17px] w-1/2" />
|
|
141
|
+
<div class="border-default mt-auto border-t pt-2">
|
|
142
|
+
<USkeleton class="h-[17px] w-1/3" />
|
|
143
|
+
</div>
|
|
137
144
|
</div>
|
|
138
|
-
</
|
|
145
|
+
</DmsCardPanel>
|
|
139
146
|
</ul>
|
|
140
147
|
|
|
141
148
|
<div
|
|
@@ -155,13 +162,13 @@ async function remove(mockup: MockupSummary): Promise<void> {
|
|
|
155
162
|
|
|
156
163
|
<ul
|
|
157
164
|
v-else
|
|
158
|
-
class="grid grid-cols-
|
|
165
|
+
class="grid grid-cols-[repeat(auto-fill,minmax(272px,1fr))] gap-4 p-4"
|
|
159
166
|
data-dms-mockup-cards
|
|
160
167
|
>
|
|
161
168
|
<li class="flex">
|
|
162
169
|
<button
|
|
163
170
|
type="button"
|
|
164
|
-
class="border-accented text-muted hover:border-primary hover:text-highlighted focus-visible:outline-primary flex min-h-
|
|
171
|
+
class="border-accented text-muted hover:border-primary hover:text-highlighted focus-visible:outline-primary flex min-h-[280px] w-full flex-col items-center justify-center gap-3 rounded-[var(--dms-radius-card)] border border-dashed p-6 text-center transition-colors focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
165
172
|
data-dms-mockup-new
|
|
166
173
|
@click="newMockup"
|
|
167
174
|
>
|
|
@@ -1,145 +1,56 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref
|
|
3
|
-
import {
|
|
4
|
-
import { usePreviewFrame } from "../composables/block-preview/usePreviewFrame";
|
|
5
|
-
import { isPreviewTheme } from "../utils/blockPreview";
|
|
6
|
-
import { previewRenderMessage } from "../utils/blockPreviewMessages";
|
|
7
|
-
import {
|
|
8
|
-
MOCKUP_WIDTHS,
|
|
9
|
-
mockupEndpoint,
|
|
10
|
-
parseMockupState,
|
|
11
|
-
type MockupState,
|
|
12
|
-
} from "../utils/mockup";
|
|
13
|
-
import {
|
|
14
|
-
mockupDataTree,
|
|
15
|
-
mockupPreviewPath,
|
|
16
|
-
readsRealData,
|
|
17
|
-
} from "../utils/mockupRealData";
|
|
18
|
-
import { mockupNavigation } from "../utils/mockupFrame";
|
|
19
|
-
import { currentSketchScheme } from "../utils/sketch";
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { mockupCaptureUrl } from "../utils/mockup";
|
|
20
4
|
|
|
21
5
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* has no page to draw.
|
|
6
|
+
* The first page of a mockup as its card shows it: the image the Overview
|
|
7
|
+
* stored beside the spec, 240 px wide on a dotted band, its top cropped by
|
|
8
|
+
* the band. It draws no page. A mockup with no stored image, or whose image
|
|
9
|
+
* cannot be loaded, leaves a quiet icon on the band.
|
|
27
10
|
*/
|
|
28
|
-
const props = defineProps<{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const bandWidth = ref(0);
|
|
42
|
-
|
|
43
|
-
const isInView = useElementVisibility(band);
|
|
44
|
-
useResizeObserver(band, ([entry]) => {
|
|
45
|
-
bandWidth.value = entry?.contentRect.width ?? 0;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const page = computed(() => state.value?.pages[0]);
|
|
49
|
-
/** A page converted from a live page is drawn on its live routes, the others on fixtures that refuse them. */
|
|
50
|
-
const previewPath = computed(() =>
|
|
51
|
-
mockupPreviewPath(readsRealData(page.value, undefined)),
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
name: string;
|
|
13
|
+
/** When the stored image was written, ISO 8601; absent when the mockup has none. */
|
|
14
|
+
capturedAt?: string;
|
|
15
|
+
}>();
|
|
16
|
+
|
|
17
|
+
const baseURL = useDmsRuntimeConfig().public.dms?.baseURL;
|
|
18
|
+
|
|
19
|
+
const failedUrl = ref<string>();
|
|
20
|
+
const url = computed(() =>
|
|
21
|
+
props.capturedAt
|
|
22
|
+
? mockupCaptureUrl(baseURL, props.name, props.capturedAt)
|
|
23
|
+
: undefined,
|
|
52
24
|
);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const stageStyle = computed(() => ({
|
|
56
|
-
width: `${MOCKUP_WIDTHS.desktop}px`,
|
|
57
|
-
height: `${SCREEN_HEIGHT_PX}px`,
|
|
58
|
-
transform: `scale(${scale.value})`,
|
|
59
|
-
transformOrigin: "top left",
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
const navigation = computed(() =>
|
|
63
|
-
mockupNavigation({
|
|
64
|
-
title: state.value?.title || props.name,
|
|
65
|
-
categories: state.value?.categories ?? [],
|
|
66
|
-
pages: state.value?.pages ?? [],
|
|
67
|
-
active: page.value?.id,
|
|
68
|
-
widgets: state.value?.sidebar?.widgets,
|
|
69
|
-
modules: state.value?.modules,
|
|
70
|
-
}),
|
|
25
|
+
const shown = computed(() =>
|
|
26
|
+
url.value === failedUrl.value ? undefined : url.value,
|
|
71
27
|
);
|
|
72
|
-
|
|
73
|
-
function syncPreview(): void {
|
|
74
|
-
const current = page.value;
|
|
75
|
-
if (!current) return;
|
|
76
|
-
bridge.post(
|
|
77
|
-
previewRenderMessage({
|
|
78
|
-
tree: mockupDataTree(current, readsRealData(current, undefined)),
|
|
79
|
-
theme: isPreviewTheme(current.options.theme)
|
|
80
|
-
? current.options.theme
|
|
81
|
-
: currentSketchScheme(),
|
|
82
|
-
locale: current.options.locale,
|
|
83
|
-
padding: current.options.padding ?? true,
|
|
84
|
-
navigation: navigation.value,
|
|
85
|
-
}),
|
|
86
|
-
);
|
|
87
|
-
isDrawn.value = true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const bridge = usePreviewFrame({
|
|
91
|
-
frame,
|
|
92
|
-
onReady: syncPreview,
|
|
93
|
-
onSelect: () => undefined,
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
async function load(): Promise<void> {
|
|
97
|
-
try {
|
|
98
|
-
state.value = parseMockupState(
|
|
99
|
-
await $authFetch(mockupEndpoint(props.name)),
|
|
100
|
-
);
|
|
101
|
-
} catch {
|
|
102
|
-
state.value = undefined;
|
|
103
|
-
}
|
|
104
|
-
isLoaded.value = true;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
watch(isInView, (inView) => {
|
|
108
|
-
if (!inView || hasBeenSeen.value) return;
|
|
109
|
-
hasBeenSeen.value = true;
|
|
110
|
-
void load();
|
|
111
|
-
});
|
|
112
28
|
</script>
|
|
113
29
|
|
|
114
30
|
<template>
|
|
115
31
|
<div
|
|
116
|
-
|
|
117
|
-
class="bg-muted border-default relative aspect-[16/10] overflow-hidden border-b"
|
|
32
|
+
class="bg-elevated/40 relative flex h-[172px] justify-center overflow-hidden bg-[radial-gradient(var(--ui-border)_1px,transparent_1px)] bg-[length:14px_14px] pt-4"
|
|
118
33
|
aria-hidden="true"
|
|
119
34
|
data-dms-mockup-thumbnail
|
|
120
35
|
>
|
|
121
|
-
<div v-if="
|
|
36
|
+
<div v-if="shown" class="pointer-events-none h-fit rounded-t-md shadow-sm">
|
|
37
|
+
<img
|
|
38
|
+
:src="shown"
|
|
39
|
+
alt=""
|
|
40
|
+
class="bg-default block w-60 max-w-full rounded-t-md"
|
|
41
|
+
loading="lazy"
|
|
42
|
+
decoding="async"
|
|
43
|
+
draggable="false"
|
|
44
|
+
data-dms-mockup-thumbnail-image
|
|
45
|
+
@error="failedUrl = shown"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
<div v-else class="grid place-items-center self-center">
|
|
122
49
|
<UIcon
|
|
123
50
|
name="i-lucide-layout-template"
|
|
124
51
|
class="text-dimmed size-8"
|
|
125
52
|
data-dms-mockup-thumbnail-placeholder
|
|
126
53
|
/>
|
|
127
54
|
</div>
|
|
128
|
-
<div
|
|
129
|
-
v-else-if="page && scale > 0"
|
|
130
|
-
class="pointer-events-none absolute top-0 left-0"
|
|
131
|
-
:style="stageStyle"
|
|
132
|
-
>
|
|
133
|
-
<iframe
|
|
134
|
-
ref="frame"
|
|
135
|
-
:key="previewPath"
|
|
136
|
-
class="bg-default block size-full border-0 transition-opacity duration-200 motion-reduce:transition-none"
|
|
137
|
-
:class="isDrawn ? 'opacity-100' : 'opacity-0'"
|
|
138
|
-
:src="previewPath"
|
|
139
|
-
:title="t('dms.mockup.thumbnail_title', { name: props.name })"
|
|
140
|
-
tabindex="-1"
|
|
141
|
-
aria-hidden="true"
|
|
142
|
-
/>
|
|
143
|
-
</div>
|
|
144
55
|
</div>
|
|
145
56
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isObject, isString } from "#dms-core/app/utils/type-check";
|
|
2
2
|
import { mockupEndpoint } from "../utils/mockup";
|
|
3
|
+
import { clearMockupCaptures } from "../utils/mockupCaptures";
|
|
3
4
|
|
|
4
5
|
/** What a mockup change sends: a new name, a new title, or both. */
|
|
5
6
|
export interface MockupRenameRequest {
|
|
@@ -23,15 +24,17 @@ function readName(answer: Answer): string {
|
|
|
23
24
|
throw new Error("Unexpected answer from the mockup API");
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
/** Renames mockup `name`, and answers the name it has now. */
|
|
27
|
+
/** Renames mockup `name`, and answers the name it has now. The Overview's captures of a mockup that changed name are released, since they are kept by name. */
|
|
27
28
|
export async function renameMockup(
|
|
28
29
|
fetch: MockupFetch,
|
|
29
30
|
name: string,
|
|
30
31
|
change: MockupRenameRequest,
|
|
31
32
|
): Promise<string> {
|
|
32
|
-
|
|
33
|
+
const renamed = readName(
|
|
33
34
|
await fetch(mockupEndpoint(name), { method: "PATCH", body: change }),
|
|
34
35
|
);
|
|
36
|
+
if (renamed !== name) clearMockupCaptures(name);
|
|
37
|
+
return renamed;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
/** Copies mockup `name` into a draft the server names, and answers that name. */
|
|
@@ -47,10 +50,11 @@ export async function duplicateMockup(
|
|
|
47
50
|
);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
/** Deletes the folder of mockup `name
|
|
53
|
+
/** Deletes the folder of mockup `name`, and releases the Overview's captures of it. */
|
|
51
54
|
export async function deleteMockup(
|
|
52
55
|
fetch: MockupFetch,
|
|
53
56
|
name: string,
|
|
54
57
|
): Promise<void> {
|
|
55
58
|
await fetch(mockupEndpoint(name), { method: "DELETE" });
|
|
59
|
+
clearMockupCaptures(name);
|
|
56
60
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { JsonValue } from "../../../../dms-core/app/types/json";
|
|
2
|
+
import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
|
|
3
|
+
import { isRecord, PREVIEW_CHANNEL } from "./blockPreviewChannel";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Parent → iframe: draw the preview's frame to an image and answer with a
|
|
7
|
+
* `capture` of the same `id`. The frame is captured as it is, so a parent
|
|
8
|
+
* asks once the page it sent is drawn.
|
|
9
|
+
*/
|
|
10
|
+
export interface PreviewCaptureRequestMessage {
|
|
11
|
+
channel: typeof PREVIEW_CHANNEL;
|
|
12
|
+
type: "capture";
|
|
13
|
+
/** Pairs the answer with the request. */
|
|
14
|
+
id: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Iframe → parent: the image of the frame a `capture` asked for. A Blob is structured-cloned into the parent's realm, so `instanceof Blob` holds there. */
|
|
18
|
+
export interface PreviewCaptureMessage {
|
|
19
|
+
channel: typeof PREVIEW_CHANNEL;
|
|
20
|
+
type: "capture";
|
|
21
|
+
/** The `id` of the request this answers. */
|
|
22
|
+
id: number;
|
|
23
|
+
image: Blob;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Iframe → parent: the frame could not be captured. */
|
|
27
|
+
export interface PreviewCaptureFailedMessage {
|
|
28
|
+
channel: typeof PREVIEW_CHANNEL;
|
|
29
|
+
type: "capture";
|
|
30
|
+
/** The `id` of the request this answers. */
|
|
31
|
+
id: number;
|
|
32
|
+
error: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Iframe → parent: the answer to a `capture` request, the image or why there is none. */
|
|
36
|
+
export type PreviewCaptureAnswer =
|
|
37
|
+
PreviewCaptureMessage | PreviewCaptureFailedMessage;
|
|
38
|
+
|
|
39
|
+
export function previewCaptureRequestMessage(
|
|
40
|
+
id: number,
|
|
41
|
+
): PreviewCaptureRequestMessage {
|
|
42
|
+
return { channel: PREVIEW_CHANNEL, type: "capture", id };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function previewCaptureMessage(
|
|
46
|
+
id: number,
|
|
47
|
+
image: Blob,
|
|
48
|
+
): PreviewCaptureMessage {
|
|
49
|
+
return { channel: PREVIEW_CHANNEL, type: "capture", id, image };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function previewCaptureFailedMessage(
|
|
53
|
+
id: number,
|
|
54
|
+
error: string,
|
|
55
|
+
): PreviewCaptureFailedMessage {
|
|
56
|
+
return { channel: PREVIEW_CHANNEL, type: "capture", id, error };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function isRequestId(value: JsonValue | undefined): value is number {
|
|
60
|
+
return isNumber(value) && Number.isInteger(value);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Whether `value` is a `capture` request: an integer id, nothing else asked. */
|
|
64
|
+
export function isCaptureRequestMessage(
|
|
65
|
+
value: Parameters<typeof isRecord>[0],
|
|
66
|
+
): value is PreviewCaptureRequestMessage {
|
|
67
|
+
return (
|
|
68
|
+
isRecord(value) &&
|
|
69
|
+
value.channel === PREVIEW_CHANNEL &&
|
|
70
|
+
value.type === "capture" &&
|
|
71
|
+
isNumber(value.id) &&
|
|
72
|
+
Number.isInteger(value.id)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The answer to a `capture` in the fields the preview posted: an image Blob,
|
|
78
|
+
* or why there is none; undefined when it holds neither. The image is checked
|
|
79
|
+
* for what it is, a Blob of an image type, since a string or a JSON object in
|
|
80
|
+
* its place would be handed to an `<img>` as a source.
|
|
81
|
+
*/
|
|
82
|
+
export function parseCaptureAnswer({
|
|
83
|
+
id,
|
|
84
|
+
image,
|
|
85
|
+
error,
|
|
86
|
+
}: {
|
|
87
|
+
id?: JsonValue;
|
|
88
|
+
image?: JsonValue | Blob;
|
|
89
|
+
error?: JsonValue;
|
|
90
|
+
}): PreviewCaptureAnswer | undefined {
|
|
91
|
+
if (!isRequestId(id)) return undefined;
|
|
92
|
+
if (image instanceof Blob && image.type.startsWith("image/")) {
|
|
93
|
+
return previewCaptureMessage(id, image);
|
|
94
|
+
}
|
|
95
|
+
return isString(error) ? previewCaptureFailedMessage(id, error) : undefined;
|
|
96
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isObject } from "../../../../dms-core/app/utils/type-check";
|
|
2
|
+
|
|
3
|
+
export const PREVIEW_CHANNEL = "dms-preview";
|
|
4
|
+
|
|
5
|
+
/** Whether a posted value is an object with fields, which the message files read the fields of. */
|
|
6
|
+
export function isRecord(
|
|
7
|
+
value: Parameters<typeof isObject>[0],
|
|
8
|
+
): value is Record<string, unknown> {
|
|
9
|
+
return isObject(value) && value !== null && !Array.isArray(value);
|
|
10
|
+
}
|