@panphora/clayjs 1.23.0 → 1.24.1

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 (471) hide show
  1. package/dist/all.js +1 -1
  2. package/dist/blockeditor/themes/light-1.css +431 -0
  3. package/dist/clay-dom.js +1 -1
  4. package/dist/clay-events.js +1 -1
  5. package/dist/clay-internals.js +1 -1
  6. package/dist/clay-options.js +1 -1
  7. package/dist/clay-router.js +1 -1
  8. package/dist/clay-ui.js +1 -1
  9. package/dist/clay-utils.js +1 -1
  10. package/dist/clay.js +1 -1
  11. package/dist/clay.standalone.js +30285 -26613
  12. package/dist/m/c-277QP5ET.js +1 -0
  13. package/dist/m/c-2BLVA6IN.js +5 -0
  14. package/dist/m/c-2OJMOUPC.js +1 -0
  15. package/dist/m/c-2PVGJFI5.js +1 -0
  16. package/dist/m/{c-AYVGD6A6.js → c-3UW5EJ77.js} +1 -1
  17. package/dist/m/{c-T5NK2TVY.js → c-42ZNV7LI.js} +1 -1
  18. package/dist/m/{c-3TLG3OLG.js → c-46LJAZZJ.js} +1 -1
  19. package/dist/m/c-47IBJGPQ.js +1 -0
  20. package/dist/m/c-5FXEKU4Y.js +1 -0
  21. package/dist/m/c-5KXDKC5G.js +1 -0
  22. package/dist/m/{c-EUGJVHDD.js → c-5RZNFTWD.js} +1 -1
  23. package/dist/m/c-65LJU2H2.js +72 -0
  24. package/dist/m/{c-NQJRVJ56.js → c-6IJEVE6B.js} +1 -1
  25. package/dist/m/{c-NW54NHKE.js → c-6LEYVQJK.js} +1 -1
  26. package/dist/m/{c-GSRLXYWL.js → c-6Q6RGFBF.js} +1 -1
  27. package/dist/m/c-6RGEQNVV.js +1 -0
  28. package/dist/m/c-7CM4GMTS.js +6 -0
  29. package/dist/m/c-7NCWENHV.js +1 -0
  30. package/dist/m/c-7V6MGMX2.js +1 -0
  31. package/dist/m/{c-LKSL4AUJ.js → c-7WZSUTYP.js} +1 -1
  32. package/dist/m/c-A4L7APIU.js +1 -0
  33. package/dist/m/c-APGHGDZM.js +1 -0
  34. package/dist/m/c-AT7GLQGV.js +34 -0
  35. package/dist/m/{c-ZRXJD4G6.js → c-B7GOFGQR.js} +1 -1
  36. package/dist/m/{c-KDXIJEEF.js → c-BGN7RCTJ.js} +1 -1
  37. package/dist/m/c-BKM46LUJ.js +1 -0
  38. package/dist/m/c-BOMQIQ3V.js +1 -0
  39. package/dist/m/{c-62HZW5DH.js → c-C5AKJVRH.js} +1 -1
  40. package/dist/m/{c-BXYSDKAN.js → c-CJ7QYEWI.js} +1 -1
  41. package/dist/m/c-CTGRDT6E.js +1 -0
  42. package/dist/m/c-CV4T65JE.js +6 -0
  43. package/dist/m/c-CVSWLX3X.js +1 -0
  44. package/dist/m/c-CZHTXGJS.js +1 -0
  45. package/dist/m/c-D7NT5S4F.js +1 -0
  46. package/dist/m/c-DD26VXAP.js +1 -0
  47. package/dist/m/{c-ANNFZFLN.js → c-DDS23EY6.js} +1 -1
  48. package/dist/m/{c-ALDVFPWL.js → c-DFKBGSN2.js} +1 -1
  49. package/dist/m/c-DIKR7H57.js +147 -0
  50. package/dist/m/c-DXPOFLEJ.js +1 -0
  51. package/dist/m/c-EDE45NM7.js +1 -0
  52. package/dist/m/c-EILLN2H2.js +1 -0
  53. package/dist/m/c-EODTTNVA.js +1 -0
  54. package/dist/m/{c-G6COVIZB.js → c-ESK4S67I.js} +1 -1
  55. package/dist/m/c-FDWR3FL7.js +1 -0
  56. package/dist/m/{c-WQZTI5P2.js → c-FEC6LGFF.js} +1 -1
  57. package/dist/m/c-FLEIU6CG.js +1 -0
  58. package/dist/m/c-FQAQRXGK.js +1 -0
  59. package/dist/m/{c-W4JCVLAB.js → c-FSQXFG5T.js} +1 -1
  60. package/dist/m/c-FVPNX2GO.js +135 -0
  61. package/dist/m/c-FYDKYW6E.js +1 -0
  62. package/dist/m/c-GNI7WHKF.js +32 -0
  63. package/dist/m/c-GO635CRU.js +3 -0
  64. package/dist/m/c-H3FNLBHN.js +2 -0
  65. package/dist/m/c-HDVH3MVC.js +72 -0
  66. package/dist/m/c-HIX5H5L7.js +1 -0
  67. package/dist/m/c-HKSLOVU4.js +1 -0
  68. package/dist/m/{c-SGRIYOAJ.js → c-HL6BLJNA.js} +1 -1
  69. package/dist/m/c-HTLYXCUH.js +1 -0
  70. package/dist/m/{c-QIR5CAKM.js → c-IUL7PU4P.js} +1 -1
  71. package/dist/m/c-IXO7EI2Q.js +1 -0
  72. package/dist/m/{c-W5E5P2TZ.js → c-JQF2EUCG.js} +1 -1
  73. package/dist/m/{c-NEL7HQW3.js → c-JWDCQL6J.js} +1 -1
  74. package/dist/m/c-KQKKIVLW.js +20 -0
  75. package/dist/m/c-LATNQ6Q5.js +1 -0
  76. package/dist/m/c-LD6UVV5R.js +1 -0
  77. package/dist/m/c-LS7IVQVW.js +1 -0
  78. package/dist/m/{c-JCOQVZYS.js → c-LSVN3OLG.js} +1 -1
  79. package/dist/m/{c-JDZDF2QM.js → c-LTSPHVAK.js} +1 -1
  80. package/dist/m/c-MFOSMAVM.js +3 -0
  81. package/dist/m/c-MJ7GVE46.js +1 -0
  82. package/dist/m/c-MP6S4AZU.js +6 -0
  83. package/dist/m/c-MQKSKQHG.js +2 -0
  84. package/dist/m/{c-UHUNXWKN.js → c-MQYEDF3Q.js} +1 -1
  85. package/dist/m/{c-IHUWUKIU.js → c-MR75YPRT.js} +1 -1
  86. package/dist/m/c-ND3Q2G2I.js +1 -0
  87. package/dist/m/c-NEQRFC4O.js +1 -0
  88. package/dist/m/{c-5FKRZNJV.js → c-NFQFV7OP.js} +1 -1
  89. package/dist/m/c-NHXOBD6A.js +1 -0
  90. package/dist/m/{c-QIKT6SKM.js → c-NICICT4P.js} +1 -1
  91. package/dist/m/c-NQAPWM7O.js +1 -0
  92. package/dist/m/{c-QUGCKMWF.js → c-NVU3DORS.js} +1 -1
  93. package/dist/m/{c-LWIDDWAR.js → c-OCYG4NBQ.js} +22 -22
  94. package/dist/m/c-OH2FPYSY.js +19 -0
  95. package/dist/m/c-OYHI67B6.js +1 -0
  96. package/dist/m/{c-R2XUODVY.js → c-OYW5MFPZ.js} +1 -1
  97. package/dist/m/{c-5B4YBZXC.js → c-P2HKMJAW.js} +1 -1
  98. package/dist/m/{c-TSBVMWAH.js → c-PCNJETUA.js} +1 -1
  99. package/dist/m/c-PDBNCJCT.js +1 -0
  100. package/dist/m/c-PGSBXHUE.js +1 -0
  101. package/dist/m/{c-5TIZ2I64.js → c-PYG2NGWU.js} +1 -1
  102. package/dist/m/c-Q26XHBLQ.js +1 -0
  103. package/dist/m/c-Q6BG3ZLO.js +1 -0
  104. package/dist/m/c-QENKN7QI.js +1 -0
  105. package/dist/m/c-QQFHEODI.js +1 -0
  106. package/dist/m/c-QTEUO2K6.js +1 -0
  107. package/dist/m/c-R23UHMXG.js +1 -0
  108. package/dist/m/c-RETTCOWO.js +10 -0
  109. package/dist/m/c-SE3SIY7Y.js +7 -0
  110. package/dist/m/{c-XX75FFNL.js → c-SGGGCIVD.js} +1 -1
  111. package/dist/m/c-SGH3UTF3.js +1 -0
  112. package/dist/m/c-SIM7Z3U7.js +1 -0
  113. package/dist/m/{c-X5LNHET5.js → c-SKMIR5HQ.js} +1 -1
  114. package/dist/m/{c-R27DWQKX.js → c-STRI73GQ.js} +1 -1
  115. package/dist/m/c-SUXHUL7U.js +1 -0
  116. package/dist/m/c-SXGEWPFC.js +10 -0
  117. package/dist/m/c-SXNSSHPP.js +1 -0
  118. package/dist/m/c-T3P3AXEW.js +1 -0
  119. package/dist/m/{c-PXLTUYZC.js → c-TFLRT5JX.js} +1 -1
  120. package/dist/m/{c-YCLU4UNT.js → c-TGIMBAWE.js} +1 -1
  121. package/dist/m/c-TGSHHFO6.js +1 -0
  122. package/dist/m/c-U4NTUVDZ.js +1 -0
  123. package/dist/m/c-UOOIF2AL.js +1 -0
  124. package/dist/m/{c-6TYGD5AB.js → c-UOUUI265.js} +1 -1
  125. package/dist/m/c-V2U3F4QX.js +1 -0
  126. package/dist/m/c-V2V5FKXX.js +1 -0
  127. package/dist/m/c-VBXRXTVS.js +26 -0
  128. package/dist/m/c-VHSMPITY.js +1 -0
  129. package/dist/m/c-VPXCXBDT.js +1 -0
  130. package/dist/m/c-WCG6AKA7.js +1 -0
  131. package/dist/m/c-WNOLMHI2.js +1 -0
  132. package/dist/m/{c-CRPIDGXC.js → c-X6MOYATI.js} +1 -1
  133. package/dist/m/{c-FQGHR32O.js → c-X75G43SZ.js} +1 -1
  134. package/dist/m/c-XB6EAIAR.js +13 -0
  135. package/dist/m/c-XMIDHEKF.js +1 -0
  136. package/dist/m/c-XUZMRQ7O.js +4 -0
  137. package/dist/m/{c-2Z22FCFK.js → c-XW5TIYYB.js} +1 -1
  138. package/dist/m/c-YDW4VCHP.js +1 -0
  139. package/dist/m/{c-QGAPG7OM.js → c-YLHTD3KX.js} +1 -1
  140. package/dist/m/c-YNIEIPBS.js +1 -0
  141. package/dist/m/c-Z4G2UK6T.js +4 -0
  142. package/dist/m/c-Z6MROEQ4.js +1 -0
  143. package/dist/m/c-ZFO5RW6G.js +2 -0
  144. package/dist/m/c-ZGCO4J3H.js +8 -0
  145. package/dist/m/c-ZKKAF4UT.js +3 -0
  146. package/dist/m/c-ZRGEN6QQ.js +4 -0
  147. package/dist/m/core/{admin-attrs-U7IJNYBG.js → admin-attrs-ONRWVXPK.js} +1 -1
  148. package/dist/m/core/{autosave-F5YQCKVL.js → autosave-TBKAAAFB.js} +1 -1
  149. package/dist/m/core/conflict-notice-FOEE6I7E.js +1 -0
  150. package/dist/m/core/draft-mode-4MCL3LYI.js +1 -0
  151. package/dist/m/core/{host-permission-6EVJGNPL.js → host-permission-X4BENZEU.js} +1 -1
  152. package/dist/m/core/{is-edit-mode-GCX6767E.js → is-edit-mode-FFHCQ5DR.js} +1 -1
  153. package/dist/m/core/{persist-CJXIL7D4.js → persist-6ILUR34S.js} +1 -1
  154. package/dist/m/core/{recovery-DRFZRJED.js → recovery-APWADU4K.js} +1 -1
  155. package/dist/m/core/save-6HT2LABE.js +1 -0
  156. package/dist/m/core/save-core-EVMNZQ4V.js +1 -0
  157. package/dist/m/core/site-edits-G4BOZMV4.js +1 -0
  158. package/dist/m/core/{unsaved-warning-HNQVTA2D.js → unsaved-warning-ITZDIZ2I.js} +1 -1
  159. package/dist/m/internals/{index-NRPNDTSA.js → index-HS3CQDFW.js} +1 -1
  160. package/dist/m/loader-GLLVDUZA.js +1 -0
  161. package/dist/m/manifest-50FF1C45.js +1 -0
  162. package/dist/m/manifest-edit-BE1A621D.js +1 -0
  163. package/dist/m/manifest.json +2072 -1811
  164. package/dist/m/page/editor-KAZDJNND.js +307 -0
  165. package/dist/m/plugins/ai-edit-LABECCSN.js +6 -0
  166. package/dist/m/plugins/{cms-H7DTMUQX.js → cms-T2HLI7JG.js} +16 -16
  167. package/dist/m/plugins/{demo-42BSYQ7T.js → demo-T7B4RIKL.js} +1 -1
  168. package/dist/m/plugins/{derive-QVI3LI3A.js → derive-6LPJOCAV.js} +1 -1
  169. package/dist/m/plugins/indicator-J4ABFARX.js +1 -0
  170. package/dist/m/plugins/{live-DCUBKXY4.js → live-PGBIEMGB.js} +1 -1
  171. package/dist/m/plugins/menu-YZL3X2AJ.js +1 -0
  172. package/dist/m/plugins/page-WOCNX2IN.js +2 -0
  173. package/dist/m/plugins/page-view-SJODOOGE.js +1 -0
  174. package/dist/m/plugins/{people-5XRNRP5U.js → people-C4TCWFOQ.js} +1 -1
  175. package/dist/m/plugins/{quickcrop-WWF5I422.js → quickcrop-X5MRIBAP.js} +2 -2
  176. package/dist/m/plugins/richclay-Y2NV44NA.js +549 -0
  177. package/dist/m/plugins/sortable-XCHQG65Z.js +1 -0
  178. package/dist/m/plugins/{source-6BKMK4PO.js → source-YK7MO23W.js} +1 -1
  179. package/dist/m/plugins/{undo-3JEYK5QY.js → undo-VLRBQNPN.js} +1 -1
  180. package/dist/m/plugins/upgrade-NNTJBSK2.js +1 -0
  181. package/dist/m/plugins/{upload-TTCQRIM5.js → upload-ZKKJV76X.js} +1 -1
  182. package/dist/m/plugins/visitor-drafts-RTZNONHT.js +20 -0
  183. package/dist/m/plugins/{visitor-drafts-owner-Z5B2OQBR.js → visitor-drafts-owner-LHUHFU3L.js} +1 -1
  184. package/dist/m/plugins/{visitor-menu-4LQMKLPP.js → visitor-menu-FY4KM2SW.js} +1 -1
  185. package/dist/m/plugins/wire-M2NR354P.js +1 -0
  186. package/dist/m/{reader-core-POFQCKRV.js → reader-core-T2S3JC4E.js} +2 -2
  187. package/dist/m/sync/live-sync-Z64YREWQ.js +1 -0
  188. package/dist/m/ui/index-MGTWOW2C.js +1 -0
  189. package/dist/m/vendor/{sap-core.vendor-OA5SKL7Q.js → sap-core.vendor-QAEPMETX.js} +1 -1
  190. package/dist/offline-manifest.json +1250 -1082
  191. package/dist/server/core.cjs +132 -109
  192. package/dist/server/page-compaction-worker.cjs +5 -5
  193. package/dist/server/rooms.mjs +3 -1
  194. package/docs/guide.md +89 -44
  195. package/entries/clay-data.js +1 -1
  196. package/entries/sap.js +1 -1
  197. package/package.json +5 -3
  198. package/src/blockeditor/themes/content.css +70 -0
  199. package/src/blockeditor/themes/light-1.css +431 -0
  200. package/src/blockeditor/themes/light-1.source.css +270 -0
  201. package/src/blockeditor/themes/light-2.css +211 -0
  202. package/src/blockeditor/themes/light-3.css +130 -0
  203. package/src/blockeditor/themes/light-4.css +299 -0
  204. package/src/core/conflict-notice.js +28 -0
  205. package/src/core/draft-mode.js +6 -0
  206. package/src/core/host-meta.js +6 -6
  207. package/src/core/is-edit-mode.js +9 -3
  208. package/src/core/mode-support.js +3 -0
  209. package/src/core/mode-switch.js +4 -4
  210. package/src/core/mode-transition.js +3 -1
  211. package/src/core/page-format-wire.js +1 -1
  212. package/src/core/page-format.js +8 -8
  213. package/src/core/save-accepted.js +6 -7
  214. package/src/core/save-core.js +52 -23
  215. package/src/core/save-failure-notice.js +37 -0
  216. package/src/core/save-feedback.js +6 -0
  217. package/src/core/save-replace.js +1 -1
  218. package/src/core/save-size.js +2 -2
  219. package/src/core/save.js +78 -15
  220. package/src/core/site-edits.js +166 -0
  221. package/src/core/unsaved-warning.js +2 -2
  222. package/src/core/upgrade-run.js +4 -4
  223. package/src/lib/ai-comment.js +23 -0
  224. package/src/lib/effect.js +8 -0
  225. package/src/lib/idb-error-code.js +20 -0
  226. package/src/live/fast-lane.js +10 -10
  227. package/src/live/local-lane.js +10 -10
  228. package/src/live/page-compaction.js +8 -8
  229. package/src/live/server-lane.js +1 -1
  230. package/src/loader-logic.js +48 -18
  231. package/src/loader.js +11 -6
  232. package/src/page/adopt-boot.js +1 -1
  233. package/src/page/adopt.js +2 -2
  234. package/src/page/ai-area.js +182 -0
  235. package/src/page/ai-preview.js +80 -0
  236. package/src/page/ai-surface.js +257 -0
  237. package/src/page/ai-tool.js +308 -145
  238. package/src/page/announce.js +2 -2
  239. package/src/page/awareness.js +18 -18
  240. package/src/page/blocks.js +35 -34
  241. package/src/page/blocksel.js +2 -2
  242. package/src/page/board-drag.js +11 -11
  243. package/src/page/board-face.js +1 -1
  244. package/src/page/board-panel.js +26 -26
  245. package/src/page/board-style.js +127 -127
  246. package/src/page/board-view.js +48 -48
  247. package/src/page/chart.js +29 -29
  248. package/src/page/checkpoint-proof.js +19 -19
  249. package/src/page/chrome.js +74 -65
  250. package/src/page/clipboard-shape.js +1 -1
  251. package/src/page/csv-import.js +4 -4
  252. package/src/page/drag.js +5 -5
  253. package/src/page/editor.js +301 -296
  254. package/src/page/export-html.js +8 -8
  255. package/src/page/features/checklist.js +36 -36
  256. package/src/page/features/export-html.js +19 -19
  257. package/src/page/features/export-markdown.js +10 -10
  258. package/src/page/features/import-markdown.js +13 -13
  259. package/src/page/features/media.js +50 -50
  260. package/src/page/features/table.js +17 -17
  261. package/src/page/features/title-cover.js +17 -17
  262. package/src/page/features/title-icon.js +7 -7
  263. package/src/page/features/toc.js +1 -1
  264. package/src/page/features/tool.js +42 -18
  265. package/src/page/format-command.js +4 -4
  266. package/src/page/format-gate.js +6 -6
  267. package/src/page/format-host.js +6 -6
  268. package/src/page/format-level.js +3 -3
  269. package/src/page/format-native-commands.js +2 -2
  270. package/src/page/highlight-slot.js +1 -1
  271. package/src/page/highlight.js +4 -4
  272. package/src/page/history-intent.js +2 -2
  273. package/src/page/image-actions.js +4 -4
  274. package/src/page/link.js +10 -10
  275. package/src/page/media.js +3 -3
  276. package/src/page/mention-picker.js +7 -7
  277. package/src/page/merge.js +1 -1
  278. package/src/page/placeholder.js +3 -3
  279. package/src/page/projection.js +11 -11
  280. package/src/page/reader-patch.js +2 -2
  281. package/src/page/recover.js +26 -26
  282. package/src/page/recovery-ui.js +28 -28
  283. package/src/page/rich/chart.js +1 -1
  284. package/src/page/rich/page-tool.js +21 -6
  285. package/src/page/rich/tool-runtime.js +3 -2
  286. package/src/page/save-projection.js +2 -2
  287. package/src/page/save-states.js +9 -9
  288. package/src/page/schema.js +9 -9
  289. package/src/page/table-style.js +21 -21
  290. package/src/page/toc-link.js +1 -1
  291. package/src/page/tool-capability.js +8 -3
  292. package/src/page/tool-transport.js +52 -0
  293. package/src/page/tool-views.js +4 -0
  294. package/src/page/tools.js +6 -1
  295. package/src/page/view.js +6 -6
  296. package/src/page/ybind/binding.js +1 -1
  297. package/src/page/ybind/conversion.js +1 -1
  298. package/src/page/ybind/layout.js +4 -4
  299. package/src/page/ybind/migrate.js +1 -1
  300. package/src/page/ybind/origins.js +2 -2
  301. package/src/page/ybind/provider.js +2 -2
  302. package/src/page/ybind/recovery-proof.js +3 -3
  303. package/src/page/ybind/recovery-replay.js +2 -2
  304. package/src/plugins/ai-edit/picker.js +235 -0
  305. package/src/plugins/ai-edit.js +220 -34
  306. package/src/plugins/indicator-chip.js +39 -34
  307. package/src/plugins/indicator.js +13 -4
  308. package/src/plugins/live.js +21 -13
  309. package/src/plugins/menu/actions.js +89 -17
  310. package/src/plugins/menu/seo.js +32 -6
  311. package/src/plugins/menu/shell-style.js +26 -7
  312. package/src/plugins/menu/shell.js +12 -7
  313. package/src/plugins/menu/variants.js +6 -10
  314. package/src/plugins/menu/visitor.js +44 -34
  315. package/src/plugins/menu.js +3 -2
  316. package/src/plugins/page-view.js +2 -2
  317. package/src/plugins/page.js +257 -98
  318. package/src/plugins/sortable.js +7 -0
  319. package/src/plugins/upgrade.js +2 -1
  320. package/src/plugins/visitor-drafts/commit.js +303 -0
  321. package/src/plugins/visitor-drafts/idb.js +221 -0
  322. package/src/plugins/visitor-drafts/intro-style.js +1 -1
  323. package/src/plugins/visitor-drafts/intro.js +8 -25
  324. package/src/plugins/visitor-drafts/prompt.js +30 -4
  325. package/src/plugins/visitor-drafts/session.js +345 -0
  326. package/src/plugins/visitor-drafts/store.js +351 -32
  327. package/src/plugins/visitor-drafts.js +158 -27
  328. package/src/server/checkpoint/index.js +8 -8
  329. package/src/server/rooms/index.js +2 -2
  330. package/src/server/rooms/live-data-rooms.js +35 -35
  331. package/src/server/rooms/live-page-history.js +2 -2
  332. package/src/server/rooms/page-admission.js +34 -6
  333. package/src/server/rooms/page-conversion.js +1 -1
  334. package/src/server/rooms/page-lineage.js +4 -4
  335. package/src/server/rooms/page-rebase.js +4 -4
  336. package/src/server/rooms/page-room-conformance.js +14 -14
  337. package/src/server/rooms/page-state.js +2 -2
  338. package/src/server/rooms/page-write-admission.js +7 -7
  339. package/src/server/rooms/page-write-guard.js +3 -3
  340. package/src/sync/data-guard-notice.js +265 -0
  341. package/src/sync/live-sync.js +54 -11
  342. package/src/sync/page-relay.js +4 -4
  343. package/src/sync/presence-store.js +1 -1
  344. package/src/sync/presence-target.js +3 -3
  345. package/src/sync/presence.js +1 -1
  346. package/src/sync/stream.js +54 -13
  347. package/src/sync/wire-profile.js +8 -3
  348. package/src/ui/bevel.js +1 -1
  349. package/src/ui/index.js +9 -10
  350. package/src/ui/skins/cms.js +1 -1
  351. package/src/ui/skins/quickcrop.js +1 -1
  352. package/src/ui/skins/richclay.js +2 -2
  353. package/src/ui/toast-lazy.js +12 -3
  354. package/src/ui/toast.js +9 -3
  355. package/src/vendor/hyper-html-api-data.vendor.js +1 -1
  356. package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
  357. package/src/vendor/hypercms.vendor.js +16 -16
  358. package/src/vendor/richclay.vendor.js +48 -20
  359. package/src/vendor/sap-core.vendor.js +1 -1
  360. package/tool-generation/context.md +44 -0
  361. package/tool-generation/system.md +23 -0
  362. package/dist/m/c-24PMUJIV.js +0 -2
  363. package/dist/m/c-2AYVYEI4.js +0 -1
  364. package/dist/m/c-2AZDZWCK.js +0 -1
  365. package/dist/m/c-2L6O5PDS.js +0 -6
  366. package/dist/m/c-2RYOGUQM.js +0 -2
  367. package/dist/m/c-2ZVOEU4M.js +0 -1
  368. package/dist/m/c-37NAONZA.js +0 -1
  369. package/dist/m/c-3GJ4SDE2.js +0 -1
  370. package/dist/m/c-3O7OBDCM.js +0 -1
  371. package/dist/m/c-5OJ7YF2N.js +0 -1
  372. package/dist/m/c-5WMXEKFH.js +0 -135
  373. package/dist/m/c-6RDOKLN7.js +0 -1
  374. package/dist/m/c-A4IP6MBC.js +0 -1
  375. package/dist/m/c-A6L3FMUS.js +0 -1
  376. package/dist/m/c-ATKAOH23.js +0 -1
  377. package/dist/m/c-B6O7AJYG.js +0 -32
  378. package/dist/m/c-BCGWJYXW.js +0 -1
  379. package/dist/m/c-BGKAT2FL.js +0 -7
  380. package/dist/m/c-BYTKL6UX.js +0 -1
  381. package/dist/m/c-DHBRA6DL.js +0 -1
  382. package/dist/m/c-DTMZ3ZHI.js +0 -1
  383. package/dist/m/c-E3ZXARWA.js +0 -1
  384. package/dist/m/c-EK63G3CG.js +0 -1
  385. package/dist/m/c-ELYIIYRS.js +0 -1
  386. package/dist/m/c-EXKHPOVC.js +0 -3
  387. package/dist/m/c-FCSZ3DC5.js +0 -20
  388. package/dist/m/c-FTWGYI5E.js +0 -1
  389. package/dist/m/c-G4PWUDD5.js +0 -1
  390. package/dist/m/c-GBKB5WDL.js +0 -2
  391. package/dist/m/c-GBTVCJXC.js +0 -1
  392. package/dist/m/c-GC2HICFJ.js +0 -1
  393. package/dist/m/c-GRWMD6O5.js +0 -1
  394. package/dist/m/c-HCNWJE4A.js +0 -4
  395. package/dist/m/c-HG2C77BM.js +0 -4
  396. package/dist/m/c-JGHEACGK.js +0 -1
  397. package/dist/m/c-JGLX6TBK.js +0 -1
  398. package/dist/m/c-JNRKHYWO.js +0 -1
  399. package/dist/m/c-KBS3UV6B.js +0 -1
  400. package/dist/m/c-KQ7E3PYY.js +0 -1
  401. package/dist/m/c-L3F5ZLIV.js +0 -1
  402. package/dist/m/c-L4KMT7FO.js +0 -6
  403. package/dist/m/c-L5VFATT6.js +0 -1
  404. package/dist/m/c-LCYPMULG.js +0 -1
  405. package/dist/m/c-LIGQYZ7M.js +0 -6
  406. package/dist/m/c-LKIWEPAV.js +0 -1
  407. package/dist/m/c-MPSKIU2I.js +0 -1
  408. package/dist/m/c-N7JPUPGC.js +0 -1
  409. package/dist/m/c-NK33MMYF.js +0 -1
  410. package/dist/m/c-NQLWOHLH.js +0 -10
  411. package/dist/m/c-NTHUTABN.js +0 -1
  412. package/dist/m/c-NWX3MFT4.js +0 -1
  413. package/dist/m/c-OKXI52N7.js +0 -1
  414. package/dist/m/c-OPONJ2UK.js +0 -128
  415. package/dist/m/c-OWQWOGYI.js +0 -1
  416. package/dist/m/c-P6Q2ZTFQ.js +0 -1
  417. package/dist/m/c-QEN6HZCA.js +0 -1
  418. package/dist/m/c-QIXT3Q7C.js +0 -28
  419. package/dist/m/c-QM5LXRDT.js +0 -9
  420. package/dist/m/c-QYYUVLVG.js +0 -1
  421. package/dist/m/c-RQRMPZXD.js +0 -1
  422. package/dist/m/c-SBCBXKOZ.js +0 -26
  423. package/dist/m/c-SKF5HL4I.js +0 -4
  424. package/dist/m/c-SRPC3VBE.js +0 -1
  425. package/dist/m/c-TANBH7FI.js +0 -1
  426. package/dist/m/c-THGQQDYY.js +0 -1
  427. package/dist/m/c-UD5JZTDL.js +0 -1
  428. package/dist/m/c-UDGEFWNU.js +0 -1
  429. package/dist/m/c-UGNV5MFB.js +0 -1
  430. package/dist/m/c-VIRFF5HG.js +0 -8
  431. package/dist/m/c-VJYEVRYK.js +0 -1
  432. package/dist/m/c-VQCEOGKH.js +0 -13
  433. package/dist/m/c-VYJ7O4RI.js +0 -34
  434. package/dist/m/c-W7IPVCAA.js +0 -1
  435. package/dist/m/c-WBGWGOM7.js +0 -1
  436. package/dist/m/c-WJ5DRBHT.js +0 -72
  437. package/dist/m/c-X5WC4PX5.js +0 -1
  438. package/dist/m/c-XCFQEWW6.js +0 -3
  439. package/dist/m/c-XGH4GS2T.js +0 -1
  440. package/dist/m/c-XLQ3BDMM.js +0 -1
  441. package/dist/m/c-ZQXNHZZT.js +0 -72
  442. package/dist/m/core/conflict-notice-42H4ASLA.js +0 -1
  443. package/dist/m/core/draft-mode-WSQAT67S.js +0 -1
  444. package/dist/m/core/save-ESPSQPLV.js +0 -1
  445. package/dist/m/core/save-core-6SQHOR6W.js +0 -1
  446. package/dist/m/loader-FBDE2UAB.js +0 -1
  447. package/dist/m/manifest-1D2F5CA5.js +0 -1
  448. package/dist/m/manifest-edit-F7CC5CFD.js +0 -1
  449. package/dist/m/page/editor-OSKOW6RS.js +0 -304
  450. package/dist/m/plugins/ai-edit-VV4QTINH.js +0 -6
  451. package/dist/m/plugins/indicator-WVPGMOZ7.js +0 -1
  452. package/dist/m/plugins/menu-Q4MFFQ6E.js +0 -1
  453. package/dist/m/plugins/page-OAWUJQEL.js +0 -2
  454. package/dist/m/plugins/page-view-DZ26ZDDQ.js +0 -1
  455. package/dist/m/plugins/richclay-PGOOJ4OK.js +0 -517
  456. package/dist/m/plugins/sortable-266HY6TR.js +0 -1
  457. package/dist/m/plugins/upgrade-BNZVFHMZ.js +0 -1
  458. package/dist/m/plugins/visitor-drafts-2AUYKAIJ.js +0 -20
  459. package/dist/m/plugins/wire-W2EV36KZ.js +0 -1
  460. package/dist/m/sync/live-sync-XGUPHI3I.js +0 -1
  461. package/dist/m/ui/index-VGYAKAKI.js +0 -1
  462. package/dist/page/themes/light-1.css +0 -431
  463. package/src/page/themes/content.css +0 -70
  464. package/src/page/themes/light-1.css +0 -431
  465. package/src/page/themes/light-1.source.css +0 -270
  466. package/src/page/themes/light-2.css +0 -211
  467. package/src/page/themes/light-3.css +0 -130
  468. package/src/page/themes/light-4.css +0 -299
  469. /package/dist/m/{c-FILLTJA7.js → c-QTTJYJMA.js} +0 -0
  470. /package/dist/m/plugins/{quickcrop-WWF5I422.js.LEGAL.txt → quickcrop-X5MRIBAP.js.LEGAL.txt} +0 -0
  471. /package/dist/m/plugins/{richclay-PGOOJ4OK.js.LEGAL.txt → richclay-Y2NV44NA.js.LEGAL.txt} +0 -0
