@antelopejs/dms 0.25.7 → 0.25.8-next.1166.gbc4d5cc

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.
Files changed (409) hide show
  1. package/E2E.md +3 -2
  2. package/data/mockup-example/spec.json +11 -0
  3. package/data/mockup-spec.schema.json +399 -20
  4. package/dist/e2e/index.d.mts +3 -1
  5. package/dist/e2e/run-state.d.mts +8 -0
  6. package/dist/e2e/stack.d.mts +3 -1
  7. package/dist/implementations/dms/page/access.js +1 -1
  8. package/dist/implementations/dms/page/access.js.map +1 -1
  9. package/dist/implementations/dms/page/payloads.js +1 -1
  10. package/dist/implementations/dms/page/payloads.js.map +1 -1
  11. package/dist/implementations/dms/page/registry.js +1 -1
  12. package/dist/implementations/dms/page/registry.js.map +1 -1
  13. package/dist/implementations/dms-base/bulk-selection.d.ts +1 -1
  14. package/dist/implementations/dms-base/bulk-selection.js +7 -1
  15. package/dist/implementations/dms-base/bulk-selection.js.map +1 -1
  16. package/dist/implementations/dms-base/group-order.d.ts +1 -1
  17. package/dist/implementations/dms-base/group-order.js +17 -4
  18. package/dist/implementations/dms-base/group-order.js.map +1 -1
  19. package/dist/implementations/dms-base/search-route.d.ts +1 -1
  20. package/dist/implementations/dms-base/search-route.js +11 -3
  21. package/dist/implementations/dms-base/search-route.js.map +1 -1
  22. package/dist/implementations/dms-base/table-view.js +12 -3
  23. package/dist/implementations/dms-base/table-view.js.map +1 -1
  24. package/dist/implementations/dms-builder/engine/expression.js +3 -2
  25. package/dist/implementations/dms-builder/engine/expression.js.map +1 -1
  26. package/dist/implementations/dms-builder/engine/inherited-variables.js +2 -1
  27. package/dist/implementations/dms-builder/engine/inherited-variables.js.map +1 -1
  28. package/dist/implementations/dms-builder/engine/preview.js +2 -1
  29. package/dist/implementations/dms-builder/engine/preview.js.map +1 -1
  30. package/dist/implementations/dms-builder/engine/table-view-settings.js +34 -14
  31. package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/mcp/index.d.ts +2 -0
  35. package/dist/mcp/index.js +9 -0
  36. package/dist/mcp/index.js.map +1 -1
  37. package/dist/mcp/mockup-export/capture.d.ts +19 -0
  38. package/dist/mcp/mockup-export/capture.js +99 -0
  39. package/dist/mcp/mockup-export/capture.js.map +1 -0
  40. package/dist/mcp/mockup-export/document.d.ts +4 -0
  41. package/dist/mcp/mockup-export/document.js +199 -0
  42. package/dist/mcp/mockup-export/document.js.map +1 -0
  43. package/dist/mcp/mockup-export/index.d.ts +20 -0
  44. package/dist/mcp/mockup-export/index.js +110 -0
  45. package/dist/mcp/mockup-export/index.js.map +1 -0
  46. package/dist/mcp/mockup-export/jobs.d.ts +32 -0
  47. package/dist/mcp/mockup-export/jobs.js +49 -0
  48. package/dist/mcp/mockup-export/jobs.js.map +1 -0
  49. package/dist/mcp/mockup-export/plan.d.ts +78 -0
  50. package/dist/mcp/mockup-export/plan.js +292 -0
  51. package/dist/mcp/mockup-export/plan.js.map +1 -0
  52. package/dist/mcp/mockup-export/route.d.ts +23 -0
  53. package/dist/mcp/mockup-export/route.js +91 -0
  54. package/dist/mcp/mockup-export/route.js.map +1 -0
  55. package/dist/mcp/page-verify/index.d.ts +15 -0
  56. package/dist/mcp/page-verify/index.js +16 -6
  57. package/dist/mcp/page-verify/index.js.map +1 -1
  58. package/dist/mcp/page-verify/mockup.d.ts +2 -1
  59. package/dist/mcp/page-verify/mockup.js +1 -0
  60. package/dist/mcp/page-verify/mockup.js.map +1 -1
  61. package/dist/mcp/page-verify/modules.d.ts +8 -0
  62. package/dist/mcp/page-verify/modules.js +49 -0
  63. package/dist/mcp/page-verify/modules.js.map +1 -0
  64. package/dist/mcp/page-verify/playwright.d.ts +22 -4
  65. package/dist/mcp/page-verify/playwright.js.map +1 -1
  66. package/dist/mcp/page-verify/report.d.ts +1 -0
  67. package/dist/mcp/tools/mockup-export-pdf.d.ts +1 -0
  68. package/dist/mcp/tools/mockup-export-pdf.js +69 -0
  69. package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
  70. package/dist/mcp/tools/mockup-module-catalog.d.ts +1 -0
  71. package/dist/mcp/tools/mockup-module-catalog.js +36 -0
  72. package/dist/mcp/tools/mockup-module-catalog.js.map +1 -0
  73. package/dist/mcp/tools/mockup-read-spec.js +2 -3
  74. package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
  75. package/dist/mcp/tools/mockup.js +4 -0
  76. package/dist/mcp/tools/mockup.js.map +1 -1
  77. package/dist/mcp/tools/page-verify.d.ts +1 -0
  78. package/dist/mcp/tools/page-verify.js +6 -2
  79. package/dist/mcp/tools/page-verify.js.map +1 -1
  80. package/dist/mockup/annotations.js +2 -2
  81. package/dist/mockup/annotations.js.map +1 -1
  82. package/dist/mockup/apply-notes.js +1 -1
  83. package/dist/mockup/apply-notes.js.map +1 -1
  84. package/dist/mockup/compile-layouts.d.ts +5 -0
  85. package/dist/mockup/compile-layouts.js +74 -0
  86. package/dist/mockup/compile-layouts.js.map +1 -0
  87. package/dist/mockup/compile-nodes.d.ts +11 -0
  88. package/dist/mockup/compile-nodes.js +119 -0
  89. package/dist/mockup/compile-nodes.js.map +1 -0
  90. package/dist/mockup/compile-pages.d.ts +18 -0
  91. package/dist/mockup/compile-pages.js +188 -0
  92. package/dist/mockup/compile-pages.js.map +1 -0
  93. package/dist/mockup/compile.d.ts +6 -10
  94. package/dist/mockup/compile.js +31 -289
  95. package/dist/mockup/compile.js.map +1 -1
  96. package/dist/mockup/create.d.ts +16 -0
  97. package/dist/mockup/create.js +78 -0
  98. package/dist/mockup/create.js.map +1 -0
  99. package/dist/mockup/created-watch.d.ts +18 -0
  100. package/dist/mockup/created-watch.js +110 -0
  101. package/dist/mockup/created-watch.js.map +1 -0
  102. package/dist/mockup/entities.d.ts +20 -0
  103. package/dist/mockup/entities.js +213 -0
  104. package/dist/mockup/entities.js.map +1 -0
  105. package/dist/mockup/etag.d.ts +1 -0
  106. package/dist/mockup/etag.js +10 -0
  107. package/dist/mockup/etag.js.map +1 -0
  108. package/dist/mockup/extensions.d.ts +17 -0
  109. package/dist/mockup/extensions.js +56 -0
  110. package/dist/mockup/extensions.js.map +1 -0
  111. package/dist/mockup/files.d.ts +2 -1
  112. package/dist/mockup/files.js +2 -1
  113. package/dist/mockup/files.js.map +1 -1
  114. package/dist/mockup/fixture-answers.d.ts +1 -0
  115. package/dist/mockup/fixture-answers.js +1 -1
  116. package/dist/mockup/fixture-answers.js.map +1 -1
  117. package/dist/mockup/fixture-batch.d.ts +21 -0
  118. package/dist/mockup/fixture-batch.js +111 -0
  119. package/dist/mockup/fixture-batch.js.map +1 -0
  120. package/dist/mockup/fixture-routes.d.ts +21 -0
  121. package/dist/mockup/fixture-routes.js +136 -0
  122. package/dist/mockup/fixture-routes.js.map +1 -0
  123. package/dist/mockup/fixtures.d.ts +0 -27
  124. package/dist/mockup/fixtures.js +11 -117
  125. package/dist/mockup/fixtures.js.map +1 -1
  126. package/dist/mockup/from-page.js +2 -9
  127. package/dist/mockup/from-page.js.map +1 -1
  128. package/dist/mockup/generate.js +4 -1
  129. package/dist/mockup/generate.js.map +1 -1
  130. package/dist/mockup/history-routes.d.ts +2 -4
  131. package/dist/mockup/history-routes.js +27 -36
  132. package/dist/mockup/history-routes.js.map +1 -1
  133. package/dist/mockup/history.js +2 -1
  134. package/dist/mockup/history.js.map +1 -1
  135. package/dist/mockup/index.d.ts +10 -0
  136. package/dist/mockup/index.js +10 -0
  137. package/dist/mockup/index.js.map +1 -1
  138. package/dist/mockup/json-schema-entities.d.ts +5 -0
  139. package/dist/mockup/json-schema-entities.js +141 -0
  140. package/dist/mockup/json-schema-entities.js.map +1 -0
  141. package/dist/mockup/json-schema-layout.d.ts +1 -0
  142. package/dist/mockup/json-schema-layout.js +95 -2
  143. package/dist/mockup/json-schema-layout.js.map +1 -1
  144. package/dist/mockup/json-schema.js +40 -23
  145. package/dist/mockup/json-schema.js.map +1 -1
  146. package/dist/mockup/json.d.ts +8 -0
  147. package/dist/mockup/json.js +20 -0
  148. package/dist/mockup/json.js.map +1 -0
  149. package/dist/mockup/layout-model.d.ts +156 -0
  150. package/dist/mockup/layout-model.js +96 -0
  151. package/dist/mockup/layout-model.js.map +1 -0
  152. package/dist/mockup/layouts.d.ts +9 -0
  153. package/dist/mockup/layouts.js +40 -0
  154. package/dist/mockup/layouts.js.map +1 -0
  155. package/dist/mockup/manage-routes.d.ts +3 -1
  156. package/dist/mockup/manage-routes.js +38 -1
  157. package/dist/mockup/manage-routes.js.map +1 -1
  158. package/dist/mockup/manage.js +1 -1
  159. package/dist/mockup/manage.js.map +1 -1
  160. package/dist/mockup/model.d.ts +137 -101
  161. package/dist/mockup/model.js +105 -91
  162. package/dist/mockup/model.js.map +1 -1
  163. package/dist/mockup/module-manifests.d.ts +99 -0
  164. package/dist/mockup/module-manifests.js +95 -0
  165. package/dist/mockup/module-manifests.js.map +1 -0
  166. package/dist/mockup/module-states.d.ts +10 -0
  167. package/dist/mockup/module-states.js +85 -0
  168. package/dist/mockup/module-states.js.map +1 -0
  169. package/dist/mockup/modules-schema.d.ts +2 -0
  170. package/dist/mockup/modules-schema.js +39 -0
  171. package/dist/mockup/modules-schema.js.map +1 -0
  172. package/dist/mockup/modules.d.ts +6 -9
  173. package/dist/mockup/modules.js +105 -24
  174. package/dist/mockup/modules.js.map +1 -1
  175. package/dist/mockup/owner-controller.js +1 -1
  176. package/dist/mockup/owner-controller.js.map +1 -1
  177. package/dist/mockup/page-capture-routes.d.ts +19 -0
  178. package/dist/mockup/page-capture-routes.js +92 -0
  179. package/dist/mockup/page-capture-routes.js.map +1 -0
  180. package/dist/mockup/page-captures.d.ts +61 -0
  181. package/dist/mockup/page-captures.js +252 -0
  182. package/dist/mockup/page-captures.js.map +1 -0
  183. package/dist/mockup/parse-spec.d.ts +10 -0
  184. package/dist/mockup/parse-spec.js +62 -0
  185. package/dist/mockup/parse-spec.js.map +1 -0
  186. package/dist/mockup/places.d.ts +17 -0
  187. package/dist/mockup/places.js +75 -0
  188. package/dist/mockup/places.js.map +1 -0
  189. package/dist/mockup/presence-board.js +1 -1
  190. package/dist/mockup/presence-board.js.map +1 -1
  191. package/dist/mockup/presence-routes.js +2 -2
  192. package/dist/mockup/presence-routes.js.map +1 -1
  193. package/dist/mockup/refusals.d.ts +5 -0
  194. package/dist/mockup/refusals.js +16 -0
  195. package/dist/mockup/refusals.js.map +1 -1
  196. package/dist/mockup/routes.d.ts +3 -5
  197. package/dist/mockup/routes.js +19 -162
  198. package/dist/mockup/routes.js.map +1 -1
  199. package/dist/mockup/sketch-limits.d.ts +1 -0
  200. package/dist/mockup/sketch-limits.js +2 -1
  201. package/dist/mockup/sketch-limits.js.map +1 -1
  202. package/dist/mockup/sketch.d.ts +2 -2
  203. package/dist/mockup/sketch.js +2 -1
  204. package/dist/mockup/sketch.js.map +1 -1
  205. package/dist/mockup/slug.d.ts +3 -0
  206. package/dist/mockup/slug.js +7 -0
  207. package/dist/mockup/slug.js.map +1 -0
  208. package/dist/mockup/source-routes.d.ts +5 -4
  209. package/dist/mockup/source-routes.js +26 -17
  210. package/dist/mockup/source-routes.js.map +1 -1
  211. package/dist/mockup/source.js +2 -1
  212. package/dist/mockup/source.js.map +1 -1
  213. package/dist/mockup/state-patch.d.ts +22 -0
  214. package/dist/mockup/state-patch.js +75 -0
  215. package/dist/mockup/state-patch.js.map +1 -0
  216. package/dist/mockup/state.d.ts +112 -0
  217. package/dist/mockup/state.js +22 -0
  218. package/dist/mockup/state.js.map +1 -0
  219. package/dist/mockup/store-list.d.ts +28 -0
  220. package/dist/mockup/store-list.js +89 -0
  221. package/dist/mockup/store-list.js.map +1 -0
  222. package/dist/mockup/store.d.ts +16 -37
  223. package/dist/mockup/store.js +85 -200
  224. package/dist/mockup/store.js.map +1 -1
  225. package/dist/mockup/table-archive.d.ts +0 -1
  226. package/dist/mockup/table-archive.js +0 -16
  227. package/dist/mockup/table-archive.js.map +1 -1
  228. package/dist/mockup/tenancy.d.ts +19 -0
  229. package/dist/mockup/tenancy.js +73 -0
  230. package/dist/mockup/tenancy.js.map +1 -0
  231. package/dist/mockup/tenant-rows.d.ts +4 -0
  232. package/dist/mockup/tenant-rows.js +19 -0
  233. package/dist/mockup/tenant-rows.js.map +1 -0
  234. package/dist/pages/settings/users/account-activity.js +2 -1
  235. package/dist/pages/settings/users/account-activity.js.map +1 -1
  236. package/dist/routes/auth/oauth/config.js +1 -1
  237. package/dist/routes/auth/oauth/config.js.map +1 -1
  238. package/dist/routes/system-state.js +1 -1
  239. package/dist/routes/system-state.js.map +1 -1
  240. package/dist/store/interfaces.js +2 -1
  241. package/dist/store/interfaces.js.map +1 -1
  242. package/dist/utils/export-jobs-run.js +4 -4
  243. package/dist/utils/export-jobs-run.js.map +1 -1
  244. package/dist/utils/export-jobs.js +15 -3
  245. package/dist/utils/export-jobs.js.map +1 -1
  246. package/e2e/index.mjs +25 -3
  247. package/e2e/journey-run.mjs +4 -3
  248. package/e2e/run-state.mjs +11 -0
  249. package/e2e/stack.mjs +9 -1
  250. package/frontend-vue/eslint-globals.generated.mjs +40 -38
  251. package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +3 -31
  252. package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +8 -2
  253. package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +5 -2
  254. package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +13 -19
  255. package/frontend-vue/layers/dms-core/app/composables/period/usePeriodScope.ts +6 -15
  256. package/frontend-vue/layers/dms-core/app/utils/localFetchAnswers.ts +124 -0
  257. package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +29 -0
  258. package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +27 -3
  259. package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +27 -3
  260. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +110 -30
  261. package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
  262. package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +19 -7
  263. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +79 -9
  264. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupWidgets.ts +65 -0
  265. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +17 -4
  266. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +12 -0
  267. package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationGroupsOpen.ts +3 -3
  268. package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationPreferences.ts +13 -8
  269. package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +39 -0
  270. package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +12 -2
  271. package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +9 -1
  272. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +3 -1
  273. package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +53 -6
  274. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +31 -5
  275. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +1 -1
  276. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +153 -0
  277. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +23 -0
  278. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +164 -0
  279. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +59 -33
  280. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +51 -0
  281. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +58 -12
  282. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +21 -0
  283. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +1 -1
  284. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +1 -1
  285. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReconnecting.vue +17 -0
  286. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +48 -0
  287. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +77 -9
  288. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +130 -45
  289. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
  290. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/{MockupOverviewZoom.vue → MockupZoomControls.vue} +23 -15
  291. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +4 -2
  292. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +70 -3
  293. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +44 -4
  294. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +14 -2
  295. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +241 -35
  296. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useFixtureBatches.ts +154 -0
  297. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +157 -0
  298. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +165 -0
  299. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +13 -1
  300. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +126 -0
  301. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +10 -5
  302. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +63 -25
  303. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +82 -29
  304. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +138 -0
  305. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +124 -0
  306. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +1 -1
  307. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +10 -3
  308. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +60 -14
  309. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +8 -3
  310. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +6 -2
  311. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +37 -0
  312. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +5 -7
  313. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +56 -0
  314. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +46 -0
  315. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +29 -8
  316. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +13 -2
  317. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +39 -10
  318. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +151 -0
  319. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +19 -0
  320. package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -1
  321. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +1 -1
  322. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +2 -1
  323. package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +3 -1
  324. package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +3 -1
  325. package/frontend-vue/layers/dms-ui/app/build/composables/page-toolbar/toolbarControlHeight.ts +1 -1
  326. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewPresence.ts +10 -4
  327. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSelection.ts +5 -2
  328. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -6
  329. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +4 -1
  330. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/formTexts.ts +2 -2
  331. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/views.ts +1 -1
  332. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +37 -3
  333. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +130 -0
  334. package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +20 -1
  335. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +1 -8
  336. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +141 -103
  337. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +332 -0
  338. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +22 -0
  339. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +75 -173
  340. package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +100 -0
  341. package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +146 -0
  342. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +118 -9
  343. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +0 -2
  344. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
  345. package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +123 -8
  346. package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +6 -2
  347. package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +171 -0
  348. package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +138 -0
  349. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +42 -8
  350. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +66 -0
  351. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +15 -0
  352. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +6 -8
  353. package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +18 -5
  354. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +177 -0
  355. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSections.ts +1 -2
  356. package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +17 -6
  357. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSketchStates.ts +7 -2
  358. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +0 -3
  359. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +179 -0
  360. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +17 -2
  361. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +143 -0
  362. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
  363. package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +2 -7
  364. package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +156 -0
  365. package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +8 -0
  366. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +108 -6
  367. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +5 -1
  368. package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +400 -0
  369. package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
  370. package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +40 -10
  371. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +23 -6
  372. package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +2 -0
  373. package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +1 -2
  374. package/frontend-vue/layers/dms-ui/app/components/form/components/RepeaterTable.vue +3 -1
  375. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +0 -2
  376. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +0 -1
  377. package/frontend-vue/layers/dms-ui/app/composables/chart/useChartTheme.ts +8 -2
  378. package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableDataChanges.ts +5 -4
  379. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +2 -0
  380. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +2 -0
  381. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +2 -0
  382. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useFixtureBatches.ts +1 -0
  383. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +1 -0
  384. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +1 -0
  385. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +1 -0
  386. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupRoutePage.ts +1 -0
  387. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.ts +1 -0
  388. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +1 -0
  389. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePersistedCaptures.ts +1 -0
  390. package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +1 -0
  391. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +1 -0
  392. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +1 -0
  393. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +1 -0
  394. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.ts +1 -0
  395. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
  396. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupStatePatch.ts +1 -0
  397. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +1 -0
  398. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +1 -0
  399. package/frontend-vue/layers/dms-ui/app/entries/utils/previewFixtureAnswers.ts +1 -0
  400. package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +1 -0
  401. package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +53 -4
  402. package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +53 -4
  403. package/frontend-vue/package.json +2 -2
  404. package/frontend-vue/server/private-options.ts +13 -3
  405. package/package.json +5 -5
  406. package/dist/mockup/row-filters.d.ts +0 -8
  407. package/dist/mockup/row-filters.js +0 -107
  408. package/dist/mockup/row-filters.js.map +0 -1
  409. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +0 -47
