@jackuait/blok 0.7.0-beta.1 → 0.7.0-beta.3

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 (256) hide show
  1. package/README.md +20 -4
  2. package/dist/blok.mjs +2 -2
  3. package/dist/chunks/{blok-ob9Fwr1L.mjs → blok-BlyYiZTm.mjs} +1840 -1654
  4. package/dist/chunks/{inline-tool-convert-CvFW2iie.mjs → constants-DEy4jBO5.mjs} +316 -297
  5. package/dist/chunks/{i18next-loader-Bu3vFvye.mjs → i18next-loader-Cfbv-x6v.mjs} +1 -1
  6. package/dist/chunks/index-Cu1w-sLZ.mjs +130 -0
  7. package/dist/chunks/{messages-D2NOpHn9.mjs → messages-0Pxnqd4N.mjs} +7 -0
  8. package/dist/chunks/{messages-GSByFygY.mjs → messages-0ZXYUq7S.mjs} +7 -0
  9. package/dist/{messages-BUl_Rcnj.mjs → chunks/messages-2OD2uUDS.mjs} +9 -2
  10. package/dist/{messages-CgTq3QhU.mjs → chunks/messages-7cEMfYzh.mjs} +7 -0
  11. package/dist/{messages-DlJbPF2T.mjs → chunks/messages-8mwfda1Q.mjs} +7 -0
  12. package/dist/{messages-D9ndgBnU.mjs → chunks/messages-B-FqWsBM.mjs} +7 -0
  13. package/dist/{messages-B217znr-.mjs → chunks/messages-B1jzqWiQ.mjs} +7 -0
  14. package/dist/{messages-BcpCubnC.mjs → chunks/messages-B5wk4Ezz.mjs} +7 -0
  15. package/dist/chunks/{messages-DRXWF0PV.mjs → messages-BAZ5Ld8x.mjs} +7 -0
  16. package/dist/{messages-CRJ_mchV.mjs → chunks/messages-BBhGp198.mjs} +7 -0
  17. package/dist/chunks/{messages-yHcs38yI.mjs → messages-BC9IjIb7.mjs} +7 -0
  18. package/dist/chunks/{messages-Cr94GzbX.mjs → messages-BFEmpeV-.mjs} +7 -0
  19. package/dist/chunks/{messages-ucTVgS5G.mjs → messages-BGqzTZy0.mjs} +7 -0
  20. package/dist/{messages-begYOTgC.mjs → chunks/messages-BICs1abK.mjs} +7 -0
  21. package/dist/chunks/{messages-DVQvl8Qj.mjs → messages-BJX6rOnd.mjs} +7 -0
  22. package/dist/chunks/{messages-Chb7k3Rg.mjs → messages-BL2bXRhN.mjs} +7 -0
  23. package/dist/{messages-Phkd7XmE.mjs → chunks/messages-BMs5qdlH.mjs} +7 -0
  24. package/dist/chunks/{messages-Cjjo7yHR.mjs → messages-BRsjUNwB.mjs} +7 -0
  25. package/dist/chunks/{messages-D4qqwVgQ.mjs → messages-BSqV8OUR.mjs} +7 -0
  26. package/dist/chunks/{messages-DviiFSv2.mjs → messages-BTqu3DfG.mjs} +7 -0
  27. package/dist/chunks/{messages-0AbcLMLm.mjs → messages-BXnDEsur.mjs} +7 -0
  28. package/dist/{messages-CmR9ftc_.mjs → chunks/messages-BYcre4-6.mjs} +7 -0
  29. package/dist/{messages-wmi-iFkH.mjs → chunks/messages-BZ9LRJf-.mjs} +7 -0
  30. package/dist/chunks/{messages-D00x4S8o.mjs → messages-BgypBy7y.mjs} +7 -0
  31. package/dist/{messages-96kNZDll.mjs → chunks/messages-BsuGf70G.mjs} +7 -0
  32. package/dist/chunks/{messages-v3GipbFl.mjs → messages-BwaoF4lQ.mjs} +7 -0
  33. package/dist/{messages-DDTQgImT.mjs → chunks/messages-C1l8_7-y.mjs} +7 -0
  34. package/dist/{messages-B1FZ8lxU.mjs → chunks/messages-C5NA_r9v.mjs} +7 -0
  35. package/dist/{messages-Cs8zmZ3L.mjs → chunks/messages-C6zgZ5pA.mjs} +7 -0
  36. package/dist/chunks/{messages-ZjUAIWb1.mjs → messages-CAo5ghFI.mjs} +7 -0
  37. package/dist/{messages-D5S1Dnpm.mjs → chunks/messages-CH9qlJ9I.mjs} +7 -0
  38. package/dist/{messages-D7u2bmP2.mjs → chunks/messages-CI0HqAeS.mjs} +7 -0
  39. package/dist/{messages-DH_jBeED.mjs → chunks/messages-CJJtms9k.mjs} +7 -0
  40. package/dist/{messages-CDBLbUOQ.mjs → chunks/messages-CM2hJqk6.mjs} +7 -0
  41. package/dist/chunks/{messages-8IPXkrDl.mjs → messages-CRMiDPIQ.mjs} +7 -0
  42. package/dist/chunks/{messages-Dzzn6XoD.mjs → messages-CWsZuBj1.mjs} +7 -0
  43. package/dist/chunks/{messages-CW4c4cRk.mjs → messages-C_gLHo6A.mjs} +7 -0
  44. package/dist/{messages-CH4hrauY.mjs → chunks/messages-Cbu-NUDn.mjs} +7 -0
  45. package/dist/{messages-RonBBCnh.mjs → chunks/messages-Cjb_MCeh.mjs} +7 -0
  46. package/dist/chunks/{messages-BJ6zrz2j.mjs → messages-ClXYO9Wn.mjs} +7 -0
  47. package/dist/chunks/{messages-CrCYPCk3.mjs → messages-CsH20vhP.mjs} +7 -0
  48. package/dist/{messages-CzK0LEhb.mjs → chunks/messages-CsjAGhzA.mjs} +7 -0
  49. package/dist/chunks/{messages-BZlmVRwn.mjs → messages-Cx7VKFOE.mjs} +7 -0
  50. package/dist/chunks/{messages-0E0AkrNu.mjs → messages-D3JeBwxo.mjs} +7 -0
  51. package/dist/chunks/{messages-D85FqxgY.mjs → messages-D541fieJ.mjs} +7 -0
  52. package/dist/{messages-4v4MuVEc.mjs → chunks/messages-D7XPdglc.mjs} +7 -0
  53. package/dist/{messages-BC8IN4Bf.mjs → chunks/messages-DBhylfvt.mjs} +7 -0
  54. package/dist/chunks/{messages-B8WNljW3.mjs → messages-DCA120lW.mjs} +7 -0
  55. package/dist/chunks/{messages-Cr49Nt3U.mjs → messages-DCf_xZMN.mjs} +7 -0
  56. package/dist/chunks/{messages-VDriF5Qy.mjs → messages-DDwXKCpe.mjs} +7 -0
  57. package/dist/{messages-b1EdvUm0.mjs → chunks/messages-DNKDlxcy.mjs} +7 -0
  58. package/dist/{messages-L_kl2Qvh.mjs → chunks/messages-DPvEjrGK.mjs} +7 -0
  59. package/dist/chunks/{messages-62v-CLC-.mjs → messages-DQ-AkNxA.mjs} +7 -0
  60. package/dist/chunks/{messages-DdK-nFGm.mjs → messages-DVuvkNap.mjs} +7 -0
  61. package/dist/{messages-DnVlmiNT.mjs → chunks/messages-DaglyqUT.mjs} +7 -0
  62. package/dist/{messages-Bm-E4iRC.mjs → chunks/messages-Di0bAfwA.mjs} +7 -0
  63. package/dist/{messages-D1mn7Zd5.mjs → chunks/messages-DuLct0Yr.mjs} +7 -0
  64. package/dist/{messages-8DeO60Oo.mjs → chunks/messages-DzEYYhZh.mjs} +7 -0
  65. package/dist/chunks/{messages-CfiyT2Wi.mjs → messages-DznNGAB2.mjs} +7 -0
  66. package/dist/chunks/{messages-DXktiao_.mjs → messages-DzoIzyu8.mjs} +7 -0
  67. package/dist/{messages-C_4otP7U.mjs → chunks/messages-QYOGmket.mjs} +7 -0
  68. package/dist/chunks/{messages-nefz1S71.mjs → messages-cEjGDAgI.mjs} +7 -0
  69. package/dist/chunks/{messages-jrncnb-H.mjs → messages-ddhvrdpE.mjs} +7 -0
  70. package/dist/chunks/{messages-DzqM3Fel.mjs → messages-mwfNK5nZ.mjs} +7 -0
  71. package/dist/chunks/{messages-Cl6ayUaq.mjs → messages-nG_vNDte.mjs} +7 -0
  72. package/dist/{messages-C4jL-90N.mjs → chunks/messages-tDq3Owh7.mjs} +7 -0
  73. package/dist/{messages-BI43k_BD.mjs → chunks/messages-x6VJVZKx.mjs} +7 -0
  74. package/dist/full.mjs +2 -2
  75. package/dist/locales.mjs +87 -80
  76. package/dist/{messages-D2NOpHn9.mjs → messages-0Pxnqd4N.mjs} +7 -0
  77. package/dist/{messages-GSByFygY.mjs → messages-0ZXYUq7S.mjs} +7 -0
  78. package/dist/{chunks/messages-BUl_Rcnj.mjs → messages-2OD2uUDS.mjs} +9 -2
  79. package/dist/{chunks/messages-CgTq3QhU.mjs → messages-7cEMfYzh.mjs} +7 -0
  80. package/dist/{chunks/messages-DlJbPF2T.mjs → messages-8mwfda1Q.mjs} +7 -0
  81. package/dist/{chunks/messages-D9ndgBnU.mjs → messages-B-FqWsBM.mjs} +7 -0
  82. package/dist/{chunks/messages-B217znr-.mjs → messages-B1jzqWiQ.mjs} +7 -0
  83. package/dist/{chunks/messages-BcpCubnC.mjs → messages-B5wk4Ezz.mjs} +7 -0
  84. package/dist/{messages-DRXWF0PV.mjs → messages-BAZ5Ld8x.mjs} +7 -0
  85. package/dist/{chunks/messages-CRJ_mchV.mjs → messages-BBhGp198.mjs} +7 -0
  86. package/dist/{messages-yHcs38yI.mjs → messages-BC9IjIb7.mjs} +7 -0
  87. package/dist/{messages-Cr94GzbX.mjs → messages-BFEmpeV-.mjs} +7 -0
  88. package/dist/{messages-ucTVgS5G.mjs → messages-BGqzTZy0.mjs} +7 -0
  89. package/dist/{chunks/messages-begYOTgC.mjs → messages-BICs1abK.mjs} +7 -0
  90. package/dist/{messages-DVQvl8Qj.mjs → messages-BJX6rOnd.mjs} +7 -0
  91. package/dist/{messages-Chb7k3Rg.mjs → messages-BL2bXRhN.mjs} +7 -0
  92. package/dist/{chunks/messages-Phkd7XmE.mjs → messages-BMs5qdlH.mjs} +7 -0
  93. package/dist/{messages-Cjjo7yHR.mjs → messages-BRsjUNwB.mjs} +7 -0
  94. package/dist/{messages-D4qqwVgQ.mjs → messages-BSqV8OUR.mjs} +7 -0
  95. package/dist/{messages-DviiFSv2.mjs → messages-BTqu3DfG.mjs} +7 -0
  96. package/dist/{messages-0AbcLMLm.mjs → messages-BXnDEsur.mjs} +7 -0
  97. package/dist/{chunks/messages-CmR9ftc_.mjs → messages-BYcre4-6.mjs} +7 -0
  98. package/dist/{chunks/messages-wmi-iFkH.mjs → messages-BZ9LRJf-.mjs} +7 -0
  99. package/dist/{messages-D00x4S8o.mjs → messages-BgypBy7y.mjs} +7 -0
  100. package/dist/{chunks/messages-96kNZDll.mjs → messages-BsuGf70G.mjs} +7 -0
  101. package/dist/{messages-v3GipbFl.mjs → messages-BwaoF4lQ.mjs} +7 -0
  102. package/dist/{chunks/messages-DDTQgImT.mjs → messages-C1l8_7-y.mjs} +7 -0
  103. package/dist/{chunks/messages-B1FZ8lxU.mjs → messages-C5NA_r9v.mjs} +7 -0
  104. package/dist/{chunks/messages-Cs8zmZ3L.mjs → messages-C6zgZ5pA.mjs} +7 -0
  105. package/dist/{messages-ZjUAIWb1.mjs → messages-CAo5ghFI.mjs} +7 -0
  106. package/dist/{chunks/messages-D5S1Dnpm.mjs → messages-CH9qlJ9I.mjs} +7 -0
  107. package/dist/{chunks/messages-D7u2bmP2.mjs → messages-CI0HqAeS.mjs} +7 -0
  108. package/dist/{chunks/messages-DH_jBeED.mjs → messages-CJJtms9k.mjs} +7 -0
  109. package/dist/{chunks/messages-CDBLbUOQ.mjs → messages-CM2hJqk6.mjs} +7 -0
  110. package/dist/{messages-8IPXkrDl.mjs → messages-CRMiDPIQ.mjs} +7 -0
  111. package/dist/{messages-Dzzn6XoD.mjs → messages-CWsZuBj1.mjs} +7 -0
  112. package/dist/{messages-CW4c4cRk.mjs → messages-C_gLHo6A.mjs} +7 -0
  113. package/dist/{chunks/messages-CH4hrauY.mjs → messages-Cbu-NUDn.mjs} +7 -0
  114. package/dist/{chunks/messages-RonBBCnh.mjs → messages-Cjb_MCeh.mjs} +7 -0
  115. package/dist/{messages-BJ6zrz2j.mjs → messages-ClXYO9Wn.mjs} +7 -0
  116. package/dist/{messages-CrCYPCk3.mjs → messages-CsH20vhP.mjs} +7 -0
  117. package/dist/{chunks/messages-CzK0LEhb.mjs → messages-CsjAGhzA.mjs} +7 -0
  118. package/dist/{messages-BZlmVRwn.mjs → messages-Cx7VKFOE.mjs} +7 -0
  119. package/dist/{messages-0E0AkrNu.mjs → messages-D3JeBwxo.mjs} +7 -0
  120. package/dist/{messages-D85FqxgY.mjs → messages-D541fieJ.mjs} +7 -0
  121. package/dist/{chunks/messages-4v4MuVEc.mjs → messages-D7XPdglc.mjs} +7 -0
  122. package/dist/{chunks/messages-BC8IN4Bf.mjs → messages-DBhylfvt.mjs} +7 -0
  123. package/dist/{messages-B8WNljW3.mjs → messages-DCA120lW.mjs} +7 -0
  124. package/dist/{messages-Cr49Nt3U.mjs → messages-DCf_xZMN.mjs} +7 -0
  125. package/dist/{messages-VDriF5Qy.mjs → messages-DDwXKCpe.mjs} +7 -0
  126. package/dist/{chunks/messages-b1EdvUm0.mjs → messages-DNKDlxcy.mjs} +7 -0
  127. package/dist/{chunks/messages-L_kl2Qvh.mjs → messages-DPvEjrGK.mjs} +7 -0
  128. package/dist/{messages-62v-CLC-.mjs → messages-DQ-AkNxA.mjs} +7 -0
  129. package/dist/{messages-DdK-nFGm.mjs → messages-DVuvkNap.mjs} +7 -0
  130. package/dist/{chunks/messages-DnVlmiNT.mjs → messages-DaglyqUT.mjs} +7 -0
  131. package/dist/{chunks/messages-Bm-E4iRC.mjs → messages-Di0bAfwA.mjs} +7 -0
  132. package/dist/{chunks/messages-D1mn7Zd5.mjs → messages-DuLct0Yr.mjs} +7 -0
  133. package/dist/{chunks/messages-8DeO60Oo.mjs → messages-DzEYYhZh.mjs} +7 -0
  134. package/dist/{messages-CfiyT2Wi.mjs → messages-DznNGAB2.mjs} +7 -0
  135. package/dist/{messages-DXktiao_.mjs → messages-DzoIzyu8.mjs} +7 -0
  136. package/dist/{chunks/messages-C_4otP7U.mjs → messages-QYOGmket.mjs} +7 -0
  137. package/dist/{messages-nefz1S71.mjs → messages-cEjGDAgI.mjs} +7 -0
  138. package/dist/{messages-jrncnb-H.mjs → messages-ddhvrdpE.mjs} +7 -0
  139. package/dist/{messages-DzqM3Fel.mjs → messages-mwfNK5nZ.mjs} +7 -0
  140. package/dist/{messages-Cl6ayUaq.mjs → messages-nG_vNDte.mjs} +7 -0
  141. package/dist/{chunks/messages-C4jL-90N.mjs → messages-tDq3Owh7.mjs} +7 -0
  142. package/dist/{chunks/messages-BI43k_BD.mjs → messages-x6VJVZKx.mjs} +7 -0
  143. package/dist/tools.mjs +443 -338
  144. package/package.json +1 -1
  145. package/src/components/i18n/locales/am/messages.json +7 -0
  146. package/src/components/i18n/locales/ar/messages.json +7 -0
  147. package/src/components/i18n/locales/az/messages.json +7 -0
  148. package/src/components/i18n/locales/bg/messages.json +7 -0
  149. package/src/components/i18n/locales/bn/messages.json +7 -0
  150. package/src/components/i18n/locales/bs/messages.json +7 -0
  151. package/src/components/i18n/locales/cs/messages.json +7 -0
  152. package/src/components/i18n/locales/da/messages.json +7 -0
  153. package/src/components/i18n/locales/de/messages.json +7 -0
  154. package/src/components/i18n/locales/dv/messages.json +7 -0
  155. package/src/components/i18n/locales/el/messages.json +7 -0
  156. package/src/components/i18n/locales/en/messages.json +7 -0
  157. package/src/components/i18n/locales/es/messages.json +7 -0
  158. package/src/components/i18n/locales/et/messages.json +7 -0
  159. package/src/components/i18n/locales/fa/messages.json +7 -0
  160. package/src/components/i18n/locales/fi/messages.json +7 -0
  161. package/src/components/i18n/locales/fil/messages.json +7 -0
  162. package/src/components/i18n/locales/fr/messages.json +7 -0
  163. package/src/components/i18n/locales/gu/messages.json +7 -0
  164. package/src/components/i18n/locales/he/messages.json +7 -0
  165. package/src/components/i18n/locales/hi/messages.json +7 -0
  166. package/src/components/i18n/locales/hr/messages.json +7 -0
  167. package/src/components/i18n/locales/hu/messages.json +7 -0
  168. package/src/components/i18n/locales/hy/messages.json +7 -0
  169. package/src/components/i18n/locales/id/messages.json +7 -0
  170. package/src/components/i18n/locales/it/messages.json +7 -0
  171. package/src/components/i18n/locales/ja/messages.json +7 -0
  172. package/src/components/i18n/locales/ka/messages.json +7 -0
  173. package/src/components/i18n/locales/km/messages.json +7 -0
  174. package/src/components/i18n/locales/kn/messages.json +7 -0
  175. package/src/components/i18n/locales/ko/messages.json +7 -0
  176. package/src/components/i18n/locales/ku/messages.json +7 -0
  177. package/src/components/i18n/locales/lo/messages.json +7 -0
  178. package/src/components/i18n/locales/lt/messages.json +7 -0
  179. package/src/components/i18n/locales/lv/messages.json +7 -0
  180. package/src/components/i18n/locales/mk/messages.json +7 -0
  181. package/src/components/i18n/locales/ml/messages.json +7 -0
  182. package/src/components/i18n/locales/mn/messages.json +7 -0
  183. package/src/components/i18n/locales/mr/messages.json +7 -0
  184. package/src/components/i18n/locales/ms/messages.json +7 -0
  185. package/src/components/i18n/locales/my/messages.json +7 -0
  186. package/src/components/i18n/locales/ne/messages.json +7 -0
  187. package/src/components/i18n/locales/nl/messages.json +7 -0
  188. package/src/components/i18n/locales/no/messages.json +7 -0
  189. package/src/components/i18n/locales/pa/messages.json +7 -0
  190. package/src/components/i18n/locales/pl/messages.json +7 -0
  191. package/src/components/i18n/locales/ps/messages.json +7 -0
  192. package/src/components/i18n/locales/pt/messages.json +7 -0
  193. package/src/components/i18n/locales/ro/messages.json +7 -0
  194. package/src/components/i18n/locales/ru/messages.json +7 -0
  195. package/src/components/i18n/locales/sd/messages.json +7 -0
  196. package/src/components/i18n/locales/si/messages.json +7 -0
  197. package/src/components/i18n/locales/sk/messages.json +7 -0
  198. package/src/components/i18n/locales/sl/messages.json +7 -0
  199. package/src/components/i18n/locales/sq/messages.json +7 -0
  200. package/src/components/i18n/locales/sr/messages.json +7 -0
  201. package/src/components/i18n/locales/sv/messages.json +7 -0
  202. package/src/components/i18n/locales/sw/messages.json +7 -0
  203. package/src/components/i18n/locales/ta/messages.json +7 -0
  204. package/src/components/i18n/locales/te/messages.json +7 -0
  205. package/src/components/i18n/locales/th/messages.json +7 -0
  206. package/src/components/i18n/locales/tr/messages.json +7 -0
  207. package/src/components/i18n/locales/ug/messages.json +7 -0
  208. package/src/components/i18n/locales/uk/messages.json +7 -0
  209. package/src/components/i18n/locales/ur/messages.json +7 -0
  210. package/src/components/i18n/locales/vi/messages.json +7 -0
  211. package/src/components/i18n/locales/yi/messages.json +7 -0
  212. package/src/components/i18n/locales/zh/messages.json +7 -0
  213. package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +44 -2
  214. package/src/components/modules/blockEvents/index.ts +1 -3
  215. package/src/components/modules/blockManager/blockManager.ts +16 -0
  216. package/src/components/modules/blockManager/operations.ts +106 -9
  217. package/src/components/modules/blockSelection.ts +2 -0
  218. package/src/components/modules/caret.ts +49 -4
  219. package/src/components/modules/drag/DragController.ts +34 -2
  220. package/src/components/modules/paste/handlers/blok-data-handler.ts +50 -3
  221. package/src/components/modules/toolbar/index.ts +11 -16
  222. package/src/components/modules/ui.ts +22 -0
  223. package/src/components/ui/toolbox.ts +19 -3
  224. package/src/components/utils/notifier/draw.ts +116 -14
  225. package/src/components/utils/notifier/index.ts +31 -4
  226. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +2 -2
  227. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +6 -7
  228. package/src/components/utils/popover/components/popover-item/popover-item-separator/popover-item-separator.const.ts +2 -2
  229. package/src/components/utils/popover/popover-abstract.ts +2 -0
  230. package/src/components/utils/popover/popover-desktop.ts +39 -2
  231. package/src/stories/Block.stories.ts +21 -0
  232. package/src/stories/EditorModes.stories.ts +19 -0
  233. package/src/stories/InlineToolbar.stories.ts +41 -9
  234. package/src/stories/MarkerColors.stories.ts +48 -52
  235. package/src/stories/Notifier.stories.ts +19 -1
  236. package/src/stories/Placeholder.stories.ts +12 -0
  237. package/src/stories/Popover.stories.ts +26 -0
  238. package/src/stories/Selection.stories.ts +6 -0
  239. package/src/stories/Table.stories.ts +12 -0
  240. package/src/stories/Toolbar.stories.ts +9 -0
  241. package/src/stories/Toolbox.stories.ts +4 -0
  242. package/src/stories/Tooltip.stories.ts +6 -0
  243. package/src/stories/helpers.ts +63 -8
  244. package/src/styles/main.css +46 -0
  245. package/src/tools/header/index.ts +121 -22
  246. package/src/tools/table/index.ts +2 -3
  247. package/src/tools/table/table-add-controls.ts +29 -1
  248. package/src/tools/table/table-cell-blocks.ts +93 -0
  249. package/src/tools/toggle/constants.ts +2 -2
  250. package/src/tools/toggle/dom-builder.ts +32 -4
  251. package/src/tools/toggle/index.ts +26 -4
  252. package/src/tools/toggle/toggle-keyboard.ts +19 -2
  253. package/src/tools/toggle/toggle-lifecycle.ts +1 -0
  254. package/src/tools/toggle/toggle-shortcuts.ts +18 -8
  255. package/types/utils/popover/popover.d.ts +8 -0
  256. package/dist/chunks/index-CZmRzRIX.mjs +0 -78
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "คลิกเพื่อเพิ่มด้านล่าง",
5
5
  "toolbox.optionAddAbove": "⌥ คลิกเพื่อเพิ่มด้านบน",
