@jackuait/blok 0.6.0-beta.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/blok.mjs +2 -2
  2. package/dist/chunks/{blok-bzxy6Olq.mjs → blok-BAh1rvUC.mjs} +3410 -2927
  3. package/dist/chunks/i18next-B47TKgbU.mjs +1303 -0
  4. package/dist/chunks/{i18next-loader-CzL6YHyQ.mjs → i18next-loader-CHtGO6IK.mjs} +2 -2
  5. package/dist/chunks/{index-DSSrx_Co.mjs → index-DBWWKrDe.mjs} +12 -12
  6. package/dist/chunks/{inline-tool-convert-D4SXxjDd.mjs → inline-tool-convert-DduRc0fF.mjs} +1467 -951
  7. package/dist/chunks/{messages-BogRq8lt.mjs → messages-0AbcLMLm.mjs} +6 -0
  8. package/dist/chunks/{messages-DJDG55Vq.mjs → messages-0E0AkrNu.mjs} +6 -0
  9. package/dist/{messages-DnXLrlHh.mjs → chunks/messages-4v4MuVEc.mjs} +6 -0
  10. package/dist/chunks/{messages-DnIhyAJk.mjs → messages-62v-CLC-.mjs} +6 -0
  11. package/dist/chunks/{messages-Dzwxv9v1.mjs → messages-8DeO60Oo.mjs} +6 -0
  12. package/dist/chunks/{messages-B1Aww8q7.mjs → messages-8IPXkrDl.mjs} +6 -0
  13. package/dist/{messages-uKX8WBaD.mjs → chunks/messages-96kNZDll.mjs} +6 -0
  14. package/dist/chunks/{messages-BL0tXcDf.mjs → messages-B1FZ8lxU.mjs} +6 -0
  15. package/dist/{messages-DBn76jVV.mjs → chunks/messages-B217znr-.mjs} +8 -2
  16. package/dist/{messages-DT4dP5uK.mjs → chunks/messages-B8WNljW3.mjs} +6 -0
  17. package/dist/chunks/{messages-BdeLo0N9.mjs → messages-BC8IN4Bf.mjs} +6 -0
  18. package/dist/{messages-CZygwLwM.mjs → chunks/messages-BI43k_BD.mjs} +6 -0
  19. package/dist/{messages-CzTufCHu.mjs → chunks/messages-BJ6zrz2j.mjs} +6 -0
  20. package/dist/{messages-BoJc_p1r.mjs → chunks/messages-BUl_Rcnj.mjs} +6 -0
  21. package/dist/chunks/{messages-CnwibSvh.mjs → messages-BZlmVRwn.mjs} +6 -0
  22. package/dist/{messages-C2htQ_3F.mjs → chunks/messages-BcpCubnC.mjs} +6 -0
  23. package/dist/{messages-D5C3J9qr.mjs → chunks/messages-Bm-E4iRC.mjs} +6 -0
  24. package/dist/chunks/{messages-BELRf6DU.mjs → messages-C4jL-90N.mjs} +6 -0
  25. package/dist/chunks/{messages-1fC8IMyX.mjs → messages-CDBLbUOQ.mjs} +6 -0
  26. package/dist/chunks/{messages-7QoX8DkW.mjs → messages-CH4hrauY.mjs} +6 -0
  27. package/dist/{messages-Dz9L52ol.mjs → chunks/messages-CRJ_mchV.mjs} +6 -0
  28. package/dist/chunks/{messages-JELdtT6E.mjs → messages-CW4c4cRk.mjs} +6 -0
  29. package/dist/chunks/{messages-CKI54h6O.mjs → messages-C_4otP7U.mjs} +6 -0
  30. package/dist/{messages-R3hUSvr3.mjs → chunks/messages-CfiyT2Wi.mjs} +6 -0
  31. package/dist/{messages-CJdUsQ-c.mjs → chunks/messages-CgTq3QhU.mjs} +6 -0
  32. package/dist/chunks/{messages-D1Hv8XGo.mjs → messages-Chb7k3Rg.mjs} +6 -0
  33. package/dist/{messages-Q7AO_FLv.mjs → chunks/messages-Cjjo7yHR.mjs} +6 -0
  34. package/dist/{messages-C99mq906.mjs → chunks/messages-Cl6ayUaq.mjs} +6 -0
  35. package/dist/chunks/{messages-Diu6jAaR.mjs → messages-CmR9ftc_.mjs} +6 -0
  36. package/dist/chunks/{messages-LPVfA-8K.mjs → messages-Cr49Nt3U.mjs} +6 -0
  37. package/dist/chunks/{messages-DqM1LFg5.mjs → messages-Cr94GzbX.mjs} +6 -0
  38. package/dist/{messages-BWF-zUpY.mjs → chunks/messages-CrCYPCk3.mjs} +6 -0
  39. package/dist/{messages-D-ZtY5v0.mjs → chunks/messages-Cs8zmZ3L.mjs} +6 -0
  40. package/dist/{messages-DprmQg6V.mjs → chunks/messages-CzK0LEhb.mjs} +6 -0
  41. package/dist/chunks/{messages-BSbjsyHY.mjs → messages-D00x4S8o.mjs} +6 -0
  42. package/dist/chunks/{messages-Xq8UmkVs.mjs → messages-D1mn7Zd5.mjs} +6 -0
  43. package/dist/chunks/{messages-BC86qLvI.mjs → messages-D2NOpHn9.mjs} +6 -0
  44. package/dist/{messages-kep5wtm4.mjs → chunks/messages-D4qqwVgQ.mjs} +6 -0
  45. package/dist/chunks/{messages-7W4d0DwD.mjs → messages-D5S1Dnpm.mjs} +6 -0
  46. package/dist/{messages-CY8_RyFE.mjs → chunks/messages-D7u2bmP2.mjs} +6 -0
  47. package/dist/chunks/{messages-BFG6Wlgy.mjs → messages-D85FqxgY.mjs} +6 -0
  48. package/dist/{messages-DLfR5bMd.mjs → chunks/messages-D9ndgBnU.mjs} +6 -0
  49. package/dist/{messages-CVw84KdI.mjs → chunks/messages-DDTQgImT.mjs} +6 -0
  50. package/dist/{messages-_ErNTNhk.mjs → chunks/messages-DH_jBeED.mjs} +6 -0
  51. package/dist/chunks/{messages-CMkNSDTo.mjs → messages-DRXWF0PV.mjs} +6 -0
  52. package/dist/chunks/{messages-BYyy6Wqf.mjs → messages-DVQvl8Qj.mjs} +6 -0
  53. package/dist/chunks/{messages-CznZadDf.mjs → messages-DXktiao_.mjs} +6 -0
  54. package/dist/chunks/{messages-DhLKYm2j.mjs → messages-DdK-nFGm.mjs} +6 -0
  55. package/dist/chunks/{messages-BMXCuEKO.mjs → messages-DlJbPF2T.mjs} +6 -0
  56. package/dist/chunks/{messages-CvGLfqmV.mjs → messages-DnVlmiNT.mjs} +6 -0
  57. package/dist/{messages-Z9nEU2xK.mjs → chunks/messages-DviiFSv2.mjs} +6 -0
  58. package/dist/chunks/{messages-BB5z9Uba.mjs → messages-DzqM3Fel.mjs} +6 -0
  59. package/dist/{messages-w7v1GNaE.mjs → chunks/messages-Dzzn6XoD.mjs} +6 -0
  60. package/dist/{messages-CqWJcCbY.mjs → chunks/messages-GSByFygY.mjs} +6 -0
  61. package/dist/chunks/{messages-_ncGrKHh.mjs → messages-L_kl2Qvh.mjs} +6 -0
  62. package/dist/chunks/{messages-BrPFGbM-.mjs → messages-Phkd7XmE.mjs} +6 -0
  63. package/dist/{messages-BU2nlrLK.mjs → chunks/messages-RonBBCnh.mjs} +6 -0
  64. package/dist/{messages-Bmu_S7GM.mjs → chunks/messages-VDriF5Qy.mjs} +6 -0
  65. package/dist/{messages-CLhcMlTc.mjs → chunks/messages-ZjUAIWb1.mjs} +6 -0
  66. package/dist/{messages-9SihnaXQ.mjs → chunks/messages-b1EdvUm0.mjs} +6 -0
  67. package/dist/{messages-DvFLX36Q.mjs → chunks/messages-begYOTgC.mjs} +6 -0
  68. package/dist/{messages-BMv4xwIr.mjs → chunks/messages-jrncnb-H.mjs} +6 -0
  69. package/dist/{messages-D5iv1Kox.mjs → chunks/messages-nefz1S71.mjs} +6 -0
  70. package/dist/{messages-CQwpzUFp.mjs → chunks/messages-ucTVgS5G.mjs} +6 -0
  71. package/dist/chunks/{messages-DBRw-7Zc.mjs → messages-v3GipbFl.mjs} +6 -0
  72. package/dist/{messages-C9eaarcK.mjs → chunks/messages-wmi-iFkH.mjs} +6 -0
  73. package/dist/chunks/{messages-O5tQus_0.mjs → messages-yHcs38yI.mjs} +6 -0
  74. package/dist/full.mjs +2 -2
  75. package/dist/locales.mjs +90 -84
  76. package/dist/{messages-BogRq8lt.mjs → messages-0AbcLMLm.mjs} +6 -0
  77. package/dist/{messages-DJDG55Vq.mjs → messages-0E0AkrNu.mjs} +6 -0
  78. package/dist/{chunks/messages-DnXLrlHh.mjs → messages-4v4MuVEc.mjs} +6 -0
  79. package/dist/{messages-DnIhyAJk.mjs → messages-62v-CLC-.mjs} +6 -0
  80. package/dist/{messages-Dzwxv9v1.mjs → messages-8DeO60Oo.mjs} +6 -0
  81. package/dist/{messages-B1Aww8q7.mjs → messages-8IPXkrDl.mjs} +6 -0
  82. package/dist/{chunks/messages-uKX8WBaD.mjs → messages-96kNZDll.mjs} +6 -0
  83. package/dist/{messages-BL0tXcDf.mjs → messages-B1FZ8lxU.mjs} +6 -0
  84. package/dist/{chunks/messages-DBn76jVV.mjs → messages-B217znr-.mjs} +8 -2
  85. package/dist/{chunks/messages-DT4dP5uK.mjs → messages-B8WNljW3.mjs} +6 -0
  86. package/dist/{messages-BdeLo0N9.mjs → messages-BC8IN4Bf.mjs} +6 -0
  87. package/dist/{chunks/messages-CZygwLwM.mjs → messages-BI43k_BD.mjs} +6 -0
  88. package/dist/{chunks/messages-CzTufCHu.mjs → messages-BJ6zrz2j.mjs} +6 -0
  89. package/dist/{chunks/messages-BoJc_p1r.mjs → messages-BUl_Rcnj.mjs} +6 -0
  90. package/dist/{messages-CnwibSvh.mjs → messages-BZlmVRwn.mjs} +6 -0
  91. package/dist/{chunks/messages-C2htQ_3F.mjs → messages-BcpCubnC.mjs} +6 -0
  92. package/dist/{chunks/messages-D5C3J9qr.mjs → messages-Bm-E4iRC.mjs} +6 -0
  93. package/dist/{messages-BELRf6DU.mjs → messages-C4jL-90N.mjs} +6 -0
  94. package/dist/{messages-1fC8IMyX.mjs → messages-CDBLbUOQ.mjs} +6 -0
  95. package/dist/{messages-7QoX8DkW.mjs → messages-CH4hrauY.mjs} +6 -0
  96. package/dist/{chunks/messages-Dz9L52ol.mjs → messages-CRJ_mchV.mjs} +6 -0
  97. package/dist/{messages-JELdtT6E.mjs → messages-CW4c4cRk.mjs} +6 -0
  98. package/dist/{messages-CKI54h6O.mjs → messages-C_4otP7U.mjs} +6 -0
  99. package/dist/{chunks/messages-R3hUSvr3.mjs → messages-CfiyT2Wi.mjs} +6 -0
  100. package/dist/{chunks/messages-CJdUsQ-c.mjs → messages-CgTq3QhU.mjs} +6 -0
  101. package/dist/{messages-D1Hv8XGo.mjs → messages-Chb7k3Rg.mjs} +6 -0
  102. package/dist/{chunks/messages-Q7AO_FLv.mjs → messages-Cjjo7yHR.mjs} +6 -0
  103. package/dist/{chunks/messages-C99mq906.mjs → messages-Cl6ayUaq.mjs} +6 -0
  104. package/dist/{messages-Diu6jAaR.mjs → messages-CmR9ftc_.mjs} +6 -0
  105. package/dist/{messages-LPVfA-8K.mjs → messages-Cr49Nt3U.mjs} +6 -0
  106. package/dist/{messages-DqM1LFg5.mjs → messages-Cr94GzbX.mjs} +6 -0
  107. package/dist/{chunks/messages-BWF-zUpY.mjs → messages-CrCYPCk3.mjs} +6 -0
  108. package/dist/{chunks/messages-D-ZtY5v0.mjs → messages-Cs8zmZ3L.mjs} +6 -0
  109. package/dist/{chunks/messages-DprmQg6V.mjs → messages-CzK0LEhb.mjs} +6 -0
  110. package/dist/{messages-BSbjsyHY.mjs → messages-D00x4S8o.mjs} +6 -0
  111. package/dist/{messages-Xq8UmkVs.mjs → messages-D1mn7Zd5.mjs} +6 -0
  112. package/dist/{messages-BC86qLvI.mjs → messages-D2NOpHn9.mjs} +6 -0
  113. package/dist/{chunks/messages-kep5wtm4.mjs → messages-D4qqwVgQ.mjs} +6 -0
  114. package/dist/{messages-7W4d0DwD.mjs → messages-D5S1Dnpm.mjs} +6 -0
  115. package/dist/{chunks/messages-CY8_RyFE.mjs → messages-D7u2bmP2.mjs} +6 -0
  116. package/dist/{messages-BFG6Wlgy.mjs → messages-D85FqxgY.mjs} +6 -0
  117. package/dist/{chunks/messages-DLfR5bMd.mjs → messages-D9ndgBnU.mjs} +6 -0
  118. package/dist/{chunks/messages-CVw84KdI.mjs → messages-DDTQgImT.mjs} +6 -0
  119. package/dist/{chunks/messages-_ErNTNhk.mjs → messages-DH_jBeED.mjs} +6 -0
  120. package/dist/{messages-CMkNSDTo.mjs → messages-DRXWF0PV.mjs} +6 -0
  121. package/dist/{messages-BYyy6Wqf.mjs → messages-DVQvl8Qj.mjs} +6 -0
  122. package/dist/{messages-CznZadDf.mjs → messages-DXktiao_.mjs} +6 -0
  123. package/dist/{messages-DhLKYm2j.mjs → messages-DdK-nFGm.mjs} +6 -0
  124. package/dist/{messages-BMXCuEKO.mjs → messages-DlJbPF2T.mjs} +6 -0
  125. package/dist/{messages-CvGLfqmV.mjs → messages-DnVlmiNT.mjs} +6 -0
  126. package/dist/{chunks/messages-Z9nEU2xK.mjs → messages-DviiFSv2.mjs} +6 -0
  127. package/dist/{messages-BB5z9Uba.mjs → messages-DzqM3Fel.mjs} +6 -0
  128. package/dist/{chunks/messages-w7v1GNaE.mjs → messages-Dzzn6XoD.mjs} +6 -0
  129. package/dist/{chunks/messages-CqWJcCbY.mjs → messages-GSByFygY.mjs} +6 -0
  130. package/dist/{messages-_ncGrKHh.mjs → messages-L_kl2Qvh.mjs} +6 -0
  131. package/dist/{messages-BrPFGbM-.mjs → messages-Phkd7XmE.mjs} +6 -0
  132. package/dist/{chunks/messages-BU2nlrLK.mjs → messages-RonBBCnh.mjs} +6 -0
  133. package/dist/{chunks/messages-Bmu_S7GM.mjs → messages-VDriF5Qy.mjs} +6 -0
  134. package/dist/{chunks/messages-CLhcMlTc.mjs → messages-ZjUAIWb1.mjs} +6 -0
  135. package/dist/{chunks/messages-9SihnaXQ.mjs → messages-b1EdvUm0.mjs} +6 -0
  136. package/dist/{chunks/messages-DvFLX36Q.mjs → messages-begYOTgC.mjs} +6 -0
  137. package/dist/{chunks/messages-BMv4xwIr.mjs → messages-jrncnb-H.mjs} +6 -0
  138. package/dist/{chunks/messages-D5iv1Kox.mjs → messages-nefz1S71.mjs} +6 -0
  139. package/dist/{chunks/messages-CQwpzUFp.mjs → messages-ucTVgS5G.mjs} +6 -0
  140. package/dist/{messages-DBRw-7Zc.mjs → messages-v3GipbFl.mjs} +6 -0
  141. package/dist/{chunks/messages-C9eaarcK.mjs → messages-wmi-iFkH.mjs} +6 -0
  142. package/dist/{messages-O5tQus_0.mjs → messages-yHcs38yI.mjs} +6 -0
  143. package/dist/tools.mjs +3194 -1690
  144. package/dist/vendor.LICENSE.txt +109 -109
  145. package/package.json +43 -57
  146. package/src/blok.ts +12 -0
  147. package/src/components/__module.ts +21 -0
  148. package/src/components/block/api.ts +17 -0
  149. package/src/components/block/style-manager.ts +6 -2
  150. package/src/components/block/tool-renderer.ts +33 -30
  151. package/src/components/blocks.ts +132 -15
  152. package/src/components/i18n/locales/am/messages.json +6 -0
  153. package/src/components/i18n/locales/ar/messages.json +6 -0
  154. package/src/components/i18n/locales/az/messages.json +6 -0
  155. package/src/components/i18n/locales/bg/messages.json +6 -0
  156. package/src/components/i18n/locales/bn/messages.json +6 -0
  157. package/src/components/i18n/locales/bs/messages.json +6 -0
  158. package/src/components/i18n/locales/cs/messages.json +6 -0
  159. package/src/components/i18n/locales/da/messages.json +6 -0
  160. package/src/components/i18n/locales/de/messages.json +6 -0
  161. package/src/components/i18n/locales/dv/messages.json +6 -0
  162. package/src/components/i18n/locales/el/messages.json +6 -0
  163. package/src/components/i18n/locales/en/messages.json +6 -0
  164. package/src/components/i18n/locales/es/messages.json +6 -0
  165. package/src/components/i18n/locales/et/messages.json +6 -0
  166. package/src/components/i18n/locales/fa/messages.json +6 -0
  167. package/src/components/i18n/locales/fi/messages.json +6 -0
  168. package/src/components/i18n/locales/fil/messages.json +6 -0
  169. package/src/components/i18n/locales/fr/messages.json +6 -0
  170. package/src/components/i18n/locales/gu/messages.json +6 -0
  171. package/src/components/i18n/locales/he/messages.json +6 -0
  172. package/src/components/i18n/locales/hi/messages.json +6 -0
  173. package/src/components/i18n/locales/hr/messages.json +6 -0
  174. package/src/components/i18n/locales/hu/messages.json +6 -0
  175. package/src/components/i18n/locales/hy/messages.json +6 -0
  176. package/src/components/i18n/locales/id/messages.json +6 -0
  177. package/src/components/i18n/locales/it/messages.json +6 -0
  178. package/src/components/i18n/locales/ja/messages.json +6 -0
  179. package/src/components/i18n/locales/ka/messages.json +6 -0
  180. package/src/components/i18n/locales/km/messages.json +6 -0
  181. package/src/components/i18n/locales/kn/messages.json +6 -0
  182. package/src/components/i18n/locales/ko/messages.json +6 -0
  183. package/src/components/i18n/locales/ku/messages.json +6 -0
  184. package/src/components/i18n/locales/lo/messages.json +6 -0
  185. package/src/components/i18n/locales/lt/messages.json +6 -0
  186. package/src/components/i18n/locales/lv/messages.json +6 -0
  187. package/src/components/i18n/locales/mk/messages.json +6 -0
  188. package/src/components/i18n/locales/ml/messages.json +6 -0
  189. package/src/components/i18n/locales/mn/messages.json +6 -0
  190. package/src/components/i18n/locales/mr/messages.json +6 -0
  191. package/src/components/i18n/locales/ms/messages.json +6 -0
  192. package/src/components/i18n/locales/my/messages.json +6 -0
  193. package/src/components/i18n/locales/ne/messages.json +6 -0
  194. package/src/components/i18n/locales/nl/messages.json +6 -0
  195. package/src/components/i18n/locales/no/messages.json +6 -0
  196. package/src/components/i18n/locales/pa/messages.json +6 -0
  197. package/src/components/i18n/locales/pl/messages.json +6 -0
  198. package/src/components/i18n/locales/ps/messages.json +6 -0
  199. package/src/components/i18n/locales/pt/messages.json +6 -0
  200. package/src/components/i18n/locales/ro/messages.json +6 -0
  201. package/src/components/i18n/locales/ru/messages.json +6 -0
  202. package/src/components/i18n/locales/sd/messages.json +6 -0
  203. package/src/components/i18n/locales/si/messages.json +6 -0
  204. package/src/components/i18n/locales/sk/messages.json +6 -0
  205. package/src/components/i18n/locales/sl/messages.json +6 -0
  206. package/src/components/i18n/locales/sq/messages.json +6 -0
  207. package/src/components/i18n/locales/sr/messages.json +6 -0
  208. package/src/components/i18n/locales/sv/messages.json +6 -0
  209. package/src/components/i18n/locales/sw/messages.json +6 -0
  210. package/src/components/i18n/locales/ta/messages.json +6 -0
  211. package/src/components/i18n/locales/te/messages.json +6 -0
  212. package/src/components/i18n/locales/th/messages.json +6 -0
  213. package/src/components/i18n/locales/tr/messages.json +6 -0
  214. package/src/components/i18n/locales/ug/messages.json +6 -0
  215. package/src/components/i18n/locales/uk/messages.json +6 -0
  216. package/src/components/i18n/locales/ur/messages.json +6 -0
  217. package/src/components/i18n/locales/vi/messages.json +6 -0
  218. package/src/components/i18n/locales/yi/messages.json +6 -0
  219. package/src/components/i18n/locales/zh/messages.json +6 -0
  220. package/src/components/icons/index.ts +17 -0
  221. package/src/components/inline-tools/inline-tool-link.ts +1 -1
  222. package/src/components/inline-tools/inline-tool-marker.ts +737 -0
  223. package/src/components/inline-tools/utils/formatting-range-utils.ts +6 -3
  224. package/src/components/inline-tools/utils/marker-dom-utils.ts +17 -0
  225. package/src/components/modules/api/blocks.ts +34 -9
  226. package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +75 -29
  227. package/src/components/modules/blockEvents/index.ts +13 -5
  228. package/src/components/modules/blockManager/blockManager.ts +81 -2
  229. package/src/components/modules/blockManager/hierarchy.ts +20 -2
  230. package/src/components/modules/blockManager/operations.ts +70 -35
  231. package/src/components/modules/blockManager/repository.ts +22 -0
  232. package/src/components/modules/blockManager/types.ts +3 -1
  233. package/src/components/modules/blockManager/yjs-sync.ts +173 -39
  234. package/src/components/modules/blockSelection.ts +3 -0
  235. package/src/components/modules/crossBlockSelection.ts +11 -3
  236. package/src/components/modules/drag/preview/DragPreview.ts +10 -2
  237. package/src/components/modules/drag/target/DropTargetDetector.ts +100 -11
  238. package/src/components/modules/drag/utils/drag.constants.ts +1 -1
  239. package/src/components/modules/normalizeInlineImages.ts +263 -0
  240. package/src/components/modules/paste/google-docs-preprocessor.ts +197 -0
  241. package/src/components/modules/paste/handlers/base.ts +43 -2
  242. package/src/components/modules/paste/handlers/html-handler.ts +1 -1
  243. package/src/components/modules/paste/handlers/index.ts +1 -0
  244. package/src/components/modules/paste/handlers/table-cells-handler.ts +104 -0
  245. package/src/components/modules/paste/index.ts +20 -3
  246. package/src/components/modules/readonly.ts +8 -2
  247. package/src/components/modules/rectangleSelection.ts +5 -2
  248. package/src/components/modules/renderer.ts +35 -0
  249. package/src/components/modules/saver.ts +52 -2
  250. package/src/components/modules/toolbar/blockSettings.ts +52 -44
  251. package/src/components/modules/toolbar/index.ts +124 -17
  252. package/src/components/modules/toolbar/inline/index.ts +4 -4
  253. package/src/components/modules/toolbar/plus-button.ts +3 -3
  254. package/src/components/modules/toolbar/settings-toggler.ts +3 -3
  255. package/src/components/modules/toolbar/styles.ts +7 -7
  256. package/src/components/modules/ui.ts +6 -6
  257. package/src/components/modules/uiControllers/controllers/blockHover.ts +16 -2
  258. package/src/components/modules/uiControllers/handlers/touch.ts +83 -10
  259. package/src/components/modules/yjs/block-observer.ts +9 -3
  260. package/src/components/modules/yjs/document-store.ts +10 -7
  261. package/src/components/modules/yjs/types.ts +8 -6
  262. package/src/components/modules/yjs/undo-history.ts +90 -11
  263. package/src/components/selection/fake-background/shadows.ts +1 -1
  264. package/src/components/shared/color-picker.ts +211 -0
  265. package/src/components/shared/color-presets.ts +25 -0
  266. package/src/components/ui/toolbox.ts +19 -11
  267. package/src/components/utils/color-mapping.ts +241 -0
  268. package/src/components/utils/notifier/draw.ts +9 -9
  269. package/src/components/utils/placeholder.ts +24 -8
  270. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +2 -2
  271. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +14 -12
  272. package/src/components/utils/popover/components/search-input/search-input.const.ts +2 -2
  273. package/src/components/utils/popover/popover-abstract.ts +27 -3
  274. package/src/components/utils/popover/popover-desktop.ts +26 -3
  275. package/src/components/utils/popover/popover-inline.ts +14 -1
  276. package/src/components/utils/popover/popover-mobile.ts +4 -4
  277. package/src/components/utils/popover/popover.const.ts +2 -2
  278. package/src/components/utils/sanitizer.ts +24 -3
  279. package/src/components/utils/tw.ts +17 -5
  280. package/src/stories/Header.stories.ts +106 -0
  281. package/src/stories/MarkerColors.stories.ts +730 -0
  282. package/src/stories/Popover.stories.ts +1 -3
  283. package/src/stories/Table.stories.ts +1662 -0
  284. package/src/styles/main.css +207 -37
  285. package/src/tools/header/index.ts +1 -1
  286. package/src/tools/index.ts +3 -1
  287. package/src/tools/list/caret-manager.ts +28 -10
  288. package/src/tools/list/constants.ts +2 -2
  289. package/src/tools/list/dom-builder.ts +3 -3
  290. package/src/tools/list/static-configs.ts +0 -1
  291. package/src/tools/paragraph/index.ts +15 -7
  292. package/src/tools/table/core/table-commands.ts +99 -0
  293. package/src/tools/table/core/table-controller.ts +231 -0
  294. package/src/tools/table/core/table-events.ts +102 -0
  295. package/src/tools/table/index.ts +1070 -174
  296. package/src/tools/table/ownership/table-event-broker.ts +74 -0
  297. package/src/tools/table/ownership/table-ownership-registry.ts +126 -0
  298. package/src/tools/table/table-add-controls.ts +85 -15
  299. package/src/tools/table/table-cell-blocks.ts +336 -38
  300. package/src/tools/table/table-cell-clipboard.ts +415 -0
  301. package/src/tools/table/table-cell-color-picker.ts +34 -0
  302. package/src/tools/table/table-cell-selection.ts +264 -15
  303. package/src/tools/table/table-core.ts +3 -42
  304. package/src/tools/table/table-heading-toggle.ts +2 -2
  305. package/src/tools/table/table-model.ts +623 -0
  306. package/src/tools/table/table-operations.ts +59 -78
  307. package/src/tools/table/table-resize.ts +15 -11
  308. package/src/tools/table/table-restrictions.ts +69 -3
  309. package/src/tools/table/table-row-col-action-handler.ts +22 -7
  310. package/src/tools/table/table-row-col-controls.ts +129 -12
  311. package/src/tools/table/table-row-col-drag.ts +14 -0
  312. package/src/tools/table/table-scroll-haze.ts +152 -0
  313. package/src/tools/table/types.ts +22 -1
  314. package/src/tools/table/view/table-cell-blocks-adapter.ts +47 -0
  315. package/src/variants/blok-minimum.ts +13 -0
  316. package/types/api/block.d.ts +13 -0
  317. package/types/api/blocks.d.ts +16 -0
  318. package/types/tools/table.d.ts +2 -0
  319. package/dist/chunks/i18next-CugVlwWp.mjs +0 -1292
  320. package/src/tools/table/data-normalizer.ts +0 -32
