@jackuait/blok 0.10.0-beta.9 → 0.10.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 (269) hide show
  1. package/dist/blok.mjs +2 -2
  2. package/dist/chunks/{blok-DDu252IK.mjs → blok-u_68bnlk.mjs} +1617 -1562
  3. package/dist/chunks/{constants-DMW9a31I.mjs → constants-VDhCUk4c.mjs} +56 -48
  4. package/dist/chunks/{i18next-loader-CwsYu0n6.mjs → i18next-loader-CDnSPae_.mjs} +1 -1
  5. package/dist/chunks/{lightweight-i18n-Cvv8CWh4.mjs → lightweight-i18n-DZmo8dAI.mjs} +1 -0
  6. package/dist/chunks/{messages-DG-4DPmP.mjs → messages-1_6UkKLS.mjs} +1 -0
  7. package/dist/{messages-CqXtJTpU.mjs → chunks/messages-4Ck88DYZ2.mjs} +1 -0
  8. package/dist/chunks/{messages-DGL1ySqb2.mjs → messages-8Ld7P_9j2.mjs} +1 -0
  9. package/dist/{messages-DLX_iBDJ.mjs → chunks/messages-BAlZjPcl.mjs} +1 -0
  10. package/dist/chunks/{messages-p1mbe__S.mjs → messages-BHMiK51R.mjs} +1 -0
  11. package/dist/chunks/{messages-Cdf0W9H02.mjs → messages-BJ-vT1SU2.mjs} +1 -0
  12. package/dist/{messages-Smt4GBbj.mjs → chunks/messages-BK8Cp2d0.mjs} +1 -0
  13. package/dist/{messages-Ci0KqX-J.mjs → chunks/messages-BKN3YVIj.mjs} +1 -0
  14. package/dist/chunks/{messages-BXM80fdr2.mjs → messages-BMD37y3q2.mjs} +1 -0
  15. package/dist/{messages-B19o-Teb.mjs → chunks/messages-BONyZroH.mjs} +1 -0
  16. package/dist/{messages-BwHs4cm1.mjs → chunks/messages-BRAoJpOu.mjs} +1 -0
  17. package/dist/{messages-DY4IqlhY.mjs → chunks/messages-BRoa9tGl.mjs} +1 -0
  18. package/dist/chunks/{messages-RInp1ytX.mjs → messages-BbEW9bQz.mjs} +1 -0
  19. package/dist/{messages-BIHc0KHY.mjs → chunks/messages-BeGZqQwz.mjs} +1 -0
  20. package/dist/{messages-CmB406HW.mjs → chunks/messages-BfAcUavP.mjs} +1 -0
  21. package/dist/chunks/{messages-Cu-Wevxs2.mjs → messages-BgM91Lxm2.mjs} +1 -0
  22. package/dist/{messages-BYNcD6uR.mjs → chunks/messages-BlxwW7M6.mjs} +1 -0
  23. package/dist/chunks/{messages-rCd0Rrw6.mjs → messages-Bz0-KNEB.mjs} +1 -0
  24. package/dist/{messages-7QD-X6XT2.mjs → chunks/messages-C0IFfhnp.mjs} +1 -0
  25. package/dist/{messages-Dl5Y2-Ia.mjs → chunks/messages-C15z2r5U.mjs} +1 -0
  26. package/dist/chunks/{messages-MxpWO1db.mjs → messages-C1S9ztpF.mjs} +1 -0
  27. package/dist/chunks/{messages-8IHf7ZP3.mjs → messages-CC_noR8y.mjs} +1 -0
  28. package/dist/chunks/{messages-COO5xmcA.mjs → messages-CD_MnBln.mjs} +1 -0
  29. package/dist/chunks/{messages-BYlSMRkd.mjs → messages-CIfUm1Oa.mjs} +1 -0
  30. package/dist/{messages-BbYq1pk-.mjs → chunks/messages-CPBN4zWc.mjs} +1 -0
  31. package/dist/{messages-DPA-mMWC2.mjs → chunks/messages-CQBo3lmL2.mjs} +1 -0
  32. package/dist/{messages-DnGJD4TL.mjs → chunks/messages-CRF7nNrO.mjs} +1 -0
  33. package/dist/{messages-D8FQWulF2.mjs → chunks/messages-CTCe595D2.mjs} +1 -0
  34. package/dist/{messages-BRZX964b2.mjs → chunks/messages-CW35K1pq.mjs} +1 -0
  35. package/dist/{messages-DnG0ef8t2.mjs → chunks/messages-CZSlfnkO2.mjs} +1 -0
  36. package/dist/chunks/{messages-iS34FHFB.mjs → messages-ChK7v1PV.mjs} +1 -0
  37. package/dist/{messages-BiUGXvYr2.mjs → chunks/messages-Clku7Cf-2.mjs} +1 -0
  38. package/dist/{messages-DIJlIqlQ2.mjs → chunks/messages-CszmHAvQ.mjs} +1 -0
  39. package/dist/chunks/{messages-DWu1r4gc2.mjs → messages-CvANwuht2.mjs} +1 -0
  40. package/dist/{messages-nUVjeh7K.mjs → chunks/messages-CxiURE2X.mjs} +1 -0
  41. package/dist/chunks/{messages-A_MkXDlG.mjs → messages-CxxyR4vY.mjs} +1 -0
  42. package/dist/{messages-ynAe7ewZ.mjs → chunks/messages-D22e9h7V2.mjs} +1 -0
  43. package/dist/{messages-DYTTu0O12.mjs → chunks/messages-D7dx_6k8.mjs} +1 -0
  44. package/dist/chunks/{messages-BA8Iv99Y2.mjs → messages-DBMaLL8b2.mjs} +1 -0
  45. package/dist/{messages-DbySKTKt2.mjs → chunks/messages-DB_-5Xln.mjs} +1 -0
  46. package/dist/{messages-CcF4y-E4.mjs → chunks/messages-DEBy3nuJ2.mjs} +1 -0
  47. package/dist/chunks/{messages-NEqrrYvE2.mjs → messages-DMoERagV2.mjs} +1 -0
  48. package/dist/chunks/{messages-Bxvi1ebN.mjs → messages-DPzHD51Y.mjs} +1 -0
  49. package/dist/chunks/{messages-jfVpL9c-2.mjs → messages-DSrdy9Nw2.mjs} +1 -0
  50. package/dist/chunks/{messages-Cmf6NhSC.mjs → messages-DTN1XGll.mjs} +1 -0
  51. package/dist/{messages-5jvKxQNu2.mjs → chunks/messages-DUeiPraX.mjs} +1 -0
  52. package/dist/chunks/{messages-G416eyjY.mjs → messages-DUr9WAkD.mjs} +1 -0
  53. package/dist/chunks/{messages-Ck81cQkn2.mjs → messages-DVr1sqfI2.mjs} +1 -0
  54. package/dist/{messages-BYmmMDrN2.mjs → chunks/messages-DjvaiALg2.mjs} +1 -0
  55. package/dist/chunks/{messages-D55HRx5O2.mjs → messages-DrfRYiM32.mjs} +1 -0
  56. package/dist/chunks/{messages-B2N4fUi72.mjs → messages-DtoId_bw2.mjs} +1 -0
  57. package/dist/{messages-Bq3F2Tp_.mjs → chunks/messages-Du2BffA7.mjs} +1 -0
  58. package/dist/{messages-CjbnogEC.mjs → chunks/messages-DxHh0O8j2.mjs} +1 -0
  59. package/dist/{messages-BECMxmfX.mjs → chunks/messages-EDMC5ukV.mjs} +1 -0
  60. package/dist/{messages-BTQPpoM42.mjs → chunks/messages-ElIGUi0O2.mjs} +1 -0
  61. package/dist/chunks/{messages-BhzzNkN-.mjs → messages-JSQjKQ8I.mjs} +1 -0
  62. package/dist/{messages-CWIXvnDf2.mjs → chunks/messages-Q7-4ZJLB2.mjs} +1 -0
  63. package/dist/chunks/{messages-DOuS1Qge.mjs → messages-QMOmwcZb.mjs} +1 -0
  64. package/dist/{messages-hWwSRF-2.mjs → chunks/messages-QilfinOn2.mjs} +1 -0
  65. package/dist/{messages-BmAn22OX.mjs → chunks/messages-a07QVz8U.mjs} +1 -0
  66. package/dist/chunks/{messages-BYxLFj7y.mjs → messages-eFd4YYzt.mjs} +1 -0
  67. package/dist/chunks/{messages-BSghd0ez.mjs → messages-euM2m3wQ.mjs} +1 -0
  68. package/dist/chunks/{messages-BVjoM7P0.mjs → messages-kGmxkeFH.mjs} +1 -0
  69. package/dist/{messages-DMr62KiO2.mjs → chunks/messages-oMc7qugU2.mjs} +1 -0
  70. package/dist/chunks/{messages-DzTk8bJ5.mjs → messages-sDdNf8O9.mjs} +1 -0
  71. package/dist/{messages-Bm0Feca1.mjs → chunks/messages-wl8YrvGG.mjs} +1 -0
  72. package/dist/chunks/{messages-BAsb5CgZ.mjs → messages-zt6zdYWh.mjs} +1 -0
  73. package/dist/chunks/{tools-XmzH2rgQ.mjs → tools-1ZFajlGN.mjs} +1619 -1307
  74. package/dist/full.mjs +3 -3
  75. package/dist/locales.mjs +68 -67
  76. package/dist/{messages-F2xRoY1w.mjs → messages-2ZWBTerL.mjs} +1 -0
  77. package/dist/{messages-Dl3Sv6Rq2.mjs → messages-53w0fPZS2.mjs} +1 -0
  78. package/dist/{chunks/messages-BDZA10kl2.mjs → messages-98nQiC7t2.mjs} +1 -0
  79. package/dist/{chunks/messages-JyvWu4rf2.mjs → messages-A96tMxeU.mjs} +1 -0
  80. package/dist/{messages-Ce6KVEbT.mjs → messages-BE_z-zrb.mjs} +1 -0
  81. package/dist/{chunks/messages-CSJ_zb3a2.mjs → messages-BK_LsgY4.mjs} +1 -0
  82. package/dist/{messages-CJTy6JZt.mjs → messages-BbJ7ZXY8.mjs} +1 -0
  83. package/dist/{chunks/messages-DMVXnAYj.mjs → messages-BcVB3osF.mjs} +1 -0
  84. package/dist/{chunks/messages-CSL-6xfb2.mjs → messages-BckDk9aq2.mjs} +1 -0
  85. package/dist/{chunks/messages-C0HvoMPb.mjs → messages-Be_2RHZD.mjs} +1 -0
  86. package/dist/{chunks/messages-Dr0Ekmbz.mjs → messages-BesJaI6A.mjs} +1 -0
  87. package/dist/{chunks/messages-D3zojZ94.mjs → messages-BiTMwiKH.mjs} +1 -0
  88. package/dist/{messages-B1ZUQagA.mjs → messages-BmH2cQHQ.mjs} +1 -0
  89. package/dist/{chunks/messages-Bfnq1xv4.mjs → messages-BrOWqNCu2.mjs} +1 -0
  90. package/dist/{messages-Dnp9N6RU2.mjs → messages-Brd5R-da2.mjs} +1 -0
  91. package/dist/{chunks/messages-DJoNVjqP.mjs → messages-C0GSBBCo2.mjs} +1 -0
  92. package/dist/{messages-Dw__BcTj.mjs → messages-C1vc5584.mjs} +1 -0
  93. package/dist/{messages-aMXpHt5X2.mjs → messages-C6ONf71u2.mjs} +1 -0
  94. package/dist/{chunks/messages-BeFqtIrc2.mjs → messages-C7lJg8fy2.mjs} +1 -0
  95. package/dist/{messages-CSUHBs4c2.mjs → messages-CRNogopy2.mjs} +1 -0
  96. package/dist/{messages-DLlc9QPw.mjs → messages-CT-Kdas6.mjs} +1 -0
  97. package/dist/{chunks/messages-DlLXpgWM2.mjs → messages-CTTmWn4Y2.mjs} +1 -0
  98. package/dist/{messages-D0aw5_0k2.mjs → messages-CZbcxlZt2.mjs} +1 -0
  99. package/dist/{chunks/messages-Bp8qin1R.mjs → messages-C_Qn9SbQ.mjs} +1 -0
  100. package/dist/{messages-96iaAUds2.mjs → messages-CdEASHDp2.mjs} +1 -0
  101. package/dist/{messages-Dy-Y_nEI.mjs → messages-CdduYw-q.mjs} +1 -0
  102. package/dist/{chunks/messages-Je5YvxiY.mjs → messages-Che99vKP.mjs} +1 -0
  103. package/dist/{messages-nlhESX9t.mjs → messages-CisR4PNV.mjs} +1 -0
  104. package/dist/{chunks/messages-BE6lHKwf.mjs → messages-ClGvlFcH2.mjs} +1 -0
  105. package/dist/{chunks/messages-FWfsxpBz.mjs → messages-CnuH-BZK2.mjs} +1 -0
  106. package/dist/{chunks/messages-aZcy0JQq2.mjs → messages-D0005ti32.mjs} +1 -0
  107. package/dist/{messages-B7ieAJBd2.mjs → messages-D05jqBIa2.mjs} +1 -0
  108. package/dist/{messages-DTh9a8mR.mjs → messages-D0lLw9KM.mjs} +1 -0
  109. package/dist/{chunks/messages-ihCjSFJI2.mjs → messages-D3rwCtKn.mjs} +1 -0
  110. package/dist/{chunks/messages-xuqyb6Ff2.mjs → messages-D6VIFnSW.mjs} +1 -0
  111. package/dist/{chunks/messages-KdawW5Na.mjs → messages-D81w6AmW.mjs} +1 -0
  112. package/dist/{chunks/messages-BUVhHx0q2.mjs → messages-DBhvm8NK.mjs} +1 -0
  113. package/dist/{chunks/messages-C7VGpihw.mjs → messages-DK6dA0O2.mjs} +1 -0
  114. package/dist/{messages-rk-A1Wa42.mjs → messages-DKHbt-7l2.mjs} +1 -0
  115. package/dist/{messages-BIoeoik5.mjs → messages-DM4Gjc9h.mjs} +1 -0
  116. package/dist/{chunks/messages-B9kmbUWV.mjs → messages-DODrhcop.mjs} +1 -0
  117. package/dist/{messages-BsycN_JI2.mjs → messages-DOGbHYv-2.mjs} +1 -0
  118. package/dist/{chunks/messages-BQYvBqm2.mjs → messages-DQORja0D.mjs} +1 -0
  119. package/dist/{chunks/messages-CVdpweyf2.mjs → messages-DSmxJWju2.mjs} +1 -0
  120. package/dist/{messages-CR_L_UtK.mjs → messages-DVL0KZE5.mjs} +1 -0
  121. package/dist/{chunks/messages-Cs81Z_Bh.mjs → messages-DYuD5-rO.mjs} +1 -0
  122. package/dist/{chunks/messages-CKBhDGI3.mjs → messages-Ddq3Ce3E2.mjs} +1 -0
  123. package/dist/{messages-xh2eOLvs.mjs → messages-DfFZ6Yj5.mjs} +1 -0
  124. package/dist/{chunks/messages-C6Mpiacw.mjs → messages-Dnd5YSWv.mjs} +1 -0
  125. package/dist/{messages-BJeGJksD.mjs → messages-Do7Xjy0n.mjs} +1 -0
  126. package/dist/{chunks/messages-C3aX3q0H.mjs → messages-DopaMHC42.mjs} +1 -0
  127. package/dist/{messages-dv19AkyJ.mjs → messages-DpJGbx3q.mjs} +1 -0
  128. package/dist/{messages-DBiVgUs2.mjs → messages-DpwMKDV0.mjs} +1 -0
  129. package/dist/{messages-j7o5rT9s.mjs → messages-Dqu4aX9s.mjs} +1 -0
  130. package/dist/{chunks/messages-BjadX8jR2.mjs → messages-E8NjqzWq2.mjs} +1 -0
  131. package/dist/{messages-aWZH50vu2.mjs → messages-JNrYldAa2.mjs} +1 -0
  132. package/dist/{chunks/messages-B4UMuyjT.mjs → messages-LMaR2_bE.mjs} +1 -0
  133. package/dist/{messages-E_ZuzGDt.mjs → messages-LYJbLq_F.mjs} +1 -0
  134. package/dist/{chunks/messages-D9N2MvQx2.mjs → messages-Q5sQeVap2.mjs} +1 -0
  135. package/dist/{chunks/messages-Bphq_Bt3.mjs → messages-Xc0KUbYl.mjs} +1 -0
  136. package/dist/{chunks/messages-DlonA3wa.mjs → messages-_PLyRfVw.mjs} +1 -0
  137. package/dist/{chunks/messages-TRUuyiFB.mjs → messages-apA6BStA.mjs} +1 -0
  138. package/dist/{chunks/messages-B0vPBsWq.mjs → messages-bkGniiaz.mjs} +1 -0
  139. package/dist/{messages-DkLU_rWm.mjs → messages-neGD3WGq.mjs} +1 -0
  140. package/dist/{messages-Ddnj2iTG2.mjs → messages-qbKjjvgd2.mjs} +1 -0
  141. package/dist/{messages-BiiongNz2.mjs → messages-qfvXgPpu2.mjs} +1 -0
  142. package/dist/{messages-Dvn35ksS.mjs → messages-uwK7ktqk.mjs} +1 -0
  143. package/dist/react.mjs +2 -2
  144. package/dist/tools.mjs +2 -2
  145. package/package.json +3 -5
  146. package/src/cli/commands/convert-gdocs/index.ts +26 -0
  147. package/src/cli/commands/convert-html/block-builder.ts +392 -0
  148. package/src/cli/commands/convert-html/id-generator.ts +11 -0
  149. package/src/cli/commands/convert-html/index.ts +23 -0
  150. package/src/cli/commands/convert-html/preprocessor.ts +422 -0
  151. package/src/cli/commands/convert-html/sanitizer.ts +93 -0
  152. package/src/cli/commands/convert-html/types.ts +15 -0
  153. package/src/cli/index.ts +56 -5
  154. package/src/components/block/index.ts +58 -10
  155. package/src/components/constants/data-attributes.ts +10 -0
  156. package/src/components/i18n/locales/am/messages.json +1 -0
  157. package/src/components/i18n/locales/ar/messages.json +1 -0
  158. package/src/components/i18n/locales/az/messages.json +1 -0
  159. package/src/components/i18n/locales/bg/messages.json +1 -0
  160. package/src/components/i18n/locales/bn/messages.json +1 -0
  161. package/src/components/i18n/locales/bs/messages.json +1 -0
  162. package/src/components/i18n/locales/cs/messages.json +1 -0
  163. package/src/components/i18n/locales/da/messages.json +1 -0
  164. package/src/components/i18n/locales/de/messages.json +1 -0
  165. package/src/components/i18n/locales/dv/messages.json +1 -0
  166. package/src/components/i18n/locales/el/messages.json +1 -0
  167. package/src/components/i18n/locales/en/messages.json +1 -0
  168. package/src/components/i18n/locales/es/messages.json +1 -0
  169. package/src/components/i18n/locales/et/messages.json +1 -0
  170. package/src/components/i18n/locales/fa/messages.json +1 -0
  171. package/src/components/i18n/locales/fi/messages.json +1 -0
  172. package/src/components/i18n/locales/fil/messages.json +1 -0
  173. package/src/components/i18n/locales/fr/messages.json +1 -0
  174. package/src/components/i18n/locales/gu/messages.json +1 -0
  175. package/src/components/i18n/locales/he/messages.json +1 -0
  176. package/src/components/i18n/locales/hi/messages.json +1 -0
  177. package/src/components/i18n/locales/hr/messages.json +1 -0
  178. package/src/components/i18n/locales/hu/messages.json +1 -0
  179. package/src/components/i18n/locales/hy/messages.json +1 -0
  180. package/src/components/i18n/locales/id/messages.json +1 -0
  181. package/src/components/i18n/locales/it/messages.json +1 -0
  182. package/src/components/i18n/locales/ja/messages.json +1 -0
  183. package/src/components/i18n/locales/ka/messages.json +1 -0
  184. package/src/components/i18n/locales/km/messages.json +1 -0
  185. package/src/components/i18n/locales/kn/messages.json +1 -0
  186. package/src/components/i18n/locales/ko/messages.json +1 -0
  187. package/src/components/i18n/locales/ku/messages.json +1 -0
  188. package/src/components/i18n/locales/lo/messages.json +1 -0
  189. package/src/components/i18n/locales/lt/messages.json +1 -0
  190. package/src/components/i18n/locales/lv/messages.json +1 -0
  191. package/src/components/i18n/locales/mk/messages.json +1 -0
  192. package/src/components/i18n/locales/ml/messages.json +1 -0
  193. package/src/components/i18n/locales/mn/messages.json +1 -0
  194. package/src/components/i18n/locales/mr/messages.json +1 -0
  195. package/src/components/i18n/locales/ms/messages.json +1 -0
  196. package/src/components/i18n/locales/my/messages.json +1 -0
  197. package/src/components/i18n/locales/ne/messages.json +1 -0
  198. package/src/components/i18n/locales/nl/messages.json +1 -0
  199. package/src/components/i18n/locales/no/messages.json +1 -0
  200. package/src/components/i18n/locales/pa/messages.json +1 -0
  201. package/src/components/i18n/locales/pl/messages.json +1 -0
  202. package/src/components/i18n/locales/ps/messages.json +1 -0
  203. package/src/components/i18n/locales/pt/messages.json +1 -0
  204. package/src/components/i18n/locales/ro/messages.json +1 -0
  205. package/src/components/i18n/locales/ru/messages.json +1 -0
  206. package/src/components/i18n/locales/sd/messages.json +1 -0
  207. package/src/components/i18n/locales/si/messages.json +1 -0
  208. package/src/components/i18n/locales/sk/messages.json +1 -0
  209. package/src/components/i18n/locales/sl/messages.json +1 -0
  210. package/src/components/i18n/locales/sq/messages.json +1 -0
  211. package/src/components/i18n/locales/sr/messages.json +1 -0
  212. package/src/components/i18n/locales/sv/messages.json +1 -0
  213. package/src/components/i18n/locales/sw/messages.json +1 -0
  214. package/src/components/i18n/locales/ta/messages.json +1 -0
  215. package/src/components/i18n/locales/te/messages.json +1 -0
  216. package/src/components/i18n/locales/th/messages.json +1 -0
  217. package/src/components/i18n/locales/tr/messages.json +1 -0
  218. package/src/components/i18n/locales/ug/messages.json +1 -0
  219. package/src/components/i18n/locales/uk/messages.json +1 -0
  220. package/src/components/i18n/locales/ur/messages.json +1 -0
  221. package/src/components/i18n/locales/vi/messages.json +1 -0
  222. package/src/components/i18n/locales/yi/messages.json +1 -0
  223. package/src/components/i18n/locales/zh/messages.json +1 -0
  224. package/src/components/icons/index.ts +29 -18
  225. package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +18 -0
  226. package/src/components/modules/blockManager/hierarchy.ts +4 -1
  227. package/src/components/modules/readonly.ts +46 -0
  228. package/src/components/modules/rectangleSelection.ts +25 -5
  229. package/src/components/modules/toolbar/index.ts +96 -19
  230. package/src/components/modules/toolbar/positioning.ts +11 -2
  231. package/src/components/modules/toolbar/styles.ts +0 -2
  232. package/src/components/modules/uiControllers/controllers/blockHover.ts +44 -1
  233. package/src/components/tools/block.ts +10 -0
  234. package/src/components/utils/placeholder.ts +9 -2
  235. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +11 -0
  236. package/src/components/utils/popover/popover-abstract.ts +7 -0
  237. package/src/styles/main.css +16 -0
  238. package/src/tools/callout/constants.ts +2 -1
  239. package/src/tools/callout/dom-builder.ts +13 -1
  240. package/src/tools/callout/index.ts +21 -7
  241. package/src/tools/code/constants.ts +28 -8
  242. package/src/tools/code/dom-builder.ts +133 -64
  243. package/src/tools/code/index.ts +280 -91
  244. package/src/tools/code/language-detector.ts +118 -0
  245. package/src/tools/divider/index.ts +5 -0
  246. package/src/tools/header/index.ts +47 -1
  247. package/src/tools/list/dom-builder.ts +3 -1
  248. package/src/tools/list/index.ts +55 -3
  249. package/src/tools/list/list-helpers.ts +2 -2
  250. package/src/tools/nested-blocks.ts +25 -0
  251. package/src/tools/paragraph/index.ts +47 -6
  252. package/src/tools/quote/index.ts +43 -8
  253. package/src/tools/stub/index.ts +10 -0
  254. package/src/tools/table/index.ts +238 -6
  255. package/src/tools/table/table-add-controls.ts +37 -5
  256. package/src/tools/table/table-cell-blocks.ts +57 -18
  257. package/src/tools/table/table-core.ts +2 -0
  258. package/src/tools/table/table-corner-drag.ts +247 -0
  259. package/src/tools/table/table-operations.ts +41 -14
  260. package/src/tools/toggle/dom-builder.ts +1 -0
  261. package/src/tools/toggle/index.ts +25 -0
  262. package/src/tools/toggle/toggle-lifecycle.ts +5 -4
  263. package/src/types-internal/jsdom.d.ts +9 -0
  264. package/types/tools/adapters/block-tool-adapter.d.ts +6 -0
  265. package/types/tools/block-tool.d.ts +20 -0
  266. package/types/utils/popover/popover-item.d.ts +6 -0
  267. package/bin/blok.mjs +0 -10
  268. package/dist/cli.mjs +0 -37
  269. package/src/tools/code/language-picker.ts +0 -241
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Veliko",
162
162
  "tools.code.codeTab": "Koda",
