@jackuait/blok 0.10.2 → 0.10.4

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 (293) hide show
  1. package/dist/blok.mjs +2 -2
  2. package/dist/chunks/{blok-D-T1XZ92.mjs → blok-NcdNQ0I6.mjs} +2304 -2101
  3. package/dist/chunks/{constants-CaB-mlB5.mjs → constants-DtfShkXT.mjs} +414 -317
  4. package/dist/chunks/{i18next-loader-CDnSPae_.mjs → i18next-loader-D32EUWLr.mjs} +1 -1
  5. package/dist/chunks/{lightweight-i18n-DZmo8dAI.mjs → lightweight-i18n-DpkvRXEd.mjs} +19 -0
  6. package/dist/{messages-Ddq3Ce3E2.mjs → chunks/messages-AD17iDBx.mjs} +18 -0
  7. package/dist/{messages-neGD3WGq.mjs → chunks/messages-B03yUEra2.mjs} +18 -0
  8. package/dist/chunks/{messages-CIfUm1Oa.mjs → messages-B2dU00Z3.mjs} +18 -0
  9. package/dist/chunks/{messages-BKN3YVIj.mjs → messages-B8hICx3L.mjs} +18 -0
  10. package/dist/{messages-Dnd5YSWv.mjs → chunks/messages-BBe45sPH.mjs} +18 -0
  11. package/dist/{messages-C7lJg8fy2.mjs → chunks/messages-BCifzMVO2.mjs} +18 -0
  12. package/dist/chunks/{messages-D7dx_6k8.mjs → messages-BGmvvtg_.mjs} +18 -0
  13. package/dist/{messages-Q5sQeVap2.mjs → chunks/messages-BJNFCDv42.mjs} +18 -0
  14. package/dist/chunks/{messages-BlxwW7M6.mjs → messages-BNy4e7Xl.mjs} +18 -0
  15. package/dist/chunks/{messages-C15z2r5U.mjs → messages-BcHZf9o-.mjs} +18 -0
  16. package/dist/{messages-A96tMxeU.mjs → chunks/messages-BjyYZeBm2.mjs} +18 -0
  17. package/dist/{messages-BbJ7ZXY8.mjs → chunks/messages-Bop7vrhU.mjs} +18 -0
  18. package/dist/{messages-BiTMwiKH.mjs → chunks/messages-BouFtpfO.mjs} +18 -0
  19. package/dist/chunks/{messages-ElIGUi0O2.mjs → messages-Br6bE1FD2.mjs} +18 -0
  20. package/dist/chunks/{messages-BHMiK51R.mjs → messages-C-EBhOHE.mjs} +18 -0
  21. package/dist/chunks/{messages-kGmxkeFH.mjs → messages-C3X7dv3f.mjs} +18 -0
  22. package/dist/chunks/{messages-4Ck88DYZ2.mjs → messages-C7Pjof0d2.mjs} +18 -0
  23. package/dist/{messages-D0lLw9KM.mjs → chunks/messages-C7sBaZOO2.mjs} +18 -0
  24. package/dist/chunks/{messages-QMOmwcZb.mjs → messages-C85zv_7x.mjs} +18 -0
  25. package/dist/chunks/{messages-DSrdy9Nw2.mjs → messages-CCEgR9GN2.mjs} +18 -0
  26. package/dist/chunks/{messages-DUr9WAkD.mjs → messages-CDSyoUft.mjs} +18 -0
  27. package/dist/{messages-bkGniiaz.mjs → chunks/messages-CGFlOwst.mjs} +18 -0
  28. package/dist/chunks/{messages-DBMaLL8b2.mjs → messages-CGLTjtRv2.mjs} +18 -0
  29. package/dist/{messages-2ZWBTerL.mjs → chunks/messages-CGPxUESo.mjs} +18 -0
  30. package/dist/chunks/{messages-BfAcUavP.mjs → messages-CNaaqQVz.mjs} +18 -0
  31. package/dist/{messages-DBhvm8NK.mjs → chunks/messages-CPFB2_m-2.mjs} +18 -0
  32. package/dist/chunks/{messages-zt6zdYWh.mjs → messages-CTdSIOAc.mjs} +18 -0
  33. package/dist/chunks/{messages-1_6UkKLS.mjs → messages-CXVWb9js.mjs} +18 -0
  34. package/dist/{messages-CdEASHDp2.mjs → chunks/messages-Cfbmwdep2.mjs} +18 -0
  35. package/dist/chunks/{messages-DxHh0O8j2.mjs → messages-ChayV9WY2.mjs} +18 -0
  36. package/dist/chunks/{messages-BgM91Lxm2.mjs → messages-Ci7UXRVI2.mjs} +18 -0
  37. package/dist/chunks/{messages-Clku7Cf-2.mjs → messages-CpXvyGWv2.mjs} +18 -0
  38. package/dist/chunks/{messages-DjvaiALg2.mjs → messages-Cql2ozf_2.mjs} +18 -0
  39. package/dist/{messages-DODrhcop.mjs → chunks/messages-Cxy_E2IS.mjs} +18 -0
  40. package/dist/chunks/{messages-CZSlfnkO2.mjs → messages-D9syZVGi2.mjs} +18 -0
  41. package/dist/chunks/{messages-BRAoJpOu.mjs → messages-D9uWAWjW.mjs} +18 -0
  42. package/dist/chunks/{messages-BK8Cp2d0.mjs → messages-DRJxSTqs.mjs} +18 -0
  43. package/dist/{messages-C_Qn9SbQ.mjs → chunks/messages-DSbI0vJf.mjs} +18 -0
  44. package/dist/chunks/{messages-CD_MnBln.mjs → messages-DVvrZRyZ.mjs} +18 -0
  45. package/dist/{messages-BE_z-zrb.mjs → chunks/messages-DY8zPIZW.mjs} +18 -0
  46. package/dist/chunks/{messages-Bz0-KNEB.mjs → messages-D_kZN9rB.mjs} +18 -0
  47. package/dist/{messages-C1vc5584.mjs → chunks/messages-DjSuq0-y2.mjs} +18 -0
  48. package/dist/chunks/{messages-DPzHD51Y.mjs → messages-DkP3Jf4F.mjs} +18 -0
  49. package/dist/{messages-_PLyRfVw.mjs → chunks/messages-DoPdy75l.mjs} +18 -0
  50. package/dist/chunks/{messages-JSQjKQ8I.mjs → messages-DpydMd36.mjs} +18 -0
  51. package/dist/{messages-BckDk9aq2.mjs → chunks/messages-DtZ9U9g72.mjs} +18 -0
  52. package/dist/{messages-JNrYldAa2.mjs → chunks/messages-H6vLy8wJ.mjs} +18 -0
  53. package/dist/chunks/{messages-DTN1XGll.mjs → messages-HzH9_QH8.mjs} +18 -0
  54. package/dist/chunks/{messages-C0IFfhnp.mjs → messages-O6FOfUgF.mjs} +18 -0
  55. package/dist/{messages-Be_2RHZD.mjs → chunks/messages-OSP4Hj5o.mjs} +18 -0
  56. package/dist/chunks/{messages-DMoERagV2.mjs → messages-RiqdVwuN2.mjs} +18 -0
  57. package/dist/chunks/{messages-BJ-vT1SU2.mjs → messages-SP659Sal2.mjs} +18 -0
  58. package/dist/{messages-Che99vKP.mjs → chunks/messages-THR8q8bJ.mjs} +18 -0
  59. package/dist/chunks/{messages-CvANwuht2.mjs → messages-VlEyFUxF2.mjs} +18 -0
  60. package/dist/{messages-apA6BStA.mjs → chunks/messages-VtfKWZ2S.mjs} +18 -0
  61. package/dist/{messages-DpJGbx3q.mjs → chunks/messages-YbckahVx2.mjs} +18 -0
  62. package/dist/{messages-DYuD5-rO.mjs → chunks/messages-ZhHLC6dk.mjs} +18 -0
  63. package/dist/{messages-C0GSBBCo2.mjs → chunks/messages-bFEdH3lv.mjs} +18 -0
  64. package/dist/chunks/{messages-euM2m3wQ.mjs → messages-dpXwA3Sz.mjs} +18 -0
  65. package/dist/chunks/{messages-CQBo3lmL2.mjs → messages-fbL5y58u2.mjs} +18 -0
  66. package/dist/chunks/{messages-CxiURE2X.mjs → messages-oPV2oMxM.mjs} +18 -0
  67. package/dist/{messages-DM4Gjc9h.mjs → chunks/messages-oXBbHW9A.mjs} +18 -0
  68. package/dist/chunks/{messages-QilfinOn2.mjs → messages-vDgsEqQW2.mjs} +18 -0
  69. package/dist/{messages-ClGvlFcH2.mjs → chunks/messages-wYQksm10.mjs} +18 -0
  70. package/dist/{messages-CnuH-BZK2.mjs → chunks/messages-yGedmr61.mjs} +18 -0
  71. package/dist/chunks/{messages-sDdNf8O9.mjs → messages-zQOpKjl3.mjs} +18 -0
  72. package/dist/chunks/{messages-eFd4YYzt.mjs → messages-zWqsggJh.mjs} +18 -0
  73. package/dist/chunks/{tools-BFK2MvVI.mjs → tools-DMSi-3RW.mjs} +3434 -1240
  74. package/dist/full.mjs +10 -10
  75. package/dist/locales.mjs +86 -67
  76. package/dist/{messages-BK_LsgY4.mjs → messages-0lOPMv8u.mjs} +18 -0
  77. package/dist/{messages-LYJbLq_F.mjs → messages-5wuR90qS.mjs} +18 -0
  78. package/dist/{messages-98nQiC7t2.mjs → messages-6eX0fWGR2.mjs} +18 -0
  79. package/dist/{chunks/messages-DUeiPraX.mjs → messages-9L4qqCKh2.mjs} +18 -0
  80. package/dist/{chunks/messages-Q7-4ZJLB2.mjs → messages-B4zPxKl62.mjs} +18 -0
  81. package/dist/{messages-D0005ti32.mjs → messages-BCMFYqKc2.mjs} +18 -0
  82. package/dist/{chunks/messages-CC_noR8y.mjs → messages-BKXjO3NH.mjs} +18 -0
  83. package/dist/{messages-CRNogopy2.mjs → messages-BLW2GX7J2.mjs} +18 -0
  84. package/dist/{messages-D81w6AmW.mjs → messages-BLfK27kX.mjs} +18 -0
  85. package/dist/{chunks/messages-CPBN4zWc.mjs → messages-BM2kx9Td.mjs} +18 -0
  86. package/dist/{messages-E8NjqzWq2.mjs → messages-BORkMoil2.mjs} +18 -0
  87. package/dist/{messages-Dqu4aX9s.mjs → messages-BPw_x-6H.mjs} +18 -0
  88. package/dist/{messages-DSmxJWju2.mjs → messages-BRY51SEw2.mjs} +18 -0
  89. package/dist/{chunks/messages-BONyZroH.mjs → messages-BSNsrZVN.mjs} +18 -0
  90. package/dist/{chunks/messages-BAlZjPcl.mjs → messages-B_UKuqrH.mjs} +18 -0
  91. package/dist/{chunks/messages-DB_-5Xln.mjs → messages-BrYeJsSE2.mjs} +18 -0
  92. package/dist/{messages-Brd5R-da2.mjs → messages-BwttyHDI2.mjs} +18 -0
  93. package/dist/{messages-qfvXgPpu2.mjs → messages-C-8qb9sf2.mjs} +18 -0
  94. package/dist/{chunks/messages-BbEW9bQz.mjs → messages-C34dTwF72.mjs} +18 -0
  95. package/dist/{messages-BmH2cQHQ.mjs → messages-C67YUZ9-.mjs} +18 -0
  96. package/dist/{messages-DpwMKDV0.mjs → messages-C6yKu_PJ.mjs} +18 -0
  97. package/dist/{messages-Do7Xjy0n.mjs → messages-CA6J_QoC.mjs} +18 -0
  98. package/dist/{messages-DVL0KZE5.mjs → messages-CFUBJfnf.mjs} +18 -0
  99. package/dist/{chunks/messages-DVr1sqfI2.mjs → messages-CLUBh7O_.mjs} +18 -0
  100. package/dist/{chunks/messages-wl8YrvGG.mjs → messages-CLZoy5fQ.mjs} +18 -0
  101. package/dist/{messages-CisR4PNV.mjs → messages-CNGwdIEz.mjs} +18 -0
  102. package/dist/{messages-DopaMHC42.mjs → messages-CR4gHjd82.mjs} +18 -0
  103. package/dist/{messages-DK6dA0O2.mjs → messages-CVMngZNA.mjs} +18 -0
  104. package/dist/{messages-Xc0KUbYl.mjs → messages-Cd5CW5Tt.mjs} +18 -0
  105. package/dist/{chunks/messages-ChK7v1PV.mjs → messages-CrjQ2Op0.mjs} +18 -0
  106. package/dist/{chunks/messages-CRF7nNrO.mjs → messages-Cv1PSaNk.mjs} +18 -0
  107. package/dist/{messages-DOGbHYv-2.mjs → messages-CxZarWTm2.mjs} +18 -0
  108. package/dist/{messages-D3rwCtKn.mjs → messages-D0eT_eWA.mjs} +18 -0
  109. package/dist/{messages-C6ONf71u2.mjs → messages-D6RYu9JW2.mjs} +18 -0
  110. package/dist/{messages-DQORja0D.mjs → messages-D8U5D391.mjs} +18 -0
  111. package/dist/{chunks/messages-EDMC5ukV.mjs → messages-D8dO6OMN.mjs} +18 -0
  112. package/dist/{messages-DfFZ6Yj5.mjs → messages-DA4T9WBe.mjs} +18 -0
  113. package/dist/{chunks/messages-D22e9h7V2.mjs → messages-DB4UKN8D.mjs} +18 -0
  114. package/dist/{chunks/messages-DEBy3nuJ2.mjs → messages-DCdP2ujL.mjs} +18 -0
  115. package/dist/{messages-D05jqBIa2.mjs → messages-DPFuzIdF2.mjs} +18 -0
  116. package/dist/{chunks/messages-DrfRYiM32.mjs → messages-DQ1icG7L.mjs} +18 -0
  117. package/dist/{chunks/messages-a07QVz8U.mjs → messages-DT7dwzEe.mjs} +18 -0
  118. package/dist/{chunks/messages-CszmHAvQ.mjs → messages-DUYxMxrQ2.mjs} +18 -0
  119. package/dist/{chunks/messages-DtoId_bw2.mjs → messages-D_V0kHD7.mjs} +18 -0
  120. package/dist/{messages-BesJaI6A.mjs → messages-DfqM_XvD.mjs} +18 -0
  121. package/dist/{messages-CT-Kdas6.mjs → messages-Di3-WVzq.mjs} +18 -0
  122. package/dist/{messages-BcVB3osF.mjs → messages-Dl0bfeA-.mjs} +18 -0
  123. package/dist/{chunks/messages-C1S9ztpF.mjs → messages-Do3mHd9U.mjs} +18 -0
  124. package/dist/{chunks/messages-BeGZqQwz.mjs → messages-DqDlcEPn.mjs} +18 -0
  125. package/dist/{chunks/messages-CTCe595D2.mjs → messages-DwiykEgr2.mjs} +18 -0
  126. package/dist/{chunks/messages-8Ld7P_9j2.mjs → messages-Dx5n6MLQ2.mjs} +18 -0
  127. package/dist/{messages-LMaR2_bE.mjs → messages-DxEiqa-B.mjs} +18 -0
  128. package/dist/{chunks/messages-CxxyR4vY.mjs → messages-Dxr1BBvo.mjs} +18 -0
  129. package/dist/{messages-D6VIFnSW.mjs → messages-DzknMM7W.mjs} +18 -0
  130. package/dist/{chunks/messages-oMc7qugU2.mjs → messages-ELvF3qMl2.mjs} +18 -0
  131. package/dist/{messages-53w0fPZS2.mjs → messages-JVJdC0Er2.mjs} +18 -0
  132. package/dist/{chunks/messages-BMD37y3q2.mjs → messages-KVerxvZC.mjs} +18 -0
  133. package/dist/{chunks/messages-Du2BffA7.mjs → messages-OOiDDmVw.mjs} +18 -0
  134. package/dist/{messages-uwK7ktqk.mjs → messages-PyOr_YgV.mjs} +18 -0
  135. package/dist/{messages-qbKjjvgd2.mjs → messages-VrQw3tQ62.mjs} +18 -0
  136. package/dist/{messages-CTTmWn4Y2.mjs → messages-WsUHzXMu2.mjs} +18 -0
  137. package/dist/{messages-CZbcxlZt2.mjs → messages-ZHgPRUj02.mjs} +18 -0
  138. package/dist/{messages-DKHbt-7l2.mjs → messages-aoO_TtoE2.mjs} +18 -0
  139. package/dist/{chunks/messages-CW35K1pq.mjs → messages-bh8BiOee2.mjs} +18 -0
  140. package/dist/{messages-BrOWqNCu2.mjs → messages-gZEhkRrR2.mjs} +18 -0
  141. package/dist/{chunks/messages-BRoa9tGl.mjs → messages-hya8YLMj.mjs} +18 -0
  142. package/dist/{messages-CdduYw-q.mjs → messages-tb1FD_ge.mjs} +18 -0
  143. package/dist/react.mjs +2 -2
  144. package/dist/tools.mjs +3 -3
  145. package/dist/vendor.LICENSE.txt +135 -0
  146. package/package.json +2 -1
  147. package/src/blok.ts +48 -0
  148. package/src/components/block/index.ts +21 -2
  149. package/src/components/block-tunes/block-tune-copy-link.ts +82 -0
  150. package/src/components/i18n/locales/am/messages.json +18 -0
  151. package/src/components/i18n/locales/ar/messages.json +18 -0
  152. package/src/components/i18n/locales/az/messages.json +18 -0
  153. package/src/components/i18n/locales/bg/messages.json +18 -0
  154. package/src/components/i18n/locales/bn/messages.json +18 -0
  155. package/src/components/i18n/locales/bs/messages.json +18 -0
  156. package/src/components/i18n/locales/cs/messages.json +18 -0
  157. package/src/components/i18n/locales/da/messages.json +18 -0
  158. package/src/components/i18n/locales/de/messages.json +18 -0
  159. package/src/components/i18n/locales/dv/messages.json +18 -0
  160. package/src/components/i18n/locales/el/messages.json +18 -0
  161. package/src/components/i18n/locales/en/messages.json +19 -0
  162. package/src/components/i18n/locales/es/messages.json +18 -0
  163. package/src/components/i18n/locales/et/messages.json +18 -0
  164. package/src/components/i18n/locales/fa/messages.json +18 -0
  165. package/src/components/i18n/locales/fi/messages.json +18 -0
  166. package/src/components/i18n/locales/fil/messages.json +18 -0
  167. package/src/components/i18n/locales/fr/messages.json +18 -0
  168. package/src/components/i18n/locales/gu/messages.json +18 -0
  169. package/src/components/i18n/locales/he/messages.json +18 -0
  170. package/src/components/i18n/locales/hi/messages.json +18 -0
  171. package/src/components/i18n/locales/hr/messages.json +18 -0
  172. package/src/components/i18n/locales/hu/messages.json +18 -0
  173. package/src/components/i18n/locales/hy/messages.json +18 -0
  174. package/src/components/i18n/locales/id/messages.json +18 -0
  175. package/src/components/i18n/locales/it/messages.json +18 -0
  176. package/src/components/i18n/locales/ja/messages.json +18 -0
  177. package/src/components/i18n/locales/ka/messages.json +18 -0
  178. package/src/components/i18n/locales/km/messages.json +18 -0
  179. package/src/components/i18n/locales/kn/messages.json +18 -0
  180. package/src/components/i18n/locales/ko/messages.json +18 -0
  181. package/src/components/i18n/locales/ku/messages.json +18 -0
  182. package/src/components/i18n/locales/lo/messages.json +18 -0
  183. package/src/components/i18n/locales/lt/messages.json +18 -0
  184. package/src/components/i18n/locales/lv/messages.json +18 -0
  185. package/src/components/i18n/locales/mk/messages.json +18 -0
  186. package/src/components/i18n/locales/ml/messages.json +18 -0
  187. package/src/components/i18n/locales/mn/messages.json +18 -0
  188. package/src/components/i18n/locales/mr/messages.json +18 -0
  189. package/src/components/i18n/locales/ms/messages.json +18 -0
  190. package/src/components/i18n/locales/my/messages.json +18 -0
  191. package/src/components/i18n/locales/ne/messages.json +18 -0
  192. package/src/components/i18n/locales/nl/messages.json +18 -0
  193. package/src/components/i18n/locales/no/messages.json +18 -0
  194. package/src/components/i18n/locales/pa/messages.json +18 -0
  195. package/src/components/i18n/locales/pl/messages.json +18 -0
  196. package/src/components/i18n/locales/ps/messages.json +18 -0
  197. package/src/components/i18n/locales/pt/messages.json +18 -0
  198. package/src/components/i18n/locales/ro/messages.json +18 -0
  199. package/src/components/i18n/locales/ru/messages.json +18 -0
  200. package/src/components/i18n/locales/sd/messages.json +18 -0
  201. package/src/components/i18n/locales/si/messages.json +18 -0
  202. package/src/components/i18n/locales/sk/messages.json +18 -0
  203. package/src/components/i18n/locales/sl/messages.json +18 -0
  204. package/src/components/i18n/locales/sq/messages.json +18 -0
  205. package/src/components/i18n/locales/sr/messages.json +18 -0
  206. package/src/components/i18n/locales/sv/messages.json +18 -0
  207. package/src/components/i18n/locales/sw/messages.json +18 -0
  208. package/src/components/i18n/locales/ta/messages.json +18 -0
  209. package/src/components/i18n/locales/te/messages.json +18 -0
  210. package/src/components/i18n/locales/th/messages.json +18 -0
  211. package/src/components/i18n/locales/tr/messages.json +18 -0
  212. package/src/components/i18n/locales/ug/messages.json +18 -0
  213. package/src/components/i18n/locales/uk/messages.json +18 -0
  214. package/src/components/i18n/locales/ur/messages.json +18 -0
  215. package/src/components/i18n/locales/vi/messages.json +18 -0
  216. package/src/components/i18n/locales/yi/messages.json +18 -0
  217. package/src/components/i18n/locales/zh/messages.json +18 -0
  218. package/src/components/icons/index.ts +65 -0
  219. package/src/components/inline-tools/inline-tool-bold.ts +10 -0
  220. package/src/components/inline-tools/inline-tool-code.ts +54 -1
  221. package/src/components/inline-tools/inline-tool-italic.ts +54 -1
  222. package/src/components/inline-tools/inline-tool-strikethrough.ts +54 -1
  223. package/src/components/inline-tools/inline-tool-underline.ts +54 -1
  224. package/src/components/inline-tools/services/bold-normalization-pass.ts +29 -3
  225. package/src/components/inline-tools/utils/formatting-range-utils.ts +83 -0
  226. package/src/components/modules/api/tools.ts +19 -0
  227. package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +5 -5
  228. package/src/components/modules/blockManager/blockManager.ts +22 -0
  229. package/src/components/modules/blockManager/event-binder.ts +12 -1
  230. package/src/components/modules/blockManager/factory.ts +4 -0
  231. package/src/components/modules/blockManager/types.ts +4 -0
  232. package/src/components/modules/blockManager/yjs-sync.ts +16 -2
  233. package/src/components/modules/paste/google-docs-preprocessor.ts +49 -3
  234. package/src/components/modules/paste/handlers/table-cells-handler.ts +12 -2
  235. package/src/components/modules/paste/index.ts +8 -4
  236. package/src/components/modules/paste/types.ts +2 -0
  237. package/src/components/modules/renderer.ts +22 -2
  238. package/src/components/modules/saver.ts +19 -1
  239. package/src/components/modules/themeManager.ts +3 -1
  240. package/src/components/modules/toolbar/blockSettings.ts +51 -1
  241. package/src/components/modules/toolbar/index.ts +95 -3
  242. package/src/components/modules/toolbar/inline/index.ts +0 -3
  243. package/src/components/modules/toolbar/plus-button.ts +37 -0
  244. package/src/components/modules/toolbar/settings-toggler.ts +6 -0
  245. package/src/components/modules/tools.ts +5 -0
  246. package/src/components/modules/uiControllers/controllers/keyboard.ts +85 -22
  247. package/src/components/modules/uiControllers/controllers/selection.ts +14 -2
  248. package/src/components/modules/yjs/document-store.ts +22 -0
  249. package/src/components/modules/yjs/index.ts +10 -0
  250. package/src/components/modules/yjs/serializer.ts +20 -0
  251. package/src/components/selection/cursor.ts +12 -2
  252. package/src/components/ui/toolbox.ts +31 -5
  253. package/src/components/utils/id-generator.ts +11 -0
  254. package/src/components/utils/key-icon.ts +187 -0
  255. package/src/components/utils/popover/components/hint/hint.ts +3 -1
  256. package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +18 -5
  257. package/src/components/utils/popover/popover-abstract.ts +45 -0
  258. package/src/components/utils/popover/popover-desktop.ts +1 -0
  259. package/src/components/utils/popover/popover-position.ts +12 -5
  260. package/src/components/utils/popover/popover.const.ts +2 -0
  261. package/src/components/utils.ts +1 -0
  262. package/src/styles/main.css +1269 -0
  263. package/src/tools/code/index.ts +4 -0
  264. package/src/tools/database/database-backend-sync.ts +132 -0
  265. package/src/tools/database/database-board-view.ts +410 -0
  266. package/src/tools/database/database-card-drag.ts +306 -0
  267. package/src/tools/database/database-card-drawer.ts +546 -0
  268. package/src/tools/database/database-column-controls.ts +141 -0
  269. package/src/tools/database/database-column-drag.ts +262 -0
  270. package/src/tools/database/database-keyboard.ts +35 -0
  271. package/src/tools/database/database-list-row-drag.ts +245 -0
  272. package/src/tools/database/database-list-view.ts +333 -0
  273. package/src/tools/database/database-model.ts +214 -0
  274. package/src/tools/database/database-property-type-popover.ts +108 -0
  275. package/src/tools/database/database-tab-bar.ts +558 -0
  276. package/src/tools/database/database-view-popover.ts +129 -0
  277. package/src/tools/database/database-view-renderer.ts +25 -0
  278. package/src/tools/database/index.ts +1223 -0
  279. package/src/tools/database/types.ts +152 -0
  280. package/src/tools/database-row/index.ts +74 -0
  281. package/src/tools/index.ts +4 -0
  282. package/src/tools/table/index.ts +10 -19
  283. package/src/tools/table/table-cell-selection.ts +126 -7
  284. package/src/tools/table/table-core.ts +59 -5
  285. package/src/tools/table/table-model.ts +8 -0
  286. package/src/tools/table/table-row-col-controls.ts +40 -18
  287. package/types/api/tools.d.ts +18 -0
  288. package/types/configs/blok-config.d.ts +27 -0
  289. package/types/data-formats/output-data.d.ts +13 -0
  290. package/types/index.d.ts +17 -0
  291. package/types/tools/database.d.ts +152 -0
  292. package/types/tools-entry.d.ts +7 -4
  293. package/types/utils/popover/popover.d.ts +6 -0