6
6
  "toolbox.ctrlAddAbove": "Ctrl คลิกเพื่อเพิ่มด้านบน",
7
+ "toolbox.typeToSearch": "พิมพ์เพื่อค้นหา",
7
8
  "popover.search": "ค้นหา",
8
9
  "popover.nothingFound": "ไม่พบผลลัพธ์",
9
10
  "popover.convertTo": "แปลงเป็น",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "รายการแบบจุด",
17
18
  "toolNames.numberedList": "รายการแบบตัวเลข",
18
19
  "toolNames.todoList": "รายการสิ่งที่ต้องทำ",
20
+ "toolNames.toggleList": "รายการพับได้",
19
21
  "tools.link.addLink": "เพิ่มลิงก์",
20
22
  "tools.link.invalidLink": "ลิงก์ไม่ถูกต้อง",
21
23
  "tools.marker.textColor": "ข้อความ",
@@ -29,6 +31,10 @@
29
31
  "tools.header.heading4": "หัวข้อ 4",
30
32
  "tools.header.heading5": "หัวข้อ 5",
31
33
  "tools.header.heading6": "หัวข้อ 6",
34
+ "tools.header.toggleHeading": "หัวข้อพับได้",
35
+ "tools.header.toggleHeading1": "หัวข้อพับได้ 1",
36
+ "tools.header.toggleHeading2": "หัวข้อพับได้ 2",
37
+ "tools.header.toggleHeading3": "หัวข้อพับได้ 3",
32
38
  "tools.list.placeholder": "รายการ",
