@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
@@ -1,54 +1,145 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref } from "vue";
3
- import { mockupCaptureUrl } from "../utils/mockup";
2
+ import { computed, ref, shallowRef, useTemplateRef, watch } from "vue";
3
+ import { useElementVisibility, useResizeObserver } from "@vueuse/core";
4
+ import { usePreviewFrame } from "../composables/block-preview/usePreviewFrame";
5
+ import { isPreviewTheme } from "../utils/blockPreview";
6
+ import { previewRenderMessage } from "../utils/blockPreviewMessages";
7
+ import {
8
+ MOCKUP_WIDTHS,
9
+ mockupEndpoint,
10
+ parseMockupState,
11
+ type MockupState,
12
+ } from "../utils/mockup";
13
+ import {
14
+ mockupDataTree,
15
+ mockupPreviewPath,
16
+ readsRealData,
17
+ } from "../utils/mockupRealData";
18
+ import { mockupNavigation } from "../utils/mockupFrame";
19
+ import { currentSketchScheme } from "../utils/sketch";
4
20
 
5
21
  /**
6
- * The first page of a mockup as its card shows it: the image the Overview
7
- * stored beside the spec, 240 px wide on a dotted band, its top cropped by
8
- * the band. It draws no page. A mockup with no stored image, or whose image
9
- * cannot be loaded, leaves a quiet icon on the band.
22
+ * A live, scaled-down drawing of the whole first page of a mockup: the real
23
+ * `/dms-preview` (on live routes for a page converted from a live page), at desktop width and a 16:10 screen, shrunk to the card's
24
+ * width. It reads the mockup and loads the frame once the thumbnail scrolls
25
+ * into view, and leaves a quiet placeholder when the mockup cannot be read or
26
+ * has no page to draw.
10
27
  */
