@jackuait/blok 0.10.0-beta.5 → 0.10.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codemod/migrate-editorjs-to-blok.js +0 -2
- package/codemod/test.js +0 -6
- package/dist/blok.mjs +3 -3
- package/dist/chunks/_basePickBy-BHRNO12X.mjs +410 -0
- package/dist/chunks/_baseUniq-DtFPDBML.mjs +1045 -0
- package/dist/chunks/_getTag-ozrhqxk_.mjs +26 -0
- package/dist/chunks/arc-BEqJP9HX.mjs +80 -0
- package/dist/chunks/architecture-YZFGNWBL-Bcu-90pi.mjs +3 -0
- package/dist/chunks/architectureDiagram-Q4EWVU46-BMno5LCn.mjs +4066 -0
- package/dist/chunks/array-Cyf-61SV.mjs +6 -0
- package/dist/chunks/blockDiagram-DXYQGD6D-DlP_cPth.mjs +3259 -0
- package/dist/chunks/{blok-DH-WEcA8.mjs → blok-CiLRmoHI.mjs} +2030 -1996
- package/dist/chunks/c4Diagram-AHTNJAMY-BbVV8EXj.mjs +2956 -0
- package/dist/chunks/channel-DPcniO2B.mjs +5 -0
- package/dist/chunks/chunk-2KRD3SAO-CazES4VS.mjs +20 -0
- package/dist/chunks/chunk-336JU56O-heO72r_k.mjs +49 -0
- package/dist/chunks/chunk-426QAEUC-CmCcml1z.mjs +13 -0
- package/dist/chunks/chunk-4BX2VUAB-B10DxOza.mjs +19 -0
- package/dist/chunks/chunk-4TB4RGXK-B0snhZOU.mjs +3250 -0
- package/dist/chunks/chunk-55IACEB6-CGkn5ABd.mjs +8 -0
- package/dist/chunks/chunk-5FUZZQ4R-USdumo_u.mjs +3786 -0
- package/dist/chunks/chunk-5PVQY5BW-CxUGVzQL.mjs +1692 -0
- package/dist/chunks/chunk-67CJDMHE-Bvw55oRa.mjs +20 -0
- package/dist/chunks/chunk-7N4EOEYR-Bs2qDy88.mjs +29 -0
- package/dist/chunks/chunk-AA7GKIK3-Bss0LgrN.mjs +24 -0
- package/dist/chunks/chunk-BSJP7CBP-CpUW7gi5.mjs +83 -0
- package/dist/chunks/chunk-CIAEETIT-DlRbLLf3.mjs +20 -0
- package/dist/chunks/chunk-D6kmoKXy.mjs +20 -0
- package/dist/chunks/chunk-EDXVE4YY-DEcX4XWm.mjs +26 -0
- package/dist/chunks/chunk-ENJZ2VHE-B4THRZkR.mjs +566 -0
- package/dist/chunks/chunk-FMBD7UC4-CF6BKEiV.mjs +5 -0
- package/dist/chunks/chunk-FOC6F5B3--xuza7Yn.mjs +20 -0
- package/dist/chunks/chunk-ICPOFSXX-BMja8cuy.mjs +3290 -0
- package/dist/chunks/chunk-K5T4RW27-CHEqGHFS.mjs +16370 -0
- package/dist/chunks/chunk-KGLVRYIC-DHYYpR8v.mjs +20 -0
- package/dist/chunks/chunk-LIHQZDEY-AvbOvyLE.mjs +55 -0
- package/dist/chunks/chunk-ORNJ4GCN-38fbR5OS.mjs +25 -0
- package/dist/chunks/chunk-OYMX7WX6-BiqlATPA.mjs +2038 -0
- package/dist/chunks/chunk-QZHKN3VN-DitZIvj8.mjs +12 -0
- package/dist/chunks/chunk-U2HBQHQK-DJytnHmZ.mjs +1875 -0
- package/dist/chunks/chunk-X2U36JSP-DlOifw1K.mjs +68 -0
- package/dist/chunks/chunk-XPW4576I-s4fsi4XO.mjs +1146 -0
- package/dist/chunks/chunk-YZCP3GAM-Ch258bXC.mjs +60 -0
- package/dist/chunks/chunk-ZZ45TVLE-DWziaKxP.mjs +33 -0
- package/dist/chunks/classDiagram-6PBFFD2Q-BOkAe08u.mjs +30 -0
- package/dist/chunks/classDiagram-v2-HSJHXN6E-DeKatSvh.mjs +30 -0
- package/dist/chunks/clone-CJCz7VRp.mjs +8 -0
- package/dist/chunks/{constants-Ccno9NZS.mjs → constants-DFS8l39Y.mjs} +525 -552
- package/dist/chunks/cose-bilkent-S5V4N54A-CzLGVqvr.mjs +2246 -0
- package/dist/chunks/cytoscape.esm-D0iglm-M.mjs +18108 -0
- package/dist/chunks/dagre-KV5264BT-XbHSjleO.mjs +298 -0
- package/dist/chunks/dagre-XY8CZ1sg.mjs +1536 -0
- package/dist/chunks/default-DIfXCS2E.mjs +4 -0
- package/dist/chunks/defaultLocale-DFhS1600.mjs +201 -0
- package/dist/chunks/diagram-5BDNPKRD-CM7c3UTI.mjs +112 -0
- package/dist/chunks/diagram-G4DWMVQ6-Bhg4ps6b.mjs +546 -0
- package/dist/chunks/diagram-MMDJMWI5-C-UCVaxB.mjs +234 -0
- package/dist/chunks/diagram-TYMM5635-BOHSujSD.mjs +144 -0
- package/dist/chunks/dist-DHsXIYdd.mjs +59 -0
- package/dist/chunks/erDiagram-SMLLAGMA-CwKxXFMB.mjs +1712 -0
- package/dist/chunks/flowDiagram-DWJPFMVM-rQJKfyuO.mjs +4175 -0
- package/dist/chunks/ganttDiagram-T4ZO3ILL-DfaZirLX.mjs +3083 -0
- package/dist/chunks/gitGraph-7Q5UKJZL-BKG8cHGz.mjs +3 -0
- package/dist/chunks/gitGraphDiagram-UUTBAWPF-CRa-ymsI.mjs +792 -0
- package/dist/chunks/graphlib-CuDElSdG.mjs +223 -0
- package/dist/chunks/{i18next-G6FKbZqA.mjs → i18next-BBGW2sDE.mjs} +1 -1
- package/dist/chunks/{i18next-loader-CwNimni3.mjs → i18next-loader-CasQQb5s.mjs} +2 -2
- package/dist/chunks/info-OMHHGYJF-FKqYyUn9.mjs +3 -0
- package/dist/chunks/infoDiagram-42DDH7IO-CvyJU2nE.mjs +29 -0
- package/dist/chunks/init-JlKGZtuT.mjs +15 -0
- package/dist/chunks/ishikawaDiagram-UXIWVN3A-CIpbw1BK.mjs +719 -0
- package/dist/chunks/journeyDiagram-VCZTEJTY-H96UcUK9.mjs +885 -0
- package/dist/chunks/kanban-definition-6JOO6SKY-BYZT3srA.mjs +980 -0
- package/dist/chunks/katex-JyOgX6MW.mjs +22026 -0
- package/dist/chunks/{lightweight-i18n-DWCdzAw0.mjs → lightweight-i18n-Cvv8CWh4.mjs} +29 -18
- package/dist/chunks/line-B9xUUA7k.mjs +34 -0
- package/dist/chunks/linear-Dj-1yA_B.mjs +289 -0
- package/dist/chunks/mdast-util-math-CHYUxOHk.mjs +151 -0
- package/dist/chunks/mermaid-parser.core-D6OPAUtM.mjs +57 -0
- package/dist/chunks/mermaid.core-BPN9ZHKQ.mjs +989 -0
- package/dist/{messages-B-4fku2H2.mjs → chunks/messages--YKhFEDE.mjs} +30 -19
- package/dist/{messages-BCG_evLg.mjs → chunks/messages-0Uwu1AMJ2.mjs} +28 -17
- package/dist/{messages-CdlsTFB1.mjs → chunks/messages-1__0Ph4Q.mjs} +28 -17
- package/dist/chunks/{messages-wLSVQbsA2.mjs → messages-4sm9Pb0C.mjs} +28 -17
- package/dist/chunks/{messages-R2W_rGOo2.mjs → messages-4uxjtzKW.mjs} +28 -17
- package/dist/chunks/{messages-Dm4YVlrm.mjs → messages-B-SwLgkQ.mjs} +30 -19
- package/dist/{messages--S8_taOd2.mjs → chunks/messages-B1ylBxXQ.mjs} +28 -17
- package/dist/chunks/{messages-B7MIRzCa2.mjs → messages-B5m3dhKc.mjs} +28 -17
- package/dist/chunks/{messages-Dplnp19q.mjs → messages-B6n2zDtv.mjs} +29 -18
- package/dist/chunks/{messages-DD7BI6BK.mjs → messages-BC9w4zAT.mjs} +28 -17
- package/dist/chunks/{messages-BrFl5773.mjs → messages-BOj-7N3p.mjs} +28 -17
- package/dist/chunks/{messages-BbdNugdi.mjs → messages-BRYHTS18.mjs} +28 -17
- package/dist/chunks/{messages-JQKFJo7C.mjs → messages-BSBbVjor.mjs} +35 -24
- package/dist/{messages-CBzd_x7H.mjs → chunks/messages-BUUkmUGc.mjs} +28 -17
- package/dist/{messages-CjmSrt1D.mjs → chunks/messages-Bb3YEV2P.mjs} +33 -22
- package/dist/{messages-BvgXeMSL2.mjs → chunks/messages-Be_6YLzJ.mjs} +29 -18
- package/dist/{messages-pgPcitDH.mjs → chunks/messages-BevRhv5d.mjs} +28 -17
- package/dist/chunks/{messages-BW_7lfqG2.mjs → messages-Bhqr7Im2.mjs} +28 -17
- package/dist/chunks/{messages-LxumrNue2.mjs → messages-BpJFjSKa.mjs} +29 -18
- package/dist/{messages-xEI8gEDK.mjs → chunks/messages-BqYlq_Bn.mjs} +28 -17
- package/dist/{messages-CBdQ3XP9.mjs → chunks/messages-BtAwCUfD.mjs} +28 -17
- package/dist/{messages-D3cAcyzj.mjs → chunks/messages-Bthbp65G.mjs} +29 -18
- package/dist/{messages-CYX48nfg.mjs → chunks/messages-BvHMZ8Pi2.mjs} +28 -17
- package/dist/{messages-Dddxv8-f2.mjs → chunks/messages-Bw1BE9jW.mjs} +28 -17
- package/dist/chunks/{messages-d0Ky6QjR.mjs → messages-Bx6Wt285.mjs} +28 -17
- package/dist/chunks/{messages-BPog17132.mjs → messages-BzslJRYv.mjs} +29 -18
- package/dist/{messages-hTpeKUaW.mjs → chunks/messages-C02M0Tpw.mjs} +28 -17
- package/dist/chunks/{messages-C-b6tPad2.mjs → messages-C1u3E9qg.mjs} +28 -17
- package/dist/{messages-BJ7BuFZi.mjs → chunks/messages-C68WgSKk.mjs} +29 -18
- package/dist/chunks/{messages-Bpda_3PM2.mjs → messages-C8w8JCP0.mjs} +30 -19
- package/dist/chunks/{messages-CmrMwBv3.mjs → messages-CFOZdSk4.mjs} +28 -17
- package/dist/{messages-DVQNjdPk.mjs → chunks/messages-CGOY79lr.mjs} +28 -17
- package/dist/chunks/{messages-DAVsuDWh2.mjs → messages-CGaSMZPu.mjs} +28 -17
- package/dist/{messages-DtrSrdfE2.mjs → chunks/messages-CJJgQ0BH.mjs} +28 -17
- package/dist/{messages-CgzbJ8_l2.mjs → chunks/messages-CTD6rtQj2.mjs} +28 -17
- package/dist/chunks/{messages-p4byLfvR.mjs → messages-CZymJML9.mjs} +32 -21
- package/dist/{messages-CqkRG9mH.mjs → chunks/messages-CfeFJbiv.mjs} +32 -21
- package/dist/{messages-DjJQoYvP2.mjs → chunks/messages-Cgatzu_z.mjs} +30 -19
- package/dist/{messages-CM5fsPo02.mjs → chunks/messages-Ch2zBI602.mjs} +28 -17
- package/dist/chunks/{messages-CyNsByCY.mjs → messages-CiAHsUfO.mjs} +28 -17
- package/dist/{messages-BXI3qIos.mjs → chunks/messages-Cuzq-tNW.mjs} +28 -17
- package/dist/chunks/{messages-FHrCEJmY2.mjs → messages-Cw4qiMwb.mjs} +28 -17
- package/dist/chunks/{messages-xfjdrZmx.mjs → messages-Cyh-mz40.mjs} +28 -17
- package/dist/{messages-Bo_FUvVH.mjs → chunks/messages-D-I2QO8H.mjs} +28 -17
- package/dist/chunks/{messages-Ct7AMBS82.mjs → messages-D0D2gruy.mjs} +28 -17
- package/dist/chunks/{messages-CrMfiGu5.mjs → messages-D1BKxfLD.mjs} +29 -18
- package/dist/chunks/{messages-CmXADeab2.mjs → messages-D4eDs6R_.mjs} +28 -17
- package/dist/chunks/{messages-ClRHDxzh.mjs → messages-D9Xr-hES.mjs} +28 -17
- package/dist/{messages-tsHpMdDT2.mjs → chunks/messages-D9eJPHia.mjs} +30 -19
- package/dist/{messages-DUBHHfEt.mjs → chunks/messages-DBFWSzKY2.mjs} +28 -17
- package/dist/{messages-i4S6q64n2.mjs → chunks/messages-DC0wu2S7.mjs} +28 -17
- package/dist/chunks/{messages-BnznaKEP2.mjs → messages-DF9o19rG.mjs} +28 -17
- package/dist/{messages-DA-o8X3A.mjs → chunks/messages-DFS_n986.mjs} +51 -40
- package/dist/{messages-BGsDZTQp2.mjs → chunks/messages-DGS4H30T.mjs} +28 -17
- package/dist/chunks/{messages-Cdx4QMR1.mjs → messages-DKjddpzJ.mjs} +30 -19
- package/dist/chunks/{messages-B3s2vra72.mjs → messages-DMvTdUXC.mjs} +30 -19
- package/dist/{messages-Dcyrzdxa2.mjs → chunks/messages-DQUX-QYI2.mjs} +28 -17
- package/dist/chunks/{messages-BS1nOvZ-.mjs → messages-DUigq8FO2.mjs} +28 -17
- package/dist/{messages-BKjqW08U.mjs → chunks/messages-DY0FJdpH.mjs} +28 -17
- package/dist/{messages-BBvDbp62.mjs → chunks/messages-DfVXiqt-2.mjs} +28 -17
- package/dist/chunks/{messages-DHCVA7XQ.mjs → messages-DgZc9TJw.mjs} +28 -17
- package/dist/chunks/{messages-1Raf1IK82.mjs → messages-QD4BCUDP.mjs} +28 -17
- package/dist/{messages-JhoVMjfX2.mjs → chunks/messages-USmweex9.mjs} +28 -17
- package/dist/chunks/{messages-DBpXyvRe2.mjs → messages-a1JTi0Qm.mjs} +31 -20
- package/dist/chunks/{messages-D5IgUbBD2.mjs → messages-jcgCHPRn.mjs} +28 -17
- package/dist/chunks/{messages-Dfpi8pDY.mjs → messages-tnnqHpbd.mjs} +29 -18
- package/dist/{messages-DZEcrbmH.mjs → chunks/messages-vzWKPLJO.mjs} +28 -17
- package/dist/chunks/micromark-extension-math-Cz_ZZ_0Y.mjs +169 -0
- package/dist/chunks/micromark-factory-space-WwmyBO_J.mjs +36 -0
- package/dist/chunks/mindmap-definition-QFDTVHPH-BswFuNN6.mjs +1013 -0
- package/dist/chunks/{notifier-Butv4Dvo.mjs → notifier-B1zCi9G1.mjs} +1 -1
- package/dist/chunks/{objectSpread2-BY4mgzrQ.mjs → objectSpread2-CWwMYL_U.mjs} +1 -1
- package/dist/chunks/ordinal-D1_lEgAO.mjs +65 -0
- package/dist/chunks/packet-4T2RLAQJ-DTUW2U0C.mjs +3 -0
- package/dist/chunks/path-6nYPAvNb.mjs +85 -0
- package/dist/chunks/pie-ZZUOXDRM-D-umqvEM.mjs +3 -0
- package/dist/chunks/pieDiagram-DEJITSTG-1WJgvK1w.mjs +179 -0
- package/dist/chunks/quadrantDiagram-34T5L4WZ-B_YH8QGl.mjs +1960 -0
- package/dist/chunks/radar-PYXPWWZC-DkQelf08.mjs +3 -0
- package/dist/chunks/requirementDiagram-MS252O5E-DRl0YJRI.mjs +2224 -0
- package/dist/chunks/rough.esm-CSWJruu5.mjs +1353 -0
- package/dist/chunks/sankeyDiagram-XADWPNL6-B-8IrknH.mjs +909 -0
- package/dist/chunks/sequenceDiagram-FGHM5R23-DTLb8qmO.mjs +4181 -0
- package/dist/chunks/src-CRgEHLPW.mjs +2149 -0
- package/dist/chunks/stateDiagram-FHFEXIEX-B0JFjLFy.mjs +218 -0
- package/dist/chunks/stateDiagram-v2-QKLJ7IA2-Co9CUU_z.mjs +28 -0
- package/dist/chunks/timeline-definition-GMOUNBTQ-CS9KTh-Q.mjs +1084 -0
- package/dist/chunks/{tools-C2_IVsQY.mjs → tools-CSYsrnud.mjs} +2846 -3098
- package/dist/chunks/treeView-SZITEDCU-DOOoyNP9.mjs +3 -0
- package/dist/chunks/treemap-W4RFUUIX-CsOoUA-u.mjs +3 -0
- package/dist/chunks/vennDiagram-DHZGUBPP-0BNu5Wna.mjs +1876 -0
- package/dist/chunks/wardley-RL74JXVD-CCzZcmEk.mjs +3 -0
- package/dist/chunks/wardleyDiagram-NUSXRM2D-Ca9XByNH.mjs +594 -0
- package/dist/chunks/xychartDiagram-5P7HB3ND-C8AyKUAE.mjs +2017 -0
- package/dist/cli.mjs +1 -1
- package/dist/full.mjs +14 -14
- package/dist/locales.mjs +95 -84
- package/dist/markdown.mjs +3962 -0
- package/dist/{chunks/messages-6mikOS4D2.mjs → messages-5jvKxQNu2.mjs} +28 -17
- package/dist/{messages-BAcH6PtT2.mjs → messages-7QD-X6XT2.mjs} +28 -17
- package/dist/{messages-DbxbxUiK2.mjs → messages-96iaAUds2.mjs} +29 -18
- package/dist/{messages-CVcQD-9u.mjs → messages-B19o-Teb.mjs} +30 -19
- package/dist/{messages-Ccd587Yn.mjs → messages-B1ZUQagA.mjs} +28 -17
- package/dist/{messages-upqrRZQH2.mjs → messages-B7ieAJBd2.mjs} +28 -17
- package/dist/{chunks/messages-Csvm4mtA.mjs → messages-BECMxmfX.mjs} +28 -17
- package/dist/{chunks/messages-DA7Zk-Cy.mjs → messages-BIHc0KHY.mjs} +29 -18
- package/dist/{chunks/messages-BdnSVKOw.mjs → messages-BIoeoik5.mjs} +28 -17
- package/dist/{chunks/messages-DQ5AyNCU.mjs → messages-BJeGJksD.mjs} +28 -17
- package/dist/{messages-C5XPUD9T2.mjs → messages-BRZX964b2.mjs} +29 -18
- package/dist/{messages-Dkg99bfr2.mjs → messages-BTQPpoM42.mjs} +31 -20
- package/dist/{messages-fLi0P2dP.mjs → messages-BYNcD6uR.mjs} +28 -17
- package/dist/{messages-BvgTQLf72.mjs → messages-BYmmMDrN2.mjs} +28 -17
- package/dist/{chunks/messages-CgRvtOEY.mjs → messages-BbYq1pk-.mjs} +28 -17
- package/dist/{chunks/messages-DUDgFEEe2.mjs → messages-BiUGXvYr2.mjs} +28 -17
- package/dist/{chunks/messages-DJkIeapn.mjs → messages-BiiongNz2.mjs} +28 -17
- package/dist/{messages-BBq0M604.mjs → messages-Bm0Feca1.mjs} +32 -21
- package/dist/{messages-eTourT12.mjs → messages-BmAn22OX.mjs} +28 -17
- package/dist/{messages-C6Y4Jv2N.mjs → messages-Bq3F2Tp_.mjs} +28 -17
- package/dist/{messages-DIRha_gg2.mjs → messages-BsycN_JI2.mjs} +28 -17
- package/dist/{chunks/messages-CljStrYi.mjs → messages-BwHs4cm1.mjs} +32 -21
- package/dist/{chunks/messages-Cs9XBt4T.mjs → messages-CJTy6JZt.mjs} +28 -17
- package/dist/{messages-BokEflKa.mjs → messages-CR_L_UtK.mjs} +28 -17
- package/dist/{chunks/messages-ZJ0b1C3a.mjs → messages-CSUHBs4c2.mjs} +28 -17
- package/dist/{messages-BcFQFcJ92.mjs → messages-CWIXvnDf2.mjs} +28 -17
- package/dist/{messages-DnatBKPm.mjs → messages-CcF4y-E4.mjs} +28 -17
- package/dist/{messages-BywbKcPC.mjs → messages-Ce6KVEbT.mjs} +29 -18
- package/dist/{messages-DOTJ2NvJ.mjs → messages-Ci0KqX-J.mjs} +35 -24
- package/dist/{messages-BtxaN-xx.mjs → messages-CjbnogEC.mjs} +28 -17
- package/dist/{messages-BSe3QDnQ.mjs → messages-CmB406HW.mjs} +30 -19
- package/dist/{messages-BVKZK-3t.mjs → messages-CqXtJTpU.mjs} +28 -17
- package/dist/{chunks/messages-DJA6fb_P2.mjs → messages-D0aw5_0k2.mjs} +30 -19
- package/dist/{chunks/messages-DPykxECP2.mjs → messages-D8FQWulF2.mjs} +28 -17
- package/dist/{chunks/messages-CpzO7KRA.mjs → messages-DBiVgUs2.mjs} +29 -18
- package/dist/{chunks/messages-B0ffBqzr.mjs → messages-DIJlIqlQ2.mjs} +28 -17
- package/dist/{chunks/messages-BaPZuLjN.mjs → messages-DLX_iBDJ.mjs} +28 -17
- package/dist/{chunks/messages-CvfKofOP.mjs → messages-DLlc9QPw.mjs} +28 -17
- package/dist/{chunks/messages-Czny5pPT2.mjs → messages-DMr62KiO2.mjs} +28 -17
- package/dist/{chunks/messages-IDEUsFhQ2.mjs → messages-DPA-mMWC2.mjs} +29 -18
- package/dist/{messages-BCuTVHBV.mjs → messages-DTh9a8mR.mjs} +28 -17
- package/dist/{chunks/messages-DT7fRpCy.mjs → messages-DY4IqlhY.mjs} +28 -17
- package/dist/{chunks/messages-BgVEGd4c.mjs → messages-DYTTu0O12.mjs} +28 -17
- package/dist/{messages-Bk984gRE2.mjs → messages-DbySKTKt2.mjs} +30 -19
- package/dist/{chunks/messages-ID1PHnMv.mjs → messages-Ddnj2iTG2.mjs} +28 -17
- package/dist/{messages-BmNaAyKS.mjs → messages-DkLU_rWm.mjs} +28 -17
- package/dist/{messages-C6OJvnJg2.mjs → messages-Dl3Sv6Rq2.mjs} +29 -18
- package/dist/{chunks/messages-C1OqT_nL.mjs → messages-Dl5Y2-Ia.mjs} +51 -40
- package/dist/{chunks/messages-Cqc-6rfh2.mjs → messages-DnG0ef8t2.mjs} +30 -19
- package/dist/{chunks/messages-BkCjgGxc.mjs → messages-DnGJD4TL.mjs} +28 -17
- package/dist/{messages-Bio7KYsr2.mjs → messages-Dnp9N6RU2.mjs} +28 -17
- package/dist/{chunks/messages-Df87zXXG.mjs → messages-Dvn35ksS.mjs} +28 -17
- package/dist/{messages-CHJ5SOZI.mjs → messages-Dw__BcTj.mjs} +28 -17
- package/dist/{chunks/messages-DC7TX-YT.mjs → messages-Dy-Y_nEI.mjs} +28 -17
- package/dist/{messages-DV9e1DW7.mjs → messages-E_ZuzGDt.mjs} +28 -17
- package/dist/{messages-DD5pW0zJ.mjs → messages-F2xRoY1w.mjs} +28 -17
- package/dist/{chunks/messages-BgsPQXfP.mjs → messages-Smt4GBbj.mjs} +33 -22
- package/dist/{messages-DJT4Bt_02.mjs → messages-aMXpHt5X2.mjs} +28 -17
- package/dist/{chunks/messages-B2pW6jO_.mjs → messages-aWZH50vu2.mjs} +30 -19
- package/dist/{chunks/messages-u2yxkNTE2.mjs → messages-dv19AkyJ.mjs} +28 -17
- package/dist/{messages-DJKLtW7u.mjs → messages-hWwSRF-2.mjs} +28 -17
- package/dist/{messages-tK67CBqn.mjs → messages-j7o5rT9s.mjs} +28 -17
- package/dist/{messages-DqyqEw1_.mjs → messages-nUVjeh7K.mjs} +29 -18
- package/dist/{chunks/messages-DSjXen8E.mjs → messages-nlhESX9t.mjs} +28 -17
- package/dist/{messages-C30Vz-UZ2.mjs → messages-rk-A1Wa42.mjs} +30 -19
- package/dist/{chunks/messages-DR09nkcZ.mjs → messages-xh2eOLvs.mjs} +28 -17
- package/dist/{chunks/messages-C11byid72.mjs → messages-ynAe7ewZ.mjs} +28 -17
- package/dist/react.mjs +3 -3
- package/dist/tools.mjs +3 -3
- package/dist/vendor.LICENSE.txt +4609 -212
- package/package.json +21 -3
- package/src/components/blocks.ts +26 -1
- package/src/components/constants/data-attributes.ts +0 -2
- package/src/components/i18n/locales/am/messages.json +28 -17
- package/src/components/i18n/locales/ar/messages.json +28 -17
- package/src/components/i18n/locales/az/messages.json +28 -17
- package/src/components/i18n/locales/bg/messages.json +28 -17
- package/src/components/i18n/locales/bn/messages.json +28 -17
- package/src/components/i18n/locales/bs/messages.json +30 -19
- package/src/components/i18n/locales/cs/messages.json +32 -21
- package/src/components/i18n/locales/da/messages.json +35 -24
- package/src/components/i18n/locales/de/messages.json +33 -22
- package/src/components/i18n/locales/dv/messages.json +28 -17
- package/src/components/i18n/locales/el/messages.json +28 -17
- package/src/components/i18n/locales/en/messages.json +28 -17
- package/src/components/i18n/locales/es/messages.json +29 -18
- package/src/components/i18n/locales/et/messages.json +32 -21
- package/src/components/i18n/locales/fa/messages.json +28 -17
- package/src/components/i18n/locales/fi/messages.json +28 -17
- package/src/components/i18n/locales/fil/messages.json +51 -40
- package/src/components/i18n/locales/fr/messages.json +29 -18
- package/src/components/i18n/locales/gu/messages.json +28 -17
- package/src/components/i18n/locales/he/messages.json +28 -17
- package/src/components/i18n/locales/hi/messages.json +28 -17
- package/src/components/i18n/locales/hr/messages.json +30 -19
- package/src/components/i18n/locales/hu/messages.json +29 -18
- package/src/components/i18n/locales/hy/messages.json +28 -17
- package/src/components/i18n/locales/id/messages.json +28 -17
- package/src/components/i18n/locales/it/messages.json +29 -18
- package/src/components/i18n/locales/ja/messages.json +28 -17
- package/src/components/i18n/locales/ka/messages.json +28 -17
- package/src/components/i18n/locales/km/messages.json +28 -17
- package/src/components/i18n/locales/kn/messages.json +28 -17
- package/src/components/i18n/locales/ko/messages.json +28 -17
- package/src/components/i18n/locales/ku/messages.json +28 -17
- package/src/components/i18n/locales/lo/messages.json +28 -17
- package/src/components/i18n/locales/lt/messages.json +28 -17
- package/src/components/i18n/locales/lv/messages.json +28 -17
- package/src/components/i18n/locales/mk/messages.json +28 -17
- package/src/components/i18n/locales/ml/messages.json +28 -17
- package/src/components/i18n/locales/mn/messages.json +28 -17
- package/src/components/i18n/locales/mr/messages.json +28 -17
- package/src/components/i18n/locales/ms/messages.json +30 -19
- package/src/components/i18n/locales/my/messages.json +28 -17
- package/src/components/i18n/locales/ne/messages.json +28 -17
- package/src/components/i18n/locales/nl/messages.json +30 -19
- package/src/components/i18n/locales/no/messages.json +31 -20
- package/src/components/i18n/locales/pa/messages.json +28 -17
- package/src/components/i18n/locales/pl/messages.json +29 -18
- package/src/components/i18n/locales/ps/messages.json +28 -17
- package/src/components/i18n/locales/pt/messages.json +29 -18
- package/src/components/i18n/locales/ro/messages.json +29 -18
- package/src/components/i18n/locales/ru/messages.json +28 -17
- package/src/components/i18n/locales/sd/messages.json +28 -17
- package/src/components/i18n/locales/si/messages.json +28 -17
- package/src/components/i18n/locales/sk/messages.json +30 -19
- package/src/components/i18n/locales/sl/messages.json +30 -19
- package/src/components/i18n/locales/sq/messages.json +29 -18
- package/src/components/i18n/locales/sr/messages.json +28 -17
- package/src/components/i18n/locales/sv/messages.json +30 -19
- package/src/components/i18n/locales/sw/messages.json +28 -17
- package/src/components/i18n/locales/ta/messages.json +28 -17
- package/src/components/i18n/locales/te/messages.json +28 -17
- package/src/components/i18n/locales/th/messages.json +28 -17
- package/src/components/i18n/locales/tr/messages.json +28 -17
- package/src/components/i18n/locales/ug/messages.json +28 -17
- package/src/components/i18n/locales/uk/messages.json +28 -17
- package/src/components/i18n/locales/ur/messages.json +28 -17
- package/src/components/i18n/locales/vi/messages.json +28 -17
- package/src/components/i18n/locales/yi/messages.json +28 -17
- package/src/components/i18n/locales/zh/messages.json +28 -17
- package/src/components/icons/index.ts +59 -47
- 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/tools.ts +0 -19
- package/src/components/modules/blockEvents/composers/blockSelectionKeys.ts +20 -3
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +5 -5
- package/src/components/modules/blockManager/blockManager.ts +0 -11
- package/src/components/modules/blockManager/event-binder.ts +1 -12
- 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/themeManager.ts +1 -3
- package/src/components/modules/toolbar/blockSettings.ts +1 -0
- package/src/components/modules/toolbar/inline/index.ts +3 -0
- package/src/components/modules/ui.ts +0 -13
- package/src/components/modules/uiControllers/controllers/keyboard.ts +0 -29
- package/src/components/modules/uiControllers/controllers/selection.ts +2 -14
- package/src/components/ui/toolbox.ts +1 -0
- package/src/components/utils/popover/popover-position.ts +2 -4
- 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 +39 -1140
- package/src/tools/callout/emoji-picker/index.ts +3 -2
- package/src/tools/callout/index.ts +24 -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 +9 -1
- package/src/tools/index.ts +4 -2
- 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/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 +196 -13
- package/src/tools/table/table-cell-blocks.ts +9 -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 +78 -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/types/api/tools.d.ts +0 -18
- package/types/data-attributes.d.ts +0 -1
- package/types/index.d.ts +0 -16
- package/types/markdown.d.ts +2 -0
- package/types/tools/code.d.ts +13 -0
- package/src/tools/database/database-backend-sync.ts +0 -101
- package/src/tools/database/database-board-view.ts +0 -301
- package/src/tools/database/database-card-drag.ts +0 -306
- package/src/tools/database/database-card-drawer.ts +0 -546
- package/src/tools/database/database-column-controls.ts +0 -46
- package/src/tools/database/database-column-drag.ts +0 -262
- package/src/tools/database/database-keyboard.ts +0 -35
- package/src/tools/database/database-list-row-drag.ts +0 -245
- package/src/tools/database/database-list-view.ts +0 -333
- package/src/tools/database/database-model.ts +0 -246
- package/src/tools/database/database-property-type-popover.ts +0 -108
- package/src/tools/database/database-tab-bar.ts +0 -532
- package/src/tools/database/database-view-popover.ts +0 -109
- package/src/tools/database/database-view-renderer.ts +0 -25
- package/src/tools/database/index.ts +0 -948
- package/src/tools/database/types.ts +0 -144
- package/types/tools/database.d.ts +0 -145
- /package/dist/chunks/{am-CHDDMHkd.mjs → am-rVzV1W41.mjs} +0 -0
- /package/dist/chunks/{ar-DoqfNqut.mjs → ar-C710lkoH.mjs} +0 -0
- /package/dist/chunks/{az-C34P9iEa.mjs → az-BOp1pgua.mjs} +0 -0
- /package/dist/chunks/{bg-jroXLY8Y.mjs → bg-CL9p09ZD.mjs} +0 -0
- /package/dist/chunks/{bn-BRI-WqxY.mjs → bn-CNmSeyAy.mjs} +0 -0
- /package/dist/chunks/{bs-CCGUpNHu.mjs → bs-BRzMGqzk.mjs} +0 -0
- /package/dist/chunks/{cs-D5qZOGuc.mjs → cs-BYPBLmnF.mjs} +0 -0
- /package/dist/chunks/{da-DrJ7W37K.mjs → da-CBC_LR1c.mjs} +0 -0
- /package/dist/chunks/{de-BW6-kp2c.mjs → de-DxRFMoAj.mjs} +0 -0
- /package/dist/chunks/{el-C-Vc_Otu.mjs → el-Bk6YbySf.mjs} +0 -0
- /package/dist/chunks/{es-B6fI5K9i.mjs → es-DpT3FCMR.mjs} +0 -0
- /package/dist/chunks/{et-BhVlZ-Yz.mjs → et-DE9Dr_g9.mjs} +0 -0
- /package/dist/chunks/{fa-D55Ijdqa.mjs → fa-Banj1QUE.mjs} +0 -0
- /package/dist/chunks/{fi-jNLjhKUQ.mjs → fi-DfN3M5ER.mjs} +0 -0
- /package/dist/chunks/{fil-DYd0T5aX.mjs → fil-DbCsRS1d.mjs} +0 -0
- /package/dist/chunks/{fr-yxy5xWw_.mjs → fr-D1clKhgt.mjs} +0 -0
- /package/dist/chunks/{gu-CcY_LJe7.mjs → gu-1CsZyRwT.mjs} +0 -0
- /package/dist/chunks/{he-DL9s7wNw.mjs → he-qQdnL6eK.mjs} +0 -0
- /package/dist/chunks/{hi-C8eGXgw5.mjs → hi-DxM0Nff1.mjs} +0 -0
- /package/dist/chunks/{hr-DLpybOhU.mjs → hr-Onldyi-u.mjs} +0 -0
- /package/dist/chunks/{hu-BkT0gT00.mjs → hu-CAn3pBuY.mjs} +0 -0
- /package/dist/chunks/{hy-CVFDCp2S.mjs → hy-D43q7NxE.mjs} +0 -0
- /package/dist/chunks/{id-0P4W9Az0.mjs → id-Xrw5Dd0Y.mjs} +0 -0
- /package/dist/chunks/{it-mLY6_uoW.mjs → it-CA9ZDMSc.mjs} +0 -0
- /package/dist/chunks/{ja-7RkeRNWG.mjs → ja-D0J6WRFh.mjs} +0 -0
- /package/dist/chunks/{ka-C7Lx-Qsh.mjs → ka-BZL7xDuY.mjs} +0 -0
- /package/dist/chunks/{km-Q8udaraH.mjs → km-BimgQZVU.mjs} +0 -0
- /package/dist/chunks/{kn-BiETM-iq.mjs → kn-C2n2cPHK.mjs} +0 -0
- /package/dist/chunks/{ko-tiB80pF1.mjs → ko-n4Cn93D3.mjs} +0 -0
- /package/dist/chunks/{ku-CY-OABkR.mjs → ku-BYZCgT44.mjs} +0 -0
- /package/dist/chunks/{lo-CTBhEnyk.mjs → lo-DVXiAE4N.mjs} +0 -0
- /package/dist/chunks/{lt-BHKHEtqK.mjs → lt-B9KlQFnY.mjs} +0 -0
- /package/dist/chunks/{lv-DWxgtfUg.mjs → lv-BINeOdyx.mjs} +0 -0
- /package/dist/chunks/{mk-BjookGdx.mjs → mk-_-QrPrLN.mjs} +0 -0
- /package/dist/chunks/{ml-L-NnZcp9.mjs → ml-KvJSC1KT.mjs} +0 -0
- /package/dist/chunks/{mn-OMWi7Hl_.mjs → mn-CjFjWnRG.mjs} +0 -0
- /package/dist/chunks/{mr-B6JPzITo.mjs → mr-DqAZ7FRX.mjs} +0 -0
- /package/dist/chunks/{ms-CG3S-sPB.mjs → ms-BZcV4UG_.mjs} +0 -0
- /package/dist/chunks/{my-BLAmGfhT.mjs → my-97SC9jYN.mjs} +0 -0
- /package/dist/chunks/{native-BPcABu9z.mjs → native-CzYG0YgY.mjs} +0 -0
- /package/dist/chunks/{ne-D1JHLfYw.mjs → ne-Bs-M2TyF.mjs} +0 -0
- /package/dist/chunks/{nl-Ca7Q8FnY.mjs → nl-2ZwQilo-.mjs} +0 -0
- /package/dist/chunks/{no-Coxcohcz.mjs → no-fOQTpFq1.mjs} +0 -0
- /package/dist/chunks/{pa-CCaXqpaI.mjs → pa-DLOqkMi0.mjs} +0 -0
- /package/dist/chunks/{pl-Cl_fAZ84.mjs → pl-FYs9QrXU.mjs} +0 -0
- /package/dist/chunks/{ps-WD5qGAWy.mjs → ps-CTXe6pSe.mjs} +0 -0
- /package/dist/chunks/{pt-C4zvLfvq.mjs → pt-B1X4x7d1.mjs} +0 -0
- /package/dist/chunks/{ro-DbefHcmM.mjs → ro-Bf7S2FaR.mjs} +0 -0
- /package/dist/chunks/{ru-uU1J14jd.mjs → ru-B8lqnu_j.mjs} +0 -0
- /package/dist/chunks/{sd-DKu368Ip.mjs → sd-CHRYJm2r.mjs} +0 -0
- /package/dist/chunks/{si-BsJCiPkZ.mjs → si-CI0Hs6vH.mjs} +0 -0
- /package/dist/chunks/{sk-CD-a3SN6.mjs → sk-Bdvq1Kb_.mjs} +0 -0
- /package/dist/chunks/{sl-CXhrPJe_.mjs → sl-B_qiFTV5.mjs} +0 -0
- /package/dist/chunks/{sq-CTctCoFQ.mjs → sq-E0j1hysP.mjs} +0 -0
- /package/dist/chunks/{sr-BZkhBwXj.mjs → sr-VPpVNTZw.mjs} +0 -0
- /package/dist/chunks/{sv-NmRZb_xi.mjs → sv-gKmDSR3d.mjs} +0 -0
- /package/dist/chunks/{sw-Be5ik3H6.mjs → sw-zeFLiO23.mjs} +0 -0
- /package/dist/chunks/{ta-DsXh6neL.mjs → ta-Ci-j89hR.mjs} +0 -0
- /package/dist/chunks/{te-CwpCbM8M.mjs → te-qyMI0M7a.mjs} +0 -0
- /package/dist/chunks/{th-CcZ15OLk.mjs → th-DPxHtpdb.mjs} +0 -0
- /package/dist/chunks/{tr-q3bTgvhW.mjs → tr-CRV6GS-G.mjs} +0 -0
- /package/dist/chunks/{tw-DmW6-pCY.mjs → tw-CqxBf-1Y.mjs} +0 -0
- /package/dist/chunks/{ug-919EhLsL.mjs → ug-DW0YFpo5.mjs} +0 -0
- /package/dist/chunks/{uk-aNMEzd0Y.mjs → uk-ssteuphK.mjs} +0 -0
- /package/dist/chunks/{ur-BwQI77sh.mjs → ur-qhY3-jY7.mjs} +0 -0
- /package/dist/chunks/{vi-Dxq806-F.mjs → vi-CHriMMC8.mjs} +0 -0
- /package/dist/chunks/{zh-BcHuy1Ti.mjs → zh-BJktawVN.mjs} +0 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import type { InlineTool, SanitizerConfig } from '../../../types';
|
|
2
|
+
import type { MenuConfig } from '../../../types/tools';
|
|
3
|
+
import { IconCode } from '../icons';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
isRangeFormatted,
|
|
7
|
+
findFormattingAncestor,
|
|
8
|
+
collectFormattingAncestors,
|
|
9
|
+
} from './utils/formatting-range-utils';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Check if an element is a code tag (<code>)
|
|
13
|
+
* @param element - The element to check
|
|
14
|
+
*/
|
|
15
|
+
const isCodeTag = (element: Element): boolean => {
|
|
16
|
+
return element.tagName === 'CODE';
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Code Inline Tool
|
|
21
|
+
*
|
|
22
|
+
* Inline Toolbar Tool
|
|
23
|
+
*
|
|
24
|
+
* Style selected text with inline code
|
|
25
|
+
*/
|
|
26
|
+
export class CodeInlineTool implements InlineTool {
|
|
27
|
+
/**
|
|
28
|
+
* Specifies Tool as Inline Toolbar Tool
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
31
|
+
public static isInline = true;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Title for the Inline Tool
|
|
35
|
+
*/
|
|
36
|
+
public static title = 'Code';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Translation key for i18n
|
|
40
|
+
*/
|
|
41
|
+
public static titleKey = 'inlineCode';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Sanitizer Rule
|
|
45
|
+
* Leave <code> tags
|
|
46
|
+
* @returns {object}
|
|
47
|
+
*/
|
|
48
|
+
public static get sanitize(): SanitizerConfig {
|
|
49
|
+
return {
|
|
50
|
+
code: {},
|
|
51
|
+
} as SanitizerConfig;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create button for Inline Toolbar
|
|
56
|
+
*/
|
|
57
|
+
public render(): MenuConfig {
|
|
58
|
+
return {
|
|
59
|
+
icon: IconCode,
|
|
60
|
+
name: 'code',
|
|
61
|
+
onActivate: () => {
|
|
62
|
+
this.toggleCode();
|
|
63
|
+
},
|
|
64
|
+
isActive: () => {
|
|
65
|
+
const selection = window.getSelection();
|
|
66
|
+
|
|
67
|
+
return selection ? this.isSelectionVisuallyCode(selection) : false;
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Shortcut for code tool
|
|
74
|
+
*/
|
|
75
|
+
public static shortcut = 'CMD+E';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Apply or remove code formatting using modern Selection API
|
|
79
|
+
*/
|
|
80
|
+
private toggleCode(): void {
|
|
81
|
+
const selection = window.getSelection();
|
|
82
|
+
|
|
83
|
+
if (!selection || selection.rangeCount === 0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const range = selection.getRangeAt(0);
|
|
88
|
+
|
|
89
|
+
if (range.collapsed) {
|
|
90
|
+
this.toggleCollapsedCode(range, selection);
|
|
91
|
+
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const shouldUnwrap = this.isRangeCode(range, { ignoreWhitespace: true });
|
|
96
|
+
|
|
97
|
+
if (shouldUnwrap) {
|
|
98
|
+
this.unwrapCodeTags(range);
|
|
99
|
+
} else {
|
|
100
|
+
this.wrapWithCode(range);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Handle toggle for collapsed selection (caret)
|
|
106
|
+
* @param range - Current range
|
|
107
|
+
* @param selection - Current selection
|
|
108
|
+
*/
|
|
109
|
+
private toggleCollapsedCode(range: Range, selection: Selection): void {
|
|
110
|
+
const isCode = this.isRangeCode(range, { ignoreWhitespace: true });
|
|
111
|
+
|
|
112
|
+
if (isCode) {
|
|
113
|
+
const textNode = document.createTextNode('\u200B');
|
|
114
|
+
|
|
115
|
+
range.insertNode(textNode);
|
|
116
|
+
range.selectNode(textNode);
|
|
117
|
+
this.unwrapCodeTags(range);
|
|
118
|
+
|
|
119
|
+
const newRange = document.createRange();
|
|
120
|
+
|
|
121
|
+
newRange.setStart(textNode, 1);
|
|
122
|
+
newRange.setEnd(textNode, 1);
|
|
123
|
+
|
|
124
|
+
selection.removeAllRanges();
|
|
125
|
+
selection.addRange(newRange);
|
|
126
|
+
} else {
|
|
127
|
+
const code = document.createElement('code');
|
|
128
|
+
const textNode = document.createTextNode('\u200B');
|
|
129
|
+
|
|
130
|
+
code.appendChild(textNode);
|
|
131
|
+
range.insertNode(code);
|
|
132
|
+
|
|
133
|
+
const newRange = document.createRange();
|
|
134
|
+
|
|
135
|
+
newRange.setStart(textNode, 1);
|
|
136
|
+
newRange.setEnd(textNode, 1);
|
|
137
|
+
|
|
138
|
+
selection.removeAllRanges();
|
|
139
|
+
selection.addRange(newRange);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Check if current selection is within a code tag
|
|
145
|
+
* @param selection - The Selection object to check
|
|
146
|
+
*/
|
|
147
|
+
private isSelectionVisuallyCode(selection: Selection): boolean {
|
|
148
|
+
if (selection.rangeCount === 0) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const range = selection.getRangeAt(0);
|
|
153
|
+
|
|
154
|
+
return this.isRangeCode(range, { ignoreWhitespace: true });
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Check if a range contains code text
|
|
159
|
+
* @param range - The range to check
|
|
160
|
+
* @param options - Options for checking code status
|
|
161
|
+
*/
|
|
162
|
+
private isRangeCode(range: Range, options: { ignoreWhitespace: boolean }): boolean {
|
|
163
|
+
return isRangeFormatted(range, isCodeTag, options);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wrap selection with <code> tag
|
|
168
|
+
* @param range - The Range object containing the selection to wrap
|
|
169
|
+
*/
|
|
170
|
+
private wrapWithCode(range: Range): void {
|
|
171
|
+
const html = this.getRangeHtmlWithoutCode(range);
|
|
172
|
+
const insertedRange = this.replaceRangeWithHtml(range, `<code>${html}</code>`);
|
|
173
|
+
const selection = window.getSelection();
|
|
174
|
+
|
|
175
|
+
if (selection && insertedRange) {
|
|
176
|
+
selection.removeAllRanges();
|
|
177
|
+
selection.addRange(insertedRange);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Remove code tags (<code>) while preserving content
|
|
183
|
+
* @param range - The Range object containing the selection to unwrap
|
|
184
|
+
*/
|
|
185
|
+
private unwrapCodeTags(range: Range): void {
|
|
186
|
+
const codeAncestors = this.collectCodeAncestors(range);
|
|
187
|
+
const selection = window.getSelection();
|
|
188
|
+
|
|
189
|
+
if (!selection) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const marker = document.createElement('span');
|
|
194
|
+
const fragment = range.extractContents();
|
|
195
|
+
|
|
196
|
+
marker.appendChild(fragment);
|
|
197
|
+
this.removeNestedCode(marker);
|
|
198
|
+
|
|
199
|
+
range.insertNode(marker);
|
|
200
|
+
|
|
201
|
+
const markerRange = document.createRange();
|
|
202
|
+
|
|
203
|
+
markerRange.selectNodeContents(marker);
|
|
204
|
+
selection.removeAllRanges();
|
|
205
|
+
selection.addRange(markerRange);
|
|
206
|
+
|
|
207
|
+
for (; ;) {
|
|
208
|
+
const currentCode = this.findCodeElement(marker);
|
|
209
|
+
|
|
210
|
+
if (!currentCode) {
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
this.moveMarkerOutOfCode(marker, currentCode);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const firstChild = marker.firstChild;
|
|
218
|
+
const lastChild = marker.lastChild;
|
|
219
|
+
|
|
220
|
+
this.unwrapElement(marker);
|
|
221
|
+
|
|
222
|
+
const finalRange = firstChild && lastChild ? (() => {
|
|
223
|
+
const newRange = document.createRange();
|
|
224
|
+
|
|
225
|
+
newRange.setStartBefore(firstChild);
|
|
226
|
+
newRange.setEndAfter(lastChild);
|
|
227
|
+
|
|
228
|
+
selection.removeAllRanges();
|
|
229
|
+
selection.addRange(newRange);
|
|
230
|
+
|
|
231
|
+
return newRange;
|
|
232
|
+
})() : undefined;
|
|
233
|
+
|
|
234
|
+
if (!finalRange) {
|
|
235
|
+
selection.removeAllRanges();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
codeAncestors.forEach((element) => {
|
|
239
|
+
if (element.textContent.length === 0) {
|
|
240
|
+
element.remove();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Find a code element in the parent chain
|
|
247
|
+
* @param node - The node to start searching from
|
|
248
|
+
*/
|
|
249
|
+
private findCodeElement(node: Node | null): HTMLElement | null {
|
|
250
|
+
return findFormattingAncestor(node, isCodeTag);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Collect all code ancestor elements within a range
|
|
255
|
+
* @param range - The range to search for code ancestors
|
|
256
|
+
*/
|
|
257
|
+
private collectCodeAncestors(range: Range): HTMLElement[] {
|
|
258
|
+
return collectFormattingAncestors(range, isCodeTag);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Get HTML content of a range with code tags removed
|
|
263
|
+
* @param range - The range to extract HTML from
|
|
264
|
+
*/
|
|
265
|
+
private getRangeHtmlWithoutCode(range: Range): string {
|
|
266
|
+
const contents = range.cloneContents();
|
|
267
|
+
|
|
268
|
+
this.removeNestedCode(contents);
|
|
269
|
+
|
|
270
|
+
const container = document.createElement('div');
|
|
271
|
+
|
|
272
|
+
container.appendChild(contents);
|
|
273
|
+
|
|
274
|
+
return container.innerHTML;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Remove nested code tags from a root node
|
|
279
|
+
* @param root - The root node to process
|
|
280
|
+
*/
|
|
281
|
+
private removeNestedCode(root: ParentNode): void {
|
|
282
|
+
const codeNodes = root.querySelectorAll('code');
|
|
283
|
+
|
|
284
|
+
codeNodes.forEach((node) => {
|
|
285
|
+
this.unwrapElement(node);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Unwrap an element by moving its children to the parent
|
|
291
|
+
* @param element - The element to unwrap
|
|
292
|
+
*/
|
|
293
|
+
private unwrapElement(element: Element): void {
|
|
294
|
+
const parent = element.parentNode;
|
|
295
|
+
|
|
296
|
+
if (!parent) {
|
|
297
|
+
element.remove();
|
|
298
|
+
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
while (element.firstChild) {
|
|
303
|
+
parent.insertBefore(element.firstChild, element);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
parent.removeChild(element);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Replace the current range contents with provided HTML snippet
|
|
311
|
+
* @param range - Range to replace
|
|
312
|
+
* @param html - HTML string to insert
|
|
313
|
+
*/
|
|
314
|
+
private replaceRangeWithHtml(range: Range, html: string): Range | undefined {
|
|
315
|
+
const fragment = this.createFragmentFromHtml(html);
|
|
316
|
+
const firstInserted = fragment.firstChild ?? null;
|
|
317
|
+
const lastInserted = fragment.lastChild ?? null;
|
|
318
|
+
|
|
319
|
+
range.deleteContents();
|
|
320
|
+
|
|
321
|
+
if (!firstInserted || !lastInserted) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
range.insertNode(fragment);
|
|
326
|
+
|
|
327
|
+
const newRange = document.createRange();
|
|
328
|
+
|
|
329
|
+
newRange.setStartBefore(firstInserted);
|
|
330
|
+
newRange.setEndAfter(lastInserted);
|
|
331
|
+
|
|
332
|
+
return newRange;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Convert an HTML snippet to a document fragment
|
|
337
|
+
* @param html - HTML string to convert
|
|
338
|
+
*/
|
|
339
|
+
private createFragmentFromHtml(html: string): DocumentFragment {
|
|
340
|
+
const template = document.createElement('template');
|
|
341
|
+
|
|
342
|
+
template.innerHTML = html;
|
|
343
|
+
|
|
344
|
+
return template.content;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Move a temporary marker element outside of a code ancestor while preserving content order
|
|
349
|
+
* @param marker - Marker element wrapping the selection contents
|
|
350
|
+
* @param codeElement - Code ancestor containing the marker
|
|
351
|
+
*/
|
|
352
|
+
private moveMarkerOutOfCode(marker: HTMLElement, codeElement: HTMLElement): void {
|
|
353
|
+
const parent = codeElement.parentNode;
|
|
354
|
+
|
|
355
|
+
if (!parent) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Remove empty text nodes to ensure accurate child count
|
|
360
|
+
Array.from(codeElement.childNodes).forEach((node) => {
|
|
361
|
+
if (node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').length === 0) {
|
|
362
|
+
node.remove();
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
const isOnlyChild = codeElement.childNodes.length === 1 && codeElement.firstChild === marker;
|
|
367
|
+
|
|
368
|
+
if (isOnlyChild) {
|
|
369
|
+
codeElement.replaceWith(marker);
|
|
370
|
+
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const isFirstChild = codeElement.firstChild === marker;
|
|
375
|
+
|
|
376
|
+
if (isFirstChild) {
|
|
377
|
+
parent.insertBefore(marker, codeElement);
|
|
378
|
+
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const isLastChild = codeElement.lastChild === marker;
|
|
383
|
+
|
|
384
|
+
if (isLastChild) {
|
|
385
|
+
parent.insertBefore(marker, codeElement.nextSibling);
|
|
386
|
+
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const trailingClone = codeElement.cloneNode(false) as HTMLElement;
|
|
391
|
+
|
|
392
|
+
while (marker.nextSibling) {
|
|
393
|
+
trailingClone.appendChild(marker.nextSibling);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
parent.insertBefore(trailingClone, codeElement.nextSibling);
|
|
397
|
+
parent.insertBefore(marker, trailingClone);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BlockToolData, OutputBlockData, OutputData, ToolConfig } from '../../../../types';
|
|
2
2
|
import type { BlockAPI as BlockAPIInterface, Blocks } from '../../../../types/api';
|
|
3
3
|
import type { BlockTuneData } from '../../../../types/block-tunes/block-tune-data';
|
|
4
|
+
import type { MarkdownImportConfig } from '../../../markdown/types';
|
|
4
5
|
import { isInsideTableCell, isRestrictedInTableCell } from '../../../tools/table/table-restrictions';
|
|
5
6
|
import { Module } from '../../__module';
|
|
6
7
|
import { Block } from '../../block';
|
|
@@ -245,6 +246,22 @@ export class BlocksAPI extends Module {
|
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Import Markdown string as blocks.
|
|
251
|
+
* Lazy-loads the markdown converter on first call.
|
|
252
|
+
* @param md - Markdown source string
|
|
253
|
+
* @param options - Optional configuration for tool mapping and extensions
|
|
254
|
+
*/
|
|
255
|
+
public async importMarkdown(md: string, options?: MarkdownImportConfig): Promise<OutputData> {
|
|
256
|
+
const { markdownToBlocks } = await import('../../../markdown/index');
|
|
257
|
+
const blocks = await markdownToBlocks(md, options);
|
|
258
|
+
const data: OutputData = { blocks };
|
|
259
|
+
|
|
260
|
+
await this.render(data);
|
|
261
|
+
|
|
262
|
+
return data;
|
|
263
|
+
}
|
|
264
|
+
|
|
248
265
|
/**
|
|
249
266
|
* Insert new Block and returns it's API
|
|
250
267
|
* @param {string} type — Tool name
|
|
@@ -11,25 +11,6 @@ export class ToolsAPI extends Module {
|
|
|
11
11
|
public get methods(): ToolsAPIInterface {
|
|
12
12
|
return {
|
|
13
13
|
getBlockTools: () => Array.from(this.Blok.Tools.blockTools.values()),
|
|
14
|
-
getToolsConfig: () => {
|
|
15
|
-
const result: ReturnType<ToolsAPIInterface['getToolsConfig']> = {
|
|
16
|
-
tools: this.config.tools,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (this.config.inlineToolbar !== undefined) {
|
|
20
|
-
result.inlineToolbar = this.config.inlineToolbar;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (this.config.tunes !== undefined) {
|
|
24
|
-
result.tunes = this.config.tunes;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (this.config.theme !== undefined) {
|
|
28
|
-
result.theme = this.config.theme;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return result;
|
|
32
|
-
},
|
|
33
14
|
};
|
|
34
15
|
}
|
|
35
16
|
}
|
|
@@ -32,19 +32,36 @@ export class BlockSelectionKeys extends BlockEventComposer {
|
|
|
32
32
|
*/
|
|
33
33
|
private canIndentSelectedListItems(): boolean {
|
|
34
34
|
const { BlockSelection, BlockManager } = this.Blok;
|
|
35
|
+
const selectedSet = new Set(BlockSelection.selectedBlocks);
|
|
35
36
|
|
|
36
37
|
for (const block of BlockSelection.selectedBlocks) {
|
|
37
38
|
const blockIndex = BlockManager.getBlockIndex(block);
|
|
38
39
|
|
|
39
|
-
if (blockIndex === undefined
|
|
40
|
+
if (blockIndex === undefined) {
|
|
40
41
|
return false;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
const previousBlock =
|
|
44
|
+
const previousBlock = blockIndex > 0
|
|
45
|
+
? BlockManager.getBlockByIndex(blockIndex - 1)
|
|
46
|
+
: undefined;
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
const isFirstInGroup = !previousBlock || previousBlock.name !== LIST_TOOL_NAME;
|
|
49
|
+
|
|
50
|
+
// First-in-group items can nest one level; mid-list items can't exceed previous depth
|
|
51
|
+
if (isFirstInGroup && this.getListBlockDepth(block) >= 1) {
|
|
46
52
|
return false;
|
|
47
53
|
}
|
|
54
|
+
if (isFirstInGroup) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* If the predecessor is also selected, both will be indented together,
|
|
60
|
+
* so the relative depth difference is preserved — skip the check.
|
|
61
|
+
*/
|
|
62
|
+
if (selectedSet.has(previousBlock)) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
48
65
|
|
|
49
66
|
if (this.getListBlockDepth(block) > this.getListBlockDepth(previousBlock)) {
|
|
50
67
|
return false;
|
|
@@ -91,14 +91,14 @@ export class KeyboardNavigation extends BlockEventComposer {
|
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
event.shiftKey ? Caret.navigatePrevious(true) : Caret.navigateNext(true);
|
|
94
|
+
const isNavigated = event.shiftKey ? Caret.navigatePrevious(true) : Caret.navigateNext(true);
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
* Without this, pressing Tab on the last block of a nested editor (e.g. a
|
|
99
|
-
* database card drawer) lets the browser move focus out of the editor entirely.
|
|
97
|
+
* If we have next Block/input to focus, then focus it. Otherwise, leave native Tab behaviour
|
|
100
98
|
*/
|
|
101
|
-
|
|
99
|
+
if (isNavigated) {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -300,17 +300,6 @@ export class BlockManager extends Module {
|
|
|
300
300
|
eventsDispatcher: this.eventsDispatcher,
|
|
301
301
|
getBlockIndex: (block) => this.repository.getBlockIndex(block),
|
|
302
302
|
onBlockMutated: this.blockDidMutated.bind(this),
|
|
303
|
-
shouldHandleEvent: (event: Event) => {
|
|
304
|
-
const target = event.target;
|
|
305
|
-
|
|
306
|
-
if (target instanceof Element) {
|
|
307
|
-
const closestEditor = target.closest('[data-blok-testid="blok-editor"]');
|
|
308
|
-
|
|
309
|
-
return closestEditor === null || closestEditor === this.Blok.UI.nodes.wrapper;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return true;
|
|
313
|
-
},
|
|
314
303
|
});
|
|
315
304
|
|
|
316
305
|
// Initialize factory
|
|
@@ -51,8 +51,6 @@ export interface BlockEventBinderDependencies {
|
|
|
51
51
|
getBlockIndex: (block: Block) => number;
|
|
52
52
|
/** Callback when block is mutated */
|
|
53
53
|
onBlockMutated: BlockMutationCallback;
|
|
54
|
-
/** Check if an event should be handled by this editor instance */
|
|
55
|
-
shouldHandleEvent?: (event: Event) => boolean;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
/**
|
|
@@ -78,31 +76,22 @@ export class BlockEventBinder {
|
|
|
78
76
|
* @param block - Block to bind events to
|
|
79
77
|
*/
|
|
80
78
|
public bindBlockEvents(block: Block): void {
|
|
81
|
-
const { blockEvents, listeners, onBlockMutated, getBlockIndex
|
|
79
|
+
const { blockEvents, listeners, onBlockMutated, getBlockIndex } = this.dependencies;
|
|
82
80
|
|
|
83
81
|
listeners.on(block.holder, 'keydown', (event: Event) => {
|
|
84
82
|
if (event instanceof KeyboardEvent) {
|
|
85
|
-
if (shouldHandleEvent && !shouldHandleEvent(event)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
83
|
blockEvents.keydown(event);
|
|
89
84
|
}
|
|
90
85
|
});
|
|
91
86
|
|
|
92
87
|
listeners.on(block.holder, 'keyup', (event: Event) => {
|
|
93
88
|
if (event instanceof KeyboardEvent) {
|
|
94
|
-
if (shouldHandleEvent && !shouldHandleEvent(event)) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
89
|
blockEvents.keyup(event);
|
|
98
90
|
}
|
|
99
91
|
});
|
|
100
92
|
|
|
101
93
|
listeners.on(block.holder, 'input', (event: Event) => {
|
|
102
94
|
if (event instanceof InputEvent) {
|
|
103
|
-
if (shouldHandleEvent && !shouldHandleEvent(event)) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
95
|
blockEvents.input(event);
|
|
107
96
|
}
|
|
108
97
|
});
|
|
@@ -77,24 +77,28 @@ export class HtmlHandler extends BasePasteHandler implements PasteHandler {
|
|
|
77
77
|
const isDetailsElement =
|
|
78
78
|
node.nodeType === Node.ELEMENT_NODE &&
|
|
79
79
|
(node as HTMLElement).tagName === 'DETAILS';
|
|
80
|
+
const isAsideElement =
|
|
81
|
+
node.nodeType === Node.ELEMENT_NODE &&
|
|
82
|
+
(node as HTMLElement).tagName === 'ASIDE';
|
|
80
83
|
|
|
81
|
-
if (!isDetailsElement) {
|
|
84
|
+
if (!isDetailsElement && !isAsideElement) {
|
|
82
85
|
expandedNodes.push({ node });
|
|
83
86
|
continue;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
const
|
|
89
|
+
const parentExpandedIndex = expandedNodes.length;
|
|
87
90
|
|
|
88
91
|
expandedNodes.push({ node });
|
|
89
92
|
|
|
90
93
|
// Only direct children are extracted (not deeply nested structures), which
|
|
91
94
|
// is correct for Google Docs DETAILS format where children are flat siblings.
|
|
95
|
+
// For ASIDE, ALL children become child blocks (no SUMMARY to skip).
|
|
92
96
|
const childElements = Array.from((node as HTMLElement).children).filter(
|
|
93
|
-
(child) => child.tagName !== 'SUMMARY'
|
|
97
|
+
(child) => isAsideElement || child.tagName !== 'SUMMARY'
|
|
94
98
|
);
|
|
95
99
|
|
|
96
100
|
for (const child of childElements) {
|
|
97
|
-
expandedNodes.push({ node: child, parentExpandedIndex
|
|
101
|
+
expandedNodes.push({ node: child, parentExpandedIndex });
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
|
|
@@ -247,12 +251,11 @@ export class HtmlHandler extends BasePasteHandler implements PasteHandler {
|
|
|
247
251
|
|
|
248
252
|
const isSubstitutable = tags.includes(element.tagName);
|
|
249
253
|
|
|
250
|
-
// DETAILS
|
|
251
|
-
// atomic
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
|
|
255
|
-
if (isSubstitutable && element.tagName === 'DETAILS') {
|
|
254
|
+
// DETAILS and ASIDE are container-type substitutable elements. Always return
|
|
255
|
+
// them as atomic blocks so the tool's onPaste receives the full element
|
|
256
|
+
// (including children), rather than having them split into flat blocks when
|
|
257
|
+
// the paragraph tool's <p> registration triggers containsAnotherToolTags = true.
|
|
258
|
+
if (isSubstitutable && (element.tagName === 'DETAILS' || element.tagName === 'ASIDE')) {
|
|
256
259
|
return [...nodes, destNode, element];
|
|
257
260
|
}
|
|
258
261
|
|
|
@@ -7,3 +7,4 @@ export { HtmlHandler } from './html-handler';
|
|
|
7
7
|
export { PatternHandler } from './pattern-handler';
|
|
8
8
|
export { TableCellsHandler } from './table-cells-handler';
|
|
9
9
|
export { TextHandler } from './text-handler';
|
|
10
|
+
export { MarkdownHandler } from '../../../../markdown/markdown-handler';
|
|
@@ -9,6 +9,7 @@ import type { PasteHandler } from './handlers/base';
|
|
|
9
9
|
import { BlokDataHandler } from './handlers/blok-data-handler';
|
|
10
10
|
import { FilesHandler } from './handlers/files-handler';
|
|
11
11
|
import { HtmlHandler } from './handlers/html-handler';
|
|
12
|
+
import { MarkdownHandler } from '../../../markdown/markdown-handler';
|
|
12
13
|
import { PatternHandler } from './handlers/pattern-handler';
|
|
13
14
|
import { TableCellsHandler } from './handlers/table-cells-handler';
|
|
14
15
|
import { TextHandler } from './handlers/text-handler';
|
|
@@ -50,6 +51,7 @@ export class Paste extends Module {
|
|
|
50
51
|
new TableCellsHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder),
|
|
51
52
|
new FilesHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder),
|
|
52
53
|
new PatternHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder),
|
|
54
|
+
new MarkdownHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder),
|
|
53
55
|
new HtmlHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder),
|
|
54
56
|
new TextHandler(this.Blok, this.toolRegistry, this.sanitizerBuilder, this.config),
|
|
55
57
|
];
|
|
@@ -192,6 +194,10 @@ export class Paste extends Module {
|
|
|
192
194
|
return plainData;
|
|
193
195
|
}
|
|
194
196
|
|
|
197
|
+
if (handler instanceof MarkdownHandler) {
|
|
198
|
+
return plainData;
|
|
199
|
+
}
|
|
200
|
+
|
|
195
201
|
if (handler instanceof TextHandler) {
|
|
196
202
|
return plainData;
|
|
197
203
|
}
|
|
@@ -108,9 +108,7 @@ export class ThemeManager extends Module {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if (this.mode === 'auto') {
|
|
111
|
-
|
|
112
|
-
this.removeAttribute();
|
|
113
|
-
}
|
|
111
|
+
this.removeAttribute();
|
|
114
112
|
} else {
|
|
115
113
|
document.documentElement.setAttribute(ATTR, this.mode);
|
|
116
114
|
}
|
|
@@ -191,6 +191,7 @@ export class BlockSettings extends Module<BlockSettingsNodes> {
|
|
|
191
191
|
searchable: true,
|
|
192
192
|
trigger: trigger || this.nodes.wrapper,
|
|
193
193
|
items: await this.getTunesItems(block, commonTunes, toolTunes),
|
|
194
|
+
scopeElement: this.Blok.API.methods.ui.nodes.redactor,
|
|
194
195
|
messages: {
|
|
195
196
|
nothingFound: this.Blok.I18n.t('popover.nothingFound'),
|
|
196
197
|
search: this.Blok.I18n.t('popover.search'),
|
|
@@ -330,8 +330,11 @@ export class InlineToolbar extends Module<InlineToolbarNodes> {
|
|
|
330
330
|
const popoverItems = await this.buildPopoverItems();
|
|
331
331
|
|
|
332
332
|
// Create popover
|
|
333
|
+
const scopeElement = this.Blok.API?.methods?.ui?.nodes?.redactor ?? this.Blok.UI.nodes.redactor;
|
|
334
|
+
|
|
333
335
|
this.popover = new PopoverInline({
|
|
334
336
|
items: popoverItems,
|
|
337
|
+
scopeElement,
|
|
335
338
|
messages: {
|
|
336
339
|
nothingFound: this.Blok.I18n.t('popover.nothingFound'),
|
|
337
340
|
search: this.Blok.I18n.t('popover.search'),
|