@jackuait/blok 0.6.0-beta.0 → 0.6.0-beta.10

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 (286) hide show
  1. package/README.md +16 -169
  2. package/bin/blok.mjs +10 -0
  3. package/dist/blok.mjs +2 -2
  4. package/dist/chunks/{blok-Bu9S3SsR.mjs → blok-Buf0btS7.mjs} +2267 -2024
  5. package/dist/chunks/{i18next-loader-CKuXJ0Av.mjs → i18next-loader-CVf_ZfwA.mjs} +1 -1
  6. package/dist/chunks/{index-jtZaryNw.mjs → index-C6jsfLLp.mjs} +1 -1
  7. package/dist/chunks/{inline-tool-convert-CFjyrH30.mjs → inline-tool-convert-BKKEoOqB.mjs} +710 -570
  8. package/dist/chunks/{messages-C5b7hr_E.mjs → messages-1fC8IMyX.mjs} +16 -2
  9. package/dist/chunks/{messages-CQj2JU2j.mjs → messages-7QoX8DkW.mjs} +23 -9
  10. package/dist/{messages-LvFKBBPa.mjs → chunks/messages-7W4d0DwD.mjs} +15 -1
  11. package/dist/{messages-Bn253WWC.mjs → chunks/messages-9SihnaXQ.mjs} +14 -0
  12. package/dist/{messages-Bf6Y3_GI.mjs → chunks/messages-B1Aww8q7.mjs} +16 -2
  13. package/dist/{messages-pA5TvcAj.mjs → chunks/messages-BB5z9Uba.mjs} +14 -0
  14. package/dist/chunks/{messages-wdqp4610.mjs → messages-BC86qLvI.mjs} +17 -3
  15. package/dist/chunks/{messages-o24dK6CU.mjs → messages-BELRf6DU.mjs} +16 -2
  16. package/dist/chunks/{messages-CUZ1x1QD.mjs → messages-BFG6Wlgy.mjs} +16 -2
  17. package/dist/{messages-B5puUm7R.mjs → chunks/messages-BL0tXcDf.mjs} +15 -1
  18. package/dist/chunks/{messages-zS1AXZ0y.mjs → messages-BMXCuEKO.mjs} +19 -5
  19. package/dist/{messages-CyDU5lz9.mjs → chunks/messages-BMv4xwIr.mjs} +16 -2
  20. package/dist/chunks/{messages-BeUhMpsr.mjs → messages-BSbjsyHY.mjs} +25 -11
  21. package/dist/chunks/{messages-JGsXAReJ.mjs → messages-BU2nlrLK.mjs} +16 -2
  22. package/dist/chunks/{messages-srxrv8Yh.mjs → messages-BWF-zUpY.mjs} +17 -3
  23. package/dist/{messages-CXHd9SUK.mjs → chunks/messages-BYyy6Wqf.mjs} +14 -0
  24. package/dist/chunks/{messages-DOlC_Tty.mjs → messages-BdeLo0N9.mjs} +24 -10
  25. package/dist/chunks/{messages-B5jGUnOy.mjs → messages-Bmu_S7GM.mjs} +14 -0
  26. package/dist/chunks/{messages-BmKCChWZ.mjs → messages-BoJc_p1r.mjs} +14 -0
  27. package/dist/chunks/{messages-CvaqJFN-.mjs → messages-BogRq8lt.mjs} +15 -1
  28. package/dist/chunks/{messages-NP1myMGI.mjs → messages-BrPFGbM-.mjs} +14 -0
  29. package/dist/chunks/{messages-D00OjS2n.mjs → messages-C2htQ_3F.mjs} +24 -10
  30. package/dist/chunks/{messages-BiExzWJv.mjs → messages-C99mq906.mjs} +15 -1
  31. package/dist/chunks/{messages-CkFT2gle.mjs → messages-C9eaarcK.mjs} +20 -6
  32. package/dist/chunks/{messages-BrJHUxQL.mjs → messages-CJdUsQ-c.mjs} +15 -1
  33. package/dist/chunks/messages-CKI54h6O.mjs +62 -0
  34. package/dist/{messages-CrsJ1TEJ.mjs → chunks/messages-CLhcMlTc.mjs} +15 -1
  35. package/dist/{messages-CnvW8Slp.mjs → chunks/messages-CMkNSDTo.mjs} +17 -3
  36. package/dist/{messages-BlpqL8vG.mjs → chunks/messages-CQwpzUFp.mjs} +19 -5
  37. package/dist/chunks/{messages-Cu08aLS3.mjs → messages-CVw84KdI.mjs} +21 -7
  38. package/dist/chunks/{messages-B9Oba7sq.mjs → messages-CY8_RyFE.mjs} +15 -1
  39. package/dist/chunks/{messages-B5hdXZwA.mjs → messages-CZygwLwM.mjs} +15 -1
  40. package/dist/chunks/{messages-CVeWVKsV.mjs → messages-CnwibSvh.mjs} +14 -0
  41. package/dist/chunks/{messages-DbVquYKN.mjs → messages-CqWJcCbY.mjs} +14 -0
  42. package/dist/{messages-Dg92dXZ5.mjs → chunks/messages-CvGLfqmV.mjs} +14 -0
  43. package/dist/{messages-AHESHJm_.mjs → chunks/messages-CzTufCHu.mjs} +14 -0
  44. package/dist/chunks/{messages-Cj-t1bdy.mjs → messages-CznZadDf.mjs} +15 -1
  45. package/dist/chunks/{messages-DMQIHGRj.mjs → messages-D-ZtY5v0.mjs} +14 -0
  46. package/dist/chunks/{messages-rRSHQDCX.mjs → messages-D1Hv8XGo.mjs} +14 -0
  47. package/dist/chunks/{messages-0tDXLuyH.mjs → messages-D5C3J9qr.mjs} +15 -1
  48. package/dist/chunks/{messages-RvMHb2Ht.mjs → messages-D5iv1Kox.mjs} +16 -2
  49. package/dist/{messages-zSzDzXej.mjs → chunks/messages-DBRw-7Zc.mjs} +16 -2
  50. package/dist/chunks/{messages-CeCjVKMW.mjs → messages-DBn76jVV.mjs} +16 -2
  51. package/dist/chunks/{messages-C7I_AVH2.mjs → messages-DJDG55Vq.mjs} +16 -2
  52. package/dist/{messages-DDLgIPDF.mjs → chunks/messages-DLfR5bMd.mjs} +16 -2
  53. package/dist/{messages-CbhuIWRJ.mjs → chunks/messages-DT4dP5uK.mjs} +15 -1
  54. package/dist/chunks/{messages-B66ZSDCJ.mjs → messages-DhLKYm2j.mjs} +15 -1
  55. package/dist/{messages-BPqWKx5Z.mjs → chunks/messages-Diu6jAaR.mjs} +17 -3
  56. package/dist/{messages-BA0rcTCY.mjs → chunks/messages-DnIhyAJk.mjs} +18 -4
  57. package/dist/chunks/{messages-DV6shA9b.mjs → messages-DnXLrlHh.mjs} +14 -0
  58. package/dist/chunks/{messages-DcKOuncK.mjs → messages-DprmQg6V.mjs} +16 -2
  59. package/dist/{messages-CJoBtXU6.mjs → chunks/messages-DqM1LFg5.mjs} +14 -0
  60. package/dist/chunks/{messages-Cyi2AMmz.mjs → messages-DvFLX36Q.mjs} +25 -11
  61. package/dist/chunks/{messages-DnbbyJT3.mjs → messages-Dz9L52ol.mjs} +16 -2
  62. package/dist/chunks/{messages-GC2PhgV3.mjs → messages-Dzwxv9v1.mjs} +23 -9
  63. package/dist/chunks/{messages-Q4kc_ZtL.mjs → messages-JELdtT6E.mjs} +15 -1
  64. package/dist/{messages-DY94ykcE.mjs → chunks/messages-LPVfA-8K.mjs} +14 -0
  65. package/dist/{messages-Cr-RJ7YB.mjs → chunks/messages-O5tQus_0.mjs} +14 -0
  66. package/dist/chunks/{messages-CbMyJSzS.mjs → messages-Q7AO_FLv.mjs} +17 -3
  67. package/dist/chunks/{messages-2_xedlYw.mjs → messages-R3hUSvr3.mjs} +15 -1
  68. package/dist/{messages-CUy1vn-b.mjs → chunks/messages-Xq8UmkVs.mjs} +14 -0
  69. package/dist/chunks/{messages-BBJgd5jG.mjs → messages-Z9nEU2xK.mjs} +16 -2
  70. package/dist/chunks/{messages-Cm9aLHeX.mjs → messages-_ErNTNhk.mjs} +15 -1
  71. package/dist/chunks/{messages-JZUhXTuV.mjs → messages-_ncGrKHh.mjs} +16 -2
  72. package/dist/chunks/{messages-ftMcCEuO.mjs → messages-kep5wtm4.mjs} +15 -1
  73. package/dist/chunks/{messages-DteYq0rv.mjs → messages-uKX8WBaD.mjs} +16 -2
  74. package/dist/chunks/{messages-Bdv-IkfG.mjs → messages-w7v1GNaE.mjs} +15 -1
  75. package/dist/cli.mjs +50 -0
  76. package/dist/full.mjs +15 -15
  77. package/dist/locales.mjs +102 -88
  78. package/dist/{messages-C5b7hr_E.mjs → messages-1fC8IMyX.mjs} +16 -2
  79. package/dist/{messages-CQj2JU2j.mjs → messages-7QoX8DkW.mjs} +23 -9
  80. package/dist/{chunks/messages-LvFKBBPa.mjs → messages-7W4d0DwD.mjs} +15 -1
  81. package/dist/{chunks/messages-Bn253WWC.mjs → messages-9SihnaXQ.mjs} +14 -0
  82. package/dist/{chunks/messages-Bf6Y3_GI.mjs → messages-B1Aww8q7.mjs} +16 -2
  83. package/dist/{chunks/messages-pA5TvcAj.mjs → messages-BB5z9Uba.mjs} +14 -0
  84. package/dist/{messages-wdqp4610.mjs → messages-BC86qLvI.mjs} +17 -3
  85. package/dist/{messages-o24dK6CU.mjs → messages-BELRf6DU.mjs} +16 -2
  86. package/dist/{messages-CUZ1x1QD.mjs → messages-BFG6Wlgy.mjs} +16 -2
  87. package/dist/{chunks/messages-B5puUm7R.mjs → messages-BL0tXcDf.mjs} +15 -1
  88. package/dist/{messages-zS1AXZ0y.mjs → messages-BMXCuEKO.mjs} +19 -5
  89. package/dist/{chunks/messages-CyDU5lz9.mjs → messages-BMv4xwIr.mjs} +16 -2
  90. package/dist/{messages-BeUhMpsr.mjs → messages-BSbjsyHY.mjs} +25 -11
  91. package/dist/{messages-JGsXAReJ.mjs → messages-BU2nlrLK.mjs} +16 -2
  92. package/dist/{messages-srxrv8Yh.mjs → messages-BWF-zUpY.mjs} +17 -3
  93. package/dist/{chunks/messages-CXHd9SUK.mjs → messages-BYyy6Wqf.mjs} +14 -0
  94. package/dist/{messages-DOlC_Tty.mjs → messages-BdeLo0N9.mjs} +24 -10
  95. package/dist/{messages-B5jGUnOy.mjs → messages-Bmu_S7GM.mjs} +14 -0
  96. package/dist/{messages-BmKCChWZ.mjs → messages-BoJc_p1r.mjs} +14 -0
  97. package/dist/{messages-CvaqJFN-.mjs → messages-BogRq8lt.mjs} +15 -1
  98. package/dist/{messages-NP1myMGI.mjs → messages-BrPFGbM-.mjs} +14 -0
  99. package/dist/{messages-D00OjS2n.mjs → messages-C2htQ_3F.mjs} +24 -10
  100. package/dist/{messages-BiExzWJv.mjs → messages-C99mq906.mjs} +15 -1
  101. package/dist/{messages-CkFT2gle.mjs → messages-C9eaarcK.mjs} +20 -6
  102. package/dist/{messages-BrJHUxQL.mjs → messages-CJdUsQ-c.mjs} +15 -1
  103. package/dist/messages-CKI54h6O.mjs +62 -0
  104. package/dist/{chunks/messages-CrsJ1TEJ.mjs → messages-CLhcMlTc.mjs} +15 -1
  105. package/dist/{chunks/messages-CnvW8Slp.mjs → messages-CMkNSDTo.mjs} +17 -3
  106. package/dist/{chunks/messages-BlpqL8vG.mjs → messages-CQwpzUFp.mjs} +19 -5
  107. package/dist/{messages-Cu08aLS3.mjs → messages-CVw84KdI.mjs} +21 -7
  108. package/dist/{messages-B9Oba7sq.mjs → messages-CY8_RyFE.mjs} +15 -1
  109. package/dist/{messages-B5hdXZwA.mjs → messages-CZygwLwM.mjs} +15 -1
  110. package/dist/{messages-CVeWVKsV.mjs → messages-CnwibSvh.mjs} +14 -0
  111. package/dist/{messages-DbVquYKN.mjs → messages-CqWJcCbY.mjs} +14 -0
  112. package/dist/{chunks/messages-Dg92dXZ5.mjs → messages-CvGLfqmV.mjs} +14 -0
  113. package/dist/{chunks/messages-AHESHJm_.mjs → messages-CzTufCHu.mjs} +14 -0
  114. package/dist/{messages-Cj-t1bdy.mjs → messages-CznZadDf.mjs} +15 -1
  115. package/dist/{messages-DMQIHGRj.mjs → messages-D-ZtY5v0.mjs} +14 -0
  116. package/dist/{messages-rRSHQDCX.mjs → messages-D1Hv8XGo.mjs} +14 -0
  117. package/dist/{messages-0tDXLuyH.mjs → messages-D5C3J9qr.mjs} +15 -1
  118. package/dist/{messages-RvMHb2Ht.mjs → messages-D5iv1Kox.mjs} +16 -2
  119. package/dist/{chunks/messages-zSzDzXej.mjs → messages-DBRw-7Zc.mjs} +16 -2
  120. package/dist/{messages-CeCjVKMW.mjs → messages-DBn76jVV.mjs} +16 -2
  121. package/dist/{messages-C7I_AVH2.mjs → messages-DJDG55Vq.mjs} +16 -2
  122. package/dist/{chunks/messages-DDLgIPDF.mjs → messages-DLfR5bMd.mjs} +16 -2
  123. package/dist/{chunks/messages-CbhuIWRJ.mjs → messages-DT4dP5uK.mjs} +15 -1
  124. package/dist/{messages-B66ZSDCJ.mjs → messages-DhLKYm2j.mjs} +15 -1
  125. package/dist/{chunks/messages-BPqWKx5Z.mjs → messages-Diu6jAaR.mjs} +17 -3
  126. package/dist/{chunks/messages-BA0rcTCY.mjs → messages-DnIhyAJk.mjs} +18 -4
  127. package/dist/{messages-DV6shA9b.mjs → messages-DnXLrlHh.mjs} +14 -0
  128. package/dist/{messages-DcKOuncK.mjs → messages-DprmQg6V.mjs} +16 -2
  129. package/dist/{chunks/messages-CJoBtXU6.mjs → messages-DqM1LFg5.mjs} +14 -0
  130. package/dist/{messages-Cyi2AMmz.mjs → messages-DvFLX36Q.mjs} +25 -11
  131. package/dist/{messages-DnbbyJT3.mjs → messages-Dz9L52ol.mjs} +16 -2
  132. package/dist/{messages-GC2PhgV3.mjs → messages-Dzwxv9v1.mjs} +23 -9
  133. package/dist/{messages-Q4kc_ZtL.mjs → messages-JELdtT6E.mjs} +15 -1
  134. package/dist/{chunks/messages-DY94ykcE.mjs → messages-LPVfA-8K.mjs} +14 -0
  135. package/dist/{chunks/messages-Cr-RJ7YB.mjs → messages-O5tQus_0.mjs} +14 -0
  136. package/dist/{messages-CbMyJSzS.mjs → messages-Q7AO_FLv.mjs} +17 -3
  137. package/dist/{messages-2_xedlYw.mjs → messages-R3hUSvr3.mjs} +15 -1
  138. package/dist/{chunks/messages-CUy1vn-b.mjs → messages-Xq8UmkVs.mjs} +14 -0
  139. package/dist/{messages-BBJgd5jG.mjs → messages-Z9nEU2xK.mjs} +16 -2
  140. package/dist/{messages-Cm9aLHeX.mjs → messages-_ErNTNhk.mjs} +15 -1
  141. package/dist/{messages-JZUhXTuV.mjs → messages-_ncGrKHh.mjs} +16 -2
  142. package/dist/{messages-ftMcCEuO.mjs → messages-kep5wtm4.mjs} +15 -1
  143. package/dist/{messages-DteYq0rv.mjs → messages-uKX8WBaD.mjs} +16 -2
  144. package/dist/{messages-Bdv-IkfG.mjs → messages-w7v1GNaE.mjs} +15 -1
  145. package/dist/tools.mjs +2005 -1267
  146. package/dist/vendor.LICENSE.txt +1 -1
  147. package/package.json +15 -14
  148. package/src/cli/commands/migration.ts +16 -0
  149. package/src/cli/commands/migrationContent.ts +6 -0
  150. package/src/cli/index.ts +47 -0
  151. package/src/cli/utils/output.ts +10 -0
  152. package/src/components/block-tunes/block-tune-delete.ts +3 -2
  153. package/src/components/blocks.ts +23 -6
  154. package/src/components/constants/data-attributes.ts +2 -0
  155. package/src/components/i18n/locales/am/messages.json +15 -1
  156. package/src/components/i18n/locales/ar/messages.json +14 -0
  157. package/src/components/i18n/locales/az/messages.json +14 -0
  158. package/src/components/i18n/locales/bg/messages.json +14 -0
  159. package/src/components/i18n/locales/bn/messages.json +25 -11
  160. package/src/components/i18n/locales/bs/messages.json +15 -1
  161. package/src/components/i18n/locales/cs/messages.json +14 -0
  162. package/src/components/i18n/locales/da/messages.json +14 -0
  163. package/src/components/i18n/locales/de/messages.json +14 -0
  164. package/src/components/i18n/locales/dv/messages.json +15 -1
  165. package/src/components/i18n/locales/el/messages.json +15 -1
  166. package/src/components/i18n/locales/en/messages.json +14 -0
  167. package/src/components/i18n/locales/es/messages.json +14 -0
  168. package/src/components/i18n/locales/et/messages.json +14 -0
  169. package/src/components/i18n/locales/fa/messages.json +15 -1
  170. package/src/components/i18n/locales/fi/messages.json +15 -1
  171. package/src/components/i18n/locales/fil/messages.json +20 -6
  172. package/src/components/i18n/locales/fr/messages.json +15 -1
  173. package/src/components/i18n/locales/gu/messages.json +15 -1
  174. package/src/components/i18n/locales/he/messages.json +14 -0
  175. package/src/components/i18n/locales/hi/messages.json +23 -9
  176. package/src/components/i18n/locales/hr/messages.json +14 -0
  177. package/src/components/i18n/locales/hu/messages.json +14 -0
  178. package/src/components/i18n/locales/hy/messages.json +16 -2
  179. package/src/components/i18n/locales/id/messages.json +19 -5
  180. package/src/components/i18n/locales/it/messages.json +14 -0
  181. package/src/components/i18n/locales/ja/messages.json +14 -0
  182. package/src/components/i18n/locales/ka/messages.json +15 -1
  183. package/src/components/i18n/locales/km/messages.json +16 -2
  184. package/src/components/i18n/locales/kn/messages.json +16 -2
  185. package/src/components/i18n/locales/ko/messages.json +14 -0
  186. package/src/components/i18n/locales/ku/messages.json +16 -2
  187. package/src/components/i18n/locales/lo/messages.json +15 -1
  188. package/src/components/i18n/locales/lt/messages.json +15 -1
  189. package/src/components/i18n/locales/lv/messages.json +15 -1
  190. package/src/components/i18n/locales/mk/messages.json +16 -2
  191. package/src/components/i18n/locales/ml/messages.json +16 -2
  192. package/src/components/i18n/locales/mn/messages.json +16 -2
  193. package/src/components/i18n/locales/mr/messages.json +24 -10
  194. package/src/components/i18n/locales/ms/messages.json +17 -3
  195. package/src/components/i18n/locales/my/messages.json +16 -2
  196. package/src/components/i18n/locales/ne/messages.json +24 -10
  197. package/src/components/i18n/locales/nl/messages.json +15 -1
  198. package/src/components/i18n/locales/no/messages.json +16 -2
  199. package/src/components/i18n/locales/pa/messages.json +15 -1
  200. package/src/components/i18n/locales/pl/messages.json +14 -0
  201. package/src/components/i18n/locales/ps/messages.json +17 -3
  202. package/src/components/i18n/locales/pt/messages.json +14 -0
  203. package/src/components/i18n/locales/ro/messages.json +15 -1
  204. package/src/components/i18n/locales/ru/messages.json +14 -0
  205. package/src/components/i18n/locales/sd/messages.json +16 -2
  206. package/src/components/i18n/locales/si/messages.json +23 -9
  207. package/src/components/i18n/locales/sk/messages.json +15 -1
  208. package/src/components/i18n/locales/sl/messages.json +16 -2
  209. package/src/components/i18n/locales/sq/messages.json +16 -2
  210. package/src/components/i18n/locales/sr/messages.json +16 -2
  211. package/src/components/i18n/locales/sv/messages.json +16 -2
  212. package/src/components/i18n/locales/sw/messages.json +16 -2
  213. package/src/components/i18n/locales/ta/messages.json +21 -7
  214. package/src/components/i18n/locales/te/messages.json +40 -26
  215. package/src/components/i18n/locales/th/messages.json +19 -5
  216. package/src/components/i18n/locales/tr/messages.json +15 -1
  217. package/src/components/i18n/locales/ug/messages.json +16 -2
  218. package/src/components/i18n/locales/uk/messages.json +15 -1
  219. package/src/components/i18n/locales/ur/messages.json +15 -1
  220. package/src/components/i18n/locales/vi/messages.json +25 -11
  221. package/src/components/i18n/locales/yi/messages.json +16 -2
  222. package/src/components/i18n/locales/zh/messages.json +15 -1
  223. package/src/components/icons/index.ts +104 -83
  224. package/src/components/modules/api/blocks.ts +35 -2
  225. package/src/components/modules/api/history.ts +64 -0
  226. package/src/components/modules/api/index.ts +2 -0
  227. package/src/components/modules/api/readonly.ts +11 -1
  228. package/src/components/modules/blockEvents/composers/markdownShortcuts.ts +12 -1
  229. package/src/components/modules/blockManager/blockManager.ts +7 -0
  230. package/src/components/modules/blockManager/operations.ts +3 -2
  231. package/src/components/modules/blockManager/types.ts +3 -1
  232. package/src/components/modules/blockManager/yjs-sync.ts +12 -2
  233. package/src/components/modules/index.ts +3 -0
  234. package/src/components/modules/normalizeInlineImages.ts +263 -0
  235. package/src/components/modules/readonly.ts +11 -0
  236. package/src/components/modules/rectangleSelection.ts +19 -3
  237. package/src/components/modules/saver.ts +7 -3
  238. package/src/components/modules/toolbar/blockSettings.ts +3 -3
  239. package/src/components/modules/toolbar/index.ts +72 -14
  240. package/src/components/modules/toolbar/plus-button.ts +24 -3
  241. package/src/components/modules/toolbar/settings-toggler.ts +3 -5
  242. package/src/components/modules/ui.ts +46 -68
  243. package/src/components/modules/uiControllers/controllers/blockHover.ts +49 -61
  244. package/src/components/modules/uiControllers/controllers/keyboard.ts +17 -11
  245. package/src/components/modules/uiControllers/handlers/click.ts +0 -12
  246. package/src/components/modules/yjs/index.ts +23 -0
  247. package/src/components/ui/toolbox.ts +41 -6
  248. package/src/components/utils/placeholder.ts +16 -0
  249. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +2 -1
  250. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +6 -1
  251. package/src/components/utils/popover/index.ts +1 -0
  252. package/src/components/utils/popover/popover-abstract.ts +11 -1
  253. package/src/components/utils/popover/popover-desktop.ts +27 -8
  254. package/src/components/utils/popover/popover-registry.ts +188 -0
  255. package/src/components/utils/sanitizer.ts +23 -2
  256. package/src/components/utils/tooltip.ts +2 -24
  257. package/src/styles/main.css +22 -0
  258. package/src/tools/paragraph/index.ts +12 -4
  259. package/src/tools/table/data-normalizer.ts +1 -0
  260. package/src/tools/table/index.ts +283 -346
  261. package/src/tools/table/table-add-controls.ts +353 -47
  262. package/src/tools/table/table-cell-blocks.ts +95 -7
  263. package/src/tools/table/table-cell-selection.ts +648 -0
  264. package/src/tools/table/table-core.ts +21 -32
  265. package/src/tools/table/table-grip-visuals.ts +96 -0
  266. package/src/tools/table/table-heading-toggle.ts +127 -0
  267. package/src/tools/table/table-operations.ts +475 -0
  268. package/src/tools/table/table-resize.ts +27 -6
  269. package/src/tools/table/table-restrictions.ts +64 -0
  270. package/src/tools/table/table-row-col-action-handler.ts +190 -0
  271. package/src/tools/table/table-row-col-controls.ts +265 -211
  272. package/src/tools/table/table-row-col-drag.ts +4 -4
  273. package/src/tools/table/table-row-col-popover.ts +225 -0
  274. package/src/tools/table/types.ts +4 -0
  275. package/src/types-internal/blok-modules.d.ts +2 -0
  276. package/types/api/blocks.d.ts +8 -0
  277. package/types/api/history.d.ts +33 -0
  278. package/types/api/index.d.ts +1 -0
  279. package/types/api/readonly.d.ts +12 -2
  280. package/types/index.d.ts +10 -0
  281. package/types/tools/table.d.ts +67 -0
  282. package/types/tools-entry.d.ts +4 -0
  283. package/types/utils/popover/popover-item.d.ts +6 -0
  284. package/types/utils/popover/popover.d.ts +7 -0
  285. package/dist/chunks/messages-CySyfkMU.mjs +0 -48
  286. package/dist/messages-CySyfkMU.mjs +0 -48
