@jackuait/blok 0.7.3-beta.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blok.mjs +2 -2
- package/dist/chunks/{blok-CdxHhr5i.mjs → blok-CdiMFzDz.mjs} +2256 -2141
- package/dist/chunks/{constants-C_H9o9Ao.mjs → constants-CjWRVOdm.mjs} +227 -190
- package/dist/chunks/{i18next-loader-D5HxE5ZQ.mjs → i18next-loader-p-7ioTwr.mjs} +1 -1
- package/dist/chunks/{lightweight-i18n-Safdy0ua.mjs → lightweight-i18n-BPeH69Dl.mjs} +14 -1
- package/dist/{messages-BbLCMWln2.mjs → chunks/messages--aM83pib2.mjs} +14 -1
- package/dist/chunks/{messages-ni0ahgYk2.mjs → messages-4OvVdaG52.mjs} +14 -1
- package/dist/chunks/{messages-DnPkoMz1.mjs → messages-5ohIWynJ.mjs} +14 -1
- package/dist/chunks/{messages-BjkDJuqh.mjs → messages-5thhSeME.mjs} +14 -1
- package/dist/chunks/{messages-hngFJrES2.mjs → messages-8pf7gRQm2.mjs} +14 -1
- package/dist/{messages-eCyczLYY.mjs → chunks/messages-B-i-d1Bc.mjs} +14 -1
- package/dist/chunks/{messages-CRxkRJRN.mjs → messages-B9zocutJ.mjs} +14 -1
- package/dist/{messages-pgqtPci-.mjs → chunks/messages-BAC7nLeM.mjs} +14 -1
- package/dist/chunks/{messages-DjOY_EqX.mjs → messages-BARPMN7R.mjs} +14 -1
- package/dist/{messages-Bsz7Qgj_.mjs → chunks/messages-BAgTIgPH.mjs} +15 -2
- package/dist/chunks/{messages-Cb-x47kY2.mjs → messages-BDTgiBJY2.mjs} +14 -1
- package/dist/chunks/{messages-BM1Su_Uy2.mjs → messages-BHf_VcXb2.mjs} +14 -1
- package/dist/{messages-wRvz0vQ3.mjs → chunks/messages-BIrkzbBP.mjs} +14 -1
- package/dist/{messages-DB9U3VIh.mjs → chunks/messages-BKjLgO5d.mjs} +14 -1
- package/dist/{messages-gldjQk7M.mjs → chunks/messages-BMzmli1K.mjs} +14 -1
- package/dist/chunks/{messages-CficsmSH2.mjs → messages-BO_jtRbZ2.mjs} +14 -1
- package/dist/chunks/{messages-kHTrX3wo2.mjs → messages-B_fFjpX12.mjs} +14 -1
- package/dist/{messages-BU9luYgO.mjs → chunks/messages-Bdk5tBNu.mjs} +14 -1
- package/dist/{messages-CRMZ79Xf.mjs → chunks/messages-BgaGPFuy2.mjs} +14 -1
- package/dist/{messages-DCOKudVN.mjs → chunks/messages-BsYzg2le.mjs} +14 -1
- package/dist/{messages-B9qltgXa.mjs → chunks/messages-BtS6JWMT.mjs} +14 -1
- package/dist/{messages-Cgy54529.mjs → chunks/messages-BvlSf_pu.mjs} +14 -1
- package/dist/{messages-oH0ADQ362.mjs → chunks/messages-C03I_oR-2.mjs} +14 -1
- package/dist/{messages-C8iAUPzI.mjs → chunks/messages-CDJLoStb.mjs} +14 -1
- package/dist/chunks/{messages-ClOxDE0y2.mjs → messages-CH_cexo62.mjs} +14 -1
- package/dist/{messages-DkkrjINb2.mjs → chunks/messages-CIBuZccC.mjs} +14 -1
- package/dist/chunks/{messages-BZ45xBlV.mjs → messages-CIZkNCpW.mjs} +14 -1
- package/dist/{messages-CJYE0_hr2.mjs → chunks/messages-CIugNDDO2.mjs} +14 -1
- package/dist/chunks/{messages-Cn5n0nHe2.mjs → messages-COkQfKa72.mjs} +14 -1
- package/dist/{messages-Bw-GC0m5.mjs → chunks/messages-CSpfBhlK2.mjs} +14 -1
- package/dist/chunks/{messages-tBHnC2Rj2.mjs → messages-CWp6-Y8f2.mjs} +14 -1
- package/dist/chunks/{messages-CteKp81J.mjs → messages-Co4WFeQ8.mjs} +14 -1
- package/dist/chunks/{messages-IJhiftj5.mjs → messages-CoRQE_Jc.mjs} +14 -1
- package/dist/{messages-DGZQXeav2.mjs → chunks/messages-CuRN1_ep2.mjs} +14 -1
- package/dist/{messages-BwdowdYD.mjs → chunks/messages-D0IKicWg.mjs} +14 -1
- package/dist/chunks/{messages-1C3OS98e.mjs → messages-D14soBOO.mjs} +14 -1
- package/dist/chunks/{messages-nE9Ko73n2.mjs → messages-D1SqLcxI2.mjs} +14 -1
- package/dist/{messages-COU4L-pL2.mjs → chunks/messages-D2uBlGXR2.mjs} +14 -1
- package/dist/chunks/{messages-DDr8J4FE.mjs → messages-DDpgr0B1.mjs} +14 -1
- package/dist/chunks/{messages-C232njMF2.mjs → messages-DEGzGmEQ2.mjs} +14 -1
- package/dist/chunks/{messages-6z-ULVyk.mjs → messages-DKChC8Qu.mjs} +14 -1
- package/dist/{messages-BP8ZuVaD.mjs → chunks/messages-DKCoHa5D.mjs} +14 -1
- package/dist/{messages-ruU_e2LK.mjs → chunks/messages-DPoPrTiZ.mjs} +14 -1
- package/dist/chunks/{messages-DziA-L3p.mjs → messages-DQOk-dTH.mjs} +14 -1
- package/dist/chunks/{messages-uLIUXFmU.mjs → messages-DUp8NnKT.mjs} +15 -2
- package/dist/chunks/{messages-rJdSnvyi.mjs → messages-DVg69mRj.mjs} +14 -1
- package/dist/chunks/{messages-Cq6wj6FG.mjs → messages-DeLzropc.mjs} +14 -1
- package/dist/chunks/{messages-DDRCk44J2.mjs → messages-Df69rfTF2.mjs} +15 -2
- package/dist/chunks/{messages-6EJxSImH.mjs → messages-DfsHFEWa.mjs} +14 -1
- package/dist/{messages-MaHxNgKA.mjs → chunks/messages-DgZnRQRS.mjs} +14 -1
- package/dist/{messages-B8M4YRFO2.mjs → chunks/messages-DhGHk-Ma2.mjs} +14 -1
- package/dist/{messages-3aRjZXpv.mjs → chunks/messages-Di7mfvB8.mjs} +14 -1
- package/dist/chunks/{messages-C1iQkKu82.mjs → messages-DlM9TmqS2.mjs} +14 -1
- package/dist/chunks/{messages-CejEH4FW2.mjs → messages-DmrsEYQm2.mjs} +14 -1
- package/dist/chunks/{messages-DK6pBwD2.mjs → messages-Dr-Ig3sw.mjs} +14 -1
- package/dist/{messages-BOxe7ewT.mjs → chunks/messages-DrXNb1gu.mjs} +14 -1
- package/dist/chunks/{messages-CvLXClh9.mjs → messages-EDTq4Q52.mjs} +14 -1
- package/dist/{messages-huTzItxA.mjs → chunks/messages-Ehx9YYeb2.mjs} +14 -1
- package/dist/chunks/{messages-CxTq0x772.mjs → messages-FCmAVA792.mjs} +14 -1
- package/dist/{messages-q7HzQPVt.mjs → chunks/messages-LL3Tflph.mjs} +14 -1
- package/dist/chunks/{messages-D9qyilS0.mjs → messages-N72K1hw3.mjs} +14 -1
- package/dist/chunks/{messages-C9XSSqS5.mjs → messages-Nz8C7Znm.mjs} +15 -2
- package/dist/{messages-e-KHuxtY2.mjs → chunks/messages-OIelQDL32.mjs} +14 -1
- package/dist/{messages-BQJzUYP-.mjs → chunks/messages-SsrFJhTN.mjs} +14 -1
- package/dist/{messages-CVBsztOg.mjs → chunks/messages-ohtcmr1w.mjs} +14 -1
- package/dist/chunks/{messages-CVzvKl6U.mjs → messages-stUQR58d.mjs} +14 -1
- package/dist/{messages-DlrZrm3s.mjs → chunks/messages-wUoSWFsJ2.mjs} +14 -1
- package/dist/chunks/{tools-B0YXCZFW.mjs → tools-B5yNeTZh.mjs} +1286 -872
- package/dist/full.mjs +15 -13
- package/dist/locales.mjs +81 -68
- package/dist/{messages-mVFAkdcY.mjs → messages-1_FCq0It.mjs} +14 -1
- package/dist/{chunks/messages-DoDbCS02.mjs → messages-8zo-T-Nx2.mjs} +14 -1
- package/dist/{chunks/messages-DacahKek.mjs → messages-B21zLG6b.mjs} +14 -1
- package/dist/{messages-BBgyeB_N.mjs → messages-B9ythxux.mjs} +14 -1
- package/dist/{messages-C_RPN2GV.mjs → messages-BAZK-8Zb.mjs} +14 -1
- package/dist/{messages-D6Sr5cUE.mjs → messages-BB8umWL1.mjs} +14 -1
- package/dist/{chunks/messages-Dhe8_mnQ.mjs → messages-BD_U2EnE.mjs} +14 -1
- package/dist/{messages-6G0Eia-2.mjs → messages-BRC9E_sp.mjs} +14 -1
- package/dist/{chunks/messages-BUy3odZo.mjs → messages-BSLYh59S.mjs} +14 -1
- package/dist/{messages-K7ROT6ea.mjs → messages-BSwhWcYw.mjs} +14 -1
- package/dist/{messages-BztXgybv2.mjs → messages-BTR3QlIb2.mjs} +14 -1
- package/dist/{messages-C0gyqo4h2.mjs → messages-BZXBdD_S2.mjs} +14 -1
- package/dist/{messages-BlnZ8CkJ2.mjs → messages-Bm8I_Li12.mjs} +15 -2
- package/dist/{chunks/messages-BKtWlK39.mjs → messages-BrcgNZOJ.mjs} +14 -1
- package/dist/{messages-Be1CCcsp2.mjs → messages-BzZ8LahA2.mjs} +14 -1
- package/dist/{chunks/messages-B_90PYaG.mjs → messages-C4HpNHfK.mjs} +14 -1
- package/dist/{chunks/messages-m6bLP64R2.mjs → messages-C5hD5pSd2.mjs} +14 -1
- package/dist/{chunks/messages-C3AJz_i6.mjs → messages-C7Rz00Tp.mjs} +14 -1
- package/dist/{chunks/messages-C1lqY56F2.mjs → messages-C92tAUYT2.mjs} +14 -1
- package/dist/{messages-Kye1BINC.mjs → messages-C9LsEUfG.mjs} +14 -1
- package/dist/{chunks/messages-tg78NAmW.mjs → messages-CHWfj4ik.mjs} +14 -1
- package/dist/{messages-CaJRIGUu2.mjs → messages-CHeucLGl2.mjs} +14 -1
- package/dist/{chunks/messages-DcPtg90i.mjs → messages-CIxT1nSh.mjs} +14 -1
- package/dist/{messages-C7R0m6oE2.mjs → messages-CKX9iXIb2.mjs} +14 -1
- package/dist/{messages-CzSLUJQt.mjs → messages-CKmmJ9tW.mjs} +14 -1
- package/dist/{messages-DpY9s4Qi2.mjs → messages-CTFwu5-h2.mjs} +14 -1
- package/dist/{messages-DAssrN5L2.mjs → messages-CTPFrtK92.mjs} +14 -1
- package/dist/{messages-BZgGD0zf2.mjs → messages-CWzET_9H2.mjs} +14 -1
- package/dist/{messages-CkmVEyEQ2.mjs → messages-CkIRmpfZ2.mjs} +14 -1
- package/dist/{messages-B2bHgIcC2.mjs → messages-CmoTIebG2.mjs} +14 -1
- package/dist/{messages-DZbsds_k2.mjs → messages-Co26RSCV2.mjs} +14 -1
- package/dist/{messages-DrouoDgp.mjs → messages-CqNzlpWi.mjs} +15 -2
- package/dist/{messages-m1uf_AMy2.mjs → messages-CrWsU4Xw2.mjs} +14 -1
- package/dist/{messages-TseLyyoU.mjs → messages-CsmTziC6.mjs} +14 -1
- package/dist/{messages-CAffVeAE2.mjs → messages-CsnglxbV2.mjs} +14 -1
- package/dist/{messages-CE305J0p.mjs → messages-Cu7Lr1wp.mjs} +14 -1
- package/dist/{chunks/messages-Ul43l29K2.mjs → messages-Cy3Ne_M9.mjs} +14 -1
- package/dist/{chunks/messages-CzCqu58X2.mjs → messages-CzZAfGif.mjs} +14 -1
- package/dist/{messages-C_4VGaBC.mjs → messages-D5rnT-BC.mjs} +14 -1
- package/dist/{chunks/messages-yJmwc3zD.mjs → messages-D8iCBMg7.mjs} +14 -1
- package/dist/{chunks/messages-BtNOlsMj.mjs → messages-DDJOu049.mjs} +14 -1
- package/dist/{chunks/messages-CnzaTbel.mjs → messages-DDiP6yex.mjs} +14 -1
- package/dist/{chunks/messages-DotEkUpQ.mjs → messages-DHJ1fZLL.mjs} +14 -1
- package/dist/{chunks/messages-3ePgbbpx2.mjs → messages-DToWAonn2.mjs} +14 -1
- package/dist/{messages-BxQ1gzJF2.mjs → messages-DV29fJMD2.mjs} +14 -1
- package/dist/{chunks/messages-DJWRON2S.mjs → messages-D_-rh8gl.mjs} +14 -1
- package/dist/{chunks/messages-D6SAC8Lc2.mjs → messages-D_cAZ4Ic2.mjs} +14 -1
- package/dist/{chunks/messages-pKUiAqlX2.mjs → messages-Dc7ZzqYN.mjs} +14 -1
- package/dist/{chunks/messages-JRavIeeW.mjs → messages-DiSeSE8p.mjs} +14 -1
- package/dist/{chunks/messages-DbS9Oibb.mjs → messages-Djhu5RJd.mjs} +14 -1
- package/dist/{messages-BdJ1lCo_.mjs → messages-Dr9L1psl.mjs} +15 -2
- package/dist/{messages-voUPclMU.mjs → messages-EIeWKoc5.mjs} +14 -1
- package/dist/{messages-GrVSCmXW.mjs → messages-EwoT2jof.mjs} +14 -1
- package/dist/{chunks/messages-B_nVGWdk.mjs → messages-F7cRf-20.mjs} +14 -1
- package/dist/{chunks/messages-Dxrg70jo.mjs → messages-JZhs_0pf.mjs} +14 -1
- package/dist/{messages-CB0RKGVM.mjs → messages-JwMkLben.mjs} +14 -1
- package/dist/{messages-Cb5JJ8C_2.mjs → messages-LyzjEEIj2.mjs} +14 -1
- package/dist/{chunks/messages-DQ4VyVJf2.mjs → messages-SepwOOcg.mjs} +14 -1
- package/dist/{chunks/messages-DfTU2I8J.mjs → messages-TI0u6Ked.mjs} +14 -1
- package/dist/{chunks/messages-D7aoKTPD.mjs → messages-Tx25QErT.mjs} +14 -1
- package/dist/{chunks/messages-D9nReG4C2.mjs → messages-bRqMCja-2.mjs} +14 -1
- package/dist/{chunks/messages-h474TGR72.mjs → messages-lEyiemqU2.mjs} +14 -1
- package/dist/{messages-BENRci-_2.mjs → messages-mVLfVtQX2.mjs} +14 -1
- package/dist/{messages-CEhkWwqI.mjs → messages-ouO9js8Z.mjs} +14 -1
- package/dist/{messages--XEfVx572.mjs → messages-ouRGTAKo2.mjs} +14 -1
- package/dist/{chunks/messages-DNrK8lCg2.mjs → messages-qV14y_oA2.mjs} +14 -1
- package/dist/{chunks/messages-Yk__PXZQ.mjs → messages-rM6YFLZH.mjs} +15 -2
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +3 -3
- package/package.json +2 -2
- package/src/components/block/style-manager.ts +1 -1
- package/src/components/blocks.ts +26 -54
- package/src/components/constants/data-attributes.ts +0 -2
- package/src/components/i18n/locales/am/messages.json +14 -1
- package/src/components/i18n/locales/ar/messages.json +14 -1
- package/src/components/i18n/locales/az/messages.json +14 -1
- package/src/components/i18n/locales/bg/messages.json +15 -2
- package/src/components/i18n/locales/bn/messages.json +14 -1
- package/src/components/i18n/locales/bs/messages.json +14 -1
- package/src/components/i18n/locales/cs/messages.json +14 -1
- package/src/components/i18n/locales/da/messages.json +14 -1
- package/src/components/i18n/locales/de/messages.json +14 -1
- package/src/components/i18n/locales/dv/messages.json +14 -1
- package/src/components/i18n/locales/el/messages.json +14 -1
- package/src/components/i18n/locales/en/messages.json +14 -1
- package/src/components/i18n/locales/es/messages.json +14 -1
- package/src/components/i18n/locales/et/messages.json +15 -2
- package/src/components/i18n/locales/fa/messages.json +14 -1
- package/src/components/i18n/locales/fi/messages.json +14 -1
- package/src/components/i18n/locales/fil/messages.json +14 -1
- package/src/components/i18n/locales/fr/messages.json +14 -1
- package/src/components/i18n/locales/gu/messages.json +14 -1
- package/src/components/i18n/locales/he/messages.json +14 -1
- package/src/components/i18n/locales/hi/messages.json +14 -1
- package/src/components/i18n/locales/hr/messages.json +14 -1
- package/src/components/i18n/locales/hu/messages.json +14 -1
- package/src/components/i18n/locales/hy/messages.json +14 -1
- package/src/components/i18n/locales/id/messages.json +14 -1
- package/src/components/i18n/locales/it/messages.json +14 -1
- package/src/components/i18n/locales/ja/messages.json +14 -1
- package/src/components/i18n/locales/ka/messages.json +14 -1
- package/src/components/i18n/locales/km/messages.json +14 -1
- package/src/components/i18n/locales/kn/messages.json +14 -1
- package/src/components/i18n/locales/ko/messages.json +14 -1
- package/src/components/i18n/locales/ku/messages.json +14 -1
- package/src/components/i18n/locales/lo/messages.json +14 -1
- package/src/components/i18n/locales/lt/messages.json +14 -1
- package/src/components/i18n/locales/lv/messages.json +14 -1
- package/src/components/i18n/locales/mk/messages.json +14 -1
- package/src/components/i18n/locales/ml/messages.json +14 -1
- package/src/components/i18n/locales/mn/messages.json +14 -1
- package/src/components/i18n/locales/mr/messages.json +14 -1
- package/src/components/i18n/locales/ms/messages.json +14 -1
- package/src/components/i18n/locales/my/messages.json +14 -1
- package/src/components/i18n/locales/ne/messages.json +14 -1
- package/src/components/i18n/locales/nl/messages.json +14 -1
- package/src/components/i18n/locales/no/messages.json +14 -1
- package/src/components/i18n/locales/pa/messages.json +14 -1
- package/src/components/i18n/locales/pl/messages.json +14 -1
- package/src/components/i18n/locales/ps/messages.json +14 -1
- package/src/components/i18n/locales/pt/messages.json +14 -1
- package/src/components/i18n/locales/ro/messages.json +14 -1
- package/src/components/i18n/locales/ru/messages.json +15 -2
- package/src/components/i18n/locales/sd/messages.json +14 -1
- package/src/components/i18n/locales/si/messages.json +14 -1
- package/src/components/i18n/locales/sk/messages.json +14 -1
- package/src/components/i18n/locales/sl/messages.json +14 -1
- package/src/components/i18n/locales/sq/messages.json +14 -1
- package/src/components/i18n/locales/sr/messages.json +14 -1
- package/src/components/i18n/locales/sv/messages.json +14 -1
- package/src/components/i18n/locales/sw/messages.json +14 -1
- package/src/components/i18n/locales/ta/messages.json +14 -1
- package/src/components/i18n/locales/te/messages.json +14 -1
- package/src/components/i18n/locales/th/messages.json +14 -1
- package/src/components/i18n/locales/tr/messages.json +14 -1
- package/src/components/i18n/locales/ug/messages.json +14 -1
- package/src/components/i18n/locales/uk/messages.json +15 -2
- package/src/components/i18n/locales/ur/messages.json +14 -1
- package/src/components/i18n/locales/vi/messages.json +14 -1
- package/src/components/i18n/locales/yi/messages.json +14 -1
- package/src/components/i18n/locales/zh/messages.json +14 -1
- package/src/components/icons/index.ts +52 -6
- package/src/components/inline-tools/inline-tool-link.ts +202 -5
- package/src/components/inline-tools/inline-tool-marker.ts +166 -23
- package/src/components/inline-tools/inline-tool-strikethrough.ts +408 -0
- package/src/components/inline-tools/inline-tool-underline.ts +408 -0
- package/src/components/inline-tools/utils/formatting-range-utils.ts +10 -1
- package/src/components/modules/blockManager/blockManager.ts +2 -2
- package/src/components/modules/blockManager/operations.ts +2 -2
- package/src/components/modules/blockManager/repository.ts +1 -9
- package/src/components/modules/blockManager/types.ts +1 -1
- package/src/components/modules/drag/operations/DragOperations.ts +45 -6
- package/src/components/modules/paste/google-docs-preprocessor.ts +69 -2
- package/src/components/modules/paste/handlers/blok-data-handler.ts +96 -19
- package/src/components/modules/rectangleSelection.ts +48 -0
- package/src/components/modules/renderer.ts +2 -0
- package/src/components/modules/toolbar/blockSettings.ts +1 -1
- package/src/components/modules/toolbar/index.ts +26 -2
- package/src/components/modules/toolbar/plus-button.ts +15 -5
- package/src/components/selection/fake-background/index.ts +9 -10
- package/src/components/shared/color-picker.ts +116 -95
- package/src/components/shared/color-presets.ts +30 -2
- package/src/components/ui/toolbox.ts +36 -7
- package/src/components/utils/color-mapping.ts +43 -1
- package/src/components/utils/color-migration.ts +37 -0
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +4 -3
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +5 -39
- package/src/components/utils/popover/components/popover-item/popover-item-separator/popover-item-separator.const.ts +2 -2
- package/src/components/utils/popover/components/popover-item/popover-item.ts +11 -0
- package/src/components/utils/popover/components/search-input/search-input.const.ts +2 -3
- package/src/components/utils/popover/components/search-input/search-input.ts +1 -32
- package/src/components/utils/popover/popover-abstract.ts +2 -4
- package/src/components/utils/popover/popover-desktop.ts +1 -16
- package/src/components/utils/popover/popover-inline.ts +1 -2
- package/src/components/utils/popover/popover-mobile.ts +2 -2
- package/src/components/utils/popover/popover.const.ts +1 -1
- package/src/full.ts +7 -1
- package/src/stories/MarkerColors.stories.ts +13 -34
- package/src/stories/Table.stories.ts +15 -9
- package/src/styles/main.css +313 -15
- package/src/tools/header/index.ts +11 -9
- package/src/tools/index.ts +4 -0
- package/src/tools/list/constants.ts +13 -6
- package/src/tools/list/depth-validator.ts +13 -1
- package/src/tools/list/dom-builder.ts +6 -3
- package/src/tools/list/index.ts +3 -2
- package/src/tools/paragraph/index.ts +2 -2
- package/src/tools/table/table-cell-blocks.ts +25 -0
- package/src/tools/table/table-cell-color-picker.ts +1 -1
- package/src/tools/table/table-cell-selection.ts +1 -2
- package/src/tools/table/table-core.ts +2 -2
- package/src/tools/table/table-grip-visuals.ts +13 -5
- package/src/tools/table/table-heading-toggle.ts +15 -9
- package/src/tools/table/table-row-col-controls.ts +17 -11
- package/src/tools/table/table-row-col-drag.ts +26 -3
- package/src/tools/toggle/constants.ts +13 -6
- package/src/tools/toggle/index.ts +1 -1
- package/types/tools/hook-events.d.ts +6 -0
- package/types/utils/popover/popover-item.d.ts +6 -0
- package/CHANGELOG.md +0 -119
|
@@ -127,9 +127,19 @@ export class BlokDataHandler extends BasePasteHandler implements PasteHandler {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* Insert Blok JSON blocks
|
|
131
|
-
*
|
|
132
|
-
*
|
|
130
|
+
* Insert Blok JSON blocks using a two-pass approach:
|
|
131
|
+
*
|
|
132
|
+
* Pass 1 — child blocks (those whose parentId is within the pasted set) are
|
|
133
|
+
* inserted first. They receive new IDs, which are recorded in a map.
|
|
134
|
+
*
|
|
135
|
+
* Pass 2 — root/container blocks (e.g. tables) are inserted with their data
|
|
136
|
+
* remapped so that any old child-block ID references are replaced by the new
|
|
137
|
+
* IDs from Pass 1. This prevents container tools (TableCellBlocks) from
|
|
138
|
+
* resolving old IDs that still exist in the editor and stealing blocks from
|
|
139
|
+
* the original table.
|
|
140
|
+
*
|
|
141
|
+
* After both passes the parent-child hierarchy is re-established using the
|
|
142
|
+
* accumulated old→new ID mapping.
|
|
133
143
|
*/
|
|
134
144
|
private insertBlokBlocks(
|
|
135
145
|
blocks: BlokClipboardBlock[],
|
|
@@ -142,31 +152,70 @@ export class BlokDataHandler extends BasePasteHandler implements PasteHandler {
|
|
|
142
152
|
this.config.sanitizer
|
|
143
153
|
);
|
|
144
154
|
|
|
155
|
+
// Capture replace intent before any insertions move the current block pointer.
|
|
156
|
+
const shouldReplaceFirst =
|
|
157
|
+
canReplace &&
|
|
158
|
+
Boolean(BlockManager.currentBlock?.tool.isDefault) &&
|
|
159
|
+
Boolean(BlockManager.currentBlock?.isEmpty);
|
|
160
|
+
|
|
161
|
+
// Set of old IDs present in this paste, used to identify parent-child pairs.
|
|
162
|
+
const pastedOldIds = new Set(blocks.map(b => b.id));
|
|
163
|
+
|
|
164
|
+
type Entry = { sanitized: (typeof sanitizedBlocks)[number]; original: BlokClipboardBlock };
|
|
165
|
+
const children: Entry[] = [];
|
|
166
|
+
const roots: Entry[] = [];
|
|
167
|
+
|
|
168
|
+
sanitizedBlocks.forEach((sanitizedBlock, i) => {
|
|
169
|
+
const original = blocks[i];
|
|
170
|
+
|
|
171
|
+
if (original === undefined) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const isChild =
|
|
176
|
+
original.parentId !== undefined &&
|
|
177
|
+
original.parentId !== null &&
|
|
178
|
+
pastedOldIds.has(original.parentId);
|
|
179
|
+
|
|
180
|
+
(isChild ? children : roots).push({ sanitized: sanitizedBlock, original });
|
|
181
|
+
});
|
|
182
|
+
|
|
145
183
|
/**
|
|
146
184
|
* Map from original (old) block ID to the newly inserted Block instance.
|
|
147
|
-
* Used
|
|
185
|
+
* Used to remap data and restore hierarchy after both passes.
|
|
148
186
|
*/
|
|
149
187
|
const oldIdToEntry = new Map<string, { newBlock: Block; original: BlokClipboardBlock }>();
|
|
150
188
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
canReplace &&
|
|
155
|
-
Boolean(BlockManager.currentBlock?.tool.isDefault) &&
|
|
156
|
-
Boolean(BlockManager.currentBlock?.isEmpty);
|
|
189
|
+
// Pass 1: insert children first so they exist with new IDs before the parent.
|
|
190
|
+
children.forEach(({ sanitized, original }) => {
|
|
191
|
+
const block = BlockManager.insert({ tool: sanitized.tool, data: sanitized.data });
|
|
157
192
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
replace: needToReplaceCurrentBlock,
|
|
162
|
-
});
|
|
193
|
+
oldIdToEntry.set(original.id, { newBlock: block, original });
|
|
194
|
+
Caret.setToBlock(block, Caret.positions.END);
|
|
195
|
+
});
|
|
163
196
|
|
|
164
|
-
|
|
197
|
+
// Build old→new string map for remapping ID references inside parent data.
|
|
198
|
+
const oldIdToNewId = new Map<string, string>();
|
|
165
199
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
200
|
+
for (const [oldId, { newBlock }] of oldIdToEntry) {
|
|
201
|
+
oldIdToNewId.set(oldId, newBlock.id);
|
|
202
|
+
}
|
|
169
203
|
|
|
204
|
+
// Pass 2: insert root blocks with child IDs remapped in their data.
|
|
205
|
+
// Skip replace when children were pre-inserted to avoid replacing a
|
|
206
|
+
// just-inserted child paragraph rather than the original empty block.
|
|
207
|
+
roots.forEach(({ sanitized, original }, idx) => {
|
|
208
|
+
const remappedData = oldIdToNewId.size > 0
|
|
209
|
+
? remapIds(sanitized.data, oldIdToNewId) as typeof sanitized.data
|
|
210
|
+
: sanitized.data;
|
|
211
|
+
|
|
212
|
+
const block = BlockManager.insert({
|
|
213
|
+
tool: sanitized.tool,
|
|
214
|
+
data: remappedData,
|
|
215
|
+
replace: idx === 0 && shouldReplaceFirst && children.length === 0,
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
oldIdToEntry.set(original.id, { newBlock: block, original });
|
|
170
219
|
Caret.setToBlock(block, Caret.positions.END);
|
|
171
220
|
});
|
|
172
221
|
|
|
@@ -193,3 +242,31 @@ export class BlokDataHandler extends BasePasteHandler implements PasteHandler {
|
|
|
193
242
|
}
|
|
194
243
|
}
|
|
195
244
|
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Recursively walks `value` and replaces any string found as a key in `idMap`
|
|
248
|
+
* with its mapped value. Used to remap old block IDs to new IDs within a
|
|
249
|
+
* tool's data object before insertion, so that container blocks (e.g. tables)
|
|
250
|
+
* reference the correct newly-inserted child block IDs.
|
|
251
|
+
*/
|
|
252
|
+
function remapIds(value: unknown, idMap: Map<string, string>): unknown {
|
|
253
|
+
if (typeof value === 'string') {
|
|
254
|
+
return idMap.get(value) ?? value;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (Array.isArray(value)) {
|
|
258
|
+
return value.map(item => remapIds(item, idMap));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (value !== null && typeof value === 'object') {
|
|
262
|
+
const result: Record<string, unknown> = {};
|
|
263
|
+
|
|
264
|
+
for (const [k, v] of Object.entries(value as Record<string, unknown>)) {
|
|
265
|
+
result[k] = remapIds(v, idMap);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
@@ -65,6 +65,13 @@ export class RectangleSelection extends Module {
|
|
|
65
65
|
*/
|
|
66
66
|
private mousedown = false;
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Set when mousedown starts from a contentEditable element that is within the
|
|
70
|
+
* editor's horizontal content bounds. Prevents the toolbar from re-opening via
|
|
71
|
+
* the BlockHovered event while the user is dragging. Cleared on mouseup.
|
|
72
|
+
*/
|
|
73
|
+
private mouseDownWithinBoundsFromContentEditable = false;
|
|
74
|
+
|
|
68
75
|
/**
|
|
69
76
|
* Is scrolling now
|
|
70
77
|
*/
|
|
@@ -213,6 +220,7 @@ export class RectangleSelection extends Module {
|
|
|
213
220
|
*/
|
|
214
221
|
public endSelection(): void {
|
|
215
222
|
this.mousedown = false;
|
|
223
|
+
this.mouseDownWithinBoundsFromContentEditable = false;
|
|
216
224
|
this.startX = 0;
|
|
217
225
|
this.startY = 0;
|
|
218
226
|
this.anchorBlockIndex = null;
|
|
@@ -229,6 +237,18 @@ export class RectangleSelection extends Module {
|
|
|
229
237
|
return this.isRectSelectionActivated || this.mousedown;
|
|
230
238
|
}
|
|
231
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Returns true when the user pressed down a mouse button within the editor's horizontal
|
|
242
|
+
* content bounds, even if the click originated on a contentEditable element (in which
|
|
243
|
+
* case rubber-band selection is not started but the toolbar is still closed).
|
|
244
|
+
*
|
|
245
|
+
* Used by the Toolbar module to suppress toolbar reopening while the user is dragging
|
|
246
|
+
* inside the editor content area.
|
|
247
|
+
*/
|
|
248
|
+
public get isMouseDownWithinBounds(): boolean {
|
|
249
|
+
return this.mouseDownWithinBoundsFromContentEditable;
|
|
250
|
+
}
|
|
251
|
+
|
|
232
252
|
/**
|
|
233
253
|
* Mark that selection is end
|
|
234
254
|
*/
|
|
@@ -305,6 +325,24 @@ export class RectangleSelection extends Module {
|
|
|
305
325
|
|
|
306
326
|
if (!startedFromContentEditable) {
|
|
307
327
|
this.startSelection(mouseEvent.pageX, mouseEvent.pageY, mouseEvent.shiftKey);
|
|
328
|
+
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* When dragging starts from a contentEditable element, track whether the
|
|
334
|
+
* pointer is within the editor's horizontal content bounds.
|
|
335
|
+
* On the first subsequent mousemove (i.e. when the user actually drags rather
|
|
336
|
+
* than just clicking), the toolbar will be closed and hover-based reopening
|
|
337
|
+
* will be suppressed while the mouse button is held.
|
|
338
|
+
*/
|
|
339
|
+
const scrollLeft = this.getScrollLeft();
|
|
340
|
+
const pointerX = mouseEvent.pageX - scrollLeft;
|
|
341
|
+
const contentRect = this.Blok.UI.contentRect;
|
|
342
|
+
const withinEditorHorizontally = pointerX >= contentRect.left && pointerX <= contentRect.right;
|
|
343
|
+
|
|
344
|
+
if (withinEditorHorizontally) {
|
|
345
|
+
this.mouseDownWithinBoundsFromContentEditable = true;
|
|
308
346
|
}
|
|
309
347
|
}
|
|
310
348
|
|
|
@@ -313,6 +351,16 @@ export class RectangleSelection extends Module {
|
|
|
313
351
|
* @param {MouseEvent} mouseEvent - mouse event payload
|
|
314
352
|
*/
|
|
315
353
|
private processMouseMove(mouseEvent: MouseEvent): void {
|
|
354
|
+
/**
|
|
355
|
+
* When the user clicked inside a contentEditable element within the editor's
|
|
356
|
+
* horizontal bounds and is now dragging, close the toolbar on the first move.
|
|
357
|
+
* We defer this to mousemove (rather than mousedown) so that a plain click
|
|
358
|
+
* does not accidentally close the toolbar.
|
|
359
|
+
*/
|
|
360
|
+
if (this.mouseDownWithinBoundsFromContentEditable) {
|
|
361
|
+
this.Blok.Toolbar.close();
|
|
362
|
+
}
|
|
363
|
+
|
|
316
364
|
this.changingRectangle(mouseEvent);
|
|
317
365
|
this.scrollByZones(mouseEvent.clientY);
|
|
318
366
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
shouldExpandToHierarchical,
|
|
11
11
|
type DataFormatAnalysis,
|
|
12
12
|
} from '../utils/data-model-transform';
|
|
13
|
+
import { migrateMarkColors } from '../utils/color-migration';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Module that responsible for rendering Blocks on blok initialization
|
|
@@ -157,6 +158,7 @@ export class Renderer extends Module {
|
|
|
157
158
|
* Insert batch of Blocks
|
|
158
159
|
*/
|
|
159
160
|
BlockManager.insertMany(blocks);
|
|
161
|
+
migrateMarkColors(this.Blok.UI.nodes.redactor);
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
/**
|
|
@@ -140,6 +140,7 @@ export class Toolbar extends Module<ToolbarNodes> {
|
|
|
140
140
|
{
|
|
141
141
|
getToolboxOpened: () => this.toolbox.opened ?? false,
|
|
142
142
|
openToolbox: () => this.toolbox.open(),
|
|
143
|
+
openToolboxWithoutSlash: () => this.toolbox.openWithoutSlash(),
|
|
143
144
|
closeToolbox: () => this.toolbox.close(),
|
|
144
145
|
moveAndOpenToolbar: (block, target) => this.moveAndOpen(block, target),
|
|
145
146
|
}
|
|
@@ -202,6 +203,7 @@ export class Toolbar extends Module<ToolbarNodes> {
|
|
|
202
203
|
opened: boolean | undefined; // undefined is for the case when Toolbox is not initialized yet
|
|
203
204
|
close: () => void;
|
|
204
205
|
open: () => void;
|
|
206
|
+
openWithoutSlash: () => void;
|
|
205
207
|
toggle: () => void;
|
|
206
208
|
hasFocus: () => boolean | undefined;
|
|
207
209
|
} {
|
|
@@ -210,6 +212,25 @@ export class Toolbar extends Module<ToolbarNodes> {
|
|
|
210
212
|
close: () => {
|
|
211
213
|
this.toolboxInstance?.close();
|
|
212
214
|
},
|
|
215
|
+
openWithoutSlash: () => {
|
|
216
|
+
if (this.toolboxInstance === null) {
|
|
217
|
+
log('toolbox.openWithoutSlash() called before initialization is finished', 'warn');
|
|
218
|
+
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (this.hoveredBlock && !this.hoveredBlockIsFromTableCell) {
|
|
223
|
+
const currentBlock = this.Blok.BlockManager.currentBlock;
|
|
224
|
+
const isCurrentBlockInsideTableCell = currentBlock !== undefined
|
|
225
|
+
&& currentBlock.holder.closest('[data-blok-table-cell-blocks]') !== null;
|
|
226
|
+
|
|
227
|
+
if (!isCurrentBlockInsideTableCell) {
|
|
228
|
+
this.Blok.BlockManager.currentBlock = this.hoveredBlock;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
this.toolboxInstance.open(false);
|
|
233
|
+
},
|
|
213
234
|
open: () => {
|
|
214
235
|
/**
|
|
215
236
|
* If Toolbox is not initialized yet, do nothing
|
|
@@ -988,9 +1009,12 @@ export class Toolbar extends Module<ToolbarNodes> {
|
|
|
988
1009
|
*/
|
|
989
1010
|
this.eventsDispatcher.on(BlockHovered, (data) => {
|
|
990
1011
|
/**
|
|
991
|
-
* Do not move toolbar during drag
|
|
1012
|
+
* Do not move toolbar during drag, rectangle selection, or when the user
|
|
1013
|
+
* started a mouse-drag from within the editor's content area (even if the
|
|
1014
|
+
* drag originated on a contentEditable element, i.e. rubber-band is not
|
|
1015
|
+
* activated but the toolbar was closed and should stay closed).
|
|
992
1016
|
*/
|
|
993
|
-
if (this.Blok.DragManager.isDragging || this.Blok.RectangleSelection.isRectActivated()) {
|
|
1017
|
+
if (this.Blok.DragManager.isDragging || this.Blok.RectangleSelection.isRectActivated() || this.Blok.RectangleSelection.isMouseDownWithinBounds) {
|
|
994
1018
|
return;
|
|
995
1019
|
}
|
|
996
1020
|
|
|
@@ -27,10 +27,15 @@ export class PlusButtonHandler {
|
|
|
27
27
|
private getToolboxOpened: () => boolean;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Callback to open the toolbox
|
|
30
|
+
* Callback to open the toolbox in slash-search mode
|
|
31
31
|
*/
|
|
32
32
|
private openToolbox: () => void;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Callback to open the toolbox in no-slash mode (used when clicking the plus button)
|
|
36
|
+
*/
|
|
37
|
+
private openToolboxWithoutSlash: () => void;
|
|
38
|
+
|
|
34
39
|
/**
|
|
35
40
|
* Callback to close the toolbox
|
|
36
41
|
*/
|
|
@@ -50,6 +55,7 @@ export class PlusButtonHandler {
|
|
|
50
55
|
callbacks: {
|
|
51
56
|
getToolboxOpened: () => boolean;
|
|
52
57
|
openToolbox: () => void;
|
|
58
|
+
openToolboxWithoutSlash: () => void;
|
|
53
59
|
closeToolbox: () => void;
|
|
54
60
|
moveAndOpenToolbar: (block?: Block | null, target?: Element | null) => void;
|
|
55
61
|
}
|
|
@@ -57,6 +63,7 @@ export class PlusButtonHandler {
|
|
|
57
63
|
this.getBlok = getBlok;
|
|
58
64
|
this.getToolboxOpened = callbacks.getToolboxOpened;
|
|
59
65
|
this.openToolbox = callbacks.openToolbox;
|
|
66
|
+
this.openToolboxWithoutSlash = callbacks.openToolboxWithoutSlash;
|
|
60
67
|
this.closeToolbox = callbacks.closeToolbox;
|
|
61
68
|
this.moveAndOpenToolbar = callbacks.moveAndOpenToolbar;
|
|
62
69
|
}
|
|
@@ -196,14 +203,17 @@ export class PlusButtonHandler {
|
|
|
196
203
|
hoveredBlock?.holder.after(targetBlock.holder);
|
|
197
204
|
}
|
|
198
205
|
|
|
199
|
-
//
|
|
206
|
+
// Position caret and open toolbox
|
|
200
207
|
if (startsWithSlash) {
|
|
208
|
+
// Block already has "/" - keep slash-search mode, position after the slash
|
|
201
209
|
Caret.setToBlock(targetBlock, Caret.positions.DEFAULT, 1);
|
|
210
|
+
this.moveAndOpenToolbar(targetBlock);
|
|
211
|
+
this.openToolbox();
|
|
202
212
|
} else {
|
|
213
|
+
// New empty block - open toolbox directly without inserting "/"
|
|
203
214
|
Caret.setToBlock(targetBlock, Caret.positions.START);
|
|
204
|
-
|
|
215
|
+
this.moveAndOpenToolbar(targetBlock);
|
|
216
|
+
this.openToolboxWithoutSlash();
|
|
205
217
|
}
|
|
206
|
-
this.moveAndOpenToolbar(targetBlock);
|
|
207
|
-
this.openToolbox();
|
|
208
218
|
}
|
|
209
219
|
}
|
|
@@ -119,18 +119,17 @@ export class FakeBackgroundManager {
|
|
|
119
119
|
* Unwraps the highlight spans and restores the selection
|
|
120
120
|
*/
|
|
121
121
|
removeFakeBackground(): void {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
if (this.selectionUtils.isFakeBackgroundEnabled) {
|
|
123
|
+
// Remove highlight spans first while they still exist in the DOM,
|
|
124
|
+
// so that removeHighlightSpans() can reconstruct savedSelectionRange
|
|
125
|
+
// as a text-node-based range before the spans are gone.
|
|
126
|
+
this.removeHighlightSpans();
|
|
127
|
+
this.selectionUtils.isFakeBackgroundEnabled = false;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
this.selectionUtils.isFakeBackgroundEnabled = false;
|
|
130
|
+
// Clean up any remaining/orphaned fake background elements
|
|
131
|
+
// (handles undo/redo restoring spans, backwards compat, etc.)
|
|
132
|
+
this.removeOrphanedFakeBackgroundElements();
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
/**
|