@@ -1,7 +1,7 @@
1
1
  import type { I18n } from '../../../types/api';
2
2
  import { twMerge } from '../../components/utils/tw';
3
3
 
4
- import { BORDER_WIDTH, CELL_ATTR, ROW_ATTR } from './table-core';
4
+ import { BORDER_WIDTH, CELL_ATTR, CELL_COL_ATTR, CELL_ROW_ATTR, ROW_ATTR } from './table-core';
5
5
  import { collapseGrip, createGripDotsSvg, expandGrip, GRIP_HOVER_SIZE, setGripPillSize } from './table-grip-visuals';
6
6
  import { getCumulativeColEdges, TableRowColDrag } from './table-row-col-drag';
7
7
  import { createGripPopover } from './table-row-col-popover';
@@ -419,11 +419,39 @@ export class TableRowColControls {
419
419
  }
420
420
 
421
421
  const rowEl = rows[i] as HTMLElement;
422
- const centerY = rowEl.offsetTop + rowEl.offsetHeight / 2;
423
- const style = grip.style;
424
422
 
425
- style.left = `${-BORDER_WIDTH / 2}px`;
426
- style.top = `${centerY}px`;
423
+ // Find the cell with the maximum rowSpan in this row to correctly
424
+ // center the grip over merged cells that span multiple rows.
425
+ const cellsInRow = this.grid.querySelectorAll<HTMLElement>(`[${CELL_ROW_ATTR}="${i}"]`);
426
+ const originCell = Array.from(cellsInRow).reduce<HTMLTableCellElement | null>((best, cell) => {
427
+ const tdCell = cell as HTMLTableCellElement;
428
+ const bestSpan = best !== null ? best.rowSpan || 1 : 0;
429
+
430
+ return (tdCell.rowSpan || 1) > bestSpan ? tdCell : best;
431
+ }, null);
432
+ const maxRowSpan = originCell !== null ? (originCell.rowSpan || 1) : 1;
433
+
434
+ if (maxRowSpan > 1 && originCell !== null) {
435
+ // Use getBoundingClientRect() on the origin cell to get its actual rendered
436
+ // height — summing tr.offsetHeight is inaccurate when the merged cell's
437
+ // content forces the browser to redistribute height across rows (each
438
+ // individual tr.offsetHeight stays at its minimum rather than reflecting
439
+ // the full visual contribution of the merged content).
440
+ const container = this.overlay ?? this.grid;
441
+ const containerRect = container.getBoundingClientRect();
442
+ const cellRect = originCell.getBoundingClientRect();
443
+ const centerY = cellRect.top - containerRect.top + cellRect.height / 2;
444
+ const style = grip.style;
445
+
446
+ style.left = `${-BORDER_WIDTH / 2}px`;
447
+ style.top = `${centerY}px`;
448
+ } else {
449
+ const centerY = rowEl.offsetTop + rowEl.offsetHeight / 2;
450
+ const style = grip.style;
451
+
452
+ style.left = `${-BORDER_WIDTH / 2}px`;
453
+ style.top = `${centerY}px`;
454
+ }
427
455
  });