163
163
  "tools.code.previewTab": "Predogled",
164
+ "tools.code.sideBySide": "Drug ob drugem",
164
165
  "tools.table.placement": "Postavitev",
165
166
  "tools.table.placementTopLeft": "Zgoraj levo",
166
167
  "tools.table.placementTopCenter": "Zgoraj na sredini",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "I madh",
162
162
  "tools.code.codeTab": "Kod",
163
163
  "tools.code.previewTab": "Shikimi paraprak",
164
+ "tools.code.sideBySide": "Krah për krah",
164
165
  "tools.table.placement": "Vendosja",
165
166
  "tools.table.placementTopLeft": "Lart majtas",
166
167
  "tools.table.placementTopCenter": "Lart në qendër",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Велики",
162
162
  "tools.code.codeTab": "Код",
163
163
  "tools.code.previewTab": "Преглед",
164
+ "tools.code.sideBySide": "Упоредно",
164
165
  "tools.table.placement": "Позиција",
165
166
  "tools.table.placementTopLeft": "Горе лево",
166
167
  "tools.table.placementTopCenter": "Горе по средини",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Stor",
162
162
  "tools.code.codeTab": "Kod",
163
163
  "tools.code.previewTab": "Förhandsgranskning",
164
+ "tools.code.sideBySide": "Sida vid sida",
164
165
  "tools.table.placement": "Placering",
