@jackuait/blok 0.10.0-beta.5 → 0.10.0-beta.7

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 (471) hide show
  1. package/codemod/migrate-editorjs-to-blok.js +0 -2
  2. package/codemod/test.js +0 -6
  3. package/dist/blok.mjs +3 -3
  4. package/dist/chunks/_basePickBy-BHRNO12X.mjs +410 -0
  5. package/dist/chunks/_baseUniq-DtFPDBML.mjs +1045 -0
  6. package/dist/chunks/_getTag-ozrhqxk_.mjs +26 -0
  7. package/dist/chunks/arc-BEqJP9HX.mjs +80 -0
  8. package/dist/chunks/architecture-YZFGNWBL-Bcu-90pi.mjs +3 -0
  9. package/dist/chunks/architectureDiagram-Q4EWVU46-BMno5LCn.mjs +4066 -0
  10. package/dist/chunks/array-Cyf-61SV.mjs +6 -0
  11. package/dist/chunks/blockDiagram-DXYQGD6D-DlP_cPth.mjs +3259 -0
  12. package/dist/chunks/{blok-DH-WEcA8.mjs → blok-CiLRmoHI.mjs} +2030 -1996
  13. package/dist/chunks/c4Diagram-AHTNJAMY-BbVV8EXj.mjs +2956 -0
  14. package/dist/chunks/channel-DPcniO2B.mjs +5 -0
  15. package/dist/chunks/chunk-2KRD3SAO-CazES4VS.mjs +20 -0
  16. package/dist/chunks/chunk-336JU56O-heO72r_k.mjs +49 -0
  17. package/dist/chunks/chunk-426QAEUC-CmCcml1z.mjs +13 -0
  18. package/dist/chunks/chunk-4BX2VUAB-B10DxOza.mjs +19 -0
  19. package/dist/chunks/chunk-4TB4RGXK-B0snhZOU.mjs +3250 -0
  20. package/dist/chunks/chunk-55IACEB6-CGkn5ABd.mjs +8 -0
  21. package/dist/chunks/chunk-5FUZZQ4R-USdumo_u.mjs +3786 -0
  22. package/dist/chunks/chunk-5PVQY5BW-CxUGVzQL.mjs +1692 -0
  23. package/dist/chunks/chunk-67CJDMHE-Bvw55oRa.mjs +20 -0
  24. package/dist/chunks/chunk-7N4EOEYR-Bs2qDy88.mjs +29 -0
  25. package/dist/chunks/chunk-AA7GKIK3-Bss0LgrN.mjs +24 -0
  26. package/dist/chunks/chunk-BSJP7CBP-CpUW7gi5.mjs +83 -0
  27. package/dist/chunks/chunk-CIAEETIT-DlRbLLf3.mjs +20 -0
  28. package/dist/chunks/chunk-D6kmoKXy.mjs +20 -0
  29. package/dist/chunks/chunk-EDXVE4YY-DEcX4XWm.mjs +26 -0
  30. package/dist/chunks/chunk-ENJZ2VHE-B4THRZkR.mjs +566 -0
  31. package/dist/chunks/chunk-FMBD7UC4-CF6BKEiV.mjs +5 -0
  32. package/dist/chunks/chunk-FOC6F5B3--xuza7Yn.mjs +20 -0
  33. package/dist/chunks/chunk-ICPOFSXX-BMja8cuy.mjs +3290 -0
  34. package/dist/chunks/chunk-K5T4RW27-CHEqGHFS.mjs +16370 -0
  35. package/dist/chunks/chunk-KGLVRYIC-DHYYpR8v.mjs +20 -0
  36. package/dist/chunks/chunk-LIHQZDEY-AvbOvyLE.mjs +55 -0
  37. package/dist/chunks/chunk-ORNJ4GCN-38fbR5OS.mjs +25 -0
  38. package/dist/chunks/chunk-OYMX7WX6-BiqlATPA.mjs +2038 -0
  39. package/dist/chunks/chunk-QZHKN3VN-DitZIvj8.mjs +12 -0
  40. package/dist/chunks/chunk-U2HBQHQK-DJytnHmZ.mjs +1875 -0
  41. package/dist/chunks/chunk-X2U36JSP-DlOifw1K.mjs +68 -0
  42. package/dist/chunks/chunk-XPW4576I-s4fsi4XO.mjs +1146 -0
  43. package/dist/chunks/chunk-YZCP3GAM-Ch258bXC.mjs +60 -0
  44. package/dist/chunks/chunk-ZZ45TVLE-DWziaKxP.mjs +33 -0
  45. package/dist/chunks/classDiagram-6PBFFD2Q-BOkAe08u.mjs +30 -0
  46. package/dist/chunks/classDiagram-v2-HSJHXN6E-DeKatSvh.mjs +30 -0
  47. package/dist/chunks/clone-CJCz7VRp.mjs +8 -0
  48. package/dist/chunks/{constants-Ccno9NZS.mjs → constants-DFS8l39Y.mjs} +525 -552
  49. package/dist/chunks/cose-bilkent-S5V4N54A-CzLGVqvr.mjs +2246 -0
  50. package/dist/chunks/cytoscape.esm-D0iglm-M.mjs +18108 -0
  51. package/dist/chunks/dagre-KV5264BT-XbHSjleO.mjs +298 -0
  52. package/dist/chunks/dagre-XY8CZ1sg.mjs +1536 -0
  53. package/dist/chunks/default-DIfXCS2E.mjs +4 -0
  54. package/dist/chunks/defaultLocale-DFhS1600.mjs +201 -0
  55. package/dist/chunks/diagram-5BDNPKRD-CM7c3UTI.mjs +112 -0
  56. package/dist/chunks/diagram-G4DWMVQ6-Bhg4ps6b.mjs +546 -0
  57. package/dist/chunks/diagram-MMDJMWI5-C-UCVaxB.mjs +234 -0
  58. package/dist/chunks/diagram-TYMM5635-BOHSujSD.mjs +144 -0
  59. package/dist/chunks/dist-DHsXIYdd.mjs +59 -0
  60. package/dist/chunks/erDiagram-SMLLAGMA-CwKxXFMB.mjs +1712 -0
  61. package/dist/chunks/flowDiagram-DWJPFMVM-rQJKfyuO.mjs +4175 -0
  62. package/dist/chunks/ganttDiagram-T4ZO3ILL-DfaZirLX.mjs +3083 -0
  63. package/dist/chunks/gitGraph-7Q5UKJZL-BKG8cHGz.mjs +3 -0
  64. package/dist/chunks/gitGraphDiagram-UUTBAWPF-CRa-ymsI.mjs +792 -0
  65. package/dist/chunks/graphlib-CuDElSdG.mjs +223 -0
  66. package/dist/chunks/{i18next-G6FKbZqA.mjs → i18next-BBGW2sDE.mjs} +1 -1
  67. package/dist/chunks/{i18next-loader-CwNimni3.mjs → i18next-loader-CasQQb5s.mjs} +2 -2
  68. package/dist/chunks/info-OMHHGYJF-FKqYyUn9.mjs +3 -0
  69. package/dist/chunks/infoDiagram-42DDH7IO-CvyJU2nE.mjs +29 -0
  70. package/dist/chunks/init-JlKGZtuT.mjs +15 -0
  71. package/dist/chunks/ishikawaDiagram-UXIWVN3A-CIpbw1BK.mjs +719 -0
  72. package/dist/chunks/journeyDiagram-VCZTEJTY-H96UcUK9.mjs +885 -0
  73. package/dist/chunks/kanban-definition-6JOO6SKY-BYZT3srA.mjs +980 -0
  74. package/dist/chunks/katex-JyOgX6MW.mjs +22026 -0
  75. package/dist/chunks/{lightweight-i18n-DWCdzAw0.mjs → lightweight-i18n-Cvv8CWh4.mjs} +29 -18
  76. package/dist/chunks/line-B9xUUA7k.mjs +34 -0
  77. package/dist/chunks/linear-Dj-1yA_B.mjs +289 -0
  78. package/dist/chunks/mdast-util-math-CHYUxOHk.mjs +151 -0
  79. package/dist/chunks/mermaid-parser.core-D6OPAUtM.mjs +57 -0
  80. package/dist/chunks/mermaid.core-BPN9ZHKQ.mjs +989 -0
  81. package/dist/{messages-B-4fku2H2.mjs → chunks/messages--YKhFEDE.mjs} +30 -19
  82. package/dist/{messages-BCG_evLg.mjs → chunks/messages-0Uwu1AMJ2.mjs} +28 -17
  83. package/dist/{messages-CdlsTFB1.mjs → chunks/messages-1__0Ph4Q.mjs} +28 -17
  84. package/dist/chunks/{messages-wLSVQbsA2.mjs → messages-4sm9Pb0C.mjs} +28 -17
  85. package/dist/chunks/{messages-R2W_rGOo2.mjs → messages-4uxjtzKW.mjs} +28 -17
  86. package/dist/chunks/{messages-Dm4YVlrm.mjs → messages-B-SwLgkQ.mjs} +30 -19
  87. package/dist/{messages--S8_taOd2.mjs → chunks/messages-B1ylBxXQ.mjs} +28 -17
  88. package/dist/chunks/{messages-B7MIRzCa2.mjs → messages-B5m3dhKc.mjs} +28 -17
  89. package/dist/chunks/{messages-Dplnp19q.mjs → messages-B6n2zDtv.mjs} +29 -18
  90. package/dist/chunks/{messages-DD7BI6BK.mjs → messages-BC9w4zAT.mjs} +28 -17
  91. package/dist/chunks/{messages-BrFl5773.mjs → messages-BOj-7N3p.mjs} +28 -17
  92. package/dist/chunks/{messages-BbdNugdi.mjs → messages-BRYHTS18.mjs} +28 -17
  93. package/dist/chunks/{messages-JQKFJo7C.mjs → messages-BSBbVjor.mjs} +35 -24
  94. package/dist/{messages-CBzd_x7H.mjs → chunks/messages-BUUkmUGc.mjs} +28 -17
  95. package/dist/{messages-CjmSrt1D.mjs → chunks/messages-Bb3YEV2P.mjs} +33 -22
  96. package/dist/{messages-BvgXeMSL2.mjs → chunks/messages-Be_6YLzJ.mjs} +29 -18
  97. package/dist/{messages-pgPcitDH.mjs → chunks/messages-BevRhv5d.mjs} +28 -17
  98. package/dist/chunks/{messages-BW_7lfqG2.mjs → messages-Bhqr7Im2.mjs} +28 -17
  99. package/dist/chunks/{messages-LxumrNue2.mjs → messages-BpJFjSKa.mjs} +29 -18
  100. package/dist/{messages-xEI8gEDK.mjs → chunks/messages-BqYlq_Bn.mjs} +28 -17
  101. package/dist/{messages-CBdQ3XP9.mjs → chunks/messages-BtAwCUfD.mjs} +28 -17
  102. package/dist/{messages-D3cAcyzj.mjs → chunks/messages-Bthbp65G.mjs} +29 -18
  103. package/dist/{messages-CYX48nfg.mjs → chunks/messages-BvHMZ8Pi2.mjs} +28 -17
  104. package/dist/{messages-Dddxv8-f2.mjs → chunks/messages-Bw1BE9jW.mjs} +28 -17
  105. package/dist/chunks/{messages-d0Ky6QjR.mjs → messages-Bx6Wt285.mjs} +28 -17
  106. package/dist/chunks/{messages-BPog17132.mjs → messages-BzslJRYv.mjs} +29 -18
  107. package/dist/{messages-hTpeKUaW.mjs → chunks/messages-C02M0Tpw.mjs} +28 -17
  108. package/dist/chunks/{messages-C-b6tPad2.mjs → messages-C1u3E9qg.mjs} +28 -17
  109. package/dist/{messages-BJ7BuFZi.mjs → chunks/messages-C68WgSKk.mjs} +29 -18
  110. package/dist/chunks/{messages-Bpda_3PM2.mjs → messages-C8w8JCP0.mjs} +30 -19
  111. package/dist/chunks/{messages-CmrMwBv3.mjs → messages-CFOZdSk4.mjs} +28 -17
  112. package/dist/{messages-DVQNjdPk.mjs → chunks/messages-CGOY79lr.mjs} +28 -17
  113. package/dist/chunks/{messages-DAVsuDWh2.mjs → messages-CGaSMZPu.mjs} +28 -17
  114. package/dist/{messages-DtrSrdfE2.mjs → chunks/messages-CJJgQ0BH.mjs} +28 -17
  115. package/dist/{messages-CgzbJ8_l2.mjs → chunks/messages-CTD6rtQj2.mjs} +28 -17
  116. package/dist/chunks/{messages-p4byLfvR.mjs → messages-CZymJML9.mjs} +32 -21
  117. package/dist/{messages-CqkRG9mH.mjs → chunks/messages-CfeFJbiv.mjs} +32 -21
  118. package/dist/{messages-DjJQoYvP2.mjs → chunks/messages-Cgatzu_z.mjs} +30 -19
  119. package/dist/{messages-CM5fsPo02.mjs → chunks/messages-Ch2zBI602.mjs} +28 -17
  120. package/dist/chunks/{messages-CyNsByCY.mjs → messages-CiAHsUfO.mjs} +28 -17
  121. package/dist/{messages-BXI3qIos.mjs → chunks/messages-Cuzq-tNW.mjs} +28 -17
  122. package/dist/chunks/{messages-FHrCEJmY2.mjs → messages-Cw4qiMwb.mjs} +28 -17
  123. package/dist/chunks/{messages-xfjdrZmx.mjs → messages-Cyh-mz40.mjs} +28 -17
  124. package/dist/{messages-Bo_FUvVH.mjs → chunks/messages-D-I2QO8H.mjs} +28 -17
  125. package/dist/chunks/{messages-Ct7AMBS82.mjs → messages-D0D2gruy.mjs} +28 -17
  126. package/dist/chunks/{messages-CrMfiGu5.mjs → messages-D1BKxfLD.mjs} +29 -18
  127. package/dist/chunks/{messages-CmXADeab2.mjs → messages-D4eDs6R_.mjs} +28 -17
  128. package/dist/chunks/{messages-ClRHDxzh.mjs → messages-D9Xr-hES.mjs} +28 -17
  129. package/dist/{messages-tsHpMdDT2.mjs → chunks/messages-D9eJPHia.mjs} +30 -19
  130. package/dist/{messages-DUBHHfEt.mjs → chunks/messages-DBFWSzKY2.mjs} +28 -17
  131. package/dist/{messages-i4S6q64n2.mjs → chunks/messages-DC0wu2S7.mjs} +28 -17
  132. package/dist/chunks/{messages-BnznaKEP2.mjs → messages-DF9o19rG.mjs} +28 -17
  133. package/dist/{messages-DA-o8X3A.mjs → chunks/messages-DFS_n986.mjs} +51 -40
  134. package/dist/{messages-BGsDZTQp2.mjs → chunks/messages-DGS4H30T.mjs} +28 -17
  135. package/dist/chunks/{messages-Cdx4QMR1.mjs → messages-DKjddpzJ.mjs} +30 -19
  136. package/dist/chunks/{messages-B3s2vra72.mjs → messages-DMvTdUXC.mjs} +30 -19
  137. package/dist/{messages-Dcyrzdxa2.mjs → chunks/messages-DQUX-QYI2.mjs} +28 -17
  138. package/dist/chunks/{messages-BS1nOvZ-.mjs → messages-DUigq8FO2.mjs} +28 -17
  139. package/dist/{messages-BKjqW08U.mjs → chunks/messages-DY0FJdpH.mjs} +28 -17
  140. package/dist/{messages-BBvDbp62.mjs → chunks/messages-DfVXiqt-2.mjs} +28 -17
  141. package/dist/chunks/{messages-DHCVA7XQ.mjs → messages-DgZc9TJw.mjs} +28 -17
  142. package/dist/chunks/{messages-1Raf1IK82.mjs → messages-QD4BCUDP.mjs} +28 -17
  143. package/dist/{messages-JhoVMjfX2.mjs → chunks/messages-USmweex9.mjs} +28 -17
  144. package/dist/chunks/{messages-DBpXyvRe2.mjs → messages-a1JTi0Qm.mjs} +31 -20
  145. package/dist/chunks/{messages-D5IgUbBD2.mjs → messages-jcgCHPRn.mjs} +28 -17
  146. package/dist/chunks/{messages-Dfpi8pDY.mjs → messages-tnnqHpbd.mjs} +29 -18
  147. package/dist/{messages-DZEcrbmH.mjs → chunks/messages-vzWKPLJO.mjs} +28 -17
  148. package/dist/chunks/micromark-extension-math-Cz_ZZ_0Y.mjs +169 -0
  149. package/dist/chunks/micromark-factory-space-WwmyBO_J.mjs +36 -0
  150. package/dist/chunks/mindmap-definition-QFDTVHPH-BswFuNN6.mjs +1013 -0
  151. package/dist/chunks/{notifier-Butv4Dvo.mjs → notifier-B1zCi9G1.mjs} +1 -1
  152. package/dist/chunks/{objectSpread2-BY4mgzrQ.mjs → objectSpread2-CWwMYL_U.mjs} +1 -1
  153. package/dist/chunks/ordinal-D1_lEgAO.mjs +65 -0
  154. package/dist/chunks/packet-4T2RLAQJ-DTUW2U0C.mjs +3 -0
  155. package/dist/chunks/path-6nYPAvNb.mjs +85 -0
  156. package/dist/chunks/pie-ZZUOXDRM-D-umqvEM.mjs +3 -0
  157. package/dist/chunks/pieDiagram-DEJITSTG-1WJgvK1w.mjs +179 -0
  158. package/dist/chunks/quadrantDiagram-34T5L4WZ-B_YH8QGl.mjs +1960 -0
  159. package/dist/chunks/radar-PYXPWWZC-DkQelf08.mjs +3 -0
  160. package/dist/chunks/requirementDiagram-MS252O5E-DRl0YJRI.mjs +2224 -0
  161. package/dist/chunks/rough.esm-CSWJruu5.mjs +1353 -0
  162. package/dist/chunks/sankeyDiagram-XADWPNL6-B-8IrknH.mjs +909 -0
  163. package/dist/chunks/sequenceDiagram-FGHM5R23-DTLb8qmO.mjs +4181 -0
  164. package/dist/chunks/src-CRgEHLPW.mjs +2149 -0
  165. package/dist/chunks/stateDiagram-FHFEXIEX-B0JFjLFy.mjs +218 -0
  166. package/dist/chunks/stateDiagram-v2-QKLJ7IA2-Co9CUU_z.mjs +28 -0
  167. package/dist/chunks/timeline-definition-GMOUNBTQ-CS9KTh-Q.mjs +1084 -0
  168. package/dist/chunks/{tools-C2_IVsQY.mjs → tools-CSYsrnud.mjs} +2846 -3098
  169. package/dist/chunks/treeView-SZITEDCU-DOOoyNP9.mjs +3 -0
  170. package/dist/chunks/treemap-W4RFUUIX-CsOoUA-u.mjs +3 -0
  171. package/dist/chunks/vennDiagram-DHZGUBPP-0BNu5Wna.mjs +1876 -0
  172. package/dist/chunks/wardley-RL74JXVD-CCzZcmEk.mjs +3 -0
  173. package/dist/chunks/wardleyDiagram-NUSXRM2D-Ca9XByNH.mjs +594 -0
  174. package/dist/chunks/xychartDiagram-5P7HB3ND-C8AyKUAE.mjs +2017 -0
  175. package/dist/cli.mjs +1 -1
  176. package/dist/full.mjs +14 -14
  177. package/dist/locales.mjs +95 -84
  178. package/dist/markdown.mjs +3962 -0
  179. package/dist/{chunks/messages-6mikOS4D2.mjs → messages-5jvKxQNu2.mjs} +28 -17
  180. package/dist/{messages-BAcH6PtT2.mjs → messages-7QD-X6XT2.mjs} +28 -17
  181. package/dist/{messages-DbxbxUiK2.mjs → messages-96iaAUds2.mjs} +29 -18
  182. package/dist/{messages-CVcQD-9u.mjs → messages-B19o-Teb.mjs} +30 -19
  183. package/dist/{messages-Ccd587Yn.mjs → messages-B1ZUQagA.mjs} +28 -17
  184. package/dist/{messages-upqrRZQH2.mjs → messages-B7ieAJBd2.mjs} +28 -17
  185. package/dist/{chunks/messages-Csvm4mtA.mjs → messages-BECMxmfX.mjs} +28 -17
  186. package/dist/{chunks/messages-DA7Zk-Cy.mjs → messages-BIHc0KHY.mjs} +29 -18
  187. package/dist/{chunks/messages-BdnSVKOw.mjs → messages-BIoeoik5.mjs} +28 -17
  188. package/dist/{chunks/messages-DQ5AyNCU.mjs → messages-BJeGJksD.mjs} +28 -17
  189. package/dist/{messages-C5XPUD9T2.mjs → messages-BRZX964b2.mjs} +29 -18
  190. package/dist/{messages-Dkg99bfr2.mjs → messages-BTQPpoM42.mjs} +31 -20
  191. package/dist/{messages-fLi0P2dP.mjs → messages-BYNcD6uR.mjs} +28 -17
  192. package/dist/{messages-BvgTQLf72.mjs → messages-BYmmMDrN2.mjs} +28 -17
  193. package/dist/{chunks/messages-CgRvtOEY.mjs → messages-BbYq1pk-.mjs} +28 -17
  194. package/dist/{chunks/messages-DUDgFEEe2.mjs → messages-BiUGXvYr2.mjs} +28 -17
  195. package/dist/{chunks/messages-DJkIeapn.mjs → messages-BiiongNz2.mjs} +28 -17
  196. package/dist/{messages-BBq0M604.mjs → messages-Bm0Feca1.mjs} +32 -21
  197. package/dist/{messages-eTourT12.mjs → messages-BmAn22OX.mjs} +28 -17
  198. package/dist/{messages-C6Y4Jv2N.mjs → messages-Bq3F2Tp_.mjs} +28 -17
  199. package/dist/{messages-DIRha_gg2.mjs → messages-BsycN_JI2.mjs} +28 -17
  200. package/dist/{chunks/messages-CljStrYi.mjs → messages-BwHs4cm1.mjs} +32 -21
  201. package/dist/{chunks/messages-Cs9XBt4T.mjs → messages-CJTy6JZt.mjs} +28 -17
  202. package/dist/{messages-BokEflKa.mjs → messages-CR_L_UtK.mjs} +28 -17
  203. package/dist/{chunks/messages-ZJ0b1C3a.mjs → messages-CSUHBs4c2.mjs} +28 -17
  204. package/dist/{messages-BcFQFcJ92.mjs → messages-CWIXvnDf2.mjs} +28 -17
  205. package/dist/{messages-DnatBKPm.mjs → messages-CcF4y-E4.mjs} +28 -17
  206. package/dist/{messages-BywbKcPC.mjs → messages-Ce6KVEbT.mjs} +29 -18
  207. package/dist/{messages-DOTJ2NvJ.mjs → messages-Ci0KqX-J.mjs} +35 -24
  208. package/dist/{messages-BtxaN-xx.mjs → messages-CjbnogEC.mjs} +28 -17
  209. package/dist/{messages-BSe3QDnQ.mjs → messages-CmB406HW.mjs} +30 -19
  210. package/dist/{messages-BVKZK-3t.mjs → messages-CqXtJTpU.mjs} +28 -17
  211. package/dist/{chunks/messages-DJA6fb_P2.mjs → messages-D0aw5_0k2.mjs} +30 -19
  212. package/dist/{chunks/messages-DPykxECP2.mjs → messages-D8FQWulF2.mjs} +28 -17
  213. package/dist/{chunks/messages-CpzO7KRA.mjs → messages-DBiVgUs2.mjs} +29 -18
  214. package/dist/{chunks/messages-B0ffBqzr.mjs → messages-DIJlIqlQ2.mjs} +28 -17
  215. package/dist/{chunks/messages-BaPZuLjN.mjs → messages-DLX_iBDJ.mjs} +28 -17
  216. package/dist/{chunks/messages-CvfKofOP.mjs → messages-DLlc9QPw.mjs} +28 -17
  217. package/dist/{chunks/messages-Czny5pPT2.mjs → messages-DMr62KiO2.mjs} +28 -17
  218. package/dist/{chunks/messages-IDEUsFhQ2.mjs → messages-DPA-mMWC2.mjs} +29 -18
  219. package/dist/{messages-BCuTVHBV.mjs → messages-DTh9a8mR.mjs} +28 -17
  220. package/dist/{chunks/messages-DT7fRpCy.mjs → messages-DY4IqlhY.mjs} +28 -17
  221. package/dist/{chunks/messages-BgVEGd4c.mjs → messages-DYTTu0O12.mjs} +28 -17
  222. package/dist/{messages-Bk984gRE2.mjs → messages-DbySKTKt2.mjs} +30 -19
  223. package/dist/{chunks/messages-ID1PHnMv.mjs → messages-Ddnj2iTG2.mjs} +28 -17
  224. package/dist/{messages-BmNaAyKS.mjs → messages-DkLU_rWm.mjs} +28 -17
  225. package/dist/{messages-C6OJvnJg2.mjs → messages-Dl3Sv6Rq2.mjs} +29 -18
  226. package/dist/{chunks/messages-C1OqT_nL.mjs → messages-Dl5Y2-Ia.mjs} +51 -40
  227. package/dist/{chunks/messages-Cqc-6rfh2.mjs → messages-DnG0ef8t2.mjs} +30 -19
  228. package/dist/{chunks/messages-BkCjgGxc.mjs → messages-DnGJD4TL.mjs} +28 -17
  229. package/dist/{messages-Bio7KYsr2.mjs → messages-Dnp9N6RU2.mjs} +28 -17
  230. package/dist/{chunks/messages-Df87zXXG.mjs → messages-Dvn35ksS.mjs} +28 -17
  231. package/dist/{messages-CHJ5SOZI.mjs → messages-Dw__BcTj.mjs} +28 -17
  232. package/dist/{chunks/messages-DC7TX-YT.mjs → messages-Dy-Y_nEI.mjs} +28 -17
  233. package/dist/{messages-DV9e1DW7.mjs → messages-E_ZuzGDt.mjs} +28 -17
  234. package/dist/{messages-DD5pW0zJ.mjs → messages-F2xRoY1w.mjs} +28 -17
  235. package/dist/{chunks/messages-BgsPQXfP.mjs → messages-Smt4GBbj.mjs} +33 -22
  236. package/dist/{messages-DJT4Bt_02.mjs → messages-aMXpHt5X2.mjs} +28 -17
  237. package/dist/{chunks/messages-B2pW6jO_.mjs → messages-aWZH50vu2.mjs} +30 -19
  238. package/dist/{chunks/messages-u2yxkNTE2.mjs → messages-dv19AkyJ.mjs} +28 -17
  239. package/dist/{messages-DJKLtW7u.mjs → messages-hWwSRF-2.mjs} +28 -17
  240. package/dist/{messages-tK67CBqn.mjs → messages-j7o5rT9s.mjs} +28 -17
  241. package/dist/{messages-DqyqEw1_.mjs → messages-nUVjeh7K.mjs} +29 -18
  242. package/dist/{chunks/messages-DSjXen8E.mjs → messages-nlhESX9t.mjs} +28 -17
  243. package/dist/{messages-C30Vz-UZ2.mjs → messages-rk-A1Wa42.mjs} +30 -19
  244. package/dist/{chunks/messages-DR09nkcZ.mjs → messages-xh2eOLvs.mjs} +28 -17
  245. package/dist/{chunks/messages-C11byid72.mjs → messages-ynAe7ewZ.mjs} +28 -17
  246. package/dist/react.mjs +3 -3
  247. package/dist/tools.mjs +3 -3
  248. package/dist/vendor.LICENSE.txt +4609 -212
  249. package/package.json +21 -3
  250. package/src/components/blocks.ts +26 -1
  251. package/src/components/constants/data-attributes.ts +0 -2
  252. package/src/components/i18n/locales/am/messages.json +28 -17
  253. package/src/components/i18n/locales/ar/messages.json +28 -17
  254. package/src/components/i18n/locales/az/messages.json +28 -17
  255. package/src/components/i18n/locales/bg/messages.json +28 -17
  256. package/src/components/i18n/locales/bn/messages.json +28 -17
  257. package/src/components/i18n/locales/bs/messages.json +30 -19
  258. package/src/components/i18n/locales/cs/messages.json +32 -21
  259. package/src/components/i18n/locales/da/messages.json +35 -24
  260. package/src/components/i18n/locales/de/messages.json +33 -22
  261. package/src/components/i18n/locales/dv/messages.json +28 -17
  262. package/src/components/i18n/locales/el/messages.json +28 -17
  263. package/src/components/i18n/locales/en/messages.json +28 -17
  264. package/src/components/i18n/locales/es/messages.json +29 -18
  265. package/src/components/i18n/locales/et/messages.json +32 -21
  266. package/src/components/i18n/locales/fa/messages.json +28 -17
  267. package/src/components/i18n/locales/fi/messages.json +28 -17
  268. package/src/components/i18n/locales/fil/messages.json +51 -40
  269. package/src/components/i18n/locales/fr/messages.json +29 -18
  270. package/src/components/i18n/locales/gu/messages.json +28 -17
  271. package/src/components/i18n/locales/he/messages.json +28 -17
  272. package/src/components/i18n/locales/hi/messages.json +28 -17
  273. package/src/components/i18n/locales/hr/messages.json +30 -19
  274. package/src/components/i18n/locales/hu/messages.json +29 -18
  275. package/src/components/i18n/locales/hy/messages.json +28 -17
  276. package/src/components/i18n/locales/id/messages.json +28 -17
  277. package/src/components/i18n/locales/it/messages.json +29 -18
  278. package/src/components/i18n/locales/ja/messages.json +28 -17
  279. package/src/components/i18n/locales/ka/messages.json +28 -17
  280. package/src/components/i18n/locales/km/messages.json +28 -17
  281. package/src/components/i18n/locales/kn/messages.json +28 -17
  282. package/src/components/i18n/locales/ko/messages.json +28 -17
  283. package/src/components/i18n/locales/ku/messages.json +28 -17
  284. package/src/components/i18n/locales/lo/messages.json +28 -17
  285. package/src/components/i18n/locales/lt/messages.json +28 -17
  286. package/src/components/i18n/locales/lv/messages.json +28 -17
  287. package/src/components/i18n/locales/mk/messages.json +28 -17
  288. package/src/components/i18n/locales/ml/messages.json +28 -17
  289. package/src/components/i18n/locales/mn/messages.json +28 -17
  290. package/src/components/i18n/locales/mr/messages.json +28 -17
  291. package/src/components/i18n/locales/ms/messages.json +30 -19
  292. package/src/components/i18n/locales/my/messages.json +28 -17
  293. package/src/components/i18n/locales/ne/messages.json +28 -17
  294. package/src/components/i18n/locales/nl/messages.json +30 -19
  295. package/src/components/i18n/locales/no/messages.json +31 -20
  296. package/src/components/i18n/locales/pa/messages.json +28 -17
  297. package/src/components/i18n/locales/pl/messages.json +29 -18
  298. package/src/components/i18n/locales/ps/messages.json +28 -17
  299. package/src/components/i18n/locales/pt/messages.json +29 -18
  300. package/src/components/i18n/locales/ro/messages.json +29 -18
  301. package/src/components/i18n/locales/ru/messages.json +28 -17
  302. package/src/components/i18n/locales/sd/messages.json +28 -17
  303. package/src/components/i18n/locales/si/messages.json +28 -17
  304. package/src/components/i18n/locales/sk/messages.json +30 -19
  305. package/src/components/i18n/locales/sl/messages.json +30 -19
  306. package/src/components/i18n/locales/sq/messages.json +29 -18
  307. package/src/components/i18n/locales/sr/messages.json +28 -17
  308. package/src/components/i18n/locales/sv/messages.json +30 -19
  309. package/src/components/i18n/locales/sw/messages.json +28 -17
  310. package/src/components/i18n/locales/ta/messages.json +28 -17
  311. package/src/components/i18n/locales/te/messages.json +28 -17
  312. package/src/components/i18n/locales/th/messages.json +28 -17
  313. package/src/components/i18n/locales/tr/messages.json +28 -17
  314. package/src/components/i18n/locales/ug/messages.json +28 -17
  315. package/src/components/i18n/locales/uk/messages.json +28 -17
  316. package/src/components/i18n/locales/ur/messages.json +28 -17
  317. package/src/components/i18n/locales/vi/messages.json +28 -17
  318. package/src/components/i18n/locales/yi/messages.json +28 -17
  319. package/src/components/i18n/locales/zh/messages.json +28 -17
  320. package/src/components/icons/index.ts +59 -47
  321. package/src/components/inline-tools/inline-tool-code.ts +399 -0
  322. package/src/components/modules/api/blocks.ts +17 -0
  323. package/src/components/modules/api/tools.ts +0 -19
  324. package/src/components/modules/blockEvents/composers/blockSelectionKeys.ts +20 -3
  325. package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +5 -5
  326. package/src/components/modules/blockManager/blockManager.ts +0 -11
  327. package/src/components/modules/blockManager/event-binder.ts +1 -12
  328. package/src/components/modules/paste/handlers/html-handler.ts +13 -10
  329. package/src/components/modules/paste/handlers/index.ts +1 -0
  330. package/src/components/modules/paste/index.ts +6 -0
  331. package/src/components/modules/themeManager.ts +1 -3
  332. package/src/components/modules/toolbar/blockSettings.ts +1 -0
  333. package/src/components/modules/toolbar/inline/index.ts +3 -0
  334. package/src/components/modules/ui.ts +0 -13
  335. package/src/components/modules/uiControllers/controllers/keyboard.ts +0 -29
  336. package/src/components/modules/uiControllers/controllers/selection.ts +2 -14
  337. package/src/components/ui/toolbox.ts +1 -0
  338. package/src/components/utils/popover/popover-position.ts +2 -4
  339. package/src/markdown/index.ts +63 -0
  340. package/src/markdown/markdown-handler.ts +110 -0
  341. package/src/markdown/mdast-to-blocks.ts +418 -0
  342. package/src/markdown/phrasing-to-html.ts +60 -0
  343. package/src/markdown/types.ts +42 -0
  344. package/src/stories/EditorModes.stories.ts +0 -60
  345. package/src/styles/main.css +39 -1140
  346. package/src/tools/callout/emoji-picker/index.ts +3 -2
  347. package/src/tools/callout/index.ts +24 -0
  348. package/src/tools/code/code-keyboard.ts +142 -0
  349. package/src/tools/code/constants.ts +96 -0
  350. package/src/tools/code/dom-builder.ts +181 -0
  351. package/src/tools/code/highlight-applier.ts +229 -0
  352. package/src/tools/code/index.ts +462 -0
  353. package/src/tools/code/katex-loader.ts +50 -0
  354. package/src/tools/code/language-picker.ts +241 -0
  355. package/src/tools/code/mermaid-loader.ts +45 -0
  356. package/src/tools/code/shiki-loader.ts +135 -0
  357. package/src/tools/divider/index.ts +9 -1
  358. package/src/tools/index.ts +4 -2
  359. package/src/tools/list/block-operations.ts +3 -1
  360. package/src/tools/list/depth-validator.ts +4 -7
  361. package/src/tools/list/dom-builder.ts +5 -3
  362. package/src/tools/list/index.ts +21 -3
  363. package/src/tools/list/list-helpers.ts +9 -2
  364. package/src/tools/list/list-keyboard.ts +56 -14
  365. package/src/tools/list/list-lifecycle.ts +3 -1
  366. package/src/tools/list/marker-calculator.ts +37 -0
  367. package/src/tools/list/ordered-marker-manager.ts +4 -2
  368. package/src/tools/table/core/table-commands.ts +16 -0
  369. package/src/tools/table/core/table-controller.ts +29 -0
  370. package/src/tools/table/core/table-events.ts +17 -0
  371. package/src/tools/table/index.ts +196 -13
  372. package/src/tools/table/table-cell-blocks.ts +9 -6
  373. package/src/tools/table/table-cell-clipboard.ts +7 -2
  374. package/src/tools/table/table-cell-placement-picker.ts +133 -0
  375. package/src/tools/table/table-cell-selection.ts +174 -19
  376. package/src/tools/table/table-core.ts +321 -113
  377. package/src/tools/table/table-map.ts +279 -0
  378. package/src/tools/table/table-model.ts +901 -1
  379. package/src/tools/table/table-operations.ts +78 -44
  380. package/src/tools/table/table-resize.ts +19 -17
  381. package/src/tools/table/table-row-col-drag.ts +24 -10
  382. package/src/tools/table/types.ts +24 -2
  383. package/types/api/tools.d.ts +0 -18
  384. package/types/data-attributes.d.ts +0 -1
  385. package/types/index.d.ts +0 -16
  386. package/types/markdown.d.ts +2 -0
  387. package/types/tools/code.d.ts +13 -0
  388. package/src/tools/database/database-backend-sync.ts +0 -101
  389. package/src/tools/database/database-board-view.ts +0 -301
  390. package/src/tools/database/database-card-drag.ts +0 -306
  391. package/src/tools/database/database-card-drawer.ts +0 -546
  392. package/src/tools/database/database-column-controls.ts +0 -46
  393. package/src/tools/database/database-column-drag.ts +0 -262
  394. package/src/tools/database/database-keyboard.ts +0 -35
  395. package/src/tools/database/database-list-row-drag.ts +0 -245
  396. package/src/tools/database/database-list-view.ts +0 -333
  397. package/src/tools/database/database-model.ts +0 -246
  398. package/src/tools/database/database-property-type-popover.ts +0 -108
  399. package/src/tools/database/database-tab-bar.ts +0 -532
  400. package/src/tools/database/database-view-popover.ts +0 -109
  401. package/src/tools/database/database-view-renderer.ts +0 -25
  402. package/src/tools/database/index.ts +0 -948
  403. package/src/tools/database/types.ts +0 -144
  404. package/types/tools/database.d.ts +0 -145
  405. /package/dist/chunks/{am-CHDDMHkd.mjs → am-rVzV1W41.mjs} +0 -0
  406. /package/dist/chunks/{ar-DoqfNqut.mjs → ar-C710lkoH.mjs} +0 -0
  407. /package/dist/chunks/{az-C34P9iEa.mjs → az-BOp1pgua.mjs} +0 -0
  408. /package/dist/chunks/{bg-jroXLY8Y.mjs → bg-CL9p09ZD.mjs} +0 -0
  409. /package/dist/chunks/{bn-BRI-WqxY.mjs → bn-CNmSeyAy.mjs} +0 -0
  410. /package/dist/chunks/{bs-CCGUpNHu.mjs → bs-BRzMGqzk.mjs} +0 -0
  411. /package/dist/chunks/{cs-D5qZOGuc.mjs → cs-BYPBLmnF.mjs} +0 -0
  412. /package/dist/chunks/{da-DrJ7W37K.mjs → da-CBC_LR1c.mjs} +0 -0
  413. /package/dist/chunks/{de-BW6-kp2c.mjs → de-DxRFMoAj.mjs} +0 -0
  414. /package/dist/chunks/{el-C-Vc_Otu.mjs → el-Bk6YbySf.mjs} +0 -0
  415. /package/dist/chunks/{es-B6fI5K9i.mjs → es-DpT3FCMR.mjs} +0 -0
  416. /package/dist/chunks/{et-BhVlZ-Yz.mjs → et-DE9Dr_g9.mjs} +0 -0
  417. /package/dist/chunks/{fa-D55Ijdqa.mjs → fa-Banj1QUE.mjs} +0 -0
  418. /package/dist/chunks/{fi-jNLjhKUQ.mjs → fi-DfN3M5ER.mjs} +0 -0
  419. /package/dist/chunks/{fil-DYd0T5aX.mjs → fil-DbCsRS1d.mjs} +0 -0
  420. /package/dist/chunks/{fr-yxy5xWw_.mjs → fr-D1clKhgt.mjs} +0 -0
  421. /package/dist/chunks/{gu-CcY_LJe7.mjs → gu-1CsZyRwT.mjs} +0 -0
  422. /package/dist/chunks/{he-DL9s7wNw.mjs → he-qQdnL6eK.mjs} +0 -0
  423. /package/dist/chunks/{hi-C8eGXgw5.mjs → hi-DxM0Nff1.mjs} +0 -0
  424. /package/dist/chunks/{hr-DLpybOhU.mjs → hr-Onldyi-u.mjs} +0 -0
  425. /package/dist/chunks/{hu-BkT0gT00.mjs → hu-CAn3pBuY.mjs} +0 -0
  426. /package/dist/chunks/{hy-CVFDCp2S.mjs → hy-D43q7NxE.mjs} +0 -0
  427. /package/dist/chunks/{id-0P4W9Az0.mjs → id-Xrw5Dd0Y.mjs} +0 -0
  428. /package/dist/chunks/{it-mLY6_uoW.mjs → it-CA9ZDMSc.mjs} +0 -0
  429. /package/dist/chunks/{ja-7RkeRNWG.mjs → ja-D0J6WRFh.mjs} +0 -0
  430. /package/dist/chunks/{ka-C7Lx-Qsh.mjs → ka-BZL7xDuY.mjs} +0 -0
  431. /package/dist/chunks/{km-Q8udaraH.mjs → km-BimgQZVU.mjs} +0 -0
  432. /package/dist/chunks/{kn-BiETM-iq.mjs → kn-C2n2cPHK.mjs} +0 -0
  433. /package/dist/chunks/{ko-tiB80pF1.mjs → ko-n4Cn93D3.mjs} +0 -0
  434. /package/dist/chunks/{ku-CY-OABkR.mjs → ku-BYZCgT44.mjs} +0 -0
  435. /package/dist/chunks/{lo-CTBhEnyk.mjs → lo-DVXiAE4N.mjs} +0 -0
  436. /package/dist/chunks/{lt-BHKHEtqK.mjs → lt-B9KlQFnY.mjs} +0 -0
  437. /package/dist/chunks/{lv-DWxgtfUg.mjs → lv-BINeOdyx.mjs} +0 -0
  438. /package/dist/chunks/{mk-BjookGdx.mjs → mk-_-QrPrLN.mjs} +0 -0
  439. /package/dist/chunks/{ml-L-NnZcp9.mjs → ml-KvJSC1KT.mjs} +0 -0
  440. /package/dist/chunks/{mn-OMWi7Hl_.mjs → mn-CjFjWnRG.mjs} +0 -0
  441. /package/dist/chunks/{mr-B6JPzITo.mjs → mr-DqAZ7FRX.mjs} +0 -0
  442. /package/dist/chunks/{ms-CG3S-sPB.mjs → ms-BZcV4UG_.mjs} +0 -0
  443. /package/dist/chunks/{my-BLAmGfhT.mjs → my-97SC9jYN.mjs} +0 -0
  444. /package/dist/chunks/{native-BPcABu9z.mjs → native-CzYG0YgY.mjs} +0 -0
  445. /package/dist/chunks/{ne-D1JHLfYw.mjs → ne-Bs-M2TyF.mjs} +0 -0
  446. /package/dist/chunks/{nl-Ca7Q8FnY.mjs → nl-2ZwQilo-.mjs} +0 -0
  447. /package/dist/chunks/{no-Coxcohcz.mjs → no-fOQTpFq1.mjs} +0 -0
  448. /package/dist/chunks/{pa-CCaXqpaI.mjs → pa-DLOqkMi0.mjs} +0 -0
  449. /package/dist/chunks/{pl-Cl_fAZ84.mjs → pl-FYs9QrXU.mjs} +0 -0
  450. /package/dist/chunks/{ps-WD5qGAWy.mjs → ps-CTXe6pSe.mjs} +0 -0
  451. /package/dist/chunks/{pt-C4zvLfvq.mjs → pt-B1X4x7d1.mjs} +0 -0
  452. /package/dist/chunks/{ro-DbefHcmM.mjs → ro-Bf7S2FaR.mjs} +0 -0
  453. /package/dist/chunks/{ru-uU1J14jd.mjs → ru-B8lqnu_j.mjs} +0 -0
  454. /package/dist/chunks/{sd-DKu368Ip.mjs → sd-CHRYJm2r.mjs} +0 -0
  455. /package/dist/chunks/{si-BsJCiPkZ.mjs → si-CI0Hs6vH.mjs} +0 -0
  456. /package/dist/chunks/{sk-CD-a3SN6.mjs → sk-Bdvq1Kb_.mjs} +0 -0
  457. /package/dist/chunks/{sl-CXhrPJe_.mjs → sl-B_qiFTV5.mjs} +0 -0
  458. /package/dist/chunks/{sq-CTctCoFQ.mjs → sq-E0j1hysP.mjs} +0 -0
  459. /package/dist/chunks/{sr-BZkhBwXj.mjs → sr-VPpVNTZw.mjs} +0 -0
  460. /package/dist/chunks/{sv-NmRZb_xi.mjs → sv-gKmDSR3d.mjs} +0 -0
  461. /package/dist/chunks/{sw-Be5ik3H6.mjs → sw-zeFLiO23.mjs} +0 -0
  462. /package/dist/chunks/{ta-DsXh6neL.mjs → ta-Ci-j89hR.mjs} +0 -0
  463. /package/dist/chunks/{te-CwpCbM8M.mjs → te-qyMI0M7a.mjs} +0 -0
  464. /package/dist/chunks/{th-CcZ15OLk.mjs → th-DPxHtpdb.mjs} +0 -0
  465. /package/dist/chunks/{tr-q3bTgvhW.mjs → tr-CRV6GS-G.mjs} +0 -0
  466. /package/dist/chunks/{tw-DmW6-pCY.mjs → tw-CqxBf-1Y.mjs} +0 -0
  467. /package/dist/chunks/{ug-919EhLsL.mjs → ug-DW0YFpo5.mjs} +0 -0
  468. /package/dist/chunks/{uk-aNMEzd0Y.mjs → uk-ssteuphK.mjs} +0 -0
  469. /package/dist/chunks/{ur-BwQI77sh.mjs → ur-qhY3-jY7.mjs} +0 -0
  470. /package/dist/chunks/{vi-Dxq806-F.mjs → vi-CHriMMC8.mjs} +0 -0
  471. /package/dist/chunks/{zh-BcHuy1Ti.mjs → zh-BJktawVN.mjs} +0 -0
