@antelopejs/dms 0.21.3-next.1001.ge3bf721 → 0.21.3-next.1003.g014f36d

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 (556) hide show
  1. package/data/mockup-example/spec.json +11 -36
  2. package/data/mockup-spec.schema.json +917 -23
  3. package/dist/builder.js +0 -2
  4. package/dist/builder.js.map +1 -1
  5. package/dist/implementations/dms-builder/engine/access-grant.js +6 -6
  6. package/dist/implementations/dms-builder/engine/access-grant.js.map +1 -1
  7. package/dist/implementations/dms-builder/engine/analysis-job.js +2 -1
  8. package/dist/implementations/dms-builder/engine/analysis-job.js.map +1 -1
  9. package/dist/implementations/dms-builder/engine/category-section.d.ts +23 -0
  10. package/dist/implementations/dms-builder/engine/category-section.js +84 -0
  11. package/dist/implementations/dms-builder/engine/category-section.js.map +1 -0
  12. package/dist/implementations/dms-builder/engine/cell-displays.d.ts +17 -0
  13. package/dist/implementations/dms-builder/engine/cell-displays.js +194 -0
  14. package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -0
  15. package/dist/implementations/dms-builder/engine/column-display.js +2 -2
  16. package/dist/implementations/dms-builder/engine/column-display.js.map +1 -1
  17. package/dist/implementations/dms-builder/engine/column-groups-write.d.ts +2 -0
  18. package/dist/implementations/dms-builder/engine/column-groups-write.js +79 -0
  19. package/dist/implementations/dms-builder/engine/column-groups-write.js.map +1 -0
  20. package/dist/implementations/dms-builder/engine/column-groups.d.ts +27 -0
  21. package/dist/implementations/dms-builder/engine/column-groups.js +36 -0
  22. package/dist/implementations/dms-builder/engine/column-groups.js.map +1 -0
  23. package/dist/implementations/dms-builder/engine/column-presentation.d.ts +13 -0
  24. package/dist/implementations/dms-builder/engine/column-presentation.js +121 -0
  25. package/dist/implementations/dms-builder/engine/column-presentation.js.map +1 -0
  26. package/dist/implementations/dms-builder/engine/compose-page.js +4 -4
  27. package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
  28. package/dist/implementations/dms-builder/engine/connection-access-switch.d.ts +11 -0
  29. package/dist/implementations/dms-builder/engine/connection-access-switch.js +61 -0
  30. package/dist/implementations/dms-builder/engine/connection-access-switch.js.map +1 -0
  31. package/dist/implementations/dms-builder/engine/connection-access.js +1 -1
  32. package/dist/implementations/dms-builder/engine/connection-access.js.map +1 -1
  33. package/dist/implementations/dms-builder/engine/connection-targets.js +3 -3
  34. package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -1
  35. package/dist/implementations/dms-builder/engine/database-connection.d.ts +2 -0
  36. package/dist/implementations/dms-builder/engine/database-connection.js +24 -0
  37. package/dist/implementations/dms-builder/engine/database-connection.js.map +1 -1
  38. package/dist/implementations/dms-builder/engine/display-defaults.d.ts +2 -1
  39. package/dist/implementations/dms-builder/engine/display-defaults.js +2 -1
  40. package/dist/implementations/dms-builder/engine/display-defaults.js.map +1 -1
  41. package/dist/implementations/dms-builder/engine/dms-database.js +2 -2
  42. package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
  43. package/dist/implementations/dms-builder/engine/emit.d.ts +1 -0
  44. package/dist/implementations/dms-builder/engine/emit.js +9 -0
  45. package/dist/implementations/dms-builder/engine/emit.js.map +1 -1
  46. package/dist/implementations/dms-builder/engine/index.d.ts +2 -0
  47. package/dist/implementations/dms-builder/engine/index.js +2 -0
  48. package/dist/implementations/dms-builder/engine/index.js.map +1 -1
  49. package/dist/implementations/dms-builder/engine/map-resources-batch.js +22 -1
  50. package/dist/implementations/dms-builder/engine/map-resources-batch.js.map +1 -1
  51. package/dist/implementations/dms-builder/engine/map-resources-pages.js +91 -41
  52. package/dist/implementations/dms-builder/engine/map-resources-pages.js.map +1 -1
  53. package/dist/implementations/dms-builder/engine/map-resources-plan.d.ts +1 -0
  54. package/dist/implementations/dms-builder/engine/map-resources-plan.js +7 -2
  55. package/dist/implementations/dms-builder/engine/map-resources-plan.js.map +1 -1
  56. package/dist/implementations/dms-builder/engine/map-resources-presentation.d.ts +10 -0
  57. package/dist/implementations/dms-builder/engine/map-resources-presentation.js +33 -0
  58. package/dist/implementations/dms-builder/engine/map-resources-presentation.js.map +1 -0
  59. package/dist/implementations/dms-builder/engine/map-resources.js +2 -1
  60. package/dist/implementations/dms-builder/engine/map-resources.js.map +1 -1
  61. package/dist/implementations/dms-builder/engine/mapped-choices.js +3 -3
  62. package/dist/implementations/dms-builder/engine/mapped-choices.js.map +1 -1
  63. package/dist/implementations/dms-builder/engine/mapped-displays.d.ts +2 -1
  64. package/dist/implementations/dms-builder/engine/mapped-displays.js +6 -3
  65. package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
  66. package/dist/implementations/dms-builder/engine/mapped-modules.js +5 -5
  67. package/dist/implementations/dms-builder/engine/mapped-modules.js.map +1 -1
  68. package/dist/implementations/dms-builder/engine/ops-categories.d.ts +3 -1
  69. package/dist/implementations/dms-builder/engine/ops-categories.js +45 -40
  70. package/dist/implementations/dms-builder/engine/ops-categories.js.map +1 -1
  71. package/dist/implementations/dms-builder/engine/page-draft-validation.js +3 -3
  72. package/dist/implementations/dms-builder/engine/page-draft-validation.js.map +1 -1
  73. package/dist/implementations/dms-builder/engine/page-draft.js +2 -1
  74. package/dist/implementations/dms-builder/engine/page-draft.js.map +1 -1
  75. package/dist/implementations/dms-builder/engine/page-structure.js +1 -0
  76. package/dist/implementations/dms-builder/engine/page-structure.js.map +1 -1
  77. package/dist/implementations/dms-builder/engine/plain-object.d.ts +1 -0
  78. package/dist/implementations/dms-builder/engine/plain-object.js +7 -0
  79. package/dist/implementations/dms-builder/engine/plain-object.js.map +1 -0
  80. package/dist/implementations/dms-builder/engine/planned-page.d.ts +1 -0
  81. package/dist/implementations/dms-builder/engine/planned-page.js +1 -0
  82. package/dist/implementations/dms-builder/engine/planned-page.js.map +1 -1
  83. package/dist/implementations/dms-builder/engine/preview.js +3 -3
  84. package/dist/implementations/dms-builder/engine/preview.js.map +1 -1
  85. package/dist/implementations/dms-builder/engine/project-config-entry.js +2 -2
  86. package/dist/implementations/dms-builder/engine/project-config-entry.js.map +1 -1
  87. package/dist/implementations/dms-builder/engine/project-config-text.js +2 -2
  88. package/dist/implementations/dms-builder/engine/project-config-text.js.map +1 -1
  89. package/dist/implementations/dms-builder/engine/project-config.js +2 -2
  90. package/dist/implementations/dms-builder/engine/project-config.js.map +1 -1
  91. package/dist/implementations/dms-builder/engine/project-scaffold.js +3 -3
  92. package/dist/implementations/dms-builder/engine/project-scaffold.js.map +1 -1
  93. package/dist/implementations/dms-builder/engine/project.js +3 -3
  94. package/dist/implementations/dms-builder/engine/project.js.map +1 -1
  95. package/dist/implementations/dms-builder/engine/query-plan.js +2 -2
  96. package/dist/implementations/dms-builder/engine/query-plan.js.map +1 -1
  97. package/dist/implementations/dms-builder/engine/query-preview.js +2 -2
  98. package/dist/implementations/dms-builder/engine/query-preview.js.map +1 -1
  99. package/dist/implementations/dms-builder/engine/query-structure.js +2 -2
  100. package/dist/implementations/dms-builder/engine/query-structure.js.map +1 -1
  101. package/dist/implementations/dms-builder/engine/query-sync.js +2 -2
  102. package/dist/implementations/dms-builder/engine/query-sync.js.map +1 -1
  103. package/dist/implementations/dms-builder/engine/query-template.js +6 -6
  104. package/dist/implementations/dms-builder/engine/query-template.js.map +1 -1
  105. package/dist/implementations/dms-builder/engine/resource-emit-types.js +5 -0
  106. package/dist/implementations/dms-builder/engine/resource-emit-types.js.map +1 -1
  107. package/dist/implementations/dms-builder/engine/resource-emit.d.ts +1 -0
  108. package/dist/implementations/dms-builder/engine/resource-emit.js +1 -0
  109. package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
  110. package/dist/implementations/dms-builder/engine/resource-guards.d.ts +4 -0
  111. package/dist/implementations/dms-builder/engine/resource-guards.js +38 -0
  112. package/dist/implementations/dms-builder/engine/resource-guards.js.map +1 -0
  113. package/dist/implementations/dms-builder/engine/resource-ops-delete.d.ts +2 -2
  114. package/dist/implementations/dms-builder/engine/resource-ops-delete.js +18 -38
  115. package/dist/implementations/dms-builder/engine/resource-ops-delete.js.map +1 -1
  116. package/dist/implementations/dms-builder/engine/resource-ops.js +5 -0
  117. package/dist/implementations/dms-builder/engine/resource-ops.js.map +1 -1
  118. package/dist/implementations/dms-builder/engine/resource-structure.js +22 -3
  119. package/dist/implementations/dms-builder/engine/resource-structure.js.map +1 -1
  120. package/dist/implementations/dms-builder/engine/row-writes.d.ts +2 -1
  121. package/dist/implementations/dms-builder/engine/row-writes.js +2 -1
  122. package/dist/implementations/dms-builder/engine/row-writes.js.map +1 -1
  123. package/dist/implementations/dms-builder/engine/scan.d.ts +2 -0
  124. package/dist/implementations/dms-builder/engine/scan.js +17 -3
  125. package/dist/implementations/dms-builder/engine/scan.js.map +1 -1
  126. package/dist/implementations/dms-builder/engine/source-index.d.ts +1 -0
  127. package/dist/implementations/dms-builder/engine/source-index.js +16 -0
  128. package/dist/implementations/dms-builder/engine/source-index.js.map +1 -1
  129. package/dist/implementations/dms-builder/engine/table-readers.js +2 -2
  130. package/dist/implementations/dms-builder/engine/table-readers.js.map +1 -1
  131. package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
  132. package/dist/implementations/dms-builder/engine/theme-declaration.d.ts +13 -0
  133. package/dist/implementations/dms-builder/engine/theme-declaration.js +72 -0
  134. package/dist/implementations/dms-builder/engine/theme-declaration.js.map +1 -0
  135. package/dist/implementations/dms-builder/engine/theme-registration.d.ts +18 -0
  136. package/dist/implementations/dms-builder/engine/theme-registration.js +210 -0
  137. package/dist/implementations/dms-builder/engine/theme-registration.js.map +1 -0
  138. package/dist/implementations/dms-builder/engine/theme-scaffold.js +41 -147
  139. package/dist/implementations/dms-builder/engine/theme-scaffold.js.map +1 -1
  140. package/dist/implementations/dms-builder/engine/theme-stylesheet.js +18 -1
  141. package/dist/implementations/dms-builder/engine/theme-stylesheet.js.map +1 -1
  142. package/dist/implementations/dms-builder/engine/theme.js +2 -0
  143. package/dist/implementations/dms-builder/engine/theme.js.map +1 -1
  144. package/dist/implementations/dms-builder/engine/value.d.ts +0 -1
  145. package/dist/implementations/dms-builder/engine/value.js +0 -4
  146. package/dist/implementations/dms-builder/engine/value.js.map +1 -1
  147. package/dist/implementations/dms-builder/index.d.ts +7 -3
  148. package/dist/implementations/dms-builder/index.js +6 -0
  149. package/dist/implementations/dms-builder/index.js.map +1 -1
  150. package/dist/index.js +1 -1
  151. package/dist/index.js.map +1 -1
  152. package/dist/mcp/access.d.ts +3 -0
  153. package/dist/mcp/access.js +16 -0
  154. package/dist/mcp/access.js.map +1 -1
  155. package/dist/mcp/analysis-summary.d.ts +51 -0
  156. package/dist/mcp/analysis-summary.js +99 -0
  157. package/dist/mcp/analysis-summary.js.map +1 -0
  158. package/dist/mcp/bridge.d.ts +1 -0
  159. package/dist/mcp/bridge.js +15 -3
  160. package/dist/mcp/bridge.js.map +1 -1
  161. package/dist/mcp/index.js +2 -1
  162. package/dist/mcp/index.js.map +1 -1
  163. package/dist/mcp/protocol.js +15 -9
  164. package/dist/mcp/protocol.js.map +1 -1
  165. package/dist/mcp/redact.d.ts +2 -1
  166. package/dist/mcp/redact.js.map +1 -1
  167. package/dist/mcp/route.d.ts +1 -1
  168. package/dist/mcp/route.js +8 -3
  169. package/dist/mcp/route.js.map +1 -1
  170. package/dist/mcp/tool.d.ts +2 -0
  171. package/dist/mcp/tool.js +1 -0
  172. package/dist/mcp/tool.js.map +1 -1
  173. package/dist/mcp/tools/builder-analysis.d.ts +2 -0
  174. package/dist/mcp/tools/builder-analysis.js +124 -0
  175. package/dist/mcp/tools/builder-analysis.js.map +1 -0
  176. package/dist/mcp/tools/builder-connection-access.d.ts +7 -0
  177. package/dist/mcp/tools/builder-connection-access.js +58 -0
  178. package/dist/mcp/tools/builder-connection-access.js.map +1 -0
  179. package/dist/mcp/tools/builder-map-resources.d.ts +1 -0
  180. package/dist/mcp/tools/builder-map-resources.js +179 -0
  181. package/dist/mcp/tools/builder-map-resources.js.map +1 -0
  182. package/dist/mcp/tools/builder-pages.js +28 -7
  183. package/dist/mcp/tools/builder-pages.js.map +1 -1
  184. package/dist/mcp/tools/builder-project.js +37 -231
  185. package/dist/mcp/tools/builder-project.js.map +1 -1
  186. package/dist/mcp/tools/builder-resources.d.ts +18 -0
  187. package/dist/mcp/tools/builder-resources.js +73 -4
  188. package/dist/mcp/tools/builder-resources.js.map +1 -1
  189. package/dist/mcp/tools/builder-theme.js +4 -4
  190. package/dist/mcp/tools/builder-theme.js.map +1 -1
  191. package/dist/mcp/tools/database.js +1 -1
  192. package/dist/mcp/tools/database.js.map +1 -1
  193. package/dist/mcp/tools/json-patch.d.ts +10 -0
  194. package/dist/mcp/tools/json-patch.js +35 -0
  195. package/dist/mcp/tools/json-patch.js.map +1 -1
  196. package/dist/mcp/tools/mockup-annotations.js +3 -2
  197. package/dist/mcp/tools/mockup-annotations.js.map +1 -1
  198. package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
  199. package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
  200. package/dist/mcp/tools/mockup-from-page.js +7 -4
  201. package/dist/mcp/tools/mockup-from-page.js.map +1 -1
  202. package/dist/mcp/tools/mockup-patch-spec.js +10 -3
  203. package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
  204. package/dist/mcp/tools/mockup-read-spec.d.ts +1 -0
  205. package/dist/mcp/tools/mockup-read-spec.js +45 -0
  206. package/dist/mcp/tools/mockup-read-spec.js.map +1 -0
  207. package/dist/mcp/tools/mockup-resolve-annotation.js +8 -9
  208. package/dist/mcp/tools/mockup-resolve-annotation.js.map +1 -1
  209. package/dist/mcp/tools/mockup-support.d.ts +4 -2
  210. package/dist/mcp/tools/mockup-support.js +18 -11
  211. package/dist/mcp/tools/mockup-support.js.map +1 -1
  212. package/dist/mcp/tools/mockup-write-spec.js +8 -3
  213. package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
  214. package/dist/mcp/tools/mockup.js +2 -0
  215. package/dist/mcp/tools/mockup.js.map +1 -1
  216. package/dist/mcp/tools/preview-blocks.js +3 -6
  217. package/dist/mcp/tools/preview-blocks.js.map +1 -1
  218. package/dist/mcp/tools/theme-schemas.d.ts +201 -0
  219. package/dist/{branding → mcp/tools}/theme-schemas.js +1 -5
  220. package/dist/mcp/tools/theme-schemas.js.map +1 -0
  221. package/dist/mockup/anchor.d.ts +33 -0
  222. package/dist/mockup/anchor.js +19 -4
  223. package/dist/mockup/anchor.js.map +1 -1
  224. package/dist/mockup/annotations-file.d.ts +105 -0
  225. package/dist/mockup/annotations-file.js +96 -0
  226. package/dist/mockup/annotations-file.js.map +1 -0
  227. package/dist/mockup/annotations.d.ts +133 -55
  228. package/dist/mockup/annotations.js +169 -97
  229. package/dist/mockup/annotations.js.map +1 -1
  230. package/dist/mockup/apply-notes.d.ts +1 -1
  231. package/dist/mockup/apply-notes.js +1 -0
  232. package/dist/mockup/apply-notes.js.map +1 -1
  233. package/dist/mockup/apply-plan.d.ts +2 -0
  234. package/dist/mockup/apply-plan.js +25 -3
  235. package/dist/mockup/apply-plan.js.map +1 -1
  236. package/dist/mockup/apply-to-page.js +3 -3
  237. package/dist/mockup/apply-to-page.js.map +1 -1
  238. package/dist/mockup/block-catalog.d.ts +8 -0
  239. package/dist/mockup/block-catalog.js +32 -0
  240. package/dist/mockup/block-catalog.js.map +1 -0
  241. package/dist/mockup/compile.d.ts +6 -2
  242. package/dist/mockup/compile.js +138 -46
  243. package/dist/mockup/compile.js.map +1 -1
  244. package/dist/mockup/controller-blocks.d.ts +2 -0
  245. package/dist/mockup/controller-blocks.js +162 -41
  246. package/dist/mockup/controller-blocks.js.map +1 -1
  247. package/dist/mockup/data-access.d.ts +3 -0
  248. package/dist/mockup/data-access.js +110 -0
  249. package/dist/mockup/data-access.js.map +1 -0
  250. package/dist/mockup/display-values.d.ts +13 -0
  251. package/dist/mockup/display-values.js +46 -0
  252. package/dist/mockup/display-values.js.map +1 -0
  253. package/dist/mockup/example.d.ts +2 -0
  254. package/dist/mockup/example.js +19 -0
  255. package/dist/mockup/example.js.map +1 -0
  256. package/dist/mockup/fixture-answers.d.ts +16 -0
  257. package/dist/mockup/fixture-answers.js +295 -0
  258. package/dist/mockup/fixture-answers.js.map +1 -0
  259. package/dist/mockup/fixtures.d.ts +40 -7
  260. package/dist/mockup/fixtures.js +85 -19
  261. package/dist/mockup/fixtures.js.map +1 -1
  262. package/dist/mockup/form-fields.d.ts +1 -0
  263. package/dist/mockup/form-fields.js +28 -0
  264. package/dist/mockup/form-fields.js.map +1 -1
  265. package/dist/mockup/form-page-modes.d.ts +8 -0
  266. package/dist/mockup/form-page-modes.js +67 -0
  267. package/dist/mockup/form-page-modes.js.map +1 -0
  268. package/dist/mockup/from-page.d.ts +1 -0
  269. package/dist/mockup/from-page.js +10 -4
  270. package/dist/mockup/from-page.js.map +1 -1
  271. package/dist/mockup/generate.d.ts +86 -0
  272. package/dist/mockup/generate.js +281 -0
  273. package/dist/mockup/generate.js.map +1 -0
  274. package/dist/mockup/history-routes.d.ts +34 -0
  275. package/dist/mockup/history-routes.js +265 -0
  276. package/dist/mockup/history-routes.js.map +1 -0
  277. package/dist/mockup/history.d.ts +62 -0
  278. package/dist/mockup/history.js +248 -0
  279. package/dist/mockup/history.js.map +1 -0
  280. package/dist/mockup/index.d.ts +6 -0
  281. package/dist/mockup/index.js +17 -0
  282. package/dist/mockup/index.js.map +1 -1
  283. package/dist/mockup/json-schema-sketch.d.ts +5 -0
  284. package/dist/mockup/json-schema-sketch.js +93 -0
  285. package/dist/mockup/json-schema-sketch.js.map +1 -0
  286. package/dist/mockup/json-schema.js +158 -7
  287. package/dist/mockup/json-schema.js.map +1 -1
  288. package/dist/mockup/live-page.d.ts +4 -2
  289. package/dist/mockup/live-page.js +105 -3
  290. package/dist/mockup/live-page.js.map +1 -1
  291. package/dist/mockup/manage-routes.d.ts +17 -0
  292. package/dist/mockup/manage-routes.js +120 -0
  293. package/dist/mockup/manage-routes.js.map +1 -0
  294. package/dist/mockup/manage.d.ts +20 -0
  295. package/dist/mockup/manage.js +108 -0
  296. package/dist/mockup/manage.js.map +1 -0
  297. package/dist/mockup/model.d.ts +589 -12
  298. package/dist/mockup/model.js +196 -30
  299. package/dist/mockup/model.js.map +1 -1
  300. package/dist/mockup/page-links.d.ts +20 -0
  301. package/dist/mockup/page-links.js +68 -0
  302. package/dist/mockup/page-links.js.map +1 -0
  303. package/dist/mockup/page-placement.d.ts +8 -0
  304. package/dist/mockup/page-placement.js +68 -0
  305. package/dist/mockup/page-placement.js.map +1 -0
  306. package/dist/mockup/page.js +5 -3
  307. package/dist/mockup/page.js.map +1 -1
  308. package/dist/mockup/route-patterns.d.ts +6 -0
  309. package/dist/mockup/route-patterns.js +16 -0
  310. package/dist/mockup/route-patterns.js.map +1 -0
  311. package/dist/mockup/routes.d.ts +2 -0
  312. package/dist/mockup/routes.js +200 -14
  313. package/dist/mockup/routes.js.map +1 -1
  314. package/dist/mockup/row-filters.d.ts +8 -0
  315. package/dist/mockup/row-filters.js +107 -0
  316. package/dist/mockup/row-filters.js.map +1 -0
  317. package/dist/mockup/sample-routes.js +8 -2
  318. package/dist/mockup/sample-routes.js.map +1 -1
  319. package/dist/mockup/sample-rows.d.ts +1 -1
  320. package/dist/mockup/sample-rows.js +5 -4
  321. package/dist/mockup/sample-rows.js.map +1 -1
  322. package/dist/mockup/sidebar.d.ts +2 -0
  323. package/dist/mockup/sidebar.js +34 -0
  324. package/dist/mockup/sidebar.js.map +1 -0
  325. package/dist/mockup/sketch-allowlist.d.ts +2 -1
  326. package/dist/mockup/sketch-allowlist.js +1 -1
  327. package/dist/mockup/sketch-allowlist.js.map +1 -1
  328. package/dist/mockup/sketch-html.d.ts +2 -1
  329. package/dist/mockup/sketch-html.js +74 -24
  330. package/dist/mockup/sketch-html.js.map +1 -1
  331. package/dist/mockup/sketch-limits.d.ts +4 -0
  332. package/dist/mockup/sketch-limits.js +5 -1
  333. package/dist/mockup/sketch-limits.js.map +1 -1
  334. package/dist/mockup/sketch.d.ts +15 -8
  335. package/dist/mockup/sketch.js +78 -33
  336. package/dist/mockup/sketch.js.map +1 -1
  337. package/dist/mockup/source-routes.js +1 -1
  338. package/dist/mockup/source-routes.js.map +1 -1
  339. package/dist/mockup/source.d.ts +6 -3
  340. package/dist/mockup/source.js +19 -23
  341. package/dist/mockup/source.js.map +1 -1
  342. package/dist/mockup/store.d.ts +15 -1
  343. package/dist/mockup/store.js +110 -2
  344. package/dist/mockup/store.js.map +1 -1
  345. package/dist/mockup/table-archive.d.ts +7 -0
  346. package/dist/mockup/table-archive.js +58 -0
  347. package/dist/mockup/table-archive.js.map +1 -0
  348. package/dist/mockup/table-columns.d.ts +57 -0
  349. package/dist/mockup/table-columns.js +136 -0
  350. package/dist/mockup/table-columns.js.map +1 -0
  351. package/dist/mockup/table-forms.d.ts +22 -0
  352. package/dist/mockup/table-forms.js +192 -0
  353. package/dist/mockup/table-forms.js.map +1 -0
  354. package/dist/mockup/table-options.d.ts +461 -0
  355. package/dist/mockup/table-options.js +231 -0
  356. package/dist/mockup/table-options.js.map +1 -0
  357. package/dist/mockup/table-title.d.ts +3 -0
  358. package/dist/mockup/table-title.js +28 -0
  359. package/dist/mockup/table-title.js.map +1 -0
  360. package/dist/mockup/validate.js +11 -0
  361. package/dist/mockup/validate.js.map +1 -1
  362. package/dist/pages/public/preview/index.d.ts +4 -0
  363. package/dist/pages/public/preview/index.js +5 -1
  364. package/dist/pages/public/preview/index.js.map +1 -1
  365. package/dist/pages/settings/users/appearance.d.ts +0 -1
  366. package/dist/pages/settings/users/appearance.js +0 -6
  367. package/dist/pages/settings/users/appearance.js.map +1 -1
  368. package/frontend-vue/dms.frontend.ts +3 -17
  369. package/frontend-vue/eslint-globals.generated.mjs +8 -7
  370. package/frontend-vue/layers/dms-core/shared/types/app-config.ts +0 -12
  371. package/frontend-vue/layers/dms-layout/app/app.config.ts +0 -1
  372. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardFrame.vue +5 -16
  373. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +1 -4
  374. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidePanel.vue +8 -6
  375. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +91 -12
  376. package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +242 -0
  377. package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +2 -9
  378. package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +45 -0
  379. package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewTopBar.vue +135 -0
  380. package/frontend-vue/layers/dms-layout/app/build/components/layout/dashboardNavbar.ts +6 -0
  381. package/frontend-vue/layers/dms-layout/app/build/components/layout/headerButton.ts +26 -0
  382. package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +138 -0
  383. package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +112 -0
  384. package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +69 -0
  385. package/frontend-vue/layers/dms-layout/app/build/mockups/header-action.ts +1 -1
  386. package/frontend-vue/layers/dms-layout/app/components/navigation/NavigationMenu.vue +16 -0
  387. package/frontend-vue/layers/dms-layout/app/custom-layouts/MockupLayout.vue +35 -0
  388. package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +26 -28
  389. package/frontend-vue/layers/dms-layout/app/entries/components/layout/MockupSidebarMenu.ts +2 -0
  390. package/frontend-vue/layers/dms-layout/app/entries/components/layout/PreviewPageHeader.ts +2 -0
  391. package/frontend-vue/layers/dms-layout/app/entries/components/layout/PreviewTopBar.ts +2 -0
  392. package/frontend-vue/layers/dms-layout/app/entries/components/layout/mockupMenu.ts +1 -0
  393. package/frontend-vue/layers/dms-layout/app/entries/mockups/created-toast.ts +2 -0
  394. package/frontend-vue/layers/dms-layout/app/error.vue +8 -4
  395. package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +4 -192
  396. package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +4 -192
  397. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +13 -3
  398. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupBlockCatalog.vue +2 -1
  399. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +66 -0
  400. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +91 -53
  401. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditPanel.vue +12 -3
  402. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +143 -0
  403. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHistoryPanel.vue +124 -0
  404. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIconInput.vue +18 -0
  405. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +43 -22
  406. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModeBanner.vue +33 -0
  407. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +564 -0
  408. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +110 -0
  409. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPageInspector.vue +77 -2
  410. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +349 -76
  411. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +251 -0
  412. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +188 -0
  413. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinTray.vue +61 -0
  414. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPlacementChip.vue +36 -0
  415. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReplaceModal.vue +33 -0
  416. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupResolveBar.vue +49 -0
  417. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupSectionDeleteModal.vue +48 -0
  418. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupShortcutTip.vue +23 -0
  419. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupShortcutsModal.vue +69 -0
  420. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupSketchStatePicker.vue +51 -0
  421. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupStatusBanners.vue +39 -0
  422. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTitle.vue +90 -0
  423. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +198 -70
  424. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupVersionBanner.vue +87 -0
  425. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +326 -406
  426. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +18 -0
  427. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +41 -8
  428. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +84 -13
  429. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupAssistantRuns.ts +71 -0
  430. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDocument.ts +75 -0
  431. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +153 -38
  432. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +65 -0
  433. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupGridLayout.ts +43 -0
  434. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupHandoff.ts +67 -28
  435. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +431 -0
  436. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +142 -0
  437. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPanels.ts +59 -0
  438. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +468 -0
  439. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +44 -0
  440. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +52 -0
  441. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSectionEditing.ts +284 -0
  442. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSectionWrites.ts +80 -0
  443. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +21 -10
  444. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupShortcutKeys.ts +27 -0
  445. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSketchStates.ts +48 -0
  446. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +67 -0
  447. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupVersions.ts +168 -0
  448. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerHandoff.ts +114 -0
  449. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +70 -0
  450. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +131 -0
  451. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +27 -4
  452. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +114 -0
  453. package/frontend-vue/layers/dms-ui/app/build/composables/layout/sidePanelState.ts +25 -0
  454. package/frontend-vue/layers/dms-ui/app/build/composables/layout/useSideRailWidth.ts +53 -0
  455. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +3 -0
  456. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewBindings.ts +1 -0
  457. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewNavigation.ts +11 -4
  458. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/types.ts +8 -0
  459. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +14 -3
  460. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewConfig.ts +3 -1
  461. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +189 -0
  462. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +129 -113
  463. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupRenameModal.vue +116 -0
  464. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +32 -30
  465. package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +56 -0
  466. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +1 -1
  467. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +250 -11
  468. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +191 -71
  469. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCard.ts +60 -0
  470. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +1 -0
  471. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +55 -44
  472. package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +180 -0
  473. package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +66 -0
  474. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +378 -0
  475. package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewArrows.ts +160 -0
  476. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +89 -0
  477. package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +152 -0
  478. package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +36 -0
  479. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSectionEdits.ts +57 -0
  480. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSections.ts +264 -0
  481. package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +226 -0
  482. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSketchStates.ts +91 -0
  483. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +89 -6
  484. package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +117 -0
  485. package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +56 -5
  486. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +17 -0
  487. package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +16 -16
  488. package/frontend-vue/layers/dms-ui/app/components/chart/ChartCard.vue +7 -2
  489. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +7 -1
  490. package/frontend-vue/layers/dms-ui/app/components/table-view/TableView.vue +3 -2
  491. package/frontend-vue/layers/dms-ui/app/composables/chart/types.ts +2 -1
  492. package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupIconInput.ts +2 -0
  493. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSectionEditing.ts +1 -0
  494. package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupVersions.ts +1 -0
  495. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCard.ts +1 -0
  496. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupFrame.ts +1 -0
  497. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupLinks.ts +1 -0
  498. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverview.ts +1 -0
  499. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewArrows.ts +1 -0
  500. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupPageTree.ts +1 -0
  501. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupRealData.ts +1 -0
  502. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSections.ts +1 -0
  503. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupShortcuts.ts +1 -0
  504. package/frontend-vue/layers/dms-ui/app/entries/utils/mockupVersions.ts +1 -0
  505. package/frontend-vue/layers/dms-ui/app/utils/mockupAssistant.ts +62 -8
  506. package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +131 -18
  507. package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +131 -18
  508. package/package.json +5 -5
  509. package/dist/branding/index.d.ts +0 -2
  510. package/dist/branding/index.js +0 -19
  511. package/dist/branding/index.js.map +0 -1
  512. package/dist/branding/page.d.ts +0 -10
  513. package/dist/branding/page.js +0 -22
  514. package/dist/branding/page.js.map +0 -1
  515. package/dist/branding/register.d.ts +0 -1
  516. package/dist/branding/register.js +0 -10
  517. package/dist/branding/register.js.map +0 -1
  518. package/dist/branding/routes.d.ts +0 -18
  519. package/dist/branding/routes.js +0 -78
  520. package/dist/branding/routes.js.map +0 -1
  521. package/dist/branding/theme-schemas.d.ts +0 -484
  522. package/dist/branding/theme-schemas.js.map +0 -1
  523. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +0 -80
  524. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingDeveloperPanel.vue +0 -266
  525. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingEditor.vue +0 -316
  526. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingLogoTile.vue +0 -67
  527. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingPaletteSwatches.vue +0 -63
  528. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingPreview.vue +0 -138
  529. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingSimplePanel.vue +0 -171
  530. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingValueInput.vue +0 -36
  531. package/frontend-vue/layers/dms-layout/app/build/branding/api.ts +0 -55
  532. package/frontend-vue/layers/dms-layout/app/build/branding/catalog.ts +0 -209
  533. package/frontend-vue/layers/dms-layout/app/build/branding/color-input.ts +0 -35
  534. package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +0 -291
  535. package/frontend-vue/layers/dms-layout/app/build/branding/errors.ts +0 -23
  536. package/frontend-vue/layers/dms-layout/app/build/branding/fonts.ts +0 -106
  537. package/frontend-vue/layers/dms-layout/app/build/branding/header-action.ts +0 -19
  538. package/frontend-vue/layers/dms-layout/app/build/branding/logo-tiles.ts +0 -73
  539. package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +0 -178
  540. package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +0 -395
  541. package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +0 -184
  542. package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +0 -100
  543. package/frontend-vue/layers/dms-layout/app/build/branding/theme-types.ts +0 -105
  544. package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +0 -284
  545. package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +0 -104
  546. package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewSidebar.vue +0 -62
  547. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/AppearanceDeveloper.vue +0 -50
  548. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +0 -322
  549. package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +0 -125
  550. package/frontend-vue/layers/dms-layout/app/entries/branding/BrandingEditor.ts +0 -1
  551. package/frontend-vue/layers/dms-layout/app/entries/branding/header-action.ts +0 -2
  552. package/frontend-vue/layers/dms-layout/app/entries/branding/model.ts +0 -5
  553. package/frontend-vue/layers/dms-layout/app/entries/mockup/header-action.ts +0 -2
  554. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupAnnotations.vue +0 -93
  555. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCommentPanel.vue +0 -85
  556. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupComments.ts +0 -95