165
166
  "tools.table.placementTopLeft": "Uppe till vänster",
166
167
  "tools.table.placementTopCenter": "Uppe i mitten",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Kubwa",
162
162
  "tools.code.codeTab": "Msimbo",
163
163
  "tools.code.previewTab": "Hakiki",
164
+ "tools.code.sideBySide": "Kando kwa kando",
164
165
  "tools.table.placement": "Uwekaji",
165
166
  "tools.table.placementTopLeft": "Juu kushoto",
166
167
  "tools.table.placementTopCenter": "Juu katikati",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "பெரிய",
162
162
  "tools.code.codeTab": "குறியீடு",
163
163
  "tools.code.previewTab": "முன்னோட்டம்",
164
+ "tools.code.sideBySide": "பக்கவாட்டில்",
164
165
  "tools.table.placement": "இட அமைப்பு",
165
166
  "tools.table.placementTopLeft": "மேல் இடது",
166
167
  "tools.table.placementTopCenter": "மேல் நடு",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "పెద్ద",
162
162
  "tools.code.codeTab": "కోడ్",
163
163
  "tools.code.previewTab": "ముందుచూపు",
164
+ "tools.code.sideBySide": "ప్రక్కన ప్రక్కన",
164
165
  "tools.table.placement": "స్థానం",
