@phtngyn/cms 0.2.0-beta.8 → 0.3.0

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 (524) hide show
  1. package/LICENSE +18 -10
  2. package/README.md +59 -404
  3. package/drizzle/20261003215543_initial/migration.sql +251 -0
  4. package/drizzle/20261003215543_initial/snapshot.json +1941 -0
  5. package/package.json +75 -71
  6. package/src/Authoring.d.ts +41 -49
  7. package/src/Authoring.js +1 -1
  8. package/src/Blocks-BrxSemnd.js +40 -0
  9. package/src/Client.d.ts +8186 -0
  10. package/src/Client.js +41 -0
  11. package/src/Collections.d.ts +142 -0
  12. package/src/Collections.js +142 -0
  13. package/src/Config-CMiwciub.js +130 -0
  14. package/src/Config.d.ts +172 -0
  15. package/src/Config.js +2 -0
  16. package/src/Configuration-Dk2k3OIc.js +73 -0
  17. package/src/DataTransfer-BmECvPHB.js +488 -0
  18. package/src/Database-DSsNCGft.d.ts +3 -0
  19. package/src/Delivery.d.ts +28 -0
  20. package/src/Delivery.js +7 -0
  21. package/src/Document-CKXMSEf1.js +293 -0
  22. package/src/Document-TgwYKJZM.d.ts +220 -0
  23. package/src/DocumentRenderer-Wz2xaNyf.js +394 -0
  24. package/src/EditorSchema-wrDv-id6.js +296 -0
  25. package/src/Fields-BegSgYhj.d.ts +166 -0
  26. package/src/Fields-ioGaMEh9.js +130 -0
  27. package/src/Forms-BuKAXQxr.d.ts +203 -0
  28. package/src/Forms.d.ts +48 -11
  29. package/src/Forms.js +342 -7
  30. package/src/I18n-Ckf9h0rC.js +154 -0
  31. package/src/I18n.d.ts +45 -2
  32. package/src/I18n.js +2 -1
  33. package/src/Image-CJWPLnhP.js +110 -0
  34. package/src/Links-CJYyy7rC.js +28 -0
  35. package/src/Links-Dx1yOni8.d.ts +28 -0
  36. package/src/Locales-Ch7a5xuA.js +67 -0
  37. package/src/Locales-jwbmJaOp.d.ts +43 -0
  38. package/src/Locales.d.ts +3 -0
  39. package/src/Locales.js +3 -0
  40. package/src/Media-BQ0uL4w7.d.ts +15 -0
  41. package/src/Media-DSyvd14o.js +87 -0
  42. package/src/Module.d.ts +2 -10
  43. package/src/Module.js +1040 -152
  44. package/src/Operations.d.ts +57 -0
  45. package/src/Operations.js +263 -0
  46. package/src/People-DvNZauWw.js +69 -0
  47. package/src/PreviewFocus-C_EelZO5.js +104 -0
  48. package/src/Query-C0kGJF5_.d.ts +261 -0
  49. package/src/RevisionPreview-IVwbJ9Wy.js +133 -0
  50. package/src/Routes-BaZvm2LE.js +126 -0
  51. package/src/Routes-DM1rRp3r.d.ts +15 -0
  52. package/src/S3MediaObjects-y-WacEi9.js +193 -0
  53. package/src/Seo-BcpqxoAs.d.ts +57 -0
  54. package/src/Seo-CjNUtUkj.js +254 -0
  55. package/src/StudioApi-CXLwwocX.js +833 -0
  56. package/src/StudioErrors-T5zLGQ1M.js +117 -0
  57. package/src/StudioErrors-kq-E44lQ.d.ts +104 -0
  58. package/src/StudioServer.d.ts +20 -0
  59. package/src/StudioServer.js +34 -0
  60. package/src/answers-DcTg0Xv2.js +41 -0
  61. package/src/cli.js +681 -187
  62. package/src/contracts-rprW3ZOB.js +130 -0
  63. package/src/forms-3xuf0Ym7.d.ts +206 -0
  64. package/src/localeConfiguration-BPbkLi7-.js +32 -0
  65. package/src/localeContext-DhF3SPvM.js +59 -0
  66. package/src/locales-6OD4XGIZ.js +12 -0
  67. package/src/nuxtDelivery-BYX_Cddb.js +466 -0
  68. package/src/plugin-DTYuDaQu.js +7171 -0
  69. package/src/previewContext-dt3ZUh-w.js +4 -0
  70. package/src/previewRegions-CXjk5cbP.js +145 -0
  71. package/src/previewSource-fb-q3ESM.js +144 -0
  72. package/src/rendering-D9LVeEKX.js +47 -0
  73. package/src/rolldown-runtime-8H4AJuhK.js +14 -0
  74. package/src/runtime/CmsImage.js +38 -0
  75. package/src/runtime/DocumentPage.vue +10 -0
  76. package/src/runtime/DocumentPageContent.js +48 -0
  77. package/src/runtime/DocumentRenderer.d.ts +129 -0
  78. package/src/runtime/DocumentRenderer.js +2 -0
  79. package/src/runtime/api.js +48 -6
  80. package/src/runtime/delivery/useCmsDocument.js +2 -0
  81. package/src/runtime/delivery/useCmsDocumentQuery.js +2 -0
  82. package/src/runtime/delivery/useCmsDocumentSeo.js +2 -114
  83. package/src/runtime/delivery/useCmsLocale.js +10 -0
  84. package/src/runtime/plugin.js +2 -40
  85. package/src/runtime/preview.css +85 -0
  86. package/src/runtime/preview.js +277 -0
  87. package/src/runtime/previewSource.js +82 -0
  88. package/src/runtime/revisionPrivacy.js +13 -0
  89. package/src/runtime/studio.js +10 -0
  90. package/src/runtime/studioIcons.js +36 -0
  91. package/src/validation-3pggwcnm.js +396 -0
  92. package/src/validation-DpUwPC8Y.js +224 -0
  93. package/studio/THIRD-PARTY-LICENSES.md +2406 -0
  94. package/studio/chunks/AccountPage-DL3DitDM.js +288 -0
  95. package/studio/chunks/AccountPage-DL3DitDM.js.br +0 -0
  96. package/studio/chunks/AccountPage-DL3DitDM.js.gz +0 -0
  97. package/studio/chunks/ActivityPage-CLqVUqTh.js +584 -0
  98. package/studio/chunks/ActivityPage-CLqVUqTh.js.br +0 -0
  99. package/studio/chunks/ActivityPage-CLqVUqTh.js.gz +0 -0
  100. package/studio/chunks/Alert-D0D24z_a.js +335 -0
  101. package/studio/chunks/Alert-D0D24z_a.js.br +0 -0
  102. package/studio/chunks/Alert-D0D24z_a.js.gz +0 -0
  103. package/studio/chunks/Badge-BBFs88TI.js +346 -0
  104. package/studio/chunks/Badge-BBFs88TI.js.br +0 -0
  105. package/studio/chunks/Badge-BBFs88TI.js.gz +0 -0
  106. package/studio/chunks/Button-BT3ztSPx.js +14319 -0
  107. package/studio/chunks/Button-BT3ztSPx.js.br +0 -0
  108. package/studio/chunks/Button-BT3ztSPx.js.gz +0 -0
  109. package/studio/chunks/Collapsible-CKnEYIlp.js +246 -0
  110. package/studio/chunks/Collapsible-CKnEYIlp.js.br +0 -0
  111. package/studio/chunks/Collapsible-CKnEYIlp.js.gz +0 -0
  112. package/studio/chunks/ContentInventory-D7nsFA6U.js +1745 -0
  113. package/studio/chunks/ContentInventory-D7nsFA6U.js.br +0 -0
  114. package/studio/chunks/ContentInventory-D7nsFA6U.js.gz +0 -0
  115. package/studio/chunks/ContentPage-DCxt6BeD.js +18 -0
  116. package/studio/chunks/ContentPage-DCxt6BeD.js.br +0 -0
  117. package/studio/chunks/ContentPage-DCxt6BeD.js.gz +0 -0
  118. package/studio/chunks/DashboardSearch-DjyMjJwF.js +2413 -0
  119. package/studio/chunks/DashboardSearch-DjyMjJwF.js.br +0 -0
  120. package/studio/chunks/DashboardSearch-DjyMjJwF.js.gz +0 -0
  121. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js +26063 -0
  122. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.br +0 -0
  123. package/studio/chunks/DocumentLocaleMenu-0EkkOr6_.js.gz +0 -0
  124. package/studio/chunks/DropdownMenu-CA9fB0uZ.js +4400 -0
  125. package/studio/chunks/DropdownMenu-CA9fB0uZ.js.br +0 -0
  126. package/studio/chunks/DropdownMenu-CA9fB0uZ.js.gz +0 -0
  127. package/studio/chunks/EditorPage-D_PAYEE4.js +7799 -0
  128. package/studio/chunks/EditorPage-D_PAYEE4.js.br +0 -0
  129. package/studio/chunks/EditorPage-D_PAYEE4.js.gz +0 -0
  130. package/studio/chunks/FormField-CgM6l2Yn.js +198 -0
  131. package/studio/chunks/FormField-CgM6l2Yn.js.br +0 -0
  132. package/studio/chunks/FormField-CgM6l2Yn.js.gz +0 -0
  133. package/studio/chunks/HelpPage-C-vrFcT_.js +552 -0
  134. package/studio/chunks/HelpPage-C-vrFcT_.js.br +0 -0
  135. package/studio/chunks/HelpPage-C-vrFcT_.js.gz +0 -0
  136. package/studio/chunks/Kbd-Ot7TIhVZ.js +271 -0
  137. package/studio/chunks/Kbd-Ot7TIhVZ.js.br +0 -0
  138. package/studio/chunks/Kbd-Ot7TIhVZ.js.gz +0 -0
  139. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js +101 -0
  140. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.br +0 -0
  141. package/studio/chunks/MediaFolderDialog-DYu-eu-q.js.gz +0 -0
  142. package/studio/chunks/MediaPage-D-jaWtdl.js +923 -0
  143. package/studio/chunks/MediaPage-D-jaWtdl.js.br +0 -0
  144. package/studio/chunks/MediaPage-D-jaWtdl.js.gz +0 -0
  145. package/studio/chunks/MediaPicker-BZs2wUFz.js +837 -0
  146. package/studio/chunks/MediaPicker-BZs2wUFz.js.br +0 -0
  147. package/studio/chunks/MediaPicker-BZs2wUFz.js.gz +0 -0
  148. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js +1173 -0
  149. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.br +0 -0
  150. package/studio/chunks/MediaUploadPanel-C7Kyg6aR.js.gz +0 -0
  151. package/studio/chunks/Modal-D6hSvxHd.js +265 -0
  152. package/studio/chunks/Modal-D6hSvxHd.js.br +0 -0
  153. package/studio/chunks/Modal-D6hSvxHd.js.gz +0 -0
  154. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js +277 -0
  155. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.br +0 -0
  156. package/studio/chunks/NewDocumentDialog-C8B6_r3J.js.gz +0 -0
  157. package/studio/chunks/Pagination-D9BSo5H2.js +573 -0
  158. package/studio/chunks/Pagination-D9BSo5H2.js.br +0 -0
  159. package/studio/chunks/Pagination-D9BSo5H2.js.gz +0 -0
  160. package/studio/chunks/PeoplePage-CWIXitBD.js +783 -0
  161. package/studio/chunks/PeoplePage-CWIXitBD.js.br +0 -0
  162. package/studio/chunks/PeoplePage-CWIXitBD.js.gz +0 -0
  163. package/studio/chunks/Popover-B63bkTMS.js +128 -0
  164. package/studio/chunks/Popover-B63bkTMS.js.br +0 -0
  165. package/studio/chunks/Popover-B63bkTMS.js.gz +0 -0
  166. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js +255 -0
  167. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.br +0 -0
  168. package/studio/chunks/PublicationActionDialog-Cm_P0C3I.js.gz +0 -0
  169. package/studio/chunks/Routes-DLYHmulE.js +102 -0
  170. package/studio/chunks/Routes-DLYHmulE.js.br +0 -0
  171. package/studio/chunks/Routes-DLYHmulE.js.gz +0 -0
  172. package/studio/chunks/RovingFocusItem-QZNg-wWF.js +95 -0
  173. package/studio/chunks/RovingFocusItem-QZNg-wWF.js.br +0 -0
  174. package/studio/chunks/RovingFocusItem-QZNg-wWF.js.gz +0 -0
  175. package/studio/chunks/ScheduledPage-C0hqrkr5.js +332 -0
  176. package/studio/chunks/ScheduledPage-C0hqrkr5.js.br +0 -0
  177. package/studio/chunks/ScheduledPage-C0hqrkr5.js.gz +0 -0
  178. package/studio/chunks/Search-BEgCe9Aj.js +14646 -0
  179. package/studio/chunks/Search-BEgCe9Aj.js.br +0 -0
  180. package/studio/chunks/Search-BEgCe9Aj.js.gz +0 -0
  181. package/studio/chunks/Select-B50WZMW-.js +2145 -0
  182. package/studio/chunks/Select-B50WZMW-.js.br +0 -0
  183. package/studio/chunks/Select-B50WZMW-.js.gz +0 -0
  184. package/studio/chunks/SelectMenu-DSweWGMz.js +2109 -0
  185. package/studio/chunks/SelectMenu-DSweWGMz.js.br +0 -0
  186. package/studio/chunks/SelectMenu-DSweWGMz.js.gz +0 -0
  187. package/studio/chunks/SeoPage-CNNxGe4h.js +846 -0
  188. package/studio/chunks/SeoPage-CNNxGe4h.js.br +0 -0
  189. package/studio/chunks/SeoPage-CNNxGe4h.js.gz +0 -0
  190. package/studio/chunks/Skeleton-COz8dcrw.js +39 -0
  191. package/studio/chunks/Skeleton-COz8dcrw.js.br +2 -0
  192. package/studio/chunks/Skeleton-COz8dcrw.js.gz +0 -0
  193. package/studio/chunks/Slideover-QMMHAAys.js +289 -0
  194. package/studio/chunks/Slideover-QMMHAAys.js.br +0 -0
  195. package/studio/chunks/Slideover-QMMHAAys.js.gz +0 -0
  196. package/studio/chunks/StudioPage-ngEIDr5d.js +80 -0
  197. package/studio/chunks/StudioPage-ngEIDr5d.js.br +0 -0
  198. package/studio/chunks/StudioPage-ngEIDr5d.js.gz +0 -0
  199. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js +2524 -0
  200. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.br +0 -0
  201. package/studio/chunks/StudioPageToolbar-BwHnqyr6.js.gz +0 -0
  202. package/studio/chunks/Switch-qKl1aDn7.js +484 -0
  203. package/studio/chunks/Switch-qKl1aDn7.js.br +0 -0
  204. package/studio/chunks/Switch-qKl1aDn7.js.gz +0 -0
  205. package/studio/chunks/ToolPage-DxoVAJVk.js +29 -0
  206. package/studio/chunks/ToolPage-DxoVAJVk.js.br +0 -0
  207. package/studio/chunks/ToolPage-DxoVAJVk.js.gz +0 -0
  208. package/studio/chunks/Tooltip-Bu15m_DB.js +693 -0
  209. package/studio/chunks/Tooltip-Bu15m_DB.js.br +0 -0
  210. package/studio/chunks/Tooltip-Bu15m_DB.js.gz +0 -0
  211. package/studio/chunks/TrashPage-lhqLLdoG.js +12 -0
  212. package/studio/chunks/TrashPage-lhqLLdoG.js.br +0 -0
  213. package/studio/chunks/TrashPage-lhqLLdoG.js.gz +0 -0
  214. package/studio/chunks/VersionsPage-Cqy6UAp9.js +2349 -0
  215. package/studio/chunks/VersionsPage-Cqy6UAp9.js.br +0 -0
  216. package/studio/chunks/VersionsPage-Cqy6UAp9.js.gz +0 -0
  217. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js +113 -0
  218. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.br +0 -0
  219. package/studio/chunks/VisuallyHiddenInput-Cu8hQLRf.js.gz +0 -0
  220. package/studio/chunks/arrays-CUJkmV4I.js +10 -0
  221. package/studio/chunks/arrays-CUJkmV4I.js.br +0 -0
  222. package/studio/chunks/arrays-CUJkmV4I.js.gz +0 -0
  223. package/studio/chunks/base-DkTekJe8.js +213 -0
  224. package/studio/chunks/base-DkTekJe8.js.br +0 -0
  225. package/studio/chunks/base-DkTekJe8.js.gz +0 -0
  226. package/studio/chunks/content-DUGl3N4d.js +6012 -0
  227. package/studio/chunks/content-DUGl3N4d.js.br +0 -0
  228. package/studio/chunks/content-DUGl3N4d.js.gz +0 -0
  229. package/studio/chunks/destinations-DPIQVQa6.js +227 -0
  230. package/studio/chunks/destinations-DPIQVQa6.js.br +0 -0
  231. package/studio/chunks/destinations-DPIQVQa6.js.gz +0 -0
  232. package/studio/chunks/en-073cjKW4.js +152 -0
  233. package/studio/chunks/en-073cjKW4.js.br +0 -0
  234. package/studio/chunks/en-073cjKW4.js.gz +0 -0
  235. package/studio/chunks/en-Bn8mxPuf.js +134 -0
  236. package/studio/chunks/en-Bn8mxPuf.js.br +0 -0
  237. package/studio/chunks/en-Bn8mxPuf.js.gz +0 -0
  238. package/studio/chunks/en-C9OiaUDZ.js +251 -0
  239. package/studio/chunks/en-C9OiaUDZ.js.br +0 -0
  240. package/studio/chunks/en-C9OiaUDZ.js.gz +0 -0
  241. package/studio/chunks/en-CHAR6jzx.js +147 -0
  242. package/studio/chunks/en-CHAR6jzx.js.br +0 -0
  243. package/studio/chunks/en-CHAR6jzx.js.gz +0 -0
  244. package/studio/chunks/en-Cq4N1vEF.js +93 -0
  245. package/studio/chunks/en-Cq4N1vEF.js.br +2 -0
  246. package/studio/chunks/en-Cq4N1vEF.js.gz +0 -0
  247. package/studio/chunks/en-D2hRqlse.js +140 -0
  248. package/studio/chunks/en-D2hRqlse.js.br +0 -0
  249. package/studio/chunks/en-D2hRqlse.js.gz +0 -0
  250. package/studio/chunks/en-DiUC3-j6.js +144 -0
  251. package/studio/chunks/en-DiUC3-j6.js.br +0 -0
  252. package/studio/chunks/en-DiUC3-j6.js.gz +0 -0
  253. package/studio/chunks/english-Cs_Adu-u.js +8 -0
  254. package/studio/chunks/english-Cs_Adu-u.js.br +0 -0
  255. package/studio/chunks/english-Cs_Adu-u.js.gz +0 -0
  256. package/studio/chunks/esm-D6DqSiL1.js +752 -0
  257. package/studio/chunks/esm-D6DqSiL1.js.br +0 -0
  258. package/studio/chunks/esm-D6DqSiL1.js.gz +0 -0
  259. package/studio/chunks/externalRequest-CTzr2nDq.js +23 -0
  260. package/studio/chunks/externalRequest-CTzr2nDq.js.br +0 -0
  261. package/studio/chunks/externalRequest-CTzr2nDq.js.gz +0 -0
  262. package/studio/chunks/iconify-DR9ryCPv.js +1007 -0
  263. package/studio/chunks/iconify-DR9ryCPv.js.br +0 -0
  264. package/studio/chunks/iconify-DR9ryCPv.js.gz +0 -0
  265. package/studio/chunks/icons-D2MsAaXq.js +183 -0
  266. package/studio/chunks/icons-D2MsAaXq.js.br +0 -0
  267. package/studio/chunks/icons-D2MsAaXq.js.gz +0 -0
  268. package/studio/chunks/leaveGuards-D22fTGgr.js +26 -0
  269. package/studio/chunks/leaveGuards-D22fTGgr.js.br +0 -0
  270. package/studio/chunks/leaveGuards-D22fTGgr.js.gz +0 -0
  271. package/studio/chunks/lucideIcons-EyqyPBsX.js +238 -0
  272. package/studio/chunks/lucideIcons-EyqyPBsX.js.br +0 -0
  273. package/studio/chunks/lucideIcons-EyqyPBsX.js.gz +0 -0
  274. package/studio/chunks/mediaRoute--8cY8rUe.js +17 -0
  275. package/studio/chunks/mediaRoute--8cY8rUe.js.br +0 -0
  276. package/studio/chunks/mediaRoute--8cY8rUe.js.gz +0 -0
  277. package/studio/chunks/newDocumentPlanning-C26DHpvh.js +77 -0
  278. package/studio/chunks/newDocumentPlanning-C26DHpvh.js.br +0 -0
  279. package/studio/chunks/newDocumentPlanning-C26DHpvh.js.gz +0 -0
  280. package/studio/chunks/notifications-OKOLc40v.js +110 -0
  281. package/studio/chunks/notifications-OKOLc40v.js.br +0 -0
  282. package/studio/chunks/notifications-OKOLc40v.js.gz +0 -0
  283. package/studio/chunks/operations-CjNHyrEX.js +57 -0
  284. package/studio/chunks/operations-CjNHyrEX.js.br +0 -0
  285. package/studio/chunks/operations-CjNHyrEX.js.gz +0 -0
  286. package/studio/chunks/overlay-DnqFLZTc.js +1733 -0
  287. package/studio/chunks/overlay-DnqFLZTc.js.br +0 -0
  288. package/studio/chunks/overlay-DnqFLZTc.js.gz +0 -0
  289. package/studio/chunks/presentation-DF83w0hE.js +57 -0
  290. package/studio/chunks/presentation-DF83w0hE.js.br +0 -0
  291. package/studio/chunks/presentation-DF83w0hE.js.gz +0 -0
  292. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js +4557 -0
  293. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.br +0 -0
  294. package/studio/chunks/runtime-core.esm-bundler-DKFA9Rep.js.gz +0 -0
  295. package/studio/chunks/searchPresentation-DFwxQkt3.js +76 -0
  296. package/studio/chunks/searchPresentation-DFwxQkt3.js.br +0 -0
  297. package/studio/chunks/searchPresentation-DFwxQkt3.js.gz +0 -0
  298. package/studio/chunks/status-DQv6ihkU.js +38 -0
  299. package/studio/chunks/status-DQv6ihkU.js.br +0 -0
  300. package/studio/chunks/status-DQv6ihkU.js.gz +0 -0
  301. package/studio/chunks/studioContext-I8HozGU1.js +4953 -0
  302. package/studio/chunks/studioContext-I8HozGU1.js.br +0 -0
  303. package/studio/chunks/studioContext-I8HozGU1.js.gz +0 -0
  304. package/studio/chunks/studioQueries-BR-9NT5F.js +73 -0
  305. package/studio/chunks/studioQueries-BR-9NT5F.js.br +0 -0
  306. package/studio/chunks/studioQueries-BR-9NT5F.js.gz +0 -0
  307. package/studio/chunks/studioSearch-ByaL-QpM.js +1095 -0
  308. package/studio/chunks/studioSearch-ByaL-QpM.js.br +0 -0
  309. package/studio/chunks/studioSearch-ByaL-QpM.js.gz +0 -0
  310. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js +62 -0
  311. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.br +0 -0
  312. package/studio/chunks/useAcknowledgedDraft-0_c9sWI6.js.gz +0 -0
  313. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js +189 -0
  314. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.br +0 -0
  315. package/studio/chunks/useApi-CUWMwLLw-B3Q3g2nf.js.gz +0 -0
  316. package/studio/chunks/useDocumentMessage-BAWvc38w.js +16 -0
  317. package/studio/chunks/useDocumentMessage-BAWvc38w.js.br +3 -0
  318. package/studio/chunks/useDocumentMessage-BAWvc38w.js.gz +0 -0
  319. package/studio/chunks/useFilter-DzyiTR7f.js +87 -0
  320. package/studio/chunks/useFilter-DzyiTR7f.js.br +0 -0
  321. package/studio/chunks/useFilter-DzyiTR7f.js.gz +0 -0
  322. package/studio/chunks/useFormControl-CL7sSCUo.js +8 -0
  323. package/studio/chunks/useFormControl-CL7sSCUo.js.br +0 -0
  324. package/studio/chunks/useFormControl-CL7sSCUo.js.gz +0 -0
  325. package/studio/chunks/useGraceArea-Chcy25IQ.js +154 -0
  326. package/studio/chunks/useGraceArea-Chcy25IQ.js.br +0 -0
  327. package/studio/chunks/useGraceArea-Chcy25IQ.js.gz +0 -0
  328. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js +44 -0
  329. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.br +8 -0
  330. package/studio/chunks/useLeaveConfirmation-_iCSnKEp.js.gz +0 -0
  331. package/studio/chunks/useLinkCopy-CMjQteCy.js +35 -0
  332. package/studio/chunks/useLinkCopy-CMjQteCy.js.br +0 -0
  333. package/studio/chunks/useLinkCopy-CMjQteCy.js.gz +0 -0
  334. package/studio/chunks/usePointerMotion-DwRcwBNQ.js +16 -0
  335. package/studio/chunks/usePointerMotion-DwRcwBNQ.js.br +0 -0
  336. package/studio/chunks/usePointerMotion-DwRcwBNQ.js.gz +0 -0
  337. package/studio/chunks/useStudioNavigation-CLwtSYpb.js +298 -0
  338. package/studio/chunks/useStudioNavigation-CLwtSYpb.js.br +0 -0
  339. package/studio/chunks/useStudioNavigation-CLwtSYpb.js.gz +0 -0
  340. package/studio/chunks/useStudioPages-DR9qmYLg.js +79 -0
  341. package/studio/chunks/useStudioPages-DR9qmYLg.js.br +0 -0
  342. package/studio/chunks/useStudioPages-DR9qmYLg.js.gz +0 -0
  343. package/studio/chunks/utils-mdScC0v0.js +59 -0
  344. package/studio/chunks/utils-mdScC0v0.js.br +0 -0
  345. package/studio/chunks/utils-mdScC0v0.js.gz +0 -0
  346. package/studio/chunks/virtualizer-D1S0bZ4t.js +781 -0
  347. package/studio/chunks/virtualizer-D1S0bZ4t.js.br +0 -0
  348. package/studio/chunks/virtualizer-D1S0bZ4t.js.gz +0 -0
  349. package/studio/help/64f767fe29c2-save-and-publish.svg +7 -0
  350. package/studio/host.css +1 -1
  351. package/studio/host.css.br +0 -0
  352. package/studio/host.css.gz +0 -0
  353. package/studio/host.js +8793 -39395
  354. package/studio/host.js.br +0 -0
  355. package/studio/host.js.gz +0 -0
  356. package/CHANGELOG.md +0 -14
  357. package/bin/cms.mjs +0 -2
  358. package/src/ApplicationTypes.d.ts +0 -84
  359. package/src/ApplicationTypes.js +0 -1
  360. package/src/Configuration-CMweD9bn.js +0 -1191
  361. package/src/Configuration-CMweD9bn.js.map +0 -1
  362. package/src/Configuration.d.ts +0 -82
  363. package/src/Configuration.js +0 -8
  364. package/src/Configuration.js.map +0 -1
  365. package/src/Content.d.ts +0 -68
  366. package/src/Content.js +0 -373
  367. package/src/Content.js.map +0 -1
  368. package/src/ContentTransfer-BxwswWn3.js +0 -86
  369. package/src/ContentTransfer-BxwswWn3.js.map +0 -1
  370. package/src/ContentTransfer-Z9FHyLez.d.ts +0 -72
  371. package/src/DocumentEngine-tYtwbBjr.js +0 -978
  372. package/src/DocumentEngine-tYtwbBjr.js.map +0 -1
  373. package/src/DocumentModel.d.ts +0 -52
  374. package/src/DocumentModel.js +0 -66
  375. package/src/DocumentModel.js.map +0 -1
  376. package/src/Forms-CX-hwmJF.js +0 -391
  377. package/src/Forms-CX-hwmJF.js.map +0 -1
  378. package/src/Forms-CfNPTiCr.js +0 -110
  379. package/src/Forms-CfNPTiCr.js.map +0 -1
  380. package/src/Forms-R0HoTR-o.d.ts +0 -92
  381. package/src/Forms.js.map +0 -1
  382. package/src/HttpPaths-Be3vshPJ.js +0 -20
  383. package/src/HttpPaths-Be3vshPJ.js.map +0 -1
  384. package/src/I18n-wxswIRyY.d.ts +0 -30
  385. package/src/Media-j1bTritO.js +0 -112
  386. package/src/Media-j1bTritO.js.map +0 -1
  387. package/src/Module.js.map +0 -1
  388. package/src/References-CCPDAPve.js +0 -45
  389. package/src/References-CCPDAPve.js.map +0 -1
  390. package/src/S3MediaObjects-BXfjaZOu.js +0 -2756
  391. package/src/S3MediaObjects-BXfjaZOu.js.map +0 -1
  392. package/src/Seo-402YumpT.d.ts +0 -198
  393. package/src/cli/content.js +0 -101
  394. package/src/cli/content.js.map +0 -1
  395. package/src/cli.js.map +0 -1
  396. package/src/connection-BP80q4d-.js +0 -92
  397. package/src/connection-BP80q4d-.js.map +0 -1
  398. package/src/dev-lifecycle-3I_pozUl.js +0 -535
  399. package/src/dev-lifecycle-3I_pozUl.js.map +0 -1
  400. package/src/installation-DxqSSVbH.js +0 -9105
  401. package/src/installation-DxqSSVbH.js.map +0 -1
  402. package/src/internal/application-types.js +0 -43
  403. package/src/internal/application-types.js.map +0 -1
  404. package/src/internal/authoring-catalog.js +0 -158
  405. package/src/internal/authoring-catalog.js.map +0 -1
  406. package/src/internal/authoring-compiler.js +0 -146
  407. package/src/internal/authoring-compiler.js.map +0 -1
  408. package/src/internal/authoring-metadata.js +0 -191
  409. package/src/internal/authoring-metadata.js.map +0 -1
  410. package/src/internal/cms-config.js +0 -45
  411. package/src/internal/cms-config.js.map +0 -1
  412. package/src/internal/configuration.js +0 -228
  413. package/src/internal/configuration.js.map +0 -1
  414. package/src/internal/dev-lifecycle.js +0 -3
  415. package/src/internal/diagnostics.js +0 -47
  416. package/src/internal/diagnostics.js.map +0 -1
  417. package/src/internal/document-model.js +0 -376
  418. package/src/internal/document-model.js.map +0 -1
  419. package/src/internal/field-metadata.js +0 -7
  420. package/src/internal/field-metadata.js.map +0 -1
  421. package/src/internal/form-capabilities.js +0 -12
  422. package/src/internal/form-capabilities.js.map +0 -1
  423. package/src/internal/i18n.js +0 -73
  424. package/src/internal/i18n.js.map +0 -1
  425. package/src/internal/studio-app.js +0 -68
  426. package/src/internal/studio-app.js.map +0 -1
  427. package/src/location-CMNGO3lU.js +0 -35
  428. package/src/location-CMNGO3lU.js.map +0 -1
  429. package/src/metadata-DN9_K6Yl.js +0 -201
  430. package/src/metadata-DN9_K6Yl.js.map +0 -1
  431. package/src/models-5j67LMqW.js +0 -131
  432. package/src/models-5j67LMqW.js.map +0 -1
  433. package/src/models-VmGmG19-.js +0 -628
  434. package/src/models-VmGmG19-.js.map +0 -1
  435. package/src/runtime/api.js.map +0 -1
  436. package/src/runtime/blocks.js +0 -30
  437. package/src/runtime/blocks.js.map +0 -1
  438. package/src/runtime/collaboration.js +0 -45
  439. package/src/runtime/collaboration.js.map +0 -1
  440. package/src/runtime/delivery/DocumentField.js +0 -23
  441. package/src/runtime/delivery/DocumentField.js.map +0 -1
  442. package/src/runtime/delivery/DocumentRenderer.js +0 -61
  443. package/src/runtime/delivery/DocumentRenderer.js.map +0 -1
  444. package/src/runtime/delivery/DocumentScope.js +0 -41
  445. package/src/runtime/delivery/DocumentScope.js.map +0 -1
  446. package/src/runtime/delivery/blocks.js +0 -8
  447. package/src/runtime/delivery/blocks.js.map +0 -1
  448. package/src/runtime/delivery/context.js +0 -12
  449. package/src/runtime/delivery/context.js.map +0 -1
  450. package/src/runtime/delivery/document-page.js +0 -21
  451. package/src/runtime/delivery/document-page.js.map +0 -1
  452. package/src/runtime/delivery/document.js +0 -43
  453. package/src/runtime/delivery/document.js.map +0 -1
  454. package/src/runtime/delivery/error.js +0 -11
  455. package/src/runtime/delivery/error.js.map +0 -1
  456. package/src/runtime/delivery/plugin.js +0 -104
  457. package/src/runtime/delivery/plugin.js.map +0 -1
  458. package/src/runtime/delivery/preview.d.ts +0 -11
  459. package/src/runtime/delivery/preview.js +0 -6
  460. package/src/runtime/delivery/preview.js.map +0 -1
  461. package/src/runtime/delivery/types.d.ts +0 -2
  462. package/src/runtime/delivery/types.js +0 -1
  463. package/src/runtime/delivery/useCmsDocumentSeo.d.ts +0 -67
  464. package/src/runtime/delivery/useCmsDocumentSeo.js.map +0 -1
  465. package/src/runtime/delivery/useDocument.d.ts +0 -6
  466. package/src/runtime/delivery/useDocument.js +0 -23
  467. package/src/runtime/delivery/useDocument.js.map +0 -1
  468. package/src/runtime/delivery/useDocumentQuery.d.ts +0 -7
  469. package/src/runtime/delivery/useDocumentQuery.js +0 -29
  470. package/src/runtime/delivery/useDocumentQuery.js.map +0 -1
  471. package/src/runtime/forms/document.js +0 -38
  472. package/src/runtime/forms/document.js.map +0 -1
  473. package/src/runtime/forms/useCmsForm.js +0 -257
  474. package/src/runtime/forms/useCmsForm.js.map +0 -1
  475. package/src/runtime/i18n/translator.js +0 -58
  476. package/src/runtime/i18n/translator.js.map +0 -1
  477. package/src/runtime/i18n/useCmsI18n.d.ts +0 -13
  478. package/src/runtime/i18n/useCmsI18n.js +0 -38
  479. package/src/runtime/i18n/useCmsI18n.js.map +0 -1
  480. package/src/runtime/installation.js +0 -3
  481. package/src/runtime/plugin.js.map +0 -1
  482. package/src/runtime/preview/CmsStudioPreviewMarker.js +0 -29
  483. package/src/runtime/preview/CmsStudioPreviewMarker.js.map +0 -1
  484. package/src/runtime/preview/comark-document.js +0 -37
  485. package/src/runtime/preview/comark-document.js.map +0 -1
  486. package/src/runtime/preview/connection.js +0 -3
  487. package/src/runtime/preview/controller.js +0 -265
  488. package/src/runtime/preview/controller.js.map +0 -1
  489. package/src/runtime/preview/crypto.js +0 -16
  490. package/src/runtime/preview/crypto.js.map +0 -1
  491. package/src/runtime/preview/overlay.js +0 -122
  492. package/src/runtime/preview/overlay.js.map +0 -1
  493. package/src/runtime/preview/plugin.client.js +0 -68
  494. package/src/runtime/preview/plugin.client.js.map +0 -1
  495. package/src/runtime/preview/preview.css +0 -91
  496. package/src/runtime/preview/protocol.d.ts +0 -16
  497. package/src/runtime/preview/protocol.js +0 -23
  498. package/src/runtime/preview/protocol.js.map +0 -1
  499. package/src/runtime/preview/regions.js +0 -142
  500. package/src/runtime/preview/regions.js.map +0 -1
  501. package/src/runtime/preview/store.js +0 -4
  502. package/src/runtime/sitemap-entries.js +0 -17
  503. package/src/runtime/sitemap-entries.js.map +0 -1
  504. package/src/runtime/sitemap.js +0 -23
  505. package/src/runtime/sitemap.js.map +0 -1
  506. package/src/runtime/studio-app.js +0 -17
  507. package/src/runtime/studio-app.js.map +0 -1
  508. package/src/runtime/studio-document.js +0 -46
  509. package/src/runtime/studio-document.js.map +0 -1
  510. package/src/runtime/studio-entry.js +0 -19
  511. package/src/runtime/studio-entry.js.map +0 -1
  512. package/src/runtime/studio-navigation.js +0 -11
  513. package/src/runtime/studio-navigation.js.map +0 -1
  514. package/src/scalars-CA6kyipS.d.ts +0 -7
  515. package/src/scalars-CVZqT3L0.js +0 -22
  516. package/src/scalars-CVZqT3L0.js.map +0 -1
  517. package/src/store-X1e1o_MF.js +0 -209
  518. package/src/store-X1e1o_MF.js.map +0 -1
  519. package/src/types-DZ0IV-Ow.d.ts +0 -101
  520. package/studio/CreateDocumentDialog-C4_JBo1w.js +0 -335
  521. package/studio/SelectMenu-wXqxymUw.js +0 -34045
  522. package/studio/collaboration-DcK2F6v9.js +0 -4566
  523. package/studio/editor-P2rB7Csp.js +0 -30128
  524. package/studio/rolldown-runtime-Dy4uBu1J.js +0 -11
