@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
|
@@ -9,29 +9,6 @@ import {
|
|
|
9
9
|
isPreviewPageLayout,
|
|
10
10
|
type PreviewPageLayout,
|
|
11
11
|
} from "./previewPageLayout";
|
|
12
|
-
import { isMockupEntities, type MockupEntityState } from "./mockupEntities";
|
|
13
|
-
import {
|
|
14
|
-
isMockupModules,
|
|
15
|
-
isPagePlace,
|
|
16
|
-
type MockupModule,
|
|
17
|
-
type MockupPagePlace,
|
|
18
|
-
} from "./mockupModules";
|
|
19
|
-
import { isMockupTenants, type MockupTenant } from "./mockupTenants";
|
|
20
|
-
|
|
21
|
-
export { MOCKUP_FIELD_TYPES } from "./mockupEntities";
|
|
22
|
-
export type {
|
|
23
|
-
MockupExtensionMenu,
|
|
24
|
-
MockupModule,
|
|
25
|
-
MockupModuleSettingsPage,
|
|
26
|
-
MockupModuleWidget,
|
|
27
|
-
MockupPagePlace,
|
|
28
|
-
MockupWidgetPosition,
|
|
29
|
-
} from "./mockupModules";
|
|
30
|
-
export type {
|
|
31
|
-
MockupEntityField,
|
|
32
|
-
MockupEntityState,
|
|
33
|
-
MockupFieldType,
|
|
34
|
-
} from "./mockupEntities";
|
|
35
12
|
|
|
36
13
|
/** A problem in `spec.json`, at a JSON pointer into it (`""` is the whole file). */
|
|
37
14
|
export interface MockupIssue {
|
|
@@ -66,9 +43,7 @@ export interface MockupPageRoute {
|
|
|
66
43
|
export interface MockupPageState {
|
|
67
44
|
id: string;
|
|
68
45
|
title: string;
|
|
69
|
-
/**
|
|
70
|
-
place: MockupPagePlace;
|
|
71
|
-
/** The id of the section the page is listed under; none for the default one, and for a page of a module. */
|
|
46
|
+
/** The id of the section the page is listed under; none for the default one. */
|
|
72
47
|
category?: string;
|
|
73
48
|
/** The sidebar leaves the page out: a detail or form page another page opens. */
|
|
74
49
|
menu?: false;
|
|
@@ -86,7 +61,7 @@ export interface MockupPageState {
|
|
|
86
61
|
icon?: string;
|
|
87
62
|
description?: string;
|
|
88
63
|
headerActions?: PreviewHeaderAction[];
|
|
89
|
-
/** The layout the page is drawn in; the dashboard frame when absent.
|
|
64
|
+
/** The layout the page is drawn in; the dashboard frame when absent. */
|
|
90
65
|
layout?: PreviewPageLayout;
|
|
91
66
|
options: MockupPageOptions;
|
|
92
67
|
/** What `DmsBlockPreview` draws: fixtures resolved, sketch nodes passed through. */
|
|
@@ -96,13 +71,6 @@ export interface MockupPageState {
|
|
|
96
71
|
* on. Present only when the page names live routes.
|
|
97
72
|
*/
|
|
98
73
|
realTree?: PreviewNode[];
|
|
99
|
-
/**
|
|
100
|
-
* The route of the page's fixture batch, `?v=` the digest of its content
|
|
101
|
-
* and of which fixtures a tenant sees only its own rows of: it changes with
|
|
102
|
-
* the fixtures the page reads, for every tenant, so a page whose fixtures
|
|
103
|
-
* changed is another page object. Absent when the page reads no fixture.
|
|
104
|
-
*/
|
|
105
|
-
fixtures?: string;
|
|
106
74
|
livePage?: MockupLivePage;
|
|
107
75
|
/** Spec JSON pointer of each node, keyed by the layout path the preview gives it. */
|
|
108
76
|
paths: Record<string, string>;
|
|
@@ -124,6 +92,15 @@ export interface MockupSidebar {
|
|
|
124
92
|
widgets: MockupSidebarWidget[];
|
|
125
93
|
}
|
|
126
94
|
|
|
95
|
+
/** A DMS module the mockup's app needs: its entry in the module store catalog. */
|
|
96
|
+
export interface MockupModule {
|
|
97
|
+
/** The module's id in the catalog. */
|
|
98
|
+
id: string;
|
|
99
|
+
/** The npm package building the mockup installs. */
|
|
100
|
+
package: string;
|
|
101
|
+
icon: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
127
104
|
export interface MockupState {
|
|
128
105
|
name: string;
|
|
129
106
|
title?: string;
|
|
@@ -135,18 +112,79 @@ export interface MockupState {
|
|
|
135
112
|
sidebar?: MockupSidebar;
|
|
136
113
|
/** Absent when the spec lists no module. */
|
|
137
114
|
modules?: MockupModule[];
|
|
138
|
-
/** The spec's entities, in spec order; absent when the spec has none. */
|
|
139
|
-
entities?: MockupEntityState[];
|
|
140
|
-
/** `fixtures.tenants` of the spec: the workspaces SaaS mode lists; absent when the spec has none. */
|
|
141
|
-
tenants?: MockupTenant[];
|
|
142
|
-
/** `data.connection` of the spec: the external connection the explorer introspects; absent when the spec has no `data`. */
|
|
143
|
-
connection?: string;
|
|
144
115
|
pages: MockupPageState[];
|
|
145
116
|
issues: MockupIssue[];
|
|
146
117
|
/** What the spec likely does not show as meant; absent from a backend that reports none. */
|
|
147
118
|
warnings?: MockupIssue[];
|
|
148
119
|
}
|
|
149
120
|
|
|
121
|
+
export type MockupAnnotationStatus = "open" | "resolved";
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The block a note is about: the node whose id is `block`, on the page `page`
|
|
125
|
+
* when set, then the children whose ids are `steps`.
|
|
126
|
+
*/
|
|
127
|
+
export interface MockupBlockAnchor {
|
|
128
|
+
block: string;
|
|
129
|
+
steps: string[];
|
|
130
|
+
page?: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** What a note is on: a block, or the page `page` as a whole. */
|
|
134
|
+
export type MockupNoteAnchor = MockupBlockAnchor | { page: string };
|
|
135
|
+
|
|
136
|
+
/** Where a pin sits on its block or page: fractions of its box, from its top left corner. */
|
|
137
|
+
export interface MockupPinOffset {
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A reviewer's pin. `page` and `path` are where it is now: both on a block,
|
|
144
|
+
* `page` alone on a page, neither when its block or page was removed.
|
|
145
|
+
* `version` is the number of the history version it was pinned on, and
|
|
146
|
+
* `resolvedVersion` the one it was resolved on.
|
|
147
|
+
*/
|
|
148
|
+
export interface MockupAnnotation {
|
|
149
|
+
id: string;
|
|
150
|
+
anchor: MockupNoteAnchor;
|
|
151
|
+
offset: MockupPinOffset;
|
|
152
|
+
page?: string;
|
|
153
|
+
/** Spec JSON pointer of the note's block now. */
|
|
154
|
+
path?: string;
|
|
155
|
+
text: string;
|
|
156
|
+
status: MockupAnnotationStatus;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
resolvedAt?: string;
|
|
159
|
+
version?: number;
|
|
160
|
+
resolvedVersion?: number;
|
|
161
|
+
/** The state of the sketch the note was pinned on; absent on its own `html` and on any other block. */
|
|
162
|
+
state?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Where a pin is put: on the node at `path` of page `page`, or on the page
|
|
167
|
+
* itself without `path`, and the state of the sketch drawn there.
|
|
168
|
+
*/
|
|
169
|
+
export interface MockupPinPlace {
|
|
170
|
+
page: string;
|
|
171
|
+
path?: string;
|
|
172
|
+
offset: MockupPinOffset;
|
|
173
|
+
state?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** What `POST /api/mockup/:name/annotations` takes. */
|
|
177
|
+
export interface MockupAnnotationDraft extends MockupPinPlace {
|
|
178
|
+
text: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** What `PATCH /api/mockup/:name/annotations/:id` takes. */
|
|
182
|
+
export interface MockupAnnotationPatch {
|
|
183
|
+
status?: MockupAnnotationStatus;
|
|
184
|
+
text?: string;
|
|
185
|
+
place?: MockupPinPlace;
|
|
186
|
+
}
|
|
187
|
+
|
|
150
188
|
/** Who wrote a mockup: the dashboard chat, Claude Code or Codex. */
|
|
151
189
|
export type MockupSource = "chat" | "claude-code" | "codex";
|
|
152
190
|
|
|
@@ -215,15 +253,9 @@ export const MOCKUP_LIST_ENDPOINT = "/api/mockup";
|
|
|
215
253
|
/** The path under a mockup's endpoint of the stored image of its first page. */
|
|
216
254
|
export const MOCKUP_CAPTURE_SUFFIX = "/capture";
|
|
217
255
|
|
|
218
|
-
/** The path under a mockup's endpoint of the images the Overview captured of its pages: all of them on a `GET`, `/<page>` on a `PUT`. */
|
|
219
|
-
export const MOCKUP_PAGE_CAPTURES_SUFFIX = "/captures";
|
|
220
|
-
|
|
221
256
|
/** Event of the state stream carrying a {@link MockupState}. */
|
|
222
257
|
export const MOCKUP_STATE_EVENT = "state";
|
|
223
258
|
|
|
224
|
-
/** Event of the state stream carrying the patch from the state the stream sent last to the state now. */
|
|
225
|
-
export const MOCKUP_PATCH_EVENT = "patch";
|
|
226
|
-
|
|
227
259
|
/** Event of the state stream carrying `{ annotations }`. */
|
|
228
260
|
export const MOCKUP_ANNOTATIONS_EVENT = "annotations";
|
|
229
261
|
|
|
@@ -269,6 +301,10 @@ function isOptionalString(value: Parameters<typeof isString>[0]): boolean {
|
|
|
269
301
|
return value === undefined || isString(value);
|
|
270
302
|
}
|
|
271
303
|
|
|
304
|
+
function isOptionalNumber(value: Parameters<typeof isNumber>[0]): boolean {
|
|
305
|
+
return value === undefined || isNumber(value);
|
|
306
|
+
}
|
|
307
|
+
|
|
272
308
|
function isIssue(value: Parameters<typeof isObject>[0]): value is MockupIssue {
|
|
273
309
|
return isRecord(value) && isString(value.path) && isString(value.message);
|
|
274
310
|
}
|
|
@@ -307,32 +343,13 @@ function hasPagePlace(value: Parameters<typeof isObject>[0]): boolean {
|
|
|
307
343
|
);
|
|
308
344
|
}
|
|
309
345
|
|
|
310
|
-
|
|
311
|
-
function hasPageContent(value: Parameters<typeof isObject>[0]): boolean {
|
|
312
|
-
return (
|
|
313
|
-
isRecord(value) &&
|
|
314
|
-
isRecord(value.options) &&
|
|
315
|
-
Array.isArray(value.tree) &&
|
|
316
|
-
isPreviewTree(value.tree) &&
|
|
317
|
-
(value.realTree === undefined ||
|
|
318
|
-
(Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
|
|
319
|
-
isOptionalString(value.fixtures) &&
|
|
320
|
-
(value.livePage === undefined ||
|
|
321
|
-
(isRecord(value.livePage) && isString(value.livePage.ref))) &&
|
|
322
|
-
isRecord(value.paths) &&
|
|
323
|
-
Object.values(value.paths).every((pointer) => isString(pointer))
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/** Whether `value` is a page of a state, every field of it checked. */
|
|
328
|
-
export function isPageState(
|
|
346
|
+
function isPageState(
|
|
329
347
|
value: Parameters<typeof isObject>[0],
|
|
330
348
|
): value is MockupPageState {
|
|
331
349
|
return (
|
|
332
350
|
isRecord(value) &&
|
|
333
351
|
isString(value.id) &&
|
|
334
352
|
isString(value.title) &&
|
|
335
|
-
isPagePlace(value.place) &&
|
|
336
353
|
isOptionalString(value.category) &&
|
|
337
354
|
hasPagePlace(value) &&
|
|
338
355
|
isPreviewHeader({
|
|
@@ -342,7 +359,15 @@ export function isPageState(
|
|
|
342
359
|
actions: value.headerActions,
|
|
343
360
|
}) &&
|
|
344
361
|
(value.layout === undefined || isPreviewPageLayout(value.layout)) &&
|
|
345
|
-
|
|
362
|
+
isRecord(value.options) &&
|
|
363
|
+
Array.isArray(value.tree) &&
|
|
364
|
+
isPreviewTree(value.tree) &&
|
|
365
|
+
(value.realTree === undefined ||
|
|
366
|
+
(Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
|
|
367
|
+
(value.livePage === undefined ||
|
|
368
|
+
(isRecord(value.livePage) && isString(value.livePage.ref))) &&
|
|
369
|
+
isRecord(value.paths) &&
|
|
370
|
+
Object.values(value.paths).every((pointer) => isString(pointer))
|
|
346
371
|
);
|
|
347
372
|
}
|
|
348
373
|
|
|
@@ -369,14 +394,14 @@ function isSidebar(
|
|
|
369
394
|
);
|
|
370
395
|
}
|
|
371
396
|
|
|
372
|
-
|
|
373
|
-
|
|
397
|
+
function isModule(
|
|
398
|
+
value: Parameters<typeof isObject>[0],
|
|
399
|
+
): value is MockupModule {
|
|
374
400
|
return (
|
|
375
401
|
isRecord(value) &&
|
|
376
|
-
(value.
|
|
377
|
-
(value.
|
|
378
|
-
(value.
|
|
379
|
-
(value.tenants === undefined || isMockupTenants(value.tenants))
|
|
402
|
+
isString(value.id) &&
|
|
403
|
+
isString(value.package) &&
|
|
404
|
+
isString(value.icon)
|
|
380
405
|
);
|
|
381
406
|
}
|
|
382
407
|
|
|
@@ -391,8 +416,9 @@ function isMockupState(
|
|
|
391
416
|
(value.categories === undefined ||
|
|
392
417
|
(Array.isArray(value.categories) &&
|
|
393
418
|
value.categories.every(isMockupCategory))) &&
|
|
394
|
-
|
|
395
|
-
|
|
419
|
+
(value.sidebar === undefined || isSidebar(value.sidebar)) &&
|
|
420
|
+
(value.modules === undefined ||
|
|
421
|
+
(Array.isArray(value.modules) && value.modules.every(isModule))) &&
|
|
396
422
|
Array.isArray(value.pages) &&
|
|
397
423
|
value.pages.every(isPageState) &&
|
|
398
424
|
Array.isArray(value.issues) &&
|
|
@@ -409,6 +435,67 @@ export function parseMockupState(
|
|
|
409
435
|
return isMockupState(value) ? value : undefined;
|
|
410
436
|
}
|
|
411
437
|
|
|
438
|
+
function isAnchor(
|
|
439
|
+
value: Parameters<typeof isObject>[0],
|
|
440
|
+
): value is MockupNoteAnchor {
|
|
441
|
+
if (!isRecord(value)) return false;
|
|
442
|
+
if (value.block === undefined) return isString(value.page);
|
|
443
|
+
return (
|
|
444
|
+
isString(value.block) &&
|
|
445
|
+
Array.isArray(value.steps) &&
|
|
446
|
+
value.steps.every((step) => isString(step)) &&
|
|
447
|
+
isOptionalString(value.page)
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function isFraction(value: Parameters<typeof isNumber>[0]): boolean {
|
|
452
|
+
return isNumber(value) && value >= 0 && value <= 1;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function isOffset(
|
|
456
|
+
value: Parameters<typeof isObject>[0],
|
|
457
|
+
): value is MockupPinOffset {
|
|
458
|
+
return isRecord(value) && isFraction(value.x) && isFraction(value.y);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function isAnnotation(
|
|
462
|
+
value: Parameters<typeof isObject>[0],
|
|
463
|
+
): value is MockupAnnotation {
|
|
464
|
+
return (
|
|
465
|
+
isRecord(value) &&
|
|
466
|
+
isString(value.id) &&
|
|
467
|
+
isAnchor(value.anchor) &&
|
|
468
|
+
isOffset(value.offset) &&
|
|
469
|
+
isOptionalString(value.page) &&
|
|
470
|
+
isOptionalString(value.path) &&
|
|
471
|
+
isString(value.text) &&
|
|
472
|
+
(value.status === "open" || value.status === "resolved") &&
|
|
473
|
+
isString(value.createdAt) &&
|
|
474
|
+
isOptionalString(value.resolvedAt) &&
|
|
475
|
+
isOptionalNumber(value.version) &&
|
|
476
|
+
isOptionalNumber(value.resolvedVersion) &&
|
|
477
|
+
isOptionalString(value.state)
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** The annotation a `POST` or `PATCH` answers, or undefined when the answer is not one. */
|
|
482
|
+
export function parseAnnotation(
|
|
483
|
+
value: Parameters<typeof isObject>[0],
|
|
484
|
+
): MockupAnnotation | undefined {
|
|
485
|
+
return isAnnotation(value) ? value : undefined;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/** The annotations of an `{ annotations }` answer or event, or undefined when it is not one. */
|
|
489
|
+
export function parseAnnotations(
|
|
490
|
+
value: Parameters<typeof isObject>[0],
|
|
491
|
+
): MockupAnnotation[] | undefined {
|
|
492
|
+
if (!isRecord(value)) return undefined;
|
|
493
|
+
const { annotations } = value;
|
|
494
|
+
return Array.isArray(annotations) && annotations.every(isAnnotation)
|
|
495
|
+
? annotations
|
|
496
|
+
: undefined;
|
|
497
|
+
}
|
|
498
|
+
|
|
412
499
|
function isSource(
|
|
413
500
|
value: Parameters<typeof isString>[0],
|
|
414
501
|
): value is MockupSource {
|
|
@@ -506,3 +593,14 @@ export function layoutPathFor(
|
|
|
506
593
|
): string | undefined {
|
|
507
594
|
return Object.entries(page.paths).find(([, at]) => at === pointer)?.[0];
|
|
508
595
|
}
|
|
596
|
+
|
|
597
|
+
/** `annotation` with the answer of a `PATCH` or `POST` merged into `list`, newest last. */
|
|
598
|
+
export function upsertAnnotation(
|
|
599
|
+
list: readonly MockupAnnotation[],
|
|
600
|
+
annotation: MockupAnnotation,
|
|
601
|
+
): MockupAnnotation[] {
|
|
602
|
+
const exists = list.some((entry) => entry.id === annotation.id);
|
|
603
|
+
return exists
|
|
604
|
+
? list.map((entry) => (entry.id === annotation.id ? annotation : entry))
|
|
605
|
+
: [...list, annotation];
|
|
606
|
+
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { shallowRef, type Ref, type ShallowRef } from "vue";
|
|
2
|
-
import type { JsonValue } from "../../../../dms-core/app/types/json";
|
|
3
|
-
import { textDigest } from "../../../../dms-core/app/utils/textDigest";
|
|
4
|
-
import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
|
|
5
2
|
import type {
|
|
6
3
|
PreviewBlockRect,
|
|
7
4
|
PreviewNavigation,
|
|
8
5
|
} from "./blockPreviewMessages";
|
|
9
|
-
import { parseBlockRects } from "./blockPreviewRects";
|
|
10
|
-
import { isObjectValue } from "./json";
|
|
11
6
|
import type { MockupPageState } from "./mockup";
|
|
12
7
|
import { mockupPageRender } from "./mockupFrame";
|
|
13
8
|
import { mockupDataTree } from "./mockupRealData";
|
|
@@ -36,34 +31,17 @@ export type PageCaptures = ReadonlyMap<string, PageCapture>;
|
|
|
36
31
|
/** The sidebar every page is drawn in, which is the same for all of them and so says nothing of one. */
|
|
37
32
|
const NO_NAVIGATION: PreviewNavigation = { sections: [] };
|
|
38
33
|
|
|
39
|
-
/** Changes with how a preview draws a capture, or with what the server keeps of one, so that every image taken before it is out of date. */
|
|
40
|
-
const CAPTURE_VERSION = 1;
|
|
41
|
-
|
|
42
34
|
/**
|
|
43
|
-
* What draws `page` alone:
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* frame follows when the page names none. Another page changing, or the
|
|
48
|
-
* pages' order or titles, leaves the key as it was; changing the page
|
|
49
|
-
* itself, its theme or locale, its fixtures, Real data, or the viewer's
|
|
50
|
-
* language for a page that names none, does not. It is short, and made of
|
|
51
|
-
* letters, digits and dashes, so the server keeps it as the name of what its
|
|
52
|
-
* image was drawn from.
|
|
35
|
+
* What draws `page` alone: its own state as the preview is sent it, minus
|
|
36
|
+
* the sidebar, and whether it reads real data. Another page changing, or
|
|
37
|
+
* the pages' order or titles, leaves the key as it was; changing the page
|
|
38
|
+
* itself, its theme or locale, or Real data does not.
|
|
53
39
|
*/
|
|
54
|
-
export function captureKey(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
59
|
-
return `c${CAPTURE_VERSION}-${textDigest(
|
|
60
|
-
JSON.stringify([
|
|
61
|
-
realData,
|
|
62
|
-
page.fixtures ?? null,
|
|
63
|
-
page.options.locale ?? locale,
|
|
64
|
-
mockupPageRender(page, mockupDataTree(page, realData), NO_NAVIGATION),
|
|
65
|
-
]),
|
|
66
|
-
)}`;
|
|
40
|
+
export function captureKey(page: MockupPageState, realData: boolean): string {
|
|
41
|
+
return JSON.stringify([
|
|
42
|
+
realData,
|
|
43
|
+
mockupPageRender(page, mockupDataTree(page, realData), NO_NAVIGATION),
|
|
44
|
+
]);
|
|
67
45
|
}
|
|
68
46
|
|
|
69
47
|
/**
|
|
@@ -143,96 +121,9 @@ export function releaseCaptureUpload(
|
|
|
143
121
|
if (sent.get(name) === JSON.stringify([page, key])) sent.delete(name);
|
|
144
122
|
}
|
|
145
123
|
|
|
146
|
-
/** The images a data URL of an image holds, which is how the server sends one. */
|
|
147
|
-
const IMAGE_DATA_URL = /^data:image\/(?:webp|png);base64,/;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* The captures `GET /captures` answered, by page id. An entry whose key or
|
|
151
|
-
* image is not a string, whose image is not a WebP or PNG data URL, or whose
|
|
152
|
-
* blocks are not all a path and a box, is left out, so a page nothing sound
|
|
153
|
-
* is known of is drawn live as if it had no capture.
|
|
154
|
-
*/
|
|
155
|
-
export function parseSeededCaptures(
|
|
156
|
-
value: JsonValue | undefined,
|
|
157
|
-
): Map<string, PageCapture> {
|
|
158
|
-
const captures = new Map<string, PageCapture>();
|
|
159
|
-
if (!isObjectValue(value)) return captures;
|
|
160
|
-
for (const [page, entry] of Object.entries(value)) {
|
|
161
|
-
if (!isObjectValue(entry)) continue;
|
|
162
|
-
const { key, src, height, blocks } = entry;
|
|
163
|
-
if (!isString(key) || !isString(src) || !IMAGE_DATA_URL.test(src)) continue;
|
|
164
|
-
const drawn = blocks === undefined ? undefined : parseBlockRects(blocks);
|
|
165
|
-
if (blocks !== undefined && drawn === undefined) continue;
|
|
166
|
-
captures.set(page, {
|
|
167
|
-
key,
|
|
168
|
-
url: src,
|
|
169
|
-
...(isNumber(height) &&
|
|
170
|
-
Number.isFinite(height) &&
|
|
171
|
-
height >= 0 && { height }),
|
|
172
|
-
...(drawn && { blocks: drawn }),
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return captures;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* What the server holds of each mockup's pages as far as this browser session
|
|
180
|
-
* knows, by mockup and page: the key of the capture it holds.
|
|
181
|
-
*/
|
|
182
|
-
const persisted = new Map<string, Map<string, string>>();
|
|
183
|
-
|
|
184
|
-
/** Whether the server holds the capture of `page` of the mockup `name` for `key`. */
|
|
185
|
-
export function isCapturePersisted(
|
|
186
|
-
name: string,
|
|
187
|
-
page: string,
|
|
188
|
-
key: string,
|
|
189
|
-
): boolean {
|
|
190
|
-
return persisted.get(name)?.get(page) === key;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** Records that the server holds the capture of `page` of the mockup `name` for `key`. */
|
|
194
|
-
export function markCapturePersisted(
|
|
195
|
-
name: string,
|
|
196
|
-
page: string,
|
|
197
|
-
key: string,
|
|
198
|
-
): void {
|
|
199
|
-
const pages = persisted.get(name) ?? new Map<string, string>();
|
|
200
|
-
pages.set(page, key);
|
|
201
|
-
persisted.set(name, pages);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/** The mockups whose captures were read from the server in this session. */
|
|
205
|
-
const seeded = new Set<string>();
|
|
206
|
-
|
|
207
|
-
/** Whether the captures of the mockup `name` were read from the server in this session. */
|
|
208
|
-
export function hasSeededCaptures(name: string): boolean {
|
|
209
|
-
return seeded.has(name);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Keeps the captures the server held for the mockup `name`, but for a page
|
|
214
|
-
* this browser captured since it asked: a capture taken here is never
|
|
215
|
-
* replaced by one read later. What is kept is what the server holds.
|
|
216
|
-
*/
|
|
217
|
-
export function seedPageCaptures(
|
|
218
|
-
name: string,
|
|
219
|
-
captures: ReadonlyMap<string, PageCapture>,
|
|
220
|
-
): void {
|
|
221
|
-
const store = storeOf(name);
|
|
222
|
-
const next = new Map(store.value);
|
|
223
|
-
for (const [page, capture] of captures) {
|
|
224
|
-
markCapturePersisted(name, page, capture.key);
|
|
225
|
-
if (!next.has(page)) next.set(page, capture);
|
|
226
|
-
}
|
|
227
|
-
store.value = next;
|
|
228
|
-
seeded.add(name);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
124
|
/** Forgets every capture of the mockup `name`, and releases its images. */
|
|
232
125
|
export function clearMockupCaptures(name: string): void {
|
|
233
126
|
sent.delete(name);
|
|
234
|
-
persisted.delete(name);
|
|
235
|
-
seeded.delete(name);
|
|
236
127
|
const store = storeOf(name);
|
|
237
128
|
for (const { url } of store.value.values()) URL.revokeObjectURL(url);
|
|
238
129
|
store.value = new Map();
|