165
166
  "tools.table.placementTopLeft": "పైన ఎడమ",
166
167
  "tools.table.placementTopCenter": "పైన మధ్య",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "ใหญ่",
162
162
  "tools.code.codeTab": "โค้ด",
163
163
  "tools.code.previewTab": "ตัวอย่าง",
164
+ "tools.code.sideBySide": "เคียงข้างกัน",
164
165
  "tools.table.placement": "ตำแหน่ง",
165
166
  "tools.table.placementTopLeft": "บนซ้าย",
166
167
  "tools.table.placementTopCenter": "บนกลาง",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Büyük",
162
162
  "tools.code.codeTab": "Kod",
163
163
  "tools.code.previewTab": "Önizleme",
164
+ "tools.code.sideBySide": "Yan yana",
164
165
  "tools.table.placement": "Yerleşim",
165
166
  "tools.table.placementTopLeft": "Sol üst",
166
167
  "tools.table.placementTopCenter": "Orta üst",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "چوڭ",
162
162
  "tools.code.codeTab": "كود",
163
163
  "tools.code.previewTab": "ئالدىن كۆرۈش",
164
+ "tools.code.sideBySide": "يانمۇ-يان",
164
165
  "tools.table.placement": "ئورنى",
165
166
  "tools.table.placementTopLeft": "ئۈستى سول",
