@antelopejs/dms 0.25.6 → 0.25.7-next.1111.gaba637e

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 (384) hide show
  1. package/CHANGELOG.md +0 -60
  2. package/README.md +1 -1
  3. package/data/mockup-spec.schema.json +223 -303
  4. package/dist/implementations/dms-auth/account-emails.js +2 -2
  5. package/dist/implementations/dms-auth/account-emails.js.map +1 -1
  6. package/dist/implementations/dms-auth/index.js +2 -1
  7. package/dist/implementations/dms-auth/index.js.map +1 -1
  8. package/dist/implementations/dms-base/search-route.js +5 -8
  9. package/dist/implementations/dms-base/search-route.js.map +1 -1
  10. package/dist/implementations/dms-builder/engine/cell-displays.js +1 -4
  11. package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
  12. package/dist/implementations/dms-builder/engine/mapped-displays.js +1 -5
  13. package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
  14. package/dist/implementations/dms-builder/engine/resource-emit.js +0 -4
  15. package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
  16. package/dist/implementations/dms-builder/engine/theme-assets.js +17 -5
  17. package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
  18. package/dist/index.js +1 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/mcp/index.d.ts +1 -0
  21. package/dist/mcp/index.js +5 -0
  22. package/dist/mcp/index.js.map +1 -1
  23. package/dist/mcp/mockup-export/capture.d.ts +15 -0
  24. package/dist/mcp/mockup-export/capture.js +97 -0
  25. package/dist/mcp/mockup-export/capture.js.map +1 -0
  26. package/dist/mcp/mockup-export/document.d.ts +4 -0
  27. package/dist/mcp/mockup-export/document.js +199 -0
  28. package/dist/mcp/mockup-export/document.js.map +1 -0
  29. package/dist/mcp/mockup-export/index.d.ts +23 -0
  30. package/dist/mcp/mockup-export/index.js +90 -0
  31. package/dist/mcp/mockup-export/index.js.map +1 -0
  32. package/dist/mcp/mockup-export/plan.d.ts +78 -0
  33. package/dist/mcp/mockup-export/plan.js +257 -0
  34. package/dist/mcp/mockup-export/plan.js.map +1 -0
  35. package/dist/mcp/mockup-export/route.d.ts +13 -0
  36. package/dist/mcp/mockup-export/route.js +66 -0
  37. package/dist/mcp/mockup-export/route.js.map +1 -0
  38. package/dist/mcp/page-verify/index.d.ts +14 -0
  39. package/dist/mcp/page-verify/index.js +9 -5
  40. package/dist/mcp/page-verify/index.js.map +1 -1
  41. package/dist/mcp/page-verify/mockup.d.ts +2 -1
  42. package/dist/mcp/page-verify/mockup.js +1 -0
  43. package/dist/mcp/page-verify/mockup.js.map +1 -1
  44. package/dist/mcp/page-verify/playwright.d.ts +22 -4
  45. package/dist/mcp/page-verify/playwright.js.map +1 -1
  46. package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
  47. package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
  48. package/dist/mcp/tools/mockup-export-pdf.d.ts +1 -0
  49. package/dist/mcp/tools/mockup-export-pdf.js +71 -0
  50. package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
  51. package/dist/mcp/tools/mockup-patch-spec.js +1 -1
  52. package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
  53. package/dist/mcp/tools/mockup-read-spec.js +10 -3
  54. package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
  55. package/dist/mcp/tools/mockup-write-spec.js +1 -1
  56. package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
  57. package/dist/mcp/tools/mockup.js +2 -0
  58. package/dist/mcp/tools/mockup.js.map +1 -1
  59. package/dist/mcp/tools/page-verify.d.ts +1 -0
  60. package/dist/mcp/tools/page-verify.js +5 -1
  61. package/dist/mcp/tools/page-verify.js.map +1 -1
  62. package/dist/mockup/apply-notes.d.ts +1 -1
  63. package/dist/mockup/apply-notes.js +1 -2
  64. package/dist/mockup/apply-notes.js.map +1 -1
  65. package/dist/mockup/apply-plan.js +0 -3
  66. package/dist/mockup/apply-plan.js.map +1 -1
  67. package/dist/mockup/compile.d.ts +6 -1
  68. package/dist/mockup/compile.js +29 -25
  69. package/dist/mockup/compile.js.map +1 -1
  70. package/dist/mockup/controller-blocks.js +10 -62
  71. package/dist/mockup/controller-blocks.js.map +1 -1
  72. package/dist/mockup/database-manifest.d.ts +2 -0
  73. package/dist/mockup/database-manifest.js +75 -0
  74. package/dist/mockup/database-manifest.js.map +1 -0
  75. package/dist/mockup/display-values.js +1 -1
  76. package/dist/mockup/display-values.js.map +1 -1
  77. package/dist/mockup/entities.d.ts +20 -0
  78. package/dist/mockup/entities.js +213 -0
  79. package/dist/mockup/entities.js.map +1 -0
  80. package/dist/mockup/files.d.ts +2 -2
  81. package/dist/mockup/files.js +2 -2
  82. package/dist/mockup/files.js.map +1 -1
  83. package/dist/mockup/fixture-answers.d.ts +1 -0
  84. package/dist/mockup/fixture-answers.js +1 -1
  85. package/dist/mockup/fixture-answers.js.map +1 -1
  86. package/dist/mockup/{capture-routes.d.ts → fixture-routes.d.ts} +11 -6
  87. package/dist/mockup/fixture-routes.js +155 -0
  88. package/dist/mockup/fixture-routes.js.map +1 -0
  89. package/dist/mockup/fixtures.d.ts +1 -3
  90. package/dist/mockup/fixtures.js +2 -25
  91. package/dist/mockup/fixtures.js.map +1 -1
  92. package/dist/mockup/form-fields.js +1 -10
  93. package/dist/mockup/form-fields.js.map +1 -1
  94. package/dist/mockup/generate.js +4 -1
  95. package/dist/mockup/generate.js.map +1 -1
  96. package/dist/mockup/history-routes.js +2 -17
  97. package/dist/mockup/history-routes.js.map +1 -1
  98. package/dist/mockup/index.d.ts +3 -0
  99. package/dist/mockup/index.js +3 -0
  100. package/dist/mockup/index.js.map +1 -1
  101. package/dist/mockup/json-schema-entities.d.ts +5 -0
  102. package/dist/mockup/json-schema-entities.js +141 -0
  103. package/dist/mockup/json-schema-entities.js.map +1 -0
  104. package/dist/mockup/json-schema.js +23 -24
  105. package/dist/mockup/json-schema.js.map +1 -1
  106. package/dist/mockup/json.d.ts +8 -0
  107. package/dist/mockup/json.js +20 -0
  108. package/dist/mockup/json.js.map +1 -0
  109. package/dist/mockup/manage.js +1 -1
  110. package/dist/mockup/manage.js.map +1 -1
  111. package/dist/mockup/manifest-blocks.d.ts +19 -0
  112. package/dist/mockup/manifest-blocks.js +65 -0
  113. package/dist/mockup/manifest-blocks.js.map +1 -0
  114. package/dist/mockup/model.d.ts +106 -255
  115. package/dist/mockup/model.js +86 -82
  116. package/dist/mockup/model.js.map +1 -1
  117. package/dist/mockup/module-manifests.d.ts +22 -0
  118. package/dist/mockup/module-manifests.js +28 -0
  119. package/dist/mockup/module-manifests.js.map +1 -0
  120. package/dist/mockup/modules-schema.d.ts +2 -0
  121. package/dist/mockup/modules-schema.js +42 -0
  122. package/dist/mockup/modules-schema.js.map +1 -0
  123. package/dist/mockup/modules.d.ts +20 -9
  124. package/dist/mockup/modules.js +146 -22
  125. package/dist/mockup/modules.js.map +1 -1
  126. package/dist/mockup/page-links.d.ts +1 -2
  127. package/dist/mockup/page-links.js +3 -14
  128. package/dist/mockup/page-links.js.map +1 -1
  129. package/dist/mockup/refusals.d.ts +4 -1
  130. package/dist/mockup/refusals.js +15 -1
  131. package/dist/mockup/refusals.js.map +1 -1
  132. package/dist/mockup/routes.d.ts +1 -5
  133. package/dist/mockup/routes.js +9 -171
  134. package/dist/mockup/routes.js.map +1 -1
  135. package/dist/mockup/saas-manifest.d.ts +2 -0
  136. package/dist/mockup/saas-manifest.js +496 -0
  137. package/dist/mockup/saas-manifest.js.map +1 -0
  138. package/dist/mockup/sample-rows.js +0 -4
  139. package/dist/mockup/sample-rows.js.map +1 -1
  140. package/dist/mockup/state.d.ts +76 -0
  141. package/dist/mockup/state.js +22 -0
  142. package/dist/mockup/state.js.map +1 -0
  143. package/dist/mockup/{summary-fields.js → store-summary.js} +1 -1
  144. package/dist/mockup/store-summary.js.map +1 -0
  145. package/dist/mockup/store.d.ts +1 -2
  146. package/dist/mockup/store.js +16 -22
  147. package/dist/mockup/store.js.map +1 -1
  148. package/dist/mockup/table-columns.js +3 -9
  149. package/dist/mockup/table-columns.js.map +1 -1
  150. package/dist/mockup/table-options.d.ts +1 -4
  151. package/dist/mockup/table-options.js +2 -40
  152. package/dist/mockup/table-options.js.map +1 -1
  153. package/dist/mockup/tenancy.d.ts +19 -0
  154. package/dist/mockup/tenancy.js +73 -0
  155. package/dist/mockup/tenancy.js.map +1 -0
  156. package/dist/mockup/tenant-rows.d.ts +4 -0
  157. package/dist/mockup/tenant-rows.js +19 -0
  158. package/dist/mockup/tenant-rows.js.map +1 -0
  159. package/dist/mockup/validate.d.ts +1 -7
  160. package/dist/mockup/validate.js +3 -76
  161. package/dist/mockup/validate.js.map +1 -1
  162. package/dist/pages/account.d.ts +0 -1
  163. package/dist/pages/account.js +0 -1
  164. package/dist/pages/account.js.map +1 -1
  165. package/dist/pages/settings/overview/account-summary.d.ts +0 -2
  166. package/dist/pages/settings/overview/account-summary.js +8 -17
  167. package/dist/pages/settings/overview/account-summary.js.map +1 -1
  168. package/dist/pages/settings/settings-index.js +1 -2
  169. package/dist/pages/settings/settings-index.js.map +1 -1
  170. package/dist/realtime/sse.js +4 -2
  171. package/dist/realtime/sse.js.map +1 -1
  172. package/dist/store/internal/frontend/dev-reload.js +1 -7
  173. package/dist/store/internal/frontend/dev-reload.js.map +1 -1
  174. package/dist/utils/account-notifications.js +0 -1
  175. package/dist/utils/account-notifications.js.map +1 -1
  176. package/dist/utils/email-change-mail.js +2 -2
  177. package/dist/utils/email-change-mail.js.map +1 -1
  178. package/dist/utils/export-jobs.js +2 -2
  179. package/dist/utils/export-jobs.js.map +1 -1
  180. package/dist/utils/index.d.ts +0 -2
  181. package/dist/utils/index.js +0 -2
  182. package/dist/utils/index.js.map +1 -1
  183. package/dist/validation/index.d.ts +0 -1
  184. package/dist/validation/index.js +0 -1
  185. package/dist/validation/index.js.map +1 -1
  186. package/frontend-vue/eslint-globals.generated.mjs +2 -2
  187. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +0 -3
  188. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +0 -3
  189. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +0 -3
  190. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +0 -3
  191. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +1 -4
  192. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +0 -3
  193. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +1 -17
  194. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +0 -3
  195. package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
  196. package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +0 -8
  197. package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +2 -3
  198. package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +5 -23
  199. package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +0 -1
  200. package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +443 -12
  201. package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +0 -8
  202. package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +0 -8
  203. package/frontend-vue/layers/dms-core/shared/types/app-config.ts +0 -2
  204. package/frontend-vue/layers/dms-layout/app/app.config.ts +0 -1
  205. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +4 -7
  206. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +29 -14
  207. package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +0 -2
  208. package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
  209. package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +3 -19
  210. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +110 -9
  211. package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -8
  212. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +9 -6
  213. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +2 -6
  214. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +22 -27
  215. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +10 -8
  216. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +3 -39
  217. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +5 -38
  218. package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +3 -1
  219. package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +4 -23
  220. package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +31 -39
  221. package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +9 -60
  222. package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
  223. package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +1 -7
  224. package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +1 -14
  225. package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +0 -13
  226. package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
  227. package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
  228. package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +0 -3
  229. package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -3
  230. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
  231. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +165 -0
  232. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +4 -1
  233. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +1 -2
  234. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +1 -22
  235. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +11 -6
  236. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +182 -125
  237. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +12 -114
  238. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +4 -10
  239. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +48 -0
  240. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +76 -8
  241. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +65 -9
  242. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
  243. package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +6 -26
  244. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -8
  245. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +6 -46
  246. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +175 -0
  247. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +35 -109
  248. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +18 -5
  249. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +76 -0
  250. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +1 -4
  251. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +63 -0
  252. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +1 -3
  253. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +6 -0
  254. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +13 -68
  255. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +7 -17
  256. package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +0 -6
  257. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +0 -4
  258. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +0 -38
  259. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +3 -69
  260. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +7 -20
  261. package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +0 -36
  262. package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +0 -4
  263. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +0 -1
  264. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +5 -21
  265. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +0 -8
  266. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +4 -32
  267. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
  268. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
  269. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +2 -14
  270. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +6 -68
  271. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +0 -5
  272. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +48 -73
  273. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +11 -18
  274. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +125 -34
  275. package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +3 -7
  276. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +149 -84
  277. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +119 -0
  278. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +72 -43
  279. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
  280. package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +92 -8
  281. package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +1 -35
  282. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +17 -44
  283. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +177 -0
  284. package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +14 -3
  285. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +14 -26
  286. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +151 -0
  287. package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
  288. package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
  289. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +6 -56
  290. package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +3 -0
  291. package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
  292. package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +7 -4
  293. package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +0 -5
  294. package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +20 -2
  295. package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +15 -51
  296. package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +8 -3
  297. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +0 -10
  298. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +2 -0
  299. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +2 -0
  300. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +1 -0
  301. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +1 -0
  302. package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +0 -3
  303. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
  304. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +1 -0
  305. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +1 -0
  306. package/frontend-vue/layers/dms-ui/app/types/table/query.ts +0 -5
  307. package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +28 -2
  308. package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +38 -12
  309. package/frontend-vue/scripts/check-invariants.mjs +0 -101
  310. package/package.json +5 -5
  311. package/skills/dms/SKILL.md +2 -4
  312. package/skills/dms-module/SKILL.md +0 -3
  313. package/dist/implementations/dms-base/group-order.d.ts +0 -18
  314. package/dist/implementations/dms-base/group-order.js +0 -66
  315. package/dist/implementations/dms-base/group-order.js.map +0 -1
  316. package/dist/mockup/capture-routes.js +0 -101
  317. package/dist/mockup/capture-routes.js.map +0 -1
  318. package/dist/mockup/capture.d.ts +0 -10
  319. package/dist/mockup/capture.js +0 -64
  320. package/dist/mockup/capture.js.map +0 -1
  321. package/dist/mockup/header-action.d.ts +0 -47
  322. package/dist/mockup/header-action.js +0 -46
  323. package/dist/mockup/header-action.js.map +0 -1
  324. package/dist/mockup/json-schema-header.d.ts +0 -2
  325. package/dist/mockup/json-schema-header.js +0 -69
  326. package/dist/mockup/json-schema-header.js.map +0 -1
  327. package/dist/mockup/json-schema-layout.d.ts +0 -2
  328. package/dist/mockup/json-schema-layout.js +0 -61
  329. package/dist/mockup/json-schema-layout.js.map +0 -1
  330. package/dist/mockup/summary-fields.js.map +0 -1
  331. package/dist/mockup/table-param-filters.d.ts +0 -52
  332. package/dist/mockup/table-param-filters.js +0 -83
  333. package/dist/mockup/table-param-filters.js.map +0 -1
  334. package/dist/mockup/table-row-actions.d.ts +0 -2
  335. package/dist/mockup/table-row-actions.js +0 -85
  336. package/dist/mockup/table-row-actions.js.map +0 -1
  337. package/dist/mockup/unknown-keys.d.ts +0 -3
  338. package/dist/mockup/unknown-keys.js +0 -45
  339. package/dist/mockup/unknown-keys.js.map +0 -1
  340. package/dist/utils/email-plain-text.d.ts +0 -1
  341. package/dist/utils/email-plain-text.js +0 -95
  342. package/dist/utils/email-plain-text.js.map +0 -1
  343. package/dist/utils/html-email.d.ts +0 -8
  344. package/dist/utils/html-email.js +0 -9
  345. package/dist/utils/html-email.js.map +0 -1
  346. package/dist/utils/image-signatures.d.ts +0 -3
  347. package/dist/utils/image-signatures.js +0 -22
  348. package/dist/utils/image-signatures.js.map +0 -1
  349. package/dist/utils/sse-keepalive/index.d.ts +0 -3
  350. package/dist/utils/sse-keepalive/index.js +0 -8
  351. package/dist/utils/sse-keepalive/index.js.map +0 -1
  352. package/dist/validation/allowed-keys.d.ts +0 -2
  353. package/dist/validation/allowed-keys.js +0 -16
  354. package/dist/validation/allowed-keys.js.map +0 -1
  355. package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +0 -485
  356. package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +0 -27
  357. package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +0 -1
  358. package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +0 -49
  359. package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +0 -2
  360. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +0 -110
  361. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +0 -75
  362. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +0 -67
  363. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +0 -247
  364. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +0 -181
  365. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +0 -45
  366. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +0 -136
  367. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +0 -96
  368. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +0 -10
  369. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +0 -61
  370. package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +0 -37
  371. package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +0 -279
  372. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +0 -130
  373. package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +0 -154
  374. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +0 -149
  375. package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +0 -42
  376. package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +0 -90
  377. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +0 -1
  378. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +0 -1
  379. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +0 -1
  380. package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +0 -1
  381. package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +0 -1
  382. package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +0 -1
  383. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +0 -1
  384. /package/dist/mockup/{summary-fields.d.ts → store-summary.d.ts} +0 -0