@@ -1,13 +1,13 @@
1
1
  // Cross/Close icon
2
2
  export const IconCross = `
3
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="m4.5 15 11-11m0 11L4.5 4" stroke="currentColor" stroke-linecap="round"/>
3
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <path d="m5 15 10-10m0 10L5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
5
5
  </svg>
6
6
  `;
7
7
 
8
8
  // Bold icon
9
9
  export const IconBold = `
10
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path
12
12
  d="M5.5 11h4.9231c.6528 0 1.2789-.3161 1.7405-.8787.4617-.56259.721-1.32565.721-2.1213 0-.79565-.2593-1.55871-.721-2.12132C11.702 5.31607 11.0759 5 10.4231 5H5.5v6Zm0 0h5.5385c.6528 0 1.2789.3161 1.7405.8787.4617.5626.721 1.3257.721 2.1213 0 .7956-.2593 1.5587-.721 2.1213-.4616.5626-1.0877.8787-1.7405.8787H5.5v-6Z"
13
13
  stroke="currentColor"
@@ -20,10 +20,11 @@ export const IconBold = `
20
20
 
21
21
  // Italic icon
22
22
  export const IconItalic = `
23
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
23
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
24
24
  <path
25
25
  d="M8.5 5h6m-10 12h6m1-12-4 12"
26
26
  stroke="currentColor"
27
+ stroke-width="1.25"
27
28
  stroke-linecap="round"
28
29
  stroke-linejoin="round"
29
30
  />
@@ -32,78 +33,70 @@ export const IconItalic = `
32
33
 
