@antelopejs/dms 0.25.8-next.1174.ge77e0bd → 0.25.8
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 +48 -0
- package/README.md +2 -2
- package/data/mockup-example/spec.json +0 -11
- package/data/mockup-spec.schema.json +16 -399
- package/dist/e2e/index.d.mts +1 -2
- package/dist/implementations/dms-builder/engine/table-view-settings.js +33 -9
- package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +0 -2
- package/dist/mcp/index.js +0 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +0 -15
- package/dist/mcp/page-verify/index.js +6 -16
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +1 -3
- package/dist/mcp/page-verify/mockup.js +1 -5
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/page-probe.d.ts +0 -5
- package/dist/mcp/page-verify/page-probe.js +0 -2
- package/dist/mcp/page-verify/page-probe.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/page-verify/report.d.ts +0 -1
- package/dist/mcp/tools/mockup-read-spec.js +3 -2
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +0 -4
- 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 +2 -6
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mockup/annotations.js +2 -2
- package/dist/mockup/annotations.js.map +1 -1
- package/dist/mockup/apply-notes.js +1 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/compile.d.ts +10 -6
- package/dist/mockup/compile.js +290 -31
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -2
- package/dist/mockup/files.js +1 -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 +27 -0
- package/dist/mockup/fixtures.js +111 -0
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/from-page.js +9 -2
- package/dist/mockup/from-page.js.map +1 -1
- package/dist/mockup/generate.js +1 -4
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +4 -2
- package/dist/mockup/history-routes.js +36 -27
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/history.js +1 -2
- package/dist/mockup/history.js.map +1 -1
- package/dist/mockup/index.d.ts +0 -10
- package/dist/mockup/index.js +0 -10
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-layout.d.ts +0 -1
- package/dist/mockup/json-schema-layout.js +2 -95
- package/dist/mockup/json-schema-layout.js.map +1 -1
- package/dist/mockup/json-schema.js +19 -40
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/manage-routes.d.ts +1 -3
- package/dist/mockup/manage-routes.js +1 -38
- package/dist/mockup/manage-routes.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 +100 -137
- package/dist/mockup/model.js +86 -102
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +9 -6
- package/dist/mockup/modules.js +24 -105
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/presence-board.js +1 -1
- package/dist/mockup/presence-board.js.map +1 -1
- package/dist/mockup/presence-routes.js +2 -2
- package/dist/mockup/presence-routes.js.map +1 -1
- package/dist/mockup/refusals.d.ts +0 -5
- package/dist/mockup/refusals.js +0 -16
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +5 -3
- package/dist/mockup/routes.js +162 -19
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/row-filters.d.ts +8 -0
- package/dist/mockup/row-filters.js +107 -0
- package/dist/mockup/row-filters.js.map +1 -0
- package/dist/mockup/sketch-limits.d.ts +0 -1
- package/dist/mockup/sketch-limits.js +1 -2
- package/dist/mockup/sketch-limits.js.map +1 -1
- package/dist/mockup/sketch.d.ts +2 -2
- package/dist/mockup/sketch.js +1 -2
- package/dist/mockup/sketch.js.map +1 -1
- package/dist/mockup/source-routes.d.ts +4 -5
- package/dist/mockup/source-routes.js +17 -26
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.js +1 -2
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/store.d.ts +37 -16
- package/dist/mockup/store.js +200 -85
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-archive.d.ts +1 -0
- package/dist/mockup/table-archive.js +16 -0
- package/dist/mockup/table-archive.js.map +1 -1
- package/e2e/index.mjs +2 -3
- package/frontend-vue/eslint-globals.generated.mjs +38 -40
- package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +31 -3
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +2 -8
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -3
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -110
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +6 -21
- package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +7 -19
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +9 -79
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +4 -17
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +0 -12
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +0 -39
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +2 -12
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +1 -9
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +6 -53
- package/frontend-vue/layers/dms-layout/app/theme/actions.ts +7 -11
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +5 -31
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +47 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +33 -59
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -58
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/{MockupZoomControls.vue → MockupOverviewZoom.vue} +15 -23
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +0 -21
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +9 -77
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +45 -130
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +3 -70
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +4 -44
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +2 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +36 -256
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +1 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +5 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +23 -50
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +29 -82
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +3 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +14 -60
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +7 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +8 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +2 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +10 -39
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +0 -29
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +3 -37
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +1 -20
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +103 -167
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -22
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +173 -75
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +9 -118
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +8 -123
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +3 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +5 -18
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +6 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +2 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +0 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +6 -108
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +1 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +10 -40
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -23
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -2
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +4 -53
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +4 -53
- package/frontend-vue/package.json +2 -2
- package/package.json +5 -6
- package/E2E.md +0 -138
- package/dist/mcp/mockup-export/capture.d.ts +0 -19
- package/dist/mcp/mockup-export/capture.js +0 -99
- 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 -20
- package/dist/mcp/mockup-export/index.js +0 -110
- package/dist/mcp/mockup-export/index.js.map +0 -1
- package/dist/mcp/mockup-export/jobs.d.ts +0 -32
- package/dist/mcp/mockup-export/jobs.js +0 -49
- package/dist/mcp/mockup-export/jobs.js.map +0 -1
- package/dist/mcp/mockup-export/plan.d.ts +0 -78
- package/dist/mcp/mockup-export/plan.js +0 -292
- package/dist/mcp/mockup-export/plan.js.map +0 -1
- package/dist/mcp/mockup-export/route.d.ts +0 -23
- package/dist/mcp/mockup-export/route.js +0 -91
- package/dist/mcp/mockup-export/route.js.map +0 -1
- package/dist/mcp/page-verify/modules.d.ts +0 -8
- package/dist/mcp/page-verify/modules.js +0 -49
- package/dist/mcp/page-verify/modules.js.map +0 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +0 -1
- package/dist/mcp/tools/mockup-export-pdf.js +0 -69
- package/dist/mcp/tools/mockup-export-pdf.js.map +0 -1
- package/dist/mcp/tools/mockup-module-catalog.d.ts +0 -1
- package/dist/mcp/tools/mockup-module-catalog.js +0 -36
- package/dist/mcp/tools/mockup-module-catalog.js.map +0 -1
- package/dist/mockup/compile-layouts.d.ts +0 -5
- package/dist/mockup/compile-layouts.js +0 -74
- package/dist/mockup/compile-layouts.js.map +0 -1
- package/dist/mockup/compile-nodes.d.ts +0 -11
- package/dist/mockup/compile-nodes.js +0 -119
- package/dist/mockup/compile-nodes.js.map +0 -1
- package/dist/mockup/compile-pages.d.ts +0 -18
- package/dist/mockup/compile-pages.js +0 -189
- package/dist/mockup/compile-pages.js.map +0 -1
- package/dist/mockup/create.d.ts +0 -16
- package/dist/mockup/create.js +0 -78
- package/dist/mockup/create.js.map +0 -1
- package/dist/mockup/created-watch.d.ts +0 -18
- package/dist/mockup/created-watch.js +0 -110
- package/dist/mockup/created-watch.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/etag.d.ts +0 -1
- package/dist/mockup/etag.js +0 -10
- package/dist/mockup/etag.js.map +0 -1
- package/dist/mockup/extensions.d.ts +0 -18
- package/dist/mockup/extensions.js +0 -61
- package/dist/mockup/extensions.js.map +0 -1
- package/dist/mockup/fixture-batch.d.ts +0 -21
- package/dist/mockup/fixture-batch.js +0 -111
- package/dist/mockup/fixture-batch.js.map +0 -1
- package/dist/mockup/fixture-routes.d.ts +0 -21
- package/dist/mockup/fixture-routes.js +0 -136
- 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/layout-model.d.ts +0 -156
- package/dist/mockup/layout-model.js +0 -96
- package/dist/mockup/layout-model.js.map +0 -1
- package/dist/mockup/layouts.d.ts +0 -9
- package/dist/mockup/layouts.js +0 -40
- package/dist/mockup/layouts.js.map +0 -1
- package/dist/mockup/module-manifests.d.ts +0 -99
- package/dist/mockup/module-manifests.js +0 -95
- package/dist/mockup/module-manifests.js.map +0 -1
- package/dist/mockup/module-states.d.ts +0 -10
- package/dist/mockup/module-states.js +0 -85
- package/dist/mockup/module-states.js.map +0 -1
- package/dist/mockup/modules-schema.d.ts +0 -2
- package/dist/mockup/modules-schema.js +0 -39
- package/dist/mockup/modules-schema.js.map +0 -1
- package/dist/mockup/page-capture-routes.d.ts +0 -19
- package/dist/mockup/page-capture-routes.js +0 -92
- package/dist/mockup/page-capture-routes.js.map +0 -1
- package/dist/mockup/page-captures.d.ts +0 -61
- package/dist/mockup/page-captures.js +0 -252
- package/dist/mockup/page-captures.js.map +0 -1
- package/dist/mockup/parse-spec.d.ts +0 -10
- package/dist/mockup/parse-spec.js +0 -62
- package/dist/mockup/parse-spec.js.map +0 -1
- package/dist/mockup/places.d.ts +0 -17
- package/dist/mockup/places.js +0 -75
- package/dist/mockup/places.js.map +0 -1
- package/dist/mockup/slug.d.ts +0 -3
- package/dist/mockup/slug.js +0 -7
- package/dist/mockup/slug.js.map +0 -1
- package/dist/mockup/state-patch.d.ts +0 -22
- package/dist/mockup/state-patch.js +0 -75
- package/dist/mockup/state-patch.js.map +0 -1
- package/dist/mockup/state.d.ts +0 -112
- package/dist/mockup/state.js +0 -22
- package/dist/mockup/state.js.map +0 -1
- package/dist/mockup/store-list.d.ts +0 -28
- package/dist/mockup/store-list.js +0 -89
- package/dist/mockup/store-list.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-core/app/utils/localFetchAnswers.ts +0 -124
- package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +0 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupWidgets.ts +0 -65
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +0 -153
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +0 -23
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +0 -164
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +0 -51
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReconnecting.vue +0 -17
- 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/useFixtureBatches.ts +0 -154
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +0 -157
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +0 -165
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +0 -126
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +0 -138
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +0 -124
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +0 -37
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +0 -56
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +0 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +0 -151
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +0 -130
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +0 -332
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +0 -100
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +0 -146
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +0 -80
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +0 -171
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +0 -138
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +0 -66
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +0 -177
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +0 -179
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +0 -143
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +0 -23
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +0 -156
- package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +0 -400
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +0 -2
- 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/useFixtureBatches.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +0 -1
- 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/useMockupRoutePage.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.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/composables/block-preview/usePersistedCaptures.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.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/mockupStatePatch.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/frontend-vue/layers/dms-ui/app/entries/utils/previewFixtureAnswers.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +0 -1
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.captureAndPrint = captureAndPrint;
|
|
4
|
-
const page_verify_1 = require("../page-verify");
|
|
5
|
-
const browser_1 = require("../page-verify/browser");
|
|
6
|
-
const mockup_1 = require("../page-verify/mockup");
|
|
7
|
-
const VIEWPORT = { width: 2400, height: 1000 };
|
|
8
|
-
const DEVICE_SCALE = 2;
|
|
9
|
-
const FRAME_SELECTOR = "[data-dms-mockup-canvas] iframe";
|
|
10
|
-
const HIDE_OVERLAYS = `${FRAME_SELECTOR} ~ *, [data-dms-mockup-canvas] ~ * { visibility: hidden !important; }`;
|
|
11
|
-
const BOTTOM_MARGIN_PX = 80;
|
|
12
|
-
const SETTLE_MS = 500;
|
|
13
|
-
const EMPTY_FRAME_TIMEOUT_MS = 10_000;
|
|
14
|
-
function viewerUrl(request, pageId) {
|
|
15
|
-
const url = new URL("/mockup", request.origin);
|
|
16
|
-
url.searchParams.set("name", request.name);
|
|
17
|
-
url.searchParams.set("page", pageId);
|
|
18
|
-
url.searchParams.set("width", "desktop");
|
|
19
|
-
url.searchParams.set("data", "sample");
|
|
20
|
-
if (request.saasTenant !== undefined) {
|
|
21
|
-
url.searchParams.set("tenant", request.saasTenant);
|
|
22
|
-
}
|
|
23
|
-
return url.href;
|
|
24
|
-
}
|
|
25
|
-
async function frameDrawn(page, hasBlocks) {
|
|
26
|
-
if (hasBlocks)
|
|
27
|
-
return (await (0, mockup_1.drawnPreview)(page)) !== undefined;
|
|
28
|
-
const deadline = Date.now() + EMPTY_FRAME_TIMEOUT_MS;
|
|
29
|
-
while ((await page.locator(FRAME_SELECTOR).count()) === 0) {
|
|
30
|
-
if (Date.now() > deadline)
|
|
31
|
-
return false;
|
|
32
|
-
await page.waitForTimeout(SETTLE_MS);
|
|
33
|
-
}
|
|
34
|
-
await page.waitForTimeout(SETTLE_MS * 2);
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
async function capturePage(context, request, target) {
|
|
38
|
-
const page = await context.newPage();
|
|
39
|
-
try {
|
|
40
|
-
await page.setViewportSize(VIEWPORT);
|
|
41
|
-
await page.goto(viewerUrl(request, target.id), { waitUntil: "load" });
|
|
42
|
-
if (!(await frameDrawn(page, target.hasBlocks)))
|
|
43
|
-
return undefined;
|
|
44
|
-
const frame = page.locator(FRAME_SELECTOR).first();
|
|
45
|
-
const bottom = await frame.evaluateAll((elements) => elements[0]?.getBoundingClientRect().bottom ?? 0);
|
|
46
|
-
if (bottom > VIEWPORT.height) {
|
|
47
|
-
await page.setViewportSize({
|
|
48
|
-
width: VIEWPORT.width,
|
|
49
|
-
height: Math.ceil(bottom + BOTTOM_MARGIN_PX),
|
|
50
|
-
});
|
|
51
|
-
await page.waitForTimeout(SETTLE_MS);
|
|
52
|
-
}
|
|
53
|
-
return await frame.screenshot({ type: "png", style: HIDE_OVERLAYS });
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
await page.close();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async function captureAndPrint(request, print, control) {
|
|
63
|
-
const workspace = await (0, page_verify_1.loadWorkspace)();
|
|
64
|
-
const browser = await (0, browser_1.launchBrowser)();
|
|
65
|
-
const sessions = new page_verify_1.Sessions(browser, request.origin, {
|
|
66
|
-
locale: "en-US",
|
|
67
|
-
colorScheme: "light",
|
|
68
|
-
deviceScaleFactor: DEVICE_SCALE,
|
|
69
|
-
});
|
|
70
|
-
try {
|
|
71
|
-
const context = await sessions.contextFor((0, page_verify_1.ownerAccount)(workspace), {
|
|
72
|
-
submit: false,
|
|
73
|
-
writes: [],
|
|
74
|
-
});
|
|
75
|
-
const shots = new Map();
|
|
76
|
-
for (const [index, target] of request.pages.entries()) {
|
|
77
|
-
control.signal.throwIfAborted();
|
|
78
|
-
const shot = await capturePage(context, request, target);
|
|
79
|
-
if (shot)
|
|
80
|
-
shots.set(target.id, shot);
|
|
81
|
-
control.onDrawn(index + 1);
|
|
82
|
-
}
|
|
83
|
-
control.signal.throwIfAborted();
|
|
84
|
-
const printed = print(shots);
|
|
85
|
-
const sheet = await context.newPage();
|
|
86
|
-
try {
|
|
87
|
-
await sheet.setContent(printed.html, { waitUntil: "load" });
|
|
88
|
-
return await sheet.pdf(printed.pdf);
|
|
89
|
-
}
|
|
90
|
-
finally {
|
|
91
|
-
await sheet.close();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
finally {
|
|
95
|
-
await browser.close();
|
|
96
|
-
await sessions.close();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=capture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/capture.ts"],"names":[],"mappings":";;;AAAA,gDAAuE;AACvE,oDAAuD;AACvD,kDAAqD;AASrD,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC/C,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,cAAc,GAAG,iCAAiC,CAAC;AAEzD,MAAM,aAAa,GAAG,GAAG,cAAc,uEAAuE,CAAC;AAE/G,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAYtC,SAAS,SAAS,CAAC,OAAuB,EAAE,MAAc;IACxD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACrC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC;AAGD,KAAK,UAAU,UAAU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AE,CAAC;YAChC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YACzD,IAAI,IAAI;gBAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YACrC,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5D,OAAO,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;gBAAS,CAAC;YACT,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -1,199 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/document.ts"],"names":[],"mappings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,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAChL,CAAC,CAAC,CAAC;IACH,OAAO;MACH,MAAM;;mBAEO,GAAG,CAAC,QAAQ,CAAC;wGACwE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;WAC1G,CAAC;AACZ,CAAC;AAOD,wBACE,IAAgB,EAChB,IAAY,EACZ,KAAkB;IAElB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC3B,aAAa,CAAC,MAAM,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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type MockupName } from "../../mockup";
|
|
2
|
-
import { type StartedJob } from "./jobs";
|
|
3
|
-
import { type ExportOptions } from "./plan";
|
|
4
|
-
export * from "./document";
|
|
5
|
-
export * from "./jobs";
|
|
6
|
-
export * from "./plan";
|
|
7
|
-
export interface ExportRequest {
|
|
8
|
-
name: MockupName;
|
|
9
|
-
mockupsDir: string;
|
|
10
|
-
origin: string;
|
|
11
|
-
options: ExportOptions;
|
|
12
|
-
}
|
|
13
|
-
export type ExportStart = ({
|
|
14
|
-
ok: true;
|
|
15
|
-
} & StartedJob) | {
|
|
16
|
-
ok: false;
|
|
17
|
-
reason: "no_mockup" | "invalid" | "running" | "failed";
|
|
18
|
-
message: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function startExport(request: ExportRequest): Promise<ExportStart>;
|
|
@@ -1,110 +0,0 @@
|
|
|
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.startExport = startExport;
|
|
18
|
-
const node_path_1 = require("node:path");
|
|
19
|
-
const mockup_1 = require("../../mockup");
|
|
20
|
-
const capture_1 = require("./capture");
|
|
21
|
-
const jobs_1 = require("./jobs");
|
|
22
|
-
const document_1 = require("./document");
|
|
23
|
-
const plan_1 = require("./plan");
|
|
24
|
-
__exportStar(require("./document"), exports);
|
|
25
|
-
__exportStar(require("./jobs"), exports);
|
|
26
|
-
__exportStar(require("./plan"), exports);
|
|
27
|
-
async function startExport(request) {
|
|
28
|
-
try {
|
|
29
|
-
return await startPrinting(request);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
return {
|
|
33
|
-
ok: false,
|
|
34
|
-
reason: "failed",
|
|
35
|
-
message: `The export could not run: ${error instanceof Error ? error.message : String(error)}`,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async function startPrinting(request) {
|
|
40
|
-
const { name, mockupsDir, options } = request;
|
|
41
|
-
const text = await (0, mockup_1.readSpecText)(mockupsDir, name);
|
|
42
|
-
if (text === undefined) {
|
|
43
|
-
return {
|
|
44
|
-
ok: false,
|
|
45
|
-
reason: "no_mockup",
|
|
46
|
-
message: `Mockup "${name}" does not exist: no mockups/${name}/spec.json.`,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const read = (0, mockup_1.parseSpec)(text);
|
|
50
|
-
if (!read.ok) {
|
|
51
|
-
return {
|
|
52
|
-
ok: false,
|
|
53
|
-
reason: "invalid",
|
|
54
|
-
message: `The spec of "${name}" does not parse: ${read.issues.map((issue) => `${issue.path || "/"} ${issue.message}`).join("; ")}`,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const notes = (await (0, mockup_1.listAnnotationsInSpec)(name, mockupsDir)) ?? [];
|
|
58
|
-
const planned = (0, plan_1.planExport)(read.spec, notes, options, new Date());
|
|
59
|
-
if (!planned.ok) {
|
|
60
|
-
return {
|
|
61
|
-
ok: false,
|
|
62
|
-
reason: "invalid",
|
|
63
|
-
message: (0, plan_1.describeRefusal)(planned.refusal),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
const { plan } = planned;
|
|
67
|
-
const printed = (0, plan_1.planScreens)(plan);
|
|
68
|
-
const screens = printed.map((screen) => screen.pageId);
|
|
69
|
-
const job = jobs_1.exportJobs.start(name, screens.length, async (onDrawn, signal) => {
|
|
70
|
-
let drawn = new Set();
|
|
71
|
-
const pdf = await (0, capture_1.captureAndPrint)({
|
|
72
|
-
name,
|
|
73
|
-
pages: printed.map((screen) => ({
|
|
74
|
-
id: screen.pageId,
|
|
75
|
-
hasBlocks: screen.blocks.length > 0,
|
|
76
|
-
})),
|
|
77
|
-
...(plan.tenant && { saasTenant: plan.tenant.id }),
|
|
78
|
-
origin: request.origin,
|
|
79
|
-
}, (shots) => {
|
|
80
|
-
drawn = new Set(shots.keys());
|
|
81
|
-
return {
|
|
82
|
-
html: (0, document_1.exportDocument)(plan, name, shots),
|
|
83
|
-
pdf: {
|
|
84
|
-
format: "A4",
|
|
85
|
-
printBackground: true,
|
|
86
|
-
displayHeaderFooter: true,
|
|
87
|
-
headerTemplate: "<span></span>",
|
|
88
|
-
footerTemplate: (0, document_1.exportFooter)(plan),
|
|
89
|
-
preferCSSPageSize: true,
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}, { onDrawn, signal });
|
|
93
|
-
signal.throwIfAborted();
|
|
94
|
-
await (0, mockup_1.writeAtomically)((0, node_path_1.join)((0, mockup_1.mockupDirectory)(mockupsDir, name), mockup_1.EXPORT_PDF_FILE), pdf);
|
|
95
|
-
return {
|
|
96
|
-
screens,
|
|
97
|
-
undrawn: screens.filter((id) => !drawn.has(id)),
|
|
98
|
-
schema: plan.schema !== undefined,
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
if (job === undefined) {
|
|
102
|
-
return {
|
|
103
|
-
ok: false,
|
|
104
|
-
reason: "running",
|
|
105
|
-
message: `An export of "${name}" already runs. Wait for it to end, then export again.`,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
return { ok: true, ...job };
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAiC;AACjC,yCAQsB;AACtB,uCAA4C;AAC5C,iCAAqD;AACrD,yCAA0D;AAC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AAK,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9B,OAAO;gBACL,IAAI,EAAE,IAAA,yBAAc,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;gBACvC,GAAG,EAAE;oBACH,MAAM,EAAE,IAAI;oBACZ,eAAe,EAAE,IAAI;oBACrB,mBAAmB,EAAE,IAAI;oBACzB,cAAc,EAAE,eAAe;oBAC/B,cAAc,EAAE,IAAA,uBAAY,EAAC,IAAI,CAAC;oBAClC,iBAAiB,EAAE,IAAI;iBACxB;aACF,CAAC;QACJ,CAAC,EACD,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;QACF,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,IAAA,wBAAe,EACnB,IAAA,gBAAI,EAAC,IAAA,wBAAe,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,wBAAe,CAAC,EACxD,GAAG,CACJ,CAAC;QACF,OAAO;YACL,OAAO;YACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS;SAClC,CAAC;IACJ,CAAC,CACF,CAAC;IACF,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,iBAAiB,IAAI,wDAAwD;SACvF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { MockupName } from "../../mockup";
|
|
2
|
-
export interface PrintedExport {
|
|
3
|
-
screens: string[];
|
|
4
|
-
undrawn: string[];
|
|
5
|
-
schema: boolean;
|
|
6
|
-
}
|
|
7
|
-
export type FinishedJobView = ({
|
|
8
|
-
status: "done";
|
|
9
|
-
} & PrintedExport) | {
|
|
10
|
-
status: "failed";
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
export type ExportJobView = {
|
|
14
|
-
status: "running";
|
|
15
|
-
drawn: number;
|
|
16
|
-
total: number;
|
|
17
|
-
} | FinishedJobView;
|
|
18
|
-
export type ExportWork = (onDrawn: (drawn: number) => void, signal: AbortSignal) => Promise<PrintedExport>;
|
|
19
|
-
export interface StartedJob {
|
|
20
|
-
id: string;
|
|
21
|
-
finished: Promise<FinishedJobView>;
|
|
22
|
-
}
|
|
23
|
-
export declare function createExportJobs(): {
|
|
24
|
-
start: (name: MockupName, total: number, work: ExportWork) => StartedJob | undefined;
|
|
25
|
-
status: (name: MockupName, id: string) => ExportJobView | undefined;
|
|
26
|
-
stop(): Promise<void>;
|
|
27
|
-
};
|
|
28
|
-
export declare const exportJobs: {
|
|
29
|
-
start: (name: MockupName, total: number, work: ExportWork) => StartedJob | undefined;
|
|
30
|
-
status: (name: MockupName, id: string) => ExportJobView | undefined;
|
|
31
|
-
stop(): Promise<void>;
|
|
32
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exportJobs = void 0;
|
|
4
|
-
exports.createExportJobs = createExportJobs;
|
|
5
|
-
const node_crypto_1 = require("node:crypto");
|
|
6
|
-
function createExportJobs() {
|
|
7
|
-
const jobs = new Map();
|
|
8
|
-
function start(name, total, work) {
|
|
9
|
-
if (jobs.get(name)?.view.status === "running")
|
|
10
|
-
return undefined;
|
|
11
|
-
const running = {
|
|
12
|
-
id: (0, node_crypto_1.randomUUID)(),
|
|
13
|
-
view: { status: "running", drawn: 0, total },
|
|
14
|
-
abort: new AbortController(),
|
|
15
|
-
};
|
|
16
|
-
const finished = work((drawn) => {
|
|
17
|
-
if (running.view.status === "running") {
|
|
18
|
-
running.view = { ...running.view, drawn };
|
|
19
|
-
}
|
|
20
|
-
}, running.abort.signal)
|
|
21
|
-
.then((printed) => ({ status: "done", ...printed }), (error) => ({
|
|
22
|
-
status: "failed",
|
|
23
|
-
message: `The export could not run: ${error instanceof Error ? error.message : String(error)}`,
|
|
24
|
-
}))
|
|
25
|
-
.then((last) => {
|
|
26
|
-
running.view = last;
|
|
27
|
-
return last;
|
|
28
|
-
});
|
|
29
|
-
const job = Object.assign(running, { finished });
|
|
30
|
-
jobs.set(name, job);
|
|
31
|
-
return { id: job.id, finished };
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
start,
|
|
35
|
-
status: (name, id) => {
|
|
36
|
-
const job = jobs.get(name);
|
|
37
|
-
return job?.id === id ? job.view : undefined;
|
|
38
|
-
},
|
|
39
|
-
async stop() {
|
|
40
|
-
const running = [...jobs.values()];
|
|
41
|
-
jobs.clear();
|
|
42
|
-
for (const job of running)
|
|
43
|
-
job.abort.abort();
|
|
44
|
-
await Promise.all(running.map((job) => job.finished));
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.exportJobs = createExportJobs();
|
|
49
|
-
//# sourceMappingURL=jobs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/jobs.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC;AA4CzC;IACE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAmB,CAAC;IAExC,SAAS,KAAK,CACZ,IAAgB,EAChB,KAAa,EACb,IAAgB;QAEhB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAChE,MAAM,OAAO,GAA0B;YACrC,EAAE,EAAE,IAAA,wBAAU,GAAE;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;YAC5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C,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/C,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,KAAK,MAAM,GAAG,IAAI,OAAO;gBAAE,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC7C,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC;AAGY,QAAA,UAAU,GAAG,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
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 {};
|