166
167
  "tools.table.placementTopCenter": "ئۈستى ئوتتۇرا",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Великий",
162
162
  "tools.code.codeTab": "Код",
163
163
  "tools.code.previewTab": "Попередній перегляд",
164
+ "tools.code.sideBySide": "Поруч",
164
165
  "tools.table.placement": "Розташування",
165
166
  "tools.table.placementTopLeft": "Зверху зліва",
166
167
  "tools.table.placementTopCenter": "Зверху по центру",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "بڑا",
162
162
  "tools.code.codeTab": "کوڈ",
163
163
  "tools.code.previewTab": "پیش نظارہ",
164
+ "tools.code.sideBySide": "ساتھ ساتھ",
164
165
  "tools.table.placement": "جگہ",
165
166
  "tools.table.placementTopLeft": "اوپر بائیں",
166
167
  "tools.table.placementTopCenter": "اوپر درمیان",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "Lớn",
162
162
  "tools.code.codeTab": "Mã",
163
163
  "tools.code.previewTab": "Xem trước",
164
+ "tools.code.sideBySide": "Song song",
164
165
  "tools.table.placement": "Vị trí",
165
166
  "tools.table.placementTopLeft": "Trên trái",
166
167
  "tools.table.placementTopCenter": "Trên giữa",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "גרויס",
162
162
  "tools.code.codeTab": "קאָד",
163
163
  "tools.code.previewTab": "פֿאָרויסבליק",
164
+ "tools.code.sideBySide": "זייט ביי זייט",
164
165
  "tools.table.placement": "אָרט",
165
166
  "tools.table.placementTopLeft": "אויבן לינקס",
166
167
  "tools.table.placementTopCenter": "אויבן מיטן",
@@ -161,6 +161,7 @@
161
161
  "tools.quote.largeSize": "大",
162
162
  "tools.code.codeTab": "代码",
163
163
  "tools.code.previewTab": "预览",
164
+ "tools.code.sideBySide": "并排",
164
165
  "tools.table.placement": "位置",
165
166
  "tools.table.placementTopLeft": "左上",
166
167
  "tools.table.placementTopCenter": "居中上",
@@ -1,3 +1,17 @@
1
+ // Check/Confirm icon
2
+ export const IconCheck = `
3
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <path d="m4.5 10.5 4 4 7-8" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
6
+ `;
7
+
8
+ // Sparkle/Auto-detect icon — 4-pointed star (modern AI/auto symbol)
9
+ export const IconWand = `
10
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
11
+ <path d="M10 2 Q10 10 18 10 Q10 10 10 18 Q10 10 2 10 Q10 10 10 2Z" stroke="currentColor" stroke-width="1.25" stroke-linejoin="round"/>
12
+ </svg>
13
+ `;
14
+
1
15
  // Cross/Close icon
2
16
  export const IconCross = `
3
17
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -95,6 +109,13 @@ export const IconPlus = `
95
109
  </svg>
96
110
  `;
97
111
 
112
+ // Chevron Down icon
113
+ export const IconChevronDown = `
114
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
115
+ <path d="m6 8 4 4 4-4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
116
+ </svg>
117
+ `;
118
+
98
119
  // Chevron Left icon
99
120
  export const IconChevronLeft = `
100
121
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -481,24 +502,6 @@ export const IconCodeBlock = `
481
502
  </svg>
482
503
  `;
483
504
 
484
- // Line wrap icon
485
- export const IconWrap = `
486
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
487
- <path d="M4 6h12M4 10h8a2 2 0 0 1 2 2v0a2 2 0 0 1-2 2H9m0 0 2-2m-2 2 2 2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
488
- </svg>
489
- `;
490
-
491
- // Line numbers icon (gutter marks + code lines)
492
- export const IconLineNumbers = `
493
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
494
- <path d="M7 4v12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" opacity="0.35"/>
495
- <circle cx="4.5" cy="7" r="0.75" fill="currentColor"/>
496
- <circle cx="4.5" cy="10" r="0.75" fill="currentColor"/>
497
- <circle cx="4.5" cy="13" r="0.75" fill="currentColor"/>
498
- <path d="M10 7h6M10 10h6M10 13h4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
499
- </svg>
500
- `;
501
-
502
505
  // Emoji Picker Category Icons
503
506
 
504
507
  // Star icon (Callout category)