@@ -1,12 +1,12 @@
1
1
  Name: @babel/register
2
- Version: 7.28.3
2
+ Version: 7.28.6
3
3
  License: MIT
4
4
  Private: false
5
5
  Description: babel require hook
6
6
  Repository: https://github.com/babel/babel.git
7
7
  Homepage: https://babel.dev/docs/en/next/babel-register
8
8
  Author: The Babel Team (https://babel.dev/team)
9
- License Copyright:
9
+ License Text:
10
10
  ===
11
11
 
12
12
  MIT License
@@ -34,12 +34,116 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
34
 
35
35
  ---
36
36
 
37
+ Name: lib0
38
+ Version: 0.2.117
39
+ License: MIT
40
+ Private: false
41
+ Repository: git+https://github.com/dmonad/lib0.git
42
+ Homepage: https://github.com/dmonad/lib0#readme
43
+ Author: Kevin Jahns <kevin.jahns@protonmail.com>
44
+ License Text:
45
+ ===
46
+
47
+ The MIT License (MIT)
48
+
49
+ Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
50
+
51
+ Permission is hereby granted, free of charge, to any person obtaining a copy
52
+ of this software and associated documentation files (the "Software"), to deal
53
+ in the Software without restriction, including without limitation the rights
54
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55
+ copies of the Software, and to permit persons to whom the Software is
56
+ furnished to do so, subject to the following conditions:
57
+
58
+ The above copyright notice and this permission notice shall be included in all
59
+ copies or substantial portions of the Software.
60
+
61
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67
+ SOFTWARE.
68
+
69
+ ---
70
+
71
+ Name: yjs
72
+ Version: 13.6.29
73
+ License: MIT
74
+ Private: false
75
+ Description: Shared Editing Library
76
+ Repository: https://github.com/yjs/yjs.git
77
+ Homepage: https://docs.yjs.dev
78
+ Author: Kevin Jahns
79
+ License Text:
80
+ ===
81
+
82
+ The MIT License (MIT)
83
+
84
+ Copyright (c) 2023
85
+ - Kevin Jahns <kevin.jahns@protonmail.com>.
86
+ - Chair of Computer Science 5 (Databases & Information Systems), RWTH Aachen University, Germany
87
+
88
+ Permission is hereby granted, free of charge, to any person obtaining a copy
89
+ of this software and associated documentation files (the "Software"), to deal
90
+ in the Software without restriction, including without limitation the rights
91
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
92
+ copies of the Software, and to permit persons to whom the Software is
93
+ furnished to do so, subject to the following conditions:
94
+
95
+ The above copyright notice and this permission notice shall be included in all
96
+ copies or substantial portions of the Software.
97
+
98
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
101
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
102
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
103
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
104
+ SOFTWARE.
105
+
106
+ ---
107
+
108
+ Name: nanoid
109
+ Version: 5.1.6
110
+ License: MIT
111
+ Private: false
112
+ Description: A tiny (118 bytes), secure URL-friendly unique string ID generator
113
+ Repository: undefined
114
+ Author: Andrey Sitnik <andrey@sitnik.ru>
115
+ License Text:
116
+ ===
117
+
118
+ The MIT License (MIT)
119
+
120
+ Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
121
+
122
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
123
+ this software and associated documentation files (the "Software"), to deal in
124
+ the Software without restriction, including without limitation the rights to
125
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
126
+ the Software, and to permit persons to whom the Software is furnished to do so,
127
+ subject to the following conditions:
128
+
129
+ The above copyright notice and this permission notice shall be included in all
130
+ copies or substantial portions of the Software.
131
+
132
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
133
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
134
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
135
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
136
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
137
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
138
+
139
+ ---
140
+
37
141
  Name: html-janitor
38
142
  Version: 2.0.4
39
143
  License: null
40
144
  Private: false
41
145
  Repository: https://github.com/guardian/html-janitor.git
42
- License Copyright:
146
+ License Text:
43
147
  ===
44
148
 
45
149
  Apache License
@@ -246,119 +350,15 @@ Apache License
246
350
 
247
351
  ---
248
352
 
249
- Name: lib0
250
- Version: 0.2.117
251
- License: MIT
252
- Private: false
253
- Repository: git+https://github.com/dmonad/lib0.git
254
- Homepage: https://github.com/dmonad/lib0#readme
255
- Author: Kevin Jahns <kevin.jahns@protonmail.com>
256
- License Copyright:
257
- ===
258
-
259
- The MIT License (MIT)
260
-
261
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
262
-
263
- Permission is hereby granted, free of charge, to any person obtaining a copy
264
- of this software and associated documentation files (the "Software"), to deal
265
- in the Software without restriction, including without limitation the rights
266
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
267
- copies of the Software, and to permit persons to whom the Software is
268
- furnished to do so, subject to the following conditions:
269
-
270
- The above copyright notice and this permission notice shall be included in all
271
- copies or substantial portions of the Software.
272
-
273
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
274
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
275
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
276
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
277
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
278
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
279
- SOFTWARE.
280
-
281
- ---
282
-
283
- Name: yjs
284
- Version: 13.6.28
285
- License: MIT
286
- Private: false
287
- Description: Shared Editing Library
288
- Repository: https://github.com/yjs/yjs.git
289
- Homepage: https://docs.yjs.dev
290
- Author: Kevin Jahns
291
- License Copyright:
292
- ===
293
-
294
- The MIT License (MIT)
295
-
296
- Copyright (c) 2023
297
- - Kevin Jahns <kevin.jahns@protonmail.com>.
298
- - Chair of Computer Science 5 (Databases & Information Systems), RWTH Aachen University, Germany
299
-
300
- Permission is hereby granted, free of charge, to any person obtaining a copy
301
- of this software and associated documentation files (the "Software"), to deal
302
- in the Software without restriction, including without limitation the rights
303
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
304
- copies of the Software, and to permit persons to whom the Software is
305
- furnished to do so, subject to the following conditions:
306
-
307
- The above copyright notice and this permission notice shall be included in all
308
- copies or substantial portions of the Software.
309
-
310
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
311
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
312
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
313
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
314
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
315
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
316
- SOFTWARE.
317
-
318
- ---
319
-
320
- Name: nanoid
321
- Version: 5.1.6
322
- License: MIT
323
- Private: false
324
- Description: A tiny (118 bytes), secure URL-friendly unique string ID generator
325
- Repository: undefined
326
- Author: Andrey Sitnik <andrey@sitnik.ru>
327
- License Copyright:
328
- ===
329
-
330
- The MIT License (MIT)
331
-
332
- Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
333
-
334
- Permission is hereby granted, free of charge, to any person obtaining a copy of
335
- this software and associated documentation files (the "Software"), to deal in
336
- the Software without restriction, including without limitation the rights to
337
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
338
- the Software, and to permit persons to whom the Software is furnished to do so,
339
- subject to the following conditions:
340
-
341
- The above copyright notice and this permission notice shall be included in all
342
- copies or substantial portions of the Software.
343
-
344
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
345
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
346
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
347
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
348
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
349
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
350
-
351
- ---
352
-
353
353
  Name: i18next
354
- Version: 25.7.3
354
+ Version: 25.8.13
355
355
  License: MIT
356
356
  Private: false
357
357
  Description: i18next internationalization framework
358
358
  Repository: https://github.com/i18next/i18next.git
359
359
  Homepage: https://www.i18next.com
360
360
  Author: Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)