@@ -4,11 +4,19 @@ import {
4
4
  isString,
5
5
  } from "../../../../dms-core/app/utils/type-check";
6
6
  import { isPreviewTree, type PreviewNode } from "./blockPreview";
7
- import { isPreviewHeader, type PreviewHeaderAction } from "./previewHeader";
8
7
  import {
9
- isPreviewPageLayout,
10
- type PreviewPageLayout,
11
- } from "./previewPageLayout";
8
+ isPreviewHeader,
9
+ type PreviewHeaderAction,
10
+ } from "./blockPreviewMessages";
11
+ import { isMockupEntities, type MockupEntityState } from "./mockupEntities";
12
+ import { isMockupTenants, type MockupTenant } from "./mockupTenants";
13
+
14
+ export { MOCKUP_FIELD_TYPES } from "./mockupEntities";
15
+ export type {
16
+ MockupEntityField,
17
+ MockupEntityState,
18
+ MockupFieldType,
19
+ } from "./mockupEntities";
12
20
 
13
21
  /** A problem in `spec.json`, at a JSON pointer into it (`""` is the whole file). */
14
22
  export interface MockupIssue {
@@ -61,8 +69,6 @@ export interface MockupPageState {
61
69
  icon?: string;
62
70
  description?: string;
63
71
  headerActions?: PreviewHeaderAction[];
64
- /** The layout the page is drawn in; the dashboard frame when absent. */
65
- layout?: PreviewPageLayout;
66
72
  options: MockupPageOptions;
67
73
  /** What `DmsBlockPreview` draws: fixtures resolved, sketch nodes passed through. */
68
74
  tree: PreviewNode[];
@@ -92,13 +98,30 @@ export interface MockupSidebar {
92
98
  widgets: MockupSidebarWidget[];
93
99
  }
94
100
 
95
- /** A DMS module the mockup's app needs: its entry in the module store catalog. */
101
+ /** One side of a module's menu: its title, its sub-sections and the ids of its pages. */
102
+ export interface MockupModuleSide {
103
+ title: string;
104
+ categories: MockupCategory[];
105
+ pages: string[];
106
+ }
107
+
108
+ /**
109
+ * A module of the mockup's app, a menu root under the app's own menu: a
110
+ * catalog module with its manifest pages, or one the spec defines.
111
+ */
96
112
  export interface MockupModule {
97
- /** The module's id in the catalog. */
113
+ /** The catalog id, or the id of the module the spec defines. */
98
114
  id: string;
99
- /** The npm package building the mockup installs. */
100
- package: string;
115
+ title: string;
101
116
  icon: string;
117
+ /** The npm package building the mockup installs; a spec's own module has none. */
118
+ package?: string;
119
+ /** The module's sub-sections, in menu order. */
120
+ categories: MockupCategory[];
121
+ /** The ids of the pages its root lists, in menu order. */
122
+ pages: string[];
123
+ /** What the menu draws in SaaS mode in place of the sections and pages above; absent for a module with no tenant side. */
124
+ tenant?: MockupModuleSide;
102
125
  }
103
126
 
104
127
  export interface MockupState {
@@ -112,10 +135,14 @@ 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
- /** What the spec likely does not show as meant; absent from a backend that reports none. */
118
- warnings?: MockupIssue[];
119
146
  }
120
147
 
121
148
  export type MockupAnnotationStatus = "open" | "resolved";
@@ -213,8 +240,6 @@ interface MockupSummaryBase {
213
240
  source?: MockupSource;
214
241
  /** When `spec.json` last changed, ISO 8601. */
215
242
  updatedAt: string;
216
- /** When the stored image of the first page was last written, ISO 8601; absent when the mockup has none. */
217
- capturedAt?: string;
218
243
  }
219
244
 
220
245
  /** One row of `GET /api/mockup`: a draft, or a mockup built into real pages. */
@@ -250,9 +275,6 @@ export const MOCKUP_WIDTHS: Record<MockupWidth, number> = {
250
275
 
251
276
  export const MOCKUP_LIST_ENDPOINT = "/api/mockup";
252
277
 
253
- /** The path under a mockup's endpoint of the stored image of its first page. */
254
- export const MOCKUP_CAPTURE_SUFFIX = "/capture";
255
-
256
278
  /** Event of the state stream carrying a {@link MockupState}. */
257
279
  export const MOCKUP_STATE_EVENT = "state";
258
280
 
@@ -264,21 +286,6 @@ export function mockupEndpoint(name: string, suffix = ""): string {
264
286
  return `${MOCKUP_LIST_ENDPOINT}/${encodeURIComponent(name)}${suffix}`;
265
287
  }
266
288
 
267
- /**
268
- * The URL of the stored image of a mockup's first page. `capturedAt` makes
269
- * it a new URL each time the image is written, so a browser that kept the
270
- * old one asks again. `baseURL` is the API's own, which the session cookie
271
- * authenticates an image request on.
272
- */
273
- export function mockupCaptureUrl(
274
- baseURL: string | undefined,
275
- name: string,
276
- capturedAt: string,
277
- ): string {
278
- const origin = baseURL?.replace(/\/+$/, "") ?? "";
279
- return `${origin}${mockupEndpoint(name, MOCKUP_CAPTURE_SUFFIX)}?v=${encodeURIComponent(capturedAt)}`;
280
- }
281
-
282
289
  export function isMockupWidth(value: string | undefined): value is MockupWidth {
283
290
  return value !== undefined && Object.hasOwn(MOCKUP_WIDTHS, value);
284
291
  }
@@ -358,7 +365,6 @@ function isPageState(
358
365
  description: value.description,
359
366
  actions: value.headerActions,
360
367
  }) &&
361
- (value.layout === undefined || isPreviewPageLayout(value.layout)) &&
362
368
  isRecord(value.options) &&
363
369
  Array.isArray(value.tree) &&
364
370
  isPreviewTree(value.tree) &&
@@ -394,14 +400,41 @@ function isSidebar(
394
400
  );
395
401
  }
396
402
 
403
+ function isModuleSide(
404
+ value: Parameters<typeof isObject>[0],
405
+ ): value is MockupModuleSide {
406
+ return (
407
+ isRecord(value) &&
408
+ isString(value.title) &&
409
+ Array.isArray(value.categories) &&
410
+ value.categories.every(isMockupCategory) &&
411
+ Array.isArray(value.pages) &&
412
+ value.pages.every(isString)
413
+ );
414
+ }
415
+
397
416
  function isModule(
398
417
  value: Parameters<typeof isObject>[0],
399
418
  ): value is MockupModule {
400
419
  return (
420
+ isModuleSide(value) &&
401
421
  isRecord(value) &&
402
422
  isString(value.id) &&
403
- isString(value.package) &&
404
- isString(value.icon)
423
+ isString(value.icon) &&
424
+ isOptionalString(value.package) &&
425
+ (value.tenant === undefined || isModuleSide(value.tenant))
426
+ );
427
+ }
428
+
429
+ /** Whether the parts of a state a spec may leave out are each absent or well-formed. */
430
+ function hasValidParts(value: Parameters<typeof isObject>[0]): boolean {
431
+ return (
432
+ isRecord(value) &&
433
+ (value.sidebar === undefined || isSidebar(value.sidebar)) &&
434
+ (value.modules === undefined ||
435
+ (Array.isArray(value.modules) && value.modules.every(isModule))) &&
436
+ (value.entities === undefined || isMockupEntities(value.entities)) &&
437
+ (value.tenants === undefined || isMockupTenants(value.tenants))
405
438
  );
406
439
  }
407
440
 
@@ -416,15 +449,12 @@ function isMockupState(
416
449
  (value.categories === undefined ||
417
450
  (Array.isArray(value.categories) &&
418
451
  value.categories.every(isMockupCategory))) &&
419
- (value.sidebar === undefined || isSidebar(value.sidebar)) &&
420
- (value.modules === undefined ||
421
- (Array.isArray(value.modules) && value.modules.every(isModule))) &&
452
+ hasValidParts(value) &&
453
+ isOptionalString(value.connection) &&
422
454
  Array.isArray(value.pages) &&
423
455
  value.pages.every(isPageState) &&
424
456
  Array.isArray(value.issues) &&
425
- value.issues.every(isIssue) &&
426
- (value.warnings === undefined ||
427
- (Array.isArray(value.warnings) && value.warnings.every(isIssue)))
457
+ value.issues.every(isIssue)
428
458
  );
429
459
  }
