emdash 0.36.0 → 0.38.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 (991) hide show
  1. package/dist/{activation-K0kGBWuJ.mjs → activation-DyNTe_Tl.mjs} +3 -3
  2. package/dist/{activation-K0kGBWuJ.mjs.map → activation-DyNTe_Tl.mjs.map} +1 -1
  3. package/dist/{adapters-CzL3H752.d.mts → adapters-DCEgOBXi.d.mts} +4 -2
  4. package/dist/{adapters-CzL3H752.d.mts.map → adapters-DCEgOBXi.d.mts.map} +1 -1
  5. package/dist/{allowed-origins-maylGaHv.mjs → allowed-origins-GFUVavRj.mjs} +2 -2
  6. package/dist/{allowed-origins-maylGaHv.mjs.map → allowed-origins-GFUVavRj.mjs.map} +1 -1
  7. package/dist/api/route-utils.d.mts +3 -3
  8. package/dist/api/route-utils.mjs +25 -24
  9. package/dist/api/route-utils.mjs.map +1 -1
  10. package/dist/api/schemas/index.d.mts +2 -2
  11. package/dist/api/schemas/index.mjs +5 -5
  12. package/dist/api-BvxJmnFY.mjs +10094 -0
  13. package/dist/api-BvxJmnFY.mjs.map +1 -0
  14. package/dist/{api-tokens-9YrrCoE6.mjs → api-tokens-xpGqMHrC.mjs} +2 -2
  15. package/dist/{api-tokens-9YrrCoE6.mjs.map → api-tokens-xpGqMHrC.mjs.map} +1 -1
  16. package/dist/{apply-B_VMpJ2P.mjs → apply-DLmM3R7f.mjs} +26 -22
  17. package/dist/apply-DLmM3R7f.mjs.map +1 -0
  18. package/dist/artifact-fetch-P2JXVwOq.mjs +972 -0
  19. package/dist/artifact-fetch-P2JXVwOq.mjs.map +1 -0
  20. package/dist/astro/image-endpoint.mjs +2 -2
  21. package/dist/astro/image-endpoint.mjs.map +1 -1
  22. package/dist/astro/index.d.mts +12 -12
  23. package/dist/astro/index.d.mts.map +1 -1
  24. package/dist/astro/index.mjs +138 -39
  25. package/dist/astro/index.mjs.map +1 -1
  26. package/dist/astro/middleware/auth.d.mts +10 -10
  27. package/dist/astro/middleware/auth.mjs +6 -6
  28. package/dist/astro/middleware/media-usage-write-fence.mjs +3 -3
  29. package/dist/astro/middleware/redirect.mjs +7 -5
  30. package/dist/astro/middleware/redirect.mjs.map +1 -1
  31. package/dist/astro/middleware/request-context.mjs +3 -3
  32. package/dist/astro/middleware/setup.mjs +1 -1
  33. package/dist/astro/middleware.d.mts +10 -10
  34. package/dist/astro/middleware.d.mts.map +1 -1
  35. package/dist/astro/middleware.mjs +223 -232
  36. package/dist/astro/middleware.mjs.map +1 -1
  37. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
  38. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
  39. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
  40. package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -1
  41. package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
  42. package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
  43. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  44. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
  45. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
  46. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
  47. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -17
  48. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -17
  49. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -17
  50. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +13 -13
  51. package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
  52. package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
  53. package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
  54. package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
  55. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
  56. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  57. package/dist/astro/routes/api/admin/media-usage/activation.mjs +13 -13
  58. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +15 -15
  59. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +15 -15
  60. package/dist/astro/routes/api/admin/media-usage/progress.mjs +14 -14
  61. package/dist/astro/routes/api/admin/media-usage/repair.mjs +17 -17
  62. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +15 -15
  63. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +15 -15
  64. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
  65. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
  66. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
  67. package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
  68. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +59 -56
  69. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
  70. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +59 -56
  71. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
  72. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +57 -54
  73. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  74. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
  75. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +57 -54
  76. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  77. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +58 -55
  78. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +58 -55
  80. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  81. package/dist/astro/routes/api/admin/plugins/index.mjs +57 -54
  82. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  83. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  84. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +57 -54
  85. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +58 -55
  87. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +57 -54
  89. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +58 -55
  91. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  92. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
  93. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +64 -57
  94. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +18 -16
  96. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
  98. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +65 -58
  99. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  100. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
  101. package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
  102. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +96 -0
  103. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
  104. package/dist/astro/routes/api/admin/plugins/updates.mjs +57 -54
  105. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  106. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +57 -54
  107. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  108. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  109. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +57 -54
  110. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  111. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
  112. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  113. package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
  114. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  115. package/dist/astro/routes/api/admin/users/index.mjs +6 -6
  116. package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
  117. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  118. package/dist/astro/routes/api/auth/invite/complete.mjs +11 -11
  119. package/dist/astro/routes/api/auth/invite/index.mjs +8 -8
  120. package/dist/astro/routes/api/auth/invite/register-options.mjs +10 -10
  121. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  122. package/dist/astro/routes/api/auth/magic-link/send.mjs +10 -10
  123. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  124. package/dist/astro/routes/api/auth/me.mjs +7 -7
  125. package/dist/astro/routes/api/auth/mode.mjs +2 -2
  126. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
  127. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  128. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
  129. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  130. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -12
  131. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -10
  132. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -11
  133. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -11
  134. package/dist/astro/routes/api/auth/signup/complete.mjs +11 -11
  135. package/dist/astro/routes/api/auth/signup/request.mjs +10 -10
  136. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  137. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  138. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +13 -13
  139. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  140. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -1
  141. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +19 -5
  142. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
  143. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
  144. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
  145. package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
  146. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +66 -0
  147. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
  148. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
  149. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
  150. package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -1
  151. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +18 -10
  152. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
  153. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +20 -18
  154. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
  155. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +20 -18
  156. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
  157. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
  158. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  159. package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -1
  160. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +15 -8
  161. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
  162. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -15
  163. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
  164. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  165. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
  166. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +19 -5
  167. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
  168. package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
  169. package/dist/astro/routes/api/content/_collection_/_id_.mjs +23 -11
  170. package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
  171. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  172. package/dist/astro/routes/api/content/_collection_/index.mjs +14 -9
  173. package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
  174. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
  175. package/dist/astro/routes/api/dashboard.mjs +8 -8
  176. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  177. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  178. package/dist/astro/routes/api/import/probe.mjs +18 -18
  179. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  180. package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
  181. package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -14
  182. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  183. package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
  184. package/dist/astro/routes/api/import/wordpress/media.mjs +11 -11
  185. package/dist/astro/routes/api/import/wordpress/prepare.mjs +10 -10
  186. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
  187. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +13 -13
  188. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  189. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +18 -18
  190. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
  191. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +29 -28
  192. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  193. package/dist/astro/routes/api/manifest.mjs +4 -4
  194. package/dist/astro/routes/api/manifest.mjs.map +1 -1
  195. package/dist/astro/routes/api/mcp.mjs +213 -74
  196. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  197. package/dist/astro/routes/api/media/_id_/confirm.mjs +11 -11
  198. package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
  199. package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
  200. package/dist/astro/routes/api/media/_id_/replace.mjs +91 -0
  201. package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
  202. package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
  203. package/dist/astro/routes/api/media/_id_/usage.mjs +19 -19
  204. package/dist/astro/routes/api/media/_id_.mjs +18 -18
  205. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
  206. package/dist/astro/routes/api/media/file/_...key_.mjs +3 -2
  207. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
  208. package/dist/astro/routes/api/media/folders/_id_.mjs +8 -8
  209. package/dist/astro/routes/api/media/folders/index.mjs +8 -8
  210. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  211. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  212. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  213. package/dist/astro/routes/api/media/upload-url.mjs +16 -14
  214. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  215. package/dist/astro/routes/api/media.d.mts.map +1 -1
  216. package/dist/astro/routes/api/media.mjs +53 -30
  217. package/dist/astro/routes/api/media.mjs.map +1 -1
  218. package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -1
  219. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +20 -13
  220. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  221. package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -1
  222. package/dist/astro/routes/api/menus/_name_/items.mjs +15 -11
  223. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  224. package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -1
  225. package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -11
  226. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  227. package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -1
  228. package/dist/astro/routes/api/menus/_name_/translations.mjs +16 -12
  229. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  230. package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -1
  231. package/dist/astro/routes/api/menus/_name_.mjs +21 -14
  232. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  233. package/dist/astro/routes/api/menus/index.d.mts.map +1 -1
  234. package/dist/astro/routes/api/menus/index.mjs +15 -11
  235. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  236. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  237. package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
  238. package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
  239. package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
  240. package/dist/astro/routes/api/oauth/register.mjs +2 -2
  241. package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
  242. package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
  243. package/dist/astro/routes/api/oauth/token.mjs +5 -5
  244. package/dist/astro/routes/api/openapi.json.mjs +184 -52
  245. package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
  246. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
  247. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
  248. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  249. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
  250. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  251. package/dist/astro/routes/api/redirects/_id_.mjs +13 -12
  252. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  253. package/dist/astro/routes/api/redirects/index.mjs +13 -12
  254. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  255. package/dist/astro/routes/api/relations/_id_/index.mjs +20 -18
  256. package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
  257. package/dist/astro/routes/api/relations/_id_/translations.mjs +15 -13
  258. package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
  259. package/dist/astro/routes/api/relations/index.mjs +20 -18
  260. package/dist/astro/routes/api/relations/index.mjs.map +1 -1
  261. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  262. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
  263. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +57 -54
  264. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  265. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +57 -54
  266. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  267. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +57 -54
  268. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  269. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +57 -54
  270. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  271. package/dist/astro/routes/api/schema/collections/index.mjs +57 -54
  272. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  273. package/dist/astro/routes/api/schema/collections/reorder.mjs +57 -54
  274. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  275. package/dist/astro/routes/api/schema/index.mjs +13 -11
  276. package/dist/astro/routes/api/schema/index.mjs.map +1 -1
  277. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +57 -54
  278. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  279. package/dist/astro/routes/api/schema/orphans/index.mjs +57 -54
  280. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  281. package/dist/astro/routes/api/search/enable.mjs +12 -11
  282. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  283. package/dist/astro/routes/api/search/index.mjs +11 -10
  284. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  285. package/dist/astro/routes/api/search/rebuild.mjs +12 -11
  286. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  287. package/dist/astro/routes/api/search/stats.mjs +7 -6
  288. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  289. package/dist/astro/routes/api/search/suggest.mjs +11 -10
  290. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  291. package/dist/astro/routes/api/sections/_slug_.mjs +11 -10
  292. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  293. package/dist/astro/routes/api/sections/index.mjs +11 -10
  294. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  295. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -6
  296. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
  297. package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -5
  298. package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
  299. package/dist/astro/routes/api/settings/backups/export.mjs +7 -6
  300. package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
  301. package/dist/astro/routes/api/settings/backups/index.mjs +8 -7
  302. package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
  303. package/dist/astro/routes/api/settings/email.mjs +5 -5
  304. package/dist/astro/routes/api/settings/email.mjs.map +1 -1
  305. package/dist/astro/routes/api/settings.d.mts.map +1 -1
  306. package/dist/astro/routes/api/settings.mjs +21 -17
  307. package/dist/astro/routes/api/settings.mjs.map +1 -1
  308. package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
  309. package/dist/astro/routes/api/setup/admin.mjs +11 -11
  310. package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -33
  311. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  312. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  313. package/dist/astro/routes/api/setup/index.mjs +35 -33
  314. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  315. package/dist/astro/routes/api/setup/status.mjs +3 -3
  316. package/dist/astro/routes/api/snapshot.mjs +8 -7
  317. package/dist/astro/routes/api/snapshot.mjs.map +1 -1
  318. package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -1
  319. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +22 -17
  320. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
  321. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -1
  322. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +23 -18
  323. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
  324. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -1
  325. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +27 -19
  326. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
  327. package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
  328. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -17
  329. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
  330. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +16 -15
  331. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
  332. package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -1
  333. package/dist/astro/routes/api/taxonomies/_name_.mjs +28 -20
  334. package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
  335. package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -1
  336. package/dist/astro/routes/api/taxonomies/index.mjs +22 -17
  337. package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
  338. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  339. package/dist/astro/routes/api/typegen.mjs +4 -4
  340. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  341. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  342. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  343. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
  344. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -8
  345. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  346. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
  347. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +18 -14
  348. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  349. package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -1
  350. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +16 -13
  351. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  352. package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -1
  353. package/dist/astro/routes/api/widget-areas/_name_.mjs +9 -7
  354. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  355. package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -1
  356. package/dist/astro/routes/api/widget-areas/index.mjs +16 -13
  357. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  358. package/dist/astro/routes/api/widget-components.mjs +2 -2
  359. package/dist/astro/routes/robots.txt.mjs +8 -8
  360. package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -12
  361. package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
  362. package/dist/astro/routes/sitemap.xml.mjs +9 -9
  363. package/dist/astro/types.d.mts +50 -20
  364. package/dist/astro/types.d.mts.map +1 -1
  365. package/dist/auth/providers/github.d.mts +1 -1
  366. package/dist/auth/providers/google.d.mts +1 -1
  367. package/dist/{authorize-ByYs-Uxs.mjs → authorize-C2QHlWSS.mjs} +2 -2
  368. package/dist/{authorize-ByYs-Uxs.mjs.map → authorize-C2QHlWSS.mjs.map} +1 -1
  369. package/dist/{backup-ChyHfIoX.mjs → backup-oS8ft5Cm.mjs} +5 -5
  370. package/dist/{backup-ChyHfIoX.mjs.map → backup-oS8ft5Cm.mjs.map} +1 -1
  371. package/dist/{bundle-DZFhFurR.mjs → bundle-CL0JjIPx.mjs} +4 -4
  372. package/dist/{bundle-DZFhFurR.mjs.map → bundle-CL0JjIPx.mjs.map} +1 -1
  373. package/dist/{byline-Cpnwrje1.mjs → byline-Vdi85CsZ.mjs} +27 -14
  374. package/dist/byline-Vdi85CsZ.mjs.map +1 -0
  375. package/dist/{byline-fields-CAyA_Umd.mjs → byline-fields-DPVRFMz2.mjs} +2 -2
  376. package/dist/{byline-fields-CAyA_Umd.mjs.map → byline-fields-DPVRFMz2.mjs.map} +1 -1
  377. package/dist/{byline-registry-Bpu9-MVs.mjs → byline-registry-BxDGIO0I.mjs} +2 -2
  378. package/dist/{byline-registry-Bpu9-MVs.mjs.map → byline-registry-BxDGIO0I.mjs.map} +1 -1
  379. package/dist/{bylines-BSo9B9RX.mjs → bylines-BX8QhcTk.mjs} +7 -7
  380. package/dist/{bylines-BSo9B9RX.mjs.map → bylines-BX8QhcTk.mjs.map} +1 -1
  381. package/dist/{bylines-CHjvehVX.mjs → bylines-w-E1IEQd.mjs} +3 -3
  382. package/dist/{bylines-CHjvehVX.mjs.map → bylines-w-E1IEQd.mjs.map} +1 -1
  383. package/dist/{cache-5VirJ2Cn.mjs → cache--7HKu5Xm.mjs} +4 -4
  384. package/dist/{cache-5VirJ2Cn.mjs.map → cache--7HKu5Xm.mjs.map} +1 -1
  385. package/dist/{capture-triggers-CNW1q3HK.mjs → capture-triggers-CeAsC76Z.mjs} +2 -2
  386. package/dist/{capture-triggers-CNW1q3HK.mjs.map → capture-triggers-CeAsC76Z.mjs.map} +1 -1
  387. package/dist/{challenge-store-D5pSY2S1.mjs → challenge-store-BIOak-tp.mjs} +5 -3
  388. package/dist/challenge-store-BIOak-tp.mjs.map +1 -0
  389. package/dist/chrome-tags-DzDQBCjX.mjs +24 -0
  390. package/dist/chrome-tags-DzDQBCjX.mjs.map +1 -0
  391. package/dist/{chunks-bNiX6_DR.mjs → chunks-VG_tyqnP.mjs} +2 -2
  392. package/dist/{chunks-bNiX6_DR.mjs.map → chunks-VG_tyqnP.mjs.map} +1 -1
  393. package/dist/cli/index.mjs +68 -40
  394. package/dist/cli/index.mjs.map +1 -1
  395. package/dist/client/cf-access.d.mts +1 -1
  396. package/dist/client/index.d.mts +17 -7
  397. package/dist/client/index.d.mts.map +1 -1
  398. package/dist/client/index.mjs +17 -12
  399. package/dist/client/index.mjs.map +1 -1
  400. package/dist/{collection-deletion-m_oi2c0N.mjs → collection-deletion-BCwaWTDw.mjs} +4 -4
  401. package/dist/{collection-deletion-m_oi2c0N.mjs.map → collection-deletion-BCwaWTDw.mjs.map} +1 -1
  402. package/dist/collection-slugs-cache-7lTmNzeA.mjs +85 -0
  403. package/dist/collection-slugs-cache-7lTmNzeA.mjs.map +1 -0
  404. package/dist/{comment-reaction-CRuItEjt.mjs → comment-reaction-CDyvPQRj.mjs} +2 -2
  405. package/dist/{comment-reaction-CRuItEjt.mjs.map → comment-reaction-CDyvPQRj.mjs.map} +1 -1
  406. package/dist/{comment-DhvLEdhQ.mjs → comment-vxOzWbZN.mjs} +2 -2
  407. package/dist/{comment-DhvLEdhQ.mjs.map → comment-vxOzWbZN.mjs.map} +1 -1
  408. package/dist/{comments-CLj4bi8I.mjs → comments-VzmVLyaC.mjs} +2 -2
  409. package/dist/{comments-CLj4bi8I.mjs.map → comments-VzmVLyaC.mjs.map} +1 -1
  410. package/dist/{components-v4U4DT2y.mjs → components-CL6Wkdk-.mjs} +1 -1
  411. package/dist/{components-v4U4DT2y.mjs.map → components-CL6Wkdk-.mjs.map} +1 -1
  412. package/dist/config--eWjQJE5.mjs +217 -0
  413. package/dist/config--eWjQJE5.mjs.map +1 -0
  414. package/dist/{index-DWbJrsAg.d.mts → config-CGAhyOjP.d.mts} +276 -76
  415. package/dist/config-CGAhyOjP.d.mts.map +1 -0
  416. package/dist/{config-DrfghTPe.d.mts → config-ChFzshGd.d.mts} +1 -1
  417. package/dist/{config-DrfghTPe.d.mts.map → config-ChFzshGd.d.mts.map} +1 -1
  418. package/dist/{content-CP-SeXNa.mjs → content-CNfMWuhY.mjs} +202 -46
  419. package/dist/content-CNfMWuhY.mjs.map +1 -0
  420. package/dist/{content-list-query-BhejKVqb.d.mts → content-list-query-B8d4UQp9.d.mts} +1 -1
  421. package/dist/{content-list-query-BhejKVqb.d.mts.map → content-list-query-B8d4UQp9.d.mts.map} +1 -1
  422. package/dist/{content-refresh-DLOfIhYc.mjs → content-refresh-GTMyi2Xy.mjs} +53 -26
  423. package/dist/content-refresh-GTMyi2Xy.mjs.map +1 -0
  424. package/dist/{content-repair-BCxzy0r4.mjs → content-repair-CIMt5C0U.mjs} +4 -4
  425. package/dist/{content-repair-BCxzy0r4.mjs.map → content-repair-CIMt5C0U.mjs.map} +1 -1
  426. package/dist/{context-BR5hRWiK.mjs → context-C9PB8vGd.mjs} +308 -33
  427. package/dist/context-C9PB8vGd.mjs.map +1 -0
  428. package/dist/{cron-CWfWrWKG.mjs → cron-DHAy9oyq.mjs} +1 -1
  429. package/dist/{cron-CWfWrWKG.mjs.map → cron-DHAy9oyq.mjs.map} +1 -1
  430. package/dist/{dashboard-CkIV2rnQ.mjs → dashboard-BNSvAN8A.mjs} +5 -5
  431. package/dist/{dashboard-CkIV2rnQ.mjs.map → dashboard-BNSvAN8A.mjs.map} +1 -1
  432. package/dist/db/index.d.mts +3 -3
  433. package/dist/db/index.mjs +2 -2
  434. package/dist/db/index.mjs.map +1 -1
  435. package/dist/db/libsql-migrations.d.mts +1 -1
  436. package/dist/db/libsql-migrations.mjs +5 -5
  437. package/dist/db/libsql.d.mts +1 -1
  438. package/dist/db/postgres-migrations.d.mts +1 -1
  439. package/dist/db/postgres-migrations.mjs +5 -5
  440. package/dist/db/postgres.d.mts +1 -1
  441. package/dist/db/postgres.d.mts.map +1 -1
  442. package/dist/db/postgres.mjs +19 -3
  443. package/dist/db/postgres.mjs.map +1 -1
  444. package/dist/db/sqlite-migrations.d.mts +1 -1
  445. package/dist/db/sqlite-migrations.mjs +5 -5
  446. package/dist/db/sqlite.d.mts +1 -1
  447. package/dist/db/sqlite.mjs +1 -1
  448. package/dist/{default-YMEfcQUx.mjs → default-ByZ0JqZo.mjs} +1 -1
  449. package/dist/{default-YMEfcQUx.mjs.map → default-ByZ0JqZo.mjs.map} +1 -1
  450. package/dist/{deferred-tasks-DfqxH5Xf.d.mts → deferred-tasks-Cu4NSJpa.d.mts} +1 -1
  451. package/dist/{deferred-tasks-DfqxH5Xf.d.mts.map → deferred-tasks-Cu4NSJpa.d.mts.map} +1 -1
  452. package/dist/dev-typegen-DHT7lcMU.mjs +29 -0
  453. package/dist/dev-typegen-DHT7lcMU.mjs.map +1 -0
  454. package/dist/{device-flow-CojjSBwb.mjs → device-flow-Cf6bhCCT.mjs} +4 -4
  455. package/dist/{device-flow-CojjSBwb.mjs.map → device-flow-Cf6bhCCT.mjs.map} +1 -1
  456. package/dist/{dialect-helpers-BSbfaO3F.mjs → dialect-helpers-BcQvkHgn.mjs} +83 -2
  457. package/dist/dialect-helpers-BcQvkHgn.mjs.map +1 -0
  458. package/dist/{direct-executor-BWeWiRYB.mjs → direct-executor-yAyUGSqB.mjs} +3 -3
  459. package/dist/{direct-executor-BWeWiRYB.mjs.map → direct-executor-yAyUGSqB.mjs.map} +1 -1
  460. package/dist/{dist-89xCrGqi.mjs → dist-BAsh8dbf.mjs} +1 -1
  461. package/dist/{dist-89xCrGqi.mjs.map → dist-BAsh8dbf.mjs.map} +1 -1
  462. package/dist/{email-console-CEJgR_LB.mjs → email-console-DNup1Fku.mjs} +1 -1
  463. package/dist/{email-console-CEJgR_LB.mjs.map → email-console-DNup1Fku.mjs.map} +1 -1
  464. package/dist/{enrich-BX0IDp4z.mjs → enrich-t2Xvjdqa.mjs} +3 -3
  465. package/dist/{enrich-BX0IDp4z.mjs.map → enrich-t2Xvjdqa.mjs.map} +1 -1
  466. package/dist/entry-lock-BEr8gDkG.mjs +163 -0
  467. package/dist/entry-lock-BEr8gDkG.mjs.map +1 -0
  468. package/dist/{relations-C7B46bcU.d.mts → entry-lock-CGAtrwAR.d.mts} +265 -76
  469. package/dist/entry-lock-CGAtrwAR.d.mts.map +1 -0
  470. package/dist/{redirects-CRIM55KH.mjs → entry-lock-DIYHAaSw.mjs} +112 -34
  471. package/dist/entry-lock-DIYHAaSw.mjs.map +1 -0
  472. package/dist/entry-locks-BEcX7ET0.mjs +167 -0
  473. package/dist/entry-locks-BEcX7ET0.mjs.map +1 -0
  474. package/dist/{error-D9w94fjV.mjs → error-BDcFyoRt.mjs} +2 -2
  475. package/dist/{error-D9w94fjV.mjs.map → error-BDcFyoRt.mjs.map} +1 -1
  476. package/dist/{errors-n2j49uNf.mjs → errors-DvMdNrgf.mjs} +10 -1
  477. package/dist/errors-DvMdNrgf.mjs.map +1 -0
  478. package/dist/{escape-DN4Qmjsl.mjs → escape-B3asJC6W.mjs} +1 -1
  479. package/dist/{escape-DN4Qmjsl.mjs.map → escape-B3asJC6W.mjs.map} +1 -1
  480. package/dist/{field-defs-cache-Bh4q6oar.mjs → field-defs-cache-Cf5FHK0M.mjs} +5 -5
  481. package/dist/{field-defs-cache-Bh4q6oar.mjs.map → field-defs-cache-Cf5FHK0M.mjs.map} +1 -1
  482. package/dist/{fts-manager-BhOdW0bi.mjs → fts-manager-iddym8cd.mjs} +4 -4
  483. package/dist/{fts-manager-BhOdW0bi.mjs.map → fts-manager-iddym8cd.mjs.map} +1 -1
  484. package/dist/{hash-CTcngWvj.mjs → hash-BRweX6jz.mjs} +1 -1
  485. package/dist/{hash-CTcngWvj.mjs.map → hash-BRweX6jz.mjs.map} +1 -1
  486. package/dist/hook-result-BrshYHLx.d.mts +31 -0
  487. package/dist/hook-result-BrshYHLx.d.mts.map +1 -0
  488. package/dist/{hreflang-7pTHsLZJ.d.mts → hreflang-CQpu5bMy.d.mts} +2 -2
  489. package/dist/{hreflang-7pTHsLZJ.d.mts.map → hreflang-CQpu5bMy.d.mts.map} +1 -1
  490. package/dist/{hreflang-Huc6O5wa.mjs → hreflang-DshnweTC.mjs} +9 -8
  491. package/dist/{hreflang-Huc6O5wa.mjs.map → hreflang-DshnweTC.mjs.map} +1 -1
  492. package/dist/{identity-DXmb4aVp.mjs → identity-CjGKDq8J.mjs} +3 -3
  493. package/dist/{identity-DXmb4aVp.mjs.map → identity-CjGKDq8J.mjs.map} +1 -1
  494. package/dist/{import-C4_O3KXU.mjs → import-D96g2otw.mjs} +6 -6
  495. package/dist/{import-C4_O3KXU.mjs.map → import-D96g2otw.mjs.map} +1 -1
  496. package/dist/{index-6bRee8zb.d.mts → index-1ECYpfiF.d.mts} +3 -3
  497. package/dist/{index-6bRee8zb.d.mts.map → index-1ECYpfiF.d.mts.map} +1 -1
  498. package/dist/index.d.mts +22 -21
  499. package/dist/index.mjs +84 -81
  500. package/dist/{init-lock-DJkX6Hto.mjs → init-lock-CFNBe_iH.mjs} +1 -1
  501. package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-CFNBe_iH.mjs.map} +1 -1
  502. package/dist/{load-Bo7fZAbg.mjs → load-DPtY9cZo.mjs} +2 -2
  503. package/dist/{load-Bo7fZAbg.mjs.map → load-DPtY9cZo.mjs.map} +1 -1
  504. package/dist/{loader-ZsjE4paL.mjs → loader-WJi6GFRn.mjs} +90 -17
  505. package/dist/loader-WJi6GFRn.mjs.map +1 -0
  506. package/dist/{manifest-builder-QXuqvVMP.mjs → manifest-builder-BfNlGQIA.mjs} +2 -2
  507. package/dist/{manifest-builder-QXuqvVMP.mjs.map → manifest-builder-BfNlGQIA.mjs.map} +1 -1
  508. package/dist/{manifest-schema-CUYPfCEH.mjs → manifest-schema-CILooI5J.mjs} +5 -5
  509. package/dist/manifest-schema-CILooI5J.mjs.map +1 -0
  510. package/dist/media/image-endpoint.d.mts +4 -2
  511. package/dist/media/image-endpoint.d.mts.map +1 -1
  512. package/dist/media/image-endpoint.mjs +6 -4
  513. package/dist/media/image-endpoint.mjs.map +1 -1
  514. package/dist/media/index.d.mts +1 -1
  515. package/dist/media/index.mjs +3 -3
  516. package/dist/media/local-runtime.d.mts +12 -12
  517. package/dist/media/local-runtime.mjs +7 -7
  518. package/dist/{media-D6SeAfBl.mjs → media-BBm8Wg3f.mjs} +30 -2
  519. package/dist/media-BBm8Wg3f.mjs.map +1 -0
  520. package/dist/{media-BjwNuLEu.mjs → media-C1EIZKh1.mjs} +35 -5
  521. package/dist/media-C1EIZKh1.mjs.map +1 -0
  522. package/dist/{media-allowlist-D35v7bmL.mjs → media-allowlist-elXJgb_K.mjs} +2 -2
  523. package/dist/{media-allowlist-D35v7bmL.mjs.map → media-allowlist-elXJgb_K.mjs.map} +1 -1
  524. package/dist/{media-folders-D-0CmRZj.mjs → media-folders-DASfX_DH.mjs} +1 -1
  525. package/dist/{media-folders-D-0CmRZj.mjs.map → media-folders-DASfX_DH.mjs.map} +1 -1
  526. package/dist/{media-upload-C7bLXGcI.mjs → media-upload-C7_AQJ5v.mjs} +9 -9
  527. package/dist/{media-upload-C7bLXGcI.mjs.map → media-upload-C7_AQJ5v.mjs.map} +1 -1
  528. package/dist/{media-url-DH7giMx_.mjs → media-url-8dVl1loq.mjs} +19 -2
  529. package/dist/media-url-8dVl1loq.mjs.map +1 -0
  530. package/dist/{media-usage-BTRJvS6V.mjs → media-usage-C1EswMTq.mjs} +10 -10
  531. package/dist/{media-usage-BTRJvS6V.mjs.map → media-usage-C1EswMTq.mjs.map} +1 -1
  532. package/dist/{media-usage-activation-Dx0kPV6b.mjs → media-usage-activation-CrHNltlL.mjs} +3 -3
  533. package/dist/{media-usage-activation-Dx0kPV6b.mjs.map → media-usage-activation-CrHNltlL.mjs.map} +1 -1
  534. package/dist/{media-usage-work-C-fhM30c.mjs → media-usage-work-C5B1zT1c.mjs} +2 -2
  535. package/dist/{media-usage-work-C-fhM30c.mjs.map → media-usage-work-C5B1zT1c.mjs.map} +1 -1
  536. package/dist/{media-usage-work-DWb2XPMI.mjs → media-usage-work-IkQx_Yz6.mjs} +4 -4
  537. package/dist/{media-usage-work-DWb2XPMI.mjs.map → media-usage-work-IkQx_Yz6.mjs.map} +1 -1
  538. package/dist/{media-usage-write-fence-BwoJVRDC.mjs → media-usage-write-fence-B9anjOSg.mjs} +3 -3
  539. package/dist/{media-usage-write-fence-BwoJVRDC.mjs.map → media-usage-write-fence-B9anjOSg.mjs.map} +1 -1
  540. package/dist/{menus-CNg0QlDt.mjs → menus-D8mC4eaN.mjs} +406 -175
  541. package/dist/menus-D8mC4eaN.mjs.map +1 -0
  542. package/dist/{menus-CD7EFLwz.mjs → menus-UdwjHZJC.mjs} +12 -4
  543. package/dist/{menus-CD7EFLwz.mjs.map → menus-UdwjHZJC.mjs.map} +1 -1
  544. package/dist/migrations/index.d.mts +1 -1
  545. package/dist/migrations/index.mjs +4 -4
  546. package/dist/{mime-CUIG6x84.mjs → mime-DYpsOAny.mjs} +1 -1
  547. package/dist/{mime-CUIG6x84.mjs.map → mime-DYpsOAny.mjs.map} +1 -1
  548. package/dist/{mode-DaUM_MB2.mjs → mode-Dm4BHhRH.mjs} +1 -1
  549. package/dist/{mode-DaUM_MB2.mjs.map → mode-Dm4BHhRH.mjs.map} +1 -1
  550. package/dist/{node-sqlite-compat-Udb4Y-rs.mjs → node-sqlite-compat-2sezm-Zd.mjs} +1 -1
  551. package/dist/{node-sqlite-compat-Udb4Y-rs.mjs.map → node-sqlite-compat-2sezm-Zd.mjs.map} +1 -1
  552. package/dist/{normalize-CSxdKBVa.mjs → normalize-4nkKGsuW.mjs} +15 -5
  553. package/dist/normalize-4nkKGsuW.mjs.map +1 -0
  554. package/dist/{oauth-authorization-Dpsb-fMJ.mjs → oauth-authorization-BxE_lURD.mjs} +4 -4
  555. package/dist/{oauth-authorization-Dpsb-fMJ.mjs.map → oauth-authorization-BxE_lURD.mjs.map} +1 -1
  556. package/dist/{oauth-clients-Bxnoe_67.mjs → oauth-clients-DJIdOdq0.mjs} +1 -1
  557. package/dist/{oauth-clients-Bxnoe_67.mjs.map → oauth-clients-DJIdOdq0.mjs.map} +1 -1
  558. package/dist/{oauth-state-store-0C4s0K6w.mjs → oauth-state-store-CsdxP57n.mjs} +1 -1
  559. package/dist/{oauth-state-store-0C4s0K6w.mjs.map → oauth-state-store-CsdxP57n.mjs.map} +1 -1
  560. package/dist/{oauth-user-lookup-wlGYSeqX.mjs → oauth-user-lookup-HzzW-dkF.mjs} +1 -1
  561. package/dist/{oauth-user-lookup-wlGYSeqX.mjs.map → oauth-user-lookup-HzzW-dkF.mjs.map} +1 -1
  562. package/dist/object-cache/memory.d.mts +1 -1
  563. package/dist/{object-cache-71tPfV4A.mjs → object-cache-DVKnyOfy.mjs} +19 -3
  564. package/dist/object-cache-DVKnyOfy.mjs.map +1 -0
  565. package/dist/{options-BHPeIbBd.mjs → options-D1FBiAv1.mjs} +60 -5
  566. package/dist/options-D1FBiAv1.mjs.map +1 -0
  567. package/dist/{options-BhZIeFY1.d.mts → options-D8Y0VHc7.d.mts} +30 -11
  568. package/dist/options-D8Y0VHc7.d.mts.map +1 -0
  569. package/dist/page/index.d.mts +2 -2
  570. package/dist/page/index.d.mts.map +1 -1
  571. package/dist/page/index.mjs +12 -0
  572. package/dist/page/index.mjs.map +1 -1
  573. package/dist/{parse-BRJg1kz8.mjs → parse-WRg5C3NX.mjs} +2 -2
  574. package/dist/{parse-BRJg1kz8.mjs.map → parse-WRg5C3NX.mjs.map} +1 -1
  575. package/dist/{passkey-config-B3P0nHRR.mjs → passkey-config-qIdO-wF6.mjs} +1 -1
  576. package/dist/{passkey-config-B3P0nHRR.mjs.map → passkey-config-qIdO-wF6.mjs.map} +1 -1
  577. package/dist/{patterns-D9iDO3j8.mjs → patterns-DC8CLptu.mjs} +1 -1
  578. package/dist/{patterns-D9iDO3j8.mjs.map → patterns-DC8CLptu.mjs.map} +1 -1
  579. package/dist/{placeholder-BR4ZhVJl.d.mts → placeholder-COrvARyD.d.mts} +1 -1
  580. package/dist/{placeholder-BR4ZhVJl.d.mts.map → placeholder-COrvARyD.d.mts.map} +1 -1
  581. package/dist/plugin-types.d.mts +8 -3
  582. package/dist/plugin-types.d.mts.map +1 -1
  583. package/dist/plugin-utils.d.mts +10 -10
  584. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  585. package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
  586. package/dist/{policy-BVRganJQ.mjs → policy-XCfb-IE9.mjs} +2 -2
  587. package/dist/{policy-BVRganJQ.mjs.map → policy-XCfb-IE9.mjs.map} +1 -1
  588. package/dist/{portable-text-C8Tvp4_g.mjs → portable-text-BS3d5n-0.mjs} +1 -1
  589. package/dist/{portable-text-C8Tvp4_g.mjs.map → portable-text-BS3d5n-0.mjs.map} +1 -1
  590. package/dist/{preview-dn2dUyM0.mjs → preview-BxwsGgGp.mjs} +2 -2
  591. package/dist/{preview-dn2dUyM0.mjs.map → preview-BxwsGgGp.mjs.map} +1 -1
  592. package/dist/{protocol-CuBEsqgE.d.mts → protocol-CLn58-nw.d.mts} +2 -2
  593. package/dist/{protocol-CuBEsqgE.d.mts.map → protocol-CLn58-nw.d.mts.map} +1 -1
  594. package/dist/{public-url-DRz_AinV.mjs → public-url-FWWAvnre.mjs} +1 -1
  595. package/dist/{public-url-DRz_AinV.mjs.map → public-url-FWWAvnre.mjs.map} +1 -1
  596. package/dist/{query-D18vTdha.mjs → query-DygOte9M.mjs} +26 -17
  597. package/dist/query-DygOte9M.mjs.map +1 -0
  598. package/dist/{query-tZDEdtCN.mjs → query-gtXT03Wc.mjs} +5 -5
  599. package/dist/{query-tZDEdtCN.mjs.map → query-gtXT03Wc.mjs.map} +1 -1
  600. package/dist/{rate-limit-on7KPo-v.mjs → rate-limit-CQUPm0dh.mjs} +2 -2
  601. package/dist/{rate-limit-on7KPo-v.mjs.map → rate-limit-CQUPm0dh.mjs.map} +1 -1
  602. package/dist/{redirect-DrbEmU9a.mjs → redirect-D1cWafi6.mjs} +1 -1
  603. package/dist/{redirect-DrbEmU9a.mjs.map → redirect-D1cWafi6.mjs.map} +1 -1
  604. package/dist/{redirect-CZkbozu9.mjs → redirect-DId44BS1.mjs} +19 -6
  605. package/dist/redirect-DId44BS1.mjs.map +1 -0
  606. package/dist/{redirects-BahWiu8Z.mjs → redirects-DN-ZE33W.mjs} +5 -5
  607. package/dist/{redirects-BahWiu8Z.mjs.map → redirects-DN-ZE33W.mjs.map} +1 -1
  608. package/dist/{registry-Cx-jEJOS.mjs → registry-DTqaqxed.mjs} +46 -12
  609. package/dist/registry-DTqaqxed.mjs.map +1 -0
  610. package/dist/{relation-A6wLF_DS.mjs → relation-DxgCHOBw.mjs} +2 -2
  611. package/dist/{relation-A6wLF_DS.mjs.map → relation-DxgCHOBw.mjs.map} +1 -1
  612. package/dist/{relations-Cj5hZ6Zg.mjs → relations-KKDSLUwS.mjs} +4 -4
  613. package/dist/{relations-Cj5hZ6Zg.mjs.map → relations-KKDSLUwS.mjs.map} +1 -1
  614. package/dist/{relations-BTPM2saV.mjs → relations-rOmbndUJ.mjs} +8 -8
  615. package/dist/relations-rOmbndUJ.mjs.map +1 -0
  616. package/dist/{request-cache-DH9zdCOD.mjs → request-cache-DAZZmesc.mjs} +1 -1
  617. package/dist/{request-cache-DH9zdCOD.mjs.map → request-cache-DAZZmesc.mjs.map} +1 -1
  618. package/dist/request-context.d.mts +1 -1
  619. package/dist/{request-meta-DRp5ENd_.mjs → request-meta-BgjUQLQ-.mjs} +2 -2
  620. package/dist/{request-meta-DRp5ENd_.mjs.map → request-meta-BgjUQLQ-.mjs.map} +1 -1
  621. package/dist/{resolve-DxUpTMmE.mjs → resolve-Cy0aWSRj.mjs} +37 -4
  622. package/dist/resolve-Cy0aWSRj.mjs.map +1 -0
  623. package/dist/{runner-zgqA_CqP.d.mts → runner-CfwysRM0.d.mts} +3 -2
  624. package/dist/runner-CfwysRM0.d.mts.map +1 -0
  625. package/dist/{runner-77GOZCnH.mjs → runner-nEzvnogG.mjs} +476 -295
  626. package/dist/runner-nEzvnogG.mjs.map +1 -0
  627. package/dist/runtime.d.mts +11 -11
  628. package/dist/runtime.mjs +3 -2
  629. package/dist/runtime.mjs.map +1 -1
  630. package/dist/{schema-BY-oVntF.mjs → schema-CRu38Pr5.mjs} +3 -3
  631. package/dist/{schema-BY-oVntF.mjs.map → schema-CRu38Pr5.mjs.map} +1 -1
  632. package/dist/{schema-Cw9kVK0I.mjs → schema-DifxndJx.mjs} +5 -5
  633. package/dist/{schema-Cw9kVK0I.mjs.map → schema-DifxndJx.mjs.map} +1 -1
  634. package/dist/{scopes-vMR1uIbt.mjs → scopes-D5A1OZbq.mjs} +3 -3
  635. package/dist/{scopes-vMR1uIbt.mjs.map → scopes-D5A1OZbq.mjs.map} +1 -1
  636. package/dist/{search-CfT3KxO5.mjs → search-DEPFSBFq.mjs} +4 -4
  637. package/dist/{search-CfT3KxO5.mjs.map → search-DEPFSBFq.mjs.map} +1 -1
  638. package/dist/{secrets-BH2Qow1-.mjs → secrets-CdfzLdoO.mjs} +3 -3
  639. package/dist/{secrets-BH2Qow1-.mjs.map → secrets-CdfzLdoO.mjs.map} +1 -1
  640. package/dist/{sections-DTfjyf1z.mjs → sections-3X52kmIR.mjs} +2 -2
  641. package/dist/{sections-DTfjyf1z.mjs.map → sections-3X52kmIR.mjs.map} +1 -1
  642. package/dist/seed/index.d.mts +2 -2
  643. package/dist/seed/index.mjs +28 -26
  644. package/dist/seo/index.d.mts +3 -3
  645. package/dist/seo/index.d.mts.map +1 -1
  646. package/dist/seo/index.mjs +20 -21
  647. package/dist/seo/index.mjs.map +1 -1
  648. package/dist/{seo-Cm-dtvgk.mjs → seo-Bw68KxRc.mjs} +3 -3
  649. package/dist/{seo-Cm-dtvgk.mjs.map → seo-Bw68KxRc.mjs.map} +1 -1
  650. package/dist/{seo-BSiTIXzd.mjs → seo-C4AmbsMU.mjs} +3 -2
  651. package/dist/seo-C4AmbsMU.mjs.map +1 -0
  652. package/dist/{service-DYsDHEKe.mjs → service-J_-Vgo7R.mjs} +3 -3
  653. package/dist/{service-DYsDHEKe.mjs.map → service-J_-Vgo7R.mjs.map} +1 -1
  654. package/dist/{session-user-CNAfvsdw.mjs → session-user-CbnMMwk6.mjs} +1 -1
  655. package/dist/{session-user-CNAfvsdw.mjs.map → session-user-CbnMMwk6.mjs.map} +1 -1
  656. package/dist/{settings-DjtkUo__.mjs → settings-AnEFYICn.mjs} +3 -3
  657. package/dist/{settings-DjtkUo__.mjs.map → settings-AnEFYICn.mjs.map} +1 -1
  658. package/dist/{settings-BgN-0DT-.mjs → settings-DcMjREe5.mjs} +21 -8
  659. package/dist/settings-DcMjREe5.mjs.map +1 -0
  660. package/dist/{setup-complete-CcpXaPU7.mjs → setup-complete-BClXXTvr.mjs} +2 -2
  661. package/dist/{setup-complete-CcpXaPU7.mjs.map → setup-complete-BClXXTvr.mjs.map} +1 -1
  662. package/dist/{setup-nonce-Reyw30jg.mjs → setup-nonce-BheRa4RG.mjs} +1 -1
  663. package/dist/{setup-nonce-Reyw30jg.mjs.map → setup-nonce-BheRa4RG.mjs.map} +1 -1
  664. package/dist/{single-flight-cache-BPuGPdcN.mjs → single-flight-cache-jaswDzmQ.mjs} +2 -2
  665. package/dist/{single-flight-cache-BPuGPdcN.mjs.map → single-flight-cache-jaswDzmQ.mjs.map} +1 -1
  666. package/dist/{site-url-Cs_V9n3V.mjs → site-url-Bqf-ea3N.mjs} +3 -3
  667. package/dist/{site-url-Cs_V9n3V.mjs.map → site-url-Bqf-ea3N.mjs.map} +1 -1
  668. package/dist/{snapshot-DSB8P7Lm.mjs → snapshot-C4CtXntb.mjs} +51 -35
  669. package/dist/snapshot-C4CtXntb.mjs.map +1 -0
  670. package/dist/{ssrf-DqebVE34.mjs → ssrf-gl4gFNhw.mjs} +151 -93
  671. package/dist/ssrf-gl4gFNhw.mjs.map +1 -0
  672. package/dist/{state-BJfU9Uzw.mjs → state-1F6IOhdQ.mjs} +1 -1
  673. package/dist/{state-BJfU9Uzw.mjs.map → state-1F6IOhdQ.mjs.map} +1 -1
  674. package/dist/{status-DDu8HIQl.mjs → status-Cenfk_r5.mjs} +1 -1
  675. package/dist/{status-DDu8HIQl.mjs.map → status-Cenfk_r5.mjs.map} +1 -1
  676. package/dist/storage/local.d.mts +2 -1
  677. package/dist/storage/local.d.mts.map +1 -1
  678. package/dist/storage/local.mjs +1 -1
  679. package/dist/storage/local.mjs.map +1 -1
  680. package/dist/storage/s3.d.mts +2 -1
  681. package/dist/storage/s3.d.mts.map +1 -1
  682. package/dist/storage/s3.mjs +3 -2
  683. package/dist/storage/s3.mjs.map +1 -1
  684. package/dist/{target-D0o26Azo.mjs → target-CRzeTs8G.mjs} +1 -1
  685. package/dist/{target-D0o26Azo.mjs.map → target-CRzeTs8G.mjs.map} +1 -1
  686. package/dist/{taxonomies-CPGxo-bn.mjs → taxonomies-BOdxuZpV.mjs} +23 -13
  687. package/dist/taxonomies-BOdxuZpV.mjs.map +1 -0
  688. package/dist/{taxonomies-kmyudNGP.mjs → taxonomies-NcFDq5Gg.mjs} +58 -23
  689. package/dist/taxonomies-NcFDq5Gg.mjs.map +1 -0
  690. package/dist/{taxonomy-8X09dLN5.mjs → taxonomy-DP1vny4K.mjs} +12 -4
  691. package/dist/{taxonomy-8X09dLN5.mjs.map → taxonomy-DP1vny4K.mjs.map} +1 -1
  692. package/dist/{tokens-gTS-IVUp.mjs → tokens-CDk8ox9p.mjs} +1 -1
  693. package/dist/{tokens-gTS-IVUp.mjs.map → tokens-CDk8ox9p.mjs.map} +1 -1
  694. package/dist/{transport-_6R1ub7t.d.mts → transport-BVn4tVb9.d.mts} +1 -1
  695. package/dist/{transport-_6R1ub7t.d.mts.map → transport-BVn4tVb9.d.mts.map} +1 -1
  696. package/dist/{transport-fX59xaJz.mjs → transport-DP0JI-8i.mjs} +1 -1
  697. package/dist/{transport-fX59xaJz.mjs.map → transport-DP0JI-8i.mjs.map} +1 -1
  698. package/dist/{trusted-proxy-fe6nEgR4.mjs → trusted-proxy-BTM6UxqD.mjs} +1 -1
  699. package/dist/{trusted-proxy-fe6nEgR4.mjs.map → trusted-proxy-BTM6UxqD.mjs.map} +1 -1
  700. package/dist/{types-D_DWe7k9.d.mts → types-2n848aVW.d.mts} +3 -2
  701. package/dist/types-2n848aVW.d.mts.map +1 -0
  702. package/dist/types-A2cN6a4a.mjs +3 -0
  703. package/dist/{types-75KIqzL9.mjs → types-BMXnRIrX.mjs} +4 -2
  704. package/dist/types-BMXnRIrX.mjs.map +1 -0
  705. package/dist/{types-Vg6f5i3s.d.mts → types-BouXpOsa.d.mts} +121 -4
  706. package/dist/types-BouXpOsa.d.mts.map +1 -0
  707. package/dist/{types-BXUmsINL.mjs → types-ByG2coLw.mjs} +1 -1
  708. package/dist/{types-BXUmsINL.mjs.map → types-ByG2coLw.mjs.map} +1 -1
  709. package/dist/types-CQPWhPxE.mjs.map +1 -1
  710. package/dist/{types-Blb-MRC3.d.mts → types-DEfNJ__A.d.mts} +1 -1
  711. package/dist/{types-Blb-MRC3.d.mts.map → types-DEfNJ__A.d.mts.map} +1 -1
  712. package/dist/{types-Br-ERaxh.d.mts → types-DKcKSbtB.d.mts} +23 -7
  713. package/dist/types-DKcKSbtB.d.mts.map +1 -0
  714. package/dist/{types-BzBd3PeX.d.mts → types-DRYs7uTL.d.mts} +1 -1
  715. package/dist/{types-BzBd3PeX.d.mts.map → types-DRYs7uTL.d.mts.map} +1 -1
  716. package/dist/{types-CLqvnd05.d.mts → types-DaEg7KX2.d.mts} +1 -1
  717. package/dist/{types-CLqvnd05.d.mts.map → types-DaEg7KX2.d.mts.map} +1 -1
  718. package/dist/{types-DJQxln7q.d.mts → types-LU8utpP_.d.mts} +14 -10
  719. package/dist/types-LU8utpP_.d.mts.map +1 -0
  720. package/dist/{types-D5VVLr7J.d.mts → types-VpYfPUxN.d.mts} +1 -1
  721. package/dist/{types-D5VVLr7J.d.mts.map → types-VpYfPUxN.d.mts.map} +1 -1
  722. package/dist/{types-DM3vioBY.mjs → types-c9GP7Dj5.mjs} +1 -1
  723. package/dist/{types-DM3vioBY.mjs.map → types-c9GP7Dj5.mjs.map} +1 -1
  724. package/dist/{types-DHxzBjbD.d.mts → types-tJWDK__M.d.mts} +14 -1
  725. package/dist/types-tJWDK__M.d.mts.map +1 -0
  726. package/dist/{upload-attempts-CNyGSepg.mjs → upload-attempts-C6S2y-lp.mjs} +1 -1
  727. package/dist/{upload-attempts-CNyGSepg.mjs.map → upload-attempts-C6S2y-lp.mjs.map} +1 -1
  728. package/dist/{url-pattern-K-KdXcSe.mjs → url-pattern-UYtxVTuj.mjs} +1 -1
  729. package/dist/{url-pattern-K-KdXcSe.mjs.map → url-pattern-UYtxVTuj.mjs.map} +1 -1
  730. package/dist/{user-CtYY0tp2.mjs → user-DIsIXogT.mjs} +2 -2
  731. package/dist/{user-CtYY0tp2.mjs.map → user-DIsIXogT.mjs.map} +1 -1
  732. package/dist/{utils-HztC73hq.mjs → utils-BicP5Qbg.mjs} +2 -2
  733. package/dist/{utils-HztC73hq.mjs.map → utils-BicP5Qbg.mjs.map} +1 -1
  734. package/dist/{validate-Dd-IUjnZ.mjs → validate-D8VPn4Hv.mjs} +8 -3
  735. package/dist/validate-D8VPn4Hv.mjs.map +1 -0
  736. package/dist/{validate-DlqdOZXB.d.mts → validate-Df6Dvwbw.d.mts} +12 -7
  737. package/dist/validate-Df6Dvwbw.d.mts.map +1 -0
  738. package/dist/{validation-D83n7Npi.mjs → validation-CzMJn9Ku.mjs} +13 -11
  739. package/dist/{validation-D83n7Npi.mjs.map → validation-CzMJn9Ku.mjs.map} +1 -1
  740. package/dist/version-CK67_SXX.mjs +7 -0
  741. package/dist/{version-ri-sCyAp.mjs.map → version-CK67_SXX.mjs.map} +1 -1
  742. package/dist/{widgets-CpmZd9Q-.mjs → widgets-RFVAxQl3.mjs} +18 -5
  743. package/dist/widgets-RFVAxQl3.mjs.map +1 -0
  744. package/dist/{wxr-taxonomies-BFd0y72_.d.mts → wxr-taxonomies-BX4yQL9s.d.mts} +1 -1
  745. package/dist/{wxr-taxonomies-BFd0y72_.d.mts.map → wxr-taxonomies-BX4yQL9s.d.mts.map} +1 -1
  746. package/dist/{wxr-taxonomies-Df4vxWcU.mjs → wxr-taxonomies-Csdp7yde.mjs} +4 -4
  747. package/dist/{wxr-taxonomies-Df4vxWcU.mjs.map → wxr-taxonomies-Csdp7yde.mjs.map} +1 -1
  748. package/dist/{zod-generator-DylzusHh.mjs → zod-generator-CNRGdnBY.mjs} +11 -7
  749. package/dist/zod-generator-CNRGdnBY.mjs.map +1 -0
  750. package/package.json +16 -11
  751. package/src/api/errors.ts +9 -0
  752. package/src/api/handlers/content.ts +115 -90
  753. package/src/api/handlers/entry-lock.ts +206 -0
  754. package/src/api/handlers/index.ts +1 -0
  755. package/src/api/handlers/manifest.ts +162 -12
  756. package/src/api/handlers/marketplace.ts +28 -20
  757. package/src/api/handlers/media.ts +30 -0
  758. package/src/api/handlers/menus.ts +9 -0
  759. package/src/api/handlers/registry.ts +406 -297
  760. package/src/api/handlers/revision.ts +2 -1
  761. package/src/api/handlers/seo.ts +10 -1
  762. package/src/api/handlers/snapshot.ts +84 -72
  763. package/src/api/handlers/taxonomies.ts +25 -9
  764. package/src/api/openapi/document.ts +196 -11
  765. package/src/api/parse.ts +1 -1
  766. package/src/api/schemas/auth.ts +4 -4
  767. package/src/api/schemas/bylines.ts +3 -3
  768. package/src/api/schemas/comments.ts +1 -1
  769. package/src/api/schemas/common.ts +3 -2
  770. package/src/api/schemas/content.ts +86 -22
  771. package/src/api/schemas/entry-lock.ts +48 -0
  772. package/src/api/schemas/index.ts +1 -0
  773. package/src/api/schemas/media.ts +52 -0
  774. package/src/api/schemas/redirects.ts +6 -1
  775. package/src/api/schemas/schema.ts +14 -1
  776. package/src/api/schemas/setup.ts +1 -1
  777. package/src/api/schemas/taxonomies.ts +2 -2
  778. package/src/api/schemas/users.ts +1 -1
  779. package/src/api/types.ts +25 -10
  780. package/src/astro/dev-typegen.ts +35 -0
  781. package/src/astro/image-endpoint.ts +2 -2
  782. package/src/astro/integration/dev-typegen.ts +91 -0
  783. package/src/astro/integration/index.ts +18 -50
  784. package/src/astro/integration/routes.ts +10 -0
  785. package/src/astro/integration/runtime.ts +13 -5
  786. package/src/astro/integration/vite-config.ts +51 -2
  787. package/src/astro/middleware.ts +21 -0
  788. package/src/astro/routes/api/admin/api-tokens/index.ts +4 -1
  789. package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
  790. package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
  791. package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
  792. package/src/astro/routes/api/admin/plugins/registry/artifact.ts +3 -7
  793. package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
  794. package/src/astro/routes/api/admin/plugins/registry/verify.ts +60 -0
  795. package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +18 -2
  796. package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
  797. package/src/astro/routes/api/content/[collection]/[id]/publish.ts +12 -1
  798. package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +20 -0
  799. package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +16 -2
  800. package/src/astro/routes/api/content/[collection]/[id].ts +27 -2
  801. package/src/astro/routes/api/content/[collection]/index.ts +3 -0
  802. package/src/astro/routes/api/manifest.ts +1 -1
  803. package/src/astro/routes/api/media/[id]/replace.ts +114 -0
  804. package/src/astro/routes/api/media/file/[...key].ts +4 -1
  805. package/src/astro/routes/api/media/upload-url.ts +8 -4
  806. package/src/astro/routes/api/media.ts +54 -8
  807. package/src/astro/routes/api/menus/[name]/items/[id].ts +7 -2
  808. package/src/astro/routes/api/menus/[name]/items.ts +4 -1
  809. package/src/astro/routes/api/menus/[name]/reorder.ts +4 -1
  810. package/src/astro/routes/api/menus/[name]/translations.ts +4 -1
  811. package/src/astro/routes/api/menus/[name].ts +7 -2
  812. package/src/astro/routes/api/menus/index.ts +4 -1
  813. package/src/astro/routes/api/settings/email.ts +1 -1
  814. package/src/astro/routes/api/settings.ts +4 -1
  815. package/src/astro/routes/api/taxonomies/[name]/reorder.ts +4 -1
  816. package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +4 -1
  817. package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +7 -2
  818. package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +4 -1
  819. package/src/astro/routes/api/taxonomies/[name].ts +7 -2
  820. package/src/astro/routes/api/taxonomies/index.ts +4 -1
  821. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
  822. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
  823. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
  824. package/src/astro/routes/api/widget-areas/[name].ts +3 -1
  825. package/src/astro/routes/api/widget-areas/index.ts +3 -1
  826. package/src/astro/routes/sitemap-[collection].xml.ts +4 -0
  827. package/src/astro/types.ts +36 -8
  828. package/src/auth/challenge-store.ts +3 -1
  829. package/src/aws-sdk.d.ts +1 -0
  830. package/src/cache/chrome-tags.ts +24 -0
  831. package/src/cli/commands/content.ts +31 -5
  832. package/src/cli/commands/export-seed.ts +2 -0
  833. package/src/client/index.ts +34 -7
  834. package/src/components/EmDashBodyEnd.astro +4 -1
  835. package/src/components/EmDashBodyStart.astro +4 -1
  836. package/src/components/EmDashHead.astro +35 -16
  837. package/src/components/EmDashImage.astro +2 -1
  838. package/src/components/EmDashMedia.astro +2 -1
  839. package/src/components/Gallery.astro +18 -4
  840. package/src/components/InlineEditor.astro +3 -1
  841. package/src/components/InlinePortableTextEditor.tsx +112 -12
  842. package/src/components/PortableText.astro +4 -0
  843. package/src/components/Table.astro +147 -62
  844. package/src/components/widgets/Archives.astro +2 -37
  845. package/src/config/errors.ts +13 -0
  846. package/src/content/converters/index.ts +2 -0
  847. package/src/content/converters/mark-safety.ts +1 -0
  848. package/src/content/converters/portable-text-identity.ts +139 -0
  849. package/src/content/converters/portable-text-to-prosemirror.ts +226 -69
  850. package/src/content/converters/prosemirror-to-portable-text.ts +128 -28
  851. package/src/content/converters/types.ts +11 -0
  852. package/src/database/dialect-helpers.ts +125 -0
  853. package/src/database/migrations/017_authorization_codes.ts +14 -4
  854. package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
  855. package/src/database/migrations/075_entry_edit_locks.ts +44 -0
  856. package/src/database/migrations/076_collection_nav_group.ts +22 -0
  857. package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
  858. package/src/database/migrations/runner.ts +9 -1
  859. package/src/database/repositories/byline.ts +32 -16
  860. package/src/database/repositories/content.ts +284 -48
  861. package/src/database/repositories/entry-locks.ts +257 -0
  862. package/src/database/repositories/media-usage.ts +66 -37
  863. package/src/database/repositories/media.ts +60 -1
  864. package/src/database/repositories/options.ts +69 -5
  865. package/src/database/repositories/plugin-storage.ts +233 -9
  866. package/src/database/repositories/redirect.ts +17 -6
  867. package/src/database/repositories/taxonomy.ts +8 -0
  868. package/src/database/repositories/types.ts +11 -7
  869. package/src/database/types.ts +15 -1
  870. package/src/db/adapters.ts +8 -1
  871. package/src/db/postgres.ts +23 -0
  872. package/src/emdash-runtime.ts +196 -199
  873. package/src/fields/boolean.ts +1 -1
  874. package/src/fields/datetime.ts +1 -1
  875. package/src/fields/file.ts +1 -1
  876. package/src/fields/integer.ts +1 -1
  877. package/src/fields/json.ts +1 -1
  878. package/src/fields/multiselect.ts +1 -1
  879. package/src/fields/number.ts +1 -1
  880. package/src/fields/portable-text.ts +1 -1
  881. package/src/fields/richtext.ts +1 -1
  882. package/src/fields/select.ts +1 -1
  883. package/src/fields/slug.ts +1 -1
  884. package/src/fields/text.ts +1 -1
  885. package/src/fields/textarea.ts +1 -1
  886. package/src/fields/types.ts +2 -2
  887. package/src/i18n/resolve.ts +44 -4
  888. package/src/index.ts +39 -3
  889. package/src/loader.ts +96 -12
  890. package/src/mcp/server.ts +251 -29
  891. package/src/media/image-endpoint.ts +5 -2
  892. package/src/media/normalize.ts +15 -4
  893. package/src/media/responsive.ts +23 -0
  894. package/src/media/usage/cleanup.ts +9 -8
  895. package/src/media/usage/content-refresh.ts +2 -1
  896. package/src/menus/index.ts +33 -21
  897. package/src/object-cache/index.ts +44 -2
  898. package/src/page/seo-contributions.ts +78 -1
  899. package/src/page/seo-panel.ts +47 -0
  900. package/src/plugin-types.ts +27 -1
  901. package/src/plugins/conditional-storage.ts +30 -0
  902. package/src/plugins/context.ts +49 -17
  903. package/src/plugins/hooks.ts +10 -1
  904. package/src/plugins/index.ts +15 -0
  905. package/src/plugins/manager.ts +6 -2
  906. package/src/plugins/manifest-schema.ts +1 -1
  907. package/src/plugins/routes.ts +3 -1
  908. package/src/plugins/sandbox/hook-result.ts +52 -0
  909. package/src/plugins/sandbox/index.ts +10 -0
  910. package/src/plugins/sandbox/types.ts +16 -2
  911. package/src/plugins/storage-query.ts +45 -0
  912. package/src/plugins/storage-update.ts +96 -0
  913. package/src/plugins/types.ts +120 -0
  914. package/src/query.ts +29 -3
  915. package/src/registry/artifact-checksum.ts +15 -0
  916. package/src/registry/artifact-verification.ts +85 -0
  917. package/src/registry/authoritative-records.ts +180 -0
  918. package/src/registry/config.ts +130 -27
  919. package/src/registry/record-labels.ts +28 -0
  920. package/src/registry/types.ts +5 -6
  921. package/src/schema/collection-slugs-cache.ts +157 -0
  922. package/src/schema/registry.ts +45 -3
  923. package/src/schema/types.ts +25 -6
  924. package/src/schema/zod-generator.ts +16 -13
  925. package/src/security/ssrf.ts +172 -143
  926. package/src/seed/apply.ts +4 -0
  927. package/src/seed/types.ts +7 -2
  928. package/src/seed/validate.ts +18 -1
  929. package/src/seo/hreflang.ts +1 -0
  930. package/src/seo/index.ts +5 -10
  931. package/src/seo/media-url.ts +26 -0
  932. package/src/settings/index.ts +16 -0
  933. package/src/storage/local.ts +1 -0
  934. package/src/storage/s3.ts +2 -0
  935. package/src/storage/types.ts +2 -0
  936. package/src/taxonomies/index.ts +40 -20
  937. package/src/taxonomies/term-counts.ts +22 -5
  938. package/src/widgets/archives.ts +67 -0
  939. package/src/widgets/index.ts +16 -0
  940. package/dist/api-B0w3uBiG.mjs +0 -2269
  941. package/dist/api-B0w3uBiG.mjs.map +0 -1
  942. package/dist/apply-B_VMpJ2P.mjs.map +0 -1
  943. package/dist/byline-Cpnwrje1.mjs.map +0 -1
  944. package/dist/challenge-store-D5pSY2S1.mjs.map +0 -1
  945. package/dist/content-CP-SeXNa.mjs.map +0 -1
  946. package/dist/content-refresh-DLOfIhYc.mjs.map +0 -1
  947. package/dist/context-BR5hRWiK.mjs.map +0 -1
  948. package/dist/dialect-helpers-BSbfaO3F.mjs.map +0 -1
  949. package/dist/errors-n2j49uNf.mjs.map +0 -1
  950. package/dist/index-DWbJrsAg.d.mts.map +0 -1
  951. package/dist/loader-ZsjE4paL.mjs.map +0 -1
  952. package/dist/manifest-schema-CUYPfCEH.mjs.map +0 -1
  953. package/dist/media-BjwNuLEu.mjs.map +0 -1
  954. package/dist/media-D6SeAfBl.mjs.map +0 -1
  955. package/dist/media-url-DH7giMx_.mjs.map +0 -1
  956. package/dist/menus-CNg0QlDt.mjs.map +0 -1
  957. package/dist/normalize-CSxdKBVa.mjs.map +0 -1
  958. package/dist/object-cache-71tPfV4A.mjs.map +0 -1
  959. package/dist/options-BHPeIbBd.mjs.map +0 -1
  960. package/dist/options-BhZIeFY1.d.mts.map +0 -1
  961. package/dist/query-D18vTdha.mjs.map +0 -1
  962. package/dist/redirect-CZkbozu9.mjs.map +0 -1
  963. package/dist/redirects-CRIM55KH.mjs.map +0 -1
  964. package/dist/registry-BiO5WwPq.mjs +0 -2716
  965. package/dist/registry-BiO5WwPq.mjs.map +0 -1
  966. package/dist/registry-Cx-jEJOS.mjs.map +0 -1
  967. package/dist/relations-BTPM2saV.mjs.map +0 -1
  968. package/dist/relations-C7B46bcU.d.mts.map +0 -1
  969. package/dist/resolve-DxUpTMmE.mjs.map +0 -1
  970. package/dist/runner-77GOZCnH.mjs.map +0 -1
  971. package/dist/runner-zgqA_CqP.d.mts.map +0 -1
  972. package/dist/seo-BSiTIXzd.mjs.map +0 -1
  973. package/dist/settings-BgN-0DT-.mjs.map +0 -1
  974. package/dist/snapshot-DSB8P7Lm.mjs.map +0 -1
  975. package/dist/ssrf-DqebVE34.mjs.map +0 -1
  976. package/dist/taxonomies-CPGxo-bn.mjs.map +0 -1
  977. package/dist/taxonomies-kmyudNGP.mjs.map +0 -1
  978. package/dist/types-75KIqzL9.mjs.map +0 -1
  979. package/dist/types-Br-ERaxh.d.mts.map +0 -1
  980. package/dist/types-D6OcIp2P.mjs +0 -3
  981. package/dist/types-DHxzBjbD.d.mts.map +0 -1
  982. package/dist/types-DJQxln7q.d.mts.map +0 -1
  983. package/dist/types-D_DWe7k9.d.mts.map +0 -1
  984. package/dist/types-Vg6f5i3s.d.mts.map +0 -1
  985. package/dist/validate-Dd-IUjnZ.mjs.map +0 -1
  986. package/dist/validate-DlqdOZXB.d.mts.map +0 -1
  987. package/dist/version-ri-sCyAp.mjs +0 -7
  988. package/dist/widgets-CpmZd9Q-.mjs.map +0 -1
  989. package/dist/zod-generator-DylzusHh.mjs.map +0 -1
  990. /package/dist/{api-tokens-B5NHLNUN.mjs → api-tokens-B_lfpmH3.mjs} +0 -0
  991. /package/dist/{ssrf-BPKzkm6O.mjs → ssrf-TQhaljuI.mjs} +0 -0