@@ -601,6 +604,14 @@ export const IconMergeCells = `
601
604
  // Split cell icon (one cell splitting into two)
602
605
  export const IconSplitCell = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M12 3v18"/><path d="M8 8l4 4-4 4"/><path d="M16 8l-4 4 4 4"/></svg>`;
603
606
 
607
+ // Split view icon (two panels side by side)
608
+ export const IconSplitView = `
609
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
610
+ <rect x="3" y="4" width="6" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
611
+ <rect x="11" y="4" width="6" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
612
+ </svg>
613
+ `;
614
+
604
615
  // Placement icon (3x3 alignment dot grid)
605
616
  export const IconPlacement = `
606
617
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -344,6 +344,15 @@ export class KeyboardNavigation extends BlockEventComposer {
344
344
  // Previous sibling exists in the same parent — fall through to merge/remove logic
345
345
  }
346
346
 
347
+ /**
348
+ * Don't merge across table cell boundaries.
349
+ * When the caret is at the start of the first input in a table cell, Backspace should be a no-op
350
+ * rather than merging the previous cell's last block into the current cell.
351
+ */
352
+ if (this.isCurrentBlockInsideTableCell) {
353
+ return;
354
+ }
355
+
347
356
  /**
348
357
  * Backspace at the start of the first Block should do nothing
349
358
  */
@@ -447,6 +456,15 @@ export class KeyboardNavigation extends BlockEventComposer {
447
456
  return;
448
457
  }
449
458
 
459
+ /**
460
+ * Don't merge across table cell boundaries.
461
+ * When the caret is at the end of the last input in a table cell, Delete should be a no-op
462
+ * rather than merging the next cell's first block into the current cell.
463
+ */
464
+ if (this.isCurrentBlockInsideTableCell) {
465
+ return;
466
+ }
467
+
450
468
  /**
451
469
  * If next Block is empty, it should be removed just like a character
452
470
  */
@@ -4,6 +4,7 @@
4
4
  * @module BlockHierarchy
5
5
  */
6
6
  import type { Block } from '../../block';
7
+ import { DATA_ATTR } from '../../constants/data-attributes';
7
8
 
8
9
  import type { BlockRepository } from './repository';
9
10
 
@@ -113,7 +114,9 @@ export class BlockHierarchy {
113
114
 
114
115
  // Move block holder into toggle child container if the new parent has one,
115
116
  // honouring the flat-array order so the DOM order matches the logical order.
116
- if (newParentId !== null && newParent !== undefined) {
117
+ // Skip if the holder is already claimed by another nested-blocks container
118
+ // (e.g. a table cell) — moving it would steal it from that container.
119
+ if (newParentId !== null && newParent !== undefined && !block.holder.closest(`[${DATA_ATTR.nestedBlocks}]`)) {
117
120
  const newContainer = newParent.holder.querySelector('[data-blok-toggle-children]');
118
121
  if (newContainer) {
119
122
  const allBlocks = this.repository.blocks;
@@ -16,6 +16,11 @@ export class ReadOnly extends Module {
16
16
  */
17
17
  private toolsDontSupportReadOnly: string[] = [];
18
18
 
19
+ /**
20
+ * Array of tools name which don't support in-place read-only toggle via setReadOnly()
21
+ */
22
+ private toolsDontSupportInPlaceToggle: string[] = [];
23
+
19
24
  /**
20
25
  * Value to track read-only state
21
26
  * @type {boolean}
@@ -29,6 +34,19 @@ export class ReadOnly extends Module {
29
34
  return this.readOnlyEnabled;
30
35
  }
31
36
 
37
+ /**
38
+ * Whether tool support for in-place toggle has been checked during prepare()
39
+ */
40
+ private inPlaceToggleChecked = false;
41
+
42
+ /**
43
+ * Whether all registered block tools support in-place read-only toggle.
44
+ * Returns false until prepare() has run the check.
45
+ */
46
+ private get supportsInPlaceToggle(): boolean {
47
+ return this.inPlaceToggleChecked && this.toolsDontSupportInPlaceToggle.length === 0;
48
+ }
49
+
32
50
  /**
33
51
  * Set initial state
34
52
  */
@@ -43,9 +61,13 @@ export class ReadOnly extends Module {
43
61
  if (!tool.isReadOnlySupported) {
44
62
  toolsDontSupportReadOnly.push(name);
45
63
  }
64
+ if (!tool.supportsInPlaceReadOnly) {
65
+ this.toolsDontSupportInPlaceToggle.push(name);
66
+ }
46
67
  });
47
68
 
48
69
  this.toolsDontSupportReadOnly = toolsDontSupportReadOnly;
70
+ this.inPlaceToggleChecked = true;
49
71
 
50
72
  if (this.config.readOnly === true && toolsDontSupportReadOnly.length > 0) {
51
73
  this.throwCriticalError();
@@ -101,6 +123,24 @@ export class ReadOnly extends Module {
101
123
  return this.readOnlyEnabled;
102
124
  }
103
125
 
126
+ /**
127
+ * If all tools support in-place toggle, call setReadOnly on each block
128
+ * instead of the full save/clear/render cycle
129
+ */
130
+ if (this.supportsInPlaceToggle) {
131
+ this.Blok.ModificationsObserver.disable();
132
+
133
+ const blocks = (this.Blok.BlockManager as { blocks?: Array<{ setReadOnly: (s: boolean) => void }> }).blocks ?? [];
134
+
135
+ for (const block of blocks) {
136
+ block.setReadOnly(state);
137
+ }
138
+
139
+ this.Blok.ModificationsObserver.enable();
140
+
141
+ return this.readOnlyEnabled;
142
+ }
143
+
104
144
  /**
105
145
  * Mutex for modifications observer to prevent onChange call when read-only mode is enabled
106
146
  */
@@ -117,6 +157,8 @@ export class ReadOnly extends Module {
117
157
  return this.readOnlyEnabled;
118
158
  }
119
159
 
160
+ const savedScrollY = window.scrollY;
161
+
120
162
  this.Blok.Renderer.markRenderStart();
121
163
 
122
164
  try {
@@ -126,6 +168,10 @@ export class ReadOnly extends Module {
126
168
  this.Blok.Renderer.markRenderEnd();
127
169
  }
128
170
 
171
+ if (window.scrollY !== savedScrollY) {
172
+ window.scrollTo(0, savedScrollY);
173
+ }
174
+
129
175
  this.Blok.ModificationsObserver.enable();
130
176
 
131
177
  return this.readOnlyEnabled;
@@ -72,6 +72,14 @@ export class RectangleSelection extends Module {
72
72
  */
73
73
  private mouseDownWithinBoundsFromContentEditable = false;
74
74
 
75
+ /**
76
+ * Set when the user mousedowns in a position that should eventually close the toolbar
77
+ * if a drag begins, but NOT immediately (to avoid interfering with button clicks like
78
+ * the plus button). The toolbar is closed on the first mousemove after mousedown.
79
+ * Cleared on mouseup / endSelection.
80
+ */
81
+ private pendingToolbarClose = false;
82
+
75
83
  /**
76
84
  * Is scrolling now
77
85
  */
@@ -187,7 +195,7 @@ export class RectangleSelection extends Module {
187
195
 
188
196
  const selectorsToAvoid = [
189
197
  createSelector(DATA_ATTR.elementContent),
190
- createSelector(DATA_ATTR.toolbar),
198
+ createSelector(DATA_ATTR.settingsToggler),
191
199
  createSelector(DATA_ATTR.popover),
192
200
  INLINE_TOOLBAR_INTERFACE_SELECTOR,
193
201
  ];
@@ -202,12 +210,13 @@ export class RectangleSelection extends Module {
202
210
  }
203
211
 
204
212
  /**
205
- * Hide the toolbar immediately so it does not obstruct drag selection.
206
- * Only close the toolbar if the selection starts within the horizontal bounds of the editor.
207
- * This allows rectangle selection to start from outside (e.g., left margin) without closing the toolbar.
213
+ * Schedule toolbar close for the first mousemove (i.e. when the user actually drags).
214
+ * Deferring prevents a plain click (e.g. on the plus button) from accidentally closing
215
+ * the toolbar before its own click handler fires.
216
+ * Only close if starting within the horizontal bounds of the editor.
208
217
  */
209
218
  if (withinEditorHorizontally) {
210
- this.Blok.Toolbar.close();
219
+ this.pendingToolbarClose = true;
211
220
  }
212
221
 
213
222
  this.mousedown = true;
@@ -221,6 +230,7 @@ export class RectangleSelection extends Module {
221
230
  public endSelection(): void {
222
231
  this.mousedown = false;
223
232
  this.mouseDownWithinBoundsFromContentEditable = false;
233
+ this.pendingToolbarClose = false;
224
234
  this.startX = 0;
225
235
  this.startY = 0;
226
236
  this.anchorBlockIndex = null;
@@ -361,6 +371,16 @@ export class RectangleSelection extends Module {
361
371
  this.Blok.Toolbar.close();
362
372
  }
363
373
 
374
+ /**
375
+ * Close the toolbar on the first actual drag movement after a mousedown
376
+ * that was scheduled to close it. Using mousemove instead of mousedown ensures
377
+ * plain button clicks (e.g. the plus button) don't close the toolbar prematurely.
378
+ */
379
+ if (this.pendingToolbarClose) {
380
+ this.pendingToolbarClose = false;
381
+ this.Blok.Toolbar.close();
382
+ }
383
+
364
384
  this.changingRectangle(mouseEvent);
365
385
  this.scrollByZones(mouseEvent.clientY);
366
386
  }
@@ -289,11 +289,17 @@ export class Toolbar extends Module<ToolbarNodes> {
289
289
  // eslint-disable-next-line @typescript-eslint/no-deprecated
290
290
  this.nodes.actions?.classList.remove(this.CSS.actionsOpened);
291
291
  this.nodes.actions?.removeAttribute('data-blok-opened');
292
+ if (this.nodes.actions) {
293
+ this.nodes.actions.style.pointerEvents = 'none';
294
+ }
292
295
  },
293
296
  show: (): void => {
294
297
  // eslint-disable-next-line @typescript-eslint/no-deprecated
295
298
  this.nodes.actions?.classList.add(this.CSS.actionsOpened);
296
299
  this.nodes.actions?.setAttribute('data-blok-opened', 'true');
300
+ if (this.nodes.actions) {
301
+ this.nodes.actions.style.pointerEvents = 'auto';
302
+ }
297
303
  },
298
304
  };
299
305
  }
@@ -421,8 +427,11 @@ export class Toolbar extends Module<ToolbarNodes> {
421
427
  */
422
428
  const focusIsInsideCell = this.isFocusInsideTableCell();
423
429
  const isCalloutFirstChild = this.isFirstChildOfCallout(targetBlock);
430
+ const isCalloutBlock = targetBlock.name === 'callout';
424
431
 
425
- plusButton.style.display = isCalloutFirstChild ? 'none' : '';
432
+ // Hide plus button for callout blocks and their first children to avoid
433
+ // overlap with the callout emoji icon in the left padding area.
434
+ plusButton.style.display = (isCalloutFirstChild || isCalloutBlock) ? 'none' : '';
426
435
 
427
436
  if (settingsToggler) {
428
437
  settingsToggler.style.display = (focusIsInsideCell || isCalloutFirstChild) ? 'none' : '';
@@ -478,15 +487,6 @@ export class Toolbar extends Module<ToolbarNodes> {
478
487
 
479
488
  if (blockContentElement) {
480
489
  this.toolboxInstance.updateLeftAlignElement(blockContentElement);
481
-
482
- /**
483
- * Sync toolbar content wrapper's margin with the block content element
484
- * so toolbar buttons align with the block content edge, even when
485
- * consumer CSS overrides the block content's margin.
486
- */
487
- if (this.nodes.content) {
488
- this.nodes.content.style.marginLeft = getComputedStyle(blockContentElement).marginLeft;
489
- }
490
490
  }
491
491
 
492
492
  /**
@@ -507,6 +507,39 @@ export class Toolbar extends Module<ToolbarNodes> {
507
507
  }
508
508
 
509
509
  this.open();
510
+
511
+ /**
512
+ * For blocks with interactive elements at the left edge (toggle arrows,
513
+ * callout emoji buttons), disable pointer-events on the actions
514
+ * container so clicks pass through to the block content.
515
+ * Must run after open() which sets pointer-events: auto on actions.
516
+ */
517
+ const isToggleHeader = targetBlock.name === 'header'
518
+ && targetBlock.holder.querySelector('[data-blok-toggle-arrow]') !== null;
519
+ const hasLeftEdgeInteraction = targetBlock.name === 'callout'
520
+ || targetBlock.name === 'toggle'
521
+ || isToggleHeader;
522
+
523
+ if (hasLeftEdgeInteraction && this.nodes.actions) {
524
+ this.nodes.actions.style.pointerEvents = 'none';
525
+ this.restoreSettingsTogglerForLeftEdgeBlock(targetBlock);
526
+ }
527
+
528
+ /**
529
+ * Sync toolbar content wrapper's margin with the block content element
530
+ * so toolbar buttons align with the block content edge, even when
531
+ * consumer CSS overrides the block content's margin.
532
+ *
533
+ * Uses Math.max to guarantee the actions container (positioned via right:100%)
534
+ * never extends beyond the left edge of the viewport, which would make the
535
+ * drag handle unreachable by pointer events.
536
+ */
537
+ if (blockContentElement && this.nodes.content) {
538
+ const blockMarginLeft = parseFloat(getComputedStyle(blockContentElement).marginLeft) || 0;
539
+ const actionsWidth = this.nodes.actions?.offsetWidth ?? 0;
540
+
541
+ this.nodes.content.style.marginLeft = `${Math.max(blockMarginLeft, actionsWidth)}px`;
542
+ }
510
543
  }
511
544
 
512
545
  /**
@@ -607,18 +640,10 @@ export class Toolbar extends Module<ToolbarNodes> {
607
640
  targetBlock.setupDraggable(settingsToggler, this.Blok.DragManager);
608
641
  }
609
642
 
610
- /**
611
- * Sync toolbar content wrapper's margin with the block content element
612
- * so toolbar buttons align with the block content edge.
613
- */
614
643
  const blockContentElement = targetBlockHolder.querySelector<HTMLElement>(`[${DATA_ATTR.elementContent}]`);
615
644
 
616
645
  if (blockContentElement) {
617
646
  this.toolboxInstance.updateLeftAlignElement(blockContentElement);
618
-
619
- if (this.nodes.content) {
620
- this.nodes.content.style.marginLeft = getComputedStyle(blockContentElement).marginLeft;
621
- }
622
647
  }
623
648
 
624
649
  /**
@@ -632,6 +657,17 @@ export class Toolbar extends Module<ToolbarNodes> {
632
657
  this.blockTunesToggler.show();
633
658
 
634
659
  this.open();
660
+
661
+ /**
662
+ * Sync toolbar content wrapper's margin with the block content element.
663
+ * Clamp to actionsWidth so actions never extend beyond the left viewport edge.
664
+ */
665
+ if (blockContentElement && this.nodes.content) {
666
+ const blockMarginLeft = parseFloat(getComputedStyle(blockContentElement).marginLeft) || 0;
667
+ const actionsWidth = this.nodes.actions?.offsetWidth ?? 0;
668
+
669
+ this.nodes.content.style.marginLeft = `${Math.max(blockMarginLeft, actionsWidth)}px`;
670
+ }
635
671
  }
636
672
 
637
673
  /**
@@ -822,14 +858,48 @@ export class Toolbar extends Module<ToolbarNodes> {
822
858
 
823
859
  const focusIsInsideCell = this.isFocusInsideTableCell();
824
860
  const isCalloutFirstChild = this.hoveredBlock !== null && this.isFirstChildOfCallout(this.hoveredBlock);
861
+ const isCalloutBlock = this.hoveredBlock?.name === 'callout';
825
862
 
826
- plusButton.style.display = isCalloutFirstChild ? 'none' : '';
863
+ plusButton.style.display = (isCalloutFirstChild || isCalloutBlock) ? 'none' : '';
827
864
 
828
865
  if (settingsToggler) {
829
866
  settingsToggler.style.display = (focusIsInsideCell || isCalloutFirstChild) ? 'none' : '';
830
867
  }
831
868
  }
832
869
 
870
+ /**
871
+ * Re-enables pointer-events on the settings toggler (and callout drag zone) after
872
+ * the actions container has been set to pointer-events: none for left-edge blocks.
873
+ *
874
+ * For callout blocks: also wires the dedicated drag zone as the drag handle and
875
+ * re-enables the settings toggler so the settings menu remains accessible.
876
+ * The emoji button (at x=32px) no longer overlaps the actions zone (x=[0,29px])
877
+ * because the callout uses pl-8 (32px) left padding.
878
+ *
879
+ * For all other left-edge blocks (toggle, header with arrow): simply re-enables the
880
+ * settings toggler so it continues to function as the drag handle.
881
+ */
882
+ private restoreSettingsTogglerForLeftEdgeBlock(targetBlock: Block): void {
883
+ if (targetBlock.name === 'callout') {
884
+ if (this.nodes.settingsToggler) {
885
+ this.nodes.settingsToggler.style.pointerEvents = 'auto';
886
+ }
887
+
888
+ const calloutDragZone = targetBlock.holder.querySelector<HTMLElement>('[data-callout-drag-zone]');
889
+
890
+ if (calloutDragZone) {
891
+ calloutDragZone.style.pointerEvents = 'auto';
892
+ targetBlock.setupDraggable(calloutDragZone, this.Blok.DragManager);
893
+ }
894
+
895
+ return;
896
+ }
897
+
898
+ if (this.nodes.settingsToggler) {
899
+ this.nodes.settingsToggler.style.pointerEvents = 'auto';
900
+ }
901
+ }
902
+
833
903
  /**
834
904
  * If the block is inside a table cell, resolve to the parent table block.
835
905
  * This ensures the toolbar shows for the table when clicking/focusing inside cells.
@@ -915,6 +985,13 @@ export class Toolbar extends Module<ToolbarNodes> {
915
985
  this.CSS.actions,
916
986
  ]);
917
987
 
988
+ /**
989
+ * Start with pointer-events disabled so invisible (opacity-0) actions
990
+ * don't intercept clicks on elements underneath (e.g. toggle arrows).
991
+ * blockActions.show()/hide() toggles this inline style.
992
+ */
993
+ actions.style.pointerEvents = 'none';
994
+
918
995
  this.nodes.content = content;
919
996
 
920
997
  this.nodes.actions = actions;
@@ -77,15 +77,24 @@ export class ToolbarPositioner {
77
77
  */
78
78
  const textElement = listItemElement?.querySelector('[contenteditable]');
79
79
  const pluginsContent = targetBlock.pluginsContent;
80
+ /**
81
+ * If the tool provides a toolbar anchor element, use it instead of searching
82
+ * for a contenteditable descendant. This allows tools with deeply nested
83
+ * editable areas (e.g., code block with a header above the code) to control
84
+ * where the toolbar centers vertically.
85
+ */
86
+ const toolbarAnchor = !textElement && !listItemElement
87
+ ? targetBlock.getToolbarAnchorElement()
88
+ : undefined;
80
89
  /**
81
90
  * If pluginsContent is a non-editable container (e.g. a toggle heading wrapper <div>),
82
91
  * use its first contenteditable descendant for accurate line-height centering.
83
92
  */
84
93
  const editableDescendant =
85
- !pluginsContent.matches('[contenteditable]')
94
+ !toolbarAnchor && !pluginsContent.matches('[contenteditable]')
86
95
  ? (pluginsContent.querySelector('[contenteditable]') ?? null)
87
96
  : null;
88
- const contentElement = textElement ?? listItemElement ?? editableDescendant ?? pluginsContent;
97
+ const contentElement = textElement ?? listItemElement ?? toolbarAnchor ?? editableDescendant ?? pluginsContent;
89
98
  const contentRect = contentElement.getBoundingClientRect();
90
99
  const contentOffset = contentRect.top - holderRect.top;
91
100
 
@@ -19,8 +19,6 @@ export const getToolbarStyles = (): { [name: string]: string } => {
19
19
  actions: twJoin(
20
20
  'absolute flex opacity-0 pr-[5px]',
21
21
  'right-full',
22
- // Re-enable pointer events for interactive elements
23
- 'pointer-events-auto',
24
22
  // Mobile styles
25
23
  'mobile:right-auto',
26
24
  // RTL styles