@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,154 +0,0 @@
|
|
|
1
|
-
import { getCurrentScope, onScopeDispose } from "vue";
|
|
2
|
-
import type { MockupPageState } from "../../utils/mockup";
|
|
3
|
-
import { tenantFixtureRoute } from "../../utils/mockupTenancy";
|
|
4
|
-
import {
|
|
5
|
-
isPreviewFixtureBatch,
|
|
6
|
-
type PreviewFixtureBatch,
|
|
7
|
-
} from "../../utils/previewFixtureAnswers";
|
|
8
|
-
|
|
9
|
-
/** Reads the JSON a route answers: `$authFetch`. */
|
|
10
|
-
export type ReadRoute = (
|
|
11
|
-
route: string,
|
|
12
|
-
) => Promise<Parameters<typeof isPreviewFixtureBatch>[0]>;
|
|
13
|
-
|
|
14
|
-
/** What the viewer needs of a page to read its fixtures. */
|
|
15
|
-
export type FixtureBatchPage = Pick<MockupPageState, "id" | "fixtures">;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The waits, in milliseconds, between the tries of one batch read: a read
|
|
19
|
-
* that fails is tried again after each, so a blip of the connection costs a
|
|
20
|
-
* moment, and an outage is reported after the last.
|
|
21
|
-
*/
|
|
22
|
-
const BATCH_RETRY_DELAYS_MS: readonly number[] = [300, 900, 2700];
|
|
23
|
-
|
|
24
|
-
/** How a mockup's batches are read. */
|
|
25
|
-
export interface FixtureBatchOptions {
|
|
26
|
-
/** The waits between the tries of a read; {@link BATCH_RETRY_DELAYS_MS} by default. */
|
|
27
|
-
retryDelaysMs?: readonly number[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** The fixture batches of a mockup's pages, each read once while it stays what it was. */
|
|
31
|
-
export interface FixtureBatches {
|
|
32
|
-
/**
|
|
33
|
-
* The fixtures `page` reads, as `tenant` sees them when one is given:
|
|
34
|
-
* undefined when the page reads none. A frame has no other way to read
|
|
35
|
-
* them, so a read that fails or answers no batch is tried again after each
|
|
36
|
-
* of the retry delays, and rejects with why the last try failed. A page's
|
|
37
|
-
* batch is read again only when its route, which holds the digest of the
|
|
38
|
-
* batch, changed.
|
|
39
|
-
*/
|
|
40
|
-
of: (
|
|
41
|
-
page: FixtureBatchPage,
|
|
42
|
-
tenant?: string,
|
|
43
|
-
) => Promise<PreviewFixtureBatch | undefined>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** The failure of a read, as an `Error`. */
|
|
47
|
-
function failureOf(cause: unknown): Error {
|
|
48
|
-
return cause instanceof Error ? cause : new Error(String(cause));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function sleep(milliseconds: number): Promise<void> {
|
|
52
|
-
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Reads the batches of the pages `read` can reach, one request per page and
|
|
57
|
-
* tenant until the page's fixtures change, and stops trying again once the
|
|
58
|
-
* scope it was made in is disposed.
|
|
59
|
-
*/
|
|
60
|
-
export function useFixtureBatches(
|
|
61
|
-
read: ReadRoute,
|
|
62
|
-
options: FixtureBatchOptions = {},
|
|
63
|
-
): FixtureBatches {
|
|
64
|
-
const delays = options.retryDelaysMs ?? BATCH_RETRY_DELAYS_MS;
|
|
65
|
-
const held = new Map<
|
|
66
|
-
string,
|
|
67
|
-
{ route: string; batch: Promise<PreviewFixtureBatch | undefined> }
|
|
68
|
-
>();
|
|
69
|
-
let isStopped = false;
|
|
70
|
-
if (getCurrentScope()) onScopeDispose(() => (isStopped = true));
|
|
71
|
-
|
|
72
|
-
async function readBatch(route: string): Promise<PreviewFixtureBatch> {
|
|
73
|
-
let failure = new Error(`No try was made to read ${route}`);
|
|
74
|
-
for (const delay of [0, ...delays]) {
|
|
75
|
-
if (delay > 0) await sleep(delay);
|
|
76
|
-
if (isStopped) break;
|
|
77
|
-
try {
|
|
78
|
-
const answer = await read(route);
|
|
79
|
-
if (isPreviewFixtureBatch(answer)) return answer;
|
|
80
|
-
failure = new Error(`${route} answered no fixture batch`);
|
|
81
|
-
} catch (cause) {
|
|
82
|
-
failure = failureOf(cause);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
throw failure;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
of(page, tenant) {
|
|
90
|
-
if (page.fixtures === undefined) return Promise.resolve(undefined);
|
|
91
|
-
const route =
|
|
92
|
-
tenant === undefined
|
|
93
|
-
? page.fixtures
|
|
94
|
-
: tenantFixtureRoute(page.fixtures, tenant);
|
|
95
|
-
const key = JSON.stringify([page.id, tenant]);
|
|
96
|
-
const kept = held.get(key);
|
|
97
|
-
if (kept?.route === route) return kept.batch;
|
|
98
|
-
const batch: Promise<PreviewFixtureBatch | undefined> = readBatch(
|
|
99
|
-
route,
|
|
100
|
-
).catch((cause: unknown) => {
|
|
101
|
-
if (held.get(key)?.batch === batch) held.delete(key);
|
|
102
|
-
throw failureOf(cause);
|
|
103
|
-
});
|
|
104
|
-
held.set(key, { route, batch });
|
|
105
|
-
return batch;
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** What a render of a page carries of its fixtures: none for a page that reads none. */
|
|
111
|
-
export interface RenderFixtures {
|
|
112
|
-
fixtures: PreviewFixtureBatch | undefined;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The fixtures a render of `page` must carry. A page whose batch could not be
|
|
117
|
-
* read, after every retry, is not rendered without it, since the frame has no
|
|
118
|
-
* other way to answer the page's reads: this tells `onFailure` why and
|
|
119
|
-
* resolves undefined, and the frame keeps what it showed.
|
|
120
|
-
*/
|
|
121
|
-
export async function fixturesForRender(
|
|
122
|
-
batches: FixtureBatches,
|
|
123
|
-
page: FixtureBatchPage,
|
|
124
|
-
tenant: string | undefined,
|
|
125
|
-
onFailure: (failure: Error) => void,
|
|
126
|
-
): Promise<RenderFixtures | undefined> {
|
|
127
|
-
try {
|
|
128
|
-
return { fixtures: await batches.of(page, tenant) };
|
|
129
|
-
} catch (cause) {
|
|
130
|
-
onFailure(failureOf(cause));
|
|
131
|
-
return undefined;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/** The least time between two reports of a failed batch: one outage hits every frame of the viewer at once, and is told once. */
|
|
136
|
-
const REPORT_INTERVAL_MS = 10_000;
|
|
137
|
-
|
|
138
|
-
let reportedAt = Number.NEGATIVE_INFINITY;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* The report of a batch that could not be read, through the viewer's error
|
|
142
|
-
* presenter, at most once for each {@link REPORT_INTERVAL_MS}.
|
|
143
|
-
*/
|
|
144
|
-
export function useFixtureFailureReport(): (failure: Error) => void {
|
|
145
|
-
const presenter = useApiErrorPresenter();
|
|
146
|
-
return (failure) => {
|
|
147
|
-
const now = Date.now();
|
|
148
|
-
if (now - reportedAt < REPORT_INTERVAL_MS) return;
|
|
149
|
-
reportedAt = now;
|
|
150
|
-
presenter.presentError(failure, {
|
|
151
|
-
fallbackKey: "dms.mockup.fixtures_failed",
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
onBeforeUnmount,
|
|
4
|
-
ref,
|
|
5
|
-
shallowRef,
|
|
6
|
-
watch,
|
|
7
|
-
type Ref,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import { isReducedMotionActive } from "../../../utils/reducedMotion";
|
|
10
|
-
import {
|
|
11
|
-
ACTIVATION_FADE_MS,
|
|
12
|
-
nextActivation,
|
|
13
|
-
type Activation,
|
|
14
|
-
type ActivationEvent,
|
|
15
|
-
} from "../../utils/mockupActivation";
|
|
16
|
-
import type { PageCapture } from "../../utils/mockupCaptures";
|
|
17
|
-
|
|
18
|
-
/** How long the browser may take to find the Overview idle before the page view's frame boots anyway. */
|
|
19
|
-
const IDLE_BOOT_TIMEOUT_MS = 3_000;
|
|
20
|
-
|
|
21
|
-
/** How long a browser without idle callbacks waits, once the Overview settled, before the frame boots. */
|
|
22
|
-
const IDLE_BOOT_FALLBACK_MS = 300;
|
|
23
|
-
|
|
24
|
-
/** How long the frame has, from the moment it was handed the render of the page opened, to acknowledge it drawn before it is shown anyway: a frame that failed to draw it never does. */
|
|
25
|
-
const DRAWN_ACK_TIMEOUT_MS = 2_000;
|
|
26
|
-
|
|
27
|
-
/** What the page view's activation is driven by. */
|
|
28
|
-
interface ActivationOptions {
|
|
29
|
-
/** What the frame is to draw, from `activationScope`; undefined while the Overview shows. */
|
|
30
|
-
scope: Readonly<Ref<string | undefined>>;
|
|
31
|
-
/** The image of the page to open that matches what the frame is to draw, if there is one. */
|
|
32
|
-
capture: Readonly<Ref<PageCapture | undefined>>;
|
|
33
|
-
/** Whether a page is asked for, as the URL names one: the frame boots at once, before the state that holds the page arrived. */
|
|
34
|
-
isRequested: Readonly<Ref<boolean>>;
|
|
35
|
-
/** Whether the Overview has every page drawn, or given up on it: the frame boots once it is idle. */
|
|
36
|
-
isSettled: Readonly<Ref<boolean>>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Calls `task` when the browser is idle, and answers the call that takes it back. */
|
|
40
|
-
function whenIdle(task: () => void): () => void {
|
|
41
|
-
if ("requestIdleCallback" in window) {
|
|
42
|
-
const handle = window.requestIdleCallback(task, {
|
|
43
|
-
timeout: IDLE_BOOT_TIMEOUT_MS,
|
|
44
|
-
});
|
|
45
|
-
return () => window.cancelIdleCallback(handle);
|
|
46
|
-
}
|
|
47
|
-
const handle = setTimeout(task, IDLE_BOOT_FALLBACK_MS);
|
|
48
|
-
return () => clearTimeout(handle);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Opening a page, as a state machine rather than a set of flags
|
|
53
|
-
* ({@link Activation}): the page view's frame is booted once, in idle time
|
|
54
|
-
* once the Overview settled, and then kept, so opening a page is a render to
|
|
55
|
-
* a warm frame. While that render draws, the page's capture shows in the
|
|
56
|
-
* frame's place at once, and the frame, which may still draw the page it
|
|
57
|
-
* drew last, is not seen. Once the frame acknowledges the render drawn
|
|
58
|
-
* ({@link ActivationEvent}, `acknowledge`), it fades in over the image, which
|
|
59
|
-
* goes when the frame is opaque; a frame that never acknowledges is shown
|
|
60
|
-
* {@link DRAWN_ACK_TIMEOUT_MS} after it was handed the render (`posted`), so
|
|
61
|
-
* a render still waiting for its data never uncovers the page drawn before.
|
|
62
|
-
* A page with no capture shows nothing in the frame's place until the frame
|
|
63
|
-
* fades in.
|
|
64
|
-
*/
|
|
65
|
-
export function useMockupActivation(options: ActivationOptions) {
|
|
66
|
-
const state = shallowRef<Activation>({ phase: "idle" });
|
|
67
|
-
const isCovered = ref(false);
|
|
68
|
-
const isBooted = ref(false);
|
|
69
|
-
let uncover: ReturnType<typeof setTimeout> | undefined;
|
|
70
|
-
let grace: ReturnType<typeof setTimeout> | undefined;
|
|
71
|
-
let cancelIdle: (() => void) | undefined;
|
|
72
|
-
|
|
73
|
-
function send(event: ActivationEvent): void {
|
|
74
|
-
state.value = nextActivation(state.value, event);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
watch(
|
|
78
|
-
options.scope,
|
|
79
|
-
(scope) =>
|
|
80
|
-
send(scope === undefined ? { type: "close" } : { type: "open", scope }),
|
|
81
|
-
{ immediate: true },
|
|
82
|
-
);
|
|
83
|
-
watch(
|
|
84
|
-
state,
|
|
85
|
-
(now, before) => {
|
|
86
|
-
clearTimeout(uncover);
|
|
87
|
-
clearTimeout(grace);
|
|
88
|
-
if (now.phase === "rendering") {
|
|
89
|
-
isCovered.value = true;
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (
|
|
93
|
-
now.phase === "drawn" &&
|
|
94
|
-
before?.phase === "rendering" &&
|
|
95
|
-
!isReducedMotionActive()
|
|
96
|
-
) {
|
|
97
|
-
uncover = setTimeout(() => {
|
|
98
|
-
isCovered.value = false;
|
|
99
|
-
}, ACTIVATION_FADE_MS);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
isCovered.value = false;
|
|
103
|
-
},
|
|
104
|
-
{ immediate: true },
|
|
105
|
-
);
|
|
106
|
-
watch(
|
|
107
|
-
[options.isRequested, options.isSettled],
|
|
108
|
-
([isRequested, isSettled]) => {
|
|
109
|
-
if (isBooted.value) return;
|
|
110
|
-
if (isRequested) {
|
|
111
|
-
isBooted.value = true;
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (isSettled && !cancelIdle) {
|
|
115
|
-
cancelIdle = whenIdle(() => {
|
|
116
|
-
isBooted.value = true;
|
|
117
|
-
});
|
|
118
|
-
} else if (!isSettled) {
|
|
119
|
-
cancelIdle?.();
|
|
120
|
-
cancelIdle = undefined;
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{ immediate: true },
|
|
124
|
-
);
|
|
125
|
-
onBeforeUnmount(() => {
|
|
126
|
-
clearTimeout(uncover);
|
|
127
|
-
clearTimeout(grace);
|
|
128
|
-
cancelIdle?.();
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
return {
|
|
132
|
-
phase: computed(() => state.value.phase),
|
|
133
|
-
/** The frame acknowledged the render of the page `scope` names drawn: one of another scope than the page opened, as a late one of the page before, changes nothing. */
|
|
134
|
-
acknowledge: (scope: string): void => send({ type: "drawn", scope }),
|
|
135
|
-
/** The frame was handed the render of the page `scope` names: from now it has {@link DRAWN_ACK_TIMEOUT_MS} to acknowledge it. */
|
|
136
|
-
posted: (scope: string): void => {
|
|
137
|
-
const now = state.value;
|
|
138
|
-
if (now.phase !== "rendering" || now.scope !== scope) return;
|
|
139
|
-
clearTimeout(grace);
|
|
140
|
-
grace = setTimeout(
|
|
141
|
-
() => send({ type: "drawn", scope }),
|
|
142
|
-
DRAWN_ACK_TIMEOUT_MS,
|
|
143
|
-
);
|
|
144
|
-
},
|
|
145
|
-
/** Whether the frame is to be seen: from the moment it acknowledged the page's render drawn. */
|
|
146
|
-
isFrameShown: computed(() => state.value.phase === "drawn"),
|
|
147
|
-
/** The image shown in the frame's place: while the page renders, and until the frame is opaque over it. */
|
|
148
|
-
image: computed(() =>
|
|
149
|
-
isCovered.value ? options.capture.value : undefined,
|
|
150
|
-
),
|
|
151
|
-
/** Whether the frame has its document: a page is open, or the Overview settled and the browser is idle. */
|
|
152
|
-
isBooted,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** The activation of the page view. */
|
|
157
|
-
export type MockupActivation = ReturnType<typeof useMockupActivation>;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { computed, ref, watch, type Ref, type WritableComputedRef } from "vue";
|
|
2
|
-
import type { MockupEntityState, MockupState } from "../../utils/mockup";
|
|
3
|
-
import {
|
|
4
|
-
entitiesSource,
|
|
5
|
-
entitiesSpec,
|
|
6
|
-
type SchemaExplorerSource,
|
|
7
|
-
type SchemaExplorerView,
|
|
8
|
-
} from "../../utils/mockupSchema";
|
|
9
|
-
|
|
10
|
-
/** Where the explorer reads its schema: the spec's entities, or the database the spec connects to. */
|
|
11
|
-
export type MockupDatabaseSource = "spec" | "connection";
|
|
12
|
-
|
|
13
|
-
interface DatabaseOptions {
|
|
14
|
-
/** The state on screen: the previewed version's, else the current one's. */
|
|
15
|
-
shown: Readonly<Ref<MockupState | undefined>>;
|
|
16
|
-
/** Opens the page `id` of the mockup. */
|
|
17
|
-
openPage: (id: string) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** A page that holds a fixture of an entity. */
|
|
21
|
-
export interface MockupDatabasePage {
|
|
22
|
-
id: string;
|
|
23
|
-
title: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The DB explorer of a mockup: its data model, drawn as a diagram and
|
|
28
|
-
* browsed as data. It is on screen over the canvas while open, and offered
|
|
29
|
-
* only when the state on screen has entities or a connection.
|
|
30
|
-
*/
|
|
31
|
-
export interface MockupDatabase {
|
|
32
|
-
/** Whether the state on screen has a data model to show: entities, or a connection to introspect. */
|
|
33
|
-
isAvailable: Readonly<Ref<boolean>>;
|
|
34
|
-
isOpen: Readonly<Ref<boolean>>;
|
|
35
|
-
toggle: () => void;
|
|
36
|
-
close: () => void;
|
|
37
|
-
/** The sources to pick from, in the toggle's order; the toggle shows when there are two. */
|
|
38
|
-
sources: Readonly<Ref<MockupDatabaseSource[]>>;
|
|
39
|
-
/** The source on screen: the one picked, else the introspected database when the spec has a connection, else the spec's entities. */
|
|
40
|
-
source: WritableComputedRef<MockupDatabaseSource>;
|
|
41
|
-
/** The explorer's view, which its own Diagram/Data switch moves. */
|
|
42
|
-
view: Ref<SchemaExplorerView>;
|
|
43
|
-
/** Whether the spec has entities, whose JSON the explorer can show. */
|
|
44
|
-
hasJson: Readonly<Ref<boolean>>;
|
|
45
|
-
/** Whether the entities' JSON is on screen in place of the explorer: never while the spec has none. */
|
|
46
|
-
isJsonShown: WritableComputedRef<boolean>;
|
|
47
|
-
/** The table the explorer has open, by name. */
|
|
48
|
-
table: Ref<string | undefined>;
|
|
49
|
-
explorerSource: Readonly<Ref<SchemaExplorerSource>>;
|
|
50
|
-
/** The spec's entities as `spec.json` writes them, pretty-printed. */
|
|
51
|
-
json: Readonly<Ref<string>>;
|
|
52
|
-
/** The entity of the open table, while the source is the spec's. */
|
|
53
|
-
entity: Readonly<Ref<MockupEntityState | undefined>>;
|
|
54
|
-
/** The pages holding a fixture of {@link entity}, in the spec's order. */
|
|
55
|
-
usedBy: Readonly<Ref<MockupDatabasePage[]>>;
|
|
56
|
-
/** Closes the explorer and opens the page `id`. */
|
|
57
|
-
openPage: (id: string) => void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The state of the DB explorer: whether it is open, the source, the view,
|
|
62
|
-
* the JSON and the table it is on. The source defaults to the introspected
|
|
63
|
-
* database when the spec has a connection, else to the spec's entities, and a
|
|
64
|
-
* source or the JSON the state on screen no longer offers falls back to the
|
|
65
|
-
* default, so a past version without entities never leaves the explorer on a
|
|
66
|
-
* dead choice.
|
|
67
|
-
*/
|
|
68
|
-
export function useMockupDatabase(options: DatabaseOptions): MockupDatabase {
|
|
69
|
-
const entities = computed(() => options.shown.value?.entities ?? []);
|
|
70
|
-
const connection = computed(() => options.shown.value?.connection);
|
|
71
|
-
const hasEntities = computed(() => entities.value.length > 0);
|
|
72
|
-
const isAvailable = computed(
|
|
73
|
-
() => hasEntities.value || connection.value !== undefined,
|
|
74
|
-
);
|
|
75
|
-
const isOpen = ref(false);
|
|
76
|
-
watch(isAvailable, (isOffered) => {
|
|
77
|
-
if (!isOffered) isOpen.value = false;
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const sources = computed(() => {
|
|
81
|
-
const offered: MockupDatabaseSource[] = [];
|
|
82
|
-
if (hasEntities.value) offered.push("spec");
|
|
83
|
-
if (connection.value !== undefined) offered.push("connection");
|
|
84
|
-
return offered;
|
|
85
|
-
});
|
|
86
|
-
const pickedSource = ref<MockupDatabaseSource>();
|
|
87
|
-
const source = computed<MockupDatabaseSource>({
|
|
88
|
-
get() {
|
|
89
|
-
const picked = pickedSource.value;
|
|
90
|
-
if (picked !== undefined && sources.value.includes(picked)) return picked;
|
|
91
|
-
return connection.value === undefined ? "spec" : "connection";
|
|
92
|
-
},
|
|
93
|
-
set: (next) => {
|
|
94
|
-
pickedSource.value = next;
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
const table = ref<string>();
|
|
98
|
-
watch(source, () => {
|
|
99
|
-
table.value = undefined;
|
|
100
|
-
});
|
|
101
|
-
watch(entities, (now) => {
|
|
102
|
-
const open = table.value;
|
|
103
|
-
if (source.value !== "spec" || open === undefined) return;
|
|
104
|
-
if (!now.some((candidate) => candidate.name === open)) {
|
|
105
|
-
table.value = undefined;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const view = ref<SchemaExplorerView>("diagram");
|
|
110
|
-
const isJsonPicked = ref(false);
|
|
111
|
-
const isJsonShown = computed({
|
|
112
|
-
get: () => isJsonPicked.value && hasEntities.value,
|
|
113
|
-
set: (next: boolean) => {
|
|
114
|
-
isJsonPicked.value = next;
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const explorerSource = computed((): SchemaExplorerSource => {
|
|
119
|
-
const connected = connection.value;
|
|
120
|
-
return source.value === "connection" && connected !== undefined
|
|
121
|
-
? { kind: "connection", connection: connected }
|
|
122
|
-
: entitiesSource(entities.value);
|
|
123
|
-
});
|
|
124
|
-
const entity = computed(() =>
|
|
125
|
-
source.value === "spec"
|
|
126
|
-
? entities.value.find((candidate) => candidate.name === table.value)
|
|
127
|
-
: undefined,
|
|
128
|
-
);
|
|
129
|
-
const usedBy = computed(() => {
|
|
130
|
-
const titles = new Map(
|
|
131
|
-
(options.shown.value?.pages ?? []).map((page) => [page.id, page.title]),
|
|
132
|
-
);
|
|
133
|
-
return (entity.value?.pages ?? []).map((id) => ({
|
|
134
|
-
id,
|
|
135
|
-
title: titles.get(id) ?? id,
|
|
136
|
-
}));
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
function close(): void {
|
|
140
|
-
isOpen.value = false;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
isAvailable,
|
|
145
|
-
isOpen,
|
|
146
|
-
toggle: () => {
|
|
147
|
-
isOpen.value = !isOpen.value && isAvailable.value;
|
|
148
|
-
},
|
|
149
|
-
close,
|
|
150
|
-
sources,
|
|
151
|
-
source,
|
|
152
|
-
view,
|
|
153
|
-
hasJson: hasEntities,
|
|
154
|
-
isJsonShown,
|
|
155
|
-
table,
|
|
156
|
-
explorerSource,
|
|
157
|
-
json: computed(() => JSON.stringify(entitiesSpec(entities.value), null, 2)),
|
|
158
|
-
entity,
|
|
159
|
-
usedBy,
|
|
160
|
-
openPage: (id) => {
|
|
161
|
-
close();
|
|
162
|
-
options.openPage(id);
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { computed, type Ref } from "vue";
|
|
2
|
-
import type {
|
|
3
|
-
PreviewNavigation,
|
|
4
|
-
PreviewRenderMessage,
|
|
5
|
-
} from "../../utils/blockPreviewMessages";
|
|
6
|
-
import type { MockupPageState } from "../../utils/mockup";
|
|
7
|
-
import { activationScope, STORE_SCOPE } from "../../utils/mockupActivation";
|
|
8
|
-
import {
|
|
9
|
-
mockupPageRender,
|
|
10
|
-
mockupRenderScope,
|
|
11
|
-
mockupStoreRender,
|
|
12
|
-
withRenderData,
|
|
13
|
-
} from "../../utils/mockupFrame";
|
|
14
|
-
import { mockupPageParams } from "../../utils/mockupLinks";
|
|
15
|
-
import { withTenantFixtures } from "../../utils/mockupTenancy";
|
|
16
|
-
import type { PreviewHeader } from "../../utils/previewHeader";
|
|
17
|
-
import {
|
|
18
|
-
fixturesForRender,
|
|
19
|
-
useFixtureBatches,
|
|
20
|
-
useFixtureFailureReport,
|
|
21
|
-
} from "./useFixtureBatches";
|
|
22
|
-
import type { MockupSketchStatesChoice } from "./useMockupSketchStates";
|
|
23
|
-
|
|
24
|
-
/** What the page view's frame is posted for the page on screen. */
|
|
25
|
-
export interface FrameRender {
|
|
26
|
-
message: PreviewRenderMessage;
|
|
27
|
-
/** The activation the render belongs to, as `activationScope` names it. */
|
|
28
|
-
activation: string;
|
|
29
|
-
/** The scope the frame names when it says it drew the render. */
|
|
30
|
-
scope: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** What the render of the page view's frame reads. */
|
|
34
|
-
interface FrameRenderOptions {
|
|
35
|
-
/** The mockup's folder name, which its fixture routes are under. */
|
|
36
|
-
name: string;
|
|
37
|
-
/** The row the page shows. */
|
|
38
|
-
record: Readonly<Ref<string | undefined>>;
|
|
39
|
-
/** The query of the page, as its URL gives it. */
|
|
40
|
-
query: Readonly<Ref<Record<string, string> | undefined>>;
|
|
41
|
-
realData: Readonly<Ref<boolean>>;
|
|
42
|
-
/** The tenant the page is drawn as in SaaS mode, which reads its fixtures as that tenant; none in single-tenant mode. */
|
|
43
|
-
tenant: Readonly<Ref<string | undefined>>;
|
|
44
|
-
navigation: Readonly<Ref<PreviewNavigation>>;
|
|
45
|
-
/** Whether the module store is drawn in place of the page. */
|
|
46
|
-
isStoreOpen: Readonly<Ref<boolean>>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** The header the module store is drawn under, in the viewer's language. */
|
|
50
|
-
function useStoreHeader() {
|
|
51
|
-
const { t } = useI18n();
|
|
52
|
-
return computed<PreviewHeader>(() => ({
|
|
53
|
-
title: t("dms.mockup.store_title"),
|
|
54
|
-
icon: "i-ph-squares-four",
|
|
55
|
-
description: t("dms.mockup.store_description"),
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* What the page view's frame draws, as a render to post: the page, as the
|
|
61
|
-
* tenant sees it, with the fixtures it reads from its batch, or the module
|
|
62
|
-
* store while it is open. A page is rendered only once its batch is read,
|
|
63
|
-
* since the frame has no other way to answer its reads.
|
|
64
|
-
*/
|
|
65
|
-
export function useMockupFrameRender(
|
|
66
|
-
options: FrameRenderOptions,
|
|
67
|
-
sketchStates: Pick<MockupSketchStatesChoice, "treeOf">,
|
|
68
|
-
) {
|
|
69
|
-
const batches = useFixtureBatches(useAuthFetch().$authFetch);
|
|
70
|
-
const reportFailure = useFixtureFailureReport();
|
|
71
|
-
const storeHeader = useStoreHeader();
|
|
72
|
-
|
|
73
|
-
function storeRender(page: MockupPageState): FrameRender {
|
|
74
|
-
return {
|
|
75
|
-
message: withRenderData(
|
|
76
|
-
mockupStoreRender(page, options.navigation.value, storeHeader.value),
|
|
77
|
-
{ scope: STORE_SCOPE },
|
|
78
|
-
),
|
|
79
|
-
activation: STORE_SCOPE,
|
|
80
|
-
scope: STORE_SCOPE,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async function pageRender(
|
|
85
|
-
page: MockupPageState,
|
|
86
|
-
): Promise<FrameRender | undefined> {
|
|
87
|
-
const tenant = options.tenant.value;
|
|
88
|
-
const realData = options.realData.value;
|
|
89
|
-
const picked = sketchStates.treeOf(page, realData);
|
|
90
|
-
const tree =
|
|
91
|
-
tenant === undefined
|
|
92
|
-
? picked
|
|
93
|
-
: withTenantFixtures(picked, options.name, tenant);
|
|
94
|
-
const params = mockupPageParams(page, options.record.value);
|
|
95
|
-
const read = await fixturesForRender(batches, page, tenant, reportFailure);
|
|
96
|
-
if (!read) return undefined;
|
|
97
|
-
const scope = mockupRenderScope(page.id, tenant, realData, tree, params);
|
|
98
|
-
return {
|
|
99
|
-
message: withRenderData(
|
|
100
|
-
mockupPageRender(
|
|
101
|
-
page,
|
|
102
|
-
tree,
|
|
103
|
-
options.navigation.value,
|
|
104
|
-
params,
|
|
105
|
-
options.query.value,
|
|
106
|
-
),
|
|
107
|
-
{ scope, fixtures: read.fixtures },
|
|
108
|
-
),
|
|
109
|
-
activation: activationScope(page.id, tenant, realData),
|
|
110
|
-
scope,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
/** The header of the module store, which a change of language redraws. */
|
|
116
|
-
storeHeader,
|
|
117
|
-
/**
|
|
118
|
-
* The render of `page`, or of the module store when it is open; undefined
|
|
119
|
-
* when the page's fixtures could not be read, which is reported.
|
|
120
|
-
*/
|
|
121
|
-
renderOf: (page: MockupPageState): Promise<FrameRender | undefined> =>
|
|
122
|
-
options.isStoreOpen.value
|
|
123
|
-
? Promise.resolve(storeRender(page))
|
|
124
|
-
: pageRender(page),
|
|
125
|
-
};
|
|
126
|
-
}
|