33
34
  // Link icon
34
35
  export const IconLink = `
35
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
36
- <path
37
- d="m9.98288 15.0959-.91628.9157c-.29867.3092-.65593.5559-1.05095.7255-.39502.1697-.81987.259-1.24978.2628-.4299.0037-.85625-.0782-1.25415-.241-.39791-.1628-.75941-.4032-1.06341-.7072-.304-.304-.54441-.6655-.70721-1.0634-.16279-.3979-.24471-.8243-.24098-1.2542.00374-.4299.09306-.8547.26274-1.2497.16969-.3951.41635-.7523.72558-1.051l.91499-.9163m8.24197.9156.9163-.9156c.6028-.60809.9402-1.43021.9383-2.28645-.0019-.85625-.3429-1.67688-.9483-2.28234-.6055-.60546-1.4261-.94643-2.2823-.9483-.8563-.00188-1.6784.3355-2.28652.9383l-.91628.91563M7.258 13.2413l4.5328-4.53278"
38
- stroke="currentColor"
39
- stroke-width=".784151"
40
- stroke-linecap="round"
41
- stroke-linejoin="round"
42
- />
36
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
37
+ <path d="M8.5 11.5a3.5 3.5 0 0 0 5 0l2-2a3.536 3.536 0 0 0-5-5l-1 1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
38
+ <path d="M11.5 8.5a3.5 3.5 0 0 0-5 0l-2 2a3.536 3.536 0 0 0 5 5l1-1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
43
39
  </svg>
44
40
  `;