33
39
  "blockSettings.delete": "ลบ",
34
40
  "a11y.dragHandle": "ลากเพื่อย้ายบล็อก หรือคลิกเพื่อเปิดเมนู",
@@ -46,6 +52,7 @@
46
52
  "a11y.atTop": "บล็อกอยู่บนสุดแล้ว ไม่สามารถย้ายขึ้นได้",
47
53
  "a11y.atBottom": "บล็อกอยู่ล่างสุดแล้ว ไม่สามารถย้ายลงได้",
48
54
  "tools.paragraph.placeholder": "เขียนอะไรสักอย่าง หรือกด / เพื่อเลือกเครื่องมือ",
55
+ "tools.toggle.placeholder": "พับได้",
49
56
  "tools.table.title": "ตาราง",
50
57
  "tools.table.clearSelection": "ล้าง",
51
58
  "tools.table.copySelection": "คัดลอก",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "Blok ekle",
5
5
  "toolbox.optionAddAbove": "⌥ Üstüne ekle",
6
6
  "toolbox.ctrlAddAbove": "Ctrl Üstüne ekle",
7
+ "toolbox.typeToSearch": "Aramak için yazın",
7
8
  "popover.search": "Ara",
8
9
  "popover.nothingFound": "Sonuç bulunamadı",