@@ -0,0 +1,418 @@
1
+ import type { Root, Nodes, List, ListItem, PhrasingContent, Table, Blockquote, RootContent } from 'mdast';
2
+ import type { OutputBlockData } from '../../types/data-formats/output-data';
3
+ import type { MarkdownImportConfig } from './types';
4
+ import { phrasingToHtml } from './phrasing-to-html';
5
+
6
+ /**
7
+ * Creates a scoped ID generator. Each call to mdastToBlocks gets a fresh generator.
8
+ */
9
+ function createIdGenerator(): () => string {
10
+ const prefix = `md-${Date.now().toString(36)}`;
11
+ const state = { counter: 0 };
12
+
13
+ return () => `${prefix}-${(state.counter++).toString(36)}`;
14
+ }
15
+
16
+ /**
17
+ * Convert an mdast tree to an array of Blok OutputBlockData.
18
+ */
19
+ export function mdastToBlocks(tree: Root, config: MarkdownImportConfig = {}): OutputBlockData[] {
20
+ const generateId = createIdGenerator();
21
+
22
+ return convertNodes(tree.children, config, 0, generateId);
23
+ }
24
+
25
+ function convertNodes(
26
+ nodes: RootContent[],
27
+ config: MarkdownImportConfig,
28
+ listDepth: number,
29
+ generateId: () => string,
30
+ ): OutputBlockData[] {
31
+ const blocks: OutputBlockData[] = [];
32
+
33
+ for (const node of nodes) {
34
+ const result = convertNode(node, config, listDepth, generateId);
35
+
36
+ if (result) {
37
+ blocks.push(...result);
38
+ }
39
+ }
40
+
41
+ return blocks;
42
+ }
43
+
44
+ function convertNode(
45
+ node: RootContent,
46
+ config: MarkdownImportConfig,
47
+ listDepth: number,
48
+ generateId: () => string,
49
+ ): OutputBlockData[] | null {
50
+ // 1. Check toolMap first
51
+ if (config.toolMap?.[node.type]) {
52
+ return handleToolMap(node, config, generateId);
53
+ }
54
+
55
+ // 2. Built-in handlers
56
+ const builtInResult = handleBuiltInNode(node, config, listDepth, generateId);
57
+
58
+ if (builtInResult !== undefined) {
59
+ return builtInResult;
60
+ }
61
+
62
+ // 3. onUnknownNode hook
63
+ if (config.onUnknownNode) {
64
+ return tryOnUnknownNode(config.onUnknownNode, node);
65
+ }
66
+
67
+ // 4. Fallback: extract any text content as paragraph
68
+ if ('value' in node && typeof node.value === 'string') {
69
+ return [makeParagraph(escapeHtml(node.value), generateId)];
70
+ }
71
+
72
+ return null;
73
+ }
74
+
75
+ /**
76
+ * Handle built-in node types. Returns undefined if node type is not built-in.
77
+ */
78
+ function handleBuiltInNode(
79
+ node: RootContent,
80
+ config: MarkdownImportConfig,
81
+ listDepth: number,
82
+ generateId: () => string,
83
+ ): OutputBlockData[] | null | undefined {
84
+ if (node.type === 'paragraph') {
85
+ return handleParagraph(node.children as Array<{ type: string; value?: string; children?: unknown[] }>, generateId);
86
+ }
87
+
88
+ if (node.type === 'heading') {
89
+ return [makeBlock('header', { text: phrasingToHtml(node.children), level: node.depth }, generateId)];
90
+ }
91
+
92
+ if (node.type === 'thematicBreak') {
93
+ return [makeBlock('divider', {}, generateId)];
94
+ }
95
+
96
+ if (node.type === 'list') {
97
+ return handleList(node, config, listDepth, generateId);
98
+ }
99
+
100
+ if (node.type === 'blockquote') {
101
+ return handleBlockquote(node, generateId);
102
+ }
103
+
104
+ if (node.type === 'table') {
105
+ return handleTable(node, generateId);
106
+ }
107
+
108
+ if (node.type === 'code') {
109
+ return [makeBlock('code', {
110
+ code: node.value,
111
+ language: node.lang ?? 'plain text',
112
+ }, generateId)];
113
+ }
114
+
115
+ if (node.type === 'math') {
116
+ return [makeBlock('code', { code: node.value, language: 'latex' }, generateId)];
117
+ }
118
+
119
+ if (node.type === 'html') {
120
+ return handleFallback(node, config, escapeHtml(node.value), generateId);
121
+ }
122
+
123
+ return undefined;
124
+ }
125
+
126
+ type ParagraphChild = { type: string; value?: string; children?: unknown[] };
127
+
128
+ /**
129
+ * Convert a paragraph's phrasing children to blocks.
130
+ * Splits on inlineMath nodes, emitting each as a latex code block.
131
+ */
132
+ function handleParagraph(children: ParagraphChild[], generateId: () => string): OutputBlockData[] {
133
+ const hasInlineMath = children.some(c => c.type === 'inlineMath');
134
+
135
+ if (!hasInlineMath) {
136
+ return [makeParagraph(phrasingToHtml(children as PhrasingContent[]), generateId)];
137
+ }
138
+
139
+ return splitOnInlineMath(children, generateId);
140
+ }
141
+
142
+ function splitOnInlineMath(children: ParagraphChild[], generateId: () => string): OutputBlockData[] {
143
+ const blocks: OutputBlockData[] = [];
144
+ const segments = groupByInlineMath(children);
145
+
146
+ for (const segment of segments) {
147
+ if (segment.type === 'math') {
148
+ blocks.push(makeBlock('code', { code: segment.value, language: 'latex' }, generateId));
149
+ continue;
150
+ }
151
+
152
+ const text = phrasingToHtml(segment.nodes as PhrasingContent[]).trim();
153
+
154
+ if (text) {
155
+ blocks.push(makeParagraph(text, generateId));
156
+ }
157
+ }
158
+
159
+ return blocks;
160
+ }
161
+
162
+ type MathSegment = { type: 'math'; value: string } | { type: 'text'; nodes: ParagraphChild[] };
163
+
164
+ function groupByInlineMath(children: ParagraphChild[]): MathSegment[] {
165
+ const segments: MathSegment[] = [];
166
+ const textNodes: ParagraphChild[] = [];
167
+
168
+ for (const child of children) {
169
+ if (child.type !== 'inlineMath') {
170
+ textNodes.push(child);
171
+ continue;
172
+ }
173
+
174
+ if (textNodes.length > 0) {
175
+ segments.push({ type: 'text', nodes: [...textNodes] });
176
+ textNodes.length = 0;
177
+ }
178
+
179
+ segments.push({ type: 'math', value: child.value ?? '' });
180
+ }
181
+
182
+ if (textNodes.length > 0) {
183
+ segments.push({ type: 'text', nodes: textNodes });
184
+ }
185
+
186
+ return segments;
187
+ }
188
+
189
+ function tryOnUnknownNode(
190
+ onUnknownNode: (node: Nodes) => OutputBlockData[] | null,
191
+ node: RootContent,
192
+ ): OutputBlockData[] | null {
193
+ try {
194
+ return onUnknownNode(node as Nodes);
195
+ } catch (e) {
196
+ console.warn(`markdownToBlocks: onUnknownNode threw for node type "${node.type}"`, e);
197
+
198
+ return null;
199
+ }
200
+ }
201
+
202
+ function handleToolMap(
203
+ node: RootContent,
204
+ config: MarkdownImportConfig,
205
+ generateId: () => string,
206
+ ): OutputBlockData[] {
207
+ const toolMap = config.toolMap;
208
+
209
+ if (!toolMap) {
210
+ return [];
211
+ }
212
+
213
+ const entry = toolMap[node.type];
214
+
215
+ try {
216
+ const block: OutputBlockData = {
217
+ id: generateId(),
218
+ type: entry.tool,
219
+ data: entry.data(node as Nodes),
220
+ };
221
+
222
+ if (entry.children) {
223
+ const childBlocks = entry.children(
224
+ node as Nodes,
225
+ (childNodes) => convertNodes(childNodes as RootContent[], config, 0, generateId),
226
+ );
227
+
228
+ return [block, ...childBlocks];
229
+ }
230
+
231
+ return [block];
232
+ } catch (e) {
233
+ console.warn(`markdownToBlocks: toolMap handler threw for node type "${node.type}"`, e);
234
+
235
+ return [];
236
+ }
237
+ }
238
+
239
+ function handleList(
240
+ list: List,
241
+ config: MarkdownImportConfig,
242
+ depth: number,
243
+ generateId: () => string,
244
+ ): OutputBlockData[] {
245
+ const blocks: OutputBlockData[] = [];
246
+
247
+ for (const [index, item] of list.children.entries()) {
248
+ blocks.push(...handleListItem(item, list, config, depth, index, generateId));
249
+ }
250
+
251
+ return blocks;
252
+ }
253
+
254
+ function resolveListStyle(isChecklist: boolean, ordered: boolean | null | undefined): string {
255
+ if (isChecklist) {
256
+ return 'checklist';
257
+ }
258
+
259
+ return ordered ? 'ordered' : 'unordered';
260
+ }
261
+
262
+ function handleListItem(
263
+ item: ListItem,
264
+ list: List,
265
+ config: MarkdownImportConfig,
266
+ depth: number,
267
+ index: number,
268
+ generateId: () => string,
269
+ ): OutputBlockData[] {
270
+ const blocks: OutputBlockData[] = [];
271
+ const isChecklist = item.checked !== null && item.checked !== undefined;
272
+ const style = resolveListStyle(isChecklist, list.ordered);
273
+
274
+ // Extract text from the first paragraph child
275
+ const paragraphChild = item.children.find(
276
+ (c): c is Extract<typeof c, { type: 'paragraph' }> => c.type === 'paragraph',
277
+ );
278
+ const text = paragraphChild ? phrasingToHtml(paragraphChild.children) : '';
279
+
280
+ const data: Record<string, unknown> = { text, style, depth };
281
+
282
+ if (isChecklist) {
283
+ data.checked = item.checked;
284
+ }
285
+
286
+ if (list.ordered && index === 0 && list.start !== null && list.start !== undefined && list.start !== 1) {
287
+ data.start = list.start;
288
+ }
289
+
290
+ blocks.push(makeBlock('list', data, generateId));
291
+
292
+ // Process nested lists (increase depth)
293
+ for (const child of item.children) {
294
+ if (child.type === 'list') {
295
+ blocks.push(...handleList(child, config, depth + 1, generateId));
296
+ }
297
+ }
298
+
299
+ return blocks;
300
+ }
301
+
302
+ function handleBlockquote(bq: Blockquote, generateId: () => string): OutputBlockData[] {
303
+ const parts: string[] = [];
304
+
305
+ for (const child of bq.children) {
306
+ if (child.type === 'paragraph') {
307
+ parts.push(phrasingToHtml(child.children));
308
+ continue;
309
+ }
310
+
311
+ if (!('children' in child) || !Array.isArray(child.children)) {
312
+ continue;
313
+ }
314
+
315
+ // For non-paragraph flow content, extract text
316
+ const innerPhrasing = child.children.filter(
317
+ (c): c is PhrasingContent => 'value' in c || 'children' in c,
318
+ );
319
+
320
+ if (innerPhrasing.length > 0) {
321
+ parts.push(phrasingToHtml(innerPhrasing));
322
+ }
323
+ }
324
+
325
+ return [makeBlock('quote', { text: parts.join('<br>'), size: 'default' }, generateId)];
326
+ }
327
+
328
+ function handleTable(table: Table, generateId: () => string): OutputBlockData[] {
329
+ const blocks: OutputBlockData[] = [];
330
+ const tableId = generateId();
331
+ const content: Array<Array<{ blocks: string[] }>> = [];
332
+
333
+ for (const row of table.children) {
334
+ const rowContent = processTableRow(row.children, tableId, blocks, generateId);
335
+
336
+ content.push(rowContent);
337
+ }
338
+
339
+ const tableBlock: OutputBlockData = {
340
+ id: tableId,
341
+ type: 'table',
342
+ data: {
343
+ withHeadings: table.children.length > 1,
344
+ withHeadingColumn: false,
345
+ content,
346
+ },
347
+ };
348
+
349
+ // Table block first, then cell blocks
350
+ return [tableBlock, ...blocks];
351
+ }
352
+
353
+ function processTableRow(
354
+ cells: Table['children'][number]['children'],
355
+ tableId: string,
356
+ blocks: OutputBlockData[],
357
+ generateId: () => string,
358
+ ): Array<{ blocks: string[] }> {
359
+ const rowContent: Array<{ blocks: string[] }> = [];
360
+
361
+ for (const cell of cells) {
362
+ const cellText = phrasingToHtml(cell.children);
363
+ const cellBlockId = generateId();
364
+
365
+ blocks.push({
366
+ id: cellBlockId,
367
+ type: 'paragraph',
368
+ data: { text: cellText },
369
+ parent: tableId,
370
+ });
371
+
372
+ rowContent.push({ blocks: [cellBlockId] });
373
+ }
374
+
375
+ return rowContent;
376
+ }
377
+
378
+ function handleFallback(
379
+ node: RootContent,
380
+ config: MarkdownImportConfig,
381
+ fallbackText: string,
382
+ generateId: () => string,
383
+ ): OutputBlockData[] | null {
384
+ // Try onUnknownNode first for unmapped block types
385
+ if (config.onUnknownNode) {
386
+ const result = tryOnUnknownNode(config.onUnknownNode, node);
387
+
388
+ // null means "skip this node" — respect the caller's decision
389
+ // non-null means the hook handled it
390
+ if (result === null) {
391
+ return null;
392
+ }
393
+
394
+ return result;
395
+ }
396
+
397
+ return [makeParagraph(fallbackText, generateId)];
398
+ }
399
+
400
+ function makeParagraph(text: string, generateId: () => string): OutputBlockData {
401
+ return makeBlock('paragraph', { text }, generateId);
402
+ }
403
+
404
+ function makeBlock(type: string, data: Record<string, unknown>, generateId: () => string): OutputBlockData {
405
+ return {
406
+ id: generateId(),
407
+ type,
408
+ data,
409
+ };
410
+ }
411
+
412
+ function escapeHtml(text: string): string {
413
+ return text
414
+ .replace(/&/g, '&amp;')
415
+ .replace(/</g, '&lt;')
416
+ .replace(/>/g, '&gt;')
417
+ .replace(/"/g, '&quot;');
418
+ }
@@ -0,0 +1,60 @@
1
+ import type { PhrasingContent } from 'mdast';
2
+
3
+ /**
4
+ * Escape HTML special characters to prevent XSS.
5
+ */
6
+ function escapeHtml(text: string): string {
7
+ return text
8
+ .replace(/&/g, '&amp;')
9
+ .replace(/</g, '&lt;')
10
+ .replace(/>/g, '&gt;')
11
+ .replace(/"/g, '&quot;');
12
+ }
13
+
14
+ /**
15
+ * Serialize an array of mdast phrasing (inline) nodes to an HTML string.
16
+ * Produces the HTML that Blok stores in block `text` fields.
17
+ */
18
+ export function phrasingToHtml(nodes: PhrasingContent[]): string {
19
+ return nodes.map(serializeNode).join('');
20
+ }
21
+
22
+ function serializeNode(node: PhrasingContent): string {
23
+ switch (node.type) {
24
+ case 'text':
25
+ return escapeHtml(node.value);
26
+
27
+ case 'strong':
28
+ return `<strong>${phrasingToHtml(node.children)}</strong>`;
29
+
30
+ case 'emphasis':
31
+ return `<i>${phrasingToHtml(node.children)}</i>`;
32
+
33
+ case 'delete':
34
+ return `<s>${phrasingToHtml(node.children)}</s>`;
35
+
36
+ case 'inlineCode':
37
+ return `<code>${escapeHtml(node.value)}</code>`;
38
+
39
+ case 'link':
40
+ return `<a href="${escapeHtml(node.url)}" target="_blank" rel="nofollow">${phrasingToHtml(node.children)}</a>`;
41
+
42
+ case 'break':
43
+ return '<br>';
44
+
45
+ case 'image':
46
+ return `<img src="${escapeHtml(node.url)}" alt="${escapeHtml(node.alt ?? '')}">`;
47
+
48
+ case 'html':
49
+ return node.value;
50
+
51
+ case 'inlineMath':
52
+ case 'footnoteReference':
53
+ case 'imageReference':
54
+ case 'linkReference':
55
+ return '';
56
+
57
+ default:
58
+ return '';
59
+ }
60
+ }
@@ -0,0 +1,42 @@
1
+ import type { Extension as MicromarkExtension } from 'micromark-util-types';
2
+ import type { Extension as MdastExtension } from 'mdast-util-from-markdown';
3
+ import type { BlockToolData } from '../../types';
4
+ import type { OutputBlockData } from '../../types/data-formats/output-data';
5
+ import type { Nodes } from 'mdast';
6
+
7
+ /**
8
+ * Maps an mdast node type to a Blok tool.
9
+ */
10
+ export interface ToolMapEntry {
11
+ /** Blok tool name to use */
12
+ tool: string;
13
+
14
+ /** Transform the mdast node into block tool data */
15
+ data: (node: Nodes) => BlockToolData;
16
+
17
+ /**
18
+ * Produce child blocks for container tools.
19
+ * `convert` is the converter's own recursive function.
20
+ */
21
+ children?: (node: Nodes, convert: (nodes: Nodes[]) => OutputBlockData[]) => OutputBlockData[];
22
+ }
23
+
24
+ /**
25
+ * Configuration for markdownToBlocks().
26
+ */
27
+ export interface MarkdownImportConfig {
28
+ /** Map mdast node types to custom Blok tools. Checked before built-in handlers. */
29
+ toolMap?: Record<string, ToolMapEntry>;
30
+
31
+ /** Catch-all for nodes not handled by toolMap or built-ins. Return null to skip. */
32
+ onUnknownNode?: (node: Nodes) => OutputBlockData[] | null;
33
+
34
+ /** Enable GFM (tables, task lists, strikethrough). Default: true */
35
+ gfm?: boolean;
36
+
37
+ /** Additional micromark syntax extensions */
38
+ extensions?: MicromarkExtension[];
39
+
40
+ /** Additional mdast extensions */
41
+ mdastExtensions?: MdastExtension[];
42
+ }
@@ -5,7 +5,6 @@
5
5
  * - ReadOnlyMode: Editor in read-only state
6
6
  * - EmptyEditor: Editor with no initial content
7
7
  * - ToolboxOpenedMode: Editor with toolbox popover open
8
- * - NarrowMode: Editor in constrained width container
9
8
  *
10
9
  * Do not duplicate these stories in other files.
11
10
  */
@@ -84,52 +83,6 @@ export const ReadOnlyMode: Story = {
84
83
  },
85
84
  };
86
85
 
87
- /**
88
- * Narrow mode - editor in a constrained width container.
89
- * Toolbar actions move inside the content area.
90
- */
91
- export const NarrowMode: Story = {
92
- args: {
93
- data: sampleData,
94
- readOnly: false,
95
- width: 400,
96
- },
97
- parameters: {
98
- chromatic: { delay: 500 },
99
- },
100
- play: async ({ canvasElement, step }) => {
101
- await step('Wait for editor and toolbar to initialize', async () => {
102
- await waitFor(
103
- () => {
104
- const block = canvasElement.querySelector(BLOCK_TESTID);
105
-
106
- expect(block).toBeInTheDocument();
107
- },
108
- TIMEOUT_INIT
109
- );
110
- // Wait for toolbar to be created (happens in requestIdleCallback)
111
- await waitForToolbar(canvasElement);
112
- });
113
-
114
- await step('Click block to show toolbar in narrow mode', async () => {
115
- const block = canvasElement.querySelector(BLOCK_TESTID);
116
-
117
- if (block) {
118
- simulateClick(block);
119
- }
120
-
121
- await waitFor(
122
- () => {
123
- const toolbar = canvasElement.querySelector(TOOLBAR_TESTID);
124
-
125
- expect(toolbar).toHaveAttribute('data-blok-opened', 'true');
126
- },
127
- TIMEOUT_ACTION
128
- );
129
- });
130
- },
131
- };
132
-
133
86
  /**
134
87
  * Empty editor state - no blocks.
135
88
  */
@@ -214,7 +167,6 @@ export const ToolboxOpenedMode: Story = {
214
167
  args: {
215
168
  data: sampleData,
216
169
  readOnly: false,
217
- width: 450,
218
170
  },
219
171
  parameters: {
220
172
  chromatic: { delay: 500 },
@@ -269,18 +221,6 @@ export const ToolboxOpenedMode: Story = {
269
221
  },
270
222
  };
271
223
 
272
- /**
273
- * Compact narrow editor (mobile-like).
274
- */
275
- export const CompactNarrow: Story = {
276
- args: {
277
- data: sampleData,
278
- readOnly: false,
279
- width: 320,
280
- minHeight: 200,
281
- },
282
- };
283
-
284
224
  /**
285
225
  * RTL (Right-to-Left) mode for languages like Arabic and Hebrew.
286
226
  * Text direction and toolbar positioning are mirrored.