@antelopejs/dms 0.25.8-next.1174.ge77e0bd → 0.25.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +2 -2
  3. package/data/mockup-example/spec.json +0 -11
  4. package/data/mockup-spec.schema.json +16 -399
  5. package/dist/e2e/index.d.mts +1 -2
  6. package/dist/implementations/dms-builder/engine/table-view-settings.js +33 -9
  7. package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
  8. package/dist/index.js +0 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/index.d.ts +0 -2
  11. package/dist/mcp/index.js +0 -9
  12. package/dist/mcp/index.js.map +1 -1
  13. package/dist/mcp/page-verify/index.d.ts +0 -15
  14. package/dist/mcp/page-verify/index.js +6 -16
  15. package/dist/mcp/page-verify/index.js.map +1 -1
  16. package/dist/mcp/page-verify/mockup.d.ts +1 -3
  17. package/dist/mcp/page-verify/mockup.js +1 -5
  18. package/dist/mcp/page-verify/mockup.js.map +1 -1
  19. package/dist/mcp/page-verify/page-probe.d.ts +0 -5
  20. package/dist/mcp/page-verify/page-probe.js +0 -2
  21. package/dist/mcp/page-verify/page-probe.js.map +1 -1
  22. package/dist/mcp/page-verify/playwright.d.ts +4 -22
  23. package/dist/mcp/page-verify/playwright.js.map +1 -1
  24. package/dist/mcp/page-verify/report.d.ts +0 -1
  25. package/dist/mcp/tools/mockup-read-spec.js +3 -2
  26. package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
  27. package/dist/mcp/tools/mockup.js +0 -4
  28. package/dist/mcp/tools/mockup.js.map +1 -1
  29. package/dist/mcp/tools/page-verify.d.ts +0 -1
  30. package/dist/mcp/tools/page-verify.js +2 -6
  31. package/dist/mcp/tools/page-verify.js.map +1 -1
  32. package/dist/mockup/annotations.js +2 -2
  33. package/dist/mockup/annotations.js.map +1 -1
  34. package/dist/mockup/apply-notes.js +1 -1
  35. package/dist/mockup/apply-notes.js.map +1 -1
  36. package/dist/mockup/compile.d.ts +10 -6
  37. package/dist/mockup/compile.js +290 -31
  38. package/dist/mockup/compile.js.map +1 -1
  39. package/dist/mockup/files.d.ts +1 -2
  40. package/dist/mockup/files.js +1 -2
  41. package/dist/mockup/files.js.map +1 -1
  42. package/dist/mockup/fixture-answers.d.ts +0 -1
  43. package/dist/mockup/fixture-answers.js +1 -1
  44. package/dist/mockup/fixture-answers.js.map +1 -1
  45. package/dist/mockup/fixtures.d.ts +27 -0
  46. package/dist/mockup/fixtures.js +111 -0
  47. package/dist/mockup/fixtures.js.map +1 -1
  48. package/dist/mockup/from-page.js +9 -2
  49. package/dist/mockup/from-page.js.map +1 -1
  50. package/dist/mockup/generate.js +1 -4
  51. package/dist/mockup/generate.js.map +1 -1
  52. package/dist/mockup/history-routes.d.ts +4 -2
  53. package/dist/mockup/history-routes.js +36 -27
  54. package/dist/mockup/history-routes.js.map +1 -1
  55. package/dist/mockup/history.js +1 -2
  56. package/dist/mockup/history.js.map +1 -1
  57. package/dist/mockup/index.d.ts +0 -10
  58. package/dist/mockup/index.js +0 -10
  59. package/dist/mockup/index.js.map +1 -1
  60. package/dist/mockup/json-schema-layout.d.ts +0 -1
  61. package/dist/mockup/json-schema-layout.js +2 -95
  62. package/dist/mockup/json-schema-layout.js.map +1 -1
  63. package/dist/mockup/json-schema.js +19 -40
  64. package/dist/mockup/json-schema.js.map +1 -1
  65. package/dist/mockup/manage-routes.d.ts +1 -3
  66. package/dist/mockup/manage-routes.js +1 -38
  67. package/dist/mockup/manage-routes.js.map +1 -1
  68. package/dist/mockup/manage.js +1 -1
  69. package/dist/mockup/manage.js.map +1 -1
  70. package/dist/mockup/model.d.ts +100 -137
  71. package/dist/mockup/model.js +86 -102
  72. package/dist/mockup/model.js.map +1 -1
  73. package/dist/mockup/modules.d.ts +9 -6
  74. package/dist/mockup/modules.js +24 -105
  75. package/dist/mockup/modules.js.map +1 -1
  76. package/dist/mockup/presence-board.js +1 -1
  77. package/dist/mockup/presence-board.js.map +1 -1
  78. package/dist/mockup/presence-routes.js +2 -2
  79. package/dist/mockup/presence-routes.js.map +1 -1
  80. package/dist/mockup/refusals.d.ts +0 -5
  81. package/dist/mockup/refusals.js +0 -16
  82. package/dist/mockup/refusals.js.map +1 -1
  83. package/dist/mockup/routes.d.ts +5 -3
  84. package/dist/mockup/routes.js +162 -19
  85. package/dist/mockup/routes.js.map +1 -1
  86. package/dist/mockup/row-filters.d.ts +8 -0
  87. package/dist/mockup/row-filters.js +107 -0
  88. package/dist/mockup/row-filters.js.map +1 -0
  89. package/dist/mockup/sketch-limits.d.ts +0 -1
  90. package/dist/mockup/sketch-limits.js +1 -2
  91. package/dist/mockup/sketch-limits.js.map +1 -1
  92. package/dist/mockup/sketch.d.ts +2 -2
  93. package/dist/mockup/sketch.js +1 -2
  94. package/dist/mockup/sketch.js.map +1 -1
  95. package/dist/mockup/source-routes.d.ts +4 -5
  96. package/dist/mockup/source-routes.js +17 -26
  97. package/dist/mockup/source-routes.js.map +1 -1
  98. package/dist/mockup/source.js +1 -2
  99. package/dist/mockup/source.js.map +1 -1
  100. package/dist/mockup/store.d.ts +37 -16
  101. package/dist/mockup/store.js +200 -85
  102. package/dist/mockup/store.js.map +1 -1
  103. package/dist/mockup/table-archive.d.ts +1 -0
  104. package/dist/mockup/table-archive.js +16 -0
  105. package/dist/mockup/table-archive.js.map +1 -1
  106. package/e2e/index.mjs +2 -3
  107. package/frontend-vue/eslint-globals.generated.mjs +38 -40
  108. package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +31 -3
  109. package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +2 -8
  110. package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -3
  111. package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -3
  112. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -110
  113. package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +6 -21
  114. package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +7 -19
  115. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +9 -79
  116. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +4 -17
  117. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +0 -12
  118. package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +0 -39
  119. package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +2 -12
  120. package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +1 -9
  121. package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +6 -53
  122. package/frontend-vue/layers/dms-layout/app/theme/actions.ts +7 -11
  123. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +5 -31
  124. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +1 -1
  125. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +47 -0
  126. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +33 -59
  127. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -58
  128. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/{MockupZoomControls.vue → MockupOverviewZoom.vue} +15 -23
  129. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +0 -21
  130. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +1 -1
  131. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +1 -1
  132. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +9 -77
  133. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +45 -130
  134. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +3 -70
  135. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +4 -44
  136. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +2 -14
  137. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +36 -256
  138. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +1 -13
  139. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +5 -10
  140. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +23 -50
  141. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +29 -82
  142. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +1 -1
  143. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +3 -10
  144. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +14 -60
  145. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +3 -8
  146. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +2 -6
  147. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +7 -5
  148. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +8 -29
  149. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +2 -13
  150. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +10 -39
  151. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +0 -29
  152. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +3 -37
  153. package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +1 -20
  154. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +8 -1
  155. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +103 -167
  156. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -22
  157. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +173 -75
  158. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +9 -118
  159. package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +8 -123
  160. package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +2 -6
  161. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +3 -21
  162. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +0 -15
  163. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +8 -6
  164. package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +5 -18
  165. package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +6 -17
  166. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +2 -17
  167. package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +7 -2
  168. package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +0 -8
  169. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +6 -108
  170. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +1 -5
  171. package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +10 -40
  172. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -23
  173. package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -2
  174. package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +4 -53
  175. package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +4 -53
  176. package/frontend-vue/package.json +2 -2
  177. package/package.json +5 -6
  178. package/E2E.md +0 -138
  179. package/dist/mcp/mockup-export/capture.d.ts +0 -19
  180. package/dist/mcp/mockup-export/capture.js +0 -99
  181. package/dist/mcp/mockup-export/capture.js.map +0 -1
  182. package/dist/mcp/mockup-export/document.d.ts +0 -4
  183. package/dist/mcp/mockup-export/document.js +0 -199
  184. package/dist/mcp/mockup-export/document.js.map +0 -1
  185. package/dist/mcp/mockup-export/index.d.ts +0 -20
  186. package/dist/mcp/mockup-export/index.js +0 -110
  187. package/dist/mcp/mockup-export/index.js.map +0 -1
  188. package/dist/mcp/mockup-export/jobs.d.ts +0 -32
  189. package/dist/mcp/mockup-export/jobs.js +0 -49
  190. package/dist/mcp/mockup-export/jobs.js.map +0 -1
  191. package/dist/mcp/mockup-export/plan.d.ts +0 -78
  192. package/dist/mcp/mockup-export/plan.js +0 -292
  193. package/dist/mcp/mockup-export/plan.js.map +0 -1
  194. package/dist/mcp/mockup-export/route.d.ts +0 -23
  195. package/dist/mcp/mockup-export/route.js +0 -91
  196. package/dist/mcp/mockup-export/route.js.map +0 -1
  197. package/dist/mcp/page-verify/modules.d.ts +0 -8
  198. package/dist/mcp/page-verify/modules.js +0 -49
  199. package/dist/mcp/page-verify/modules.js.map +0 -1
  200. package/dist/mcp/tools/mockup-export-pdf.d.ts +0 -1
  201. package/dist/mcp/tools/mockup-export-pdf.js +0 -69
  202. package/dist/mcp/tools/mockup-export-pdf.js.map +0 -1
  203. package/dist/mcp/tools/mockup-module-catalog.d.ts +0 -1
  204. package/dist/mcp/tools/mockup-module-catalog.js +0 -36
  205. package/dist/mcp/tools/mockup-module-catalog.js.map +0 -1
  206. package/dist/mockup/compile-layouts.d.ts +0 -5
  207. package/dist/mockup/compile-layouts.js +0 -74
  208. package/dist/mockup/compile-layouts.js.map +0 -1
  209. package/dist/mockup/compile-nodes.d.ts +0 -11
  210. package/dist/mockup/compile-nodes.js +0 -119
  211. package/dist/mockup/compile-nodes.js.map +0 -1
  212. package/dist/mockup/compile-pages.d.ts +0 -18
  213. package/dist/mockup/compile-pages.js +0 -189
  214. package/dist/mockup/compile-pages.js.map +0 -1
  215. package/dist/mockup/create.d.ts +0 -16
  216. package/dist/mockup/create.js +0 -78
  217. package/dist/mockup/create.js.map +0 -1
  218. package/dist/mockup/created-watch.d.ts +0 -18
  219. package/dist/mockup/created-watch.js +0 -110
  220. package/dist/mockup/created-watch.js.map +0 -1
  221. package/dist/mockup/entities.d.ts +0 -20
  222. package/dist/mockup/entities.js +0 -213
  223. package/dist/mockup/entities.js.map +0 -1
  224. package/dist/mockup/etag.d.ts +0 -1
  225. package/dist/mockup/etag.js +0 -10
  226. package/dist/mockup/etag.js.map +0 -1
  227. package/dist/mockup/extensions.d.ts +0 -18
  228. package/dist/mockup/extensions.js +0 -61
  229. package/dist/mockup/extensions.js.map +0 -1
  230. package/dist/mockup/fixture-batch.d.ts +0 -21
  231. package/dist/mockup/fixture-batch.js +0 -111
  232. package/dist/mockup/fixture-batch.js.map +0 -1
  233. package/dist/mockup/fixture-routes.d.ts +0 -21
  234. package/dist/mockup/fixture-routes.js +0 -136
  235. package/dist/mockup/fixture-routes.js.map +0 -1
  236. package/dist/mockup/json-schema-entities.d.ts +0 -5
  237. package/dist/mockup/json-schema-entities.js +0 -141
  238. package/dist/mockup/json-schema-entities.js.map +0 -1
  239. package/dist/mockup/json.d.ts +0 -8
  240. package/dist/mockup/json.js +0 -20
  241. package/dist/mockup/json.js.map +0 -1
  242. package/dist/mockup/layout-model.d.ts +0 -156
  243. package/dist/mockup/layout-model.js +0 -96
  244. package/dist/mockup/layout-model.js.map +0 -1
  245. package/dist/mockup/layouts.d.ts +0 -9
  246. package/dist/mockup/layouts.js +0 -40
  247. package/dist/mockup/layouts.js.map +0 -1
  248. package/dist/mockup/module-manifests.d.ts +0 -99
  249. package/dist/mockup/module-manifests.js +0 -95
  250. package/dist/mockup/module-manifests.js.map +0 -1
  251. package/dist/mockup/module-states.d.ts +0 -10
  252. package/dist/mockup/module-states.js +0 -85
  253. package/dist/mockup/module-states.js.map +0 -1
  254. package/dist/mockup/modules-schema.d.ts +0 -2
  255. package/dist/mockup/modules-schema.js +0 -39
  256. package/dist/mockup/modules-schema.js.map +0 -1
  257. package/dist/mockup/page-capture-routes.d.ts +0 -19
  258. package/dist/mockup/page-capture-routes.js +0 -92
  259. package/dist/mockup/page-capture-routes.js.map +0 -1
  260. package/dist/mockup/page-captures.d.ts +0 -61
  261. package/dist/mockup/page-captures.js +0 -252
  262. package/dist/mockup/page-captures.js.map +0 -1
  263. package/dist/mockup/parse-spec.d.ts +0 -10
  264. package/dist/mockup/parse-spec.js +0 -62
  265. package/dist/mockup/parse-spec.js.map +0 -1
  266. package/dist/mockup/places.d.ts +0 -17
  267. package/dist/mockup/places.js +0 -75
  268. package/dist/mockup/places.js.map +0 -1
  269. package/dist/mockup/slug.d.ts +0 -3
  270. package/dist/mockup/slug.js +0 -7
  271. package/dist/mockup/slug.js.map +0 -1
  272. package/dist/mockup/state-patch.d.ts +0 -22
  273. package/dist/mockup/state-patch.js +0 -75
  274. package/dist/mockup/state-patch.js.map +0 -1
  275. package/dist/mockup/state.d.ts +0 -112
  276. package/dist/mockup/state.js +0 -22
  277. package/dist/mockup/state.js.map +0 -1
  278. package/dist/mockup/store-list.d.ts +0 -28
  279. package/dist/mockup/store-list.js +0 -89
  280. package/dist/mockup/store-list.js.map +0 -1
  281. package/dist/mockup/tenancy.d.ts +0 -19
  282. package/dist/mockup/tenancy.js +0 -73
  283. package/dist/mockup/tenancy.js.map +0 -1
  284. package/dist/mockup/tenant-rows.d.ts +0 -4
  285. package/dist/mockup/tenant-rows.js +0 -19
  286. package/dist/mockup/tenant-rows.js.map +0 -1
  287. package/frontend-vue/layers/dms-core/app/utils/localFetchAnswers.ts +0 -124
  288. package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +0 -29
  289. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupWidgets.ts +0 -65
  290. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +0 -153
  291. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +0 -23
  292. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +0 -164
  293. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +0 -51
  294. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReconnecting.vue +0 -17
  295. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +0 -48
  296. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +0 -142
  297. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useFixtureBatches.ts +0 -154
  298. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +0 -157
  299. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +0 -165
  300. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +0 -126
  301. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +0 -138
  302. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +0 -124
  303. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +0 -37
  304. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +0 -56
  305. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +0 -46
  306. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +0 -151
  307. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +0 -130
  308. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +0 -332
  309. package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +0 -100
  310. package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +0 -146
  311. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +0 -80
  312. package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +0 -171
  313. package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +0 -138
  314. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +0 -66
  315. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +0 -177
  316. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +0 -179
  317. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +0 -143
  318. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +0 -23
  319. package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +0 -156
  320. package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +0 -400
  321. package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +0 -15
  322. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +0 -2
  323. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +0 -2
  324. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +0 -2
  325. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useFixtureBatches.ts +0 -1
  326. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +0 -1
  327. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +0 -1
  328. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +0 -1
  329. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupRoutePage.ts +0 -1
  330. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.ts +0 -1
  331. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +0 -1
  332. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePersistedCaptures.ts +0 -1
  333. package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +0 -1
  334. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +0 -1
  335. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +0 -1
  336. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +0 -1
  337. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.ts +0 -1
  338. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +0 -1
  339. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupStatePatch.ts +0 -1
  340. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +0 -1
  341. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +0 -1
  342. package/frontend-vue/layers/dms-ui/app/entries/utils/previewFixtureAnswers.ts +0 -1
  343. package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +0 -1
