@jackuait/blok 0.13.2 → 0.14.0
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/dist/blok.cjs +1 -1
- package/dist/blok.iife.js +30 -30
- package/dist/blok.mjs +2 -2
- package/dist/chunks/blok-Da-GaWJ8.cjs +17 -0
- package/dist/chunks/{blok-Du6vYONn.mjs → blok-PpFnlqXZ.mjs} +2722 -2322
- package/dist/chunks/constants-C-OQpSwB.cjs +457 -0
- package/dist/chunks/{constants-DUuYY64n.mjs → constants-DdfiMdC1.mjs} +390 -299
- package/dist/chunks/{i18next-loader-GIrBCFrC.mjs → i18next-loader-BEWWek8j.mjs} +1 -1
- package/dist/chunks/{i18next-loader-DC1uN-wc.cjs → i18next-loader-BRLYf-CW.cjs} +1 -1
- package/dist/chunks/{lightweight-i18n-DF9Pupws.mjs → lightweight-i18n-GbzxWVgl.mjs} +9 -0
- package/dist/chunks/lightweight-i18n-lNYVKCfj.cjs +1 -0
- package/dist/chunks/messages-085GG-gT.cjs +1 -0
- package/dist/{messages-3j4yi-DF.mjs → chunks/messages-46QopBh4.mjs} +9 -0
- package/dist/chunks/messages-5kQujjf1.cjs +1 -0
- package/dist/chunks/{messages-CTWXEx_o.mjs → messages-6r3Lrqpf.mjs} +9 -0
- package/dist/chunks/messages-8vjbwhvK.cjs +1 -0
- package/dist/chunks/messages-ACbZDExx.cjs +1 -0
- package/dist/chunks/messages-B05XREvI.cjs +1 -0
- package/dist/chunks/{messages-CQg2_vmm.mjs → messages-B0y97-C9.mjs} +9 -0
- package/dist/chunks/{messages-ZHNvKiIX.mjs → messages-B26pkAIj.mjs} +9 -0
- package/dist/chunks/messages-B2J7kDKI.cjs +1 -0
- package/dist/chunks/messages-B3jMjjFG.cjs +1 -0
- package/dist/chunks/messages-B4_c-uS0.cjs +1 -0
- package/dist/chunks/messages-B6zoVYEd.cjs +1 -0
- package/dist/chunks/{messages-DI9Ifrgt.mjs → messages-B73uch0z.mjs} +9 -0
- package/dist/chunks/{messages-AgmrT2Id.mjs → messages-B74xK8Ux.mjs} +9 -0
- package/dist/chunks/messages-B7efcz_S2.cjs +1 -0
- package/dist/chunks/{messages-sqdfYuVj2.mjs → messages-B9u3UJRu2.mjs} +9 -0
- package/dist/chunks/messages-BB9huoLU.cjs +1 -0
- package/dist/{messages-Cx7sqvx02.mjs → chunks/messages-BEzCtzW3.mjs} +9 -0
- package/dist/chunks/messages-BGQdk2zV2.cjs +1 -0
- package/dist/chunks/messages-BGmUrVtN2.cjs +1 -0
- package/dist/chunks/messages-BH-3FR4b2.cjs +1 -0
- package/dist/chunks/{messages-BZ4d5yNH.mjs → messages-BHqAQF6C.mjs} +9 -0
- package/dist/{messages-DzkZ434Z.mjs → chunks/messages-BI_-Ub99.mjs} +9 -0
- package/dist/chunks/messages-BNa6_BYq2.cjs +1 -0
- package/dist/chunks/{messages-BvupGuDw2.mjs → messages-BOMNOs8T2.mjs} +9 -0
- package/dist/chunks/{messages-fSeXd6-z.mjs → messages-BPYPnKHy.mjs} +9 -0
- package/dist/{messages-B3PWaMcw.mjs → chunks/messages-BQmUOeft.mjs} +9 -0
- package/dist/chunks/messages-BRfutnCs.cjs +1 -0
- package/dist/chunks/messages-BT_0dgL1.cjs +1 -0
- package/dist/chunks/{messages-BWGqOZ9J.mjs → messages-BWSXW4jk.mjs} +9 -0
- package/dist/chunks/messages-BWpKvkND2.cjs +1 -0
- package/dist/chunks/messages-BY6gCAsA2.cjs +1 -0
- package/dist/{messages-BDwU9rYR2.mjs → chunks/messages-BbfZo0kw2.mjs} +9 -0
- package/dist/{messages-gQ5PFa2t2.mjs → chunks/messages-BfqzgRP72.mjs} +9 -0
- package/dist/chunks/messages-Bk2Xs7_v.cjs +1 -0
- package/dist/{messages-CmN2OfuB.mjs → chunks/messages-BmkavfpK.mjs} +9 -0
- package/dist/chunks/{messages-B1k4DgVe.mjs → messages-BmzMikmq.mjs} +9 -0
- package/dist/chunks/messages-BniEGAW32.cjs +1 -0
- package/dist/chunks/{messages-BP77P9ER.mjs → messages-BplwYBhA.mjs} +9 -0
- package/dist/chunks/{messages-B1xgsCNQ.cjs → messages-BqJ-xe8R.cjs} +1 -1
- package/dist/chunks/messages-Bry43U_U.cjs +1 -0
- package/dist/{messages-DFfhoDWZ2.mjs → chunks/messages-BuzGjYKw.mjs} +9 -0
- package/dist/chunks/messages-ByT63R7v2.cjs +1 -0
- package/dist/{messages-C_gdsU952.mjs → chunks/messages-C0S7KViA2.mjs} +9 -0
- package/dist/chunks/{messages-DzY53I67.mjs → messages-C0Tt7Odx.mjs} +9 -0
- package/dist/{messages-B8Tq9Txy.mjs → chunks/messages-C3A1iLjY.mjs} +9 -0
- package/dist/chunks/{messages-B6You-RA.mjs → messages-C3gh1rpr.mjs} +9 -0
- package/dist/chunks/{messages-CXxz5HYQ.mjs → messages-C7JE4SUS.mjs} +9 -0
- package/dist/chunks/messages-C9IWDnCh2.cjs +1 -0
- package/dist/chunks/messages-CBc3S61g2.cjs +1 -0
- package/dist/chunks/{messages-DefZ3ihx.mjs → messages-CHpkDOiI.mjs} +9 -0
- package/dist/{messages-BcD7xtJA.mjs → chunks/messages-CImQCp-z2.mjs} +9 -0
- package/dist/chunks/messages-CJ--z80t2.cjs +1 -0
- package/dist/chunks/messages-CNH8YFuv.cjs +1 -0
- package/dist/chunks/{messages-bjSJwsXK2.mjs → messages-CQ2KWTbV2.mjs} +9 -0
- package/dist/{messages-C8RMjnBe.mjs → chunks/messages-CWAukiLC.mjs} +9 -0
- package/dist/{messages-B3oFjWq3.mjs → chunks/messages-C_BUhMkZ.mjs} +9 -0
- package/dist/chunks/{messages-BvuEffoe.mjs → messages-CcBT1o1B.mjs} +9 -0
- package/dist/chunks/messages-CdqejEof.cjs +1 -0
- package/dist/chunks/messages-Chdejshy2.cjs +1 -0
- package/dist/{messages-D-rvoUSJ.mjs → chunks/messages-CijMg_B_.mjs} +9 -0
- package/dist/{messages-JKXCsFKZ.mjs → chunks/messages-Ciz80Z2u2.mjs} +9 -0
- package/dist/{messages-Dq2WEsEu.mjs → chunks/messages-CjuGKMoT.mjs} +9 -0
- package/dist/chunks/{messages-BxKobpJ22.mjs → messages-ClOfUECP2.mjs} +9 -0
- package/dist/chunks/messages-CrF-Q_ML.cjs +1 -0
- package/dist/chunks/messages-Cww_rBCM.cjs +1 -0
- package/dist/chunks/messages-CxPVYl2H2.cjs +1 -0
- package/dist/chunks/{messages-BA2sVGrR2.mjs → messages-Cyiqo_dk2.mjs} +9 -0
- package/dist/{messages-D788KtGe.mjs → chunks/messages-D-u_SWhb.mjs} +9 -0
- package/dist/chunks/messages-D0H-D5FQ2.cjs +1 -0
- package/dist/chunks/messages-D195RH3A.cjs +1 -0
- package/dist/chunks/{messages-Dd4nzvLj2.mjs → messages-D5-DG-_u2.mjs} +9 -0
- package/dist/chunks/messages-D6kDQgDP2.cjs +1 -0
- package/dist/{messages-CAGQtm7T.mjs → chunks/messages-D8-hiQgf.mjs} +9 -0
- package/dist/{messages-ftPYsH6d2.mjs → chunks/messages-D8nb9CKr2.mjs} +9 -0
- package/dist/{messages-DPqFBtJR.mjs → chunks/messages-DAd5yWtH2.mjs} +9 -0
- package/dist/chunks/messages-DAdsFLpE.cjs +1 -0
- package/dist/chunks/messages-DCUsbiUQ.cjs +1 -0
- package/dist/{messages-AycxTjmw.mjs → chunks/messages-DCVZaAT9.mjs} +9 -0
- package/dist/chunks/messages-DHXttezt2.cjs +1 -0
- package/dist/chunks/messages-DIgxCixa.cjs +1 -0
- package/dist/chunks/messages-DJ0Wr-Bt2.cjs +1 -0
- package/dist/chunks/messages-DJBdlmxR.cjs +1 -0
- package/dist/chunks/{messages-5AxgjKgf2.mjs → messages-DJm-uLwr2.mjs} +9 -0
- package/dist/chunks/{messages-BVarbXYD2.mjs → messages-DKF4qWhw2.mjs} +9 -0
- package/dist/chunks/messages-DLAWSVlE.cjs +1 -0
- package/dist/{messages-Bj03XD-02.mjs → chunks/messages-DLI8m6z_2.mjs} +9 -0
- package/dist/{messages-CTzO11jz.mjs → chunks/messages-DNiWBVQr.mjs} +9 -0
- package/dist/chunks/messages-DNsgR3ZH.cjs +1 -0
- package/dist/{messages-CgaGkQi32.mjs → chunks/messages-DPI5-TrO2.mjs} +9 -0
- package/dist/chunks/{messages-CyCl8la6.mjs → messages-DQ1z_srP.mjs} +9 -0
- package/dist/chunks/{messages-C4bHKGnB2.mjs → messages-DSxYO-_j2.mjs} +9 -0
- package/dist/chunks/messages-DTrrEqf02.cjs +1 -0
- package/dist/chunks/{messages-D7YPlNAK.mjs → messages-DYLfoakZ.mjs} +9 -0
- package/dist/chunks/messages-DZCWq8nI2.cjs +1 -0
- package/dist/{messages-PQVh93mt.mjs → chunks/messages-D_JT9POv.mjs} +9 -0
- package/dist/chunks/{messages-Uc3Uc2862.mjs → messages-DaTniq4w2.mjs} +9 -0
- package/dist/{messages-DiL61awK.mjs → chunks/messages-De2tXe0o.mjs} +9 -0
- package/dist/chunks/{messages-l5xHQb_m.mjs → messages-DiwyN3uU.mjs} +9 -0
- package/dist/chunks/messages-DkQGwmom.cjs +1 -0
- package/dist/chunks/{messages-B6t1xShv.mjs → messages-Dl-C7Pdf.mjs} +9 -0
- package/dist/chunks/{messages-bSVgJ1cu.mjs → messages-DlDyYt5x.mjs} +9 -0
- package/dist/chunks/messages-Dmhwr_Ow2.cjs +1 -0
- package/dist/chunks/messages-DrQQ1Hky.cjs +1 -0
- package/dist/chunks/messages-DtQ_pCWn.cjs +1 -0
- package/dist/{messages-uy3FE24_2.mjs → chunks/messages-Du-inLpi2.mjs} +9 -0
- package/dist/{messages-DqXJJPx9.mjs → chunks/messages-Duu9LiF32.mjs} +9 -0
- package/dist/chunks/messages-DxCc14pu2.cjs +1 -0
- package/dist/chunks/{messages-DNqFlfOd.mjs → messages-Dz3cVqxu.mjs} +9 -0
- package/dist/chunks/messages-EJkYSgsP.cjs +1 -0
- package/dist/chunks/messages-F3QeKduK.cjs +1 -0
- package/dist/chunks/messages-HfCZ1oPV.cjs +1 -0
- package/dist/chunks/{messages-BVZONUH9.mjs → messages-Ji3WDjrp.mjs} +9 -0
- package/dist/chunks/messages-MTnjMh07.cjs +1 -0
- package/dist/{messages-DL7JAwpC.mjs → chunks/messages-NU3n_1t9.mjs} +9 -0
- package/dist/chunks/messages-NpCBoXqi.cjs +1 -0
- package/dist/chunks/messages-PMZIH3mH.cjs +1 -0
- package/dist/{messages-7fwJIrld2.mjs → chunks/messages-TFu4tdzc2.mjs} +9 -0
- package/dist/{messages-BSHFypGE2.mjs → chunks/messages-Ti4ZdnqM2.mjs} +9 -0
- package/dist/chunks/messages-UOTfsDv3.cjs +1 -0
- package/dist/chunks/messages-WDBEGpNu.cjs +1 -0
- package/dist/chunks/messages-Zg6PFQ87.cjs +1 -0
- package/dist/chunks/messages-bdVhFVzt2.cjs +1 -0
- package/dist/chunks/messages-dnnjc_oR2.cjs +1 -0
- package/dist/{messages-BmWP4vpV2.mjs → chunks/messages-fI_5bRwV2.mjs} +9 -0
- package/dist/{messages-CIjSE2_O2.mjs → chunks/messages-g80Luov_2.mjs} +9 -0
- package/dist/chunks/messages-hlzAtKI5.cjs +1 -0
- package/dist/chunks/messages-kuh4lSUE2.cjs +1 -0
- package/dist/chunks/messages-m20Eebmt2.cjs +1 -0
- package/dist/chunks/messages-o1__8Rul.cjs +1 -0
- package/dist/chunks/messages-pBYvH88_.cjs +1 -0
- package/dist/chunks/{messages-CMRjQYxi2.mjs → messages-u1hpTCvK2.mjs} +9 -0
- package/dist/chunks/{messages-BoCUgrkI.mjs → messages-vq5ZvFTF.mjs} +9 -0
- package/dist/chunks/tools-DeTgjuIK.cjs +116 -0
- package/dist/chunks/{tools-Tt-NXbRZ.mjs → tools-omGeunql.mjs} +1818 -1686
- package/dist/full.cjs +1 -1
- package/dist/full.mjs +8 -8
- package/dist/locales.mjs +76 -67
- package/dist/{chunks/messages-DHdoaaFq2.mjs → messages-2hSOMnir2.mjs} +9 -0
- package/dist/{chunks/messages-DlcI-0Sy.mjs → messages-3VCxXECx.mjs} +9 -0
- package/dist/{messages-CxX23Jsk2.mjs → messages-8xGEIh_m2.mjs} +9 -0
- package/dist/{chunks/messages-DmErSGPk2.mjs → messages-B-QcHnuI2.mjs} +9 -0
- package/dist/{messages-BKCuCTFM.mjs → messages-B8zoeMf9.mjs} +9 -0
- package/dist/{chunks/messages-BmdkDNYv.mjs → messages-B9CF0GcE.mjs} +9 -0
- package/dist/{messages-1ufJbdRv2.mjs → messages-B9W0pRCr2.mjs} +9 -0
- package/dist/{messages-DQik3_xv2.mjs → messages-BFM2ljkf2.mjs} +9 -0
- package/dist/{chunks/messages-BNxTGhHu.mjs → messages-BLm4FSbz2.mjs} +9 -0
- package/dist/{chunks/messages-GHsufIGi2.mjs → messages-BLpeYPKv2.mjs} +9 -0
- package/dist/{messages-D_WzyzUt.mjs → messages-BM73sjxy.mjs} +9 -0
- package/dist/{messages-CX8egsiA2.mjs → messages-BOpqKi6Y2.mjs} +9 -0
- package/dist/{chunks/messages-eyGOcbhV.mjs → messages-BUGdUeTK.mjs} +9 -0
- package/dist/{chunks/messages-DhZwMl9x2.mjs → messages-BZm7MzSJ2.mjs} +9 -0
- package/dist/{messages-C31VIrlL.mjs → messages-BtBhP1sv.mjs} +9 -0
- package/dist/{messages-D1Fjr4OK2.mjs → messages-BthFu3bN2.mjs} +9 -0
- package/dist/{chunks/messages-COMdnGQV2.mjs → messages-BurjwjCQ2.mjs} +9 -0
- package/dist/{messages-DTkd9ND8.mjs → messages-ByIHkus-.mjs} +9 -0
- package/dist/{messages-C9GFRcVj.mjs → messages-ByVKFMH3.mjs} +9 -0
- package/dist/{chunks/messages-B5CFhyI8.mjs → messages-C6FDRqcf.mjs} +9 -0
- package/dist/{chunks/messages-OSIAf0Wk2.mjs → messages-C9dJ_N542.mjs} +9 -0
- package/dist/{messages-CRR1VRO6.mjs → messages-CCw8aJgW.mjs} +9 -0
- package/dist/{chunks/messages-AtUsRyWK2.mjs → messages-CO3NEwf22.mjs} +9 -0
- package/dist/{chunks/messages-CcboYTP8.mjs → messages-CPB2xkpC.mjs} +9 -0
- package/dist/{messages-CITYhXUz.mjs → messages-CPDsEORY.mjs} +9 -0
- package/dist/{chunks/messages-B2zrJyAc2.mjs → messages-CYyPOGy7.mjs} +9 -0
- package/dist/{chunks/messages-C03LZxma.mjs → messages-CZAODRjY.mjs} +9 -0
- package/dist/{messages-Duk7VVeY.mjs → messages-C_rns7Ku.mjs} +9 -0
- package/dist/{chunks/messages-CdWXgq_r.mjs → messages-CaUUIQvU.mjs} +9 -0
- package/dist/{messages-Cp0fjsey.mjs → messages-Cc-A7Vip.mjs} +9 -0
- package/dist/{chunks/messages-B7KbtBAE.mjs → messages-Ccf81JsG.mjs} +9 -0
- package/dist/{chunks/messages-rEsI_fAk.mjs → messages-CerTDuSC.mjs} +9 -0
- package/dist/{messages-BkTBwYet.mjs → messages-CgmDwRRE.mjs} +9 -0
- package/dist/{chunks/messages-DsyO86r3.mjs → messages-Cn3PWtLp.mjs} +9 -0
- package/dist/{chunks/messages-CWTFEPbA2.mjs → messages-Cu1rTEkB.mjs} +9 -0
- package/dist/{messages-oIa8wahx.mjs → messages-CxEHfUNH.mjs} +9 -0
- package/dist/{messages-C_mN4lx0.mjs → messages-D1B41i8X.mjs} +9 -0
- package/dist/{messages-NVepzgE3.mjs → messages-D6954zcl.mjs} +9 -0
- package/dist/{messages-C2TRJroV2.mjs → messages-DBwWssfL2.mjs} +9 -0
- package/dist/{messages-Cdgz3urh.mjs → messages-DFHRMYke.mjs} +9 -0
- package/dist/{messages-DXCyNanc2.mjs → messages-DJVrq0Xa2.mjs} +9 -0
- package/dist/{chunks/messages-OYoN_rp1.mjs → messages-DMJz28kt.mjs} +9 -0
- package/dist/{chunks/messages-B_U10evN2.mjs → messages-DOnOpXFJ2.mjs} +9 -0
- package/dist/{messages-5USazVPA2.mjs → messages-DR1Tf-Kj2.mjs} +9 -0
- package/dist/{chunks/messages-C4sIqArW2.mjs → messages-DSUXwuzH2.mjs} +9 -0
- package/dist/{chunks/messages-DGHTTk1S2.mjs → messages-DTNO7tw1.mjs} +9 -0
- package/dist/{messages-Ddz6eH0-2.mjs → messages-DWBtyom42.mjs} +9 -0
- package/dist/{messages-DKsyrVp5.mjs → messages-DZQALZIU.mjs} +9 -0
- package/dist/{chunks/messages-V8K7-1l2.mjs → messages-D_i86vbQ.mjs} +9 -0
- package/dist/{chunks/messages-BmiN0JGP2.mjs → messages-Da1VKvvf2.mjs} +9 -0
- package/dist/{messages-D5qgCWmB2.mjs → messages-Ddimgqvp2.mjs} +9 -0
- package/dist/{chunks/messages-MPF8o3EP.mjs → messages-DdmXBLUC.mjs} +9 -0
- package/dist/{messages-D4U4wkYM.mjs → messages-Devcsnrv.mjs} +9 -0
- package/dist/{chunks/messages-DiGsu5XN.mjs → messages-DhS-j4Hp.mjs} +9 -0
- package/dist/{messages-BGzpwNrz.mjs → messages-DrRVvVPI.mjs} +9 -0
- package/dist/{chunks/messages-Z9mDYT3w.mjs → messages-Ds4gQbVR2.mjs} +9 -0
- package/dist/{chunks/messages-vQ5kblO8.mjs → messages-DxkB7LL6.mjs} +9 -0
- package/dist/{chunks/messages-LTkIIrSe2.mjs → messages-GgHHrLBU2.mjs} +9 -0
- package/dist/{messages-CntTlSE22.mjs → messages-IycPaZe22.mjs} +9 -0
- package/dist/{messages-BtDz-sw92.mjs → messages-ST8f_nDx2.mjs} +9 -0
- package/dist/{messages-CgVEHCQ-.mjs → messages-SV8lf6F0.mjs} +9 -0
- package/dist/{messages-Bt4TLGth.mjs → messages-lVrQmsky.mjs} +9 -0
- package/dist/{messages-rpO1POP02.mjs → messages-lcoIGSX82.mjs} +9 -0
- package/dist/{chunks/messages-BuYnNUtU2.mjs → messages-mqRVfUUq.mjs} +9 -0
- package/dist/{chunks/messages-C24IC_eR.mjs → messages-qWFvoPY1.mjs} +9 -0
- package/dist/{messages-CacRpQpm.mjs → messages-yte1QPX5.mjs} +9 -0
- package/dist/{messages-DNlrcG5Z.mjs → messages-zyiti_A8.mjs} +9 -0
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/tools.cjs +1 -1
- package/dist/tools.mjs +3 -3
- package/package.json +1 -1
- package/src/components/blocks.ts +30 -7
- package/src/components/i18n/locales/am/messages.json +9 -0
- package/src/components/i18n/locales/ar/messages.json +9 -0
- package/src/components/i18n/locales/az/messages.json +9 -0
- package/src/components/i18n/locales/bg/messages.json +9 -0
- package/src/components/i18n/locales/bn/messages.json +9 -0
- package/src/components/i18n/locales/bs/messages.json +9 -0
- package/src/components/i18n/locales/cs/messages.json +9 -0
- package/src/components/i18n/locales/da/messages.json +9 -0
- package/src/components/i18n/locales/de/messages.json +9 -0
- package/src/components/i18n/locales/dv/messages.json +9 -0
- package/src/components/i18n/locales/el/messages.json +9 -0
- package/src/components/i18n/locales/en/messages.json +9 -0
- package/src/components/i18n/locales/es/messages.json +9 -0
- package/src/components/i18n/locales/et/messages.json +9 -0
- package/src/components/i18n/locales/fa/messages.json +9 -0
- package/src/components/i18n/locales/fi/messages.json +9 -0
- package/src/components/i18n/locales/fil/messages.json +9 -0
- package/src/components/i18n/locales/fr/messages.json +9 -0
- package/src/components/i18n/locales/gu/messages.json +9 -0
- package/src/components/i18n/locales/he/messages.json +9 -0
- package/src/components/i18n/locales/hi/messages.json +9 -0
- package/src/components/i18n/locales/hr/messages.json +9 -0
- package/src/components/i18n/locales/hu/messages.json +9 -0
- package/src/components/i18n/locales/hy/messages.json +9 -0
- package/src/components/i18n/locales/id/messages.json +9 -0
- package/src/components/i18n/locales/it/messages.json +9 -0
- package/src/components/i18n/locales/ja/messages.json +9 -0
- package/src/components/i18n/locales/ka/messages.json +9 -0
- package/src/components/i18n/locales/km/messages.json +9 -0
- package/src/components/i18n/locales/kn/messages.json +9 -0
- package/src/components/i18n/locales/ko/messages.json +9 -0
- package/src/components/i18n/locales/ku/messages.json +9 -0
- package/src/components/i18n/locales/lo/messages.json +9 -0
- package/src/components/i18n/locales/lt/messages.json +9 -0
- package/src/components/i18n/locales/lv/messages.json +9 -0
- package/src/components/i18n/locales/mk/messages.json +9 -0
- package/src/components/i18n/locales/ml/messages.json +9 -0
- package/src/components/i18n/locales/mn/messages.json +9 -0
- package/src/components/i18n/locales/mr/messages.json +9 -0
- package/src/components/i18n/locales/ms/messages.json +9 -0
- package/src/components/i18n/locales/my/messages.json +9 -0
- package/src/components/i18n/locales/ne/messages.json +9 -0
- package/src/components/i18n/locales/nl/messages.json +9 -0
- package/src/components/i18n/locales/no/messages.json +9 -0
- package/src/components/i18n/locales/pa/messages.json +9 -0
- package/src/components/i18n/locales/pl/messages.json +9 -0
- package/src/components/i18n/locales/ps/messages.json +9 -0
- package/src/components/i18n/locales/pt/messages.json +9 -0
- package/src/components/i18n/locales/ro/messages.json +9 -0
- package/src/components/i18n/locales/ru/messages.json +9 -0
- package/src/components/i18n/locales/sd/messages.json +9 -0
- package/src/components/i18n/locales/si/messages.json +9 -0
- package/src/components/i18n/locales/sk/messages.json +9 -0
- package/src/components/i18n/locales/sl/messages.json +9 -0
- package/src/components/i18n/locales/sq/messages.json +9 -0
- package/src/components/i18n/locales/sr/messages.json +9 -0
- package/src/components/i18n/locales/sv/messages.json +9 -0
- package/src/components/i18n/locales/sw/messages.json +9 -0
- package/src/components/i18n/locales/ta/messages.json +9 -0
- package/src/components/i18n/locales/te/messages.json +9 -0
- package/src/components/i18n/locales/th/messages.json +9 -0
- package/src/components/i18n/locales/tr/messages.json +9 -0
- package/src/components/i18n/locales/ug/messages.json +9 -0
- package/src/components/i18n/locales/uk/messages.json +9 -0
- package/src/components/i18n/locales/ur/messages.json +9 -0
- package/src/components/i18n/locales/vi/messages.json +9 -0
- package/src/components/i18n/locales/yi/messages.json +9 -0
- package/src/components/i18n/locales/zh/messages.json +9 -0
- package/src/components/icons/index.ts +24 -0
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +67 -6
- package/src/components/modules/blockManager/hierarchy.ts +150 -8
- package/src/components/modules/blockManager/operations.ts +207 -8
- package/src/components/modules/blockManager/yjs-sync.ts +36 -1
- package/src/components/modules/caret.ts +205 -31
- package/src/components/modules/drag/DragController.ts +219 -2
- package/src/components/modules/drag/a11y/DragA11y.ts +9 -1
- package/src/components/modules/drag/state/DragStateMachine.ts +1 -1
- package/src/components/modules/drag/target/DropTargetDetector.ts +513 -3
- package/src/components/modules/drag/utils/drag.constants.ts +9 -0
- package/src/components/modules/toolbar/blockSettings.ts +75 -5
- package/src/components/modules/toolbar/index.ts +12 -1
- package/src/components/modules/uiControllers/controllers/blockHover.ts +24 -2
- package/src/components/modules/uiControllers/controllers/selection.ts +50 -0
- package/src/components/utils/blocks.ts +21 -7
- package/src/styles/colors.css +3 -0
- package/src/styles/columns.css +105 -0
- package/src/styles/main.css +48 -3
- package/src/styles/popover-animation.css +8 -0
- package/src/tools/column/index.ts +189 -0
- package/src/tools/column/types.ts +26 -0
- package/src/tools/column-drop.ts +273 -0
- package/src/tools/column-list/index.ts +142 -0
- package/src/tools/column-list/types.ts +17 -0
- package/src/tools/columns-shared.ts +343 -0
- package/src/tools/divider/index.ts +1 -0
- package/src/tools/index.ts +4 -0
- package/src/tools/nested-blocks.ts +23 -2
- package/src/tools/table/table-restrictions.ts +1 -1
- package/types/tools/column-list.d.ts +15 -0
- package/types/tools/column.d.ts +13 -0
- package/types/tools-entry.d.ts +8 -0
- package/dist/chunks/blok-Xu27QC2G.cjs +0 -17
- package/dist/chunks/constants-DDTVRO2H.cjs +0 -457
- package/dist/chunks/lightweight-i18n-Bbl1cNYK.cjs +0 -1
- package/dist/chunks/messages-1qYt6EhZ2.cjs +0 -1
- package/dist/chunks/messages-2fxvN3Nb.cjs +0 -1
- package/dist/chunks/messages-B1Vs2HmR.cjs +0 -1
- package/dist/chunks/messages-B780gS332.cjs +0 -1
- package/dist/chunks/messages-B7T5Notn.cjs +0 -1
- package/dist/chunks/messages-BE9aZQ1Q.cjs +0 -1
- package/dist/chunks/messages-BIQpTYfm.cjs +0 -1
- package/dist/chunks/messages-BIRvUJ0t.cjs +0 -1
- package/dist/chunks/messages-BIodfkjv.cjs +0 -1
- package/dist/chunks/messages-BL-zBcuM.cjs +0 -1
- package/dist/chunks/messages-BQr0zpmu2.cjs +0 -1
- package/dist/chunks/messages-BTHi6rVW2.cjs +0 -1
- package/dist/chunks/messages-BZOAdcmO2.cjs +0 -1
- package/dist/chunks/messages-BbsGeVs_2.cjs +0 -1
- package/dist/chunks/messages-Bc1NYJVS.cjs +0 -1
- package/dist/chunks/messages-BdORNG8X.cjs +0 -1
- package/dist/chunks/messages-Bg2kheTv.cjs +0 -1
- package/dist/chunks/messages-Bj1eQtQw.cjs +0 -1
- package/dist/chunks/messages-BkJJCHNK.cjs +0 -1
- package/dist/chunks/messages-BkdGQfIX.cjs +0 -1
- package/dist/chunks/messages-BkgsB-cj2.cjs +0 -1
- package/dist/chunks/messages-Bn0vGFEP.cjs +0 -1
- package/dist/chunks/messages-BoIUXwWe.cjs +0 -1
- package/dist/chunks/messages-BpDEh8rW.cjs +0 -1
- package/dist/chunks/messages-BwknPZJ8.cjs +0 -1
- package/dist/chunks/messages-ByicRCge2.cjs +0 -1
- package/dist/chunks/messages-C2oBmyTn.cjs +0 -1
- package/dist/chunks/messages-C9wBMmxr2.cjs +0 -1
- package/dist/chunks/messages-CDK5-8vW.cjs +0 -1
- package/dist/chunks/messages-CKHbPcfh.cjs +0 -1
- package/dist/chunks/messages-CNFfwTfw.cjs +0 -1
- package/dist/chunks/messages-CNiuofck2.cjs +0 -1
- package/dist/chunks/messages-CWszAGkF.cjs +0 -1
- package/dist/chunks/messages-CWzQNagc2.cjs +0 -1
- package/dist/chunks/messages-CYf1gv722.cjs +0 -1
- package/dist/chunks/messages-CfcCwbQo.cjs +0 -1
- package/dist/chunks/messages-CkvqOnAR.cjs +0 -1
- package/dist/chunks/messages-Cnrug7nz2.cjs +0 -1
- package/dist/chunks/messages-Cr51zCHy.cjs +0 -1
- package/dist/chunks/messages-CsLvvl2F2.cjs +0 -1
- package/dist/chunks/messages-CuO-Rx4g.cjs +0 -1
- package/dist/chunks/messages-Cv4I3k1W2.cjs +0 -1
- package/dist/chunks/messages-CwHRv6g8.cjs +0 -1
- package/dist/chunks/messages-CzXnHfGb2.cjs +0 -1
- package/dist/chunks/messages-D2QxLx1a.cjs +0 -1
- package/dist/chunks/messages-D4LUPpX_.cjs +0 -1
- package/dist/chunks/messages-DJFL-bxd2.cjs +0 -1
- package/dist/chunks/messages-DLEeNpMi2.cjs +0 -1
- package/dist/chunks/messages-DTNU_cq0.cjs +0 -1
- package/dist/chunks/messages-DVKsYqpJ.cjs +0 -1
- package/dist/chunks/messages-DXlfz-nC.cjs +0 -1
- package/dist/chunks/messages-DbA_Zja3.cjs +0 -1
- package/dist/chunks/messages-Dc2TTEx_2.cjs +0 -1
- package/dist/chunks/messages-DeDMMmRC.cjs +0 -1
- package/dist/chunks/messages-DlQNXqzr.cjs +0 -1
- package/dist/chunks/messages-DqMqZLcn.cjs +0 -1
- package/dist/chunks/messages-DqqDuEE22.cjs +0 -1
- package/dist/chunks/messages-DzppdmWe.cjs +0 -1
- package/dist/chunks/messages-HzLF-BQL2.cjs +0 -1
- package/dist/chunks/messages-Jb9n97oP2.cjs +0 -1
- package/dist/chunks/messages-K_vSdSoF2.cjs +0 -1
- package/dist/chunks/messages-Nh7wrRdm.cjs +0 -1
- package/dist/chunks/messages-QHS-Ydg_.cjs +0 -1
- package/dist/chunks/messages-SpiG5vT-2.cjs +0 -1
- package/dist/chunks/messages-XFaJzdhP2.cjs +0 -1
- package/dist/chunks/messages-y03BGg692.cjs +0 -1
- package/dist/chunks/tools-DOuVjow8.cjs +0 -116
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import type { API } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const COLUMN_LIST_TOOL = 'column_list';
|
|
4
|
+
export const COLUMN_TOOL = 'column';
|
|
5
|
+
export const COLUMNS_ATTR = 'data-blok-columns';
|
|
6
|
+
export const COLUMN_ATTR = 'data-blok-column';
|
|
7
|
+
export const COLUMN_RESIZER_ATTR = 'data-blok-column-resizer';
|
|
8
|
+
/** Trigger attribute the CSS keyframes hook onto to play the new-column entry. */
|
|
9
|
+
export const COLUMN_ENTER_ATTR = 'data-blok-column-enter';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Play the one-shot "new column" entry animation on a freshly added column
|
|
13
|
+
* holder, à la Notion: the bar expands its flex-grow from 0 to its natural
|
|
14
|
+
* share while fading in, so neighbours reflow smoothly to make room. The
|
|
15
|
+
* trigger attribute is stripped once the animation ends, returning the column
|
|
16
|
+
* to its static state so the effect never replays on a later re-render.
|
|
17
|
+
*/
|
|
18
|
+
export const playColumnEnterAnimation = (holder: HTMLElement): void => {
|
|
19
|
+
holder.setAttribute(COLUMN_ENTER_ATTR, '');
|
|
20
|
+
holder.addEventListener(
|
|
21
|
+
'animationend',
|
|
22
|
+
() => holder.removeAttribute(COLUMN_ENTER_ATTR),
|
|
23
|
+
{ once: true }
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Smallest width (px) a column may be squeezed to while dragging a resizer.
|
|
29
|
+
* Zero means no min-width restriction — a column can be dragged all the way
|
|
30
|
+
* to collapse. The resize math still clamps to [0, pairWidth] so widths never
|
|
31
|
+
* go negative or overflow the pair.
|
|
32
|
+
*/
|
|
33
|
+
export const COLUMN_MIN_WIDTH = 0;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Redistribute the flex-grow of two adjacent columns as their shared separator
|
|
37
|
+
* is dragged by `delta` px. The pair's total grow is preserved so columns
|
|
38
|
+
* outside the pair keep their width; widths are clamped to `minWidth` so
|
|
39
|
+
* neither column collapses.
|
|
40
|
+
*
|
|
41
|
+
* Width-driven because the columns use `flex-basis: 0` — width is proportional
|
|
42
|
+
* to flex-grow, so the new grows are the pair's grow sum split by the new
|
|
43
|
+
* width fractions.
|
|
44
|
+
*/
|
|
45
|
+
export const resizeColumnGrow = (params: {
|
|
46
|
+
leftWidth: number;
|
|
47
|
+
rightWidth: number;
|
|
48
|
+
leftGrow: number;
|
|
49
|
+
rightGrow: number;
|
|
50
|
+
delta: number;
|
|
51
|
+
minWidth: number;
|
|
52
|
+
}): { leftGrow: number; rightGrow: number } => {
|
|
53
|
+
const pairWidth = params.leftWidth + params.rightWidth;
|
|
54
|
+
const growSum = params.leftGrow + params.rightGrow;
|
|
55
|
+
|
|
56
|
+
if (pairWidth <= 0 || growSum <= 0) {
|
|
57
|
+
return { leftGrow: params.leftGrow, rightGrow: params.rightGrow };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const leftWidth = Math.max(
|
|
61
|
+
params.minWidth,
|
|
62
|
+
Math.min(pairWidth - params.minWidth, params.leftWidth + params.delta)
|
|
63
|
+
);
|
|
64
|
+
const rightWidth = pairWidth - leftWidth;
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
leftGrow: (growSum * leftWidth) / pairWidth,
|
|
68
|
+
rightGrow: (growSum * rightWidth) / pairWidth,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Update the separator's slider value to the left column's width percentage. */
|
|
73
|
+
const updateResizerAria = (
|
|
74
|
+
resizer: HTMLElement,
|
|
75
|
+
leftHolder: HTMLElement,
|
|
76
|
+
rightHolder: HTMLElement
|
|
77
|
+
): void => {
|
|
78
|
+
const leftGrow = Number(leftHolder.style.flexGrow) || 1;
|
|
79
|
+
const rightGrow = Number(rightHolder.style.flexGrow) || 1;
|
|
80
|
+
const growSum = leftGrow + rightGrow;
|
|
81
|
+
const percent = growSum > 0 ? Math.round((leftGrow / growSum) * 100) : 50;
|
|
82
|
+
|
|
83
|
+
resizer.setAttribute('aria-valuenow', String(percent));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** Apply a px `delta` to the column pair and sync the separator's aria value. */
|
|
87
|
+
const applyResizeDelta = (
|
|
88
|
+
resizer: HTMLElement,
|
|
89
|
+
leftHolder: HTMLElement,
|
|
90
|
+
rightHolder: HTMLElement,
|
|
91
|
+
delta: number
|
|
92
|
+
): void => {
|
|
93
|
+
// Alias to locals so we set flex-grow without tripping no-param-reassign.
|
|
94
|
+
const leftEl = leftHolder;
|
|
95
|
+
const rightEl = rightHolder;
|
|
96
|
+
const next = resizeColumnGrow({
|
|
97
|
+
leftWidth: leftEl.getBoundingClientRect().width,
|
|
98
|
+
rightWidth: rightEl.getBoundingClientRect().width,
|
|
99
|
+
leftGrow: Number(leftEl.style.flexGrow) || 1,
|
|
100
|
+
rightGrow: Number(rightEl.style.flexGrow) || 1,
|
|
101
|
+
delta,
|
|
102
|
+
minWidth: COLUMN_MIN_WIDTH,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
leftEl.style.flexGrow = String(next.leftGrow);
|
|
106
|
+
rightEl.style.flexGrow = String(next.rightGrow);
|
|
107
|
+
updateResizerAria(resizer, leftEl, rightEl);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** Per-press keyboard resize step in px. */
|
|
111
|
+
const KEYBOARD_RESIZE_STEP = 16;
|
|
112
|
+
|
|
113
|
+
const onResizerKeydown = (
|
|
114
|
+
event: KeyboardEvent,
|
|
115
|
+
resizer: HTMLElement,
|
|
116
|
+
leftHolder: HTMLElement,
|
|
117
|
+
rightHolder: HTMLElement
|
|
118
|
+
): void => {
|
|
119
|
+
const pairWidth =
|
|
120
|
+
leftHolder.getBoundingClientRect().width + rightHolder.getBoundingClientRect().width;
|
|
121
|
+
|
|
122
|
+
const deltaByKey: Record<string, number> = {
|
|
123
|
+
ArrowLeft: -KEYBOARD_RESIZE_STEP,
|
|
124
|
+
ArrowRight: KEYBOARD_RESIZE_STEP,
|
|
125
|
+
Home: -pairWidth,
|
|
126
|
+
End: pairWidth,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const delta = deltaByKey[event.key];
|
|
130
|
+
|
|
131
|
+
if (delta === undefined) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
applyResizeDelta(resizer, leftHolder, rightHolder, delta);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Drag handler for a single separator: redistribute flex-grow between the two
|
|
141
|
+
* neighbouring column holders as the separator moves. Pointer capture keeps the
|
|
142
|
+
* move/up events flowing even when the cursor leaves the thin handle. The
|
|
143
|
+
* holder's flex-grow is the persisted source of truth (Column.save reads it
|
|
144
|
+
* back), so no api.blocks.update is needed.
|
|
145
|
+
*/
|
|
146
|
+
const startColumnResize = (
|
|
147
|
+
event: PointerEvent,
|
|
148
|
+
resizer: HTMLElement,
|
|
149
|
+
leftHolder: HTMLElement,
|
|
150
|
+
rightHolder: HTMLElement
|
|
151
|
+
): void => {
|
|
152
|
+
if (event.button !== 0) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
|
|
158
|
+
// Alias to locals so the move handler mutates flex-grow without tripping
|
|
159
|
+
// no-param-reassign on the parameters.
|
|
160
|
+
const leftEl = leftHolder;
|
|
161
|
+
const rightEl = rightHolder;
|
|
162
|
+
const startX = event.clientX;
|
|
163
|
+
const leftWidth = leftEl.getBoundingClientRect().width;
|
|
164
|
+
const rightWidth = rightEl.getBoundingClientRect().width;
|
|
165
|
+
const leftGrow = Number(leftEl.style.flexGrow) || 1;
|
|
166
|
+
const rightGrow = Number(rightEl.style.flexGrow) || 1;
|
|
167
|
+
|
|
168
|
+
resizer.setPointerCapture(event.pointerId);
|
|
169
|
+
resizer.setAttribute('data-dragging', '');
|
|
170
|
+
|
|
171
|
+
const onMove = (moveEvent: PointerEvent): void => {
|
|
172
|
+
const next = resizeColumnGrow({
|
|
173
|
+
leftWidth,
|
|
174
|
+
rightWidth,
|
|
175
|
+
leftGrow,
|
|
176
|
+
rightGrow,
|
|
177
|
+
delta: moveEvent.clientX - startX,
|
|
178
|
+
minWidth: COLUMN_MIN_WIDTH,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
leftEl.style.flexGrow = String(next.leftGrow);
|
|
182
|
+
rightEl.style.flexGrow = String(next.rightGrow);
|
|
183
|
+
updateResizerAria(resizer, leftEl, rightEl);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const onUp = (upEvent: PointerEvent): void => {
|
|
187
|
+
resizer.releasePointerCapture(upEvent.pointerId);
|
|
188
|
+
resizer.removeAttribute('data-dragging');
|
|
189
|
+
resizer.removeEventListener('pointermove', onMove);
|
|
190
|
+
resizer.removeEventListener('pointerup', onUp);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
resizer.addEventListener('pointermove', onMove);
|
|
194
|
+
resizer.addEventListener('pointerup', onUp);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const createColumnResizer = (
|
|
198
|
+
leftHolder: HTMLElement,
|
|
199
|
+
rightHolder: HTMLElement,
|
|
200
|
+
api: API,
|
|
201
|
+
columnListId: string
|
|
202
|
+
): HTMLElement => {
|
|
203
|
+
const resizer = document.createElement('div');
|
|
204
|
+
|
|
205
|
+
resizer.setAttribute(COLUMN_RESIZER_ATTR, '');
|
|
206
|
+
resizer.setAttribute('data-blok-testid', 'column-resizer');
|
|
207
|
+
resizer.setAttribute('role', 'separator');
|
|
208
|
+
resizer.setAttribute('aria-orientation', 'vertical');
|
|
209
|
+
resizer.setAttribute('tabindex', '0');
|
|
210
|
+
resizer.setAttribute('aria-label', api.i18n.t('tools.columns.resizeAriaLabel'));
|
|
211
|
+
resizer.setAttribute('aria-valuemin', '0');
|
|
212
|
+
resizer.setAttribute('aria-valuemax', '100');
|
|
213
|
+
updateResizerAria(resizer, leftHolder, rightHolder);
|
|
214
|
+
|
|
215
|
+
resizer.addEventListener('pointerdown', event => {
|
|
216
|
+
startColumnResize(event, resizer, leftHolder, rightHolder);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Double-click equalizes every column in the list, à la Notion.
|
|
220
|
+
resizer.addEventListener('dblclick', () => {
|
|
221
|
+
resetColumnsToEvenWidth(api, columnListId);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
resizer.addEventListener('keydown', event => {
|
|
225
|
+
onResizerKeydown(event, resizer, leftHolder, rightHolder);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
return resizer;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* (Re)build the drag-to-resize separators inside a column_list `container`:
|
|
233
|
+
* one between each adjacent pair of column `holders`. Existing separators are
|
|
234
|
+
* cleared first so repeated calls never stack duplicates. No-op in read-only
|
|
235
|
+
* mode — columns are not resizable there.
|
|
236
|
+
*
|
|
237
|
+
* Shared so BOTH the ColumnList tool (on render/seed) and the drag-beside
|
|
238
|
+
* "add a column" path can rebuild handles. The latter mutates an
|
|
239
|
+
* already-rendered list whose rendered() hook never fires again, so it must
|
|
240
|
+
* rebuild the separators itself rather than rely on a re-render.
|
|
241
|
+
*/
|
|
242
|
+
export const buildColumnResizers = (
|
|
243
|
+
container: HTMLElement,
|
|
244
|
+
holders: HTMLElement[],
|
|
245
|
+
readOnly: boolean,
|
|
246
|
+
api: API,
|
|
247
|
+
columnListId: string
|
|
248
|
+
): void => {
|
|
249
|
+
if (readOnly) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
container
|
|
254
|
+
.querySelectorAll(`[${COLUMN_RESIZER_ATTR}]`)
|
|
255
|
+
.forEach(resizer => resizer.remove());
|
|
256
|
+
|
|
257
|
+
holders.slice(1).forEach((rightHolder, index) => {
|
|
258
|
+
const leftHolder = holders[index];
|
|
259
|
+
const resizer = createColumnResizer(leftHolder, rightHolder, api, columnListId);
|
|
260
|
+
|
|
261
|
+
container.insertBefore(resizer, rightHolder);
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Re-split a column_list evenly: reset every child column's holder flex-grow
|
|
267
|
+
* to 1. Called only when a column is added, so the row re-balances; resize is
|
|
268
|
+
* the only OTHER place widths change. The holder's flex-grow is the persisted
|
|
269
|
+
* source of truth (Column.save reads it back), so setting it to 1 both resizes
|
|
270
|
+
* live and drops any stored widthRatio on the next save.
|
|
271
|
+
*/
|
|
272
|
+
export const resetColumnsToEvenWidth = (api: API, columnListId: string): void => {
|
|
273
|
+
for (const column of api.blocks.getChildren(columnListId)) {
|
|
274
|
+
column.holder.style.flexGrow = '1';
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Delete a block by id. `api.blocks.delete` is index-based and async, and any
|
|
280
|
+
* preceding delete shifts the flat array, so the id is re-resolved to its
|
|
281
|
+
* CURRENT index immediately before the call. Resolving by id (never a stale
|
|
282
|
+
* captured index) is what prevents the unwrap from deleting an innocent
|
|
283
|
+
* sibling that has slid into the doomed block's old slot.
|
|
284
|
+
*/
|
|
285
|
+
const deleteById = async (api: API, blockId: string): Promise<void> => {
|
|
286
|
+
const index = api.blocks.getBlockIndex(blockId);
|
|
287
|
+
|
|
288
|
+
if (index !== undefined) {
|
|
289
|
+
await api.blocks.delete(index);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* If a column_list has collapsed to a single column, dissolve it: promote the
|
|
295
|
+
* surviving column's child blocks into the column_list's OWN parent, then
|
|
296
|
+
* delete both the surviving column and the column_list.
|
|
297
|
+
*
|
|
298
|
+
* The promotion target is the column_list's enclosing parent, NOT a hardcoded
|
|
299
|
+
* root: a top-level list promotes its survivors to root (null), but a NESTED
|
|
300
|
+
* list (one living inside an outer column) promotes them into that enclosing
|
|
301
|
+
* column so they stay visually inside the outer layout instead of escaping to
|
|
302
|
+
* the document root.
|
|
303
|
+
*
|
|
304
|
+
* Deletes are resolved by id (see {@link deleteById}) so a shifted flat array
|
|
305
|
+
* never targets the wrong block.
|
|
306
|
+
*
|
|
307
|
+
* Returns true when an unwrap occurred.
|
|
308
|
+
*/
|
|
309
|
+
export const unwrapColumnListIfCollapsed = async (
|
|
310
|
+
api: API,
|
|
311
|
+
columnListId: string,
|
|
312
|
+
excludeId?: string
|
|
313
|
+
): Promise<boolean> => {
|
|
314
|
+
const allColumns = api.blocks.getChildren(columnListId);
|
|
315
|
+
const columns = excludeId !== undefined
|
|
316
|
+
? allColumns.filter(c => c.id !== excludeId)
|
|
317
|
+
: allColumns;
|
|
318
|
+
|
|
319
|
+
if (columns.length !== 1) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// The column_list's own parent is where survivors belong: root (null) for a
|
|
324
|
+
// top-level list, or the enclosing column for a nested one.
|
|
325
|
+
const enclosingParentId = api.blocks.getById(columnListId)?.parentId ?? null;
|
|
326
|
+
|
|
327
|
+
const [survivingColumn] = columns;
|
|
328
|
+
const survivingBlocks = api.blocks.getChildren(survivingColumn.id);
|
|
329
|
+
|
|
330
|
+
for (const child of survivingBlocks) {
|
|
331
|
+
api.blocks.setBlockParent(child.id, enclosingParentId);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Detach the surviving column to root before deleting it: its children are
|
|
335
|
+
// already promoted, so deleting it drops nothing, and a null parentId means
|
|
336
|
+
// its removed() hook skips the recursive unwrap call.
|
|
337
|
+
api.blocks.setBlockParent(survivingColumn.id, null);
|
|
338
|
+
|
|
339
|
+
await deleteById(api, survivingColumn.id);
|
|
340
|
+
await deleteById(api, columnListId);
|
|
341
|
+
|
|
342
|
+
return true;
|
|
343
|
+
};
|
|
@@ -37,6 +37,7 @@ export class DividerTool implements BlockTool {
|
|
|
37
37
|
|
|
38
38
|
const hr = document.createElement('hr');
|
|
39
39
|
|
|
40
|
+
hr.setAttribute('data-blok-divider', '');
|
|
40
41
|
hr.className = twMerge('border-t', 'border-border-primary', 'border-b-0', 'border-l-0', 'border-r-0');
|
|
41
42
|
wrapper.appendChild(hr);
|
|
42
43
|
this.element = wrapper;
|
package/src/tools/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export { DividerTool as Divider } from './divider';
|
|
|
32
32
|
export { Quote } from './quote';
|
|
33
33
|
export { CodeTool as Code } from './code';
|
|
34
34
|
export { ImageTool as Image } from './image';
|
|
35
|
+
export { ColumnList } from './column-list';
|
|
36
|
+
export { Column } from './column';
|
|
35
37
|
|
|
36
38
|
// Inline tools
|
|
37
39
|
export { BoldInlineTool as Bold } from '../components/inline-tools/inline-tool-bold';
|
|
@@ -58,6 +60,8 @@ export const defaultBlockTools = {
|
|
|
58
60
|
quote: {},
|
|
59
61
|
code: { inlineToolbar: false },
|
|
60
62
|
image: {},
|
|
63
|
+
column_list: {},
|
|
64
|
+
column: {},
|
|
61
65
|
} as const;
|
|
62
66
|
|
|
63
67
|
export const defaultInlineTools = {
|
|
@@ -4,7 +4,7 @@ import { DATA_ATTR } from '../components/constants/data-attributes';
|
|
|
4
4
|
* Mount child block holders into a container, skipping children that are
|
|
5
5
|
* already in place or claimed by another nested-blocks container.
|
|
6
6
|
*
|
|
7
|
-
* Used by toggle, header, and callout tools to reconcile child holders
|
|
7
|
+
* Used by toggle, header, column, and callout tools to reconcile child holders
|
|
8
8
|
* during the `rendered()` lifecycle hook.
|
|
9
9
|
*/
|
|
10
10
|
export const mountChildBlocks = (
|
|
@@ -16,7 +16,28 @@ export const mountChildBlocks = (
|
|
|
16
16
|
continue;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const nested = child.holder.closest(`[${DATA_ATTR.nestedBlocks}]`);
|
|
20
|
+
|
|
21
|
+
// Claim a holder stranded in the column_list ROW. A drag reparent into a
|
|
22
|
+
// column drops the moved holder directly into the [data-blok-columns] row
|
|
23
|
+
// (itself a nested-blocks container that wraps each column's own container).
|
|
24
|
+
// Left there it renders as a rogue new column, so pull it down into THIS
|
|
25
|
+
// column container where it belongs. Scoped to the column_list row
|
|
26
|
+
// specifically — claiming from arbitrary ancestor containers would let one
|
|
27
|
+
// table cell steal a paragraph transiently parked in an outer container.
|
|
28
|
+
if (
|
|
29
|
+
nested !== null &&
|
|
30
|
+
nested !== container &&
|
|
31
|
+
nested.hasAttribute('data-blok-columns') &&
|
|
32
|
+
nested.contains(container)
|
|
33
|
+
) {
|
|
34
|
+
container.appendChild(child.holder);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Otherwise leave holders that already live inside another nested container
|
|
39
|
+
// (a sibling, or a deeper nesting within this one) where they are.
|
|
40
|
+
if (nested !== null) {
|
|
20
41
|
continue;
|
|
21
42
|
}
|
|
22
43
|
|
|
@@ -5,7 +5,7 @@ import type { Block } from '../../components/block';
|
|
|
5
5
|
* Default block tools that are always restricted from being inserted into table cells.
|
|
6
6
|
* These tools create semantic or structural issues when nested in table cells.
|
|
7
7
|
*/
|
|
8
|
-
const DEFAULT_RESTRICTED_TOOLS = ['header', 'table'];
|
|
8
|
+
const DEFAULT_RESTRICTED_TOOLS = ['header', 'table', 'column_list'];
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Additional restricted tools registered via table tool config.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BlockTool, BlockToolConstructable, BlockToolConstructorOptions, BlockToolData } from './block-tool';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ColumnList Tool's input and output data format.
|
|
5
|
+
* The structure (which columns it holds) lives in the block's contentIds;
|
|
6
|
+
* `columnCount` is a transient seed used only by toolbox presets and is
|
|
7
|
+
* never persisted.
|
|
8
|
+
*/
|
|
9
|
+
export interface ColumnListData extends BlockToolData {
|
|
10
|
+
columnCount?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ColumnListConstructable extends BlockToolConstructable {
|
|
14
|
+
new(options: BlockToolConstructorOptions<ColumnListData>): BlockTool;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BlockTool, BlockToolConstructable, BlockToolConstructorOptions, BlockToolData } from './block-tool';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Column Tool's input and output data format.
|
|
5
|
+
* `widthRatio` is applied as flex-grow; omitted means equal width.
|
|
6
|
+
*/
|
|
7
|
+
export interface ColumnData extends BlockToolData {
|
|
8
|
+
widthRatio?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ColumnConstructable extends BlockToolConstructable {
|
|
12
|
+
new(options: BlockToolConstructorOptions<ColumnData>): BlockTool;
|
|
13
|
+
}
|
package/types/tools-entry.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { ToggleConstructable, ToggleData, ToggleConfig } from './tools/toggle';
|
|
|
11
11
|
import { DividerConstructable, DividerData } from './tools/divider';
|
|
12
12
|
import { CalloutConstructable, CalloutData, CalloutConfig } from './tools/callout';
|
|
13
13
|
import { QuoteConstructable, QuoteData } from './tools/quote';
|
|
14
|
+
import { ColumnListConstructable, ColumnListData } from './tools/column-list';
|
|
15
|
+
import { ColumnConstructable, ColumnData } from './tools/column';
|
|
14
16
|
import { BlockToolConstructable } from './tools/block-tool';
|
|
15
17
|
import { DatabaseData, DatabaseConfig, DatabaseAdapter, DatabaseViewConfig, DatabaseRowData } from './tools/database';
|
|
16
18
|
import { ImageData, ImageConfig, ImageUploader, ImageAlignment, ImageSize, ImageFrame, ImageCrop, ImageCropShape } from './tools/image';
|
|
@@ -30,6 +32,8 @@ export const Database: BlockToolConstructable;
|
|
|
30
32
|
export const DatabaseRow: BlockToolConstructable; // DatabaseRowTool (block tool), distinct from DatabaseRow interface in types/tools/database.d.ts
|
|
31
33
|
export const Image: BlockToolConstructable;
|
|
32
34
|
export const Code: BlockToolConstructable;
|
|
35
|
+
export const ColumnList: ColumnListConstructable;
|
|
36
|
+
export const Column: ColumnConstructable;
|
|
33
37
|
|
|
34
38
|
// Re-export data and config types for convenience
|
|
35
39
|
export { HeaderData, HeaderConfig } from './tools/header';
|
|
@@ -42,6 +46,8 @@ export { CalloutData, CalloutConfig } from './tools/callout';
|
|
|
42
46
|
export { QuoteData } from './tools/quote';
|
|
43
47
|
export { DatabaseData, DatabaseConfig, DatabaseAdapter, DatabaseViewConfig, DatabaseRowData } from './tools/database';
|
|
44
48
|
export { ImageData, ImageConfig, ImageUploader, ImageAlignment, ImageSize, ImageFrame, ImageCrop, ImageCropShape } from './tools/image';
|
|
49
|
+
export { ColumnListData } from './tools/column-list';
|
|
50
|
+
export { ColumnData } from './tools/column';
|
|
45
51
|
|
|
46
52
|
// Inline tools
|
|
47
53
|
export const Bold: InlineToolConstructable;
|
|
@@ -69,6 +75,8 @@ export const defaultBlockTools: {
|
|
|
69
75
|
readonly quote: {};
|
|
70
76
|
readonly code: { readonly inlineToolbar: false };
|
|
71
77
|
readonly image: {};
|
|
78
|
+
readonly column_list: {};
|
|
79
|
+
readonly column: {};
|
|
72
80
|
};
|
|
73
81
|
|
|
74
82
|
/**
|