@@ -1,24 +1,40 @@
1
1
  import { t as validateIdentifier } from "./validate-BpwoDOgt.mjs";
2
- import { n as cachedQuery, t as CacheNamespace } from "./object-cache-71tPfV4A.mjs";
3
- import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-bNiX6_DR.mjs";
2
+ import { n as cachedQuery, t as CacheNamespace } from "./object-cache-DVKnyOfy.mjs";
3
+ import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-VG_tyqnP.mjs";
4
4
  import { o as decodeCursor, s as encodeCursor } from "./types-CQPWhPxE.mjs";
5
- import { t as CommentRepository } from "./comment-DhvLEdhQ.mjs";
6
- import { t as OptionsRepository } from "./options-BHPeIbBd.mjs";
7
- import { t as PluginContextFactory } from "./context-BR5hRWiK.mjs";
8
- import { r as requestCached } from "./request-cache-DH9zdCOD.mjs";
9
- import { i as resolveLocaleChain, r as resolveLocale } from "./resolve-DxUpTMmE.mjs";
10
- import { s as getDb } from "./loader-ZsjE4paL.mjs";
11
- import { a as normalizeCapabilities } from "./types-D6OcIp2P.mjs";
12
- import { gt as sanitizeHref } from "./redirects-CRIM55KH.mjs";
13
- import { t as extractRequestMeta } from "./request-meta-DRp5ENd_.mjs";
14
- import { r as setCronTasksEnabled } from "./cron-CWfWrWKG.mjs";
15
- import { t as MediaUsageActivationWriteBlockedError } from "./media-usage-write-fence-BwoJVRDC.mjs";
16
- import { t as CommentReactionRepository } from "./comment-reaction-CRuItEjt.mjs";
5
+ import { t as CommentRepository } from "./comment-vxOzWbZN.mjs";
6
+ import { t as OptionsRepository } from "./options-D1FBiAv1.mjs";
7
+ import { t as PluginContextFactory } from "./context-C9PB8vGd.mjs";
8
+ import { i as resolveLocaleChain, r as resolveLocale, t as interpolateUrlPattern } from "./resolve-Cy0aWSRj.mjs";
9
+ import { r as requestCached } from "./request-cache-DAZZmesc.mjs";
10
+ import { t as menuTag } from "./chrome-tags-DzDQBCjX.mjs";
11
+ import { s as getDb } from "./loader-WJi6GFRn.mjs";
12
+ import { i as normalizeCapabilities } from "./types-A2cN6a4a.mjs";
13
+ import { xt as sanitizeHref } from "./entry-lock-DIYHAaSw.mjs";
14
+ import { t as extractRequestMeta } from "./request-meta-BgjUQLQ-.mjs";
15
+ import { r as setCronTasksEnabled } from "./cron-DHAy9oyq.mjs";
16
+ import { t as MediaUsageActivationWriteBlockedError } from "./media-usage-write-fence-B9anjOSg.mjs";
17
+ import { t as CommentReactionRepository } from "./comment-reaction-CDyvPQRj.mjs";
17
18
  import { sql } from "kysely";