9
10
  "popover.convertTo": "Dönüştür",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "Madde işaretli liste",
17
18
  "toolNames.numberedList": "Numaralı liste",
18
19
  "toolNames.todoList": "Yapılacaklar listesi",
20
+ "toolNames.toggleList": "Açılır liste",
19
21
  "tools.link.addLink": "Bağlantı ekle",
20
22
  "tools.link.invalidLink": "Geçersiz bağlantı",
21
23
  "tools.marker.textColor": "Metin",
@@ -29,6 +31,10 @@
29
31
  "tools.header.heading4": "Başlık 4",
30
32
  "tools.header.heading5": "Başlık 5",
31
33
  "tools.header.heading6": "Başlık 6",
34
+ "tools.header.toggleHeading": "Açılır başlık",
35
+ "tools.header.toggleHeading1": "Açılır başlık 1",
36
+ "tools.header.toggleHeading2": "Açılır başlık 2",
37
+ "tools.header.toggleHeading3": "Açılır başlık 3",
32
38
  "tools.list.placeholder": "Liste",
33
39
  "blockSettings.delete": "Sil",
34
40
  "a11y.dragHandle": "Taşımak için sürükle veya menü için tıkla",
@@ -46,6 +52,7 @@
46
52
  "a11y.atTop": "Blok en üstte, yukarı taşınamaz",
47
53
  "a11y.atBottom": "Blok en altta, aşağı taşınamaz",