430
460
 
@@ -536,8 +566,7 @@ function isSummaryBase(
536
566
  isNumber(value.pages) &&
537
567
  isNumber(value.openComments) &&
538
568
  (value.source === undefined || isSource(value.source)) &&
539
- isString(value.updatedAt) &&
540
- isOptionalString(value.capturedAt)
569
+ isString(value.updatedAt)
541
570
  );
542
571
  }
543
572
 
@@ -0,0 +1,80 @@
1
+ import { isString } from "../../../../dms-core/app/utils/type-check";
2
+ import { isJsonObject, type JsonObject } from "./json";
3
+ import { isRecord } from "./recordGuards";
4
+
5
+ /** The types a field of a spec entity takes. */
6
+ export const MOCKUP_FIELD_TYPES = [
7
+ "string",
8
+ "number",
9
+ "price",
10
+ "boolean",
11
+ "date",
12
+ "email",
13
+ "url",
14
+ "enum",
15
+ "ref",
16
+ ] as const;
17
+
18
+ /** A field type of an entity. */
19
+ export type MockupFieldType = (typeof MOCKUP_FIELD_TYPES)[number];
20
+
21
+ export interface MockupEntityField {
22
+ name: string;
23
+ type: MockupFieldType;
24
+ /** The entity a `ref` points to; set on a `ref` alone. */
25
+ to?: string;
26
+ /** The values an `enum` takes, at least one; set on an `enum` alone. */
27
+ values?: string[];
28
+ }
29
+
30
+ /** An entity of the spec's data model: a table of the mockup's database. */
31
+ export interface MockupEntityState {
32
+ name: string;
33
+ tenantScoped?: true;
34
+ /** `id` first (declared, else implied `{ name: "id", type: "string" }`), then the declared fields in spec order. */
35
+ fields: MockupEntityField[];
36
+ /** The rows of every fixture pointing to it, pages in spec order then fixture keys in order; a row whose `id` an earlier row has is dropped. */
37
+ rows: JsonObject[];
38
+ /** The ids of the pages holding a fixture that points to it, in spec order, each once. */
39
+ pages: string[];
40
+ }
41
+
42
+ function isFieldType(value: unknown): value is MockupFieldType {
43
+ const types: readonly unknown[] = MOCKUP_FIELD_TYPES;
44
+ return types.includes(value);
45
+ }
46
+
47
+ function isEnumValues(value: Parameters<typeof isString>[0]): boolean {
48
+ return Array.isArray(value) && value.length > 0 && value.every(isString);
49
+ }
50
+
51
+ /** Whether `value` is a field: a `ref` names its target and an `enum` its values, and no other type carries either. */
52
+ function isEntityField(value: unknown): value is MockupEntityField {
53
+ if (!isRecord(value) || !isString(value.name) || !isFieldType(value.type)) {
54
+ return false;
55
+ }
56
+ const { type, to, values } = value;
57
+ return (
58
+ (type === "ref" ? isString(to) : to === undefined) &&
59
+ (type === "enum" ? isEnumValues(values) : values === undefined)
60
+ );
61
+ }
62
+
63
+ function isEntity(value: unknown): value is MockupEntityState {
64
+ return (
65
+ isRecord(value) &&
66
+ isString(value.name) &&
67
+ (value.tenantScoped === undefined || value.tenantScoped === true) &&
68
+ Array.isArray(value.fields) &&
69
+ value.fields.every(isEntityField) &&
70
+ Array.isArray(value.rows) &&
71
+ value.rows.every(isJsonObject) &&
72
+ Array.isArray(value.pages) &&
73
+ value.pages.every(isString)
74
+ );
75
+ }
76
+
77
+ /** Whether `value` is a list of entities, each field, row and page id of them read. */
78
+ export function isMockupEntities(value: unknown): value is MockupEntityState[] {
79
+ return Array.isArray(value) && value.every(isEntity);
80
+ }
@@ -2,15 +2,21 @@ import { isPreviewTheme, type PreviewNode } from "./blockPreview";
2
2
  import {
3
3
  previewRenderMessage,
4
4
  type PreviewNavigation,
5
+ type PreviewNavigationModule,
6
+ type PreviewNavigationSection,
5
7
  type PreviewRenderMessage,
6
8
  type PreviewSidebarWidget,
9
+ type PreviewWorkspace,
7
10
  } from "./blockPreviewMessages";