18
19
  import { ulid } from "ulidx";
19
20
  import { AsyncLocalStorage } from "node:async_hooks";
20
21
  import { z } from "astro/zod";
22
+ import { z as z$1 } from "zod";
23
+ import { UnsafePortableTextTableError, portableTextTableToProseMirror, proseMirrorTableToPortableText } from "@emdash-cms/admin/portable-text-table";
24
+ import { Extension, Mark, Node } from "@tiptap/core";
21
25
 
26
+ //#region src/config/errors.ts
27
+ /** A configuration failure whose message is safe to return from the API. */
28
+ var EmDashConfigurationError = class extends Error {
29
+ constructor(message, code, cause) {
30
+ super(message);
31
+ this.code = code;
32
+ this.cause = cause;
33
+ this.name = "EmDashConfigurationError";
34
+ }
35
+ };
36
+
37
+ //#endregion
22
38
  //#region src/database/repositories/audit.ts
23
39
  /**
24
40
  * Audit repository for logging system events
@@ -224,7 +240,7 @@ function reference(collection, options) {
224
240
  const portableTextBlockSchema = z.object({
225
241
  _type: z.string(),
226
242
  _key: z.string()
227
- }).passthrough();
243
+ }).loose();
228
244
  /**
229
245
  * Portable Text field
230
246
  * Stores structured content in Portable Text format
@@ -252,10 +268,10 @@ function sanitizeGalleryImages(value, generateKey) {
252
268
  if (!Array.isArray(value)) return [];
253
269
  const images = [];
254
270
  for (const entry of value) {
255
- if (!isRecord$2(entry)) continue;
271
+ if (!isRecord$3(entry)) continue;
256
272
  const record = entry;
257
273
  const asset = record.asset;
258
- if (!isRecord$2(asset)) continue;
274
+ if (!isRecord$3(asset)) continue;
259
275
  const assetRecord = asset;
260
276
  const image = {
261
277
  _type: "image",
@@ -279,7 +295,7 @@ function sanitizeGalleryImages(value, generateKey) {
279
295
  }
280
296
  return images;
281
297
  }
282
- function isRecord$2(value) {
298
+ function isRecord$3(value) {
283
299
  return typeof value === "object" && value !== null && !Array.isArray(value);
284
300
  }
285
301
 
@@ -305,9 +321,10 @@ const SUPPORTED_PROSEMIRROR_MARKS = new Set([
305
321
  "subscript",
306
322
  "superscript",
307
323
  "code",
308
- "link"
324
+ "link",
325
+ "emdashPortableTextSpan"
309
326
  ]);
310
- function isRecord$1(value) {
327
+ function isRecord$2(value) {
311
328
  return typeof value === "object" && value !== null && !Array.isArray(value);
312
329
  }
313
330
  function collectPortableTextMarks(value, inheritedMarkDefs, unsupported) {
@@ -315,11 +332,11 @@ function collectPortableTextMarks(value, inheritedMarkDefs, unsupported) {
315
332
  for (const item of value) collectPortableTextMarks(item, inheritedMarkDefs, unsupported);
316
333
  return;
317
334
  }
318
- if (!isRecord$1(value)) return;
335
+ if (!isRecord$2(value)) return;
319
336
  let markDefs = inheritedMarkDefs;
320
337
  if (Array.isArray(value.markDefs)) {
321
338
  const localMarkDefs = new Map(inheritedMarkDefs);
322
- for (const markDef of value.markDefs) if (isRecord$1(markDef) && typeof markDef._key === "string") localMarkDefs.set(markDef._key, markDef);
339
+ for (const markDef of value.markDefs) if (isRecord$2(markDef) && typeof markDef._key === "string") localMarkDefs.set(markDef._key, markDef);
323
340
  markDefs = localMarkDefs;
324
341
  }
325
342
  if (value._type === "span" && Array.isArray(value.marks)) for (const mark of value.marks) {
@@ -474,6 +491,125 @@ function normalizeProseMirrorOrderedListJson(doc) {
474
491
  return normalized;
475
492
  }
476
493
 
494
+ //#endregion
495
+ //#region src/content/converters/portable-text-identity.ts
496
+ const PORTABLE_TEXT_BLOCK_NODE = "emdashPortableTextBlock";
497
+ const PORTABLE_TEXT_BLOCK_ATTR = "emdashPortableTextBlock";
498
+ const PORTABLE_TEXT_KEY_ATTR = "emdashPortableTextKey";
499
+ const PORTABLE_TEXT_SPAN_MARK = "emdashPortableTextSpan";
500
+ function isRecord$1(value) {
501
+ return typeof value === "object" && value !== null && !Array.isArray(value);
502
+ }
503
+ function attrsWithPortableTextKey(attrs, key) {
504
+ return {
505
+ ...attrs,
506
+ [PORTABLE_TEXT_KEY_ATTR]: key
507
+ };
508
+ }
509
+ function portableTextKeyFromAttrs(attrs) {
510
+ const key = attrs?.[PORTABLE_TEXT_KEY_ATTR];
511
+ return typeof key === "string" && key ? key : void 0;
512
+ }
513
+ function portableTextSpanKeyFromMarks(marks) {
514
+ for (const mark of marks ?? []) {
515
+ if (!isRecord$1(mark) || mark.type !== PORTABLE_TEXT_SPAN_MARK || !isRecord$1(mark.attrs)) continue;
516
+ const key = mark.attrs.key;
517
+ if (typeof key === "string" && key) return key;
518
+ }
519
+ }
520
+ function portableTextMarkDefsFromMarks(marks) {
521
+ const identity = (marks ?? []).find((mark) => isRecord$1(mark) && mark.type === PORTABLE_TEXT_SPAN_MARK && isRecord$1(mark.attrs));
522
+ if (!isRecord$1(identity) || !isRecord$1(identity.attrs) || !Array.isArray(identity.attrs.markDefs)) return [];
523
+ return identity.attrs.markDefs.filter((markDef) => isRecord$1(markDef) && typeof markDef._type === "string" && typeof markDef._key === "string");
524
+ }
525
+ function portableTextBlockFromAttrs(attrs) {
526
+ const block = attrs?.[PORTABLE_TEXT_BLOCK_ATTR];
527
+ if (!isRecord$1(block) || typeof block._type !== "string" || typeof block._key !== "string") return;
528
+ return {
529
+ ...block,
530
+ _type: block._type,
531
+ _key: block._key
532
+ };
533
+ }
534
+ const PortableTextIdentityExtension = Extension.create({
535
+ name: "emdashPortableTextIdentity",
536
+ addGlobalAttributes() {
537
+ const hiddenAttribute = {
538
+ default: null,
539
+ rendered: false
540
+ };
541
+ return [{
542
+ types: [
543
+ "paragraph",
544
+ "heading",
545
+ "blockquote",
546
+ "codeBlock",
547
+ "htmlBlock",
548
+ "image",
549
+ "horizontalRule",
550
+ "gallery",
551
+ PORTABLE_TEXT_BLOCK_NODE
552
+ ],
553
+ attributes: { [PORTABLE_TEXT_KEY_ATTR]: hiddenAttribute }
554
+ }];
555
+ }
556
+ });
557
+ const PortableTextSpanIdentity = Mark.create({
558
+ name: PORTABLE_TEXT_SPAN_MARK,
559
+ inclusive: false,
560
+ spanning: false,
561
+ addAttributes() {
562
+ return {
563
+ key: {
564
+ default: null,
565
+ rendered: false
566
+ },
567
+ markDefs: {
568
+ default: [],
569
+ rendered: false
570
+ }
571
+ };
572
+ },
573
+ parseHTML() {
574
+ return [];
575
+ },
576
+ renderHTML() {
577
+ return ["span", 0];
578
+ }
579
+ });
580
+ const PortableTextOpaqueBlock = Node.create({
581
+ name: PORTABLE_TEXT_BLOCK_NODE,
582
+ group: "block",
583
+ atom: true,
584
+ selectable: true,
585
+ draggable: true,
586
+ addAttributes() {
587
+ return { [PORTABLE_TEXT_BLOCK_ATTR]: {
588
+ default: null,
589
+ rendered: false
590
+ } };
591
+ },
592
+ parseHTML() {
593
+ return [{ tag: "div[data-emdash-portable-text-block]" }];
594
+ },
595
+ renderHTML({ node }) {
596
+ const blockType = portableTextBlockFromAttrs(node.attrs)?._type ?? "unknown";
597
+ return [
598
+ "div",
599
+ {
600
+ "data-emdash-portable-text-block": blockType,
601
+ contenteditable: "false"
602
+ },
603
+ `[Unknown block type: ${blockType}]`
604
+ ];
605
+ }
606
+ });
607
+ const portableTextIdentityExtensions = [
608
+ PortableTextIdentityExtension,
609
+ PortableTextSpanIdentity,
610
+ PortableTextOpaqueBlock
611
+ ];
612
+
477
613
  //#endregion
478
614
  //#region src/content/converters/prosemirror-to-portable-text.ts
479
615
  /**
@@ -484,7 +620,7 @@ function normalizeProseMirrorOrderedListJson(doc) {
484
620
  /**
485
621
  * Generate a unique key for Portable Text blocks
486
622
  */