@@ -31194,6 +31194,7 @@ __export(rooms_exports, {
31194
31194
  applyOps: () => applyOps,
31195
31195
  applyTracked: () => applyTracked,
31196
31196
  assignDeep: () => assignDeep,
31197
+ blockeditorFormatFloor: () => blockeditorFormatFloor,
31197
31198
  captureFormat: () => captureFormat,
31198
31199
  checkOp: () => checkOp,
31199
31200
  checkPageConversion: () => checkPageConversion,
@@ -31222,10 +31223,11 @@ __export(rooms_exports, {
31222
31223
  isYPageValue: () => isYPageValue,
31223
31224
  liveTags: () => liveTags,
31224
31225
  makePageTransition: () => makePageTransition,
31226
+ oldBlockeditorFormat: () => oldBlockeditorFormat,
31227
+ oldFormatRefusal: () => oldFormatRefusal,
31225
31228
  overlaps: () => overlaps,
31226
31229
  pageBaseline: () => pageBaseline,
31227
31230
  pageCompactionWorkerUrl: () => pageCompactionWorkerUrl,
31228
- pageFormatFloor: () => pageFormatFloor,
31229
31231
  pageLineageLost: () => pageLineageLost,
31230
31232
  pageRev: () => pageRev,
31231
31233
  pageTransitionState: () => pageTransitionState,
@@ -53857,7 +53859,7 @@ var schema = new Qr.Schema({
53857
53859
  due: { default: null }
53858
53860
  },
53859
53861
  toDOM: (n) => ["div", ref(n, {
53860
- class: "page-li",
53862
+ class: "blockeditor-li",
53861
53863
  "data-kind": n.attrs.kind,
53862
53864
  "data-indent": String(n.attrs.indent),
53863
53865
  "data-checked": n.attrs.checked ? "true" : "false"
@@ -53873,7 +53875,7 @@ var schema = new Qr.Schema({
53873
53875
  group: "block",
53874
53876
  content: "inline*",
53875
53877
  attrs: block,
53876
- toDOM: (n) => ["aside", ref(n, { class: "page-callout" }), 0]
53878
+ toDOM: (n) => ["aside", ref(n, { class: "blockeditor-callout" }), 0]
53877
53879
  },
53878
53880
  code_block: {
53879
53881
  group: "block",
@@ -53888,7 +53890,7 @@ var schema = new Qr.Schema({
53888
53890
  group: "block",
53889
53891
  content: "inline*",
53890
53892
  attrs: { ...block, open: { default: false }, level: { default: null } },
53891
- toDOM: (n) => ["div", ref(n, { class: "page-toggle", "data-open": n.attrs.open ? "true" : "false", ...n.attrs.level ? { "data-level": String(n.attrs.level) } : {} }), 0]
53893
+ toDOM: (n) => ["div", ref(n, { class: "blockeditor-toggle", "data-open": n.attrs.open ? "true" : "false", ...n.attrs.level ? { "data-level": String(n.attrs.level) } : {} }), 0]
53892
53894
  },
53893
53895
  divider: {
53894
53896
  group: "block",
@@ -53902,7 +53904,7 @@ var schema = new Qr.Schema({
53902
53904
  group: "block",
53903
53905
  atom: true,
53904
53906
  attrs: { ...block, maxLevel: { default: null } },
53905
- toDOM: (n) => ["div", ref(n, { class: "page-toc", "data-type": "toc", ...n.attrs.maxLevel ? { "data-max-level": String(n.attrs.maxLevel) } : {} })]
53907
+ toDOM: (n) => ["div", ref(n, { class: "blockeditor-toc", "data-type": "toc", ...n.attrs.maxLevel ? { "data-max-level": String(n.attrs.maxLevel) } : {} })]
53906
53908
  },
53907
53909
  image: {
53908
53910
  group: "block",
@@ -53917,7 +53919,7 @@ var schema = new Qr.Schema({
53917
53919
  attrs: { ...block, src: { default: "" }, name: { default: "" }, size: { default: null }, mime: { default: null } },
53918
53920
  toDOM: (n) => [
53919
53921
  "div",
53920
- ref(n, { class: "page-file", "data-type": "file", "data-src": safeFileHref(n.attrs.src) ?? "", "data-name": n.attrs.name, "data-size": n.attrs.size == null ? "" : String(n.attrs.size), "data-mime": n.attrs.mime ?? "" }),
53922
+ ref(n, { class: "blockeditor-file", "data-type": "file", "data-src": safeFileHref(n.attrs.src) ?? "", "data-name": n.attrs.name, "data-size": n.attrs.size == null ? "" : String(n.attrs.size), "data-mime": n.attrs.mime ?? "" }),
53921
53923
  ["a", { href: safeFileHref(n.attrs.src), target: "_blank", rel: "noopener noreferrer" }, n.attrs.name || "file"]
53922
53924
  ]
53923
53925
  },
@@ -53984,8 +53986,8 @@ var schema = new Qr.Schema({
53984
53986
  toDOM: (n) => [
53985
53987
  "div",
53986
53988
  ref(n, { "data-type": "newer-format", "data-format": String(n.attrs.raw?.t ?? ""), contenteditable: "false" }),
53987
- ["span", { class: "page-newer-format" }, `Newer format: ${String(n.attrs.raw?.t ?? "")}`],
53988
- ["span", { class: "page-newer-format-text" }, n.textContent]
53989
+ ["span", { class: "blockeditor-newer-format" }, `Newer format: ${String(n.attrs.raw?.t ?? "")}`],
53990
+ ["span", { class: "blockeditor-newer-format-text" }, n.textContent]
53989
53991
  ]
53990
53992
  },
53991
53993
  text: { group: "inline" },
@@ -54012,7 +54014,7 @@ var schema = new Qr.Schema({
54012
54014
  attrs: { id: {} },
54013
54015
  inclusive: false,
54014
54016
  excludes: "mention date link",
54015
- toDOM: (m2) => ["span", { "data-page-mention": m2.attrs.id }, 0]
54017
+ toDOM: (m2) => ["span", { "data-blockeditor-mention": m2.attrs.id }, 0]
54016
54018
  },
54017
54019
  // A date mention is the calendar date as ordinary ISO text with this mark over it:
54018
54020
  // `date` is YYYY-MM-DD, and no time, zone, reminder or relative word is stored.
@@ -54020,7 +54022,7 @@ var schema = new Qr.Schema({
54020
54022
  attrs: { date: {} },
54021
54023
  inclusive: false,
54022
54024
  excludes: "mention date link",
54023
- toDOM: (m2) => ["time", { datetime: m2.attrs.date, "data-page-date": "" }, 0]
54025
+ toDOM: (m2) => ["time", { datetime: m2.attrs.date, "data-blockeditor-date": "" }, 0]
54024
54026
  },
54025
54027
  // The floor-1 formats (format-native.js): written as named descriptors,
54026
54028
  // drawn as the elements the saved article keeps for them.
@@ -54457,7 +54459,7 @@ function renderPie(model, slices, width) {
54457
54459
  const y1 = fmt(PIE.cy + PIE.radius * Math.sin(slice2.from));
54458
54460
  const x22 = fmt(PIE.cx + PIE.radius * Math.cos(slice2.to));
54459
54461
  const y2 = fmt(PIE.cy + PIE.radius * Math.sin(slice2.to));
54460
- parts.push(`<path${point} d="M ${PIE.cx} ${PIE.cy} L ${x1} ${y1} A ${PIE.radius} ${PIE.radius} 0 ${slice2.fraction > 0.5 ? 1 : 0} 1 ${x22} ${y2} Z" fill="${slice2.color}" stroke="var(--page-bg)" stroke-width="2"/>`);
54462
+ parts.push(`<path${point} d="M ${PIE.cx} ${PIE.cy} L ${x1} ${y1} A ${PIE.radius} ${PIE.radius} 0 ${slice2.fraction > 0.5 ? 1 : 0} 1 ${x22} ${y2} Z" fill="${slice2.color}" stroke="var(--blockeditor-bg)" stroke-width="2"/>`);
54461
54463
  });
54462
54464
  slices.forEach((slice2, index2) => {
54463
54465
  const yy = fmt(54 + index2 * 36);
@@ -54536,11 +54538,11 @@ var CODES2 = ["b", "i", "s", "c", "a"];
54536
54538
  var TAGS = { b: "strong", i: "em", s: "s", c: "code" };
54537
54539
  var NEST = ["a", "b", "i", "s", "c"];
54538
54540
  var KNOWN = new Set(CODES2);
54539
- var OPAQUE = "data-clay-page-opaque";
54540
- var VALUE = "data-clay-page-value";
54541
- var MARKS = "data-clay-page-marks";
54542
- var MENTION = "data-page-mention";
54543
- var DATE = "data-page-date";
54541
+ var OPAQUE = "data-clay-blockeditor-opaque";
54542
+ var VALUE = "data-clay-blockeditor-value";
54543
+ var MARKS = "data-clay-blockeditor-marks";
54544
+ var MENTION = "data-blockeditor-mention";
54545
+ var DATE = "data-blockeditor-date";
54544
54546
  var DAY = /^\d{4}-\d{2}-\d{2}$/;
54545
54547
  var ENVELOPE = "1";
54546
54548
  var STRUCTURAL = /* @__PURE__ */ new Set(["id", "t", "parent", "c", "m"]);
@@ -54565,7 +54567,7 @@ var DEFAULTS = {
54565
54567
  };
54566
54568
  var TEXT = /* @__PURE__ */ new Set(["paragraph", "heading", "list_item", "callout", "quote", "code_block", "toggle"]);
54567
54569
  var TOC_LABEL = "Table of contents";
54568
- var TOC_ANCHOR = "page-block-";
54570
+ var TOC_ANCHOR = "blockeditor-block-";
54569
54571
  var blockAnchor = (id) => `${TOC_ANCHOR}${b64url(String(id ?? ""))}`;
54570
54572
  var TOC_MAX_LEVEL = 3;
54571
54573
  var tocLevel = (item) => item.t === "heading" ? Math.min(6, Math.max(1, Number.isInteger(item.level) ? item.level : 2)) : item.t === "toggle" && (item.level === 1 || item.level === 2 || item.level === 3) ? item.level : 0;
@@ -54952,8 +54954,8 @@ function renderInline(c, m2, marksEnvelopes = true) {
54952
54954
  return html3;
54953
54955
  }
54954
54956
  var inlineOf = (item) => renderInline(item.c ?? "", item.m);
54955
- var titleHtml = (item) => `<header${attr2("data-id", item.id)} data-page-heading="1"${extrasOfItem(item)}>${item.pageCoverSrc ? `<img data-page-cover${attr2("src", item.pageCoverSrc)}${attr2("alt", item.pageCoverAlt ?? "")} style="object-position:${item.pageCoverX ?? 50}% ${item.pageCoverY ?? 50}%">` : ""}${item.pageIcon ? `<span data-page-icon aria-hidden="true">${escText(item.pageIcon)}</span>` : ""}<h1>${inlineOf(item)}</h1></header>`;
54956
- var toolData = (item) => item.artifact || item.rev || item.state && Object.keys(item.state).length ? `<script type="application/json" data-tool>${canon({ artifact: item.artifact ?? null, rev: item.rev ?? null, state: item.state ?? {} }).replace(/</g, "\\u003c")}</script>` : "";
54957
+ var titleHtml = (item) => `<header${attr2("data-id", item.id)} data-blockeditor-heading="1"${extrasOfItem(item)}>${item.pageCoverSrc ? `<img data-blockeditor-cover${attr2("src", item.pageCoverSrc)}${attr2("alt", item.pageCoverAlt ?? "")} style="object-position:${item.pageCoverX ?? 50}% ${item.pageCoverY ?? 50}%">` : ""}${item.pageIcon ? `<span data-blockeditor-icon aria-hidden="true">${escText(item.pageIcon)}</span>` : ""}<h1>${inlineOf(item)}</h1></header>`;
54958
+ var toolData = (item) => item.artifact || item.rev || item.state && Object.keys(item.state).length ? `<script type="application/json" clay="no-data" data-tool>${canon({ artifact: item.artifact ?? null, rev: item.rev ?? null, state: item.state ?? {} }).replace(/</g, "\\u003c")}</script>` : "";
54957
54959
  var headerId = (tableId, colId) => `${tableId}-${colId}`;
54958
54960
  var cellHtml = (cell) => typeof cell === "string" ? escText(cell) : cell && typeof cell === "object" ? renderInline(String(cell.c ?? ""), cell.m) : "";
54959
54961
  var dataAttrs = (obj) => Object.entries(obj).map(([k2, v3]) => attr2(`data-${k2}`, v3)).join("");
@@ -54969,7 +54971,7 @@ function renderLeaf(item, clean, tables) {
54969
54971
  return `<${h}${at2}>${inlineOf(item)}</${h}>`;
54970
54972
  }
54971
54973
  case "callout":
54972
- return `<aside${at2} class="page-callout">${inlineOf(item)}</aside>`;
54974
+ return `<aside${at2} class="blockeditor-callout">${inlineOf(item)}</aside>`;
54973
54975
  case "quote":
54974
54976
  return `<blockquote${at2}>${inlineOf(item)}</blockquote>`;
54975
54977
  case "code_block":
@@ -55235,8 +55237,8 @@ function parseArticle(article) {
55235
55237
  const onlyImage = tag === "P" && el3.children.length === 1 && el3.children[0].tagName === "IMG" && !el3.textContent.trim();
55236
55238
  if (tag === "P" && !onlyImage) return push(el3, "paragraph", parent2, { ...omitDefaults("paragraph", P3), ...tf2(el3) });
55237
55239
  if (/^H[1-6]$/.test(tag)) return push(el3, "heading", parent2, { ...omitDefaults("heading", { ...P3, level: +tag[1] }), ...tf2(el3) });
55238
- if (tag === "HEADER" && el3.getAttribute("data-page-heading") === ENVELOPE) {
55239
- const icon = el3.querySelector(":scope > [data-page-icon]");
55240
+ if (tag === "HEADER" && el3.getAttribute("data-blockeditor-heading") === ENVELOPE) {
55241
+ const icon = el3.querySelector(":scope > [data-blockeditor-icon]");
55240
55242
  const cover = el3.querySelector(":scope > img");
55241
55243
  const [, x3, y2] = /object-position:\s*([-\d.]+)%\s+([-\d.]+)%/.exec(cover?.getAttribute("style") ?? "") ?? [];
55242
55244
  const cover0 = cover ? { pageCoverSrc: safeSrc(cover.getAttribute("src")), pageCoverAlt: cover.getAttribute("alt") ?? "", pageCoverX: focal(x3), pageCoverY: focal(y2) } : {};
@@ -58979,7 +58981,7 @@ ji2[qi2] === true && console.error("Yjs was already imported. This breaks constr
58979
58981
  ji2[qi2] = true;
58980
58982
 
58981
58983
  // src/page/ybind/layout.js
58982
- var NET = "page-net";
58984
+ var NET = "blockeditor-net";
58983
58985
  var PAGE_ROOTS = Object.freeze(["flow", "attrs", "gone", "boardFields", "tableFields", "origins"]);
58984
58986
  var SKIP = /* @__PURE__ */ new Set(["id", "pos"]);
58985
58987
  var KEYS = /* @__PURE__ */ new WeakMap();
@@ -60595,20 +60597,20 @@ function blocksFromPageValues(values) {
60595
60597
 
60596
60598
  // src/core/page-format-wire.js
60597
60599
  var PAGE_FORMAT = 1;
60598
- var PAGE_FORMAT_HEADER = "X-Clay-Page-Format";
60600
+ var PAGE_FORMAT_HEADER = "X-Clay-Blockeditor-Format";
60599
60601
 
60600
60602
  // src/core/page-format.js
60601
- var PAGE_FORMAT_META = "clay-page-format";
60602
- var PAGE_FORMAT_EXTENSION = "page-format-v1";
60603
- var PAGE_FORMAT_UPGRADE = "page-format-upgrade-required";
60603
+ var PAGE_FORMAT_META = "clay-blockeditor-format";
60604
+ var PAGE_FORMAT_EXTENSION = "blockeditor-format-v1";
60605
+ var PAGE_FORMAT_UPGRADE = "blockeditor-format-upgrade-required";
60604
60606
  var level = (value) => Number.isSafeInteger(value) && value > 0 ? value : 0;
60605
- var metaTag = (html3) => /<meta\b[^>]*\bname\s*=\s*["']?clay-page-format["']?[^>]*>/i.exec(html3);
60607
+ var metaTag = (html3) => /<meta\b[^>]*\bname\s*=\s*["']?clay-blockeditor-format["']?[^>]*>/i.exec(html3);
60606
60608
  function formatCapability(value) {
60607
60609
  if (typeof value === "number") return level(value);
60608
60610
  if (typeof value !== "string" || !/^\s*\d+\s*$/.test(value)) return 0;
60609
60611
  return level(Number(value));
60610
60612
  }
60611
- function pageFormatFloor(html3) {
60613
+ function blockeditorFormatFloor(html3) {
60612
60614
  if (typeof html3 !== "string") return 0;
60613
60615
  const tag = metaTag(html3);
60614
60616
  if (!tag) return 0;
@@ -60619,7 +60621,7 @@ function withPageFormatFloor(html3, floor) {
60619
60621
  const want = level(floor);
60620
60622
  if (typeof html3 !== "string" || !want) return html3;
60621
60623
  const tag = metaTag(html3);
60622
- if (tag && pageFormatFloor(tag[0]) === want) return html3;
60624
+ if (tag && blockeditorFormatFloor(tag[0]) === want) return html3;
60623
60625
  const marker = `<meta name="${PAGE_FORMAT_META}" content="${want}">`;
60624
60626
  if (tag) return html3.slice(0, tag.index) + marker + html3.slice(tag.index + tag[0].length);
60625
60627
  const at2 = /<\/head\s*>/i.exec(html3) || /<body\b/i.exec(html3);
@@ -60770,7 +60772,7 @@ function pageFormatRefusal(required, message = null) {
60770
60772
  }
60771
60773
 
60772
60774
  // src/server/rooms/page-admission.js
60773
- var PAGE = /^page(\.[0-9]+)?$/;
60775
+ var PAGE = /^blockeditor(\.[0-9]+)?$/;
60774
60776
  var PART2 = /^(.+)\.(\d+)\.(\d+)$/;
60775
60777
  var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
60776
60778
  var isHybridPageValue = (value) => record3(value) && record3(value.blocks) && (value.deleted == null || record3(value.deleted)) && Object.keys(value).every((key) => key === "blocks" || key === "deleted");
@@ -60798,6 +60800,27 @@ function isYPageValue(value, { complete = true } = {}) {
60798
60800
  }
60799
60801
  return true;
60800
60802
  }
60803
+ var OLD_TAG = /^page(\.[0-9]+)?$/;
60804
+ var OLD_FORMAT_MSG = "This document now uses the new Block editor format, so this change was not saved. Copy any text you need from this tab, then reload.";
60805
+ function oldFormatRefusal() {
60806
+ const error = new Error(OLD_FORMAT_MSG);
60807
+ error.name = "BlockeditorOldFormat";
60808
+ error.code = "blockeditor-old-format";
60809
+ error.statusCode = 409;
60810
+ return error;
60811
+ }
60812
+ function oldBlockeditorFormat(html3) {
60813
+ if (typeof html3 !== "string" || !/merge/i.test(html3)) return false;
60814
+ return liveTags(html3, { includeDuplicates: true }).some((tag) => {
60815
+ if (!OLD_TAG.test(tag.name)) return false;
60816
+ try {
60817
+ const value = parseJsonRelaxed(tag.text);
60818
+ return record3(value) && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v"));
60819
+ } catch {
60820
+ return false;
60821
+ }
60822
+ });
60823
+ }
60801
60824
  function inspectPage(html3) {
60802
60825
  const answer = inspected(html3);
60803
60826
  return { ...answer, tags: cloneJson(answer.tags) };
@@ -60819,7 +60842,7 @@ var inspected = recent(4, (html3) => {
60819
60842
  }
60820
60843
  }
60821
60844
  if (tags.some(([, value]) => record3(value) && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v")))) {
60822
- if (tags.length !== 1 || tags[0][0] !== "page" || !isYPageValue(tags[0][1])) return { kind: "invalid", reason: "invalid-yjs", tags };
60845
+ if (tags.length !== 1 || tags[0][0] !== "blockeditor" || !isYPageValue(tags[0][1])) return { kind: "invalid", reason: "invalid-yjs", tags };
60823
60846
  return { kind: "yjs", tags };
60824
60847
  }
60825
60848
  return { kind: tags.every(([, value]) => isHybridPageValue(value)) ? "hybrid" : "other", tags };
@@ -60843,10 +60866,10 @@ function captureFormat(html3) {
60843
60866
  return requiredPageFormat(project(blocksFromPageValues([answer.tags[0][1]])));
60844
60867
  }
60845
60868
  function checkPageFormatAdmission({ currentHtml, html: html3, capability = 0, admitted = [] }) {
60846
- const established = pageFormatFloor(currentHtml ?? "");
60869
+ const established = blockeditorFormatFloor(currentHtml ?? "");
60847
60870
  const decision = pageFormatDecision({
60848
60871
  floor: established,
60849
- required: Math.max(captureFormat(html3), pageFormatFloor(html3 ?? "")),
60872
+ required: Math.max(captureFormat(html3), blockeditorFormatFloor(html3 ?? "")),
60850
60873
  capability,
60851
60874
  admitted
60852
60875
  });
@@ -60865,8 +60888,8 @@ var span = (node) => {
60865
60888
  };
60866
60889
  var locate = recent(4, (html3) => {
60867
60890
  const $4 = load(html3, { sourceCodeLocationInfo: true });
60868
- const articles = $4("article[data-page]").toArray().filter((node) => !inert2(node));
60869
- const tags = $4('script[merge="page"]').toArray().filter((node) => !inert2(node) && ($4(node).attr("clay") || "").split(/\s+/).includes("live"));
60891
+ const articles = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
60892
+ const tags = $4('script[merge="blockeditor"]').toArray().filter((node) => !inert2(node) && ($4(node).attr("clay") || "").split(/\s+/).includes("live"));
60870
60893
  return Object.freeze({
60871
60894
  articles: articles.length,
60872
60895
  tags: tags.length,
@@ -72102,7 +72125,7 @@ var TEXT2 = /* @__PURE__ */ new Set(["paragraph", "heading", "list_item", "callo
72102
72125
  var same2 = (a, b2) => canon(a) === canon(b2);
72103
72126
  function inlineOf2(item, doc) {
72104
72127
  const article = doc.createElement("article");
72105
- article.setAttribute("data-page", "");
72128
+ article.setAttribute("data-blockeditor", "");
72106
72129
  article.innerHTML = renderModel([{ id: item.id, t: "paragraph", c: item.c ?? "", ...item.m ? { m: item.m } : {} }], { clean: fragmentCleaner(doc) });
72107
72130
  return article;
72108
72131
  }
@@ -72210,7 +72233,7 @@ function mergePageModels(base, current, incoming, { doc, merge3: merge33, mergeJ
72210
72233
  // src/server/rooms/page-rebase.js
72211
72234
  function articleOf(html3, doc) {
72212
72235
  const $4 = load(html3, { sourceCodeLocationInfo: true });
72213
- const nodes = $4("article[data-page]").toArray().filter((node) => !inert2(node));
72236
+ const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
72214
72237
  if (nodes.length !== 1) return null;
72215
72238
  const loc = nodes[0].sourceCodeLocation;
72216
72239
  if (!loc?.startTag || !loc?.endTag) return null;
@@ -72257,7 +72280,7 @@ ${renderModel(merged2.items, { fallbackOf, clean: fragmentCleaner(doc) })}
72257
72280
  const [innerStart, innerEnd] = incoming.inner;
72258
72281
  const open = stampOpen(incomingHtml, incoming.startTag, state.rev);
72259
72282
  const body = incomingHtml.slice(0, incoming.startTag.startOffset) + open + inner + incomingHtml.slice(innerEnd);
72260
- const html3 = withPageFormatFloor(body, Math.max(pageFormatFloor(storedHtml), pageFormatFloor(incomingHtml)));
72283
+ const html3 = withPageFormatFloor(body, Math.max(blockeditorFormatFloor(storedHtml), blockeditorFormatFloor(incomingHtml)));
72261
72284
  return { html: html3, conflicts: merged2.conflicts };
72262
72285
  }
72263
72286
  function closestBase(candidates, incomingHtml, createDocument) {
@@ -72286,7 +72309,7 @@ function closestBase(candidates, incomingHtml, createDocument) {
72286
72309
  function stampPageRev(html3, rev, floor = 0) {
72287
72310
  if (typeof html3 !== "string" || !rev) return null;
72288
72311
  const $4 = load(html3, { sourceCodeLocationInfo: true });
72289
- const nodes = $4("article[data-page]").toArray().filter((node) => !inert2(node));
72312
+ const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
72290
72313
  const loc = nodes.length === 1 ? nodes[0].sourceCodeLocation?.startTag : null;
72291
72314
  if (!loc) return null;
72292
72315
  const stamped = stampOpen(html3, loc, rev);
@@ -72310,7 +72333,7 @@ function ifMatchSatisfied(fieldValue, storedBytes) {
72310
72333
  }
72311
72334
 
72312
72335
  // src/server/rooms/page-conversion.js
72313
- var PAGE2 = /^page(\.[0-9]+)?$/;
72336
+ var PAGE2 = /^blockeditor(\.[0-9]+)?$/;
72314
72337
  var BASE = /^[0-9a-f]{64}$/;
72315
72338
  var EPOCH = /^[A-Za-z0-9-]{1,64}$/;
72316
72339
  var PageConversionError = class extends Error {
@@ -72372,17 +72395,17 @@ var PageFormatError = class extends Error {
72372
72395
  constructor() {
72373
72396
  super("A converted page must retain one complete Yjs page value");
72374
72397
  this.name = "PageFormatError";
72375
- this.code = "page-format";
72398
+ this.code = "blockeditor-format";
72376
72399
  this.statusCode = 409;
72377
72400
  }
72378
72401
  };
72379
72402
  function checkPageWriteFormat({ currentHtml, html: html3, room = null }) {
72380
- if (room?.pageTransition?.format !== "yjs" && inspectPage(currentHtml ?? "").kind !== "yjs") return;
72403
+ if (room?.blockeditorTransition?.format !== "yjs" && inspectPage(currentHtml ?? "").kind !== "yjs") return;
72381
72404
  const kind = inspectPage(html3 ?? "").kind;
72382
72405
  if (kind !== "yjs" && kind !== "none") throw new PageFormatError();
72383
72406
  }
72384
72407
  function pageLineageLost(room, html3) {
72385
- return room?.pageTransition?.format === "yjs" && room.stores.has("page") && inspectPage(html3 ?? "").kind === "none";
72408
+ return room?.blockeditorTransition?.format === "yjs" && room.stores.has("blockeditor") && inspectPage(html3 ?? "").kind === "none";
72386
72409
  }
72387
72410
 
72388
72411
  // src/page/adopt.js
@@ -72443,7 +72466,7 @@ function classifyFile(article, tagValues) {
72443
72466
 
72444
72467
  // src/page/ybind/migrate.js
72445
72468
  function seedClientId(blocks) {
72446
- const id = parseInt(hash64(`page-seed:v1:${canon(blocks)}`).slice(0, 8), 16) >>> 0;
72469
+ const id = parseInt(hash64(`blockeditor-seed:v1:${canon(blocks)}`).slice(0, 8), 16) >>> 0;
72447
72470
  return id < 2 ? id + 2 : id;
72448
72471
  }
72449
72472
 
@@ -72488,7 +72511,7 @@ var refuse2 = (reason) => {
72488
72511
  var lineages = /* @__PURE__ */ new Map();
72489
72512
  function storedArticle(html3, doc) {
72490
72513
  const $4 = load(html3);
72491
- const nodes = $4("article[data-page]").toArray().filter((node) => !inert2(node));
72514
+ const nodes = $4("article[data-blockeditor]").toArray().filter((node) => !inert2(node));
72492
72515
  if (nodes.length !== 1) return null;
72493
72516
  const article = doc.createElement("article");
72494
72517
  for (const [name, value] of Object.entries(nodes[0].attribs)) article.setAttribute(name, value);
@@ -72506,7 +72529,7 @@ function storedLineage(html3, createDocument) {
72506
72529
  if (lineages.size > 4) lineages.delete(lineages.keys().next().value);
72507
72530
  return lineage;
72508
72531
  }
72509
- function checkInitialLineage({ currentHtml, html: html3, pageWrite = null, createDocument }) {
72532
+ function checkInitialLineage({ currentHtml, html: html3, blockeditorWrite = null, createDocument }) {
72510
72533
  const lineage = storedLineage(currentHtml, createDocument);
72511
72534
  if (!lineage) return;
72512
72535
  let doc;
@@ -72517,19 +72540,19 @@ function checkInitialLineage({ currentHtml, html: html3, pageWrite = null, creat
72517
72540
  }
72518
72541
  try {
72519
72542
  if (lineage.client !== null && !ui2(Aa2(doc)).has(lineage.client)) refuse2("seed-lineage");
72520
- if (typeof pageWrite === "string" && pageWrite.trim() === "v1" && seedOnly(doc, lineage.client) && splitPage(html3).file === currentHtml) refuse2("nothing-to-write");
72543
+ if (typeof blockeditorWrite === "string" && blockeditorWrite.trim() === "v1" && seedOnly(doc, lineage.client) && splitPage(html3).file === currentHtml) refuse2("nothing-to-write");
72521
72544
  } finally {
72522
72545
  doc.destroy();
72523
72546
  }
72524
72547
  }
72525
72548
  function checkOrdinaryLineage({ currentHtml, html: html3, room = null }) {
72526
72549
  const before2 = inspectPage(currentHtml ?? "");
72527
- const stored = before2.kind === "yjs" ? before2.tags[0][1] : room?.stores.get("page")?.value ?? null;
72550
+ const stored = before2.kind === "yjs" ? before2.tags[0][1] : room?.stores.get("blockeditor")?.value ?? null;
72528
72551
  if (stored && !sharesLineage(stored, inspectPage(html3).tags[0][1])) refuse2("seed-lineage");
72529
72552
  }
72530
72553
 
72531
72554
  // src/server/rooms/page-write-admission.js
72532
- var PAGE3 = /^page(\.[0-9]+)?$/;
72555
+ var PAGE3 = /^blockeditor(\.[0-9]+)?$/;
72533
72556
  var record4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
72534
72557
  var refuse3 = (reason) => {
72535
72558
  throw new PageConversionError(reason);
@@ -72547,22 +72570,22 @@ function claimsYPage(html3) {
72547
72570
  });
72548
72571
  }
72549
72572
  function checkInitialRoom(room) {
72550
- if ([...room?.stores.keys() ?? []].some((name) => PAGE3.test(name)) || [...room?.lastN.keys() ?? []].some((key) => PAGE3.test(key.slice(0, key.indexOf("\n")))) || room?.pageTransition && room.pageTransition.format !== "none") refuse3("room-page-authority");
72573
+ if ([...room?.stores.keys() ?? []].some((name) => PAGE3.test(name)) || [...room?.lastN.keys() ?? []].some((key) => PAGE3.test(key.slice(0, key.indexOf("\n")))) || room?.blockeditorTransition && room.blockeditorTransition.format !== "none") refuse3("room-blockeditor-authority");
72551
72574
  }
72552
72575
  function checkInitialCondition(ifMatch, currentHtml) {
72553
72576
  if (typeof ifMatch !== "string" || ifMatch.trim() === "*" || ifMatch.includes(",") || !ifMatchSatisfied(ifMatch, currentHtml)) refuse3("file-changed");
72554
72577
  }
72555
- function checkPageInitial({ currentHtml, html: html3, ifMatch, room = null, pageWrite = null, createDocument }) {
72578
+ function checkPageInitial({ currentHtml, html: html3, ifMatch, room = null, blockeditorWrite = null, createDocument }) {
72556
72579
  if (typeof currentHtml !== "string" || inspectPage(currentHtml).kind !== "none") refuse3("invalid-source");
72557
72580
  if (typeof html3 !== "string" || inspectPage(html3).kind !== "yjs") refuse3("invalid-capture");
72558
72581
  checkInitialRoom(room);
72559
72582
  checkInitialCondition(ifMatch, currentHtml);
72560
- checkInitialLineage({ currentHtml, html: html3, pageWrite, createDocument });
72583
+ checkInitialLineage({ currentHtml, html: html3, blockeditorWrite, createDocument });
72561
72584
  }
72562
- function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMatch, room = null, pageWrite = null, createDocument }) {
72585
+ function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMatch, room = null, blockeditorWrite = null, createDocument }) {
72563
72586
  const before2 = inspectPage(currentHtml ?? "");
72564
72587
  const after2 = inspectPage(html3 ?? "");
72565
- const converted = before2.kind === "yjs" || room?.pageTransition?.format === "yjs";
72588
+ const converted = before2.kind === "yjs" || room?.blockeditorTransition?.format === "yjs";
72566
72589
  if (converted && after2.kind === "none" && header == null) return "ordinary";
72567
72590
  if (converted && after2.kind !== "yjs") throw new PageFormatError();
72568
72591
  if (header !== null && header !== void 0) {
@@ -72581,7 +72604,7 @@ function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMa
72581
72604
  if (before2.kind !== "none" || typeof currentHtml !== "string") refuse3("invalid-source");
72582
72605
  checkInitialRoom(room);
72583
72606
  checkInitialCondition(ifMatch, currentHtml);
72584
- checkInitialLineage({ currentHtml, html: html3, pageWrite, createDocument });
72607
+ checkInitialLineage({ currentHtml, html: html3, blockeditorWrite, createDocument });
72585
72608
  return "initial";
72586
72609
  }
72587
72610
 
@@ -72589,10 +72612,10 @@ function checkPageWriteAdmission({ currentHtml, html: html3, header = null, ifMa
72589
72612
  var import_node_crypto2 = require("node:crypto");
72590
72613
  function makePageTransition({ room = null, format = "yjs", sources = [], receipts = /* @__PURE__ */ new Map() } = {}) {
72591
72614
  const archived = new Map([...receipts].map(([key, receipt]) => [key, cloneJson(receipt)]));
72592
- const history = [...room?.pageTransition?.history ?? []];
72615
+ const history = [...room?.blockeditorTransition?.history ?? []];
72593
72616
  if (archived.size) history.push({
72594
72617
  epoch: room.epoch,
72595
- generation: room.pageTransition?.id ?? null,
72618
+ generation: room.blockeditorTransition?.id ?? null,
72596
72619
  receiptGeneration: room.receiptGeneration ?? 0,
72597
72620
  sources: [...sources],
72598
72621
  receipts: archived
@@ -72649,12 +72672,12 @@ var COMPACTION = Object.freeze({
72649
72672
  });
72650
72673
  var ROOM_ERROR_STATUS = Object.freeze({
72651
72674
  "checkpoint-required": 503,
72652
- "page-full": 409,
72675
+ "blockeditor-full": 409,
72653
72676
  "compaction-failed": 409,
72654
- "page-immutable": 409,
72655
- "page-batch": 409,
72656
- "page-update-invalid": 422,
72657
- "page-upgrade": 404
72677
+ "blockeditor-immutable": 409,
72678
+ "blockeditor-batch": 409,
72679
+ "blockeditor-update-invalid": 422,
72680
+ "blockeditor-upgrade": 404
72658
72681
  });
72659
72682
  var CLIENT_KEY = /^[ur][0-9a-z]+(-[0-9a-z]+){2}$/;
72660
72683
  var HOST_KEY = /^[ctf][0-9a-z]{8}-[0-9a-z]+(-[0-9a-z]+)?$/;
@@ -72733,25 +72756,25 @@ function checkUpdate(text4) {
72733
72756
  }
72734
72757
  }
72735
72758
  function admitPageOps({ y: y2, ops, state, limits }) {
72736
- if (state.compaction !== limits.version) return { error: "page-upgrade" };
72759
+ if (state.compaction !== limits.version) return { error: "blockeditor-upgrade" };
72737
72760
  let added = 0;
72738
72761
  let deleted = 0;
72739
72762
  let inserts = false;
72740
72763
  for (const op of ops) {
72741
72764
  const key = op.path?.[1];
72742
- if (op.op !== "set" || typeof key !== "string" || !CLIENT_KEY.test(key)) return { error: "page-immutable" };
72765
+ if (op.op !== "set" || typeof key !== "string" || !CLIENT_KEY.test(key)) return { error: "blockeditor-immutable" };
72743
72766
  if (Object.hasOwn(y2, key)) {
72744
- if (y2[key] !== op.value) return { error: "page-immutable" };
72767
+ if (y2[key] !== op.value) return { error: "blockeditor-immutable" };
72745
72768
  continue;
72746
72769
  }
72747
- if (state.retired.has(key)) return { error: "page-immutable" };
72770
+ if (state.retired.has(key)) return { error: "blockeditor-immutable" };
72748
72771
  const checked = checkUpdate(op.value);
72749
- if (!checked) return { error: "page-update-invalid" };
72772
+ if (!checked) return { error: "blockeditor-update-invalid" };
72750
72773
  added += 1;
72751
72774
  deleted += checked.deleted;
72752
72775
  inserts ||= checked.inserts;
72753
72776
  }
72754
- if (added > limits.newPerFrame) return { error: "page-batch" };
72777
+ if (added > limits.newPerFrame) return { error: "blockeditor-batch" };
72755
72778
  if (state.failed) return { added, deleted, inserts, limit: limits.activeBytes + (inserts ? 0 : limits.deleteReserve), shape: null, failed: true };
72756
72779
  const shape = pageShape(y2, limits);
72757
72780
  if (!shape.normal || shape.loose + added > limits.loose) return { error: "checkpoint-required", retryAfter: 0 };
@@ -72808,7 +72831,7 @@ var LIVE_LIMITS = Object.freeze({
72808
72831
  // (the reader rebuilds from the value, as after the log is evicted).
72809
72832
  movesBytes: 1024 * 1024
72810
72833
  });
72811
- var PAGE4 = /^page(\.[0-9]+)?$/;
72834
+ var PAGE4 = /^blockeditor(\.[0-9]+)?$/;
72812
72835
  var COMPACTOR = "compactor";
72813
72836
  var isContainer2 = (v3) => v3 !== null && typeof v3 === "object";
72814
72837
  function seedStores(html3, { pageOnly = false, heldBytes = 0, heldCount = 0 } = {}) {
@@ -72949,7 +72972,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
72949
72972
  lastSentAt: /* @__PURE__ */ new Map(),
72950
72973
  seen: /* @__PURE__ */ new Map(),
72951
72974
  emptySince: null,
72952
- ...inspectPage(html3).kind === "yjs" && { pageTransition: makePageTransition() },
72975
+ ...inspectPage(html3).kind === "yjs" && { blockeditorTransition: makePageTransition() },
72953
72976
  compaction: hostMode(inspectPage(html3).kind === "yjs")
72954
72977
  });
72955
72978
  const roomBytes = (room) => {
@@ -72958,7 +72981,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
72958
72981
  return total;
72959
72982
  };
72960
72983
  const heldBy = (room) => {
72961
- let total = (room.receiptBytes ?? 0) + (room.pageTransition?.bytes ?? 0) + (room.compaction?.job?.reserved ?? 0);
72984
+ let total = (room.receiptBytes ?? 0) + (room.blockeditorTransition?.bytes ?? 0) + (room.compaction?.job?.reserved ?? 0);
72962
72985
  for (const s of room.stores.values()) total += s.bytes + s.logBytes;
72963
72986
  return total;
72964
72987
  };
@@ -72973,7 +72996,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
72973
72996
  return {
72974
72997
  limit,
72975
72998
  over() {
72976
- if (answer.failed || state.lastFull && state.deletesSince === 0) return { error: "page-full" };
72999
+ if (answer.failed || state.lastFull && state.deletesSince === 0) return { error: "blockeditor-full" };
72977
73000
  due(room, true);
72978
73001
  return { error: "checkpoint-required", retryAfter: 0 };
72979
73002
  },
@@ -73045,7 +73068,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73045
73068
  };
73046
73069
  const pageSource = (key, nodeId) => {
73047
73070
  if (nodeId == null) throw new PageConversionError("invalid-document");
73048
- if (pageReservations.has(key) || persistentReservations.has(key) || reservedNodes.has(String(nodeId))) throw new PageConversionError("page-converting");
73071
+ if (pageReservations.has(key) || persistentReservations.has(key) || reservedNodes.has(String(nodeId))) throw new PageConversionError("blockeditor-converting");
73049
73072
  let room = rooms.get(key) ?? null;
73050
73073
  if (room && String(room.nodeId) !== String(nodeId)) {
73051
73074
  used -= heldBy(room);
@@ -73056,7 +73079,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73056
73079
  };
73057
73080
  const reservePageTarget = (key, nodeId, room, html3, details) => {
73058
73081
  const receipts = new Set([...room?.lastN.keys() ?? []].filter((key2) => PAGE4.test(key2.slice(0, key2.indexOf("\n")))));
73059
- if (receipts.size >= LIVE_LIMITS.receipts || (room?.pageTransition?.receiptCount ?? 0) + receipts.size > LIVE_LIMITS.receipts) throw new PageConversionError("receipt-capacity");
73082
+ if (receipts.size >= LIVE_LIMITS.receipts || (room?.blockeditorTransition?.receiptCount ?? 0) + receipts.size > LIVE_LIMITS.receipts) throw new PageConversionError("receipt-capacity");
73060
73083
  const names = details.names ?? [.../* @__PURE__ */ new Set([
73061
73084
  ...[...room?.stores.keys() ?? []].filter((name) => PAGE4.test(name)),
73062
73085
  ...[...receipts].map((key2) => key2.slice(0, key2.indexOf("\n")))
@@ -73074,7 +73097,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73074
73097
  heldCount: others.length
73075
73098
  });
73076
73099
  for (const store of stores.values()) store.from = null;
73077
- budget = transition.bytes - (room.pageTransition?.historyBytes ?? 0) + [...stores.values()].reduce((sum, store) => sum + store.bytes, 0);
73100
+ budget = transition.bytes - (room.blockeditorTransition?.historyBytes ?? 0) + [...stores.values()].reduce((sum, store) => sum + store.bytes, 0);
73078
73101
  const replacedBytes = [...room.stores].filter(([name]) => PAGE4.test(name)).reduce((sum, [, store]) => sum + store.bytes + store.logBytes, 0);
73079
73102
  const growth = details.source === "replacement" ? budget - replacedBytes : budget;
73080
73103
  if (details.source === "replacement" ? growth > 0 && used + growth > liveBytes : used + budget > liveBytes) {
@@ -73108,11 +73131,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73108
73131
  }
73109
73132
  if (!isContainer2(value) || Array.isArray(value) !== Array.isArray(store.value)) continue;
73110
73133
  if (PAGE4.test(tag.name)) {
73111
- if (room.pageTransition?.format === "yjs") {
73112
- if (tag.name !== "page" || !isYPageValue(value)) continue;
73134
+ if (room.blockeditorTransition?.format === "yjs") {
73135
+ if (tag.name !== "blockeditor" || !isYPageValue(value)) continue;
73113
73136
  } else if (isYPageValue(value, { complete: false })) continue;
73114
73137
  }
73115
- const host = Boolean(room.compaction && tag.name === "page" && room.pageTransition?.format === "yjs");
73138
+ const host = Boolean(room.compaction && tag.name === "blockeditor" && room.blockeditorTransition?.format === "yjs");
73116
73139
  const before2 = store.landed;
73117
73140
  const base = baseOf(room, store, tag.at);
73118
73141
  const stamped = placed(room, store, tag.at) && tag.at.hash === textHash(serializeLive(value));
@@ -73229,9 +73252,9 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73229
73252
  const { source, base, epoch, names } = conversion;
73230
73253
  return reservePageTarget(key, nodeId, room, html3, { source, base, epoch, names, format: "yjs" });
73231
73254
  },
73232
- reservePageInitial(key, { nodeId, currentHtml, html: html3, ifMatch, pageWrite = null, createDocument }) {
73255
+ reservePageInitial(key, { nodeId, currentHtml, html: html3, ifMatch, blockeditorWrite = null, createDocument }) {
73233
73256
  const room = pageSource(key, nodeId);
73234
- checkPageInitial({ currentHtml, html: html3, ifMatch, room, pageWrite, createDocument });
73257
+ checkPageInitial({ currentHtml, html: html3, ifMatch, room, blockeditorWrite, createDocument });
73235
73258
  return reservePageTarget(key, nodeId, room, html3, { source: "initial", names: [], format: "yjs" });
73236
73259
  },
73237
73260
  reservePageReplacement(key, { nodeId, html: html3 }) {
@@ -73269,7 +73292,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73269
73292
  room.stores.set(name, store);
73270
73293
  bytes += store.bytes;
73271
73294
  }
73272
- room.pageTransition = transition;
73295
+ room.blockeditorTransition = transition;
73273
73296
  if (hostLimits) room.compaction = hostMode(transition.format === "yjs");
73274
73297
  reservation.target = null;
73275
73298
  used += heldBy(room) - before2 - reservation.budget;
@@ -73337,8 +73360,8 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73337
73360
  throw new PersistentReservationError("invalid-target");
73338
73361
  }
73339
73362
  if (PAGE4.test(name)) {
73340
- if (record5.room.pageTransition?.format === "yjs") {
73341
- if (name !== "page" || !isYPageValue(value) || value.g !== store.value.g) {
73363
+ if (record5.room.blockeditorTransition?.format === "yjs") {
73364
+ if (name !== "blockeditor" || !isYPageValue(value) || value.g !== store.value.g) {
73342
73365
  throw new PersistentReservationError("invalid-target");
73343
73366
  }
73344
73367
  } else if (isYPageValue(value, { complete: false })) throw new PersistentReservationError("invalid-target");
@@ -73505,12 +73528,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73505
73528
  if (current === room && persistentReservations.has(room.key)) return { error: "checkpointing" };
73506
73529
  if (!isContainer2(frame)) return { error: "bad-frame" };
73507
73530
  if (current !== room) return { stale: true, epoch: current?.epoch ?? null };
73508
- if (pageReservations.has(room.key) && PAGE4.test(frame.name)) return { error: "page-converting" };
73531
+ if (pageReservations.has(room.key) && PAGE4.test(frame.name)) return { error: "blockeditor-converting" };
73509
73532
  if ((PAGE4.test(frame.name) || frame.epoch !== void 0) && frame.epoch !== room.epoch) return { stale: true, epoch: room.epoch };
73510
- const transition = PAGE4.test(frame.name) ? room.pageTransition : null;
73511
- if (PAGE4.test(frame.name) && (transition?.format === "yjs" || frame.pageGeneration !== void 0) && (frame.pageGeneration ?? null) !== (transition?.id ?? null)) return { error: "page-generation" };
73533
+ const transition = PAGE4.test(frame.name) ? room.blockeditorTransition : null;
73534
+ if (PAGE4.test(frame.name) && (transition?.format === "yjs" || frame.blockeditorGeneration !== void 0) && (frame.blockeditorGeneration ?? null) !== (transition?.id ?? null)) return { error: "blockeditor-generation" };
73512
73535
  const converted = transition?.format === "yjs";
73513
- if (converted && frame.name !== "page") return { error: "page-format" };
73536
+ if (converted && frame.name !== "blockeditor") return { error: "blockeditor-format" };
73514
73537
  const store = room.stores.get(frame.name);
73515
73538
  if (!store) return { error: "unknown-store" };
73516
73539
  if (!Number.isInteger(frame.n) || frame.n < 1) return { error: "bad-frame" };
@@ -73525,11 +73548,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73525
73548
  } catch (err) {
73526
73549
  return { error: "bad-op", message: err.message };
73527
73550
  }
73528
- if (ops.some((op) => op.path.length !== 2 || op.path[0] !== "y" || !(op.op === "del" || op.op === "set" && typeof op.value === "string"))) return { error: "page-format" };
73551
+ if (ops.some((op) => op.path.length !== 2 || op.path[0] !== "y" || !(op.op === "del" || op.op === "set" && typeof op.value === "string"))) return { error: "blockeditor-format" };
73529
73552
  }
73530
73553
  const nKey = frame.name + "\n" + clientId;
73531
73554
  const last2 = room.lastN.get(nKey);
73532
- const admission = room.compaction && frame.name === "page" && !receiptHas(last2, frame.n) ? admit(room, store, frame, ops) : null;
73555
+ const admission = room.compaction && frame.name === "blockeditor" && !receiptHas(last2, frame.n) ? admit(room, store, frame, ops) : null;
73533
73556
  if (admission?.error) return admission;
73534
73557
  if (receiptHas(last2, frame.n)) return { duplicate: true, seq: frame.n <= last2.n ? last2.seq : last2.savedSeq, epoch: room.epoch };
73535
73558
  if ((room.retiredReceipts?.get(nKey) ?? 0) > (frame.receiptGeneration ?? 0)) return { error: "receipt-expired" };
@@ -73570,11 +73593,11 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73570
73593
  }
73571
73594
  if (converted && !isYPageValue(value, { complete: false })) {
73572
73595
  undo();
73573
- return { error: "page-format" };
73596
+ return { error: "blockeditor-format" };
73574
73597
  }
73575
73598
  if (!converted && PAGE4.test(frame.name) && (isYPageValue(value, { complete: false }) || hybridSource && (Object.hasOwn(value, "y") || Object.hasOwn(value, "v")))) {
73576
73599
  undo();
73577
- return { error: "page-conversion-required" };
73600
+ return { error: "blockeditor-conversion-required" };
73578
73601
  }
73579
73602
  if (bytes > LIVE_LIMITS.storeBytes || roomBytes(room) - store.bytes + bytes > LIVE_LIMITS.roomBytes) {
73580
73603
  undo();
@@ -73611,7 +73634,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73611
73634
  if (admission && done.length) admission.admitted(bytes);
73612
73635
  const writerGone = room.writer && connected && !connected.includes(room.writer);
73613
73636
  if ((!room.writer || writerGone) && (!connected || connected.includes(clientId))) room.writer = clientId;
73614
- return { seq: room.seq, epoch: room.epoch, name: frame.name, ops, writer: room.writer, checkpoint: pressed(store), receiptGeneration: room.receiptGeneration ?? 0, ...transition && { pageGeneration: transition.id } };
73637
+ return { seq: room.seq, epoch: room.epoch, name: frame.name, ops, writer: room.writer, checkpoint: pressed(store), receiptGeneration: room.receiptGeneration ?? 0, ...transition && { blockeditorGeneration: transition.id } };
73615
73638
  },
73616
73639
  /** Everything a joining tab needs, with clientId's own receipt per store. Values are the room's own objects: serialize, never mutate. With since in this room's epoch, moves carries each store's log entries after since.seq (null where the log no longer reaches back that far). */
73617
73640
  state(room, clientId = null, since = void 0, { compaction: capable } = {}) {
@@ -73623,7 +73646,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73623
73646
  }
73624
73647
  const hidden = Boolean(legacy && (capable !== void 0 ? capable !== hostLimits.version : clientId && legacy.has(clientId)));
73625
73648
  for (const [name, s] of room.stores) {
73626
- if (hidden && name === "page") continue;
73649
+ if (hidden && name === "blockeditor") continue;
73627
73650
  const seen = {};
73628
73651
  const mine = clientId ? room.lastN.get(name + "\n" + clientId) : null;
73629
73652
  if (mine) seen[clientId] = mine.n;
@@ -73636,12 +73659,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73636
73659
  last: s.last,
73637
73660
  seen,
73638
73661
  ...mine?.saved?.length && { saved: mine.saved },
73639
- ...name === "page" && room.compaction && { compaction: { v: hostLimits.version, loose: hostLimits.loose, activeBytes: hostLimits.activeBytes } }
73662
+ ...name === "blockeditor" && room.compaction && { compaction: { v: hostLimits.version, loose: hostLimits.loose, activeBytes: hostLimits.activeBytes } }
73640
73663
  };
73641
73664
  }
73642
73665
  const provenance = { provenanceVersion: 2, receiptGeneration: room.receiptGeneration ?? 0 };
73643
- if (room.pageTransition) {
73644
- provenance.pageTransition = pageTransitionState(room.pageTransition, clientId);
73666
+ if (room.blockeditorTransition) {
73667
+ provenance.blockeditorTransition = pageTransitionState(room.blockeditorTransition, clientId);
73645
73668
  }
73646
73669
  if (since === void 0) return { epoch: room.epoch, seq: room.seq, writer: room.writer, stores, ...provenance };
73647
73670
  const from = since && since.epoch === room.epoch && Number.isInteger(since.seq) ? since.seq : 0;
@@ -73760,7 +73783,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73760
73783
  if (now() < state.job.deadline) return null;
73761
73784
  endJob(state.job);
73762
73785
  }
73763
- const store = room.stores.get("page");
73786
+ const store = room.stores.get("blockeditor");
73764
73787
  if (!store || pageReservations.has(room.key) || persistentReservations.has(room.key)) return null;
73765
73788
  const plan = planCompaction(store.value.y, { overflow }, hostLimits);
73766
73789
  if (!plan) return null;
@@ -73773,7 +73796,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73773
73796
  room,
73774
73797
  store,
73775
73798
  epoch: room.epoch,
73776
- generation: room.pageTransition?.id ?? null,
73799
+ generation: room.blockeditorTransition?.id ?? null,
73777
73800
  kind: plan.kind,
73778
73801
  sources: new Map(plan.sources),
73779
73802
  physical: Object.keys(store.value.y),
@@ -73800,7 +73823,7 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73800
73823
  jobs.delete(token);
73801
73824
  const { room, store } = job;
73802
73825
  if (!endJob(job)) return { refused: "stale-token" };
73803
- if (rooms.get(room.key) !== room || room.epoch !== job.epoch || room.stores.get("page") !== store || (room.pageTransition?.id ?? null) !== job.generation) return { refused: "stale-token" };
73826
+ if (rooms.get(room.key) !== room || room.epoch !== job.epoch || room.stores.get("blockeditor") !== store || (room.blockeditorTransition?.id ?? null) !== job.generation) return { refused: "stale-token" };
73804
73827
  const y2 = store.value.y;
73805
73828
  const retire = job.physical.filter((k2) => {
73806
73829
  const part = PART_KEY.exec(k2);
@@ -73855,12 +73878,12 @@ function createRooms({ now = Date.now, newEpoch = import_node_crypto3.randomUUID
73855
73878
  return {
73856
73879
  seq: room.seq,
73857
73880
  epoch: room.epoch,
73858
- name: "page",
73881
+ name: "blockeditor",
73859
73882
  ops,
73860
73883
  from: COMPACTOR,
73861
73884
  kind: job.kind,
73862
73885
  landed: store.landed,
73863
- ...room.pageTransition && { pageGeneration: room.pageTransition.id }
73886
+ ...room.blockeditorTransition && { blockeditorGeneration: room.blockeditorTransition.id }
73864
73887
  };
73865
73888
  },
73866
73889
  /** Every room's key. */
@@ -74009,7 +74032,7 @@ function documentTitle(items, { custom = false, currentTitle = "", keepWithoutHe
74009
74032
  }
74010
74033
 
74011
74034
  // src/server/checkpoint/index.js
74012
- var PAGE5 = /^page(\.[0-9]+)?$/;
74035
+ var PAGE5 = /^blockeditor(\.[0-9]+)?$/;
74013
74036
  var TITLE_MODE = "clay-seo-title-mode";
74014
74037
  var NAME3 = /^[A-Za-z0-9_.:-]{1,64}$/;
74015
74038
  var attr3 = (node, name) => node.attrs.find((item) => item.name === name)?.value;
@@ -74022,7 +74045,7 @@ function provenanceOf(room, store) {
74022
74045
  function captureCheckpoint(room, { nodeId, roomKey }) {
74023
74046
  if (!room || room.key !== roomKey || String(room.nodeId) !== String(nodeId)) throw new TypeError("The room identity changed");
74024
74047
  const { epoch, seq } = room;
74025
- const generation = room.pageTransition?.id ?? null;
74048
+ const generation = room.blockeditorTransition?.id ?? null;
74026
74049
  const stores = [...room.stores].filter(([, store]) => !store.ephemeral).map(([name, store]) => {
74027
74050
  const text4 = serializeLive(store.value);
74028
74051
  return { name, value: cloneJson(store.value), text: text4, liveAt: stampOf(epoch, seq, text4), provenance: provenanceOf(room, store) };
@@ -74050,7 +74073,7 @@ function inspect(html3) {
74050
74073
  if (!blocked && node.parentNode === head && node.tagName === "meta" && (attr3(node, "name") ?? "").trim().toLowerCase() === TITLE_MODE) {
74051
74074
  titleModes.push(attr3(node, "content"));
74052
74075
  }
74053
- if (!blocked && node.tagName === "article" && attr3(node, "data-page") !== void 0) articles.push(node);
74076
+ if (!blocked && node.tagName === "article" && attr3(node, "data-blockeditor") !== void 0) articles.push(node);
74054
74077
  if (!blocked && node.tagName === "script" && attr3(node, "src") === void 0 && (attr3(node, "clay") ?? "").split(/\s+/).includes("live")) {
74055
74078
  const type = (attr3(node, "type") ?? "").split(";")[0].trim().toLowerCase();
74056
74079
  const name = attr3(node, "merge");
@@ -74075,8 +74098,8 @@ function startTag(html3, node, store) {
74075
74098
  return raw.slice(0, -1) + insert + ">";
74076
74099
  }
74077
74100
  function projection(capture) {
74078
- const page = capture.stores.find((store) => store.name === "page");
74079
- if (!page || capture.stores.some((store) => PAGE5.test(store.name) && store.name !== "page")) return { kind: "refused", reason: "invalid-document" };
74101
+ const page = capture.stores.find((store) => store.name === "blockeditor");
74102
+ if (!page || capture.stores.some((store) => PAGE5.test(store.name) && store.name !== "blockeditor")) return { kind: "refused", reason: "invalid-document" };
74080
74103
  try {
74081
74104
  const blocks = blocksFromYValue(page.value);
74082
74105
  if (Object.values(blocks).some((block2) => block2.t === "tool" || block2.t === "table" && !Object.keys(block2.cols ?? {}).length)) {
@@ -74085,7 +74108,7 @@ function projection(capture) {
74085
74108
  return { kind: "ok", blocks };
74086
74109
  } catch (error) {
74087
74110
  if (error instanceof YDecodeError) {
74088
- return { kind: "refused", reason: error.code === "incomplete-update" || error.code === "unresolved-update" ? "incomplete-page" : error.code === "unsupported-content" ? "unknown-page-content" : "invalid-document" };
74111
+ return { kind: "refused", reason: error.code === "incomplete-update" || error.code === "unresolved-update" ? "incomplete-blockeditor" : error.code === "unsupported-content" ? "unknown-blockeditor-content" : "invalid-document" };
74089
74112
  }
74090
74113
  throw error;
74091
74114
  }
@@ -74195,7 +74218,7 @@ function renderCheckpoint(currentHtml, capture, { createDocument, recovery = fal
74195
74218
  if (!recovery && found.kind === "adopt" && capture.adopted !== found.A && !holdsEdit(found, decoded.blocks, doc)) return { kind: "refused", reason: "needs-adoption" };
74196
74219
  const current = currentHtml.slice(articleLoc2.startTag.endOffset, articleLoc2.endTag.startOffset);
74197
74220
  rendered = renderBlocks(decoded.blocks, { clean: fragmentCleaner(doc) });
74198
- if (current !== rendered.html && holdsEnvelope(current)) return { kind: "refused", reason: "unknown-page-content" };
74221
+ if (current !== rendered.html && holdsEnvelope(current)) return { kind: "refused", reason: "unknown-blockeditor-content" };
74199
74222
  } catch (error) {
74200
74223
  if (error instanceof YDecodeError || error instanceof SyntaxError) return { kind: "refused", reason: "invalid-document" };
74201
74224
  throw error;