@@ -16,7 +16,6 @@ exports.registerSpecRoutes = registerSpecRoutes;
16
16
  const interface_api_1 = require("@antelopejs/interface-api");
17
17
  const block_types_1 = require("@antelopejs/interface-dms/base/block-types");
18
18
  const zod_1 = require("zod");
19
- const etag_1 = require("./etag");
20
19
  const fixtures_1 = require("./fixtures");
21
20
  const model_1 = require("./model");
22
21
  const owner_controller_1 = require("./owner-controller");
@@ -24,8 +23,6 @@ const refusals_1 = require("./refusals");
24
23
  const anchor_1 = require("./anchor");
25
24
  const presence_1 = require("./presence");
26
25
  const source_1 = require("./source");
27
- const HTTP_OK = 200;
28
- const HTTP_NOT_MODIFIED = 304;
29
26
  const HTTP_BAD_REQUEST = 400;
30
27
  const HTTP_CONFLICT = 409;
31
28
  const writeBodySchema = zod_1.z
@@ -35,15 +32,6 @@ const writeBodySchema = zod_1.z
35
32
  viewer: presence_1.viewerIdSchema.optional(),
36
33
  })
37
34
  .strict();
38
- function specAnswer(text, digest, writtenBy) {
39
- const spec = (0, source_1.parseSpecObject)(text);
40
- if (!spec) {
41
- throw new interface_api_1.HTTPResult(HTTP_CONFLICT, {
42
- message: "$dms.refusals.mockup.spec_not_object",
43
- });
44
- }
45
- return { spec, digest, ...(writtenBy && { writtenBy }) };
46
- }
47
35
  function registerSpecRoutes(mockupsDir, presence) {
48
36
  function nameOf(raw) {
49
37
  const name = (0, model_1.parseMockupName)(raw);
@@ -56,21 +44,25 @@ function registerSpecRoutes(mockupsDir, presence) {
56
44
  await this.assertOwner();
57
45
  return { blocks: (0, block_types_1.ListBlockTypes)() };
58
46
  }
59
- async source(rawName, context) {
47
+ async source(rawName) {
60
48
  await this.assertOwner();
61
49
  const name = nameOf(rawName);
62
- const text = await (0, source_1.readSpecText)(mockupsDir, name);
63
- if (text === undefined)
50
+ const source = await (0, source_1.readSpecSource)(mockupsDir, name);
51
+ if (!source)
64
52
  throw (0, refusals_1.notFound)("mockup");
65
- const digest = (0, source_1.digestOf)(text);
66
- const writtenBy = presence.writtenBy(name, digest);
67
- const etag = `"${digest}${writtenBy ? `:${encodeURIComponent(writtenBy.name)}` : ""}"`;
68
- const result = (0, etag_1.etagMatches)(context.rawRequest.headers["if-none-match"], etag)
69
- ? new interface_api_1.HTTPResult(HTTP_NOT_MODIFIED)
70
- : new interface_api_1.HTTPResult(HTTP_OK, specAnswer(text, digest, writtenBy));
71
- result.addHeader("ETag", etag);
72
- result.addHeader("Cache-Control", "private, no-cache");
73
- return result;
53
+ if (!source.spec) {
54
+ throw new interface_api_1.HTTPResult(HTTP_CONFLICT, {
55
+ message: "$dms.refusals.mockup.spec_not_object",
56
+ });
57
+ }
58
+ const answer = {
59
+ spec: source.spec,
60
+ digest: source.digest,
61
+ };
62
+ const writtenBy = presence.writtenBy(name, source.digest);
63
+ if (writtenBy)
64
+ answer.writtenBy = writtenBy;
65
+ return answer;
74
66
  }
75
67
  async write(rawName, body) {
76
68
  const owner = await this.owner();
@@ -117,9 +109,8 @@ function registerSpecRoutes(mockupsDir, presence) {
117
109
  __decorate([
118
110
  (0, interface_api_1.Get)(":name/spec"),
119
111
  __param(0, (0, interface_api_1.Parameter)("name")),
120
- __param(1, (0, interface_api_1.Context)()),
121
112
  __metadata("design:type", Function),
122
- __metadata("design:paramtypes", [String, Object]),
113
+ __metadata("design:paramtypes", [String]),
123
114
  __metadata("design:returntype", Promise)
124
115
  ], MockupSourceController.prototype, "source", null);
125
116
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"source-routes.js","sourceRoot":"","sources":["../../src/mockup/source-routes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DASmC;AACnC,4EAGoD;AACpD,6BAAwB;AACxB,iCAAqC;AACrC,yCAAwC;AACxC,mCAA6E;AAC7E,yDAA2D;AAC3D,yCAAsC;AACtC,qCAAkC;AAElC,yCAA4C;AAC5C,qCAQkB;AAElB,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,eAAe,GAAG,OAAC;KACtB,MAAM,CAAC;IACN,IAAI,EAAE,wBAAgB;IAEtB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE7B,MAAM,EAAE,yBAAc,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,MAAM,EAAE,CAAC;AAgBZ,SAAS,UAAU,CACjB,IAAY,EACZ,MAAkB,EAClB,SAAwC;IAExC,MAAM,IAAI,GAAG,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,0BAAU,CAAC,aAAa,EAAE;YAClC,OAAO,EAAE,sCAAsC;SAChD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAC3D,CAAC;AAQD,4BACE,UAAkB,EAClB,QAAuB;IAEvB,SAAS,MAAM,CAAC,GAAW;QACzB,MAAM,IAAI,GAAG,IAAA,uBAAe,EAAC,GAAG,CAAC,CA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AAC;QAEf,WAAA,IAAA,yBAAS,EAAC,MAAM,CAAC,CAAA;;;;wDAkBnB;IAGK;QADL,IAAA,mBAAG,EAAC,YAAY,CAAC;QAEf,WAAA,IAAA,yBAAS,EAAC,MAAM,CAAC,CAAA;QACjB,WAAA,IAAA,wBAAQ,GAAE,CAAA;;;;uDAuCZ;IAEH,OAAO,sBAAsB,CAAC;AAChC,CAAC"}
@@ -10,7 +10,6 @@ const node_crypto_1 = require("node:crypto");
10
10
  const promises_1 = require("node:fs/promises");
11
11
  const node_path_1 = require("node:path");
12
12
  const compile_1 = require("./compile");
13
- const parse_spec_1 = require("./parse-spec");
14
13
  const files_1 = require("./files");
15
14
  const history_1 = require("./history");
16
15
  const model_1 = require("./model");
@@ -87,7 +86,7 @@ function laidOutAs(text, spec) {
87
86
  }
88
87
  function writeNow(mockupsDir, name) {
89
88
  return async (spec, meta) => {
90
- const read = (0, parse_spec_1.parseSpec)(JSON.stringify(spec));
89
+ const read = (0, compile_1.parseSpec)(JSON.stringify(spec));
91
90
  const { issues, warnings } = read.ok
92
91
  ? (0, compile_1.compileSpec)(name, read.spec)
93
92
  : { issues: read.issues, warnings: [] };
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/mockup/source.ts"],"names":[],"mappings":";;;;;;;;AAAA,6CAAyC;AACzC,+CAAmD;AACnD,yCAAiC;AAEjC,uCAAwC;AACxC,6CAAyC;AACzC,mCAMiB;AACjB,uCAMmB;AAQnB,mCAAsE;AAEtE,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,EAAE,GAAG,IAAI,CAAC;AAChB,MAAM,IAAI,GAAG,MAAM,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE,CAAC;AAsBzB,kBAAyB,IAAY;IACnC,OAAO,IAAA,wBA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AC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAC5C,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AASD,mBACE,UAAkB,EAClB,IAAgB,EAChB,IAAuB,EACvB,IAAmB;IAEnB,OAAO,YAAY,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACtE,CAAC"}
@@ -1,18 +1,11 @@
1
1
  import { type MockupAnnotation } from "./annotations";
2
- import type { PageReader } from "./built-sync";
3
- import { type MockupCreated, type MockupCreatedListener } from "./created-watch";
4
- import { type FixtureBatchAnswer } from "./fixture-batch";
5
- import { type Clock } from "./generate";
6
- import type { Json, MockupName, MockupState } from "./model";
2
+ import { type BuiltPageSync, type PageReader } from "./built-sync";
3
+ import type { Clock } from "./generate";
4
+ import type { Json, MockupName, MockupSource, MockupState } from "./model";
7
5
  import type { PresenceSnapshot } from "./presence";
8
- import { type MockupStatePatch } from "./state-patch";
9
- import { type MockupSummary } from "./store-list";
10
6
  export type MockupEvent = {
11
7
  event: "state";
12
8
  data: MockupState;
13
- } | {
14
- event: "patch";
15
- data: MockupStatePatch;
16
9
  } | {
17
10
  event: "annotations";
18
11
  data: {
@@ -23,8 +16,30 @@ export type MockupEvent = {
23
16
  data: PresenceSnapshot;
24
17
  };
25
18
  export type MockupListener = (event: MockupEvent) => void;
26
- export type { MockupCreated, MockupCreatedListener };
27
- export type { MockupSummary };
19
+ export interface MockupCreated {
20
+ name: MockupName;
21
+ title?: string;
22
+ }
23
+ export type MockupCreatedListener = (created: MockupCreated) => void;
24
+ interface MockupSummaryBase {
25
+ name: MockupName;
26
+ title?: string;
27
+ pages: number;
28
+ openComments: number;
29
+ source?: MockupSource;
30
+ updatedAt: string;
31
+ capturedAt?: string;
32
+ }
33
+ export type MockupSummary = MockupSummaryBase & ({
34
+ status: "draft";
35
+ } | {
36
+ status: "built";
37
+ builtAt: string;
38
+ builtPages: Array<{
39
+ path: string;
40
+ title: string;
41
+ } & BuiltPageSync>;
42
+ });
28
43
  export declare class MockupStore {
29
44
  readonly mockupsDir: string;
30
45
  private readonly livePages?;
@@ -32,14 +47,20 @@ export declare class MockupStore {
32
47
  private readonly entries;
33
48
  private readonly watches;
34
49
  private watcher;
35
- private readonly created;
50
+ private created;
36
51
  constructor(mockupsDir: string, livePages?: PageReader | undefined, clock?: Clock);
37
52
  list(): Promise<MockupSummary[]>;
53
+ private summary;
54
+ private openComments;
55
+ private specFile;
38
56
  state(name: MockupName): Promise<MockupState | undefined>;
39
- fixture(name: MockupName, pageId: string, key: string, tenant?: string): Promise<Json | undefined>;
40
- fixtureBatch(name: MockupName, pageId: string, tenant?: string): Promise<FixtureBatchAnswer | undefined>;
57
+ fixture(name: MockupName, pageId: string, key: string): Promise<Json | undefined>;
41
58
  subscribe(name: MockupName, listener: MockupListener): Promise<(() => void) | undefined>;
42
59
  subscribeCreated(listener: MockupCreatedListener): Promise<() => void>;
60
+ private startCreatedWatch;
61
+ private stopCreatedWatch;
62
+ private specNames;
63
+ private scanCreated;
43
64
  isWatching(): boolean;
44
65
  close(): void;
45
66
  private current;
@@ -48,7 +69,6 @@ export declare class MockupStore {
48
69
  private load;
49
70
  private toState;
50
71
  private specEvent;
51
- private deliver;
52
72
  private annotationsEvent;
53
73
  private readonly fileEvents;
54
74
  private startWatch;
@@ -59,3 +79,4 @@ export declare class MockupStore {
59
79
  private flush;
60
80
  private stopWatch;
61
81
  }
82
+ export {};
@@ -6,43 +6,31 @@ const promises_1 = require("node:fs/promises");
6
6
  const node_path_1 = require("node:path");
7
7
  const logging_1 = require("@antelopejs/interface-core/logging");
8
8
  const annotations_1 = require("./annotations");
9
+ const built_sync_1 = require("./built-sync");
10
+ const capture_1 = require("./capture");
9
11
  const compile_1 = require("./compile");
10
- const created_watch_1 = require("./created-watch");
11
- const fixture_batch_1 = require("./fixture-batch");
12
- const parse_spec_1 = require("./parse-spec");
13
- const generate_1 = require("./generate");
14
12
  const history_1 = require("./history");
15
13
  const files_1 = require("./files");
16
14
  const model_1 = require("./model");
17
15
  const source_1 = require("./source");
18
- const state_patch_1 = require("./state-patch");
19
- const store_list_1 = require("./store-list");
16
+ const summary_fields_1 = require("./summary-fields");
20
17
  const WATCH_DEBOUNCE_MS = 40;
18
+ const CREATED_POLL_MS = 500;
21
19
  const MISSING_SPEC = {
22
20
  path: "",
23
21
  message: `${files_1.SPEC_FILE} is missing`,
24
22
  };
25
- function withFixtureRoutes(name, entry) {
26
- return { ...entry, pages: (0, fixture_batch_1.withBatchRoutes)({ name }, entry, entry.pages) };
27
- }
28
- function lastGood(previous, revision, issues, textHash, day) {
23
+ function lastGood(previous, revision, issues) {
29
24
  return {
30
25
  revision,
31
- textHash,
32
- day,
33
26
  title: previous?.title,
34
27
  categories: previous?.categories,
35
28
  sidebar: previous?.sidebar,
36
29
  modules: previous?.modules,
37
- entities: previous?.entities,
38
- tenants: previous?.tenants,
39
- connection: previous?.connection,
40
30
  pages: previous?.pages ?? [],
41
31
  fixtures: previous?.fixtures ?? new Map(),
42
- tenantFixtures: previous?.tenantFixtures ?? new Map(),
43
32
  issues,
44
33
  warnings: [],
45
- batches: new Map(),
46
34
  };
47
35
  }
48
36
  class MockupStore {
@@ -57,45 +45,188 @@ class MockupStore {
57
45
  this.mockupsDir = mockupsDir;
58
46
  this.livePages = livePages;
59
47
  this.clock = clock;
60
- this.created = new created_watch_1.CreatedWatcher(mockupsDir, (name) => this.readSpec(name));
61
48
  }
62
- list() {
63
- return (0, store_list_1.listMockups)({
64
- mockupsDir: this.mockupsDir,
65
- livePages: this.livePages,
66
- readSpec: (name) => this.readSpec(name),
67
- });
49
+ async list() {
50
+ let names;
51
+ try {
52
+ names = await (0, promises_1.readdir)(this.mockupsDir);
53
+ }
54
+ catch (error) {
55
+ if ((0, files_1.parseFsError)(error).code === files_1.MISSING_FILE)
56
+ return [];
57
+ throw error;
58
+ }
59
+ const reads = this.livePages && new built_sync_1.BuilderReads(this.livePages);
60
+ const summaries = await Promise.all(names.map(async (raw) => {
61
+ const name = (0, model_1.parseMockupName)(raw);
62
+ return name ? this.summary(name, reads) : undefined;
63
+ }));
64
+ return summaries
65
+ .flatMap((summary) => summary ?? [])
66
+ .sort((left, right) => right.updatedAt.localeCompare(left.updatedAt) ||
67
+ left.name.localeCompare(right.name));
68
+ }
69
+ async summary(name, reads) {
70
+ const file = await this.specFile(name);
71
+ if (!file)
72
+ return undefined;
73
+ const { title, pages, source, built } = (0, summary_fields_1.readSummaryFields)(file.text);
74
+ const base = {
75
+ name,
76
+ pages: pages.length,
77
+ openComments: await this.openComments(name),
78
+ updatedAt: file.updatedAt,
79
+ };
80
+ const capturedAt = await (0, capture_1.captureUpdatedAt)(this.mockupsDir, name);
81
+ if (capturedAt)
82
+ base.capturedAt = capturedAt.toISOString();
83
+ if (title !== undefined)
84
+ base.title = title;
85
+ if (source !== undefined)
86
+ base.source = source;
87
+ if (!built)
88
+ return { ...base, status: "draft" };
89
+ return {
90
+ ...base,
91
+ status: "built",
92
+ builtAt: built.at,
93
+ builtPages: await Promise.all(built.pages.map(async (page) => ({
94
+ path: page.path,
95
+ title: page.title?.trim() || page.path,
96
+ ...(await (0, built_sync_1.builtPageSync)(page.path, pages, reads)),
97
+ }))),
98
+ };
99
+ }
100
+ async openComments(name) {
101
+ try {
102
+ const annotations = await (0, annotations_1.listAnnotations)(name, this.mockupsDir);
103
+ return (annotations?.filter((annotation) => annotation.status === "open")
104
+ .length ?? 0);
105
+ }
106
+ catch (error) {
107
+ logging_1.Logging.Warn(`[DMS] mockup "${name}": annotations cannot be read`, error);
108
+ return 0;
109
+ }
110
+ }
111
+ async specFile(name) {
112
+ const text = await this.readSpec(name);
113
+ if (text === undefined)
114
+ return undefined;
115
+ try {
116
+ const { mtime } = await (0, promises_1.stat)((0, node_path_1.join)((0, files_1.mockupDirectory)(this.mockupsDir, name), files_1.SPEC_FILE));
117
+ return { text, updatedAt: mtime.toISOString() };
118
+ }
119
+ catch (error) {
120
+ if ((0, files_1.parseFsError)(error).code === files_1.MISSING_FILE)
121
+ return undefined;
122
+ throw error;
123
+ }
68
124
  }
69
125
  async state(name) {
70
126
  const entry = await this.current(name);
71
127
  return entry && this.toState(name, entry);
72
128
  }
73
- async fixture(name, pageId, key, tenant) {
74
- const entry = await this.current(name);
75
- return entry && (0, fixture_batch_1.fixtureOf)(entry, pageId, key, tenant);
76
- }
77
- async fixtureBatch(name, pageId, tenant) {
78
- const entry = await this.current(name);
79
- const page = entry?.pages.find((candidate) => candidate.id === pageId);
80
- return entry && page && (0, fixture_batch_1.batchOf)({ name }, entry, page, tenant);
129
+ async fixture(name, pageId, key) {
130
+ const fixtures = (await this.current(name))?.fixtures.get(pageId);
131
+ return fixtures && Object.hasOwn(fixtures, key) ? fixtures[key] : undefined;
81
132
  }
82
133
  async subscribe(name, listener) {
83
134
  const entry = await this.current(name);
84
135
  if (!entry)
85
136
  return undefined;
86
137
  const watched = this.watches.get(name) ?? this.startWatch(name);
87
- const state = this.toState(name, entry);
88
- const subscriber = { listener, sent: (0, state_patch_1.stateDigestOf)(state) };
89
- watched.subscribers.add(subscriber);
90
- listener({ event: "state", data: state });
138
+ watched.listeners.add(listener);
139
+ listener({ event: "state", data: this.toState(name, entry) });
91
140
  return () => {
92
- watched.subscribers.delete(subscriber);
93
- if (!watched.subscribers.size)
141
+ watched.listeners.delete(listener);
142
+ if (!watched.listeners.size)
94
143
  this.stopWatch(name);
95
144
  };
96
145
  }
97
- subscribeCreated(listener) {
98
- return this.created.subscribe(listener);
146
+ async subscribeCreated(listener) {
147
+ const watched = this.created ?? (await this.startCreatedWatch());
148
+ watched.listeners.add(listener);
149
+ return () => {
150
+ watched.listeners.delete(listener);
151
+ if (!watched.listeners.size)
152
+ this.stopCreatedWatch(watched);
153
+ };
154
+ }
155
+ async startCreatedWatch() {
156
+ const known = new Set(await this.specNames());
157
+ if (this.created)
158
+ return this.created;
159
+ const watched = {
160
+ listeners: new Set(),
161
+ known,
162
+ scanning: false,
163
+ timer: setInterval(() => void this.scanCreated(watched), CREATED_POLL_MS),
164
+ };
165
+ watched.timer.unref();
166
+ this.created = watched;
167
+ return watched;
168
+ }
169
+ stopCreatedWatch(watched) {
170
+ clearInterval(watched.timer);
171
+ if (this.created === watched)
172
+ this.created = undefined;
173
+ }
174
+ async specNames() {
175
+ let entries;
176
+ try {
177
+ entries = await (0, promises_1.readdir)(this.mockupsDir);
178
+ }
179
+ catch (error) {
180
+ if ((0, files_1.parseFsError)(error).code === files_1.MISSING_FILE)
181
+ return [];
182
+ throw error;
183
+ }
184
+ const names = await Promise.all(entries.map(async (entry) => {
185
+ const name = (0, model_1.parseMockupName)(entry);
186
+ if (!name)
187
+ return undefined;
188
+ try {
189
+ await (0, promises_1.stat)((0, node_path_1.join)((0, files_1.mockupDirectory)(this.mockupsDir, name), files_1.SPEC_FILE));
190
+ return name;
191
+ }
192
+ catch (error) {
193
+ if ((0, files_1.parseFsError)(error).code === files_1.MISSING_FILE)
194
+ return undefined;
195
+ throw error;
196
+ }
197
+ }));
198
+ return names.flatMap((name) => name ?? []);
199
+ }
200
+ async scanCreated(watched) {
201
+ if (watched.scanning)
202
+ return;
203
+ watched.scanning = true;
204
+ try {
205
+ const names = await this.specNames();
206
+ const present = new Set(names);
207
+ for (const name of watched.known) {
208
+ if (!present.has(name))
209
+ watched.known.delete(name);
210
+ }
211
+ for (const name of names) {
212
+ if (watched.known.has(name))
213
+ continue;
214
+ const text = await this.readSpec(name);
215
+ watched.known.add(name);
216
+ const created = { name };
217
+ const title = text === undefined ? "" : (0, summary_fields_1.readSummaryFields)(text).title;
218
+ if (title)
219
+ created.title = title;
220
+ for (const listener of watched.listeners)
221
+ listener(created);
222
+ }
223
+ }
224
+ catch (error) {
225
+ logging_1.Logging.Warn("[DMS] the mockups directory could not be read", error);
226
+ }
227
+ finally {
228
+ watched.scanning = false;
229
+ }
99
230
  }
100
231
  isWatching() {
101
232
  return this.watcher !== undefined;
@@ -103,18 +234,14 @@ class MockupStore {
103
234
  close() {
104
235
  for (const name of this.watches.keys())
105
236
  this.stopWatch(name);
106
- this.created.close();
237
+ if (this.created)
238
+ this.stopCreatedWatch(this.created);
107
239
  }
108
240
  async current(name) {
109
- const today = (0, generate_1.startOfDay)(this.clock());
110
241
  const cached = this.entries.get(name);
111
- const kept = cached?.day === today ? cached : undefined;
112
- if (kept && this.watches.has(name))
113
- return kept;
114
- const text = await this.readSpec(name);
115
- if (text === undefined)
116
- return undefined;
117
- return kept?.textHash === (0, source_1.digestOf)(text) ? kept : this.load(name, text);
242
+ if (cached && this.watches.has(name))
243
+ return cached;
244
+ return this.load(name);
118
245
  }
119
246
  async readSpec(name) {
120
247
  try {
@@ -134,61 +261,46 @@ class MockupStore {
134
261
  }
135
262
  }));
136
263
  }
137
- async load(name, text) {
264
+ async load(name) {
265
+ const text = await this.readSpec(name);
266
+ if (text === undefined)
267
+ return undefined;
138
268
  await this.observeDisk(name);
139
269
  const previous = this.entries.get(name);
140
270
  const revision = (previous?.revision ?? 0) + 1;
141
- const textHash = (0, source_1.digestOf)(text);
142
- const read = (0, parse_spec_1.parseSpec)(text);
143
- const now = this.clock();
144
- const day = (0, generate_1.startOfDay)(now);
271
+ const read = (0, compile_1.parseSpec)(text);
145
272
  const entry = read.ok
146
- ? withFixtureRoutes(name, {
147
- revision,
148
- textHash,
149
- day,
150
- ...(0, compile_1.compileSpec)(name, read.spec, now),
151
- batches: new Map(),
152
- })
153
- : lastGood(previous, revision, read.issues, textHash, day);
273
+ ? { revision, ...(0, compile_1.compileSpec)(name, read.spec, this.clock()) }
274
+ : lastGood(previous, revision, read.issues);
154
275
  this.entries.set(name, entry);
155
276
  return entry;
156
277
  }
157
278
  toState(name, entry) {
158
- entry.state ??= {
279
+ const state = {
159
280
  name,
160
281
  revision: entry.revision,
161
282
  pages: entry.pages,
162
283
  issues: entry.issues,
163
- ...(0, model_1.stateParts)(entry),
164
284
  warnings: entry.warnings,
165
285
  };
166
- return entry.state;
286
+ if (entry.title !== undefined)
287
+ state.title = entry.title;
288
+ if (entry.categories !== undefined)
289
+ state.categories = entry.categories;
290
+ if (entry.sidebar !== undefined)
291
+ state.sidebar = entry.sidebar;
292
+ if (entry.modules !== undefined)
293
+ state.modules = entry.modules;
294
+ return state;
167
295
  }
168
296
  async specEvent(name) {
169
- const text = await this.readSpec(name);
170
- const entry = text === undefined ? undefined : await this.load(name, text);
297
+ const entry = await this.load(name);
171
298
  if (entry)
172
299
  return { event: "state", data: this.toState(name, entry) };
173
300
  const previous = this.entries.get(name);
174
- const revision = previous?.revision ?? 0;
175
- const missing = lastGood(previous, revision, [MISSING_SPEC], "", (0, generate_1.startOfDay)(this.clock()));
301
+ const missing = lastGood(previous, previous?.revision ?? 0, [MISSING_SPEC]);
176
302
  return { event: "state", data: this.toState(name, missing) };
177
303
  }
178
- deliver(name, event) {
179
- const subscribers = this.watches.get(name)?.subscribers ?? [];
180
- if (event.event !== "state") {
181
- for (const { listener } of subscribers)
182
- listener(event);
183
- return;
184
- }
185
- const next = (0, state_patch_1.stateDigestOf)(event.data);
186
- for (const subscriber of subscribers) {
187
- const data = (0, state_patch_1.diffState)(subscriber.sent, next);
188
- subscriber.sent = next;
189
- subscriber.listener({ event: "patch", data });
190
- }
191
- }
192
304
  async annotationsEvent(name) {
193
305
  const annotations = await (0, annotations_1.listAnnotations)(name, this.mockupsDir);
194
306
  return { event: "annotations", data: { annotations: annotations ?? [] } };
@@ -202,7 +314,7 @@ class MockupStore {
202
314
  ]);
203
315
  startWatch(name) {
204
316
  this.watcher ??= this.watchDirectory(this.mockupsDir, (filename) => this.directoryChanged(filename));
205
- const watched = { subscribers: new Set(), timers: new Map() };
317
+ const watched = { listeners: new Set(), timers: new Map() };
206
318
  this.watches.set(name, watched);
207
319
  this.armMockup(name, watched);
208
320
  return watched;
@@ -257,7 +369,10 @@ class MockupStore {
257
369
  this.watches.get(name)?.timers.delete(file);
258
370
  for (const read of reads) {
259
371
  try {
260
- this.deliver(name, await read(name));
372
+ const event = await read(name);
373
+ for (const listener of this.watches.get(name)?.listeners ?? []) {
374
+ listener(event);
375
+ }
261
376
  }
262
377
  catch (error) {
263
378
  logging_1.Logging.Warn(`[DMS] mockup "${name}": ${file} could not be read`, error);