45
41
 
46
42
  // Replace/Convert icon
47
43
  export const IconReplace = `
48
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
49
- <path
50
- d="M15.5 14.003h-3v-3.0004m-9-6.00078h3v3.0004m1.55478-3.80901A5.2170862 5.2170862 0 0 1 9.5 4.00014c1.1682.00058 2.3059.37321 3.2481 1.06388.9422.69067 1.64 1.66348 1.9923 2.77744.3523 1.11396.3407 2.31114-.033 3.41814-.3738 1.1069-1.0903 2.0661-2.0457 2.7384m-1.7165.8088c-.4703.1317-.9568.1967-1.4452.1931-1.16819-.0006-2.30585-.3733-3.24807-1.0639-.94222-.6907-1.64004-1.6635-1.99232-2.7775-.35229-1.1139-.34072-2.31114.03302-3.41808.37375-1.10694 1.09024-2.06608 2.04563-2.73841"
51
- stroke="currentColor"
52
- stroke-miterlimit="10"
53
- stroke-linecap="round"
54
- />
44
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
45
+ <path d="M14.5 6.5l2-2-2-2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
46
+ <path d="M16.5 4.5h-4a5 5 0 0 0-5 5v1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
47
+ <path d="M5.5 13.5l-2 2 2 2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
48
+ <path d="M3.5 15.5h4a5 5 0 0 0 5-5v-1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
55
49
  </svg>
56
50
  `;
