@antelopejs/dms 0.25.7 → 0.25.8-next.1166.gbc4d5cc
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/E2E.md +3 -2
- package/data/mockup-example/spec.json +11 -0
- package/data/mockup-spec.schema.json +399 -20
- package/dist/e2e/index.d.mts +3 -1
- package/dist/e2e/run-state.d.mts +8 -0
- package/dist/e2e/stack.d.mts +3 -1
- package/dist/implementations/dms/page/access.js +1 -1
- package/dist/implementations/dms/page/access.js.map +1 -1
- package/dist/implementations/dms/page/payloads.js +1 -1
- package/dist/implementations/dms/page/payloads.js.map +1 -1
- package/dist/implementations/dms/page/registry.js +1 -1
- package/dist/implementations/dms/page/registry.js.map +1 -1
- package/dist/implementations/dms-base/bulk-selection.d.ts +1 -1
- package/dist/implementations/dms-base/bulk-selection.js +7 -1
- package/dist/implementations/dms-base/bulk-selection.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +1 -1
- package/dist/implementations/dms-base/group-order.js +17 -4
- package/dist/implementations/dms-base/group-order.js.map +1 -1
- package/dist/implementations/dms-base/search-route.d.ts +1 -1
- package/dist/implementations/dms-base/search-route.js +11 -3
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-base/table-view.js +12 -3
- package/dist/implementations/dms-base/table-view.js.map +1 -1
- package/dist/implementations/dms-builder/engine/expression.js +3 -2
- package/dist/implementations/dms-builder/engine/expression.js.map +1 -1
- package/dist/implementations/dms-builder/engine/inherited-variables.js +2 -1
- package/dist/implementations/dms-builder/engine/inherited-variables.js.map +1 -1
- package/dist/implementations/dms-builder/engine/preview.js +2 -1
- package/dist/implementations/dms-builder/engine/preview.js.map +1 -1
- package/dist/implementations/dms-builder/engine/table-view-settings.js +34 -14
- package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mockup-export/capture.d.ts +19 -0
- package/dist/mcp/mockup-export/capture.js +99 -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 +20 -0
- package/dist/mcp/mockup-export/index.js +110 -0
- package/dist/mcp/mockup-export/index.js.map +1 -0
- package/dist/mcp/mockup-export/jobs.d.ts +32 -0
- package/dist/mcp/mockup-export/jobs.js +49 -0
- package/dist/mcp/mockup-export/jobs.js.map +1 -0
- package/dist/mcp/mockup-export/plan.d.ts +78 -0
- package/dist/mcp/mockup-export/plan.js +292 -0
- package/dist/mcp/mockup-export/plan.js.map +1 -0
- package/dist/mcp/mockup-export/route.d.ts +23 -0
- package/dist/mcp/mockup-export/route.js +91 -0
- package/dist/mcp/mockup-export/route.js.map +1 -0
- package/dist/mcp/page-verify/index.d.ts +15 -0
- package/dist/mcp/page-verify/index.js +16 -6
- 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/modules.d.ts +8 -0
- package/dist/mcp/page-verify/modules.js +49 -0
- package/dist/mcp/page-verify/modules.js.map +1 -0
- package/dist/mcp/page-verify/playwright.d.ts +22 -4
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/page-verify/report.d.ts +1 -0
- package/dist/mcp/tools/mockup-export-pdf.d.ts +1 -0
- package/dist/mcp/tools/mockup-export-pdf.js +69 -0
- package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
- package/dist/mcp/tools/mockup-module-catalog.d.ts +1 -0
- package/dist/mcp/tools/mockup-module-catalog.js +36 -0
- package/dist/mcp/tools/mockup-module-catalog.js.map +1 -0
- package/dist/mcp/tools/mockup-read-spec.js +2 -3
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +4 -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 +6 -2
- 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-layouts.d.ts +5 -0
- package/dist/mockup/compile-layouts.js +74 -0
- package/dist/mockup/compile-layouts.js.map +1 -0
- package/dist/mockup/compile-nodes.d.ts +11 -0
- package/dist/mockup/compile-nodes.js +119 -0
- package/dist/mockup/compile-nodes.js.map +1 -0
- package/dist/mockup/compile-pages.d.ts +18 -0
- package/dist/mockup/compile-pages.js +188 -0
- package/dist/mockup/compile-pages.js.map +1 -0
- package/dist/mockup/compile.d.ts +6 -10
- package/dist/mockup/compile.js +31 -289
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/create.d.ts +16 -0
- package/dist/mockup/create.js +78 -0
- package/dist/mockup/create.js.map +1 -0
- package/dist/mockup/created-watch.d.ts +18 -0
- package/dist/mockup/created-watch.js +110 -0
- package/dist/mockup/created-watch.js.map +1 -0
- 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/etag.d.ts +1 -0
- package/dist/mockup/etag.js +10 -0
- package/dist/mockup/etag.js.map +1 -0
- package/dist/mockup/extensions.d.ts +17 -0
- package/dist/mockup/extensions.js +56 -0
- package/dist/mockup/extensions.js.map +1 -0
- package/dist/mockup/files.d.ts +2 -1
- package/dist/mockup/files.js +2 -1
- 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/fixture-batch.d.ts +21 -0
- package/dist/mockup/fixture-batch.js +111 -0
- package/dist/mockup/fixture-batch.js.map +1 -0
- package/dist/mockup/fixture-routes.d.ts +21 -0
- package/dist/mockup/fixture-routes.js +136 -0
- package/dist/mockup/fixture-routes.js.map +1 -0
- package/dist/mockup/fixtures.d.ts +0 -27
- package/dist/mockup/fixtures.js +11 -117
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/from-page.js +2 -9
- package/dist/mockup/from-page.js.map +1 -1
- package/dist/mockup/generate.js +4 -1
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +2 -4
- package/dist/mockup/history-routes.js +27 -36
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/history.js +2 -1
- package/dist/mockup/history.js.map +1 -1
- package/dist/mockup/index.d.ts +10 -0
- package/dist/mockup/index.js +10 -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-layout.d.ts +1 -0
- package/dist/mockup/json-schema-layout.js +95 -2
- package/dist/mockup/json-schema-layout.js.map +1 -1
- package/dist/mockup/json-schema.js +40 -23
- 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/layout-model.d.ts +156 -0
- package/dist/mockup/layout-model.js +96 -0
- package/dist/mockup/layout-model.js.map +1 -0
- package/dist/mockup/layouts.d.ts +9 -0
- package/dist/mockup/layouts.js +40 -0
- package/dist/mockup/layouts.js.map +1 -0
- package/dist/mockup/manage-routes.d.ts +3 -1
- package/dist/mockup/manage-routes.js +38 -1
- 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 +137 -101
- package/dist/mockup/model.js +105 -91
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/module-manifests.d.ts +99 -0
- package/dist/mockup/module-manifests.js +95 -0
- package/dist/mockup/module-manifests.js.map +1 -0
- package/dist/mockup/module-states.d.ts +10 -0
- package/dist/mockup/module-states.js +85 -0
- package/dist/mockup/module-states.js.map +1 -0
- package/dist/mockup/modules-schema.d.ts +2 -0
- package/dist/mockup/modules-schema.js +39 -0
- package/dist/mockup/modules-schema.js.map +1 -0
- package/dist/mockup/modules.d.ts +6 -9
- package/dist/mockup/modules.js +105 -24
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/owner-controller.js +1 -1
- package/dist/mockup/owner-controller.js.map +1 -1
- package/dist/mockup/page-capture-routes.d.ts +19 -0
- package/dist/mockup/page-capture-routes.js +92 -0
- package/dist/mockup/page-capture-routes.js.map +1 -0
- package/dist/mockup/page-captures.d.ts +61 -0
- package/dist/mockup/page-captures.js +252 -0
- package/dist/mockup/page-captures.js.map +1 -0
- package/dist/mockup/parse-spec.d.ts +10 -0
- package/dist/mockup/parse-spec.js +62 -0
- package/dist/mockup/parse-spec.js.map +1 -0
- package/dist/mockup/places.d.ts +17 -0
- package/dist/mockup/places.js +75 -0
- package/dist/mockup/places.js.map +1 -0
- 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 +5 -0
- package/dist/mockup/refusals.js +16 -0
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +3 -5
- package/dist/mockup/routes.js +19 -162
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sketch-limits.d.ts +1 -0
- package/dist/mockup/sketch-limits.js +2 -1
- package/dist/mockup/sketch-limits.js.map +1 -1
- package/dist/mockup/sketch.d.ts +2 -2
- package/dist/mockup/sketch.js +2 -1
- package/dist/mockup/sketch.js.map +1 -1
- package/dist/mockup/slug.d.ts +3 -0
- package/dist/mockup/slug.js +7 -0
- package/dist/mockup/slug.js.map +1 -0
- package/dist/mockup/source-routes.d.ts +5 -4
- package/dist/mockup/source-routes.js +26 -17
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.js +2 -1
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/state-patch.d.ts +22 -0
- package/dist/mockup/state-patch.js +75 -0
- package/dist/mockup/state-patch.js.map +1 -0
- package/dist/mockup/state.d.ts +112 -0
- package/dist/mockup/state.js +22 -0
- package/dist/mockup/state.js.map +1 -0
- package/dist/mockup/store-list.d.ts +28 -0
- package/dist/mockup/store-list.js +89 -0
- package/dist/mockup/store-list.js.map +1 -0
- package/dist/mockup/store.d.ts +16 -37
- package/dist/mockup/store.js +85 -200
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-archive.d.ts +0 -1
- package/dist/mockup/table-archive.js +0 -16
- package/dist/mockup/table-archive.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/pages/settings/users/account-activity.js +2 -1
- package/dist/pages/settings/users/account-activity.js.map +1 -1
- package/dist/routes/auth/oauth/config.js +1 -1
- package/dist/routes/auth/oauth/config.js.map +1 -1
- package/dist/routes/system-state.js +1 -1
- package/dist/routes/system-state.js.map +1 -1
- package/dist/store/interfaces.js +2 -1
- package/dist/store/interfaces.js.map +1 -1
- package/dist/utils/export-jobs-run.js +4 -4
- package/dist/utils/export-jobs-run.js.map +1 -1
- package/dist/utils/export-jobs.js +15 -3
- package/dist/utils/export-jobs.js.map +1 -1
- package/e2e/index.mjs +25 -3
- package/e2e/journey-run.mjs +4 -3
- package/e2e/run-state.mjs +11 -0
- package/e2e/stack.mjs +9 -1
- package/frontend-vue/eslint-globals.generated.mjs +40 -38
- package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +3 -31
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +8 -2
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +5 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +13 -19
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriodScope.ts +6 -15
- package/frontend-vue/layers/dms-core/app/utils/localFetchAnswers.ts +124 -0
- package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +29 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +27 -3
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +27 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +110 -30
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
- package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +19 -7
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +79 -9
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupWidgets.ts +65 -0
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +17 -4
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +12 -0
- package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationGroupsOpen.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationPreferences.ts +13 -8
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +39 -0
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +12 -2
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +9 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +3 -1
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +53 -6
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +31 -5
- 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/MockupDatabase.vue +153 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +23 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +164 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +59 -33
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +51 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +58 -12
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +21 -0
- 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/MockupReconnecting.vue +17 -0
- 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 +77 -9
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +130 -45
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/{MockupOverviewZoom.vue → MockupZoomControls.vue} +23 -15
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +70 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +44 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +14 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +241 -35
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useFixtureBatches.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +157 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +165 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +13 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +126 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +10 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +63 -25
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +82 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +138 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +124 -0
- 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 +10 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +60 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +37 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +5 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +56 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +46 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +29 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +39 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +151 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +19 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/page-toolbar/toolbarControlHeight.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewPresence.ts +10 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSelection.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/formTexts.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/views.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +37 -3
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +130 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +20 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +1 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +141 -103
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +332 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +22 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +75 -173
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +100 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +146 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +118 -9
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +123 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +171 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +138 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +42 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +66 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +6 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +18 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +177 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSections.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +17 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSketchStates.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +0 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +179 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +17 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +143 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +2 -7
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +156 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +108 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +400 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +40 -10
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +23 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +2 -0
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/RepeaterTable.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartTheme.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableDataChanges.ts +5 -4
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +2 -0
- 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/useFixtureBatches.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +1 -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/useMockupRoutePage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.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/composables/block-preview/usePersistedCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupStatePatch.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/entries/utils/previewFixtureAnswers.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +1 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +53 -4
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +53 -4
- package/frontend-vue/package.json +2 -2
- package/frontend-vue/server/private-options.ts +13 -3
- package/package.json +5 -5
- package/dist/mockup/row-filters.d.ts +0 -8
- package/dist/mockup/row-filters.js +0 -107
- package/dist/mockup/row-filters.js.map +0 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +0 -47
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,S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EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,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"}
|
|
@@ -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,292 @@
|
|
|
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
|
+
.optional()
|
|
15
|
+
.describe("The page ids to print. Default: every page."),
|
|
16
|
+
annotations: zod_1.z
|
|
17
|
+
.boolean()
|
|
18
|
+
.describe("Print each page's open annotations under its screen."),
|
|
19
|
+
saasTenant: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("The id of a tenant of the spec's fixtures.tenants to draw every page as, in SaaS mode. Default: the first tenant, when an installed module provides tenancy."),
|
|
24
|
+
includeSchema: zod_1.z
|
|
25
|
+
.boolean()
|
|
26
|
+
.describe("End with the data model (ERD and entity table) when the spec has entities."),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
const APP_GROUP = "App";
|
|
30
|
+
const SETTINGS_SECTION = "Settings";
|
|
31
|
+
const SKETCH_TYPE = "sketch";
|
|
32
|
+
const CUSTOM_PAGE_BLOCK = "Custom page (sketch)";
|
|
33
|
+
const DATE_FORMAT = new Intl.DateTimeFormat("en-GB", {
|
|
34
|
+
day: "numeric",
|
|
35
|
+
month: "short",
|
|
36
|
+
year: "numeric",
|
|
37
|
+
timeZone: "UTC",
|
|
38
|
+
});
|
|
39
|
+
function nodeLabel(node) {
|
|
40
|
+
if (node.type === SKETCH_TYPE)
|
|
41
|
+
return "Sketch";
|
|
42
|
+
return node.componentName ?? node.type ?? "Block";
|
|
43
|
+
}
|
|
44
|
+
function blockList(pages) {
|
|
45
|
+
const counts = new Map();
|
|
46
|
+
const count = (label) => {
|
|
47
|
+
counts.set(label, (counts.get(label) ?? 0) + 1);
|
|
48
|
+
};
|
|
49
|
+
const visit = (nodes) => {
|
|
50
|
+
for (const node of nodes) {
|
|
51
|
+
count(nodeLabel(node));
|
|
52
|
+
visit(node.children ?? []);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
for (const page of pages) {
|
|
56
|
+
if (page.custom === true)
|
|
57
|
+
count(CUSTOM_PAGE_BLOCK);
|
|
58
|
+
else
|
|
59
|
+
visit(page.tree);
|
|
60
|
+
}
|
|
61
|
+
return [...counts].map(([label, total]) => total > 1 ? `${label} ×${total}` : label);
|
|
62
|
+
}
|
|
63
|
+
function rootPage(page, byId) {
|
|
64
|
+
let root = page;
|
|
65
|
+
const seen = new Set([page.id]);
|
|
66
|
+
for (let parent = page.parent ? byId.get(page.parent) : undefined; parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
67
|
+
seen.add(parent.id);
|
|
68
|
+
root = parent;
|
|
69
|
+
}
|
|
70
|
+
return root;
|
|
71
|
+
}
|
|
72
|
+
function categoryTitle(spec, page) {
|
|
73
|
+
return spec.categories?.find((category) => category.id === page.category)
|
|
74
|
+
?.title;
|
|
75
|
+
}
|
|
76
|
+
function sectionTitle(spec, root, group, isSettings) {
|
|
77
|
+
if (group.kind !== "app")
|
|
78
|
+
return group.title;
|
|
79
|
+
if (isSettings)
|
|
80
|
+
return SETTINGS_SECTION;
|
|
81
|
+
return categoryTitle(spec, root) ?? group.title;
|
|
82
|
+
}
|
|
83
|
+
function parentTitles(page, byId) {
|
|
84
|
+
const titles = [];
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
for (let parent = page.parent && byId.get(page.parent); parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
87
|
+
seen.add(parent.id);
|
|
88
|
+
titles.unshift(parent.title);
|
|
89
|
+
}
|
|
90
|
+
return titles;
|
|
91
|
+
}
|
|
92
|
+
function rootsOf(pages) {
|
|
93
|
+
const byId = new Map(pages.map((page) => [page.id, page]));
|
|
94
|
+
return new Map(pages.map((page) => [page.id, rootPage(page, byId).id]));
|
|
95
|
+
}
|
|
96
|
+
function withSubPages(tops, pages, roots, placed) {
|
|
97
|
+
const taken = [];
|
|
98
|
+
for (const page of tops.flatMap((top) => [
|
|
99
|
+
top,
|
|
100
|
+
...pages.filter((under) => under.id !== top.id && roots.get(under.id) === top.id),
|
|
101
|
+
])) {
|
|
102
|
+
if (placed.has(page.id))
|
|
103
|
+
continue;
|
|
104
|
+
placed.add(page.id);
|
|
105
|
+
taken.push(page);
|
|
106
|
+
}
|
|
107
|
+
return taken;
|
|
108
|
+
}
|
|
109
|
+
function menuOrder(tops, categories) {
|
|
110
|
+
const known = new Set(categories.map((category) => category.id));
|
|
111
|
+
const sectionOf = (page) => page.category !== undefined && known.has(page.category)
|
|
112
|
+
? page.category
|
|
113
|
+
: undefined;
|
|
114
|
+
return [
|
|
115
|
+
...tops.filter((page) => sectionOf(page) === undefined),
|
|
116
|
+
...categories.flatMap((category) => tops.filter((page) => sectionOf(page) === category.id)),
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
function screensOf(spec) {
|
|
120
|
+
return (0, mockup_1.placePages)(spec.modules ?? [], spec.pages).map((entry) => {
|
|
121
|
+
const page = (0, mockup_1.leadOf)(entry);
|
|
122
|
+
if (entry.kind === "page") {
|
|
123
|
+
return {
|
|
124
|
+
page,
|
|
125
|
+
contributors: [page],
|
|
126
|
+
isSettings: entry.place.kind === "settings",
|
|
127
|
+
...(entry.place.kind === "module" && { module: entry.place.module }),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const module = (0, mockup_1.menuModule)(entry.menu);
|
|
131
|
+
return {
|
|
132
|
+
page,
|
|
133
|
+
contributors: entry.pages,
|
|
134
|
+
isSettings: entry.menu === "settings",
|
|
135
|
+
...(module !== undefined && { module }),
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function draftGroups(spec, screened) {
|
|
140
|
+
const pages = screened.map((entry) => entry.page);
|
|
141
|
+
const roots = rootsOf(pages);
|
|
142
|
+
const tops = (module) => {
|
|
143
|
+
const own = screened.filter((entry) => entry.module === module);
|
|
144
|
+
const ids = new Set(own.map((entry) => entry.page.id));
|
|
145
|
+
return own
|
|
146
|
+
.map((entry) => entry.page)
|
|
147
|
+
.filter((page) => page.parent === undefined || !ids.has(page.parent));
|
|
148
|
+
};
|
|
149
|
+
const listed = (0, mockup_1.moduleStates)(spec.modules ?? []).map((module) => ({
|
|
150
|
+
module,
|
|
151
|
+
tops: tops(module.id),
|
|
152
|
+
}));
|
|
153
|
+
const placed = new Set(listed.flatMap((entry) => entry.tops.map((page) => page.id)));
|
|
154
|
+
const app = {
|
|
155
|
+
title: APP_GROUP,
|
|
156
|
+
kind: "app",
|
|
157
|
+
pages: withSubPages(menuOrder(tops(undefined), spec.categories ?? []), pages, roots, placed),
|
|
158
|
+
};
|
|
159
|
+
for (const entry of listed)
|
|
160
|
+
for (const page of entry.tops)
|
|
161
|
+
placed.delete(page.id);
|
|
162
|
+
const modules = listed.map(({ module, tops: moduleTops }) => ({
|
|
163
|
+
title: module.title,
|
|
164
|
+
kind: module.package === undefined ? "custom" : "catalog",
|
|
165
|
+
pages: withSubPages(moduleTops, pages, roots, placed),
|
|
166
|
+
}));
|
|
167
|
+
return [app, ...modules].filter((group) => group.pages.length > 0);
|
|
168
|
+
}
|
|
169
|
+
function refuseUnknownPages(groups, asked) {
|
|
170
|
+
if (asked === undefined)
|
|
171
|
+
return undefined;
|
|
172
|
+
const known = groups.flatMap((group) => group.pages.map((page) => page.id));
|
|
173
|
+
const ids = asked.filter((id) => !known.includes(id));
|
|
174
|
+
return ids.length ? { kind: "unknown_pages", ids, known } : undefined;
|
|
175
|
+
}
|
|
176
|
+
function schemaOf(spec) {
|
|
177
|
+
return Object.entries(spec.entities ?? {}).map(([name, entity]) => ({
|
|
178
|
+
name,
|
|
179
|
+
tenantScoped: entity.tenantScoped === true,
|
|
180
|
+
fields: Object.entries(entity.fields).map(([field, type]) => ({
|
|
181
|
+
name: field,
|
|
182
|
+
type: type.type,
|
|
183
|
+
...(type.type === "ref" && { to: type.to }),
|
|
184
|
+
})),
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
function tenantOf(spec, id) {
|
|
188
|
+
const tenancy = (0, mockup_1.hasTenancy)(spec.modules ?? []);
|
|
189
|
+
if (id !== undefined && !tenancy)
|
|
190
|
+
return { kind: "no_saas" };
|
|
191
|
+
if (!tenancy)
|
|
192
|
+
return { ok: true };
|
|
193
|
+
const tenants = spec.fixtures?.tenants ?? [];
|
|
194
|
+
if (id === undefined) {
|
|
195
|
+
const first = tenants[0];
|
|
196
|
+
return first
|
|
197
|
+
? { ok: true, tenant: { id: first.id, name: first.name } }
|
|
198
|
+
: { ok: true };
|
|
199
|
+
}
|
|
200
|
+
const found = tenants.find((tenant) => tenant.id === id);
|
|
201
|
+
if (!found)
|
|
202
|
+
return {
|
|
203
|
+
kind: "unknown_tenant",
|
|
204
|
+
id,
|
|
205
|
+
known: tenants.map((tenant) => tenant.id),
|
|
206
|
+
};
|
|
207
|
+
return { ok: true, tenant: { id: found.id, name: found.name } };
|
|
208
|
+
}
|
|
209
|
+
function planExport(spec, notes, options, now) {
|
|
210
|
+
const tenant = tenantOf(spec, options.saasTenant);
|
|
211
|
+
if (!("ok" in tenant))
|
|
212
|
+
return { ok: false, refusal: tenant };
|
|
213
|
+
const screened = screensOf(spec);
|
|
214
|
+
const drafts = draftGroups(spec, screened);
|
|
215
|
+
const unknown = refuseUnknownPages(drafts, options.pages);
|
|
216
|
+
if (unknown)
|
|
217
|
+
return { ok: false, refusal: unknown };
|
|
218
|
+
const asked = options.pages && new Set(options.pages);
|
|
219
|
+
const byId = new Map(spec.pages.map((page) => [page.id, page]));
|
|
220
|
+
const contributors = new Map(screened.map((entry) => [entry.page.id, entry.contributors]));
|
|
221
|
+
const settings = new Set(screened.flatMap((entry) => (entry.isSettings ? [entry.page.id] : [])));
|
|
222
|
+
const groups = drafts
|
|
223
|
+
.map((draft) => ({
|
|
224
|
+
...draft,
|
|
225
|
+
pages: draft.pages.filter((page) => !asked || asked.has(page.id)),
|
|
226
|
+
}))
|
|
227
|
+
.filter((draft) => draft.pages.length > 0)
|
|
228
|
+
.map((draft, index) => ({
|
|
229
|
+
number: index + 1,
|
|
230
|
+
title: draft.title,
|
|
231
|
+
kind: draft.kind,
|
|
232
|
+
screens: draft.pages.map((page, at) => ({
|
|
233
|
+
number: `${index + 1}.${at + 1}`,
|
|
234
|
+
pageId: page.id,
|
|
235
|
+
title: page.title,
|
|
236
|
+
path: [
|
|
237
|
+
sectionTitle(spec, rootPage(page, byId), draft, settings.has(page.id)),
|
|
238
|
+
...parentTitles(page, byId),
|
|
239
|
+
page.title,
|
|
240
|
+
],
|
|
241
|
+
mode: [
|
|
242
|
+
{
|
|
243
|
+
app: "App page",
|
|
244
|
+
custom: "Custom module",
|
|
245
|
+
catalog: "Catalog module",
|
|
246
|
+
}[draft.kind],
|
|
247
|
+
page.custom === true ? "custom page" : "fixtures",
|
|
248
|
+
...(tenant.tenant ? [`SaaS mode: ${tenant.tenant.name}`] : []),
|
|
249
|
+
],
|
|
250
|
+
blocks: blockList(contributors.get(page.id) ?? [page]),
|
|
251
|
+
notes: options.annotations
|
|
252
|
+
? notes.flatMap((note, at) => (contributors.get(page.id) ?? [page]).some((own) => own.id === note.page) && note.status === "open"
|
|
253
|
+
? [{ number: at + 1, text: note.text }]
|
|
254
|
+
: [])
|
|
255
|
+
: [],
|
|
256
|
+
})),
|
|
257
|
+
}));
|
|
258
|
+
if (groups.length === 0)
|
|
259
|
+
return { ok: false, refusal: { kind: "no_pages" } };
|
|
260
|
+
const schema = schemaOf(spec);
|
|
261
|
+
return {
|
|
262
|
+
ok: true,
|
|
263
|
+
plan: {
|
|
264
|
+
title: spec.title ?? "Mockup",
|
|
265
|
+
date: DATE_FORMAT.format(now),
|
|
266
|
+
counts: {
|
|
267
|
+
pages: groups.reduce((sum, group) => sum + group.screens.length, 0),
|
|
268
|
+
modules: spec.modules?.length ?? 0,
|
|
269
|
+
entities: schema.length,
|
|
270
|
+
},
|
|
271
|
+
groups,
|
|
272
|
+
...(tenant.tenant && { tenant: tenant.tenant }),
|
|
273
|
+
...(options.includeSchema && schema.length > 0 && { schema }),
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function planScreens(plan) {
|
|
278
|
+
return plan.groups.flatMap((group) => group.screens);
|
|
279
|
+
}
|
|
280
|
+
function describeRefusal(refusal) {
|
|
281
|
+
switch (refusal.kind) {
|
|
282
|
+
case "unknown_pages":
|
|
283
|
+
return `No page of the mockup has the id ${refusal.ids.map((id) => `"${id}"`).join(", ")}. Its pages: ${refusal.known.join(", ") || "none"}.`;
|
|
284
|
+
case "no_saas":
|
|
285
|
+
return 'saasTenant draws a page in SaaS mode, which a mockup has once an installed module provides tenancy, such as "saas".';
|
|
286
|
+
case "unknown_tenant":
|
|
287
|
+
return `No tenant of the spec's fixtures.tenants has the id "${refusal.id}". Its tenants: ${refusal.known.join(", ") || "none"}.`;
|
|
288
|
+
case "no_pages":
|
|
289
|
+
return "The mockup has no page to export.";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/plan.ts"],"names":[],"mappings":";;;;;;AAAA,6BAAwB;AACxB,yCAUsB;AAGT,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,CAAC;IACN,KAAK,EAAE,OAAC;SACL,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAA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,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvD,CAAC;AAGD,yBAAgC,OAAoB;IAClD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,eAAe;YAClB,OAAO,oCAAoC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC;QAChJ,KAAK,SAAS;YACZ,OAAO,qHAAqH,CAAC;QAC/H,KAAK,gBAAgB;YACnB,OAAO,wDAAwD,OAAO,CAAC,EAAE,mBAAmB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC;QACpI,KAAK,UAAU;YACb,OAAO,mCAAmC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ExportJobView } from ".";
|
|
2
|
+
export type ExportStartAnswer = {
|
|
3
|
+
ok: true;
|
|
4
|
+
id: string;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function registerMockupExportRoute(mockupsDir: string): {
|
|
10
|
+
new (...args: any[]): {
|
|
11
|
+
assertOwner(): Promise<void>;
|
|
12
|
+
owner(): Promise<import("../../mockup").Who>;
|
|
13
|
+
start(rawName: string, body: unknown): Promise<ExportStartAnswer>;
|
|
14
|
+
status(rawName: string, id: string): Promise<ExportJobView>;
|
|
15
|
+
download(rawName: string, id: string): Promise<void>;
|
|
16
|
+
requestContext: import("@antelopejs/interface-api").RequestContext;
|
|
17
|
+
roleModel: import("@antelopejs/interface-dms/db").RoleModel;
|
|
18
|
+
memberModel: import("@antelopejs/interface-dms/db").TenantMemberModel;
|
|
19
|
+
user: import("@antelopejs/interface-dms/auth/db").User | undefined;
|
|
20
|
+
};
|
|
21
|
+
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
22
|
+
location: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.registerMockupExportRoute = registerMockupExportRoute;
|
|
16
|
+
const promises_1 = require("node:fs/promises");
|
|
17
|
+
const node_path_1 = require("node:path");
|
|
18
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
19
|
+
const mockup_1 = require("../../mockup");
|
|
20
|
+
const page_verify_1 = require("../tools/page-verify");
|
|
21
|
+
const _1 = require(".");
|
|
22
|
+
const plan_1 = require("./plan");
|
|
23
|
+
function registerMockupExportRoute(mockupsDir) {
|
|
24
|
+
class MockupExportController extends (0, interface_api_1.Controller)(mockup_1.MOCKUP_API, mockup_1.MockupOwnerController) {
|
|
25
|
+
async start(rawName, body) {
|
|
26
|
+
await this.assertOwner();
|
|
27
|
+
const name = (0, mockup_1.nameOf)(rawName);
|
|
28
|
+
const options = plan_1.exportOptionsSchema.safeParse(body ?? {});
|
|
29
|
+
if (!options.success) {
|
|
30
|
+
return { ok: false, message: options.error.message };
|
|
31
|
+
}
|
|
32
|
+
const started = await (0, _1.startExport)({
|
|
33
|
+
name,
|
|
34
|
+
mockupsDir,
|
|
35
|
+
origin: (0, page_verify_1.dashboardOrigin)(),
|
|
36
|
+
options: options.data,
|
|
37
|
+
});
|
|
38
|
+
if (started.ok)
|
|
39
|
+
return { ok: true, id: started.id };
|
|
40
|
+
if (started.reason === "no_mockup")
|
|
41
|
+
throw (0, mockup_1.notFound)("mockup");
|
|
42
|
+
return { ok: false, message: started.message };
|
|
43
|
+
}
|
|
44
|
+
async status(rawName, id) {
|
|
45
|
+
await this.assertOwner();
|
|
46
|
+
const view = _1.exportJobs.status((0, mockup_1.nameOf)(rawName), id);
|
|
47
|
+
if (view === undefined)
|
|
48
|
+
throw (0, mockup_1.notFound)("export");
|
|
49
|
+
return view;
|
|
50
|
+
}
|
|
51
|
+
async download(rawName, id) {
|
|
52
|
+
await this.assertOwner();
|
|
53
|
+
const name = (0, mockup_1.nameOf)(rawName);
|
|
54
|
+
if (_1.exportJobs.status(name, id)?.status !== "done") {
|
|
55
|
+
throw (0, mockup_1.notFound)("export");
|
|
56
|
+
}
|
|
57
|
+
const pdf = await (0, promises_1.readFile)((0, node_path_1.join)((0, mockup_1.mockupDirectory)(mockupsDir, name), mockup_1.EXPORT_PDF_FILE));
|
|
58
|
+
const { response } = this.requestContext;
|
|
59
|
+
response.addHeader("Content-Disposition", `attachment; filename="${name}.pdf"`);
|
|
60
|
+
response.addHeader("Content-Length", String(pdf.length));
|
|
61
|
+
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition, Content-Length");
|
|
62
|
+
response.getWriteStream("application/pdf").end(pdf);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, interface_api_1.Post)(":name/export"),
|
|
67
|
+
__param(0, (0, interface_api_1.Parameter)("name")),
|
|
68
|
+
__param(1, (0, interface_api_1.JSONBody)()),
|
|
69
|
+
__metadata("design:type", Function),
|
|
70
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
71
|
+
__metadata("design:returntype", Promise)
|
|
72
|
+
], MockupExportController.prototype, "start", null);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, interface_api_1.Get)(":name/export/:id"),
|
|
75
|
+
__param(0, (0, interface_api_1.Parameter)("name")),
|
|
76
|
+
__param(1, (0, interface_api_1.Parameter)("id")),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", [String, String]),
|
|
79
|
+
__metadata("design:returntype", Promise)
|
|
80
|
+
], MockupExportController.prototype, "status", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, interface_api_1.Get)(":name/export/:id/pdf"),
|
|
83
|
+
__param(0, (0, interface_api_1.Parameter)("name")),
|
|
84
|
+
__param(1, (0, interface_api_1.Parameter)("id")),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [String, String]),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], MockupExportController.prototype, "download", null);
|
|
89
|
+
return MockupExportController;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/route.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,yCAAiC;AACjC,6DAMmC;AACnC,yCAOsB;AACtB,sDAAuD;AACvD,wBAAgE;AAChE,iCAA6C;AAe7C,mCAA0C,UAAkB;IAC1D,MAAM,sBAAuB,SAAQ,IAAA,0BAAU,EAC7C,mBAAU,EACV,8BAAqB,CACtB;QAEO,AAAN,KAAK,CAAC,KAAK,CACU,OAAe,EACtB,IAAa;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BAAsB,CAAC;AAChC,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import type { Browser, BrowserContext, ContextOptions } from "./playwright";
|
|
2
|
+
import { type VerifyAccount } from "./accounts";
|
|
3
|
+
import { type WriteGuard } from "./controls";
|
|
1
4
|
import { type MockupTarget } from "./mockup";
|
|
2
5
|
import type { PageVerifyReport, Viewport } from "./report";
|
|
3
6
|
export * from "./accounts";
|
|
4
7
|
export * from "./failures";
|
|
5
8
|
export * from "./forms";
|
|
6
9
|
export * from "./mockup";
|
|
10
|
+
export * from "./modules";
|
|
7
11
|
export * from "./render";
|
|
8
12
|
export * from "./page-probe";
|
|
9
13
|
export * from "./redact-report";
|
|
@@ -17,4 +21,15 @@ export interface VerifyRequest {
|
|
|
17
21
|
submit: boolean;
|
|
18
22
|
origin: string;
|
|
19
23
|
}
|
|
24
|
+
export declare class Sessions {
|
|
25
|
+
private readonly browser;
|
|
26
|
+
readonly origin: string;
|
|
27
|
+
private readonly options;
|
|
28
|
+
private readonly opened;
|
|
29
|
+
private readonly contexts;
|
|
30
|
+
constructor(browser: Browser, origin: string, options?: ContextOptions);
|
|
31
|
+
contextFor(account: VerifyAccount, guard: WriteGuard): Promise<BrowserContext>;
|
|
32
|
+
private signIn;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
20
35
|
export declare function verifyPages(request: VerifyRequest): Promise<PageVerifyReport>;
|