@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
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
// src/tools/callout/index.ts
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
API,
|
|
5
|
+
BlockTool,
|
|
6
|
+
BlockToolConstructorOptions,
|
|
7
|
+
ToolboxConfig,
|
|
8
|
+
ConversionConfig,
|
|
9
|
+
ToolSanitizerConfig,
|
|
10
|
+
} from '../../../types';
|
|
11
|
+
import type { MenuConfig } from '../../../types/tools/menu-config';
|
|
12
|
+
import { PopoverItemType } from '../../components/utils/popover';
|
|
13
|
+
import type { CalloutData, CalloutConfig } from './types';
|
|
14
|
+
import { buildCalloutDOM, type CalloutDOMRefs } from './dom-builder';
|
|
15
|
+
import { saveCallout } from './block-operations';
|
|
16
|
+
import { handleCalloutFirstChildBackspace } from './callout-keyboard';
|
|
17
|
+
import { createColorPicker, type ColorPickerHandle } from '../../components/shared/color-picker';
|
|
18
|
+
import { colorVarName } from '../../components/shared/color-presets';
|
|
19
|
+
import { mapToNearestPresetName } from '../../components/utils/color-mapping';
|
|
20
|
+
import { EmojiPicker } from './emoji-picker';
|
|
21
|
+
import { IconCallout, IconEmojiSmile, IconPaintRoller } from '../../components/icons';
|
|
22
|
+
import {
|
|
23
|
+
TOOL_NAME,
|
|
24
|
+
COLOR_KEY,
|
|
25
|
+
EDIT_ICON_KEY,
|
|
26
|
+
ADD_EMOJI_KEY,
|
|
27
|
+
DEFAULT_EMOJI,
|
|
28
|
+
} from './constants';
|
|
29
|
+
|
|
30
|
+
export class CalloutTool implements BlockTool {
|
|
31
|
+
private readonly api: API;
|
|
32
|
+
private readonly readOnly: boolean;
|
|
33
|
+
private _data: CalloutData;
|
|
34
|
+
private _dom: CalloutDOMRefs | null = null;
|
|
35
|
+
private _emojiPicker: EmojiPicker | null = null;
|
|
36
|
+
private _colorPicker: ColorPickerHandle | null = null;
|
|
37
|
+
private blockId?: string;
|
|
38
|
+
|
|
39
|
+
constructor({ data, api, readOnly, block }: BlockToolConstructorOptions<CalloutData, CalloutConfig>) {
|
|
40
|
+
this.api = api;
|
|
41
|
+
this.readOnly = readOnly;
|
|
42
|
+
this._data = this.normalizeData(data);
|
|
43
|
+
|
|
44
|
+
if (block) {
|
|
45
|
+
this.blockId = block.id;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private normalizeData(data: Partial<CalloutData>): CalloutData {
|
|
50
|
+
return {
|
|
51
|
+
emoji: typeof data.emoji === 'string' ? data.emoji : DEFAULT_EMOJI,
|
|
52
|
+
textColor: typeof data.textColor === 'string' ? data.textColor : null,
|
|
53
|
+
backgroundColor: typeof data.backgroundColor === 'string' ? data.backgroundColor : null,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public render(): HTMLElement {
|
|
58
|
+
const dom = buildCalloutDOM({
|
|
59
|
+
emoji: this._data.emoji,
|
|
60
|
+
readOnly: this.readOnly,
|
|
61
|
+
addEmojiLabel: this.api.i18n.t(ADD_EMOJI_KEY),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
this._dom = dom;
|
|
65
|
+
this.applyColors();
|
|
66
|
+
|
|
67
|
+
if (!this.readOnly) {
|
|
68
|
+
dom.emojiButton.addEventListener('click', () => this.openEmojiPicker());
|
|
69
|
+
dom.emojiButton.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
70
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
this.openEmojiPicker();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Backspace delegation: intercept on first child block when it's empty
|
|
77
|
+
dom.childContainer.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
78
|
+
if (e.key === 'Backspace') {
|
|
79
|
+
this.handleChildBackspace(e);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return dom.wrapper;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public rendered(): void {
|
|
88
|
+
if (this.blockId === undefined || this._dom === null) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const children = this.api.blocks.getChildren(this.blockId);
|
|
93
|
+
|
|
94
|
+
// Append existing children to the container
|
|
95
|
+
for (const child of children) {
|
|
96
|
+
if (child.holder.parentElement !== this._dom.childContainer) {
|
|
97
|
+
this._dom.childContainer.appendChild(child.holder);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Auto-create initial paragraph child when callout has no children
|
|
102
|
+
if (children.length === 0) {
|
|
103
|
+
const blockIndex = this.api.blocks.getBlockIndex(this.blockId);
|
|
104
|
+
|
|
105
|
+
if (blockIndex !== undefined) {
|
|
106
|
+
const newBlock = this.api.blocks.insertInsideParent(this.blockId, blockIndex + 1);
|
|
107
|
+
|
|
108
|
+
// Manually append the new child's holder — insertInsideParent places it in the
|
|
109
|
+
// flat block list but doesn't know about our childContainer DOM.
|
|
110
|
+
this._dom.childContainer.appendChild(newBlock.holder);
|
|
111
|
+
|
|
112
|
+
this.api.caret.setToBlock(newBlock.id, 'start');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public save(): CalloutData {
|
|
118
|
+
return saveCallout({
|
|
119
|
+
emoji: this._data.emoji,
|
|
120
|
+
textColor: this._data.textColor,
|
|
121
|
+
backgroundColor: this._data.backgroundColor,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public validate(_data: CalloutData): boolean {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public renderSettings(): MenuConfig {
|
|
130
|
+
if (this._colorPicker === null) {
|
|
131
|
+
const picker = createColorPicker({
|
|
132
|
+
i18n: this.api.i18n,
|
|
133
|
+
testIdPrefix: 'callout-color',
|
|
134
|
+
modes: [
|
|
135
|
+
{ key: 'color', labelKey: 'tools.marker.textColor', presetField: 'text' },
|
|
136
|
+
{ key: 'background-color', labelKey: 'tools.marker.background', presetField: 'bg' },
|
|
137
|
+
],
|
|
138
|
+
onColorSelect: (color, modeKey) => {
|
|
139
|
+
const presetName = color !== null ? mapToNearestPresetName(color, modeKey === 'color' ? 'text' : 'bg') : null;
|
|
140
|
+
|
|
141
|
+
if (modeKey === 'color') {
|
|
142
|
+
this._data.textColor = presetName;
|
|
143
|
+
} else {
|
|
144
|
+
this._data.backgroundColor = presetName;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
picker.setActiveColor(color, modeKey);
|
|
148
|
+
this.applyColors();
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
this._colorPicker = picker;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Sync active state with current data
|
|
156
|
+
this.syncPickerActiveColors();
|
|
157
|
+
|
|
158
|
+
return [
|
|
159
|
+
{
|
|
160
|
+
icon: IconEmojiSmile,
|
|
161
|
+
title: this.api.i18n.t(EDIT_ICON_KEY),
|
|
162
|
+
name: 'callout-edit-icon',
|
|
163
|
+
closeOnActivate: true,
|
|
164
|
+
onActivate: (): void => this.openEmojiPicker(),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
icon: IconPaintRoller,
|
|
168
|
+
title: this.api.i18n.t(COLOR_KEY),
|
|
169
|
+
name: 'callout-color',
|
|
170
|
+
children: {
|
|
171
|
+
items: [
|
|
172
|
+
{
|
|
173
|
+
type: PopoverItemType.Html,
|
|
174
|
+
element: this._colorPicker.element,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public removed(): void {
|
|
183
|
+
// No-op — no subscriptions to clean up
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private syncPickerActiveColors(): void {
|
|
187
|
+
if (this._colorPicker === null) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const textName = this._data.textColor;
|
|
192
|
+
const bgName = this._data.backgroundColor;
|
|
193
|
+
|
|
194
|
+
// The picker expects hex values; convert from preset name by looking up the light preset
|
|
195
|
+
// The picker's internal `colorsEqual` handles the comparison regardless of theme
|
|
196
|
+
this._colorPicker.setActiveColor(
|
|
197
|
+
textName !== null ? colorVarName(textName, 'text') : null,
|
|
198
|
+
'color'
|
|
199
|
+
);
|
|
200
|
+
this._colorPicker.setActiveColor(
|
|
201
|
+
bgName !== null ? colorVarName(bgName, 'bg') : null,
|
|
202
|
+
'background-color'
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private applyColors(): void {
|
|
207
|
+
if (this._dom === null) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const { textColor, backgroundColor } = this._data;
|
|
212
|
+
|
|
213
|
+
if (textColor !== null) {
|
|
214
|
+
this._dom.wrapper.style.color = colorVarName(textColor, 'text');
|
|
215
|
+
} else {
|
|
216
|
+
this._dom.wrapper.style.color = '';
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (backgroundColor !== null) {
|
|
220
|
+
const bgVar = colorVarName(backgroundColor, 'bg');
|
|
221
|
+
|
|
222
|
+
this._dom.wrapper.style.backgroundColor = bgVar;
|
|
223
|
+
this._dom.wrapper.style.border = '';
|
|
224
|
+
this._dom.wrapper.style.setProperty('--blok-search-input-bg', `light-dark(color-mix(in srgb, ${bgVar} 70%, white), color-mix(in srgb, ${bgVar} 85%, white))`);
|
|
225
|
+
} else {
|
|
226
|
+
this._dom.wrapper.style.backgroundColor = '';
|
|
227
|
+
this._dom.wrapper.style.border = '1px solid var(--blok-callout-default-border, #e5e7eb)';
|
|
228
|
+
this._dom.wrapper.style.removeProperty('--blok-search-input-bg');
|
|
229
|
+
this._dom.wrapper.style.removeProperty('--blok-search-input-border');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
private handleChildBackspace(e: KeyboardEvent): void {
|
|
234
|
+
if (this.blockId === undefined || this._dom === null) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const children = this.api.blocks.getChildren(this.blockId);
|
|
239
|
+
|
|
240
|
+
if (children.length === 0) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const firstChild = children[0];
|
|
245
|
+
|
|
246
|
+
// Only handle when the event target is inside the first child block
|
|
247
|
+
const target = e.target as HTMLElement;
|
|
248
|
+
|
|
249
|
+
if (!firstChild.holder.contains(target)) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Only handle when the first child is empty and caret is at start
|
|
254
|
+
const selection = window.getSelection();
|
|
255
|
+
const isAtStart = selection !== null &&
|
|
256
|
+
selection.rangeCount > 0 &&
|
|
257
|
+
selection.getRangeAt(0).startOffset === 0 &&
|
|
258
|
+
selection.getRangeAt(0).collapsed;
|
|
259
|
+
const isEmpty = firstChild.holder.textContent === '';
|
|
260
|
+
|
|
261
|
+
if (!isEmpty || !isAtStart) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
void handleCalloutFirstChildBackspace({
|
|
266
|
+
api: this.api,
|
|
267
|
+
calloutBlockId: this.blockId,
|
|
268
|
+
firstChildBlockId: firstChild.id,
|
|
269
|
+
event: e,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
private openEmojiPicker(): void {
|
|
274
|
+
if (this._dom === null) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (this._emojiPicker === null) {
|
|
279
|
+
this._emojiPicker = new EmojiPicker({
|
|
280
|
+
onSelect: (native: string) => this.setEmoji(native),
|
|
281
|
+
onRemove: () => this.setEmoji(''),
|
|
282
|
+
i18n: this.api.i18n,
|
|
283
|
+
locale: this.api.i18n.getLocale(),
|
|
284
|
+
});
|
|
285
|
+
document.body.appendChild(this._emojiPicker.getElement());
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
void this._emojiPicker.open(this._dom.emojiButton);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private setEmoji(native: string): void {
|
|
292
|
+
this._data.emoji = native;
|
|
293
|
+
|
|
294
|
+
if (this._dom === null) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
this._dom.emojiButton.textContent = native;
|
|
299
|
+
this._dom.emojiButton.setAttribute(
|
|
300
|
+
'aria-label',
|
|
301
|
+
native !== '' ? native : this.api.i18n.t(ADD_EMOJI_KEY)
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public static get toolbox(): ToolboxConfig {
|
|
306
|
+
return {
|
|
307
|
+
icon: IconCallout,
|
|
308
|
+
title: 'Callout',
|
|
309
|
+
titleKey: 'callout',
|
|
310
|
+
name: TOOL_NAME,
|
|
311
|
+
searchTerms: ['callout', 'note', 'info', 'warning', 'tip', 'alert'],
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
public static get conversionConfig(): ConversionConfig<CalloutData> {
|
|
316
|
+
return {
|
|
317
|
+
import: (): CalloutData => ({
|
|
318
|
+
emoji: DEFAULT_EMOJI,
|
|
319
|
+
textColor: null,
|
|
320
|
+
backgroundColor: null,
|
|
321
|
+
}),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
public static get sanitize(): ToolSanitizerConfig {
|
|
326
|
+
return {
|
|
327
|
+
emoji: false,
|
|
328
|
+
textColor: false,
|
|
329
|
+
backgroundColor: false,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
public static get isReadOnlySupported(): boolean {
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export type { CalloutData, CalloutConfig };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/tools/callout/types.ts
|
|
2
|
+
|
|
3
|
+
import type { BlockToolData } from '../../../types';
|
|
4
|
+
|
|
5
|
+
export interface CalloutData extends BlockToolData {
|
|
6
|
+
emoji: string;
|
|
7
|
+
textColor: string | null;
|
|
8
|
+
backgroundColor: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface CalloutConfig {}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { API } from '../../../types';
|
|
11
11
|
|
|
12
12
|
import { isCaretAtStartOfInput } from '../../components/utils/caret';
|
|
13
|
-
import { splitContentAtRange } from '../toggle/toggle-keyboard';
|
|
13
|
+
import { getInsertAfterLastDescendantIndex, splitContentAtRange } from '../toggle/toggle-keyboard';
|
|
14
14
|
|
|
15
15
|
export interface HeaderToggleKeyboardContext {
|
|
16
16
|
api: API;
|
|
@@ -57,7 +57,8 @@ export const handleHeaderToggleEnter = async (
|
|
|
57
57
|
// Caret at end of an open toggle heading → insert child paragraph.
|
|
58
58
|
// insertInsideParent() groups both block creation and parent assignment into
|
|
59
59
|
// a single Yjs undo entry, so one CMD+Z removes the new block completely.
|
|
60
|
-
const
|
|
60
|
+
const insertIndex = getInsertAfterLastDescendantIndex(api, blockId, currentBlockIndex);
|
|
61
|
+
const newBlock = api.blocks.insertInsideParent(blockId, insertIndex);
|
|
61
62
|
|
|
62
63
|
api.caret.setToBlock(newBlock.id, 'start');
|
|
63
64
|
|
|
@@ -183,7 +183,7 @@ export class Header implements BlockTool {
|
|
|
183
183
|
this.readOnly = readOnly;
|
|
184
184
|
this._settings = config || {};
|
|
185
185
|
this._data = this.normalizeData(data);
|
|
186
|
-
this._isOpen = this._data.isOpen ??
|
|
186
|
+
this._isOpen = this._data.isOpen ?? true;
|
|
187
187
|
this._element = this.getTag();
|
|
188
188
|
|
|
189
189
|
if (block) {
|
package/src/tools/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { Header } from './header';
|
|
|
25
25
|
export { ListItem as List } from './list';
|
|
26
26
|
export { Table } from './table';
|
|
27
27
|
export { ToggleItem as Toggle } from './toggle';
|
|
28
|
+
export { CalloutTool as Callout } from './callout';
|
|
28
29
|
|
|
29
30
|
// Inline tools
|
|
30
31
|
export { BoldInlineTool as Bold } from '../components/inline-tools/inline-tool-bold';
|
|
@@ -43,6 +44,7 @@ export const defaultBlockTools = {
|
|
|
43
44
|
list: {},
|
|
44
45
|
table: {},
|
|
45
46
|
toggle: {},
|
|
47
|
+
callout: {},
|
|
46
48
|
} as const;
|
|
47
49
|
|
|
48
50
|
export const defaultInlineTools = {
|
|
@@ -50,7 +50,7 @@ export class ToggleItem implements BlockTool {
|
|
|
50
50
|
this.readOnly = readOnly;
|
|
51
51
|
this._settings = config || {};
|
|
52
52
|
this._data = this.normalizeData(data);
|
|
53
|
-
this._isOpen = this._data.isOpen ??
|
|
53
|
+
this._isOpen = this._data.isOpen ?? true;
|
|
54
54
|
|
|
55
55
|
if (block) {
|
|
56
56
|
this.blockId = block.id;
|
|
@@ -61,7 +61,8 @@ export const handleToggleEnter = async (context: ToggleKeyboardContext): Promise
|
|
|
61
61
|
* a single Yjs undo entry, so one CMD+Z removes the new block completely.
|
|
62
62
|
*/
|
|
63
63
|
if (isOpen && afterContent === '') {
|
|
64
|
-
const
|
|
64
|
+
const insertIndex = getInsertAfterLastDescendantIndex(api, blockId, currentBlockIndex);
|
|
65
|
+
const newBlock = api.blocks.insertInsideParent(blockId, insertIndex);
|
|
65
66
|
|
|
66
67
|
api.caret.setToBlock(newBlock.id, 'start');
|
|
67
68
|
|
|
@@ -122,6 +123,33 @@ export const handleToggleBackspace = async (
|
|
|
122
123
|
await api.blocks.convert(blockId, 'paragraph', { text });
|
|
123
124
|
};
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Returns the flat-array index at which a new child should be inserted so that
|
|
128
|
+
* it appears as the **last** child of `parentId`. Walks descendants recursively
|
|
129
|
+
* so nested toggles are accounted for.
|
|
130
|
+
*
|
|
131
|
+
* @param api - Blocks API
|
|
132
|
+
* @param parentId - ID of the parent block
|
|
133
|
+
* @param parentIndex - Flat-array index of the parent block
|
|
134
|
+
* @returns The insertion index (one past the last descendant)
|
|
135
|
+
*/
|
|
136
|
+
export const getInsertAfterLastDescendantIndex = (
|
|
137
|
+
api: Pick<API, 'blocks'>,
|
|
138
|
+
parentId: string,
|
|
139
|
+
parentIndex: number
|
|
140
|
+
): number => {
|
|
141
|
+
const children = api.blocks.getChildren(parentId);
|
|
142
|
+
|
|
143
|
+
if (children.length === 0) {
|
|
144
|
+
return parentIndex + 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const lastChild = children[children.length - 1];
|
|
148
|
+
const lastChildIndex = api.blocks.getBlockIndex(lastChild.id) ?? parentIndex;
|
|
149
|
+
|
|
150
|
+
return getInsertAfterLastDescendantIndex(api, lastChild.id, lastChildIndex);
|
|
151
|
+
};
|
|
152
|
+
|
|
125
153
|
/**
|
|
126
154
|
* Split content element's HTML at the given range position.
|
|
127
155
|
*
|
package/types/api/i18n.d.ts
CHANGED
|
@@ -27,4 +27,11 @@ export interface I18n {
|
|
|
27
27
|
* @returns English translation string, or empty string if not found
|
|
28
28
|
*/
|
|
29
29
|
getEnglishTranslation(key: string): string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the current locale code.
|
|
33
|
+
*
|
|
34
|
+
* @returns The active locale code (e.g., 'en', 'fr', 'ja')
|
|
35
|
+
*/
|
|
36
|
+
getLocale(): string;
|
|
30
37
|
}
|
package/types/tools-entry.d.ts
CHANGED
|
@@ -32,8 +32,6 @@ export const Italic: InlineToolConstructable;
|
|
|
32
32
|
export const Link: InlineToolConstructable;
|
|
33
33
|
export const Convert: InlineToolConstructable;
|
|
34
34
|
export const Marker: InlineToolConstructable;
|
|
35
|
-
export const Strikethrough: InlineToolConstructable;
|
|
36
|
-
export const Underline: InlineToolConstructable;
|
|
37
35
|
|
|
38
36
|
// Block tunes
|
|
39
37
|
export const Delete: BlockTuneConstructable;
|
|
@@ -56,6 +54,4 @@ export const defaultInlineTools: {
|
|
|
56
54
|
readonly italic: {};
|
|
57
55
|
readonly link: {};
|
|
58
56
|
readonly marker: {};
|
|
59
|
-
readonly strikethrough: {};
|
|
60
|
-
readonly underline: {};
|
|
61
57
|
};
|
|
File without changes
|
|
File without changes
|