48
54
  "tools.paragraph.placeholder": "Bir şeyler yazın veya seçmek için / tuşuna basın",
55
+ "tools.toggle.placeholder": "Açılır",
49
56
  "tools.table.title": "Tablo",
50
57
  "tools.table.clearSelection": "Temizle",
51
58
  "tools.table.copySelection": "Kopyala",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "ئاستىغا قوشۇش ئۈچۈن چېكىڭ",
5
5
  "toolbox.optionAddAbove": "ئۈستىگە قوشۇش ئۈچۈن Option-چېكىڭ",
6
6
  "toolbox.ctrlAddAbove": "ئۈستىگە قوشۇش ئۈچۈن Ctrl-چېكىڭ",
7
+ "toolbox.typeToSearch": "ئىزدەش ئۈچۈن يېزىڭ",
7
8
  "popover.search": "ئىزدەش",
8
9
  "popover.nothingFound": "ھېچنېمە تېپىلمىدى",
9
10
  "popover.convertTo": "ئۆزگەرتىش",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "چېكىتلىك تىزىملىك",
17
18
  "toolNames.numberedList": "نومۇرلۇق تىزىملىك",
18
19
  "toolNames.todoList": "ۋەزىپە تىزىملىكى",
20
+ "toolNames.toggleList": "يىغىلما تىزىملىك",
19
21
  "tools.link.addLink": "ئۇلانما قوشۇش",
20
22
  "tools.link.invalidLink": "ئىناۋەتسىز ئۇلانما",
21
23
  "tools.marker.textColor": "تېكىست",
@@ -29,8 +31,13 @@
29
31
  "tools.header.heading4": "ماۋزۇ 4",
30
32
  "tools.header.heading5": "ماۋزۇ 5",
31
33
  "tools.header.heading6": "ماۋزۇ 6",
34
+ "tools.header.toggleHeading": "يىغىلما ماۋزۇ",
35
+ "tools.header.toggleHeading1": "يىغىلما ماۋزۇ 1",
36
+ "tools.header.toggleHeading2": "يىغىلما ماۋزۇ 2",
37
+ "tools.header.toggleHeading3": "يىغىلما ماۋزۇ 3",
32
38
  "tools.list.placeholder": "تىزىملىك",
33
39
  "tools.paragraph.placeholder": "بىر نەرسە يېزىڭ ياكى / نى بېسىپ قورال تاللاڭ",
40
+ "tools.toggle.placeholder": "يىغىلما",
34
41
  "tools.table.title": "جەدۋەل",
35
42
  "tools.table.clearSelection": "تازىلاش",
36
43
  "tools.table.copySelection": "كۆچۈر",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "Додати блок",
5
5
  "toolbox.optionAddAbove": "⌥ — додати вище",
6
6
  "toolbox.ctrlAddAbove": "Ctrl — додати вище",
7
+ "toolbox.typeToSearch": "Введіть для пошуку",
7
8
  "popover.search": "Пошук",
8
9
  "popover.nothingFound": "Нічого не знайдено",
9
10
  "popover.convertTo": "Перетворити на",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "Маркований список",
17
18
  "toolNames.numberedList": "Нумерований список",
18
19
  "toolNames.todoList": "Список справ",
20
+ "toolNames.toggleList": "Згортний список",
19
21
  "tools.link.addLink": "Додати посилання",
20
22
  "tools.link.invalidLink": "Недійсне посилання",
21
23
  "tools.marker.textColor": "Текст",
@@ -29,6 +31,10 @@
29
31
  "tools.header.heading4": "Заголовок 4",
30
32
  "tools.header.heading5": "Заголовок 5",
31
33
  "tools.header.heading6": "Заголовок 6",
34
+ "tools.header.toggleHeading": "Згортний заголовок",
35
+ "tools.header.toggleHeading1": "Згортний заголовок 1",
36
+ "tools.header.toggleHeading2": "Згортний заголовок 2",
37
+ "tools.header.toggleHeading3": "Згортний заголовок 3",
32
38
  "tools.list.placeholder": "Список",
33
39
  "blockSettings.delete": "Видалити",
34
40
  "a11y.dragHandle": "Перетягніть або натисніть для меню",
@@ -46,6 +52,7 @@
46
52
  "a11y.atTop": "Блок вже вгорі",
47
53
  "a11y.atBottom": "Блок вже внизу",
48
54
  "tools.paragraph.placeholder": "Напишіть щось або натисніть / для вибору",
55
+ "tools.toggle.placeholder": "Згортний",
49
56
  "tools.table.title": "Таблиця",
50
57
  "tools.table.clearSelection": "Очистити",
51
58
  "tools.table.copySelection": "Копіювати",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "نیچے شامل کرنے کے لیے کلک کریں",
5
5
  "toolbox.optionAddAbove": "اوپر شامل کرنے کے لیے Option-کلک",
6
6
  "toolbox.ctrlAddAbove": "اوپر شامل کرنے کے لیے Ctrl-کلک",
7
+ "toolbox.typeToSearch": "تلاش کے لیے ٹائپ کریں",
7
8
  "popover.search": "تلاش",
8
9
  "popover.nothingFound": "کچھ نہیں ملا",
9
10
  "popover.convertTo": "تبدیل کریں",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "بلٹ فہرست",
17
18
  "toolNames.numberedList": "نمبر فہرست",
18
19
  "toolNames.todoList": "کام کی فہرست",
20
+ "toolNames.toggleList": "ٹوگل فہرست",
19
21
  "tools.link.addLink": "لنک شامل کریں",
20
22
  "tools.link.invalidLink": "غلط لنک",
21
23
  "tools.marker.textColor": "متن",
@@ -29,6 +31,10 @@
29
31
  "tools.header.heading4": "عنوان 4",
30
32
  "tools.header.heading5": "عنوان 5",
31
33
  "tools.header.heading6": "عنوان 6",
34
+ "tools.header.toggleHeading": "ٹوگل عنوان",
35
+ "tools.header.toggleHeading1": "ٹوگل عنوان 1",
36
+ "tools.header.toggleHeading2": "ٹوگل عنوان 2",
37
+ "tools.header.toggleHeading3": "ٹوگل عنوان 3",
32
38
  "tools.list.placeholder": "فہرست",
33
39
  "blockSettings.delete": "حذف کریں",
34
40
  "a11y.dragHandle": "بلاک منتقل کرنے کے لیے گھسیٹیں یا مینو کے لیے کلک کریں",
@@ -46,6 +52,7 @@
46
52
  "a11y.atTop": "بلاک سب سے اوپر ہے، اوپر نہیں جا سکتا",
47
53
  "a11y.atBottom": "بلاک سب سے نیچے ہے، نیچے نہیں جا سکتا",
48
54
  "tools.paragraph.placeholder": "کچھ لکھیں یا منتخب کرنے کیلئے / دبائیں",
55
+ "tools.toggle.placeholder": "ٹوگل",
49
56
  "tools.table.title": "ٹیبل",
50
57
  "tools.table.clearSelection": "صاف کریں",
51
58
  "tools.table.copySelection": "کاپی",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "Nhấp để thêm bên dưới",
5
5
  "toolbox.optionAddAbove": "⌥ Nhấp để thêm bên trên",
6
6
  "toolbox.ctrlAddAbove": "Ctrl+Nhấp để thêm bên trên",
