@antelopejs/dms 0.25.8 → 0.25.9-next.1183.ga9db169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -48
- package/E2E.md +138 -0
- package/README.md +2 -2
- package/data/mockup-example/spec.json +13 -0
- package/data/mockup-spec.schema.json +399 -16
- package/dist/e2e/index.d.mts +2 -1
- package/dist/implementations/dms/live-pages.d.ts +6 -0
- package/dist/implementations/dms/live-pages.js +139 -0
- package/dist/implementations/dms/live-pages.js.map +1 -0
- package/dist/implementations/dms/page/notifications.js +2 -0
- package/dist/implementations/dms/page/notifications.js.map +1 -1
- package/dist/implementations/dms/page/registry.js +19 -4
- package/dist/implementations/dms/page/registry.js.map +1 -1
- package/dist/implementations/dms/registry-snapshot.d.ts +32 -0
- package/dist/implementations/dms/registry-snapshot.js +55 -0
- package/dist/implementations/dms/registry-snapshot.js.map +1 -0
- package/dist/implementations/dms/services.d.ts +2 -0
- package/dist/implementations/dms/services.js +2 -0
- package/dist/implementations/dms/services.js.map +1 -1
- package/dist/implementations/dms/tenant-access.d.ts +1 -0
- package/dist/implementations/dms/tenant-access.js +7 -0
- package/dist/implementations/dms/tenant-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/map-resources-pages.js +1 -1
- package/dist/implementations/dms-builder/engine/map-resources-pages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.d.ts +2 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js +12 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js.map +1 -1
- package/dist/implementations/dms-builder/engine/table-view-settings.js +9 -33
- 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 +112 -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 +296 -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 +3 -1
- package/dist/mcp/page-verify/mockup.js +2 -0
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/modules.d.ts +1 -0
- package/dist/mcp/page-verify/modules.js +22 -0
- package/dist/mcp/page-verify/modules.js.map +1 -0
- package/dist/mcp/page-verify/page-probe.d.ts +5 -0
- package/dist/mcp/page-verify/page-probe.js +2 -0
- package/dist/mcp/page-verify/page-probe.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +22 -4
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/page-verify/report.d.ts +1 -0
- package/dist/mcp/tools/builder-compose.js +4 -1
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-pages.js +1 -1
- package/dist/mcp/tools/builder-pages.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.js +6 -1
- package/dist/mcp/tools/index.js.map +1 -1
- 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-install-modules.d.ts +9 -0
- package/dist/mcp/tools/mockup-install-modules.js +122 -0
- package/dist/mcp/tools/mockup-install-modules.js.map +1 -0
- package/dist/mcp/tools/mockup-module-catalog.d.ts +3 -0
- package/dist/mcp/tools/mockup-module-catalog.js +52 -0
- package/dist/mcp/tools/mockup-module-catalog.js.map +1 -0
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +8 -6
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-support.js +18 -5
- package/dist/mcp/tools/mockup-support.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +6 -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/mcp/tools/pages.d.ts +1 -0
- package/dist/mcp/tools/pages.js +9 -3
- package/dist/mcp/tools/pages.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-modules.d.ts +5 -0
- package/dist/mockup/compile-modules.js +40 -0
- package/dist/mockup/compile-modules.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 +20 -0
- package/dist/mockup/compile-pages.js +272 -0
- package/dist/mockup/compile-pages.js.map +1 -0
- package/dist/mockup/compile.d.ts +10 -12
- package/dist/mockup/compile.js +36 -292
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +2 -0
- package/dist/mockup/controller-blocks.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/database-routes.d.ts +15 -0
- package/dist/mockup/database-routes.js +58 -0
- package/dist/mockup/database-routes.js.map +1 -0
- package/dist/mockup/database-schema.d.ts +17 -0
- package/dist/mockup/database-schema.js +41 -0
- package/dist/mockup/database-schema.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 +34 -0
- package/dist/mockup/extensions.js +107 -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 +3 -2
- package/dist/mockup/fixture-answers.js +13 -4
- 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 +2 -29
- package/dist/mockup/fixtures.js +0 -111
- 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 +30 -39
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/history.js +7 -3
- package/dist/mockup/history.js.map +1 -1
- package/dist/mockup/index.d.ts +14 -0
- package/dist/mockup/index.js +14 -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.d.ts +1 -1
- package/dist/mockup/json-schema.js +41 -20
- 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 +145 -99
- package/dist/mockup/model.js +101 -86
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/module-context.d.ts +25 -0
- package/dist/mockup/module-context.js +83 -0
- package/dist/mockup/module-context.js.map +1 -0
- package/dist/mockup/module-install.d.ts +22 -0
- package/dist/mockup/module-install.js +71 -0
- package/dist/mockup/module-install.js.map +1 -0
- package/dist/mockup/module-states.d.ts +17 -0
- package/dist/mockup/module-states.js +167 -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 +38 -0
- package/dist/mockup/modules-schema.js.map +1 -0
- package/dist/mockup/modules.d.ts +9 -10
- package/dist/mockup/modules.js +104 -25
- package/dist/mockup/modules.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/page-descriptions.d.ts +2 -0
- package/dist/mockup/page-descriptions.js +18 -0
- package/dist/mockup/page-descriptions.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 +6 -0
- package/dist/mockup/refusals.js +17 -0
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +3 -5
- package/dist/mockup/routes.js +24 -163
- 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.d.ts +3 -3
- package/dist/mockup/source.js +4 -3
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/state-patch.d.ts +22 -0
- package/dist/mockup/state-patch.js +76 -0
- package/dist/mockup/state-patch.js.map +1 -0
- package/dist/mockup/state.d.ts +163 -0
- package/dist/mockup/state.js +24 -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 +25 -38
- package/dist/mockup/store.js +126 -203
- 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/mockup/unknown-keys.d.ts +2 -2
- package/dist/mockup/unknown-keys.js +8 -4
- package/dist/mockup/unknown-keys.js.map +1 -1
- package/dist/mockup/validate.d.ts +2 -2
- package/dist/mockup/validate.js.map +1 -1
- package/dist/store/catalog.d.ts +5 -1
- package/dist/store/catalog.js +12 -1
- package/dist/store/catalog.js.map +1 -1
- package/dist/store/changes.d.ts +3 -0
- package/dist/store/changes.js +22 -0
- package/dist/store/changes.js.map +1 -0
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.js +2 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/listing.js +5 -5
- package/dist/store/listing.js.map +1 -1
- package/dist/store/operations.d.ts +8 -0
- package/dist/store/operations.js +27 -3
- package/dist/store/operations.js.map +1 -1
- package/dist/store/registry.d.ts +1 -0
- package/dist/store/registry.js +9 -0
- package/dist/store/registry.js.map +1 -1
- package/dist/store/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/live-pages.d.ts +41 -0
- package/dist/types/live-pages.js +3 -0
- package/dist/types/live-pages.js.map +1 -0
- package/dist/validation/store.schema.d.ts +1 -0
- package/dist/validation/store.schema.js +4 -4
- package/dist/validation/store.schema.js.map +1 -1
- package/e2e/index.mjs +3 -2
- package/frontend-vue/build/viewer-chunks.ts +181 -0
- package/frontend-vue/dms.frontend.build.ts +2 -1
- package/frontend-vue/dms.frontend.ts +7 -0
- package/frontend-vue/eslint-globals.generated.mjs +27 -24
- package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +3 -31
- package/frontend-vue/layers/dms-core/app/build/utils/previewFrame.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +8 -2
- 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 +4 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +4 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +89 -31
- 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 +61 -8
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +79 -9
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +57 -8
- 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/settings/useSettingsNavigation.ts +42 -62
- 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/useMockupStoreInstaller.ts +85 -0
- package/frontend-vue/layers/dms-layout/app/custom-layouts/MockupLayout.vue +0 -2
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +53 -6
- package/frontend-vue/layers/dms-layout/app/plugins/mockup-store-installer.ts +10 -0
- package/frontend-vue/layers/dms-layout/app/plugins/registered-sidebar-widgets.ts +10 -0
- package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +7 -0
- package/frontend-vue/layers/dms-layout/app/theme/actions.ts +11 -7
- package/frontend-vue/layers/dms-onboarding/app/middleware/onboarding.global.ts +3 -3
- package/frontend-vue/layers/dms-onboarding/app/plugins/onboarding-preload.ts +5 -1
- 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 +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +204 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseData.vue +288 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseDiagram.vue +91 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseRelationEdge.vue +40 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseTableNode.vue +133 -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 +240 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +54 -33
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +52 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +65 -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/MockupTitle.vue +24 -15
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupToolbar.vue +196 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +200 -179
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWarningsMenu.vue +59 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +152 -57
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewAdmission.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +71 -4
- 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/previewSwapHold.ts +157 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/registeredSidebarWidgets.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/storeModuleInstaller.ts +32 -0
- 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 +309 -41
- 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 +182 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupConnectionTables.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +212 -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 +50 -23
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +103 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +146 -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 +11 -4
- 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 +36 -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 +59 -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 +44 -10
- 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/useMockupWarningFocus.ts +145 -0
- 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 +41 -0
- 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/blockPreview.ts +137 -78
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +1 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +165 -103
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +321 -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 +112 -175
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +120 -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/mockupDiagram.ts +330 -0
- 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 +11 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +215 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +240 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +21 -3
- 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 +23 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRows.ts +83 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +173 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSettings.ts +218 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +17 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +180 -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 +148 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTitles.ts +33 -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 +37 -19
- package/frontend-vue/layers/dms-ui/app/build/utils/previewOptionRules.ts +129 -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/settingsGroups.ts +73 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +68 -12
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +61 -12
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +4 -1
- 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/registeredSidebarWidgets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/storeModuleInstaller.ts +1 -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/blockPreview.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/mockupDiagram.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/mockupRows.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/mockupSettings.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/mockupTitles.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/app/entries/utils/settingsGroups.ts +1 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +85 -7
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +85 -7
- package/frontend-vue/package.json +2 -2
- package/frontend-vue/scripts/test-dms-components.mjs +1 -1
- package/package.json +6 -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
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +0 -67
|
@@ -9,6 +9,41 @@ import {
|
|
|
9
9
|
isPreviewPageLayout,
|
|
10
10
|
type PreviewPageLayout,
|
|
11
11
|
} from "./previewPageLayout";
|
|
12
|
+
import { isMockupEntities, type MockupEntityState } from "./mockupEntities";
|
|
13
|
+
import {
|
|
14
|
+
isMockupModules,
|
|
15
|
+
isPagePlace,
|
|
16
|
+
type MockupModule,
|
|
17
|
+
type MockupPagePlace,
|
|
18
|
+
} from "./mockupModules";
|
|
19
|
+
import { isMockupSettings, type MockupSettings } from "./mockupSettings";
|
|
20
|
+
import { isMockupTenants, type MockupTenant } from "./mockupTenants";
|
|
21
|
+
|
|
22
|
+
export { MOCKUP_FIELD_TYPES } from "./mockupEntities";
|
|
23
|
+
export type {
|
|
24
|
+
MockupMenuNode,
|
|
25
|
+
MockupRegisteredBlock,
|
|
26
|
+
MockupRegisteredPage,
|
|
27
|
+
MockupSettings,
|
|
28
|
+
} from "./mockupSettings";
|
|
29
|
+
export type {
|
|
30
|
+
MockupCustomModule,
|
|
31
|
+
MockupExtensionMenu,
|
|
32
|
+
MockupInstalledModule,
|
|
33
|
+
MockupMissingModule,
|
|
34
|
+
MockupModule,
|
|
35
|
+
MockupModuleExtension,
|
|
36
|
+
MockupModulePage,
|
|
37
|
+
MockupModuleRoot,
|
|
38
|
+
MockupModuleSetting,
|
|
39
|
+
MockupPagePlace,
|
|
40
|
+
} from "./mockupModules";
|
|
41
|
+
export { providesTenancy } from "./mockupModules";
|
|
42
|
+
export type {
|
|
43
|
+
MockupEntityField,
|
|
44
|
+
MockupEntityState,
|
|
45
|
+
MockupFieldType,
|
|
46
|
+
} from "./mockupEntities";
|
|
12
47
|
|
|
13
48
|
/** A problem in `spec.json`, at a JSON pointer into it (`""` is the whole file). */
|
|
14
49
|
export interface MockupIssue {
|
|
@@ -16,6 +51,14 @@ export interface MockupIssue {
|
|
|
16
51
|
message: string;
|
|
17
52
|
}
|
|
18
53
|
|
|
54
|
+
/** What the spec likely does not show as meant, with the change that clears it. */
|
|
55
|
+
export interface MockupWarning extends MockupIssue {
|
|
56
|
+
/** The change to the spec that clears it; absent from a backend that sends none. */
|
|
57
|
+
fix?: string;
|
|
58
|
+
/** The pointer of the block it concerns, when `path` is elsewhere, such as the fixture the block reads. */
|
|
59
|
+
block?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
19
62
|
export interface MockupPageOptions {
|
|
20
63
|
theme?: string;
|
|
21
64
|
locale?: string;
|
|
@@ -43,7 +86,9 @@ export interface MockupPageRoute {
|
|
|
43
86
|
export interface MockupPageState {
|
|
44
87
|
id: string;
|
|
45
88
|
title: string;
|
|
46
|
-
/**
|
|
89
|
+
/** Where the page lives: the app's menu, a module's root, the Settings, or an existing page the spec extends. */
|
|
90
|
+
place: MockupPagePlace;
|
|
91
|
+
/** The id of the section the page is listed under; none for the default one, and for a page of a module. */
|
|
47
92
|
category?: string;
|
|
48
93
|
/** The sidebar leaves the page out: a detail or form page another page opens. */
|
|
49
94
|
menu?: false;
|
|
@@ -61,7 +106,7 @@ export interface MockupPageState {
|
|
|
61
106
|
icon?: string;
|
|
62
107
|
description?: string;
|
|
63
108
|
headerActions?: PreviewHeaderAction[];
|
|
64
|
-
/** The layout the page is drawn in; the dashboard frame when absent. */
|
|
109
|
+
/** The layout the page is drawn in; the dashboard frame when absent. A custom layout is resolved: its regions come with the page. */
|
|
65
110
|
layout?: PreviewPageLayout;
|
|
66
111
|
options: MockupPageOptions;
|
|
67
112
|
/** What `DmsBlockPreview` draws: fixtures resolved, sketch nodes passed through. */
|
|
@@ -71,6 +116,13 @@ export interface MockupPageState {
|
|
|
71
116
|
* on. Present only when the page names live routes.
|
|
72
117
|
*/
|
|
73
118
|
realTree?: PreviewNode[];
|
|
119
|
+
/**
|
|
120
|
+
* The route of the page's fixture batch, `?v=` the digest of its content
|
|
121
|
+
* and of which fixtures a tenant sees only its own rows of: it changes with
|
|
122
|
+
* the fixtures the page reads, for every tenant, so a page whose fixtures
|
|
123
|
+
* changed is another page object. Absent when the page reads no fixture.
|
|
124
|
+
*/
|
|
125
|
+
fixtures?: string;
|
|
74
126
|
livePage?: MockupLivePage;
|
|
75
127
|
/** Spec JSON pointer of each node, keyed by the layout path the preview gives it. */
|
|
76
128
|
paths: Record<string, string>;
|
|
@@ -92,15 +144,6 @@ export interface MockupSidebar {
|
|
|
92
144
|
widgets: MockupSidebarWidget[];
|
|
93
145
|
}
|
|
94
146
|
|
|
95
|
-
/** A DMS module the mockup's app needs: its entry in the module store catalog. */
|
|
96
|
-
export interface MockupModule {
|
|
97
|
-
/** The module's id in the catalog. */
|
|
98
|
-
id: string;
|
|
99
|
-
/** The npm package building the mockup installs. */
|
|
100
|
-
package: string;
|
|
101
|
-
icon: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
147
|
export interface MockupState {
|
|
105
148
|
name: string;
|
|
106
149
|
title?: string;
|
|
@@ -112,77 +155,18 @@ export interface MockupState {
|
|
|
112
155
|
sidebar?: MockupSidebar;
|
|
113
156
|
/** Absent when the spec lists no module. */
|
|
114
157
|
modules?: MockupModule[];
|
|
158
|
+
/** The spec's entities, in spec order; absent when the spec has none. */
|
|
159
|
+
entities?: MockupEntityState[];
|
|
160
|
+
/** `fixtures.tenants` of the spec: the workspaces SaaS mode lists; absent when the spec has none. */
|
|
161
|
+
tenants?: MockupTenant[];
|
|
162
|
+
/** `data.connection` of the spec: the external connection the explorer introspects; absent when the spec has no `data`. */
|
|
163
|
+
connection?: string;
|
|
164
|
+
/** The dashboard's real settings: its menu and its pages, which the viewer draws as they are. Absent while no settings root is registered. */
|
|
165
|
+
settings?: MockupSettings;
|
|
115
166
|
pages: MockupPageState[];
|
|
116
167
|
issues: MockupIssue[];
|
|
117
168
|
/** What the spec likely does not show as meant; absent from a backend that reports none. */
|
|
118
|
-
warnings?:
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export type MockupAnnotationStatus = "open" | "resolved";
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The block a note is about: the node whose id is `block`, on the page `page`
|
|
125
|
-
* when set, then the children whose ids are `steps`.
|
|
126
|
-
*/
|
|
127
|
-
export interface MockupBlockAnchor {
|
|
128
|
-
block: string;
|
|
129
|
-
steps: string[];
|
|
130
|
-
page?: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** What a note is on: a block, or the page `page` as a whole. */
|
|
134
|
-
export type MockupNoteAnchor = MockupBlockAnchor | { page: string };
|
|
135
|
-
|
|
136
|
-
/** Where a pin sits on its block or page: fractions of its box, from its top left corner. */
|
|
137
|
-
export interface MockupPinOffset {
|
|
138
|
-
x: number;
|
|
139
|
-
y: number;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* A reviewer's pin. `page` and `path` are where it is now: both on a block,
|
|
144
|
-
* `page` alone on a page, neither when its block or page was removed.
|
|
145
|
-
* `version` is the number of the history version it was pinned on, and
|
|
146
|
-
* `resolvedVersion` the one it was resolved on.
|
|
147
|
-
*/
|
|
148
|
-
export interface MockupAnnotation {
|
|
149
|
-
id: string;
|
|
150
|
-
anchor: MockupNoteAnchor;
|
|
151
|
-
offset: MockupPinOffset;
|
|
152
|
-
page?: string;
|
|
153
|
-
/** Spec JSON pointer of the note's block now. */
|
|
154
|
-
path?: string;
|
|
155
|
-
text: string;
|
|
156
|
-
status: MockupAnnotationStatus;
|
|
157
|
-
createdAt: string;
|
|
158
|
-
resolvedAt?: string;
|
|
159
|
-
version?: number;
|
|
160
|
-
resolvedVersion?: number;
|
|
161
|
-
/** The state of the sketch the note was pinned on; absent on its own `html` and on any other block. */
|
|
162
|
-
state?: string;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Where a pin is put: on the node at `path` of page `page`, or on the page
|
|
167
|
-
* itself without `path`, and the state of the sketch drawn there.
|
|
168
|
-
*/
|
|
169
|
-
export interface MockupPinPlace {
|
|
170
|
-
page: string;
|
|
171
|
-
path?: string;
|
|
172
|
-
offset: MockupPinOffset;
|
|
173
|
-
state?: string;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/** What `POST /api/mockup/:name/annotations` takes. */
|
|
177
|
-
export interface MockupAnnotationDraft extends MockupPinPlace {
|
|
178
|
-
text: string;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/** What `PATCH /api/mockup/:name/annotations/:id` takes. */
|
|
182
|
-
export interface MockupAnnotationPatch {
|
|
183
|
-
status?: MockupAnnotationStatus;
|
|
184
|
-
text?: string;
|
|
185
|
-
place?: MockupPinPlace;
|
|
169
|
+
warnings?: MockupWarning[];
|
|
186
170
|
}
|
|
187
171
|
|
|
188
172
|
/** Who wrote a mockup: the dashboard chat, Claude Code or Codex. */
|
|
@@ -253,9 +237,15 @@ export const MOCKUP_LIST_ENDPOINT = "/api/mockup";
|
|
|
253
237
|
/** The path under a mockup's endpoint of the stored image of its first page. */
|
|
254
238
|
export const MOCKUP_CAPTURE_SUFFIX = "/capture";
|
|
255
239
|
|
|
240
|
+
/** The path under a mockup's endpoint of the images the Overview captured of its pages: all of them on a `GET`, `/<page>` on a `PUT`. */
|
|
241
|
+
export const MOCKUP_PAGE_CAPTURES_SUFFIX = "/captures";
|
|
242
|
+
|
|
256
243
|
/** Event of the state stream carrying a {@link MockupState}. */
|
|
257
244
|
export const MOCKUP_STATE_EVENT = "state";
|
|
258
245
|
|
|
246
|
+
/** Event of the state stream carrying the patch from the state the stream sent last to the state now. */
|
|
247
|
+
export const MOCKUP_PATCH_EVENT = "patch";
|
|
248
|
+
|
|
259
249
|
/** Event of the state stream carrying `{ annotations }`. */
|
|
260
250
|
export const MOCKUP_ANNOTATIONS_EVENT = "annotations";
|
|
261
251
|
|
|
@@ -301,14 +291,22 @@ function isOptionalString(value: Parameters<typeof isString>[0]): boolean {
|
|
|
301
291
|
return value === undefined || isString(value);
|
|
302
292
|
}
|
|
303
293
|
|
|
304
|
-
function isOptionalNumber(value: Parameters<typeof isNumber>[0]): boolean {
|
|
305
|
-
return value === undefined || isNumber(value);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
294
|
function isIssue(value: Parameters<typeof isObject>[0]): value is MockupIssue {
|
|
309
295
|
return isRecord(value) && isString(value.path) && isString(value.message);
|
|
310
296
|
}
|
|
311
297
|
|
|
298
|
+
function isWarning(
|
|
299
|
+
value: Parameters<typeof isObject>[0],
|
|
300
|
+
): value is MockupWarning {
|
|
301
|
+
return (
|
|
302
|
+
isRecord(value) &&
|
|
303
|
+
isString(value.path) &&
|
|
304
|
+
isString(value.message) &&
|
|
305
|
+
(value.fix === undefined || isString(value.fix)) &&
|
|
306
|
+
(value.block === undefined || isString(value.block))
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
312
310
|
/** Whether `value` is a section of the sidebar. */
|
|
313
311
|
export function isMockupCategory(
|
|
314
312
|
value: Parameters<typeof isObject>[0],
|
|
@@ -343,13 +341,32 @@ function hasPagePlace(value: Parameters<typeof isObject>[0]): boolean {
|
|
|
343
341
|
);
|
|
344
342
|
}
|
|
345
343
|
|
|
346
|
-
|
|
344
|
+
/** Whether a page's content reads right: its options, its tree and the real one, its fixtures, the live page it converts and the pointers of its paths. */
|
|
345
|
+
function hasPageContent(value: Parameters<typeof isObject>[0]): boolean {
|
|
346
|
+
return (
|
|
347
|
+
isRecord(value) &&
|
|
348
|
+
isRecord(value.options) &&
|
|
349
|
+
Array.isArray(value.tree) &&
|
|
350
|
+
isPreviewTree(value.tree) &&
|
|
351
|
+
(value.realTree === undefined ||
|
|
352
|
+
(Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
|
|
353
|
+
isOptionalString(value.fixtures) &&
|
|
354
|
+
(value.livePage === undefined ||
|
|
355
|
+
(isRecord(value.livePage) && isString(value.livePage.ref))) &&
|
|
356
|
+
isRecord(value.paths) &&
|
|
357
|
+
Object.values(value.paths).every((pointer) => isString(pointer))
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** Whether `value` is a page of a state, every field of it checked. */
|
|
362
|
+
export function isPageState(
|
|
347
363
|
value: Parameters<typeof isObject>[0],
|
|
348
364
|
): value is MockupPageState {
|
|
349
365
|
return (
|
|
350
366
|
isRecord(value) &&
|
|
351
367
|
isString(value.id) &&
|
|
352
368
|
isString(value.title) &&
|
|
369
|
+
isPagePlace(value.place) &&
|
|
353
370
|
isOptionalString(value.category) &&
|
|
354
371
|
hasPagePlace(value) &&
|
|
355
372
|
isPreviewHeader({
|
|
@@ -359,15 +376,7 @@ function isPageState(
|
|
|
359
376
|
actions: value.headerActions,
|
|
360
377
|
}) &&
|
|
361
378
|
(value.layout === undefined || isPreviewPageLayout(value.layout)) &&
|
|
362
|
-
|
|
363
|
-
Array.isArray(value.tree) &&
|
|
364
|
-
isPreviewTree(value.tree) &&
|
|
365
|
-
(value.realTree === undefined ||
|
|
366
|
-
(Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
|
|
367
|
-
(value.livePage === undefined ||
|
|
368
|
-
(isRecord(value.livePage) && isString(value.livePage.ref))) &&
|
|
369
|
-
isRecord(value.paths) &&
|
|
370
|
-
Object.values(value.paths).every((pointer) => isString(pointer))
|
|
379
|
+
hasPageContent(value)
|
|
371
380
|
);
|
|
372
381
|
}
|
|
373
382
|
|
|
@@ -394,14 +403,15 @@ function isSidebar(
|
|
|
394
403
|
);
|
|
395
404
|
}
|
|
396
405
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
): value is MockupModule {
|
|
406
|
+
/** Whether the parts of a state a spec may leave out are each absent or well-formed. */
|
|
407
|
+
function hasValidParts(value: Parameters<typeof isObject>[0]): boolean {
|
|
400
408
|
return (
|
|
401
409
|
isRecord(value) &&
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
410
|
+
(value.sidebar === undefined || isSidebar(value.sidebar)) &&
|
|
411
|
+
(value.modules === undefined || isMockupModules(value.modules)) &&
|
|
412
|
+
(value.entities === undefined || isMockupEntities(value.entities)) &&
|
|
413
|
+
(value.tenants === undefined || isMockupTenants(value.tenants)) &&
|
|
414
|
+
(value.settings === undefined || isMockupSettings(value.settings))
|
|
405
415
|
);
|
|
406
416
|
}
|
|
407
417
|
|
|
@@ -416,15 +426,14 @@ function isMockupState(
|
|
|
416
426
|
(value.categories === undefined ||
|
|
417
427
|
(Array.isArray(value.categories) &&
|
|
418
428
|
value.categories.every(isMockupCategory))) &&
|
|
419
|
-
(value
|
|
420
|
-
(value.
|
|
421
|
-
(Array.isArray(value.modules) && value.modules.every(isModule))) &&
|
|
429
|
+
hasValidParts(value) &&
|
|
430
|
+
isOptionalString(value.connection) &&
|
|
422
431
|
Array.isArray(value.pages) &&
|
|
423
432
|
value.pages.every(isPageState) &&
|
|
424
433
|
Array.isArray(value.issues) &&
|
|
425
434
|
value.issues.every(isIssue) &&
|
|
426
435
|
(value.warnings === undefined ||
|
|
427
|
-
(Array.isArray(value.warnings) && value.warnings.every(
|
|
436
|
+
(Array.isArray(value.warnings) && value.warnings.every(isWarning)))
|
|
428
437
|
);
|
|
429
438
|
}
|
|
430
439
|
|
|
@@ -435,67 +444,6 @@ export function parseMockupState(
|
|
|
435
444
|
return isMockupState(value) ? value : undefined;
|
|
436
445
|
}
|
|
437
446
|
|
|
438
|
-
function isAnchor(
|
|
439
|
-
value: Parameters<typeof isObject>[0],
|
|
440
|
-
): value is MockupNoteAnchor {
|
|
441
|
-
if (!isRecord(value)) return false;
|
|
442
|
-
if (value.block === undefined) return isString(value.page);
|
|
443
|
-
return (
|
|
444
|
-
isString(value.block) &&
|
|
445
|
-
Array.isArray(value.steps) &&
|
|
446
|
-
value.steps.every((step) => isString(step)) &&
|
|
447
|
-
isOptionalString(value.page)
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
function isFraction(value: Parameters<typeof isNumber>[0]): boolean {
|
|
452
|
-
return isNumber(value) && value >= 0 && value <= 1;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
function isOffset(
|
|
456
|
-
value: Parameters<typeof isObject>[0],
|
|
457
|
-
): value is MockupPinOffset {
|
|
458
|
-
return isRecord(value) && isFraction(value.x) && isFraction(value.y);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
function isAnnotation(
|
|
462
|
-
value: Parameters<typeof isObject>[0],
|
|
463
|
-
): value is MockupAnnotation {
|
|
464
|
-
return (
|
|
465
|
-
isRecord(value) &&
|
|
466
|
-
isString(value.id) &&
|
|
467
|
-
isAnchor(value.anchor) &&
|
|
468
|
-
isOffset(value.offset) &&
|
|
469
|
-
isOptionalString(value.page) &&
|
|
470
|
-
isOptionalString(value.path) &&
|
|
471
|
-
isString(value.text) &&
|
|
472
|
-
(value.status === "open" || value.status === "resolved") &&
|
|
473
|
-
isString(value.createdAt) &&
|
|
474
|
-
isOptionalString(value.resolvedAt) &&
|
|
475
|
-
isOptionalNumber(value.version) &&
|
|
476
|
-
isOptionalNumber(value.resolvedVersion) &&
|
|
477
|
-
isOptionalString(value.state)
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/** The annotation a `POST` or `PATCH` answers, or undefined when the answer is not one. */
|
|
482
|
-
export function parseAnnotation(
|
|
483
|
-
value: Parameters<typeof isObject>[0],
|
|
484
|
-
): MockupAnnotation | undefined {
|
|
485
|
-
return isAnnotation(value) ? value : undefined;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
/** The annotations of an `{ annotations }` answer or event, or undefined when it is not one. */
|
|
489
|
-
export function parseAnnotations(
|
|
490
|
-
value: Parameters<typeof isObject>[0],
|
|
491
|
-
): MockupAnnotation[] | undefined {
|
|
492
|
-
if (!isRecord(value)) return undefined;
|
|
493
|
-
const { annotations } = value;
|
|
494
|
-
return Array.isArray(annotations) && annotations.every(isAnnotation)
|
|
495
|
-
? annotations
|
|
496
|
-
: undefined;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
447
|
function isSource(
|
|
500
448
|
value: Parameters<typeof isString>[0],
|
|
501
449
|
): value is MockupSource {
|
|
@@ -593,14 +541,3 @@ export function layoutPathFor(
|
|
|
593
541
|
): string | undefined {
|
|
594
542
|
return Object.entries(page.paths).find(([, at]) => at === pointer)?.[0];
|
|
595
543
|
}
|
|
596
|
-
|
|
597
|
-
/** `annotation` with the answer of a `PATCH` or `POST` merged into `list`, newest last. */
|
|
598
|
-
export function upsertAnnotation(
|
|
599
|
-
list: readonly MockupAnnotation[],
|
|
600
|
-
annotation: MockupAnnotation,
|
|
601
|
-
): MockupAnnotation[] {
|
|
602
|
-
const exists = list.some((entry) => entry.id === annotation.id);
|
|
603
|
-
return exists
|
|
604
|
-
? list.map((entry) => (entry.id === annotation.id ? annotation : entry))
|
|
605
|
-
: [...list, annotation];
|
|
606
|
-
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** How long the page view's frame takes to fade in over the image of the page it draws, in milliseconds. */
|
|
2
|
+
export const ACTIVATION_FADE_MS = 150;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What the page view shows of the page being opened. The frame is `idle`
|
|
6
|
+
* while the Overview shows, and `rendering` from the moment a page is opened
|
|
7
|
+
* from the Overview, where the frame holds a page that is no longer current,
|
|
8
|
+
* until the frame acknowledged that page's render drawn, during which the
|
|
9
|
+
* page's capture, when it has one, shows in the frame's place and the frame
|
|
10
|
+
* itself is not seen. It is `drawn` from then. A page opened while another is
|
|
11
|
+
* drawn in the same document is `swapping`: the frame keeps showing the page
|
|
12
|
+
* it drew, in full, until it acknowledged the new page's render drawn, so the
|
|
13
|
+
* switch is invisible. A new document has drawn nothing yet, so a page opened
|
|
14
|
+
* in one renders.
|
|
15
|
+
*/
|
|
16
|
+
export type Activation =
|
|
17
|
+
| { phase: "idle" }
|
|
18
|
+
| { phase: "rendering" | "swapping" | "drawn"; scope: string; document: string };
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* What moves the page view from one {@link Activation} to the next: a page is
|
|
22
|
+
* opened, or what the frame draws changed (`open`, which `scope` names, in the
|
|
23
|
+
* frame's `document`, the URL it loads); the
|
|
24
|
+
* frame acknowledged the render of the page `scope` names drawn (`drawn`); the
|
|
25
|
+
* Overview shows again (`close`).
|
|
26
|
+
*/
|
|
27
|
+
export type ActivationEvent =
|
|
28
|
+
| { type: "open"; scope: string; document: string }
|
|
29
|
+
| { type: "drawn"; scope: string }
|
|
30
|
+
| { type: "close" };
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The identity of what the page view's frame draws: the page, the tenant it
|
|
34
|
+
* is drawn for and whether it reads real data. A render of the same scope
|
|
35
|
+
* redraws the page in place, so it fades nothing; another scope draws
|
|
36
|
+
* something else, which the frame shows once it acknowledged that render.
|
|
37
|
+
*/
|
|
38
|
+
export function activationScope(
|
|
39
|
+
page: string,
|
|
40
|
+
tenant: string | undefined,
|
|
41
|
+
realData: boolean,
|
|
42
|
+
): string {
|
|
43
|
+
return JSON.stringify([page, tenant ?? null, realData]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The activation after `event`. Opening the scope already open leaves it as
|
|
48
|
+
* it is. Opening another from the Overview, or while one renders, renders it;
|
|
49
|
+
* opening another while a page is drawn or swapping swaps it in, so the page
|
|
50
|
+
* on screen stays until the new one is drawn. Either way only the render of
|
|
51
|
+
* the new scope draws the page. An acknowledgment of another scope than the
|
|
52
|
+
* one rendering or swapping, or while nothing does, changes nothing.
|
|
53
|
+
*/
|
|
54
|
+
export function nextActivation(
|
|
55
|
+
state: Activation,
|
|
56
|
+
event: ActivationEvent,
|
|
57
|
+
): Activation {
|
|
58
|
+
switch (event.type) {
|
|
59
|
+
case "open":
|
|
60
|
+
if (
|
|
61
|
+
state.phase !== "idle" &&
|
|
62
|
+
state.scope === event.scope &&
|
|
63
|
+
state.document === event.document
|
|
64
|
+
)
|
|
65
|
+
return state;
|
|
66
|
+
return {
|
|
67
|
+
phase:
|
|
68
|
+
state.phase !== "idle" &&
|
|
69
|
+
state.phase !== "rendering" &&
|
|
70
|
+
state.document === event.document
|
|
71
|
+
? "swapping"
|
|
72
|
+
: "rendering",
|
|
73
|
+
scope: event.scope,
|
|
74
|
+
document: event.document,
|
|
75
|
+
};
|
|
76
|
+
case "drawn":
|
|
77
|
+
return (state.phase === "rendering" || state.phase === "swapping") &&
|
|
78
|
+
state.scope === event.scope
|
|
79
|
+
? { ...state, phase: "drawn" }
|
|
80
|
+
: state;
|
|
81
|
+
case "close":
|
|
82
|
+
return { phase: "idle" };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The scope the module store is drawn under, as an activation and as a
|
|
88
|
+
* render: it is no page, so no page's capture shows in its place, and every
|
|
89
|
+
* render of it is the same, its tree being empty.
|
|
90
|
+
*/
|
|
91
|
+
export const STORE_SCOPE = JSON.stringify(["module-store"]);
|
|
92
|
+
|
|
93
|
+
/** What {@link renderAcknowledgments} tells an activation. */
|
|
94
|
+
export interface RenderAcknowledgments {
|
|
95
|
+
/** A render of the scope `scope` was posted to the frame, for the activation `activation` names. */
|
|
96
|
+
posted: (activation: string, scope: string) => void;
|
|
97
|
+
/** The frame says it drew the render of the scope `scope`. */
|
|
98
|
+
drawn: (scope: string) => void;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Turns what the frame acknowledges, the scope of a render it drew, into the
|
|
103
|
+
* activation that render belongs to, which `onDrawn` is told. Only the render
|
|
104
|
+
* posted last counts: the acknowledgment of one the frame was handed before
|
|
105
|
+
* it, which names another scope, tells nothing, so a page that was open
|
|
106
|
+
* before never shows the frame of the page opened after it.
|
|
107
|
+
*/
|
|
108
|
+
export function renderAcknowledgments(
|
|
109
|
+
onDrawn: (activation: string) => void,
|
|
110
|
+
): RenderAcknowledgments {
|
|
111
|
+
let last: { activation: string; scope: string } | undefined;
|
|
112
|
+
return {
|
|
113
|
+
posted: (activation, scope) => {
|
|
114
|
+
last = { activation, scope };
|
|
115
|
+
},
|
|
116
|
+
drawn: (scope) => {
|
|
117
|
+
if (last?.scope === scope) onDrawn(last.activation);
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { isObject } from "../../../../dms-core/app/utils/type-check";
|
|
2
|
+
import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
|
|
3
|
+
import { isOptionalString, isRecord } from "./recordGuards";
|
|
4
|
+
|
|
5
|
+
export type MockupAnnotationStatus = "open" | "resolved";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The block a note is about: the node whose id is `block`, on the page `page`
|
|
9
|
+
* when set, then the children whose ids are `steps`.
|
|
10
|
+
*/
|
|
11
|
+
export interface MockupBlockAnchor {
|
|
12
|
+
block: string;
|
|
13
|
+
steps: string[];
|
|
14
|
+
page?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** What a note is on: a block, or the page `page` as a whole. */
|
|
18
|
+
export type MockupNoteAnchor = MockupBlockAnchor | { page: string };
|
|
19
|
+
|
|
20
|
+
/** Where a pin sits on its block or page: fractions of its box, from its top left corner. */
|
|
21
|
+
export interface MockupPinOffset {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A reviewer's pin. `page` and `path` are where it is now: both on a block,
|
|
28
|
+
* `page` alone on a page, neither when its block or page was removed.
|
|
29
|
+
* `version` is the number of the history version it was pinned on, and
|
|
30
|
+
* `resolvedVersion` the one it was resolved on.
|
|
31
|
+
*/
|
|
32
|
+
export interface MockupAnnotation {
|
|
33
|
+
id: string;
|
|
34
|
+
anchor: MockupNoteAnchor;
|
|
35
|
+
offset: MockupPinOffset;
|
|
36
|
+
page?: string;
|
|
37
|
+
/** Spec JSON pointer of the note's block now. */
|
|
38
|
+
path?: string;
|
|
39
|
+
text: string;
|
|
40
|
+
status: MockupAnnotationStatus;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
resolvedAt?: string;
|
|
43
|
+
version?: number;
|
|
44
|
+
resolvedVersion?: number;
|
|
45
|
+
/** The state of the sketch the note was pinned on; absent on its own `html` and on any other block. */
|
|
46
|
+
state?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Where a pin is put: on the node at `path` of page `page`, or on the page
|
|
51
|
+
* itself without `path`, and the state of the sketch drawn there.
|
|
52
|
+
*/
|
|
53
|
+
export interface MockupPinPlace {
|
|
54
|
+
page: string;
|
|
55
|
+
path?: string;
|
|
56
|
+
offset: MockupPinOffset;
|
|
57
|
+
state?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** What `POST /api/mockup/:name/annotations` takes. */
|
|
61
|
+
export interface MockupAnnotationDraft extends MockupPinPlace {
|
|
62
|
+
text: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** What `PATCH /api/mockup/:name/annotations/:id` takes. */
|
|
66
|
+
export interface MockupAnnotationPatch {
|
|
67
|
+
status?: MockupAnnotationStatus;
|
|
68
|
+
text?: string;
|
|
69
|
+
place?: MockupPinPlace;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function isOptionalNumber(value: Parameters<typeof isNumber>[0]): boolean {
|
|
73
|
+
return value === undefined || isNumber(value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isAnchor(
|
|
77
|
+
value: Parameters<typeof isObject>[0],
|
|
78
|
+
): value is MockupNoteAnchor {
|
|
79
|
+
if (!isRecord(value)) return false;
|
|
80
|
+
if (value.block === undefined) return isString(value.page);
|
|
81
|
+
return (
|
|
82
|
+
isString(value.block) &&
|
|
83
|
+
Array.isArray(value.steps) &&
|
|
84
|
+
value.steps.every((step) => isString(step)) &&
|
|
85
|
+
isOptionalString(value.page)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function isFraction(value: Parameters<typeof isNumber>[0]): boolean {
|
|
90
|
+
return isNumber(value) && value >= 0 && value <= 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function isOffset(
|
|
94
|
+
value: Parameters<typeof isObject>[0],
|
|
95
|
+
): value is MockupPinOffset {
|
|
96
|
+
return isRecord(value) && isFraction(value.x) && isFraction(value.y);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function isAnnotation(
|
|
100
|
+
value: Parameters<typeof isObject>[0],
|
|
101
|
+
): value is MockupAnnotation {
|
|
102
|
+
return (
|
|
103
|
+
isRecord(value) &&
|
|
104
|
+
isString(value.id) &&
|
|
105
|
+
isAnchor(value.anchor) &&
|
|
106
|
+
isOffset(value.offset) &&
|
|
107
|
+
isOptionalString(value.page) &&
|
|
108
|
+
isOptionalString(value.path) &&
|
|
109
|
+
isString(value.text) &&
|
|
110
|
+
(value.status === "open" || value.status === "resolved") &&
|
|
111
|
+
isString(value.createdAt) &&
|
|
112
|
+
isOptionalString(value.resolvedAt) &&
|
|
113
|
+
isOptionalNumber(value.version) &&
|
|
114
|
+
isOptionalNumber(value.resolvedVersion) &&
|
|
115
|
+
isOptionalString(value.state)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The annotation a `POST` or `PATCH` answers, or undefined when the answer is not one. */
|
|
120
|
+
export function parseAnnotation(
|
|
121
|
+
value: Parameters<typeof isObject>[0],
|
|
122
|
+
): MockupAnnotation | undefined {
|
|
123
|
+
return isAnnotation(value) ? value : undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The annotations of an `{ annotations }` answer or event, or undefined when it is not one. */
|
|
127
|
+
export function parseAnnotations(
|
|
128
|
+
value: Parameters<typeof isObject>[0],
|
|
129
|
+
): MockupAnnotation[] | undefined {
|
|
130
|
+
if (!isRecord(value)) return undefined;
|
|
131
|
+
const { annotations } = value;
|
|
132
|
+
return Array.isArray(annotations) && annotations.every(isAnnotation)
|
|
133
|
+
? annotations
|
|
134
|
+
: undefined;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** `annotation` with the answer of a `PATCH` or `POST` merged into `list`, newest last. */
|
|
138
|
+
export function upsertAnnotation(
|
|
139
|
+
list: readonly MockupAnnotation[],
|
|
140
|
+
annotation: MockupAnnotation,
|
|
141
|
+
): MockupAnnotation[] {
|
|
142
|
+
const exists = list.some((entry) => entry.id === annotation.id);
|
|
143
|
+
return exists
|
|
144
|
+
? list.map((entry) => (entry.id === annotation.id ? annotation : entry))
|
|
145
|
+
: [...list, annotation];
|
|
146
|
+
}
|