@jackuait/blok 0.9.0 → 0.10.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codemod/migrate-editorjs-to-blok.js +50 -2
- package/codemod/test.js +39 -6
- package/dist/blok.mjs +3 -3
- package/dist/chunks/_basePickBy-DISiGhsr.mjs +410 -0
- package/dist/chunks/_baseUniq-gAuHRtRF.mjs +1045 -0
- package/dist/chunks/_getTag-Aj56Wgor.mjs +26 -0
- package/dist/chunks/arc-D-pL2Ftf.mjs +80 -0
- package/dist/chunks/architecture-YZFGNWBL-CuqTb_ae.mjs +3 -0
- package/dist/chunks/architectureDiagram-Q4EWVU46-DS7mqjL2.mjs +4066 -0
- package/dist/chunks/array-BsrkCVSZ.mjs +6 -0
- package/dist/chunks/blockDiagram-DXYQGD6D-BTtcn4NG.mjs +3259 -0
- package/dist/chunks/{blok-RJ3hyzDH.mjs → blok-Bg3-zpSu.mjs} +2192 -2156
- package/dist/chunks/c-C6JXJf5K.mjs +5 -0
- package/dist/chunks/c4Diagram-AHTNJAMY-Y4Dcwcoo.mjs +2956 -0
- package/dist/chunks/ccount-C9Y7nqDe.mjs +10 -0
- package/dist/chunks/channel-Cln-eWE0.mjs +5 -0
- package/dist/chunks/chunk-2KRD3SAO-DkM7qh-k.mjs +20 -0
- package/dist/chunks/chunk-336JU56O-B17AtzlK.mjs +49 -0
- package/dist/chunks/chunk-426QAEUC-D6UAVUog.mjs +13 -0
- package/dist/chunks/chunk-4BX2VUAB-CgIkjF7Z.mjs +19 -0
- package/dist/chunks/chunk-4TB4RGXK-BUP4eON3.mjs +3250 -0
- package/dist/chunks/chunk-55IACEB6-zZ-IgaSt.mjs +8 -0
- package/dist/chunks/chunk-5FUZZQ4R-DsZnJYxM.mjs +3786 -0
- package/dist/chunks/chunk-5PVQY5BW-CORl9dnu.mjs +1692 -0
- package/dist/chunks/chunk-67CJDMHE-m0UKdcSH.mjs +20 -0
- package/dist/chunks/chunk-7N4EOEYR-DKNajFZd.mjs +29 -0
- package/dist/chunks/chunk-AA7GKIK3-BeLhNzKa.mjs +24 -0
- package/dist/chunks/chunk-BSJP7CBP-CJExmx8a.mjs +83 -0
- package/dist/chunks/chunk-CIAEETIT-CTikoJ19.mjs +20 -0
- package/dist/chunks/chunk-D6kmoKXy.mjs +20 -0
- package/dist/chunks/chunk-EDXVE4YY-DjInnnwb.mjs +26 -0
- package/dist/chunks/chunk-ENJZ2VHE-CIl5FRDA.mjs +566 -0
- package/dist/chunks/chunk-FMBD7UC4-DjV0W7UE.mjs +5 -0
- package/dist/chunks/chunk-FOC6F5B3-LmHCCWYY.mjs +20 -0
- package/dist/chunks/chunk-ICPOFSXX-BHZIN46A.mjs +3290 -0
- package/dist/chunks/chunk-K5T4RW27-BPZ6fFnW.mjs +16370 -0
- package/dist/chunks/chunk-KGLVRYIC-S1OQdW76.mjs +20 -0
- package/dist/chunks/chunk-LIHQZDEY-CjtyJlI6.mjs +55 -0
- package/dist/chunks/chunk-ORNJ4GCN-CdO0hAge.mjs +25 -0
- package/dist/chunks/chunk-OYMX7WX6-ApX8eV4o.mjs +2038 -0
- package/dist/chunks/chunk-QZHKN3VN-BGFuA6-k.mjs +12 -0
- package/dist/chunks/chunk-U2HBQHQK-B88ZUOTL.mjs +1875 -0
- package/dist/chunks/chunk-X2U36JSP-1VS5TyCr.mjs +68 -0
- package/dist/chunks/chunk-XPW4576I-BMupdrvo.mjs +1146 -0
- package/dist/chunks/chunk-YZCP3GAM-BQ7eEsm2.mjs +60 -0
- package/dist/chunks/chunk-ZZ45TVLE-D1xks9zd.mjs +33 -0
- package/dist/chunks/classDiagram-6PBFFD2Q-C59BZJxp.mjs +30 -0
- package/dist/chunks/classDiagram-v2-HSJHXN6E-7a0qeMsE.mjs +30 -0
- package/dist/chunks/clone-Ckjt1LtE.mjs +8 -0
- package/dist/chunks/{constants-A3iVmQL8.mjs → constants-D7zjGD5W.mjs} +529 -530
- package/dist/chunks/core-Bm6DWt7D.mjs +4501 -0
- package/dist/chunks/cose-bilkent-S5V4N54A-Bpcs2jA_.mjs +2246 -0
- package/dist/chunks/cpp-BdjvAny0.mjs +16 -0
- package/dist/chunks/csharp-YHxeHpeH.mjs +3 -0
- package/dist/chunks/css-DdLevFaX.mjs +3 -0
- package/dist/chunks/cytoscape.esm-BvD8wo00.mjs +18108 -0
- package/dist/chunks/dagre-CGNbYTKq.mjs +1536 -0
- package/dist/chunks/dagre-KV5264BT-DUD9ikgN.mjs +298 -0
- package/dist/chunks/dart-DrPWqfcC.mjs +3 -0
- package/dist/chunks/default-qigT1Xpq.mjs +4 -0
- package/dist/chunks/defaultLocale-ChuSeAxU.mjs +201 -0
- package/dist/chunks/diagram-5BDNPKRD-CZGfTYEe.mjs +112 -0
- package/dist/chunks/diagram-G4DWMVQ6-CuS0-h95.mjs +546 -0
- package/dist/chunks/diagram-MMDJMWI5-C-AEApYz.mjs +234 -0
- package/dist/chunks/diagram-TYMM5635-CiwAJVMq.mjs +144 -0
- package/dist/chunks/dist-Ctq-pyfb.mjs +59 -0
- package/dist/chunks/dockerfile-C68ALcaN.mjs +3 -0
- package/dist/chunks/engine-javascript-CJpnSvzf.mjs +2373 -0
- package/dist/chunks/erDiagram-SMLLAGMA-DeH5yck2.mjs +1712 -0
- package/dist/chunks/flowDiagram-DWJPFMVM-Cr6dwmQ5.mjs +4175 -0
- package/dist/chunks/ganttDiagram-T4ZO3ILL-K-divBg_.mjs +3083 -0
- package/dist/chunks/gitGraph-7Q5UKJZL-Dl-vQzrq.mjs +3 -0
- package/dist/chunks/gitGraphDiagram-UUTBAWPF-UytPZv72.mjs +792 -0
- package/dist/chunks/go-Fm5N96DN.mjs +3 -0
- package/dist/chunks/graphlib-Cye9EPNq.mjs +223 -0
- package/dist/chunks/graphql-BSnqmqgO.mjs +11 -0
- package/dist/chunks/html-BLNeZvnp.mjs +10 -0
- package/dist/chunks/{i18next-Ch0gVA3V.mjs → i18next-CXx5niYF.mjs} +1 -1
- package/dist/chunks/{i18next-loader-dH3UPF7S.mjs → i18next-loader-CwsYu0n6.mjs} +2 -2
- package/dist/chunks/info-OMHHGYJF-BOejJvJR.mjs +3 -0
- package/dist/chunks/infoDiagram-42DDH7IO-DuYnDbF3.mjs +29 -0
- package/dist/chunks/init-C6T-mugb.mjs +15 -0
- package/dist/chunks/ishikawaDiagram-UXIWVN3A-CHc59dLn.mjs +719 -0
- package/dist/chunks/java-83DWBpzu.mjs +5 -0
- package/dist/chunks/javascript-CBgeF1Xx.mjs +3 -0
- package/dist/chunks/journeyDiagram-VCZTEJTY-CD25C4_n.mjs +885 -0
- package/dist/chunks/json-BI17y-1H.mjs +3 -0
- package/dist/chunks/kanban-definition-6JOO6SKY-CTCT6N_p.mjs +980 -0
- package/dist/chunks/katex-CmTPfM0f.mjs +22026 -0
- package/dist/chunks/kotlin-DjnvsrfO.mjs +3 -0
- package/dist/chunks/latex-24n3TcOR.mjs +5 -0
- package/dist/chunks/{lightweight-i18n-1rbaxIZW.mjs → lightweight-i18n-Cvv8CWh4.mjs} +69 -2
- package/dist/chunks/line-Dct5pMmw.mjs +34 -0
- package/dist/chunks/linear-BRCpMvtr.mjs +289 -0
- package/dist/chunks/lua-DV0fuZWx.mjs +5 -0
- package/dist/chunks/markdown-BqQYT45f.mjs +3 -0
- package/dist/chunks/mdast-util-math-BlK2Zu-1.mjs +151 -0
- package/dist/chunks/mermaid-parser.core-CA3DKkuk.mjs +57 -0
- package/dist/chunks/mermaid-vF0cEnZ0.mjs +3 -0
- package/dist/chunks/mermaid.core-CA8nc1sZ.mjs +989 -0
- package/dist/{messages-DaOnbI6d.mjs → chunks/messages-8IHf7ZP3.mjs} +68 -1
- package/dist/chunks/{messages-C9aKfCro.mjs → messages-A_MkXDlG.mjs} +68 -1
- package/dist/{messages-BLEVLZve.mjs → chunks/messages-B0vPBsWq.mjs} +68 -1
- package/dist/chunks/{messages-C0hQPZmh2.mjs → messages-B2N4fUi72.mjs} +68 -1
- package/dist/{messages-HNAtlVax.mjs → chunks/messages-B4UMuyjT.mjs} +73 -6
- package/dist/chunks/{messages-DRUkmDVZ.mjs → messages-B9kmbUWV.mjs} +68 -1
- package/dist/{messages-Dbsx9m5q2.mjs → chunks/messages-BA8Iv99Y2.mjs} +68 -1
- package/dist/chunks/{messages-Da-SOTFW.mjs → messages-BAsb5CgZ.mjs} +68 -1
- package/dist/{messages-D1P0QGLz2.mjs → chunks/messages-BDZA10kl2.mjs} +68 -1
- package/dist/chunks/{messages-ComLU2T32.mjs → messages-BE6lHKwf.mjs} +68 -1
- package/dist/chunks/{messages-gaxTO-87.mjs → messages-BQYvBqm2.mjs} +68 -1
- package/dist/chunks/{messages-BwKs-9DF.mjs → messages-BSghd0ez.mjs} +68 -1
- package/dist/{messages-BPRR6TMf.mjs → chunks/messages-BUVhHx0q2.mjs} +68 -1
- package/dist/{messages-B7jZvo-m.mjs → chunks/messages-BVjoM7P0.mjs} +68 -1
- package/dist/{messages-C-4z1-Dh.mjs → chunks/messages-BXM80fdr2.mjs} +68 -1
- package/dist/{messages-Bm0nvUuj2.mjs → chunks/messages-BYlSMRkd.mjs} +68 -1
- package/dist/chunks/{messages-DLPrj3Dh.mjs → messages-BYxLFj7y.mjs} +68 -1
- package/dist/{messages-BRcLIBCd2.mjs → chunks/messages-BeFqtIrc2.mjs} +68 -1
- package/dist/{messages-zHkURG6V2.mjs → chunks/messages-Bfnq1xv4.mjs} +68 -1
- package/dist/chunks/{messages-Z762-GLL.mjs → messages-BhzzNkN-.mjs} +68 -1
- package/dist/chunks/{messages-COJ0CbVV2.mjs → messages-BjadX8jR2.mjs} +68 -1
- package/dist/{messages-B2ZwD4n9.mjs → chunks/messages-Bp8qin1R.mjs} +68 -1
- package/dist/chunks/{messages-DdEWnfAR.mjs → messages-Bphq_Bt3.mjs} +71 -4
- package/dist/{messages-CUDbNJG5.mjs → chunks/messages-Bxvi1ebN.mjs} +68 -1
- package/dist/chunks/{messages-B0t2L3bi.mjs → messages-C0HvoMPb.mjs} +68 -1
- package/dist/{messages-D6qfWi6H2.mjs → chunks/messages-C3aX3q0H.mjs} +68 -1
- package/dist/chunks/{messages-v9NkxRcL.mjs → messages-C6Mpiacw.mjs} +68 -1
- package/dist/chunks/{messages-CqZ9vFyx.mjs → messages-C7VGpihw.mjs} +69 -2
- package/dist/chunks/{messages-Yj4Q1_uX2.mjs → messages-CKBhDGI3.mjs} +69 -2
- package/dist/chunks/{messages-DxtnwNPo.mjs → messages-COO5xmcA.mjs} +68 -1
- package/dist/{messages-CZTcgUzd.mjs → chunks/messages-CSJ_zb3a2.mjs} +68 -1
- package/dist/{messages-A8aZS7d_2.mjs → chunks/messages-CSL-6xfb2.mjs} +68 -1
- package/dist/{messages-CxruHsuD2.mjs → chunks/messages-CVdpweyf2.mjs} +69 -2
- package/dist/{messages-D2Mf9z2D.mjs → chunks/messages-Cdf0W9H02.mjs} +68 -1
- package/dist/chunks/{messages-DAbCNake2.mjs → messages-Ck81cQkn2.mjs} +68 -1
- package/dist/chunks/{messages-Dyku8Cut.mjs → messages-Cmf6NhSC.mjs} +68 -1
- package/dist/chunks/{messages-DQ6bFum9.mjs → messages-Cs81Z_Bh.mjs} +68 -1
- package/dist/chunks/{messages-cegxHurd2.mjs → messages-Cu-Wevxs2.mjs} +68 -1
- package/dist/{messages-D2HwpoUE.mjs → chunks/messages-D3zojZ94.mjs} +69 -2
- package/dist/{messages-BfTBVFd9.mjs → chunks/messages-D55HRx5O2.mjs} +68 -1
- package/dist/chunks/{messages-Dl03jd4b2.mjs → messages-D9N2MvQx2.mjs} +68 -1
- package/dist/{messages-DfXh-i9o.mjs → chunks/messages-DG-4DPmP.mjs} +68 -1
- package/dist/chunks/{messages-DmJf9laH2.mjs → messages-DGL1ySqb2.mjs} +68 -1
- package/dist/chunks/{messages-DfU4yvkL.mjs → messages-DJoNVjqP.mjs} +68 -1
- package/dist/{messages-Bsd4ruEY.mjs → chunks/messages-DMVXnAYj.mjs} +70 -3
- package/dist/{messages-3WhPEFd7.mjs → chunks/messages-DOuS1Qge.mjs} +68 -1
- package/dist/chunks/{messages-B1kDfIN82.mjs → messages-DWu1r4gc2.mjs} +68 -1
- package/dist/{messages-Dtih3ffa2.mjs → chunks/messages-DlLXpgWM2.mjs} +68 -1
- package/dist/chunks/{messages-DKNULJpc.mjs → messages-DlonA3wa.mjs} +69 -2
- package/dist/{messages-C5pBfa_W.mjs → chunks/messages-Dr0Ekmbz.mjs} +81 -14
- package/dist/{messages-Du62vI49.mjs → chunks/messages-DzTk8bJ5.mjs} +68 -1
- package/dist/{messages-DNAp0U4l2.mjs → chunks/messages-FWfsxpBz.mjs} +68 -1
- package/dist/{messages-B2YeJw8s2.mjs → chunks/messages-G416eyjY.mjs} +68 -1
- package/dist/chunks/{messages-C5-aaU2b.mjs → messages-Je5YvxiY.mjs} +68 -1
- package/dist/chunks/{messages-DHHZUf_H2.mjs → messages-JyvWu4rf2.mjs} +68 -1
- package/dist/chunks/{messages-D_6vPBzT.mjs → messages-KdawW5Na.mjs} +68 -1
- package/dist/chunks/{messages-DnuhgHG0.mjs → messages-MxpWO1db.mjs} +68 -1
- package/dist/{messages-DT4rHATO2.mjs → chunks/messages-NEqrrYvE2.mjs} +68 -1
- package/dist/chunks/{messages-DeSSxLsh.mjs → messages-RInp1ytX.mjs} +68 -1
- package/dist/{messages-DfEPVRdJ.mjs → chunks/messages-TRUuyiFB.mjs} +68 -1
- package/dist/chunks/{messages--eH7tTJV2.mjs → messages-aZcy0JQq2.mjs} +68 -1
- package/dist/{messages-O6z1uabG.mjs → chunks/messages-iS34FHFB.mjs} +68 -1
- package/dist/{messages-BE0DjTEC.mjs → chunks/messages-ihCjSFJI2.mjs} +68 -1
- package/dist/chunks/{messages-_5Pg5fKy2.mjs → messages-jfVpL9c-2.mjs} +68 -1
- package/dist/chunks/{messages-CaRSYuhO.mjs → messages-p1mbe__S.mjs} +68 -1
- package/dist/chunks/{messages-BGssMBWM2.mjs → messages-rCd0Rrw6.mjs} +69 -2
- package/dist/{messages-COgvIEeW.mjs → chunks/messages-xuqyb6Ff2.mjs} +68 -1
- package/dist/chunks/micromark-extension-math-BbkUb36G.mjs +169 -0
- package/dist/chunks/micromark-factory-space-y4SDWQKm.mjs +36 -0
- package/dist/chunks/mindmap-definition-QFDTVHPH-hNnyBkEP.mjs +1013 -0
- package/dist/chunks/{notifier-Butv4Dvo.mjs → notifier-CuvTt9pe.mjs} +1 -1
- package/dist/chunks/objectWithoutProperties-D0XxKB4n.mjs +23 -0
- package/dist/chunks/one-light-DmNO_Y4X.mjs +4 -0
- package/dist/chunks/ordinal-B-kolV-i.mjs +65 -0
- package/dist/chunks/packet-4T2RLAQJ-B5ZMgwzZ.mjs +3 -0
- package/dist/chunks/path-rIMjg_tH.mjs +85 -0
- package/dist/chunks/php-DmXKyPwJ.mjs +18 -0
- package/dist/chunks/pie-ZZUOXDRM-B9l6y0XJ.mjs +3 -0
- package/dist/chunks/pieDiagram-DEJITSTG-Gw-fsc6U.mjs +179 -0
- package/dist/chunks/python-DfwfY9t5.mjs +3 -0
- package/dist/chunks/quadrantDiagram-34T5L4WZ-CQ5fGYI5.mjs +1960 -0
- package/dist/chunks/r-BD2D7qEW.mjs +5 -0
- package/dist/chunks/radar-PYXPWWZC-D5kYmUaB.mjs +3 -0
- package/dist/chunks/requirementDiagram-MS252O5E-DjWKB42c.mjs +2224 -0
- package/dist/chunks/rough.esm-cmMIcj7N.mjs +1353 -0
- package/dist/chunks/ruby-DdOo03Kg.mjs +33 -0
- package/dist/chunks/rust-DEDueB5R.mjs +3 -0
- package/dist/chunks/sankeyDiagram-XADWPNL6-BIN2evSB.mjs +909 -0
- package/dist/chunks/scala-CsjqvxE4.mjs +3 -0
- package/dist/chunks/sequenceDiagram-FGHM5R23-CQz2lMoS.mjs +4181 -0
- package/dist/chunks/shellscript-Bh5zEpnQ.mjs +3 -0
- package/dist/chunks/sql-D9CrOi1i.mjs +3 -0
- package/dist/chunks/src-DVJl6f6s.mjs +2149 -0
- package/dist/chunks/stateDiagram-FHFEXIEX-BIBFsF65.mjs +218 -0
- package/dist/chunks/stateDiagram-v2-QKLJ7IA2-BZUmAVw7.mjs +28 -0
- package/dist/chunks/swift-Dpyt0s2c.mjs +3 -0
- package/dist/chunks/timeline-definition-GMOUNBTQ-CzvQ7Lav.mjs +1084 -0
- package/dist/chunks/{tools-nT6zA9QL.mjs → tools-CrRhWn8L.mjs} +3043 -1303
- package/dist/chunks/treeView-SZITEDCU-BNtnNxpI.mjs +3 -0
- package/dist/chunks/treemap-W4RFUUIX-DYENULz2.mjs +3 -0
- package/dist/chunks/typescript-DO5cd4m8.mjs +5 -0
- package/dist/chunks/vennDiagram-DHZGUBPP-B0DmLQqe.mjs +1876 -0
- package/dist/chunks/vitesse-dark-CcorSKT2.mjs +4 -0
- package/dist/chunks/wardley-RL74JXVD-ByNHVBTb.mjs +3 -0
- package/dist/chunks/wardleyDiagram-NUSXRM2D-CzoKesUw.mjs +594 -0
- package/dist/chunks/xml-g8kXXALs.mjs +5 -0
- package/dist/chunks/xychartDiagram-5P7HB3ND-CixwR8r2.mjs +2017 -0
- package/dist/chunks/yaml-CrNNZyLb.mjs +3 -0
- package/dist/cli.mjs +1 -1
- package/dist/full.mjs +14 -14
- package/dist/locales.mjs +135 -68
- package/dist/markdown.mjs +3954 -0
- package/dist/{messages-D_CUdqU12.mjs → messages-5jvKxQNu2.mjs} +68 -1
- package/dist/{chunks/messages-CFfpHyTU.mjs → messages-7QD-X6XT2.mjs} +68 -1
- package/dist/{messages-CdX1odk_2.mjs → messages-96iaAUds2.mjs} +68 -1
- package/dist/{messages-C8ca-jEa.mjs → messages-B19o-Teb.mjs} +69 -2
- package/dist/{messages-I03yFhup.mjs → messages-B1ZUQagA.mjs} +68 -1
- package/dist/{chunks/messages-BSw88lIo2.mjs → messages-B7ieAJBd2.mjs} +68 -1
- package/dist/{messages-sNSXCkeB.mjs → messages-BECMxmfX.mjs} +68 -1
- package/dist/{messages-DgGZsxBB.mjs → messages-BIHc0KHY.mjs} +68 -1
- package/dist/{messages-yZj20Fvf.mjs → messages-BIoeoik5.mjs} +68 -1
- package/dist/{chunks/messages-D8JFu42v.mjs → messages-BJeGJksD.mjs} +68 -1
- package/dist/{messages-BSLErTnW2.mjs → messages-BRZX964b2.mjs} +68 -1
- package/dist/{chunks/messages-BW8arxf72.mjs → messages-BTQPpoM42.mjs} +68 -1
- package/dist/{messages-C52AiyVV.mjs → messages-BYNcD6uR.mjs} +68 -1
- package/dist/{messages-BxJv0qBn2.mjs → messages-BYmmMDrN2.mjs} +68 -1
- package/dist/{messages-CoCy2JIP.mjs → messages-BbYq1pk-.mjs} +68 -1
- package/dist/{messages-Cnz_SHE32.mjs → messages-BiUGXvYr2.mjs} +68 -1
- package/dist/{chunks/messages-Dl6SVT1Z.mjs → messages-BiiongNz2.mjs} +68 -1
- package/dist/{chunks/messages-C912bk5I.mjs → messages-Bm0Feca1.mjs} +69 -2
- package/dist/{chunks/messages-CTuCPqpJ.mjs → messages-BmAn22OX.mjs} +68 -1
- package/dist/{messages-DdiPWkV8.mjs → messages-Bq3F2Tp_.mjs} +68 -1
- package/dist/{chunks/messages-DJxXZi1D2.mjs → messages-BsycN_JI2.mjs} +68 -1
- package/dist/{chunks/messages-OdEuBvgf.mjs → messages-BwHs4cm1.mjs} +70 -3
- package/dist/{chunks/messages-C4ZAJzBh.mjs → messages-CJTy6JZt.mjs} +68 -1
- package/dist/{chunks/messages-D2OZ9dbO.mjs → messages-CR_L_UtK.mjs} +68 -1
- package/dist/{messages-ypuLZyw12.mjs → messages-CSUHBs4c2.mjs} +68 -1
- package/dist/{chunks/messages-BkES2MDr2.mjs → messages-CWIXvnDf2.mjs} +68 -1
- package/dist/{messages-Cpeko5kB.mjs → messages-CcF4y-E4.mjs} +68 -1
- package/dist/{messages-BmnC-s4X.mjs → messages-Ce6KVEbT.mjs} +68 -1
- package/dist/{messages-DTNfG4ZH.mjs → messages-Ci0KqX-J.mjs} +71 -4
- package/dist/{chunks/messages-CGh56r-H2.mjs → messages-CjbnogEC.mjs} +68 -1
- package/dist/{messages-B3jq5Hpa.mjs → messages-CmB406HW.mjs} +69 -2
- package/dist/{chunks/messages-BsZz1Hnn2.mjs → messages-CqXtJTpU.mjs} +68 -1
- package/dist/{messages-DL000FUf2.mjs → messages-D0aw5_0k2.mjs} +68 -1
- package/dist/{chunks/messages-Df2RYuup2.mjs → messages-D8FQWulF2.mjs} +68 -1
- package/dist/{messages-CxHn7cs2.mjs → messages-DBiVgUs2.mjs} +68 -1
- package/dist/{chunks/messages-Dsapm4K9.mjs → messages-DIJlIqlQ2.mjs} +68 -1
- package/dist/{chunks/messages-517llQmh.mjs → messages-DLX_iBDJ.mjs} +68 -1
- package/dist/{chunks/messages-BG8Nq35G.mjs → messages-DLlc9QPw.mjs} +68 -1
- package/dist/{messages-cokJPuUp2.mjs → messages-DMr62KiO2.mjs} +68 -1
- package/dist/{chunks/messages-Dkp-Eyu02.mjs → messages-DPA-mMWC2.mjs} +68 -1
- package/dist/{chunks/messages-7uCUVFea.mjs → messages-DTh9a8mR.mjs} +68 -1
- package/dist/{messages-VBFioL2M.mjs → messages-DY4IqlhY.mjs} +68 -1
- package/dist/{chunks/messages-C4X0xP3h.mjs → messages-DYTTu0O12.mjs} +68 -1
- package/dist/{messages-diSPQ2Da2.mjs → messages-DbySKTKt2.mjs} +69 -2
- package/dist/{chunks/messages-BGE43_6M.mjs → messages-Ddnj2iTG2.mjs} +68 -1
- package/dist/{chunks/messages-BtUqUzMG2.mjs → messages-DkLU_rWm.mjs} +68 -1
- package/dist/{messages-DSX2HaeN2.mjs → messages-Dl3Sv6Rq2.mjs} +68 -1
- package/dist/{chunks/messages-BDvpl6Ox.mjs → messages-Dl5Y2-Ia.mjs} +81 -14
- package/dist/{chunks/messages-C7plNvNE2.mjs → messages-DnG0ef8t2.mjs} +69 -2
- package/dist/{chunks/messages-qS8tM3Dk.mjs → messages-DnGJD4TL.mjs} +68 -1
- package/dist/{messages-Ct468oX22.mjs → messages-Dnp9N6RU2.mjs} +68 -1
- package/dist/{chunks/messages-CjIA--kO.mjs → messages-Dvn35ksS.mjs} +68 -1
- package/dist/{messages-BRxNqmJ8.mjs → messages-Dw__BcTj.mjs} +68 -1
- package/dist/{chunks/messages-0zhE8A9X.mjs → messages-Dy-Y_nEI.mjs} +68 -1
- package/dist/{chunks/messages-CCH4OETw2.mjs → messages-E_ZuzGDt.mjs} +68 -1
- package/dist/{chunks/messages-DZzoT0T_.mjs → messages-F2xRoY1w.mjs} +68 -1
- package/dist/{chunks/messages-zGdqNZbH.mjs → messages-Smt4GBbj.mjs} +73 -6
- package/dist/{messages-CvIxHHp92.mjs → messages-aMXpHt5X2.mjs} +68 -1
- package/dist/{messages-C8JVJUp12.mjs → messages-aWZH50vu2.mjs} +68 -1
- package/dist/{messages-Phrqr7a6.mjs → messages-dv19AkyJ.mjs} +68 -1
- package/dist/{chunks/messages-DngM4hda2.mjs → messages-hWwSRF-2.mjs} +68 -1
- package/dist/{messages-DpGo_Da5.mjs → messages-j7o5rT9s.mjs} +68 -1
- package/dist/{messages-C6WJx6Z0.mjs → messages-nUVjeh7K.mjs} +68 -1
- package/dist/{messages-CbVilNPE.mjs → messages-nlhESX9t.mjs} +68 -1
- package/dist/{messages-C6o0FVy02.mjs → messages-rk-A1Wa42.mjs} +69 -2
- package/dist/{messages-D4mCIODv.mjs → messages-xh2eOLvs.mjs} +68 -1
- package/dist/{chunks/messages-Ct9UUOrl2.mjs → messages-ynAe7ewZ.mjs} +68 -1
- package/dist/react.mjs +26 -25
- package/dist/tools.mjs +3 -3
- package/dist/vendor.LICENSE.txt +5404 -80
- package/package.json +16 -1
- package/src/components/blocks.ts +26 -1
- package/src/components/constants/data-attributes.ts +2 -2
- package/src/components/i18n/locales/am/messages.json +68 -1
- package/src/components/i18n/locales/ar/messages.json +68 -1
- package/src/components/i18n/locales/az/messages.json +68 -1
- package/src/components/i18n/locales/bg/messages.json +68 -1
- package/src/components/i18n/locales/bn/messages.json +68 -1
- package/src/components/i18n/locales/bs/messages.json +69 -2
- package/src/components/i18n/locales/cs/messages.json +70 -3
- package/src/components/i18n/locales/da/messages.json +71 -4
- package/src/components/i18n/locales/de/messages.json +73 -6
- package/src/components/i18n/locales/dv/messages.json +68 -1
- package/src/components/i18n/locales/el/messages.json +68 -1
- package/src/components/i18n/locales/en/messages.json +68 -1
- package/src/components/i18n/locales/es/messages.json +68 -1
- package/src/components/i18n/locales/et/messages.json +69 -2
- package/src/components/i18n/locales/fa/messages.json +68 -1
- package/src/components/i18n/locales/fi/messages.json +68 -1
- package/src/components/i18n/locales/fil/messages.json +81 -14
- package/src/components/i18n/locales/fr/messages.json +68 -1
- package/src/components/i18n/locales/gu/messages.json +68 -1
- package/src/components/i18n/locales/he/messages.json +68 -1
- package/src/components/i18n/locales/hi/messages.json +68 -1
- package/src/components/i18n/locales/hr/messages.json +69 -2
- package/src/components/i18n/locales/hu/messages.json +68 -1
- package/src/components/i18n/locales/hy/messages.json +68 -1
- package/src/components/i18n/locales/id/messages.json +68 -1
- package/src/components/i18n/locales/it/messages.json +68 -1
- package/src/components/i18n/locales/ja/messages.json +68 -1
- package/src/components/i18n/locales/ka/messages.json +68 -1
- package/src/components/i18n/locales/km/messages.json +68 -1
- package/src/components/i18n/locales/kn/messages.json +68 -1
- package/src/components/i18n/locales/ko/messages.json +68 -1
- package/src/components/i18n/locales/ku/messages.json +68 -1
- package/src/components/i18n/locales/lo/messages.json +68 -1
- package/src/components/i18n/locales/lt/messages.json +68 -1
- package/src/components/i18n/locales/lv/messages.json +68 -1
- package/src/components/i18n/locales/mk/messages.json +68 -1
- package/src/components/i18n/locales/ml/messages.json +68 -1
- package/src/components/i18n/locales/mn/messages.json +68 -1
- package/src/components/i18n/locales/mr/messages.json +68 -1
- package/src/components/i18n/locales/ms/messages.json +69 -2
- package/src/components/i18n/locales/my/messages.json +68 -1
- package/src/components/i18n/locales/ne/messages.json +68 -1
- package/src/components/i18n/locales/nl/messages.json +68 -1
- package/src/components/i18n/locales/no/messages.json +68 -1
- package/src/components/i18n/locales/pa/messages.json +68 -1
- package/src/components/i18n/locales/pl/messages.json +68 -1
- package/src/components/i18n/locales/ps/messages.json +68 -1
- package/src/components/i18n/locales/pt/messages.json +68 -1
- package/src/components/i18n/locales/ro/messages.json +68 -1
- package/src/components/i18n/locales/ru/messages.json +68 -1
- package/src/components/i18n/locales/sd/messages.json +68 -1
- package/src/components/i18n/locales/si/messages.json +68 -1
- package/src/components/i18n/locales/sk/messages.json +69 -2
- package/src/components/i18n/locales/sl/messages.json +69 -2
- package/src/components/i18n/locales/sq/messages.json +68 -1
- package/src/components/i18n/locales/sr/messages.json +68 -1
- package/src/components/i18n/locales/sv/messages.json +68 -1
- package/src/components/i18n/locales/sw/messages.json +68 -1
- package/src/components/i18n/locales/ta/messages.json +68 -1
- package/src/components/i18n/locales/te/messages.json +68 -1
- package/src/components/i18n/locales/th/messages.json +68 -1
- package/src/components/i18n/locales/tr/messages.json +68 -1
- package/src/components/i18n/locales/ug/messages.json +68 -1
- package/src/components/i18n/locales/uk/messages.json +68 -1
- package/src/components/i18n/locales/ur/messages.json +68 -1
- package/src/components/i18n/locales/vi/messages.json +68 -1
- package/src/components/i18n/locales/yi/messages.json +68 -1
- package/src/components/i18n/locales/zh/messages.json +68 -1
- package/src/components/icons/index.ts +78 -0
- package/src/components/inline-tools/inline-tool-code.ts +399 -0
- package/src/components/modules/api/blocks.ts +17 -0
- package/src/components/modules/api/ui.ts +0 -3
- package/src/components/modules/blockEvents/composers/blockSelectionKeys.ts +20 -3
- package/src/components/modules/paste/handlers/html-handler.ts +13 -10
- package/src/components/modules/paste/handlers/index.ts +1 -0
- package/src/components/modules/paste/index.ts +6 -0
- package/src/components/modules/renderer.ts +17 -0
- package/src/components/modules/ui.ts +1 -13
- package/src/components/ui/toolbox.ts +9 -0
- package/src/components/utils/caret/boundaries.ts +15 -4
- package/src/components/utils/popover/popover-desktop.ts +11 -0
- package/src/markdown/index.ts +63 -0
- package/src/markdown/markdown-handler.ts +110 -0
- package/src/markdown/mdast-to-blocks.ts +418 -0
- package/src/markdown/phrasing-to-html.ts +60 -0
- package/src/markdown/types.ts +42 -0
- package/src/stories/EditorModes.stories.ts +0 -60
- package/src/styles/main.css +57 -2
- package/src/tools/callout/constants.ts +2 -1
- package/src/tools/callout/emoji-picker/index.ts +41 -2
- package/src/tools/callout/index.ts +25 -0
- package/src/tools/code/code-keyboard.ts +142 -0
- package/src/tools/code/constants.ts +96 -0
- package/src/tools/code/dom-builder.ts +181 -0
- package/src/tools/code/highlight-applier.ts +229 -0
- package/src/tools/code/index.ts +462 -0
- package/src/tools/code/katex-loader.ts +50 -0
- package/src/tools/code/language-picker.ts +241 -0
- package/src/tools/code/mermaid-loader.ts +45 -0
- package/src/tools/code/shiki-loader.ts +135 -0
- package/src/tools/divider/index.ts +11 -2
- package/src/tools/header/index.ts +2 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/list/block-operations.ts +3 -1
- package/src/tools/list/depth-validator.ts +4 -7
- package/src/tools/list/dom-builder.ts +5 -3
- package/src/tools/list/index.ts +21 -3
- package/src/tools/list/list-helpers.ts +9 -2
- package/src/tools/list/list-keyboard.ts +56 -14
- package/src/tools/list/list-lifecycle.ts +3 -1
- package/src/tools/list/marker-calculator.ts +37 -0
- package/src/tools/list/ordered-marker-manager.ts +4 -2
- package/src/tools/list/style-config.ts +3 -0
- package/src/tools/paragraph/index.ts +1 -0
- package/src/tools/quote/index.ts +229 -0
- package/src/tools/table/core/table-commands.ts +16 -0
- package/src/tools/table/core/table-controller.ts +29 -0
- package/src/tools/table/core/table-events.ts +17 -0
- package/src/tools/table/index.ts +220 -14
- package/src/tools/table/table-cell-blocks.ts +51 -6
- package/src/tools/table/table-cell-clipboard.ts +7 -2
- package/src/tools/table/table-cell-placement-picker.ts +133 -0
- package/src/tools/table/table-cell-selection.ts +174 -19
- package/src/tools/table/table-core.ts +321 -113
- package/src/tools/table/table-map.ts +279 -0
- package/src/tools/table/table-model.ts +901 -1
- package/src/tools/table/table-operations.ts +87 -44
- package/src/tools/table/table-resize.ts +19 -17
- package/src/tools/table/table-row-col-drag.ts +24 -10
- package/src/tools/table/types.ts +24 -2
- package/src/tools/toggle/index.ts +1 -0
- package/types/configs/blok-config.d.ts +7 -0
- package/types/data-attributes.d.ts +0 -1
- package/types/markdown.d.ts +2 -0
- package/types/tools/callout.d.ts +16 -0
- package/types/tools/code.d.ts +13 -0
- package/types/tools/quote.d.ts +13 -0
- package/types/tools/tool-settings.d.ts +7 -0
- package/types/tools-entry.d.ts +7 -0
- /package/dist/chunks/{am-CHDDMHkd.mjs → am-BxlkYGsI.mjs} +0 -0
- /package/dist/chunks/{ar-DoqfNqut.mjs → ar-9vlpr9V8.mjs} +0 -0
- /package/dist/chunks/{az-C34P9iEa.mjs → az-ON63W_FP.mjs} +0 -0
- /package/dist/chunks/{bg-jroXLY8Y.mjs → bg-CtXWTP5w.mjs} +0 -0
- /package/dist/chunks/{bn-BRI-WqxY.mjs → bn-BERvhXM4.mjs} +0 -0
- /package/dist/chunks/{bs-CCGUpNHu.mjs → bs-CBg8NVPG.mjs} +0 -0
- /package/dist/chunks/{cs-D5qZOGuc.mjs → cs-DeQddxS7.mjs} +0 -0
- /package/dist/chunks/{da-DrJ7W37K.mjs → da-DyTo-ec_.mjs} +0 -0
- /package/dist/chunks/{de-BW6-kp2c.mjs → de-Cu7545m1.mjs} +0 -0
- /package/dist/chunks/{el-C-Vc_Otu.mjs → el-oiubLRBq.mjs} +0 -0
- /package/dist/chunks/{es-B6fI5K9i.mjs → es-DZUC6Klv.mjs} +0 -0
- /package/dist/chunks/{et-BhVlZ-Yz.mjs → et-CDeklAog.mjs} +0 -0
- /package/dist/chunks/{fa-D55Ijdqa.mjs → fa-Cafp7_Li.mjs} +0 -0
- /package/dist/chunks/{fi-jNLjhKUQ.mjs → fi-BD_V_aVW.mjs} +0 -0
- /package/dist/chunks/{fil-DYd0T5aX.mjs → fil-Crsfbtx4.mjs} +0 -0
- /package/dist/chunks/{fr-yxy5xWw_.mjs → fr-BGGc04Zv.mjs} +0 -0
- /package/dist/chunks/{gu-CcY_LJe7.mjs → gu-Vg_BgCTp.mjs} +0 -0
- /package/dist/chunks/{he-DL9s7wNw.mjs → he-DTY9chlZ.mjs} +0 -0
- /package/dist/chunks/{hi-C8eGXgw5.mjs → hi-DChMXk0x.mjs} +0 -0
- /package/dist/chunks/{hr-DLpybOhU.mjs → hr-BWVgNU8k.mjs} +0 -0
- /package/dist/chunks/{hu-BkT0gT00.mjs → hu-B37awHXA.mjs} +0 -0
- /package/dist/chunks/{hy-CVFDCp2S.mjs → hy-DGC_GDHh.mjs} +0 -0
- /package/dist/chunks/{id-0P4W9Az0.mjs → id-V7cw6La2.mjs} +0 -0
- /package/dist/chunks/{it-mLY6_uoW.mjs → it-DrTGP8Rn.mjs} +0 -0
- /package/dist/chunks/{ja-7RkeRNWG.mjs → ja-DS4pbJEG.mjs} +0 -0
- /package/dist/chunks/{ka-C7Lx-Qsh.mjs → ka-BueyosRh.mjs} +0 -0
- /package/dist/chunks/{km-Q8udaraH.mjs → km-B0K891yW.mjs} +0 -0
- /package/dist/chunks/{kn-BiETM-iq.mjs → kn-BQ__skg8.mjs} +0 -0
- /package/dist/chunks/{ko-tiB80pF1.mjs → ko-BuPxi_7e.mjs} +0 -0
- /package/dist/chunks/{ku-CY-OABkR.mjs → ku-nQjwPRw2.mjs} +0 -0
- /package/dist/chunks/{lo-CTBhEnyk.mjs → lo-K5NVFoq1.mjs} +0 -0
- /package/dist/chunks/{lt-BHKHEtqK.mjs → lt-D3xD6Eb2.mjs} +0 -0
- /package/dist/chunks/{lv-DWxgtfUg.mjs → lv-DH13mzZj.mjs} +0 -0
- /package/dist/chunks/{mk-BjookGdx.mjs → mk-Bb48BcDA.mjs} +0 -0
- /package/dist/chunks/{ml-L-NnZcp9.mjs → ml-BHPEj1kD.mjs} +0 -0
- /package/dist/chunks/{mn-OMWi7Hl_.mjs → mn-BNGzpdI6.mjs} +0 -0
- /package/dist/chunks/{mr-B6JPzITo.mjs → mr-D5PgU-cH.mjs} +0 -0
- /package/dist/chunks/{ms-CG3S-sPB.mjs → ms-DPkxqKz5.mjs} +0 -0
- /package/dist/chunks/{my-BLAmGfhT.mjs → my-DZGcyfxy.mjs} +0 -0
- /package/dist/chunks/{native-BPcABu9z.mjs → native-D0cfLXsM.mjs} +0 -0
- /package/dist/chunks/{ne-D1JHLfYw.mjs → ne-BU_Wh4Wv.mjs} +0 -0
- /package/dist/chunks/{nl-Ca7Q8FnY.mjs → nl-DtAPk1mK.mjs} +0 -0
- /package/dist/chunks/{no-Coxcohcz.mjs → no-CdW3n3BY.mjs} +0 -0
- /package/dist/chunks/{objectSpread2-CyPxu8-u.mjs → objectSpread2-CWwMYL_U.mjs} +0 -0
- /package/dist/chunks/{pa-CCaXqpaI.mjs → pa-BacCHz87.mjs} +0 -0
- /package/dist/chunks/{pl-Cl_fAZ84.mjs → pl-8zBJbmhZ.mjs} +0 -0
- /package/dist/chunks/{ps-WD5qGAWy.mjs → ps-c6nGXD-W.mjs} +0 -0
- /package/dist/chunks/{pt-C4zvLfvq.mjs → pt-B5yR8Qhr.mjs} +0 -0
- /package/dist/chunks/{ro-DbefHcmM.mjs → ro-Nscylsqb.mjs} +0 -0
- /package/dist/chunks/{ru-uU1J14jd.mjs → ru-DxERQkVJ.mjs} +0 -0
- /package/dist/chunks/{sd-DKu368Ip.mjs → sd-5z-QY3q9.mjs} +0 -0
- /package/dist/chunks/{si-BsJCiPkZ.mjs → si-DTL0mzrx.mjs} +0 -0
- /package/dist/chunks/{sk-CD-a3SN6.mjs → sk-DrGczTvY.mjs} +0 -0
- /package/dist/chunks/{sl-CXhrPJe_.mjs → sl-D8nJjig4.mjs} +0 -0
- /package/dist/chunks/{sq-CTctCoFQ.mjs → sq-C74Hm3YL.mjs} +0 -0
- /package/dist/chunks/{sr-BZkhBwXj.mjs → sr-DAwB05Gj.mjs} +0 -0
- /package/dist/chunks/{sv-NmRZb_xi.mjs → sv-BkHBsN4y.mjs} +0 -0
- /package/dist/chunks/{sw-Be5ik3H6.mjs → sw-BBQLTq_z.mjs} +0 -0
- /package/dist/chunks/{ta-DsXh6neL.mjs → ta-DRRzdKky.mjs} +0 -0
- /package/dist/chunks/{te-CwpCbM8M.mjs → te-CedXLsKM.mjs} +0 -0
- /package/dist/chunks/{th-CcZ15OLk.mjs → th-DDOlGA0W.mjs} +0 -0
- /package/dist/chunks/{tr-q3bTgvhW.mjs → tr-ClgvwOlL.mjs} +0 -0
- /package/dist/chunks/{tw-DmW6-pCY.mjs → tw-CqxBf-1Y.mjs} +0 -0
- /package/dist/chunks/{ug-919EhLsL.mjs → ug-bXxwiinM.mjs} +0 -0
- /package/dist/chunks/{uk-aNMEzd0Y.mjs → uk-Dp46o_VT.mjs} +0 -0
- /package/dist/chunks/{ur-BwQI77sh.mjs → ur-MfEEhdFq.mjs} +0 -0
- /package/dist/chunks/{vi-Dxq806-F.mjs → vi-bt-3LPGO.mjs} +0 -0
- /package/dist/chunks/{zh-BcHuy1Ti.mjs → zh-Dgyb5Ly8.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, '&')
|
|
415
|
+
.replace(/</g, '<')
|
|
416
|
+
.replace(/>/g, '>')
|
|
417
|
+
.replace(/"/g, '"');
|
|
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, '&')
|
|
9
|
+
.replace(/</g, '<')
|
|
10
|
+
.replace(/>/g, '>')
|
|
11
|
+
.replace(/"/g, '"');
|
|
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.
|
package/src/styles/main.css
CHANGED
|
@@ -320,7 +320,6 @@
|
|
|
320
320
|
font-variation-settings: inherit;
|
|
321
321
|
letter-spacing: inherit;
|
|
322
322
|
color: inherit;
|
|
323
|
-
border-radius: 0;
|
|
324
323
|
background-color: transparent;
|
|
325
324
|
opacity: 1;
|
|
326
325
|
}
|
|
@@ -492,7 +491,7 @@
|
|
|
492
491
|
|
|
493
492
|
/* Spacing (also powers w-*, h-*, min-w-*, min-h-*, size-*) */
|
|
494
493
|
--spacing-content-width: 650px;
|
|
495
|
-
|
|
494
|
+
|
|
496
495
|
--spacing-toolbox-btn: 26px;
|
|
497
496
|
--spacing-toolbox-btn-mobile: 36px;
|
|
498
497
|
--spacing-icon: 20px;
|
|
@@ -1126,6 +1125,24 @@
|
|
|
1126
1125
|
border-radius: 4px;
|
|
1127
1126
|
}
|
|
1128
1127
|
|
|
1128
|
+
/**
|
|
1129
|
+
* Content alignment
|
|
1130
|
+
* Applies horizontal alignment to block content based on the editor's contentAlign setting.
|
|
1131
|
+
* Left alignment overrides the mx-auto Tailwind class on [data-blok-element-content].
|
|
1132
|
+
*/
|
|
1133
|
+
[data-blok-content-align="left"] [data-blok-element-content] {
|
|
1134
|
+
margin-left: 0;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
[data-blok-content-align="center"] [data-blok-element-content] {
|
|
1138
|
+
margin-left: auto;
|
|
1139
|
+
margin-right: auto;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
[data-blok-content-align="right"] [data-blok-element-content] {
|
|
1143
|
+
margin-left: auto;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1129
1146
|
/**
|
|
1130
1147
|
* Multi-block drag visual feedback
|
|
1131
1148
|
* Makes selected blocks semi-transparent during multi-block drag operation
|
|
@@ -1191,6 +1208,44 @@
|
|
|
1191
1208
|
@apply p-0 m-0 min-h-[1.6em];
|
|
1192
1209
|
}
|
|
1193
1210
|
|
|
1211
|
+
/* ─── Cell content placement ──────────────────────────────────── */
|
|
1212
|
+
|
|
1213
|
+
[data-blok-cell-placement="top-center"] {
|
|
1214
|
+
align-items: center;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
[data-blok-cell-placement="top-right"] {
|
|
1218
|
+
align-items: flex-end;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
[data-blok-cell-placement="middle-left"] {
|
|
1222
|
+
justify-content: center;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
[data-blok-cell-placement="middle-center"] {
|
|
1226
|
+
align-items: center;
|
|
1227
|
+
justify-content: center;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
[data-blok-cell-placement="middle-right"] {
|
|
1231
|
+
align-items: flex-end;
|
|
1232
|
+
justify-content: center;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
[data-blok-cell-placement="bottom-left"] {
|
|
1236
|
+
justify-content: flex-end;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
[data-blok-cell-placement="bottom-center"] {
|
|
1240
|
+
align-items: center;
|
|
1241
|
+
justify-content: flex-end;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
[data-blok-cell-placement="bottom-right"] {
|
|
1245
|
+
align-items: flex-end;
|
|
1246
|
+
justify-content: flex-end;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1194
1249
|
/**
|
|
1195
1250
|
* Exclude bare 'color' from transition-property inside table cells.
|
|
1196
1251
|
* StyleManager applies transition-colors (which includes 'color') for smooth
|
|
@@ -26,5 +26,6 @@ export const DEFAULT_EMOJI = '💡';
|
|
|
26
26
|
|
|
27
27
|
// CSS — Tailwind classes
|
|
28
28
|
export const WRAPPER_STYLES = 'rounded-xl px-4 py-[5px] my-1 flex items-start gap-2';
|
|
29
|
-
|
|
29
|
+
// h-[38px] = py-[7px]×2 + 1.5rem×1 = 14+24; explicit height prevents platform-specific emoji font metrics from inflating the button
|
|
30
|
+
export const EMOJI_BUTTON_STYLES = 'text-[1.5rem] leading-[1] cursor-pointer bg-transparent border-0 px-0 py-[7px] h-[38px] flex-shrink-0 select-none';
|
|
30
31
|
export const CHILDREN_STYLES = 'flex-1 min-w-0';
|