@@ -0,0 +1,284 @@
1
+ import { computed, ref, type ComputedRef, type Ref } from "vue";
2
+ import type { DropdownMenuItem } from "@nuxt/ui";
3
+ import type { MockupSectionEdit } from "../../utils/mockupSections";
4
+
5
+ /** A category of the sidebar, as a section's header names it. */
6
+ export interface EditedCategory {
7
+ id: string;
8
+ title: string;
9
+ icon?: string;
10
+ }
11
+
12
+ /** A section as a sidebar lists it: its category, none for the default one, and its pages. */
13
+ export interface EditedSection {
14
+ category?: EditedCategory;
15
+ items: readonly { id: string }[];
16
+ }
17
+
18
+ /** What is being dragged: a page, or a category's section. */
19
+ export type SectionDrag =
20
+ | { kind: "page"; page: string }
21
+ | { kind: "section"; category: string };
22
+
23
+ /**
24
+ * Where a drop lands, drawn as a line: before the page `index` of the section
25
+ * `section` (its index in the sidebar, the default one being 0), or before
26
+ * the category `index` among the categories.
27
+ */
28
+ export type SectionDrop =
29
+ | { kind: "page"; section: number; index: number }
30
+ | { kind: "section"; index: number };
31
+
32
+ /** The title being typed: a new section's, or the one of the category `category`. */
33
+ export interface SectionNaming {
34
+ category?: string;
35
+ }
36
+
37
+ interface SectionEditingOptions {
38
+ /** The sections as the sidebar lists them now. */
39
+ sections: () => readonly EditedSection[];
40
+ /** Hands a change to the spec's write path, or to the page that holds it. */
41
+ edit: (edit: MockupSectionEdit) => void;
42
+ t: (key: string) => string;
43
+ }
44
+
45
+ export interface MockupSectionEditing {
46
+ naming: Ref<SectionNaming | undefined>;
47
+ /** The title typed in the inline field. */
48
+ draft: Ref<string>;
49
+ /** The category whose icon is being picked. */
50
+ pickingIcon: Ref<string | undefined>;
51
+ dragging: Ref<SectionDrag | undefined>;
52
+ drop: Ref<SectionDrop | undefined>;
53
+ isNaming: (category?: string) => boolean;
54
+ startNew: () => void;
55
+ startRename: (category: EditedCategory) => void;
56
+ /** Saves the typed title: a new section, or the category renamed. An empty title saves nothing. */
57
+ commitName: () => void;
58
+ cancelName: () => void;
59
+ setIcon: (category: string, icon: string) => void;
60
+ /** The ⋯ menu of a category: Rename, Icon, Delete. */
61
+ menu: (category: EditedCategory) => DropdownMenuItem[];
62
+ /**
63
+ * The content props of that menu. A menu closing hands the focus back to its
64
+ * trigger, which would blur the inline field its Rename or Icon entry just
65
+ * opened and close it; while a field is open the focus stays where it is.
66
+ */
67
+ menuContent: { onCloseAutoFocus: (event: Event) => void };
68
+ startPageDrag: (event: DragEvent, page: string) => void;
69
+ startSectionDrag: (event: DragEvent, category: string) => void;
70
+ /** The pointer is over the page `item` of the section `section`. */
71
+ overPage: (event: DragEvent, section: number, item: number) => void;
72
+ /** The pointer is over the section `section`, outside its pages. */
73
+ overSection: (event: DragEvent, section: number) => void;
74
+ /** Drops what is dragged where the line is, as one edit. */
75
+ dropHere: (event: DragEvent) => void;
76
+ endDrag: () => void;
77
+ isDraggingSection: ComputedRef<boolean>;
78
+ }
79
+
80
+ /** Whether the pointer is in the lower half of the element the event is on. */
81
+ function isLowerHalf(event: DragEvent): boolean {
82
+ const target = event.currentTarget;
83
+ if (!(target instanceof Element)) return false;
84
+ const box = target.getBoundingClientRect();
85
+ return event.clientY > box.top + box.height / 2;
86
+ }
87
+
88
+ /** The index of the categories entry a section stands for: the default section is none. */
89
+ function categoryIndex(section: number): number {
90
+ return section - 1;
91
+ }
92
+
93
+ /** The edit a drop makes, or none when it puts the dragged thing back where it was. */
94
+ export function dropEdit(
95
+ sections: readonly EditedSection[],
96
+ dragged: SectionDrag,
97
+ drop: SectionDrop,
98
+ ): MockupSectionEdit | undefined {
99
+ if (dragged.kind === "section" && drop.kind === "section") {
100
+ const from = sections.findIndex(
101
+ (section) => section.category?.id === dragged.category,
102
+ );
103
+ if (from < 1) return undefined;
104
+ const source = categoryIndex(from);
105
+ const to = source < drop.index ? drop.index - 1 : drop.index;
106
+ return to === source
107
+ ? undefined
108
+ : { kind: "moveCategory", category: dragged.category, to };
109
+ }
110
+ if (dragged.kind !== "page" || drop.kind !== "page") return undefined;
111
+ const target = sections[drop.section];
112
+ if (!target) return undefined;
113
+ const at = target.items.findIndex((item) => item.id === dragged.page);
114
+ const index = at >= 0 && at < drop.index ? drop.index - 1 : drop.index;
115
+ if (at >= 0 && index === at) return undefined;
116
+ return {
117
+ kind: "movePageTo",
118
+ page: dragged.page,
119
+ category: target.category?.id ?? null,
120
+ index,
121
+ };
122
+ }
123
+
124
+ /** A category's ⋯ menu, each entry running its action. */
125
+ function sectionMenu(
126
+ t: (key: string) => string,
127
+ actions: { rename: () => void; icon: () => void; remove: () => void },
128
+ ): DropdownMenuItem[] {
129
+ return [
130
+ {
131
+ label: t("dms.mockup.section_rename"),
132
+ icon: "i-ph-pencil-simple",
133
+ onSelect: actions.rename,
134
+ },
135
+ {
136
+ label: t("dms.mockup.section_icon"),
137
+ icon: "i-ph-smiley",
138
+ onSelect: actions.icon,
139
+ },
140
+ {
141
+ label: t("dms.mockup.section_delete"),
142
+ icon: "i-ph-trash",
143
+ color: "error",
144
+ onSelect: actions.remove,
145
+ },
146
+ ];
147
+ }
148
+
149
+ function startDrag(event: DragEvent, id: string): void {
150
+ if (!event.dataTransfer) return;
151
+ event.dataTransfer.effectAllowed = "move";
152
+ event.dataTransfer.setData("text/plain", id);
153
+ }
154
+
155
+ /**
156
+ * Edits the sidebar's sections, wherever a sidebar lists them: a new section
157
+ * named inline, a title renamed inline, a category's ⋯ menu (Rename, Icon,
158
+ * Delete), and pages and sections dragged into place. Each change is one
159
+ * {@link MockupSectionEdit} handed to `edit`; the page holding the spec
160
+ * writes it, and asks before deleting a section that holds pages.
161
+ */
162
+ export function useMockupSectionEditing(
163
+ options: SectionEditingOptions,
164
+ ): MockupSectionEditing {
165
+ const naming = ref<SectionNaming>();
166
+ const draft = ref("");
167
+ const pickingIcon = ref<string>();
168
+ const dragging = ref<SectionDrag>();
169
+ const drop = ref<SectionDrop>();
170
+
171
+ function startRename(category: EditedCategory): void {
172
+ naming.value = { category: category.id };
173
+ draft.value = category.title;
174
+ }
175
+
176
+ function commitName(): void {
177
+ const at = naming.value;
178
+ const title = draft.value.trim();
179
+ naming.value = undefined;
180
+ if (!at || !title) return;
181
+ options.edit(
182
+ at.category === undefined
183
+ ? { kind: "addCategory", title }
184
+ : { kind: "updateCategory", category: at.category, title },
185
+ );
186
+ }
187
+
188
+ function overPage(event: DragEvent, section: number, item: number): void {
189
+ const dragged = dragging.value;
190
+ if (!dragged) return;
191
+ event.preventDefault();
192
+ if (dragged.kind === "section") {
193
+ overSection(event, section);
194
+ return;
195
+ }
196
+ drop.value = {
197
+ kind: "page",
198
+ section,
199
+ index: item + (isLowerHalf(event) ? 1 : 0),
200
+ };
201
+ }
202
+
203
+ function overSection(event: DragEvent, section: number): void {
204
+ const dragged = dragging.value;
205
+ if (!dragged) return;
206
+ event.preventDefault();
207
+ if (dragged.kind === "page") {
208
+ const isKept =
209
+ drop.value?.kind === "page" && drop.value.section === section;
210
+ if (!isKept) drop.value = { kind: "page", section, index: 0 };
211
+ return;
212
+ }
213
+ const index = Math.max(0, categoryIndex(section));
214
+ drop.value = {
215
+ kind: "section",
216
+ index: section === 0 ? 0 : index + (isLowerHalf(event) ? 1 : 0),
217
+ };
218
+ }
219
+
220
+ function endDrag(): void {
221
+ dragging.value = undefined;
222
+ drop.value = undefined;
223
+ }
224
+
225
+ function dropHere(event: DragEvent): void {
226
+ const dragged = dragging.value;
227
+ const at = drop.value;
228
+ endDrag();
229
+ if (!dragged || !at) return;
230
+ event.preventDefault();
231
+ const edit = dropEdit(options.sections(), dragged, at);
232
+ if (edit) options.edit(edit);
233
+ }
234
+
235
+ return {
236
+ naming,
237
+ draft,
238
+ pickingIcon,
239
+ dragging,
240
+ drop,
241
+ isNaming: (category) =>
242
+ naming.value !== undefined && naming.value.category === category,
243
+ startNew: () => {
244
+ naming.value = {};
245
+ draft.value = "";
246
+ },
247
+ startRename,
248
+ commitName,
249
+ cancelName: () => {
250
+ naming.value = undefined;
251
+ },
252
+ setIcon: (category, icon) =>
253
+ options.edit({ kind: "updateCategory", category, icon }),
254
+ menuContent: {
255
+ onCloseAutoFocus: (event) => {
256
+ if (naming.value !== undefined || pickingIcon.value !== undefined) {
257
+ event.preventDefault();
258
+ }
259
+ },
260
+ },
261
+ menu: (category) =>
262
+ sectionMenu(options.t, {
263
+ rename: () => startRename(category),
264
+ icon: () => {
265
+ pickingIcon.value = category.id;
266
+ },
267
+ remove: () =>
268
+ options.edit({ kind: "removeCategory", category: category.id }),
269
+ }),
270
+ startPageDrag: (event, page) => {
271
+ dragging.value = { kind: "page", page };
272
+ startDrag(event, page);
273
+ },
274
+ startSectionDrag: (event, category) => {
275
+ dragging.value = { kind: "section", category };
276
+ startDrag(event, category);
277
+ },
278
+ overPage,
279
+ overSection,
280
+ dropHere,
281
+ endDrag,
282
+ isDraggingSection: computed(() => dragging.value?.kind === "section"),
283
+ };
284
+ }
@@ -0,0 +1,80 @@
1
+ import { ref, type ComputedRef, type Ref } from "vue";
2
+ import type { MockupEdit } from "../../utils/mockupEdit";
3
+ import {
4
+ sectionCoalesceKey,
5
+ specSections,
6
+ type MockupSectionEdit,
7
+ } from "../../utils/mockupSections";
8
+ import type { MockupSpecDocument } from "../../utils/mockupSpec";
9
+
10
+ /** A section to delete that still holds pages, waiting for the developer to confirm. */
11
+ export interface SectionRemoval {
12
+ category: string;
13
+ title: string;
14
+ /** How many pages move to the default section. */
15
+ count: number;
16
+ }
17
+
18
+ interface SectionWritesOptions {
19
+ spec: ComputedRef<MockupSpecDocument | undefined>;
20
+ /** Whether the spec shown may be edited now. */
21
+ canEdit: ComputedRef<boolean>;
22
+ edit: (edit: MockupEdit, coalesceKey?: string) => void;
23
+ }
24
+
25
+ export interface MockupSectionWrites {
26
+ removing: Ref<SectionRemoval | undefined>;
27
+ /** Writes a change of the sections, or asks first when it deletes a section holding pages. */
28
+ write: (edit: MockupSectionEdit) => void;
29
+ /** Deletes the section waiting for confirmation. */
30
+ confirm: () => void;
31
+ cancel: () => void;
32
+ }
33
+
34
+ /**
35
+ * Writes the changes of the sidebar's sections, from the viewer's page list
36
+ * or the preview's sidebar, as any edit of the spec: one undoable step, the
37
+ * keystrokes of a section's icon joined into one. Deleting a section that
38
+ * holds pages waits for the developer to confirm it.
39
+ */
40
+ export function useMockupSectionWrites(
41
+ options: SectionWritesOptions,
42
+ ): MockupSectionWrites {
43
+ const removing = ref<SectionRemoval>();
44
+
45
+ function write(edit: MockupSectionEdit): void {
46
+ const spec = options.spec.value;
47
+ if (!options.canEdit.value || !spec) return;
48
+ if (edit.kind === "removeCategory") {
49
+ const section = specSections(spec).find(
50
+ (entry) => entry.category?.id === edit.category,
51
+ );
52
+ if (section?.category && section.pages.length > 0) {
53
+ removing.value = {
54
+ category: section.category.id,
55
+ title: section.category.title,
56
+ count: section.pages.length,
57
+ };
58
+ return;
59
+ }
60
+ }
61
+ options.edit(edit, sectionCoalesceKey(edit));
62
+ }
63
+
64
+ function confirm(): void {
65
+ const section = removing.value;
66
+ removing.value = undefined;
67
+ if (section) {
68
+ options.edit({ kind: "removeCategory", category: section.category });
69
+ }
70
+ }
71
+
72
+ return {
73
+ removing,
74
+ write,
75
+ confirm,
76
+ cancel: () => {
77
+ removing.value = undefined;
78
+ },
79
+ };
80
+ }
@@ -13,7 +13,7 @@ import {
13
13
  upsertAnnotation,
14
14
  type MockupAnnotation,
15
15
  type MockupAnnotationDraft,
16
- type MockupAnnotationStatus,
16
+ type MockupAnnotationPatch,
17
17
  type MockupState,
18
18
  } from "../../utils/mockup";