8
11
  import type {
9
12
  MockupCategory,
13
+ MockupModule,
14
+ MockupModuleSide,
10
15
  MockupPageState,
11
16
  MockupSidebarWidget,
12
17
  } from "./mockup";
13
18
  import { groupSections } from "./mockupSections";
19
+ import { type MockupTenancy, SINGLE_TENANCY } from "./mockupTenancy";
14
20
  import { currentSketchScheme } from "./sketch";
15
21
 
16
22
  const HOME_ICON = "i-ph-house-light";
@@ -80,6 +86,12 @@ export interface MockupNavigationSource {
80
86
  editable?: boolean;
81
87
  /** Sketches the sidebar draws among its widgets. */
82
88
  widgets?: readonly MockupSidebarWidget[];
89
+ /** The modules under the app's menu, each listing the pages it holds. */
90
+ modules?: readonly MockupModule[];
91
+ /** How the mockup is seen: in SaaS mode a module with a tenant side draws it in place of its platform side. Single-tenant when absent. */
92
+ tenancy?: MockupTenancy;
93
+ /** The workspace switcher and the banner SaaS mode draws; none when absent. */
94
+ workspace?: PreviewWorkspace;
83
95
  }
84
96
 
85
97
  function sidebarWidget(widget: MockupSidebarWidget): PreviewSidebarWidget {
@@ -113,18 +125,90 @@ function menuEntryOf(
113
125
  return undefined;
114
126
  }
115
127
 
128
+ /** The side of `module` the menu draws: its tenant side in SaaS mode when it has one, else its platform side. */
129
+ function sideOf(
130
+ module: MockupModule,
131
+ tenancy: MockupTenancy,
132
+ ): MockupModuleSide {
133
+ return tenancy.mode === "saas" && module.tenant ? module.tenant : module;
134
+ }
135
+
136
+ /**
137
+ * A module as the sidebar lists it: the root pages of its side as a section
138
+ * with no category, then each category that holds a page. A page the module
139
+ * lists and the mockup lacks, or with `menu: false`, is left out.
140
+ */
141
+ function moduleNavigation(
142
+ module: MockupModule,
143
+ pages: ReadonlyMap<string, NavigationPage>,
144
+ tenancy: MockupTenancy,
145
+ ): PreviewNavigationModule {
146
+ const side = sideOf(module, tenancy);
147
+ const listed = side.pages.flatMap((id) => {
148
+ const page = pages.get(id);
149
+ return page && page.menu !== false ? [page] : [];
150
+ });
151
+ const sectionOf = (
152
+ pagesIn: readonly NavigationPage[],
153
+ category?: MockupCategory,
154
+ ): PreviewNavigationSection[] =>
155
+ pagesIn.length === 0
156
+ ? []
157
+ : [
158
+ {
159
+ ...(category && { category }),
160
+ items: pagesIn.map((page) => ({
161
+ id: page.id,
162
+ label: page.title,
163
+ icon: page.icon,
164
+ })),
165
+ },
166
+ ];
167
+ return {
168
+ id: module.id,
169
+ title: side.title,
170
+ icon: module.icon,
171
+ sections: [
172
+ ...sectionOf(
173
+ listed.filter(
174
+ (page) =>
175
+ !side.categories.some((category) => category.id === page.category),
176
+ ),
177
+ ),
178
+ ...side.categories.flatMap((category) =>
179
+ sectionOf(
180
+ listed.filter((page) => page.category === category.id),
181
+ category,
182
+ ),
183
+ ),
184
+ ],
185
+ };
186
+ }
187
+
116
188
  /**
117
189
  * The mockup's pages as the preview's sidebar lists them: under their
118
190
  * sections, each page with its icon, and `active` as the current one. A page with `menu: false`
119
191
  * is left out, and while it is the current one, its nearest listed parent is.
120
- * The mockup's sidebar widgets follow, each `title` the caption over it.
192
+ * A page a module lists, on either side, belongs to that module: it leaves
193
+ * the sections and is listed under the module, which follows them in
194
+ * `modules` order, drawing its tenant side in SaaS mode. The
195
+ * mockup's sidebar widgets follow, each `title` the caption over it.
121
196
  */
122
197
  export function mockupNavigation(
123
198
  source: MockupNavigationSource,
124
199
  ): PreviewNavigation {
200
+ const modules = source.modules ?? [];
201
+ const byId = new Map(source.pages.map((page) => [page.id, page]));
202
+ const tenancy = source.tenancy ?? SINGLE_TENANCY;
203
+ const inModule = new Set(
204
+ modules.flatMap((module) => [
205
+ ...module.pages,
206
+ ...(module.tenant?.pages ?? []),
207
+ ]),
208
+ );
125
209
  const indexed = source.pages
126
210
  .map((page, index) => ({ page, index }))
127
- .filter(({ page }) => page.menu !== false);
211
+ .filter(({ page }) => page.menu !== false && !inModule.has(page.id));
128
212
  const sections = groupSections(
129
213
  source.categories,
130
214
  indexed,
@@ -140,32 +224,33 @@ export function mockupNavigation(
140
224
  icon: sidebarIcon(page, index),
141
225
  })),
142
226
  })),
