@antelopejs/dms 0.25.6 → 0.25.7-next.1111.gaba637e
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 +0 -60
- package/README.md +1 -1
- package/data/mockup-spec.schema.json +223 -303
- 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 +2 -1
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/search-route.js +5 -8
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +1 -4
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +1 -5
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +0 -4
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +17 -5
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mockup-export/capture.d.ts +15 -0
- package/dist/mcp/mockup-export/capture.js +97 -0
- package/dist/mcp/mockup-export/capture.js.map +1 -0
- package/dist/mcp/mockup-export/document.d.ts +4 -0
- package/dist/mcp/mockup-export/document.js +199 -0
- package/dist/mcp/mockup-export/document.js.map +1 -0
- package/dist/mcp/mockup-export/index.d.ts +23 -0
- package/dist/mcp/mockup-export/index.js +90 -0
- package/dist/mcp/mockup-export/index.js.map +1 -0
- package/dist/mcp/mockup-export/plan.d.ts +78 -0
- package/dist/mcp/mockup-export/plan.js +257 -0
- package/dist/mcp/mockup-export/plan.js.map +1 -0
- package/dist/mcp/mockup-export/route.d.ts +13 -0
- package/dist/mcp/mockup-export/route.js +66 -0
- package/dist/mcp/mockup-export/route.js.map +1 -0
- package/dist/mcp/page-verify/index.d.ts +14 -0
- package/dist/mcp/page-verify/index.js +9 -5
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +2 -1
- package/dist/mcp/page-verify/mockup.js +1 -0
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +22 -4
- 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-export-pdf.d.ts +1 -0
- package/dist/mcp/tools/mockup-export-pdf.js +71 -0
- package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
- 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 +10 -3
- 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 +2 -0
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +1 -0
- package/dist/mcp/tools/page-verify.js +5 -1
- 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 +1 -2
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +0 -3
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/compile.d.ts +6 -1
- package/dist/mockup/compile.js +29 -25
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +10 -62
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/database-manifest.d.ts +2 -0
- package/dist/mockup/database-manifest.js +75 -0
- package/dist/mockup/database-manifest.js.map +1 -0
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/entities.d.ts +20 -0
- package/dist/mockup/entities.js +213 -0
- package/dist/mockup/entities.js.map +1 -0
- 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 +1 -0
- package/dist/mockup/fixture-answers.js +1 -1
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/{capture-routes.d.ts → fixture-routes.d.ts} +11 -6
- package/dist/mockup/fixture-routes.js +155 -0
- package/dist/mockup/fixture-routes.js.map +1 -0
- package/dist/mockup/fixtures.d.ts +1 -3
- package/dist/mockup/fixtures.js +2 -25
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +1 -10
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/generate.js +4 -1
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.js +2 -17
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +3 -0
- package/dist/mockup/index.js +3 -0
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-entities.d.ts +5 -0
- package/dist/mockup/json-schema-entities.js +141 -0
- package/dist/mockup/json-schema-entities.js.map +1 -0
- package/dist/mockup/json-schema.js +23 -24
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/json.d.ts +8 -0
- package/dist/mockup/json.js +20 -0
- package/dist/mockup/json.js.map +1 -0
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/manifest-blocks.d.ts +19 -0
- package/dist/mockup/manifest-blocks.js +65 -0
- package/dist/mockup/manifest-blocks.js.map +1 -0
- package/dist/mockup/model.d.ts +106 -255
- package/dist/mockup/model.js +86 -82
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/module-manifests.d.ts +22 -0
- package/dist/mockup/module-manifests.js +28 -0
- package/dist/mockup/module-manifests.js.map +1 -0
- package/dist/mockup/modules-schema.d.ts +2 -0
- package/dist/mockup/modules-schema.js +42 -0
- package/dist/mockup/modules-schema.js.map +1 -0
- package/dist/mockup/modules.d.ts +20 -9
- package/dist/mockup/modules.js +146 -22
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/page-links.d.ts +1 -2
- package/dist/mockup/page-links.js +3 -14
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +4 -1
- package/dist/mockup/refusals.js +15 -1
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +1 -5
- package/dist/mockup/routes.js +9 -171
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/saas-manifest.d.ts +2 -0
- package/dist/mockup/saas-manifest.js +496 -0
- package/dist/mockup/saas-manifest.js.map +1 -0
- package/dist/mockup/sample-rows.js +0 -4
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/state.d.ts +76 -0
- package/dist/mockup/state.js +22 -0
- package/dist/mockup/state.js.map +1 -0
- package/dist/mockup/{summary-fields.js → store-summary.js} +1 -1
- package/dist/mockup/store-summary.js.map +1 -0
- package/dist/mockup/store.d.ts +1 -2
- package/dist/mockup/store.js +16 -22
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-columns.js +3 -9
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +1 -4
- package/dist/mockup/table-options.js +2 -40
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/tenancy.d.ts +19 -0
- package/dist/mockup/tenancy.js +73 -0
- package/dist/mockup/tenancy.js.map +1 -0
- package/dist/mockup/tenant-rows.d.ts +4 -0
- package/dist/mockup/tenant-rows.js +19 -0
- package/dist/mockup/tenant-rows.js.map +1 -0
- package/dist/mockup/validate.d.ts +1 -7
- package/dist/mockup/validate.js +3 -76
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +0 -1
- package/dist/pages/account.js +0 -1
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +0 -2
- package/dist/pages/settings/overview/account-summary.js +8 -17
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +1 -2
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +4 -2
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +1 -7
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +0 -1
- 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/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +0 -1
- 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 +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +1 -4
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +0 -3
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +1 -17
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +0 -3
- 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 +0 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +2 -3
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +5 -23
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +0 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +443 -12
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -8
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -8
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +0 -2
- package/frontend-vue/layers/dms-layout/app/app.config.ts +0 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +4 -7
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +29 -14
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +0 -2
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +3 -19
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +110 -9
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -8
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +9 -6
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +2 -6
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +22 -27
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +10 -8
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +3 -39
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +5 -38
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +3 -1
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +4 -23
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +31 -39
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +9 -60
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +1 -7
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +1 -14
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +0 -13
- 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 +0 -3
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -3
- 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/MockupDatabase.vue +165 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +1 -22
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +182 -125
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -114
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +4 -10
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +48 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +76 -8
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +65 -9
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +6 -26
- 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/useBlockPreviewEmbed.ts +6 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +175 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +35 -109
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +18 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +76 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +63 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +1 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +13 -68
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +7 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +0 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +0 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +0 -38
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +3 -69
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +7 -20
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +0 -36
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +0 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +5 -21
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +0 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +4 -32
- 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 +2 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +6 -68
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +0 -5
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +48 -73
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +11 -18
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +125 -34
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +3 -7
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +149 -84
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +119 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +72 -43
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +92 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +1 -35
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +17 -44
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +177 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +14 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +14 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +151 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -56
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +3 -0
- 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 +7 -4
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +0 -5
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +20 -2
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +15 -51
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +0 -10
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +0 -3
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +0 -5
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +28 -2
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +38 -12
- package/frontend-vue/scripts/check-invariants.mjs +0 -101
- package/package.json +5 -5
- package/skills/dms/SKILL.md +2 -4
- package/skills/dms-module/SKILL.md +0 -3
- package/dist/implementations/dms-base/group-order.d.ts +0 -18
- package/dist/implementations/dms-base/group-order.js +0 -66
- package/dist/implementations/dms-base/group-order.js.map +0 -1
- package/dist/mockup/capture-routes.js +0 -101
- package/dist/mockup/capture-routes.js.map +0 -1
- package/dist/mockup/capture.d.ts +0 -10
- package/dist/mockup/capture.js +0 -64
- package/dist/mockup/capture.js.map +0 -1
- package/dist/mockup/header-action.d.ts +0 -47
- package/dist/mockup/header-action.js +0 -46
- package/dist/mockup/header-action.js.map +0 -1
- package/dist/mockup/json-schema-header.d.ts +0 -2
- package/dist/mockup/json-schema-header.js +0 -69
- package/dist/mockup/json-schema-header.js.map +0 -1
- package/dist/mockup/json-schema-layout.d.ts +0 -2
- package/dist/mockup/json-schema-layout.js +0 -61
- package/dist/mockup/json-schema-layout.js.map +0 -1
- package/dist/mockup/summary-fields.js.map +0 -1
- package/dist/mockup/table-param-filters.d.ts +0 -52
- package/dist/mockup/table-param-filters.js +0 -83
- package/dist/mockup/table-param-filters.js.map +0 -1
- package/dist/mockup/table-row-actions.d.ts +0 -2
- package/dist/mockup/table-row-actions.js +0 -85
- package/dist/mockup/table-row-actions.js.map +0 -1
- package/dist/mockup/unknown-keys.d.ts +0 -3
- package/dist/mockup/unknown-keys.js +0 -45
- package/dist/mockup/unknown-keys.js.map +0 -1
- package/dist/utils/email-plain-text.d.ts +0 -1
- package/dist/utils/email-plain-text.js +0 -95
- package/dist/utils/email-plain-text.js.map +0 -1
- package/dist/utils/html-email.d.ts +0 -8
- package/dist/utils/html-email.js +0 -9
- package/dist/utils/html-email.js.map +0 -1
- package/dist/utils/image-signatures.d.ts +0 -3
- package/dist/utils/image-signatures.js +0 -22
- package/dist/utils/image-signatures.js.map +0 -1
- package/dist/utils/sse-keepalive/index.d.ts +0 -3
- package/dist/utils/sse-keepalive/index.js +0 -8
- package/dist/utils/sse-keepalive/index.js.map +0 -1
- package/dist/validation/allowed-keys.d.ts +0 -2
- package/dist/validation/allowed-keys.js +0 -16
- package/dist/validation/allowed-keys.js.map +0 -1
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +0 -485
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +0 -27
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +0 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +0 -49
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +0 -110
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +0 -75
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +0 -67
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +0 -247
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +0 -181
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +0 -45
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +0 -136
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +0 -96
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +0 -10
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -61
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +0 -37
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +0 -279
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +0 -130
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +0 -154
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +0 -149
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +0 -42
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +0 -90
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +0 -1
- /package/dist/mockup/{summary-fields.d.ts → store-summary.d.ts} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportDocument = exportDocument;
|
|
4
|
+
exports.exportFooter = exportFooter;
|
|
5
|
+
const ERD_COLUMNS = 3;
|
|
6
|
+
const BOX_WIDTH = 200;
|
|
7
|
+
const BOX_GAP_X = 60;
|
|
8
|
+
const BOX_GAP_Y = 40;
|
|
9
|
+
const HEADER_HEIGHT = 26;
|
|
10
|
+
const ROW_HEIGHT = 17;
|
|
11
|
+
const MAX_ERD_FIELDS = 8;
|
|
12
|
+
const BOX_PADDING = 8;
|
|
13
|
+
const ESCAPES = new Map([
|
|
14
|
+
["&", "&"],
|
|
15
|
+
["<", "<"],
|
|
16
|
+
[">", ">"],
|
|
17
|
+
['"', """],
|
|
18
|
+
["'", "'"],
|
|
19
|
+
]);
|
|
20
|
+
function escape(text) {
|
|
21
|
+
return text.replace(/[&<>"']/g, (char) => ESCAPES.get(char) ?? char);
|
|
22
|
+
}
|
|
23
|
+
const STYLE = `
|
|
24
|
+
@page { size: A4; margin: 14mm 14mm 16mm; }
|
|
25
|
+
* { box-sizing: border-box; }
|
|
26
|
+
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1a1a1a; font-size: 11pt; }
|
|
27
|
+
section { break-after: page; }
|
|
28
|
+
section:last-child { break-after: auto; }
|
|
29
|
+
.cover { display: flex; flex-direction: column; min-height: 250mm; }
|
|
30
|
+
.cover .kicker { color: #666; font-size: 10pt; letter-spacing: .04em; text-transform: uppercase; }
|
|
31
|
+
.cover h1 { font-size: 28pt; margin: 40mm 0 4mm; }
|
|
32
|
+
.cover .meta { color: #555; margin: 0; }
|
|
33
|
+
.toc { margin-top: 14mm; line-height: 1.7; }
|
|
34
|
+
.toc h2 { font-size: 12pt; margin: 0 0 3mm; }
|
|
35
|
+
.toc .group { margin-top: 3mm; }
|
|
36
|
+
.toc .group b { display: block; }
|
|
37
|
+
.toc .group span { color: #444; }
|
|
38
|
+
.tag { font-size: 8pt; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #eef2ff; color: #3730a3; margin-left: 6px; }
|
|
39
|
+
.cover .source { margin-top: auto; color: #888; font-size: 9pt; }
|
|
40
|
+
.screen h2 { font-size: 15pt; margin: 0 0 1mm; }
|
|
41
|
+
.screen .mode { color: #666; font-size: 9.5pt; margin: 0 0 4mm; }
|
|
42
|
+
.shot { border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
|
|
43
|
+
.shot img { display: block; width: 100%; max-height: 160mm; object-fit: contain; object-position: top left; }
|
|
44
|
+
.missing { padding: 20mm; text-align: center; color: #888; border: 1px dashed #ccc; border-radius: 4px; }
|
|
45
|
+
.blocks { margin: 4mm 0 0; font-size: 10pt; }
|
|
46
|
+
.notes { margin-top: 4mm; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 4px; padding: 3mm 4mm; font-size: 10pt; }
|
|
47
|
+
.notes p { margin: 1mm 0; }
|
|
48
|
+
.schema h2 { font-size: 15pt; margin: 0 0 1mm; }
|
|
49
|
+
.erd { margin: 4mm 0 6mm; }
|
|
50
|
+
.erd svg { width: 100%; height: auto; }
|
|
51
|
+
table { width: 100%; border-collapse: collapse; font-size: 10pt; }
|
|
52
|
+
th, td { text-align: left; padding: 2mm; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
|
|
53
|
+
th { color: #666; font-weight: 500; }
|
|
54
|
+
`;
|
|
55
|
+
function cover(plan, name, schemaNumber) {
|
|
56
|
+
const groups = plan.groups.map((group) => `<div class="group"><b>${group.number}. ${escape(group.title)}${groupTag(group)}</b><span>${group.screens.map((screen) => escape(screen.title)).join(" · ")}</span></div>`);
|
|
57
|
+
const schema = plan.schema
|
|
58
|
+
? `<div class="group"><b>${schemaNumber}. Data model</b><span>${plan.schema.length} entities · ERD</span></div>`
|
|
59
|
+
: "";
|
|
60
|
+
const counts = [
|
|
61
|
+
`${plan.counts.pages} ${plan.counts.pages === 1 ? "page" : "pages"}`,
|
|
62
|
+
`${plan.counts.modules} ${plan.counts.modules === 1 ? "module" : "modules"}`,
|
|
63
|
+
`${plan.counts.entities} ${plan.counts.entities === 1 ? "entity" : "entities"}`,
|
|
64
|
+
];
|
|
65
|
+
const tenant = plan.tenant
|
|
66
|
+
? ` · SaaS mode as ${escape(plan.tenant.name)}`
|
|
67
|
+
: "";
|
|
68
|
+
return `<section class="cover" data-export-section="cover">
|
|
69
|
+
<div class="kicker">${escape(name)} · mockup</div>
|
|
70
|
+
<h1>${escape(plan.title)}</h1>
|
|
71
|
+
<p class="meta">Mockup · ${escape(plan.date)} · ${counts.join(" · ")}${tenant}</p>
|
|
72
|
+
<div class="toc"><h2>Contents</h2>${groups.join("")}${schema}</div>
|
|
73
|
+
<div class="source">Generated from mockups/${escape(name)}/spec.json</div>
|
|
74
|
+
</section>`;
|
|
75
|
+
}
|
|
76
|
+
function groupTag(group) {
|
|
77
|
+
if (group.kind === "app")
|
|
78
|
+
return "";
|
|
79
|
+
return `<span class="tag">${group.kind}</span>`;
|
|
80
|
+
}
|
|
81
|
+
function screenSection(screen, shot) {
|
|
82
|
+
const image = shot
|
|
83
|
+
? `<div class="shot"><img alt="" src="data:image/png;base64,${shot.toString("base64")}"></div>`
|
|
84
|
+
: `<div class="missing">The viewer drew no frame for this page.</div>`;
|
|
85
|
+
const notes = screen.notes.length
|
|
86
|
+
? `<div class="notes">${screen.notes.map((note) => `<p>💬 <b>Annotation #${note.number}</b> ${escape(note.text)}</p>`).join("")}</div>`
|
|
87
|
+
: "";
|
|
88
|
+
return `<section class="screen" data-export-section="screen" data-page="${escape(screen.pageId)}">
|
|
89
|
+
<h2>${escape(screen.number)} ${screen.path.map(escape).join(" › ")}</h2>
|
|
90
|
+
<p class="mode">${screen.mode.map(escape).join(" · ")}</p>
|
|
91
|
+
${image}
|
|
92
|
+
<p class="blocks"><b>Blocks:</b> ${screen.blocks.map(escape).join(" · ") || "none"}</p>
|
|
93
|
+
${notes}
|
|
94
|
+
</section>`;
|
|
95
|
+
}
|
|
96
|
+
function boxHeight(entity) {
|
|
97
|
+
const rows = Math.min(entity.fields.length, MAX_ERD_FIELDS + 1);
|
|
98
|
+
return HEADER_HEIGHT + rows * ROW_HEIGHT + BOX_PADDING;
|
|
99
|
+
}
|
|
100
|
+
function layout(entities) {
|
|
101
|
+
const boxes = [];
|
|
102
|
+
let y = 0;
|
|
103
|
+
for (let start = 0; start < entities.length; start += ERD_COLUMNS) {
|
|
104
|
+
const row = entities.slice(start, start + ERD_COLUMNS);
|
|
105
|
+
const height = Math.max(...row.map(boxHeight));
|
|
106
|
+
row.forEach((entity, column) => boxes.push({
|
|
107
|
+
entity,
|
|
108
|
+
x: column * (BOX_WIDTH + BOX_GAP_X),
|
|
109
|
+
y,
|
|
110
|
+
height: boxHeight(entity),
|
|
111
|
+
}));
|
|
112
|
+
y += height + BOX_GAP_Y;
|
|
113
|
+
}
|
|
114
|
+
const columns = Math.min(entities.length, ERD_COLUMNS);
|
|
115
|
+
return {
|
|
116
|
+
boxes,
|
|
117
|
+
width: columns * BOX_WIDTH + (columns - 1) * BOX_GAP_X,
|
|
118
|
+
height: y - BOX_GAP_Y,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function fieldLabel(field) {
|
|
122
|
+
return field.to
|
|
123
|
+
? `${field.name} → ${field.to}`
|
|
124
|
+
: `${field.name}: ${field.type}`;
|
|
125
|
+
}
|
|
126
|
+
function boxSvg(box) {
|
|
127
|
+
const shown = box.entity.fields.slice(0, MAX_ERD_FIELDS);
|
|
128
|
+
const more = box.entity.fields.length - shown.length;
|
|
129
|
+
const rows = [
|
|
130
|
+
...shown.map(fieldLabel),
|
|
131
|
+
...(more > 0 ? [`+${more} more`] : []),
|
|
132
|
+
].map((label, index) => `<text x="${box.x + BOX_PADDING}" y="${box.y + HEADER_HEIGHT + (index + 1) * ROW_HEIGHT - 4}" font-size="11" fill="#333">${escape(label)}</text>`);
|
|
133
|
+
return `<g data-entity="${escape(box.entity.name)}">
|
|
134
|
+
<rect x="${box.x}" y="${box.y}" width="${BOX_WIDTH}" height="${box.height}" rx="6" fill="#fff" stroke="#9ca3af"/>
|
|
135
|
+
<rect x="${box.x}" y="${box.y}" width="${BOX_WIDTH}" height="${HEADER_HEIGHT}" rx="6" fill="#eef2ff" stroke="#9ca3af"/>
|
|
136
|
+
<text x="${box.x + BOX_PADDING}" y="${box.y + HEADER_HEIGHT - 9}" font-size="12" font-weight="700" fill="#1e1b4b">${escape(box.entity.name)}${box.entity.tenantScoped ? " · tenant" : ""}</text>
|
|
137
|
+
${rows.join("\n")}
|
|
138
|
+
</g>`;
|
|
139
|
+
}
|
|
140
|
+
function centre(box) {
|
|
141
|
+
return { x: box.x + BOX_WIDTH / 2, y: box.y + box.height / 2 };
|
|
142
|
+
}
|
|
143
|
+
function borderPoint(box, toward) {
|
|
144
|
+
const from = centre(box);
|
|
145
|
+
const dx = toward.x - from.x;
|
|
146
|
+
const dy = toward.y - from.y;
|
|
147
|
+
const scale = Math.min(dx === 0 ? Infinity : BOX_WIDTH / 2 / Math.abs(dx), dy === 0 ? Infinity : box.height / 2 / Math.abs(dy));
|
|
148
|
+
return { x: from.x + dx * scale, y: from.y + dy * scale };
|
|
149
|
+
}
|
|
150
|
+
function edgesSvg(boxes) {
|
|
151
|
+
const byName = new Map(boxes.map((box) => [box.entity.name, box]));
|
|
152
|
+
return boxes
|
|
153
|
+
.flatMap((box) => box.entity.fields.flatMap((field) => {
|
|
154
|
+
const target = field.to === undefined ? undefined : byName.get(field.to);
|
|
155
|
+
if (!target || target === box)
|
|
156
|
+
return [];
|
|
157
|
+
const from = borderPoint(box, centre(target));
|
|
158
|
+
const to = borderPoint(target, centre(box));
|
|
159
|
+
return [
|
|
160
|
+
`<line x1="${from.x}" y1="${from.y}" x2="${to.x}" y2="${to.y}" stroke="#6366f1" stroke-width="1.5" marker-end="url(#arrow)"/>`,
|
|
161
|
+
];
|
|
162
|
+
}))
|
|
163
|
+
.join("\n");
|
|
164
|
+
}
|
|
165
|
+
function erd(entities) {
|
|
166
|
+
const { boxes, width, height } = layout(entities);
|
|
167
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 -4 ${width + 8} ${height + 8}" role="img" aria-label="Entity relationship diagram">
|
|
168
|
+
<defs><marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="#6366f1"/></marker></defs>
|
|
169
|
+
${edgesSvg(boxes)}
|
|
170
|
+
${boxes.map(boxSvg).join("\n")}
|
|
171
|
+
</svg>`;
|
|
172
|
+
}
|
|
173
|
+
function schemaSection(entities, number) {
|
|
174
|
+
const rows = entities.map((entity) => {
|
|
175
|
+
const refs = entity.fields.flatMap((field) => field.to ? [`${field.name} → ${field.to}`] : []);
|
|
176
|
+
return `<tr><td>${escape(entity.name)}</td><td>${entity.fields.length}</td><td>${entity.tenantScoped ? "yes" : "no"}</td><td>${refs.map(escape).join(", ") || "—"}</td></tr>`;
|
|
177
|
+
});
|
|
178
|
+
return `<section class="schema" data-export-section="schema">
|
|
179
|
+
<h2>${number}. Data model</h2>
|
|
180
|
+
<p class="mode">Source: spec entities</p>
|
|
181
|
+
<div class="erd">${erd(entities)}</div>
|
|
182
|
+
<table><thead><tr><th>Entity</th><th>Fields</th><th>Tenant</th><th>References</th></tr></thead><tbody>${rows.join("")}</tbody></table>
|
|
183
|
+
</section>`;
|
|
184
|
+
}
|
|
185
|
+
function exportDocument(plan, name, shots) {
|
|
186
|
+
const schemaNumber = plan.groups.length + 1;
|
|
187
|
+
const screens = plan.groups.flatMap((group) => group.screens.map((screen) => screenSection(screen, shots.get(screen.pageId))));
|
|
188
|
+
return `<!doctype html>
|
|
189
|
+
<html lang="en"><head><meta charset="utf-8"><title>${escape(plan.title)}</title><style>${STYLE}</style></head>
|
|
190
|
+
<body>
|
|
191
|
+
${cover(plan, name, schemaNumber)}
|
|
192
|
+
${screens.join("\n")}
|
|
193
|
+
${plan.schema ? schemaSection(plan.schema, schemaNumber) : ""}
|
|
194
|
+
</body></html>`;
|
|
195
|
+
}
|
|
196
|
+
function exportFooter(plan) {
|
|
197
|
+
return `<div style="width:100%;font-size:8px;color:#888;padding:0 14mm;display:flex;justify-content:space-between;font-family:system-ui,sans-serif"><span>${escape(plan.title)} · mockup</span><span class="pageNumber"></span></div>`;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/document.ts"],"names":[],"mappings":";;;;AAUA,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,GAAG,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC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AM,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAChD,CACF,CAAC;IACF,OAAO;qDAC4C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAAK;;EAE5F,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;EAC/B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;EAClB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;eAC9C,CAAC;AAChB,CAAC;AAGD,sBAA6B,IAAgB;IAC3C,OAAO,qJAAqJ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,wDAAwD,CAAC;AACzO,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type MockupName } from "../../mockup";
|
|
2
|
+
import { type ExportOptions } from "./plan";
|
|
3
|
+
export * from "./document";
|
|
4
|
+
export * from "./plan";
|
|
5
|
+
export interface ExportRequest {
|
|
6
|
+
name: MockupName;
|
|
7
|
+
mockupsDir: string;
|
|
8
|
+
origin: string;
|
|
9
|
+
options: ExportOptions;
|
|
10
|
+
}
|
|
11
|
+
export type ExportOutcome = {
|
|
12
|
+
ok: true;
|
|
13
|
+
path: string;
|
|
14
|
+
pdf: Buffer;
|
|
15
|
+
screens: string[];
|
|
16
|
+
undrawn: string[];
|
|
17
|
+
schema: boolean;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
reason: "no_mockup" | "invalid";
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function exportMockupPdf(request: ExportRequest): Promise<ExportOutcome>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.exportMockupPdf = exportMockupPdf;
|
|
18
|
+
const node_path_1 = require("node:path");
|
|
19
|
+
const mockup_1 = require("../../mockup");
|
|
20
|
+
const capture_1 = require("./capture");
|
|
21
|
+
const document_1 = require("./document");
|
|
22
|
+
const plan_1 = require("./plan");
|
|
23
|
+
__exportStar(require("./document"), exports);
|
|
24
|
+
__exportStar(require("./plan"), exports);
|
|
25
|
+
async function exportMockupPdf(request) {
|
|
26
|
+
const { name, mockupsDir, options } = request;
|
|
27
|
+
const text = await (0, mockup_1.readSpecText)(mockupsDir, name);
|
|
28
|
+
if (text === undefined) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
reason: "no_mockup",
|
|
32
|
+
message: `Mockup "${name}" does not exist: no mockups/${name}/spec.json.`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const read = (0, mockup_1.parseSpec)(text);
|
|
36
|
+
if (!read.ok) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
reason: "invalid",
|
|
40
|
+
message: `The spec of "${name}" does not parse: ${read.issues.map((issue) => `${issue.path || "/"} ${issue.message}`).join("; ")}`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const notes = (await (0, mockup_1.listAnnotationsInSpec)(name, mockupsDir)) ?? [];
|
|
44
|
+
const planned = (0, plan_1.planExport)(read.spec, notes, options, new Date());
|
|
45
|
+
if (!planned.ok) {
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
reason: "invalid",
|
|
49
|
+
message: (0, plan_1.describeRefusal)(planned.refusal),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const { plan } = planned;
|
|
53
|
+
const printed = (0, plan_1.planScreens)(plan);
|
|
54
|
+
const screens = printed.map((screen) => screen.pageId);
|
|
55
|
+
let drawn = new Set();
|
|
56
|
+
const pdf = await (0, capture_1.captureAndPrint)({
|
|
57
|
+
name,
|
|
58
|
+
pages: printed.map((screen) => ({
|
|
59
|
+
id: screen.pageId,
|
|
60
|
+
hasBlocks: screen.blocks.length > 0,
|
|
61
|
+
})),
|
|
62
|
+
...(options.saasTenant !== undefined && {
|
|
63
|
+
saasTenant: options.saasTenant,
|
|
64
|
+
}),
|
|
65
|
+
origin: request.origin,
|
|
66
|
+
}, (shots) => {
|
|
67
|
+
drawn = new Set(shots.keys());
|
|
68
|
+
return {
|
|
69
|
+
html: (0, document_1.exportDocument)(plan, name, shots),
|
|
70
|
+
pdf: {
|
|
71
|
+
format: "A4",
|
|
72
|
+
printBackground: true,
|
|
73
|
+
displayHeaderFooter: true,
|
|
74
|
+
headerTemplate: "<span></span>",
|
|
75
|
+
footerTemplate: (0, document_1.exportFooter)(plan),
|
|
76
|
+
preferCSSPageSize: true,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
await (0, mockup_1.writeAtomically)((0, node_path_1.join)((0, mockup_1.mockupDirectory)(mockupsDir, name), mockup_1.EXPORT_PDF_FILE), pdf);
|
|
81
|
+
return {
|
|
82
|
+
ok: true,
|
|
83
|
+
path: `mockups/${name}/${mockup_1.EXPORT_PDF_FILE}`,
|
|
84
|
+
pdf,
|
|
85
|
+
screens,
|
|
86
|
+
undrawn: screens.filter((id) => !drawn.has(id)),
|
|
87
|
+
schema: plan.schema !== undefined,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAiC;AACjC,yCAQsB;AACtB,uCAA4C;AAC5C,yCAA0D;AAC1D,iCAKgB;AAEhB,6CAA2B;AAC3B,yCAAuB;AAiChB,KAAK,0BACV,OAAsB;IAEtB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,WAAW,IAAI,gCAAgC,IAAI,aAAa;SAC1E,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,gBAAgB,IAAI,qBAAqB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACnI,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAA,8BAAqB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;IACpE,MAAM,OAAO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AAE,IAAI;gBACzB,cAAc,EAAE,eAAe;gBAC/B,cAAc,EAAE,IAAA,uBAAY,EAAC,IAAI,CAAC;gBAClC,iBAAiB,EAAE,IAAI;aACxB;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IACF,MAAM,IAAA,wBAAe,EACnB,IAAA,gBAAI,EAAC,IAAA,wBAAe,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,wBAAe,CAAC,EACxD,GAAG,CACJ,CAAC;IACF,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,WAAW,IAAI,IAAI,wBAAe,EAAE;QAC1C,GAAG;QACH,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type AnnotationInSpec, type MockupSpec } from "../../mockup";
|
|
3
|
+
export declare const exportOptionsSchema: z.ZodObject<{
|
|
4
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
+
annotations: z.ZodBoolean;
|
|
6
|
+
saasTenant: z.ZodOptional<z.ZodString>;
|
|
7
|
+
includeSchema: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type ExportOptions = z.infer<typeof exportOptionsSchema>;
|
|
10
|
+
type GroupKind = "app" | "custom" | "catalog";
|
|
11
|
+
export interface ExportGroup {
|
|
12
|
+
number: number;
|
|
13
|
+
title: string;
|
|
14
|
+
kind: GroupKind;
|
|
15
|
+
screens: ExportScreen[];
|
|
16
|
+
}
|
|
17
|
+
export interface ExportNote {
|
|
18
|
+
number: number;
|
|
19
|
+
text: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ExportScreen {
|
|
22
|
+
number: string;
|
|
23
|
+
pageId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
path: string[];
|
|
26
|
+
mode: string[];
|
|
27
|
+
blocks: string[];
|
|
28
|
+
notes: ExportNote[];
|
|
29
|
+
}
|
|
30
|
+
export interface ExportField {
|
|
31
|
+
name: string;
|
|
32
|
+
type: string;
|
|
33
|
+
to?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ExportEntity {
|
|
36
|
+
name: string;
|
|
37
|
+
tenantScoped: boolean;
|
|
38
|
+
fields: ExportField[];
|
|
39
|
+
}
|
|
40
|
+
export interface ExportPlan {
|
|
41
|
+
title: string;
|
|
42
|
+
date: string;
|
|
43
|
+
counts: {
|
|
44
|
+
pages: number;
|
|
45
|
+
modules: number;
|
|
46
|
+
entities: number;
|
|
47
|
+
};
|
|
48
|
+
groups: ExportGroup[];
|
|
49
|
+
tenant?: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
schema?: ExportEntity[];
|
|
54
|
+
}
|
|
55
|
+
export type PlanRefusal = {
|
|
56
|
+
kind: "unknown_pages";
|
|
57
|
+
ids: string[];
|
|
58
|
+
known: string[];
|
|
59
|
+
} | {
|
|
60
|
+
kind: "no_saas";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "unknown_tenant";
|
|
63
|
+
id: string;
|
|
64
|
+
known: string[];
|
|
65
|
+
} | {
|
|
66
|
+
kind: "no_pages";
|
|
67
|
+
};
|
|
68
|
+
export type PlanResult = {
|
|
69
|
+
ok: true;
|
|
70
|
+
plan: ExportPlan;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
refusal: PlanRefusal;
|
|
74
|
+
};
|
|
75
|
+
export declare function planExport(spec: MockupSpec, notes: readonly AnnotationInSpec[], options: ExportOptions, now: Date): PlanResult;
|
|
76
|
+
export declare function planScreens(plan: ExportPlan): ExportScreen[];
|
|
77
|
+
export declare function describeRefusal(refusal: PlanRefusal): string;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportOptionsSchema = void 0;
|
|
4
|
+
exports.planExport = planExport;
|
|
5
|
+
exports.planScreens = planScreens;
|
|
6
|
+
exports.describeRefusal = describeRefusal;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const mockup_1 = require("../../mockup");
|
|
9
|
+
exports.exportOptionsSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
pages: zod_1.z
|
|
12
|
+
.array(zod_1.z.string().min(1))
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(mockup_1.MAX_PAGES)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("The page ids to print. Default: every page."),
|
|
17
|
+
annotations: zod_1.z
|
|
18
|
+
.boolean()
|
|
19
|
+
.describe("Print each page's open annotations under its screen."),
|
|
20
|
+
saasTenant: zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("The id of a tenant of the spec's fixtures.tenants to draw every page as, in SaaS mode."),
|
|
25
|
+
includeSchema: zod_1.z
|
|
26
|
+
.boolean()
|
|
27
|
+
.describe("End with the data model (ERD and entity table) when the spec has entities."),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
const SAAS_MODULE = "saas";
|
|
31
|
+
const APP_GROUP = "App";
|
|
32
|
+
const SKETCH_TYPE = "sketch";
|
|
33
|
+
const CUSTOM_PAGE_BLOCK = "Custom page (sketch)";
|
|
34
|
+
const DATE_FORMAT = new Intl.DateTimeFormat("en-GB", {
|
|
35
|
+
day: "numeric",
|
|
36
|
+
month: "short",
|
|
37
|
+
year: "numeric",
|
|
38
|
+
timeZone: "UTC",
|
|
39
|
+
});
|
|
40
|
+
function nodeLabel(node) {
|
|
41
|
+
if (node.type === SKETCH_TYPE)
|
|
42
|
+
return "Sketch";
|
|
43
|
+
return node.componentName ?? node.type ?? "Block";
|
|
44
|
+
}
|
|
45
|
+
function blockList(page) {
|
|
46
|
+
if (page.custom === true)
|
|
47
|
+
return [CUSTOM_PAGE_BLOCK];
|
|
48
|
+
const counts = new Map();
|
|
49
|
+
const visit = (nodes) => {
|
|
50
|
+
for (const node of nodes) {
|
|
51
|
+
const label = nodeLabel(node);
|
|
52
|
+
counts.set(label, (counts.get(label) ?? 0) + 1);
|
|
53
|
+
visit(node.children ?? []);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
visit(page.tree);
|
|
57
|
+
return [...counts].map(([label, count]) => count > 1 ? `${label} ×${count}` : label);
|
|
58
|
+
}
|
|
59
|
+
function rootPage(page, byId) {
|
|
60
|
+
let root = page;
|
|
61
|
+
const seen = new Set([page.id]);
|
|
62
|
+
for (let parent = page.parent ? byId.get(page.parent) : undefined; parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
63
|
+
seen.add(parent.id);
|
|
64
|
+
root = parent;
|
|
65
|
+
}
|
|
66
|
+
return root;
|
|
67
|
+
}
|
|
68
|
+
function categoryTitle(spec, page) {
|
|
69
|
+
return spec.categories?.find((category) => category.id === page.category)
|
|
70
|
+
?.title;
|
|
71
|
+
}
|
|
72
|
+
function parentTitles(page, byId) {
|
|
73
|
+
const titles = [];
|
|
74
|
+
const seen = new Set();
|
|
75
|
+
for (let parent = page.parent && byId.get(page.parent); parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
76
|
+
seen.add(parent.id);
|
|
77
|
+
titles.unshift(parent.title);
|
|
78
|
+
}
|
|
79
|
+
return titles;
|
|
80
|
+
}
|
|
81
|
+
function rootsOf(pages) {
|
|
82
|
+
const byId = new Map(pages.map((page) => [page.id, page]));
|
|
83
|
+
return new Map(pages.map((page) => [page.id, rootPage(page, byId).id]));
|
|
84
|
+
}
|
|
85
|
+
function withSubPages(tops, pages, roots, placed) {
|
|
86
|
+
const taken = [];
|
|
87
|
+
for (const page of tops.flatMap((top) => [
|
|
88
|
+
top,
|
|
89
|
+
...pages.filter((under) => under.id !== top.id && roots.get(under.id) === top.id),
|
|
90
|
+
])) {
|
|
91
|
+
if (placed.has(page.id))
|
|
92
|
+
continue;
|
|
93
|
+
placed.add(page.id);
|
|
94
|
+
taken.push(page);
|
|
95
|
+
}
|
|
96
|
+
return taken;
|
|
97
|
+
}
|
|
98
|
+
function menuOrder(tops, categories) {
|
|
99
|
+
const known = new Set(categories.map((category) => category.id));
|
|
100
|
+
const sectionOf = (page) => page.category !== undefined && known.has(page.category)
|
|
101
|
+
? page.category
|
|
102
|
+
: undefined;
|
|
103
|
+
return [
|
|
104
|
+
...tops.filter((page) => sectionOf(page) === undefined),
|
|
105
|
+
...categories.flatMap((category) => tops.filter((page) => sectionOf(page) === category.id)),
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
function draftGroups(spec, saas) {
|
|
109
|
+
const plan = (0, mockup_1.planModules)(spec.modules ?? [], spec.pages);
|
|
110
|
+
const pages = plan.pages.map((placed) => placed.page);
|
|
111
|
+
const byId = new Map(pages.map((page) => [page.id, page]));
|
|
112
|
+
const roots = rootsOf(pages);
|
|
113
|
+
const inModule = new Set(plan.modules.flatMap((module) => [
|
|
114
|
+
...module.pages,
|
|
115
|
+
...(module.tenant?.pages ?? []),
|
|
116
|
+
]));
|
|
117
|
+
const customIds = new Set((spec.modules ?? []).flatMap((entry) => (0, mockup_1.isCatalogModule)(entry) ? [] : [entry.id]));
|
|
118
|
+
const listedTops = plan.modules.map((module) => {
|
|
119
|
+
const side = saas && module.tenant ? module.tenant : module;
|
|
120
|
+
return {
|
|
121
|
+
module,
|
|
122
|
+
side,
|
|
123
|
+
tops: side.pages.flatMap((id) => byId.get(id) ?? []),
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
const placed = new Set(listedTops.flatMap(({ tops }) => tops.map((page) => page.id)));
|
|
127
|
+
const app = {
|
|
128
|
+
title: APP_GROUP,
|
|
129
|
+
kind: "app",
|
|
130
|
+
pages: withSubPages(menuOrder(spec.pages.filter((page) => page.parent === undefined && !inModule.has(page.id)), spec.categories ?? []), pages, roots, placed),
|
|
131
|
+
};
|
|
132
|
+
for (const { tops } of listedTops)
|
|
133
|
+
for (const page of tops)
|
|
134
|
+
placed.delete(page.id);
|
|
135
|
+
const modules = listedTops.map(({ module, side, tops }) => ({
|
|
136
|
+
title: side.title,
|
|
137
|
+
kind: customIds.has(module.id) ? "custom" : "catalog",
|
|
138
|
+
pages: withSubPages(tops, pages, roots, placed),
|
|
139
|
+
}));
|
|
140
|
+
return [app, ...modules].filter((group) => group.pages.length > 0);
|
|
141
|
+
}
|
|
142
|
+
function refuseUnknownPages(groups, asked) {
|
|
143
|
+
if (asked === undefined)
|
|
144
|
+
return undefined;
|
|
145
|
+
const known = groups.flatMap((group) => group.pages.map((page) => page.id));
|
|
146
|
+
const ids = asked.filter((id) => !known.includes(id));
|
|
147
|
+
return ids.length ? { kind: "unknown_pages", ids, known } : undefined;
|
|
148
|
+
}
|
|
149
|
+
function schemaOf(spec) {
|
|
150
|
+
return Object.entries(spec.entities ?? {}).map(([name, entity]) => ({
|
|
151
|
+
name,
|
|
152
|
+
tenantScoped: entity.tenantScoped === true,
|
|
153
|
+
fields: Object.entries(entity.fields).map(([field, type]) => ({
|
|
154
|
+
name: field,
|
|
155
|
+
type: type.type,
|
|
156
|
+
...(type.type === "ref" && { to: type.to }),
|
|
157
|
+
})),
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
function tenantOf(spec, id) {
|
|
161
|
+
if (id === undefined)
|
|
162
|
+
return { ok: true };
|
|
163
|
+
if (!(spec.modules ?? []).includes(SAAS_MODULE))
|
|
164
|
+
return { kind: "no_saas" };
|
|
165
|
+
const tenants = spec.fixtures?.tenants ?? [];
|
|
166
|
+
const found = tenants.find((tenant) => tenant.id === id);
|
|
167
|
+
if (!found)
|
|
168
|
+
return {
|
|
169
|
+
kind: "unknown_tenant",
|
|
170
|
+
id,
|
|
171
|
+
known: tenants.map((tenant) => tenant.id),
|
|
172
|
+
};
|
|
173
|
+
return { ok: true, tenant: { id: found.id, name: found.name } };
|
|
174
|
+
}
|
|
175
|
+
function planExport(spec, notes, options, now) {
|
|
176
|
+
const tenant = tenantOf(spec, options.saasTenant);
|
|
177
|
+
if (!("ok" in tenant))
|
|
178
|
+
return { ok: false, refusal: tenant };
|
|
179
|
+
const drafts = draftGroups(spec, tenant.tenant !== undefined);
|
|
180
|
+
const unknown = refuseUnknownPages(drafts, options.pages);
|
|
181
|
+
if (unknown)
|
|
182
|
+
return { ok: false, refusal: unknown };
|
|
183
|
+
const asked = options.pages && new Set(options.pages);
|
|
184
|
+
const byId = new Map(spec.pages.map((page) => [page.id, page]));
|
|
185
|
+
const groups = drafts
|
|
186
|
+
.map((draft) => ({
|
|
187
|
+
...draft,
|
|
188
|
+
pages: draft.pages.filter((page) => !asked || asked.has(page.id)),
|
|
189
|
+
}))
|
|
190
|
+
.filter((draft) => draft.pages.length > 0)
|
|
191
|
+
.map((draft, index) => ({
|
|
192
|
+
number: index + 1,
|
|
193
|
+
title: draft.title,
|
|
194
|
+
kind: draft.kind,
|
|
195
|
+
screens: draft.pages.map((page, at) => ({
|
|
196
|
+
number: `${index + 1}.${at + 1}`,
|
|
197
|
+
pageId: page.id,
|
|
198
|
+
title: page.title,
|
|
199
|
+
path: [
|
|
200
|
+
draft.kind === "app"
|
|
201
|
+
? (categoryTitle(spec, rootPage(page, byId)) ?? draft.title)
|
|
202
|
+
: draft.title,
|
|
203
|
+
...parentTitles(page, byId),
|
|
204
|
+
page.title,
|
|
205
|
+
],
|
|
206
|
+
mode: [
|
|
207
|
+
{
|
|
208
|
+
app: "App page",
|
|
209
|
+
custom: "Custom module",
|
|
210
|
+
catalog: "Catalog module",
|
|
211
|
+
}[draft.kind],
|
|
212
|
+
page.custom === true ? "custom page" : "fixtures",
|
|
213
|
+
...(tenant.tenant ? [`SaaS mode: ${tenant.tenant.name}`] : []),
|
|
214
|
+
],
|
|
215
|
+
blocks: blockList(page),
|
|
216
|
+
notes: options.annotations
|
|
217
|
+
? notes.flatMap((note, at) => note.page === page.id && note.status === "open"
|
|
218
|
+
? [{ number: at + 1, text: note.text }]
|
|
219
|
+
: [])
|
|
220
|
+
: [],
|
|
221
|
+
})),
|
|
222
|
+
}));
|
|
223
|
+
if (groups.length === 0)
|
|
224
|
+
return { ok: false, refusal: { kind: "no_pages" } };
|
|
225
|
+
const schema = schemaOf(spec);
|
|
226
|
+
return {
|
|
227
|
+
ok: true,
|
|
228
|
+
plan: {
|
|
229
|
+
title: spec.title ?? "Mockup",
|
|
230
|
+
date: DATE_FORMAT.format(now),
|
|
231
|
+
counts: {
|
|
232
|
+
pages: groups.reduce((sum, group) => sum + group.screens.length, 0),
|
|
233
|
+
modules: spec.modules?.length ?? 0,
|
|
234
|
+
entities: schema.length,
|
|
235
|
+
},
|
|
236
|
+
groups,
|
|
237
|
+
...(tenant.tenant && { tenant: tenant.tenant }),
|
|
238
|
+
...(options.includeSchema && schema.length > 0 && { schema }),
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function planScreens(plan) {
|
|
243
|
+
return plan.groups.flatMap((group) => group.screens);
|
|
244
|
+
}
|
|
245
|
+
function describeRefusal(refusal) {
|
|
246
|
+
switch (refusal.kind) {
|
|
247
|
+
case "unknown_pages":
|
|
248
|
+
return `No page of the mockup has the id ${refusal.ids.map((id) => `"${id}"`).join(", ")}. Its pages: ${refusal.known.join(", ") || "none"}.`;
|
|
249
|
+
case "no_saas":
|
|
250
|
+
return 'saasTenant draws a page in SaaS mode, which a mockup has once its modules list "saas".';
|
|
251
|
+
case "unknown_tenant":
|
|
252
|
+
return `No tenant of the spec's fixtures.tenants has the id "${refusal.id}". Its tenants: ${refusal.known.join(", ") || "none"}.`;
|
|
253
|
+
case "no_pages":
|
|
254
|
+
return "The mockup has no page to export.";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=plan.js.map
|