361
- License Copyright:
361
+ License Text:
362
362
  ===
363
363
 
364
364
  The MIT License (MIT)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackuait/blok",
3
- "version": "0.6.0-beta.8",
3
+ "version": "0.6.0",
4
4
  "description": "Blok — headless, highly extensible rich text editor built for developers who need to implement a block-based editing experience (similar to Notion) without building it from scratch",
5
5
  "module": "dist/blok.mjs",
6
6
  "types": "./types/index.d.ts",
@@ -49,8 +49,9 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
+ "packageManager": "yarn@4.9.4",
52
53
  "engines": {
53
- "node": ">=18.0.0"
54
+ "node": ">=20.19.0"
54
55
  },
55
56
  "keywords": [
56
57
  "blok",
@@ -118,73 +119,58 @@
118
119
  "url": "git+https://github.com/JackUait/blok.git"
119
120
  },
120
121
  "devDependencies": {
121
- "@axe-core/playwright": "4.11.0",
122
- "@babel/register": "7.28.3",
123
- "@commitlint/cli": "20.1.0",
124
- "@commitlint/config-conventional": "20.0.0",
125
- "@playwright/test": "1.57.0",
122
+ "@axe-core/playwright": "4.11.1",
123
+ "@babel/register": "7.28.6",
124
+ "@commitlint/cli": "20.4.2",
125
+ "@commitlint/config-conventional": "20.4.2",
126
+ "@playwright/test": "1.58.2",
126
127
  "@size-limit/esbuild-why": "12.0.0",
127
128
  "@size-limit/preset-small-lib": "12.0.0",
128
- "@storybook/addon-a11y": "10.1.11",
129
- "@storybook/addon-vitest": "10.1.11",
130
- "@storybook/html-vite": "10.1.11",
131
- "@types/eslint-plugin-tailwindcss": "3",
132
- "@types/node": "22.19.0",
133
- "@vitest/browser-playwright": "4.0.14",
134
- "@vitest/coverage-v8": "4.0.14",
135
- "@vitest/ui": "4.0.14",
136
- "autoprefixer": "10.4.22",
137
- "chromatic": "13.3.4",
138
- "eslint": "9.39.1",
129
+ "@storybook/addon-a11y": "10.2.13",
130
+ "@storybook/addon-vitest": "10.2.13",
131
+ "@storybook/html-vite": "10.2.13",
132
+ "@tailwindcss/vite": "4.2.1",
133
+ "@types/node": "25.3.2",
134
+ "@vitest/browser-playwright": "4.0.18",
135
+ "@vitest/coverage-v8": "4.0.18",
136
+ "@vitest/eslint-plugin": "1.6.9",
137
+ "@vitest/ui": "4.0.18",
138
+ "chromatic": "15.2.0",
139
+ "eslint": "10.0.2",
139
140
  "eslint-plugin-import": "2.32.0",
140
- "eslint-plugin-jest": "29.2.1",
141
+ "eslint-plugin-jest": "29.15.0",
141
142
  "eslint-plugin-jest-dom": "^5.5.0",
142
- "eslint-plugin-jsdoc": "61.4.1",
143
- "eslint-plugin-playwright": "2.3.0",
144
- "eslint-plugin-sonarjs": "3.0.5",
145
- "eslint-plugin-storybook": "10.1.11",
146
- "eslint-plugin-tailwindcss": "3.18.2",
147
- "eslint-plugin-testing-library": "^7.15.4",
148
- "eslint-plugin-vitest": "^0.5.4",
143
+ "eslint-plugin-jsdoc": "62.7.1",
144
+ "eslint-plugin-playwright": "2.7.1",
145
+ "eslint-plugin-sonarjs": "4.0.0",
146
+ "eslint-plugin-storybook": "10.2.13",
147
+ "eslint-plugin-tailwindcss": "4.0.0-beta.0",
148
+ "eslint-plugin-testing-library": "^7.16.0",
149
149
  "html-janitor": "2.0.4",
150
150
  "husky": "9.1.7",
151
- "jscpd": "4.0.5",
152
- "jsdom": "27.2.0",
153
- "playwright": "1.57.0",
151
+ "jscpd": "4.0.8",
152
+ "jsdom": "28.1.0",
153
+ "playwright": "1.58.2",
154
154
  "postcss": "8.5.6",
155
- "rollup-plugin-license": "3.6.0",
156
- "semantic-release": "25.0.2",
157
- "shiki": "^3.21.0",
155
+ "rollup-plugin-license": "3.7.0",
156
+ "semantic-release": "25.0.3",
157
+ "shiki": "^3.23.0",
158
158
  "size-limit": "12.0.0",
159
- "storybook": "10.1.11",
160
- "tailwindcss": "3",
159
+ "storybook": "10.2.13",
160
+ "tailwindcss": "4.2.1",
161
161
  "typescript": "5.9.3",
162
- "typescript-eslint": "8.48.0",
163
- "vite": "7.2.4",
164
- "vite-plugin-css-injected-by-js": "3.1.0",
165
- "vitest": "4.0.14",
162
+ "typescript-eslint": "8.56.1",
163
+ "vite": "7.3.1",
164
+ "vite-plugin-css-injected-by-js": "4.0.1",
165
+ "vitest": "4.0.18",
166
166
  "yaml": "^2.8.2"
167
167
  },
