@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
package/src/tools/list/index.ts
CHANGED
|
@@ -124,12 +124,19 @@ export class ListItem implements BlockTool {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
public render(): HTMLElement {
|
|
127
|
+
const blockIndex = this.blockId
|
|
128
|
+
? this.api.blocks.getBlockIndex(this.blockId) ?? this.api.blocks.getCurrentBlockIndex()
|
|
129
|
+
: this.api.blocks.getCurrentBlockIndex();
|
|
130
|
+
const depth = this._data.depth ?? 0;
|
|
131
|
+
const markerDepth = this.markerCalculator.getVisualDepth(blockIndex, depth);
|
|
132
|
+
|
|
127
133
|
this._element = renderListItem({
|
|
128
134
|
data: this._data,
|
|
129
135
|
readOnly: this.readOnly,
|
|
130
136
|
placeholder: this.placeholder,
|
|
131
137
|
itemColor: this.itemColor,
|
|
132
138
|
itemSize: this.itemSize,
|
|
139
|
+
markerDepth,
|
|
133
140
|
setupItemPlaceholder: this.setupItemPlaceholder.bind(this),
|
|
134
141
|
onCheckboxChange: (checked, content) => {
|
|
135
142
|
this._data.checked = checked;
|
|
@@ -226,13 +233,18 @@ export class ListItem implements BlockTool {
|
|
|
226
233
|
return;
|
|
227
234
|
}
|
|
228
235
|
|
|
236
|
+
const blockIndex = this.blockId
|
|
237
|
+
? this.api.blocks.getBlockIndex(this.blockId) ?? this.api.blocks.getCurrentBlockIndex()
|
|
238
|
+
: this.api.blocks.getCurrentBlockIndex();
|
|
239
|
+
const visualDepth = this.markerCalculator.getVisualDepth(blockIndex, newDepth);
|
|
240
|
+
|
|
229
241
|
if (style === 'ordered') {
|
|
230
242
|
const siblingIndex = getSiblingIndex(this.blockId, newDepth, this._data.style, this.api.blocks, this.markerCalculator);
|
|
231
243
|
const markerText = getOrderedMarkerText(siblingIndex, newDepth, this._data, this.blockId, this.api.blocks, this.markerCalculator);
|
|
232
244
|
|
|
233
245
|
marker.textContent = markerText;
|
|
234
246
|
} else {
|
|
235
|
-
const bulletChar = getBulletCharacter(
|
|
247
|
+
const bulletChar = getBulletCharacter(visualDepth, this.markerCalculator);
|
|
236
248
|
|
|
237
249
|
marker.textContent = bulletChar;
|
|
238
250
|
}
|
|
@@ -295,7 +307,7 @@ export class ListItem implements BlockTool {
|
|
|
295
307
|
getDepth: this.getDepth.bind(this),
|
|
296
308
|
};
|
|
297
309
|
|
|
298
|
-
await handleEnter(context);
|
|
310
|
+
await handleEnter(context, this.depthValidator);
|
|
299
311
|
}
|
|
300
312
|
|
|
301
313
|
private async handleBackspace(event: KeyboardEvent): Promise<void> {
|
|
@@ -337,7 +349,7 @@ export class ListItem implements BlockTool {
|
|
|
337
349
|
getDepth: this.getDepth.bind(this),
|
|
338
350
|
};
|
|
339
351
|
|
|
340
|
-
await handleOutdent(context);
|
|
352
|
+
await handleOutdent(context, this.depthValidator);
|
|
341
353
|
}
|
|
342
354
|
|
|
343
355
|
private syncContentFromDOM(): void {
|
|
@@ -375,12 +387,18 @@ export class ListItem implements BlockTool {
|
|
|
375
387
|
}
|
|
376
388
|
|
|
377
389
|
private rerender(): void {
|
|
390
|
+
const blockIndex = this.blockId
|
|
391
|
+
? this.api.blocks.getBlockIndex(this.blockId) ?? this.api.blocks.getCurrentBlockIndex()
|
|
392
|
+
: this.api.blocks.getCurrentBlockIndex();
|
|
393
|
+
const depth = this._data.depth ?? 0;
|
|
394
|
+
|
|
378
395
|
const newElement = rerenderListItem({
|
|
379
396
|
data: this._data,
|
|
380
397
|
readOnly: this.readOnly,
|
|
381
398
|
placeholder: this.placeholder,
|
|
382
399
|
itemColor: this.itemColor,
|
|
383
400
|
itemSize: this.itemSize,
|
|
401
|
+
markerDepth: this.markerCalculator.getVisualDepth(blockIndex, depth),
|
|
384
402
|
element: this._element,
|
|
385
403
|
setupItemPlaceholder: this.setupItemPlaceholder.bind(this),
|
|
386
404
|
onCheckboxChange: (checked, content) => {
|
|
@@ -166,7 +166,13 @@ export const getOrderedMarkerText = (
|
|
|
166
166
|
): string => {
|
|
167
167
|
const startValue = getListStartValue(index, depth, blockId, data, blocks, markerCalculator);
|
|
168
168
|
const actualNumber = startValue + index;
|
|
169
|
-
|
|
169
|
+
|
|
170
|
+
const blockIndex = blockId
|
|
171
|
+
? blocks.getBlockIndex(blockId) ?? blocks.getCurrentBlockIndex()
|
|
172
|
+
: blocks.getCurrentBlockIndex();
|
|
173
|
+
const visualDepth = markerCalculator.getVisualDepth(blockIndex, depth);
|
|
174
|
+
|
|
175
|
+
return markerCalculator.formatNumber(actualNumber, visualDepth);
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
/**
|
|
@@ -216,7 +222,8 @@ export const updateBlockMarker = (
|
|
|
216
222
|
|
|
217
223
|
const startValue = markerCalculator.getGroupStartValue(blockIndex, blockDepth, siblingIndex, blockStyle);
|
|
218
224
|
const actualNumber = startValue + siblingIndex;
|
|
219
|
-
const
|
|
225
|
+
const visualDepth = markerCalculator.getVisualDepth(blockIndex, blockDepth);
|
|
226
|
+
const markerText = markerCalculator.formatNumber(actualNumber, visualDepth);
|
|
220
227
|
|
|
221
228
|
marker.textContent = markerText;
|
|
222
229
|
}
|
|
@@ -32,7 +32,10 @@ export interface KeyboardContext {
|
|
|
32
32
|
/**
|
|
33
33
|
* Handle Enter key - split content or exit list
|
|
34
34
|
*/
|
|
35
|
-
export const handleEnter = async (
|
|
35
|
+
export const handleEnter = async (
|
|
36
|
+
context: KeyboardContext,
|
|
37
|
+
depthValidator?: ListDepthValidator
|
|
38
|
+
): Promise<void> => {
|
|
36
39
|
const { api, blockId, data, element, getContentElement } = context;
|
|
37
40
|
|
|
38
41
|
const selection = window.getSelection();
|
|
@@ -45,7 +48,7 @@ export const handleEnter = async (context: KeyboardContext): Promise<void> => {
|
|
|
45
48
|
|
|
46
49
|
// If current item is empty, handle based on depth
|
|
47
50
|
if (currentContent === '' || currentContent === '<br>') {
|
|
48
|
-
await exitListOrOutdent(context);
|
|
51
|
+
await exitListOrOutdent(context, depthValidator);
|
|
49
52
|
return;
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -98,13 +101,16 @@ export const handleEnter = async (context: KeyboardContext): Promise<void> => {
|
|
|
98
101
|
/**
|
|
99
102
|
* Exit list or outdent when pressing Enter on empty item
|
|
100
103
|
*/
|
|
101
|
-
const exitListOrOutdent = async (
|
|
104
|
+
const exitListOrOutdent = async (
|
|
105
|
+
context: KeyboardContext,
|
|
106
|
+
depthValidator?: ListDepthValidator
|
|
107
|
+
): Promise<void> => {
|
|
102
108
|
const { api, blockId, getDepth } = context;
|
|
103
109
|
const currentDepth = getDepth();
|
|
104
110
|
|
|
105
111
|
// If nested, outdent instead of exiting
|
|
106
112
|
if (currentDepth > 0) {
|
|
107
|
-
await handleOutdent(context);
|
|
113
|
+
await handleOutdent(context, depthValidator);
|
|
108
114
|
return;
|
|
109
115
|
}
|
|
110
116
|
|
|
@@ -193,16 +199,11 @@ export const handleIndent = async(
|
|
|
193
199
|
const { api, blockId, data, syncContentFromDOM, getDepth } = context;
|
|
194
200
|
|
|
195
201
|
const currentBlockIndex = api.blocks.getCurrentBlockIndex();
|
|
196
|
-
if (currentBlockIndex === 0) return;
|
|
197
|
-
|
|
198
|
-
const previousBlock = api.blocks.getBlockByIndex(currentBlockIndex - 1);
|
|
199
|
-
if (!previousBlock || previousBlock.name !== TOOL_NAME) return;
|
|
200
|
-
|
|
201
202
|
const currentDepth = getDepth();
|
|
202
|
-
const
|
|
203
|
+
const maxAllowedDepth = depthValidator.getMaxAllowedDepth(currentBlockIndex);
|
|
203
204
|
|
|
204
|
-
// Can only indent
|
|
205
|
-
if (currentDepth
|
|
205
|
+
// Can only indent if current depth is below the maximum
|
|
206
|
+
if (currentDepth >= maxAllowedDepth) return;
|
|
206
207
|
|
|
207
208
|
// Sync current content before updating
|
|
208
209
|
syncContentFromDOM();
|
|
@@ -222,9 +223,45 @@ export const handleIndent = async(
|
|
|
222
223
|
};
|
|
223
224
|
|
|
224
225
|
/**
|
|
225
|
-
*
|
|
226
|
+
* Reduce depth by 1 for all descendant list items following the given block.
|
|
227
|
+
* Stops at non-list blocks or blocks with depth <= the parent's original depth.
|
|
226
228
|
*/
|
|
227
|
-
|
|
229
|
+
const cascadeDepthReduction = async (
|
|
230
|
+
api: API,
|
|
231
|
+
blockId: string | undefined,
|
|
232
|
+
parentOriginalDepth: number,
|
|
233
|
+
depthValidator: ListDepthValidator
|
|
234
|
+
): Promise<void> => {
|
|
235
|
+
const startIndex = blockId
|
|
236
|
+
? api.blocks.getBlockIndex(blockId) ?? api.blocks.getCurrentBlockIndex()
|
|
237
|
+
: api.blocks.getCurrentBlockIndex();
|
|
238
|
+
const blocksCount = api.blocks.getBlocksCount();
|
|
239
|
+
|
|
240
|
+
const processDescendant = async (index: number): Promise<void> => {
|
|
241
|
+
if (index >= blocksCount) return;
|
|
242
|
+
|
|
243
|
+
const block = api.blocks.getBlockByIndex(index);
|
|
244
|
+
|
|
245
|
+
if (!block || block.name !== TOOL_NAME) return;
|
|
246
|
+
|
|
247
|
+
const blockDepth = depthValidator.getBlockDepth(block);
|
|
248
|
+
|
|
249
|
+
if (blockDepth <= parentOriginalDepth) return;
|
|
250
|
+
|
|
251
|
+
await api.blocks.update(block.id, { depth: blockDepth - 1 });
|
|
252
|
+
await processDescendant(index + 1);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
await processDescendant(startIndex + 1);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Handle Shift+Tab key - outdent the list item and cascade to descendants
|
|
260
|
+
*/
|
|
261
|
+
export const handleOutdent = async(
|
|
262
|
+
context: KeyboardContext,
|
|
263
|
+
depthValidator?: ListDepthValidator
|
|
264
|
+
): Promise<void> => {
|
|
228
265
|
const { api, blockId, data, syncContentFromDOM, getDepth } = context;
|
|
229
266
|
|
|
230
267
|
const currentDepth = getDepth();
|
|
@@ -245,6 +282,11 @@ export const handleOutdent = async(context: KeyboardContext): Promise<void> => {
|
|
|
245
282
|
depth: newDepth,
|
|
246
283
|
});
|
|
247
284
|
|
|
285
|
+
// Cascade depth reduction to descendant list items
|
|
286
|
+
if (depthValidator) {
|
|
287
|
+
await cascadeDepthReduction(api, blockId, currentDepth, depthValidator);
|
|
288
|
+
}
|
|
289
|
+
|
|
248
290
|
// Restore focus to the updated block after DOM has been updated
|
|
249
291
|
setCaretToBlockContent(api, updatedBlock);
|
|
250
292
|
};
|
|
@@ -16,6 +16,7 @@ export interface RenderContext {
|
|
|
16
16
|
placeholder: string;
|
|
17
17
|
itemColor: string | undefined;
|
|
18
18
|
itemSize: string | undefined;
|
|
19
|
+
markerDepth?: number;
|
|
19
20
|
setupItemPlaceholder: (element: HTMLElement) => void;
|
|
20
21
|
onCheckboxChange: (checked: boolean, content: HTMLElement | null) => void;
|
|
21
22
|
keydownHandler: ((event: KeyboardEvent) => void) | undefined;
|
|
@@ -25,7 +26,7 @@ export interface RenderContext {
|
|
|
25
26
|
* Render the list item
|
|
26
27
|
*/
|
|
27
28
|
export const renderListItem = (context: RenderContext): HTMLElement => {
|
|
28
|
-
const { data, readOnly, placeholder, itemColor, itemSize, setupItemPlaceholder, onCheckboxChange, keydownHandler } = context;
|
|
29
|
+
const { data, readOnly, placeholder, itemColor, itemSize, markerDepth, setupItemPlaceholder, onCheckboxChange, keydownHandler } = context;
|
|
29
30
|
|
|
30
31
|
const result = buildListItem({
|
|
31
32
|
data,
|
|
@@ -33,6 +34,7 @@ export const renderListItem = (context: RenderContext): HTMLElement => {
|
|
|
33
34
|
placeholder,
|
|
34
35
|
itemColor,
|
|
35
36
|
itemSize,
|
|
37
|
+
markerDepth,
|
|
36
38
|
keydownHandler,
|
|
37
39
|
});
|
|
38
40
|
|
|
@@ -191,6 +191,43 @@ export class ListMarkerCalculator {
|
|
|
191
191
|
return this.findFirstItemIndex(index - 1, targetDepth, remainingCount - 1, targetStyle);
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Get the base depth of the contiguous list run containing the block at blockIndex.
|
|
196
|
+
* Walks backward until a non-list block or the start of the editor is reached,
|
|
197
|
+
* then returns the depth of the first list item in that run.
|
|
198
|
+
*
|
|
199
|
+
* @param blockIndex - The block index to look up
|
|
200
|
+
* @returns The depth of the first list item in the run
|
|
201
|
+
*/
|
|
202
|
+
getGroupBaseDepth(blockIndex: number): number {
|
|
203
|
+
const findFirstListIndex = (index: number): number => {
|
|
204
|
+
if (index <= 0) {
|
|
205
|
+
return 0;
|
|
206
|
+
}
|
|
207
|
+
const prevBlock = this.blocks.getBlockByIndex(index - 1);
|
|
208
|
+
if (!prevBlock || prevBlock.name !== TOOL_NAME) {
|
|
209
|
+
return index;
|
|
210
|
+
}
|
|
211
|
+
return findFirstListIndex(index - 1);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const firstListIndex = findFirstListIndex(blockIndex);
|
|
215
|
+
const firstBlock = this.blocks.getBlockByIndex(firstListIndex);
|
|
216
|
+
return this.getBlockDepth(firstBlock);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Get the visual depth for marker display.
|
|
221
|
+
* Returns the depth relative to the list group's base, clamped to >= 0.
|
|
222
|
+
*
|
|
223
|
+
* @param blockIndex - The block index
|
|
224
|
+
* @param actualDepth - The block's actual depth
|
|
225
|
+
* @returns The visual depth for marker formatting
|
|
226
|
+
*/
|
|
227
|
+
getVisualDepth(blockIndex: number, actualDepth: number): number {
|
|
228
|
+
return Math.max(0, actualDepth - this.getGroupBaseDepth(blockIndex));
|
|
229
|
+
}
|
|
230
|
+
|
|
194
231
|
/**
|
|
195
232
|
* Get the depth of a block by reading from its DOM.
|
|
196
233
|
*/
|
|
@@ -77,7 +77,8 @@ export class OrderedMarkerManager {
|
|
|
77
77
|
: startValue;
|
|
78
78
|
|
|
79
79
|
const actualNumber = actualStartValue + siblingIndex;
|
|
80
|
-
const
|
|
80
|
+
const visualDepth = this.markerCalculator.getVisualDepth(blockIndex, blockDepth);
|
|
81
|
+
const markerText = this.markerCalculator.formatNumber(actualNumber, visualDepth);
|
|
81
82
|
|
|
82
83
|
marker.textContent = markerText;
|
|
83
84
|
}
|
|
@@ -241,7 +242,8 @@ export class OrderedMarkerManager {
|
|
|
241
242
|
: startValue;
|
|
242
243
|
|
|
243
244
|
const actualNumber = actualStartValue + siblingIndex;
|
|
244
|
-
const
|
|
245
|
+
const visualDepth = this.markerCalculator.getVisualDepth(blockIndex, blockDepth);
|
|
246
|
+
const markerText = this.markerCalculator.formatNumber(actualNumber, visualDepth);
|
|
245
247
|
|
|
246
248
|
marker.textContent = markerText;
|
|
247
249
|
}
|
|
@@ -42,6 +42,7 @@ export const getToolboxConfig = (): ToolboxConfig => [
|
|
|
42
42
|
data: { style: 'unordered' },
|
|
43
43
|
name: 'bulleted-list',
|
|
44
44
|
searchTerms: ['ul', 'bullet', 'unordered', 'list'],
|
|
45
|
+
searchTermKeys: ['bullet', 'unordered', 'list'],
|
|
45
46
|
shortcut: '-',
|
|
46
47
|
},
|
|
47
48
|
{
|
|
@@ -51,6 +52,7 @@ export const getToolboxConfig = (): ToolboxConfig => [
|
|
|
51
52
|
data: { style: 'ordered' },
|
|
52
53
|
name: 'numbered-list',
|
|
53
54
|
searchTerms: ['ol', 'ordered', 'number', 'list'],
|
|
55
|
+
searchTermKeys: ['ordered', 'number', 'list'],
|
|
54
56
|
shortcut: '1.',
|
|
55
57
|
},
|
|
56
58
|
{
|
|
@@ -60,6 +62,7 @@ export const getToolboxConfig = (): ToolboxConfig => [
|
|
|
60
62
|
data: { style: 'checklist' },
|
|
61
63
|
name: 'check-list',
|
|
62
64
|
searchTerms: ['checkbox', 'task', 'todo', 'check', 'list'],
|
|
65
|
+
searchTermKeys: ['checkbox', 'task', 'todo', 'check', 'list'],
|
|
63
66
|
shortcut: '[]',
|
|
64
67
|
},
|
|
65
68
|
];
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
API,
|
|
3
|
+
BlockTool,
|
|
4
|
+
BlockToolConstructorOptions,
|
|
5
|
+
BlockToolData,
|
|
6
|
+
PasteEvent,
|
|
7
|
+
ToolboxConfig,
|
|
8
|
+
ConversionConfig,
|
|
9
|
+
ToolSanitizerConfig,
|
|
10
|
+
PasteConfig,
|
|
11
|
+
} from '../../../types';
|
|
12
|
+
import type { MenuConfig } from '../../../types/tools/menu-config';
|
|
13
|
+
import { DATA_ATTR } from '../../components/constants';
|
|
14
|
+
import { IconQuote } from '../../components/icons';
|
|
15
|
+
import { stripFakeBackgroundElements } from '../../components/utils';
|
|
16
|
+
import { PLACEHOLDER_FOCUS_ONLY_CLASSES, setupPlaceholder } from '../../components/utils/placeholder';
|
|
17
|
+
import { twMerge } from '../../components/utils/tw';
|
|
18
|
+
|
|
19
|
+
export interface QuoteData extends BlockToolData {
|
|
20
|
+
text: string;
|
|
21
|
+
size: 'default' | 'large';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const DEFAULT_PLACEHOLDER = 'tools.quote.placeholder';
|
|
25
|
+
|
|
26
|
+
const BASE_CLASSES = [
|
|
27
|
+
'border-l-[3px]',
|
|
28
|
+
'border-current',
|
|
29
|
+
'pl-[0.9em]',
|
|
30
|
+
'pr-[0.9em]',
|
|
31
|
+
'py-[0.2em]',
|
|
32
|
+
'leading-[1.5]',
|
|
33
|
+
'outline-hidden',
|
|
34
|
+
'mt-[0.3em]',
|
|
35
|
+
'mb-[0.3em]',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const LARGE_CLASS = 'text-[1.2em]';
|
|
39
|
+
|
|
40
|
+
export class Quote implements BlockTool {
|
|
41
|
+
private api: API;
|
|
42
|
+
private readOnly: boolean;
|
|
43
|
+
private _data: QuoteData;
|
|
44
|
+
private _element: HTMLQuoteElement | null = null;
|
|
45
|
+
|
|
46
|
+
constructor({ data, api, readOnly }: BlockToolConstructorOptions<QuoteData>) {
|
|
47
|
+
this.api = api;
|
|
48
|
+
this.readOnly = readOnly;
|
|
49
|
+
this._data = {
|
|
50
|
+
text: data?.text ?? '',
|
|
51
|
+
size: data?.size ?? 'default',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
if (!this.readOnly) {
|
|
55
|
+
this.onKeyUp = this.onKeyUp.bind(this);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public onKeyUp(e: KeyboardEvent): void {
|
|
60
|
+
if (e.code !== 'Backspace' && e.code !== 'Delete') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!this._element) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (this._element.textContent === '') {
|
|
69
|
+
this._element.innerHTML = '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public render(): HTMLQuoteElement {
|
|
74
|
+
const el = document.createElement('blockquote');
|
|
75
|
+
|
|
76
|
+
el.className = twMerge(
|
|
77
|
+
this.api.styles.block,
|
|
78
|
+
BASE_CLASSES,
|
|
79
|
+
PLACEHOLDER_FOCUS_ONLY_CLASSES,
|
|
80
|
+
this._data.size === 'large' ? LARGE_CLASS : ''
|
|
81
|
+
);
|
|
82
|
+
el.setAttribute(DATA_ATTR.tool, 'quote');
|
|
83
|
+
el.contentEditable = 'false';
|
|
84
|
+
|
|
85
|
+
if (this._data.text) {
|
|
86
|
+
el.innerHTML = this._data.text;
|
|
87
|
+
} else if (this.readOnly) {
|
|
88
|
+
el.innerHTML = '<br>';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!this.readOnly) {
|
|
92
|
+
el.contentEditable = 'true';
|
|
93
|
+
el.addEventListener('keyup', this.onKeyUp);
|
|
94
|
+
setupPlaceholder(el, this.api.i18n.t(DEFAULT_PLACEHOLDER), 'data-blok-placeholder-active');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this._element = el;
|
|
98
|
+
|
|
99
|
+
return el;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public save(blockContent: HTMLQuoteElement): QuoteData {
|
|
103
|
+
return {
|
|
104
|
+
text: stripFakeBackgroundElements(blockContent.innerHTML),
|
|
105
|
+
size: this._data.size,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public validate(savedData: QuoteData): boolean {
|
|
110
|
+
return savedData.text.trim() !== '';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public merge(data: QuoteData): void {
|
|
114
|
+
if (!this._element) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this._data.text += data.text;
|
|
119
|
+
|
|
120
|
+
const wrapper = document.createElement('div');
|
|
121
|
+
wrapper.innerHTML = data.text.trim();
|
|
122
|
+
const fragment = document.createDocumentFragment();
|
|
123
|
+
fragment.append(...Array.from(wrapper.childNodes));
|
|
124
|
+
|
|
125
|
+
this._element.appendChild(fragment);
|
|
126
|
+
this._element.normalize();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public renderSettings(): MenuConfig {
|
|
130
|
+
return [
|
|
131
|
+
{
|
|
132
|
+
icon: IconQuote,
|
|
133
|
+
title: this.api.i18n.t('tools.quote.size'),
|
|
134
|
+
name: 'quote-size',
|
|
135
|
+
children: {
|
|
136
|
+
items: [
|
|
137
|
+
{
|
|
138
|
+
icon: IconQuote,
|
|
139
|
+
title: this.api.i18n.t('tools.quote.defaultSize'),
|
|
140
|
+
onActivate: (): void => this.setSize('default'),
|
|
141
|
+
closeOnActivate: true,
|
|
142
|
+
isActive: this._data.size === 'default',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
icon: IconQuote,
|
|
146
|
+
title: this.api.i18n.t('tools.quote.largeSize'),
|
|
147
|
+
onActivate: (): void => this.setSize('large'),
|
|
148
|
+
closeOnActivate: true,
|
|
149
|
+
isActive: this._data.size === 'large',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private setSize(size: 'default' | 'large'): void {
|
|
158
|
+
this._data.size = size;
|
|
159
|
+
|
|
160
|
+
if (this._element) {
|
|
161
|
+
this._element.className = twMerge(
|
|
162
|
+
this.api.styles.block,
|
|
163
|
+
BASE_CLASSES,
|
|
164
|
+
PLACEHOLDER_FOCUS_ONLY_CLASSES,
|
|
165
|
+
size === 'large' ? LARGE_CLASS : ''
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public onPaste(event: PasteEvent): void {
|
|
171
|
+
const detail = event.detail;
|
|
172
|
+
|
|
173
|
+
if (!('data' in detail)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const content = detail.data as HTMLElement;
|
|
178
|
+
|
|
179
|
+
this._data = {
|
|
180
|
+
text: content.innerHTML,
|
|
181
|
+
size: this._data.size,
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
if (this._element) {
|
|
185
|
+
this._element.innerHTML = this._data.text || '';
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
public static get toolbox(): ToolboxConfig {
|
|
190
|
+
return {
|
|
191
|
+
icon: IconQuote,
|
|
192
|
+
title: 'Quote',
|
|
193
|
+
titleKey: 'quote',
|
|
194
|
+
searchTerms: ['quote', 'blockquote', 'citation'],
|
|
195
|
+
searchTermKeys: ['quote', 'blockquote', 'citation'],
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
public static get conversionConfig(): ConversionConfig {
|
|
200
|
+
return {
|
|
201
|
+
export: 'text',
|
|
202
|
+
import: 'text',
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public static get sanitize(): ToolSanitizerConfig {
|
|
207
|
+
return {
|
|
208
|
+
text: {
|
|
209
|
+
br: true,
|
|
210
|
+
b: true,
|
|
211
|
+
i: true,
|
|
212
|
+
a: true,
|
|
213
|
+
mark: {
|
|
214
|
+
style: true,
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
public static get isReadOnlySupported(): boolean {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
public static get pasteConfig(): PasteConfig {
|
|
225
|
+
return {
|
|
226
|
+
tags: ['BLOCKQUOTE'],
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -77,6 +77,20 @@ export interface SetColWidthsCommand {
|
|
|
77
77
|
readonly widths: readonly number[] | undefined;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
export interface MergeCellsCommand {
|
|
81
|
+
readonly type: 'merge-cells';
|
|
82
|
+
readonly minRow: number;
|
|
83
|
+
readonly maxRow: number;
|
|
84
|
+
readonly minCol: number;
|
|
85
|
+
readonly maxCol: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface SplitCellCommand {
|
|
89
|
+
readonly type: 'split-cell';
|
|
90
|
+
readonly row: number;
|
|
91
|
+
readonly col: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
80
94
|
export interface ReplaceAllCommand {
|
|
81
95
|
readonly type: 'replace-all';
|
|
82
96
|
readonly data: TableData;
|
|
@@ -96,4 +110,6 @@ export type TableCommand =
|
|
|
96
110
|
| RemoveBlockFromCellCommand
|
|
97
111
|
| SetCellBlocksCommand
|
|
98
112
|
| SetColWidthsCommand
|
|
113
|
+
| MergeCellsCommand
|
|
114
|
+
| SplitCellCommand
|
|
99
115
|
| ReplaceAllCommand;
|
|
@@ -83,6 +83,12 @@ export class TableController {
|
|
|
83
83
|
case 'set-col-widths':
|
|
84
84
|
return this.handleSetColWidths(command.widths ? [...command.widths] : undefined);
|
|
85
85
|
|
|
86
|
+
case 'merge-cells':
|
|
87
|
+
return this.handleMergeCells(command.minRow, command.maxRow, command.minCol, command.maxCol);
|
|
88
|
+
|
|
89
|
+
case 'split-cell':
|
|
90
|
+
return this.handleSplitCell(command.row, command.col);
|
|
91
|
+
|
|
86
92
|
case 'replace-all':
|
|
87
93
|
return this.handleReplaceAll(command.data);
|
|
88
94
|
}
|
|
@@ -223,6 +229,29 @@ export class TableController {
|
|
|
223
229
|
};
|
|
224
230
|
}
|
|
225
231
|
|
|
232
|
+
private handleMergeCells(minRow: number, maxRow: number, minCol: number, maxCol: number): TableDomainEvent {
|
|
233
|
+
const result = this.model.mergeCells({ minRow, maxRow, minCol, maxCol });
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
type: 'cells-merged',
|
|
237
|
+
minRow,
|
|
238
|
+
maxRow,
|
|
239
|
+
minCol,
|
|
240
|
+
maxCol,
|
|
241
|
+
blocksToRelocate: result.blocksToRelocate,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
private handleSplitCell(row: number, col: number): TableDomainEvent {
|
|
246
|
+
this.model.splitCell(row, col);
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
type: 'cell-split',
|
|
250
|
+
row,
|
|
251
|
+
col,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
226
255
|
private handleReplaceAll(data: TableData): TableDomainEvent {
|
|
227
256
|
this.model.replaceAll(data);
|
|
228
257
|
|
|
@@ -81,6 +81,21 @@ export interface ColWidthsChangedEvent {
|
|
|
81
81
|
readonly widths: readonly number[] | undefined;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
export interface CellsMergedEvent {
|
|
85
|
+
readonly type: 'cells-merged';
|
|
86
|
+
readonly minRow: number;
|
|
87
|
+
readonly maxRow: number;
|
|
88
|
+
readonly minCol: number;
|
|
89
|
+
readonly maxCol: number;
|
|
90
|
+
readonly blocksToRelocate: readonly string[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface CellSplitEvent {
|
|
94
|
+
readonly type: 'cell-split';
|
|
95
|
+
readonly row: number;
|
|
96
|
+
readonly col: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
84
99
|
export interface ModelReplacedEvent {
|
|
85
100
|
readonly type: 'model-replaced';
|
|
86
101
|
}
|
|
@@ -99,4 +114,6 @@ export type TableDomainEvent =
|
|
|
99
114
|
| BlockRemovedFromCellEvent
|
|
100
115
|
| CellBlocksSetEvent
|
|
101
116
|
| ColWidthsChangedEvent
|
|
117
|
+
| CellsMergedEvent
|
|
118
|
+
| CellSplitEvent
|
|
102
119
|
| ModelReplacedEvent;
|