@@ -59,3 +59,25 @@ export function parseBlockRects(
59
59
  const blocks = value.map(parseBlockRect);
60
60
  return blocks.every((block) => block !== undefined) ? blocks : undefined;
61
61
  }
62
+
63
+ /** Whether two layouts place the same blocks, in the same order, in the same boxes. */
64
+ export function sameBlockRects(
65
+ left: readonly PreviewBlockRect[] | undefined,
66
+ right: readonly PreviewBlockRect[],
67
+ ): boolean {
68
+ return (
69
+ left !== undefined &&
70
+ left.length === right.length &&
71
+ left.every((block, index) => {
72
+ const other = right[index];
73
+ return (
74
+ other !== undefined &&
75
+ block.path === other.path &&
76
+ block.rect.x === other.rect.x &&
77
+ block.rect.y === other.rect.y &&
78
+ block.rect.width === other.rect.width &&
79
+ block.rect.height === other.rect.height
80
+ );
81
+ })
82
+ );
83
+ }
@@ -9,6 +9,29 @@ import {
9
9
  isPreviewPageLayout,
10
10
  type PreviewPageLayout,
11
11
  } from "./previewPageLayout";
12
+ import { isMockupEntities, type MockupEntityState } from "./mockupEntities";
13
+ import {
14
+ isMockupModules,
15
+ isPagePlace,
16
+ type MockupModule,
17
+ type MockupPagePlace,
18
+ } from "./mockupModules";
19
+ import { isMockupTenants, type MockupTenant } from "./mockupTenants";
20
+
21
+ export { MOCKUP_FIELD_TYPES } from "./mockupEntities";
22
+ export type {
23
+ MockupExtensionMenu,
24
+ MockupModule,
25
+ MockupModuleSettingsPage,
26
+ MockupModuleWidget,
27
+ MockupPagePlace,
28
+ MockupWidgetPosition,
29
+ } from "./mockupModules";
30
+ export type {
31
+ MockupEntityField,
32
+ MockupEntityState,
33
+ MockupFieldType,
34
+ } from "./mockupEntities";
12
35
 
