@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
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
import { textDigest } from "../../../../dms-core/app/utils/textDigest";
|
|
2
1
|
import { isPreviewTheme, type PreviewNode } from "./blockPreview";
|
|
3
2
|
import {
|
|
4
3
|
previewRenderMessage,
|
|
5
4
|
type PreviewNavigation,
|
|
6
|
-
type PreviewNavigationItem,
|
|
7
5
|
type PreviewRenderMessage,
|
|
8
6
|
type PreviewSidebarWidget,
|
|
9
|
-
type PreviewWorkspace,
|
|
10
7
|
} from "./blockPreviewMessages";
|
|
11
8
|
import type {
|
|
12
9
|
MockupCategory,
|
|
13
|
-
MockupModule,
|
|
14
10
|
MockupPageState,
|
|
15
11
|
MockupSidebarWidget,
|
|
16
12
|
} from "./mockup";
|
|
17
|
-
import {
|
|
18
|
-
activeModule,
|
|
19
|
-
isAppPage,
|
|
20
|
-
isSettingsPage,
|
|
21
|
-
moduleWidgets,
|
|
22
|
-
settingsNavigation,
|
|
23
|
-
storeModules,
|
|
24
|
-
} from "./mockupModuleNavigation";
|
|
25
|
-
import type { PreviewFixtureBatch } from "./previewFixtureAnswers";
|
|
26
|
-
import type { PreviewHeader } from "./previewHeader";
|
|
27
13
|
import { groupSections } from "./mockupSections";
|
|
28
14
|
import { currentSketchScheme } from "./sketch";
|
|
29
15
|
|
|
@@ -63,7 +49,7 @@ export function mockupPageIcon(
|
|
|
63
49
|
|
|
64
50
|
type NavigationPage = Pick<
|
|
65
51
|
MockupPageState,
|
|
66
|
-
"id" | "title" | "icon" | "category" | "menu" | "parent"
|
|
52
|
+
"id" | "title" | "icon" | "category" | "menu" | "parent"
|
|
67
53
|
>;
|
|
68
54
|
|
|
69
55
|
/**
|
|
@@ -92,14 +78,8 @@ export interface MockupNavigationSource {
|
|
|
92
78
|
active: string | undefined;
|
|
93
79
|
/** Whether the sidebar edits its sections. */
|
|
94
80
|
editable?: boolean;
|
|
95
|
-
/** Sketches the
|
|
81
|
+
/** Sketches the sidebar draws among its widgets. */
|
|
96
82
|
widgets?: readonly MockupSidebarWidget[];
|
|
97
|
-
/** The modules the mockup installs: the Modules button counts them, the store lists them, and their widgets are in the sidebar. */
|
|
98
|
-
modules?: readonly MockupModule[];
|
|
99
|
-
/** Whether the module store is open in place of the page. */
|
|
100
|
-
isStoreOpen?: boolean;
|
|
101
|
-
/** The workspace the switcher widget lists and the banner names; none when absent. */
|
|
102
|
-
workspace?: PreviewWorkspace;
|
|
103
83
|
}
|
|
104
84
|
|
|
105
85
|
function sidebarWidget(widget: MockupSidebarWidget): PreviewSidebarWidget {
|
|
@@ -133,44 +113,23 @@ function menuEntryOf(
|
|
|
133
113
|
return undefined;
|
|
134
114
|
}
|
|
135
115
|
|
|
136
|
-
/** The Settings section's entries: the spec's settings pages and the pages that extend a Settings page, in the spec's order. */
|
|
137
|
-
function settingsItems(
|
|
138
|
-
pages: readonly NavigationPage[],
|
|
139
|
-
): PreviewNavigationItem[] {
|
|
140
|
-
return pages
|
|
141
|
-
.filter((page) => page.menu !== false && isSettingsPage(page))
|
|
142
|
-
.map((page) => ({ id: page.id, label: page.title, icon: page.icon }));
|
|
143
|
-
}
|
|
144
|
-
|
|
145
116
|
/**
|
|
146
|
-
* The mockup's pages as the preview's sidebar lists them:
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* of a module is never in the app's menu: while one is current, the sidebar
|
|
151
|
-
* draws as inside that module, its pages in place of the app's menu. The
|
|
152
|
-
* installed modules fill the Modules button and the module store, and put
|
|
153
|
-
* their widgets in the sidebar; the mockup's own sketches follow.
|
|
117
|
+
* The mockup's pages as the preview's sidebar lists them: under their
|
|
118
|
+
* sections, each page with its icon, and `active` as the current one. A page with `menu: false`
|
|
119
|
+
* is left out, and while it is the current one, its nearest listed parent is.
|
|
120
|
+
* The mockup's sidebar widgets follow, each `title` the caption over it.
|
|
154
121
|
*/
|
|
155
122
|
export function mockupNavigation(
|
|
156
123
|
source: MockupNavigationSource,
|
|
157
124
|
): PreviewNavigation {
|
|
158
|
-
const modules = source.modules ?? [];
|
|
159
125
|
const indexed = source.pages
|
|
160
126
|
.map((page, index) => ({ page, index }))
|
|
161
|
-
.filter(({ page }) => page.menu !== false
|
|
127
|
+
.filter(({ page }) => page.menu !== false);
|
|
162
128
|
const sections = groupSections(
|
|
163
129
|
source.categories,
|
|
164
130
|
indexed,
|
|
165
131
|
({ page }) => page.category,
|
|
166
132
|
);
|
|
167
|
-
const settings = settingsItems(source.pages);
|
|
168
|
-
const settingsNav = settingsNavigation(modules, source.pages);
|
|
169
|
-
const isStore = source.isStoreOpen === true;
|
|
170
|
-
const module = isStore
|
|
171
|
-
? undefined
|
|
172
|
-
: activeModule(modules, source.pages, source.active);
|
|
173
|
-
const widgets = moduleWidgets(modules);
|
|
174
133
|
return {
|
|
175
134
|
title: source.title,
|
|
176
135
|
sections: sections.map((section) => ({
|
|
@@ -181,64 +140,12 @@ export function mockupNavigation(
|
|
|
181
140
|
icon: sidebarIcon(page, index),
|
|
182
141
|
})),
|
|
183
142
|
})),
|
|
184
|
-
|
|
185
|
-
...(settingsNav.length > 0 && { settingsNav }),
|
|
186
|
-
...(module && { module }),
|
|
187
|
-
...(modules.length > 0 && {
|
|
188
|
-
modules: storeModules(modules, source.pages),
|
|
189
|
-
}),
|
|
190
|
-
...(isStore && { store: true as const }),
|
|
191
|
-
active: isStore ? undefined : menuEntryOf(source.pages, source.active),
|
|
143
|
+
active: menuEntryOf(source.pages, source.active),
|
|
192
144
|
...(source.editable && { editable: true }),
|
|
193
145
|
...(source.widgets &&
|
|
194
146
|
source.widgets.length > 0 && {
|
|
195
147
|
widgets: source.widgets.map(sidebarWidget),
|
|
196
148
|
}),
|
|
197
|
-
...(widgets.length > 0 && { moduleWidgets: widgets }),
|
|
198
|
-
...(source.workspace && { workspace: source.workspace }),
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* What the blocks a render draws are of: the page, as one tenant sees it when
|
|
204
|
-
* SaaS mode is on, on its fixtures or its live routes, as `tree` draws it and
|
|
205
|
-
* `params` fill it. Another page, tenant, data mode, tree or row remounts the
|
|
206
|
-
* blocks, which read their options once when they mount; a change of the
|
|
207
|
-
* fixtures alone leaves the scope as it was, and the blocks read them again
|
|
208
|
-
* in place.
|
|
209
|
-
*/
|
|
210
|
-
export function mockupRenderScope(
|
|
211
|
-
pageId: string,
|
|
212
|
-
tenant: string | undefined,
|
|
213
|
-
realData: boolean,
|
|
214
|
-
tree: readonly PreviewNode[],
|
|
215
|
-
params?: Record<string, string>,
|
|
216
|
-
): string {
|
|
217
|
-
return JSON.stringify([
|
|
218
|
-
pageId,
|
|
219
|
-
tenant ?? null,
|
|
220
|
-
realData,
|
|
221
|
-
textDigest(JSON.stringify([tree, params ?? null])),
|
|
222
|
-
]);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/** What a render brings besides the page's tree. */
|
|
226
|
-
export interface MockupRenderData {
|
|
227
|
-
/** What the blocks are of; a render with none remounts them. */
|
|
228
|
-
scope?: string;
|
|
229
|
-
/** The fixtures the page reads, which the frame answers its blocks' reads from. */
|
|
230
|
-
fixtures?: PreviewFixtureBatch;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/** `message` naming what its blocks are of and carrying the fixtures they read. */
|
|
234
|
-
export function withRenderData(
|
|
235
|
-
message: PreviewRenderMessage,
|
|
236
|
-
data: MockupRenderData,
|
|
237
|
-
): PreviewRenderMessage {
|
|
238
|
-
return {
|
|
239
|
-
...message,
|
|
240
|
-
...(data.scope !== undefined && { scope: data.scope }),
|
|
241
|
-
...(data.fixtures && { fixtures: data.fixtures }),
|
|
242
149
|
};
|
|
243
150
|
}
|
|
244
151
|
|
|
@@ -275,25 +182,3 @@ export function mockupPageRender(
|
|
|
275
182
|
...(page.layout && { pageLayout: page.layout }),
|
|
276
183
|
});
|
|
277
184
|
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* What the preview draws while the module store is open: no block, the
|
|
281
|
-
* store under `header`, inside `navigation`, in the theme and the locale of
|
|
282
|
-
* `page`, the page the viewer would otherwise show.
|
|
283
|
-
*/
|
|
284
|
-
export function mockupStoreRender(
|
|
285
|
-
page: MockupPageState,
|
|
286
|
-
navigation: PreviewNavigation,
|
|
287
|
-
header: PreviewHeader,
|
|
288
|
-
): PreviewRenderMessage {
|
|
289
|
-
return previewRenderMessage({
|
|
290
|
-
tree: [],
|
|
291
|
-
theme: isPreviewTheme(page.options.theme)
|
|
292
|
-
? page.options.theme
|
|
293
|
-
: currentSketchScheme(),
|
|
294
|
-
locale: page.options.locale,
|
|
295
|
-
padding: true,
|
|
296
|
-
navigation,
|
|
297
|
-
header,
|
|
298
|
-
});
|
|
299
|
-
}
|
|
@@ -8,18 +8,14 @@ const PAGE_QUERY = "page";
|
|
|
8
8
|
/** The viewer's query naming the row a page with a route shows. */
|
|
9
9
|
export const RECORD_QUERY = "record";
|
|
10
10
|
|
|
11
|
-
/** The viewer's query that opens the module store in place of a page. */
|
|
12
|
-
export const STORE_QUERY = "store";
|
|
13
|
-
|
|
14
11
|
/**
|
|
15
12
|
* The query parameters the viewer and its preview read themselves: the
|
|
16
|
-
* mockup, the page, the
|
|
17
|
-
*
|
|
13
|
+
* mockup, the page, the canvas width, the data shown, the preview's state and
|
|
14
|
+
* its fixtures-only switch.
|
|
18
15
|
*/
|
|
19
16
|
const VIEWER_QUERY_KEYS: ReadonlySet<string> = new Set([
|
|
20
17
|
"name",
|
|
21
18
|
PAGE_QUERY,
|
|
22
|
-
STORE_QUERY,
|
|
23
19
|
"width",
|
|
24
20
|
"data",
|
|
25
21
|
"state",
|
|
@@ -18,15 +18,12 @@ const COLUMN_GAP = 160;
|
|
|
18
18
|
const ROW_GAP = 400;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* How far the overview
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* How far the overview zooms out and in: 100% draws a page at its real size.
|
|
22
|
+
* A mockup too large to fit at `min` zooms out as far as it fits, see
|
|
23
|
+
* {@link zoomFloor}.
|
|
24
24
|
*/
|
|
25
25
|
export const OVERVIEW_ZOOM = { min: 0.02, max: 2 } as const;
|
|
26
26
|
|
|
27
|
-
/** How much one step of a zoom button zooms, in the overview and in a page. */
|
|
28
|
-
export const ZOOM_STEP = 1.5;
|
|
29
|
-
|
|
30
27
|
/** How many screen pixels of wheel turn the zoom by a factor of e. */
|
|
31
28
|
const WHEEL_PIXELS_PER_ZOOM = 100;
|
|
32
29
|
|
|
@@ -436,18 +433,3 @@ export function assignSlots(
|
|
|
436
433
|
}
|
|
437
434
|
return next;
|
|
438
435
|
}
|
|
439
|
-
|
|
440
|
-
/** How far an arrow key pans the canvas, in screen pixels, and how far with Shift held. */
|
|
441
|
-
export const ARROW_PAN_PX = 80;
|
|
442
|
-
export const ARROW_PAN_FAST_PX = 400;
|
|
443
|
-
|
|
444
|
-
/** Which way each arrow key moves the canvas: the view moves the arrow's way. */
|
|
445
|
-
export const PAN_DIRECTIONS = new Map<string, readonly [number, number]>([
|
|
446
|
-
["ArrowLeft", [1, 0]],
|
|
447
|
-
["ArrowRight", [-1, 0]],
|
|
448
|
-
["ArrowUp", [0, 1]],
|
|
449
|
-
["ArrowDown", [0, -1]],
|
|
450
|
-
]);
|
|
451
|
-
|
|
452
|
-
/** The `button` of a pointer event of the middle button, which pans the canvas with a drag. */
|
|
453
|
-
export const MIDDLE_BUTTON = 1;
|
|
@@ -68,21 +68,6 @@ export const SPEC_PAGE_KEYS: PageKeys<MockupSpecPage> = {
|
|
|
68
68
|
parentOf: (page) => (isString(page.parent) ? page.parent : undefined),
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
/** Where a spec page says it lives beyond the app's menu: the module it is added to, or the existing page it extends. */
|
|
72
|
-
export interface SpecPagePlace {
|
|
73
|
-
module?: string;
|
|
74
|
-
extends?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** The module and the extended page a spec page names, as written; neither for a page of the app. */
|
|
78
|
-
export function specPagePlace(page: MockupSpecPage): SpecPagePlace {
|
|
79
|
-
const { module, extends: target } = page;
|
|
80
|
-
return {
|
|
81
|
-
...(isString(module) && { module }),
|
|
82
|
-
...(isString(target) && { extends: target }),
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
71
|
/** Whether the sidebar leaves the spec page out. */
|
|
87
72
|
export function isHiddenPage(page: MockupSpecPage): boolean {
|
|
88
73
|
return page.menu === false;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { PreviewBlockRect, PreviewRect } from "./blockPreviewMessages";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import {
|
|
3
|
+
layoutPathFor,
|
|
4
|
+
specPointerFor,
|
|
5
|
+
type MockupAnnotation,
|
|
6
|
+
type MockupPageState,
|
|
7
|
+
type MockupPinOffset,
|
|
8
|
+
type MockupPinPlace,
|
|
9
|
+
} from "./mockup";
|
|
8
10
|
import {
|
|
9
11
|
CUSTOM_PAGE_SKETCH,
|
|
10
12
|
type MockupSketchStates,
|
|
@@ -3,8 +3,6 @@ import type { MockupDataMode, MockupPageState } from "./mockup";
|
|
|
3
3
|
import {
|
|
4
4
|
FIXTURES_ONLY_QUERY,
|
|
5
5
|
FIXTURES_ONLY_VALUE,
|
|
6
|
-
MOCKUP_PAGE_FRAME_QUERY,
|
|
7
|
-
MOCKUP_PAGE_FRAME_VALUE,
|
|
8
6
|
} from "./previewFixturesOnly";
|
|
9
7
|
|
|
10
8
|
const PREVIEW_PATH = "/dms-preview";
|
|
@@ -22,22 +20,11 @@ export function readsRealData(
|
|
|
22
20
|
return choice ? choice === "real" : page.livePage !== undefined;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
/**
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* `realData`, marked as the page view's frame when `role` is `page`.
|
|
31
|
-
*/
|
|
32
|
-
export function mockupPreviewPath(
|
|
33
|
-
realData: boolean,
|
|
34
|
-
role: MockupFrameRole,
|
|
35
|
-
): string {
|
|
36
|
-
const query = new URLSearchParams();
|
|
37
|
-
if (!realData) query.set(FIXTURES_ONLY_QUERY, FIXTURES_ONLY_VALUE);
|
|
38
|
-
if (role === "page") query.set(MOCKUP_PAGE_FRAME_QUERY, MOCKUP_PAGE_FRAME_VALUE);
|
|
39
|
-
const search = query.toString();
|
|
40
|
-
return search ? `${PREVIEW_PATH}?${search}` : PREVIEW_PATH;
|
|
23
|
+
/** The preview document for a page: one that refuses every live route unless `realData`. */
|
|
24
|
+
export function mockupPreviewPath(realData: boolean): string {
|
|
25
|
+
return realData
|
|
26
|
+
? PREVIEW_PATH
|
|
27
|
+
: `${PREVIEW_PATH}?${FIXTURES_ONLY_QUERY}=${FIXTURES_ONLY_VALUE}`;
|
|
41
28
|
}
|
|
42
29
|
|
|
43
30
|
/** The tree of `page` for the frame `mockupPreviewPath(realData)` opens. */
|
|
@@ -31,17 +31,11 @@ export interface MockupCombo {
|
|
|
31
31
|
/**
|
|
32
32
|
* What the canvas shows: one page of the mockup as it is now, or of a past
|
|
33
33
|
* version of it, read-only; every page of either side by side, in the
|
|
34
|
-
* overview; a page as the dashboard runs it, in Preview, where a click
|
|
35
|
-
* reaches the page
|
|
36
|
-
* the page behind it.
|
|
34
|
+
* overview; or a page as the dashboard runs it, in Preview, where a click
|
|
35
|
+
* reaches the page.
|
|
37
36
|
*/
|
|
38
37
|
export type MockupView =
|
|
39
|
-
| "
|
|
40
|
-
| "version"
|
|
41
|
-
| "overview"
|
|
42
|
-
| "overview_version"
|
|
43
|
-
| "preview"
|
|
44
|
-
| "database";
|
|
38
|
+
"current" | "version" | "overview" | "overview_version" | "preview";
|
|
45
39
|
|
|
46
40
|
const PAGE_VIEWS: readonly MockupView[] = ["current", "version"];
|
|
47
41
|
const OVERVIEW_VIEWS: readonly MockupView[] = ["overview", "overview_version"];
|
|
@@ -94,12 +88,12 @@ export const MOCKUP_SHORTCUTS = {
|
|
|
94
88
|
cancel: {
|
|
95
89
|
group: "editing",
|
|
96
90
|
combos: [{ key: "escape" }],
|
|
97
|
-
views: ["current", "overview"
|
|
91
|
+
views: ["current", "overview"],
|
|
98
92
|
},
|
|
99
93
|
comment: {
|
|
100
94
|
group: "comments",
|
|
101
95
|
combos: [{ key: "c" }],
|
|
102
|
-
views: ["current", "overview"
|
|
96
|
+
views: ["current", "overview"],
|
|
103
97
|
},
|
|
104
98
|
undo: {
|
|
105
99
|
group: "history",
|
|
@@ -124,7 +118,7 @@ export const MOCKUP_SHORTCUTS = {
|
|
|
124
118
|
fit_all: {
|
|
125
119
|
group: "overview",
|
|
126
120
|
combos: [{ key: "1", code: "Digit1", shift: true }],
|
|
127
|
-
views:
|
|
121
|
+
views: OVERVIEW_VIEWS,
|
|
128
122
|
},
|
|
129
123
|
preview: {
|
|
130
124
|
group: "preview",
|
|
@@ -136,11 +130,6 @@ export const MOCKUP_SHORTCUTS = {
|
|
|
136
130
|
combos: [{ key: "escape" }],
|
|
137
131
|
views: ["preview"],
|
|
138
132
|
},
|
|
139
|
-
close_database: {
|
|
140
|
-
group: "panels",
|
|
141
|
-
combos: [{ key: "escape" }],
|
|
142
|
-
views: ["database"],
|
|
143
|
-
},
|
|
144
133
|
} as const satisfies Record<string, MockupShortcut>;
|
|
145
134
|
|
|
146
135
|
export type MockupShortcutId = keyof typeof MOCKUP_SHORTCUTS;
|
|
@@ -3,13 +3,12 @@ import { isString } from "../../../../dms-core/app/utils/type-check";
|
|
|
3
3
|
import { isJsonValue } from "./json";
|
|
4
4
|
import {
|
|
5
5
|
MOCKUP_ANNOTATIONS_EVENT,
|
|
6
|
-
MOCKUP_PATCH_EVENT,
|
|
7
6
|
MOCKUP_STATE_EVENT,
|
|
7
|
+
parseAnnotations,
|
|
8
8
|
parseMockupState,
|
|
9
|
+
type MockupAnnotation,
|
|
9
10
|
type MockupState,
|
|
10
11
|
} from "./mockup";
|
|
11
|
-
import { parseAnnotations, type MockupAnnotation } from "./mockupAnnotations";
|
|
12
|
-
import { type MockupStatePatch, parseStatePatch } from "./mockupStatePatch";
|
|
13
12
|
import {
|
|
14
13
|
MOCKUP_PRESENCE_EVENT,
|
|
15
14
|
parseMockupPresence,
|
|
@@ -19,10 +18,7 @@ import {
|
|
|
19
18
|
const REOPEN_DELAY_MS = 2000;
|
|
20
19
|
|
|
21
20
|
export interface MockupStreamHandlers {
|
|
22
|
-
/** The state, whole: on connect, and again when the stream reconnects. */
|
|
23
21
|
onState: (state: MockupState) => void;
|
|
24
|
-
/** What changed since the last state or patch the stream sent, which the patch names by its `from`. */
|
|
25
|
-
onPatch: (patch: MockupStatePatch) => void;
|
|
26
22
|
onAnnotations: (annotations: MockupAnnotation[]) => void;
|
|
27
23
|
/** Who is on the mockup and which blocks they hold, on connect and after each change. */
|
|
28
24
|
onPresence: (presence: MockupPresence) => void;
|
|
@@ -32,8 +28,6 @@ export interface MockupStreamHandlers {
|
|
|
32
28
|
|
|
33
29
|
export interface MockupStream {
|
|
34
30
|
close: () => void;
|
|
35
|
-
/** Opens the stream again at once: the server sends the state whole on connect. */
|
|
36
|
-
reopen: () => void;
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
interface StreamState {
|
|
@@ -78,10 +72,6 @@ function open(state: StreamState): void {
|
|
|
78
72
|
const mockup = parseMockupState(readJson(event));
|
|
79
73
|
if (mockup) state.handlers.onState(mockup);
|
|
80
74
|
});
|
|
81
|
-
source.addEventListener(MOCKUP_PATCH_EVENT, (event) => {
|
|
82
|
-
const patch = parseStatePatch(readJson(event));
|
|
83
|
-
if (patch) state.handlers.onPatch(patch);
|
|
84
|
-
});
|
|
85
75
|
source.addEventListener(MOCKUP_ANNOTATIONS_EVENT, (event) => {
|
|
86
76
|
const annotations = parseAnnotations(readJson(event));
|
|
87
77
|
if (annotations) state.handlers.onAnnotations(annotations);
|
|
@@ -113,11 +103,6 @@ export function openMockupStream(
|
|
|
113
103
|
};
|
|
114
104
|
open(state);
|
|
115
105
|
return {
|
|
116
|
-
reopen: () => {
|
|
117
|
-
if (state.reopenTimer) clearTimeout(state.reopenTimer);
|
|
118
|
-
state.reopenTimer = null;
|
|
119
|
-
open(state);
|
|
120
|
-
},
|
|
121
106
|
close: () => {
|
|
122
107
|
state.isClosed = true;
|
|
123
108
|
if (state.reopenTimer) clearTimeout(state.reopenTimer);
|
|
@@ -3,8 +3,13 @@ import {
|
|
|
3
3
|
isObject,
|
|
4
4
|
isString,
|
|
5
5
|
} from "../../../../dms-core/app/utils/type-check";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
mockupEndpoint,
|
|
8
|
+
parseAnnotations,
|
|
9
|
+
parseMockupState,
|
|
10
|
+
type MockupAnnotation,
|
|
11
|
+
type MockupState,
|
|
12
|
+
} from "./mockup";
|
|
8
13
|
|
|
9
14
|
/** Who wrote a version of a mockup: the AI's tools, this viewer, or an edit of the file. */
|
|
10
15
|
export type MockupVersionAuthor = "ai" | "you" | "disk";
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
export const FIXTURES_ONLY_QUERY = "fixtures";
|
|
3
3
|
export const FIXTURES_ONLY_VALUE = "only";
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* The query that marks `/dms-preview` as the mockup viewer's page frame, on
|
|
7
|
-
* sample or real data alike, and its value: that frame hands the viewer its
|
|
8
|
-
* zoom wheel and reports where its blocks sit while not inspecting.
|
|
9
|
-
*/
|
|
10
|
-
export const MOCKUP_PAGE_FRAME_QUERY = "frame";
|
|
11
|
-
export const MOCKUP_PAGE_FRAME_VALUE = "page";
|
|
12
|
-
|
|
13
5
|
/** The routes answering a mockup's fixtures and its own state. */
|
|
14
6
|
const MOCKUP_ROUTES = "/api/mockup/";
|
|
15
7
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isBoolean,
|
|
3
|
-
isNumber,
|
|
4
3
|
isObject,
|
|
5
4
|
isString,
|
|
6
5
|
} from "../../../../dms-core/app/utils/type-check";
|
|
7
|
-
import type { PreviewSketch } from "./blockPreview";
|
|
8
|
-
import { isPreviewSketch } from "./blockPreviewNavigation";
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* The layouts a mockup page is drawn in, named after their factories:
|
|
@@ -38,51 +35,12 @@ const LAYOUT_OPTION_KEYS: readonly string[] = [
|
|
|
38
35
|
"hideFooter",
|
|
39
36
|
] satisfies (keyof PreviewPageLayoutOptions)[];
|
|
40
37
|
|
|
41
|
-
/**
|
|
42
|
-
export interface
|
|
38
|
+
/** The layout a page is drawn in, with its options. */
|
|
39
|
+
export interface PreviewPageLayout {
|
|
43
40
|
type: PreviewPageLayoutType;
|
|
44
41
|
options?: PreviewPageLayoutOptions;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
/** The side of the page a custom layout's aside is on. */
|
|
48
|
-
export type PreviewAsideSide = "start" | "end";
|
|
49
|
-
|
|
50
|
-
const ASIDE_SIDES: ReadonlySet<unknown> = new Set<PreviewAsideSide>([
|
|
51
|
-
"start",
|
|
52
|
-
"end",
|
|
53
|
-
]);
|
|
54
|
-
|
|
55
|
-
/** The aside of a custom layout: a sketch beside the page, `width` pixels wide. */
|
|
56
|
-
export interface PreviewLayoutAside extends PreviewSketch {
|
|
57
|
-
width: number;
|
|
58
|
-
side: PreviewAsideSide;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* A layout the spec declares, resolved for the page that names it: sketches
|
|
63
|
-
* drawn above, beside and under the page, and whether the dashboard's
|
|
64
|
-
* sidebar, top bar and page header stay around it.
|
|
65
|
-
*/
|
|
66
|
-
export interface PreviewCustomLayout {
|
|
67
|
-
type: "custom";
|
|
68
|
-
id: string;
|
|
69
|
-
title: string;
|
|
70
|
-
dashboard: boolean;
|
|
71
|
-
header?: PreviewSketch;
|
|
72
|
-
aside?: PreviewLayoutAside;
|
|
73
|
-
footer?: PreviewSketch;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** The layout a page is drawn in: one of the DMS's with its options, or a custom layout of the mockup. */
|
|
77
|
-
export type PreviewPageLayout = PreviewBuiltInLayout | PreviewCustomLayout;
|
|
78
|
-
|
|
79
|
-
/** The sketches a custom layout draws around the page. */
|
|
80
|
-
export interface PreviewCustomRegions {
|
|
81
|
-
header?: PreviewSketch;
|
|
82
|
-
aside?: PreviewLayoutAside;
|
|
83
|
-
footer?: PreviewSketch;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
44
|
/** What the preview draws around a page's blocks. */
|
|
87
45
|
export interface PreviewFrame {
|
|
88
46
|
/** The dashboard's sidebar and top bar. */
|
|
@@ -99,8 +57,6 @@ export interface PreviewFrame {
|
|
|
99
57
|
brand: boolean;
|
|
100
58
|
/** Without the dashboard: the footer under the page. */
|
|
101
59
|
footer: boolean;
|
|
102
|
-
/** A custom layout's sketches around the page; absent for the DMS's own layouts. */
|
|
103
|
-
custom?: PreviewCustomRegions;
|
|
104
60
|
}
|
|
105
61
|
|
|
106
62
|
function isRecord(
|
|
@@ -129,34 +85,10 @@ function isLayoutOptions(value: unknown): value is PreviewPageLayoutOptions {
|
|
|
129
85
|
);
|
|
130
86
|
}
|
|
131
87
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function isLayoutAside(value: unknown): value is PreviewLayoutAside {
|
|
137
|
-
return (
|
|
138
|
-
isPreviewSketch(value) &&
|
|
139
|
-
isRecord(value) &&
|
|
140
|
-
isNumber(value.width) &&
|
|
141
|
-
Number.isFinite(value.width) &&
|
|
142
|
-
ASIDE_SIDES.has(value.side)
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function isCustomLayout(value: unknown): value is PreviewCustomLayout {
|
|
147
|
-
return (
|
|
148
|
-
isRecord(value) &&
|
|
149
|
-
value.type === "custom" &&
|
|
150
|
-
isString(value.id) &&
|
|
151
|
-
isString(value.title) &&
|
|
152
|
-
isBoolean(value.dashboard) &&
|
|
153
|
-
isOptionalSketch(value.header) &&
|
|
154
|
-
(value.aside === undefined || isLayoutAside(value.aside)) &&
|
|
155
|
-
isOptionalSketch(value.footer)
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function isBuiltInLayout(value: unknown): value is PreviewBuiltInLayout {
|
|
88
|
+
/** Whether `value` is a layout a page is drawn in, each option a boolean the layouts take. */
|
|
89
|
+
export function isPreviewPageLayout(
|
|
90
|
+
value: unknown,
|
|
91
|
+
): value is PreviewPageLayout {
|
|
160
92
|
return (
|
|
161
93
|
isRecord(value) &&
|
|
162
94
|
isLayoutType(value.type) &&
|
|
@@ -164,16 +96,6 @@ function isBuiltInLayout(value: unknown): value is PreviewBuiltInLayout {
|
|
|
164
96
|
);
|
|
165
97
|
}
|
|
166
98
|
|
|
167
|
-
/**
|
|
168
|
-
* Whether `value` is a layout a page is drawn in: one of the DMS's, each
|
|
169
|
-
* option a boolean the layouts take, or a custom layout, each region a sketch.
|
|
170
|
-
*/
|
|
171
|
-
export function isPreviewPageLayout(
|
|
172
|
-
value: unknown,
|
|
173
|
-
): value is PreviewPageLayout {
|
|
174
|
-
return isBuiltInLayout(value) || isCustomLayout(value);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
99
|
/** Whether `value` is absent, or a layout a page is drawn in. */
|
|
178
100
|
export function isOptionalPreviewPageLayout(
|
|
179
101
|
value: unknown,
|
|
@@ -201,7 +123,6 @@ export function isOptionalStringRecord(
|
|
|
201
123
|
export function previewFrameOf(
|
|
202
124
|
layout: PreviewPageLayout | undefined,
|
|
203
125
|
): PreviewFrame {
|
|
204
|
-
if (layout?.type === "custom") return customFrameOf(layout);
|
|
205
126
|
const options = layout?.options ?? {};
|
|
206
127
|
const fillHeight = options.fillHeight ?? false;
|
|
207
128
|
if (layout?.type === "empty") {
|
|
@@ -226,26 +147,3 @@ export function previewFrameOf(
|
|
|
226
147
|
footer: false,
|
|
227
148
|
};
|
|
228
149
|
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* What the preview draws around a page in a custom layout: the dashboard's
|
|
232
|
-
* sidebar, top bar and page header when the layout keeps the dashboard, none
|
|
233
|
-
* of them and no logo or footer when it does not, and the layout's sketches,
|
|
234
|
-
* the blocks spanning the panel either way.
|
|
235
|
-
*/
|
|
236
|
-
function customFrameOf(layout: PreviewCustomLayout): PreviewFrame {
|
|
237
|
-
return {
|
|
238
|
-
dashboard: layout.dashboard,
|
|
239
|
-
header: layout.dashboard,
|
|
240
|
-
fullWidth: true,
|
|
241
|
-
settings: false,
|
|
242
|
-
fillHeight: false,
|
|
243
|
-
brand: false,
|
|
244
|
-
footer: false,
|
|
245
|
-
custom: {
|
|
246
|
-
...(layout.header && { header: layout.header }),
|
|
247
|
-
...(layout.aside && { aside: layout.aside }),
|
|
248
|
-
...(layout.footer && { footer: layout.footer }),
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FIXTURES_ONLY_QUERY,
|
|
3
|
-
MOCKUP_PAGE_FRAME_QUERY,
|
|
4
|
-
} from "./previewFixturesOnly";
|
|
1
|
+
import { FIXTURES_ONLY_QUERY } from "./previewFixturesOnly";
|
|
5
2
|
|
|
6
3
|
/** The query `/dms-preview` reads its first state from. */
|
|
7
4
|
export const STATE_QUERY = "state";
|
|
@@ -10,7 +7,6 @@ export const STATE_QUERY = "state";
|
|
|
10
7
|
const PREVIEW_QUERY_KEYS: ReadonlySet<string> = new Set([
|
|
11
8
|
STATE_QUERY,
|
|
12
9
|
FIXTURES_ONLY_QUERY,
|
|
13
|
-
MOCKUP_PAGE_FRAME_QUERY,
|
|
14
10
|
]);
|
|
15
11
|
|
|
16
12
|
type QueryValue = string | null | readonly (string | null)[];
|