7
+ "toolbox.typeToSearch": "Nhập để tìm kiếm",
7
8
  "popover.search": "Tìm kiếm",
8
9
  "popover.nothingFound": "Không tìm thấy",
9
10
  "popover.convertTo": "Chuyển sang",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "Danh sách chấm",
17
18
  "toolNames.numberedList": "Danh sách đánh số",
18
19
  "toolNames.todoList": "Danh sách việc cần làm",
20
+ "toolNames.toggleList": "Danh sách thu gọn",
19
21
  "tools.link.addLink": "Thêm liên kết",
20
22
  "tools.link.invalidLink": "Liên kết không hợp lệ",
21
23
  "tools.marker.textColor": "Chữ",
@@ -29,8 +31,13 @@
29
31
  "tools.header.heading4": "Tiêu đề 4",
30
32
  "tools.header.heading5": "Tiêu đề 5",
31
33
  "tools.header.heading6": "Tiêu đề 6",
34
+ "tools.header.toggleHeading": "Tiêu đề thu gọn",
35
+ "tools.header.toggleHeading1": "Tiêu đề thu gọn 1",
36
+ "tools.header.toggleHeading2": "Tiêu đề thu gọn 2",
37
+ "tools.header.toggleHeading3": "Tiêu đề thu gọn 3",
32
38
  "tools.list.placeholder": "Danh sách",
33
39
  "tools.paragraph.placeholder": "Viết gì đó hoặc nhấn / để chọn công cụ",
40
+ "tools.toggle.placeholder": "Thu gọn",
34
41
  "tools.table.title": "Bảng",
35
42
  "tools.table.clearSelection": "Xóa",
36
43
  "tools.table.copySelection": "Sao chép",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "קליק צו צולייגן אונטן",
5
5
  "toolbox.optionAddAbove": "Option-קליק צו צולייגן אויבן",
6
6
  "toolbox.ctrlAddAbove": "Ctrl-קליק צו צולייגן אויבן",
7
+ "toolbox.typeToSearch": "טייפּט צו זוכן",
7
8
  "popover.search": "זוכן",
8
9
  "popover.nothingFound": "גארנישט געפֿונען",
9
10
  "popover.convertTo": "פֿאַרוואַנדלען צו",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "פּונקט ליסטע",
17
18
  "toolNames.numberedList": "נומעריקע ליסטע",
18
19
  "toolNames.todoList": "צו-טאָן ליסטע",
20
+ "toolNames.toggleList": "אויפֿקלאַפּ ליסטע",
19
21
  "tools.link.addLink": "צולייגן לינק",
20
22
  "tools.link.invalidLink": "אומגילטיקער לינק",
21
23
  "tools.marker.textColor": "טעקסט",
@@ -29,8 +31,13 @@
29
31
  "tools.header.heading4": "קעפּל 4",
30
32
  "tools.header.heading5": "קעפּל 5",
31
33
  "tools.header.heading6": "קעפּל 6",
34
+ "tools.header.toggleHeading": "אויפֿקלאַפּ קעפּל",
35
+ "tools.header.toggleHeading1": "אויפֿקלאַפּ קעפּל 1",
36
+ "tools.header.toggleHeading2": "אויפֿקלאַפּ קעפּל 2",
37
+ "tools.header.toggleHeading3": "אויפֿקלאַפּ קעפּל 3",
32
38
  "tools.list.placeholder": "ליסטע",
33
39
  "tools.paragraph.placeholder": "שרײַב עפּעס אָדער דריק / צו קלײַבן אַ געצײַג",
40
+ "tools.toggle.placeholder": "אויפֿקלאַפּ",
34
41
  "tools.table.title": "טאַבעלע",
35
42
  "tools.table.clearSelection": "אויסמעקן",
36
43
  "tools.table.copySelection": "קאָפּירן",
@@ -4,6 +4,7 @@
4
4
  "toolbox.addBelow": "添加内容块",
5
5
  "toolbox.optionAddAbove": "⌥ 在上方添加",
6
6
  "toolbox.ctrlAddAbove": "Ctrl 在上方添加",
7
+ "toolbox.typeToSearch": "输入以搜索",
7
8
  "popover.search": "搜索",
8
9
  "popover.nothingFound": "未找到结果",
9
10
  "popover.convertTo": "转换为",
@@ -16,6 +17,7 @@
16
17
  "toolNames.bulletedList": "无序列表",
17
18
  "toolNames.numberedList": "有序列表",
18
19
  "toolNames.todoList": "清单",
20
+ "toolNames.toggleList": "折叠列表",
19
21
  "tools.link.addLink": "添加链接",
20
22
  "tools.link.invalidLink": "链接无效",
21
23
  "tools.marker.textColor": "文字",
@@ -29,8 +31,13 @@
29
31
  "tools.header.heading4": "四级标题",
30
32
  "tools.header.heading5": "五级标题",
31
33
  "tools.header.heading6": "六级标题",
34
+ "tools.header.toggleHeading": "折叠标题",
35
+ "tools.header.toggleHeading1": "折叠一级标题",
36
+ "tools.header.toggleHeading2": "折叠二级标题",
37
+ "tools.header.toggleHeading3": "折叠三级标题",
32
38
  "tools.list.placeholder": "列表",
33
39
  "tools.paragraph.placeholder": "输入内容或按 / 选择工具",
40
+ "tools.toggle.placeholder": "折叠",
34
41
  "blockSettings.delete": "删除",
35
42
  "a11y.dragHandle": "拖动移动或点击打开菜单",
36
43
  "a11y.dragHandleRole": "拖动控件",
@@ -83,6 +83,14 @@ export class KeyboardNavigation extends BlockEventComposer {
83
83
  return;
84
84
  }
85
85
 
86
+ /**
87
+ * Skip Tab handling for blocks inside table cells — the table's own grid-level
88
+ * handler (setupKeyboardNavigation) manages cell-to-cell and table-exit navigation.
89
+ */
90
+ if (this.isCurrentBlockInsideTableCell) {
91
+ return;
92
+ }
93
+
86
94
  const isNavigated = event.shiftKey ? Caret.navigatePrevious(true) : Caret.navigateNext(true);
87
95
 
88
96
  /**
@@ -174,14 +182,40 @@ export class KeyboardNavigation extends BlockEventComposer {
174
182
  private createBlockOnEnter(currentBlock: Block): Block {
175
183
  // Case 1: Caret at start - insert block above
176
184
  if (currentBlock.currentInput !== undefined && isCaretAtStartOfInput(currentBlock.currentInput) && !currentBlock.hasMedia && (currentBlock.parentId === null || !currentBlock.isEmpty)) {
177
- this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex);
185
+ const newBlock = this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex);
186
+
187
+ /**
188
+ * When the current block is a child of a toggle, the new block inserted above
189
+ * should also be a child of the same parent.
190
+ */
191
+ if (currentBlock.parentId !== null) {
192
+ this.Blok.BlockManager.setBlockParent(newBlock, currentBlock.parentId);
193
+ }
178
194
 
179
195
  return currentBlock;
180
196
  }
181
197
 
182
198
  // Case 2: Caret at end - insert block below