57
51
 
58
- // Menu icon
52
+ // Menu icon (6-dot grip)
59
53
  export const IconMenu = `
60
- <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
- <path
62
- d="M8 6c0-.55228.44772-1 1-1s1 .44772 1 1-.44772 1-1 1-1-.44772-1-1Zm0 6c0-.5523.44772-1 1-1s1 .4477 1 1-.44772 1-1 1-1-.4477-1-1Zm0 6c0-.5523.44772-1 1-1s1 .4477 1 1-.44772 1-1 1-1-.4477-1-1Zm6-12c0-.55228.4477-1 1-1s1 .44772 1 1-.4477 1-1 1-1-.44772-1-1Zm0 6c0-.5523.4477-1 1-1s1 .4477 1 1-.4477 1-1 1-1-.4477-1-1Zm0 6c0-.5523.4477-1 1-1s1 .4477 1 1-.4477 1-1 1-1-.4477-1-1Z"
63
- fill="currentColor"
64
- />
54
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
55
+ <circle cx="7.5" cy="5.5" r="1" fill="currentColor"/>
56
+ <circle cx="12.5" cy="5.5" r="1" fill="currentColor"/>
57
+ <circle cx="7.5" cy="10" r="1" fill="currentColor"/>
58
+ <circle cx="12.5" cy="10" r="1" fill="currentColor"/>
59
+ <circle cx="7.5" cy="14.5" r="1" fill="currentColor"/>
60
+ <circle cx="12.5" cy="14.5" r="1" fill="currentColor"/>
65
61
  </svg>
66
62
  `;
67
63
 
68
64
  // Plus/Add icon
69
65
  export const IconPlus = `
70
- <svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
71
- <path d="M4.5 11.0711h14.1421m-7.071 7.071V4" stroke="currentColor" stroke-linecap="round"/>
66
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
67
+ <path d="M4.5 10h11M10 4.5v11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
72
68
  </svg>
73
69
  `;
74
70
 
75
71
  // Chevron Left icon
76
72
  export const IconChevronLeft = `
77
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
78
- <path d="m12.5 5-5 5 5 5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
73
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
74
+ <path d="m12 5-5 5 5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
79
75
  </svg>
80
76
  `;
81
77
 
82
78
  // Chevron Right icon
83
79
  export const IconChevronRight = `
84
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
85
- <path d="m7.5 15 5-5-5-5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
80
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
81
+ <path d="m8 5 5 5-5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
86
82
  </svg>
87
83
  `;
88
84
 
89
85
  // Search icon
90
86
  export const IconSearch = `
91
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
92
- <path
93
- d="m17.5 17.5-5-5m1.6667-4.16667c0 .76605-.1509 1.52459-.4441 2.23237-.2931.7077-.7228 1.3507-1.2645 1.8924-.5417.5417-1.1847.9714-1.8924 1.2645-.70778.2932-1.46632.4441-2.23237.4441-.76604 0-1.52458-.1509-2.23232-.4441-.70773-.2931-1.35079-.7228-1.89247-1.2645-.54167-.5417-.97135-1.1847-1.2645-1.8924C2.65088 9.85792 2.5 9.09938 2.5 8.33333c0-1.54709.61458-3.03082 1.70854-4.12479C5.30251 3.11458 6.78624 2.5 8.33333 2.5c1.5471 0 3.03087.61458 4.12477 1.70854 1.094 1.09397 1.7086 2.5777 1.7086 4.12479Z"
94
- stroke="currentColor"
95
- stroke-linecap="round"
96
- stroke-linejoin="round"
97
- />
87
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
88
+ <circle cx="9" cy="9" r="4.5" stroke="currentColor" stroke-width="1.25"/>
89
+ <path d="m12.5 12.5 3.5 3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
98
90
  </svg>
99
91
  `;
100
92
 
101
93
  // Heading 1 icon