428
456
  }
429
457
 
@@ -482,27 +510,21 @@ export class TableRowColControls {
482
510
  }
483
511
 
484
512
  private getCellPosition(cell: HTMLElement): { row: number; col: number } | null {
485
- const row = cell.closest<HTMLElement>(`[${ROW_ATTR}]`);
486
-
487
- if (!row) {
488
- return null;
489
- }
490
-
491
- const rows = Array.from(this.grid.querySelectorAll(`[${ROW_ATTR}]`));
492
- const rowIndex = rows.indexOf(row);
513
+ const rowAttr = cell.getAttribute(CELL_ROW_ATTR);
514
+ const colAttr = cell.getAttribute(CELL_COL_ATTR);
493
515
 
494
- if (rowIndex < 0) {
516
+ if (rowAttr === null || colAttr === null) {
495
517
  return null;
496
518
  }
497
519
 
498
- const cells = Array.from(row.querySelectorAll(`[${CELL_ATTR}]`));
499
- const colIndex = cells.indexOf(cell);
520
+ const row = parseInt(rowAttr, 10);
521
+ const col = parseInt(colAttr, 10);
500
522
 
501
- if (colIndex < 0) {
523
+ if (isNaN(row) || isNaN(col)) {
502
524
  return null;
503
525
  }
504
526
 
505
- return { row: rowIndex, col: colIndex };
527
+ return { row, col };
506
528
  }
507
529
 
508
530
  /**
@@ -1,4 +1,16 @@
1
1
  import { BlockToolAdapter } from '../tools/adapters/block-tool-adapter';
2
+ import { ToolConstructable, ToolSettings } from '../tools';
3
+ import { ThemeMode } from './theme';
4
+
5
+ /**
6
+ * Tools-related configuration that can be passed to a nested Blok instance.
7
+ */
8
+ export interface ToolsConfig {
9
+ tools: { [toolName: string]: ToolConstructable | ToolSettings } | undefined;
10
+ inlineToolbar?: string[] | boolean;
11
+ tunes?: string[];
12
+ theme?: ThemeMode;
13
+ }
2
14
 
3
15
  /**
4
16
  * Describes methods for accessing installed Blok tools
@@ -8,4 +20,10 @@ export interface Tools {
8
20
  * Returns all available Block Tools
9
21
  */
10
22
  getBlockTools(): BlockToolAdapter[];
23
+
24
+ /**
25
+ * Returns the tools-related configuration of the current editor instance.
26
+ * Useful for creating nested Blok editors with the same tools.
27
+ */
28
+ getToolsConfig(): ToolsConfig;
11
29
  }
@@ -183,4 +183,31 @@ export interface BlokConfig {
183
183
  * @param resolvedTheme - the resolved theme ('dark' or 'light')
184
184
  */
185
185
  onThemeChange?: (resolvedTheme: ResolvedTheme) => void;
186
+
187
+ /**
188
+ * Options for the automatic scroll-to-block behavior on hash navigation.
189
+ * When the page URL contains a hash (`#<blockId>`) that matches a block ID,
190
+ * the editor smooth-scrolls to that block once all blocks are rendered.
191
+ * This behavior is always active — this config object only controls offset.
192
+ * No-op if the URL contains no hash or the hash does not match any block ID.
193
+ */
194
+ scrollToBlock?: {
195
+ /**
196
+ * Pixels to leave above the block when scrolling into view.
197
+ * Useful when a sticky header is present.
198
+ * @default 0
199
+ */
200
+ topOffset?: number;
201
+ };
202
+
203
+ /**
204
+ * User identity for edit tracking.
205
+ * When set, the user's name is recorded on each block they edit.
206
+ */
207
+ user?: {
208
+ /**
209
+ * Display name shown in the "Last edited by" footer in block settings.
210
+ */
211
+ name: string;
212
+ };
186
213
  }
@@ -41,6 +41,19 @@ export interface OutputBlockData<Type extends string = string, Data extends obje
41
41
  * Omit if block has no children.
42
42
  */
43
43
  content?: BlockId[];
44
+
45
+ /**
46
+ * Timestamp (milliseconds since epoch) of the last edit to this block.
47
+ * Automatically tracked by the editor when content changes.
48
+ * Omit for legacy data or blocks that haven't been edited.
49
+ */
50
+ lastEditedAt?: number;
51
+
52
+ /**
53
+ * Display name of the user who last edited this block.
54
+ * Set from the `user.name` config option. Omit if no user is configured.
55
+ */
56
+ lastEditedBy?: string;
44
57
  }