227
+ ...(modules.length > 0 && {
228
+ modules: modules.map((module) => moduleNavigation(module, byId, tenancy)),
229
+ }),
143
230
  active: menuEntryOf(source.pages, source.active),
144
231
  ...(source.editable && { editable: true }),
145
232
  ...(source.widgets &&
146
233
  source.widgets.length > 0 && {
147
234
  widgets: source.widgets.map(sidebarWidget),
148
235
  }),
236
+ ...(source.workspace && { workspace: source.workspace }),
149
237
  };
150
238
  }
151
239
 
152
240
  /**
153
241
  * What the preview draws for a page of the mockup: `tree`, the page's own or
154
242
  * its live one, in the page's theme, else the dashboard's, and its locale,
155
- * inside `navigation`, under the page header its spec writes, in the page's
156
- * layout, its blocks' `{{params.X}}` tokens filled with `params`, and the
157
- * page's URL query `query`.
243
+ * inside `navigation`, under the page header its spec writes, its blocks'
244
+ * `{{params.X}}` tokens filled with `params`.
158
245
  */
159
246
  export function mockupPageRender(
160
247
  page: MockupPageState,
161
248
  tree: PreviewNode[],
162
249
  navigation: PreviewNavigation,
163
250
  params?: Record<string, string>,
164
- query?: Record<string, string>,
165
251
  ): PreviewRenderMessage {
166
252
  return previewRenderMessage({
167
253
  ...(params && { params }),
168
- ...(query && { query }),
169
254
  tree,
170
255
  theme: isPreviewTheme(page.options.theme)
171
256
  ? page.options.theme
@@ -179,6 +264,5 @@ export function mockupPageRender(
179
264
  description: page.description,
180
265
  actions: page.headerActions,
181
266
  },
182
- ...(page.layout && { pageLayout: page.layout }),
183
267
  });
184
268
  }