487
- function generateKey() {
623
+ function generateKey$1() {
488
624
  return Math.random().toString(36).substring(2, 11);
489
625
  }
490
626
  /**
@@ -494,18 +630,33 @@ function prosemirrorToPortableText(doc) {
494
630
  if (!doc || doc.type !== "doc" || !doc.content) return [];
495
631
  assertProseMirrorMarksSupported(doc);
496
632
  const blocks = [];
633
+ const usedBlockKeys = /* @__PURE__ */ new Set();
497
634
  for (const [i, node] of doc.content.entries()) {
635
+ if (i === doc.content.length - 1 && isUnkeyedEmptyParagraph(node)) continue;
498
636
  const converted = convertNode(node, `root:${i}`);
499
- if (converted) if (Array.isArray(converted)) blocks.push(...converted);
500
- else blocks.push(converted);
637
+ for (const block of converted ? Array.isArray(converted) ? converted : [converted] : []) {
638
+ let key = block._key;
639
+ if (usedBlockKeys.has(key)) do
640
+ key = generateKey$1();
641
+ while (usedBlockKeys.has(key));
642
+ usedBlockKeys.add(key);
643
+ blocks.push(key === block._key ? block : {
644
+ ...block,
645
+ _key: key
646
+ });
647
+ }
501
648
  }
502
649
  return blocks;
503
650
  }