11
- const props = defineProps<{
12
- name: string;
13
- /** When the stored image was written, ISO 8601; absent when the mockup has none. */
14
- capturedAt?: string;
15
- }>();
16
-
17
- const baseURL = useDmsRuntimeConfig().public.dms?.baseURL;
18
-
19
- const failedUrl = ref<string>();
20
- const url = computed(() =>
21
- props.capturedAt
22
- ? mockupCaptureUrl(baseURL, props.name, props.capturedAt)
23
- : undefined,
28
+ const props = defineProps<{ name: string }>();
29
+
30
+ const SCREEN_HEIGHT_PX = (MOCKUP_WIDTHS.desktop * 10) / 16;
31
+
32
+ const { t } = useI18n();
33
+ const { $authFetch } = useAuthFetch();
34
+
35
+ const band = useTemplateRef<HTMLElement>("band");
36
+ const frame = useTemplateRef<HTMLIFrameElement>("frame");
37
+ const hasBeenSeen = ref(false);
38
+ const isLoaded = ref(false);
39
+ const isDrawn = ref(false);
40
+ const state = shallowRef<MockupState>();
41
+ const bandWidth = ref(0);
42
+
43
+ const isInView = useElementVisibility(band);
44
+ useResizeObserver(band, ([entry]) => {
45
+ bandWidth.value = entry?.contentRect.width ?? 0;
46
+ });
47
+
48
+ const page = computed(() => state.value?.pages[0]);
49
+ /** A page converted from a live page is drawn on its live routes, the others on fixtures that refuse them. */
50
+ const previewPath = computed(() =>
51
+ mockupPreviewPath(readsRealData(page.value, undefined)),
52
+ );
53
+ const isUnavailable = computed(() => isLoaded.value && !page.value);
54
+ const scale = computed(() => bandWidth.value / MOCKUP_WIDTHS.desktop);
55
+ const stageStyle = computed(() => ({
56
+ width: `${MOCKUP_WIDTHS.desktop}px`,
57
+ height: `${SCREEN_HEIGHT_PX}px`,
58
+ transform: `scale(${scale.value})`,
59
+ transformOrigin: "top left",
60
+ }));
61
+
62
+ const navigation = computed(() =>
63
+ mockupNavigation({
64
+ title: state.value?.title || props.name,
65
+ categories: state.value?.categories ?? [],
66
+ pages: state.value?.pages ?? [],
67
+ active: page.value?.id,
68
+ widgets: state.value?.sidebar?.widgets,
69
+ modules: state.value?.modules,
70
+ }),
24
71
  );
25
- const shown = computed(() => (url.value === failedUrl.value ? undefined : url.value));
72
+
73
+ function syncPreview(): void {
74
+ const current = page.value;
75
+ if (!current) return;
76
+ bridge.post(
77
+ previewRenderMessage({
78
+ tree: mockupDataTree(current, readsRealData(current, undefined)),
79
+ theme: isPreviewTheme(current.options.theme)
80
+ ? current.options.theme
81
+ : currentSketchScheme(),
82
+ locale: current.options.locale,
83
+ padding: current.options.padding ?? true,
84
+ navigation: navigation.value,
85
+ }),
86
+ );
87
+ isDrawn.value = true;
88
+ }
89
+
90
+ const bridge = usePreviewFrame({
91
+ frame,
92
+ onReady: syncPreview,
93
+ onSelect: () => undefined,
94
+ });
95
+
96
+ async function load(): Promise<void> {
97
+ try {
98
+ state.value = parseMockupState(
99
+ await $authFetch(mockupEndpoint(props.name)),
100
+ );
101
+ } catch {
102
+ state.value = undefined;
103
+ }
104
+ isLoaded.value = true;
105
+ }
106
+
107
+ watch(isInView, (inView) => {
108
+ if (!inView || hasBeenSeen.value) return;
109
+ hasBeenSeen.value = true;
110
+ void load();
111
+ });
26
112
  </script>
27
113
 
28
114
  <template>
29
115
  <div
30
- class="bg-elevated/40 relative flex h-[172px] justify-center overflow-hidden bg-[radial-gradient(var(--ui-border)_1px,transparent_1px)] bg-[length:14px_14px] pt-4"
116
+ ref="band"
117
+ class="bg-muted border-default relative aspect-[16/10] overflow-hidden border-b"
31
118
  aria-hidden="true"
32
119
  data-dms-mockup-thumbnail
33
120
  >
34
- <div v-if="shown" class="pointer-events-none h-fit rounded-t-md shadow-sm">
35
- <img
36
- :src="shown"
37
- alt=""
38
- class="bg-default block w-60 max-w-full rounded-t-md"
39
- loading="lazy"
40
- decoding="async"
41
- draggable="false"
42
- data-dms-mockup-thumbnail-image
43
- @error="failedUrl = shown"
44
- />
45
- </div>
46
- <div v-else class="grid place-items-center self-center">
121
+ <div v-if="isUnavailable" class="grid h-full place-items-center">
47
122
  <UIcon
48
123
  name="i-lucide-layout-template"
49
124
  class="text-dimmed size-8"
50
125
  data-dms-mockup-thumbnail-placeholder
51
126
  />
52
127
  </div>
128
+ <div
129
+ v-else-if="page && scale > 0"
130
+ class="pointer-events-none absolute top-0 left-0"
131
+ :style="stageStyle"
132
+ >
133
+ <iframe
134
+ ref="frame"
135
+ :key="previewPath"
136
+ class="bg-default block size-full border-0 transition-opacity duration-200 motion-reduce:transition-none"
137
+ :class="isDrawn ? 'opacity-100' : 'opacity-0'"
138
+ :src="previewPath"
139
+ :title="t('dms.mockup.thumbnail_title', { name: props.name })"
140
+ tabindex="-1"
141
+ aria-hidden="true"
142
+ />
143
+ </div>
53
144
  </div>
54
145
  </template>
@@ -1,6 +1,5 @@
1
1
  import { isObject, isString } from "#dms-core/app/utils/type-check";
2
2
  import { mockupEndpoint } from "../utils/mockup";
3
- import { clearMockupCaptures } from "../utils/mockupCaptures";
4
3
 
5
4
  /** What a mockup change sends: a new name, a new title, or both. */
6
5
  export interface MockupRenameRequest {
@@ -24,17 +23,15 @@ function readName(answer: Answer): string {
24
23
  throw new Error("Unexpected answer from the mockup API");
25
24
  }
26
25
 
27
- /** Renames mockup `name`, and answers the name it has now. The Overview's captures of a mockup that changed name are released, since they are kept by name. */
26
+ /** Renames mockup `name`, and answers the name it has now. */
28
27
  export async function renameMockup(
29
28
  fetch: MockupFetch,
30
29
  name: string,
31
30
  change: MockupRenameRequest,
32
31
  ): Promise<string> {
33
- const renamed = readName(
32
+ return readName(
34
33
  await fetch(mockupEndpoint(name), { method: "PATCH", body: change }),
35
34
  );
36
- if (renamed !== name) clearMockupCaptures(name);
37
- return renamed;
38
35
  }
39
36
 
40
37
  /** Copies mockup `name` into a draft the server names, and answers that name. */
@@ -50,11 +47,10 @@ export async function duplicateMockup(
50
47
  );
51
48
  }
52
49
 
53
- /** Deletes the folder of mockup `name`, and releases the Overview's captures of it. */
50
+ /** Deletes the folder of mockup `name`. */
54
51
  export async function deleteMockup(
55
52
  fetch: MockupFetch,
56
53
  name: string,
57
54
  ): Promise<void> {
58
55
  await fetch(mockupEndpoint(name), { method: "DELETE" });
59
- clearMockupCaptures(name);
60
56
  }
@@ -4,9 +4,18 @@ import {
4
4
  isNumber,
5
5
  isString,
6
6
  } from "../../../../dms-core/app/utils/type-check";
7
+ import { ButtonVariant } from "../../../../dms-core/app/types/button";
8
+ import { Color, type ColorValue } from "../../../../dms-core/app/types/color";
9
+ import {
10
+ isNavigationModule,
11
+ isNavigationSection,
12
+ isPreviewWorkspace,
13
+ type PreviewNavigationModule,
14
+ type PreviewNavigationSection,
15
+ type PreviewWorkspace,
16
+ } from "./blockPreviewNavigation";
7
17
  import { isObjectValue } from "./json";
8
- import { isPreviewHeader, type PreviewHeader } from "./previewHeader";
9
- import { parseBlockRects, parseFont, parseRect } from "./blockPreviewRects";
18
+ import { isOptionalString, isRecord } from "./recordGuards";
10
19
  import {
11
20
  isPreviewTheme,
12
21
  isPreviewTree,
@@ -15,55 +24,34 @@ import {
15
24
  type PreviewTree,
16
25
  } from "./blockPreview";
17
26
  import type { MockupSectionEdit } from "./mockupSections";
18
- import {
19
- isOptionalPreviewPageLayout,
20
- isOptionalStringRecord,
21
- type PreviewPageLayout,
22
- } from "./previewPageLayout";
23
27
  import { parseSectionEdit } from "./mockupSectionEdits";
24
- import { isRecord, PREVIEW_CHANNEL } from "./blockPreviewChannel";
25
- import {
26
- isCaptureRequestMessage,
27
- parseCaptureAnswer,
28
- type PreviewCaptureAnswer,
29
- type PreviewCaptureRequestMessage,
30
- } from "./blockPreviewCapture";
31
-
32
- export * from "./blockPreviewChannel";
33
- export * from "./blockPreviewCapture";
34
-
35
- /** One entry of the sidebar the preview draws around the blocks. */
36
- export interface PreviewNavigationItem {
37
- id: string;
38
- label: string;
39
- icon?: string;
40
- }
41
28
 
42
- /** A category of the sidebar: the header its entries are listed under. */
43
- export interface PreviewNavigationCategory {
44
- id: string;
45
- title: string;
46
- icon?: string;
47
- }
29
+ export type {
30
+ PreviewNavigationCategory,
31
+ PreviewNavigationItem,
32
+ PreviewNavigationModule,
33
+ PreviewNavigationSection,
34
+ PreviewHiddenRows,
35
+ PreviewWorkspace,
36
+ } from "./blockPreviewNavigation";
48
37
 
49
- /** A section of the sidebar: a category and its entries, or the default section's entries. */
50
- export interface PreviewNavigationSection {
51
- /** None for the default section, which holds the pages without a category. */
52
- category?: PreviewNavigationCategory;
53
- items: PreviewNavigationItem[];
54
- }
38
+ export const PREVIEW_CHANNEL = "dms-preview";
55
39
 
56
40
  /** The sidebar the preview draws around the blocks, as a dashboard does. */
57
41
  export interface PreviewNavigation {
58
42
  title?: string;
59
43
  /** The default section first, then each category in the menu's order. */
60
44
  sections: PreviewNavigationSection[];
45
+ /** The modules drawn under the sections, in the spec's order; read-only, never edited. */
46
+ modules?: PreviewNavigationModule[];
61
47
  /** The id of the entry drawn as the current one. */
62
48
  active?: string;
63
49
  /** The sidebar edits its sections, each change posted as a `section-edit`. */
64
50
  editable?: boolean;
65
51
  /** Sketches drawn below the sidebar's own widgets. */
66
52
  widgets?: PreviewSidebarWidget[];
53
+ /** SaaS mode: the workspace switcher above the menu, and a banner above the page. */
54
+ workspace?: PreviewWorkspace;
67
55
  }
68
56
 
69
57
  /** A sketch the sidebar draws among its widgets, `caption` over it. */
@@ -71,6 +59,41 @@ export interface PreviewSidebarWidget extends PreviewSketch {
71
59
  id: string;
72
60
  }
73
61
 
62
+ type ButtonVariantValue = `${ButtonVariant}`;
63
+
64
+ const HEADER_COLORS = new Set<string>(Object.values(Color));
65
+ const HEADER_VARIANTS = new Set<string>(Object.values(ButtonVariant));
66
+
67
+ /** Whether `value` is a color a header button takes. */
68
+ export function isHeaderColor(
69
+ value: Parameters<typeof isString>[0],
70
+ ): value is ColorValue {
71
+ return isString(value) && HEADER_COLORS.has(value);
72
+ }
73
+
74
+ /** Whether `value` is a variant a header button takes. */
75
+ export function isHeaderVariant(
76
+ value: Parameters<typeof isString>[0],
77
+ ): value is ButtonVariantValue {
78
+ return isString(value) && HEADER_VARIANTS.has(value);
79
+ }
80
+
81
+ /** A button right of the page title, as the header draws it. */
82
+ export interface PreviewHeaderAction {
83
+ label: string;
84
+ icon?: string;
85
+ color?: ColorValue;
86
+ variant?: ButtonVariantValue;
87
+ }
88
+
89
+ /** The page header the preview draws above the blocks, as the dashboard draws a page's. */
90
+ export interface PreviewHeader {
91
+ title: string;
92
+ icon?: string;
93
+ description?: string;
94
+ actions?: PreviewHeaderAction[];
95
+ }
96
+
74
97
  /** A box in the preview's document, in CSS pixels from its top-left corner. */
75
98
  export interface PreviewRect {
76
99
  x: number;
@@ -105,12 +128,8 @@ export interface PreviewRenderMessage {
105
128
  navigation?: PreviewNavigation;
106
129
  /** Draws this page header, and the dashboard's top bar over it, above the blocks; none when absent. */
107
130
  header?: PreviewHeader;
108
- /** Draws the page in this layout, which may leave out the sidebar, the top bar and the header; the dashboard frame when absent. */
109
- pageLayout?: PreviewPageLayout;
110
131
  /** The route parameters the blocks fill `{{params.X}}` with, as a page's route gives them; none when absent. */
111
132
  params?: Record<string, string>;
112
- /** The query parameters of the page the blocks are on, as its URL gives them; none when absent. */
113
- query?: Record<string, string>;
114
133
  }
115
134
 
116
135
  /** Parent → iframe: switch the color mode. */
@@ -145,8 +164,7 @@ export type PreviewInboundMessage =
145
164
  | PreviewRenderMessage
146
165
  | PreviewThemeMessage
147
166
  | PreviewInspectMessage
148
- | PreviewMinHeightMessage
149
- | PreviewCaptureRequestMessage;
167
+ | PreviewMinHeightMessage;
150
168
 
151
169
  /** Iframe → parent: mounted, ready for `render`. */
152
170
  export interface PreviewReadyMessage {
@@ -219,6 +237,13 @@ export interface PreviewNavigateMessage {
219
237
  record?: string;
220
238
  }
221
239
 
240
+ /** Iframe → parent: the workspace switcher picked a tenant, by its id. */
241
+ export interface PreviewTenantMessage {
242
+ channel: typeof PREVIEW_CHANNEL;
243
+ type: "tenant";
244
+ id: string;
245
+ }
246
+
222
247
  /** Iframe → parent: Escape was pressed in the page, and no menu or dialog of its own took it. */
223
248
  export interface PreviewEscapeMessage {
224
249
  channel: typeof PREVIEW_CHANNEL;
@@ -252,23 +277,10 @@ export type PreviewOutboundMessage =
252
277
  | PreviewTextMessage
253
278
  | PreviewSelectPageMessage
254
279
  | PreviewNavigateMessage
280
+ | PreviewTenantMessage
255
281
  | PreviewEscapeMessage
256
282
  | PreviewSectionEditMessage
257
- | PreviewPressMessage
258
- | PreviewCaptureAnswer;
259
-
260
- function isOptionalString(value: Parameters<typeof isString>[0]): boolean {
261
- return value === undefined || isString(value);
262
- }
263
-
264
- function isNavigationItem(value: unknown): value is PreviewNavigationItem {
265
- return (
266
- isRecord(value) &&
267
- isString(value.id) &&
268
- isString(value.label) &&
269
- isOptionalString(value.icon)
270
- );
271
- }
283
+ | PreviewPressMessage;
272
284
 
273
285
  function isSidebarWidget(value: unknown): value is PreviewSidebarWidget {
274
286
  return (
@@ -282,44 +294,94 @@ function isSidebarWidget(value: unknown): value is PreviewSidebarWidget {
282
294
  );
283
295
  }
284
296
 
285
- function isNavigationCategory(
297
+ /** Whether `value` is a sidebar a `render` may carry, every entry checked. */
298
+ export function isPreviewNavigation(
286
299
  value: unknown,
287
- ): value is PreviewNavigationCategory {
300
+ ): value is PreviewNavigation {
288
301
  return (
289
302
  isRecord(value) &&
290
- isString(value.id) &&
291
- isString(value.title) &&
292
- isOptionalString(value.icon)
303
+ isOptionalString(value.title) &&
304
+ isOptionalString(value.active) &&
305
+ (value.editable === undefined || isBoolean(value.editable)) &&
306
+ Array.isArray(value.sections) &&
307
+ value.sections.every(isNavigationSection) &&
308
+ (value.modules === undefined ||
309
+ (Array.isArray(value.modules) &&
310
+ value.modules.every(isNavigationModule))) &&
311
+ (value.widgets === undefined ||
312
+ (Array.isArray(value.widgets) && value.widgets.every(isSidebarWidget))) &&
313
+ (value.workspace === undefined || isPreviewWorkspace(value.workspace))
293
314
  );
294
315
  }
295
316
 
296
- function isNavigationSection(
297
- value: unknown,
298
- ): value is PreviewNavigationSection {
317
+ function isHeaderAction(value: unknown): value is PreviewHeaderAction {
299
318
  return (
300
319
  isRecord(value) &&
301
- (value.category === undefined || isNavigationCategory(value.category)) &&
302
- Array.isArray(value.items) &&
303
- value.items.every(isNavigationItem)
320
+ isString(value.label) &&
321
+ isOptionalString(value.icon) &&
322
+ (value.color === undefined || isHeaderColor(value.color)) &&
323
+ (value.variant === undefined || isHeaderVariant(value.variant))
304
324
  );
305
325
  }
306
326
 
307
- /** Whether `value` is a sidebar a `render` may carry, every entry checked. */
308
- export function isPreviewNavigation(
309
- value: unknown,
310
- ): value is PreviewNavigation {
327
+ /** Whether `value` is a page header a `render` may carry, every button checked. */
328
+ export function isPreviewHeader(value: unknown): value is PreviewHeader {
311
329
  return (
312
330
  isRecord(value) &&
313
- isOptionalString(value.title) &&
314
- isOptionalString(value.active) &&
315
- (value.editable === undefined || isBoolean(value.editable)) &&
316
- Array.isArray(value.sections) &&
317
- value.sections.every(isNavigationSection) &&
318
- (value.widgets === undefined ||
319
- (Array.isArray(value.widgets) && value.widgets.every(isSidebarWidget)))
331
+ isString(value.title) &&
332
+ isOptionalString(value.icon) &&
333
+ isOptionalString(value.description) &&
334
+ (value.actions === undefined ||
335
+ (Array.isArray(value.actions) && value.actions.every(isHeaderAction)))
320
336
  );
321
337
  }
322
338
 
339
+ function isFiniteNumber(value: JsonValue | undefined): value is number {
340
+ return isNumber(value) && Number.isFinite(value);
341
+ }
342
+
343
+ function parseRect(value: JsonValue | undefined): PreviewRect | undefined {
344
+ if (!isObjectValue(value)) return undefined;
345
+ const { x, y, width, height } = value;
346
+ return isFiniteNumber(x) &&
347
+ isFiniteNumber(y) &&
348
+ isFiniteNumber(width) &&
349
+ isFiniteNumber(height)
350
+ ? { x, y, width, height }
351
+ : undefined;
352
+ }
353
+
354
+ function parseFont(value: JsonValue | undefined): PreviewFont | undefined {
355
+ if (!isObjectValue(value)) return undefined;
356
+ const { family, size, weight, lineHeight, letterSpacing, color, align } =
357
+ value;
358
+ return isString(family) &&
359
+ isString(size) &&
360
+ isString(weight) &&
361
+ isString(lineHeight) &&
362
+ isString(letterSpacing) &&
363
+ isString(color) &&
364
+ isString(align)
365
+ ? { family, size, weight, lineHeight, letterSpacing, color, align }
366
+ : undefined;
367
+ }
368
+
369
+ function parseBlockRect(
370
+ value: JsonValue | undefined,
371
+ ): PreviewBlockRect | undefined {
372
+ if (!isObjectValue(value) || !isString(value.path)) return undefined;
373
+ const rect = parseRect(value.rect);
374
+ return rect ? { path: value.path, rect } : undefined;
375
+ }
376
+
377
+ function parseBlockRects(
378
+ value: JsonValue | undefined,
379
+ ): PreviewBlockRect[] | undefined {
380
+ if (!Array.isArray(value)) return undefined;
381
+ const blocks = value.map(parseBlockRect);
382
+ return blocks.every((block) => block !== undefined) ? blocks : undefined;
383
+ }
384
+
323
385
  function isRenderMessage(
324
386
  value: Parameters<typeof isRecord>[0],
325
387
  ): value is PreviewRenderMessage {
@@ -334,8 +396,8 @@ function isRenderMessage(
334
396
  (value.padding === undefined || isBoolean(value.padding)) &&
335
397
  (value.navigation === undefined || isPreviewNavigation(value.navigation)) &&
336
398
  (value.header === undefined || isPreviewHeader(value.header)) &&
337
- isOptionalPreviewPageLayout(value.pageLayout) &&
338
- [value.params, value.query].every(isOptionalStringRecord)
399
+ (value.params === undefined ||
400
+ (isRecord(value.params) && Object.values(value.params).every(isString)))
339
401
  );
340
402
  }
341
403
 
@@ -384,8 +446,7 @@ export function parsePreviewMessage(
384
446
  return isRenderMessage(data) ||
385
447
  isThemeMessage(data) ||
386
448
  isInspectMessage(data) ||
387
- isMinHeightMessage(data) ||
388
- isCaptureRequestMessage(data)
449
+ isMinHeightMessage(data)
389
450
  ? data
390
451
  : undefined;
391
452
  }
@@ -435,6 +496,10 @@ export function previewNavigateMessage(
435
496
  : { channel: PREVIEW_CHANNEL, type: "navigate", id, record };
436
497
  }
437
498
 
499
+ export function previewTenantMessage(id: string): PreviewTenantMessage {
500
+ return { channel: PREVIEW_CHANNEL, type: "tenant", id };
501
+ }
502
+
438
503
  export function previewEscapeMessage(): PreviewEscapeMessage {
439
504
  return { channel: PREVIEW_CHANNEL, type: "escape" };
440
505
  }
@@ -510,6 +575,7 @@ const OUTBOUND_PARSERS: Record<
510
575
  isString(id) && (record === undefined || isString(record))
511
576
  ? previewNavigateMessage(id, record)
512
577
  : undefined,
578
+ tenant: ({ id }) => (isString(id) ? previewTenantMessage(id) : undefined),
513
579
  escape: () => previewEscapeMessage(),
514
580
  "section-edit": ({ edit }) => {
515
581
  const parsed = parseSectionEdit(edit);
@@ -519,7 +585,6 @@ const OUTBOUND_PARSERS: Record<
519
585
  isNumber(button) && Number.isInteger(button)
520
586
  ? previewPressMessage(button)
521
587
  : undefined,
522
- capture: parseCaptureAnswer,
523
588
  };
524
589
 
525
590
  /**
@@ -0,0 +1,119 @@
1
+ import { isNumber, isString } from "../../../../dms-core/app/utils/type-check";
2
+ import { isMockupTenants, type MockupTenant } from "./mockupTenants";
3
+ import { isOptionalString, isRecord } from "./recordGuards";
4
+
5
+ /** One entry of the sidebar the preview draws around the blocks. */
6
+ export interface PreviewNavigationItem {
7
+ id: string;
8
+ label: string;
9
+ icon?: string;
10
+ }
11
+
12
+ /** A category of the sidebar: the header its entries are listed under. */
13
+ export interface PreviewNavigationCategory {
14
+ id: string;
15
+ title: string;
16
+ icon?: string;
17
+ }
18
+
19
+ /** A section of the sidebar: a category and its entries, or the default section's entries. */
20
+ export interface PreviewNavigationSection {
21
+ /** None for the default section, which holds the pages without a category. */
22
+ category?: PreviewNavigationCategory;
23
+ items: PreviewNavigationItem[];
24
+ }
25
+
26
+ /**
27
+ * A module of the app, a menu root under the app's own menu: its icon and
28
+ * title, then its root pages as a section with no category and each of its
29
+ * categories with their pages.
30
+ */
31
+ export interface PreviewNavigationModule {
32
+ id: string;
33
+ title: string;
34
+ icon: string;
35
+ sections: PreviewNavigationSection[];
36
+ }
37
+
38
+ /** How many rows of a tenant-scoped entity the active tenant sees, out of all of them. */
39
+ export interface PreviewHiddenRows {
40
+ entity: string;
41
+ shown: number;
42
+ total: number;
43
+ }
44
+
45
+ /**
46
+ * SaaS mode as the sidebar and the banner draw it: the workspaces the
47
+ * switcher lists, the id of the active one, and the rows its page hides.
48
+ */
49
+ export interface PreviewWorkspace {
50
+ tenants: MockupTenant[];
51
+ active: string;
52
+ hidden: PreviewHiddenRows[];
53
+ }
54
+
55
+ function isHiddenRows(value: unknown): value is PreviewHiddenRows {
56
+ return (
57
+ isRecord(value) &&
58
+ isString(value.entity) &&
59
+ isNumber(value.shown) &&
60
+ Number.isFinite(value.shown) &&
61
+ isNumber(value.total) &&
62
+ Number.isFinite(value.total)
63
+ );
64
+ }
65
+
66
+ /** Whether `value` is a workspace a sidebar may carry: its tenants and the rows it hides, each read. */
67
+ export function isPreviewWorkspace(value: unknown): value is PreviewWorkspace {
68
+ return (
69
+ isRecord(value) &&
70
+ isMockupTenants(value.tenants) &&
71
+ isString(value.active) &&
72
+ Array.isArray(value.hidden) &&
73
+ value.hidden.every(isHiddenRows)
74
+ );
75
+ }
76
+
77
+ function isNavigationItem(value: unknown): value is PreviewNavigationItem {
78
+ return (
79
+ isRecord(value) &&
80
+ isString(value.id) &&
81
+ isString(value.label) &&
82
+ isOptionalString(value.icon)
83
+ );
84
+ }
85
+
86
+ function isNavigationCategory(
87
+ value: unknown,
88
+ ): value is PreviewNavigationCategory {
89
+ return (
90
+ isRecord(value) &&
91
+ isString(value.id) &&
92
+ isString(value.title) &&
93
+ isOptionalString(value.icon)
94
+ );
95
+ }
96
+
97
+ export function isNavigationSection(
98
+ value: unknown,
99
+ ): value is PreviewNavigationSection {
100
+ return (
101
+ isRecord(value) &&
102
+ (value.category === undefined || isNavigationCategory(value.category)) &&
103
+ Array.isArray(value.items) &&
104
+ value.items.every(isNavigationItem)
105
+ );
106
+ }
107
+
108
+ export function isNavigationModule(
109
+ value: unknown,
110
+ ): value is PreviewNavigationModule {
111
+ return (
112
+ isRecord(value) &&
113
+ isString(value.id) &&
114
+ isString(value.title) &&
115
+ isString(value.icon) &&
116
+ Array.isArray(value.sections) &&
117
+ value.sections.every(isNavigationSection)
118
+ );
119
+ }