102
94
  export const IconH1 = `
103
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
95
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
104
96
  <path
105
97
  d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 5 2.5-1.66667V15"
106
98
  stroke="currentColor"
99
+ stroke-width="1.25"
107
100
  stroke-linecap="round"
108
101
  stroke-linejoin="round"
109
102
  />
@@ -112,10 +105,11 @@ export const IconH1 = `
112
105
 
113
106
  // Heading 2 icon
114
107
  export const IconH2 = `
115
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
108
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
116
109
  <path
117
110
  d="M3.33334 10H10m-6.66666 5V5M10 15V5m7.5 10h-3.3333c0-3.3333 3.3333-2.5 3.3333-5 0-1.25-1.6667-2.08333-3.3333-.83333"
118
111
  stroke="currentColor"
112
+ stroke-width="1.25"
119
113
  stroke-linecap="round"
120
114
  stroke-linejoin="round"
121
115
  />
@@ -124,10 +118,11 @@ export const IconH2 = `
124
118
 
125
119
  // Heading 3 icon
126
120
  export const IconH3 = `
127
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
121
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
128
122
  <path
129
123
  d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.5833 3.75C16 7.91667 17.5 8.75 17.5 10c0 .442-.1756.866-.4882 1.1785-.3125.3126-.7364.4882-1.1785.4882.4421 0 .866.1756 1.1785.4881.3126.3126.4882.7365.4882 1.1785 0 1.5-1.6667 2.5-3.3333 1.25"
130
124
  stroke="currentColor"
125
+ stroke-width="1.25"
131
126
  stroke-linecap="round"
132
127
  stroke-linejoin="round"
133
128
  />
@@ -139,7 +134,8 @@ export const IconH4 = `
139
134
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
140
135
  <path
141
136
  d="M10 15V5M14.1667 8.33333V10.8333C14.1667 11.0543 14.2545 11.2663 14.4107 11.4226C14.567 11.5789 14.779 11.6667 15 11.6667H17.5M17.5 8.33333V15M3.33334 10H10M3.33334 15V5"
142
- stroke="black"
137
+ stroke="currentColor"
138
+ stroke-width="1.25"
143
139
  stroke-linecap="round"
144
140
  stroke-linejoin="round"
145
141
  />
@@ -151,7 +147,8 @@ export const IconH5 = `
151
147
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
152
148
  <path
153
149
  d="M3.33334 10H10M3.33334 15V5M10 15V5M17.5 8.33333H14.1667V10.8333H15.25C16.5 10.8333 17.5 11.75 17.5 12.9167C17.5 14.0833 16.5 15 15.25 15C14.8333 15 14.5 14.9167 14.1667 14.75"
154
- stroke="black"
150
+ stroke="currentColor"
151
+ stroke-width="1.25"
155
152
  stroke-linecap="round"
156
153
  stroke-linejoin="round"
157
154
  />
@@ -160,22 +157,24 @@ export const IconH5 = `
160
157
 
161
158
  // Heading 6 icon
162
159
  export const IconH6 = `
163
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
160
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
164
161
  <path
165
162
  d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 8.3333c0 .9205.7462 1.6667 1.6666 1.6667.9205 0 1.6667-.7462 1.6667-1.6667 0-.9204-.7462-1.6666-1.6667-1.6666-.9204 0-1.6666.7462-1.6666 1.6666Zm0 0c0-2.0833.8333-3.3333 2.5-4.99997"
166
163
  stroke="currentColor"
164
+ stroke-width="1.25"
167
165
  stroke-linecap="round"
168
166
  stroke-linejoin="round"
169
167
  />
170
168
  </svg>
171
169
  `;
172
170
 
173
- // Heading i)
171
+ // Heading icon
174
172
  export const IconHeading = `
175
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
173
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
176
174
  <path
177
175
  d="M6.5 10h6.6667M6.5 15V5m6.6667 10V5"
178
176
  stroke="currentColor"
177
+ stroke-width="1.25"
179
178
  stroke-linecap="round"
180
179
  stroke-linejoin="round"
181
180
  />
@@ -184,10 +183,11 @@ export const IconHeading = `
184
183
 
185
184
  // Text/Paragraph icon
186
185
  export const IconText = `
187
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
186
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
188
187
  <path
189
188
  d="M14.5 7.28571V6h-9v1.28571M10 6v9m0 0H8.71429M10 15h1.2857"
190
189
  stroke="currentColor"
190
+ stroke-width="1.25"
191
191
  stroke-linecap="round"
192
192
  stroke-linejoin="round"
193
193
  />
@@ -196,25 +196,19 @@ export const IconText = `
196
196
 
197
197
  // Warning icon
198
198
  export const IconWarning = `
199
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
200
- <path
201
- d="M18.5667 18H1.5l8.5333-16 8.5334 16Z"
202
- stroke="currentColor"
203
- stroke-width="1.06667"
204
- stroke-linecap="round"
205
- stroke-linejoin="round"
206
- />
207
- <rect x="9.75" y="14.25" width=".5" height=".5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
208
- <rect x="9.75" y="8.25" width=".5" height="4.5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
199
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
200
+ <path d="M10 4 3 16h14Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
201
+ <path d="M10 8.5v3.5m0 2v.01" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
209
202
  </svg>
210
203
  `;
211
204
 
212
205
  // Bulleted List icon
213
206
  export const IconListBulleted = `
214
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
207
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
215
208
  <path
216
209
  d="M8 5h9M8 10h9M8 15h9M4 5h.01M4 10h.01M4 15h.01"
217
210
  stroke="currentColor"
211
+ stroke-width="1.25"
218
212
  stroke-linecap="round"
219
213
  stroke-linejoin="round"
220
214
  />
@@ -223,17 +217,24 @@ export const IconListBulleted = `
223
217
 
224
218
  // Numbered List icon
225
219
  export const IconListNumbered = `
226
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
227
- <path d="M7.90873 4.60317h9.61907M4.70238 6.20635V3L3.5 4.20238m1.60317 7.61512H3.5l1.52702-2.37514c.02625-.03721.04486-.07925.05477-.12369.0099-.04444.01091-.09039.00295-.13523-.04569-.2068-.20922-.57233-.78315-.57233-.80159 0-.80159.71261-.80159.71261v.17795m0 7.92693h.80159c.21259 0 .41648-.0845.56681-.2348.15032-.1503.23477-.3542.23477-.5668 0-.2126-.08445-.4165-.23477-.5668-.15033-.1503-.35422-.2348-.56681-.2348h-.4008l1.20238-1.6032H3.5m4.40873-4.0079h9.61907m-9.61907 5.6111h9.61907" stroke="#000" stroke-width=".841667" stroke-linecap="round" stroke-linejoin="round"/>
220
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
221
+ <path
222
+ d="M8 5h9M8 10h9M8 15h9M3.5 4.5l1-1v3M3.5 9.5a1 1 0 1 1 2 0c0 .75-2 1.25-2 2h2M3.5 13.5h1a.75.75 0 0 1 0 1.5.75.75 0 0 1 0 1.5h-1"
223
+ stroke="currentColor"
224
+ stroke-width="1.25"
225
+ stroke-linecap="round"
226
+ stroke-linejoin="round"
227
+ />
228
228
  </svg>
229
229
  `;
