@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
package/src/page/chart.js CHANGED
@@ -154,7 +154,7 @@ function option(doc, value, label, selected = false) {
154
154
  }
155
155
 
156
156
  function select(doc, field, label) {
157
- const node = element(doc, "select", "page-chart-select");
157
+ const node = element(doc, "select", "blockeditor-chart-select");
158
158
  node.dataset.field = field;
159
159
  node.setAttribute("aria-label", label);
160
160
  return node;
@@ -173,21 +173,21 @@ export class ChartView {
173
173
  const doc = view.dom.ownerDocument;
174
174
  this.doc = doc;
175
175
  this.dom = doc.createElement("figure");
176
- this.dom.className = "page-chart";
176
+ this.dom.className = "blockeditor-chart";
177
177
  this.dom.dataset.id = node.attrs.id ?? "";
178
178
  this.dom.dataset.type = "chart";
179
- this.head = element(doc, "div", "page-chart-head");
179
+ this.head = element(doc, "div", "blockeditor-chart-head");
180
180
  this.head.contentEditable = "false";
181
- this.title = element(doc, "span", "page-chart-title");
182
- this.chip = element(doc, "button", "page-chart-source");
181
+ this.title = element(doc, "span", "blockeditor-chart-title");
182
+ this.chip = element(doc, "button", "blockeditor-chart-source");
183
183
  this.chip.type = "button";
184
184
  this.chip.contentEditable = "false";
185
185
  this.chip.setAttribute("aria-label", "Go to source table");
186
186
  this.chip.innerHTML = TABLE_ICON;
187
- this.chipName = element(doc, "span", "page-chart-source-name");
187
+ this.chipName = element(doc, "span", "blockeditor-chart-source-name");
188
188
  this.chip.append(this.chipName);
189
189
  this.chip.addEventListener("click", () => this.goToSource());
190
- this.edit = element(doc, "button", "page-chart-edit");
190
+ this.edit = element(doc, "button", "blockeditor-chart-edit");
191
191
  this.edit.type = "button";
192
192
  this.edit.contentEditable = "false";
193
193
  this.edit.setAttribute("aria-haspopup", "dialog");
@@ -196,14 +196,14 @@ export class ChartView {
196
196
  this.edit.append("Edit chart");
197
197
  this.edit.addEventListener("click", () => (this.panel.isConnected ? this.closePanel(true) : this.openPanel()));
198
198
  this.head.append(this.title, this.chip, this.edit);
199
- this.plot = element(doc, "div", "page-chart-plot");
200
- this.broken = element(doc, "div", "page-chart-broken");
199
+ this.plot = element(doc, "div", "blockeditor-chart-plot");
200
+ this.broken = element(doc, "div", "blockeditor-chart-broken");
201
201
  this.broken.hidden = true;
202
202
  this.broken.contentEditable = "false";
203
203
  this.brokenKey = null;
204
204
  this.brokenSelect = null;
205
205
  this.broken.addEventListener("click", (event) => this.brokenClick(event));
206
- this.panel = element(doc, "div", "page-chart-panel");
206
+ this.panel = element(doc, "div", "blockeditor-chart-panel");
207
207
  this.panel.tabIndex = -1;
208
208
  this.panel.contentEditable = "false";
209
209
  this.panel.setAttribute("role", "dialog");
@@ -277,20 +277,20 @@ export class ChartView {
277
277
  const doc = this.doc;
278
278
  this.broken.textContent = "";
279
279
  this.broken.append(
280
- element(doc, "div", "page-chart-broken-head", "This chart's table was deleted"),
281
- element(doc, "p", "page-chart-broken-text", "Pick another table in this document, or delete the chart. Undo brings the table back."),
280
+ element(doc, "div", "blockeditor-chart-broken-head", "This chart's table was deleted"),
281
+ element(doc, "p", "blockeditor-chart-broken-text", "Pick another table in this document, or delete the chart. Undo brings the table back."),
282
282
  );
283
- const actions = element(doc, "div", "page-chart-broken-actions");
283
+ const actions = element(doc, "div", "blockeditor-chart-broken-actions");
284
284
  if (tables.length) {
285
285
  const sources = select(doc, "rescue", "Source table");
286
286
  for (const table of tables) sources.append(option(doc, table.id, `${table.name} (${table.rows} ${table.rows === 1 ? "row" : "rows"})`));
287
287
  this.brokenSelect = sources;
288
- const use = element(doc, "button", "page-chart-use", "Use this table");
288
+ const use = element(doc, "button", "blockeditor-chart-use", "Use this table");
289
289
  use.type = "button";
290
290
  use.dataset.action = "use";
291
291
  actions.append(sources, use);
292
292
  }
293
- const remove = element(doc, "button", "page-chart-delete", "Delete chart");
293
+ const remove = element(doc, "button", "blockeditor-chart-delete", "Delete chart");
294
294
  remove.type = "button";
295
295
  remove.dataset.action = "delete";
296
296
  actions.append(remove);
@@ -329,8 +329,8 @@ export class ChartView {
329
329
  }
330
330
 
331
331
  row(label, ...children) {
332
- const row = element(this.doc, "div", "page-chart-row");
333
- if (label) row.append(element(this.doc, "span", "page-chart-label", label));
332
+ const row = element(this.doc, "div", "blockeditor-chart-row");
333
+ if (label) row.append(element(this.doc, "span", "blockeditor-chart-label", label));
334
334
  row.append(...children);
335
335
  return row;
336
336
  }
@@ -370,9 +370,9 @@ export class ChartView {
370
370
  this.titleInput = null;
371
371
  this.panel.textContent = "";
372
372
 
373
- const types = element(doc, "div", "page-chart-types");
373
+ const types = element(doc, "div", "blockeditor-chart-types");
374
374
  for (const [kind, label] of CHART_TYPES) {
375
- const button = element(doc, "button", "page-chart-type", label);
375
+ const button = element(doc, "button", "blockeditor-chart-type", label);
376
376
  button.type = "button";
377
377
  button.dataset.kind = kind;
378
378
  button.setAttribute("aria-pressed", String(attrs.kind === kind));
@@ -390,22 +390,22 @@ export class ChartView {
390
390
  for (const col of cols) labels.append(option(doc, col.id, col.name || col.id, col.id === attrs.x));
391
391
  this.panel.append(this.row("Labels column", labels));
392
392
 
393
- const values = element(doc, "div", "page-chart-values");
393
+ const values = element(doc, "div", "blockeditor-chart-values");
394
394
  cols.filter((col) => col.id !== attrs.x).forEach((col, index) => {
395
- const line = element(doc, "label", "page-chart-value");
395
+ const line = element(doc, "label", "blockeditor-chart-value");
396
396
  const check = element(doc, "input");
397
397
  check.type = "checkbox";
398
398
  check.dataset.field = "series";
399
399
  check.dataset.col = col.id;
400
400
  check.checked = attrs.series.includes(col.id);
401
- const swatch = element(doc, "span", "page-chart-swatch");
401
+ const swatch = element(doc, "span", "blockeditor-chart-swatch");
402
402
  swatch.style.background = `var(--chart-${index % 6 + 1})`;
403
403
  swatch.setAttribute("aria-hidden", "true");
404
- line.append(check, swatch, element(doc, "span", "page-chart-value-name", col.name || col.id));
404
+ line.append(check, swatch, element(doc, "span", "blockeditor-chart-value-name", col.name || col.id));
405
405
  values.append(line);
406
406
  });
407
407
  const valueRow = this.row(pie ? "Value column" : "Value columns", values);
408
- if (pie) valueRow.append(element(doc, "span", "page-chart-hint", "Pie charts plot the first value column across rows."));
408
+ if (pie) valueRow.append(element(doc, "span", "blockeditor-chart-hint", "Pie charts plot the first value column across rows."));
409
409
  this.panel.append(valueRow);
410
410
 
411
411
  const highlight = select(doc, "highlight", "Highlight row");
@@ -413,7 +413,7 @@ export class ChartView {
413
413
  for (const row of rows) highlight.append(option(doc, row.id, cellText(row.cells?.[attrs.x]) || row.id, row.id === attrs.highlight));
414
414
  this.panel.append(this.row("Highlight row", highlight));
415
415
 
416
- const title = element(doc, "input", "page-chart-title-input");
416
+ const title = element(doc, "input", "blockeditor-chart-title-input");
417
417
  title.type = "text";
418
418
  title.dataset.field = "title";
419
419
  title.setAttribute("aria-label", "Chart title");
@@ -430,13 +430,13 @@ export class ChartView {
430
430
  this.titleInput = title;
431
431
  this.panel.append(this.row("Chart title", title));
432
432
 
433
- const foot = element(doc, "div", "page-chart-foot");
434
- const remove = element(doc, "button", "page-chart-remove");
433
+ const foot = element(doc, "div", "blockeditor-chart-foot");
434
+ const remove = element(doc, "button", "blockeditor-chart-remove");
435
435
  remove.type = "button";
436
436
  remove.dataset.action = "remove";
437
437
  remove.innerHTML = TRASH_ICON;
438
438
  remove.append("Remove");
439
- const done = element(doc, "button", "page-chart-done", "Done");
439
+ const done = element(doc, "button", "blockeditor-chart-done", "Done");
440
440
  done.type = "button";
441
441
  done.dataset.action = "done";
442
442
  foot.append(remove, done);
@@ -536,7 +536,7 @@ export class ChartView {
536
536
  return true;
537
537
  }
538
538
 
539
- stopEvent(event) { return !!event.target.closest?.(".page-chart-head, .page-chart-panel"); }
539
+ stopEvent(event) { return !!event.target.closest?.(".blockeditor-chart-head, .blockeditor-chart-panel"); }
540
540
 
541
541
  destroy() {
542
542
  this.unsaved?.dispose();
@@ -14,7 +14,7 @@
14
14
  * meaning, a page rebuilt from another article or a stale tag all produce no proof, and
15
15
  * the records stay.
16
16
  *
17
- * The second half is the conditional page-state client: the host's own copy of the page
17
+ * The second half is the conditional blockeditor-state client: the host's own copy of the page
18
18
  * state, asked for by the accepted ETag, for the cases a local capture cannot answer —
19
19
  * the server's checkpoint, another writer's, and a lost reply that only a verified
20
20
  * refetch can reconcile. Nothing here reads a cookie, a room sequence or a version
@@ -35,7 +35,7 @@ import { articleOfPageState, pageStateOfClone } from "./save-projection.js";
35
35
  // clone whose bytes it sends, after every transform.
36
36
  setCapturePageState(pageStateOfClone);
37
37
 
38
- /** The only page-state resource version this client reads. */
38
+ /** The only blockeditor-state resource version this client reads. */
39
39
  export const PAGE_STATE_VERSION = 1;
40
40
 
41
41
  export class PageCheckpointError extends Error {
@@ -79,7 +79,7 @@ const idKey = (value) => (value === null || value === undefined ? "" : String(va
79
79
  * failure are refusals with a code: the caller keeps its records and asks again later.
80
80
  *
81
81
  * @param {Object} options
82
- * @param {string} options.href - the resource discovery named in `document.pageState.href`
82
+ * @param {string} options.href - the resource discovery named in `document.blockeditorState.href`
83
83
  * @param {string} options.etag - the ETag the accepted bytes were stored under
84
84
  * @param {Function} [options.fetch]
85
85
  * @param {AbortSignal} [options.signal]
@@ -87,12 +87,12 @@ const idKey = (value) => (value === null || value === undefined ? "" : String(va
87
87
  */
88
88
  export async function readPageState({ href, etag, fetch: doFetch = globalThis.fetch, signal = null } = {}) {
89
89
  if (typeof etag !== "string" || !etag) return refused("missing-etag", "A conditional read needs the accepted ETag");
90
- if (typeof href !== "string" || !href) return refused("no-page-state", "This host names no page-state resource");
90
+ if (typeof href !== "string" || !href) return refused("no-blockeditor-state", "This host names no blockeditor-state resource");
91
91
  if (typeof doFetch !== "function") return refused("unavailable", "This tab cannot read the page state");
92
92
  const base = globalThis.location?.href ?? "http://localhost/";
93
93
  let url;
94
94
  try { url = new URL(href, base).href; }
95
- catch (_) { return refused("no-page-state", "The page-state resource is not a URL"); }
95
+ catch (_) { return refused("no-blockeditor-state", "The blockeditor-state resource is not a URL"); }
96
96
  const token = saveToken();
97
97
  let res;
98
98
  try {
@@ -105,23 +105,23 @@ export async function readPageState({ href, etag, fetch: doFetch = globalThis.fe
105
105
  signal,
106
106
  });
107
107
  } catch (_) {
108
- return refused("unavailable", "The page-state request did not complete");
108
+ return refused("unavailable", "The blockeditor-state request did not complete");
109
109
  }
110
- if (!res || typeof res.status !== "number") return refused("unavailable", "The page-state request did not answer");
110
+ if (!res || typeof res.status !== "number") return refused("unavailable", "The blockeditor-state request did not answer");
111
111
  if (res.status === 412) return refused("etag-mismatch", "Another version of this document is stored");
112
112
  if (res.status === 428) return refused("etag-required", "The host needs a condition this read cannot send");
113
- if (res.status === 404) return refused("no-page-state", "This host keeps no page state");
113
+ if (res.status === 404) return refused("no-blockeditor-state", "This host keeps no page state");
114
114
  if (!res.ok) return refused("unavailable", `The host answered ${res.status}`);
115
115
 
116
116
  let body;
117
117
  try { body = JSON.parse(await res.text()); }
118
- catch (_) { return refused("invalid-state", "The page-state answer is not JSON"); }
119
- if (!isObject(body) || body.version !== PAGE_STATE_VERSION) return refused("unsupported-version", "Unknown page-state version");
120
- if (typeof body.tag !== "string" || !body.tag) return refused("invalid-state", "The page-state answer carries no page tag");
121
- if (typeof body.stateHash !== "string" || !HEX64.test(body.stateHash)) return refused("invalid-state", "The page-state answer carries no state digest");
122
- if (typeof body.generation !== "string" || !GENERATION.test(body.generation)) return refused("invalid-state", "The page-state answer carries no generation");
123
- if (typeof body.etag !== "string" || !body.etag) return refused("invalid-state", "The page-state answer carries no ETag");
124
- if (!Object.hasOwn(body, "documentId")) return refused("invalid-state", "The page-state answer carries no document identity");
118
+ catch (_) { return refused("invalid-state", "The blockeditor-state answer is not JSON"); }
119
+ if (!isObject(body) || body.version !== PAGE_STATE_VERSION) return refused("unsupported-version", "Unknown blockeditor-state version");
120
+ if (typeof body.tag !== "string" || !body.tag) return refused("invalid-state", "The blockeditor-state answer carries no page tag");
121
+ if (typeof body.stateHash !== "string" || !HEX64.test(body.stateHash)) return refused("invalid-state", "The blockeditor-state answer carries no state digest");
122
+ if (typeof body.generation !== "string" || !GENERATION.test(body.generation)) return refused("invalid-state", "The blockeditor-state answer carries no generation");
123
+ if (typeof body.etag !== "string" || !body.etag) return refused("invalid-state", "The blockeditor-state answer carries no ETag");
124
+ if (!Object.hasOwn(body, "documentId")) return refused("invalid-state", "The blockeditor-state answer carries no document identity");
125
125
  return {
126
126
  ok: true,
127
127
  version: body.version,
@@ -149,7 +149,7 @@ export async function readPageState({ href, etag, fetch: doFetch = globalThis.fe
149
149
  * @param {{authority: Object, lineage: Object}} options.accepted
150
150
  * @param {string} options.article - the final outgoing canonical article
151
151
  * @param {string} options.etag - the ETag the accepted save carried
152
- * @returns {Promise<{ok: true, state: Object, receipt: {file: string, pageState: string}}|{ok: false, code: string, message: string}>}
152
+ * @returns {Promise<{ok: true, state: Object, receipt: {file: string, blockeditorState: string}}|{ok: false, code: string, message: string}>}
153
153
  */
154
154
  export async function verifyPageState(read, { accepted, article, etag } = {}) {
155
155
  if (!read || read.ok !== true) return refused(read?.code ?? "unavailable", read?.message ?? "The page state was not read");
@@ -167,7 +167,7 @@ export async function verifyPageState(read, { accepted, article, etag } = {}) {
167
167
  try { projected = articleOfPageState(state); }
168
168
  catch (error) { return refused("invalid-state", error?.message ?? "The page state does not project"); }
169
169
  if (projected !== article) return refused("article-mismatch", "The page state does not project to the accepted article");
170
- return { ok: true, state, receipt: { file: read.etag, pageState: read.stateHash } };
170
+ return { ok: true, state, receipt: { file: read.etag, blockeditorState: read.stateHash } };
171
171
  }
172
172
 
173
173
  // A proof is only worth the records the validator confirms, over the revisions the
@@ -217,7 +217,7 @@ export async function captureProof({ capture, records = [], accepted, article, s
217
217
  accepted,
218
218
  article,
219
219
  state,
220
- receipt: { file: etag, pageState: await digestHex(stateBytes) },
220
+ receipt: { file: etag, blockeditorState: await digestHex(stateBytes) },
221
221
  });
222
222
  } catch (error) {
223
223
  return refused(error?.code ?? "invalid-proof", error?.message ?? "The proof could not be built");
@@ -265,7 +265,7 @@ export async function refetchedProof({ read, capture, records = [], accepted, ar
265
265
  * @param {string} options.article
266
266
  * @param {Object} [options.state] - the page state pinned to the capture
267
267
  * @param {string} options.etag
268
- * @param {?string} [options.href] - the page-state resource, or null
268
+ * @param {?string} [options.href] - the blockeditor-state resource, or null
269
269
  * @param {Function} [options.read]
270
270
  * @param {Function} [options.fetch]
271
271
  * @returns {Promise<{ok: boolean, retired: Array, proof: ?Object, code?: string}>}
@@ -2,7 +2,7 @@
2
2
  // line, a toolbar over a text selection and a block menu (from the plus or "/").
3
3
  // At rest everything is faint; moving the pointer adds .is-moved to the shell,
4
4
  // which themes darken by a small step. All of it is themed through the
5
- // --page-* tokens in editor.js (contract: default-page/v1/look/THEME-CONTRACT.md).
5
+ // --blockeditor-* tokens in editor.js (contract: default-page/v1/look/THEME-CONTRACT.md).
6
6
  import { state, commands } from "../vendor/prosemirror.vendor.js";
7
7
  import { schema } from "./schema.js";
8
8
  import { BlockSelection, siblingSpan, moveBlock, indentBlocks, outdentBlocks } from "./blocks.js";
@@ -262,19 +262,19 @@ const el = (tag, cls, attrs = {}) => {
262
262
  };
263
263
 
264
264
  function toolButton(name, label) {
265
- const b = el("button", `page-tool${PHONE_TOOLS.has(name) ? " page-tool-primary" : " page-tool-desk"}`, { type: "button", "data-cmd": name, "aria-label": label, title: label });
265
+ const b = el("button", `blockeditor-tool${PHONE_TOOLS.has(name) ? " blockeditor-tool-primary" : " blockeditor-tool-desk"}`, { type: "button", "data-cmd": name, "aria-label": label, title: label });
266
266
  b.innerHTML = ICONS[name];
267
267
  return b;
268
268
  }
269
269
 
270
270
  const MOVED_MS = 1600;
271
271
  let menuCount = 0;
272
- export const chromeKey = new PluginKey("page-chrome");
272
+ export const chromeKey = new PluginKey("blockeditor-chrome");
273
273
  const chromeFor = new WeakMap();
274
274
 
275
275
  // A range a slash menu chose, held in plugin state so it follows the document
276
276
  // while the action it belongs to waits for code to load.
277
- export const slashRangeKey = new PluginKey("page-slash-range");
277
+ export const slashRangeKey = new PluginKey("blockeditor-slash-range");
278
278
  const slashRangeState = {
279
279
  init: () => null,
280
280
  apply(tr, value) {
@@ -324,9 +324,10 @@ export function reanchorPageMenu(view, from, to) {
324
324
  }
325
325
 
326
326
  class Chrome {
327
- constructor(view, onAiTool) {
327
+ constructor(view, onAiTool, mediaNote) {
328
328
  this.view = view;
329
329
  this.onAiTool = onAiTool;
330
+ this.mediaNote = mediaNote;
330
331
  this.shell = view.dom.parentElement;
331
332
  this.menu = null;
332
333
  this.priorAria = null;
@@ -340,33 +341,33 @@ class Chrome {
340
341
  this.roving = null;
341
342
  this.remote = false;
342
343
 
343
- this.dock = el("div", "page-dock", { role: "toolbar", "aria-label": "Formatting" });
344
- this.turn = el("button", "page-tool page-tool-turn page-tool-desk", { type: "button", "aria-haspopup": "menu" });
345
- this.more = el("button", "page-tool page-tool-primary page-tool-more", { type: "button", "aria-label": "More", title: "More", "aria-haspopup": "menu" });
344
+ this.dock = el("div", "blockeditor-dock", { role: "toolbar", "aria-label": "Formatting" });
345
+ this.turn = el("button", "blockeditor-tool blockeditor-tool-turn blockeditor-tool-desk", { type: "button", "aria-haspopup": "menu" });
346
+ this.more = el("button", "blockeditor-tool blockeditor-tool-primary blockeditor-tool-more", { type: "button", "aria-label": "More", title: "More", "aria-haspopup": "menu" });
346
347
  this.more.innerHTML = ICONS.more;
347
- this.settingsBtn = el("button", "page-tool page-tool-desk page-tool-settings", { type: "button", "aria-label": "Document settings", title: "Document settings", "aria-haspopup": "dialog", "aria-expanded": "false" });
348
+ this.settingsBtn = el("button", "blockeditor-tool blockeditor-tool-desk blockeditor-tool-settings", { type: "button", "aria-label": "Document settings", title: "Document settings", "aria-haspopup": "dialog", "aria-expanded": "false" });
348
349
  this.settingsBtn.innerHTML = ICONS.gear;
349
350
  this.settingsEl = null;
350
351
  this.settingsOpen = false;
351
352
  this.settingsAnchor = null;
352
353
  this.settingSwitches = {};
353
- this.dock.append(this.turn, el("span", "page-tool-sep page-tool-desk"), ...TOOLS.map(([n, l]) => toolButton(n, l)), this.more);
354
+ this.dock.append(this.turn, el("span", "blockeditor-tool-sep blockeditor-tool-desk"), ...TOOLS.map(([n, l]) => toolButton(n, l)), this.more);
354
355
  // The loader publishes the page facade when its module arrives, which can be after
355
356
  // this toolbar is built, so the gear asks for the settings each time it is drawn.
356
357
  this.dock.insertBefore(this.settingsBtn, this.more);
357
358
  this.settingsBtn.hidden = !this.settingsAPI;
358
- this.plus = el("button", "page-plus", { type: "button", "aria-label": "Add a block", title: "Add a block" });
359
+ this.plus = el("button", "blockeditor-plus", { type: "button", "aria-label": "Add a block", title: "Add a block" });
359
360
  this.plus.innerHTML = ICONS.plus;
360
- this.grip = el("button", "page-grip", { type: "button", "aria-label": "Block actions", title: "Drag to move, click for actions", "aria-haspopup": "menu" });
361
+ this.grip = el("button", "blockeditor-grip", { type: "button", "aria-label": "Block actions", title: "Drag to move, click for actions", "aria-haspopup": "menu" });
361
362
  this.grip.innerHTML = ICONS.grip;
362
- this.bubble = el("div", "page-bubble", { role: "toolbar", "aria-label": "Selection", hidden: "" });
363
- this.bubbleTurn = el("button", "page-tool page-tool-turn", { type: "button", "aria-haspopup": "menu" });
364
- this.bubbleMore = el("button", "page-tool page-tool-primary page-tool-more", { type: "button", "aria-label": "More", title: "More", "aria-haspopup": "menu" });
363
+ this.bubble = el("div", "blockeditor-bubble", { role: "toolbar", "aria-label": "Selection", hidden: "" });
364
+ this.bubbleTurn = el("button", "blockeditor-tool blockeditor-tool-turn", { type: "button", "aria-haspopup": "menu" });
365
+ this.bubbleMore = el("button", "blockeditor-tool blockeditor-tool-primary blockeditor-tool-more", { type: "button", "aria-label": "More", title: "More", "aria-haspopup": "menu" });
365
366
  this.bubbleMore.innerHTML = ICONS.more;
366
- this.bubble.append(this.bubbleTurn, el("span", "page-tool-sep"), ...TOOLS.map(([n, l]) => toolButton(n, l)), this.bubbleMore);
367
- this.menuId = `page-menu-${++menuCount}`;
368
- this.menuEl = el("div", "page-menu", { role: "menu", id: this.menuId, hidden: "" });
369
- this.scrim = el("div", "page-scrim", { hidden: "" });
367
+ this.bubble.append(this.bubbleTurn, el("span", "blockeditor-tool-sep"), ...TOOLS.map(([n, l]) => toolButton(n, l)), this.bubbleMore);
368
+ this.menuId = `blockeditor-menu-${++menuCount}`;
369
+ this.menuEl = el("div", "blockeditor-menu", { role: "menu", id: this.menuId, hidden: "" });
370
+ this.scrim = el("div", "blockeditor-scrim", { hidden: "" });
370
371
  this.shell.insertBefore(this.dock, view.dom);
371
372
  this.shell.append(this.plus, this.grip, this.bubble, this.scrim, this.menuEl);
372
373
 
@@ -398,7 +399,7 @@ class Chrome {
398
399
  scrimPressed = false;
399
400
  });
400
401
  this.menuEl.addEventListener("click", (e) => {
401
- const row = e.target.closest(".page-menu-item");
402
+ const row = e.target.closest(".blockeditor-menu-item");
402
403
  if (row) this.pick(Number(row.dataset.index));
403
404
  });
404
405
  this.menuEl.addEventListener("keydown", (e) => {
@@ -460,14 +461,14 @@ class Chrome {
460
461
 
461
462
  dockControls() {
462
463
  const all = [...this.dock.querySelectorAll("button")].filter((b) => this.rendered(b));
463
- return this.isPhone() ? all.filter((b) => b.classList.contains("page-tool-primary")) : all;
464
+ return this.isPhone() ? all.filter((b) => b.classList.contains("blockeditor-tool-primary")) : all;
464
465
  }
465
466
 
466
467
  // Every transaction asks whether the roving control is still usable: one style read for
467
468
  // that control, not one for every button in the dock.
468
469
  inRoving(control) {
469
470
  if (!control || !this.dock.contains(control)) return false;
470
- if (this.isPhone() && !control.classList.contains("page-tool-primary")) return false;
471
+ if (this.isPhone() && !control.classList.contains("blockeditor-tool-primary")) return false;
471
472
  return this.rendered(control);
472
473
  }
473
474
 
@@ -595,26 +596,26 @@ class Chrome {
595
596
  // placed under the control that opened it.
596
597
  buildSettings() {
597
598
  if (this.settingsEl) return this.settingsEl;
598
- const panel = el("div", "page-settings", { role: "dialog", "aria-label": "Document settings", hidden: "" });
599
- const head = el("div", "page-settings-head");
600
- const title = el("span", "page-settings-title");
599
+ const panel = el("div", "blockeditor-settings", { role: "dialog", "aria-label": "Document settings", hidden: "" });
600
+ const head = el("div", "blockeditor-settings-head");
601
+ const title = el("span", "blockeditor-settings-title");
601
602
  title.textContent = "Document settings";
602
- const close = el("button", "page-settings-close", { type: "button", "aria-label": "Close settings" });
603
+ const close = el("button", "blockeditor-settings-close", { type: "button", "aria-label": "Close settings" });
603
604
  close.innerHTML = ICONS.close;
604
605
  close.addEventListener("click", () => this.closeSettings(true));
605
606
  head.append(title, close);
606
607
  const rows = SETTING_ROWS.map(([key, label]) => {
607
- const row = el("div", "page-settings-row");
608
- const name = el("span", "page-settings-name", { id: `${this.menuId}-set-${key}` });
608
+ const row = el("div", "blockeditor-settings-row");
609
+ const name = el("span", "blockeditor-settings-name", { id: `${this.menuId}-set-${key}` });
609
610
  name.textContent = label;
610
- const sw = el("button", "page-settings-switch", { type: "button", role: "switch", "aria-checked": "true", "aria-labelledby": name.id, "data-setting": key });
611
- sw.append(el("span", "page-settings-knob"));
611
+ const sw = el("button", "blockeditor-settings-switch", { type: "button", role: "switch", "aria-checked": "true", "aria-labelledby": name.id, "data-setting": key });
612
+ sw.append(el("span", "blockeditor-settings-knob"));
612
613
  sw.addEventListener("click", () => this.flipSetting(key));
613
614
  this.settingSwitches[key] = sw;
614
615
  row.append(name, sw);
615
616
  return row;
616
617
  });
617
- const note = el("div", "page-settings-note");
618
+ const note = el("div", "blockeditor-settings-note");
618
619
  note.textContent = "Hidden values stay saved and come back when turned on.";
619
620
  panel.append(head, ...rows, note);
620
621
  this.settingsEl = panel;
@@ -643,7 +644,7 @@ class Chrome {
643
644
  anchor.setAttribute("aria-expanded", "true");
644
645
  panel.hidden = false;
645
646
  this.placeSettings();
646
- panel.querySelector(".page-settings-close")?.focus({ preventScroll: true });
647
+ panel.querySelector(".blockeditor-settings-close")?.focus({ preventScroll: true });
647
648
  }
648
649
 
649
650
  closeSettings(restoreFocus = false) {
@@ -674,16 +675,16 @@ class Chrome {
674
675
  const x = Math.max(v.left + PHONE_INSET, Math.min(r.right - width, v.left + v.width - PHONE_INSET - width));
675
676
  let y = r.top - 6 - height;
676
677
  if (y < v.top + PHONE_INSET) y = Math.min(r.bottom + 6, v.top + v.height - PHONE_INSET - height);
677
- panel.style.setProperty("--page-pop-x", `${x}px`);
678
- panel.style.setProperty("--page-pop-y", `${Math.max(v.top + PHONE_INSET, y)}px`);
678
+ panel.style.setProperty("--blockeditor-pop-x", `${x}px`);
679
+ panel.style.setProperty("--blockeditor-pop-y", `${Math.max(v.top + PHONE_INSET, y)}px`);
679
680
  return;
680
681
  }
681
682
  const shellBox = this.shell.getBoundingClientRect();
682
683
  const x = Math.max(8, Math.min(r.right - shellBox.left - width, Math.max(8, shellBox.width - width - 8)));
683
684
  let y = r.bottom - shellBox.top + 6;
684
685
  if (y + height > this.win.innerHeight - 8 && r.top - shellBox.top - 6 - height >= 8) y = r.top - shellBox.top - 6 - height;
685
- panel.style.setProperty("--page-pop-x", `${x}px`);
686
- panel.style.setProperty("--page-pop-y", `${y}px`);
686
+ panel.style.setProperty("--blockeditor-pop-x", `${x}px`);
687
+ panel.style.setProperty("--blockeditor-pop-y", `${y}px`);
687
688
  }
688
689
 
689
690
  toggleMenu(mode, anchor) {
@@ -741,7 +742,7 @@ class Chrome {
741
742
  ...actions,
742
743
  ...(phone && this.settingsAPI ? [{ key: "settings", label: "Document settings", icon: "gear", focus: false, run: (view, chrome) => chrome.openSettings(chrome.more) }] : []),
743
744
  { key: "titleIcon", label: "Page icon", icon: "\u263A", run: (view) => runMenuCommand(view, "titleIcon") },
744
- { key: "titleCover", label: "Add cover", icon: "\u25A4", run: (view) => runMenuCommand(view, "titleCover") },
745
+ ...(this.mediaNote ? [] : [{ key: "titleCover", label: "Add cover", icon: "\u25A4", run: (view) => runMenuCommand(view, "titleCover") }]),
745
746
  { key: "exportHtml", label: "Export reading copy", icon: "\u21E9", run: (view) => runMenuCommand(view, "exportHtml") },
746
747
  { key: "exportMarkdown", label: "Export as Markdown", icon: "M\u21E9", run: (view) => runMenuCommand(view, "exportMarkdown") },
747
748
  ];
@@ -751,9 +752,11 @@ class Chrome {
751
752
  if (m.mode === "external") return m.externalItems || [];
752
753
  if (m.mode === "actions") return actionsFor(this.view.state);
753
754
  if (m.mode === "more") return this.moreItems();
754
- const items = m.mode === "turn" ? BLOCK_TYPES : insertItemsFor(this.view.state, this.onAiTool
755
+ const all = this.onAiTool
755
756
  ? [...MENU_ITEMS, { key: "ai", label: "Make a tool with AI…", icon: "✦", aliases: ["tool", "generate"], insert: "ai" }]
756
- : MENU_ITEMS);
757
+ : MENU_ITEMS;
758
+ const offered = this.mediaNote ? all.filter((item) => item.key !== "image" && item.key !== "file") : all;
759
+ const items = m.mode === "turn" ? BLOCK_TYPES : insertItemsFor(this.view.state, offered);
757
760
  return rankItems(items, m.query);
758
761
  }
759
762
 
@@ -785,12 +788,12 @@ class Chrome {
785
788
  this.menuEl.setAttribute("role", slash ? "listbox" : "menu");
786
789
  const nodes = [];
787
790
  if (m.mode === "turn") {
788
- const title = el("div", "page-menu-title");
791
+ const title = el("div", "blockeditor-menu-title");
789
792
  title.textContent = m.query ? `Turn into “${m.query}”` : "Turn into";
790
793
  nodes.push(title);
791
794
  }
792
795
  if (!m.items.length) {
793
- const none = el("div", "page-menu-empty");
796
+ const none = el("div", "blockeditor-menu-empty");
794
797
  none.textContent = "No matching blocks";
795
798
  nodes.push(none);
796
799
  }
@@ -798,26 +801,32 @@ class Chrome {
798
801
  const active = i === m.active;
799
802
  const checked = current ? current.size === 1 && b.key === [...current][0] : (typeof b.checked === "boolean" ? b.checked : null);
800
803
  const role = m.mode === "turn" ? "menuitemradio" : typeof checked === "boolean" ? "menuitemcheckbox" : slash ? "option" : "menuitem";
801
- const row = el("button", `page-menu-item${active ? " is-active" : ""}`, { type: "button", role, tabindex: !slash && active ? "0" : "-1", id: `${this.menuId}-${i}`, "data-index": String(i), ...(role === "menuitemradio" ? {} : { "aria-selected": active ? "true" : "false" }), ...(typeof checked === "boolean" ? { "aria-checked": String(checked) } : {}) });
802
- const icon = el("span", "page-menu-icon");
804
+ const row = el("button", `blockeditor-menu-item${active ? " is-active" : ""}`, { type: "button", role, tabindex: !slash && active ? "0" : "-1", id: `${this.menuId}-${i}`, "data-index": String(i), ...(role === "menuitemradio" ? {} : { "aria-selected": active ? "true" : "false" }), ...(typeof checked === "boolean" ? { "aria-checked": String(checked) } : {}) });
805
+ const icon = el("span", "blockeditor-menu-icon");
803
806
  if (ICONS[b.icon]) icon.innerHTML = ICONS[b.icon];
804
807
  else icon.textContent = b.icon || "";
805
- const label = el("span", "page-menu-label");
808
+ const label = el("span", "blockeditor-menu-label");
806
809
  label.textContent = b.label;
807
810
  if (b.description) {
808
- const text = el("span", "page-menu-text");
809
- const description = el("span", "page-menu-desc");
811
+ const text = el("span", "blockeditor-menu-text");
812
+ const description = el("span", "blockeditor-menu-desc");
810
813
  description.textContent = b.description;
811
814
  text.append(label, description);
812
815
  row.append(icon, text);
813
816
  } else row.append(icon, label);
814
817
  if (b.hint) {
815
- const hint = el("span", "page-menu-hint");
818
+ const hint = el("span", "blockeditor-menu-hint");
816
819
  hint.textContent = b.hint;
817
820
  row.append(hint);
818
821
  }
819
822
  nodes.push(row);
820
823
  });
824
+ // A visitor's draft keeps no pictures or files: the menu says where they go instead.
825
+ if (this.mediaNote && m.mode !== "turn" && m.mode !== "actions" && m.mode !== "more" && m.mode !== "external") {
826
+ const note = el("div", "blockeditor-menu-note", { role: "note" });
827
+ note.textContent = this.mediaNote;
828
+ nodes.push(note);
829
+ }
821
830
  this.menuEl.replaceChildren(...nodes);
822
831
  if (slash && m.items.length) this.view.dom.setAttribute("aria-activedescendant", `${this.menuId}-${m.active}`);
823
832
  else this.view.dom.removeAttribute("aria-activedescendant");
@@ -933,7 +942,7 @@ class Chrome {
933
942
  // The safe-area inset the browser reports, read through one hidden probe.
934
943
  safeBottom() {
935
944
  if (!this.probe) {
936
- this.probe = el("div", "page-safe-probe");
945
+ this.probe = el("div", "blockeditor-safe-probe");
937
946
  this.shell.append(this.probe);
938
947
  }
939
948
  return parseFloat(this.win.getComputedStyle(this.probe).paddingBottom) || 0;
@@ -944,10 +953,10 @@ class Chrome {
944
953
  const v = phoneViewport(this.win);
945
954
  const maxHeight = Math.max(0, v.height - PHONE_INSET * 2);
946
955
  const width = Math.min(280, Math.max(0, v.width - PHONE_INSET * 2));
947
- const applied = this.menuEl.style.getPropertyValue("--page-pop-max");
948
- this.menuEl.style.removeProperty("--page-pop-max");
956
+ const applied = this.menuEl.style.getPropertyValue("--blockeditor-pop-max");
957
+ this.menuEl.style.removeProperty("--blockeditor-pop-max");
949
958
  const natural = this.menuEl.offsetHeight || 0;
950
- if (applied) this.menuEl.style.setProperty("--page-pop-max", applied);
959
+ if (applied) this.menuEl.style.setProperty("--blockeditor-pop-max", applied);
951
960
  const height = Math.min(natural, maxHeight);
952
961
  const left = Math.max(v.left + PHONE_INSET, Math.min(bar.left, v.left + v.width - PHONE_INSET - width));
953
962
  let top = bar.top - 6 - height;
@@ -1018,34 +1027,34 @@ class Chrome {
1018
1027
  this.dock.style.left = `${layout.bar.left}px`;
1019
1028
  this.dock.style.top = `${layout.bar.top}px`;
1020
1029
  this.dock.style.width = `${layout.bar.width}px`;
1021
- this.grip.style.setProperty("--page-grip-lift", `${layout.bar.height}px`);
1030
+ this.grip.style.setProperty("--blockeditor-grip-lift", `${layout.bar.height}px`);
1022
1031
  } else {
1023
1032
  if (layout.desk) for (const side of ["left", "top", "width"]) this.dock.style.removeProperty(side);
1024
- this.grip.style.removeProperty("--page-grip-lift");
1033
+ this.grip.style.removeProperty("--blockeditor-grip-lift");
1025
1034
  }
1026
1035
  if (layout.gutter) {
1027
1036
  for (const part of [this.plus, this.grip]) {
1028
- part.style.setProperty("--page-plus-top", `${layout.gutter.top}px`);
1029
- part.style.setProperty("--page-plus-left", `${layout.gutter.left}px`);
1037
+ part.style.setProperty("--blockeditor-plus-top", `${layout.gutter.top}px`);
1038
+ part.style.setProperty("--blockeditor-plus-left", `${layout.gutter.left}px`);
1030
1039
  }
1031
1040
  }
1032
- this.plus.style.setProperty("--page-text-left", `${layout.textLeft}px`);
1041
+ this.plus.style.setProperty("--blockeditor-text-left", `${layout.textLeft}px`);
1033
1042
  if (layout.bubble) {
1034
- this.bubble.style.setProperty("--page-pop-x", `${layout.bubble.x}px`);
1035
- this.bubble.style.setProperty("--page-pop-y", `${layout.bubble.y}px`);
1043
+ this.bubble.style.setProperty("--blockeditor-pop-x", `${layout.bubble.x}px`);
1044
+ this.bubble.style.setProperty("--blockeditor-pop-y", `${layout.bubble.y}px`);
1036
1045
  }
1037
1046
  if (layout.menu) {
1038
- this.menuEl.style.setProperty("--page-pop-x", `${layout.menu.x}px`);
1039
- this.menuEl.style.setProperty("--page-pop-y", `${layout.menu.y}px`);
1047
+ this.menuEl.style.setProperty("--blockeditor-pop-x", `${layout.menu.x}px`);
1048
+ this.menuEl.style.setProperty("--blockeditor-pop-y", `${layout.menu.y}px`);
1040
1049
  if (layout.menu.width !== undefined) {
1041
- this.menuEl.style.setProperty("--page-pop-width", `${layout.menu.width}px`);
1042
- this.menuEl.style.setProperty("--page-pop-max", `${layout.menu.maxHeight}px`);
1050
+ this.menuEl.style.setProperty("--blockeditor-pop-width", `${layout.menu.width}px`);
1051
+ this.menuEl.style.setProperty("--blockeditor-pop-max", `${layout.menu.maxHeight}px`);
1043
1052
  }
1044
1053
  }
1045
1054
  }
1046
1055
 
1047
1056
  get settingsAPI() {
1048
- return globalThis.clay?.page?.settings ?? null;
1057
+ return globalThis.clay?.blockeditor?.settings ?? null;
1049
1058
  }
1050
1059
 
1051
1060
  update(view, prev) {
@@ -1107,12 +1116,12 @@ class Chrome {
1107
1116
  }
1108
1117
  }
1109
1118
 
1110
- export function chromePlugin({ onAiTool = null } = {}) {
1119
+ export function chromePlugin({ onAiTool = null, mediaNote = null } = {}) {
1111
1120
  let chrome = null;
1112
1121
  return new Plugin({
1113
1122
  key: chromeKey,
1114
1123
  view(view) {
1115
- chrome = new Chrome(view, onAiTool);
1124
+ chrome = new Chrome(view, onAiTool, mediaNote);
1116
1125
  chromeFor.set(view, chrome);
1117
1126
  return chrome;
1118
1127
  },
@@ -122,5 +122,5 @@ function pastedTable(dom) {
122
122
  return found;
123
123
  }
124
124
 
125
- export const table = (dom) => ({ cols: pastedTable(dom).cols, sort: pastedTable(dom).sort, parent: dom.getAttribute("data-page-parent") || null });
125
+ export const table = (dom) => ({ cols: pastedTable(dom).cols, sort: pastedTable(dom).sort, parent: dom.getAttribute("data-blockeditor-parent") || null });
126
126
  export const rows = (dom) => pastedTable(dom).rows;