183
199
  if (currentBlock.currentInput && isCaretAtEndOfInput(currentBlock.currentInput)) {
184
- return this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex + 1);
200
+ const newBlock = this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex + 1);
201
+
202
+ /**
203
+ * When the current block is an open toggle (heading or list item),
204
+ * the new block should become a child of the toggle rather than a sibling.
205
+ * Detect via the data-blok-toggle-open DOM attribute set by toggle tools.
206
+ *
207
+ * When the current block is already a child of a toggle, the new block
208
+ * should inherit the same parent so it stays inside the toggle.
209
+ */
210
+ const toggleWrapper = currentBlock.holder.querySelector('[data-blok-toggle-open]');
211
+
212
+ if (toggleWrapper?.getAttribute('data-blok-toggle-open') === 'true') {
213
+ this.Blok.BlockManager.setBlockParent(newBlock, currentBlock.id);
214
+ } else if (currentBlock.parentId !== null) {
215
+ this.Blok.BlockManager.setBlockParent(newBlock, currentBlock.parentId);
216
+ }
217
+
218
+ return newBlock;
185
219
  }
186
220
 
187
221
  // Case 3: Caret in middle - split block
@@ -486,6 +520,14 @@ export class KeyboardNavigation extends BlockEventComposer {
486
520
  const isDownKey = keyCode === keyCodes.DOWN;
487
521
  const isRightKey = keyCode === keyCodes.RIGHT && !this.isRtl;
488
522
 
523
+ /**
524
+ * Skip ArrowDown handling for blocks inside table cells — the table's own
525
+ * grid-level handler manages row-based navigation and table exit.
526
+ */
527
+ if (isDownKey && this.isCurrentBlockInsideTableCell) {
528
+ return;
529
+ }
530
+
489
531
  const isNavigated = (() => {
490
532
  if (isDownKey) {
491
533
  /**
@@ -341,9 +341,7 @@ export class BlockEvents extends Module {
341
341
  * If Toolbox is not open, then just open it and show plus button
342
342
  */
343
343
  private activateToolbox(): void {
344
- if (!this.Blok.Toolbar.opened) {
345
- this.Blok.Toolbar.moveAndOpen();
346
- } // else Flipper will leaf through it
344
+ this.Blok.Toolbar.moveAndOpen();
347
345
 
348
346
  this.Blok.Toolbar.toolbox.open();
349
347
  }
@@ -127,6 +127,22 @@ export class BlockManager extends Module {
127
127
  return this.operations?.previousBlock ?? null;
128
128
  }
129
129
 
130
+ /**
131
+ * Returns next visible Block instance (skips hidden blocks)
132
+ * @returns {Block|null}
133
+ */
134
+ public get nextVisibleBlock(): Block | null {
135
+ return this.operations?.nextVisibleBlock ?? null;
136
+ }
137
+
138
+ /**
139
+ * Returns previous visible Block instance (skips hidden blocks)
140
+ * @returns {Block|null}
141
+ */
142
+ public get previousVisibleBlock(): Block | null {
143
+ return this.operations?.previousVisibleBlock ?? null;
144
+ }
145
+
130
146
  /**
131
147
  * Get array of Block instances
132
148
  * @returns {Block[]} {@link Blocks#array}
@@ -175,6 +175,35 @@ export class BlockOperations {
175
175
  return previousBlock ?? null;
176
176
  }
177
177
 
178
+ /**
179
+ * Get next visible block (skips blocks whose holder has 'hidden' class)
180
+ * Returns null when no visible block is found after the current one
181
+ */
182
+ public get nextVisibleBlock(): Block | null {
183
+ if (this.currentBlockIndex === -1) {
184
+ return null;
185
+ }
186
+
187
+ return this.repository.blocks
188
+ .slice(this.currentBlockIndex + 1)
189
+ .find(block => !block.holder.classList.contains('hidden')) ?? null;
190
+ }
191
+
192
+ /**
193
+ * Get previous visible block (skips blocks whose holder has 'hidden' class)
194
+ * Returns null when no visible block is found before the current one
195
+ */
196
+ public get previousVisibleBlock(): Block | null {
197
+ if (this.currentBlockIndex === -1) {
198
+ return null;
199
+ }
200
+
201
+ return this.repository.blocks
202
+ .slice(0, this.currentBlockIndex)
203
+ .reverse()
204
+ .find(block => !block.holder.classList.contains('hidden')) ?? null;
205
+ }
206
+
178
207
  /**
179
208
  * Insert new block
180
209
  * @param options - Insert options
@@ -256,6 +285,20 @@ export class BlockOperations {
256
285
 
257
286
  blocksStore.insert(targetIndex, block, replace, appendToWorkingArea);
258
287
 
288
+ /**
289
+ * Update the raw currentBlockIndex BEFORE firing the mutation event so
290
+ * that listeners (e.g. TableCellBlocks.handleBlockMutation) see the
291
+ * index of the newly inserted block. We bypass the setter to avoid
292
+ * triggering stopCapturing prematurely — that happens after Yjs sync.
293
+ */
294
+ const prevIndex = this.currentBlockIndex;
295
+
296
+ if (needToFocus) {
297
+ this.currentBlockIndex = targetIndex;
298
+ } else if (targetIndex <= this.currentBlockIndex) {
299
+ this.currentBlockIndex++;
300
+ }
301
+
259
302
  /**
260
303
  * Force call of didMutated event on Block insertion
261
304
  */
@@ -277,12 +320,12 @@ export class BlockOperations {
277
320
  }, targetIndex);
278
321
  }
279
322
 
280
- if (needToFocus) {
281
- this.currentBlockIndexValue = targetIndex;
282
- }
283
-
284
- if (!needToFocus && targetIndex <= this.currentBlockIndex) {
285
- this.currentBlockIndexValue++;
323
+ /**
324
+ * Trigger stopCapturing for the index change now that Yjs sync is done.
325
+ * This preserves undo group boundaries at the original timing.
326
+ */
327
+ if (this.currentBlockIndex !== prevIndex && !this.suppressStopCapturing) {
328
+ this.dependencies.YjsManager?.stopCapturing();
286
329
  }
287
330
 
288
331
  return block;
@@ -349,6 +392,18 @@ export class BlockOperations {
349
392
  parentBlock.contentIds = parentBlock.contentIds.filter(id => id !== block.id);
350
393
  }
351
394
 
395
+ // Promote children to root level when a parent block is removed
396
+ for (const childId of block.contentIds) {
397
+ const childBlock = this.repository.getBlockById(childId);
398
+
399
+ if (childBlock === undefined) {
400
+ continue;
401
+ }
402
+
403
+ childBlock.parentId = null;
404
+ childBlock.holder.classList.remove('hidden');
405
+ }
406
+
352
407
  blocksStore.remove(index);
353
408
 
354
409
  /**
@@ -416,6 +471,8 @@ export class BlockOperations {
416
471
  tool: block.name,
417
472
  data: Object.assign({}, existingData, data ?? {}),
418
473
  tunes: tunes ?? block.preservedTunes,
474
+ parentId: block.parentId ?? undefined,
475
+ contentIds: block.contentIds.length > 0 ? [...block.contentIds] : undefined,
419
476
  bindEventsImmediately: true,
420
477
  });
421
478
 
@@ -455,6 +512,10 @@ export class BlockOperations {
455
512
  const blockIndex = this.repository.getBlockIndex(block);
456
513
  const newBlockId = generateBlockId();
457
514
 
515
+ // Capture hierarchy before replacement
516
+ const oldParentId = block.parentId;
517
+ const oldContentIds = [...block.contentIds];
518
+
458
519
  // Atomic transaction: remove old block + add new block as single undo entry
459
520
  this.dependencies.YjsManager.transact(() => {
460
521
  this.dependencies.YjsManager.removeBlock(block.id);
@@ -466,7 +527,7 @@ export class BlockOperations {
466
527
  });
467
528
 
468
529
  // DOM update (skip Yjs sync — already done above)
469
- return this.insert({
530
+ const newBlock = this.insert({
470
531
  id: newBlockId,
471
532
  tool: newTool,
472
533
  data,
@@ -474,6 +535,28 @@ export class BlockOperations {
474
535
  replace: true,
475
536
  skipYjsSync: true,
476
537
  }, blocksStore);
538
+
539
+ // Transfer hierarchy to new block
540
+ if (oldParentId !== null) {
541
+ newBlock.parentId = oldParentId;
542
+
543
+ const parentBlock = this.repository.getBlockById(oldParentId);
544
+
545
+ if (parentBlock !== undefined) {
546
+ parentBlock.contentIds = parentBlock.contentIds.map(id => id === block.id ? newBlock.id : id);
547
+ }
548
+ }
549
+
550
+ for (const childId of oldContentIds) {
551
+ const childBlock = this.repository.getBlockById(childId);
552
+
553
+ if (childBlock !== undefined) {
554
+ childBlock.parentId = newBlock.id;
555
+ }
556
+ }
557
+ newBlock.contentIds = oldContentIds;
558
+
559
+ return newBlock;
477
560
  }
478
561
 
479
562
  /**
@@ -663,12 +746,19 @@ export class BlockOperations {
663
746
  });
664
747
 
665
748
  // Insert DOM block (skip Yjs sync - already done above)
666
- return this.insert({
749
+ const newBlock = this.insert({
667
750
  id: newBlockId,
668
751
  tool: currentBlock.name,
669
752
  data: { text: extractedText },
670
753
  skipYjsSync: true,
671
754
  }, blocksStore);
755
+
756
+ // Inherit parentId from the split block so nested blocks stay nested
757
+ if (currentBlock.parentId !== null) {
758
+ this.hierarchy.setBlockParent(newBlock, currentBlock.parentId);
759
+ }
760
+
761
+ return newBlock;
672
762
  });
673
763
  }
674
764
 
@@ -722,7 +812,7 @@ export class BlockOperations {
722
812
  }
723
813
 
724
814
  // Insert DOM block (skip Yjs sync - already done above)
725
- return this.insert({
815
+ const newBlock = this.insert({
726
816
  id: newBlockId,
727
817
  tool: newBlockType,
728
818
  data: newBlockData,
@@ -730,6 +820,13 @@ export class BlockOperations {
730
820
  needToFocus: true,
731
821
  skipYjsSync: true,
732
822
  }, blocksStore);
823
+
824
+ // Inherit parentId from the split block so nested blocks stay nested
825
+ if (currentBlock.parentId !== null) {
826
+ this.hierarchy.setBlockParent(newBlock, currentBlock.parentId);
827
+ }
828
+
829
+ return newBlock;
733
830
  });
734
831
  }
735
832
 
@@ -336,6 +336,8 @@ export class BlockSelection extends Module {
336
336
  tool: block.name,
337
337
  data: block.preservedData,
338
338
  tunes: block.preservedTunes,
339
+ parentId: block.parentId,
340
+ contentIds: block.contentIds,
339
341
  }));
340
342
 
341
343
  this.selectedBlocks.forEach((block) => {
@@ -499,7 +499,7 @@ export class Caret extends Module {
499
499
  */
500
500
  public navigateNext(force = false): boolean {
501
501
  const { BlockManager } = this.Blok;
502
- const { currentBlock, nextBlock } = BlockManager;
502
+ const { currentBlock, nextVisibleBlock: nextBlock } = BlockManager;
503
503
 
504
504
  if (currentBlock === undefined) {
505
505
  return false;
@@ -567,7 +567,7 @@ export class Caret extends Module {
567
567
  * @param {boolean} force - pass true to skip check for caret position
568
568
  */
569
569
  public navigatePrevious(force = false): boolean {
570
- const { currentBlock, previousBlock } = this.Blok.BlockManager;
570
+ const { currentBlock, previousVisibleBlock: previousBlock } = this.Blok.BlockManager;
571
571
 
572
572
  if (!currentBlock) {
573
573
  return false;
@@ -634,7 +634,7 @@ export class Caret extends Module {
634
634
  */
635
635
  public navigateVerticalNext(): boolean {
636
636
  const { BlockManager } = this.Blok;
637
- const { currentBlock, nextBlock } = BlockManager;
637
+ const { currentBlock, nextVisibleBlock: nextBlock } = BlockManager;
638
638
 
639
639
  if (currentBlock === undefined) {
640
640
  return false;
@@ -681,6 +681,35 @@ export class Caret extends Module {
681
681
  return true;
682
682
  }
683
683
 
684
+ /**
685
+ * If current block is inside a table cell (has parentId), check if we should
686
+ * exit the table. This handles two cases:
687
+ * 1. nextBlock is still in the same table → skip all cell paragraphs
688
+ * 2. nextBlock is null (last block in flat list) → table is at the end
689
+ */
690
+ const shouldExitParent = currentBlock.parentId !== null && (
691
+ nextBlock === null ||
692
+ nextBlock.parentId === currentBlock.parentId ||
693
+ nextBlock.id === currentBlock.parentId
694
+ );
695
+
696
+ if (shouldExitParent && currentBlock.parentId !== null) {
697
+ const blockAfterTable = this.findFirstBlockAfterParent(currentBlock.parentId);
698
+
699
+ if (blockAfterTable !== null) {
700
+ this.setToBlockAtXPosition(blockAfterTable, caretX, true);
701
+
702
+ return true;
703
+ }
704
+
705
+ // No block after table — create one
706
+ const newBlock = BlockManager.insertAtEnd();
707
+
708
+ this.setToBlock(newBlock, this.positions.START);
709
+
710
+ return true;
711
+ }
712
+
684
713
  /**
685
714
  * Navigate to next block, preserving horizontal position
686
715
  */
@@ -714,7 +743,7 @@ export class Caret extends Module {
714
743
  */
715
744
  public navigateVerticalPrevious(): boolean {
716
745
  const { BlockManager } = this.Blok;
717
- const { currentBlock, previousBlock } = BlockManager;
746
+ const { currentBlock, previousVisibleBlock: previousBlock } = BlockManager;
718
747
 
719
748
  if (currentBlock === undefined) {
720
749
  return false;
@@ -773,6 +802,22 @@ export class Caret extends Module {
773
802
  return false;
774
803
  }
775
804
 
805
+ /**
806
+ * Find the first block after a parent block (e.g., a table) by scanning the flat
807
+ * block array and skipping blocks whose parentId matches.
808
+ */
809
+ private findFirstBlockAfterParent(parentBlockId: string): Block | null {
810
+ const { BlockManager } = this.Blok;
811
+ const blocks = BlockManager.blocks;
812
+ const parentIndex = blocks.findIndex(b => b.id === parentBlockId);
813
+
814
+ if (parentIndex === -1) {
815
+ return null;
816
+ }
817
+
818
+ return blocks.slice(parentIndex + 1).find(b => b.parentId !== parentBlockId) ?? null;
819
+ }
820
+
776
821
  /**
777
822
  * Inserts shadow element after passed element where caret can be placed
778
823
  * @param {Element} element - element after which shadow caret should be inserted