230
230
 
231
231
  // Checklist icon
232
232
  export const IconListChecklist = `
233
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
233
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
234
234
  <path
235
235
  d="M10 5h7M10 10h7M10 15h7M3 5l1 1 2-2M3 10l1 1 2-2M3 15l1 1 2-2"
236
236
  stroke="currentColor"
237
+ stroke-width="1.25"
237
238
  stroke-linecap="round"
238
239
  stroke-linejoin="round"
239
240
  />
@@ -242,72 +243,92 @@ export const IconListChecklist = `
242
243
 
243
244
  // Table icon
244
245
  export const IconTable = `
245
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
246
- <path d="M3 4h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z" stroke="currentColor" stroke-width="1.25"/>
247
- <path d="M2 8h16M2 12h16M7 4v12M13 4v12" stroke="currentColor" stroke-width="1.25"/>
246
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
247
+ <rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
248
+ <path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
249
+ </svg>
250
+ `;
251
+
252
+ // Table with highlighted top row (header row)
253
+ export const IconHeaderRow = `
254
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
255
+ <path d="M4.5 4h11A1.5 1.5 0 0 1 17 5.5V8H3V5.5A1.5 1.5 0 0 1 4.5 4Z" fill="currentColor"/>
256
+ <rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
257
+ <path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
258
+ </svg>
259
+ `;
260
+
261
+ // Table with highlighted left column (header column)
262
+ export const IconHeaderColumn = `
263
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
264
+ <path d="M4.5 4H7.5v12H4.5A1.5 1.5 0 0 1 3 14.5v-9A1.5 1.5 0 0 1 4.5 4Z" fill="currentColor"/>
265
+ <rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
266
+ <path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
248
267
  </svg>
249
268
  `;
250
269
 
251
270
  // Insert row above icon
252
271
  export const IconInsertAbove = `
253
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
254
- <path d="M10 3v6m-3-3h6M4 13h12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
272
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
273
+ <path d="M10 4l-3 3m3-3l3 3M10 4v7M5 16h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
255
274
  </svg>
256
275
  `;
257
276
 
258
277
  // Insert row below icon
259
278
  export const IconInsertBelow = `
260
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
261
- <path d="M10 17v-6m-3 3h6M4 7h12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
279
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
280
+ <path d="M10 16l-3-3m3 3l3-3M10 16V9M5 4h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
262
281
  </svg>
263
282
  `;
264
283
 
265
284
  // Insert column left icon
266
285
  export const IconInsertLeft = `
267
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
268
- <path d="M3 10h6M6 7v6M13 4v12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
286
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
287
+ <path d="M4 10l3-3M4 10l3 3M4 10h7M16 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
269
288
  </svg>
270
289
  `;
271
290
 
272
291
  // Insert column right icon
273
292
  export const IconInsertRight = `
274
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
275
- <path d="M17 10h-6m3-3v6M7 4v12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
293
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
294
+ <path d="M16 10l-3-3m3 3l-3 3M16 10H9M4 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
276
295
  </svg>
277
296
  `;
278
297
 
279
298
  // Move up icon
280
299
  export const IconMoveUp = `
281
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
282
- <path d="M10 16V4m0 0-4 4m4-4 4 4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
300
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
301
+ <path d="M10 16V4m0 0-3 3m3-3 3 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
283
302
  </svg>
284
303
  `;
285
304
 
286
305
  // Move down icon
287
306
  export const IconMoveDown = `
288
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
289
- <path d="M10 4v12m0 0 4-4m-4 4-4-4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
307
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
308
+ <path d="M10 4v12m0 0 3-3m-3 3-3-3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
290
309
  </svg>
291
310
  `;
292
311
 
293
312
  // Move left icon
294
313
  export const IconMoveLeft = `
295
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
296
- <path d="M16 10H4m0 0 4-4M4 10l4 4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
314
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
315
+ <path d="M16 10H4m0 0 3-3M4 10l3 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
297
316
  </svg>
298
317
  `;
299
318
 
300
319
  // Move right icon
301
320
  export const IconMoveRight = `
302
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
303
- <path d="M4 10h12m0 0-4-4m4 4-4 4" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
321
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
322
+ <path d="M4 10h12m0 0-3-3m3 3-3 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
304
323
  </svg>
305
324
  `;
306
325
 
307
326
  // Trash/Delete icon
308
327
  export const IconTrash = `
309
- <svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
310
- <path d="M5 6h10m-1 0v9a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V6m2 0V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
328
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
329
+ <path d="M4.5 6.5h11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
330
+ <path d="M8 6.5V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
331
+ <path d="M6.5 6.5l.5 8.5a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1l.5-8.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
332
+ <path d="M8.5 9.5v3.5M11.5 9.5v3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
311
333
  </svg>
312
334
  `;
313
-
@@ -1,6 +1,7 @@
1
1
  import type { BlockToolData, OutputBlockData, OutputData, ToolConfig } from '../../../../types';
2
2
  import type { BlockAPI as BlockAPIInterface, Blocks } from '../../../../types/api';
3
3
  import type { BlockTuneData } from '../../../../types/block-tunes/block-tune-data';
4
+ import { isInsideTableCell, isRestrictedInTableCell } from '../../../tools/table/table-restrictions';
4
5
  import { Module } from '../../__module';
5
6
  import { Block } from '../../block';
6
7
  import { BlockAPI } from '../../block/api';
@@ -37,6 +38,7 @@ export class BlocksAPI extends Module {
37
38
  update: this.update,
38
39
  composeBlockData: this.composeBlockData,
39
40
  convert: this.convert,
41
+ setBlockParent: (blockId: string, parentId: string | null): void => this.setBlockParent(blockId, parentId),
40
42
  stopBlockMutationWatching: (index: number): void => this.stopBlockMutationWatching(index),
41
43
  splitBlock: this.splitBlock,
42
44
  };