168
168
  "dependencies": {
169
- "i18next": "25.7.3",
169
+ "i18next": "25.8.13",
170
170
  "nanoid": "5.1.6",
171
- "yjs": "13.6.28"
171
+ "yjs": "13.6.29"
172
172
  },
173
- "size-limit": [
174
- {
175
- "name": "Minimum (core only)",
176
- "path": "src/variants/blok-minimum.ts",
177
- "limit": "300 KB"
178
- },
179
- {
180
- "name": "Normal (with tools)",
181
- "path": "src/blok.ts",
182
- "limit": "300 KB"
183
- },
184
- {
185
- "name": "Maximum (all locales)",
186
- "path": "src/variants/blok-maximum.ts",
187
- "limit": "300 KB"
188
- }
189
- ]
173
+ "resolutions": {
174
+ "@typescript-eslint/utils": "8.56.1"
175
+ }
190
176
  }
package/src/blok.ts CHANGED
@@ -111,6 +111,18 @@ class Blok {
111
111
  public exportAPI(blok: Core): void {
112
112
  const fieldsToExport = [ 'configuration' ];
113
113
  const destroy = (): void => {
114
+ // Mark all modules as destroyed first so any in-flight async work stops gracefully
115
+ Object.values(blok.moduleInstances)
116
+ .forEach((moduleInstance) => {
117
+ if (moduleInstance === undefined || moduleInstance === null) {
118
+ return;
119
+ }
120
+
121
+ if (isFunction((moduleInstance as { markDestroyed?: () => void }).markDestroyed)) {
122
+ (moduleInstance as { markDestroyed: () => void }).markDestroyed();
123
+ }
124
+ });
125
+
114
126
  Object.values(blok.moduleInstances)
115
127
  .forEach((moduleInstance) => {
116
128
  if (moduleInstance === undefined || moduleInstance === null) {
@@ -27,6 +27,27 @@ export class Module<T extends ModuleNodes = Record<string, HTMLElement>> {
27
27
 
28
28
  public nodes: T = {} as T;
29
29
 
30
+ /**
31
+ * Flag indicating whether this module's editor has been destroyed.
32
+ * After destruction, modules should refuse to perform work.
33
+ */
34
+ private _isDestroyed = false;
35
+
36
+ /**
37
+ * Returns true if the editor owning this module has been destroyed
38
+ */
39
+ public get isDestroyed(): boolean {
40
+ return this._isDestroyed;
41
+ }
42
+
43
+ /**
44
+ * Mark this module as destroyed. Called by the editor's destroy() method.
45
+ * After this, the module should refuse to perform further work.
46
+ */
47
+ public markDestroyed(): void {
48
+ this._isDestroyed = true;
49
+ }
50
+
30
51
  /**
31
52
  * Blok modules list
32
53
  * @type {BlokModules}
@@ -1,5 +1,6 @@
1
1
  import type { BlockAPI as BlockAPIInterface } from '../../../types/api';
2
2
  import type { SavedData } from '../../../types/data-formats';
3
+ import type { BlockTuneData } from '../../../types/block-tunes/block-tune-data';
3
4
  import type { BlockToolData, ToolConfig, ToolboxConfigEntry } from '../../../types/tools';
4
5
 
5
6
  import type { Block } from './index';
@@ -61,6 +62,22 @@ const BlockAPIConstructor = function BlockAPI(
61
62
  return block.selected;
62
63
  },
63
64
 
65
+ /**
66
+ * Last successfully extracted block tool data (synchronous)
67
+ * @returns {BlockToolData}
68
+ */
69
+ get preservedData(): BlockToolData {
70
+ return block.preservedData;
71
+ },
72
+
73
+ /**
74
+ * Last successfully extracted tune data (synchronous)
75
+ * @returns {{ [name: string]: BlockTuneData }}
76
+ */
77
+ get preservedTunes(): { [name: string]: BlockTuneData } {
78
+ return block.preservedTunes;
79
+ },
80
+
64
81
  /**
65
82
  * Set Block's stretch state
66
83
  * @param {boolean} state — state to set
@@ -10,9 +10,9 @@ export class StyleManager {
10
10
  * Tailwind styles for the Block elements
11
11
  */
12
12
  private static readonly styles = {
13
- wrapper: 'relative opacity-100 my-[-0.5em] py-[0.5em] first:mt-0 [&_a]:cursor-pointer [&_a]:underline [&_a]:text-link [&_b]:font-bold [&_i]:italic',
13
+ wrapper: 'relative opacity-100 my-[-0.5em] py-[0.5em] first:mt-0 last:pb-0 last:mb-0 [&_a]:cursor-pointer [&_a]:underline [&_a]:text-link [&_b]:font-bold [&_i]:italic',
14
14
  content: 'relative mx-auto transition-colors duration-150 ease-out max-w-content',
15
- contentSelected: 'bg-selection rounded-[4px] [&_[contenteditable]]:select-none [&_img]:opacity-55 [&_[data-blok-tool=stub]]:opacity-55',
15
+ contentSelected: 'bg-selection rounded-[4px] **:[[contenteditable]]:select-none [&_img]:opacity-55 **:data-[blok-tool=stub]:opacity-55',
16
16
  contentStretched: 'max-w-none',
17
17
  };
18
18
 
@@ -84,6 +84,10 @@ export class StyleManager {
84
84
  * @returns The CSS class string
85
85
  */
86
86
  public getContentClasses(selected: boolean, stretched: boolean): string {
87
+ if (selected && stretched) {
88
+ return twMerge(StyleManager.styles.content, StyleManager.styles.contentSelected, StyleManager.styles.contentStretched);
89
+ }
90
+
87
91
  if (selected) {
88
92
  return twMerge(StyleManager.styles.content, StyleManager.styles.contentSelected);
89
93
  }
@@ -163,19 +163,7 @@ export class ToolRenderer {
163
163
  this.addToolDataAttributes(pluginsContent, wrapper);
164
164
  contentNode.appendChild(pluginsContent);
165
165
 
166
- // Call the tool's rendered lifecycle method if it exists
167
- // Defer to next frame to ensure all blocks are registered
168
- const rendered = this.toolInstance.rendered;
169
- if (typeof rendered === 'function') {
170
- const resolver = this.readyResolver;
171
- const toolInstance = this.toolInstance;
172
- requestAnimationFrame(() => {
173
- rendered.call(toolInstance);
174
- resolver?.();
175
- });
176
- } else {
177
- this.readyResolver?.();
178
- }
166
+ this.invokeRenderedLifecycle();
179
167
  }
180
168
 
181
169
  /**
@@ -192,19 +180,7 @@ export class ToolRenderer {
192
180
  this.addToolDataAttributes(resolvedElement, wrapper);
193
181
  contentNode.appendChild(resolvedElement);
194
182
 
195
- // Call the tool's rendered lifecycle method if it exists
196
- // Defer to next frame to ensure all blocks are registered
197
- const rendered = this.toolInstance.rendered;
198
- if (typeof rendered === 'function') {
199
- const resolver = this.readyResolver;
200
- const toolInstance = this.toolInstance;
201
- requestAnimationFrame(() => {
202
- rendered.call(toolInstance);
203
- resolver?.();
204
- });
205
- } else {
206
- this.readyResolver?.();
207
- }
183
+ this.invokeRenderedLifecycle();
208
184
  })
209
185
  .catch((error) => {
210
186
  log(`Tool render promise rejected: %o`, 'error', error);
@@ -212,6 +188,33 @@ export class ToolRenderer {
212
188
  });
213
189
  }
214
190
 
191
+ /**
192
+ * Call the tool's rendered lifecycle method if it exists.
193
+ * Defers to next frame to ensure all blocks are registered.
194
+ * Always resolves readyResolver, even if rendered() throws.
195
+ */
196
+ private invokeRenderedLifecycle(): void {
197
+ const rendered = this.toolInstance.rendered;
198
+
199
+ if (typeof rendered === 'function') {
200
+ const resolver = this.readyResolver;
201
+ const toolInstance = this.toolInstance;
202
+ const name = this.name;
203
+
204
+ requestAnimationFrame(() => {
205
+ try {
206
+ rendered.call(toolInstance);
207
+ } catch (e) {
208
+ log(`${name}: rendered() threw: ${e instanceof Error ? e.message : String(e)}`, 'warn');
209
+ } finally {
210
+ resolver?.();
211
+ }
212
+ });
213
+ } else {
214
+ this.readyResolver?.();
215
+ }
216
+ }
217
+
215
218
  /**
216
219
  * Add data attributes to tool-rendered element based on tool name
217
220
  */
@@ -237,10 +240,10 @@ export class ToolRenderer {
237
240
  'empty:before:text-gray-text',
238
241
  'empty:before:cursor-text',
239
242
  'empty:before:content-[attr(data-blok-placeholder)]',
240
- '[&[data-blok-empty=true]]:before:pointer-events-none',
241
- '[&[data-blok-empty=true]]:before:text-gray-text',
242
- '[&[data-blok-empty=true]]:before:cursor-text',
243
- '[&[data-blok-empty=true]]:before:content-[attr(data-blok-placeholder)]',
243
+ 'data-[blok-empty=true]:before:pointer-events-none',
244
+ 'data-[blok-empty=true]:before:text-gray-text',
245
+ 'data-[blok-empty=true]:before:cursor-text',
246
+ 'data-[blok-empty=true]:before:content-[attr(data-blok-placeholder)]',
244
247
  ];
245
248
 
246
249
  if (placeholderText.length > 0) {