13
36
  /** A problem in `spec.json`, at a JSON pointer into it (`""` is the whole file). */
14
37
  export interface MockupIssue {
@@ -43,7 +66,9 @@ export interface MockupPageRoute {
43
66
  export interface MockupPageState {
44
67
  id: string;
45
68
  title: string;
46
- /** The id of the section the page is listed under; none for the default one. */
69
+ /** Where the page lives: the app's menu, a module's root, the Settings, or an existing page the spec extends. */
70
+ place: MockupPagePlace;
71
+ /** The id of the section the page is listed under; none for the default one, and for a page of a module. */
47
72
  category?: string;
48
73
  /** The sidebar leaves the page out: a detail or form page another page opens. */
49
74
  menu?: false;
@@ -61,7 +86,7 @@ export interface MockupPageState {
61
86
  icon?: string;
62
87
  description?: string;
63
88
  headerActions?: PreviewHeaderAction[];
64
- /** The layout the page is drawn in; the dashboard frame when absent. */
89
+ /** The layout the page is drawn in; the dashboard frame when absent. A custom layout is resolved: its regions come with the page. */
65
90
  layout?: PreviewPageLayout;
66
91
  options: MockupPageOptions;
67
92
  /** What `DmsBlockPreview` draws: fixtures resolved, sketch nodes passed through. */
@@ -71,6 +96,13 @@ export interface MockupPageState {
71
96
  * on. Present only when the page names live routes.
72
97
  */
73
98
  realTree?: PreviewNode[];
99
+ /**
100
+ * The route of the page's fixture batch, `?v=` the digest of its content
101
+ * and of which fixtures a tenant sees only its own rows of: it changes with
102
+ * the fixtures the page reads, for every tenant, so a page whose fixtures
103
+ * changed is another page object. Absent when the page reads no fixture.
104
+ */
105
+ fixtures?: string;
74
106
  livePage?: MockupLivePage;
75
107
  /** Spec JSON pointer of each node, keyed by the layout path the preview gives it. */
76
108
  paths: Record<string, string>;
@@ -92,15 +124,6 @@ export interface MockupSidebar {
92
124
  widgets: MockupSidebarWidget[];
93
125
  }
94
126
 
95
- /** A DMS module the mockup's app needs: its entry in the module store catalog. */
96
- export interface MockupModule {
97
- /** The module's id in the catalog. */
98
- id: string;
99
- /** The npm package building the mockup installs. */
100
- package: string;
101
- icon: string;
102
- }
103
-
104
127
  export interface MockupState {
105
128
  name: string;
106
129
  title?: string;
@@ -112,79 +135,18 @@ export interface MockupState {
112
135
  sidebar?: MockupSidebar;
113
136
  /** Absent when the spec lists no module. */
114
137
  modules?: MockupModule[];
138
+ /** The spec's entities, in spec order; absent when the spec has none. */
139
+ entities?: MockupEntityState[];
140
+ /** `fixtures.tenants` of the spec: the workspaces SaaS mode lists; absent when the spec has none. */
141
+ tenants?: MockupTenant[];
142
+ /** `data.connection` of the spec: the external connection the explorer introspects; absent when the spec has no `data`. */
143
+ connection?: string;
115
144
  pages: MockupPageState[];
116
145
  issues: MockupIssue[];
117
146
  /** What the spec likely does not show as meant; absent from a backend that reports none. */
118
147
  warnings?: MockupIssue[];
119
148
  }
120
149
 
121
- export type MockupAnnotationStatus = "open" | "resolved";
122
-
123
- /**
124
- * The block a note is about: the node whose id is `block`, on the page `page`
125
- * when set, then the children whose ids are `steps`.
126
- */
127
- export interface MockupBlockAnchor {
128
- block: string;
129
- steps: string[];
130
- page?: string;
131
- }
132
-
133
- /** What a note is on: a block, or the page `page` as a whole. */
134
- export type MockupNoteAnchor = MockupBlockAnchor | { page: string };
135
-
136
- /** Where a pin sits on its block or page: fractions of its box, from its top left corner. */
137
- export interface MockupPinOffset {
138
- x: number;
139
- y: number;
140
- }
141
-
142
- /**
143
- * A reviewer's pin. `page` and `path` are where it is now: both on a block,
144
- * `page` alone on a page, neither when its block or page was removed.
145
- * `version` is the number of the history version it was pinned on, and
146
- * `resolvedVersion` the one it was resolved on.
147
- */
148
- export interface MockupAnnotation {
149
- id: string;
150
- anchor: MockupNoteAnchor;
151
- offset: MockupPinOffset;
152
- page?: string;
153
- /** Spec JSON pointer of the note's block now. */
154
- path?: string;
155
- text: string;
156
- status: MockupAnnotationStatus;
157
- createdAt: string;
158
- resolvedAt?: string;
159
- version?: number;
160
- resolvedVersion?: number;
161
- /** The state of the sketch the note was pinned on; absent on its own `html` and on any other block. */
162
- state?: string;
163
- }
164
-
165
- /**
166
- * Where a pin is put: on the node at `path` of page `page`, or on the page
167
- * itself without `path`, and the state of the sketch drawn there.
168
- */
169
- export interface MockupPinPlace {
170
- page: string;
171
- path?: string;
172
- offset: MockupPinOffset;
173
- state?: string;
174
- }
175
-
176
- /** What `POST /api/mockup/:name/annotations` takes. */
177
- export interface MockupAnnotationDraft extends MockupPinPlace {
178
- text: string;
179
- }
180
-
181
- /** What `PATCH /api/mockup/:name/annotations/:id` takes. */
182
- export interface MockupAnnotationPatch {
183
- status?: MockupAnnotationStatus;
184
- text?: string;
185
- place?: MockupPinPlace;
186
- }
187
-
188
150
  /** Who wrote a mockup: the dashboard chat, Claude Code or Codex. */
189
151
  export type MockupSource = "chat" | "claude-code" | "codex";
190
152
 
@@ -253,9 +215,15 @@ export const MOCKUP_LIST_ENDPOINT = "/api/mockup";
253
215
  /** The path under a mockup's endpoint of the stored image of its first page. */
254
216
  export const MOCKUP_CAPTURE_SUFFIX = "/capture";
255
217
 
218
+ /** The path under a mockup's endpoint of the images the Overview captured of its pages: all of them on a `GET`, `/<page>` on a `PUT`. */
219
+ export const MOCKUP_PAGE_CAPTURES_SUFFIX = "/captures";
220
+
256
221
  /** Event of the state stream carrying a {@link MockupState}. */
257
222
  export const MOCKUP_STATE_EVENT = "state";
258
223
 
224
+ /** Event of the state stream carrying the patch from the state the stream sent last to the state now. */
225
+ export const MOCKUP_PATCH_EVENT = "patch";
226
+
259
227
  /** Event of the state stream carrying `{ annotations }`. */
260
228
  export const MOCKUP_ANNOTATIONS_EVENT = "annotations";
261
229
 
@@ -301,10 +269,6 @@ function isOptionalString(value: Parameters<typeof isString>[0]): boolean {
301
269
  return value === undefined || isString(value);
302
270
  }
303
271
 
304
- function isOptionalNumber(value: Parameters<typeof isNumber>[0]): boolean {
305
- return value === undefined || isNumber(value);
306
- }
307
-
308
272
  function isIssue(value: Parameters<typeof isObject>[0]): value is MockupIssue {
309
273
  return isRecord(value) && isString(value.path) && isString(value.message);
310
274
  }
@@ -343,13 +307,32 @@ function hasPagePlace(value: Parameters<typeof isObject>[0]): boolean {
343
307
  );
344
308
  }
345
309
 
346
- function isPageState(
310
+ /** Whether a page's content reads right: its options, its tree and the real one, its fixtures, the live page it converts and the pointers of its paths. */
311
+ function hasPageContent(value: Parameters<typeof isObject>[0]): boolean {
312
+ return (
313
+ isRecord(value) &&
314
+ isRecord(value.options) &&
315
+ Array.isArray(value.tree) &&
316
+ isPreviewTree(value.tree) &&
317
+ (value.realTree === undefined ||
318
+ (Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
319
+ isOptionalString(value.fixtures) &&
320
+ (value.livePage === undefined ||
321
+ (isRecord(value.livePage) && isString(value.livePage.ref))) &&
322
+ isRecord(value.paths) &&
323
+ Object.values(value.paths).every((pointer) => isString(pointer))
324
+ );
325
+ }
326
+
327
+ /** Whether `value` is a page of a state, every field of it checked. */
328
+ export function isPageState(
347
329
  value: Parameters<typeof isObject>[0],
348
330
  ): value is MockupPageState {
349
331
  return (
350
332
  isRecord(value) &&
351
333
  isString(value.id) &&
352
334
  isString(value.title) &&
335
+ isPagePlace(value.place) &&
353
336
  isOptionalString(value.category) &&
354
337
  hasPagePlace(value) &&
355
338
  isPreviewHeader({
@@ -359,15 +342,7 @@ function isPageState(
359
342
  actions: value.headerActions,
360
343
  }) &&
361
344
  (value.layout === undefined || isPreviewPageLayout(value.layout)) &&
362
- isRecord(value.options) &&
363
- Array.isArray(value.tree) &&
364
- isPreviewTree(value.tree) &&
365
- (value.realTree === undefined ||
366
- (Array.isArray(value.realTree) && isPreviewTree(value.realTree))) &&
367
- (value.livePage === undefined ||
368
- (isRecord(value.livePage) && isString(value.livePage.ref))) &&
369
- isRecord(value.paths) &&
370
- Object.values(value.paths).every((pointer) => isString(pointer))
345
+ hasPageContent(value)
371
346
  );
372
347
  }
373
348
 
@@ -394,14 +369,14 @@ function isSidebar(
394
369
  );
395
370
  }
396
371
 
397
- function isModule(
398
- value: Parameters<typeof isObject>[0],
399
- ): value is MockupModule {
372
+ /** Whether the parts of a state a spec may leave out are each absent or well-formed. */
373
+ function hasValidParts(value: Parameters<typeof isObject>[0]): boolean {
400
374
  return (
401
375
  isRecord(value) &&
402
- isString(value.id) &&
403
- isString(value.package) &&
404
- isString(value.icon)
376
+ (value.sidebar === undefined || isSidebar(value.sidebar)) &&
377
+ (value.modules === undefined || isMockupModules(value.modules)) &&
378
+ (value.entities === undefined || isMockupEntities(value.entities)) &&
379
+ (value.tenants === undefined || isMockupTenants(value.tenants))
405
380
  );
406
381
  }
407
382
 
@@ -416,9 +391,8 @@ function isMockupState(
416
391
  (value.categories === undefined ||
417
392
  (Array.isArray(value.categories) &&
418
393
  value.categories.every(isMockupCategory))) &&
419
- (value.sidebar === undefined || isSidebar(value.sidebar)) &&
420
- (value.modules === undefined ||
421
- (Array.isArray(value.modules) && value.modules.every(isModule))) &&
394
+ hasValidParts(value) &&
395
+ isOptionalString(value.connection) &&
422
396
  Array.isArray(value.pages) &&
423
397
  value.pages.every(isPageState) &&
424
398
  Array.isArray(value.issues) &&
@@ -435,67 +409,6 @@ export function parseMockupState(
435
409
  return isMockupState(value) ? value : undefined;
436
410
  }
437
411
 
438
- function isAnchor(
439
- value: Parameters<typeof isObject>[0],
440
- ): value is MockupNoteAnchor {
441
- if (!isRecord(value)) return false;
442
- if (value.block === undefined) return isString(value.page);
443
- return (
444
- isString(value.block) &&
445
- Array.isArray(value.steps) &&
446
- value.steps.every((step) => isString(step)) &&
447
- isOptionalString(value.page)
448
- );
449
- }
450
-
451
- function isFraction(value: Parameters<typeof isNumber>[0]): boolean {
452
- return isNumber(value) && value >= 0 && value <= 1;
453
- }
454
-
455
- function isOffset(
456
- value: Parameters<typeof isObject>[0],
457
- ): value is MockupPinOffset {
458
- return isRecord(value) && isFraction(value.x) && isFraction(value.y);
459
- }
460
-
461
- function isAnnotation(
462
- value: Parameters<typeof isObject>[0],
463
- ): value is MockupAnnotation {
464
- return (
465
- isRecord(value) &&
466
- isString(value.id) &&
467
- isAnchor(value.anchor) &&
468
- isOffset(value.offset) &&
469
- isOptionalString(value.page) &&
470
- isOptionalString(value.path) &&
471
- isString(value.text) &&
472
- (value.status === "open" || value.status === "resolved") &&
473
- isString(value.createdAt) &&
474
- isOptionalString(value.resolvedAt) &&
475
- isOptionalNumber(value.version) &&
476
- isOptionalNumber(value.resolvedVersion) &&
477
- isOptionalString(value.state)
478
- );
479
- }
480
-
481
- /** The annotation a `POST` or `PATCH` answers, or undefined when the answer is not one. */
482
- export function parseAnnotation(
483
- value: Parameters<typeof isObject>[0],
484
- ): MockupAnnotation | undefined {
485
- return isAnnotation(value) ? value : undefined;
486
- }
487
-
488
- /** The annotations of an `{ annotations }` answer or event, or undefined when it is not one. */
489
- export function parseAnnotations(
490
- value: Parameters<typeof isObject>[0],
491
- ): MockupAnnotation[] | undefined {
492
- if (!isRecord(value)) return undefined;
493
- const { annotations } = value;
494
- return Array.isArray(annotations) && annotations.every(isAnnotation)
495
- ? annotations
496
- : undefined;
497
- }
498
-
499
412
  function isSource(
500
413
  value: Parameters<typeof isString>[0],
501
414
  ): value is MockupSource {
@@ -593,14 +506,3 @@ export function layoutPathFor(
593
506
  ): string | undefined {
594
507
  return Object.entries(page.paths).find(([, at]) => at === pointer)?.[0];
595
508
  }
596
-
597
- /** `annotation` with the answer of a `PATCH` or `POST` merged into `list`, newest last. */
598
- export function upsertAnnotation(
599
- list: readonly MockupAnnotation[],
600
- annotation: MockupAnnotation,
601
- ): MockupAnnotation[] {
602
- const exists = list.some((entry) => entry.id === annotation.id);
603
- return exists
604
- ? list.map((entry) => (entry.id === annotation.id ? annotation : entry))
605
- : [...list, annotation];
606
- }
@@ -0,0 +1,100 @@
1
+ /** How long the page view's frame takes to fade in over the image of the page it draws, in milliseconds. */
2
+ export const ACTIVATION_FADE_MS = 150;
3
+
4
+ /**
5
+ * What the page view shows of the page being opened. The frame is `idle`
6
+ * while the Overview shows, and `rendering` from the moment a page is opened
7
+ * until the frame acknowledged that page's render drawn, during which the
8
+ * page's capture, when it has one, shows in the frame's place and the frame
9
+ * itself is not seen, so the page it drew before never is. It is `drawn` from
10
+ * then.
11
+ */
12
+ export type Activation =
13
+ | { phase: "idle" }
14
+ | { phase: "rendering"; scope: string }
15
+ | { phase: "drawn"; scope: string };
16
+
17
+ /**
18
+ * What moves the page view from one {@link Activation} to the next: a page is
19
+ * opened, or what the frame draws changed (`open`, which `scope` names); the
20
+ * frame acknowledged the render of the page `scope` names drawn (`drawn`); the
21
+ * Overview shows again (`close`).
22
+ */
23
+ export type ActivationEvent =
24
+ | { type: "open"; scope: string }
25
+ | { type: "drawn"; scope: string }
26
+ | { type: "close" };
27
+
28
+ /**
29
+ * The identity of what the page view's frame draws: the page, the tenant it
30
+ * is drawn for and whether it reads real data. A render of the same scope
31
+ * redraws the page in place, so it fades nothing; another scope draws
32
+ * something else, so the frame is hidden until it acknowledged that render.
33
+ */
34
+ export function activationScope(
35
+ page: string,
36
+ tenant: string | undefined,
37
+ realData: boolean,
38
+ ): string {
39
+ return JSON.stringify([page, tenant ?? null, realData]);
40
+ }
41
+
42
+ /**
43
+ * The activation after `event`. Opening the scope already open leaves it as
44
+ * it is, and opening another while one renders replaces it, so only the
45
+ * render of the new scope draws the page. An acknowledgment of another scope
46
+ * than the one rendering, or while nothing renders, changes nothing.
47
+ */
48
+ export function nextActivation(
49
+ state: Activation,
50
+ event: ActivationEvent,
51
+ ): Activation {
52
+ switch (event.type) {
53
+ case "open":
54
+ return state.phase !== "idle" && state.scope === event.scope
55
+ ? state
56
+ : { phase: "rendering", scope: event.scope };
57
+ case "drawn":
58
+ return state.phase === "rendering" && state.scope === event.scope
59
+ ? { phase: "drawn", scope: state.scope }
60
+ : state;
61
+ case "close":
62
+ return { phase: "idle" };
63
+ }
64
+ }
65
+
66
+ /**
67
+ * The scope the module store is drawn under, as an activation and as a
68
+ * render: it is no page, so no page's capture shows in its place, and every
69
+ * render of it is the same, its tree being empty.
70
+ */
71
+ export const STORE_SCOPE = JSON.stringify(["module-store"]);
72
+
73
+ /** What {@link renderAcknowledgments} tells an activation. */
74
+ export interface RenderAcknowledgments {
75
+ /** A render of the scope `scope` was posted to the frame, for the activation `activation` names. */
76
+ posted: (activation: string, scope: string) => void;
77
+ /** The frame says it drew the render of the scope `scope`. */
78
+ drawn: (scope: string) => void;
79
+ }
80
+
81
+ /**
82
+ * Turns what the frame acknowledges, the scope of a render it drew, into the
83
+ * activation that render belongs to, which `onDrawn` is told. Only the render
84
+ * posted last counts: the acknowledgment of one the frame was handed before
85
+ * it, which names another scope, tells nothing, so a page that was open
86
+ * before never shows the frame of the page opened after it.
87
+ */
88
+ export function renderAcknowledgments(
89
+ onDrawn: (activation: string) => void,
90
+ ): RenderAcknowledgments {
91
+ let last: { activation: string; scope: string } | undefined;
92
+ return {
93
+ posted: (activation, scope) => {
94
+ last = { activation, scope };
95
+ },
96
+ drawn: (scope) => {
97
+ if (last?.scope === scope) onDrawn(last.activation);
98
+ },
99
+ };
100
+ }
@@ -0,0 +1,146 @@
1
+ import type { isObject } from "../../../../dms-core/app/utils/type-check";
2
+ import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
3
+ import { isOptionalString, isRecord } from "./recordGuards";
4
+
5
+ export type MockupAnnotationStatus = "open" | "resolved";
6
+
7
+ /**
8
+ * The block a note is about: the node whose id is `block`, on the page `page`
9
+ * when set, then the children whose ids are `steps`.
10
+ */
11
+ export interface MockupBlockAnchor {
12
+ block: string;
13
+ steps: string[];
14
+ page?: string;
15
+ }
16
+
17
+ /** What a note is on: a block, or the page `page` as a whole. */
18
+ export type MockupNoteAnchor = MockupBlockAnchor | { page: string };
19
+
20
+ /** Where a pin sits on its block or page: fractions of its box, from its top left corner. */
21
+ export interface MockupPinOffset {
22
+ x: number;
23
+ y: number;
24
+ }
25
+
26
+ /**
27
+ * A reviewer's pin. `page` and `path` are where it is now: both on a block,
28
+ * `page` alone on a page, neither when its block or page was removed.
29
+ * `version` is the number of the history version it was pinned on, and
30
+ * `resolvedVersion` the one it was resolved on.
31
+ */
32
+ export interface MockupAnnotation {
33
+ id: string;
34
+ anchor: MockupNoteAnchor;
35
+ offset: MockupPinOffset;
36
+ page?: string;
37
+ /** Spec JSON pointer of the note's block now. */
38
+ path?: string;
39
+ text: string;
40
+ status: MockupAnnotationStatus;
41
+ createdAt: string;
42
+ resolvedAt?: string;
43
+ version?: number;
44
+ resolvedVersion?: number;
45
+ /** The state of the sketch the note was pinned on; absent on its own `html` and on any other block. */
46
+ state?: string;
47
+ }
48
+
49
+ /**
50
+ * Where a pin is put: on the node at `path` of page `page`, or on the page
51
+ * itself without `path`, and the state of the sketch drawn there.
52
+ */
53
+ export interface MockupPinPlace {
54
+ page: string;
55
+ path?: string;
56
+ offset: MockupPinOffset;
57
+ state?: string;
58
+ }
59
+
60
+ /** What `POST /api/mockup/:name/annotations` takes. */
61
+ export interface MockupAnnotationDraft extends MockupPinPlace {
62
+ text: string;
63
+ }
64
+
65
+ /** What `PATCH /api/mockup/:name/annotations/:id` takes. */
66
+ export interface MockupAnnotationPatch {
67
+ status?: MockupAnnotationStatus;
68
+ text?: string;
69
+ place?: MockupPinPlace;
70
+ }
71
+
72
+ function isOptionalNumber(value: Parameters<typeof isNumber>[0]): boolean {
73
+ return value === undefined || isNumber(value);
74
+ }
75
+
76
+ function isAnchor(
77
+ value: Parameters<typeof isObject>[0],
78
+ ): value is MockupNoteAnchor {
79
+ if (!isRecord(value)) return false;
80
+ if (value.block === undefined) return isString(value.page);
81
+ return (
82
+ isString(value.block) &&
83
+ Array.isArray(value.steps) &&
84
+ value.steps.every((step) => isString(step)) &&
85
+ isOptionalString(value.page)
86
+ );
87
+ }
88
+
89
+ function isFraction(value: Parameters<typeof isNumber>[0]): boolean {
90
+ return isNumber(value) && value >= 0 && value <= 1;
91
+ }
92
+
93
+ function isOffset(
94
+ value: Parameters<typeof isObject>[0],
95
+ ): value is MockupPinOffset {
96
+ return isRecord(value) && isFraction(value.x) && isFraction(value.y);
97
+ }
98
+
99
+ function isAnnotation(
100
+ value: Parameters<typeof isObject>[0],
101
+ ): value is MockupAnnotation {
102
+ return (
103
+ isRecord(value) &&
104
+ isString(value.id) &&
105
+ isAnchor(value.anchor) &&
106
+ isOffset(value.offset) &&
107
+ isOptionalString(value.page) &&
108
+ isOptionalString(value.path) &&
109
+ isString(value.text) &&
110
+ (value.status === "open" || value.status === "resolved") &&
111
+ isString(value.createdAt) &&
112
+ isOptionalString(value.resolvedAt) &&
113
+ isOptionalNumber(value.version) &&
114
+ isOptionalNumber(value.resolvedVersion) &&
115
+ isOptionalString(value.state)
116
+ );
117
+ }
118
+
119
+ /** The annotation a `POST` or `PATCH` answers, or undefined when the answer is not one. */
120
+ export function parseAnnotation(
121
+ value: Parameters<typeof isObject>[0],
122
+ ): MockupAnnotation | undefined {
123
+ return isAnnotation(value) ? value : undefined;
124
+ }
125
+
126
+ /** The annotations of an `{ annotations }` answer or event, or undefined when it is not one. */
127
+ export function parseAnnotations(
128
+ value: Parameters<typeof isObject>[0],
129
+ ): MockupAnnotation[] | undefined {
130
+ if (!isRecord(value)) return undefined;
131
+ const { annotations } = value;
132
+ return Array.isArray(annotations) && annotations.every(isAnnotation)
133
+ ? annotations
134
+ : undefined;
135
+ }
136
+
137
+ /** `annotation` with the answer of a `PATCH` or `POST` merged into `list`, newest last. */
138
+ export function upsertAnnotation(
139
+ list: readonly MockupAnnotation[],
140
+ annotation: MockupAnnotation,
141
+ ): MockupAnnotation[] {
142
+ const exists = list.some((entry) => entry.id === annotation.id);
143
+ return exists
144
+ ? list.map((entry) => (entry.id === annotation.id ? annotation : entry))
145
+ : [...list, annotation];
146
+ }