@@ -0,0 +1,394 @@
1
+ import { i as MediaId, m as mediaPath } from "./Media-DSyvd14o.js";
2
+ import { l as DocumentId } from "./Document-CKXMSEf1.js";
3
+ import { n as ImagePosition, o as imagePlacementStyle, r as ImageZoom } from "./Image-CJWPLnhP.js";
4
+ import { i as editorSchema, n as checkedBody } from "./EditorSchema-wrDv-id6.js";
5
+ import { n as resolveBlockProps, r as responsiveImageSrcSet, t as blockComponentName } from "./rendering-D9LVeEKX.js";
6
+ import { a as encodePreviewSource } from "./PreviewFocus-C_EelZO5.js";
7
+ import { a as blockRenderingKey, n as previewSourceAt } from "./previewRegions-CXjk5cbP.js";
8
+ import { t as previewContextKey } from "./previewContext-dt3ZUh-w.js";
9
+ import { CmsPreviewRegion } from "./runtime/previewSource.js";
10
+ import { n as localeConfigurationKey, t as contentLanguageAttributes } from "./locales-6OD4XGIZ.js";
11
+ import { Schema } from "effect";
12
+ import { Fragment, createCommentVNode, defineComponent, h, inject, onErrorCaptured, resolveComponent, shallowRef } from "vue";
13
+ import { ssrRenderComponent } from "vue/server-renderer";
14
+ //#region src/internal/bodyRendering.ts
15
+ /** Shared website markup for strict delivery and prepared saved-revision nodes. */
16
+ function renderBodyNode(node, children, attributes = {}, inlineParagraph = false, onMediaError) {
17
+ const encoded = attributes["data-cms-source"];
18
+ if (node.isText) {
19
+ let content = node.text ?? "";
20
+ for (const mark of node.marks) {
21
+ if (mark.type.name === "bold") content = h("strong", content);
22
+ if (mark.type.name === "italic") content = h("em", content);
23
+ if (mark.type.name === "strike") content = h("s", content);
24
+ if (mark.type.name === "code") content = h("code", content);
25
+ if (mark.type.name === "link" && Schema.is(Schema.String)(mark.attrs.href)) content = h("a", { href: mark.attrs.href }, content);
26
+ }
27
+ return content;
28
+ }
29
+ if (node.type.name === "image" && Schema.is(MediaId)(node.attrs.mediaId)) {
30
+ const mediaId = node.attrs.mediaId;
31
+ const framed = node.attrs.layout !== "natural";
32
+ const image = {
33
+ src: mediaPath(mediaId),
34
+ srcset: responsiveImageSrcSet(mediaId),
35
+ sizes: node.attrs.layout === "content" ? "(min-width: 768px) 768px, 100vw" : "100vw",
36
+ alt: node.attrs.alt,
37
+ loading: "lazy",
38
+ onError: onMediaError,
39
+ "data-cms-layout": node.attrs.layout
40
+ };
41
+ if (!framed) return h("img", {
42
+ ...image,
43
+ ...attributes,
44
+ class: "my-4 h-auto max-w-full rounded-md object-contain"
45
+ });
46
+ return h("div", {
47
+ ...attributes,
48
+ class: `relative my-4 aspect-video w-full overflow-hidden rounded-md ${node.attrs.layout === "content" ? "max-w-3xl" : ""}`
49
+ }, [h("img", {
50
+ ...image,
51
+ class: "absolute inset-0 size-full max-w-none",
52
+ style: imagePlacementStyle({
53
+ focalX: Schema.is(ImagePosition)(node.attrs.focalX) ? node.attrs.focalX : void 0,
54
+ focalY: Schema.is(ImagePosition)(node.attrs.focalY) ? node.attrs.focalY : void 0,
55
+ zoom: Schema.is(ImageZoom)(node.attrs.zoom) ? node.attrs.zoom : void 0
56
+ })
57
+ })]);
58
+ }
59
+ if (node.type.name === "video" && Schema.is(MediaId)(node.attrs.mediaId)) return h("video", {
60
+ src: mediaPath(node.attrs.mediaId),
61
+ title: node.attrs.title,
62
+ controls: true,
63
+ onError: onMediaError,
64
+ preload: "metadata",
65
+ playsinline: true,
66
+ poster: Schema.is(MediaId)(node.attrs.posterMediaId) ? mediaPath(node.attrs.posterMediaId) : void 0,
67
+ "data-cms-layout": node.attrs.layout,
68
+ ...attributes,
69
+ class: `my-4 block h-auto w-full rounded-lg bg-black ${node.attrs.layout === "full" ? "" : "max-w-3xl"}`
70
+ });
71
+ if (node.type.name === "paragraph") {
72
+ const content = encoded ? [
73
+ createCommentVNode(`cms-source:${encoded}:start`),
74
+ ...children,
75
+ createCommentVNode(`cms-source:${encoded}:end`)
76
+ ] : children;
77
+ return inlineParagraph ? h(Fragment, null, content) : h("p", attributes, content);
78
+ }
79
+ if (node.type.name === "heading") return h(`h${node.attrs.level}`, attributes, children);
80
+ if (node.type.name === "blockquote") return h("blockquote", {
81
+ ...attributes,
82
+ class: "my-4 border-s-2 border-default ps-4 italic"
83
+ }, children);
84
+ if (node.type.name === "bulletList") return h("ul", {
85
+ ...attributes,
86
+ class: "my-4 list-disc ps-6"
87
+ }, children);
88
+ if (node.type.name === "orderedList") return h("ol", {
89
+ ...attributes,
90
+ start: node.attrs.start,
91
+ class: "my-4 list-decimal ps-6"
92
+ }, children);
93
+ if (node.type.name === "listItem") return h("li", attributes, children);
94
+ if (node.type.name === "codeBlock") return h("pre", {
95
+ ...attributes,
96
+ class: "my-4 overflow-x-auto rounded-md bg-muted px-4 py-3"
97
+ }, [h("code", children)]);
98
+ if (node.type.name === "horizontalRule") return h("hr", {
99
+ ...attributes,
100
+ class: "my-6 border-default"
101
+ });
102
+ if (node.type.name === "hardBreak") return h("br");
103
+ return h("span", children);
104
+ }
105
+ //#endregion
106
+ //#region src/runtime/internal/RevisionRenderGuard.ts
107
+ async function unroll(buffer) {
108
+ const parts = await buffer;
109
+ const output = [];
110
+ for (const part of parts) output.push(Schema.is(Schema.String)(part) ? part : await unroll(part));
111
+ return output.join("");
112
+ }
113
+ const FragmentContent = defineComponent({
114
+ props: { read: {
115
+ type: Function,
116
+ required: true
117
+ } },
118
+ setup: (props) => () => props.read()
119
+ });
120
+ /** Buffer one saved region before sending HTML; Vue client error capture alone cannot recover SSR. */
121
+ var RevisionRenderGuard_default = defineComponent({
122
+ name: "CmsRevisionRenderGuard",
123
+ props: {
124
+ content: {
125
+ type: Function,
126
+ required: true
127
+ },
128
+ fallback: {
129
+ type: Function,
130
+ required: true
131
+ },
132
+ onFailed: {
133
+ type: Function,
134
+ required: true
135
+ },
136
+ initiallyFailed: Boolean
137
+ },
138
+ setup(props) {
139
+ const failed = shallowRef(props.initiallyFailed);
140
+ function fail() {
141
+ failed.value = true;
142
+ props.onFailed();
143
+ }
144
+ onErrorCaptured(() => {
145
+ fail();
146
+ return false;
147
+ });
148
+ return {
149
+ failed,
150
+ fail
151
+ };
152
+ },
153
+ render() {
154
+ return h(FragmentContent, { read: this.failed ? this.fallback : this.content });
155
+ },
156
+ ssrRender(context, push, parent) {
157
+ if (import.meta.server === false) return;
158
+ push((async () => {
159
+ if (!context.failed) try {
160
+ const html = await unroll(ssrRenderComponent(FragmentContent, { read: context.content }, null, parent));
161
+ if (!context.failed) return [html];
162
+ } catch {
163
+ context.fail();
164
+ }
165
+ return [await unroll(ssrRenderComponent(FragmentContent, { read: context.fallback }, null, parent))];
166
+ })());
167
+ }
168
+ });
169
+ //#endregion
170
+ //#region src/runtime/internal/RevisionRenderer.ts
171
+ const MediaNode = defineComponent({
172
+ props: { value: {
173
+ type: Object,
174
+ required: true
175
+ } },
176
+ setup(props) {
177
+ const failed = shallowRef(false);
178
+ return () => failed.value ? h("p", {
179
+ role: "note",
180
+ class: "my-4 text-muted"
181
+ }, "This saved media is unavailable.") : renderBodyNode(editorSchema.nodeFromJSON(props.value.node), [], {}, false, () => {
182
+ failed.value = true;
183
+ });
184
+ }
185
+ });
186
+ function plainValue(value) {
187
+ return Schema.is(Schema.String)(value) ? value : JSON.stringify(value, null, 2);
188
+ }
189
+ var RevisionRenderer_default = defineComponent({
190
+ name: "CmsRevisionRenderer",
191
+ props: { value: {
192
+ type: Object,
193
+ required: true
194
+ } },
195
+ setup(props) {
196
+ const blocks = inject(blockRenderingKey, /* @__PURE__ */ new Map());
197
+ return () => {
198
+ const value = props.value;
199
+ const plan = value.renderPlan;
200
+ if (!plan) return null;
201
+ const failures = value.renderFailures ??= [];
202
+ const forms = new Map(value.forms?.map((form) => [form.blockId, form]));
203
+ function guard(id, content, fallback) {
204
+ return h(RevisionRenderGuard_default, {
205
+ key: id,
206
+ content,
207
+ fallback,
208
+ initiallyFailed: failures.includes(id),
209
+ onFailed: () => {
210
+ if (!failures.includes(id)) failures.push(id);
211
+ }
212
+ });
213
+ }
214
+ function render(node, mode = "current", inline = false) {
215
+ if (node.kind === "placeholder") return h("p", {
216
+ role: "note",
217
+ class: "text-muted"
218
+ }, node.label);
219
+ if (node.kind === "fallback") {
220
+ const children = node.children.map((child) => render(child, mode, inline));
221
+ return h(Fragment, mode === "readable" ? [node.text, ...children] : [
222
+ h("span", { class: "text-sm text-muted" }, node.label),
223
+ node.text ? h("span", { class: "whitespace-pre-wrap wrap-break-word" }, node.text) : null,
224
+ ...children
225
+ ]);
226
+ }
227
+ if (node.kind === "node") {
228
+ if (node.node.type === "image" || node.node.type === "video") return h(MediaNode, { value: node });
229
+ return renderBodyNode(editorSchema.nodeFromJSON(node.node), node.children.map((child) => render(child, mode)), {}, inline);
230
+ }
231
+ if (mode === "readable") return h("section", { class: "my-4 space-y-3" }, [
232
+ h("p", { class: "text-sm text-muted" }, "Saved content"),
233
+ Object.keys(node.props).length ? h("pre", { class: "whitespace-pre-wrap wrap-break-word text-sm" }, plainValue(node.props)) : null,
234
+ ...node.slots.flatMap((slot) => slot.children.map((child) => render(child, mode)))
235
+ ]);
236
+ const component = resolveComponent(blockComponentName(node.name));
237
+ if (Schema.is(Schema.String)(component)) return render(node, "readable");
238
+ return guard(node.id, () => {
239
+ const slots = Object.fromEntries(node.slots.map((slot) => [slot.name, () => slot.children.map((child) => render(child, mode, blocks.get(node.name)?.inlineSlots.has(slot.name)))]));
240
+ const form = forms.get(node.id);
241
+ const properties = resolveBlockProps(node.props, node.id, value.referencePaths, blocks.get(node.name)?.definition.fields ?? []);
242
+ return h(component, Object.assign({}, properties, form ? { cmsForm: form } : void 0), slots);
243
+ }, () => render(node, "readable"));
244
+ }
245
+ const title = value.source.fields.title;
246
+ const heading = () => Schema.is(Schema.String)(title) ? h("h1", title) : null;
247
+ const fields = () => h("dl", { class: "my-4 space-y-3" }, Object.entries(plan.fields.values).filter(([name]) => name !== "title").flatMap(([name, field]) => [h("dt", { class: "font-medium" }, name), h("dd", { class: "whitespace-pre-wrap wrap-break-word" }, plainValue(field))]));
248
+ return h("article", { "data-cms-document": value.identity.documentId }, [guard("document", () => h(Fragment, [
249
+ heading(),
250
+ plan.fields.mode === "readable" ? fields() : null,
251
+ ...plan.body.map((node) => render(node))
252
+ ]), () => h(Fragment, [
253
+ heading(),
254
+ fields(),
255
+ ...plan.body.map((node) => render(node, "readable"))
256
+ ]))]);
257
+ };
258
+ }
259
+ });
260
+ //#endregion
261
+ //#region src/runtime/DocumentRenderer.ts
262
+ var DocumentRenderer_default = defineComponent({
263
+ name: "CmsDocumentRenderer",
264
+ props: {
265
+ value: { type: Object },
266
+ source: { type: Object },
267
+ documentId: { type: String },
268
+ forms: { type: Array },
269
+ formBlockNames: { type: Array },
270
+ referencePaths: { type: Object },
271
+ previewFocus: {
272
+ type: Boolean,
273
+ default: void 0
274
+ }
275
+ },
276
+ emits: { focusTarget: (_target) => true },
277
+ setup(props, { emit }) {
278
+ const preview = inject(previewContextKey, null);
279
+ const blocks = inject(blockRenderingKey, /* @__PURE__ */ new Map());
280
+ const locales = inject(localeConfigurationKey, void 0);
281
+ return () => {
282
+ const value = props.value;
283
+ const source = props.source ?? (value && value.source);
284
+ if (!source) return null;
285
+ const language = contentLanguageAttributes(value?.locale, locales);
286
+ if (value?.renderPlan) return h(RevisionRenderer_default, {
287
+ value,
288
+ ...language
289
+ });
290
+ const document = checkedBody(source.body);
291
+ const title = source.fields.title;
292
+ const focus = props.previewFocus ?? preview?.mapped.value ?? false;
293
+ const id = props.documentId ?? (value && value.identity.documentId);
294
+ const documentId = Schema.is(DocumentId)(id) ? id : void 0;
295
+ const children = [];
296
+ const deliveredForms = props.forms ?? props.value?.forms ?? [];
297
+ const forms = new Map(deliveredForms.map((form) => [form.blockId, form]));
298
+ const formBlockNames = new Set(props.formBlockNames ?? deliveredForms.map((form) => form.name));
299
+ const referencePaths = props.referencePaths ?? props.value?.referencePaths ?? {};
300
+ const context = {
301
+ blocks,
302
+ forms,
303
+ formBlockNames,
304
+ referencePaths,
305
+ preview: focus && documentId ? {
306
+ documentId,
307
+ sources: preview?.sources
308
+ } : null
309
+ };
310
+ document.forEach((node, _offset, index) => children.push(renderNode(node, [index], context)));
311
+ return h("article", {
312
+ ...language,
313
+ "data-cms-document": id,
314
+ "data-cms-source": focus && documentId ? encodePreviewSource({
315
+ documentId,
316
+ target: { kind: "document" },
317
+ approximate: true
318
+ }) : void 0,
319
+ onClick: focus ? (event) => {
320
+ if (!(event.target instanceof Element)) return;
321
+ const article = event.currentTarget;
322
+ const selected = article instanceof Element ? previewSourceAt(article, event.target) : null;
323
+ if (!selected) return;
324
+ event.preventDefault();
325
+ event.stopPropagation();
326
+ emit("focusTarget", selected.target);
327
+ } : void 0
328
+ }, [Schema.is(Schema.String)(title) ? h("h1", focus ? { "data-cms-source": documentId ? encodePreviewSource({
329
+ documentId,
330
+ target: { kind: "title" },
331
+ approximate: false
332
+ }) : void 0 } : {}, title) : void 0, ...children]);
333
+ };
334
+ }
335
+ });
336
+ function renderNode(node, path, context, containingBlockId, inlineParagraph = false) {
337
+ const { forms, formBlockNames, referencePaths, preview } = context;
338
+ const target = {
339
+ kind: "body",
340
+ path
341
+ };
342
+ if (Schema.is(Schema.NonEmptyString)(node.attrs.id)) Object.assign(target, { nodeId: node.attrs.id });
343
+ if (containingBlockId) Object.assign(target, { blockId: containingBlockId });
344
+ const source = preview ? {
345
+ documentId: preview.documentId,
346
+ target,
347
+ approximate: false
348
+ } : null;
349
+ const attributes = { "data-cms-source": source ? encodePreviewSource(source) : void 0 };
350
+ if (node.isText) return renderBodyNode(node, [], attributes);
351
+ if (node.type.name === "cmsBlock") {
352
+ const name = node.attrs.name;
353
+ const blockId = String(node.attrs.id);
354
+ const component = resolveComponent(blockComponentName(Schema.is(Schema.String)(name) ? name : ""));
355
+ const blockProps = Schema.is(Schema.JsonObject)(node.attrs.props) ? node.attrs.props : {};
356
+ const block = context.blocks.get(String(name));
357
+ const slots = {};
358
+ node.forEach((region, _offset, regionIndex) => {
359
+ const slotName = region.attrs.name;
360
+ if (!Schema.is(Schema.String)(slotName)) return;
361
+ const inlineParagraph = block?.inlineSlots.has(slotName) ?? false;
362
+ slots[slotName] = () => {
363
+ const children = [];
364
+ region.forEach((child, _offset, childIndex) => children.push(renderNode(child, [
365
+ ...path,
366
+ regionIndex,
367
+ childIndex
368
+ ], context, blockId, inlineParagraph)));
369
+ return children;
370
+ };
371
+ });
372
+ const resolvedProps = resolveBlockProps(blockProps, blockId, referencePaths, block?.definition.fields ?? []);
373
+ const componentProps = Object.assign({}, resolvedProps);
374
+ if (formBlockNames.has(name)) componentProps.cmsForm = forms.get(blockId);
375
+ const properties = preview ? preview.sources?.block(resolvedProps, String(name), blockId, preview.documentId) ?? {} : {};
376
+ const blockSource = preview ? {
377
+ documentId: preview.documentId,
378
+ target: {
379
+ kind: "block",
380
+ blockId
381
+ },
382
+ approximate: false
383
+ } : null;
384
+ return preview ? h(CmsPreviewRegion, {
385
+ source: blockSource,
386
+ properties
387
+ }, { default: () => [h(component, componentProps, slots)] }) : h(component, componentProps, slots);
388
+ }
389
+ const children = [];
390
+ node.forEach((child, _offset, childIndex) => children.push(renderNode(child, [...path, childIndex], context, containingBlockId)));
391
+ return renderBodyNode(node, children, attributes, inlineParagraph);
392
+ }
393
+ //#endregion
394
+ export { DocumentRenderer_default as t };
@@ -0,0 +1,296 @@
1
+ import { _ as canonicalContent } from "./Seo-CjNUtUkj.js";
2
+ import { i as MediaId, m as mediaPath, o as MediaLayout } from "./Media-DSyvd14o.js";
3
+ import { _ as DocumentSource, r as DocumentBody } from "./Document-CKXMSEf1.js";
4
+ import { n as safeLinkHref } from "./Links-CJYyy7rC.js";
5
+ import { n as ImagePosition, r as ImageZoom } from "./Image-CJWPLnhP.js";
6
+ import { Schema } from "effect";
7
+ import { Schema as Schema$1 } from "@tiptap/pm/model";
8
+ import { Transform } from "@tiptap/pm/transform";
9
+ //#region ../model/src/EditorSchema.ts
10
+ /** The durable body schema shared by Studio, collaboration, and publication. */
11
+ const editorSchema = new Schema$1({
12
+ nodes: {
13
+ doc: { content: "block+" },
14
+ paragraph: {
15
+ attrs: { id: { default: null } },
16
+ group: "block",
17
+ content: "inline*",
18
+ parseDOM: [{ tag: "p" }],
19
+ toDOM: () => ["p", 0]
20
+ },
21
+ heading: {
22
+ attrs: {
23
+ id: { default: null },
24
+ level: { default: 2 }
25
+ },
26
+ group: "block",
27
+ content: "inline*",
28
+ parseDOM: [
29
+ {
30
+ tag: "h1",
31
+ attrs: { level: 1 }
32
+ },
33
+ {
34
+ tag: "h2",
35
+ attrs: { level: 2 }
36
+ },
37
+ {
38
+ tag: "h3",
39
+ attrs: { level: 3 }
40
+ }
41
+ ],
42
+ toDOM: (node) => [`h${node.attrs.level}`, 0]
43
+ },
44
+ blockquote: {
45
+ attrs: { id: { default: null } },
46
+ group: "block",
47
+ content: "block+",
48
+ parseDOM: [{ tag: "blockquote" }],
49
+ toDOM: () => ["blockquote", 0]
50
+ },
51
+ bulletList: {
52
+ group: "block",
53
+ content: "listItem+",
54
+ attrs: { id: { default: null } },
55
+ parseDOM: [{ tag: "ul" }],
56
+ toDOM: () => ["ul", 0]
57
+ },
58
+ orderedList: {
59
+ group: "block",
60
+ content: "listItem+",
61
+ attrs: {
62
+ id: { default: null },
63
+ start: { default: 1 }
64
+ },
65
+ parseDOM: [{
66
+ tag: "ol",
67
+ getAttrs: (element) => ({ start: Number(element.getAttribute("start") ?? 1) })
68
+ }],
69
+ toDOM: (node) => [
70
+ "ol",
71
+ { start: node.attrs.start },
72
+ 0
73
+ ]
74
+ },
75
+ listItem: {
76
+ content: "paragraph block*",
77
+ attrs: { id: { default: null } },
78
+ parseDOM: [{ tag: "li" }],
79
+ toDOM: () => ["li", 0]
80
+ },
81
+ codeBlock: {
82
+ group: "block",
83
+ content: "text*",
84
+ marks: "",
85
+ code: true,
86
+ attrs: {
87
+ id: { default: null },
88
+ language: { default: null }
89
+ },
90
+ parseDOM: [{ tag: "pre" }],
91
+ toDOM: () => ["pre", ["code", 0]]
92
+ },
93
+ horizontalRule: {
94
+ group: "block",
95
+ atom: true,
96
+ attrs: { id: { default: null } },
97
+ parseDOM: [{ tag: "hr" }],
98
+ toDOM: () => ["hr"]
99
+ },
100
+ hardBreak: {
101
+ group: "inline",
102
+ inline: true,
103
+ selectable: false,
104
+ parseDOM: [{ tag: "br" }],
105
+ toDOM: () => ["br"]
106
+ },
107
+ cmsBlock: {
108
+ group: "block",
109
+ content: "cmsSlot*",
110
+ attrs: {
111
+ id: {},
112
+ name: {},
113
+ props: { default: {} }
114
+ },
115
+ toDOM: (node) => [
116
+ "section",
117
+ { "data-cms-block": node.attrs.name },
118
+ 0
119
+ ]
120
+ },
121
+ cmsSlot: {
122
+ content: "block*",
123
+ attrs: { name: {} },
124
+ toDOM: (node) => [
125
+ "div",
126
+ { "data-cms-slot": node.attrs.name },
127
+ 0
128
+ ]
129
+ },
130
+ image: {
131
+ group: "block",
132
+ atom: true,
133
+ attrs: {
134
+ id: { default: null },
135
+ mediaId: {},
136
+ alt: { default: "" },
137
+ layout: { default: "natural" },
138
+ focalX: { default: null },
139
+ focalY: { default: null },
140
+ zoom: { default: null }
141
+ },
142
+ toDOM: (node) => ["img", {
143
+ src: mediaPath(node.attrs.mediaId),
144
+ alt: node.attrs.alt
145
+ }]
146
+ },
147
+ video: {
148
+ group: "block",
149
+ atom: true,
150
+ attrs: {
151
+ id: { default: null },
152
+ mediaId: {},
153
+ title: { default: "" },
154
+ layout: { default: "content" },
155
+ posterMediaId: { default: null }
156
+ },
157
+ toDOM: (node) => ["video", {
158
+ src: mediaPath(node.attrs.mediaId),
159
+ controls: "controls"
160
+ }]
161
+ },
162
+ text: { group: "inline" }
163
+ },
164
+ marks: {
165
+ bold: {
166
+ parseDOM: [{ tag: "strong" }],
167
+ toDOM: () => ["strong", 0]
168
+ },
169
+ italic: {
170
+ parseDOM: [{ tag: "em" }],
171
+ toDOM: () => ["em", 0]
172
+ },
173
+ strike: {
174
+ parseDOM: [{ tag: "s" }],
175
+ toDOM: () => ["s", 0]
176
+ },
177
+ code: {
178
+ code: true,
179
+ parseDOM: [{ tag: "code" }],
180
+ toDOM: () => ["code", 0]
181
+ },
182
+ link: {
183
+ attrs: { href: {} },
184
+ inclusive: false,
185
+ parseDOM: [{
186
+ tag: "a[href]",
187
+ getAttrs: (element) => ({ href: element.getAttribute("href") })
188
+ }],
189
+ toDOM: (mark) => [
190
+ "a",
191
+ { href: mark.attrs.href },
192
+ 0
193
+ ]
194
+ }
195
+ }
196
+ });
197
+ function checkedBody(body) {
198
+ const document = editorSchema.nodeFromJSON(body);
199
+ document.check();
200
+ document.descendants((node) => {
201
+ if (node.type.name === "heading" && ![
202
+ 1,
203
+ 2,
204
+ 3
205
+ ].includes(node.attrs.level)) throw new Error("Body heading has an unsupported level.");
206
+ if (node.type.name === "orderedList" && (!Number.isSafeInteger(node.attrs.start) || node.attrs.start < 1 || node.attrs.start > 1e6)) throw new Error("Body numbered list has an invalid start.");
207
+ if (node.type.name === "image" || node.type.name === "video") {
208
+ if (!Schema.is(MediaId)(node.attrs.mediaId)) throw new Error("Body media needs a valid asset ID.");
209
+ if (!Schema.is(MediaLayout)(node.attrs.layout)) throw new Error("Body media needs a valid layout.");
210
+ if (node.type.name === "image" && !Schema.is(Schema.String)(node.attrs.alt)) throw new Error("Body image needs alternative text or an empty decorative description.");
211
+ if (node.type.name === "image") {
212
+ if (node.attrs.focalX !== null && !Schema.is(ImagePosition)(node.attrs.focalX) || node.attrs.focalY !== null && !Schema.is(ImagePosition)(node.attrs.focalY) || node.attrs.zoom !== null && !Schema.is(ImageZoom)(node.attrs.zoom)) throw new Error("Body image has invalid framing values.");
213
+ }
214
+ if (node.type.name === "video" && !Schema.is(Schema.String)(node.attrs.title)) throw new Error("Body video needs a title.");
215
+ if (node.type.name === "video" && node.attrs.posterMediaId !== null && !Schema.is(MediaId)(node.attrs.posterMediaId)) throw new Error("Body video poster needs a valid image asset ID.");
216
+ }
217
+ for (const mark of node.marks) {
218
+ if (mark.type.name !== "link") continue;
219
+ const href = mark.attrs.href;
220
+ if (!Schema.is(Schema.String)(href) || !safeLinkHref(href)) throw new Error("Document link has an unsafe URL.");
221
+ }
222
+ });
223
+ return document;
224
+ }
225
+ /** Seed missing identity once, without a browser opening the document producing an edit. */
226
+ function withBodyNodeIds(body) {
227
+ const document = checkedBody(body);
228
+ const transaction = new Transform(document);
229
+ const reserved = /* @__PURE__ */ new Set();
230
+ const seen = /* @__PURE__ */ new Set();
231
+ document.descendants((node) => {
232
+ if (Schema.is(Schema.NonEmptyString)(node.attrs.id)) reserved.add(node.attrs.id);
233
+ });
234
+ document.descendants((node, position) => {
235
+ if (!Object.hasOwn(node.attrs, "id")) return;
236
+ const id = node.attrs.id;
237
+ if (Schema.is(Schema.NonEmptyString)(id) && !seen.has(id)) {
238
+ seen.add(id);
239
+ return;
240
+ }
241
+ let initial = `initial:${position}`;
242
+ let suffix = 0;
243
+ while (reserved.has(initial)) initial = `initial:${position}:${++suffix}`;
244
+ reserved.add(initial);
245
+ seen.add(initial);
246
+ transaction.setNodeMarkup(position, void 0, {
247
+ ...node.attrs,
248
+ id: initial
249
+ });
250
+ });
251
+ return transaction.doc;
252
+ }
253
+ /** Schema defaults and initial body identity do not constitute an authored change. */
254
+ function sameDocumentSource(left, right) {
255
+ if (canonicalContent(left) === canonicalContent(right)) return true;
256
+ const normalize = (source) => {
257
+ const normalized = Object.assign({}, source, { body: withBodyNodeIds(source.body).toJSON() });
258
+ if (source.translations) Object.assign(normalized, { translations: Object.fromEntries(Object.entries(source.translations).map(([locale, content]) => [locale, Object.assign({}, content, { body: withBodyNodeIds(content.body).toJSON() })])) });
259
+ return Schema.encodeSync(DocumentSource)(normalized);
260
+ };
261
+ return canonicalContent(normalize(left)) === canonicalContent(normalize(right));
262
+ }
263
+ function sameDocumentContent(left, right) {
264
+ const settings = { placement: { kind: "home" } };
265
+ return sameDocumentSource(Object.assign({}, left, { settings }), Object.assign({}, right, { settings }));
266
+ }
267
+ function bodyMediaReferences(body) {
268
+ const references = [];
269
+ checkedBody(body).descendants((node, position) => {
270
+ if ((node.type.name === "image" || node.type.name === "video") && Schema.is(MediaId)(node.attrs.mediaId)) references.push({
271
+ mediaId: node.attrs.mediaId,
272
+ kind: node.type.name,
273
+ path: `body.${position}`
274
+ });
275
+ if (node.type.name === "video" && Schema.is(MediaId)(node.attrs.posterMediaId)) references.push({
276
+ mediaId: node.attrs.posterMediaId,
277
+ kind: "image",
278
+ path: `body.${position}.poster`
279
+ });
280
+ });
281
+ return references;
282
+ }
283
+ /** Independent copies retain content and references, while renewing authoring identities. */
284
+ function copyDocumentBody(body, nextId) {
285
+ const document = checkedBody(body);
286
+ const transaction = new Transform(document);
287
+ document.descendants((node, position) => {
288
+ if (Object.hasOwn(node.attrs, "id")) transaction.setNodeMarkup(position, void 0, {
289
+ ...node.attrs,
290
+ id: nextId()
291
+ });
292
+ });
293
+ return Schema.decodeUnknownSync(DocumentBody)(transaction.doc.toJSON());
294
+ }
295
+ //#endregion
296
+ export { sameDocumentContent as a, editorSchema as i, checkedBody as n, sameDocumentSource as o, copyDocumentBody as r, withBodyNodeIds as s, bodyMediaReferences as t };