@@ -114,7 +116,7 @@ export class BlocksAPI extends Module {
114
116
  const block = this.Blok.BlockManager.getBlock(element);
115
117
 
116
118
  if (block === undefined) {
117
- logLabeled(`There is no block corresponding to element <${element.tagName.toLowerCase()}>`, 'warn');
119
+ logLabeled(`There is no block corresponding to element <${element.tagName?.toLowerCase() ?? 'unknown'}>`, 'warn');
118
120
 
119
121
  return;
120
122
  }
@@ -242,7 +244,21 @@ export class BlocksAPI extends Module {
242
244
  replace?: boolean,
243
245
  id?: string
244
246
  ): BlockAPIInterface => {
245
- const tool = type ?? (this.config.defaultBlock);
247
+ const defaultTool = type ?? (this.config.defaultBlock);
248
+ const tool = (() => {
249
+ if (!defaultTool) {
250
+ return defaultTool;
251
+ }
252
+
253
+ const targetIndex = index ?? this.Blok.BlockManager.currentBlockIndex;
254
+ const targetBlock = this.Blok.BlockManager.getBlockByIndex(targetIndex);
255
+
256
+ if (targetBlock !== undefined && isInsideTableCell(targetBlock) && isRestrictedInTableCell(defaultTool)) {
257
+ return 'paragraph';
258
+ }
259
+
260
+ return defaultTool;
261
+ })();
246
262
 
247
263
  const insertedBlock = this.Blok.BlockManager.insert({
248
264
  id,
@@ -361,6 +377,23 @@ export class BlocksAPI extends Module {
361
377
  return blocksToInsert.map((block) => new BlockAPI(block));
362
378
  };
363
379
 
380
+ /**
381
+ * Sets the parent of a block, updating both the block's parentId and the parent's contentIds.
382
+ * @param blockId - id of the block to reparent
383
+ * @param parentId - id of the new parent block, or null for root level
384
+ */
385
+ private setBlockParent(blockId: string, parentId: string | null): void {
386
+ const block = this.Blok.BlockManager.getBlockById(blockId);
387
+
388
+ if (block === undefined) {
389
+ logLabeled('There is no block with id `' + blockId + '`', 'warn');
390
+
391
+ return;
392
+ }
393
+
394
+ this.Blok.BlockManager.setBlockParent(block, parentId);
395
+ }
396
+
364
397
  /**
365
398
  * Stops mutation watching on a block at the specified index.
366
399
  * This is used to prevent spurious block-changed events during block replacement.
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @module HistoryAPI
3
+ * @copyright <CodeX> 2018
4
+ *
5
+ * Provides public methods for undo/redo operations
6
+ */
7
+ import type { History } from '../../../../types/api';
8
+ import { Module } from '../../__module';
9
+
10
+ /**
11
+ * @class HistoryAPI
12
+ */
13
+ export class HistoryAPI extends Module {
14
+ /**
15
+ * Available methods
16
+ * @returns {History}
17
+ */
18
+ public get methods(): History {
19
+ return {
20
+ undo: (): void => this.undo(),
21
+ redo: (): void => this.redo(),
22
+ canUndo: (): boolean => this.canUndo(),
23
+ canRedo: (): boolean => this.canRedo(),
24
+ clear: (): void => this.clear(),
25
+ };
26
+ }
27
+
28
+ /**
29
+ * Undo the last operation
30
+ */
31
+ public undo(): void {
32
+ this.Blok.YjsManager.undo();
33
+ }
34
+
35
+ /**
36
+ * Redo the last undone operation
37
+ */
38
+ public redo(): void {
39
+ this.Blok.YjsManager.redo();
40
+ }
41
+
42
+ /**
43
+ * Check if undo is available
44
+ * @returns {boolean} true if undo is available
45
+ */
46
+ public canUndo(): boolean {
47
+ return this.Blok.YjsManager.canUndo();
48
+ }
49
+
50
+ /**
51
+ * Check if redo is available
52
+ * @returns {boolean} true if redo is available
53
+ */
54
+ public canRedo(): boolean {
55
+ return this.Blok.YjsManager.canRedo();
56
+ }
57
+
58
+ /**
59
+ * Clear all history
60
+ */
61
+ public clear(): void {
62
+ this.Blok.YjsManager.clear();
63
+ }
64
+ }
@@ -21,6 +21,7 @@ export class API extends Module {
21
21
  caret: this.Blok.CaretAPI.methods,
22
22
  tools: this.Blok.ToolsAPI.methods,
23
23
  events: this.Blok.EventsAPI.methods,
24
+ history: this.Blok.HistoryAPI.methods,
24
25
  listeners: this.Blok.ListenersAPI.methods,
25
26
  notifier: this.Blok.NotifierAPI.methods,
26
27
  sanitizer: this.Blok.SanitizerAPI.methods,
@@ -33,6 +34,7 @@ export class API extends Module {
33
34
  i18n: this.Blok.I18nAPI.methods,
34
35
  readOnly: this.Blok.ReadOnlyAPI.methods,
35
36
  ui: this.Blok.UiAPI.methods,
37
+ rectangleSelection: this.Blok.RectangleSelection,
36
38
  };
37
39
  }
38
40
  }
@@ -12,9 +12,10 @@ export class ReadOnlyAPI extends Module {
12
12
  public get methods(): ReadOnly {
13
13
  const getIsEnabled = (): boolean => this.isEnabled;
14
14
 
15
-
15
+
16
16
  return {
17
17
  toggle: (state): Promise<boolean> => this.toggle(state),
18
+ set: (state): Promise<boolean> => this.set(state),
18
19
  get isEnabled(): boolean {
19
20
  return getIsEnabled();
20
21
  },
@@ -30,6 +31,15 @@ export class ReadOnlyAPI extends Module {
30
31
  return this.Blok.ReadOnly.toggle(state);
31
32
  }
32
33
 
34
+ /**
35
+ * Set read-only mode to the specified boolean state
36
+ * @param {boolean} state - read-only state to set
37
+ * @returns {Promise<boolean>} the new read-only state
38
+ */
39
+ public set(state: boolean): Promise<boolean> {
40
+ return this.Blok.ReadOnly.set(state);
41
+ }
42
+
33
43
  /**
34
44
  * Returns current read-only state
35
45
  */
@@ -153,7 +153,18 @@ export class MarkdownShortcuts extends BlockEventComposer {
153
153
  const { BlockManager, Tools } = this.Blok;
154
154
  const currentBlock = BlockManager.currentBlock;
155
155
 
156
- if (!currentBlock?.tool.isDefault) {
156
+ if (!currentBlock) {
157
+ return false;
158
+ }
159
+
160
+ // Check if inside table cell
161
+ const isInsideTableCell = currentBlock.holder.closest('[data-blok-table-cell-blocks]') !== null;
162
+
163
+ if (isInsideTableCell) {
164
+ return false; // Don't convert to header
165
+ }
166
+
167
+ if (!currentBlock.tool.isDefault) {
157
168
  return false;
158
169
  }
159
170
 
@@ -7,6 +7,7 @@
7
7
  import type { BlockToolData, OutputBlockData, PasteEvent } from '../../../../types';
8
8
  import type { BlockTuneData } from '../../../../types/block-tunes/block-tune-data';
9
9
  import type { BlockMutationEventMap, BlockMutationType } from '../../../../types/events/block';
10
+ import { BlockAddedMutationType } from '../../../../types/events/block/BlockAdded';
10
11
  import { BlockChangedMutationType } from '../../../../types/events/block/BlockChanged';
11
12
  import { BlockRemovedMutationType } from '../../../../types/events/block/BlockRemoved';
12
13
  import { Module } from '../../__module';
@@ -307,6 +308,12 @@ export class BlockManager extends Module {
307
308
  replaceBlock: (index, newBlock) => {
308
309
  this.blocksStore.replace(index, newBlock);
309
310
  },
311
+ onBlockRemoved: (block, index) => {
312
+ this.blockDidMutated(BlockRemovedMutationType, block, { index });
313
+ },
314
+ onBlockAdded: (block, index) => {
315
+ this.blockDidMutated(BlockAddedMutationType, block, { index });
316
+ },
310
317
  },
311
318
  this.blocksStore
312
319
  );