@@ -1,4 +1,4 @@
1
- import { type MockupPageState, readQueryValue } from "./mockup";
1
+ import type { MockupPageState } from "./mockup";
2
2
 
3
3
  /** Where the viewer draws a mockup: a spec's `page:<id>` link compiles to it. */
4
4
  export const MOCKUP_VIEWER_PATH = "/mockup";
@@ -8,40 +8,6 @@ const PAGE_QUERY = "page";
8
8
  /** The viewer's query naming the row a page with a route shows. */
9
9
  export const RECORD_QUERY = "record";
10
10
 
11
- /**
12
- * The query parameters the viewer and its preview read themselves: the
13
- * mockup, the page, the canvas width, the data shown, the preview's state and
14
- * its fixtures-only switch.
15
- */
16
- const VIEWER_QUERY_KEYS: ReadonlySet<string> = new Set([
17
- "name",
18
- PAGE_QUERY,
19
- "width",
20
- "data",
21
- "state",
22
- "fixtures",
23
- ]);
24
-
25
- /**
26
- * The query of the page the viewer shows, which its tables'
27
- * `queryParamFilters` and its `{{query.X}}` tokens read: the viewer's URL
28
- * query, `?record=` included, without the parameters the viewer reads
29
- * itself. None when nothing is left.
30
- */
31
- export function mockupPageQuery(
32
- query: Readonly<
33
- Record<string, string | null | readonly (string | null)[] | undefined>
34
- >,
35
- ): Record<string, string> | undefined {
36
- const entries = Object.entries(query).flatMap(([key, value]) => {
37
- const read = readQueryValue(value);
38
- return VIEWER_QUERY_KEYS.has(key) || read === undefined
39
- ? []
40
- : [[key, read] as const];
41
- });
42
- return entries.length > 0 ? Object.fromEntries(entries) : undefined;
43
- }
44
-
45
11
  /** A page of the mockup a link opens, and the row it shows there. */