45
58
 
46
59
  export interface OutputData {
package/types/index.d.ts CHANGED
@@ -88,6 +88,23 @@ export {
88
88
  export * from './utils/popover';
89
89
 
90
90
  export { OutputData, OutputBlockData} from './data-formats/output-data';
91
+ export {
92
+ PropertyType,
93
+ SelectOption,
94
+ SelectPropertyConfig,
95
+ PropertyConfig,
96
+ PropertyDefinition,
97
+ PropertyValue,
98
+ DatabaseRow,
99
+ ViewType,
100
+ SortConfig,
101
+ FilterConfig,
102
+ DatabaseViewConfig,
103
+ DatabaseRowData,
104
+ DatabaseData,
105
+ DatabaseAdapter,
106
+ DatabaseConfig,
107
+ } from './tools/database';
91
108
  export { BlockId } from './data-formats/block-id';
92
109
  export {
93
110
  BlockAPI,
@@ -0,0 +1,152 @@
1
+ import { BlockToolData } from './block-tool';
2
+ import { OutputData } from '../data-formats/output-data';
3
+
4
+ // ─── Property types ───
5
+
6
+ export type PropertyType = 'title' | 'text' | 'number' | 'select' | 'multiSelect' | 'date' | 'checkbox' | 'url' | 'richText';
7
+
8
+ export interface SelectOption {
9
+ id: string;
10
+ label: string;
11
+ color?: string;
12
+ position: string;
13
+ }
14
+
15
+ export interface SelectPropertyConfig {
16
+ options: SelectOption[];
17
+ }
18
+
19
+ export type PropertyConfig = SelectPropertyConfig;
20
+
21
+ export interface PropertyDefinition {
22
+ id: string;
23
+ name: string;
24
+ type: PropertyType;
25
+ position: string;
26
+ config?: PropertyConfig;
27
+ }
28
+
29
+ export type PropertyValue = string | number | boolean | string[] | OutputData | null;
30
+
31
+ // ─── Rows ───
32
+
33
+ export interface DatabaseRow {
34
+ id: string;
35
+ position: string;
36
+ properties: Record<string, PropertyValue>;
37
+ }
38
+
39
+ export interface DatabaseRowData extends BlockToolData {
40
+ properties: Record<string, PropertyValue>;
41
+ position: string;
42
+ }
43
+
44
+ // ─── View config ───
45
+
46
+ export type ViewType = 'board' | 'table' | 'gallery' | 'list';
47
+
48
+ export interface SortConfig {
49
+ propertyId: string;
50
+ direction: 'asc' | 'desc';
51
+ }
52
+
53
+ export interface FilterConfig {
54
+ propertyId: string;
55
+ operator: string;
56
+ value: PropertyValue;
57
+ }
58
+
59
+ export interface DatabaseViewConfig {
60
+ id: string;
61
+ name: string;
62
+ type: ViewType;
63
+ position: string;
64
+ groupBy?: string;
65
+ sorts: SortConfig[];
66
+ filters: FilterConfig[];
67
+ visibleProperties: string[];
68
+ }
69
+
70
+ // ─── Top-level saved data ───
71
+
72
+ /**
73
+ * Data saved by the database block.
74
+ * Schema and views only — rows are child blocks (database-row type).
75
+ */
76
+ export interface DatabaseData extends BlockToolData {
77
+ schema: PropertyDefinition[];
78
+ views: DatabaseViewConfig[];
79
+ activeViewId: string;
80
+ }
81
+
82
+ // ─── Adapter ───
83
+
84
+ export interface DatabaseAdapter {
85
+ loadDatabase(): Promise<{
86
+ schema: PropertyDefinition[];
87
+ views: DatabaseViewConfig[];
88
+ }>;
89
+
90
+ createRow(params: {
91
+ id: string;
92
+ properties: Record<string, PropertyValue>;
93
+ position: string;
94
+ }): Promise<DatabaseRow>;
95
+
96
+ updateRow(params: {
97
+ rowId: string;
98
+ properties: Record<string, PropertyValue>;
99
+ }): Promise<DatabaseRow>;
100
+
101
+ moveRow(params: {
102
+ rowId: string;
103
+ position: string;
104
+ }): Promise<DatabaseRow>;
105
+
106
+ deleteRow(params: {
107
+ rowId: string;
108
+ }): Promise<void>;
109
+
110
+ createProperty(params: {
111
+ id: string;
112
+ name: string;
113
+ type: PropertyType;
114
+ position: string;
115
+ config?: PropertyConfig;
116
+ }): Promise<PropertyDefinition>;
117
+
118
+ updateProperty(params: {
119
+ propertyId: string;
120
+ changes: Partial<Pick<PropertyDefinition, 'name' | 'config'>>;
121
+ }): Promise<PropertyDefinition>;
122
+
123
+ deleteProperty(params: {
124
+ propertyId: string;
125
+ }): Promise<void>;
126
+
127
+ createView(params: {
128
+ id: string;
129
+ name: string;
130
+ type: ViewType;
131
+ position: string;
132
+ groupBy?: string;
133
+ sorts?: SortConfig[];
134
+ filters?: FilterConfig[];
135
+ visibleProperties?: string[];
136
+ }): Promise<DatabaseViewConfig>;
137
+
138
+ updateView(params: {
139
+ viewId: string;
140
+ changes: Partial<Pick<DatabaseViewConfig,
141
+ 'name' | 'type' | 'position' | 'groupBy' | 'sorts' | 'filters' | 'visibleProperties'
142
+ >>;
143
+ }): Promise<DatabaseViewConfig>;
144
+
145
+ deleteView(params: {
146
+ viewId: string;
147
+ }): Promise<void>;
148
+ }
149
+
150
+ export interface DatabaseConfig {
151
+ adapter?: DatabaseAdapter;
152
+ }
@@ -11,8 +11,9 @@ import { ToggleConstructable, ToggleData, ToggleConfig } from './tools/toggle';
11
11
  import { DividerConstructable, DividerData } from './tools/divider';
12
12
  import { CalloutConstructable, CalloutData, CalloutConfig } from './tools/callout';
13
13
  import { QuoteConstructable, QuoteData } from './tools/quote';
14
+ import { BlockToolConstructable } from './tools/block-tool';
15
+ import { DatabaseData, DatabaseConfig, DatabaseAdapter, DatabaseViewConfig, DatabaseRowData } from './tools/database';
14
16
  import { InlineToolConstructable } from './tools/inline-tool';
15
- import { BlockTuneConstructable } from './block-tunes';
16
17
  import { ToolSettings } from './tools';
17
18
 
18
19
  // Block tools
@@ -24,6 +25,8 @@ export const Toggle: ToggleConstructable;
24
25
  export const Divider: DividerConstructable;
25
26
  export const Callout: CalloutConstructable;
26
27
  export const Quote: QuoteConstructable;
28
+ export const Database: BlockToolConstructable;
29
+ export const DatabaseRow: BlockToolConstructable; // DatabaseRowTool (block tool), distinct from DatabaseRow interface in types/tools/database.d.ts
27
30
 
28
31
  // Re-export data and config types for convenience
29
32
  export { HeaderData, HeaderConfig } from './tools/header';
@@ -34,6 +37,7 @@ export { ToggleData, ToggleConfig } from './tools/toggle';
34
37
  export { DividerData } from './tools/divider';
35
38
  export { CalloutData, CalloutConfig } from './tools/callout';
36
39
  export { QuoteData } from './tools/quote';
40
+ export { DatabaseData, DatabaseConfig, DatabaseAdapter, DatabaseViewConfig, DatabaseRowData } from './tools/database';
37
41
 
38
42
  // Inline tools
39
43
  export const Bold: InlineToolConstructable;
@@ -44,9 +48,6 @@ export const Marker: InlineToolConstructable;
44
48
  export const Strikethrough: InlineToolConstructable;
45
49
  export const Underline: InlineToolConstructable;
46
50
 
47
- // Block tunes
48
- export const Delete: BlockTuneConstructable;
49
-
50
51
  /**
51
52
  * Default block tools configuration
52
53
  */
@@ -57,6 +58,8 @@ export const defaultBlockTools: {
57
58
  readonly table: {};
58
59
  readonly toggle: {};
59
60
  readonly callout: {};
61
+ readonly database: {};
62
+ readonly 'database-row': {};
60
63
  readonly divider: {};
61
64
  readonly quote: {};
62
65
  };
@@ -146,6 +146,12 @@ export interface PopoverNodes {
146
146
 
147
147
  /** Popover items wrapper */
148
148
  items: HTMLElement;
149
+
150
+ /** Top scroll haze gradient overlay */
151
+ scrollHazeTop: HTMLElement;
152
+
153
+ /** Bottom scroll haze gradient overlay */
154
+ scrollHazeBottom: HTMLElement;
149
155
  }
150
156
 
151
157
  /**