651
+ function isUnkeyedEmptyParagraph(node) {
652
+ return node.type === "paragraph" && (node.content?.length ?? 0) === 0 && portableTextKeyFromAttrs(node.attrs) === void 0;
653
+ }
504
654
  /**
505
655
  * Convert a single ProseMirror node to Portable Text block(s)
506
656
  */
507
657
  function convertNode(node, path) {
508
658
  switch (node.type) {
659
+ case PORTABLE_TEXT_BLOCK_NODE: return portableTextBlockFromAttrs(node.attrs) ?? null;
509
660
  case "paragraph": return convertParagraph(node);
510
661
  case "heading": return convertHeading(node);
511
662
  case "bulletList": return convertList$1(node, "bullet", path);
@@ -515,14 +666,29 @@ function convertNode(node, path) {
515
666
  case "htmlBlock": return convertHtmlBlock(node);
516
667
  case "image": return convertImage$1(node);
517
668
  case "gallery": return convertGallery(node);
669
+ case "table": {
670
+ const result = proseMirrorTableToPortableText(node, {
671
+ path,
672
+ createKey: generateKey$1,
673
+ inlineToSpans: (content) => {
674
+ const { children, markDefs } = convertInlineContent(content, true);
675
+ return {
676
+ content: children,
677
+ markDefs
678
+ };
679
+ }
680
+ });
681
+ if (!result.ok) throw new UnsafePortableTextTableError(result.reason, result.raw, result.renderFallback);
682
+ return result.table;
683
+ }
518
684
  case "horizontalRule": return {
519
685
  _type: "break",
520
- _key: generateKey(),
686
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
521
687
  style: "lineBreak"
522
688
  };
523
689
  default: return {
524
690
  _type: node.type,
525
- _key: generateKey(),
691
+ _key: generateKey$1(),
526
692
  ...node.attrs,
527
693
  _pmContent: node.content
528
694
  };
@@ -538,10 +704,10 @@ function convertParagraph(node) {
538
704
  const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
539
705
  return {
540
706
  _type: "block",
541
- _key: generateKey(),
707
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
542
708
  style: "normal",
543
709
  children,
544
- markDefs: markDefs.length > 0 ? markDefs : void 0,
710
+ ...markDefs.length > 0 ? { markDefs } : {},
545
711
  ...textAlign ? { textAlign } : {}
546
712
  };
547
713
  }
@@ -568,7 +734,7 @@ function convertHeading(node) {
568
734
  const textAlign = ta === "center" || ta === "right" || ta === "justify" ? ta : void 0;
569
735
  return {
570
736
  _type: "block",
571
- _key: generateKey(),
737
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
572
738
  style,
573
739
  children,
574
740
  markDefs: markDefs.length > 0 ? markDefs : void 0,
@@ -596,7 +762,7 @@ function convertListItem$1(item, listItem, level, path, metadata) {
596
762
  const { children, markDefs } = convertInlineContent(child.content || []);
597
763
  if (children.length > 0) blocks.push({
598
764
  _type: "block",
599
- _key: generateKey(),
765
+ _key: portableTextKeyFromAttrs(child.attrs) ?? generateKey$1(),
600
766
  style: "normal",
601
767
  listItem,
602
768
  level,
@@ -626,7 +792,7 @@ function convertBlockquote(node) {
626
792
  const { children, markDefs } = convertInlineContent(child.content || []);
627
793
  if (children.length > 0) blocks.push({
628
794
  _type: "block",
629
- _key: generateKey(),
795
+ _key: portableTextKeyFromAttrs(child.attrs) ?? portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
630
796
  style: "blockquote",
631
797
  children,
632
798
  markDefs: markDefs.length > 0 ? markDefs : void 0
@@ -642,7 +808,7 @@ function convertCodeBlock$1(node) {
642
808
  const language = typeof node.attrs?.language === "string" ? node.attrs.language : void 0;
643
809
  return {
644
810
  _type: "code",
645
- _key: generateKey(),
811
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
646
812
  code,
647
813
  language: language || void 0
648
814
  };
@@ -654,7 +820,7 @@ function convertHtmlBlock(node) {
654
820
  const rawHtml = node.attrs?.html;
655
821
  return {
656
822
  _type: "htmlBlock",
657
- _key: generateKey(),
823
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
658
824
  html: typeof rawHtml === "string" ? rawHtml : ""
659
825
  };
660
826
  }
@@ -672,9 +838,10 @@ function convertImage$1(node) {
672
838
  const height = typeof attrs?.height === "number" ? attrs.height : void 0;
673
839
  const displayWidth = typeof attrs?.displayWidth === "number" ? attrs.displayWidth : void 0;
674
840
  const displayHeight = typeof attrs?.displayHeight === "number" ? attrs.displayHeight : void 0;
841
+ const alignment = attrs?.alignment;
675
842
  return {
676
843
  _type: "image",
677
- _key: generateKey(),
844
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
678
845
  asset: {
679
846
  _ref: mediaId || src || "",
680
847
  url: src || "",
@@ -685,7 +852,8 @@ function convertImage$1(node) {
685
852
  width: width || void 0,
686
853
  height: height || void 0,
687
854
  displayWidth: displayWidth || void 0,
688
- displayHeight: displayHeight || void 0
855
+ displayHeight: displayHeight || void 0,
856
+ alignment: alignment === "left" || alignment === "center" || alignment === "right" || alignment === "wide" || alignment === "full" ? alignment : void 0
689
857
  };
690
858
  }
691
859
  /**
@@ -695,41 +863,62 @@ function convertGallery(node) {
695
863
  const columns = node.attrs?.columns;
696
864
  return {
697
865
  _type: "gallery",
698
- _key: generateKey(),
699
- images: sanitizeGalleryImages(node.attrs?.images, generateKey),
866
+ _key: portableTextKeyFromAttrs(node.attrs) ?? generateKey$1(),
867
+ images: sanitizeGalleryImages(node.attrs?.images, generateKey$1),
700
868
  ...typeof columns === "number" ? { columns } : {}
701
869
  };
702
870
  }
703
871
  /**
704
872
  * Convert inline content (text nodes with marks) to Portable Text spans
705
873
  */
706
- function convertInlineContent(nodes) {
874
+ function convertInlineContent(nodes, preserveHardBreakBoundary = false) {
707
875
  const children = [];
708
876
  const markDefs = [];
709
877
  const markDefMap = /* @__PURE__ */ new Map();
878
+ const usedSpanKeys = /* @__PURE__ */ new Set();
879
+ const claimSpanKey = (preferred) => {
880
+ if (preferred && !usedSpanKeys.has(preferred)) {
881
+ usedSpanKeys.add(preferred);
882
+ return preferred;
883
+ }
884
+ let key;
885
+ do
886
+ key = generateKey$1();
887
+ while (usedSpanKeys.has(key));
888
+ usedSpanKeys.add(key);
889
+ return key;
890
+ };
710
891
  for (const node of nodes) if (node.type === "text" && node.text) {
711
892
  const marks = [];
893
+ const originalMarkDefs = portableTextMarkDefsFromMarks(node.marks);
712
894
  for (const mark of node.marks || []) {
713
- const markType = convertMark(mark, markDefs, markDefMap);
895
+ const markType = convertMark(mark, markDefs, markDefMap, originalMarkDefs);
714
896
  if (markType) marks.push(markType);
715
897
  }
898
+ const preferredKey = portableTextSpanKeyFromMarks(node.marks) ?? portableTextKeyFromAttrs(node.attrs);
899
+ const normalizedMarks = marks.length > 0 ? marks : void 0;
900
+ const previous = children.at(-1);
901
+ if (preferredKey && previous?._key === preferredKey && JSON.stringify(previous.marks) === JSON.stringify(normalizedMarks)) {
902
+ previous.text += node.text;
903
+ continue;
904
+ }
716
905
  children.push({
717
906
  _type: "span",
718
- _key: generateKey(),
907
+ _key: claimSpanKey(preferredKey),
719
908
  text: node.text,
720
- marks: marks.length > 0 ? marks : void 0
909
+ marks: normalizedMarks
721
910
  });
722
- } else if (node.type === "hardBreak") if (children.length > 0) {
911
+ } else if (node.type === "hardBreak") if (children.length > 0 && !preserveHardBreakBoundary) {
723
912
  const lastChild = children.at(-1);
724
913
  lastChild.text += "\n";
725
914
  } else children.push({
726
915
  _type: "span",
727
- _key: generateKey(),
916
+ _key: claimSpanKey(portableTextSpanKeyFromMarks(node.marks) ?? portableTextKeyFromAttrs(node.attrs)),
728
917
  text: "\n"
729
918
  });
730
919
  if (children.length === 0) children.push({
731
920
  _type: "span",
732
- _key: generateKey(),
921
+ _key: claimSpanKey(),
733
922
  text: ""
734
923
  });
735
924
  return {
@@ -740,7 +929,7 @@ function convertInlineContent(nodes) {
740
929
  /**
741
930
  * Convert a ProseMirror mark to Portable Text mark
742
931
  */
743
- function convertMark(mark, markDefs, markDefMap) {
932
+ function convertMark(mark, markDefs, markDefMap, originalMarkDefs) {
744
933
  switch (mark.type) {
745
934
  case "bold":
746
935
  case "strong": return "strong";
@@ -752,17 +941,22 @@ function convertMark(mark, markDefs, markDefMap) {
752
941
  case "subscript": return "subscript";
753
942
  case "superscript": return "superscript";
754
943
  case "code": return "code";
944
+ case PORTABLE_TEXT_SPAN_MARK: return null;
755
945
  case "link": {
756
946
  const href = (typeof mark.attrs?.href === "string" ? mark.attrs.href : "") || "";
757
- if (markDefMap.has(href)) return markDefMap.get(href);
758
- const key = generateKey();
947
+ const blank = mark.attrs?.target === "_blank";
948
+ const originalMarkDef = originalMarkDefs.find((markDef) => markDef._type === "link");
949
+ const mapKey = originalMarkDef ? `key:${originalMarkDef._key}` : `value:${JSON.stringify([href, blank])}`;
950
+ if (markDefMap.has(mapKey)) return markDefMap.get(mapKey);
951
+ const key = originalMarkDef?._key || generateKey$1();
759
952
  markDefs.push({
953
+ ...originalMarkDef,
760
954
  _type: "link",
761
955
  _key: key,
762
956
  href,
763
- blank: mark.attrs?.target === "_blank"
957
+ ...originalMarkDef ? blank || Object.hasOwn(originalMarkDef, "blank") ? { blank } : {} : { blank }
764
958
  });
765
- markDefMap.set(href, key);
959
+ markDefMap.set(mapKey, key);
766
960
  return key;
767
961
  }
768
962
  default: throw new UnsupportedPortableTextMarksError([mark.type]);
@@ -776,15 +970,17 @@ function convertMark(mark, markDefs, markDefMap) {
776
970
  *
777
971
  * Converts Portable Text to TipTap's ProseMirror JSON format for editing.
778
972
  */
779
- /**
780
- * Convert Portable Text to ProseMirror document
781
- */
782
- function portableTextToProsemirror(blocks) {
973
+ function generateKey() {
974
+ return Math.random().toString(36).substring(2, 11);
975
+ }
976
+ /** Convert Portable Text to a ProseMirror document. */
977
+ function portableTextToProsemirror(blocks, options = {}) {
783
978
  if (!blocks || blocks.length === 0) return {
784
979
  type: "doc",
785
980
  content: [{ type: "paragraph" }]
786
981
  };
787
982
  assertPortableTextMarksSupported(blocks);
983
+ const preserveIdentity = options.preserveIdentity === true;
788
984
  const content = [];
789
985
  let i = 0;
790
986
  while (i < blocks.length) {
@@ -805,7 +1001,7 @@ function portableTextToProsemirror(blocks) {
805
1001
  i++;
806
1002
  } else break;
807
1003
  }
808
- content.push(convertList(listBlocks, listType, `root:${runStart}`));
1004
+ content.push(convertList(listBlocks, listType, `root:${runStart}`, preserveIdentity));
809
1005
  } else if (isTextBlock(block) && block.style === "blockquote") {
810
1006
  const quoteBlocks = [];
811
1007
  while (i < blocks.length) {
@@ -817,15 +1013,16 @@ function portableTextToProsemirror(blocks) {
817
1013
  content.push({
818
1014
  type: "blockquote",
819
1015
  content: quoteBlocks.map((quoteBlock) => {
820
- const paragraph = convertSpans(quoteBlock.children, quoteBlock.markDefs || []);
1016
+ const paragraph = convertSpans(quoteBlock.children, quoteBlock.markDefs || [], preserveIdentity);
821
1017
  return {
822
1018
  type: "paragraph",
1019
+ attrs: identityAttrs(void 0, quoteBlock._key, preserveIdentity),
823
1020
  content: paragraph.length > 0 ? paragraph : void 0
824
1021
  };
825
1022
  })
826
1023
  });
827
1024
  } else {
828
- const converted = convertBlock(block);
1025
+ const converted = convertBlock(block, `root:${i}`, preserveIdentity);
829
1026
  if (converted) content.push(converted);
830
1027
  i++;
831
1028
  }
@@ -835,6 +1032,9 @@ function portableTextToProsemirror(blocks) {
835
1032
  content: content.length > 0 ? content : [{ type: "paragraph" }]
836
1033
  });
837
1034
  }
1035
+ function identityAttrs(attrs, key, preserveIdentity) {
1036
+ return preserveIdentity ? attrsWithPortableTextKey(attrs, key) : attrs;
1037
+ }
838
1038
  function getListMetadata(item, fallbackSeed) {
839
1039
  const listId = normalizeListId(item.listId) ?? deriveLegacyListId(fallbackSeed);
840
1040
  const listStart = normalizeListStart(item.listStart);
@@ -866,8 +1066,8 @@ function isImageBlock(block) {
866
1066
  return block._type === "image" && "asset" in block && typeof block.asset === "object" && block.asset !== null;
867
1067
  }
868
1068
  /**
869
- * Type guard for gallery blocks. Requires an `images` array — a gallery
870
- * without one is malformed and falls through to the unknown-block path.
1069
+ * Type guard for gallery blocks that carry a usable `images` array.
1070
+ * Galleries without one are handled separately in `convertBlock`.
871
1071
  */
872
1072
  function isGalleryBlock(block) {
873
1073
  return block._type === "gallery" && "images" in block && Array.isArray(block.images);
@@ -881,23 +1081,53 @@ function isCodeBlock(block) {
881
1081
  /**
882
1082
  * Convert a single Portable Text block to ProseMirror node
883
1083
  */
884
- function convertBlock(block) {
885
- if (isTextBlock(block)) return convertTextBlock(block);
886
- if (isImageBlock(block)) return convertImage(block);
887
- if (block._type === "image") return convertMalformedImage(block);
1084
+ function convertBlock(block, path, preserveIdentity) {
1085
+ if (isTextBlock(block)) return convertTextBlock(block, preserveIdentity);
1086
+ if (isImageBlock(block)) return convertImage(block, preserveIdentity);
1087
+ if (block._type === "image") return convertMalformedImage(block, preserveIdentity);
888
1088
  if (isGalleryBlock(block)) return {
889
1089
  type: "gallery",
890
- attrs: {
1090
+ attrs: identityAttrs({
891
1091
  images: sanitizeGalleryImages(block.images),
892
1092
  columns: typeof block.columns === "number" ? block.columns : void 0
893
- }
1093
+ }, block._key, preserveIdentity)
894
1094
  };
895
- if (isCodeBlock(block)) return convertCodeBlock(block);
1095
+ if (isCodeBlock(block)) return convertCodeBlock(block, preserveIdentity);
896
1096
  if (block._type === "htmlBlock") return {
897
1097
  type: "htmlBlock",
898
- attrs: { html: block.html || "" }
1098
+ attrs: identityAttrs({ html: block.html || "" }, block._key, preserveIdentity)
899
1099
  };
900
- if (block._type === "break") return { type: "horizontalRule" };
1100
+ if (block._type === "break") return {
1101
+ type: "horizontalRule",
1102
+ attrs: identityAttrs(void 0, block._key, preserveIdentity)
1103
+ };
1104
+ if (block._type === "gallery") {
1105
+ if (preserveIdentity) return {
1106
+ type: PORTABLE_TEXT_BLOCK_NODE,
1107
+ attrs: { [PORTABLE_TEXT_BLOCK_ATTR]: block }
1108
+ };
1109
+ return {
1110
+ type: "paragraph",
1111
+ content: [{
1112
+ type: "text",
1113
+ text: `[Unknown block type: ${block._type}]`,
1114
+ marks: [{ type: "code" }]
1115
+ }]
1116
+ };
1117
+ }
1118
+ if (preserveIdentity) return {
1119
+ type: PORTABLE_TEXT_BLOCK_NODE,
1120
+ attrs: { [PORTABLE_TEXT_BLOCK_ATTR]: block }
1121
+ };
1122
+ if (block._type === "table") {
1123
+ const result = portableTextTableToProseMirror(block, {
1124
+ path,
1125
+ createKey: generateKey,
1126
+ spansToInline: (content, markDefs) => convertSpans(content, markDefs, preserveIdentity)
1127
+ });
1128
+ if (!result.ok) throw new UnsafePortableTextTableError(result.reason, result.raw, result.renderFallback);
1129
+ return result.node;
1130
+ }
901
1131
  return {
902
1132
  type: "paragraph",
903
1133
  content: [{
@@ -910,9 +1140,9 @@ function convertBlock(block) {
910
1140
  /**
911
1141
  * Convert text block to ProseMirror paragraph or heading
912
1142
  */
913
- function convertTextBlock(block) {
1143
+ function convertTextBlock(block, preserveIdentity) {
914
1144
  const { style = "normal", children, markDefs = [] } = block;
915
- const content = convertSpans(children, markDefs);
1145
+ const content = convertSpans(children, markDefs, preserveIdentity);
916
1146
  switch (style) {
917
1147
  case "h1":
918
1148
  case "h2":
@@ -921,14 +1151,15 @@ function convertTextBlock(block) {
921
1151
  case "h5":
922
1152
  case "h6": return {
923
1153
  type: "heading",
924
- attrs: {
1154
+ attrs: identityAttrs({
925
1155
  level: parseInt(style.substring(1), 10),
926
1156
  ...block.textAlign ? { textAlign: block.textAlign } : {}
927
- },
1157
+ }, block._key, preserveIdentity),
928
1158
  content: content.length > 0 ? content : void 0
929
1159
  };
930
1160
  case "blockquote": return {
931
1161
  type: "blockquote",
1162
+ attrs: identityAttrs(void 0, block._key, preserveIdentity),
932
1163
  content: [{
933
1164
  type: "paragraph",
934
1165
  content: content.length > 0 ? content : void 0
@@ -936,7 +1167,7 @@ function convertTextBlock(block) {
936
1167
  };
937
1168
  default: return {
938
1169
  type: "paragraph",
939
- attrs: block.textAlign ? { textAlign: block.textAlign } : void 0,
1170
+ attrs: identityAttrs(block.textAlign ? { textAlign: block.textAlign } : void 0, block._key, preserveIdentity),
940
1171
  content: content.length > 0 ? content : void 0
941
1172
  };
942
1173
  }
@@ -944,7 +1175,7 @@ function convertTextBlock(block) {
944
1175
  /**
945
1176
  * Convert list items to ProseMirror list
946
1177
  */
947
- function convertList(items, listType, context) {
1178
+ function convertList(items, listType, context, preserveIdentity) {
948
1179
  const rootItems = [];
949
1180
  let i = 0;
950
1181
  while (i < items.length) {
@@ -956,9 +1187,9 @@ function convertList(items, listType, context) {
956
1187
  nestedItems.push(items[i]);
957
1188
  i++;
958
1189
  }
959
- rootItems.push(convertListItem(item, nestedItems, listType, `${context}:${rootItems.length}`));
1190
+ rootItems.push(convertListItem(item, nestedItems, listType, `${context}:${rootItems.length}`, preserveIdentity));
960
1191
  } else {
961
- rootItems.push(convertListItem(item, [], listType, `${context}:${rootItems.length}`));
1192
+ rootItems.push(convertListItem(item, [], listType, `${context}:${rootItems.length}`, preserveIdentity));
962
1193
  i++;
963
1194
  }
964
1195
  }
@@ -975,11 +1206,12 @@ function convertList(items, listType, context) {
975
1206
  /**
976
1207
  * Convert a single list item to ProseMirror
977
1208
  */
978
- function convertListItem(item, nestedItems, parentListType, context) {
1209
+ function convertListItem(item, nestedItems, parentListType, context, preserveIdentity) {
979
1210
  const content = [];
980
- const spans = convertSpans(item.children, item.markDefs || []);
1211
+ const spans = convertSpans(item.children, item.markDefs || [], preserveIdentity);
981
1212
  content.push({
982
1213
  type: "paragraph",
1214
+ attrs: identityAttrs(void 0, item._key, preserveIdentity),
983
1215
  content: spans.length > 0 ? spans : void 0
984
1216
  });
985
1217
  if (nestedItems.length > 0) {
@@ -1002,7 +1234,7 @@ function convertListItem(item, nestedItems, parentListType, context) {
1002
1234
  ...ni,
1003
1235
  level: (ni.level || 2) - 1
1004
1236
  }));
1005
- content.push(convertList(adjustedGroup, anchorType, `${context}:nested:${j - nestedGroup.length}`));
1237
+ content.push(convertList(adjustedGroup, anchorType, `${context}:nested:${j - nestedGroup.length}`, preserveIdentity));
1006
1238
  }
1007
1239
  }
1008
1240
  }
@@ -1014,16 +1246,24 @@ function convertListItem(item, nestedItems, parentListType, context) {
1014
1246
  /**
1015
1247
  * Convert Portable Text spans to ProseMirror text nodes
1016
1248
  */
1017
- function convertSpans(spans, markDefs) {
1249
+ function convertSpans(spans, markDefs, preserveIdentity) {
1018
1250
  const nodes = [];
1019
1251
  const markDefsMap = new Map(markDefs.map((md) => [md._key, md]));
1020
1252
  for (const span of spans) {
1021
1253
  if (span._type !== "span") continue;
1254
+ const referencedMarkDefs = markDefs.filter((markDef) => span.marks?.includes(markDef._key));
1022
1255
  const parts = span.text.split("\n");
1023
1256
  for (let i = 0; i < parts.length; i++) {
1024
1257
  const text = parts[i];
1025
1258
  if (text.length > 0) {
1026
1259
  const marks = convertMarks(span.marks || [], markDefsMap);
1260
+ if (preserveIdentity) marks.push({
1261
+ type: PORTABLE_TEXT_SPAN_MARK,
1262
+ attrs: {
1263
+ key: span._key,
1264
+ markDefs: referencedMarkDefs
1265
+ }
1266
+ });
1027
1267
  const node = {
1028
1268
  type: "text",
1029
1269
  text
@@ -1031,7 +1271,16 @@ function convertSpans(spans, markDefs) {
1031
1271
  if (marks.length > 0) node.marks = marks;
1032
1272
  nodes.push(node);
1033
1273
  }
1034
- if (i < parts.length - 1) nodes.push({ type: "hardBreak" });
1274
+ if (i < parts.length - 1) nodes.push(preserveIdentity ? {
1275
+ type: "hardBreak",
1276
+ marks: [{
1277
+ type: PORTABLE_TEXT_SPAN_MARK,
1278
+ attrs: {
1279
+ key: span._key,
1280
+ markDefs: referencedMarkDefs
1281
+ }
1282
+ }]
1283
+ } : { type: "hardBreak" });
1035
1284
  }
1036
1285
  }
1037
1286
  return nodes;
@@ -1078,13 +1327,16 @@ function convertMarks(marks, markDefs) {
1078
1327
  }
1079
1328
  return pmMarks;
1080
1329
  }
1330
+ function imageAlignment(value) {
1331
+ return value === "left" || value === "center" || value === "right" || value === "wide" || value === "full" ? value : void 0;
1332
+ }
1081
1333
  /**
1082
1334
  * Convert image block to ProseMirror
1083
1335
  */
1084
- function convertImage(block) {
1336
+ function convertImage(block, preserveIdentity) {
1085
1337
  return {
1086
1338
  type: "image",
1087
- attrs: {
1339
+ attrs: identityAttrs({
1088
1340
  src: block.asset.url || block.asset._ref,
1089
1341
  alt: block.alt || "",
1090
1342
  title: block.caption || "",
@@ -1093,8 +1345,9 @@ function convertImage(block) {
1093
1345
  width: block.width,
1094
1346
  height: block.height,
1095
1347
  displayWidth: block.displayWidth,
1096
- displayHeight: block.displayHeight
1097
- }
1348
+ displayHeight: block.displayHeight,
1349
+ alignment: imageAlignment(block.alignment)
1350
+ }, block._key, preserveIdentity)
1098
1351
  };
1099
1352
  }
1100
1353
  /**
@@ -1102,10 +1355,10 @@ function convertImage(block) {
1102
1355
  * Handles blocks like `{ _type: "image", url: "...", alt: "..." }` that may
1103
1356
  * originate from migrations or third-party imports.
1104
1357
  */
1105
- function convertMalformedImage(block) {
1358
+ function convertMalformedImage(block, preserveIdentity) {
1106
1359
  return {
1107
1360
  type: "image",
1108
- attrs: {
1361
+ attrs: identityAttrs({
1109
1362
  src: "url" in block && typeof block.url === "string" ? block.url : "",
1110
1363
  alt: "alt" in block && typeof block.alt === "string" ? block.alt : "",
1111
1364
  title: "caption" in block && typeof block.caption === "string" ? block.caption : "",
@@ -1114,17 +1367,18 @@ function convertMalformedImage(block) {
1114
1367
  width: "width" in block && typeof block.width === "number" ? block.width : void 0,
1115
1368
  height: "height" in block && typeof block.height === "number" ? block.height : void 0,
1116
1369
  displayWidth: "displayWidth" in block && typeof block.displayWidth === "number" ? block.displayWidth : void 0,
1117
- displayHeight: "displayHeight" in block && typeof block.displayHeight === "number" ? block.displayHeight : void 0
1118
- }
1370
+ displayHeight: "displayHeight" in block && typeof block.displayHeight === "number" ? block.displayHeight : void 0,
1371
+ alignment: imageAlignment("alignment" in block ? block.alignment : void 0)
1372
+ }, block._key, preserveIdentity)
1119
1373
  };
1120
1374
  }
1121
1375
  /**
1122
1376
  * Convert code block to ProseMirror
1123
1377
  */
1124
- function convertCodeBlock(block) {
1378
+ function convertCodeBlock(block, preserveIdentity) {
1125
1379
  return {
1126
1380
  type: "codeBlock",
1127
- attrs: { language: block.language || null },
1381
+ attrs: identityAttrs({ language: block.language || null }, block._key, preserveIdentity),
1128
1382
  content: block.code ? [{
1129
1383
  type: "text",
1130
1384
  text: block.code
@@ -1569,9 +1823,11 @@ var HookPipeline = class HookPipeline {
1569
1823
  }
1570
1824
  /**
1571
1825
  * Run content:beforeSave hooks
1572
- * Returns modified content from the pipeline
1826
+ * Returns modified content from the pipeline. `id` is the existing item's
1827
+ * ID when updating. `actor` is the authenticated user that triggered the
1828
+ * save, when one is available.
1573
1829
  */
1574
- async runContentBeforeSave(content, collection, isNew) {
1830
+ async runContentBeforeSave(content, collection, isNew, id, actor) {
1575
1831
  const hooks = this.getTypedHooks("content:beforeSave");
1576
1832
  const results = [];
1577
1833
  let currentContent = content;
@@ -1582,6 +1838,8 @@ var HookPipeline = class HookPipeline {
1582
1838
  collection,
1583
1839
  isNew
1584
1840
  };
1841
+ if (id !== void 0) event.id = id;
1842
+ if (actor !== void 0) event.actor = { ...actor };
1585
1843
  const ctx = this.getContext(hook.pluginId);
1586
1844
  const start = Date.now();
1587
1845
  try {
@@ -1611,7 +1869,7 @@ var HookPipeline = class HookPipeline {
1611
1869
  /**
1612
1870
  * Run content:afterSave hooks
1613
1871
  */
1614
- async runContentAfterSave(content, collection, isNew) {
1872
+ async runContentAfterSave(content, collection, isNew, actor) {
1615
1873
  const hooks = this.getTypedHooks("content:afterSave");
1616
1874
  const results = [];
1617
1875
  for (const hook of hooks) {
@@ -1621,6 +1879,7 @@ var HookPipeline = class HookPipeline {
1621
1879
  collection,
1622
1880
  isNew
1623
1881
  };
1882
+ if (actor !== void 0) event.actor = { ...actor };
1624
1883
  const ctx = this.getContext(hook.pluginId);
1625
1884
  const start = Date.now();
1626
1885
  try {
@@ -2539,7 +2798,7 @@ var PluginRouteHandler = class {
2539
2798
  error: {
2540
2799
  code: "VALIDATION_ERROR",
2541
2800
  message: "Invalid request body",
2542
- details: parseResult.error.format()
2801
+ details: z$1.formatError(parseResult.error)
2543
2802
  },
2544
2803
  status: 400
2545
2804
  };
@@ -2846,16 +3105,16 @@ var PluginManager = class {
2846
3105
  /**
2847
3106
  * Run content:beforeSave hooks across all active plugins
2848
3107
  */
2849
- async runContentBeforeSave(content, collection, isNew) {
3108
+ async runContentBeforeSave(content, collection, isNew, id, actor) {
2850
3109
  this.ensureInitialized();
2851
- return this.hookPipeline.runContentBeforeSave(content, collection, isNew);
3110
+ return this.hookPipeline.runContentBeforeSave(content, collection, isNew, id, actor);
2852
3111
  }
2853
3112
  /**
2854
3113
  * Run content:afterSave hooks across all active plugins
2855
3114
  */
2856
- async runContentAfterSave(content, collection, isNew) {
3115
+ async runContentAfterSave(content, collection, isNew, actor) {
2857
3116
  this.ensureInitialized();
2858
- return this.hookPipeline.runContentAfterSave(content, collection, isNew);
3117
+ return this.hookPipeline.runContentAfterSave(content, collection, isNew, actor);
2859
3118
  }
2860
3119
  /**
2861
3120
  * Run content:beforeDelete hooks across all active plugins
@@ -3231,67 +3490,28 @@ function createNoopSandboxRunner(_options) {
3231
3490
  }
3232
3491
 
3233
3492
  //#endregion
3234
- //#region src/plugins/sandbox/types.ts
3235
- const SANDBOX_ROUTE_ERROR_DEFINITIONS = {
3236
- MEDIA_USAGE_ACTIVATION_IN_PROGRESS: {
3237
- message: "Media usage activation is in progress",
3238
- status: 503
3239
- },
3240
- MEDIA_USAGE_ACTIVATION_CHECK_FAILED: {
3241
- message: "Unable to verify media usage activation state",
3242
- status: 503
3243
- }
3244
- };
3493
+ //#region src/plugins/sandbox/hook-result.ts
3494
+ /** Current wire-format version for sandbox hook result envelopes. */
3495
+ const SANDBOX_HOOK_RESULT_VERSION = 1;
3496
+ /** Maximum editor-facing rejection reason accepted from a sandboxed plugin. */
3497
+ const MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH = 500;
3245
3498
  function isRecord(value) {
3246
- return typeof value === "object" && value !== null;
3247
- }
3248
- function isSandboxRouteErrorCode(value) {
3249
- return typeof value === "string" && value in SANDBOX_ROUTE_ERROR_DEFINITIONS;
3250
- }
3251
- function getSandboxRouteErrorDetails(error) {
3252
- if (!isRecord(error)) return null;
3253
- const propertyCode = isSandboxRouteErrorCode(error.code) ? error.code : null;
3254
- const nameCode = error instanceof Error && isSandboxRouteErrorCode(error.name) ? error.name : null;
3255
- if (propertyCode && nameCode && propertyCode !== nameCode) return null;
3256
- const code = propertyCode ?? nameCode;
3257
- if (!code || error.status !== void 0 && error.status !== 503) return null;
3258
- return {
3259
- code,
3260
- ...SANDBOX_ROUTE_ERROR_DEFINITIONS[code]
3261
- };
3499
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3262
3500
  }
3263
- function createSandboxRouteError(code) {
3264
- const details = {
3265
- code,
3266
- ...SANDBOX_ROUTE_ERROR_DEFINITIONS[code]
3501
+ /** Validate and normalize an untrusted value returned across the sandbox boundary. */
3502
+ function inspectSandboxHookResult(value) {
3503
+ if (!isRecord(value) || !Object.hasOwn(value, "__emdashSandboxHookResult")) return { kind: "value" };
3504
+ if (value.__emdashSandboxHookResult !== true || value.version !== SANDBOX_HOOK_RESULT_VERSION || !isRecord(value.error) || value.error.code !== "SAVE_REJECTED" || typeof value.error.reason !== "string") return { kind: "malformed" };
3505
+ const reason = value.error.reason.trim();
3506
+ if (reason.length === 0 || reason.length > MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH) return { kind: "malformed" };
3507
+ return {
3508
+ kind: "error",
3509
+ error: {
3510
+ code: "SAVE_REJECTED",
3511
+ reason
3512
+ }
3267
3513
  };
3268
- return Object.assign(new Error(details.message), details, { name: code });
3269
3514
  }
3270
- function createSandboxRouteErrorEnvelope(error) {
3271
- const details = getSandboxRouteErrorDetails(error);
3272
- return details ? {
3273
- __emdashSandboxRouteError: true,
3274
- error: details
3275
- } : null;
3276
- }
3277
- function getSandboxRouteErrorEnvelope(value) {
3278
- if (!isRecord(value) || value.__emdashSandboxRouteError !== true) return null;
3279
- const details = getSandboxRouteErrorDetails(value.error);
3280
- return details ? {
3281
- __emdashSandboxRouteError: true,
3282
- error: details
3283
- } : null;
3284
- }
3285
- /**
3286
- * Error thrown when the sandbox runtime is unavailable.
3287
- * This happens when the sidecar process has crashed or hasn't started.
3288
- */
3289
- var SandboxUnavailableError = class extends Error {
3290
- constructor(pluginId, reason) {
3291
- super(`Plugin sandbox unavailable for ${pluginId}: ${reason}`);
3292
- this.name = "SandboxUnavailableError";
3293
- }
3294
- };
3295
3515
 
3296
3516
  //#endregion
3297
3517
  //#region src/comments/ranking.ts
@@ -3523,6 +3743,18 @@ async function getMenusWithDb(db, options = {}) {
3523
3743
  return query.execute();
3524
3744
  }
3525
3745
  /**
3746
+ * Get a menu by name with a Workers edge-cache hint.
3747
+ *
3748
+ * Use the returned `cacheHint` with `Astro.cache.set()` so pages that render
3749
+ * this menu can be purged automatically when the menu is edited.
3750
+ */
3751
+ async function getMenuWithCacheHint(name, options = {}) {
3752
+ return {
3753
+ data: await getMenu(name, options),
3754
+ cacheHint: { tags: [menuTag(name)] }
3755
+ };
3756
+ }
3757
+ /**
3526
3758
  * Build a hierarchical menu tree from a flat list of items. Items are
3527
3759
  * resolved against the given `locale` so references land on the right
3528
3760
  * per-locale content rows.
@@ -3644,16 +3876,6 @@ function resolveMenuItem(item, urlPatterns, contentLookup, taxonomyLookup) {
3644
3876
  children: []
3645
3877
  };
3646
3878
  }
3647
- const SLUG_PLACEHOLDER = /\{slug\}/g;
3648
- const ID_PLACEHOLDER = /\{id\}/g;
3649
- /**
3650
- * Interpolate a URL pattern with entry data
3651
- *
3652
- * Replaces `{slug}` and `{id}` placeholders.
3653
- */
3654
- function interpolateUrlPattern(pattern, slug, id) {
3655
- return pattern.replace(SLUG_PLACEHOLDER, slug).replace(ID_PLACEHOLDER, id);
3656
- }
3657
3879
  async function resolveContentReferences(db, references, locale) {
3658
3880
  const entries = await Promise.all(Array.from(references, async ([collection, referenceGroups]) => {
3659
3881
  const lookup = /* @__PURE__ */ new Map();
@@ -3662,7 +3884,7 @@ async function resolveContentReferences(db, references, locale) {
3662
3884
  validateIdentifier(collection, "menu item collection");
3663
3885
  for (const batch of chunks([...referenceGroups], SQL_BATCH_SIZE)) {
3664
3886
  const result = await sql`
3665
- SELECT id, slug, locale, translation_group
3887
+ SELECT id, slug, published_at, locale, translation_group
3666
3888
  FROM ${sql.ref(`ec_${collection}`)}
3667
3889
  WHERE translation_group IN (${sql.join(batch)})
3668
3890
  `.execute(db);
@@ -3670,15 +3892,20 @@ async function resolveContentReferences(db, references, locale) {
3670
3892
  }
3671
3893
  for (const [referenceGroup, row] of localized) lookup.set(referenceGroup, {
3672
3894
  id: row.id,
3673
- slug: row.slug
3895
+ slug: row.slug,
3896
+ publishedAt: row.published_at
3674
3897
  });
3675
3898
  const unresolved = [...referenceGroups].filter((id) => !lookup.has(id));
3676
3899
  for (const batch of chunks(unresolved, SQL_BATCH_SIZE)) {
3677
3900
  const result = await sql`
3678
- SELECT id, slug FROM ${sql.ref(`ec_${collection}`)}
3901
+ SELECT id, slug, published_at FROM ${sql.ref(`ec_${collection}`)}
3679
3902
  WHERE id IN (${sql.join(batch)})
3680
3903
  `.execute(db);
3681
- for (const row of result.rows) lookup.set(row.id, row);
3904
+ for (const row of result.rows) lookup.set(row.id, {
3905
+ id: row.id,
3906
+ slug: row.slug,
3907
+ publishedAt: row.published_at
3908
+ });
3682
3909
  }
3683
3910
  } catch (error) {
3684
3911
  console.error(`Failed to resolve content URLs for ${collection}:`, error);
@@ -3703,9 +3930,13 @@ function resolveContentUrl(collection, referenceGroup, urlPatterns, contentLooku
3703
3930
  if (!referenceGroup) return null;
3704
3931
  const row = contentLookup.get(collection)?.get(referenceGroup);
3705
3932
  if (!row) return null;
3706
- const pattern = urlPatterns.get(collection);
3707
- if (pattern) return interpolateUrlPattern(pattern, row.slug, row.id);
3708
- return `/${collection}/${row.slug}`;
3933
+ return interpolateUrlPattern({
3934
+ pattern: urlPatterns.get(collection) ?? null,
3935
+ collection,
3936
+ slug: row.slug,
3937
+ id: row.id,
3938
+ date: row.publishedAt
3939
+ });
3709
3940
  }
3710
3941
  async function resolveTaxonomyReferences(db, referenceGroups, locale) {
3711
3942
  const lookup = /* @__PURE__ */ new Map();
@@ -3754,5 +3985,5 @@ function resolveTaxonomyUrl(referenceGroup, taxonomyLookup) {
3754
3985
  }
3755
3986
 
3756
3987
  //#endregion
3757
- export { portableText as A, isContentSaveRejection as C, definePlugin as D, resolveExclusiveHooks as E, file as M, image as N, portableTextToProsemirror as O, AuditRepository as P, ContentSaveRejectedError as S, createHookPipeline as T, PluginRouteRegistry as _, SandboxUnavailableError as a, toRouteCallerInfo as b, getSandboxRouteErrorDetails as c, SandboxNotAvailableError as d, createNoopSandboxRunner as f, PluginRouteError as g, createPluginManager as h, getComments as i, reference as j, prosemirrorToPortableText as k, getSandboxRouteErrorEnvelope as l, PluginManager as m, getMenus as n, createSandboxRouteError as o, NodeCronScheduler as p, getCommentCount as r, createSandboxRouteErrorEnvelope as s, getMenu as t, NoopSandboxRunner as u, buildRouteMeta as v, HookPipeline as w, EmailPipeline as x, parseRouteInput as y };
3758
- //# sourceMappingURL=menus-CNg0QlDt.mjs.map
3988
+ export { portableText as A, HookPipeline as C, portableTextToProsemirror as D, definePlugin as E, EmDashConfigurationError as F, file as M, image as N, prosemirrorToPortableText as O, AuditRepository as P, isContentSaveRejection as S, resolveExclusiveHooks as T, buildRouteMeta as _, getComments as a, EmailPipeline as b, inspectSandboxHookResult as c, createNoopSandboxRunner as d, NodeCronScheduler as f, PluginRouteRegistry as g, PluginRouteError as h, getCommentCount as i, reference as j, portableTextIdentityExtensions as k, NoopSandboxRunner as l, createPluginManager as m, getMenuWithCacheHint as n, MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH as o, PluginManager as p, getMenus as r, SANDBOX_HOOK_RESULT_VERSION as s, getMenu as t, SandboxNotAvailableError as u, parseRouteInput as v, createHookPipeline as w, ContentSaveRejectedError as x, toRouteCallerInfo as y };
3989
+ //# sourceMappingURL=menus-D8mC4eaN.mjs.map