19
19
  import { openMockupStream, type MockupStream } from "../../utils/mockupStream";
@@ -39,10 +39,9 @@ export interface MockupSession {
39
39
  /** Whether the last annotation request failed. */
40
40
  hasRequestFailed: Ref<boolean>;
41
41
  addAnnotation: (draft: MockupAnnotationDraft) => Promise<void>;
42
- setAnnotationStatus: (
43
- id: string,
44
- status: MockupAnnotationStatus,
45
- ) => Promise<void>;
42
+ /** Changes a note's status or text, or moves its pin. */
43
+ updateAnnotation: (id: string, patch: MockupAnnotationPatch) => Promise<void>;
44
+ deleteAnnotation: (id: string) => Promise<void>;
46
45
  }
47
46
 
48
47
  /**
@@ -80,6 +79,20 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
80
79
  }
81
80
  }
82
81
 
82
+ async function deleteAnnotation(id: string): Promise<void> {
83
+ hasRequestFailed.value = false;
84
+ try {
85
+ await options.authFetch(noteEndpoint(id), { method: "DELETE" });
86
+ annotations.value = annotations.value.filter((note) => note.id !== id);
87
+ } catch {
88
+ hasRequestFailed.value = true;
89
+ }
90
+ }
91
+
92
+ function noteEndpoint(id: string): string {
93
+ return `${annotationsEndpoint}/${encodeURIComponent(id)}`;
94
+ }
95
+
83
96
  onMounted(() => {
84
97
  stream = openMockupStream(
85
98
  `${options.baseURL}${mockupEndpoint(options.name, "/events")}`,
@@ -106,10 +119,8 @@ export function useMockupSession(options: MockupSessionOptions): MockupSession {
106
119
  hasRequestFailed,
107
120
  addAnnotation: (draft) =>
108
121
  sendAnnotation(annotationsEndpoint, { method: "POST", body: draft }),
109
- setAnnotationStatus: (id, status) =>
110
- sendAnnotation(`${annotationsEndpoint}/${encodeURIComponent(id)}`, {
111
- method: "PATCH",
112
- body: { status },
113
- }),
122
+ updateAnnotation: (id, patch) =>
123
+ sendAnnotation(noteEndpoint(id), { method: "PATCH", body: patch }),
124
+ deleteAnnotation,
114
125
  };
115
126
  }
@@ -0,0 +1,27 @@
1
+ import { useKeyboardPlatform } from "../../../composables/global/keyboardPlatform";
2
+ import {
3
+ MOCKUP_SHORTCUTS,
4
+ comboKeys,
5
+ type MockupShortcutId,
6
+ } from "../../utils/mockupShortcuts";
7
+
8
+ /** The keys of the viewer's shortcuts as this keyboard prints them: ⌘ and ⌥ on macOS, Ctrl and Alt elsewhere. */
9
+ export interface MockupShortcutKeys {
10
+ /** The keys of the combination shown for a shortcut, one badge each. */
11
+ keysOf: (id: MockupShortcutId) => string[];
12
+ /** The keys of every combination that fires a shortcut. */
13
+ combosOf: (id: MockupShortcutId) => string[][];
14
+ }
15
+
16
+ /** Reads the shortcuts table with the labels of the keyboard in use. */
17
+ export function useMockupShortcutKeys(): MockupShortcutKeys {
18
+ const { keyLabel } = useKeyboardPlatform();
19
+
20
+ function combosOf(id: MockupShortcutId): string[][] {
21
+ return MOCKUP_SHORTCUTS[id].combos.map((combo) =>
22
+ comboKeys(combo).map(keyLabel),
23
+ );
24
+ }
25
+
26
+ return { keysOf: (id) => combosOf(id)[0] ?? [], combosOf };
27
+ }
@@ -0,0 +1,48 @@
1
+ import { shallowRef } from "vue";
2
+ import type { PreviewNode } from "../../utils/blockPreview";
3
+ import type { MockupPageState } from "../../utils/mockup";
4
+ import {
5
+ withSketchStates,
6
+ type MockupSketchStates,
7
+ } from "../../utils/mockupSketchStates";
8
+
9
+ /** The states the viewer draws its sketches in, which no spec holds. */
10
+ export interface MockupSketchStatesChoice {
11
+ /** The state each sketch of the page `page` draws. */
12
+ of: (page: string | undefined) => MockupSketchStates;
13
+ /** Draws the sketch at `pointer` of the page `page` in its state `state`, or in its own `html` when undefined. */
14
+ pick: (page: string, pointer: string, state: string | undefined) => void;
15
+ /** The tree `page` draws, its live one with Real data on, each sketch in the state picked for it. */
16
+ treeOf: (page: MockupPageState, realData: boolean) => PreviewNode[];
17
+ }
18
+
19
+ const NONE: MockupSketchStates = new Map();
20
+
21
+ /**
22
+ * The state each sketch draws while the viewer is open, picked in the
23
+ * inspector; `onPick` runs after each pick, to draw it. Each page keeps its
24
+ * picks when another page opens.
25
+ */
26
+ export function useMockupSketchStates(
27
+ onPick: () => void,
28
+ ): MockupSketchStatesChoice {
29
+ const picked = shallowRef<ReadonlyMap<string, MockupSketchStates>>(new Map());
30
+ const of = (page: string | undefined) =>
31
+ (page === undefined ? undefined : picked.value.get(page)) ?? NONE;
32
+ return {
33
+ of,
34
+ pick: (page, pointer, state) => {
35
+ const states = new Map(of(page));
36
+ if (state === undefined) states.delete(pointer);
37
+ else states.set(pointer, state);
38
+ picked.value = new Map(picked.value).set(page, states);
39
+ onPick();
40
+ },
41
+ treeOf: (page, realData) =>
42
+ withSketchStates(
43
+ page,
44
+ realData && page.realTree ? page.realTree : page.tree,
45
+ of(page.id),
46
+ ),
47
+ };
48
+ }
@@ -0,0 +1,67 @@
1
+ import { computed, nextTick, ref, watch, type Ref } from "vue";
2
+ import { detach } from "../detach";
3
+ import { previewInspectMessage } from "../../utils/blockPreviewMessages";
4
+ import type { MockupEditing } from "./useMockupEditing";
5
+ import type { MockupPins } from "./useMockupPins";
6
+ import type { PreviewFrame } from "./usePreviewFrame";
7
+
8
+ interface ToolModesOptions {
9
+ editing: MockupEditing;
10
+ pins: MockupPins;
11
+ isOverview: Readonly<Ref<boolean>>;
12
+ post: PreviewFrame["post"];
13
+ /** Gives the focus to the canvas, once the page shows. */
14
+ focusCanvas: () => void;
15
+ }
16
+
17
+ /**
18
+ * The modes the canvas is in, which exclude one another: Preview hands every
19
+ * click to the page, so no block stays selected and no tool stays armed; a
20
+ * block armed and the comment tool never are both; the Overview places no
21
+ * block and leaves Preview, to comment on every page, and gives the focus
22
+ * back to the page once it shows again.
23
+ */
24
+ export function useMockupToolModes(options: ToolModesOptions) {
25
+ const { editing, pins, post } = options;
26
+ const isPreviewing = ref(false);
27
+
28
+ watch(isPreviewing, (isOn) => {
29
+ if (isOn) {
30
+ editing.selection.value = undefined;
31
+ editing.cancelPlacing();
32
+ pins.cancel();
33
+ pins.isPlacing.value = false;
34
+ }
35
+ post(previewInspectMessage(!isOn));
36
+ });
37
+ watch(
38
+ () => editing.placing.value,
39
+ (armed) => {
40
+ if (armed) pins.isPlacing.value = false;
41
+ },
42
+ );
43
+ watch(
44
+ () => pins.isPlacing.value,
45
+ (armed) => {
46
+ if (armed) editing.cancelPlacing();
47
+ },
48
+ );
49
+ watch(options.isOverview, (isShown) => {
50
+ if (!isShown) {
51
+ detach(nextTick(options.focusCanvas));
52
+ return;
53
+ }
54
+ editing.cancelPlacing();
55
+ isPreviewing.value = false;
56
+ });
57
+
58
+ return {
59
+ isPreviewing,
60
+ /** The tool armed, which the banner says; the comment tool and a placed block never are both. */
61
+ mode: computed(() => {
62
+ if (pins.isPlacing.value) return { kind: "comment" as const };
63
+ const armed = editing.placing.value;
64
+ return armed ? { kind: "place" as const, name: armed.name } : undefined;
65
+ }),
66
+ };
67
+ }