@antelopejs/dms 0.25.8-next.1175.g5f8cc4d → 0.25.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +2 -2
- package/data/mockup-example/spec.json +0 -11
- package/data/mockup-spec.schema.json +16 -399
- package/dist/e2e/index.d.mts +1 -2
- package/dist/implementations/dms-builder/engine/table-view-settings.js +33 -9
- package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +0 -2
- package/dist/mcp/index.js +0 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +0 -15
- package/dist/mcp/page-verify/index.js +6 -16
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +1 -3
- package/dist/mcp/page-verify/mockup.js +1 -5
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/page-probe.d.ts +0 -5
- package/dist/mcp/page-verify/page-probe.js +0 -2
- package/dist/mcp/page-verify/page-probe.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +4 -22
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/page-verify/report.d.ts +0 -1
- package/dist/mcp/tools/mockup-read-spec.js +3 -2
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup.js +0 -4
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +0 -1
- package/dist/mcp/tools/page-verify.js +2 -6
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mockup/annotations.js +2 -2
- package/dist/mockup/annotations.js.map +1 -1
- package/dist/mockup/apply-notes.js +1 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/compile.d.ts +10 -6
- package/dist/mockup/compile.js +290 -31
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -2
- package/dist/mockup/files.js +1 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixture-answers.d.ts +0 -1
- package/dist/mockup/fixture-answers.js +1 -1
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +27 -0
- package/dist/mockup/fixtures.js +111 -0
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/from-page.js +9 -2
- package/dist/mockup/from-page.js.map +1 -1
- package/dist/mockup/generate.js +1 -4
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +4 -2
- package/dist/mockup/history-routes.js +36 -27
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/history.js +1 -2
- package/dist/mockup/history.js.map +1 -1
- package/dist/mockup/index.d.ts +0 -10
- package/dist/mockup/index.js +0 -10
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-layout.d.ts +0 -1
- package/dist/mockup/json-schema-layout.js +2 -95
- package/dist/mockup/json-schema-layout.js.map +1 -1
- package/dist/mockup/json-schema.js +19 -40
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/manage-routes.d.ts +1 -3
- package/dist/mockup/manage-routes.js +1 -38
- package/dist/mockup/manage-routes.js.map +1 -1
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/model.d.ts +100 -137
- package/dist/mockup/model.js +86 -102
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +9 -6
- package/dist/mockup/modules.js +24 -105
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/presence-board.js +1 -1
- package/dist/mockup/presence-board.js.map +1 -1
- package/dist/mockup/presence-routes.js +2 -2
- package/dist/mockup/presence-routes.js.map +1 -1
- package/dist/mockup/refusals.d.ts +0 -5
- package/dist/mockup/refusals.js +0 -16
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +5 -3
- package/dist/mockup/routes.js +162 -19
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/row-filters.d.ts +8 -0
- package/dist/mockup/row-filters.js +107 -0
- package/dist/mockup/row-filters.js.map +1 -0
- package/dist/mockup/sketch-limits.d.ts +0 -1
- package/dist/mockup/sketch-limits.js +1 -2
- package/dist/mockup/sketch-limits.js.map +1 -1
- package/dist/mockup/sketch.d.ts +2 -2
- package/dist/mockup/sketch.js +1 -2
- package/dist/mockup/sketch.js.map +1 -1
- package/dist/mockup/source-routes.d.ts +4 -5
- package/dist/mockup/source-routes.js +17 -26
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.js +1 -2
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/store.d.ts +37 -16
- package/dist/mockup/store.js +200 -85
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-archive.d.ts +1 -0
- package/dist/mockup/table-archive.js +16 -0
- package/dist/mockup/table-archive.js.map +1 -1
- package/e2e/index.mjs +2 -3
- package/frontend-vue/eslint-globals.generated.mjs +38 -40
- package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +31 -3
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +2 -8
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -3
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -110
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +6 -21
- package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +7 -19
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +9 -79
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +4 -17
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +0 -12
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +0 -39
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +2 -12
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +1 -9
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +6 -53
- package/frontend-vue/layers/dms-layout/app/theme/actions.ts +7 -11
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +5 -31
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +47 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +33 -59
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -58
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/{MockupZoomControls.vue → MockupOverviewZoom.vue} +15 -23
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +0 -21
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +9 -77
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +45 -130
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +3 -70
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +4 -44
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +2 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +36 -256
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +1 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +5 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +23 -50
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +29 -82
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +3 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +14 -60
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +7 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +8 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +2 -13
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +10 -39
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +0 -41
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +3 -37
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +1 -20
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +103 -167
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -22
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +173 -75
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +9 -118
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +8 -123
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +3 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +5 -18
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +6 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +2 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +0 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +6 -108
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +1 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +10 -40
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -23
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -2
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +4 -53
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +4 -53
- package/frontend-vue/package.json +2 -2
- package/package.json +5 -6
- package/E2E.md +0 -138
- package/dist/mcp/mockup-export/capture.d.ts +0 -19
- package/dist/mcp/mockup-export/capture.js +0 -99
- package/dist/mcp/mockup-export/capture.js.map +0 -1
- package/dist/mcp/mockup-export/document.d.ts +0 -4
- package/dist/mcp/mockup-export/document.js +0 -199
- package/dist/mcp/mockup-export/document.js.map +0 -1
- package/dist/mcp/mockup-export/index.d.ts +0 -20
- package/dist/mcp/mockup-export/index.js +0 -110
- package/dist/mcp/mockup-export/index.js.map +0 -1
- package/dist/mcp/mockup-export/jobs.d.ts +0 -32
- package/dist/mcp/mockup-export/jobs.js +0 -49
- package/dist/mcp/mockup-export/jobs.js.map +0 -1
- package/dist/mcp/mockup-export/plan.d.ts +0 -78
- package/dist/mcp/mockup-export/plan.js +0 -292
- package/dist/mcp/mockup-export/plan.js.map +0 -1
- package/dist/mcp/mockup-export/route.d.ts +0 -23
- package/dist/mcp/mockup-export/route.js +0 -91
- package/dist/mcp/mockup-export/route.js.map +0 -1
- package/dist/mcp/page-verify/modules.d.ts +0 -8
- package/dist/mcp/page-verify/modules.js +0 -49
- package/dist/mcp/page-verify/modules.js.map +0 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +0 -1
- package/dist/mcp/tools/mockup-export-pdf.js +0 -69
- package/dist/mcp/tools/mockup-export-pdf.js.map +0 -1
- package/dist/mcp/tools/mockup-module-catalog.d.ts +0 -1
- package/dist/mcp/tools/mockup-module-catalog.js +0 -36
- package/dist/mcp/tools/mockup-module-catalog.js.map +0 -1
- package/dist/mockup/compile-layouts.d.ts +0 -5
- package/dist/mockup/compile-layouts.js +0 -74
- package/dist/mockup/compile-layouts.js.map +0 -1
- package/dist/mockup/compile-nodes.d.ts +0 -11
- package/dist/mockup/compile-nodes.js +0 -119
- package/dist/mockup/compile-nodes.js.map +0 -1
- package/dist/mockup/compile-pages.d.ts +0 -18
- package/dist/mockup/compile-pages.js +0 -189
- package/dist/mockup/compile-pages.js.map +0 -1
- package/dist/mockup/create.d.ts +0 -16
- package/dist/mockup/create.js +0 -78
- package/dist/mockup/create.js.map +0 -1
- package/dist/mockup/created-watch.d.ts +0 -18
- package/dist/mockup/created-watch.js +0 -110
- package/dist/mockup/created-watch.js.map +0 -1
- package/dist/mockup/entities.d.ts +0 -20
- package/dist/mockup/entities.js +0 -213
- package/dist/mockup/entities.js.map +0 -1
- package/dist/mockup/etag.d.ts +0 -1
- package/dist/mockup/etag.js +0 -10
- package/dist/mockup/etag.js.map +0 -1
- package/dist/mockup/extensions.d.ts +0 -18
- package/dist/mockup/extensions.js +0 -61
- package/dist/mockup/extensions.js.map +0 -1
- package/dist/mockup/fixture-batch.d.ts +0 -21
- package/dist/mockup/fixture-batch.js +0 -111
- package/dist/mockup/fixture-batch.js.map +0 -1
- package/dist/mockup/fixture-routes.d.ts +0 -21
- package/dist/mockup/fixture-routes.js +0 -136
- package/dist/mockup/fixture-routes.js.map +0 -1
- package/dist/mockup/json-schema-entities.d.ts +0 -5
- package/dist/mockup/json-schema-entities.js +0 -141
- package/dist/mockup/json-schema-entities.js.map +0 -1
- package/dist/mockup/json.d.ts +0 -8
- package/dist/mockup/json.js +0 -20
- package/dist/mockup/json.js.map +0 -1
- package/dist/mockup/layout-model.d.ts +0 -156
- package/dist/mockup/layout-model.js +0 -96
- package/dist/mockup/layout-model.js.map +0 -1
- package/dist/mockup/layouts.d.ts +0 -9
- package/dist/mockup/layouts.js +0 -40
- package/dist/mockup/layouts.js.map +0 -1
- package/dist/mockup/module-manifests.d.ts +0 -99
- package/dist/mockup/module-manifests.js +0 -95
- package/dist/mockup/module-manifests.js.map +0 -1
- package/dist/mockup/module-states.d.ts +0 -10
- package/dist/mockup/module-states.js +0 -85
- package/dist/mockup/module-states.js.map +0 -1
- package/dist/mockup/modules-schema.d.ts +0 -2
- package/dist/mockup/modules-schema.js +0 -39
- package/dist/mockup/modules-schema.js.map +0 -1
- package/dist/mockup/page-capture-routes.d.ts +0 -19
- package/dist/mockup/page-capture-routes.js +0 -92
- package/dist/mockup/page-capture-routes.js.map +0 -1
- package/dist/mockup/page-captures.d.ts +0 -61
- package/dist/mockup/page-captures.js +0 -252
- package/dist/mockup/page-captures.js.map +0 -1
- package/dist/mockup/parse-spec.d.ts +0 -10
- package/dist/mockup/parse-spec.js +0 -62
- package/dist/mockup/parse-spec.js.map +0 -1
- package/dist/mockup/places.d.ts +0 -17
- package/dist/mockup/places.js +0 -75
- package/dist/mockup/places.js.map +0 -1
- package/dist/mockup/slug.d.ts +0 -3
- package/dist/mockup/slug.js +0 -7
- package/dist/mockup/slug.js.map +0 -1
- package/dist/mockup/state-patch.d.ts +0 -22
- package/dist/mockup/state-patch.js +0 -75
- package/dist/mockup/state-patch.js.map +0 -1
- package/dist/mockup/state.d.ts +0 -112
- package/dist/mockup/state.js +0 -22
- package/dist/mockup/state.js.map +0 -1
- package/dist/mockup/store-list.d.ts +0 -28
- package/dist/mockup/store-list.js +0 -89
- package/dist/mockup/store-list.js.map +0 -1
- package/dist/mockup/tenancy.d.ts +0 -19
- package/dist/mockup/tenancy.js +0 -73
- package/dist/mockup/tenancy.js.map +0 -1
- package/dist/mockup/tenant-rows.d.ts +0 -4
- package/dist/mockup/tenant-rows.js +0 -19
- package/dist/mockup/tenant-rows.js.map +0 -1
- package/frontend-vue/layers/dms-core/app/utils/localFetchAnswers.ts +0 -124
- package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +0 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupWidgets.ts +0 -65
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +0 -153
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +0 -23
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +0 -164
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +0 -51
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReconnecting.vue +0 -17
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +0 -48
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +0 -142
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useFixtureBatches.ts +0 -154
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +0 -157
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +0 -165
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +0 -126
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +0 -138
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +0 -124
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +0 -37
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +0 -56
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +0 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +0 -151
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +0 -130
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +0 -332
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +0 -100
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +0 -146
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +0 -80
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +0 -171
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +0 -138
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +0 -66
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +0 -177
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +0 -179
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +0 -143
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +0 -23
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +0 -156
- package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +0 -400
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +0 -15
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +0 -2
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useFixtureBatches.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupRoutePage.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePersistedCaptures.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupStatePatch.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewFixtureAnswers.ts +0 -1
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +0 -1
|
@@ -10,11 +10,9 @@ import {
|
|
|
10
10
|
import { useResizeObserver, useTimeoutFn } from "@vueuse/core";
|
|
11
11
|
import { isReducedMotionActive } from "../../../utils/reducedMotion";
|
|
12
12
|
import type { PreviewBlockRect } from "../../utils/blockPreviewMessages";
|
|
13
|
-
import { sameBlockRects } from "../../utils/blockPreviewRects";
|
|
14
13
|
import type {
|
|
15
14
|
MockupCategory,
|
|
16
15
|
MockupDataMode,
|
|
17
|
-
MockupModule,
|
|
18
16
|
MockupPageState,
|
|
19
17
|
} from "../../utils/mockup";
|
|
20
18
|
import {
|
|
@@ -32,18 +30,14 @@ import {
|
|
|
32
30
|
wantedLivePages,
|
|
33
31
|
zoomAt,
|
|
34
32
|
zoomFloor,
|
|
35
|
-
ZOOM_STEP,
|
|
36
33
|
type OverviewCamera,
|
|
37
34
|
type OverviewFrame,
|
|
38
35
|
type OverviewSectionLabel,
|
|
39
36
|
type ViewportPoint,
|
|
40
37
|
type ViewportSize,
|
|
41
38
|
} from "../../utils/mockupOverview";
|
|
42
|
-
import {
|
|
43
|
-
type OverviewSectionTitle,
|
|
44
|
-
overviewSections,
|
|
45
|
-
} from "../../utils/mockupOverviewSections";
|
|
46
39
|
import type { PagePoint, PinCanvas } from "../../utils/mockupPins";
|
|
40
|
+
import { groupSections } from "../../utils/mockupSections";
|
|
47
41
|
import { pageForest } from "../../utils/mockupPageTree";
|
|
48
42
|
import type { ClientPoint } from "./useMockupPins";
|
|
49
43
|
import {
|
|
@@ -60,6 +54,9 @@ const FIT_PADDING_PX = 56;
|
|
|
60
54
|
/** The room a fit keeps once the frames sit under section titles, which stand above their pages' titles. */
|
|
61
55
|
const SECTIONED_FIT_PADDING_PX = 96;
|
|
62
56
|
|
|
57
|
+
/** How much one step of the zoom buttons zooms. */
|
|
58
|
+
const ZOOM_STEP = 1.5;
|
|
59
|
+
|
|
63
60
|
/** How long the camera eases to where a control sent it. */
|
|
64
61
|
const EASE_MS = 220;
|
|
65
62
|
|
|
@@ -85,10 +82,11 @@ interface OverviewOptions {
|
|
|
85
82
|
categories: ComputedRef<readonly MockupCategory[]>;
|
|
86
83
|
/** The developer's Real data choice, if any: each page draws, and is captured, by it. */
|
|
87
84
|
dataMode: Readonly<Ref<MockupDataMode | undefined>>;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** What labels a section's row: its category, none for the default section. */
|
|
88
|
+
export interface OverviewSectionTitle {
|
|
89
|
+
category?: MockupCategory;
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
/** The overview of every page of the mockup: where each frame sits, where the camera looks, and which frames are drawn live. */
|
|
@@ -109,10 +107,6 @@ export interface MockupOverview {
|
|
|
109
107
|
pick: (page: string | undefined) => void;
|
|
110
108
|
/** Whether the camera is moving: from a move until it has been still for a while. Live frames neither change page nor are captured meanwhile. */
|
|
111
109
|
isMoving: Readonly<Ref<boolean>>;
|
|
112
|
-
/** Whether the overview is on screen: while it is not, it holds its slots and does no work. */
|
|
113
|
-
isOpen: Readonly<Ref<boolean>>;
|
|
114
|
-
/** Whether the mockup has pages, every page has an image current for it or gave up on one, and the server's captures were read: nothing is left to draw live. */
|
|
115
|
-
isSettled: ComputedRef<boolean>;
|
|
116
110
|
/** The key each page's capture is current for, by page id. */
|
|
117
111
|
captureKeys: ComputedRef<ReadonlyMap<string, string>>;
|
|
118
112
|
/** The image each page's live frame drew, by page id, current or out of date. */
|
|
@@ -207,8 +201,7 @@ function useViewport() {
|
|
|
207
201
|
size,
|
|
208
202
|
hasSize: computed(() => size.value.width > 0 && size.value.height > 0),
|
|
209
203
|
attach: (next: Element | null) => {
|
|
210
|
-
element.value =
|
|
211
|
-
next !== null && next instanceof HTMLElement ? next : undefined;
|
|
204
|
+
element.value = next instanceof HTMLElement ? next : undefined;
|
|
212
205
|
},
|
|
213
206
|
middle: (): ViewportPoint => ({
|
|
214
207
|
x: size.value.width / 2,
|
|
@@ -239,25 +232,19 @@ function usePageReports(options: OverviewOptions) {
|
|
|
239
232
|
);
|
|
240
233
|
const layout = computed(() => {
|
|
241
234
|
const categories = options.categories.value;
|
|
235
|
+
const isSectioned = categories.length > 0;
|
|
242
236
|
const forest = pageForest(pages.value, {
|
|
243
237
|
idOf: (page) => page.id,
|
|
244
238
|
parentOf: (page) => page.parent,
|
|
245
239
|
});
|
|
246
|
-
const sections =
|
|
240
|
+
const sections = groupSections(
|
|
247
241
|
categories,
|
|
248
|
-
options.modules.value,
|
|
249
242
|
forest.roots,
|
|
243
|
+
(page) => page.category,
|
|
250
244
|
);
|
|
251
|
-
const isSectioned =
|
|
252
|
-
categories.length > 0 ||
|
|
253
|
-
sections.some(
|
|
254
|
-
(section) =>
|
|
255
|
-
section.title.module !== undefined ||
|
|
256
|
-
section.title.isSettings === true,
|
|
257
|
-
);
|
|
258
245
|
return layoutSections<OverviewSectionTitle>(
|
|
259
246
|
sections.map((section) => ({
|
|
260
|
-
...(isSectioned && { label: section.
|
|
247
|
+
...(isSectioned && { label: { category: section.category } }),
|
|
261
248
|
pages: section.pages
|
|
262
249
|
.flatMap((page) => [
|
|
263
250
|
page,
|
|
@@ -288,9 +275,7 @@ function usePageReports(options: OverviewOptions) {
|
|
|
288
275
|
if (height !== undefined && heights.value.get(page) !== height) {
|
|
289
276
|
heights.value = new Map(heights.value).set(page, height);
|
|
290
277
|
}
|
|
291
|
-
if (blocks
|
|
292
|
-
layouts.value = new Map(layouts.value).set(page, blocks);
|
|
293
|
-
}
|
|
278
|
+
if (blocks) layouts.value = new Map(layouts.value).set(page, blocks);
|
|
294
279
|
}
|
|
295
280
|
return {
|
|
296
281
|
frames,
|
|
@@ -319,14 +304,10 @@ interface LiveSlotPages {
|
|
|
319
304
|
* thread, so the pool grows by one iframe at a time, once every iframe it
|
|
320
305
|
* has booted: the page nearest the middle draws first, and the canvas keeps
|
|
321
306
|
* answering while the others boot. Each page draws once, is captured, and
|
|
322
|
-
* keeps that image for as long as it is not drawn live.
|
|
323
|
-
* slot before the server's captures were read, or failed to be, so a page
|
|
324
|
-
* whose capture the server holds boots no iframe. While the camera
|
|
307
|
+
* keeps that image for as long as it is not drawn live. While the camera
|
|
325
308
|
* moves, the slots stay as they are, since an iframe drawing another page or
|
|
326
309
|
* booting holds the main thread for a whole frame or more; they follow the
|
|
327
|
-
* camera once it rests.
|
|
328
|
-
* slots stay as they are too, iframes booted and all, so coming back to the
|
|
329
|
-
* overview draws no boot; they follow the camera again once it opens.
|
|
310
|
+
* camera once it rests.
|
|
330
311
|
*/
|
|
331
312
|
function useLiveSlots(
|
|
332
313
|
isOpen: Readonly<Ref<boolean>>,
|
|
@@ -349,12 +330,14 @@ function useLiveSlots(
|
|
|
349
330
|
captured.captures,
|
|
350
331
|
captured.keys,
|
|
351
332
|
captured.failed,
|
|
352
|
-
captured.isSettled,
|
|
353
333
|
],
|
|
354
334
|
() => {
|
|
355
|
-
if (!isOpen.value)
|
|
335
|
+
if (!isOpen.value) {
|
|
336
|
+
if (slots.value.length) slots.value = [];
|
|
337
|
+
if (booted.value.size) booted.value = new Set();
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
356
340
|
if (!viewport.hasSize.value || isMoving.value) return;
|
|
357
|
-
if (!captured.isSettled.value) return;
|
|
358
341
|
const wanted = wantedLivePages({
|
|
359
342
|
frames: frames.value,
|
|
360
343
|
camera: camera.value,
|
|
@@ -375,7 +358,7 @@ function useLiveSlots(
|
|
|
375
358
|
return {
|
|
376
359
|
slots,
|
|
377
360
|
booted: (slot: number) => {
|
|
378
|
-
if (!booted.value.has(slot)) {
|
|
361
|
+
if (isOpen.value && !booted.value.has(slot)) {
|
|
379
362
|
booted.value = new Set(booted.value).add(slot);
|
|
380
363
|
}
|
|
381
364
|
},
|
|
@@ -533,16 +516,6 @@ export function useMockupOverview(options: OverviewOptions): MockupOverview {
|
|
|
533
516
|
picked.value = page;
|
|
534
517
|
},
|
|
535
518
|
isMoving,
|
|
536
|
-
isOpen,
|
|
537
|
-
isSettled: computed(
|
|
538
|
-
() =>
|
|
539
|
-
captured.isSettled.value &&
|
|
540
|
-
frames.value.length > 0 &&
|
|
541
|
-
frames.value.every(({ id }) => {
|
|
542
|
-
const key = captured.keys.value.get(id);
|
|
543
|
-
return key === undefined || !captured.needsCapture(id, key);
|
|
544
|
-
}),
|
|
545
|
-
),
|
|
546
519
|
captureKeys: captured.keys,
|
|
547
520
|
captures: captured.captures,
|
|
548
521
|
needsCapture: captured.needsCapture,
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts
CHANGED
|
@@ -9,21 +9,17 @@ import type {
|
|
|
9
9
|
MockupState,
|
|
10
10
|
MockupWidth,
|
|
11
11
|
} from "../../utils/mockup";
|
|
12
|
-
import {
|
|
13
|
-
import { followedRecord } from "../../utils/mockupLinks";
|
|
12
|
+
import { mockupPageRender } from "../../utils/mockupFrame";
|
|
13
|
+
import { followedRecord, mockupPageParams } from "../../utils/mockupLinks";
|
|
14
14
|
import type { PagePoint } from "../../utils/mockupPins";
|
|
15
15
|
import type { MockupSectionEdit } from "../../utils/mockupSections";
|
|
16
16
|
import type { MockupEditing } from "./useMockupEditing";
|
|
17
|
-
import { useMockupFrameRender } from "./useMockupFrameRender";
|
|
18
17
|
import { useMockupFrameSize } from "./useMockupFrameSize";
|
|
19
|
-
import { useMockupPageZoom } from "./useMockupPageZoom";
|
|
20
18
|
import type { ClientPoint } from "./useMockupPins";
|
|
21
19
|
import { useMockupSketchStates } from "./useMockupSketchStates";
|
|
22
20
|
import { usePreviewFrame } from "./usePreviewFrame";
|
|
23
21
|
|
|
24
22
|
interface PageFrameOptions {
|
|
25
|
-
/** The mockup's folder name, which its fixture routes are under. */
|
|
26
|
-
name: string;
|
|
27
23
|
editing: MockupEditing;
|
|
28
24
|
width: Readonly<Ref<MockupWidth>>;
|
|
29
25
|
/** The state the canvas draws. */
|
|
@@ -35,22 +31,10 @@ interface PageFrameOptions {
|
|
|
35
31
|
/** The query of the page, as its URL gives it. */
|
|
36
32
|
query: Readonly<Ref<Record<string, string> | undefined>>;
|
|
37
33
|
realData: Readonly<Ref<boolean>>;
|
|
38
|
-
/** The tenant the page is drawn as in SaaS mode, which reads its fixtures as that tenant; none in single-tenant mode. */
|
|
39
|
-
tenant: Readonly<Ref<string | undefined>>;
|
|
40
34
|
navigation: Readonly<Ref<PreviewNavigation>>;
|
|
41
|
-
/** Whether the module store is drawn in place of the page. */
|
|
42
|
-
isStoreOpen: Readonly<Ref<boolean>>;
|
|
43
35
|
isPreviewing: Readonly<Ref<boolean>>;
|
|
44
36
|
/** Opens the page `id`, on the row `record` when a link names one. */
|
|
45
37
|
openPage: (id: string, record?: string) => void;
|
|
46
|
-
/** The frame drew the render last posted for what `activationScope` names: only that one, never a render the frame was handed before it. */
|
|
47
|
-
onDrawn: (activation: string) => void;
|
|
48
|
-
/** The frame, ready, was handed the render of what `activationScope` names. */
|
|
49
|
-
onPosted: (activation: string) => void;
|
|
50
|
-
/** The preview's workspace switcher picked the tenant `id`. */
|
|
51
|
-
onTenant: (id: string) => void;
|
|
52
|
-
/** The preview's Modules button, or its Back entry inside a module, was picked. */
|
|
53
|
-
onModules: () => void;
|
|
54
38
|
onSectionEdit: (edit: MockupSectionEdit) => void;
|
|
55
39
|
/** Escape was pressed in the preview, and nothing of its page took it. */
|
|
56
40
|
onEscape: () => void;
|
|
@@ -58,33 +42,30 @@ interface PageFrameOptions {
|
|
|
58
42
|
|
|
59
43
|
/**
|
|
60
44
|
* The page view's frame: the preview iframe of the template's `preview`
|
|
61
|
-
* element, drawn at the size the canvas
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* through it too, so a pick redraws. While Preview is on the frame reports no
|
|
66
|
-
* block layout, so the layout of the page left behind is dropped when the
|
|
67
|
-
* page changes.
|
|
45
|
+
* element, drawn at the size the canvas gives it, which the page is posted to
|
|
46
|
+
* whenever what it draws changes, and what the frame reports back, a block
|
|
47
|
+
* picked, a link followed, the sections of its sidebar edited. The sketch
|
|
48
|
+
* states picked in the inspector are drawn through it too, so a pick redraws.
|
|
68
49
|
*/
|
|
69
50
|
export function useMockupPageFrame(options: PageFrameOptions) {
|
|
70
51
|
const { editing } = options;
|
|
71
52
|
const previewElement = useTemplateRef<HTMLIFrameElement>("preview");
|
|
72
53
|
const canvasElement = useTemplateRef<HTMLElement>("canvas");
|
|
73
54
|
const stageElement = useTemplateRef<HTMLElement>("stage");
|
|
74
|
-
const sketchStates = useMockupSketchStates(
|
|
75
|
-
const frames = useMockupFrameRender(options, sketchStates);
|
|
76
|
-
const acks = renderAcknowledgments(options.onDrawn);
|
|
77
|
-
let syncing = 0;
|
|
55
|
+
const sketchStates = useMockupSketchStates(sync);
|
|
78
56
|
|
|
79
|
-
|
|
57
|
+
function sync(): void {
|
|
80
58
|
const page = options.currentPage.value;
|
|
81
59
|
if (!page) return;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
60
|
+
bridge.post(
|
|
61
|
+
mockupPageRender(
|
|
62
|
+
page,
|
|
63
|
+
sketchStates.treeOf(page, options.realData.value),
|
|
64
|
+
options.navigation.value,
|
|
65
|
+
mockupPageParams(page, options.record.value),
|
|
66
|
+
options.query.value,
|
|
67
|
+
),
|
|
68
|
+
);
|
|
88
69
|
bridge.post(previewInspectMessage(!options.isPreviewing.value));
|
|
89
70
|
bridge.post(previewMinHeightMessage(size.fillHeight.value));
|
|
90
71
|
}
|
|
@@ -100,8 +81,7 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
100
81
|
|
|
101
82
|
const bridge = usePreviewFrame({
|
|
102
83
|
frame: previewElement,
|
|
103
|
-
onReady:
|
|
104
|
-
onDrawn: acks.drawn,
|
|
84
|
+
onReady: sync,
|
|
105
85
|
onSelect: (layoutPath) => {
|
|
106
86
|
editing.selectPath(layoutPath);
|
|
107
87
|
focusCanvas();
|
|
@@ -119,34 +99,21 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
119
99
|
options.record.value,
|
|
120
100
|
),
|
|
121
101
|
),
|
|
122
|
-
onTenant: options.onTenant,
|
|
123
|
-
onModules: options.onModules,
|
|
124
102
|
onEscape: options.onEscape,
|
|
125
103
|
onSectionEdit: options.onSectionEdit,
|
|
126
|
-
onZoom: (message) => pageZoom.zoomFromFrame(message),
|
|
127
104
|
});
|
|
128
105
|
const size = useMockupFrameSize({
|
|
129
106
|
canvas: canvasElement,
|
|
130
107
|
width: options.width,
|
|
131
108
|
reportedHeight: bridge.height,
|
|
132
109
|
});
|
|
133
|
-
const pageZoom = useMockupPageZoom({
|
|
134
|
-
canvas: canvasElement,
|
|
135
|
-
stage: stageElement,
|
|
136
|
-
zoom: size.zoom,
|
|
137
|
-
scale: size.scale,
|
|
138
|
-
fitScale: size.fitScale,
|
|
139
|
-
});
|
|
140
110
|
|
|
141
111
|
watch(
|
|
142
112
|
[
|
|
143
113
|
options.shown,
|
|
144
114
|
() => options.currentPage.value?.id,
|
|
145
115
|
options.realData,
|
|
146
|
-
options.tenant,
|
|
147
116
|
options.navigation,
|
|
148
|
-
options.isStoreOpen,
|
|
149
|
-
frames.storeHeader,
|
|
150
117
|
options.record,
|
|
151
118
|
options.query,
|
|
152
119
|
],
|
|
@@ -155,17 +122,10 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
155
122
|
watch(size.fillHeight, (height) =>
|
|
156
123
|
bridge.post(previewMinHeightMessage(height)),
|
|
157
124
|
);
|
|
158
|
-
watch(
|
|
159
|
-
() => options.currentPage.value?.id,
|
|
160
|
-
() => {
|
|
161
|
-
if (options.isPreviewing.value) editing.setLayout([]);
|
|
162
|
-
},
|
|
163
|
-
);
|
|
164
125
|
|
|
165
126
|
return {
|
|
166
127
|
bridge,
|
|
167
128
|
sketchStates,
|
|
168
|
-
pageZoom,
|
|
169
129
|
focusCanvas,
|
|
170
130
|
/** Deselects the block on a click on the canvas itself, around the page, and leaves a click on anything drawn in it to that. */
|
|
171
131
|
onCanvasClick(event: MouseEvent): void {
|
|
@@ -173,30 +133,17 @@ export function useMockupPageFrame(options: PageFrameOptions) {
|
|
|
173
133
|
},
|
|
174
134
|
...size,
|
|
175
135
|
/** The page in view, and the point of its frame's document, under a point of the screen. */
|
|
176
|
-
toFrame
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
function framePoint(
|
|
188
|
-
stage: HTMLElement | null,
|
|
189
|
-
page: string | undefined,
|
|
190
|
-
scale: number,
|
|
191
|
-
client: ClientPoint,
|
|
192
|
-
): PagePoint | undefined {
|
|
193
|
-
const box = stage?.getBoundingClientRect();
|
|
194
|
-
if (!box || page === undefined) return undefined;
|
|
195
|
-
return {
|
|
196
|
-
page,
|
|
197
|
-
point: {
|
|
198
|
-
x: (client.x - box.left) / scale,
|
|
199
|
-
y: (client.y - box.top) / scale,
|
|
136
|
+
toFrame(client: ClientPoint): PagePoint | undefined {
|
|
137
|
+
const stage = stageElement.value?.getBoundingClientRect();
|
|
138
|
+
const page = options.currentPage.value?.id;
|
|
139
|
+
if (!stage || page === undefined) return undefined;
|
|
140
|
+
return {
|
|
141
|
+
page,
|
|
142
|
+
point: {
|
|
143
|
+
x: (client.x - stage.left) / size.scale.value,
|
|
144
|
+
y: (client.y - stage.top) / size.scale.value,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
200
147
|
},
|
|
201
148
|
};
|
|
202
149
|
}
|
|
@@ -9,15 +9,10 @@ import { mockupPreviewPath, readsRealData } from "../../utils/mockupRealData";
|
|
|
9
9
|
* a document that refuses every live route. Switching Real data replaces the
|
|
10
10
|
* frame, so no tree is drawn in the document of the other mode. On the
|
|
11
11
|
* Overview the switch covers every page of the board, which draws each by the
|
|
12
|
-
* same rule through `choice`.
|
|
13
|
-
* is handed, `framePage`, and keeps the one it has while none is, which is
|
|
14
|
-
* the fixtures-only document until a page was handed: opening a page and
|
|
15
|
-
* coming back to the Overview boot nothing, and only a page that reads the
|
|
16
|
-
* other mode than the last one handed replaces the document.
|
|
12
|
+
* same rule through `choice`.
|
|
17
13
|
*/
|
|
18
14
|
export function useMockupRealData(
|
|
19
15
|
currentPage: Readonly<Ref<MockupPageState | undefined>>,
|
|
20
|
-
framePage: Readonly<Ref<MockupPageState | undefined>>,
|
|
21
16
|
pages: Readonly<Ref<readonly MockupPageState[]>>,
|
|
22
17
|
isOverview: Readonly<Ref<boolean>>,
|
|
23
18
|
initial: MockupDataMode | undefined,
|
|
@@ -39,10 +34,8 @@ export function useMockupRealData(
|
|
|
39
34
|
choice.value = isOn ? "real" : "sample";
|
|
40
35
|
},
|
|
41
36
|
});
|
|
42
|
-
const previewSrc = computed
|
|
43
|
-
|
|
44
|
-
? mockupPreviewPath(readsRealData(framePage.value, choice.value), "page")
|
|
45
|
-
: (held ?? mockupPreviewPath(false, "page")),
|
|
37
|
+
const previewSrc = computed(() =>
|
|
38
|
+
mockupPreviewPath(readsRealData(currentPage.value, choice.value)),
|
|
46
39
|
);
|
|
47
40
|
return { choice, hasRealData, realData, previewSrc };
|
|
48
41
|
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
computed,
|
|
4
|
-
onBeforeUnmount,
|
|
5
|
-
onMounted,
|
|
6
|
-
type WritableComputedRef,
|
|
7
|
-
type ComputedRef,
|
|
8
|
-
} from "vue";
|
|
1
|
+
import { computed, type WritableComputedRef, type ComputedRef } from "vue";
|
|
9
2
|
import { readQueryValue } from "../../utils/mockup";
|
|
10
|
-
import {
|
|
11
|
-
mockupPageQuery,
|
|
12
|
-
RECORD_QUERY,
|
|
13
|
-
STORE_QUERY,
|
|
14
|
-
} from "../../utils/mockupLinks";
|
|
3
|
+
import { mockupPageQuery, RECORD_QUERY } from "../../utils/mockupLinks";
|
|
15
4
|
import { detach } from "../detach";
|
|
16
5
|
|
|
17
6
|
const PAGE_QUERY = "page";
|
|
18
7
|
|
|
19
|
-
/**
|
|
20
|
-
* The state of each history entry of the viewer: no `page`, so Inertia has no
|
|
21
|
-
* page to draw again when back or forward returns to it, which would remount
|
|
22
|
-
* the viewer and lose its state (Preview, the panels). It finds the entry
|
|
23
|
-
* missing and visits its URL with `preserveState`, and the viewer stays.
|
|
24
|
-
*/
|
|
25
|
-
const VIEWER_ENTRY_STATE = { dmsMockupViewer: true };
|
|
26
|
-
|
|
27
8
|
/** The page the viewer shows, and the row it shows it on. */
|
|
28
9
|
export interface MockupRoutePage {
|
|
29
10
|
/** The id of the page asked for, none for the Overview; setting it opens that page on no row. */
|
|
@@ -32,59 +13,36 @@ export interface MockupRoutePage {
|
|
|
32
13
|
record: ComputedRef<string | undefined>;
|
|
33
14
|
/** The query of the page on screen: the URL's, without what the viewer reads itself. */
|
|
34
15
|
query: ComputedRef<Record<string, string> | undefined>;
|
|
35
|
-
/** Whether the module store is open in place of a page. */
|
|
36
|
-
isStoreOpen: ComputedRef<boolean>;
|
|
37
16
|
/** Opens the page `id`, on the row `record` when a link names one; no `id` opens the Overview. */
|
|
38
17
|
open: (id: string | undefined, record?: string) => void;
|
|
39
|
-
/** Opens the module store. */
|
|
40
|
-
openStore: () => void;
|
|
41
18
|
}
|
|
42
19
|
|
|
43
20
|
/**
|
|
44
|
-
* The page on screen and its row as the URL's `?page=` and `?record
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* browser's history, so back and forward step through them, in the viewer on
|
|
48
|
-
* screen: Inertia writes its page in each entry it moves to, and the viewer
|
|
49
|
-
* takes it out ({@link VIEWER_ENTRY_STATE}).
|
|
21
|
+
* The page on screen and its row as the URL's `?page=` and `?record=`: each
|
|
22
|
+
* page opened, and each return to the Overview, is a new entry of the
|
|
23
|
+
* browser's history, so back and forward step through them.
|
|
50
24
|
*/
|
|
51
25
|
export function useMockupRoutePage(): MockupRoutePage {
|
|
52
26
|
const route = useDmsRoute();
|
|
53
27
|
const router = useDmsRouter();
|
|
54
28
|
|
|
55
|
-
function
|
|
29
|
+
function open(id: string | undefined, record?: string): void {
|
|
56
30
|
const kept = Object.fromEntries(
|
|
57
31
|
Object.entries(route.query).filter(
|
|
58
|
-
([key]) =>
|
|
59
|
-
key !== PAGE_QUERY && key !== RECORD_QUERY && key !== STORE_QUERY,
|
|
32
|
+
([key]) => key !== PAGE_QUERY && key !== RECORD_QUERY,
|
|
60
33
|
),
|
|
61
34
|
);
|
|
62
35
|
detach(
|
|
63
|
-
router.push({
|
|
36
|
+
router.push({
|
|
37
|
+
query: {
|
|
38
|
+
...kept,
|
|
39
|
+
...(id !== undefined && { [PAGE_QUERY]: id }),
|
|
40
|
+
...(record !== undefined && { [RECORD_QUERY]: record }),
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
64
43
|
);
|
|
65
44
|
}
|
|
66
45
|
|
|
67
|
-
function open(id: string | undefined, record?: string): void {
|
|
68
|
-
go({
|
|
69
|
-
...(id !== undefined && { [PAGE_QUERY]: id }),
|
|
70
|
-
...(record !== undefined && { [RECORD_QUERY]: record }),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let viewerPath: string | undefined;
|
|
75
|
-
function forgetInertiaPage(): void {
|
|
76
|
-
if (window.location.pathname !== viewerPath) return;
|
|
77
|
-
window.history.replaceState(VIEWER_ENTRY_STATE, "", window.location.href);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let stopForgetting: (() => void) | undefined;
|
|
81
|
-
onMounted(() => {
|
|
82
|
-
viewerPath = window.location.pathname;
|
|
83
|
-
forgetInertiaPage();
|
|
84
|
-
stopForgetting = inertiaRouter.on("finish", forgetInertiaPage);
|
|
85
|
-
});
|
|
86
|
-
onBeforeUnmount(() => stopForgetting?.());
|
|
87
|
-
|
|
88
46
|
return {
|
|
89
47
|
page: computed({
|
|
90
48
|
get: () => readQueryValue(route.query[PAGE_QUERY]),
|
|
@@ -92,10 +50,6 @@ export function useMockupRoutePage(): MockupRoutePage {
|
|
|
92
50
|
}),
|
|
93
51
|
record: computed(() => readQueryValue(route.query[RECORD_QUERY])),
|
|
94
52
|
query: computed(() => mockupPageQuery(route.query)),
|
|
95
|
-
isStoreOpen: computed(
|
|
96
|
-
() => readQueryValue(route.query[STORE_QUERY]) !== undefined,
|
|
97
|
-
),
|
|
98
53
|
open,
|
|
99
|
-
openStore: () => go({ [STORE_QUERY]: "1" }),
|
|
100
54
|
};
|
|
101
55
|
}
|
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
type Ref,
|
|
7
7
|
type ShallowRef,
|
|
8
8
|
} from "vue";
|
|
9
|
-
import { mockupEndpoint, type MockupState } from "../../utils/mockup";
|
|
10
9
|
import {
|
|
10
|
+
mockupEndpoint,
|
|
11
11
|
parseAnnotation,
|
|
12
12
|
parseAnnotations,
|
|
13
13
|
upsertAnnotation,
|
|
14
14
|
type MockupAnnotation,
|
|
15
15
|
type MockupAnnotationDraft,
|
|
16
16
|
type MockupAnnotationPatch,
|
|
17
|
-
|
|
17
|
+
type MockupState,
|
|
18
|
+
} from "../../utils/mockup";
|
|
18
19
|
import {
|
|
19
20
|
newViewerId,
|
|
20
21
|
NO_PRESENCE,
|
|
21
22
|
type MockupPresence,
|
|
22
23
|
} from "../../utils/mockupPresence";
|
|
23
|
-
import { applyStatePatch } from "../../utils/mockupStatePatch";
|
|
24
24
|
import { openMockupStream, type MockupStream } from "../../utils/mockupStream";
|
|
25
25
|
|
|
26
26
|
type AuthFetch = ReturnType<typeof useAuthFetch>["$authFetch"];
|
|
@@ -112,11 +112,6 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
|
|
|
112
112
|
onState: (next) => {
|
|
113
113
|
state.value = next;
|
|
114
114
|
},
|
|
115
|
-
onPatch: (patch) => {
|
|
116
|
-
const next = state.value && applyStatePatch(state.value, patch);
|
|
117
|
-
if (next) state.value = next;
|
|
118
|
-
else stream?.reopen();
|
|
119
|
-
},
|
|
120
115
|
onAnnotations: (next) => {
|
|
121
116
|
annotations.value = next;
|
|
122
117
|
},
|
|
@@ -488,18 +488,14 @@ export function useMockupSpec(options: MockupSpecOptions): MockupSpecEditor {
|
|
|
488
488
|
const sync = new MockupSpecSync(options);
|
|
489
489
|
const { history, written } = sync;
|
|
490
490
|
|
|
491
|
-
let mountRead: Promise<SpecSource | undefined> | undefined;
|
|
492
491
|
onMounted(async () => {
|
|
493
|
-
|
|
494
|
-
const source = await mountRead;
|
|
492
|
+
const source = await sync.read();
|
|
495
493
|
if (source && !sync.isClosed && !history.value) sync.adopt(source, false);
|
|
496
494
|
});
|
|
497
495
|
watch(
|
|
498
496
|
() => options.state.value?.revision,
|
|
499
|
-
|
|
497
|
+
() => {
|
|
500
498
|
sync.isAwaitingState.value = false;
|
|
501
|
-
const isFirstState = previous === undefined && mountRead !== undefined;
|
|
502
|
-
if (isFirstState && (await mountRead)) return;
|
|
503
499
|
ignoreRejection(sync.check());
|
|
504
500
|
},
|
|
505
501
|
);
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts
CHANGED
|
@@ -15,11 +15,11 @@ interface ToolModesOptions {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The modes the canvas is in: Preview hands every
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* The modes the canvas is in, which exclude one another: Preview hands every
|
|
19
|
+
* click to the page, so no block stays selected and no tool stays armed; a
|
|
20
|
+
* block armed and the comment tool never are both; the Overview places no
|
|
21
|
+
* block and leaves Preview, to comment on every page, and gives the focus
|
|
22
|
+
* back to the page once it shows again.
|
|
23
23
|
*/
|
|
24
24
|
export function useMockupToolModes(options: ToolModesOptions) {
|
|
25
25
|
const { editing, pins, post } = options;
|
|
@@ -29,6 +29,8 @@ export function useMockupToolModes(options: ToolModesOptions) {
|
|
|
29
29
|
if (isOn) {
|
|
30
30
|
editing.selection.value = undefined;
|
|
31
31
|
editing.cancelPlacing();
|
|
32
|
+
pins.cancel();
|
|
33
|
+
pins.isPlacing.value = false;
|
|
32
34
|
}
|
|
33
35
|
post(previewInspectMessage(!isOn));
|
|
34
36
|
});
|