@jackuait/blok 0.8.2 → 0.8.3-beta.2
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.mjs +2 -2
- package/dist/chunks/am-CHDDMHkd.mjs +16490 -0
- package/dist/chunks/ar-DoqfNqut.mjs +19245 -0
- package/dist/chunks/az-C34P9iEa.mjs +14694 -0
- package/dist/chunks/bg-jroXLY8Y.mjs +15432 -0
- package/dist/chunks/{blok-GAbVCHTV.mjs → blok-0-8moMz9.mjs} +2090 -2052
- package/dist/chunks/bn-BRI-WqxY.mjs +16150 -0
- package/dist/chunks/bs-CCGUpNHu.mjs +12536 -0
- package/dist/chunks/{constants-CyDHDZyH.mjs → constants-PWnlOOrQ.mjs} +211 -172
- package/dist/chunks/cs-D5qZOGuc.mjs +22809 -0
- package/dist/chunks/da-DrJ7W37K.mjs +14573 -0
- package/dist/chunks/de-BW6-kp2c.mjs +16366 -0
- package/dist/chunks/el-C-Vc_Otu.mjs +16339 -0
- package/dist/chunks/es-B6fI5K9i.mjs +13597 -0
- package/dist/chunks/et-BhVlZ-Yz.mjs +14747 -0
- package/dist/chunks/fa-D55Ijdqa.mjs +16368 -0
- package/dist/chunks/fi-jNLjhKUQ.mjs +14408 -0
- package/dist/chunks/fil-DYd0T5aX.mjs +15915 -0
- package/dist/chunks/fr-yxy5xWw_.mjs +17010 -0
- package/dist/chunks/gu-CcY_LJe7.mjs +19021 -0
- package/dist/chunks/he-DL9s7wNw.mjs +15047 -0
- package/dist/chunks/hi-C8eGXgw5.mjs +15946 -0
- package/dist/chunks/hr-DLpybOhU.mjs +15099 -0
- package/dist/chunks/hu-BkT0gT00.mjs +16564 -0
- package/dist/chunks/hy-CVFDCp2S.mjs +12823 -0
- package/dist/chunks/{i18next-loader-p-7ioTwr.mjs → i18next-loader-BCAGutUy.mjs} +2 -2
- package/dist/chunks/id-0P4W9Az0.mjs +16690 -0
- package/dist/chunks/it-mLY6_uoW.mjs +19054 -0
- package/dist/chunks/ja-7RkeRNWG.mjs +15708 -0
- package/dist/chunks/ka-C7Lx-Qsh.mjs +13049 -0
- package/dist/chunks/km-Q8udaraH.mjs +12319 -0
- package/dist/chunks/kn-BiETM-iq.mjs +19123 -0
- package/dist/chunks/ko-tiB80pF1.mjs +17322 -0
- package/dist/chunks/ku-CY-OABkR.mjs +236 -0
- package/dist/chunks/{lightweight-i18n-BPeH69Dl.mjs → lightweight-i18n-CNUuUkuo.mjs} +31 -1
- package/dist/chunks/lo-CTBhEnyk.mjs +13576 -0
- package/dist/chunks/lt-BHKHEtqK.mjs +14587 -0
- package/dist/chunks/lv-DWxgtfUg.mjs +15042 -0
- package/dist/chunks/{messages-BHf_VcXb2.mjs → messages-2i0z2hFq2.mjs} +32 -2
- package/dist/{messages-8zo-T-Nx2.mjs → chunks/messages-4epWYTzK.mjs} +32 -2
- package/dist/chunks/{messages-DgZnRQRS.mjs → messages-B-x11A7Z.mjs} +32 -2
- package/dist/chunks/{messages-C03I_oR-2.mjs → messages-B1mCwtgm2.mjs} +32 -2
- package/dist/{messages-C5hD5pSd2.mjs → chunks/messages-B2Xnfn7m2.mjs} +32 -2
- package/dist/chunks/{messages-B-i-d1Bc.mjs → messages-B38lWmza.mjs} +32 -2
- package/dist/{messages-BRC9E_sp.mjs → chunks/messages-B3VMWaO8.mjs} +32 -2
- package/dist/{messages-BrcgNZOJ.mjs → chunks/messages-B6n2OYKJ.mjs} +32 -2
- package/dist/chunks/{messages-CIugNDDO2.mjs → messages-B847kJa02.mjs} +32 -2
- package/dist/chunks/{messages-CH_cexo62.mjs → messages-B8nL5cPA2.mjs} +32 -2
- package/dist/chunks/{messages-Bdk5tBNu.mjs → messages-BHMUmX3N.mjs} +32 -2
- package/dist/chunks/{messages-LL3Tflph.mjs → messages-BN78Am3l2.mjs} +32 -2
- package/dist/chunks/{messages-BIrkzbBP.mjs → messages-BRa1Itk_.mjs} +32 -2
- package/dist/chunks/{messages-BtS6JWMT.mjs → messages-BleThZm5.mjs} +32 -2
- package/dist/{messages-DHJ1fZLL.mjs → chunks/messages-Bo2PcQoc.mjs} +32 -2
- package/dist/{messages-D5rnT-BC.mjs → chunks/messages-Bqk7cuZY.mjs} +32 -2
- package/dist/chunks/{messages-Di7mfvB8.mjs → messages-BrsB1FRe.mjs} +32 -2
- package/dist/{messages-CsmTziC6.mjs → chunks/messages-ByeBRHpJ.mjs} +32 -2
- package/dist/{messages-C7Rz00Tp.mjs → chunks/messages-C35b_LVM.mjs} +32 -2
- package/dist/{messages-Co26RSCV2.mjs → chunks/messages-CAH4L_Mq2.mjs} +32 -2
- package/dist/chunks/{messages-BMzmli1K.mjs → messages-CBa6-NHn.mjs} +32 -2
- package/dist/chunks/{messages-wUoSWFsJ2.mjs → messages-CCywXuFz2.mjs} +32 -2
- package/dist/chunks/{messages-4OvVdaG52.mjs → messages-CDZrOiaR.mjs} +32 -2
- package/dist/{messages-C92tAUYT2.mjs → chunks/messages-CEVMB1TN2.mjs} +32 -2
- package/dist/{messages-CHeucLGl2.mjs → chunks/messages-CF7WlKOY.mjs} +32 -2
- package/dist/{messages-D_-rh8gl.mjs → chunks/messages-CLcwMAAe.mjs} +32 -2
- package/dist/chunks/{messages-Df69rfTF2.mjs → messages-CTGjizuJ2.mjs} +32 -2
- package/dist/chunks/{messages-Ehx9YYeb2.mjs → messages-CTI66ZU52.mjs} +32 -2
- package/dist/{messages-C9LsEUfG.mjs → chunks/messages-CTtFH-AE.mjs} +32 -2
- package/dist/{messages-BB8umWL1.mjs → chunks/messages-CbilQw5o2.mjs} +32 -2
- package/dist/chunks/{messages-BAgTIgPH.mjs → messages-CiSiPyKp.mjs} +32 -2
- package/dist/chunks/{messages-5thhSeME.mjs → messages-ClD_3Kmk.mjs} +32 -2
- package/dist/chunks/{messages--aM83pib2.mjs → messages-CqoOMgIb2.mjs} +32 -2
- package/dist/chunks/{messages-EDTq4Q52.mjs → messages-Cqxe2gIN.mjs} +32 -2
- package/dist/chunks/{messages-SsrFJhTN.mjs → messages-CxKX6wTt.mjs} +32 -2
- package/dist/chunks/{messages-DUp8NnKT.mjs → messages-CyrZJ9dG.mjs} +32 -2
- package/dist/{messages-EIeWKoc5.mjs → chunks/messages-D1eXOdyJ.mjs} +32 -2
- package/dist/chunks/{messages-ohtcmr1w.mjs → messages-D2QcrPYF.mjs} +32 -2
- package/dist/{messages-DV29fJMD2.mjs → chunks/messages-D6EtVUzk2.mjs} +32 -2
- package/dist/{messages-C4HpNHfK.mjs → chunks/messages-D7qp-JvC.mjs} +32 -2
- package/dist/chunks/{messages-Dr-Ig3sw.mjs → messages-DAhzpf-j.mjs} +32 -2
- package/dist/chunks/{messages-DKChC8Qu.mjs → messages-DEVxqfH0.mjs} +32 -2
- package/dist/{messages-CkIRmpfZ2.mjs → chunks/messages-DHJIlD2m.mjs} +32 -2
- package/dist/{messages-CmoTIebG2.mjs → chunks/messages-DJ_gZym52.mjs} +32 -2
- package/dist/{messages-Cu7Lr1wp.mjs → chunks/messages-DMENc4jZ.mjs} +32 -2
- package/dist/chunks/{messages-BAC7nLeM.mjs → messages-DVDFAJaw.mjs} +32 -2
- package/dist/chunks/{messages-Co4WFeQ8.mjs → messages-DYQ87v5m.mjs} +32 -2
- package/dist/chunks/{messages-BO_jtRbZ2.mjs → messages-Dc2wd0BC2.mjs} +32 -2
- package/dist/{messages-F7cRf-20.mjs → chunks/messages-DlSDBHih.mjs} +32 -2
- package/dist/chunks/{messages-Nz8C7Znm.mjs → messages-Dmxk7uOK.mjs} +32 -2
- package/dist/chunks/{messages-8pf7gRQm2.mjs → messages-Dqoj0eKD2.mjs} +32 -2
- package/dist/{messages-BD_U2EnE.mjs → chunks/messages-DvUNk-e7.mjs} +32 -2
- package/dist/{messages-CTFwu5-h2.mjs → chunks/messages-DvZa_OtS2.mjs} +32 -2
- package/dist/chunks/{messages-CSpfBhlK2.mjs → messages-Dxa27UhV2.mjs} +32 -2
- package/dist/chunks/{messages-D14soBOO.mjs → messages-JQR7Z2f0.mjs} +32 -2
- package/dist/{messages-bRqMCja-2.mjs → chunks/messages-K453lCht2.mjs} +32 -2
- package/dist/{messages-B9ythxux.mjs → chunks/messages-Kqu8QyYy2.mjs} +32 -2
- package/dist/{messages-CWzET_9H2.mjs → chunks/messages-LGqROvB5.mjs} +32 -2
- package/dist/{messages-JwMkLben.mjs → chunks/messages-LiQ7ni4i2.mjs} +32 -2
- package/dist/{messages-B21zLG6b.mjs → chunks/messages-PDaWSrFT.mjs} +32 -2
- package/dist/{messages-ouO9js8Z.mjs → chunks/messages-SOew8O6I.mjs} +32 -2
- package/dist/{messages-SepwOOcg.mjs → chunks/messages-cjqgX4JV2.mjs} +32 -2
- package/dist/chunks/{messages-BARPMN7R.mjs → messages-fdO2V2XC.mjs} +32 -2
- package/dist/chunks/{messages-DDpgr0B1.mjs → messages-lu4RI1A3.mjs} +32 -2
- package/dist/{messages-D_cAZ4Ic2.mjs → chunks/messages-qt_Tsj1u2.mjs} +32 -2
- package/dist/chunks/{messages-BDTgiBJY2.mjs → messages-uQOWdLDn2.mjs} +32 -2
- package/dist/chunks/{messages-FCmAVA792.mjs → messages-xG65ERBM2.mjs} +32 -2
- package/dist/chunks/mk-BjookGdx.mjs +16800 -0
- package/dist/chunks/ml-L-NnZcp9.mjs +13558 -0
- package/dist/chunks/mn-OMWi7Hl_.mjs +12107 -0
- package/dist/chunks/mr-B6JPzITo.mjs +17324 -0
- package/dist/chunks/ms-CG3S-sPB.mjs +14999 -0
- package/dist/chunks/my-BLAmGfhT.mjs +12534 -0
- package/dist/chunks/native-BPcABu9z.mjs +107 -0
- package/dist/chunks/ne-D1JHLfYw.mjs +13248 -0
- package/dist/chunks/nl-Ca7Q8FnY.mjs +16693 -0
- package/dist/chunks/no-Coxcohcz.mjs +14767 -0
- package/dist/chunks/pa-CCaXqpaI.mjs +17220 -0
- package/dist/chunks/pl-Cl_fAZ84.mjs +17221 -0
- package/dist/chunks/ps-WD5qGAWy.mjs +12185 -0
- package/dist/chunks/pt-C4zvLfvq.mjs +16334 -0
- package/dist/chunks/ro-DbefHcmM.mjs +18857 -0
- package/dist/chunks/ru-uU1J14jd.mjs +17485 -0
- package/dist/chunks/sd-DKu368Ip.mjs +10889 -0
- package/dist/chunks/si-BsJCiPkZ.mjs +12721 -0
- package/dist/chunks/sk-CD-a3SN6.mjs +19081 -0
- package/dist/chunks/sl-CXhrPJe_.mjs +15682 -0
- package/dist/chunks/sq-CTctCoFQ.mjs +15278 -0
- package/dist/chunks/sr-BZkhBwXj.mjs +14524 -0
- package/dist/chunks/sv-NmRZb_xi.mjs +12855 -0
- package/dist/chunks/sw-Be5ik3H6.mjs +14315 -0
- package/dist/chunks/ta-DsXh6neL.mjs +16836 -0
- package/dist/chunks/te-CwpCbM8M.mjs +18588 -0
- package/dist/chunks/th-CcZ15OLk.mjs +13894 -0
- package/dist/chunks/{tools-CW1RAIvp.mjs → tools-BBmJ8jqK.mjs} +1417 -761
- package/dist/chunks/tr-q3bTgvhW.mjs +16318 -0
- package/dist/chunks/ug-919EhLsL.mjs +9816 -0
- package/dist/chunks/uk-aNMEzd0Y.mjs +16725 -0
- package/dist/chunks/ur-BwQI77sh.mjs +18051 -0
- package/dist/chunks/vi-Dxq806-F.mjs +14006 -0
- package/dist/chunks/zh-BcHuy1Ti.mjs +16334 -0
- package/dist/full.mjs +10 -10
- package/dist/locales.mjs +98 -68
- package/dist/{messages-qV14y_oA2.mjs → messages--PYnorLu2.mjs} +32 -2
- package/dist/{messages-Cy3Ne_M9.mjs → messages-B2X5gO-s.mjs} +32 -2
- package/dist/{chunks/messages-D1SqLcxI2.mjs → messages-BD3lSUU_.mjs} +32 -2
- package/dist/{chunks/messages-CIZkNCpW.mjs → messages-BFbAM_pK2.mjs} +32 -2
- package/dist/{chunks/messages-CIBuZccC.mjs → messages-BMUQ7kA62.mjs} +32 -2
- package/dist/{messages-CrWsU4Xw2.mjs → messages-BR1Hlhdc2.mjs} +32 -2
- package/dist/{chunks/messages-D2uBlGXR2.mjs → messages-BRJBZB-H2.mjs} +32 -2
- package/dist/{chunks/messages-OIelQDL32.mjs → messages-BTFWPbHk2.mjs} +32 -2
- package/dist/{messages-EwoT2jof.mjs → messages-BXvE3YB4.mjs} +32 -2
- package/dist/{messages-CqNzlpWi.mjs → messages-BZg8xxIT.mjs} +32 -2
- package/dist/{messages-BAZK-8Zb.mjs → messages-B_idm-Pp.mjs} +32 -2
- package/dist/{messages-LyzjEEIj2.mjs → messages-BcrsCh5-2.mjs} +32 -2
- package/dist/{chunks/messages-DPoPrTiZ.mjs → messages-Bf0eqjDJ.mjs} +32 -2
- package/dist/{messages-CKmmJ9tW.mjs → messages-Bgu3IB_k.mjs} +32 -2
- package/dist/{chunks/messages-DeLzropc.mjs → messages-Bkv2sk7Y.mjs} +32 -2
- package/dist/{messages-rM6YFLZH.mjs → messages-Bn77ieXA.mjs} +32 -2
- package/dist/{messages-CTPFrtK92.mjs → messages-Buf_f_-32.mjs} +32 -2
- package/dist/{messages-ouRGTAKo2.mjs → messages-BvIBkUCG2.mjs} +32 -2
- package/dist/{chunks/messages-DVg69mRj.mjs → messages-Bw0kGTAV.mjs} +32 -2
- package/dist/{chunks/messages-CWp6-Y8f2.mjs → messages-C5MKR_WT2.mjs} +32 -2
- package/dist/{chunks/messages-N72K1hw3.mjs → messages-C6UkeZ0y.mjs} +32 -2
- package/dist/{messages-CzZAfGif.mjs → messages-C9AvcT0K.mjs} +32 -2
- package/dist/{chunks/messages-D0IKicWg.mjs → messages-CC596_yM.mjs} +32 -2
- package/dist/{messages-DiSeSE8p.mjs → messages-CGD9LR8l.mjs} +32 -2
- package/dist/{messages-Tx25QErT.mjs → messages-CH8tCpAX.mjs} +32 -2
- package/dist/{chunks/messages-DfsHFEWa.mjs → messages-CIGa1j8-2.mjs} +32 -2
- package/dist/{messages-TI0u6Ked.mjs → messages-CJ5pCncM.mjs} +32 -2
- package/dist/{chunks/messages-DEGzGmEQ2.mjs → messages-CJd52qP7.mjs} +32 -2
- package/dist/{messages-Bm8I_Li12.mjs → messages-CWIigMhw2.mjs} +32 -2
- package/dist/{messages-JZhs_0pf.mjs → messages-CY_Fj715.mjs} +32 -2
- package/dist/{messages-BSLYh59S.mjs → messages-C_YAmOyQ.mjs} +32 -2
- package/dist/{messages-CIxT1nSh.mjs → messages-CjCjr0wW.mjs} +32 -2
- package/dist/{messages-Dr9L1psl.mjs → messages-CqbeAhjH.mjs} +32 -2
- package/dist/{messages-BTR3QlIb2.mjs → messages-Cr2hTJyi2.mjs} +32 -2
- package/dist/{chunks/messages-BKjLgO5d.mjs → messages-Cuw_6akN.mjs} +32 -2
- package/dist/{messages-lEyiemqU2.mjs → messages-D0KBToO12.mjs} +32 -2
- package/dist/{messages-1_FCq0It.mjs → messages-D2Xo8E0P.mjs} +32 -2
- package/dist/{messages-Djhu5RJd.mjs → messages-D5Uk_qYf.mjs} +32 -2
- package/dist/{messages-CHWfj4ik.mjs → messages-D7dJJ7dx.mjs} +32 -2
- package/dist/{chunks/messages-DmrsEYQm2.mjs → messages-D8SS2hOs2.mjs} +32 -2
- package/dist/{chunks/messages-DQOk-dTH.mjs → messages-D9a5iSFC2.mjs} +32 -2
- package/dist/{messages-BSwhWcYw.mjs → messages-DAjtVSb6.mjs} +32 -2
- package/dist/{messages-BZXBdD_S2.mjs → messages-DBuHaabF2.mjs} +32 -2
- package/dist/{chunks/messages-CuRN1_ep2.mjs → messages-DCjAu6M72.mjs} +32 -2
- package/dist/{messages-CKX9iXIb2.mjs → messages-DFlT_TM02.mjs} +32 -2
- package/dist/{chunks/messages-DlM9TmqS2.mjs → messages-DPECmAwT.mjs} +32 -2
- package/dist/{chunks/messages-DhGHk-Ma2.mjs → messages-DR2Lgl002.mjs} +32 -2
- package/dist/{messages-DDiP6yex.mjs → messages-DUPXmcZh.mjs} +32 -2
- package/dist/{chunks/messages-CoRQE_Jc.mjs → messages-DVReQ5EC.mjs} +32 -2
- package/dist/{chunks/messages-BvlSf_pu.mjs → messages-DaZkRhoM.mjs} +32 -2
- package/dist/{chunks/messages-B9zocutJ.mjs → messages-Dc93MR86.mjs} +32 -2
- package/dist/{messages-Dc7ZzqYN.mjs → messages-Dd4OTpH3.mjs} +32 -2
- package/dist/{chunks/messages-BsYzg2le.mjs → messages-DffJ5W5G.mjs} +32 -2
- package/dist/{messages-D8iCBMg7.mjs → messages-DjWAR34D.mjs} +32 -2
- package/dist/{messages-BzZ8LahA2.mjs → messages-DkaJV53s2.mjs} +32 -2
- package/dist/{chunks/messages-stUQR58d.mjs → messages-Dl7LQ_fI.mjs} +32 -2
- package/dist/{chunks/messages-B_fFjpX12.mjs → messages-DlEdd01l2.mjs} +32 -2
- package/dist/{chunks/messages-5ohIWynJ.mjs → messages-ItP2i78l.mjs} +32 -2
- package/dist/{messages-DDJOu049.mjs → messages-Oqm_fCLp.mjs} +32 -2
- package/dist/{chunks/messages-DrXNb1gu.mjs → messages-UpoT1AS6.mjs} +32 -2
- package/dist/{chunks/messages-COkQfKa72.mjs → messages-Z8dpjy_K2.mjs} +32 -2
- package/dist/{messages-mVLfVtQX2.mjs → messages-ierNgYE02.mjs} +32 -2
- package/dist/{messages-DToWAonn2.mjs → messages-ikSI7M732.mjs} +32 -2
- package/dist/{chunks/messages-DKCoHa5D.mjs → messages-olK9oNtb.mjs} +32 -2
- package/dist/{messages-CsnglxbV2.mjs → messages-rgXeOQMh2.mjs} +32 -2
- package/dist/{chunks/messages-CDJLoStb.mjs → messages-syo0DKqf.mjs} +32 -2
- package/dist/{chunks/messages-BgaGPFuy2.mjs → messages-tFDVfvWL.mjs} +32 -2
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +3 -3
- package/dist/vendor.LICENSE.txt +34 -0
- package/package.json +3 -1
- package/src/components/i18n/locales/am/messages.json +32 -2
- package/src/components/i18n/locales/ar/messages.json +32 -2
- package/src/components/i18n/locales/az/messages.json +32 -2
- package/src/components/i18n/locales/bg/messages.json +32 -2
- package/src/components/i18n/locales/bn/messages.json +32 -2
- package/src/components/i18n/locales/bs/messages.json +32 -2
- package/src/components/i18n/locales/cs/messages.json +32 -2
- package/src/components/i18n/locales/da/messages.json +32 -2
- package/src/components/i18n/locales/de/messages.json +32 -2
- package/src/components/i18n/locales/dv/messages.json +32 -2
- package/src/components/i18n/locales/el/messages.json +32 -2
- package/src/components/i18n/locales/en/messages.json +31 -1
- package/src/components/i18n/locales/es/messages.json +32 -2
- package/src/components/i18n/locales/et/messages.json +32 -2
- package/src/components/i18n/locales/fa/messages.json +32 -2
- package/src/components/i18n/locales/fi/messages.json +32 -2
- package/src/components/i18n/locales/fil/messages.json +32 -2
- package/src/components/i18n/locales/fr/messages.json +32 -2
- package/src/components/i18n/locales/gu/messages.json +32 -2
- package/src/components/i18n/locales/he/messages.json +32 -2
- package/src/components/i18n/locales/hi/messages.json +32 -2
- package/src/components/i18n/locales/hr/messages.json +32 -2
- package/src/components/i18n/locales/hu/messages.json +32 -2
- package/src/components/i18n/locales/hy/messages.json +32 -2
- package/src/components/i18n/locales/id/messages.json +32 -2
- package/src/components/i18n/locales/it/messages.json +32 -2
- package/src/components/i18n/locales/ja/messages.json +32 -2
- package/src/components/i18n/locales/ka/messages.json +32 -2
- package/src/components/i18n/locales/km/messages.json +32 -2
- package/src/components/i18n/locales/kn/messages.json +32 -2
- package/src/components/i18n/locales/ko/messages.json +32 -2
- package/src/components/i18n/locales/ku/messages.json +32 -2
- package/src/components/i18n/locales/lo/messages.json +32 -2
- package/src/components/i18n/locales/lt/messages.json +32 -2
- package/src/components/i18n/locales/lv/messages.json +32 -2
- package/src/components/i18n/locales/mk/messages.json +32 -2
- package/src/components/i18n/locales/ml/messages.json +32 -2
- package/src/components/i18n/locales/mn/messages.json +32 -2
- package/src/components/i18n/locales/mr/messages.json +32 -2
- package/src/components/i18n/locales/ms/messages.json +32 -2
- package/src/components/i18n/locales/my/messages.json +32 -2
- package/src/components/i18n/locales/ne/messages.json +32 -2
- package/src/components/i18n/locales/nl/messages.json +32 -2
- package/src/components/i18n/locales/no/messages.json +32 -2
- package/src/components/i18n/locales/pa/messages.json +32 -2
- package/src/components/i18n/locales/pl/messages.json +32 -2
- package/src/components/i18n/locales/ps/messages.json +32 -2
- package/src/components/i18n/locales/pt/messages.json +32 -2
- package/src/components/i18n/locales/ro/messages.json +32 -2
- package/src/components/i18n/locales/ru/messages.json +32 -2
- package/src/components/i18n/locales/sd/messages.json +32 -2
- package/src/components/i18n/locales/si/messages.json +32 -2
- package/src/components/i18n/locales/sk/messages.json +32 -2
- package/src/components/i18n/locales/sl/messages.json +32 -2
- package/src/components/i18n/locales/sq/messages.json +32 -2
- package/src/components/i18n/locales/sr/messages.json +32 -2
- package/src/components/i18n/locales/sv/messages.json +32 -2
- package/src/components/i18n/locales/sw/messages.json +32 -2
- package/src/components/i18n/locales/ta/messages.json +32 -2
- package/src/components/i18n/locales/te/messages.json +32 -2
- package/src/components/i18n/locales/th/messages.json +32 -2
- package/src/components/i18n/locales/tr/messages.json +32 -2
- package/src/components/i18n/locales/ug/messages.json +32 -2
- package/src/components/i18n/locales/uk/messages.json +32 -2
- package/src/components/i18n/locales/ur/messages.json +32 -2
- package/src/components/i18n/locales/vi/messages.json +32 -2
- package/src/components/i18n/locales/yi/messages.json +32 -2
- package/src/components/i18n/locales/zh/messages.json +32 -2
- package/src/components/icons/index.ts +98 -0
- package/src/components/modules/api/i18n.ts +1 -0
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +22 -5
- package/src/components/modules/blockManager/operations.ts +1 -0
- package/src/components/modules/toolbar/index.ts +102 -7
- package/src/components/modules/toolbar/plus-button.ts +17 -5
- package/src/components/modules/uiControllers/controllers/blockHover.ts +36 -9
- package/src/components/modules/uiControllers/handlers/touch.ts +20 -8
- package/src/components/tools/factory.ts +4 -0
- package/src/components/ui/toolbox.ts +38 -3
- package/src/components/utils/popover/popover-desktop.ts +48 -71
- package/src/components/utils/popover/popover-position.ts +105 -0
- package/src/stories/MarkerColors.stories.ts +8 -1
- package/src/styles/main.css +121 -17
- package/src/tools/callout/block-operations.ts +17 -0
- package/src/tools/callout/callout-keyboard.ts +45 -0
- package/src/tools/callout/constants.ts +30 -0
- package/src/tools/callout/dom-builder.ts +53 -0
- package/src/tools/callout/emoji-picker/emoji-data.ts +105 -0
- package/src/tools/callout/emoji-picker/emoji-locale.ts +165 -0
- package/src/tools/callout/emoji-picker/index.ts +762 -0
- package/src/tools/callout/emoji-picker/locales/am.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ar.json +1 -0
- package/src/tools/callout/emoji-picker/locales/az.json +1 -0
- package/src/tools/callout/emoji-picker/locales/bg.json +1 -0
- package/src/tools/callout/emoji-picker/locales/bn.json +1 -0
- package/src/tools/callout/emoji-picker/locales/bs.json +1 -0
- package/src/tools/callout/emoji-picker/locales/cs.json +1 -0
- package/src/tools/callout/emoji-picker/locales/da.json +1 -0
- package/src/tools/callout/emoji-picker/locales/de.json +1 -0
- package/src/tools/callout/emoji-picker/locales/el.json +1 -0
- package/src/tools/callout/emoji-picker/locales/es.json +1 -0
- package/src/tools/callout/emoji-picker/locales/et.json +1 -0
- package/src/tools/callout/emoji-picker/locales/fa.json +1 -0
- package/src/tools/callout/emoji-picker/locales/fi.json +1 -0
- package/src/tools/callout/emoji-picker/locales/fil.json +1 -0
- package/src/tools/callout/emoji-picker/locales/fr.json +1 -0
- package/src/tools/callout/emoji-picker/locales/gu.json +1 -0
- package/src/tools/callout/emoji-picker/locales/he.json +1 -0
- package/src/tools/callout/emoji-picker/locales/hi.json +1 -0
- package/src/tools/callout/emoji-picker/locales/hr.json +1 -0
- package/src/tools/callout/emoji-picker/locales/hu.json +1 -0
- package/src/tools/callout/emoji-picker/locales/hy.json +1 -0
- package/src/tools/callout/emoji-picker/locales/id.json +1 -0
- package/src/tools/callout/emoji-picker/locales/it.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ja.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ka.json +1 -0
- package/src/tools/callout/emoji-picker/locales/km.json +1 -0
- package/src/tools/callout/emoji-picker/locales/kn.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ko.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ku.json +1 -0
- package/src/tools/callout/emoji-picker/locales/lo.json +1 -0
- package/src/tools/callout/emoji-picker/locales/lt.json +1 -0
- package/src/tools/callout/emoji-picker/locales/lv.json +1 -0
- package/src/tools/callout/emoji-picker/locales/mk.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ml.json +1 -0
- package/src/tools/callout/emoji-picker/locales/mn.json +1 -0
- package/src/tools/callout/emoji-picker/locales/mr.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ms.json +1 -0
- package/src/tools/callout/emoji-picker/locales/my.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ne.json +1 -0
- package/src/tools/callout/emoji-picker/locales/nl.json +1 -0
- package/src/tools/callout/emoji-picker/locales/no.json +1 -0
- package/src/tools/callout/emoji-picker/locales/pa.json +1 -0
- package/src/tools/callout/emoji-picker/locales/pl.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ps.json +1 -0
- package/src/tools/callout/emoji-picker/locales/pt.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ro.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ru.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sd.json +1 -0
- package/src/tools/callout/emoji-picker/locales/si.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sk.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sl.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sq.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sr.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sv.json +1 -0
- package/src/tools/callout/emoji-picker/locales/sw.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ta.json +1 -0
- package/src/tools/callout/emoji-picker/locales/te.json +1 -0
- package/src/tools/callout/emoji-picker/locales/th.json +1 -0
- package/src/tools/callout/emoji-picker/locales/tr.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ug.json +1 -0
- package/src/tools/callout/emoji-picker/locales/uk.json +1 -0
- package/src/tools/callout/emoji-picker/locales/ur.json +1 -0
- package/src/tools/callout/emoji-picker/locales/vi.json +1 -0
- package/src/tools/callout/emoji-picker/locales/zh.json +1 -0
- package/src/tools/callout/index.ts +338 -0
- package/src/tools/callout/types.ts +11 -0
- package/src/tools/header/header-toggle-keyboard.ts +3 -2
- package/src/tools/header/index.ts +1 -1
- package/src/tools/index.ts +2 -0
- package/src/tools/toggle/index.ts +1 -1
- package/src/tools/toggle/toggle-keyboard.ts +29 -1
- package/types/api/i18n.d.ts +7 -0
- package/types/tools-entry.d.ts +0 -4
- /package/dist/chunks/{i18next-DymC16cN.mjs → i18next-Ch0gVA3V.mjs} +0 -0
- /package/dist/chunks/{notifier-BqYxvxnV.mjs → notifier-Butv4Dvo.mjs} +0 -0
|
@@ -166,11 +166,21 @@ export class PlusButtonHandler {
|
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
// Determine target block: reuse empty
|
|
169
|
+
// Determine target block: reuse any empty block, or create a new one
|
|
170
170
|
const hoveredBlock = this.hoveredBlockInternal;
|
|
171
171
|
const isParagraph = hoveredBlock?.name === 'paragraph';
|
|
172
172
|
const startsWithSlash = isParagraph && hoveredBlock.pluginsContent.textContent?.startsWith('/');
|
|
173
|
-
|
|
173
|
+
|
|
174
|
+
// Reuse the hovered block if it's empty (any type, not just paragraphs).
|
|
175
|
+
// If hoveredBlock is not empty (e.g. a table), check if the focused block
|
|
176
|
+
// is empty and nested inside it (e.g. an empty paragraph in a table cell).
|
|
177
|
+
const currentBlock = BlockManager.currentBlock ?? null;
|
|
178
|
+
const hoveredIsEmpty = hoveredBlock !== null && hoveredBlock.isEmpty;
|
|
179
|
+
const nestedCurrentBlockIsEmpty = !hoveredIsEmpty && currentBlock !== null
|
|
180
|
+
&& currentBlock !== hoveredBlock && currentBlock.isEmpty
|
|
181
|
+
&& hoveredBlock !== null && hoveredBlock.holder.contains(currentBlock.holder);
|
|
182
|
+
const emptyBlockToReuse: Block | null =
|
|
183
|
+
(hoveredIsEmpty && hoveredBlock) || (nestedCurrentBlockIsEmpty && currentBlock) || null;
|
|
174
184
|
|
|
175
185
|
// Calculate insert index based on direction
|
|
176
186
|
const hoveredBlockIndex = hoveredBlock !== null
|
|
@@ -191,15 +201,17 @@ export class PlusButtonHandler {
|
|
|
191
201
|
: 0;
|
|
192
202
|
const insertIndex = baseInsertIndex + (firstNonNestedOffset === -1 ? blocksAfterInsert.length : firstNonNestedOffset);
|
|
193
203
|
|
|
194
|
-
|
|
204
|
+
// startsWithSlash is only true when isParagraph is true, which requires
|
|
205
|
+
// hoveredBlock to be non-null. TypeScript narrows this correctly.
|
|
206
|
+
const targetBlock: Block = startsWithSlash
|
|
195
207
|
? hoveredBlock
|
|
196
|
-
: BlockManager.insertDefaultBlockAtIndex(insertIndex, true);
|
|
208
|
+
: (emptyBlockToReuse ?? BlockManager.insertDefaultBlockAtIndex(insertIndex, true));
|
|
197
209
|
|
|
198
210
|
// The DOM insertion may place the new block's holder inside a nested
|
|
199
211
|
// container (e.g. a table cell) because the previous block in the array
|
|
200
212
|
// is inside another block's DOM. Move the holder to be a sibling after
|
|
201
213
|
// the hovered block so it becomes a top-level block.
|
|
202
|
-
if (targetBlock !== hoveredBlock && isNested(targetBlock)) {
|
|
214
|
+
if (targetBlock !== hoveredBlock && emptyBlockToReuse === null && isNested(targetBlock)) {
|
|
203
215
|
hoveredBlock?.holder.after(targetBlock.holder);
|
|
204
216
|
}
|
|
205
217
|
|
|
@@ -67,12 +67,39 @@ export class BlockHoverController extends Controller {
|
|
|
67
67
|
const closestBlockWrapper = (event.target as Element | null)?.closest('[data-blok-testid="block-wrapper"]');
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
* When the cursor is in the gap between children inside a [data-blok-child-toolbar]
|
|
71
|
+
* container, the closest block-wrapper is the parent — not a child.
|
|
72
|
+
* Skip the event so the toolbar stays on the previous child block.
|
|
73
|
+
*/
|
|
74
|
+
const targetChildToolbar = (event.target as Element | null)?.closest('[data-blok-child-toolbar]');
|
|
75
|
+
|
|
76
|
+
if (targetChildToolbar && closestBlockWrapper && !targetChildToolbar.contains(closestBlockWrapper)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* If the hovered block is inside a table cell or toggle-children container,
|
|
82
|
+
* resolve to the parent block instead.
|
|
83
|
+
* Without this, the toolbar targets nested child blocks and the parent's
|
|
72
84
|
* block tune settings become inaccessible.
|
|
85
|
+
*
|
|
86
|
+
* Containers with [data-blok-child-toolbar] opt out of parent resolution,
|
|
87
|
+
* allowing non-first children to have independent toolbars (e.g. callout blocks).
|
|
88
|
+
* The first child still resolves to parent so the container's own controls display.
|
|
73
89
|
*/
|
|
74
|
-
const
|
|
75
|
-
|
|
90
|
+
const alwaysResolveContainer = closestBlockWrapper?.closest(
|
|
91
|
+
'[data-blok-table-cell-blocks], [data-blok-toggle-children]:not([data-blok-child-toolbar])'
|
|
92
|
+
);
|
|
93
|
+
const childToolbarContainer = !alwaysResolveContainer
|
|
94
|
+
? closestBlockWrapper?.closest('[data-blok-child-toolbar]') ?? null
|
|
95
|
+
: null;
|
|
96
|
+
const isFirstChildOfContainer = childToolbarContainer !== null
|
|
97
|
+
&& childToolbarContainer.querySelector(':scope > [data-blok-testid="block-wrapper"]') === closestBlockWrapper;
|
|
98
|
+
|
|
99
|
+
const nestedContainer = alwaysResolveContainer
|
|
100
|
+
?? (isFirstChildOfContainer ? childToolbarContainer : null);
|
|
101
|
+
const hoveredBlockElement = nestedContainer
|
|
102
|
+
? nestedContainer.closest('[data-blok-testid="block-wrapper"]') ?? null
|
|
76
103
|
: closestBlockWrapper;
|
|
77
104
|
|
|
78
105
|
/**
|
|
@@ -158,13 +185,13 @@ export class BlockHoverController extends Controller {
|
|
|
158
185
|
}
|
|
159
186
|
|
|
160
187
|
/**
|
|
161
|
-
* Filter out blocks whose holders are inside a table cell container.
|
|
162
|
-
*
|
|
163
|
-
* the parent
|
|
164
|
-
* This matches the direct-hit path which also resolves
|
|
188
|
+
* Filter out blocks whose holders are inside a table cell or toggle-children container.
|
|
189
|
+
* Nested child blocks should not participate in nearest-block detection —
|
|
190
|
+
* the parent block should be found instead.
|
|
191
|
+
* This matches the direct-hit path which also resolves nested blocks to their parent.
|
|
165
192
|
*/
|
|
166
193
|
const topLevelBlocks = blocks.filter(block =>
|
|
167
|
-
block.holder.closest('[data-blok-table-cell-blocks]') === null
|
|
194
|
+
block.holder.closest('[data-blok-table-cell-blocks], [data-blok-toggle-children]') === null
|
|
168
195
|
);
|
|
169
196
|
|
|
170
197
|
if (topLevelBlocks.length === 0) {
|
|
@@ -71,15 +71,27 @@ export const createRedactorTouchHandler = (
|
|
|
71
71
|
*/
|
|
72
72
|
if (!deps.Blok.ReadOnly.isEnabled && !deps.Blok.Toolbar.contains(initialTarget)) {
|
|
73
73
|
/**
|
|
74
|
-
* When the clicked node is inside a table cell
|
|
75
|
-
*
|
|
76
|
-
* Without this, moveAndOpen falls back to currentBlock (the
|
|
77
|
-
*
|
|
74
|
+
* When the clicked node is inside a table cell or toggle-children container,
|
|
75
|
+
* resolve to the parent block so moveAndOpen receives the correct parent block.
|
|
76
|
+
* Without this, moveAndOpen falls back to currentBlock (the nested child),
|
|
77
|
+
* and the parent's block tune settings become inaccessible.
|
|
78
|
+
*
|
|
79
|
+
* For child-toolbar containers (e.g. callout), the first child still resolves
|
|
80
|
+
* to the parent so the container's own controls (settings, drag) are accessible.
|
|
81
|
+
* Non-first children keep their own toolbar via the block argument being undefined.
|
|
78
82
|
*/
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
const alwaysResolve = clickedNode.closest?.('[data-blok-table-cell-blocks], [data-blok-toggle-children]:not([data-blok-child-toolbar])');
|
|
84
|
+
const childToolbar = !alwaysResolve
|
|
85
|
+
? clickedNode.closest?.('[data-blok-child-toolbar]') ?? null
|
|
86
|
+
: null;
|
|
87
|
+
const closestBlockWrapper = clickedNode.closest?.('[data-blok-testid="block-wrapper"]') ?? null;
|
|
88
|
+
const isFirstChild = childToolbar !== null
|
|
89
|
+
&& closestBlockWrapper !== null
|
|
90
|
+
&& childToolbar.querySelector(':scope > [data-blok-testid="block-wrapper"]') === closestBlockWrapper;
|
|
91
|
+
const nestedContainer = alwaysResolve ?? (isFirstChild ? childToolbar : null);
|
|
92
|
+
const parentBlockWrapper = nestedContainer?.closest('[data-blok-testid="block-wrapper"]');
|
|
93
|
+
const resolvedBlock = parentBlockWrapper
|
|
94
|
+
? deps.Blok.BlockManager.getBlockByChildNode(parentBlockWrapper)
|
|
83
95
|
: undefined;
|
|
84
96
|
|
|
85
97
|
deps.Blok.Toolbar.moveAndOpen(resolvedBlock, clickedNode);
|
|
@@ -226,6 +226,28 @@ export class Toolbox extends EventsDispatcher<ToolboxEventMap> {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Applies or clears callout background color on the popover's search input.
|
|
231
|
+
* When the toolbox opens inside a callout with a custom background, the search
|
|
232
|
+
* input container should match the callout background instead of its default.
|
|
233
|
+
*
|
|
234
|
+
* @param color - the callout background CSS value, or null to clear
|
|
235
|
+
*/
|
|
236
|
+
public setCalloutBackground(color: string | null): void {
|
|
237
|
+
const popoverEl = this.popover?.getElement();
|
|
238
|
+
|
|
239
|
+
if (!popoverEl) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (color) {
|
|
244
|
+
popoverEl.style.setProperty('--blok-search-input-bg', `light-dark(color-mix(in srgb, ${color} 70%, white), color-mix(in srgb, ${color} 85%, white))`);
|
|
245
|
+
} else {
|
|
246
|
+
popoverEl.style.removeProperty('--blok-search-input-bg');
|
|
247
|
+
popoverEl.style.removeProperty('--blok-search-input-border');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
229
251
|
/**
|
|
230
252
|
* Returns root block settings element
|
|
231
253
|
*/
|
|
@@ -323,7 +345,9 @@ export class Toolbox extends EventsDispatcher<ToolboxEventMap> {
|
|
|
323
345
|
* instead of at the trigger element (which is outside the table).
|
|
324
346
|
* Must be called after show() so the popover is in the DOM.
|
|
325
347
|
*/
|
|
326
|
-
|
|
348
|
+
const triggerHidden = this.triggerElement?.getBoundingClientRect().height === 0;
|
|
349
|
+
|
|
350
|
+
if ((this.isInsideTableCell || triggerHidden) && this.popover instanceof PopoverDesktop) {
|
|
327
351
|
const caretRect = SelectionUtils.rect;
|
|
328
352
|
|
|
329
353
|
this.popover.updatePosition(caretRect);
|
|
@@ -629,8 +653,13 @@ export class Toolbox extends EventsDispatcher<ToolboxEventMap> {
|
|
|
629
653
|
/**
|
|
630
654
|
* Check if the block contains only slash search text (e.g., "/head").
|
|
631
655
|
* If so, treat it as empty and replace it with the new block.
|
|
656
|
+
*
|
|
657
|
+
* When opened without slash (via plus button), any text in the block
|
|
658
|
+
* is a search query, not user content — always replace.
|
|
632
659
|
*/
|
|
633
|
-
const shouldReplaceBlock = currentBlock.isEmpty
|
|
660
|
+
const shouldReplaceBlock = currentBlock.isEmpty
|
|
661
|
+
|| this.isBlockSlashSearchOnly(currentBlock.holder)
|
|
662
|
+
|| !this.openedWithSlash;
|
|
634
663
|
|
|
635
664
|
/**
|
|
636
665
|
* On mobile version, we see the Plus Button even near non-empty blocks,
|
|
@@ -721,7 +750,13 @@ export class Toolbox extends EventsDispatcher<ToolboxEventMap> {
|
|
|
721
750
|
}
|
|
722
751
|
|
|
723
752
|
this.currentBlockForSearch = currentBlock.holder;
|
|
724
|
-
|
|
753
|
+
|
|
754
|
+
const activeEl = document.activeElement;
|
|
755
|
+
|
|
756
|
+
this.currentContentEditable = activeEl instanceof HTMLElement && activeEl.isContentEditable && this.currentBlockForSearch.contains(activeEl)
|
|
757
|
+
? activeEl
|
|
758
|
+
: this.currentBlockForSearch.querySelector('[contenteditable="true"]');
|
|
759
|
+
|
|
725
760
|
if (this.currentContentEditable instanceof HTMLElement) {
|
|
726
761
|
this.currentContentEditable.setAttribute(DATA_ATTR.slashSearch, this.i18nLabels.slashSearchPlaceholder);
|
|
727
762
|
}
|
|
@@ -10,6 +10,7 @@ import type { SearchableItem } from './components/search-input';
|
|
|
10
10
|
import { SearchInput, SearchInputEvent, scoreSearchMatch } from './components/search-input';
|
|
11
11
|
import { PopoverAbstract } from './popover-abstract';
|
|
12
12
|
import { CSSVariables, css as popoverCss } from './popover.const';
|
|
13
|
+
import { resolvePosition } from './popover-position';
|
|
13
14
|
import { twMerge } from '../tw';
|
|
14
15
|
|
|
15
16
|
import type { PopoverParams } from '@/types/utils/popover/popover';
|
|
@@ -224,12 +225,14 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
if (this.trigger) {
|
|
227
|
-
const { top, left } = this.calculatePosition();
|
|
228
|
+
const { top, left, openTop, openLeft } = this.calculatePosition();
|
|
228
229
|
this.nodes.popover.style.position = 'absolute';
|
|
229
230
|
this.nodes.popover.style.top = `${top}px`;
|
|
230
231
|
this.nodes.popover.style.left = `${left}px`;
|
|
231
232
|
this.nodes.popover.style.setProperty(CSSVariables.PopoverTop, '0px');
|
|
232
233
|
this.nodes.popover.style.setProperty(CSSVariables.PopoverLeft, '0px');
|
|
234
|
+
this.setOpenTop(openTop);
|
|
235
|
+
this.setOpenLeft(openLeft);
|
|
233
236
|
}
|
|
234
237
|
|
|
235
238
|
const measuredSize = this.size;
|
|
@@ -243,16 +246,27 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
243
246
|
this.nodes.popover.style.setProperty('--width', width + 'px');
|
|
244
247
|
}
|
|
245
248
|
|
|
246
|
-
if (!this.trigger
|
|
247
|
-
this.
|
|
248
|
-
//
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
if (!this.trigger) {
|
|
250
|
+
const containerRect = this.nodes.popoverContainer.getBoundingClientRect();
|
|
251
|
+
// offset: 0 because the visual gap is handled by CSS calc (0.5rem), not pixel positioning
|
|
252
|
+
const { openTop, openLeft } = resolvePosition({
|
|
253
|
+
anchor: containerRect,
|
|
254
|
+
popoverSize: measuredSize,
|
|
255
|
+
scopeBounds: this.scopeElement.getBoundingClientRect(),
|
|
256
|
+
viewportSize: { width: window.innerWidth, height: window.innerHeight },
|
|
257
|
+
scrollOffset: { x: window.scrollX, y: window.scrollY },
|
|
258
|
+
offset: 0,
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
if (openTop) {
|
|
262
|
+
this.setOpenTop(true);
|
|
263
|
+
this.nodes.popover.style.setProperty(CSSVariables.PopoverTop, 'calc(-1 * (0.5rem + var(--popover-height)))');
|
|
264
|
+
}
|
|
251
265
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
266
|
+
if (openLeft) {
|
|
267
|
+
this.setOpenLeft(true);
|
|
268
|
+
this.nodes.popover.style.setProperty(CSSVariables.PopoverLeft, 'calc(-1 * var(--width) + 100%)');
|
|
269
|
+
}
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
super.show();
|
|
@@ -294,45 +308,34 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
294
308
|
|
|
295
309
|
// Recalculate and apply position if already shown
|
|
296
310
|
if (this.nodes.popover.hasAttribute('data-blok-popover-opened')) {
|
|
297
|
-
const { top, left } = this.calculatePosition();
|
|
311
|
+
const { top, left, openTop, openLeft } = this.calculatePosition();
|
|
298
312
|
|
|
299
313
|
this.nodes.popover.style.top = `${top}px`;
|
|
300
314
|
this.nodes.popover.style.left = `${left}px`;
|
|
315
|
+
this.setOpenTop(openTop);
|
|
316
|
+
this.setOpenLeft(openLeft);
|
|
301
317
|
}
|
|
302
318
|
}
|
|
303
319
|
|
|
304
320
|
/**
|
|
305
321
|
* Calculates position for the popover
|
|
306
322
|
*/
|
|
307
|
-
private calculatePosition(): { top: number; left: number } {
|
|
308
|
-
// Use provided position if available, otherwise fall back to trigger element
|
|
323
|
+
private calculatePosition(): { top: number; left: number; openTop: boolean; openLeft: boolean } {
|
|
309
324
|
const rect = this.params.position ?? this.trigger?.getBoundingClientRect();
|
|
310
325
|
|
|
311
326
|
if (!rect) {
|
|
312
|
-
return {
|
|
313
|
-
top: 0,
|
|
314
|
-
left: 0,
|
|
315
|
-
};
|
|
327
|
+
return { top: 0, left: 0, openTop: false, openLeft: false };
|
|
316
328
|
}
|
|
317
329
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
const initialLeft = (this.leftAlignElement?.getBoundingClientRect().left ?? rect.left) + window.scrollX;
|
|
329
|
-
const shouldFlipLeft = initialLeft + popoverRect.width > windowWidth + window.scrollX;
|
|
330
|
-
const left = shouldFlipLeft ? Math.max(0, rect.right - popoverRect.width + window.scrollX) : initialLeft;
|
|
331
|
-
|
|
332
|
-
return {
|
|
333
|
-
top,
|
|
334
|
-
left,
|
|
335
|
-
};
|
|
330
|
+
return resolvePosition({
|
|
331
|
+
anchor: rect,
|
|
332
|
+
popoverSize: this.size,
|
|
333
|
+
scopeBounds: this.scopeElement.getBoundingClientRect(),
|
|
334
|
+
viewportSize: { width: window.innerWidth, height: window.innerHeight },
|
|
335
|
+
scrollOffset: { x: window.scrollX, y: window.scrollY },
|
|
336
|
+
offset: 8,
|
|
337
|
+
leftAlignRect: this.leftAlignElement?.getBoundingClientRect(),
|
|
338
|
+
});
|
|
336
339
|
}
|
|
337
340
|
|
|
338
341
|
/**
|
|
@@ -647,42 +650,6 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
647
650
|
nestedContainer.style.top = 'calc(var(--trigger-item-top) - var(--popover-height) / 2 + var(--item-height) / 2)';
|
|
648
651
|
}
|
|
649
652
|
|
|
650
|
-
/**
|
|
651
|
-
* Checks if popover should be opened bottom.
|
|
652
|
-
* It should happen when there is enough space below or not enough space above
|
|
653
|
-
*/
|
|
654
|
-
private get shouldOpenBottom(): boolean {
|
|
655
|
-
if (this.nodes.popover === undefined || this.nodes.popover === null) {
|
|
656
|
-
return false;
|
|
657
|
-
}
|
|
658
|
-
const popoverRect = this.nodes.popoverContainer.getBoundingClientRect();
|
|
659
|
-
const scopeElementRect = this.scopeElement.getBoundingClientRect();
|
|
660
|
-
const popoverHeight = this.size.height;
|
|
661
|
-
const popoverPotentialBottomEdge = popoverRect.top + popoverHeight;
|
|
662
|
-
const popoverPotentialTopEdge = popoverRect.top - popoverHeight;
|
|
663
|
-
const bottomEdgeForComparison = Math.min(window.innerHeight, scopeElementRect.bottom);
|
|
664
|
-
|
|
665
|
-
return popoverPotentialTopEdge < scopeElementRect.top || popoverPotentialBottomEdge <= bottomEdgeForComparison;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Checks if popover should be opened left.
|
|
670
|
-
* It should happen when there is enough space in the right or not enough space in the left
|
|
671
|
-
*/
|
|
672
|
-
private get shouldOpenRight(): boolean {
|
|
673
|
-
if (this.nodes.popover === undefined || this.nodes.popover === null) {
|
|
674
|
-
return false;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
const popoverRect = this.nodes.popover.getBoundingClientRect();
|
|
678
|
-
const scopeElementRect = this.scopeElement.getBoundingClientRect();
|
|
679
|
-
const popoverWidth = this.size.width;
|
|
680
|
-
const popoverPotentialRightEdge = popoverRect.right + popoverWidth;
|
|
681
|
-
const popoverPotentialLeftEdge = popoverRect.left - popoverWidth;
|
|
682
|
-
const rightEdgeForComparison = Math.min(window.innerWidth, scopeElementRect.right);
|
|
683
|
-
|
|
684
|
-
return popoverPotentialLeftEdge < scopeElementRect.left || popoverPotentialRightEdge <= rightEdgeForComparison;
|
|
685
|
-
}
|
|
686
653
|
|
|
687
654
|
/**
|
|
688
655
|
* Helps to calculate size of popover that is only resolved when popover is displayed on screen.
|
|
@@ -726,6 +693,13 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
726
693
|
return size;
|
|
727
694
|
}
|
|
728
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Invalidates the cached popover size so the next access to `size` re-measures.
|
|
698
|
+
*/
|
|
699
|
+
public invalidateSizeCache(): void {
|
|
700
|
+
this._size = undefined;
|
|
701
|
+
}
|
|
702
|
+
|
|
729
703
|
/**
|
|
730
704
|
* Returns list of elements available for keyboard navigation.
|
|
731
705
|
*/
|
|
@@ -1047,6 +1021,9 @@ export class PopoverDesktop extends PopoverAbstract {
|
|
|
1047
1021
|
item.toggleHidden(isHidden);
|
|
1048
1022
|
});
|
|
1049
1023
|
|
|
1024
|
+
// Invalidate size cache since item visibility changed
|
|
1025
|
+
this._size = undefined;
|
|
1026
|
+
|
|
1050
1027
|
// Reorder top-level DOM elements to reflect ranking
|
|
1051
1028
|
if (!isEmptyQuery && matchingTopLevel.length > 0) {
|
|
1052
1029
|
this.reorderItemsByRank(matchingTopLevel);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input for popover position resolution.
|
|
3
|
+
* All rects/sizes are in viewport coordinates unless noted.
|
|
4
|
+
*/
|
|
5
|
+
export interface PositionInput {
|
|
6
|
+
/** Bounding rect of the anchor element (trigger or popover container) */
|
|
7
|
+
anchor: DOMRect;
|
|
8
|
+
/** Measured popover dimensions */
|
|
9
|
+
popoverSize: { width: number; height: number };
|
|
10
|
+
/** Bounding rect of the scope element that constrains the popover */
|
|
11
|
+
scopeBounds: DOMRect;
|
|
12
|
+
/** Viewport dimensions */
|
|
13
|
+
viewportSize: { width: number; height: number };
|
|
14
|
+
/** Current scroll offset */
|
|
15
|
+
scrollOffset: { x: number; y: number };
|
|
16
|
+
/** Gap between anchor and popover edge (default 8) */
|
|
17
|
+
offset?: number;
|
|
18
|
+
/** Element rect whose left edge overrides anchor's left for horizontal alignment */
|
|
19
|
+
leftAlignRect?: DOMRect;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ResolvedPosition {
|
|
23
|
+
/** Final top coordinate in document (scroll-adjusted) coordinates */
|
|
24
|
+
top: number;
|
|
25
|
+
/** Final left coordinate in document (scroll-adjusted) coordinates */
|
|
26
|
+
left: number;
|
|
27
|
+
/** True if popover opens above the anchor */
|
|
28
|
+
openTop: boolean;
|
|
29
|
+
/** True if popover opens to the left of the anchor */
|
|
30
|
+
openLeft: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether the popover should flip to the alternate side.
|
|
35
|
+
* Returns true when the popover doesn't fit on the preferred side and the alternate side has more (or equal) space.
|
|
36
|
+
*/
|
|
37
|
+
function shouldFlip(popoverDimension: number, spaceOnPreferred: number, spaceOnAlternate: number): boolean {
|
|
38
|
+
if (popoverDimension <= spaceOnPreferred) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (popoverDimension <= spaceOnAlternate) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return spaceOnAlternate > spaceOnPreferred;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Pure function that resolves popover position.
|
|
51
|
+
* Picks the direction with more available space when the popover doesn't fit on the preferred side.
|
|
52
|
+
* Clamps to scope/viewport boundaries on both edges.
|
|
53
|
+
*/
|
|
54
|
+
export function resolvePosition(input: PositionInput): ResolvedPosition {
|
|
55
|
+
const {
|
|
56
|
+
anchor,
|
|
57
|
+
popoverSize,
|
|
58
|
+
scopeBounds,
|
|
59
|
+
viewportSize,
|
|
60
|
+
scrollOffset,
|
|
61
|
+
offset = 8,
|
|
62
|
+
leftAlignRect,
|
|
63
|
+
} = input;
|
|
64
|
+
|
|
65
|
+
// --- Vertical ---
|
|
66
|
+
const boundaryBottom = Math.min(viewportSize.height, scopeBounds.bottom);
|
|
67
|
+
const boundaryTop = Math.max(0, scopeBounds.top);
|
|
68
|
+
|
|
69
|
+
const spaceBelow = boundaryBottom - anchor.bottom - offset;
|
|
70
|
+
const spaceAbove = anchor.top - offset - boundaryTop;
|
|
71
|
+
|
|
72
|
+
const openTop = shouldFlip(popoverSize.height, spaceBelow, spaceAbove);
|
|
73
|
+
|
|
74
|
+
const rawTop = openTop
|
|
75
|
+
? anchor.top - offset - popoverSize.height + scrollOffset.y
|
|
76
|
+
: anchor.bottom + offset + scrollOffset.y;
|
|
77
|
+
|
|
78
|
+
// Clamp: ensure popover doesn't overflow above top boundary
|
|
79
|
+
const top = rawTop < boundaryTop + scrollOffset.y
|
|
80
|
+
? boundaryTop + scrollOffset.y
|
|
81
|
+
: rawTop;
|
|
82
|
+
|
|
83
|
+
// --- Horizontal ---
|
|
84
|
+
const boundaryRight = Math.min(viewportSize.width, scopeBounds.right);
|
|
85
|
+
const boundaryLeft = Math.max(0, scopeBounds.left);
|
|
86
|
+
|
|
87
|
+
const alignLeft = (leftAlignRect?.left ?? anchor.left) + scrollOffset.x;
|
|
88
|
+
const alignRight = anchor.right + scrollOffset.x;
|
|
89
|
+
|
|
90
|
+
const spaceRight = boundaryRight + scrollOffset.x - alignLeft;
|
|
91
|
+
const spaceLeft = alignRight - boundaryLeft - scrollOffset.x;
|
|
92
|
+
|
|
93
|
+
const openLeft = shouldFlip(popoverSize.width, spaceRight, spaceLeft);
|
|
94
|
+
|
|
95
|
+
const rawLeft = openLeft
|
|
96
|
+
? Math.max(boundaryLeft + scrollOffset.x, anchor.right - popoverSize.width + scrollOffset.x)
|
|
97
|
+
: alignLeft;
|
|
98
|
+
|
|
99
|
+
// Clamp: ensure popover doesn't overflow right boundary
|
|
100
|
+
const left = rawLeft + popoverSize.width > boundaryRight + scrollOffset.x
|
|
101
|
+
? Math.max(boundaryLeft + scrollOffset.x, boundaryRight + scrollOffset.x - popoverSize.width)
|
|
102
|
+
: rawLeft;
|
|
103
|
+
|
|
104
|
+
return { top, left, openTop, openLeft };
|
|
105
|
+
}
|
|
@@ -496,7 +496,14 @@ export const PickerNoActiveSwatch: Story = {
|
|
|
496
496
|
expect(swatches?.length).toBe(10);
|
|
497
497
|
|
|
498
498
|
swatches?.forEach((swatch) => {
|
|
499
|
-
|
|
499
|
+
// Default swatch correctly shows active ring when no color is set
|
|
500
|
+
if (swatch.getAttribute('data-blok-testid')?.endsWith('-default')) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Use classList.contains for exact token match — className.includes
|
|
505
|
+
// would false-positive on the hover:ring-swatch-ring-hover variant
|
|
506
|
+
expect(swatch.classList.contains('ring-swatch-ring-hover')).toBe(false);
|
|
500
507
|
});
|
|
501
508
|
},
|
|
502
509
|
TIMEOUT_ACTION
|