46
12
  export interface MockupLink {
47
13
  page: string;
@@ -327,61 +327,34 @@ function overlaps(left: PreviewRect, right: PreviewRect): boolean {
327
327
  );
328
328
  }
329
329
 
330
- /** How wide a frame is on the screen, at least, for its page to be worth drawing live: a narrower frame is a thumbnail, which its image serves as well. */
331
- export const LIVE_FRAME_MIN_SCREEN_WIDTH = 400;
332
-
333
- /** What decides which pages the live slots draw. */
334
- export interface LiveView {
335
- frames: readonly OverviewFrame[];
336
- camera: OverviewCamera;
337
- viewport: ViewportSize;
338
- /** The page picked with a click, if any. */
339
- picked: string | undefined;
340
- /** Whether the page has no image, or one that is out of date. */
341
- needsCapture: (page: string) => boolean;
342
- }
343
-
344
330
  /**
345
- * The pages to draw live, most wanted first: the picked page; the frames in
346
- * view, while a frame is at least {@link LIVE_FRAME_MIN_SCREEN_WIDTH} wide on
347
- * the screen, those with no current image before the others, each group
348
- * nearest the middle of the view first; then every page with no current
349
- * image, nearest first. A page in view with no image comes before the pages
350
- * in view that have one, so a view of more frames than slots still draws and
351
- * captures each of them. The caller hands slots to the first few.
331
+ * The frames worth drawing live, nearest the middle of the view first: those
332
+ * in view, and those within half a viewport of it, which panning reaches next.
352
333
  */
