@antelopejs/dms 0.21.3 → 0.21.4-next.1000.g005d1ab
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/E2E.md +101 -10
- package/README.md +3 -3
- package/data/mockup-spec.schema.json +181 -0
- package/dist/config/internal/state.d.ts +4 -1
- package/dist/config/internal/state.js +5 -0
- package/dist/config/internal/state.js.map +1 -1
- package/dist/db/setup-token.d.ts +1 -1
- package/dist/db/setup-token.js +2 -2
- package/dist/db/setup-token.js.map +1 -1
- package/dist/{bin/control → e2e}/backend.d.mts +4 -4
- package/dist/{bin/control → e2e}/base.d.mts +5 -5
- package/dist/{bin/control → e2e}/browser.d.mts +2 -28
- package/dist/e2e/fixtures.d.mts +45 -0
- package/dist/{bin/control → e2e}/frontend-workspace.d.mts +9 -1
- package/dist/e2e/global-setup.d.mts +27 -0
- package/dist/{bin/control → e2e}/identity.d.mts +3 -4
- package/dist/e2e/index.d.mts +57 -0
- package/dist/{bin/control → e2e}/journey-judge.d.mts +8 -8
- package/dist/{bin/control → e2e}/journey-load.d.mts +0 -6
- package/dist/e2e/journey-run.d.mts +61 -0
- package/dist/{bin/control → e2e}/journey.d.mts +37 -38
- package/dist/e2e/journeys-config.d.mts +56 -0
- package/dist/{bin/control → e2e}/json.d.mts +7 -14
- package/dist/{bin/control → e2e}/launch.d.mts +3 -3
- package/dist/{bin/control → e2e}/module-root.d.mts +3 -3
- package/dist/{bin/control → e2e}/mongo.d.mts +3 -3
- package/dist/{bin/control → e2e}/renderer.d.mts +1 -1
- package/dist/{bin/control → e2e}/run-state.d.mts +8 -7
- package/dist/e2e/run.d.mts +53 -0
- package/dist/{bin/control → e2e}/stack.d.mts +0 -1
- package/dist/e2e/start.d.mts +50 -0
- package/dist/{bin/control/e2e-suite.d.mts → e2e/suite.d.mts} +13 -16
- package/dist/e2e/test-journey.d.mts +30 -0
- package/dist/{bin/control → e2e}/timing.d.mts +0 -29
- package/dist/e2e/types.d.mts +58 -0
- package/dist/implementations/dms-auth/database-deadline.d.ts +7 -0
- package/dist/implementations/dms-auth/database-deadline.js +45 -0
- package/dist/implementations/dms-auth/database-deadline.js.map +1 -0
- package/dist/implementations/dms-auth/index.js +14 -6
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/analysis.js +1 -0
- package/dist/implementations/dms-builder/engine/analysis.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +1 -0
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +2 -5
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/index.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/index.js +5 -1
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/indexed-project.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/indexed-project.js +18 -3
- package/dist/implementations/dms-builder/engine/indexed-project.js.map +1 -1
- package/dist/implementations/dms-builder/engine/interface-capabilities.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/interface-capabilities.js +14 -5
- package/dist/implementations/dms-builder/engine/interface-capabilities.js.map +1 -1
- package/dist/implementations/dms-builder/engine/map-resources.js +2 -3
- package/dist/implementations/dms-builder/engine/map-resources.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-choices.js +9 -1
- package/dist/implementations/dms-builder/engine/mapped-choices.js.map +1 -1
- package/dist/implementations/dms-builder/engine/modules.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/modules.js +3 -2
- package/dist/implementations/dms-builder/engine/modules.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js +1 -2
- package/dist/implementations/dms-builder/engine/ops-blocks.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-categories.js +2 -4
- package/dist/implementations/dms-builder/engine/ops-categories.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops.js +3 -4
- package/dist/implementations/dms-builder/engine/ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/page-access.js +3 -1
- package/dist/implementations/dms-builder/engine/page-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/page-category-move.js +3 -3
- package/dist/implementations/dms-builder/engine/page-category-move.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-chain.d.ts +3 -1
- package/dist/implementations/dms-builder/engine/query-chain.js +10 -4
- package/dist/implementations/dms-builder/engine/query-chain.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-emit.d.ts +17 -2
- package/dist/implementations/dms-builder/engine/query-emit.js +72 -15
- package/dist/implementations/dms-builder/engine/query-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-ops-emit.js +6 -0
- package/dist/implementations/dms-builder/engine/query-ops-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-ops.js +29 -1
- package/dist/implementations/dms-builder/engine/query-ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-plan-execute.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/query-plan-execute.js +11 -4
- package/dist/implementations/dms-builder/engine/query-plan-execute.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-plan.d.ts +14 -1
- package/dist/implementations/dms-builder/engine/query-plan.js +68 -28
- package/dist/implementations/dms-builder/engine/query-plan.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-preview.js +25 -15
- package/dist/implementations/dms-builder/engine/query-preview.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-route-response.js +3 -4
- package/dist/implementations/dms-builder/engine/query-route-response.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-structure.js +66 -15
- package/dist/implementations/dms-builder/engine/query-structure.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-template-emit.js +2 -0
- package/dist/implementations/dms-builder/engine/query-template-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-template-ratio.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/query-template-ratio.js +140 -0
- package/dist/implementations/dms-builder/engine/query-template-ratio.js.map +1 -0
- package/dist/implementations/dms-builder/engine/query-template.d.ts +8 -1
- package/dist/implementations/dms-builder/engine/query-template.js +2 -3
- package/dist/implementations/dms-builder/engine/query-template.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-where.d.ts +2 -1
- package/dist/implementations/dms-builder/engine/query-where.js +4 -2
- package/dist/implementations/dms-builder/engine/query-where.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resolution-inputs.d.ts +8 -0
- package/dist/implementations/dms-builder/engine/resolution-inputs.js +85 -0
- package/dist/implementations/dms-builder/engine/resolution-inputs.js.map +1 -0
- package/dist/implementations/dms-builder/engine/resource-index.js +1 -1
- package/dist/implementations/dms-builder/engine/resource-index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-ops.js +2 -4
- package/dist/implementations/dms-builder/engine/resource-ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/save-check.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/save-check.js +104 -0
- package/dist/implementations/dms-builder/engine/save-check.js.map +1 -0
- package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -2
- package/dist/implementations/dms-builder/engine/theme-scaffold.js.map +1 -1
- package/dist/implementations/dms-builder/engine/writable.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/writable.js +46 -42
- package/dist/implementations/dms-builder/engine/writable.js.map +1 -1
- package/dist/implementations/dms-html-render/index.js +1 -0
- package/dist/implementations/dms-html-render/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/analysis-summary.d.ts +3 -0
- package/dist/mcp/analysis-summary.js +23 -1
- package/dist/mcp/analysis-summary.js.map +1 -1
- package/dist/mcp/page-verify/mockup.js +2 -2
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/relation-groups.d.ts +7 -0
- package/dist/mcp/relation-groups.js +88 -0
- package/dist/mcp/relation-groups.js.map +1 -0
- package/dist/mcp/tools/builder-analysis.js +1 -1
- package/dist/mcp/tools/builder-analysis.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +3 -3
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-resources.js +1 -1
- package/dist/mcp/tools/builder-resources.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +1 -0
- package/dist/mcp/tools/index.js +3 -3
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/mockup-from-page.d.ts +2 -0
- package/dist/mcp/tools/mockup-from-page.js +28 -24
- package/dist/mcp/tools/mockup-from-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +4 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +14 -2
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-support.d.ts +2 -0
- package/dist/mcp/tools/mockup-support.js +13 -2
- package/dist/mcp/tools/mockup-support.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mockup/anchor.d.ts +1 -0
- package/dist/mockup/anchor.js +7 -0
- package/dist/mockup/anchor.js.map +1 -1
- package/dist/mockup/compile.d.ts +2 -1
- package/dist/mockup/compile.js +3 -0
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/from-page-routes.d.ts +4 -2
- package/dist/mockup/from-page-routes.js +3 -2
- package/dist/mockup/from-page-routes.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +3 -1
- package/dist/mockup/history-routes.js +25 -11
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +5 -0
- package/dist/mockup/index.js +11 -4
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema.js +8 -0
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/live-page.d.ts +2 -1
- package/dist/mockup/live-page.js +19 -10
- package/dist/mockup/live-page.js.map +1 -1
- package/dist/mockup/manage-routes.d.ts +1 -0
- package/dist/mockup/model.d.ts +8 -0
- package/dist/mockup/model.js +6 -0
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +11 -0
- package/dist/mockup/modules.js +38 -0
- package/dist/mockup/modules.js.map +1 -0
- package/dist/mockup/owner-controller.d.ts +2 -0
- package/dist/mockup/owner-controller.js +8 -0
- package/dist/mockup/owner-controller.js.map +1 -1
- package/dist/mockup/presence-board.d.ts +45 -0
- package/dist/mockup/presence-board.js +181 -0
- package/dist/mockup/presence-board.js.map +1 -0
- package/dist/mockup/presence-routes.d.ts +23 -0
- package/dist/mockup/presence-routes.js +169 -0
- package/dist/mockup/presence-routes.js.map +1 -0
- package/dist/mockup/presence.d.ts +83 -0
- package/dist/mockup/presence.js +168 -0
- package/dist/mockup/presence.js.map +1 -0
- package/dist/mockup/routes.d.ts +6 -0
- package/dist/mockup/routes.js +20 -4
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/source-routes.d.ts +6 -1
- package/dist/mockup/source-routes.js +36 -13
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.d.ts +1 -0
- package/dist/mockup/source.js +1 -0
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/store.d.ts +4 -0
- package/dist/mockup/store.js +3 -0
- package/dist/mockup/store.js.map +1 -1
- package/dist/pages/settings/users/role-preview.d.ts +1 -1
- package/dist/pages/settings/users/role-preview.js +2 -2
- package/dist/pages/settings/users/role-preview.js.map +1 -1
- package/dist/pages/settings/users/roles.js +1 -1
- package/dist/pages/settings/users/roles.js.map +1 -1
- package/dist/routes/auth/refresh.d.ts +1 -1
- package/dist/routes/auth/refresh.js +3 -25
- package/dist/routes/auth/refresh.js.map +1 -1
- package/dist/store/catalog.d.ts +1 -0
- package/dist/store/catalog.js +1 -0
- package/dist/store/catalog.js.map +1 -1
- package/dist/utils/auth-constants.d.ts +0 -1
- package/dist/utils/auth-constants.js +1 -2
- package/dist/utils/auth-constants.js.map +1 -1
- package/dist/utils/user-activity.js +1 -7
- package/dist/utils/user-activity.js.map +1 -1
- package/{bin/control → e2e}/backend.mjs +5 -5
- package/{bin/control → e2e}/base.mjs +11 -11
- package/{bin/control → e2e}/browser.mjs +1 -113
- package/{bin/control → e2e}/build-cache.mjs +3 -3
- package/{bin/control → e2e}/build-key.mjs +27 -3
- package/{bin/control → e2e}/dashboard.mjs +33 -6
- package/e2e/fixtures.mjs +154 -0
- package/{bin/control → e2e}/frontend-workspace.mjs +39 -5
- package/e2e/global-setup.mjs +74 -0
- package/{bin/control → e2e}/identity.mjs +4 -5
- package/e2e/index.mjs +110 -0
- package/{bin/control → e2e}/journey-judge.mjs +4 -4
- package/{bin/control → e2e}/journey-load.mjs +0 -13
- package/e2e/journey-run.mjs +190 -0
- package/{bin/control → e2e}/journey.mjs +57 -216
- package/e2e/journeys-config.mjs +126 -0
- package/{bin/control → e2e}/json.mjs +11 -32
- package/{bin/control → e2e}/launch.mjs +6 -6
- package/{bin/control → e2e}/mail.mjs +2 -3
- package/{bin/control → e2e}/module-root.mjs +3 -3
- package/{bin/control → e2e}/mongo.mjs +8 -8
- package/{bin/control → e2e}/prepared-workspace.mjs +1 -1
- package/{bin/control → e2e}/renderer.mjs +6 -4
- package/{bin/control → e2e}/run-state.mjs +15 -14
- package/e2e/run.mjs +96 -0
- package/e2e/service.mjs +11 -0
- package/e2e/services.mjs +64 -0
- package/{bin/control → e2e}/session.mjs +1 -3
- package/{bin/control → e2e}/stack.mjs +4 -5
- package/e2e/start.mjs +79 -0
- package/{bin/control/e2e-suite.mjs → e2e/suite.mjs} +25 -33
- package/e2e/test-journey.mjs +55 -0
- package/{bin/control → e2e}/timing.mjs +0 -112
- package/{bin/control/verify → e2e}/types.mjs +3 -7
- package/frontend-vue/eslint-globals.generated.mjs +20 -20
- package/frontend-vue/layers/dms-auth/server/session.ts +9 -2
- package/frontend-vue/layers/dms-core/app/build/utils/previewFrame.ts +12 -0
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +20 -14
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +2 -1
- package/frontend-vue/layers/dms-core/app/entries/utils/previewFrame.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/live.ts +1 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/row-action.ts +2 -0
- package/frontend-vue/layers/dms-core/app/utils/http-status.ts +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +5 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +5 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/assets/css/foundation.css +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +4 -8
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +4 -7
- package/frontend-vue/layers/dms-layout/app/error.vue +7 -0
- package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +2 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/public/images/antelope-logo/dark.svg +1 -1
- package/frontend-vue/layers/dms-layout/public/images/antelope-logo/light.svg +1 -1
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-en-GB.json +2 -2
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-fr-FR.json +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +29 -8
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupLayers.vue +10 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +46 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +26 -5
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +47 -3
- package/frontend-vue/layers/dms-ui/app/build/components/button/DisabledReason.vue +27 -0
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/build/components/stat/StatCell.vue +2 -11
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +17 -17
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardAvatar.vue +2 -10
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/IdentityCell.vue +15 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetContainers.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +14 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetUrl.ts +25 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +5 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDocument.ts +12 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +34 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupLocks.ts +268 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +39 -23
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +10 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +21 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +92 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexAxes.ts +11 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexCategoryFormat.ts +32 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +45 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationFilter.ts +17 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/page/pageUrlValues.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodDisplay.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +47 -31
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionRendering.ts +19 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnTypes.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionTypes.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewActions.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +10 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/types/tree.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/fetchStatus.ts +12 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/initials.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +24 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +18 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOutline.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +15 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPresence.ts +117 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRebase.ts +139 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +16 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +13 -1
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +5 -3
- package/frontend-vue/layers/dms-ui/app/components/form/components/DatePicker.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputCalendar.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputRelation.vue +14 -1
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputRepeater.vue +23 -10
- package/frontend-vue/layers/dms-ui/app/components/kpi/KpiCard.vue +1 -6
- package/frontend-vue/layers/dms-ui/app/components/period/PeriodSelector.vue +9 -8
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +62 -16
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/button/DisabledReason.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/stat/StatCell.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupLocks.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/initials.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupPresence.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupRebase.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/row-action.ts +2 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +4 -1
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +4 -1
- package/frontend-vue/package.json +1 -1
- package/package.json +20 -18
- package/skills/dms/REFERENCE.md +1 -1
- package/skills/dms-module/SKILL.md +1 -1
- package/bin/control/backend-mode.test.mjs +0 -112
- package/bin/control/backend-records.test.mjs +0 -330
- package/bin/control/backend.test.mjs +0 -346
- package/bin/control/base.test.mjs +0 -88
- package/bin/control/browser-client.mjs +0 -65
- package/bin/control/browser-wire.mjs +0 -41
- package/bin/control/browser-wire.test.mjs +0 -96
- package/bin/control/build-cache.test.mjs +0 -270
- package/bin/control/build-key-refusals.test.mjs +0 -138
- package/bin/control/build-key.test.mjs +0 -417
- package/bin/control/build-layout.test.mjs +0 -357
- package/bin/control/commands-stack.mjs +0 -297
- package/bin/control/commands-verify.mjs +0 -157
- package/bin/control/consumer-install.test.mjs +0 -86
- package/bin/control/dashboard.test.mjs +0 -102
- package/bin/control/doctor.mjs +0 -346
- package/bin/control/e2e-run.mjs +0 -61
- package/bin/control/e2e-suite.test.mjs +0 -174
- package/bin/control/e2e.mjs +0 -178
- package/bin/control/forwarder.test.mjs +0 -267
- package/bin/control/frontend-check.mjs +0 -55
- package/bin/control/frontend-mode.test.mjs +0 -24
- package/bin/control/frontend-workspace.test.mjs +0 -133
- package/bin/control/helpers/env.mjs +0 -21
- package/bin/control/helpers/ephemeral-range.mjs +0 -18
- package/bin/control/helpers/evidence.mjs +0 -13
- package/bin/control/helpers/fake-run.mjs +0 -368
- package/bin/control/helpers/key-fixture.mjs +0 -85
- package/bin/control/helpers/narrow-range.mjs +0 -35
- package/bin/control/helpers/pids.mjs +0 -37
- package/bin/control/helpers/repo.mjs +0 -13
- package/bin/control/helpers/tree.mjs +0 -40
- package/bin/control/identity.test.mjs +0 -166
- package/bin/control/journey-judge.test.mjs +0 -106
- package/bin/control/journey.test.mjs +0 -392
- package/bin/control/json.test.mjs +0 -130
- package/bin/control/mail.test.mjs +0 -55
- package/bin/control/module-root.test.mjs +0 -69
- package/bin/control/mongo-server.test.mjs +0 -136
- package/bin/control/mongo.test.mjs +0 -298
- package/bin/control/namespaces.test.mjs +0 -263
- package/bin/control/options.mjs +0 -36
- package/bin/control/pid-guard.test.mjs +0 -202
- package/bin/control/pid-reuse.test.mjs +0 -278
- package/bin/control/processes.test.mjs +0 -289
- package/bin/control/renderer.test.mjs +0 -268
- package/bin/control/run-ports.test.mjs +0 -141
- package/bin/control/run-state.test.mjs +0 -171
- package/bin/control/tab.test.mjs +0 -444
- package/bin/control/timing.test.mjs +0 -186
- package/bin/control/verify/decode.mjs +0 -78
- package/bin/control/verify/decode.test.mjs +0 -123
- package/bin/control/verify/doors.mjs +0 -44
- package/bin/control/verify/doors.test.mjs +0 -87
- package/bin/control/verify/formal.mjs +0 -77
- package/bin/control/verify/formal.test.mjs +0 -94
- package/bin/control/verify/map.mjs +0 -236
- package/bin/control/verify/map.test.mjs +0 -212
- package/bin/control/verify/skill.mjs +0 -160
- package/bin/dms-control.mjs +0 -77
- package/dist/bin/control/browser-client.d.mts +0 -26
- package/dist/bin/control/browser-wire.d.mts +0 -4
- package/dist/bin/control/commands-stack.d.mts +0 -40
- package/dist/bin/control/doctor.d.mts +0 -18
- package/dist/bin/control/e2e-run.d.mts +0 -22
- package/dist/bin/control/e2e.d.mts +0 -47
- package/dist/bin/control/frontend-check.d.mts +0 -11
- package/dist/bin/control/options.d.mts +0 -95
- package/dist/bin/control/verify/decode.d.mts +0 -41
- package/dist/bin/control/verify/skill.d.mts +0 -69
- package/dist/bin/control/verify/types.d.mts +0 -106
- package/dist/mcp/tools/preview-blocks.d.ts +0 -1
- package/dist/mcp/tools/preview-blocks.js +0 -249
- package/dist/mcp/tools/preview-blocks.js.map +0 -1
- /package/dist/{bin/control → e2e}/build-cache.d.mts +0 -0
- /package/dist/{bin/control → e2e}/build-inputs.d.mts +0 -0
- /package/dist/{bin/control → e2e}/build-key.d.mts +0 -0
- /package/dist/{bin/control → e2e}/dashboard.d.mts +0 -0
- /package/dist/{bin/control → e2e}/database.d.mts +0 -0
- /package/dist/{bin/control → e2e}/failure.d.mts +0 -0
- /package/dist/{bin/control → e2e}/forwarder.d.mts +0 -0
- /package/dist/{bin/control → e2e}/git.d.mts +0 -0
- /package/dist/{bin/control → e2e}/mail.d.mts +0 -0
- /package/dist/{bin/control → e2e}/processes.d.mts +0 -0
- /package/dist/{bin/control → e2e}/run-copy.d.mts +0 -0
- /package/dist/{bin/control → e2e}/session.d.mts +0 -0
- /package/dist/{bin/control → e2e}/tab.d.mts +0 -0
- /package/{bin/control → e2e}/build-inputs.mjs +0 -0
- /package/{bin/control → e2e}/database.mjs +0 -0
- /package/{bin/control → e2e}/failure.mjs +0 -0
- /package/{bin/control → e2e}/forwarder.mjs +0 -0
- /package/{bin/control → e2e}/git.mjs +0 -0
- /package/{bin/control → e2e}/processes.mjs +0 -0
- /package/{bin/control → e2e}/run-copy.mjs +0 -0
- /package/{bin/control → e2e}/tab.mjs +0 -0
|
@@ -16,6 +16,11 @@ import {
|
|
|
16
16
|
type MockupAnnotationPatch,
|
|
17
17
|
type MockupState,
|
|
18
18
|
} from "../../utils/mockup";
|
|
19
|
+
import {
|
|
20
|
+
newViewerId,
|
|
21
|
+
NO_PRESENCE,
|
|
22
|
+
type MockupPresence,
|
|
23
|
+
} from "../../utils/mockupPresence";
|
|
19
24
|
import { openMockupStream, type MockupStream } from "../../utils/mockupStream";
|
|
20
25
|
|
|
21
26
|
type AuthFetch = ReturnType<typeof useAuthFetch>["$authFetch"];
|
|
@@ -35,6 +40,10 @@ export interface MockupSession {
|
|
|
35
40
|
*/
|
|
36
41
|
state: Readonly<ShallowRef<MockupState | undefined>>;
|
|
37
42
|
annotations: Ref<MockupAnnotation[]>;
|
|
43
|
+
/** The id this browser session goes by on the stream, which its locks and spec writes name. */
|
|
44
|
+
viewer: string;
|
|
45
|
+
/** Who is on the mockup and which blocks they hold. */
|
|
46
|
+
presence: Readonly<ShallowRef<MockupPresence>>;
|
|
38
47
|
isConnected: Ref<boolean>;
|
|
39
48
|
/** Whether the last annotation request failed. */
|
|
40
49
|
hasRequestFailed: Ref<boolean>;
|
|
@@ -45,13 +54,16 @@ export interface MockupSession {
|
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
/**
|
|
48
|
-
* Follows a mockup: opens its event stream while the component lives,
|
|
49
|
-
*
|
|
50
|
-
* `annotations
|
|
57
|
+
* Follows a mockup: opens its event stream while the component lives, naming
|
|
58
|
+
* this browser session `viewer`, so each save of the spec lands in `state`,
|
|
59
|
+
* each change of the notes in `annotations` and each change of who is on the
|
|
60
|
+
* mockup in `presence`, and sends the viewer's annotation requests.
|
|
51
61
|
*/
|
|
52
62
|
export function useMockupSession(options: MockupSessionOptions): MockupSession {
|
|
53
63
|
const state = shallowRef<MockupState>();
|
|
54
64
|
const annotations = ref<MockupAnnotation[]>([]);
|
|
65
|
+
const viewer = newViewerId();
|
|
66
|
+
const presence = shallowRef<MockupPresence>(NO_PRESENCE);
|
|
55
67
|
const isConnected = ref(false);
|
|
56
68
|
const hasRequestFailed = ref(false);
|
|
57
69
|
const annotationsEndpoint = mockupEndpoint(options.name, "/annotations");
|
|
@@ -95,7 +107,7 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
|
|
|
95
107
|
|
|
96
108
|
onMounted(() => {
|
|
97
109
|
stream = openMockupStream(
|
|
98
|
-
`${options.baseURL}${mockupEndpoint(options.name, "/events")}`,
|
|
110
|
+
`${options.baseURL}${mockupEndpoint(options.name, "/events")}?viewer=${viewer}`,
|
|
99
111
|
{
|
|
100
112
|
onState: (next) => {
|
|
101
113
|
state.value = next;
|
|
@@ -103,6 +115,9 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
|
|
|
103
115
|
onAnnotations: (next) => {
|
|
104
116
|
annotations.value = next;
|
|
105
117
|
},
|
|
118
|
+
onPresence: (next) => {
|
|
119
|
+
presence.value = next;
|
|
120
|
+
},
|
|
106
121
|
onConnection: (connected) => {
|
|
107
122
|
isConnected.value = connected;
|
|
108
123
|
},
|
|
@@ -115,6 +130,8 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
|
|
|
115
130
|
return {
|
|
116
131
|
state,
|
|
117
132
|
annotations,
|
|
133
|
+
viewer,
|
|
134
|
+
presence,
|
|
118
135
|
isConnected,
|
|
119
136
|
hasRequestFailed,
|
|
120
137
|
addAnnotation: (draft) =>
|
|
@@ -5,14 +5,12 @@ import {
|
|
|
5
5
|
shallowRef,
|
|
6
6
|
watch,
|
|
7
7
|
type ComputedRef,
|
|
8
|
+
type Ref,
|
|
8
9
|
type ShallowRef,
|
|
9
10
|
} from "vue";
|
|
10
11
|
import type { JsonValue } from "../../../../../dms-core/app/types/json";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
isObject,
|
|
14
|
-
isString,
|
|
15
|
-
} from "../../../../../dms-core/app/utils/type-check";
|
|
12
|
+
import { isString } from "../../../../../dms-core/app/utils/type-check";
|
|
13
|
+
import { fetchStatus } from "../../utils/fetchStatus";
|
|
16
14
|
import { isObjectValue } from "../../utils/json";
|
|
17
15
|
import {
|
|
18
16
|
mockupEndpoint,
|
|
@@ -32,6 +30,7 @@ import {
|
|
|
32
30
|
undo,
|
|
33
31
|
type MockupHistory,
|
|
34
32
|
} from "../../utils/mockupHistory";
|
|
33
|
+
import { rebasedEdit } from "../../utils/mockupRebase";
|
|
35
34
|
import {
|
|
36
35
|
parseMockupSpec,
|
|
37
36
|
type MockupSpecDocument,
|
|
@@ -42,7 +41,11 @@ type AuthFetch = ReturnType<typeof useAuthFetch>["$authFetch"];
|
|
|
42
41
|
|
|
43
42
|
/** Why the editor's spec changed under the developer, or could not be saved. */
|
|
44
43
|
export type MockupSpecNotice =
|
|
45
|
-
| {
|
|
44
|
+
| {
|
|
45
|
+
kind: "adopted";
|
|
46
|
+
/** The name of the viewer of the editor who wrote the file, when one did: the change is news, not a surprise. */
|
|
47
|
+
by?: string;
|
|
48
|
+
}
|
|
46
49
|
| {
|
|
47
50
|
kind: "refused";
|
|
48
51
|
issue: MockupIssue;
|
|
@@ -57,12 +60,26 @@ export interface MockupAdoption {
|
|
|
57
60
|
next: MockupSpecDocument;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
/** A change the editor made to its own spec: an edit, an undo or a redo. */
|
|
64
|
+
export interface MockupOwnEdit {
|
|
65
|
+
previous: MockupSpecDocument;
|
|
66
|
+
next: MockupSpecDocument;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
interface MockupSpecOptions {
|
|
61
70
|
name: string;
|
|
62
71
|
authFetch: AuthFetch;
|
|
63
72
|
/** The compiled state the stream last sent: each new one re-reads the file. */
|
|
64
73
|
state: Readonly<ShallowRef<MockupState | undefined>>;
|
|
65
74
|
onNotice: (notice: MockupSpecNotice) => void;
|
|
75
|
+
/** This browser session's viewer id, which each write names: its own locks do not refuse it. */
|
|
76
|
+
viewer?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The id of the block this session holds the lock of, while it holds one:
|
|
79
|
+
* the editor finds the block by it, wherever an edit or an outside change
|
|
80
|
+
* put it, and never writes it.
|
|
81
|
+
*/
|
|
82
|
+
held?: Readonly<Ref<string | undefined>>;
|
|
66
83
|
}
|
|
67
84
|
|
|
68
85
|
/** The spec the `/mockup` editor changes, and its undo history. */
|
|
@@ -73,6 +90,13 @@ export interface MockupSpecEditor {
|
|
|
73
90
|
canRedo: ComputedRef<boolean>;
|
|
74
91
|
/** The last change from outside the editor took over its own spec. */
|
|
75
92
|
adoption: Readonly<ShallowRef<MockupAdoption | undefined>>;
|
|
93
|
+
/**
|
|
94
|
+
* The digest of the file as the editor last read or wrote it: the file's
|
|
95
|
+
* once no edit is pending, which names the spec a lock is taken in.
|
|
96
|
+
*/
|
|
97
|
+
digest: Readonly<ShallowRef<string | undefined>>;
|
|
98
|
+
/** The last change the editor made to its own spec: never one that came from outside, nor one that took ids a note stamped. */
|
|
99
|
+
ownEdit: Readonly<ShallowRef<MockupOwnEdit | undefined>>;
|
|
76
100
|
/** Whether the last write failed and is being retried: true until one lands. */
|
|
77
101
|
hasFailed: ComputedRef<boolean>;
|
|
78
102
|
/**
|
|
@@ -108,16 +132,18 @@ const HTTP_CONFLICT = 409;
|
|
|
108
132
|
interface SpecSource {
|
|
109
133
|
spec: MockupSpecDocument;
|
|
110
134
|
digest: string;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
114
|
-
return isObject(value) && value !== null && !Array.isArray(value);
|
|
135
|
+
/** The name of the viewer of an editor whose write made this very file. */
|
|
136
|
+
writtenBy?: { name: string };
|
|
115
137
|
}
|
|
116
138
|
|
|
117
139
|
function parseSource(value: JsonValue | undefined): SpecSource | undefined {
|
|
118
140
|
if (!isObjectValue(value) || !isString(value.digest)) return undefined;
|
|
119
141
|
const spec = parseMockupSpec(value.spec);
|
|
120
|
-
|
|
142
|
+
if (!spec) return undefined;
|
|
143
|
+
const { writtenBy } = value;
|
|
144
|
+
return isObjectValue(writtenBy) && isString(writtenBy.name)
|
|
145
|
+
? { spec, digest: value.digest, writtenBy: { name: writtenBy.name } }
|
|
146
|
+
: { spec, digest: value.digest };
|
|
121
147
|
}
|
|
122
148
|
|
|
123
149
|
type WriteAnswer =
|
|
@@ -139,12 +165,6 @@ function parseWriteAnswer(
|
|
|
139
165
|
: undefined;
|
|
140
166
|
}
|
|
141
167
|
|
|
142
|
-
function statusOf(cause: unknown): number | undefined {
|
|
143
|
-
if (!isRecord(cause)) return undefined;
|
|
144
|
-
const response = isRecord(cause.response) ? cause.response : {};
|
|
145
|
-
return [cause.status, cause.statusCode, response.status].find(isNumber);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
168
|
function sameSpec(
|
|
149
169
|
left: MockupSpecDocument,
|
|
150
170
|
right: MockupSpecDocument,
|
|
@@ -161,11 +181,13 @@ class MockupSpecSync {
|
|
|
161
181
|
readonly history = shallowRef<MockupHistory<MockupSpecDocument>>();
|
|
162
182
|
readonly written = shallowRef<MockupSpecDocument>();
|
|
163
183
|
readonly adoption = shallowRef<MockupAdoption>();
|
|
184
|
+
readonly ownEdit = shallowRef<MockupOwnEdit>();
|
|
185
|
+
/** The digest of the file as the editor last read or wrote it. */
|
|
186
|
+
readonly digest = shallowRef<string>();
|
|
164
187
|
readonly hasFailed = shallowRef(false);
|
|
165
188
|
readonly isAwaitingState = shallowRef(false);
|
|
166
189
|
isClosed = false;
|
|
167
190
|
private readonly endpoint: string;
|
|
168
|
-
private digest: string | undefined;
|
|
169
191
|
private timer: ReturnType<typeof setTimeout> | undefined;
|
|
170
192
|
private retryTimer: ReturnType<typeof setTimeout> | undefined;
|
|
171
193
|
private failures = 0;
|
|
@@ -223,7 +245,7 @@ class MockupSpecSync {
|
|
|
223
245
|
(spec) => spec !== undefined && sameSpec(source.spec, spec),
|
|
224
246
|
);
|
|
225
247
|
if (!own) return false;
|
|
226
|
-
this.digest = source.digest;
|
|
248
|
+
this.digest.value = source.digest;
|
|
227
249
|
this.written.value = own;
|
|
228
250
|
this.landed();
|
|
229
251
|
return true;
|
|
@@ -242,22 +264,52 @@ class MockupSpecSync {
|
|
|
242
264
|
stampedHistory(this.history.value, bases, source.spec);
|
|
243
265
|
if (!stamped) return false;
|
|
244
266
|
this.history.value = stamped.history;
|
|
245
|
-
this.digest = source.digest;
|
|
267
|
+
this.digest.value = source.digest;
|
|
246
268
|
this.written.value = stamped.written;
|
|
247
269
|
this.landed();
|
|
248
270
|
return true;
|
|
249
271
|
}
|
|
250
272
|
|
|
273
|
+
/**
|
|
274
|
+
* The file with the edit not written yet put back on it, when the edit is
|
|
275
|
+
* all inside the block this session holds: see {@link rebasedEdit}.
|
|
276
|
+
*/
|
|
277
|
+
private keptEdit(source: SpecSource): MockupSpecDocument | undefined {
|
|
278
|
+
const present = this.history.value?.present;
|
|
279
|
+
const held = this.options.held?.value;
|
|
280
|
+
const written = this.written.value;
|
|
281
|
+
if (!present || !written || present === written || held === undefined) {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
return rebasedEdit(written, present, source.spec, held);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Takes the file in place of the spec held, starting the history over. An
|
|
289
|
+
* edit inside the block this session holds is kept and written on top. The
|
|
290
|
+
* notice names the viewer who wrote the file only when no edit not written
|
|
291
|
+
* yet goes with it: an edit it drops is never dropped in silence.
|
|
292
|
+
*/
|
|
251
293
|
adopt(source: SpecSource, isNews: boolean): void {
|
|
252
294
|
const previous = this.history.value?.present;
|
|
295
|
+
const kept = isNews ? this.keptEdit(source) : undefined;
|
|
296
|
+
const isLosing =
|
|
297
|
+
previous !== undefined && previous !== this.written.value && !kept;
|
|
253
298
|
this.stopTimers();
|
|
254
299
|
this.landed();
|
|
255
|
-
this.digest = source.digest;
|
|
300
|
+
this.digest.value = source.digest;
|
|
256
301
|
this.written.value = source.spec;
|
|
257
|
-
this.history.value =
|
|
302
|
+
this.history.value = kept
|
|
303
|
+
? commit(reset(source.spec), kept)
|
|
304
|
+
: reset(source.spec);
|
|
258
305
|
if (!isNews) return;
|
|
259
|
-
this.adoption.value = { previous, next: source.spec };
|
|
260
|
-
this.options.onNotice(
|
|
306
|
+
this.adoption.value = { previous, next: kept ?? source.spec };
|
|
307
|
+
this.options.onNotice(
|
|
308
|
+
source.writtenBy && !isLosing
|
|
309
|
+
? { kind: "adopted", by: source.writtenBy.name }
|
|
310
|
+
: { kind: "adopted" },
|
|
311
|
+
);
|
|
312
|
+
if (kept) this.schedule();
|
|
261
313
|
}
|
|
262
314
|
|
|
263
315
|
private isBusy(): boolean {
|
|
@@ -272,7 +324,7 @@ class MockupSpecSync {
|
|
|
272
324
|
const source = await this.read();
|
|
273
325
|
const present = this.history.value?.present;
|
|
274
326
|
if (!source || this.isClosed) return;
|
|
275
|
-
if (source.digest === this.digest) {
|
|
327
|
+
if (source.digest === this.digest.value) {
|
|
276
328
|
if (!this.isBusy() && present !== this.written.value) {
|
|
277
329
|
ignoreRejection(this.write());
|
|
278
330
|
}
|
|
@@ -324,7 +376,7 @@ class MockupSpecSync {
|
|
|
324
376
|
cause: unknown,
|
|
325
377
|
sent: MockupSpecDocument,
|
|
326
378
|
): Promise<void> {
|
|
327
|
-
if (
|
|
379
|
+
if (fetchStatus(cause) !== HTTP_CONFLICT) {
|
|
328
380
|
if (!this.unconfirmed.includes(sent)) this.unconfirmed.push(sent);
|
|
329
381
|
this.failed(cause);
|
|
330
382
|
return;
|
|
@@ -356,11 +408,18 @@ class MockupSpecSync {
|
|
|
356
408
|
const answer = parseWriteAnswer(
|
|
357
409
|
await this.options.authFetch<JsonValue>(this.endpoint, {
|
|
358
410
|
method: "PUT",
|
|
359
|
-
body:
|
|
411
|
+
body:
|
|
412
|
+
this.options.viewer === undefined
|
|
413
|
+
? { spec, digest: this.digest.value }
|
|
414
|
+
: {
|
|
415
|
+
spec,
|
|
416
|
+
digest: this.digest.value,
|
|
417
|
+
viewer: this.options.viewer,
|
|
418
|
+
},
|
|
360
419
|
}),
|
|
361
420
|
);
|
|
362
421
|
if (answer?.ok) {
|
|
363
|
-
this.digest = answer.digest;
|
|
422
|
+
this.digest.value = answer.digest;
|
|
364
423
|
this.written.value = spec;
|
|
365
424
|
this.isAwaitingState.value =
|
|
366
425
|
this.options.state.value?.revision === sentAt;
|
|
@@ -392,8 +451,10 @@ class MockupSpecSync {
|
|
|
392
451
|
}
|
|
393
452
|
|
|
394
453
|
move(next: MockupHistory<MockupSpecDocument>): void {
|
|
395
|
-
|
|
454
|
+
const previous = this.history.value?.present;
|
|
455
|
+
if (!previous || next === this.history.value) return;
|
|
396
456
|
this.history.value = next;
|
|
457
|
+
this.ownEdit.value = { previous, next: next.present };
|
|
397
458
|
this.schedule();
|
|
398
459
|
}
|
|
399
460
|
|
|
@@ -451,6 +512,8 @@ export function useMockupSpec(options: MockupSpecOptions): MockupSpecEditor {
|
|
|
451
512
|
canUndo: computed(() => !!history.value?.past.length),
|
|
452
513
|
canRedo: computed(() => !!history.value?.future.length),
|
|
453
514
|
adoption: sync.adoption,
|
|
515
|
+
ownEdit: sync.ownEdit,
|
|
516
|
+
digest: sync.digest,
|
|
454
517
|
hasFailed: computed(() => sync.hasFailed.value),
|
|
455
518
|
isPending: computed(
|
|
456
519
|
() =>
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts
CHANGED
|
@@ -50,6 +50,7 @@ export function useMockupViewerPages(options: ViewerPagesOptions) {
|
|
|
50
50
|
}),
|
|
51
51
|
pages,
|
|
52
52
|
categories: computed(() => shown.value?.categories ?? []),
|
|
53
|
+
modules: computed(() => shown.value?.modules ?? []),
|
|
53
54
|
issues: computed(() => shown.value?.issues ?? []),
|
|
54
55
|
requestedPage,
|
|
55
56
|
record,
|
package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computed, onBeforeUnmount, onMounted, type Ref } from "vue";
|
|
2
2
|
import {
|
|
3
3
|
isFieldKey,
|
|
4
|
+
isInspectorEscape,
|
|
4
5
|
matchShortcuts,
|
|
5
6
|
type MockupShortcutId,
|
|
6
7
|
type MockupView,
|
|
@@ -44,8 +45,9 @@ function always(act: () => void): () => boolean {
|
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* The viewer's keyboard: the shortcuts table's actions, each of the view the
|
|
47
|
-
* canvas shows, fired by the window's key presses outside a field,
|
|
48
|
-
* Escape the
|
|
48
|
+
* canvas shows, fired by the window's key presses outside a field, by an
|
|
49
|
+
* Escape a field of the inspector left, and by an Escape the preview frame
|
|
50
|
+
* reports. Escape steps back from the innermost
|
|
49
51
|
* thing going on: an armed block, the comment tool, a pin, the selection.
|
|
50
52
|
*/
|
|
51
53
|
export function useMockupViewerShortcuts(
|
|
@@ -119,8 +121,14 @@ export function useMockupViewerShortcuts(
|
|
|
119
121
|
return matchShortcuts(event, view.value).some((id) => actions[id]());
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
/** Whether the viewer takes a key: one pressed outside a field, or an Escape a field of the inspector left, with a block selected to step back from. */
|
|
125
|
+
function takesKey(event: KeyboardEvent): boolean {
|
|
126
|
+
if (!isFieldKey(event.target)) return true;
|
|
127
|
+
return editing.selection.value !== undefined && isInspectorEscape(event);
|
|
128
|
+
}
|
|
129
|
+
|
|
122
130
|
function onKeydown(event: KeyboardEvent): void {
|
|
123
|
-
if (
|
|
131
|
+
if (!takesKey(event)) return;
|
|
124
132
|
if (run(event)) event.preventDefault();
|
|
125
133
|
}
|
|
126
134
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "../../../composables/chart/apexYRange";
|
|
7
7
|
import { thinnedCategoryFormatter } from "../../../composables/chart/apexCategoryLabels";
|
|
8
8
|
import type { ChartType } from "../../../composables/chart/types";
|
|
9
|
+
import { categoryLabelFormatter, isHorizontalBar } from "./apexCategoryFormat";
|
|
9
10
|
import type { UseApexChartInput } from "../../../composables/chart/useApexChart.types";
|
|
10
11
|
import {
|
|
11
12
|
readThemeBorderAccented,
|
|
@@ -43,6 +44,12 @@ export function buildYAxis(
|
|
|
43
44
|
yaxis.min = input.yRange.min;
|
|
44
45
|
yaxis.max = input.yRange.max;
|
|
45
46
|
}
|
|
47
|
+
if (isHorizontalBar(input)) {
|
|
48
|
+
const categories = categoryLabelFormatter(input);
|
|
49
|
+
if (categories)
|
|
50
|
+
yaxis.labels.formatter = (value: number | string) => categories(value);
|
|
51
|
+
return yaxis;
|
|
52
|
+
}
|
|
46
53
|
const valueFormatter = CATEGORY_YAXIS_TYPES.includes(input.type)
|
|
47
54
|
? undefined
|
|
48
55
|
: input.yAxisFormatter;
|
|
@@ -73,6 +80,9 @@ export function thinsOwnXLabels(
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
function xLabelFormatter(input: UseApexChartInput) {
|
|
83
|
+
const valueFormatter = input.yAxisFormatter;
|
|
84
|
+
if (isHorizontalBar(input))
|
|
85
|
+
return valueFormatter && ((value: string) => valueFormatter(Number(value)));
|
|
76
86
|
if (thinsOwnXLabels(input))
|
|
77
87
|
return thinnedCategoryFormatter(input.xAxisFormatter);
|
|
78
88
|
return input.xAxisFormatter;
|
|
@@ -85,7 +95,7 @@ export function buildXAxis(
|
|
|
85
95
|
const settings = input.xAxis;
|
|
86
96
|
const formatter = xLabelFormatter(input);
|
|
87
97
|
const xaxis: ReturnType<typeof buildXAxis> = {
|
|
88
|
-
type: input.xaxisType ?? "category",
|
|
98
|
+
type: isHorizontalBar(input) ? "category" : (input.xaxisType ?? "category"),
|
|
89
99
|
axisBorder: { show: false },
|
|
90
100
|
axisTicks: { show: false },
|
|
91
101
|
tooltip: { enabled: false },
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isNumber,
|
|
3
|
+
isString,
|
|
4
|
+
} from "../../../../../dms-core/app/utils/type-check";
|
|
5
|
+
import type { UseApexChartInput } from "../../../composables/chart/useApexChart.types";
|
|
6
|
+
|
|
7
|
+
/** A horizontal bar puts its categories on the vertical axis, which Apex labels through the y formatter. */
|
|
8
|
+
export function isHorizontalBar(input: UseApexChartInput): boolean {
|
|
9
|
+
return input.type === "bar" && input.orientation !== "vertical";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Writes a category as text: through `xAxisFormatter`, else as a date when
|
|
14
|
+
* the axis is datetime and the category is a timestamp or a date string.
|
|
15
|
+
*/
|
|
16
|
+
export function categoryLabelFormatter(
|
|
17
|
+
input: UseApexChartInput,
|
|
18
|
+
): ((value: string | number) => string) | undefined {
|
|
19
|
+
const { xAxisFormatter } = input;
|
|
20
|
+
if (xAxisFormatter) {
|
|
21
|
+
return (value) =>
|
|
22
|
+
xAxisFormatter(String(value), isNumber(value) ? value : undefined);
|
|
23
|
+
}
|
|
24
|
+
if (input.xaxisType !== "datetime") return undefined;
|
|
25
|
+
const format = new Intl.DateTimeFormat(input.locale, { dateStyle: "medium" });
|
|
26
|
+
return (value) => {
|
|
27
|
+
const date = new Date(
|
|
28
|
+
isString(value) && /^-?\d+$/.test(value) ? Number(value) : value,
|
|
29
|
+
);
|
|
30
|
+
return Number.isNaN(date.getTime()) ? String(value) : format.format(date);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ApexOptions } from "apexcharts";
|
|
2
2
|
import { isNumber } from "../../../../../dms-core/app/utils/type-check";
|
|
3
|
+
import { categoryLabelFormatter, isHorizontalBar } from "./apexCategoryFormat";
|
|
3
4
|
import type { ApexTypeConfig } from "../../../composables/chart/apexTypeConfigs";
|
|
4
5
|
import type { ChartSeries, ChartType } from "../../../composables/chart/types";
|
|
5
6
|
import type { UseApexChartInput } from "../../../composables/chart/useApexChart.types";
|
|
@@ -116,7 +117,13 @@ export function buildTooltip(
|
|
|
116
117
|
intersect: !config.sharedTooltip,
|
|
117
118
|
marker: { show: true },
|
|
118
119
|
};
|
|
119
|
-
if (input
|
|
120
|
+
if (isHorizontalBar(input)) {
|
|
121
|
+
const categories = categoryLabelFormatter(input);
|
|
122
|
+
tooltip.x = {
|
|
123
|
+
formatter: (value: string | number) =>
|
|
124
|
+
categories ? categories(value) : String(value ?? ""),
|
|
125
|
+
};
|
|
126
|
+
} else if (input.xaxisType === "datetime") {
|
|
120
127
|
tooltip.x = { format: TOOLTIP_DATETIME_FORMAT };
|
|
121
128
|
}
|
|
122
129
|
if (input.yAxisFormatter) {
|
|
@@ -36,6 +36,8 @@ interface IdentityBadgeOption {
|
|
|
36
36
|
|
|
37
37
|
interface IdentityOptions {
|
|
38
38
|
avatarField?: string;
|
|
39
|
+
/** `square` draws the avatar whole in the icon's tile; `circle` otherwise. */
|
|
40
|
+
avatarFrame?: string;
|
|
39
41
|
icon?: string;
|
|
40
42
|
/** Row field holding the tile's icon; `icon` when it is empty. */
|
|
41
43
|
iconField?: string;
|
|
@@ -99,6 +101,7 @@ export function renderIdentity(
|
|
|
99
101
|
emptyLabel: opts.emptyLabel ? processI18n(opts.emptyLabel) : undefined,
|
|
100
102
|
emptyIcon: opts.emptyIcon,
|
|
101
103
|
avatar: avatarOf(readRowField(row, opts.avatarField)),
|
|
104
|
+
avatarFrame: opts.avatarFrame === "square" ? "square" : "circle",
|
|
102
105
|
icon: stringOf(readRowField(row, opts.iconField)) ?? opts.icon,
|
|
103
106
|
selfId: stringOf(readRowField(row, opts.selfField)),
|
|
104
107
|
selfLabel: opts.selfLabel ? processI18n(opts.selfLabel) : undefined,
|
package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts
CHANGED
|
@@ -66,8 +66,7 @@ function formatAddress(value: CellValue): string {
|
|
|
66
66
|
const parts = [
|
|
67
67
|
street,
|
|
68
68
|
addr.addressLine2,
|
|
69
|
-
addr.postalCode,
|
|
70
|
-
addr.city,
|
|
69
|
+
[addr.postalCode, addr.city].filter(Boolean).join(" "),
|
|
71
70
|
addr.countrySubdivision,
|
|
72
71
|
countryName,
|
|
73
72
|
].filter(Boolean);
|
|
@@ -8,6 +8,9 @@ import type {
|
|
|
8
8
|
DataTypeFormatter,
|
|
9
9
|
} from "#dms-core/app/composables/data-types/useDataType";
|
|
10
10
|
import StatusPill from "../../../components/status-pill/StatusPill.vue";
|
|
11
|
+
import { isObject } from "#dms-core/app/utils/type-check";
|
|
12
|
+
import { readRelationLabel } from "./relationBadges";
|
|
13
|
+
import { DEFAULT_RELATION_VALUE_KEY } from "./relationValue";
|
|
11
14
|
import MonoCell from "../../components/table/MonoCell.vue";
|
|
12
15
|
import { getAppComposedText } from "../../../../../dms-core/app/composables/translation/useComposedText";
|
|
13
16
|
import {
|
|
@@ -32,6 +35,8 @@ interface SelectItemOption {
|
|
|
32
35
|
value: unknown;
|
|
33
36
|
label?: string;
|
|
34
37
|
icon?: string;
|
|
38
|
+
textColor?: string;
|
|
39
|
+
iconColor?: string;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
interface StatusPillOptions {
|
|
@@ -46,13 +51,24 @@ interface StatusPillOptions {
|
|
|
46
51
|
typeOptions?: { items?: SelectItemOption[] };
|
|
47
52
|
}
|
|
48
53
|
|
|
49
|
-
function statusPillTone(
|
|
50
|
-
|
|
54
|
+
function statusPillTone(
|
|
55
|
+
opts: StatusPillOptions,
|
|
56
|
+
key: string,
|
|
57
|
+
row: Row,
|
|
58
|
+
item?: SelectItemOption,
|
|
59
|
+
) {
|
|
60
|
+
return (
|
|
61
|
+
readRowTone(row, opts.toneField) ??
|
|
62
|
+
opts.tones?.[key] ??
|
|
63
|
+
item?.textColor ??
|
|
64
|
+
item?.iconColor ??
|
|
65
|
+
"neutral"
|
|
66
|
+
);
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
/**
|
|
54
70
|
* `status_pill`: a tinted pill led by a dot, in the tone the row gives
|
|
55
|
-
* (`toneField`)
|
|
71
|
+
* (`toneField`), the value maps to or its select item carries, with an optional line under it (a
|
|
56
72
|
* failure's cause, a composed "retry Oct 10") in the row's tone, else
|
|
57
73
|
* `subTone`, else the pill's.
|
|
58
74
|
*/
|
|
@@ -68,7 +84,7 @@ function renderStatusPill(
|
|
|
68
84
|
const item = opts.typeOptions?.items?.find(
|
|
69
85
|
(candidate) => String(candidate.value) === key,
|
|
70
86
|
);
|
|
71
|
-
const tone = statusPillTone(opts, key, row);
|
|
87
|
+
const tone = statusPillTone(opts, key, row, item);
|
|
72
88
|
const pill = h(StatusPill, {
|
|
73
89
|
tone,
|
|
74
90
|
label: processI18n(item?.label ?? key),
|
|
@@ -272,6 +288,30 @@ function renderDuration(
|
|
|
272
288
|
*/
|
|
273
289
|
interface MonoOptions {
|
|
274
290
|
copy?: boolean;
|
|
291
|
+
/** The column's own type options: a relation's key mapping names its label. */
|
|
292
|
+
typeOptions?: {
|
|
293
|
+
keyMapping?: { label?: string; value?: string };
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const MONO_RELATION_LABEL_KEY = "name";
|
|
298
|
+
|
|
299
|
+
/** The text a mono cell shows: a related row reads as its label, not as an object. */
|
|
300
|
+
function monoText(
|
|
301
|
+
value: Parameters<DataTypeFormatter>[0],
|
|
302
|
+
opts: MonoOptions,
|
|
303
|
+
): string {
|
|
304
|
+
if (Array.isArray(value)) {
|
|
305
|
+
const items: unknown[] = value;
|
|
306
|
+
return items.map((item) => monoText(item, opts)).join(", ");
|
|
307
|
+
}
|
|
308
|
+
if (!isObject(value) || value === null) return String(value);
|
|
309
|
+
const mapping = opts.typeOptions?.keyMapping;
|
|
310
|
+
return readRelationLabel(
|
|
311
|
+
value,
|
|
312
|
+
mapping?.label || MONO_RELATION_LABEL_KEY,
|
|
313
|
+
mapping?.value || DEFAULT_RELATION_VALUE_KEY,
|
|
314
|
+
);
|
|
275
315
|
}
|
|
276
316
|
|
|
277
317
|
export const registerMetricCellTypes = (
|
|
@@ -317,7 +357,7 @@ export const registerMetricCellTypes = (
|
|
|
317
357
|
default: (value, _locale, options) => {
|
|
318
358
|
const opts: MonoOptions = options ?? {};
|
|
319
359
|
return h(MonoCell, {
|
|
320
|
-
value:
|
|
360
|
+
value: monoText(value, opts),
|
|
321
361
|
copy: !!opts.copy,
|
|
322
362
|
class: CELL_TEXT_CLASS,
|
|
323
363
|
});
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { isEmptyFormValue, sameFormValue } from "../unsaved-changes/formValue";
|
|
2
2
|
import { isBoolean, isNumber, isString } from "#dms-core/app/utils/type-check";
|
|
3
|
+
import type { TableFilter } from "../../components/table/Table.types";
|
|
4
|
+
import {
|
|
5
|
+
buildFiltersQuery,
|
|
6
|
+
combineFilters,
|
|
7
|
+
} from "../table-view/utils/tableQuery";
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* A relation picker narrowed by another field of its form: the related
|
|
@@ -24,15 +29,23 @@ function isFilterValue(
|
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
31
|
* The query narrowing the picker's search: the related table's filter
|
|
27
|
-
* syntax (`filter_<field
|
|
28
|
-
*
|
|
32
|
+
* syntax (`filter_<field>=<mode>:<value>`), the one its funnel sends. The
|
|
33
|
+
* fixed `filter` always applies, `filterBy` only while its source field
|
|
34
|
+
* holds a single value; a field both name gets both conditions.
|
|
29
35
|
*/
|
|
30
36
|
export function relationFilterParams(
|
|
31
37
|
filterBy: RelationFilterBy | undefined,
|
|
32
38
|
sourceValue: RelationPickChange["source"],
|
|
39
|
+
filter?: TableFilter,
|
|
33
40
|
) {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
const narrowing: TableFilter[] =
|
|
42
|
+
filterBy && isFilterValue(sourceValue)
|
|
43
|
+
? [{ accessorKey: filterBy.field, mode: FILTER_MODE, value: sourceValue }]
|
|
44
|
+
: [];
|
|
45
|
+
return combineFilters(
|
|
46
|
+
buildFiltersQuery(filter ? [filter] : []),
|
|
47
|
+
buildFiltersQuery(narrowing),
|
|
48
|
+
);
|
|
36
49
|
}
|
|
37
50
|
|
|
38
51
|
/** The source field and the pick, before and after a change of either. */
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
export function currentPageUrlValues(): ReplaceUrlVariablesContext {
|
|
14
14
|
const route = useDmsRoute();
|
|
15
15
|
return {
|
|
16
|
-
routeParams:
|
|
16
|
+
routeParams: findPageRoute(route.path)?.params,
|
|
17
17
|
routeQuery: route.query,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -30,7 +30,7 @@ export function calendarToDate(
|
|
|
30
30
|
calendar: CalendarDate,
|
|
31
31
|
asEndOfDay: boolean,
|
|
32
32
|
): Date {
|
|
33
|
-
const native =
|
|
33
|
+
const native = calendar.toDate(getLocalTimeZone());
|
|
34
34
|
if (asEndOfDay) {
|
|
35
35
|
native.setHours(
|
|
36
36
|
END_OF_DAY_HOURS,
|