@jackuait/blok 0.10.0-beta.6 → 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 +2 -2
- 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-BdlR_lX6.mjs → blok-CiLRmoHI.mjs} +850 -855
- 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-Byubey_H.mjs → chunk-D6kmoKXy.mjs} +5 -5
- 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-Cp8O0UfP.mjs → constants-DFS8l39Y.mjs} +49 -50
- 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/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-loader-oDO9ZKUV.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-NjLaA6AJ.mjs → katex-JyOgX6MW.mjs} +1 -1
- package/dist/chunks/{lightweight-i18n-DTySD6f6.mjs → lightweight-i18n-Cvv8CWh4.mjs} +13 -0
- package/dist/chunks/line-B9xUUA7k.mjs +34 -0
- package/dist/chunks/linear-Dj-1yA_B.mjs +289 -0
- package/dist/chunks/mermaid-parser.core-D6OPAUtM.mjs +57 -0
- package/dist/chunks/mermaid.core-BPN9ZHKQ.mjs +989 -0
- package/dist/{messages-B4lhNMKm2.mjs → chunks/messages--YKhFEDE.mjs} +28 -3
- package/dist/chunks/{messages-CF_PfacZ.mjs → messages-0Uwu1AMJ2.mjs} +26 -1
- package/dist/{messages-Bug6Du35.mjs → chunks/messages-1__0Ph4Q.mjs} +26 -1
- package/dist/chunks/{messages-CnQydQJd2.mjs → messages-4sm9Pb0C.mjs} +26 -1
- package/dist/chunks/{messages-BDXl53cy2.mjs → messages-4uxjtzKW.mjs} +26 -1
- package/dist/{messages-DQN1y6E9.mjs → chunks/messages-B-SwLgkQ.mjs} +28 -3
- package/dist/chunks/{messages-BlcRm2I3.mjs → messages-B1ylBxXQ.mjs} +26 -1
- package/dist/{messages-12_eyAo-.mjs → chunks/messages-B5m3dhKc.mjs} +26 -1
- package/dist/chunks/{messages-D8-N0FmU.mjs → messages-B6n2zDtv.mjs} +27 -2
- package/dist/chunks/{messages-BMq9k_lI.mjs → messages-BC9w4zAT.mjs} +26 -1
- package/dist/{messages-CsiGzUSP2.mjs → chunks/messages-BOj-7N3p.mjs} +26 -1
- package/dist/chunks/{messages-CvlMT1e62.mjs → messages-BRYHTS18.mjs} +26 -1
- package/dist/{messages-hrSlVSHp.mjs → chunks/messages-BSBbVjor.mjs} +33 -8
- package/dist/{messages-uCsQjz7M.mjs → chunks/messages-BUUkmUGc.mjs} +26 -1
- package/dist/chunks/{messages-DopbvJlg.mjs → messages-Bb3YEV2P.mjs} +31 -6
- package/dist/{messages-KqWQKmIu2.mjs → chunks/messages-Be_6YLzJ.mjs} +27 -2
- package/dist/chunks/{messages-BXn9Vzbx2.mjs → messages-BevRhv5d.mjs} +26 -1
- package/dist/chunks/{messages-DQ5ng0_t2.mjs → messages-Bhqr7Im2.mjs} +26 -1
- package/dist/{messages-B3Yhiycb2.mjs → chunks/messages-BpJFjSKa.mjs} +27 -2
- package/dist/chunks/{messages-BaoJwsEZ.mjs → messages-BqYlq_Bn.mjs} +26 -1
- package/dist/chunks/{messages-vN4T4r67.mjs → messages-BtAwCUfD.mjs} +26 -1
- package/dist/{messages-Cb3wXGnc.mjs → chunks/messages-Bthbp65G.mjs} +27 -2
- package/dist/{messages-x353UCBI.mjs → chunks/messages-BvHMZ8Pi2.mjs} +26 -1
- package/dist/{messages-BOE2mzCj2.mjs → chunks/messages-Bw1BE9jW.mjs} +26 -1
- package/dist/chunks/{messages-C5aCWL7B.mjs → messages-Bx6Wt285.mjs} +26 -1
- package/dist/{messages-C8f1I5EQ2.mjs → chunks/messages-BzslJRYv.mjs} +27 -2
- package/dist/chunks/{messages-CZ5Sbf8U.mjs → messages-C02M0Tpw.mjs} +26 -1
- package/dist/chunks/{messages-DN-194c32.mjs → messages-C1u3E9qg.mjs} +26 -1
- package/dist/chunks/{messages-DdmWzF5M.mjs → messages-C68WgSKk.mjs} +27 -2
- package/dist/chunks/{messages-Dgng6KN8.mjs → messages-C8w8JCP0.mjs} +28 -3
- package/dist/chunks/{messages-B5fKJXd6.mjs → messages-CFOZdSk4.mjs} +26 -1
- package/dist/chunks/{messages-5ArOv8cj.mjs → messages-CGOY79lr.mjs} +26 -1
- package/dist/{messages-mipkPgwQ2.mjs → chunks/messages-CGaSMZPu.mjs} +26 -1
- package/dist/{messages-Dq_v7slw2.mjs → chunks/messages-CJJgQ0BH.mjs} +26 -1
- package/dist/chunks/{messages-DUGEqDEG.mjs → messages-CTD6rtQj2.mjs} +26 -1
- package/dist/{messages-DIKCwGog.mjs → chunks/messages-CZymJML9.mjs} +30 -5
- package/dist/chunks/{messages-CcyIKgGU.mjs → messages-CfeFJbiv.mjs} +30 -5
- package/dist/chunks/{messages-BXSXk3oS2.mjs → messages-Cgatzu_z.mjs} +28 -3
- package/dist/{messages-CBPiFbEf2.mjs → chunks/messages-Ch2zBI602.mjs} +26 -1
- package/dist/chunks/{messages-yszqJukE.mjs → messages-CiAHsUfO.mjs} +26 -1
- package/dist/chunks/{messages-bmwto4UV.mjs → messages-Cuzq-tNW.mjs} +26 -1
- package/dist/{messages-JK9Okzsy2.mjs → chunks/messages-Cw4qiMwb.mjs} +26 -1
- package/dist/chunks/{messages-DSO2U-ul.mjs → messages-Cyh-mz40.mjs} +26 -1
- package/dist/{messages-DbZsJAff.mjs → chunks/messages-D-I2QO8H.mjs} +26 -1
- package/dist/chunks/{messages-BhcYsC_M2.mjs → messages-D0D2gruy.mjs} +26 -1
- package/dist/{messages-X80Nh0ib.mjs → chunks/messages-D1BKxfLD.mjs} +27 -2
- package/dist/chunks/{messages-CjVPwkVy.mjs → messages-D4eDs6R_.mjs} +26 -1
- package/dist/{messages-C5Uufygq.mjs → chunks/messages-D9Xr-hES.mjs} +26 -1
- package/dist/{messages-DkvQ-6HC2.mjs → chunks/messages-D9eJPHia.mjs} +28 -3
- package/dist/chunks/{messages-DRv4g-IA.mjs → messages-DBFWSzKY2.mjs} +26 -1
- package/dist/chunks/{messages-SSDr5fGF2.mjs → messages-DC0wu2S7.mjs} +26 -1
- package/dist/{messages-Bdk4ocMI.mjs → chunks/messages-DF9o19rG.mjs} +26 -1
- package/dist/chunks/{messages-DVKifYlq.mjs → messages-DFS_n986.mjs} +49 -24
- package/dist/{messages-CvvbLyTy2.mjs → chunks/messages-DGS4H30T.mjs} +26 -1
- package/dist/{messages-PvMdmlxI.mjs → chunks/messages-DKjddpzJ.mjs} +28 -3
- package/dist/chunks/{messages-DGD6BiGd.mjs → messages-DMvTdUXC.mjs} +28 -3
- package/dist/{messages-CD8K1g_t2.mjs → chunks/messages-DQUX-QYI2.mjs} +26 -1
- package/dist/chunks/{messages-CqgEz7C5.mjs → messages-DUigq8FO2.mjs} +26 -1
- package/dist/chunks/{messages-ByAqzAhB.mjs → messages-DY0FJdpH.mjs} +26 -1
- package/dist/{messages-DACg1XAu.mjs → chunks/messages-DfVXiqt-2.mjs} +26 -1
- package/dist/{messages-BYQ769S5.mjs → chunks/messages-DgZc9TJw.mjs} +26 -1
- package/dist/{messages-Dj79y02X.mjs → chunks/messages-QD4BCUDP.mjs} +26 -1
- package/dist/{messages-BeI2HORe2.mjs → chunks/messages-USmweex9.mjs} +26 -1
- package/dist/{messages-CEEzfqMO2.mjs → chunks/messages-a1JTi0Qm.mjs} +29 -4
- package/dist/chunks/{messages-Dz3UhEco2.mjs → messages-jcgCHPRn.mjs} +26 -1
- package/dist/{messages--cUQf9JX.mjs → chunks/messages-tnnqHpbd.mjs} +27 -2
- package/dist/chunks/{messages-DZwCufSb.mjs → messages-vzWKPLJO.mjs} +26 -1
- package/dist/chunks/{micromark-extension-math-CCEGWpdz.mjs → micromark-extension-math-Cz_ZZ_0Y.mjs} +1 -1
- package/dist/chunks/mindmap-definition-QFDTVHPH-BswFuNN6.mjs +1013 -0
- 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-DGOsJbHH.mjs → tools-CSYsrnud.mjs} +2116 -1268
- 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 +3 -3
- package/dist/locales.mjs +80 -67
- package/dist/markdown.mjs +2 -2
- package/dist/{chunks/messages-9l49jauY.mjs → messages-5jvKxQNu2.mjs} +26 -1
- package/dist/{messages-CkySRhtd2.mjs → messages-7QD-X6XT2.mjs} +26 -1
- package/dist/{chunks/messages-Btr121zI2.mjs → messages-96iaAUds2.mjs} +27 -2
- package/dist/{chunks/messages-BAP2OAQk.mjs → messages-B19o-Teb.mjs} +28 -3
- package/dist/{messages-DJU4YLij.mjs → messages-B1ZUQagA.mjs} +26 -1
- package/dist/{messages-Dg2CDXZi2.mjs → messages-B7ieAJBd2.mjs} +26 -1
- package/dist/{messages-CByBLxWk.mjs → messages-BECMxmfX.mjs} +26 -1
- package/dist/{messages-CwCEcbWG.mjs → messages-BIHc0KHY.mjs} +27 -2
- package/dist/{messages-D8WvwU42.mjs → messages-BIoeoik5.mjs} +26 -1
- package/dist/{messages-D38h5XlF.mjs → messages-BJeGJksD.mjs} +26 -1
- package/dist/{messages-Cd23UgLV2.mjs → messages-BRZX964b2.mjs} +27 -2
- package/dist/{chunks/messages-B9N__q552.mjs → messages-BTQPpoM42.mjs} +29 -4
- package/dist/{messages-CUzBNjnc.mjs → messages-BYNcD6uR.mjs} +26 -1
- package/dist/{messages-DjWfVYHS2.mjs → messages-BYmmMDrN2.mjs} +26 -1
- package/dist/{chunks/messages-DkTxBa1V.mjs → messages-BbYq1pk-.mjs} +26 -1
- package/dist/{chunks/messages-BHhbHLoq.mjs → messages-BiUGXvYr2.mjs} +26 -1
- package/dist/{messages-So3SHdIc2.mjs → messages-BiiongNz2.mjs} +26 -1
- package/dist/{chunks/messages-BxBID_0B.mjs → messages-Bm0Feca1.mjs} +30 -5
- package/dist/{messages-C2veeQpU.mjs → messages-BmAn22OX.mjs} +26 -1
- package/dist/{messages-KbYSpNrE.mjs → messages-Bq3F2Tp_.mjs} +26 -1
- package/dist/{chunks/messages-Dux1S0-D2.mjs → messages-BsycN_JI2.mjs} +26 -1
- package/dist/{messages-DRU_IgoW.mjs → messages-BwHs4cm1.mjs} +30 -5
- package/dist/{messages-Cv-DKlZd.mjs → messages-CJTy6JZt.mjs} +26 -1
- package/dist/{chunks/messages-D7n_wJK7.mjs → messages-CR_L_UtK.mjs} +26 -1
- package/dist/{messages-DnhEzmXJ2.mjs → messages-CSUHBs4c2.mjs} +26 -1
- package/dist/{messages-C_HmWyXc2.mjs → messages-CWIXvnDf2.mjs} +26 -1
- package/dist/{messages-KSxF8eib.mjs → messages-CcF4y-E4.mjs} +26 -1
- package/dist/{chunks/messages-CL3mCbi6.mjs → messages-Ce6KVEbT.mjs} +27 -2
- package/dist/{chunks/messages-C-jA6Rf7.mjs → messages-Ci0KqX-J.mjs} +33 -8
- package/dist/{chunks/messages-DMyRdafk2.mjs → messages-CjbnogEC.mjs} +26 -1
- package/dist/{chunks/messages-BlO_37l_.mjs → messages-CmB406HW.mjs} +28 -3
- package/dist/{messages-Cho2VTAX.mjs → messages-CqXtJTpU.mjs} +26 -1
- package/dist/{messages-CWEL1WDy2.mjs → messages-D0aw5_0k2.mjs} +28 -3
- package/dist/{messages-CgEDVri-2.mjs → messages-D8FQWulF2.mjs} +26 -1
- package/dist/{chunks/messages-B5aAzExz.mjs → messages-DBiVgUs2.mjs} +27 -2
- package/dist/{chunks/messages-DYizZHT2.mjs → messages-DIJlIqlQ2.mjs} +26 -1
- package/dist/{messages-BPL7riv-.mjs → messages-DLX_iBDJ.mjs} +26 -1
- package/dist/{messages-vptt-pVF.mjs → messages-DLlc9QPw.mjs} +26 -1
- package/dist/{chunks/messages-876bKyUj2.mjs → messages-DMr62KiO2.mjs} +26 -1
- package/dist/{chunks/messages-CgedvWCf.mjs → messages-DPA-mMWC2.mjs} +27 -2
- package/dist/{messages-vcoib5Ga.mjs → messages-DTh9a8mR.mjs} +26 -1
- package/dist/{chunks/messages-DgEGJECT.mjs → messages-DY4IqlhY.mjs} +26 -1
- package/dist/{chunks/messages-CdzF0Hvl.mjs → messages-DYTTu0O12.mjs} +26 -1
- package/dist/{messages-rbox5gSb2.mjs → messages-DbySKTKt2.mjs} +28 -3
- package/dist/{chunks/messages-BGCQCeWd.mjs → messages-Ddnj2iTG2.mjs} +26 -1
- package/dist/{chunks/messages-CNEJxD8q2.mjs → messages-DkLU_rWm.mjs} +26 -1
- package/dist/{chunks/messages-FYl9woii2.mjs → messages-Dl3Sv6Rq2.mjs} +27 -2
- package/dist/{messages-Clsh86WQ.mjs → messages-Dl5Y2-Ia.mjs} +49 -24
- package/dist/{chunks/messages-CKRJDX0K2.mjs → messages-DnG0ef8t2.mjs} +28 -3
- package/dist/{chunks/messages-CyxDkx8a.mjs → messages-DnGJD4TL.mjs} +26 -1
- package/dist/{chunks/messages-DnJHflSh.mjs → messages-Dnp9N6RU2.mjs} +26 -1
- package/dist/{chunks/messages-Jps5Tc77.mjs → messages-Dvn35ksS.mjs} +26 -1
- package/dist/{messages-ChTWmxS8.mjs → messages-Dw__BcTj.mjs} +26 -1
- package/dist/{messages-D7juvhHp.mjs → messages-Dy-Y_nEI.mjs} +26 -1
- package/dist/{messages-CNNcKuGH.mjs → messages-E_ZuzGDt.mjs} +26 -1
- package/dist/{chunks/messages-DJO0ERQT.mjs → messages-F2xRoY1w.mjs} +26 -1
- package/dist/{messages-DqJTZbwt.mjs → messages-Smt4GBbj.mjs} +31 -6
- package/dist/{chunks/messages-D8dKkyII2.mjs → messages-aMXpHt5X2.mjs} +26 -1
- package/dist/{chunks/messages-DWD0ry9x.mjs → messages-aWZH50vu2.mjs} +28 -3
- package/dist/{chunks/messages-BbfLRqLh2.mjs → messages-dv19AkyJ.mjs} +26 -1
- package/dist/{chunks/messages-Dw2rmKMi2.mjs → messages-hWwSRF-2.mjs} +26 -1
- package/dist/{messages-En8LDjUB.mjs → messages-j7o5rT9s.mjs} +26 -1
- package/dist/{chunks/messages-NJsvFwJj.mjs → messages-nUVjeh7K.mjs} +27 -2
- package/dist/{messages-Cg1CF4pw.mjs → messages-nlhESX9t.mjs} +26 -1
- package/dist/{messages-CSl0Wla62.mjs → messages-rk-A1Wa42.mjs} +28 -3
- package/dist/{messages-nOe1gJYu.mjs → messages-xh2eOLvs.mjs} +26 -1
- package/dist/{messages-B_sKqaeK.mjs → messages-ynAe7ewZ.mjs} +26 -1
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +2 -2
- package/dist/vendor.LICENSE.txt +3254 -297
- package/package.json +7 -2
- package/src/components/constants/data-attributes.ts +0 -2
- package/src/components/i18n/locales/am/messages.json +26 -1
- package/src/components/i18n/locales/ar/messages.json +26 -1
- package/src/components/i18n/locales/az/messages.json +26 -1
- package/src/components/i18n/locales/bg/messages.json +26 -1
- package/src/components/i18n/locales/bn/messages.json +26 -1
- package/src/components/i18n/locales/bs/messages.json +28 -3
- package/src/components/i18n/locales/cs/messages.json +30 -5
- package/src/components/i18n/locales/da/messages.json +33 -8
- package/src/components/i18n/locales/de/messages.json +31 -6
- package/src/components/i18n/locales/dv/messages.json +26 -1
- package/src/components/i18n/locales/el/messages.json +26 -1
- package/src/components/i18n/locales/en/messages.json +13 -0
- package/src/components/i18n/locales/es/messages.json +27 -2
- package/src/components/i18n/locales/et/messages.json +30 -5
- package/src/components/i18n/locales/fa/messages.json +26 -1
- package/src/components/i18n/locales/fi/messages.json +26 -1
- package/src/components/i18n/locales/fil/messages.json +49 -24
- package/src/components/i18n/locales/fr/messages.json +27 -2
- package/src/components/i18n/locales/gu/messages.json +26 -1
- package/src/components/i18n/locales/he/messages.json +26 -1
- package/src/components/i18n/locales/hi/messages.json +26 -1
- package/src/components/i18n/locales/hr/messages.json +28 -3
- package/src/components/i18n/locales/hu/messages.json +27 -2
- package/src/components/i18n/locales/hy/messages.json +26 -1
- package/src/components/i18n/locales/id/messages.json +26 -1
- package/src/components/i18n/locales/it/messages.json +27 -2
- package/src/components/i18n/locales/ja/messages.json +26 -1
- package/src/components/i18n/locales/ka/messages.json +26 -1
- package/src/components/i18n/locales/km/messages.json +26 -1
- package/src/components/i18n/locales/kn/messages.json +26 -1
- package/src/components/i18n/locales/ko/messages.json +26 -1
- package/src/components/i18n/locales/ku/messages.json +26 -1
- package/src/components/i18n/locales/lo/messages.json +26 -1
- package/src/components/i18n/locales/lt/messages.json +26 -1
- package/src/components/i18n/locales/lv/messages.json +26 -1
- package/src/components/i18n/locales/mk/messages.json +26 -1
- package/src/components/i18n/locales/ml/messages.json +26 -1
- package/src/components/i18n/locales/mn/messages.json +26 -1
- package/src/components/i18n/locales/mr/messages.json +26 -1
- package/src/components/i18n/locales/ms/messages.json +28 -3
- package/src/components/i18n/locales/my/messages.json +26 -1
- package/src/components/i18n/locales/ne/messages.json +26 -1
- package/src/components/i18n/locales/nl/messages.json +28 -3
- package/src/components/i18n/locales/no/messages.json +29 -4
- package/src/components/i18n/locales/pa/messages.json +26 -1
- package/src/components/i18n/locales/pl/messages.json +27 -2
- package/src/components/i18n/locales/ps/messages.json +26 -1
- package/src/components/i18n/locales/pt/messages.json +27 -2
- package/src/components/i18n/locales/ro/messages.json +27 -2
- package/src/components/i18n/locales/ru/messages.json +26 -1
- package/src/components/i18n/locales/sd/messages.json +26 -1
- package/src/components/i18n/locales/si/messages.json +26 -1
- package/src/components/i18n/locales/sk/messages.json +28 -3
- package/src/components/i18n/locales/sl/messages.json +28 -3
- package/src/components/i18n/locales/sq/messages.json +27 -2
- package/src/components/i18n/locales/sr/messages.json +26 -1
- package/src/components/i18n/locales/sv/messages.json +28 -3
- package/src/components/i18n/locales/sw/messages.json +26 -1
- package/src/components/i18n/locales/ta/messages.json +26 -1
- package/src/components/i18n/locales/te/messages.json +26 -1
- package/src/components/i18n/locales/th/messages.json +26 -1
- package/src/components/i18n/locales/tr/messages.json +26 -1
- package/src/components/i18n/locales/ug/messages.json +26 -1
- package/src/components/i18n/locales/uk/messages.json +26 -1
- package/src/components/i18n/locales/ur/messages.json +26 -1
- package/src/components/i18n/locales/vi/messages.json +26 -1
- package/src/components/i18n/locales/yi/messages.json +26 -1
- package/src/components/i18n/locales/zh/messages.json +26 -1
- package/src/components/icons/index.ts +38 -0
- package/src/components/modules/ui.ts +0 -13
- package/src/stories/EditorModes.stories.ts +0 -60
- package/src/styles/main.css +39 -1
- package/src/tools/callout/emoji-picker/index.ts +3 -2
- package/src/tools/code/code-keyboard.ts +16 -9
- package/src/tools/code/constants.ts +26 -3
- package/src/tools/code/dom-builder.ts +40 -5
- package/src/tools/code/highlight-applier.ts +229 -0
- package/src/tools/code/index.ts +141 -1
- package/src/tools/code/mermaid-loader.ts +45 -0
- package/src/tools/code/shiki-loader.ts +135 -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 +194 -11
- package/src/tools/table/table-cell-blocks.ts +9 -6
- package/src/tools/table/table-cell-clipboard.ts +6 -1
- 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/data-attributes.d.ts +0 -1
- package/types/tools/code.d.ts +2 -0
- /package/dist/chunks/{am-CS-JjQ0N.mjs → am-rVzV1W41.mjs} +0 -0
- /package/dist/chunks/{ar-Dt4XzR5U.mjs → ar-C710lkoH.mjs} +0 -0
- /package/dist/chunks/{az-CaDTXby8.mjs → az-BOp1pgua.mjs} +0 -0
- /package/dist/chunks/{bg-D1pLog-R.mjs → bg-CL9p09ZD.mjs} +0 -0
- /package/dist/chunks/{bn-Db_ae60m.mjs → bn-CNmSeyAy.mjs} +0 -0
- /package/dist/chunks/{bs-DJTg1R9e.mjs → bs-BRzMGqzk.mjs} +0 -0
- /package/dist/chunks/{cs-_Gc21gSL.mjs → cs-BYPBLmnF.mjs} +0 -0
- /package/dist/chunks/{da-xDB8uhCd.mjs → da-CBC_LR1c.mjs} +0 -0
- /package/dist/chunks/{de-B6gVjh1Z.mjs → de-DxRFMoAj.mjs} +0 -0
- /package/dist/chunks/{el-ClbRSnOs.mjs → el-Bk6YbySf.mjs} +0 -0
- /package/dist/chunks/{es-CuY9rnLK.mjs → es-DpT3FCMR.mjs} +0 -0
- /package/dist/chunks/{et-BLu5lDVc.mjs → et-DE9Dr_g9.mjs} +0 -0
- /package/dist/chunks/{fa-P3gnrZH8.mjs → fa-Banj1QUE.mjs} +0 -0
- /package/dist/chunks/{fi-B8PVHLjq.mjs → fi-DfN3M5ER.mjs} +0 -0
- /package/dist/chunks/{fil-B9JII5iF.mjs → fil-DbCsRS1d.mjs} +0 -0
- /package/dist/chunks/{fr-BWLDZdcc.mjs → fr-D1clKhgt.mjs} +0 -0
- /package/dist/chunks/{gu-BH3R_s4c.mjs → gu-1CsZyRwT.mjs} +0 -0
- /package/dist/chunks/{he-CCmeCVR_.mjs → he-qQdnL6eK.mjs} +0 -0
- /package/dist/chunks/{hi-BBav00DN.mjs → hi-DxM0Nff1.mjs} +0 -0
- /package/dist/chunks/{hr-B5ZX0r9G.mjs → hr-Onldyi-u.mjs} +0 -0
- /package/dist/chunks/{hu-1jgDa3YU.mjs → hu-CAn3pBuY.mjs} +0 -0
- /package/dist/chunks/{hy-LX4Kp2PE.mjs → hy-D43q7NxE.mjs} +0 -0
- /package/dist/chunks/{i18next-KNC_XV5x.mjs → i18next-BBGW2sDE.mjs} +0 -0
- /package/dist/chunks/{id-CcG40D1H.mjs → id-Xrw5Dd0Y.mjs} +0 -0
- /package/dist/chunks/{it-Cb8_K72W.mjs → it-CA9ZDMSc.mjs} +0 -0
- /package/dist/chunks/{ja-ipCH91mv.mjs → ja-D0J6WRFh.mjs} +0 -0
- /package/dist/chunks/{ka-BRvREIgq.mjs → ka-BZL7xDuY.mjs} +0 -0
- /package/dist/chunks/{km-BJwVw7Fg.mjs → km-BimgQZVU.mjs} +0 -0
- /package/dist/chunks/{kn-BPgUazCC.mjs → kn-C2n2cPHK.mjs} +0 -0
- /package/dist/chunks/{ko-CQLzxe7k.mjs → ko-n4Cn93D3.mjs} +0 -0
- /package/dist/chunks/{ku-BHhHu8Iz.mjs → ku-BYZCgT44.mjs} +0 -0
- /package/dist/chunks/{lo-DsTgYblY.mjs → lo-DVXiAE4N.mjs} +0 -0
- /package/dist/chunks/{lt-CDzHJm71.mjs → lt-B9KlQFnY.mjs} +0 -0
- /package/dist/chunks/{lv-MLLIAnIX.mjs → lv-BINeOdyx.mjs} +0 -0
- /package/dist/chunks/{mdast-util-math-yS0EygZV.mjs → mdast-util-math-CHYUxOHk.mjs} +0 -0
- /package/dist/chunks/{mk-DQdmUquZ.mjs → mk-_-QrPrLN.mjs} +0 -0
- /package/dist/chunks/{ml-DqehZnra.mjs → ml-KvJSC1KT.mjs} +0 -0
- /package/dist/chunks/{mn-4cFkKFjW.mjs → mn-CjFjWnRG.mjs} +0 -0
- /package/dist/chunks/{mr-DWiztOP4.mjs → mr-DqAZ7FRX.mjs} +0 -0
- /package/dist/chunks/{ms-BSz-iSnc.mjs → ms-BZcV4UG_.mjs} +0 -0
- /package/dist/chunks/{my-DbtbM1MW.mjs → my-97SC9jYN.mjs} +0 -0
- /package/dist/chunks/{ne-CqALWw_f.mjs → ne-Bs-M2TyF.mjs} +0 -0
- /package/dist/chunks/{nl-D_ra6RvH.mjs → nl-2ZwQilo-.mjs} +0 -0
- /package/dist/chunks/{no-Cg_kz_jl.mjs → no-fOQTpFq1.mjs} +0 -0
- /package/dist/chunks/{notifier-BOwxj_Ok.mjs → notifier-B1zCi9G1.mjs} +0 -0
- /package/dist/chunks/{pa-NLAsNqwY.mjs → pa-DLOqkMi0.mjs} +0 -0
- /package/dist/chunks/{pl-NHKp4YDg.mjs → pl-FYs9QrXU.mjs} +0 -0
- /package/dist/chunks/{ps-D1zEqNeg.mjs → ps-CTXe6pSe.mjs} +0 -0
- /package/dist/chunks/{pt-DBtqbUEB.mjs → pt-B1X4x7d1.mjs} +0 -0
- /package/dist/chunks/{ro-lqr63ai5.mjs → ro-Bf7S2FaR.mjs} +0 -0
- /package/dist/chunks/{ru-BycNnDyN.mjs → ru-B8lqnu_j.mjs} +0 -0
- /package/dist/chunks/{sd-DpHpIN9Z.mjs → sd-CHRYJm2r.mjs} +0 -0
- /package/dist/chunks/{si-BwiwaC7N.mjs → si-CI0Hs6vH.mjs} +0 -0
- /package/dist/chunks/{sk-CqRHT2Gp.mjs → sk-Bdvq1Kb_.mjs} +0 -0
- /package/dist/chunks/{sl-DA348uQ_.mjs → sl-B_qiFTV5.mjs} +0 -0
- /package/dist/chunks/{sq-D7JNgve1.mjs → sq-E0j1hysP.mjs} +0 -0
- /package/dist/chunks/{sr-D8RK6Kwp.mjs → sr-VPpVNTZw.mjs} +0 -0
- /package/dist/chunks/{sv-dwgT67ZG.mjs → sv-gKmDSR3d.mjs} +0 -0
- /package/dist/chunks/{sw-ZRRJnkem.mjs → sw-zeFLiO23.mjs} +0 -0
- /package/dist/chunks/{ta-5x4L5Krl.mjs → ta-Ci-j89hR.mjs} +0 -0
- /package/dist/chunks/{te-BZpEimwA.mjs → te-qyMI0M7a.mjs} +0 -0
- /package/dist/chunks/{th-Bhr-33kv.mjs → th-DPxHtpdb.mjs} +0 -0
- /package/dist/chunks/{tr-6tSNKGNB.mjs → tr-CRV6GS-G.mjs} +0 -0
- /package/dist/chunks/{ug-_e-jvr2b.mjs → ug-DW0YFpo5.mjs} +0 -0
- /package/dist/chunks/{uk-DooSc2Ja.mjs → uk-ssteuphK.mjs} +0 -0
- /package/dist/chunks/{ur-rb-krkIO.mjs → ur-qhY3-jY7.mjs} +0 -0
- /package/dist/chunks/{vi-CQkLn2AQ.mjs → vi-CHriMMC8.mjs} +0 -0
- /package/dist/chunks/{zh-CXQ40Q2_.mjs → zh-BJktawVN.mjs} +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { twMerge } from '../../components/utils/tw';
|
|
2
2
|
|
|
3
3
|
import { CELL_BLOCKS_ATTR } from './table-cell-blocks';
|
|
4
|
+
import type { TableModel } from './table-model';
|
|
4
5
|
import type { LegacyCellContent } from './types';
|
|
5
6
|
|
|
6
7
|
export const ROW_ATTR = 'data-blok-table-row';
|
|
7
8
|
export const CELL_ATTR = 'data-blok-table-cell';
|
|
9
|
+
export const CELL_ROW_ATTR = 'data-blok-table-cell-row';
|
|
10
|
+
export const CELL_COL_ATTR = 'data-blok-table-cell-col';
|
|
8
11
|
|
|
9
12
|
export const BORDER_WIDTH = 1;
|
|
10
13
|
const BORDER_STYLE = `${BORDER_WIDTH}px solid var(--blok-table-border)`;
|
|
11
14
|
|
|
12
|
-
const ROW_CLASSES = [
|
|
13
|
-
'flex',
|
|
14
|
-
];
|
|
15
|
-
|
|
16
15
|
const CELL_CLASSES = [
|
|
17
16
|
'py-1',
|
|
18
17
|
'px-2',
|
|
@@ -39,6 +38,10 @@ interface TableGridOptions {
|
|
|
39
38
|
/**
|
|
40
39
|
* Manages the table grid DOM structure.
|
|
41
40
|
* Creates, deletes, moves, and queries rows, columns, and cells.
|
|
41
|
+
*
|
|
42
|
+
* Uses native HTML `<table>` elements with `<colgroup>/<col>` for widths,
|
|
43
|
+
* `<tbody>/<tr>/<td>` for rows/cells. This enables native colspan/rowspan
|
|
44
|
+
* rendering and accessible table navigation.
|
|
42
45
|
*/
|
|
43
46
|
export class TableGrid {
|
|
44
47
|
private readOnly: boolean;
|
|
@@ -48,19 +51,36 @@ export class TableGrid {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
|
-
* Create a grid element with specified rows and columns
|
|
54
|
+
* Create a grid element with specified rows and columns.
|
|
55
|
+
* Returns an HTML <table> with <colgroup> for widths and <tbody> for rows.
|
|
52
56
|
*/
|
|
53
|
-
public createGrid(rows: number, cols: number, colWidths?: number[]):
|
|
54
|
-
const table = document.createElement('
|
|
57
|
+
public createGrid(rows: number, cols: number, colWidths?: number[]): HTMLTableElement {
|
|
58
|
+
const table = document.createElement('table');
|
|
55
59
|
|
|
60
|
+
table.style.tableLayout = 'fixed';
|
|
61
|
+
table.style.width = '100%';
|
|
62
|
+
table.style.borderCollapse = 'separate';
|
|
63
|
+
table.style.borderSpacing = '0px';
|
|
56
64
|
table.style.borderTop = BORDER_STYLE;
|
|
57
65
|
table.style.borderLeft = BORDER_STYLE;
|
|
58
66
|
|
|
59
67
|
const widths = colWidths ?? equalWidths(cols);
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
// <colgroup> holds column widths
|
|
70
|
+
const colgroup = document.createElement('colgroup');
|
|
71
|
+
|
|
72
|
+
widths.forEach(w => {
|
|
73
|
+
colgroup.appendChild(this.createCol(w));
|
|
74
|
+
});
|
|
75
|
+
table.appendChild(colgroup);
|
|
76
|
+
|
|
77
|
+
// <tbody> holds rows
|
|
78
|
+
const tbody = document.createElement('tbody');
|
|
79
|
+
|
|
80
|
+
Array.from({ length: rows }).forEach((_, rowIndex) => {
|
|
81
|
+
tbody.appendChild(this.createRow(cols, rowIndex));
|
|
63
82
|
});
|
|
83
|
+
table.appendChild(tbody);
|
|
64
84
|
|
|
65
85
|
return table;
|
|
66
86
|
}
|
|
@@ -73,22 +93,80 @@ export class TableGrid {
|
|
|
73
93
|
// Content is populated by TableCellBlocks.initializeCells()
|
|
74
94
|
}
|
|
75
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Create a grid from a TableModel, rendering colspan/rowspan for merged cells.
|
|
98
|
+
* Covered (spanned) cells are omitted from the DOM; the origin cell gets
|
|
99
|
+
* the appropriate colSpan/rowSpan attributes.
|
|
100
|
+
*/
|
|
101
|
+
public createGridFromModel(model: TableModel): HTMLTableElement {
|
|
102
|
+
const table = document.createElement('table');
|
|
103
|
+
|
|
104
|
+
table.style.tableLayout = 'fixed';
|
|
105
|
+
table.style.width = '100%';
|
|
106
|
+
table.style.borderCollapse = 'separate';
|
|
107
|
+
table.style.borderSpacing = '0px';
|
|
108
|
+
table.style.borderTop = BORDER_STYLE;
|
|
109
|
+
table.style.borderLeft = BORDER_STYLE;
|
|
110
|
+
|
|
111
|
+
// <colgroup>
|
|
112
|
+
const colgroup = document.createElement('colgroup');
|
|
113
|
+
const widths = model.colWidths ?? equalWidths(model.cols);
|
|
114
|
+
|
|
115
|
+
widths.forEach(w => colgroup.appendChild(this.createCol(w)));
|
|
116
|
+
table.appendChild(colgroup);
|
|
117
|
+
|
|
118
|
+
// <tbody>
|
|
119
|
+
const tbody = document.createElement('tbody');
|
|
120
|
+
|
|
121
|
+
Array.from({ length: model.rows }).forEach((_, r) => {
|
|
122
|
+
const row = document.createElement('tr');
|
|
123
|
+
|
|
124
|
+
row.setAttribute(ROW_ATTR, '');
|
|
125
|
+
|
|
126
|
+
Array.from({ length: model.cols }).forEach((__, c) => {
|
|
127
|
+
if (model.isSpannedCell(r, c)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const cell = this.createCell(r, c) as HTMLTableCellElement;
|
|
132
|
+
const span = model.getCellSpan(r, c);
|
|
133
|
+
|
|
134
|
+
if (span.colspan > 1) {
|
|
135
|
+
cell.colSpan = span.colspan;
|
|
136
|
+
}
|
|
137
|
+
if (span.rowspan > 1) {
|
|
138
|
+
cell.rowSpan = span.rowspan;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
row.appendChild(cell);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
tbody.appendChild(row);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
table.appendChild(tbody);
|
|
148
|
+
|
|
149
|
+
return table;
|
|
150
|
+
}
|
|
151
|
+
|
|
76
152
|
/**
|
|
77
153
|
* Add a row. If index is provided, inserts before that row.
|
|
78
154
|
* Otherwise appends at the end.
|
|
79
155
|
*/
|
|
80
156
|
public addRow(table: HTMLElement, index?: number): HTMLElement {
|
|
81
157
|
const cols = this.getColumnCount(table);
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
const rows =
|
|
158
|
+
const row = this.createRow(cols);
|
|
159
|
+
const tbody = table.querySelector('tbody') ?? table;
|
|
160
|
+
const rows = tbody.querySelectorAll(`[${ROW_ATTR}]`);
|
|
85
161
|
|
|
86
162
|
if (index !== undefined && index < rows.length) {
|
|
87
|
-
|
|
163
|
+
tbody.insertBefore(row, rows[index]);
|
|
88
164
|
} else {
|
|
89
|
-
|
|
165
|
+
tbody.appendChild(row);
|
|
90
166
|
}
|
|
91
167
|
|
|
168
|
+
this.reindexCoordinates(table);
|
|
169
|
+
|
|
92
170
|
return row;
|
|
93
171
|
}
|
|
94
172
|
|
|
@@ -101,80 +179,67 @@ export class TableGrid {
|
|
|
101
179
|
if (index < rows.length) {
|
|
102
180
|
rows[index].remove();
|
|
103
181
|
}
|
|
182
|
+
|
|
183
|
+
this.reindexCoordinates(table);
|
|
104
184
|
}
|
|
105
185
|
|
|
106
186
|
/**
|
|
107
187
|
* Add a column. If index is provided, inserts before that column.
|
|
108
188
|
* Otherwise appends at the end.
|
|
109
189
|
*
|
|
110
|
-
* When colWidths (pixel widths) are provided, existing
|
|
111
|
-
* those widths and the new column is added in px mode.
|
|
112
|
-
* existing columns from shrinking when the table is in percent mode.
|
|
190
|
+
* When colWidths (pixel widths) are provided, existing <col> elements are set to
|
|
191
|
+
* those widths and the new column is added in px mode.
|
|
113
192
|
*/
|
|
114
193
|
public addColumn(table: HTMLElement, index?: number, colWidths?: number[], newColWidth?: number): boolean {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
194
|
+
const colgroup = table.querySelector('colgroup');
|
|
195
|
+
const cols = colgroup ? Array.from(colgroup.querySelectorAll('col')) : [];
|
|
196
|
+
const oldColCount = cols.length;
|
|
117
197
|
const hasValidColWidths = colWidths !== undefined && colWidths.length === oldColCount;
|
|
118
198
|
const usePx = hasValidColWidths || this.detectWidthUnit(table) === 'px';
|
|
119
199
|
|
|
120
|
-
if (hasValidColWidths) {
|
|
121
|
-
this.
|
|
200
|
+
if (hasValidColWidths && colgroup) {
|
|
201
|
+
this.applyWidthsToCols(colgroup, colWidths);
|
|
122
202
|
}
|
|
123
203
|
|
|
124
204
|
if (usePx) {
|
|
125
|
-
this.addColumnPx(
|
|
126
|
-
|
|
127
|
-
|
|
205
|
+
this.addColumnPx(table, oldColCount, index, newColWidth);
|
|
206
|
+
} else {
|
|
207
|
+
this.addColumnPercent(table, oldColCount, index);
|
|
128
208
|
}
|
|
129
209
|
|
|
130
|
-
this.
|
|
210
|
+
this.reindexCoordinates(table);
|
|
131
211
|
|
|
132
212
|
return true;
|
|
133
213
|
}
|
|
134
214
|
|
|
135
215
|
/**
|
|
136
|
-
*
|
|
216
|
+
* Apply pixel widths to existing <col> elements
|
|
137
217
|
*/
|
|
138
|
-
private
|
|
139
|
-
|
|
140
|
-
const cells = row.querySelectorAll(`[${CELL_ATTR}]`);
|
|
141
|
-
|
|
142
|
-
cells.forEach((node, i) => {
|
|
143
|
-
if (i < colWidths.length) {
|
|
144
|
-
const el = node as HTMLElement;
|
|
218
|
+
private applyWidthsToCols(colgroup: Element, colWidths: number[]): void {
|
|
219
|
+
const cols = Array.from(colgroup.querySelectorAll('col')) as HTMLElement[];
|
|
145
220
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
221
|
+
colWidths.forEach((w, i) => {
|
|
222
|
+
if (i < cols.length) {
|
|
223
|
+
cols[i].style.width = `${w}px`;
|
|
224
|
+
}
|
|
149
225
|
});
|
|
150
226
|
}
|
|
151
227
|
|
|
152
228
|
/**
|
|
153
229
|
* Add column in px mode: keep existing widths, add new column at given width or half the average
|
|
154
230
|
*/
|
|
155
|
-
private addColumnPx(
|
|
156
|
-
const computedWidth = newColWidth ?? this.
|
|
157
|
-
|
|
158
|
-
rows.forEach(row => {
|
|
159
|
-
const cells = row.querySelectorAll(`[${CELL_ATTR}]`);
|
|
160
|
-
const isAppend = index === undefined || index >= cells.length;
|
|
161
|
-
const cell = this.createCell(`${computedWidth}px`);
|
|
231
|
+
private addColumnPx(table: HTMLElement, oldColCount: number, index?: number, newColWidth?: number): void {
|
|
232
|
+
const computedWidth = newColWidth ?? this.computeHalfAvgWidth(table, oldColCount);
|
|
233
|
+
const widthStr = `${computedWidth}px`;
|
|
162
234
|
|
|
163
|
-
|
|
164
|
-
row.insertBefore(cell, cells[index]);
|
|
165
|
-
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
row.appendChild(cell);
|
|
170
|
-
});
|
|
235
|
+
this.insertColumn(table, index, widthStr);
|
|
171
236
|
}
|
|
172
237
|
|
|
173
|
-
private
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const totalWidth =
|
|
177
|
-
(sum,
|
|
238
|
+
private computeHalfAvgWidth(table: HTMLElement, oldColCount: number): number {
|
|
239
|
+
const colgroup = table.querySelector('colgroup');
|
|
240
|
+
const cols = colgroup ? Array.from(colgroup.querySelectorAll('col')) : [];
|
|
241
|
+
const totalWidth = cols.reduce(
|
|
242
|
+
(sum, col) => sum + (parseFloat((col as HTMLElement).style.width) || 0),
|
|
178
243
|
0
|
|
179
244
|
);
|
|
180
245
|
|
|
@@ -186,33 +251,62 @@ export class TableGrid {
|
|
|
186
251
|
/**
|
|
187
252
|
* Add column in % mode: shrink existing columns slightly and add new column at half the average width
|
|
188
253
|
*/
|
|
189
|
-
private addColumnPercent(
|
|
254
|
+
private addColumnPercent(table: HTMLElement, oldColCount: number, index?: number): void {
|
|
190
255
|
const halfColFraction = 0.5 / oldColCount;
|
|
191
256
|
const scaleFactor = 1 - halfColFraction;
|
|
192
257
|
|
|
193
|
-
|
|
194
|
-
|
|
258
|
+
// Shrink existing <col> widths
|
|
259
|
+
const colgroup = table.querySelector('colgroup');
|
|
260
|
+
const existingCols = colgroup ? Array.from(colgroup.querySelectorAll('col')) : [];
|
|
195
261
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
262
|
+
existingCols.forEach(col => {
|
|
263
|
+
const el = col as HTMLElement;
|
|
264
|
+
const oldWidth = parseFloat(el.style.width) || (100 / oldColCount);
|
|
265
|
+
const newWidth = Math.round(oldWidth * scaleFactor * 100) / 100;
|
|
200
266
|
|
|
201
|
-
|
|
202
|
-
|
|
267
|
+
el.style.width = `${newWidth}%`;
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
const newColWidth = Math.round((100 / oldColCount / 2) * 100) / 100;
|
|
271
|
+
|
|
272
|
+
this.insertColumn(table, index, `${newColWidth}%`);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Insert a <col> and a <td> per row at the given index
|
|
277
|
+
*/
|
|
278
|
+
private insertColumn(table: HTMLElement, index: number | undefined, widthStr: string): void {
|
|
279
|
+
// Insert <col>
|
|
280
|
+
const colgroup = table.querySelector('colgroup');
|
|
281
|
+
|
|
282
|
+
if (colgroup) {
|
|
283
|
+
const col = document.createElement('col');
|
|
284
|
+
|
|
285
|
+
col.style.width = widthStr;
|
|
286
|
+
|
|
287
|
+
const existingCols = colgroup.querySelectorAll('col');
|
|
288
|
+
const isAppend = index === undefined || index >= existingCols.length;
|
|
203
289
|
|
|
204
|
-
|
|
290
|
+
if (!isAppend) {
|
|
291
|
+
colgroup.insertBefore(col, existingCols[index]);
|
|
292
|
+
} else {
|
|
293
|
+
colgroup.appendChild(col);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Insert <td> in each row
|
|
298
|
+
const rows = table.querySelectorAll(`[${ROW_ATTR}]`);
|
|
299
|
+
|
|
300
|
+
rows.forEach(row => {
|
|
205
301
|
const cells = row.querySelectorAll(`[${CELL_ATTR}]`);
|
|
206
302
|
const isAppend = index === undefined || index >= cells.length;
|
|
207
|
-
const cell = this.createCell(
|
|
303
|
+
const cell = this.createCell();
|
|
208
304
|
|
|
209
305
|
if (!isAppend) {
|
|
210
306
|
row.insertBefore(cell, cells[index]);
|
|
211
|
-
|
|
212
|
-
|
|
307
|
+
} else {
|
|
308
|
+
row.appendChild(cell);
|
|
213
309
|
}
|
|
214
|
-
|
|
215
|
-
row.appendChild(cell);
|
|
216
310
|
});
|
|
217
311
|
}
|
|
218
312
|
|
|
@@ -220,6 +314,18 @@ export class TableGrid {
|
|
|
220
314
|
* Delete a column at index
|
|
221
315
|
*/
|
|
222
316
|
public deleteColumn(table: HTMLElement, index: number): void {
|
|
317
|
+
// Remove <col>
|
|
318
|
+
const colgroup = table.querySelector('colgroup');
|
|
319
|
+
|
|
320
|
+
if (colgroup) {
|
|
321
|
+
const cols = colgroup.querySelectorAll('col');
|
|
322
|
+
|
|
323
|
+
if (index < cols.length) {
|
|
324
|
+
cols[index].remove();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Remove <td> per row
|
|
223
329
|
const rows = table.querySelectorAll(`[${ROW_ATTR}]`);
|
|
224
330
|
|
|
225
331
|
rows.forEach(row => {
|
|
@@ -231,6 +337,8 @@ export class TableGrid {
|
|
|
231
337
|
|
|
232
338
|
cells[index].remove();
|
|
233
339
|
});
|
|
340
|
+
|
|
341
|
+
this.reindexCoordinates(table);
|
|
234
342
|
}
|
|
235
343
|
|
|
236
344
|
/**
|
|
@@ -242,7 +350,8 @@ export class TableGrid {
|
|
|
242
350
|
return;
|
|
243
351
|
}
|
|
244
352
|
|
|
245
|
-
const
|
|
353
|
+
const tbody = table.querySelector('tbody') ?? table;
|
|
354
|
+
const rows = Array.from(tbody.querySelectorAll(`[${ROW_ATTR}]`));
|
|
246
355
|
|
|
247
356
|
if (fromIndex >= rows.length || toIndex >= rows.length) {
|
|
248
357
|
return;
|
|
@@ -252,24 +361,29 @@ export class TableGrid {
|
|
|
252
361
|
|
|
253
362
|
row.remove();
|
|
254
363
|
|
|
255
|
-
const updatedRows = Array.from(
|
|
364
|
+
const updatedRows = Array.from(tbody.querySelectorAll(`[${ROW_ATTR}]`));
|
|
256
365
|
|
|
257
366
|
if (toIndex >= updatedRows.length) {
|
|
258
|
-
|
|
367
|
+
tbody.appendChild(row);
|
|
259
368
|
} else {
|
|
260
|
-
|
|
369
|
+
tbody.insertBefore(row, updatedRows[toIndex]);
|
|
261
370
|
}
|
|
371
|
+
|
|
372
|
+
this.reindexCoordinates(table);
|
|
262
373
|
}
|
|
263
374
|
|
|
264
375
|
/**
|
|
265
376
|
* Move a column from one index to another.
|
|
266
|
-
* Reorders cells across all rows.
|
|
377
|
+
* Reorders <col> elements and cells across all rows.
|
|
267
378
|
*/
|
|
268
379
|
public moveColumn(table: HTMLElement, fromIndex: number, toIndex: number): void {
|
|
269
380
|
if (fromIndex === toIndex) {
|
|
270
381
|
return;
|
|
271
382
|
}
|
|
272
383
|
|
|
384
|
+
this.reorderColElement(table, fromIndex, toIndex);
|
|
385
|
+
|
|
386
|
+
// Move cells in each row
|
|
273
387
|
const rows = table.querySelectorAll(`[${ROW_ATTR}]`);
|
|
274
388
|
|
|
275
389
|
rows.forEach(row => {
|
|
@@ -291,6 +405,26 @@ export class TableGrid {
|
|
|
291
405
|
row.insertBefore(cell, updatedCells[toIndex]);
|
|
292
406
|
}
|
|
293
407
|
});
|
|
408
|
+
|
|
409
|
+
this.reindexCoordinates(table);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Reindex coordinate attributes on all cells after structural changes.
|
|
414
|
+
* Sets data-blok-table-cell-row and data-blok-table-cell-col to match
|
|
415
|
+
* each cell's current physical position.
|
|
416
|
+
*/
|
|
417
|
+
public reindexCoordinates(table: HTMLElement): void {
|
|
418
|
+
const rows = table.querySelectorAll(`[${ROW_ATTR}]`);
|
|
419
|
+
|
|
420
|
+
rows.forEach((row, r) => {
|
|
421
|
+
const cells = row.querySelectorAll(`[${CELL_ATTR}]`);
|
|
422
|
+
|
|
423
|
+
cells.forEach((cell, c) => {
|
|
424
|
+
cell.setAttribute(CELL_ROW_ATTR, String(r));
|
|
425
|
+
cell.setAttribute(CELL_COL_ATTR, String(c));
|
|
426
|
+
});
|
|
427
|
+
});
|
|
294
428
|
}
|
|
295
429
|
|
|
296
430
|
/**
|
|
@@ -301,9 +435,16 @@ export class TableGrid {
|
|
|
301
435
|
}
|
|
302
436
|
|
|
303
437
|
/**
|
|
304
|
-
* Get number of columns (from
|
|
438
|
+
* Get number of columns (from colgroup)
|
|
305
439
|
*/
|
|
306
440
|
public getColumnCount(table: HTMLElement): number {
|
|
441
|
+
const colgroup = table.querySelector('colgroup');
|
|
442
|
+
|
|
443
|
+
if (colgroup) {
|
|
444
|
+
return colgroup.querySelectorAll('col').length;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Fallback: count cells in first row
|
|
307
448
|
const firstRow = table.querySelector(`[${ROW_ATTR}]`);
|
|
308
449
|
|
|
309
450
|
if (!firstRow) {
|
|
@@ -314,9 +455,21 @@ export class TableGrid {
|
|
|
314
455
|
}
|
|
315
456
|
|
|
316
457
|
/**
|
|
317
|
-
* Get a specific cell element
|
|
458
|
+
* Get a specific cell element.
|
|
459
|
+
* Tries coordinate-based lookup first (works with merged cells),
|
|
460
|
+
* then falls back to index-based lookup for backwards compatibility.
|
|
318
461
|
*/
|
|
319
462
|
public getCell(table: HTMLElement, row: number, col: number): HTMLElement | null {
|
|
463
|
+
// Try coordinate-based lookup first (works with merged cells)
|
|
464
|
+
const coordCell = table.querySelector<HTMLElement>(
|
|
465
|
+
`[${CELL_ROW_ATTR}="${row}"][${CELL_COL_ATTR}="${col}"]`
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
if (coordCell) {
|
|
469
|
+
return coordCell;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Fallback to index-based lookup (for backwards compatibility)
|
|
320
473
|
const rows = table.querySelectorAll(`[${ROW_ATTR}]`);
|
|
321
474
|
|
|
322
475
|
if (row >= rows.length) {
|
|
@@ -333,20 +486,20 @@ export class TableGrid {
|
|
|
333
486
|
}
|
|
334
487
|
|
|
335
488
|
/**
|
|
336
|
-
* Read column widths from
|
|
489
|
+
* Read column widths from <col> elements
|
|
337
490
|
*/
|
|
338
491
|
public getColWidths(table: HTMLElement): number[] {
|
|
339
|
-
const
|
|
492
|
+
const colgroup = table.querySelector('colgroup');
|
|
340
493
|
|
|
341
|
-
if (!
|
|
494
|
+
if (!colgroup) {
|
|
342
495
|
return [];
|
|
343
496
|
}
|
|
344
497
|
|
|
345
|
-
const
|
|
498
|
+
const cols = colgroup.querySelectorAll('col');
|
|
346
499
|
const widths: number[] = [];
|
|
347
500
|
|
|
348
|
-
|
|
349
|
-
const w = parseFloat((
|
|
501
|
+
cols.forEach(col => {
|
|
502
|
+
const w = parseFloat((col as HTMLElement).style.width);
|
|
350
503
|
|
|
351
504
|
widths.push(isNaN(w) ? 0 : w);
|
|
352
505
|
});
|
|
@@ -355,77 +508,132 @@ export class TableGrid {
|
|
|
355
508
|
}
|
|
356
509
|
|
|
357
510
|
/**
|
|
358
|
-
*
|
|
511
|
+
* Get the <colgroup> element from the table
|
|
512
|
+
*/
|
|
513
|
+
public getColgroup(table: HTMLElement): HTMLElement | null {
|
|
514
|
+
return table.querySelector('colgroup');
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Apply widths to <col> elements
|
|
519
|
+
*/
|
|
520
|
+
public applyColWidths(table: HTMLElement, widths: number[]): void {
|
|
521
|
+
const colgroup = table.querySelector('colgroup');
|
|
522
|
+
|
|
523
|
+
if (!colgroup) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
const cols = Array.from(colgroup.querySelectorAll('col')) as HTMLElement[];
|
|
528
|
+
|
|
529
|
+
widths.forEach((w, i) => {
|
|
530
|
+
if (i < cols.length) {
|
|
531
|
+
cols[i].style.width = `${w}px`;
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Reorder a <col> element within the <colgroup>
|
|
538
|
+
*/
|
|
539
|
+
private reorderColElement(table: HTMLElement, fromIndex: number, toIndex: number): void {
|
|
540
|
+
const colgroup = table.querySelector('colgroup');
|
|
541
|
+
|
|
542
|
+
if (!colgroup) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const cols = Array.from(colgroup.querySelectorAll('col'));
|
|
547
|
+
|
|
548
|
+
if (fromIndex >= cols.length || toIndex >= cols.length) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
const col = cols[fromIndex];
|
|
553
|
+
|
|
554
|
+
col.remove();
|
|
555
|
+
|
|
556
|
+
const updatedCols = Array.from(colgroup.querySelectorAll('col'));
|
|
557
|
+
|
|
558
|
+
if (toIndex >= updatedCols.length) {
|
|
559
|
+
colgroup.appendChild(col);
|
|
560
|
+
} else {
|
|
561
|
+
colgroup.insertBefore(col, updatedCols[toIndex]);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Detect whether columns use 'px' or '%' widths
|
|
359
567
|
*/
|
|
360
568
|
private detectWidthUnit(table: HTMLElement): string {
|
|
361
|
-
const
|
|
569
|
+
const colgroup = table.querySelector('colgroup');
|
|
362
570
|
|
|
363
|
-
if (!
|
|
571
|
+
if (!colgroup) {
|
|
364
572
|
return '%';
|
|
365
573
|
}
|
|
366
574
|
|
|
367
|
-
const
|
|
575
|
+
const firstCol: HTMLElement | null = colgroup.querySelector('col');
|
|
368
576
|
|
|
369
|
-
if (!
|
|
577
|
+
if (!firstCol) {
|
|
370
578
|
return '%';
|
|
371
579
|
}
|
|
372
580
|
|
|
373
|
-
return
|
|
581
|
+
return firstCol.style.width.endsWith('px') ? 'px' : '%';
|
|
374
582
|
}
|
|
375
583
|
|
|
376
584
|
/**
|
|
377
|
-
*
|
|
585
|
+
* Create a <col> element with a width
|
|
378
586
|
*/
|
|
379
|
-
private
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
if (!firstRow) {
|
|
383
|
-
return [];
|
|
384
|
-
}
|
|
587
|
+
private createCol(width: number | string): HTMLElement {
|
|
588
|
+
const col = document.createElement('col');
|
|
385
589
|
|
|
386
|
-
|
|
590
|
+
col.style.width = typeof width === 'string' ? width : `${width}%`;
|
|
387
591
|
|
|
388
|
-
return
|
|
592
|
+
return col;
|
|
389
593
|
}
|
|
390
594
|
|
|
391
595
|
/**
|
|
392
|
-
* Create a single row with N cells
|
|
596
|
+
* Create a single <tr> row with N cells
|
|
393
597
|
*/
|
|
394
|
-
private createRow(cols: number,
|
|
395
|
-
const row = document.createElement('
|
|
598
|
+
private createRow(cols: number, rowIndex?: number): HTMLElement {
|
|
599
|
+
const row = document.createElement('tr');
|
|
396
600
|
|
|
397
|
-
row.className = twMerge(ROW_CLASSES);
|
|
398
601
|
row.setAttribute(ROW_ATTR, '');
|
|
399
602
|
|
|
400
|
-
Array.from({ length: cols }).forEach((_,
|
|
401
|
-
row.appendChild(this.createCell(
|
|
603
|
+
Array.from({ length: cols }).forEach((_, colIndex) => {
|
|
604
|
+
row.appendChild(this.createCell(rowIndex, rowIndex !== undefined ? colIndex : undefined));
|
|
402
605
|
});
|
|
403
606
|
|
|
404
607
|
return row;
|
|
405
608
|
}
|
|
406
609
|
|
|
407
610
|
/**
|
|
408
|
-
* Create a single cell
|
|
611
|
+
* Create a single <td> cell.
|
|
612
|
+
* When rowIndex and colIndex are provided, sets coordinate data attributes.
|
|
409
613
|
*/
|
|
410
|
-
private createCell(
|
|
411
|
-
const cell = document.createElement('
|
|
614
|
+
private createCell(rowIndex?: number, colIndex?: number): HTMLElement {
|
|
615
|
+
const cell = document.createElement('td');
|
|
412
616
|
|
|
413
617
|
cell.className = twMerge(CELL_CLASSES);
|
|
414
618
|
cell.style.borderRight = BORDER_STYLE;
|
|
415
619
|
cell.style.borderBottom = BORDER_STYLE;
|
|
416
|
-
cell.style.flexShrink = '0';
|
|
417
620
|
cell.style.overflow = 'hidden';
|
|
418
621
|
cell.style.overflowWrap = 'break-word';
|
|
419
|
-
|
|
420
|
-
if (width !== undefined) {
|
|
421
|
-
cell.style.width = typeof width === 'string' ? width : `${width}%`;
|
|
422
|
-
}
|
|
622
|
+
cell.style.height = '0';
|
|
423
623
|
|
|
424
624
|
cell.setAttribute(CELL_ATTR, '');
|
|
425
625
|
|
|
626
|
+
if (rowIndex !== undefined && colIndex !== undefined) {
|
|
627
|
+
cell.setAttribute(CELL_ROW_ATTR, String(rowIndex));
|
|
628
|
+
cell.setAttribute(CELL_COL_ATTR, String(colIndex));
|
|
629
|
+
}
|
|
630
|
+
|
|
426
631
|
const blocksContainer = document.createElement('div');
|
|
427
632
|
|
|
428
633
|
blocksContainer.setAttribute(CELL_BLOCKS_ATTR, '');
|
|
634
|
+
blocksContainer.style.display = 'flex';
|
|
635
|
+
blocksContainer.style.flexDirection = 'column';
|
|
636
|
+
blocksContainer.style.minHeight = '100%';
|
|
429
637
|
cell.appendChild(blocksContainer);
|
|
430
638
|
|
|
431
639
|
return cell;
|