353
- export function wantedLivePages({
354
- frames,
355
- camera,
356
- viewport,
357
- picked,
358
- needsCapture,
359
- }: LiveView): string[] {
334
+ export function nearbyFrames(
335
+ frames: readonly OverviewFrame[],
336
+ camera: OverviewCamera,
337
+ viewport: ViewportSize,
338
+ ): string[] {
360
339
  const width = viewport.width / camera.zoom;
361
340
  const height = viewport.height / camera.zoom;
362
341
  const { x, y } = toWorld(camera, { x: 0, y: 0 });
363
- const view = { x, y, width, height };
342
+ const reach = {
343
+ x: x - width / 2,
344
+ y: y - height / 2,
345
+ width: width * 2,
346
+ height: height * 2,
347
+ };
364
348
  const middle = { x: x + width / 2, y: y + height / 2 };
365
349
  const distance = ({ rect }: OverviewFrame) =>
366
350
  Math.hypot(
367
351
  rect.x + rect.width / 2 - middle.x,
368
352
  rect.y + rect.height / 2 - middle.y,
369
353
  );
370
- const nearest = [...frames].sort((a, b) => distance(a) - distance(b));
371
- const isWide =
372
- OVERVIEW_FRAME_WIDTH * camera.zoom >= LIVE_FRAME_MIN_SCREEN_WIDTH;
373
- const inView = isWide
374
- ? nearest.filter(({ rect }) => overlaps(rect, view)).map(({ id }) => id)
375
- : [];
376
- const wanted = [
377
- ...(picked !== undefined && frames.some(({ id }) => id === picked)
378
- ? [picked]
379
- : []),
380
- ...inView.filter(needsCapture),
381
- ...inView.filter((id) => !needsCapture(id)),
382
- ...nearest.map(({ id }) => id).filter(needsCapture),
383
- ];
384
- return [...new Set(wanted)];
354
+ return frames
355
+ .filter(({ rect }) => overlaps(rect, reach))
356
+ .sort((left, right) => distance(left) - distance(right))
357
+ .map(({ id }) => id);
385
358
  }
386
359
 
387
360
  /**