@jackuait/blok 0.6.0-beta.8 → 0.6.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-bzxy6Olq.mjs → blok-BAh1rvUC.mjs} +3410 -2927
- package/dist/chunks/i18next-B47TKgbU.mjs +1303 -0
- package/dist/chunks/{i18next-loader-CzL6YHyQ.mjs → i18next-loader-CHtGO6IK.mjs} +2 -2
- package/dist/chunks/{index-DSSrx_Co.mjs → index-DBWWKrDe.mjs} +12 -12
- package/dist/chunks/{inline-tool-convert-D4SXxjDd.mjs → inline-tool-convert-DduRc0fF.mjs} +1467 -951
- package/dist/chunks/{messages-BogRq8lt.mjs → messages-0AbcLMLm.mjs} +6 -0
- package/dist/chunks/{messages-DJDG55Vq.mjs → messages-0E0AkrNu.mjs} +6 -0
- package/dist/{messages-DnXLrlHh.mjs → chunks/messages-4v4MuVEc.mjs} +6 -0
- package/dist/chunks/{messages-DnIhyAJk.mjs → messages-62v-CLC-.mjs} +6 -0
- package/dist/chunks/{messages-Dzwxv9v1.mjs → messages-8DeO60Oo.mjs} +6 -0
- package/dist/chunks/{messages-B1Aww8q7.mjs → messages-8IPXkrDl.mjs} +6 -0
- package/dist/{messages-uKX8WBaD.mjs → chunks/messages-96kNZDll.mjs} +6 -0
- package/dist/chunks/{messages-BL0tXcDf.mjs → messages-B1FZ8lxU.mjs} +6 -0
- package/dist/{messages-DBn76jVV.mjs → chunks/messages-B217znr-.mjs} +8 -2
- package/dist/{messages-DT4dP5uK.mjs → chunks/messages-B8WNljW3.mjs} +6 -0
- package/dist/chunks/{messages-BdeLo0N9.mjs → messages-BC8IN4Bf.mjs} +6 -0
- package/dist/{messages-CZygwLwM.mjs → chunks/messages-BI43k_BD.mjs} +6 -0
- package/dist/{messages-CzTufCHu.mjs → chunks/messages-BJ6zrz2j.mjs} +6 -0
- package/dist/{messages-BoJc_p1r.mjs → chunks/messages-BUl_Rcnj.mjs} +6 -0
- package/dist/chunks/{messages-CnwibSvh.mjs → messages-BZlmVRwn.mjs} +6 -0
- package/dist/{messages-C2htQ_3F.mjs → chunks/messages-BcpCubnC.mjs} +6 -0
- package/dist/{messages-D5C3J9qr.mjs → chunks/messages-Bm-E4iRC.mjs} +6 -0
- package/dist/chunks/{messages-BELRf6DU.mjs → messages-C4jL-90N.mjs} +6 -0
- package/dist/chunks/{messages-1fC8IMyX.mjs → messages-CDBLbUOQ.mjs} +6 -0
- package/dist/chunks/{messages-7QoX8DkW.mjs → messages-CH4hrauY.mjs} +6 -0
- package/dist/{messages-Dz9L52ol.mjs → chunks/messages-CRJ_mchV.mjs} +6 -0
- package/dist/chunks/{messages-JELdtT6E.mjs → messages-CW4c4cRk.mjs} +6 -0
- package/dist/chunks/{messages-CKI54h6O.mjs → messages-C_4otP7U.mjs} +6 -0
- package/dist/{messages-R3hUSvr3.mjs → chunks/messages-CfiyT2Wi.mjs} +6 -0
- package/dist/{messages-CJdUsQ-c.mjs → chunks/messages-CgTq3QhU.mjs} +6 -0
- package/dist/chunks/{messages-D1Hv8XGo.mjs → messages-Chb7k3Rg.mjs} +6 -0
- package/dist/{messages-Q7AO_FLv.mjs → chunks/messages-Cjjo7yHR.mjs} +6 -0
- package/dist/{messages-C99mq906.mjs → chunks/messages-Cl6ayUaq.mjs} +6 -0
- package/dist/chunks/{messages-Diu6jAaR.mjs → messages-CmR9ftc_.mjs} +6 -0
- package/dist/chunks/{messages-LPVfA-8K.mjs → messages-Cr49Nt3U.mjs} +6 -0
- package/dist/chunks/{messages-DqM1LFg5.mjs → messages-Cr94GzbX.mjs} +6 -0
- package/dist/{messages-BWF-zUpY.mjs → chunks/messages-CrCYPCk3.mjs} +6 -0
- package/dist/{messages-D-ZtY5v0.mjs → chunks/messages-Cs8zmZ3L.mjs} +6 -0
- package/dist/{messages-DprmQg6V.mjs → chunks/messages-CzK0LEhb.mjs} +6 -0
- package/dist/chunks/{messages-BSbjsyHY.mjs → messages-D00x4S8o.mjs} +6 -0
- package/dist/chunks/{messages-Xq8UmkVs.mjs → messages-D1mn7Zd5.mjs} +6 -0
- package/dist/chunks/{messages-BC86qLvI.mjs → messages-D2NOpHn9.mjs} +6 -0
- package/dist/{messages-kep5wtm4.mjs → chunks/messages-D4qqwVgQ.mjs} +6 -0
- package/dist/chunks/{messages-7W4d0DwD.mjs → messages-D5S1Dnpm.mjs} +6 -0
- package/dist/{messages-CY8_RyFE.mjs → chunks/messages-D7u2bmP2.mjs} +6 -0
- package/dist/chunks/{messages-BFG6Wlgy.mjs → messages-D85FqxgY.mjs} +6 -0
- package/dist/{messages-DLfR5bMd.mjs → chunks/messages-D9ndgBnU.mjs} +6 -0
- package/dist/{messages-CVw84KdI.mjs → chunks/messages-DDTQgImT.mjs} +6 -0
- package/dist/{messages-_ErNTNhk.mjs → chunks/messages-DH_jBeED.mjs} +6 -0
- package/dist/chunks/{messages-CMkNSDTo.mjs → messages-DRXWF0PV.mjs} +6 -0
- package/dist/chunks/{messages-BYyy6Wqf.mjs → messages-DVQvl8Qj.mjs} +6 -0
- package/dist/chunks/{messages-CznZadDf.mjs → messages-DXktiao_.mjs} +6 -0
- package/dist/chunks/{messages-DhLKYm2j.mjs → messages-DdK-nFGm.mjs} +6 -0
- package/dist/chunks/{messages-BMXCuEKO.mjs → messages-DlJbPF2T.mjs} +6 -0
- package/dist/chunks/{messages-CvGLfqmV.mjs → messages-DnVlmiNT.mjs} +6 -0
- package/dist/{messages-Z9nEU2xK.mjs → chunks/messages-DviiFSv2.mjs} +6 -0
- package/dist/chunks/{messages-BB5z9Uba.mjs → messages-DzqM3Fel.mjs} +6 -0
- package/dist/{messages-w7v1GNaE.mjs → chunks/messages-Dzzn6XoD.mjs} +6 -0
- package/dist/{messages-CqWJcCbY.mjs → chunks/messages-GSByFygY.mjs} +6 -0
- package/dist/chunks/{messages-_ncGrKHh.mjs → messages-L_kl2Qvh.mjs} +6 -0
- package/dist/chunks/{messages-BrPFGbM-.mjs → messages-Phkd7XmE.mjs} +6 -0
- package/dist/{messages-BU2nlrLK.mjs → chunks/messages-RonBBCnh.mjs} +6 -0
- package/dist/{messages-Bmu_S7GM.mjs → chunks/messages-VDriF5Qy.mjs} +6 -0
- package/dist/{messages-CLhcMlTc.mjs → chunks/messages-ZjUAIWb1.mjs} +6 -0
- package/dist/{messages-9SihnaXQ.mjs → chunks/messages-b1EdvUm0.mjs} +6 -0
- package/dist/{messages-DvFLX36Q.mjs → chunks/messages-begYOTgC.mjs} +6 -0
- package/dist/{messages-BMv4xwIr.mjs → chunks/messages-jrncnb-H.mjs} +6 -0
- package/dist/{messages-D5iv1Kox.mjs → chunks/messages-nefz1S71.mjs} +6 -0
- package/dist/{messages-CQwpzUFp.mjs → chunks/messages-ucTVgS5G.mjs} +6 -0
- package/dist/chunks/{messages-DBRw-7Zc.mjs → messages-v3GipbFl.mjs} +6 -0
- package/dist/{messages-C9eaarcK.mjs → chunks/messages-wmi-iFkH.mjs} +6 -0
- package/dist/chunks/{messages-O5tQus_0.mjs → messages-yHcs38yI.mjs} +6 -0
- package/dist/full.mjs +2 -2
- package/dist/locales.mjs +90 -84
- package/dist/{messages-BogRq8lt.mjs → messages-0AbcLMLm.mjs} +6 -0
- package/dist/{messages-DJDG55Vq.mjs → messages-0E0AkrNu.mjs} +6 -0
- package/dist/{chunks/messages-DnXLrlHh.mjs → messages-4v4MuVEc.mjs} +6 -0
- package/dist/{messages-DnIhyAJk.mjs → messages-62v-CLC-.mjs} +6 -0
- package/dist/{messages-Dzwxv9v1.mjs → messages-8DeO60Oo.mjs} +6 -0
- package/dist/{messages-B1Aww8q7.mjs → messages-8IPXkrDl.mjs} +6 -0
- package/dist/{chunks/messages-uKX8WBaD.mjs → messages-96kNZDll.mjs} +6 -0
- package/dist/{messages-BL0tXcDf.mjs → messages-B1FZ8lxU.mjs} +6 -0
- package/dist/{chunks/messages-DBn76jVV.mjs → messages-B217znr-.mjs} +8 -2
- package/dist/{chunks/messages-DT4dP5uK.mjs → messages-B8WNljW3.mjs} +6 -0
- package/dist/{messages-BdeLo0N9.mjs → messages-BC8IN4Bf.mjs} +6 -0
- package/dist/{chunks/messages-CZygwLwM.mjs → messages-BI43k_BD.mjs} +6 -0
- package/dist/{chunks/messages-CzTufCHu.mjs → messages-BJ6zrz2j.mjs} +6 -0
- package/dist/{chunks/messages-BoJc_p1r.mjs → messages-BUl_Rcnj.mjs} +6 -0
- package/dist/{messages-CnwibSvh.mjs → messages-BZlmVRwn.mjs} +6 -0
- package/dist/{chunks/messages-C2htQ_3F.mjs → messages-BcpCubnC.mjs} +6 -0
- package/dist/{chunks/messages-D5C3J9qr.mjs → messages-Bm-E4iRC.mjs} +6 -0
- package/dist/{messages-BELRf6DU.mjs → messages-C4jL-90N.mjs} +6 -0
- package/dist/{messages-1fC8IMyX.mjs → messages-CDBLbUOQ.mjs} +6 -0
- package/dist/{messages-7QoX8DkW.mjs → messages-CH4hrauY.mjs} +6 -0
- package/dist/{chunks/messages-Dz9L52ol.mjs → messages-CRJ_mchV.mjs} +6 -0
- package/dist/{messages-JELdtT6E.mjs → messages-CW4c4cRk.mjs} +6 -0
- package/dist/{messages-CKI54h6O.mjs → messages-C_4otP7U.mjs} +6 -0
- package/dist/{chunks/messages-R3hUSvr3.mjs → messages-CfiyT2Wi.mjs} +6 -0
- package/dist/{chunks/messages-CJdUsQ-c.mjs → messages-CgTq3QhU.mjs} +6 -0
- package/dist/{messages-D1Hv8XGo.mjs → messages-Chb7k3Rg.mjs} +6 -0
- package/dist/{chunks/messages-Q7AO_FLv.mjs → messages-Cjjo7yHR.mjs} +6 -0
- package/dist/{chunks/messages-C99mq906.mjs → messages-Cl6ayUaq.mjs} +6 -0
- package/dist/{messages-Diu6jAaR.mjs → messages-CmR9ftc_.mjs} +6 -0
- package/dist/{messages-LPVfA-8K.mjs → messages-Cr49Nt3U.mjs} +6 -0
- package/dist/{messages-DqM1LFg5.mjs → messages-Cr94GzbX.mjs} +6 -0
- package/dist/{chunks/messages-BWF-zUpY.mjs → messages-CrCYPCk3.mjs} +6 -0
- package/dist/{chunks/messages-D-ZtY5v0.mjs → messages-Cs8zmZ3L.mjs} +6 -0
- package/dist/{chunks/messages-DprmQg6V.mjs → messages-CzK0LEhb.mjs} +6 -0
- package/dist/{messages-BSbjsyHY.mjs → messages-D00x4S8o.mjs} +6 -0
- package/dist/{messages-Xq8UmkVs.mjs → messages-D1mn7Zd5.mjs} +6 -0
- package/dist/{messages-BC86qLvI.mjs → messages-D2NOpHn9.mjs} +6 -0
- package/dist/{chunks/messages-kep5wtm4.mjs → messages-D4qqwVgQ.mjs} +6 -0
- package/dist/{messages-7W4d0DwD.mjs → messages-D5S1Dnpm.mjs} +6 -0
- package/dist/{chunks/messages-CY8_RyFE.mjs → messages-D7u2bmP2.mjs} +6 -0
- package/dist/{messages-BFG6Wlgy.mjs → messages-D85FqxgY.mjs} +6 -0
- package/dist/{chunks/messages-DLfR5bMd.mjs → messages-D9ndgBnU.mjs} +6 -0
- package/dist/{chunks/messages-CVw84KdI.mjs → messages-DDTQgImT.mjs} +6 -0
- package/dist/{chunks/messages-_ErNTNhk.mjs → messages-DH_jBeED.mjs} +6 -0
- package/dist/{messages-CMkNSDTo.mjs → messages-DRXWF0PV.mjs} +6 -0
- package/dist/{messages-BYyy6Wqf.mjs → messages-DVQvl8Qj.mjs} +6 -0
- package/dist/{messages-CznZadDf.mjs → messages-DXktiao_.mjs} +6 -0
- package/dist/{messages-DhLKYm2j.mjs → messages-DdK-nFGm.mjs} +6 -0
- package/dist/{messages-BMXCuEKO.mjs → messages-DlJbPF2T.mjs} +6 -0
- package/dist/{messages-CvGLfqmV.mjs → messages-DnVlmiNT.mjs} +6 -0
- package/dist/{chunks/messages-Z9nEU2xK.mjs → messages-DviiFSv2.mjs} +6 -0
- package/dist/{messages-BB5z9Uba.mjs → messages-DzqM3Fel.mjs} +6 -0
- package/dist/{chunks/messages-w7v1GNaE.mjs → messages-Dzzn6XoD.mjs} +6 -0
- package/dist/{chunks/messages-CqWJcCbY.mjs → messages-GSByFygY.mjs} +6 -0
- package/dist/{messages-_ncGrKHh.mjs → messages-L_kl2Qvh.mjs} +6 -0
- package/dist/{messages-BrPFGbM-.mjs → messages-Phkd7XmE.mjs} +6 -0
- package/dist/{chunks/messages-BU2nlrLK.mjs → messages-RonBBCnh.mjs} +6 -0
- package/dist/{chunks/messages-Bmu_S7GM.mjs → messages-VDriF5Qy.mjs} +6 -0
- package/dist/{chunks/messages-CLhcMlTc.mjs → messages-ZjUAIWb1.mjs} +6 -0
- package/dist/{chunks/messages-9SihnaXQ.mjs → messages-b1EdvUm0.mjs} +6 -0
- package/dist/{chunks/messages-DvFLX36Q.mjs → messages-begYOTgC.mjs} +6 -0
- package/dist/{chunks/messages-BMv4xwIr.mjs → messages-jrncnb-H.mjs} +6 -0
- package/dist/{chunks/messages-D5iv1Kox.mjs → messages-nefz1S71.mjs} +6 -0
- package/dist/{chunks/messages-CQwpzUFp.mjs → messages-ucTVgS5G.mjs} +6 -0
- package/dist/{messages-DBRw-7Zc.mjs → messages-v3GipbFl.mjs} +6 -0
- package/dist/{chunks/messages-C9eaarcK.mjs → messages-wmi-iFkH.mjs} +6 -0
- package/dist/{messages-O5tQus_0.mjs → messages-yHcs38yI.mjs} +6 -0
- package/dist/tools.mjs +3194 -1690
- package/dist/vendor.LICENSE.txt +109 -109
- package/package.json +43 -57
- package/src/blok.ts +12 -0
- package/src/components/__module.ts +21 -0
- package/src/components/block/api.ts +17 -0
- package/src/components/block/style-manager.ts +6 -2
- package/src/components/block/tool-renderer.ts +33 -30
- package/src/components/blocks.ts +132 -15
- package/src/components/i18n/locales/am/messages.json +6 -0
- package/src/components/i18n/locales/ar/messages.json +6 -0
- package/src/components/i18n/locales/az/messages.json +6 -0
- package/src/components/i18n/locales/bg/messages.json +6 -0
- package/src/components/i18n/locales/bn/messages.json +6 -0
- package/src/components/i18n/locales/bs/messages.json +6 -0
- package/src/components/i18n/locales/cs/messages.json +6 -0
- package/src/components/i18n/locales/da/messages.json +6 -0
- package/src/components/i18n/locales/de/messages.json +6 -0
- package/src/components/i18n/locales/dv/messages.json +6 -0
- package/src/components/i18n/locales/el/messages.json +6 -0
- package/src/components/i18n/locales/en/messages.json +6 -0
- package/src/components/i18n/locales/es/messages.json +6 -0
- package/src/components/i18n/locales/et/messages.json +6 -0
- package/src/components/i18n/locales/fa/messages.json +6 -0
- package/src/components/i18n/locales/fi/messages.json +6 -0
- package/src/components/i18n/locales/fil/messages.json +6 -0
- package/src/components/i18n/locales/fr/messages.json +6 -0
- package/src/components/i18n/locales/gu/messages.json +6 -0
- package/src/components/i18n/locales/he/messages.json +6 -0
- package/src/components/i18n/locales/hi/messages.json +6 -0
- package/src/components/i18n/locales/hr/messages.json +6 -0
- package/src/components/i18n/locales/hu/messages.json +6 -0
- package/src/components/i18n/locales/hy/messages.json +6 -0
- package/src/components/i18n/locales/id/messages.json +6 -0
- package/src/components/i18n/locales/it/messages.json +6 -0
- package/src/components/i18n/locales/ja/messages.json +6 -0
- package/src/components/i18n/locales/ka/messages.json +6 -0
- package/src/components/i18n/locales/km/messages.json +6 -0
- package/src/components/i18n/locales/kn/messages.json +6 -0
- package/src/components/i18n/locales/ko/messages.json +6 -0
- package/src/components/i18n/locales/ku/messages.json +6 -0
- package/src/components/i18n/locales/lo/messages.json +6 -0
- package/src/components/i18n/locales/lt/messages.json +6 -0
- package/src/components/i18n/locales/lv/messages.json +6 -0
- package/src/components/i18n/locales/mk/messages.json +6 -0
- package/src/components/i18n/locales/ml/messages.json +6 -0
- package/src/components/i18n/locales/mn/messages.json +6 -0
- package/src/components/i18n/locales/mr/messages.json +6 -0
- package/src/components/i18n/locales/ms/messages.json +6 -0
- package/src/components/i18n/locales/my/messages.json +6 -0
- package/src/components/i18n/locales/ne/messages.json +6 -0
- package/src/components/i18n/locales/nl/messages.json +6 -0
- package/src/components/i18n/locales/no/messages.json +6 -0
- package/src/components/i18n/locales/pa/messages.json +6 -0
- package/src/components/i18n/locales/pl/messages.json +6 -0
- package/src/components/i18n/locales/ps/messages.json +6 -0
- package/src/components/i18n/locales/pt/messages.json +6 -0
- package/src/components/i18n/locales/ro/messages.json +6 -0
- package/src/components/i18n/locales/ru/messages.json +6 -0
- package/src/components/i18n/locales/sd/messages.json +6 -0
- package/src/components/i18n/locales/si/messages.json +6 -0
- package/src/components/i18n/locales/sk/messages.json +6 -0
- package/src/components/i18n/locales/sl/messages.json +6 -0
- package/src/components/i18n/locales/sq/messages.json +6 -0
- package/src/components/i18n/locales/sr/messages.json +6 -0
- package/src/components/i18n/locales/sv/messages.json +6 -0
- package/src/components/i18n/locales/sw/messages.json +6 -0
- package/src/components/i18n/locales/ta/messages.json +6 -0
- package/src/components/i18n/locales/te/messages.json +6 -0
- package/src/components/i18n/locales/th/messages.json +6 -0
- package/src/components/i18n/locales/tr/messages.json +6 -0
- package/src/components/i18n/locales/ug/messages.json +6 -0
- package/src/components/i18n/locales/uk/messages.json +6 -0
- package/src/components/i18n/locales/ur/messages.json +6 -0
- package/src/components/i18n/locales/vi/messages.json +6 -0
- package/src/components/i18n/locales/yi/messages.json +6 -0
- package/src/components/i18n/locales/zh/messages.json +6 -0
- package/src/components/icons/index.ts +17 -0
- package/src/components/inline-tools/inline-tool-link.ts +1 -1
- package/src/components/inline-tools/inline-tool-marker.ts +737 -0
- package/src/components/inline-tools/utils/formatting-range-utils.ts +6 -3
- package/src/components/inline-tools/utils/marker-dom-utils.ts +17 -0
- package/src/components/modules/api/blocks.ts +34 -9
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +75 -29
- package/src/components/modules/blockEvents/index.ts +13 -5
- package/src/components/modules/blockManager/blockManager.ts +81 -2
- package/src/components/modules/blockManager/hierarchy.ts +20 -2
- package/src/components/modules/blockManager/operations.ts +70 -35
- package/src/components/modules/blockManager/repository.ts +22 -0
- package/src/components/modules/blockManager/types.ts +3 -1
- package/src/components/modules/blockManager/yjs-sync.ts +173 -39
- package/src/components/modules/blockSelection.ts +3 -0
- package/src/components/modules/crossBlockSelection.ts +11 -3
- package/src/components/modules/drag/preview/DragPreview.ts +10 -2
- package/src/components/modules/drag/target/DropTargetDetector.ts +100 -11
- package/src/components/modules/drag/utils/drag.constants.ts +1 -1
- package/src/components/modules/normalizeInlineImages.ts +263 -0
- package/src/components/modules/paste/google-docs-preprocessor.ts +197 -0
- package/src/components/modules/paste/handlers/base.ts +43 -2
- package/src/components/modules/paste/handlers/html-handler.ts +1 -1
- package/src/components/modules/paste/handlers/index.ts +1 -0
- package/src/components/modules/paste/handlers/table-cells-handler.ts +104 -0
- package/src/components/modules/paste/index.ts +20 -3
- package/src/components/modules/readonly.ts +8 -2
- package/src/components/modules/rectangleSelection.ts +5 -2
- package/src/components/modules/renderer.ts +35 -0
- package/src/components/modules/saver.ts +52 -2
- package/src/components/modules/toolbar/blockSettings.ts +52 -44
- package/src/components/modules/toolbar/index.ts +124 -17
- package/src/components/modules/toolbar/inline/index.ts +4 -4
- package/src/components/modules/toolbar/plus-button.ts +3 -3
- package/src/components/modules/toolbar/settings-toggler.ts +3 -3
- package/src/components/modules/toolbar/styles.ts +7 -7
- package/src/components/modules/ui.ts +6 -6
- package/src/components/modules/uiControllers/controllers/blockHover.ts +16 -2
- package/src/components/modules/uiControllers/handlers/touch.ts +83 -10
- package/src/components/modules/yjs/block-observer.ts +9 -3
- package/src/components/modules/yjs/document-store.ts +10 -7
- package/src/components/modules/yjs/types.ts +8 -6
- package/src/components/modules/yjs/undo-history.ts +90 -11
- package/src/components/selection/fake-background/shadows.ts +1 -1
- package/src/components/shared/color-picker.ts +211 -0
- package/src/components/shared/color-presets.ts +25 -0
- package/src/components/ui/toolbox.ts +19 -11
- package/src/components/utils/color-mapping.ts +241 -0
- package/src/components/utils/notifier/draw.ts +9 -9
- package/src/components/utils/placeholder.ts +24 -8
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +2 -2
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +14 -12
- package/src/components/utils/popover/components/search-input/search-input.const.ts +2 -2
- package/src/components/utils/popover/popover-abstract.ts +27 -3
- package/src/components/utils/popover/popover-desktop.ts +26 -3
- package/src/components/utils/popover/popover-inline.ts +14 -1
- package/src/components/utils/popover/popover-mobile.ts +4 -4
- package/src/components/utils/popover/popover.const.ts +2 -2
- package/src/components/utils/sanitizer.ts +24 -3
- package/src/components/utils/tw.ts +17 -5
- package/src/stories/Header.stories.ts +106 -0
- package/src/stories/MarkerColors.stories.ts +730 -0
- package/src/stories/Popover.stories.ts +1 -3
- package/src/stories/Table.stories.ts +1662 -0
- package/src/styles/main.css +207 -37
- package/src/tools/header/index.ts +1 -1
- package/src/tools/index.ts +3 -1
- package/src/tools/list/caret-manager.ts +28 -10
- package/src/tools/list/constants.ts +2 -2
- package/src/tools/list/dom-builder.ts +3 -3
- package/src/tools/list/static-configs.ts +0 -1
- package/src/tools/paragraph/index.ts +15 -7
- package/src/tools/table/core/table-commands.ts +99 -0
- package/src/tools/table/core/table-controller.ts +231 -0
- package/src/tools/table/core/table-events.ts +102 -0
- package/src/tools/table/index.ts +1070 -174
- package/src/tools/table/ownership/table-event-broker.ts +74 -0
- package/src/tools/table/ownership/table-ownership-registry.ts +126 -0
- package/src/tools/table/table-add-controls.ts +85 -15
- package/src/tools/table/table-cell-blocks.ts +336 -38
- package/src/tools/table/table-cell-clipboard.ts +415 -0
- package/src/tools/table/table-cell-color-picker.ts +34 -0
- package/src/tools/table/table-cell-selection.ts +264 -15
- package/src/tools/table/table-core.ts +3 -42
- package/src/tools/table/table-heading-toggle.ts +2 -2
- package/src/tools/table/table-model.ts +623 -0
- package/src/tools/table/table-operations.ts +59 -78
- package/src/tools/table/table-resize.ts +15 -11
- package/src/tools/table/table-restrictions.ts +69 -3
- package/src/tools/table/table-row-col-action-handler.ts +22 -7
- package/src/tools/table/table-row-col-controls.ts +129 -12
- package/src/tools/table/table-row-col-drag.ts +14 -0
- package/src/tools/table/table-scroll-haze.ts +152 -0
- package/src/tools/table/types.ts +22 -1
- package/src/tools/table/view/table-cell-blocks-adapter.ts +47 -0
- package/src/variants/blok-minimum.ts +13 -0
- package/types/api/block.d.ts +13 -0
- package/types/api/blocks.d.ts +16 -0
- package/types/tools/table.d.ts +2 -0
- package/dist/chunks/i18next-CugVlwWp.mjs +0 -1292
- package/src/tools/table/data-normalizer.ts +0 -32
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var le = Object.defineProperty, ce = Object.defineProperties;
|
|
2
|
+
var de = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Mt = Object.getOwnPropertySymbols;
|
|
4
|
+
var he = Object.prototype.hasOwnProperty, ue = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Bt = (s, t, e) => t in s ? le(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, L = (s, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
|
|
7
|
+
he.call(t, e) && Bt(s, e, t[e]);
|
|
8
|
+
if (Mt)
|
|
9
|
+
for (var e of Mt(t))
|
|
10
|
+
ue.call(t, e) && Bt(s, e, t[e]);
|
|
11
|
+
return s;
|
|
12
|
+
}, D = (s, t) => ce(s, de(t));
|
|
13
|
+
function pe(s) {
|
|
14
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
15
|
+
}
|
|
16
|
+
const p = {
|
|
14
17
|
// ============================================
|
|
15
18
|
// Core Element Identifiers
|
|
16
19
|
// ============================================
|
|
@@ -267,7 +270,7 @@ const d = {
|
|
|
267
270
|
testid: "data-blok-testid",
|
|
268
271
|
/** Force hover state (for tests/storybook) */
|
|
269
272
|
forceHover: "data-blok-force-hover"
|
|
270
|
-
},
|
|
273
|
+
}, st = (s, t) => t === void 0 ? `[${s}]` : `[${s}="${t}"]`, v = {
|
|
271
274
|
BACKSPACE: 8,
|
|
272
275
|
TAB: 9,
|
|
273
276
|
ENTER: 13,
|
|
@@ -276,16 +279,16 @@ const d = {
|
|
|
276
279
|
DOWN: 40,
|
|
277
280
|
RIGHT: 39,
|
|
278
281
|
DELETE: 46
|
|
279
|
-
},
|
|
282
|
+
}, ko = {
|
|
280
283
|
LEFT: 0
|
|
281
|
-
},
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
284
|
+
}, Co = 650, fe = () => "0.6.0";
|
|
285
|
+
var ge = /* @__PURE__ */ ((s) => (s.VERBOSE = "VERBOSE", s.INFO = "INFO", s.WARN = "WARN", s.ERROR = "ERROR", s))(ge || {});
|
|
286
|
+
const Q = (s, t, e = "log", o, n = "color: inherit") => {
|
|
287
|
+
const r = typeof console == "undefined" ? void 0 : console;
|
|
288
|
+
if (!r || typeof r[e] != "function")
|
|
286
289
|
return;
|
|
287
|
-
const
|
|
288
|
-
switch (
|
|
290
|
+
const i = ["info", "log", "warn", "error"].includes(e), a = [];
|
|
291
|
+
switch (Q.logLevel) {
|
|
289
292
|
case "VERBOSE":
|
|
290
293
|
break;
|
|
291
294
|
case "ERROR":
|
|
@@ -297,12 +300,12 @@ const V = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
297
300
|
return;
|
|
298
301
|
break;
|
|
299
302
|
case "INFO":
|
|
300
|
-
if (!
|
|
303
|
+
if (!i || s)
|
|
301
304
|
return;
|
|
302
305
|
break;
|
|
303
306
|
}
|
|
304
307
|
o && a.push(o);
|
|
305
|
-
const
|
|
308
|
+
const l = `Blok ${fe()}`, d = s ? i ? (a.unshift(`line-height: 1em;
|
|
306
309
|
color: #006FEA;
|
|
307
310
|
display: inline-block;
|
|
308
311
|
font-size: 11px;
|
|
@@ -311,164 +314,164 @@ const V = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
311
314
|
padding: 4px 9px;
|
|
312
315
|
border-radius: 30px;
|
|
313
316
|
border: 1px solid rgba(56, 138, 229, 0.16);
|
|
314
|
-
margin: 4px 5px 4px 0;`,
|
|
317
|
+
margin: 4px 5px 4px 0;`, n), `%c${l}%c ${t}`) : `( ${l} )${t}` : t, u = i ? o !== void 0 ? [`${d} %o`, ...a] : [d, ...a] : [d];
|
|
315
318
|
try {
|
|
316
|
-
|
|
317
|
-
} catch (
|
|
319
|
+
r[e](...u);
|
|
320
|
+
} catch (h) {
|
|
318
321
|
}
|
|
319
322
|
};
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
if (
|
|
323
|
+
Q.logLevel = "VERBOSE";
|
|
324
|
+
const yo = (s) => {
|
|
325
|
+
Q.logLevel = s;
|
|
326
|
+
}, rt = (s, t = "log", e, o) => {
|
|
327
|
+
Q(!1, s, t, e, o);
|
|
328
|
+
}, Eo = (s, t = "log", e, o) => {
|
|
329
|
+
Q(!0, s, t, e, o);
|
|
330
|
+
}, E = (s) => typeof s == "function", T = (s) => {
|
|
331
|
+
if (s === null || typeof s != "object")
|
|
329
332
|
return !1;
|
|
330
|
-
const t = Object.getPrototypeOf(
|
|
333
|
+
const t = Object.getPrototypeOf(s);
|
|
331
334
|
return t === null || t === Object.prototype;
|
|
332
|
-
},
|
|
333
|
-
return
|
|
334
|
-
},
|
|
335
|
-
setTimeout(() =>
|
|
336
|
-
},
|
|
335
|
+
}, P = (s) => typeof s == "string", Xt = (s) => typeof s == "boolean", Ht = (s) => typeof s == "number", To = function(s) {
|
|
336
|
+
return s === void 0;
|
|
337
|
+
}, R = (s) => s == null ? !0 : typeof s == "string" || Array.isArray(s) ? s.length === 0 : s instanceof Map || s instanceof Set ? s.size === 0 : typeof s == "object" ? Object.keys(s).length === 0 : !1, me = (s, t) => function(...e) {
|
|
338
|
+
setTimeout(() => s.apply(this, e), t);
|
|
339
|
+
}, xo = (s, t, e) => {
|
|
337
340
|
const o = {
|
|
338
341
|
timeoutId: null
|
|
339
342
|
};
|
|
340
|
-
return function(...
|
|
341
|
-
const
|
|
342
|
-
o.timeoutId = null,
|
|
343
|
+
return function(...n) {
|
|
344
|
+
const r = () => {
|
|
345
|
+
o.timeoutId = null, s.apply(this, n);
|
|
343
346
|
};
|
|
344
|
-
o.timeoutId !== null && clearTimeout(o.timeoutId), o.timeoutId = setTimeout(
|
|
347
|
+
o.timeoutId !== null && clearTimeout(o.timeoutId), o.timeoutId = setTimeout(r, t);
|
|
345
348
|
};
|
|
346
|
-
},
|
|
349
|
+
}, Io = (s, t, e) => {
|
|
347
350
|
const o = {
|
|
348
351
|
lastCallTime: void 0,
|
|
349
352
|
lastInvokeTime: 0,
|
|
350
353
|
timerId: void 0,
|
|
351
354
|
lastArgs: void 0,
|
|
352
355
|
lastThis: void 0
|
|
353
|
-
},
|
|
354
|
-
o.lastInvokeTime =
|
|
355
|
-
const
|
|
356
|
-
return o.lastArgs = void 0, o.lastThis = void 0,
|
|
357
|
-
},
|
|
358
|
-
var
|
|
359
|
-
const
|
|
360
|
-
return Math.min(
|
|
361
|
-
},
|
|
362
|
-
var
|
|
363
|
-
const
|
|
364
|
-
return o.lastCallTime === void 0 ||
|
|
356
|
+
}, n = (c) => {
|
|
357
|
+
o.lastInvokeTime = c;
|
|
358
|
+
const d = o.lastArgs, u = o.lastThis;
|
|
359
|
+
return o.lastArgs = void 0, o.lastThis = void 0, s.apply(u, d != null ? d : []);
|
|
360
|
+
}, r = (c) => {
|
|
361
|
+
var g;
|
|
362
|
+
const d = c - ((g = o.lastCallTime) != null ? g : 0), u = c - o.lastInvokeTime, h = t - d;
|
|
363
|
+
return Math.min(h, t - u);
|
|
364
|
+
}, i = (c) => {
|
|
365
|
+
var h;
|
|
366
|
+
const d = c - ((h = o.lastCallTime) != null ? h : 0), u = c - o.lastInvokeTime;
|
|
367
|
+
return o.lastCallTime === void 0 || d >= t || d < 0 || u >= t;
|
|
365
368
|
}, a = () => {
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
368
|
-
o.timerId = setTimeout(a,
|
|
369
|
+
const c = Date.now();
|
|
370
|
+
if (!i(c)) {
|
|
371
|
+
o.timerId = setTimeout(a, r(c));
|
|
369
372
|
return;
|
|
370
373
|
}
|
|
371
|
-
o.timerId = void 0, o.lastArgs !== void 0 &&
|
|
374
|
+
o.timerId = void 0, o.lastArgs !== void 0 && n(c), o.lastArgs = void 0, o.lastThis = void 0;
|
|
372
375
|
};
|
|
373
|
-
return function(...
|
|
374
|
-
const
|
|
375
|
-
if (o.lastArgs =
|
|
376
|
-
return o.lastInvokeTime =
|
|
376
|
+
return function(...c) {
|
|
377
|
+
const d = Date.now(), u = i(d);
|
|
378
|
+
if (o.lastArgs = c, o.lastThis = this, o.lastCallTime = d, !!(u && o.timerId === void 0))
|
|
379
|
+
return o.lastInvokeTime = d, o.timerId = setTimeout(a, t), n(d);
|
|
377
380
|
};
|
|
378
|
-
},
|
|
381
|
+
}, S = (() => {
|
|
379
382
|
try {
|
|
380
383
|
return new Function("return this")();
|
|
381
|
-
} catch (
|
|
384
|
+
} catch (s) {
|
|
382
385
|
return;
|
|
383
386
|
}
|
|
384
387
|
})();
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
return
|
|
389
|
-
},
|
|
390
|
-
if (
|
|
391
|
-
return
|
|
392
|
-
const
|
|
393
|
-
return
|
|
394
|
-
},
|
|
395
|
-
var
|
|
396
|
-
const
|
|
388
|
+
S && typeof S.window == "undefined" && (S.window = S);
|
|
389
|
+
const ht = () => {
|
|
390
|
+
if (S != null && S.window)
|
|
391
|
+
return S.window;
|
|
392
|
+
}, Yt = () => {
|
|
393
|
+
if (S != null && S.navigator)
|
|
394
|
+
return S.navigator;
|
|
395
|
+
const s = ht();
|
|
396
|
+
return s == null ? void 0 : s.navigator;
|
|
397
|
+
}, Ao = (s) => /^[-\w]+\/([-+\w]+|\*)$/.test(s), ve = () => {
|
|
398
|
+
var n, r;
|
|
399
|
+
const s = {
|
|
397
400
|
win: !1,
|
|
398
401
|
mac: !1,
|
|
399
402
|
x11: !1,
|
|
400
403
|
linux: !1
|
|
401
|
-
}, t =
|
|
402
|
-
return o !== void 0 && (
|
|
403
|
-
},
|
|
404
|
-
const
|
|
405
|
-
return !
|
|
406
|
-
},
|
|
407
|
-
var
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
404
|
+
}, t = Yt(), e = (r = (n = t == null ? void 0 : t.userAgent) == null ? void 0 : n.toLowerCase()) != null ? r : "", o = e ? Object.keys(s).find((i) => e.indexOf(i) !== -1) : void 0;
|
|
405
|
+
return o !== void 0 && (s[o] = !0), s;
|
|
406
|
+
}, be = 650, we = () => {
|
|
407
|
+
const s = ht();
|
|
408
|
+
return !s || typeof s.matchMedia != "function" ? !1 : s.matchMedia(`(max-width: ${be}px)`).matches;
|
|
409
|
+
}, So = (() => {
|
|
410
|
+
var l;
|
|
411
|
+
const s = Yt();
|
|
412
|
+
if (!s)
|
|
410
413
|
return !1;
|
|
411
|
-
const t =
|
|
414
|
+
const t = s.userAgent || "", e = s.userAgentData, o = e == null ? void 0 : e.platform;
|
|
412
415
|
if (/iP(ad|hone|od)/.test(t) || o !== void 0 && o !== "" && /iP(ad|hone|od)/.test(o))
|
|
413
416
|
return !0;
|
|
414
|
-
const
|
|
417
|
+
const n = ((l = s.maxTouchPoints) != null ? l : 0) > 1, r = () => (
|
|
415
418
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- Fallback for older browsers that don't support User-Agent Client Hints
|
|
416
|
-
|
|
417
|
-
),
|
|
418
|
-
return (
|
|
419
|
-
})(),
|
|
419
|
+
s.platform
|
|
420
|
+
), i = o !== void 0 && o !== "" ? o : void 0;
|
|
421
|
+
return (n ? i != null ? i : r() : void 0) === "MacIntel";
|
|
422
|
+
})(), Lo = (s) => {
|
|
420
423
|
try {
|
|
421
|
-
return new URL(
|
|
424
|
+
return new URL(s).href;
|
|
422
425
|
} catch (e) {
|
|
423
426
|
}
|
|
424
|
-
const t =
|
|
425
|
-
return
|
|
426
|
-
},
|
|
427
|
-
const t =
|
|
428
|
-
t && t.open(
|
|
429
|
-
},
|
|
430
|
-
const t =
|
|
427
|
+
const t = ht();
|
|
428
|
+
return s.substring(0, 2) === "//" ? t ? `${t.location.protocol}${s}` : s : t ? `${t.location.origin}${s}` : s;
|
|
429
|
+
}, No = (s) => {
|
|
430
|
+
const t = ht();
|
|
431
|
+
t && t.open(s, "_blank");
|
|
432
|
+
}, ke = (s) => s && s.slice(0, 1).toUpperCase() + s.slice(1), Oo = (s) => {
|
|
433
|
+
const t = ve(), e = s.replace(/shift/gi, "⇧").replace(/backspace/gi, "⌫").replace(/enter/gi, "⏎").replace(/up/gi, "↑").replace(/left/gi, "→").replace(/down/gi, "↓").replace(/right/gi, "←").replace(/escape/gi, "⎋").replace(/insert/gi, "Ins").replace(/delete/gi, "␡").replace(/\+/gi, " + ");
|
|
431
434
|
return t.mac ? e.replace(/ctrl|cmd/gi, "⌘").replace(/alt/gi, "⌥") : e.replace(/cmd/gi, "Ctrl").replace(/windows/gi, "WIN");
|
|
432
|
-
},
|
|
433
|
-
const e =
|
|
435
|
+
}, Jt = (s, t) => {
|
|
436
|
+
const e = L({}, s);
|
|
434
437
|
return Object.keys(t).forEach((o) => {
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
438
|
+
const n = e[o], r = t[o];
|
|
439
|
+
if (r === void 0)
|
|
437
440
|
return;
|
|
438
|
-
if (
|
|
439
|
-
e[o] =
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
if (T(r) && T(n) && !Array.isArray(r)) {
|
|
442
|
+
e[o] = Jt(
|
|
443
|
+
n,
|
|
444
|
+
r
|
|
442
445
|
);
|
|
443
446
|
return;
|
|
444
447
|
}
|
|
445
|
-
e[o] =
|
|
448
|
+
e[o] = r;
|
|
446
449
|
}), e;
|
|
447
|
-
},
|
|
448
|
-
if (!
|
|
449
|
-
return
|
|
450
|
-
const e = t.reduce((o,
|
|
451
|
-
return Object.assign(
|
|
452
|
-
},
|
|
453
|
-
if (
|
|
450
|
+
}, it = (s, ...t) => {
|
|
451
|
+
if (!T(s) || t.length === 0)
|
|
452
|
+
return s;
|
|
453
|
+
const e = t.reduce((o, n) => T(n) ? Jt(o, n) : o, s);
|
|
454
|
+
return Object.assign(s, e), s;
|
|
455
|
+
}, Ce = (s, t) => s.length !== t.length ? !1 : s.every((e, o) => xt(e, t[o])), xt = (s, t) => {
|
|
456
|
+
if (s === t)
|
|
454
457
|
return !0;
|
|
455
|
-
if (
|
|
458
|
+
if (s === null || t === null || typeof s != "object" || typeof t != "object" || Array.isArray(s) !== Array.isArray(t))
|
|
456
459
|
return !1;
|
|
457
|
-
if (Array.isArray(
|
|
458
|
-
return
|
|
459
|
-
const e = Object.keys(
|
|
460
|
+
if (Array.isArray(s) && Array.isArray(t))
|
|
461
|
+
return Ce(s, t);
|
|
462
|
+
const e = Object.keys(s), o = Object.keys(t);
|
|
460
463
|
return e.length !== o.length ? !1 : e.every(
|
|
461
|
-
(
|
|
464
|
+
(n) => Object.prototype.hasOwnProperty.call(t, n) && xt(s[n], t[n])
|
|
462
465
|
);
|
|
463
|
-
},
|
|
464
|
-
let
|
|
465
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
466
|
-
for (;
|
|
467
|
-
t +=
|
|
466
|
+
}, ye = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
467
|
+
let Ee = (s = 21) => {
|
|
468
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(s |= 0));
|
|
469
|
+
for (; s--; )
|
|
470
|
+
t += ye[e[s] & 63];
|
|
468
471
|
return t;
|
|
469
472
|
};
|
|
470
|
-
const
|
|
471
|
-
class
|
|
473
|
+
const Te = 1e8, xe = 16, Ro = () => Ee(10), Ie = (s = "") => `${s}${Math.floor(Math.random() * Te).toString(xe)}`;
|
|
474
|
+
class m {
|
|
472
475
|
/**
|
|
473
476
|
* Check if passed tag has no closed tag
|
|
474
477
|
* @param {HTMLElement} tag - element to check
|
|
@@ -523,12 +526,12 @@ class f {
|
|
|
523
526
|
* @param classNames - array of class names to add
|
|
524
527
|
*/
|
|
525
528
|
static safelyAddClasses(t, e) {
|
|
526
|
-
const o = [],
|
|
527
|
-
for (const
|
|
528
|
-
|
|
529
|
-
if (o.length > 0 && t.classList.add(...o),
|
|
530
|
-
const
|
|
531
|
-
t.setAttribute("class",
|
|
529
|
+
const o = [], n = [];
|
|
530
|
+
for (const r of e)
|
|
531
|
+
m.isValidClassName(r) ? o.push(r) : n.push(r);
|
|
532
|
+
if (o.length > 0 && t.classList.add(...o), n.length > 0) {
|
|
533
|
+
const r = t.className, i = r ? `${r} ${n.join(" ")}` : n.join(" ");
|
|
534
|
+
t.setAttribute("class", i);
|
|
532
535
|
}
|
|
533
536
|
}
|
|
534
537
|
/**
|
|
@@ -539,28 +542,28 @@ class f {
|
|
|
539
542
|
* @returns {HTMLElement}
|
|
540
543
|
*/
|
|
541
544
|
static make(t, e = null, o = {}) {
|
|
542
|
-
const
|
|
545
|
+
const n = document.createElement(t);
|
|
543
546
|
if (Array.isArray(e)) {
|
|
544
|
-
const
|
|
545
|
-
|
|
547
|
+
const r = e.filter((i) => i !== void 0 && i !== "").flatMap((i) => i.split(" ")).filter((i) => i !== "");
|
|
548
|
+
m.safelyAddClasses(n, r);
|
|
546
549
|
}
|
|
547
550
|
if (typeof e == "string" && e !== "") {
|
|
548
|
-
const
|
|
549
|
-
|
|
551
|
+
const r = e.split(" ").filter((i) => i !== "");
|
|
552
|
+
m.safelyAddClasses(n, r);
|
|
550
553
|
}
|
|
551
|
-
for (const
|
|
552
|
-
if (!Object.prototype.hasOwnProperty.call(o,
|
|
554
|
+
for (const r in o) {
|
|
555
|
+
if (!Object.prototype.hasOwnProperty.call(o, r))
|
|
553
556
|
continue;
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
if (
|
|
557
|
-
|
|
557
|
+
const i = o[r];
|
|
558
|
+
if (i != null) {
|
|
559
|
+
if (r in n) {
|
|
560
|
+
n[r] = i;
|
|
558
561
|
continue;
|
|
559
562
|
}
|
|
560
|
-
|
|
563
|
+
n.setAttribute(r, String(i));
|
|
561
564
|
}
|
|
562
565
|
}
|
|
563
|
-
return
|
|
566
|
+
return n;
|
|
564
567
|
}
|
|
565
568
|
/**
|
|
566
569
|
* Creates Text Node with the passed content
|
|
@@ -584,7 +587,7 @@ class f {
|
|
|
584
587
|
* @param {Element|Element[]} elements - element or elements list
|
|
585
588
|
*/
|
|
586
589
|
static prepend(t, e) {
|
|
587
|
-
Array.isArray(e) ? [...e].reverse().forEach((
|
|
590
|
+
Array.isArray(e) ? [...e].reverse().forEach((n) => t.prepend(n)) : t.prepend(e);
|
|
588
591
|
}
|
|
589
592
|
/**
|
|
590
593
|
* Selector Decorator
|
|
@@ -627,10 +630,10 @@ class f {
|
|
|
627
630
|
* @param holder - element where to find inputs
|
|
628
631
|
*/
|
|
629
632
|
static findAllInputs(t) {
|
|
630
|
-
const e = Array.from(t.querySelectorAll(
|
|
631
|
-
for (const
|
|
632
|
-
|
|
633
|
-
return o.reduce((
|
|
633
|
+
const e = Array.from(t.querySelectorAll(m.allInputsSelector)), o = [];
|
|
634
|
+
for (const n of e)
|
|
635
|
+
n instanceof HTMLElement && o.push(n);
|
|
636
|
+
return o.reduce((n, r) => m.isNativeInput(r) || m.containsOnlyInlineElements(r) ? [...n, r] : [...n, ...m.getDeepestBlockElements(r)], []);
|
|
634
637
|
}
|
|
635
638
|
/**
|
|
636
639
|
* Search for deepest node which is Leaf.
|
|
@@ -643,21 +646,21 @@ class f {
|
|
|
643
646
|
* Can return null if node is Document or DocumentFragment, or node is not attached to the DOM
|
|
644
647
|
*/
|
|
645
648
|
static getDeepestNode(t, e = !1) {
|
|
646
|
-
var
|
|
647
|
-
const o = e ? "lastChild" : "firstChild",
|
|
649
|
+
var d;
|
|
650
|
+
const o = e ? "lastChild" : "firstChild", n = e ? "previousSibling" : "nextSibling";
|
|
648
651
|
if (t === null || t.nodeType !== Node.ELEMENT_NODE)
|
|
649
652
|
return t;
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
653
|
+
const r = t[o];
|
|
654
|
+
if (r === null)
|
|
652
655
|
return t;
|
|
653
|
-
const
|
|
654
|
-
if (!(
|
|
655
|
-
return this.getDeepestNode(
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
658
|
-
return this.getDeepestNode(
|
|
659
|
-
const
|
|
660
|
-
return
|
|
656
|
+
const i = r;
|
|
657
|
+
if (!(m.isSingleTag(i) && !m.isNativeInput(i) && !m.isLineBreakTag(i)))
|
|
658
|
+
return this.getDeepestNode(i, e);
|
|
659
|
+
const l = i[n];
|
|
660
|
+
if (l)
|
|
661
|
+
return this.getDeepestNode(l, e);
|
|
662
|
+
const c = (d = i.parentNode) == null ? void 0 : d[n];
|
|
663
|
+
return c ? this.getDeepestNode(c, e) : i.parentNode;
|
|
661
664
|
}
|
|
662
665
|
/**
|
|
663
666
|
* Check if object is DOM node
|
|
@@ -665,7 +668,7 @@ class f {
|
|
|
665
668
|
* @returns {boolean}
|
|
666
669
|
*/
|
|
667
670
|
static isElement(t) {
|
|
668
|
-
return
|
|
671
|
+
return Ht(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.ELEMENT_NODE;
|
|
669
672
|
}
|
|
670
673
|
/**
|
|
671
674
|
* Check if object is DocumentFragment node
|
|
@@ -673,7 +676,7 @@ class f {
|
|
|
673
676
|
* @returns {boolean}
|
|
674
677
|
*/
|
|
675
678
|
static isFragment(t) {
|
|
676
|
-
return
|
|
679
|
+
return Ht(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
677
680
|
}
|
|
678
681
|
/**
|
|
679
682
|
* Check if passed element is contenteditable
|
|
@@ -701,7 +704,7 @@ class f {
|
|
|
701
704
|
* @returns {boolean}
|
|
702
705
|
*/
|
|
703
706
|
static canSetCaret(t) {
|
|
704
|
-
return
|
|
707
|
+
return m.isNativeInput(t) ? !(/* @__PURE__ */ new Set([
|
|
705
708
|
"file",
|
|
706
709
|
"checkbox",
|
|
707
710
|
"radio",
|
|
@@ -710,7 +713,7 @@ class f {
|
|
|
710
713
|
"button",
|
|
711
714
|
"image",
|
|
712
715
|
"reset"
|
|
713
|
-
])).has(t.type) :
|
|
716
|
+
])).has(t.type) : m.isContentEditable(t);
|
|
714
717
|
}
|
|
715
718
|
/**
|
|
716
719
|
* Checks node if it is empty
|
|
@@ -721,11 +724,11 @@ class f {
|
|
|
721
724
|
* @returns {boolean} true if it is empty
|
|
722
725
|
*/
|
|
723
726
|
static isNodeEmpty(t, e) {
|
|
724
|
-
var
|
|
727
|
+
var r, i;
|
|
725
728
|
if (this.isSingleTag(t) && !this.isLineBreakTag(t))
|
|
726
729
|
return !1;
|
|
727
|
-
const o = this.isElement(t) && this.isNativeInput(t) ? t.value : (
|
|
728
|
-
return ((
|
|
730
|
+
const o = this.isElement(t) && this.isNativeInput(t) ? t.value : (r = t.textContent) == null ? void 0 : r.replace("", ""), n = e ? o == null ? void 0 : o.replace(new RegExp(e, "g"), "") : o;
|
|
731
|
+
return ((i = n == null ? void 0 : n.length) != null ? i : 0) === 0;
|
|
729
732
|
}
|
|
730
733
|
/**
|
|
731
734
|
* checks node if it is doesn't have any child nodes
|
|
@@ -746,11 +749,11 @@ class f {
|
|
|
746
749
|
static isEmpty(t, e) {
|
|
747
750
|
const o = [t];
|
|
748
751
|
for (; o.length > 0; ) {
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
if (this.isLeaf(
|
|
752
|
+
const n = o.shift();
|
|
753
|
+
if (n) {
|
|
754
|
+
if (this.isLeaf(n) && !this.isNodeEmpty(n, e))
|
|
752
755
|
return !1;
|
|
753
|
-
o.push(...Array.from(
|
|
756
|
+
o.push(...Array.from(n.childNodes));
|
|
754
757
|
}
|
|
755
758
|
}
|
|
756
759
|
return !0;
|
|
@@ -761,7 +764,7 @@ class f {
|
|
|
761
764
|
* @returns {boolean}
|
|
762
765
|
*/
|
|
763
766
|
static isHTMLString(t) {
|
|
764
|
-
const e =
|
|
767
|
+
const e = m.make("div");
|
|
765
768
|
return e.innerHTML = t, e.childElementCount > 0;
|
|
766
769
|
}
|
|
767
770
|
/**
|
|
@@ -771,7 +774,7 @@ class f {
|
|
|
771
774
|
*/
|
|
772
775
|
static getContentLength(t) {
|
|
773
776
|
var e, o;
|
|
774
|
-
return
|
|
777
|
+
return m.isNativeInput(t) ? t.value.length : t.nodeType === Node.TEXT_NODE ? t.length : (o = (e = t.textContent) == null ? void 0 : e.length) != null ? o : 0;
|
|
775
778
|
}
|
|
776
779
|
/**
|
|
777
780
|
* Return array of names of block html elements
|
|
@@ -826,10 +829,10 @@ class f {
|
|
|
826
829
|
* @returns {boolean}
|
|
827
830
|
*/
|
|
828
831
|
static containsOnlyInlineElements(t) {
|
|
829
|
-
const e =
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
})() : t, o = (
|
|
832
|
+
const e = P(t) ? (() => {
|
|
833
|
+
const n = document.createElement("div");
|
|
834
|
+
return n.innerHTML = t, n;
|
|
835
|
+
})() : t, o = (n) => !m.blockElements.includes(n.tagName.toLowerCase()) && Array.from(n.children).every(o);
|
|
833
836
|
return Array.from(e.children).every(o);
|
|
834
837
|
}
|
|
835
838
|
/**
|
|
@@ -838,7 +841,7 @@ class f {
|
|
|
838
841
|
* @returns {HTMLElement[]}
|
|
839
842
|
*/
|
|
840
843
|
static getDeepestBlockElements(t) {
|
|
841
|
-
return
|
|
844
|
+
return m.containsOnlyInlineElements(t) ? [t] : Array.from(t.children).reduce((e, o) => [...e, ...m.getDeepestBlockElements(o)], []);
|
|
842
845
|
}
|
|
843
846
|
/**
|
|
844
847
|
* Helper for get holder from {string} or return HTMLElement
|
|
@@ -846,7 +849,7 @@ class f {
|
|
|
846
849
|
* @returns {HTMLElement}
|
|
847
850
|
*/
|
|
848
851
|
static getHolder(t) {
|
|
849
|
-
if (!
|
|
852
|
+
if (!P(t))
|
|
850
853
|
return t;
|
|
851
854
|
const e = document.getElementById(t);
|
|
852
855
|
if (e !== null)
|
|
@@ -867,12 +870,12 @@ class f {
|
|
|
867
870
|
* @param el - element to compute offset
|
|
868
871
|
*/
|
|
869
872
|
static offset(t) {
|
|
870
|
-
const e = t.getBoundingClientRect(), o = window.scrollX || document.documentElement.scrollLeft,
|
|
873
|
+
const e = t.getBoundingClientRect(), o = window.scrollX || document.documentElement.scrollLeft, n = window.scrollY || document.documentElement.scrollTop, r = e.top + n, i = e.left + o;
|
|
871
874
|
return {
|
|
872
|
-
top:
|
|
873
|
-
left:
|
|
874
|
-
bottom:
|
|
875
|
-
right:
|
|
875
|
+
top: r,
|
|
876
|
+
left: i,
|
|
877
|
+
bottom: r + e.height,
|
|
878
|
+
right: i + e.width
|
|
876
879
|
};
|
|
877
880
|
}
|
|
878
881
|
/**
|
|
@@ -886,55 +889,67 @@ class f {
|
|
|
886
889
|
t,
|
|
887
890
|
NodeFilter.SHOW_TEXT,
|
|
888
891
|
null
|
|
889
|
-
),
|
|
890
|
-
var
|
|
891
|
-
if (!
|
|
892
|
-
const
|
|
892
|
+
), n = (c, d, u, h) => {
|
|
893
|
+
var w;
|
|
894
|
+
if (!c && u) {
|
|
895
|
+
const C = d - h, k = Math.max(e - C, 0), x = Math.min(k, h);
|
|
893
896
|
return {
|
|
894
897
|
node: u,
|
|
895
|
-
offset:
|
|
898
|
+
offset: x
|
|
896
899
|
};
|
|
897
900
|
}
|
|
898
|
-
if (!
|
|
901
|
+
if (!c)
|
|
899
902
|
return {
|
|
900
903
|
node: null,
|
|
901
904
|
offset: 0
|
|
902
905
|
};
|
|
903
|
-
const
|
|
904
|
-
return
|
|
905
|
-
node:
|
|
906
|
-
offset: Math.min(e -
|
|
907
|
-
} :
|
|
906
|
+
const f = ((w = c.textContent) != null ? w : "").length;
|
|
907
|
+
return d + f >= e ? {
|
|
908
|
+
node: c,
|
|
909
|
+
offset: Math.min(e - d, f)
|
|
910
|
+
} : n(
|
|
908
911
|
o.nextNode(),
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
+
d + f,
|
|
913
|
+
c,
|
|
914
|
+
f
|
|
912
915
|
);
|
|
913
|
-
},
|
|
914
|
-
if (!
|
|
916
|
+
}, r = o.nextNode(), { node: i, offset: a } = n(r, 0, null, 0);
|
|
917
|
+
if (!i)
|
|
915
918
|
return {
|
|
916
919
|
node: null,
|
|
917
920
|
offset: 0
|
|
918
921
|
};
|
|
919
|
-
const
|
|
920
|
-
return !
|
|
922
|
+
const l = i.textContent;
|
|
923
|
+
return !l || l.length === 0 ? {
|
|
921
924
|
node: null,
|
|
922
925
|
offset: 0
|
|
923
926
|
} : {
|
|
924
|
-
node:
|
|
927
|
+
node: i,
|
|
925
928
|
offset: a
|
|
926
929
|
};
|
|
927
930
|
}
|
|
928
931
|
}
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
},
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
932
|
+
const Mo = (s) => !/[^\t\n\r \u200B]/.test(s), Bo = (s) => {
|
|
933
|
+
s.setAttribute("data-blok-empty", m.isEmpty(s) ? "true" : "false");
|
|
934
|
+
}, Zt = ["header", "table"], G = /* @__PURE__ */ new Map(), Ho = (s) => {
|
|
935
|
+
var o;
|
|
936
|
+
const t = [...new Set(s)];
|
|
937
|
+
for (const n of t) {
|
|
938
|
+
const r = (o = G.get(n)) != null ? o : 0;
|
|
939
|
+
G.set(n, r + 1);
|
|
940
|
+
}
|
|
941
|
+
const e = { cleanedUp: !1 };
|
|
942
|
+
return () => {
|
|
943
|
+
if (!e.cleanedUp) {
|
|
944
|
+
e.cleanedUp = !0;
|
|
945
|
+
for (const n of t) {
|
|
946
|
+
const r = G.get(n);
|
|
947
|
+
r !== void 0 && (r <= 1 ? G.delete(n) : G.set(n, r - 1));
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
}, Fo = () => [...Zt, ...G.keys()], Po = (s) => s ? (s instanceof HTMLElement ? s : s.holder).closest("[data-blok-table-cell-blocks]") !== null : !1, $o = (s) => Zt.includes(s) || G.has(s);
|
|
952
|
+
class Qt {
|
|
938
953
|
constructor() {
|
|
939
954
|
this.allListeners = [];
|
|
940
955
|
}
|
|
@@ -945,17 +960,17 @@ class Nt {
|
|
|
945
960
|
* @param {Function} handler - method that will be fired on event
|
|
946
961
|
* @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}
|
|
947
962
|
*/
|
|
948
|
-
on(t, e, o,
|
|
949
|
-
if (this.findOne(t, e, o,
|
|
963
|
+
on(t, e, o, n = !1) {
|
|
964
|
+
if (this.findOne(t, e, o, n))
|
|
950
965
|
return;
|
|
951
|
-
const
|
|
952
|
-
id:
|
|
966
|
+
const i = Ie("l"), a = {
|
|
967
|
+
id: i,
|
|
953
968
|
element: t,
|
|
954
969
|
eventType: e,
|
|
955
970
|
handler: o,
|
|
956
|
-
options:
|
|
971
|
+
options: n
|
|
957
972
|
};
|
|
958
|
-
return this.allListeners.push(a), t.addEventListener(e, o,
|
|
973
|
+
return this.allListeners.push(a), t.addEventListener(e, o, n), i;
|
|
959
974
|
}
|
|
960
975
|
/**
|
|
961
976
|
* Removes event listener from element
|
|
@@ -964,11 +979,11 @@ class Nt {
|
|
|
964
979
|
* @param {Function} handler - remove handler, if element listens several handlers on the same event type
|
|
965
980
|
* @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}
|
|
966
981
|
*/
|
|
967
|
-
off(t, e, o,
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
982
|
+
off(t, e, o, n) {
|
|
983
|
+
const r = this.findAll(t, e, o, n);
|
|
984
|
+
r.forEach((i, a) => {
|
|
985
|
+
const l = this.allListeners.indexOf(r[a]);
|
|
986
|
+
l > -1 && (this.allListeners.splice(l, 1), i.element.removeEventListener(i.eventType, i.handler, i.options));
|
|
972
987
|
});
|
|
973
988
|
}
|
|
974
989
|
/**
|
|
@@ -991,9 +1006,9 @@ class Nt {
|
|
|
991
1006
|
* @param {boolean|AddEventListenerOptions} [options] - event options
|
|
992
1007
|
* @returns {ListenerData|null}
|
|
993
1008
|
*/
|
|
994
|
-
findOne(t, e, o,
|
|
995
|
-
var
|
|
996
|
-
return (
|
|
1009
|
+
findOne(t, e, o, n) {
|
|
1010
|
+
var i;
|
|
1011
|
+
return (i = this.findAll(t, e, o, n)[0]) != null ? i : null;
|
|
997
1012
|
}
|
|
998
1013
|
/**
|
|
999
1014
|
* Return all stored listeners by passed params
|
|
@@ -1003,10 +1018,10 @@ class Nt {
|
|
|
1003
1018
|
* @param {boolean|AddEventListenerOptions} [options] - event options
|
|
1004
1019
|
* @returns {ListenerData[]}
|
|
1005
1020
|
*/
|
|
1006
|
-
findAll(t, e, o,
|
|
1007
|
-
return t ? this.findByEventTarget(t).filter((
|
|
1008
|
-
const a = e === void 0 ||
|
|
1009
|
-
return a &&
|
|
1021
|
+
findAll(t, e, o, n) {
|
|
1022
|
+
return t ? this.findByEventTarget(t).filter((i) => {
|
|
1023
|
+
const a = e === void 0 || i.eventType === e, l = o === void 0 || i.handler === o, c = this.areOptionsEqual(i.options, n);
|
|
1024
|
+
return a && l && c;
|
|
1010
1025
|
}) : [];
|
|
1011
1026
|
}
|
|
1012
1027
|
/**
|
|
@@ -1061,7 +1076,7 @@ class Nt {
|
|
|
1061
1076
|
* @returns {NormalizedListenerOptions}
|
|
1062
1077
|
*/
|
|
1063
1078
|
normalizeListenerOptions(t) {
|
|
1064
|
-
var e, o,
|
|
1079
|
+
var e, o, n;
|
|
1065
1080
|
return typeof t == "boolean" ? {
|
|
1066
1081
|
capture: t,
|
|
1067
1082
|
once: !1,
|
|
@@ -1069,7 +1084,7 @@ class Nt {
|
|
|
1069
1084
|
} : t ? {
|
|
1070
1085
|
capture: (e = t.capture) != null ? e : !1,
|
|
1071
1086
|
once: (o = t.once) != null ? o : !1,
|
|
1072
|
-
passive: (
|
|
1087
|
+
passive: (n = t.passive) != null ? n : !1,
|
|
1073
1088
|
signal: t.signal
|
|
1074
1089
|
} : {
|
|
1075
1090
|
capture: !1,
|
|
@@ -1086,79 +1101,79 @@ class Nt {
|
|
|
1086
1101
|
areOptionsEqual(t, e) {
|
|
1087
1102
|
if (e === void 0)
|
|
1088
1103
|
return !0;
|
|
1089
|
-
const o = this.normalizeListenerOptions(t),
|
|
1090
|
-
return o.capture ===
|
|
1104
|
+
const o = this.normalizeListenerOptions(t), n = this.normalizeListenerOptions(e);
|
|
1105
|
+
return o.capture === n.capture && o.once === n.once && o.passive === n.passive && o.signal === n.signal;
|
|
1091
1106
|
}
|
|
1092
1107
|
}
|
|
1093
|
-
const
|
|
1094
|
-
if (!
|
|
1108
|
+
const J = (s, t) => {
|
|
1109
|
+
if (!s.conversionConfig)
|
|
1095
1110
|
return !1;
|
|
1096
|
-
const e =
|
|
1097
|
-
return
|
|
1098
|
-
},
|
|
1111
|
+
const e = s.conversionConfig[t];
|
|
1112
|
+
return E(e) || P(e);
|
|
1113
|
+
}, Y = (s, t) => {
|
|
1099
1114
|
const e = t.includes(".") ? t : `toolNames.${t}`;
|
|
1100
|
-
return
|
|
1101
|
-
},
|
|
1102
|
-
const o = t.titleKey ?
|
|
1115
|
+
return s.has(e) ? s.t(e) : void 0;
|
|
1116
|
+
}, Ft = (s, t, e = "") => {
|
|
1117
|
+
const o = t.titleKey ? Y(s, t.titleKey) : void 0;
|
|
1103
1118
|
if (o !== void 0)
|
|
1104
1119
|
return o;
|
|
1105
|
-
const
|
|
1106
|
-
if (
|
|
1107
|
-
return
|
|
1120
|
+
const n = t.title ? Y(s, t.title) : void 0;
|
|
1121
|
+
if (n !== void 0)
|
|
1122
|
+
return n;
|
|
1108
1123
|
if (t.title)
|
|
1109
1124
|
return t.title;
|
|
1110
|
-
const
|
|
1111
|
-
return
|
|
1112
|
-
},
|
|
1113
|
-
const o = t ?
|
|
1125
|
+
const r = e ? Y(s, e) : void 0;
|
|
1126
|
+
return r != null ? r : e;
|
|
1127
|
+
}, Ae = (s, t, e) => {
|
|
1128
|
+
const o = t ? Y(s, t) : void 0;
|
|
1114
1129
|
if (o !== void 0)
|
|
1115
1130
|
return o;
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1118
|
-
},
|
|
1119
|
-
const o = (await
|
|
1120
|
-
return
|
|
1121
|
-
if (!
|
|
1122
|
-
return
|
|
1123
|
-
const a =
|
|
1124
|
-
if (
|
|
1131
|
+
const n = Y(s, e);
|
|
1132
|
+
return n != null ? n : e;
|
|
1133
|
+
}, Pt = (s, t) => J(s.tool, t), Se = (s, t) => Object.entries(s).some((([e, o]) => t[e] && xt(t[e], o))), te = async (s, t) => {
|
|
1134
|
+
const o = (await s.save()).data, n = t.find((r) => r.name === s.name);
|
|
1135
|
+
return n !== void 0 && !J(n, "export") ? [] : t.reduce((r, i) => {
|
|
1136
|
+
if (!J(i, "import") || i.toolbox === void 0)
|
|
1137
|
+
return r;
|
|
1138
|
+
const a = i.toolbox.filter((l) => {
|
|
1139
|
+
if (R(l) || l.icon === void 0)
|
|
1125
1140
|
return !1;
|
|
1126
|
-
const
|
|
1127
|
-
return !(
|
|
1141
|
+
const c = l.data !== void 0;
|
|
1142
|
+
return !(c && l.data !== void 0 && Se(l.data, o) || !c && i.name === s.name);
|
|
1128
1143
|
});
|
|
1129
|
-
return
|
|
1144
|
+
return r.push(D(L({}, i), {
|
|
1130
1145
|
toolbox: a
|
|
1131
|
-
})),
|
|
1146
|
+
})), r;
|
|
1132
1147
|
}, []);
|
|
1133
|
-
},
|
|
1134
|
-
if (
|
|
1148
|
+
}, Do = (s, t) => s.mergeable ? s.name === t.name ? !0 : Pt(t, "export") && Pt(s, "import") : !1, jo = async (s, t) => {
|
|
1149
|
+
if (s.length === 0)
|
|
1135
1150
|
return [];
|
|
1136
|
-
if (
|
|
1137
|
-
return
|
|
1138
|
-
for (const o of
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1151
|
+
if (s.length === 1)
|
|
1152
|
+
return te(s[0], t);
|
|
1153
|
+
for (const o of s) {
|
|
1154
|
+
const n = t.find((r) => r.name === o.name);
|
|
1155
|
+
if (n !== void 0 && !J(n, "export"))
|
|
1141
1156
|
return [];
|
|
1142
1157
|
}
|
|
1143
|
-
const e = new Set(
|
|
1144
|
-
return t.reduce((o,
|
|
1145
|
-
if (!
|
|
1158
|
+
const e = new Set(s.map((o) => o.name));
|
|
1159
|
+
return t.reduce((o, n) => {
|
|
1160
|
+
if (!J(n, "import") || n.toolbox === void 0)
|
|
1146
1161
|
return o;
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1149
|
-
toolbox:
|
|
1162
|
+
const r = n.toolbox.filter((i) => !(R(i) || i.icon === void 0 || !(i.data !== void 0) && e.size === 1 && e.has(n.name)));
|
|
1163
|
+
return r.length > 0 && o.push(D(L({}, n), {
|
|
1164
|
+
toolbox: r
|
|
1150
1165
|
})), o;
|
|
1151
1166
|
}, []);
|
|
1152
|
-
},
|
|
1167
|
+
}, _o = (s, t) => {
|
|
1153
1168
|
const e = t == null ? void 0 : t.export;
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1169
|
+
return E(e) ? e(s) : P(e) ? s[e] : (e !== void 0 && rt("Conversion «export» property must be a string or function. String means key of saved data object to export. Function should export processed string to export."), "");
|
|
1170
|
+
}, Go = (s, t, e) => {
|
|
1156
1171
|
const o = t == null ? void 0 : t.import;
|
|
1157
|
-
return
|
|
1158
|
-
[o]:
|
|
1159
|
-
} : (o !== void 0 &&
|
|
1172
|
+
return E(o) ? o(s, e) : P(o) ? {
|
|
1173
|
+
[o]: s
|
|
1174
|
+
} : (o !== void 0 && rt("Conversion «import» property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data."), {});
|
|
1160
1175
|
};
|
|
1161
|
-
class
|
|
1176
|
+
class ee {
|
|
1162
1177
|
constructor() {
|
|
1163
1178
|
this.subscribers = {};
|
|
1164
1179
|
}
|
|
@@ -1177,9 +1192,9 @@ class Bt {
|
|
|
1177
1192
|
*/
|
|
1178
1193
|
once(t, e) {
|
|
1179
1194
|
t in this.subscribers || (this.subscribers[t] = []);
|
|
1180
|
-
const o = (
|
|
1181
|
-
const
|
|
1182
|
-
return
|
|
1195
|
+
const o = (n) => {
|
|
1196
|
+
const r = e(n), i = this.subscribers[t].indexOf(o);
|
|
1197
|
+
return i !== -1 && this.subscribers[t].splice(i, 1), r;
|
|
1183
1198
|
};
|
|
1184
1199
|
this.subscribers[t].push(o);
|
|
1185
1200
|
}
|
|
@@ -1189,9 +1204,9 @@ class Bt {
|
|
|
1189
1204
|
* @param data - subscribers get this data when they were fired
|
|
1190
1205
|
*/
|
|
1191
1206
|
emit(t, e) {
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
return
|
|
1207
|
+
R(this.subscribers) || !this.subscribers[t] || this.subscribers[t].reduce((o, n) => {
|
|
1208
|
+
const r = n(o);
|
|
1209
|
+
return r !== void 0 ? r : o;
|
|
1195
1210
|
}, e);
|
|
1196
1211
|
}
|
|
1197
1212
|
/**
|
|
@@ -1205,8 +1220,8 @@ class Bt {
|
|
|
1205
1220
|
console.warn(`EventDispatcher .off(): there is no subscribers for event "${t.toString()}". Probably, .off() called before .on()`);
|
|
1206
1221
|
return;
|
|
1207
1222
|
}
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1223
|
+
const n = o.indexOf(e);
|
|
1224
|
+
n !== -1 && o.splice(n, 1);
|
|
1210
1225
|
}
|
|
1211
1226
|
/**
|
|
1212
1227
|
* Destroyer
|
|
@@ -1216,9 +1231,8 @@ class Bt {
|
|
|
1216
1231
|
this.subscribers = {};
|
|
1217
1232
|
}
|
|
1218
1233
|
}
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1221
|
-
class m {
|
|
1234
|
+
const Wo = 180, Vo = 400, Uo = "blok", zo = "inline-toolbar", pt = "tooltip", Ko = "[data-blok-interface=inline-toolbar]", qo = typeof process != "undefined" ? process.platform === "darwin" ? "Meta" : "Control" : typeof navigator != "undefined" && navigator.userAgent.toLowerCase().includes("mac") ? "Meta" : "Control";
|
|
1235
|
+
class y {
|
|
1222
1236
|
/**
|
|
1223
1237
|
* Returns selected anchor node
|
|
1224
1238
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Selection/anchorNode}
|
|
@@ -1235,7 +1249,7 @@ class m {
|
|
|
1235
1249
|
if (!t)
|
|
1236
1250
|
return null;
|
|
1237
1251
|
const e = t.anchorNode;
|
|
1238
|
-
return e ?
|
|
1252
|
+
return e ? m.isElement(e) ? e : e.parentElement : null;
|
|
1239
1253
|
}
|
|
1240
1254
|
/**
|
|
1241
1255
|
* Returns selection offset according to the anchor node
|
|
@@ -1259,8 +1273,8 @@ class m {
|
|
|
1259
1273
|
static isSelectionAtBlok(t) {
|
|
1260
1274
|
if (!t)
|
|
1261
1275
|
return !1;
|
|
1262
|
-
const e = t.anchorNode || t.focusNode, o = e && e.nodeType === Node.TEXT_NODE ? e.parentNode : e,
|
|
1263
|
-
return
|
|
1276
|
+
const e = t.anchorNode || t.focusNode, o = e && e.nodeType === Node.TEXT_NODE ? e.parentNode : e, n = o && o instanceof Element ? o.closest(st(p.redactor)) : null;
|
|
1277
|
+
return n ? n.nodeType === Node.ELEMENT_NODE : !1;
|
|
1264
1278
|
}
|
|
1265
1279
|
/**
|
|
1266
1280
|
* Check if current selection is at Blok's zone
|
|
@@ -1275,7 +1289,7 @@ class m {
|
|
|
1275
1289
|
static isRangeAtBlok(t) {
|
|
1276
1290
|
if (!t)
|
|
1277
1291
|
return;
|
|
1278
|
-
const e = t.startContainer && t.startContainer.nodeType === Node.TEXT_NODE ? t.startContainer.parentNode : t.startContainer, o = e && e instanceof Element ? e.closest(
|
|
1292
|
+
const e = t.startContainer && t.startContainer.nodeType === Node.TEXT_NODE ? t.startContainer.parentNode : t.startContainer, o = e && e instanceof Element ? e.closest(st(p.redactor)) : null;
|
|
1279
1293
|
return o ? o.nodeType === Node.ELEMENT_NODE : !1;
|
|
1280
1294
|
}
|
|
1281
1295
|
/**
|
|
@@ -1316,19 +1330,19 @@ class m {
|
|
|
1316
1330
|
height: 0
|
|
1317
1331
|
}, e = window.getSelection();
|
|
1318
1332
|
if (!e)
|
|
1319
|
-
return
|
|
1333
|
+
return rt("Method window.getSelection returned null", "warn"), t;
|
|
1320
1334
|
if (e.rangeCount === null || Number.isNaN(e.rangeCount))
|
|
1321
|
-
return
|
|
1335
|
+
return rt("Method SelectionUtils.rangeCount is not supported", "warn"), t;
|
|
1322
1336
|
if (e.rangeCount === 0)
|
|
1323
1337
|
return t;
|
|
1324
|
-
const o = e.getRangeAt(0).cloneRange(),
|
|
1325
|
-
if (
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
const
|
|
1329
|
-
return a == null || a.removeChild(
|
|
1338
|
+
const o = e.getRangeAt(0).cloneRange(), n = o.getBoundingClientRect();
|
|
1339
|
+
if (n.x === 0 && n.y === 0) {
|
|
1340
|
+
const r = document.createElement("span");
|
|
1341
|
+
r.appendChild(document.createTextNode("")), o.insertNode(r);
|
|
1342
|
+
const i = r.getBoundingClientRect(), a = r.parentNode;
|
|
1343
|
+
return a == null || a.removeChild(r), a == null || a.normalize(), i;
|
|
1330
1344
|
}
|
|
1331
|
-
return
|
|
1345
|
+
return n;
|
|
1332
1346
|
}
|
|
1333
1347
|
/**
|
|
1334
1348
|
* Returns selected text as String
|
|
@@ -1339,22 +1353,22 @@ class m {
|
|
|
1339
1353
|
return (e = t == null ? void 0 : t.toString()) != null ? e : "";
|
|
1340
1354
|
}
|
|
1341
1355
|
}
|
|
1342
|
-
class
|
|
1356
|
+
class ft {
|
|
1343
1357
|
/**
|
|
1344
1358
|
* Set focus to contenteditable or native input element
|
|
1345
1359
|
* @param element - element where to set focus
|
|
1346
1360
|
* @param offset - offset of cursor
|
|
1347
1361
|
*/
|
|
1348
1362
|
static setCursor(t, e = 0) {
|
|
1349
|
-
const o = document.createRange(),
|
|
1350
|
-
return
|
|
1363
|
+
const o = document.createRange(), n = window.getSelection(), r = m.isNativeInput(t);
|
|
1364
|
+
return r && !m.canSetCaret(t) ? t.getBoundingClientRect() : r ? (t.focus(), t.selectionStart = e, t.selectionEnd = e, t.getBoundingClientRect()) : (o.setStart(t, e), o.setEnd(t, e), n ? (n.removeAllRanges(), n.addRange(o), o.getBoundingClientRect()) : t.getBoundingClientRect());
|
|
1351
1365
|
}
|
|
1352
1366
|
/**
|
|
1353
1367
|
* Check if current range exists and belongs to container
|
|
1354
1368
|
* @param container - where range should be
|
|
1355
1369
|
*/
|
|
1356
1370
|
static isRangeInsideContainer(t) {
|
|
1357
|
-
const e =
|
|
1371
|
+
const e = y.getRange();
|
|
1358
1372
|
return e === null ? !1 : t.contains(e.startContainer);
|
|
1359
1373
|
}
|
|
1360
1374
|
/**
|
|
@@ -1368,7 +1382,7 @@ class st {
|
|
|
1368
1382
|
e.selectNodeContents(t.focusNode), e.collapse(!1), t.removeAllRanges(), t.addRange(e);
|
|
1369
1383
|
}
|
|
1370
1384
|
}
|
|
1371
|
-
const
|
|
1385
|
+
const Nt = class Nt {
|
|
1372
1386
|
/**
|
|
1373
1387
|
* Applies box-shadow to a wrapper to extend the background to fill line-height
|
|
1374
1388
|
* @param wrapper - the wrapper element
|
|
@@ -1377,8 +1391,8 @@ const gt = class gt {
|
|
|
1377
1391
|
const e = t.parentElement;
|
|
1378
1392
|
if (!e)
|
|
1379
1393
|
return;
|
|
1380
|
-
const o = window.getComputedStyle(e),
|
|
1381
|
-
|
|
1394
|
+
const o = window.getComputedStyle(e), n = window.getComputedStyle(t), r = parseFloat(o.lineHeight), i = parseFloat(n.fontSize), a = Number.isNaN(r) ? i * 1.2 : r, l = t.getBoundingClientRect(), c = Math.max(0, (a - l.height) / 2);
|
|
1395
|
+
c > 0 && (t.style.boxShadow = `0 ${c}px 0 ${this.BG_COLOR}, 0 -${c}px 0 ${this.BG_COLOR}`);
|
|
1382
1396
|
}
|
|
1383
1397
|
/**
|
|
1384
1398
|
* Applies additional box-shadow extensions to fill gaps between separate spans
|
|
@@ -1389,10 +1403,10 @@ const gt = class gt {
|
|
|
1389
1403
|
const e = this.collectAllLineRects(t);
|
|
1390
1404
|
if (e.length === 0)
|
|
1391
1405
|
return;
|
|
1392
|
-
e.sort((
|
|
1406
|
+
e.sort((n, r) => n.top - r.top);
|
|
1393
1407
|
const o = this.groupRectsByLine(e);
|
|
1394
|
-
t.forEach((
|
|
1395
|
-
this.applyMultiLineBoxShadow(
|
|
1408
|
+
t.forEach((n) => {
|
|
1409
|
+
this.applyMultiLineBoxShadow(n, o);
|
|
1396
1410
|
});
|
|
1397
1411
|
}
|
|
1398
1412
|
/**
|
|
@@ -1402,11 +1416,11 @@ const gt = class gt {
|
|
|
1402
1416
|
static collectAllLineRects(t) {
|
|
1403
1417
|
const e = [];
|
|
1404
1418
|
return t.forEach((o) => {
|
|
1405
|
-
const
|
|
1406
|
-
Array.from(
|
|
1419
|
+
const n = o.getClientRects();
|
|
1420
|
+
Array.from(n).forEach((r) => {
|
|
1407
1421
|
e.push({
|
|
1408
|
-
top:
|
|
1409
|
-
bottom:
|
|
1422
|
+
top: r.top,
|
|
1423
|
+
bottom: r.bottom,
|
|
1410
1424
|
span: o
|
|
1411
1425
|
});
|
|
1412
1426
|
});
|
|
@@ -1419,9 +1433,9 @@ const gt = class gt {
|
|
|
1419
1433
|
static groupRectsByLine(t) {
|
|
1420
1434
|
const e = [];
|
|
1421
1435
|
return t.forEach((o) => {
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1424
|
-
}), e.sort((o,
|
|
1436
|
+
const n = e.find((r) => Math.abs(r.top - o.top) < 2);
|
|
1437
|
+
n ? (n.top = Math.min(n.top, o.top), n.bottom = Math.max(n.bottom, o.bottom)) : e.push({ top: o.top, bottom: o.bottom });
|
|
1438
|
+
}), e.sort((o, n) => o.top - n.top), e;
|
|
1425
1439
|
}
|
|
1426
1440
|
/**
|
|
1427
1441
|
* Applies box-shadow to a span that may span multiple lines
|
|
@@ -1433,11 +1447,11 @@ const gt = class gt {
|
|
|
1433
1447
|
const o = t.getClientRects();
|
|
1434
1448
|
if (o.length === 0)
|
|
1435
1449
|
return;
|
|
1436
|
-
const
|
|
1437
|
-
if (!
|
|
1450
|
+
const n = t.parentElement;
|
|
1451
|
+
if (!n)
|
|
1438
1452
|
return;
|
|
1439
|
-
const
|
|
1440
|
-
t.style.boxShadow =
|
|
1453
|
+
const r = window.getComputedStyle(n), i = parseFloat(r.lineHeight), a = parseFloat(window.getComputedStyle(t).fontSize), l = Number.isNaN(i) ? a * 1.2 : i, c = o[0], d = o[o.length - 1], u = this.findLineIndex(c.top, e), h = this.findLineIndex(d.top, e), g = o.length > 1 && u !== h, f = u === 0, b = h === e.length - 1, w = Math.max(0, (l - c.height) / 2), C = g ? this.calculateLineTopExtension(w, f, e, u) : w, k = g ? this.calculateLineBottomExtension(w, b, e, h) : w, x = this.buildBoxShadow(C, k);
|
|
1454
|
+
t.style.boxShadow = x;
|
|
1441
1455
|
}
|
|
1442
1456
|
/**
|
|
1443
1457
|
* Finds the line index for a given top position
|
|
@@ -1445,7 +1459,7 @@ const gt = class gt {
|
|
|
1445
1459
|
* @param lineGroups - grouped line rectangles
|
|
1446
1460
|
*/
|
|
1447
1461
|
static findLineIndex(t, e) {
|
|
1448
|
-
const o = e.findIndex((
|
|
1462
|
+
const o = e.findIndex((n) => Math.abs(n.top - t) < 5);
|
|
1449
1463
|
return o >= 0 ? o : 0;
|
|
1450
1464
|
}
|
|
1451
1465
|
/**
|
|
@@ -1456,23 +1470,23 @@ const gt = class gt {
|
|
|
1456
1470
|
* @param _lineGroups - grouped line rectangles
|
|
1457
1471
|
* @param _lineIndex - the line index
|
|
1458
1472
|
*/
|
|
1459
|
-
static calculateLineTopExtension(t, e, o,
|
|
1473
|
+
static calculateLineTopExtension(t, e, o, n) {
|
|
1460
1474
|
return t;
|
|
1461
1475
|
}
|
|
1462
1476
|
/**
|
|
1463
1477
|
* Calculates bottom extension for a line, accounting for gap to next line
|
|
1464
1478
|
* The bottom extension fills the gap up to where the next line's top extension begins
|
|
1465
|
-
* This prevents overlap: line N's bottom shadow meets line N+1's top shadow exactly
|
|
1479
|
+
* This prevents overlap: line N's bottom shadow-sm meets line N+1's top shadow exactly
|
|
1466
1480
|
* @param baseExtension - the base extension value
|
|
1467
1481
|
* @param isLastLine - whether this is the last line
|
|
1468
1482
|
* @param lineGroups - grouped line rectangles
|
|
1469
1483
|
* @param lineIndex - the line index
|
|
1470
1484
|
*/
|
|
1471
|
-
static calculateLineBottomExtension(t, e, o,
|
|
1485
|
+
static calculateLineBottomExtension(t, e, o, n) {
|
|
1472
1486
|
if (e)
|
|
1473
1487
|
return t;
|
|
1474
|
-
const
|
|
1475
|
-
return t +
|
|
1488
|
+
const r = o[n], a = o[n + 1].top - r.bottom, c = Math.max(0, a - t);
|
|
1489
|
+
return t + c;
|
|
1476
1490
|
}
|
|
1477
1491
|
/**
|
|
1478
1492
|
* Builds box-shadow CSS value from top and bottom extensions
|
|
@@ -1486,9 +1500,9 @@ const gt = class gt {
|
|
|
1486
1500
|
return o.push(`inset 0 0 0 9999px ${this.BG_COLOR}`), e > 0 && o.push(`0 ${e}px 0 ${this.BG_COLOR}`), t > 0 && o.push(`0 -${t}px 0 ${this.BG_COLOR}`), o.join(", ");
|
|
1487
1501
|
}
|
|
1488
1502
|
};
|
|
1489
|
-
|
|
1490
|
-
let
|
|
1491
|
-
class
|
|
1503
|
+
Nt.BG_COLOR = "rgba(0, 0, 0, 0.08)";
|
|
1504
|
+
let U = Nt;
|
|
1505
|
+
class Ct {
|
|
1492
1506
|
/**
|
|
1493
1507
|
* Collects text nodes that intersect with the passed range
|
|
1494
1508
|
* @param range - selection range
|
|
@@ -1497,15 +1511,15 @@ class ct {
|
|
|
1497
1511
|
const e = [], { commonAncestorContainer: o } = t;
|
|
1498
1512
|
if (o.nodeType === Node.TEXT_NODE)
|
|
1499
1513
|
return e.push(o), e;
|
|
1500
|
-
const
|
|
1514
|
+
const n = document.createTreeWalker(
|
|
1501
1515
|
o,
|
|
1502
1516
|
NodeFilter.SHOW_TEXT,
|
|
1503
1517
|
{
|
|
1504
|
-
acceptNode: (
|
|
1518
|
+
acceptNode: (r) => t.intersectsNode(r) && r.textContent && r.textContent.length > 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
|
|
1505
1519
|
}
|
|
1506
1520
|
);
|
|
1507
|
-
for (;
|
|
1508
|
-
e.push(
|
|
1521
|
+
for (; n.nextNode(); )
|
|
1522
|
+
e.push(n.currentNode);
|
|
1509
1523
|
return e;
|
|
1510
1524
|
}
|
|
1511
1525
|
/**
|
|
@@ -1514,14 +1528,14 @@ class ct {
|
|
|
1514
1528
|
* @param expectedLines - expected number of lines
|
|
1515
1529
|
*/
|
|
1516
1530
|
static findLineBreakPositions(t, e) {
|
|
1517
|
-
const o = t.textContent || "",
|
|
1518
|
-
return Array.from({ length: o.length }, (a,
|
|
1519
|
-
(a,
|
|
1531
|
+
const o = t.textContent || "", n = document.createRange();
|
|
1532
|
+
return Array.from({ length: o.length }, (a, l) => l).reduce(
|
|
1533
|
+
(a, l) => {
|
|
1520
1534
|
if (a.positions.length >= e - 1)
|
|
1521
1535
|
return a;
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1524
|
-
return a.lastTop !== -1 && Math.abs(
|
|
1536
|
+
n.setStart(t, l), n.setEnd(t, l + 1);
|
|
1537
|
+
const c = n.getBoundingClientRect();
|
|
1538
|
+
return a.lastTop !== -1 && Math.abs(c.top - a.lastTop) > 5 && a.positions.push(l), { positions: a.positions, lastTop: c.top };
|
|
1525
1539
|
},
|
|
1526
1540
|
{ positions: [], lastTop: -1 }
|
|
1527
1541
|
).positions;
|
|
@@ -1533,10 +1547,10 @@ class ct {
|
|
|
1533
1547
|
*/
|
|
1534
1548
|
static splitTextAtPositions(t, e) {
|
|
1535
1549
|
const o = [0, ...e, t.length];
|
|
1536
|
-
return o.slice(0, -1).map((
|
|
1550
|
+
return o.slice(0, -1).map((n, r) => t.substring(n, o[r + 1])).filter((n) => n.length > 0);
|
|
1537
1551
|
}
|
|
1538
1552
|
}
|
|
1539
|
-
class
|
|
1553
|
+
class tt {
|
|
1540
1554
|
/**
|
|
1541
1555
|
* Wraps passed range with a highlight span styled like an unfocused selection (gray)
|
|
1542
1556
|
* @param range - range to wrap
|
|
@@ -1544,7 +1558,7 @@ class _ {
|
|
|
1544
1558
|
static wrapRangeWithHighlight(t) {
|
|
1545
1559
|
if (t.collapsed)
|
|
1546
1560
|
return null;
|
|
1547
|
-
const e =
|
|
1561
|
+
const e = m.make("span");
|
|
1548
1562
|
e.setAttribute("data-blok-testid", "fake-background"), e.setAttribute("data-blok-fake-background", "true"), e.setAttribute("data-blok-mutation-free", "true"), e.style.color = "inherit", e.style.boxDecorationBreak = "clone", e.style["-webkit-box-decoration-break"] = "clone", e.style.whiteSpace = "pre-wrap";
|
|
1549
1563
|
const o = t.extractContents();
|
|
1550
1564
|
return o.childNodes.length === 0 ? null : (e.appendChild(o), t.insertNode(e), e);
|
|
@@ -1557,8 +1571,8 @@ class _ {
|
|
|
1557
1571
|
static postProcessHighlightWrappers(t) {
|
|
1558
1572
|
const e = [];
|
|
1559
1573
|
return t.forEach((o) => {
|
|
1560
|
-
const
|
|
1561
|
-
e.push(...
|
|
1574
|
+
const n = this.splitMultiLineWrapper(o);
|
|
1575
|
+
e.push(...n);
|
|
1562
1576
|
}), e;
|
|
1563
1577
|
}
|
|
1564
1578
|
/**
|
|
@@ -1570,23 +1584,23 @@ class _ {
|
|
|
1570
1584
|
static splitMultiLineWrapper(t) {
|
|
1571
1585
|
const e = t.getClientRects();
|
|
1572
1586
|
if (e.length <= 1)
|
|
1573
|
-
return
|
|
1574
|
-
const o = t.textContent || "",
|
|
1575
|
-
if (!
|
|
1576
|
-
return
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1579
|
-
return
|
|
1580
|
-
const a =
|
|
1587
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1588
|
+
const o = t.textContent || "", n = t.parentNode;
|
|
1589
|
+
if (!n || !o)
|
|
1590
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1591
|
+
const r = [], i = t.firstChild;
|
|
1592
|
+
if (!i || i.nodeType !== Node.TEXT_NODE)
|
|
1593
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1594
|
+
const a = Ct.findLineBreakPositions(i, e.length);
|
|
1581
1595
|
if (a.length === 0)
|
|
1582
|
-
return
|
|
1583
|
-
const
|
|
1584
|
-
return
|
|
1585
|
-
if (
|
|
1596
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1597
|
+
const l = Ct.splitTextAtPositions(o, a), c = document.createDocumentFragment();
|
|
1598
|
+
return l.forEach((d) => {
|
|
1599
|
+
if (d.length === 0)
|
|
1586
1600
|
return;
|
|
1587
|
-
const u =
|
|
1588
|
-
u.setAttribute("data-blok-testid", "fake-background"), u.setAttribute("data-blok-fake-background", "true"), u.setAttribute("data-blok-mutation-free", "true"), u.style.color = "inherit", u.style.boxDecorationBreak = "clone", u.style["-webkit-box-decoration-break"] = "clone", u.style.whiteSpace = "pre-wrap", u.textContent =
|
|
1589
|
-
}),
|
|
1601
|
+
const u = m.make("span");
|
|
1602
|
+
u.setAttribute("data-blok-testid", "fake-background"), u.setAttribute("data-blok-fake-background", "true"), u.setAttribute("data-blok-mutation-free", "true"), u.style.color = "inherit", u.style.boxDecorationBreak = "clone", u.style["-webkit-box-decoration-break"] = "clone", u.style.whiteSpace = "pre-wrap", u.textContent = d, c.appendChild(u), r.push(u);
|
|
1603
|
+
}), n.replaceChild(c, t), r;
|
|
1590
1604
|
}
|
|
1591
1605
|
/**
|
|
1592
1606
|
* Removes fake background wrapper
|
|
@@ -1601,7 +1615,7 @@ class _ {
|
|
|
1601
1615
|
}
|
|
1602
1616
|
}
|
|
1603
1617
|
}
|
|
1604
|
-
class
|
|
1618
|
+
class Le {
|
|
1605
1619
|
constructor(t) {
|
|
1606
1620
|
this.selectionUtils = t;
|
|
1607
1621
|
}
|
|
@@ -1618,26 +1632,26 @@ class ie {
|
|
|
1618
1632
|
const e = t.getRangeAt(0);
|
|
1619
1633
|
if (e.collapsed)
|
|
1620
1634
|
return;
|
|
1621
|
-
const o =
|
|
1635
|
+
const o = Ct.collectTextNodes(e);
|
|
1622
1636
|
if (o.length === 0)
|
|
1623
1637
|
return;
|
|
1624
|
-
const
|
|
1625
|
-
if (o.forEach((
|
|
1626
|
-
var
|
|
1627
|
-
const
|
|
1628
|
-
if (
|
|
1638
|
+
const n = e.startContainer, r = e.startOffset, i = e.endContainer, a = e.endOffset, l = [];
|
|
1639
|
+
if (o.forEach((h) => {
|
|
1640
|
+
var I, $;
|
|
1641
|
+
const g = document.createRange(), f = h === n, b = h === i, w = f ? r : 0, C = ($ = (I = h.textContent) == null ? void 0 : I.length) != null ? $ : 0, k = b ? a : C;
|
|
1642
|
+
if (w === k)
|
|
1629
1643
|
return;
|
|
1630
|
-
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
}),
|
|
1644
|
+
g.setStart(h, w), g.setEnd(h, k);
|
|
1645
|
+
const x = tt.wrapRangeWithHighlight(g);
|
|
1646
|
+
x && l.push(x);
|
|
1647
|
+
}), l.length === 0)
|
|
1634
1648
|
return;
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1649
|
+
const c = tt.postProcessHighlightWrappers(l);
|
|
1650
|
+
U.applyLineHeightExtensions(c);
|
|
1651
|
+
const d = document.createRange();
|
|
1652
|
+
d.setStartBefore(c[0]), d.setEndAfter(c[c.length - 1]), this.selectionUtils.savedSelectionRange = d.cloneRange();
|
|
1639
1653
|
const u = window.getSelection();
|
|
1640
|
-
u && (u.removeAllRanges(), u.addRange(
|
|
1654
|
+
u && (u.removeAllRanges(), u.addRange(d)), this.selectionUtils.isFakeBackgroundEnabled = !0;
|
|
1641
1655
|
}
|
|
1642
1656
|
/**
|
|
1643
1657
|
* Removes fake background
|
|
@@ -1653,7 +1667,7 @@ class ie {
|
|
|
1653
1667
|
*/
|
|
1654
1668
|
removeOrphanedFakeBackgroundElements() {
|
|
1655
1669
|
document.querySelectorAll('[data-blok-fake-background="true"]').forEach((e) => {
|
|
1656
|
-
|
|
1670
|
+
tt.unwrapFakeBackground(e);
|
|
1657
1671
|
});
|
|
1658
1672
|
}
|
|
1659
1673
|
/**
|
|
@@ -1667,47 +1681,47 @@ class ie {
|
|
|
1667
1681
|
* Removes highlight spans and reconstructs the saved selection range
|
|
1668
1682
|
*/
|
|
1669
1683
|
removeHighlightSpans() {
|
|
1670
|
-
var
|
|
1684
|
+
var i;
|
|
1671
1685
|
const t = document.querySelectorAll('[data-blok-fake-background="true"]');
|
|
1672
1686
|
if (t.length === 0)
|
|
1673
1687
|
return;
|
|
1674
|
-
const e = t[0], o = t[t.length - 1],
|
|
1688
|
+
const e = t[0], o = t[t.length - 1], n = e.firstChild, r = o.lastChild;
|
|
1675
1689
|
if (t.forEach((a) => {
|
|
1676
|
-
|
|
1677
|
-
}),
|
|
1690
|
+
tt.unwrapFakeBackground(a);
|
|
1691
|
+
}), n && r) {
|
|
1678
1692
|
const a = document.createRange();
|
|
1679
|
-
a.setStart(
|
|
1693
|
+
a.setStart(n, 0), a.setEnd(r, ((i = r.textContent) == null ? void 0 : i.length) || 0), this.selectionUtils.savedSelectionRange = a;
|
|
1680
1694
|
}
|
|
1681
1695
|
}
|
|
1682
1696
|
}
|
|
1683
|
-
class
|
|
1697
|
+
class gt {
|
|
1684
1698
|
/**
|
|
1685
1699
|
* Adds fake cursor to the current range
|
|
1686
1700
|
*/
|
|
1687
1701
|
static addFakeCursor() {
|
|
1688
|
-
const t =
|
|
1702
|
+
const t = y.getRange();
|
|
1689
1703
|
if (t === null)
|
|
1690
1704
|
return;
|
|
1691
|
-
const e =
|
|
1692
|
-
e.setAttribute(
|
|
1705
|
+
const e = m.make("span");
|
|
1706
|
+
e.setAttribute(p.fakeCursor, ""), e.setAttribute("data-blok-mutation-free", "true"), t.collapse(), t.insertNode(e);
|
|
1693
1707
|
}
|
|
1694
1708
|
/**
|
|
1695
1709
|
* Check if passed element contains a fake cursor
|
|
1696
1710
|
* @param el - where to check
|
|
1697
1711
|
*/
|
|
1698
1712
|
static isFakeCursorInsideContainer(t) {
|
|
1699
|
-
return
|
|
1713
|
+
return m.find(t, st(p.fakeCursor)) !== null;
|
|
1700
1714
|
}
|
|
1701
1715
|
/**
|
|
1702
1716
|
* Removes fake cursor from a container
|
|
1703
1717
|
* @param container - container to look for
|
|
1704
1718
|
*/
|
|
1705
1719
|
static removeFakeCursor(t = document.body) {
|
|
1706
|
-
const e =
|
|
1720
|
+
const e = m.find(t, st(p.fakeCursor));
|
|
1707
1721
|
e && e.remove();
|
|
1708
1722
|
}
|
|
1709
1723
|
}
|
|
1710
|
-
class
|
|
1724
|
+
class $t {
|
|
1711
1725
|
/**
|
|
1712
1726
|
* Looks ahead to find passed tag from current selection
|
|
1713
1727
|
* @param tagName - tag to find
|
|
@@ -1715,30 +1729,30 @@ class Tt {
|
|
|
1715
1729
|
* @param searchDepth - count of tags that can be included. For better performance.
|
|
1716
1730
|
*/
|
|
1717
1731
|
static findParentTag(t, e, o = 10) {
|
|
1718
|
-
const
|
|
1719
|
-
if (!
|
|
1732
|
+
const n = window.getSelection();
|
|
1733
|
+
if (!n || !n.anchorNode || !n.focusNode)
|
|
1720
1734
|
return null;
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
],
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1735
|
+
const r = [
|
|
1736
|
+
n.anchorNode,
|
|
1737
|
+
n.focusNode
|
|
1738
|
+
], i = (a) => {
|
|
1739
|
+
const l = (c, d) => {
|
|
1740
|
+
if (d <= 0 || !c)
|
|
1727
1741
|
return null;
|
|
1728
|
-
const u =
|
|
1729
|
-
if (u &&
|
|
1730
|
-
return
|
|
1731
|
-
if (!
|
|
1742
|
+
const u = c.nodeType === Node.ELEMENT_NODE && c.tagName === t, h = !e || c.classList && c.classList.contains(e);
|
|
1743
|
+
if (u && h)
|
|
1744
|
+
return c;
|
|
1745
|
+
if (!c.parentNode)
|
|
1732
1746
|
return null;
|
|
1733
|
-
const
|
|
1734
|
-
return
|
|
1747
|
+
const g = c.parentNode, f = !e || g.classList && g.classList.contains(e);
|
|
1748
|
+
return g.tagName === t && f ? g : l(g, d - 1);
|
|
1735
1749
|
};
|
|
1736
|
-
return
|
|
1750
|
+
return l(a, o);
|
|
1737
1751
|
};
|
|
1738
|
-
for (const a of
|
|
1739
|
-
const
|
|
1740
|
-
if (
|
|
1741
|
-
return
|
|
1752
|
+
for (const a of r) {
|
|
1753
|
+
const l = i(a);
|
|
1754
|
+
if (l)
|
|
1755
|
+
return l;
|
|
1742
1756
|
}
|
|
1743
1757
|
return null;
|
|
1744
1758
|
}
|
|
@@ -1755,9 +1769,9 @@ class Tt {
|
|
|
1755
1769
|
o.selectNodeContents(t), e.addRange(o);
|
|
1756
1770
|
}
|
|
1757
1771
|
}
|
|
1758
|
-
class
|
|
1772
|
+
class oe {
|
|
1759
1773
|
constructor() {
|
|
1760
|
-
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new
|
|
1774
|
+
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new Le(this);
|
|
1761
1775
|
}
|
|
1762
1776
|
// ========================
|
|
1763
1777
|
// Static getters - delegate to core module
|
|
@@ -1768,14 +1782,14 @@ class Ot {
|
|
|
1768
1782
|
* @returns {Node|null}
|
|
1769
1783
|
*/
|
|
1770
1784
|
static get anchorNode() {
|
|
1771
|
-
return
|
|
1785
|
+
return y.getAnchorNode();
|
|
1772
1786
|
}
|
|
1773
1787
|
/**
|
|
1774
1788
|
* Returns selected anchor element
|
|
1775
1789
|
* @returns {Element|null}
|
|
1776
1790
|
*/
|
|
1777
1791
|
static get anchorElement() {
|
|
1778
|
-
return
|
|
1792
|
+
return y.getAnchorElement();
|
|
1779
1793
|
}
|
|
1780
1794
|
/**
|
|
1781
1795
|
* Returns selection offset according to the anchor node
|
|
@@ -1783,69 +1797,69 @@ class Ot {
|
|
|
1783
1797
|
* @returns {number|null}
|
|
1784
1798
|
*/
|
|
1785
1799
|
static get anchorOffset() {
|
|
1786
|
-
return
|
|
1800
|
+
return y.getAnchorOffset();
|
|
1787
1801
|
}
|
|
1788
1802
|
/**
|
|
1789
1803
|
* Is current selection range collapsed
|
|
1790
1804
|
* @returns {boolean|null}
|
|
1791
1805
|
*/
|
|
1792
1806
|
static get isCollapsed() {
|
|
1793
|
-
return
|
|
1807
|
+
return y.getIsCollapsed();
|
|
1794
1808
|
}
|
|
1795
1809
|
/**
|
|
1796
1810
|
* Check current selection if it is at Blok's zone
|
|
1797
1811
|
* @returns {boolean}
|
|
1798
1812
|
*/
|
|
1799
1813
|
static get isAtBlok() {
|
|
1800
|
-
return
|
|
1814
|
+
return y.getIsAtBlok();
|
|
1801
1815
|
}
|
|
1802
1816
|
/**
|
|
1803
1817
|
* Check if passed selection is at Blok's zone
|
|
1804
1818
|
* @param selection - Selection object to check
|
|
1805
1819
|
*/
|
|
1806
1820
|
static isSelectionAtBlok(t) {
|
|
1807
|
-
return
|
|
1821
|
+
return y.isSelectionAtBlok(t);
|
|
1808
1822
|
}
|
|
1809
1823
|
/**
|
|
1810
1824
|
* Check if passed range at Blok zone
|
|
1811
1825
|
* @param range - range to check
|
|
1812
1826
|
*/
|
|
1813
1827
|
static isRangeAtBlok(t) {
|
|
1814
|
-
return
|
|
1828
|
+
return y.isRangeAtBlok(t);
|
|
1815
1829
|
}
|
|
1816
1830
|
/**
|
|
1817
1831
|
* Methods return boolean that true if selection exists on the page
|
|
1818
1832
|
*/
|
|
1819
1833
|
static get isSelectionExists() {
|
|
1820
|
-
return
|
|
1834
|
+
return y.getIsSelectionExists();
|
|
1821
1835
|
}
|
|
1822
1836
|
/**
|
|
1823
1837
|
* Return first range
|
|
1824
1838
|
* @returns {Range|null}
|
|
1825
1839
|
*/
|
|
1826
1840
|
static get range() {
|
|
1827
|
-
return
|
|
1841
|
+
return y.getRange();
|
|
1828
1842
|
}
|
|
1829
1843
|
/**
|
|
1830
1844
|
* Returns range from passed Selection object
|
|
1831
1845
|
* @param selection - Selection object to get Range from
|
|
1832
1846
|
*/
|
|
1833
1847
|
static getRangeFromSelection(t) {
|
|
1834
|
-
return
|
|
1848
|
+
return y.getRangeFromSelection(t);
|
|
1835
1849
|
}
|
|
1836
1850
|
/**
|
|
1837
1851
|
* Calculates position and size of selected text
|
|
1838
1852
|
* @returns {DOMRect}
|
|
1839
1853
|
*/
|
|
1840
1854
|
static get rect() {
|
|
1841
|
-
return
|
|
1855
|
+
return y.getRect();
|
|
1842
1856
|
}
|
|
1843
1857
|
/**
|
|
1844
1858
|
* Returns selected text as String
|
|
1845
1859
|
* @returns {string}
|
|
1846
1860
|
*/
|
|
1847
1861
|
static get text() {
|
|
1848
|
-
return
|
|
1862
|
+
return y.getText();
|
|
1849
1863
|
}
|
|
1850
1864
|
/**
|
|
1851
1865
|
* Returns window Selection
|
|
@@ -1853,7 +1867,7 @@ class Ot {
|
|
|
1853
1867
|
* @returns {Selection}
|
|
1854
1868
|
*/
|
|
1855
1869
|
static get() {
|
|
1856
|
-
return
|
|
1870
|
+
return y.get();
|
|
1857
1871
|
}
|
|
1858
1872
|
// ========================
|
|
1859
1873
|
// Static methods - delegate to appropriate modules
|
|
@@ -1864,34 +1878,34 @@ class Ot {
|
|
|
1864
1878
|
* @param offset - offset of cursor
|
|
1865
1879
|
*/
|
|
1866
1880
|
static setCursor(t, e = 0) {
|
|
1867
|
-
return
|
|
1881
|
+
return ft.setCursor(t, e);
|
|
1868
1882
|
}
|
|
1869
1883
|
/**
|
|
1870
1884
|
* Check if current range exists and belongs to container
|
|
1871
1885
|
* @param container - where range should be
|
|
1872
1886
|
*/
|
|
1873
1887
|
static isRangeInsideContainer(t) {
|
|
1874
|
-
return
|
|
1888
|
+
return ft.isRangeInsideContainer(t);
|
|
1875
1889
|
}
|
|
1876
1890
|
/**
|
|
1877
1891
|
* Adds fake cursor to the current range
|
|
1878
1892
|
*/
|
|
1879
1893
|
static addFakeCursor() {
|
|
1880
|
-
|
|
1894
|
+
gt.addFakeCursor();
|
|
1881
1895
|
}
|
|
1882
1896
|
/**
|
|
1883
1897
|
* Check if passed element contains a fake cursor
|
|
1884
1898
|
* @param el - where to check
|
|
1885
1899
|
*/
|
|
1886
1900
|
static isFakeCursorInsideContainer(t) {
|
|
1887
|
-
return
|
|
1901
|
+
return gt.isFakeCursorInsideContainer(t);
|
|
1888
1902
|
}
|
|
1889
1903
|
/**
|
|
1890
1904
|
* Removes fake cursor from a container
|
|
1891
1905
|
* @param container - container to look for
|
|
1892
1906
|
*/
|
|
1893
1907
|
static removeFakeCursor(t = document.body) {
|
|
1894
|
-
|
|
1908
|
+
gt.removeFakeCursor(t);
|
|
1895
1909
|
}
|
|
1896
1910
|
// ========================
|
|
1897
1911
|
// Instance methods - delegate to FakeBackgroundManager or use instance state
|
|
@@ -1930,7 +1944,7 @@ class Ot {
|
|
|
1930
1944
|
* Save Selection's range
|
|
1931
1945
|
*/
|
|
1932
1946
|
save() {
|
|
1933
|
-
this.savedSelectionRange =
|
|
1947
|
+
this.savedSelectionRange = y.getRange();
|
|
1934
1948
|
}
|
|
1935
1949
|
/**
|
|
1936
1950
|
* Restore saved Selection's range
|
|
@@ -1951,7 +1965,7 @@ class Ot {
|
|
|
1951
1965
|
* Collapse current selection
|
|
1952
1966
|
*/
|
|
1953
1967
|
collapseToEnd() {
|
|
1954
|
-
|
|
1968
|
+
ft.collapseToEnd();
|
|
1955
1969
|
}
|
|
1956
1970
|
/**
|
|
1957
1971
|
* Looks ahead to find passed tag from current selection
|
|
@@ -1961,25 +1975,29 @@ class Ot {
|
|
|
1961
1975
|
* @returns {HTMLElement|null}
|
|
1962
1976
|
*/
|
|
1963
1977
|
findParentTag(t, e, o = 10) {
|
|
1964
|
-
return
|
|
1978
|
+
return $t.findParentTag(t, e, o);
|
|
1965
1979
|
}
|
|
1966
1980
|
/**
|
|
1967
1981
|
* Expands selection range to the passed parent node
|
|
1968
1982
|
* @param element - element which contents should be selected
|
|
1969
1983
|
*/
|
|
1970
1984
|
expandToTag(t) {
|
|
1971
|
-
|
|
1985
|
+
$t.expandToTag(t);
|
|
1972
1986
|
}
|
|
1973
1987
|
}
|
|
1974
|
-
const
|
|
1988
|
+
const Ne = [
|
|
1975
1989
|
// Max-width: max-w-* classes conflict with each other
|
|
1976
1990
|
{ pattern: /^max-w-(.+)$/, getGroup: () => "max-w" },
|
|
1977
1991
|
// Width: w-* classes conflict with each other
|
|
1978
1992
|
{ pattern: /^w-(.+)$/, getGroup: () => "w" },
|
|
1979
1993
|
// Min-width: min-w-* classes conflict with each other
|
|
1980
1994
|
{ pattern: /^min-w-(.+)$/, getGroup: () => "min-w" },
|
|
1995
|
+
// Max-height: max-h-* classes conflict with each other
|
|
1996
|
+
{ pattern: /^max-h-(.+)$/, getGroup: () => "max-h" },
|
|
1981
1997
|
// Height: h-* classes conflict with each other
|
|
1982
1998
|
{ pattern: /^h-(.+)$/, getGroup: () => "h" },
|
|
1999
|
+
// Min-height: min-h-* classes conflict with each other
|
|
2000
|
+
{ pattern: /^min-h-(.+)$/, getGroup: () => "min-h" },
|
|
1983
2001
|
// Display: block, inline-block, flex, hidden, etc.
|
|
1984
2002
|
{ pattern: /^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|hidden|contents|flow-root|list-item)$/, getGroup: () => "display" },
|
|
1985
2003
|
// Flex direction: flex-row, flex-col
|
|
@@ -2003,7 +2021,7 @@ const re = [
|
|
|
2003
2021
|
// Inset (all sides): inset-*
|
|
2004
2022
|
{ pattern: /^inset-(.+)$/, getGroup: () => "inset" },
|
|
2005
2023
|
// Top/Right/Bottom/Left positioning
|
|
2006
|
-
{ pattern: /^(top|right|bottom|left)-(.+)$/, getGroup: (
|
|
2024
|
+
{ pattern: /^(top|right|bottom|left)-(.+)$/, getGroup: (s) => s[1] },
|
|
2007
2025
|
// Margin: m-*, mx-*, my-*, mt-*, mr-*, mb-*, ml-*
|
|
2008
2026
|
{ pattern: /^!?m-(.+)$/, getGroup: () => "m" },
|
|
2009
2027
|
{ pattern: /^!?mx-(.+)$/, getGroup: () => "mx" },
|
|
@@ -2023,7 +2041,7 @@ const re = [
|
|
|
2023
2041
|
// Gap: gap-*, gap-x-*, gap-y-*
|
|
2024
2042
|
{ pattern: /^gap-(.+)$/, getGroup: () => "gap" },
|
|
2025
2043
|
// Border radius: rounded-*
|
|
2026
|
-
{ pattern: /^rounded(-.*)?$/, getGroup: () => "rounded" },
|
|
2044
|
+
{ pattern: /^rounded(-.*)?$/, getGroup: () => "rounded-sm" },
|
|
2027
2045
|
// Visibility: visible, invisible
|
|
2028
2046
|
{ pattern: /^(visible|invisible)$/, getGroup: () => "visibility" },
|
|
2029
2047
|
// Overflow: overflow-*
|
|
@@ -2047,33 +2065,37 @@ const re = [
|
|
|
2047
2065
|
// Line height: leading-*
|
|
2048
2066
|
{ pattern: /^leading-(.+)$/, getGroup: () => "leading" },
|
|
2049
2067
|
// Outline: outline-*
|
|
2050
|
-
{ pattern: /^outline(-.*)?$/, getGroup: () => "outline" },
|
|
2051
|
-
// Border: border
|
|
2052
|
-
{ pattern: /^border(
|
|
2068
|
+
{ pattern: /^outline(-.*)?$/, getGroup: () => "outline-solid" },
|
|
2069
|
+
// Border width/style: border, border-0, border-none
|
|
2070
|
+
{ pattern: /^border(?:-(?:none|0))?$/, getGroup: () => "border-w" },
|
|
2071
|
+
// Border side width: border-{t,r,b,l}(-{suffix})?
|
|
2072
|
+
{ pattern: /^border-([trlb])(?:-|$)/, getGroup: (s) => `border-${s[1]}` },
|
|
2073
|
+
// Border color: everything else with border- prefix
|
|
2074
|
+
{ pattern: /^border-.+$/, getGroup: () => "border-color" },
|
|
2053
2075
|
// Shadow: shadow-*
|
|
2054
|
-
{ pattern: /^shadow(-.*)?$/, getGroup: () => "shadow" }
|
|
2055
|
-
],
|
|
2056
|
-
const t =
|
|
2076
|
+
{ pattern: /^shadow(-.*)?$/, getGroup: () => "shadow-sm" }
|
|
2077
|
+
], mt = /* @__PURE__ */ new Map(), Oe = (s) => {
|
|
2078
|
+
const t = mt.get(s);
|
|
2057
2079
|
if (t !== void 0)
|
|
2058
2080
|
return t;
|
|
2059
|
-
for (const { pattern: e, getGroup: o } of
|
|
2060
|
-
const
|
|
2061
|
-
if (
|
|
2062
|
-
const
|
|
2063
|
-
return
|
|
2081
|
+
for (const { pattern: e, getGroup: o } of Ne) {
|
|
2082
|
+
const n = s.match(e);
|
|
2083
|
+
if (n) {
|
|
2084
|
+
const r = o(n);
|
|
2085
|
+
return mt.set(s, r), r;
|
|
2064
2086
|
}
|
|
2065
2087
|
}
|
|
2066
|
-
return
|
|
2067
|
-
},
|
|
2068
|
-
const o =
|
|
2088
|
+
return mt.set(s, null), null;
|
|
2089
|
+
}, Re = (s, t, e) => {
|
|
2090
|
+
const o = Oe(s);
|
|
2069
2091
|
if (o) {
|
|
2070
|
-
t.set(o,
|
|
2092
|
+
t.set(o, s);
|
|
2071
2093
|
return;
|
|
2072
2094
|
}
|
|
2073
|
-
e.includes(
|
|
2074
|
-
},
|
|
2095
|
+
e.includes(s) || e.push(s);
|
|
2096
|
+
}, Me = (s) => {
|
|
2075
2097
|
const t = [];
|
|
2076
|
-
for (const e of
|
|
2098
|
+
for (const e of s)
|
|
2077
2099
|
if (e) {
|
|
2078
2100
|
if (Array.isArray(e)) {
|
|
2079
2101
|
t.push(...e.filter(Boolean));
|
|
@@ -2082,14 +2104,237 @@ const re = [
|
|
|
2082
2104
|
t.push(e);
|
|
2083
2105
|
}
|
|
2084
2106
|
return t;
|
|
2085
|
-
},
|
|
2086
|
-
const t = /* @__PURE__ */ new Map(), e = [], o =
|
|
2087
|
-
for (const
|
|
2088
|
-
|
|
2107
|
+
}, A = (...s) => {
|
|
2108
|
+
const t = /* @__PURE__ */ new Map(), e = [], o = Me(s);
|
|
2109
|
+
for (const n of o)
|
|
2110
|
+
n.split(/\s+/).filter(Boolean).forEach((i) => Re(i, t, e));
|
|
2089
2111
|
return [...e, ...t.values()].join(" ");
|
|
2090
|
-
},
|
|
2091
|
-
var
|
|
2092
|
-
|
|
2112
|
+
}, Dt = (...s) => s.filter(Boolean).join(" ");
|
|
2113
|
+
var _ = /* @__PURE__ */ ((s) => (s.Default = "default", s.Separator = "separator", s.Html = "html", s))(_ || {}), nt = { exports: {} }, Be = nt.exports, jt;
|
|
2114
|
+
function He() {
|
|
2115
|
+
return jt || (jt = 1, (function(s, t) {
|
|
2116
|
+
(function(e, o) {
|
|
2117
|
+
s.exports = o();
|
|
2118
|
+
})(Be, function() {
|
|
2119
|
+
function e(u) {
|
|
2120
|
+
var h = u.tags, g = Object.keys(h), f = g.map(function(b) {
|
|
2121
|
+
return typeof h[b];
|
|
2122
|
+
}).every(function(b) {
|
|
2123
|
+
return b === "object" || b === "boolean" || b === "function";
|
|
2124
|
+
});
|
|
2125
|
+
if (!f)
|
|
2126
|
+
throw new Error("The configuration was invalid");
|
|
2127
|
+
this.config = u;
|
|
2128
|
+
}
|
|
2129
|
+
var o = ["P", "LI", "TD", "TH", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "PRE"];
|
|
2130
|
+
function n(u) {
|
|
2131
|
+
return o.indexOf(u.nodeName) !== -1;
|
|
2132
|
+
}
|
|
2133
|
+
var r = ["A", "B", "STRONG", "I", "EM", "SUB", "SUP", "U", "STRIKE"];
|
|
2134
|
+
function i(u) {
|
|
2135
|
+
return r.indexOf(u.nodeName) !== -1;
|
|
2136
|
+
}
|
|
2137
|
+
e.prototype.clean = function(u) {
|
|
2138
|
+
const h = document.implementation.createHTMLDocument(), g = h.createElement("div");
|
|
2139
|
+
return g.innerHTML = u, this._sanitize(h, g), g.innerHTML;
|
|
2140
|
+
}, e.prototype._sanitize = function(u, h) {
|
|
2141
|
+
var g = a(u, h), f = g.firstChild();
|
|
2142
|
+
if (f)
|
|
2143
|
+
do {
|
|
2144
|
+
if (f.nodeType === Node.TEXT_NODE)
|
|
2145
|
+
if (f.data.trim() === "" && (f.previousElementSibling && n(f.previousElementSibling) || f.nextElementSibling && n(f.nextElementSibling))) {
|
|
2146
|
+
h.removeChild(f), this._sanitize(u, h);
|
|
2147
|
+
break;
|
|
2148
|
+
} else
|
|
2149
|
+
continue;
|
|
2150
|
+
if (f.nodeType === Node.COMMENT_NODE) {
|
|
2151
|
+
h.removeChild(f), this._sanitize(u, h);
|
|
2152
|
+
break;
|
|
2153
|
+
}
|
|
2154
|
+
var b = i(f), w;
|
|
2155
|
+
b && (w = Array.prototype.some.call(f.childNodes, n));
|
|
2156
|
+
var C = !!h.parentNode, k = n(h) && n(f) && C, x = f.nodeName.toLowerCase(), I = l(this.config, x, f), $ = b && w;
|
|
2157
|
+
if ($ || c(f, I) || !this.config.keepNestedBlockElements && k) {
|
|
2158
|
+
if (!(f.nodeName === "SCRIPT" || f.nodeName === "STYLE"))
|
|
2159
|
+
for (; f.childNodes.length > 0; )
|
|
2160
|
+
h.insertBefore(f.childNodes[0], f);
|
|
2161
|
+
h.removeChild(f), this._sanitize(u, h);
|
|
2162
|
+
break;
|
|
2163
|
+
}
|
|
2164
|
+
for (var M = 0; M < f.attributes.length; M += 1) {
|
|
2165
|
+
var K = f.attributes[M];
|
|
2166
|
+
d(K, I, f) && (f.removeAttribute(K.name), M = M - 1);
|
|
2167
|
+
}
|
|
2168
|
+
this._sanitize(u, f);
|
|
2169
|
+
} while (f = g.nextSibling());
|
|
2170
|
+
};
|
|
2171
|
+
function a(u, h) {
|
|
2172
|
+
return u.createTreeWalker(
|
|
2173
|
+
h,
|
|
2174
|
+
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,
|
|
2175
|
+
null,
|
|
2176
|
+
!1
|
|
2177
|
+
);
|
|
2178
|
+
}
|
|
2179
|
+
function l(u, h, g) {
|
|
2180
|
+
return typeof u.tags[h] == "function" ? u.tags[h](g) : u.tags[h];
|
|
2181
|
+
}
|
|
2182
|
+
function c(u, h) {
|
|
2183
|
+
return typeof h == "undefined" ? !0 : typeof h == "boolean" ? !h : !1;
|
|
2184
|
+
}
|
|
2185
|
+
function d(u, h, g) {
|
|
2186
|
+
var f = u.name.toLowerCase();
|
|
2187
|
+
return h === !0 ? !1 : typeof h[f] == "function" ? !h[f](u.value, g) : typeof h[f] == "undefined" || h[f] === !1 ? !0 : typeof h[f] == "string" ? h[f] !== u.value : !1;
|
|
2188
|
+
}
|
|
2189
|
+
return e;
|
|
2190
|
+
});
|
|
2191
|
+
})(nt)), nt.exports;
|
|
2192
|
+
}
|
|
2193
|
+
var Fe = He();
|
|
2194
|
+
const Pe = /* @__PURE__ */ pe(Fe), $e = /^\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)/i, De = /\s*(?:href|src)\s*=\s*(?:"\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^"]*"|'\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^']*|(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^ \t\r\n>]*)/gi, Xo = (s, t, e = {}) => s.map((o) => {
|
|
2195
|
+
const n = E(t) ? t(o.tool) : t, r = n != null ? n : {};
|
|
2196
|
+
return T(r) && R(r) && R(e) ? o : D(L({}, o), {
|
|
2197
|
+
data: It(o.data, r, e)
|
|
2198
|
+
});
|
|
2199
|
+
}), yt = (s, t = {}) => {
|
|
2200
|
+
const e = {
|
|
2201
|
+
tags: t
|
|
2202
|
+
};
|
|
2203
|
+
return new Pe(e).clean(s);
|
|
2204
|
+
}, It = (s, t, e) => Array.isArray(s) ? je(s, t, e) : T(s) ? _e(s, t, e) : P(s) ? Ge(s, t, e) : s, je = (s, t, e) => s.map((o) => It(o, t, e)), _e = (s, t, e) => {
|
|
2205
|
+
const o = {}, n = s;
|
|
2206
|
+
for (const r in s) {
|
|
2207
|
+
if (!Object.prototype.hasOwnProperty.call(s, r))
|
|
2208
|
+
continue;
|
|
2209
|
+
const i = n[r], a = T(t) ? t : void 0, l = a == null ? void 0 : a[r], c = l !== void 0 && We(l) ? l : t;
|
|
2210
|
+
o[r] = It(i, c, e);
|
|
2211
|
+
}
|
|
2212
|
+
return o;
|
|
2213
|
+
}, Ge = (s, t, e) => {
|
|
2214
|
+
const o = Xe(t, e);
|
|
2215
|
+
if (o) {
|
|
2216
|
+
const n = yt(s, o);
|
|
2217
|
+
return vt(Gt(n, o));
|
|
2218
|
+
}
|
|
2219
|
+
if (!R(e)) {
|
|
2220
|
+
const n = yt(s, e);
|
|
2221
|
+
return vt(Gt(n, e));
|
|
2222
|
+
}
|
|
2223
|
+
return vt(s);
|
|
2224
|
+
}, We = (s) => T(s) || Xt(s) || E(s), Ve = (s) => s ? $e.test(s) : !1, vt = (s) => {
|
|
2225
|
+
if (!s || s.indexOf("<") === -1)
|
|
2226
|
+
return s;
|
|
2227
|
+
if (typeof document != "undefined") {
|
|
2228
|
+
const t = document.createElement("template");
|
|
2229
|
+
return t.innerHTML = s, t.content.querySelectorAll("[href],[src]").forEach((o) => {
|
|
2230
|
+
["href", "src"].forEach((n) => {
|
|
2231
|
+
const r = o.getAttribute(n);
|
|
2232
|
+
Ve(r) && o.removeAttribute(n);
|
|
2233
|
+
});
|
|
2234
|
+
}), t.innerHTML;
|
|
2235
|
+
}
|
|
2236
|
+
return s.replace(De, "");
|
|
2237
|
+
}, At = (s) => {
|
|
2238
|
+
if (R(s))
|
|
2239
|
+
return {};
|
|
2240
|
+
const t = {};
|
|
2241
|
+
for (const e in s)
|
|
2242
|
+
Object.prototype.hasOwnProperty.call(s, e) && (t[e] = F(s[e]));
|
|
2243
|
+
return t;
|
|
2244
|
+
}, _t = (s) => function(e) {
|
|
2245
|
+
const o = s.call(this, e);
|
|
2246
|
+
return o == null ? {} : o;
|
|
2247
|
+
}, Ue = /* @__PURE__ */ new Set(["class", "id", "title", "role", "dir", "lang"]), ze = (s) => {
|
|
2248
|
+
const t = s.toLowerCase();
|
|
2249
|
+
return t.startsWith("data-") || t.startsWith("aria-") || Ue.has(t);
|
|
2250
|
+
}, Ke = (s) => {
|
|
2251
|
+
const t = {};
|
|
2252
|
+
return Array.from(s.attributes).forEach((e) => {
|
|
2253
|
+
ze(e.name) && (t[e.name] = !0);
|
|
2254
|
+
}), t;
|
|
2255
|
+
}, F = (s) => s === !0 ? _t(Ke) : s === !1 ? !1 : E(s) ? _t(s) : P(s) ? s : T(s) ? it({}, s) : s, qe = (s, t) => {
|
|
2256
|
+
if (R(s))
|
|
2257
|
+
return At(t);
|
|
2258
|
+
const e = {};
|
|
2259
|
+
for (const o in s) {
|
|
2260
|
+
if (!Object.prototype.hasOwnProperty.call(s, o))
|
|
2261
|
+
continue;
|
|
2262
|
+
const n = s[o], r = t ? t[o] : void 0;
|
|
2263
|
+
if (E(r)) {
|
|
2264
|
+
e[o] = F(r);
|
|
2265
|
+
continue;
|
|
2266
|
+
}
|
|
2267
|
+
if (E(n)) {
|
|
2268
|
+
e[o] = F(n);
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2271
|
+
if (T(n) && T(r)) {
|
|
2272
|
+
e[o] = it({}, r, n);
|
|
2273
|
+
continue;
|
|
2274
|
+
}
|
|
2275
|
+
if (r !== void 0) {
|
|
2276
|
+
e[o] = F(r);
|
|
2277
|
+
continue;
|
|
2278
|
+
}
|
|
2279
|
+
e[o] = F(n);
|
|
2280
|
+
}
|
|
2281
|
+
if (!t)
|
|
2282
|
+
return e;
|
|
2283
|
+
for (const o in t)
|
|
2284
|
+
Object.prototype.hasOwnProperty.call(t, o) && (Object.prototype.hasOwnProperty.call(e, o) || (e[o] = F(t[o])));
|
|
2285
|
+
return e;
|
|
2286
|
+
}, Xe = (s, t) => T(s) && !E(s) ? qe(t, s) : s === !1 ? {} : R(t) ? null : At(t), Yo = (s, ...t) => {
|
|
2287
|
+
if (R(s))
|
|
2288
|
+
return Object.assign({}, ...t);
|
|
2289
|
+
const e = At(s);
|
|
2290
|
+
return t.forEach((o) => {
|
|
2291
|
+
if (o)
|
|
2292
|
+
for (const n in o) {
|
|
2293
|
+
if (!Object.prototype.hasOwnProperty.call(o, n))
|
|
2294
|
+
continue;
|
|
2295
|
+
const r = o[n];
|
|
2296
|
+
if (!Object.prototype.hasOwnProperty.call(e, n))
|
|
2297
|
+
continue;
|
|
2298
|
+
const i = e[n];
|
|
2299
|
+
if (E(r)) {
|
|
2300
|
+
e[n] = r;
|
|
2301
|
+
continue;
|
|
2302
|
+
}
|
|
2303
|
+
if (!(r === !0 && E(i))) {
|
|
2304
|
+
if (r === !0) {
|
|
2305
|
+
const a = T(i) && !E(i);
|
|
2306
|
+
e[n] = a ? it({}, i) : F(r);
|
|
2307
|
+
continue;
|
|
2308
|
+
}
|
|
2309
|
+
if (T(r) && T(i)) {
|
|
2310
|
+
e[n] = it({}, i, r);
|
|
2311
|
+
continue;
|
|
2312
|
+
}
|
|
2313
|
+
e[n] = F(r);
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
}), e;
|
|
2317
|
+
}, Gt = (s, t) => {
|
|
2318
|
+
if (typeof document == "undefined" || !s || s.indexOf("<") === -1)
|
|
2319
|
+
return s;
|
|
2320
|
+
const e = Object.entries(t).filter(([, n]) => E(n));
|
|
2321
|
+
if (e.length === 0)
|
|
2322
|
+
return s;
|
|
2323
|
+
const o = document.createElement("template");
|
|
2324
|
+
return o.innerHTML = s, e.forEach(([n, r]) => {
|
|
2325
|
+
o.content.querySelectorAll(n).forEach((a) => {
|
|
2326
|
+
const l = r(a);
|
|
2327
|
+
if (!(Xt(l) || E(l) || l == null))
|
|
2328
|
+
for (const [c, d] of Object.entries(l)) {
|
|
2329
|
+
if (d === !1) {
|
|
2330
|
+
a.removeAttribute(c);
|
|
2331
|
+
continue;
|
|
2332
|
+
}
|
|
2333
|
+
d !== !0 && P(d) && a.setAttribute(c, d);
|
|
2334
|
+
}
|
|
2335
|
+
});
|
|
2336
|
+
}), o.innerHTML;
|
|
2337
|
+
}, bt = 10, Ye = "tooltip", Je = "aria-hidden", Ze = "false", Qe = "true", to = "visibility", eo = "visible", oo = "hidden", H = class H {
|
|
2093
2338
|
/**
|
|
2094
2339
|
* Module constructor
|
|
2095
2340
|
*/
|
|
@@ -2097,7 +2342,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2097
2342
|
this.nodes = {
|
|
2098
2343
|
wrapper: null,
|
|
2099
2344
|
content: null
|
|
2100
|
-
}, this.showed = !1, this.offsetTop =
|
|
2345
|
+
}, this.showed = !1, this.offsetTop = bt, this.offsetLeft = bt, this.offsetRight = bt, this.showingTimeout = null, this.ariaObserver = null, this.handleWindowScroll = () => {
|
|
2101
2346
|
this.showed && this.hide();
|
|
2102
2347
|
}, this.prepare(), window.addEventListener("scroll", this.handleWindowScroll, { passive: !0 });
|
|
2103
2348
|
}
|
|
@@ -2107,7 +2352,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2107
2352
|
*/
|
|
2108
2353
|
get CSS() {
|
|
2109
2354
|
return {
|
|
2110
|
-
tooltip:
|
|
2355
|
+
tooltip: Dt(
|
|
2111
2356
|
"absolute z-overlay top-0 left-0",
|
|
2112
2357
|
"bg-tooltip-bg opacity-0",
|
|
2113
2358
|
"select-none pointer-events-none",
|
|
@@ -2115,7 +2360,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2115
2360
|
"before:content-[''] before:absolute before:inset-0 before:bg-tooltip-bg before:-z-10 before:rounded-lg",
|
|
2116
2361
|
"mobile:hidden"
|
|
2117
2362
|
).split(" "),
|
|
2118
|
-
tooltipContent:
|
|
2363
|
+
tooltipContent: Dt(
|
|
2119
2364
|
"px-2.5 py-1.5",
|
|
2120
2365
|
"text-tooltip-font text-xs text-center",
|
|
2121
2366
|
"tracking-[0.02em] leading-[1em]"
|
|
@@ -2127,7 +2372,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2127
2372
|
* Get singleton instance
|
|
2128
2373
|
*/
|
|
2129
2374
|
static getInstance() {
|
|
2130
|
-
return
|
|
2375
|
+
return H.instance || (H.instance = new H()), H.instance;
|
|
2131
2376
|
}
|
|
2132
2377
|
/**
|
|
2133
2378
|
* Show Tooltip near passed element with specified HTML content
|
|
@@ -2137,7 +2382,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2137
2382
|
*/
|
|
2138
2383
|
show(t, e, o = {}) {
|
|
2139
2384
|
this.nodes.wrapper || this.prepare(), this.showingTimeout && (clearTimeout(this.showingTimeout), this.showingTimeout = null);
|
|
2140
|
-
const
|
|
2385
|
+
const r = Object.assign({
|
|
2141
2386
|
placement: "bottom",
|
|
2142
2387
|
marginTop: 0,
|
|
2143
2388
|
marginLeft: 0,
|
|
@@ -2146,34 +2391,33 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2146
2391
|
delay: 0
|
|
2147
2392
|
}, o);
|
|
2148
2393
|
if (this.nodes.content && (this.nodes.content.innerHTML = "", this.nodes.content.appendChild(this.createContentNode(e)), !!this.nodes.wrapper)) {
|
|
2149
|
-
switch (
|
|
2394
|
+
switch (r.placement) {
|
|
2150
2395
|
case "top":
|
|
2151
|
-
this.placeTop(t,
|
|
2396
|
+
this.placeTop(t, r);
|
|
2152
2397
|
break;
|
|
2153
2398
|
case "left":
|
|
2154
|
-
this.placeLeft(t,
|
|
2399
|
+
this.placeLeft(t, r);
|
|
2155
2400
|
break;
|
|
2156
2401
|
case "right":
|
|
2157
|
-
this.placeRight(t,
|
|
2402
|
+
this.placeRight(t, r);
|
|
2158
2403
|
break;
|
|
2159
|
-
case "bottom":
|
|
2160
2404
|
default:
|
|
2161
|
-
this.placeBottom(t,
|
|
2405
|
+
this.placeBottom(t, r);
|
|
2162
2406
|
break;
|
|
2163
2407
|
}
|
|
2164
|
-
if (
|
|
2408
|
+
if (r && r.delay) {
|
|
2165
2409
|
this.showingTimeout = setTimeout(() => {
|
|
2166
2410
|
if (this.showingTimeout = null, this.nodes.wrapper) {
|
|
2167
|
-
const
|
|
2168
|
-
this.nodes.wrapper.classList.add(...
|
|
2411
|
+
const i = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2412
|
+
this.nodes.wrapper.classList.add(...i), this.updateTooltipVisibility();
|
|
2169
2413
|
}
|
|
2170
2414
|
this.showed = !0;
|
|
2171
|
-
},
|
|
2415
|
+
}, r.delay);
|
|
2172
2416
|
return;
|
|
2173
2417
|
}
|
|
2174
2418
|
if (this.nodes.wrapper) {
|
|
2175
|
-
const
|
|
2176
|
-
this.nodes.wrapper.classList.add(...
|
|
2419
|
+
const i = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2420
|
+
this.nodes.wrapper.classList.add(...i), this.updateTooltipVisibility();
|
|
2177
2421
|
}
|
|
2178
2422
|
this.showed = !0;
|
|
2179
2423
|
}
|
|
@@ -2207,8 +2451,8 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2207
2451
|
*/
|
|
2208
2452
|
onHover(t, e, o = {}) {
|
|
2209
2453
|
t.addEventListener("mouseenter", () => {
|
|
2210
|
-
const
|
|
2211
|
-
|
|
2454
|
+
const n = document.querySelector('[data-blok-popover-opened="true"]');
|
|
2455
|
+
n !== null && !n.contains(t) || this.show(t, e, o);
|
|
2212
2456
|
}), t.addEventListener("mouseleave", () => {
|
|
2213
2457
|
this.hide();
|
|
2214
2458
|
});
|
|
@@ -2218,13 +2462,13 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2218
2462
|
*/
|
|
2219
2463
|
destroy() {
|
|
2220
2464
|
var t;
|
|
2221
|
-
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll),
|
|
2465
|
+
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll), H.instance = null;
|
|
2222
2466
|
}
|
|
2223
2467
|
/**
|
|
2224
2468
|
* Module Preparation method
|
|
2225
2469
|
*/
|
|
2226
2470
|
prepare() {
|
|
2227
|
-
this.nodes.wrapper = this.make("div", this.CSS.tooltip), this.nodes.wrapper.setAttribute(
|
|
2471
|
+
this.nodes.wrapper = this.make("div", this.CSS.tooltip), this.nodes.wrapper.setAttribute(p.interface, pt), this.nodes.wrapper.setAttribute("data-blok-testid", "tooltip"), this.nodes.content = this.make("div", this.CSS.tooltipContent), this.nodes.content.setAttribute("data-blok-testid", "tooltip-content"), this.nodes.wrapper && this.nodes.content && (this.append(this.nodes.wrapper, this.nodes.content), this.append(document.body, this.nodes.wrapper), this.ensureTooltipAttributes());
|
|
2228
2472
|
}
|
|
2229
2473
|
/**
|
|
2230
2474
|
* Update tooltip visibility based on shown state
|
|
@@ -2233,7 +2477,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2233
2477
|
if (!this.nodes.wrapper)
|
|
2234
2478
|
return;
|
|
2235
2479
|
const t = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown[0] : this.CSS.tooltipShown, e = this.nodes.wrapper.classList.contains(t);
|
|
2236
|
-
this.nodes.wrapper.style.setProperty(
|
|
2480
|
+
this.nodes.wrapper.style.setProperty(to, e ? eo : oo), this.nodes.wrapper.setAttribute(Je, e ? Ze : Qe), this.nodes.wrapper.setAttribute("data-blok-shown", e ? "true" : "false");
|
|
2237
2481
|
}
|
|
2238
2482
|
/**
|
|
2239
2483
|
* Watch tooltip visibility changes for accessibility
|
|
@@ -2251,7 +2495,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2251
2495
|
* Ensure tooltip has proper accessibility attributes
|
|
2252
2496
|
*/
|
|
2253
2497
|
ensureTooltipAttributes() {
|
|
2254
|
-
this.nodes.wrapper && ((!this.nodes.wrapper.hasAttribute(
|
|
2498
|
+
this.nodes.wrapper && ((!this.nodes.wrapper.hasAttribute(p.interface) || this.nodes.wrapper.getAttribute(p.interface) !== pt) && this.nodes.wrapper.setAttribute(p.interface, pt), this.nodes.wrapper.setAttribute("role", Ye), this.watchTooltipVisibility());
|
|
2255
2499
|
}
|
|
2256
2500
|
/**
|
|
2257
2501
|
* Calculates element coords and moves tooltip bottom of the element
|
|
@@ -2259,11 +2503,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2259
2503
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2260
2504
|
*/
|
|
2261
2505
|
placeBottom(t, e) {
|
|
2262
|
-
var
|
|
2506
|
+
var i;
|
|
2263
2507
|
if (!this.nodes.wrapper)
|
|
2264
2508
|
return;
|
|
2265
|
-
const o = t.getBoundingClientRect(),
|
|
2266
|
-
this.applyPlacement("bottom",
|
|
2509
|
+
const o = t.getBoundingClientRect(), n = o.left + t.clientWidth / 2 - this.nodes.wrapper.offsetWidth / 2, r = o.bottom + this.getScrollTop() + this.offsetTop + ((i = e.marginTop) != null ? i : 0);
|
|
2510
|
+
this.applyPlacement("bottom", n, r);
|
|
2267
2511
|
}
|
|
2268
2512
|
/**
|
|
2269
2513
|
* Calculates element coords and moves tooltip top of the element
|
|
@@ -2273,8 +2517,8 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2273
2517
|
placeTop(t, e) {
|
|
2274
2518
|
if (!this.nodes.wrapper)
|
|
2275
2519
|
return;
|
|
2276
|
-
const o = t.getBoundingClientRect(),
|
|
2277
|
-
this.applyPlacement("top",
|
|
2520
|
+
const o = t.getBoundingClientRect(), n = o.left + t.clientWidth / 2 - this.nodes.wrapper.offsetWidth / 2, r = o.top + this.getScrollTop() - this.nodes.wrapper.clientHeight - this.offsetTop;
|
|
2521
|
+
this.applyPlacement("top", n, r);
|
|
2278
2522
|
}
|
|
2279
2523
|
/**
|
|
2280
2524
|
* Calculates element coords and moves tooltip left of the element
|
|
@@ -2282,11 +2526,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2282
2526
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2283
2527
|
*/
|
|
2284
2528
|
placeLeft(t, e) {
|
|
2285
|
-
var
|
|
2529
|
+
var i;
|
|
2286
2530
|
if (!this.nodes.wrapper)
|
|
2287
2531
|
return;
|
|
2288
|
-
const o = t.getBoundingClientRect(),
|
|
2289
|
-
this.applyPlacement("left",
|
|
2532
|
+
const o = t.getBoundingClientRect(), n = o.left - this.nodes.wrapper.offsetWidth - this.offsetLeft - ((i = e.marginLeft) != null ? i : 0), r = o.top + this.getScrollTop() + t.clientHeight / 2 - this.nodes.wrapper.offsetHeight / 2;
|
|
2533
|
+
this.applyPlacement("left", n, r);
|
|
2290
2534
|
}
|
|
2291
2535
|
/**
|
|
2292
2536
|
* Calculates element coords and moves tooltip right of the element
|
|
@@ -2294,11 +2538,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2294
2538
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2295
2539
|
*/
|
|
2296
2540
|
placeRight(t, e) {
|
|
2297
|
-
var
|
|
2541
|
+
var i;
|
|
2298
2542
|
if (!this.nodes.wrapper)
|
|
2299
2543
|
return;
|
|
2300
|
-
const o = t.getBoundingClientRect(),
|
|
2301
|
-
this.applyPlacement("right",
|
|
2544
|
+
const o = t.getBoundingClientRect(), n = o.right + this.offsetRight + ((i = e.marginRight) != null ? i : 0), r = o.top + this.getScrollTop() + t.clientHeight / 2 - this.nodes.wrapper.offsetHeight / 2;
|
|
2545
|
+
this.applyPlacement("right", n, r);
|
|
2302
2546
|
}
|
|
2303
2547
|
/**
|
|
2304
2548
|
* Set wrapper position
|
|
@@ -2324,11 +2568,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2324
2568
|
* @returns {HTMLElement}
|
|
2325
2569
|
*/
|
|
2326
2570
|
make(t, e = null, o = {}) {
|
|
2327
|
-
const
|
|
2328
|
-
Array.isArray(e) &&
|
|
2329
|
-
for (const
|
|
2330
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
2331
|
-
return
|
|
2571
|
+
const n = document.createElement(t);
|
|
2572
|
+
Array.isArray(e) && n.classList.add(...e), typeof e == "string" && n.classList.add(e);
|
|
2573
|
+
for (const r in o)
|
|
2574
|
+
Object.prototype.hasOwnProperty.call(o, r) && (n[r] = o[r]);
|
|
2575
|
+
return n;
|
|
2332
2576
|
}
|
|
2333
2577
|
/**
|
|
2334
2578
|
* Append one or several elements to the parent
|
|
@@ -2339,17 +2583,17 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2339
2583
|
Array.isArray(e) ? e.forEach((o) => t.appendChild(o)) : t.appendChild(e);
|
|
2340
2584
|
}
|
|
2341
2585
|
};
|
|
2342
|
-
|
|
2343
|
-
let
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
},
|
|
2347
|
-
|
|
2348
|
-
},
|
|
2349
|
-
|
|
2350
|
-
},
|
|
2351
|
-
|
|
2352
|
-
},
|
|
2586
|
+
H.instance = null;
|
|
2587
|
+
let Et = H;
|
|
2588
|
+
const ut = () => Et.getInstance(), Jo = (s, t, e) => {
|
|
2589
|
+
ut().show(s, t, e != null ? e : {});
|
|
2590
|
+
}, no = () => {
|
|
2591
|
+
ut().hide();
|
|
2592
|
+
}, so = (s, t, e) => {
|
|
2593
|
+
ut().onHover(s, t, e != null ? e : {});
|
|
2594
|
+
}, Zo = () => {
|
|
2595
|
+
ut().destroy();
|
|
2596
|
+
}, V = class V {
|
|
2353
2597
|
/**
|
|
2354
2598
|
* @param {HTMLElement[]} nodeList — the list of iterable HTML-items
|
|
2355
2599
|
* @param {string} focusedCssClass - user-provided CSS-class that will be set in flipping process
|
|
@@ -2388,13 +2632,13 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2388
2632
|
* Sets cursor next to the current
|
|
2389
2633
|
*/
|
|
2390
2634
|
next() {
|
|
2391
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2635
|
+
this.cursor = this.leafNodesAndReturnIndex(V.directions.RIGHT);
|
|
2392
2636
|
}
|
|
2393
2637
|
/**
|
|
2394
2638
|
* Sets cursor before current
|
|
2395
2639
|
*/
|
|
2396
2640
|
previous() {
|
|
2397
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2641
|
+
this.cursor = this.leafNodesAndReturnIndex(V.directions.LEFT);
|
|
2398
2642
|
}
|
|
2399
2643
|
/**
|
|
2400
2644
|
* Sets cursor to the default position and removes CSS-class from previously focused item
|
|
@@ -2410,9 +2654,9 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2410
2654
|
leafNodesAndReturnIndex(t) {
|
|
2411
2655
|
if (this.items.length === 0)
|
|
2412
2656
|
return this.cursor;
|
|
2413
|
-
const e = t ===
|
|
2657
|
+
const e = t === V.directions.RIGHT ? -1 : 0, o = this.cursor === -1 ? e : this.cursor;
|
|
2414
2658
|
o !== -1 && (this.items[o].classList.remove(this.focusedCssClass), this.items[o].removeAttribute("data-blok-focused"));
|
|
2415
|
-
const
|
|
2659
|
+
const n = t === V.directions.RIGHT ? (
|
|
2416
2660
|
/**
|
|
2417
2661
|
* If we go right then choose next (+1) Tool
|
|
2418
2662
|
* @type {number}
|
|
@@ -2426,48 +2670,48 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2426
2670
|
*/
|
|
2427
2671
|
(this.items.length + o - 1) % this.items.length
|
|
2428
2672
|
);
|
|
2429
|
-
return
|
|
2673
|
+
return m.canSetCaret(this.items[n]) && me(() => oe.setCursor(this.items[n]), 50)(), this.items[n].classList.add(this.focusedCssClass), this.items[n].setAttribute("data-blok-focused", "true"), n;
|
|
2430
2674
|
}
|
|
2431
2675
|
};
|
|
2432
|
-
|
|
2676
|
+
V.directions = {
|
|
2433
2677
|
RIGHT: "right",
|
|
2434
2678
|
LEFT: "left"
|
|
2435
2679
|
};
|
|
2436
|
-
let
|
|
2437
|
-
class
|
|
2680
|
+
let W = V;
|
|
2681
|
+
class at {
|
|
2438
2682
|
/**
|
|
2439
2683
|
* @param options - different constructing settings
|
|
2440
2684
|
*/
|
|
2441
2685
|
constructor(t) {
|
|
2442
2686
|
var e, o;
|
|
2443
|
-
this.iterator = null, this.activated = !1, this.skipNextTabFocus = !1, this.flipCallbacks = [], this.onKeyDown = (
|
|
2444
|
-
var
|
|
2445
|
-
const
|
|
2446
|
-
if (this.shouldSkipTarget(
|
|
2687
|
+
this.iterator = null, this.activated = !1, this.skipNextTabFocus = !1, this.flipCallbacks = [], this.onKeyDown = (n) => {
|
|
2688
|
+
var c, d;
|
|
2689
|
+
const r = n.target;
|
|
2690
|
+
if (this.shouldSkipTarget(r, n))
|
|
2447
2691
|
return;
|
|
2448
|
-
const
|
|
2449
|
-
if (!(
|
|
2450
|
-
switch (
|
|
2451
|
-
case
|
|
2452
|
-
this.handleTabPress(
|
|
2692
|
+
const i = this.getKeyCode(n), a = i === v.LEFT || i === v.RIGHT || i === v.UP || i === v.DOWN;
|
|
2693
|
+
if (!(n.shiftKey && a || !this.isEventReadyForHandling(n)) && !(i === v.ENTER && !((c = this.iterator) != null && c.currentItem)))
|
|
2694
|
+
switch (n.stopPropagation(), n.stopImmediatePropagation(), i !== null && at.usedKeys.includes(i) && n.preventDefault(), i) {
|
|
2695
|
+
case v.TAB:
|
|
2696
|
+
this.handleTabPress(n);
|
|
2453
2697
|
break;
|
|
2454
|
-
case
|
|
2698
|
+
case v.LEFT:
|
|
2455
2699
|
this.onArrowLeftCallback && this.onArrowLeftCallback();
|
|
2456
2700
|
break;
|
|
2457
|
-
case
|
|
2701
|
+
case v.UP:
|
|
2458
2702
|
this.flipLeft();
|
|
2459
2703
|
break;
|
|
2460
|
-
case
|
|
2461
|
-
(
|
|
2704
|
+
case v.RIGHT:
|
|
2705
|
+
(d = this.iterator) != null && d.currentItem && this.currentItemHasChildren() && this.handleEnterPress(n);
|
|
2462
2706
|
break;
|
|
2463
|
-
case
|
|
2707
|
+
case v.DOWN:
|
|
2464
2708
|
this.flipRight();
|
|
2465
2709
|
break;
|
|
2466
|
-
case
|
|
2467
|
-
this.handleEnterPress(
|
|
2710
|
+
case v.ENTER:
|
|
2711
|
+
this.handleEnterPress(n);
|
|
2468
2712
|
break;
|
|
2469
2713
|
}
|
|
2470
|
-
}, this.iterator = new
|
|
2714
|
+
}, this.iterator = new W(t.items || [], (e = t.focusedItemClass) != null ? e : ""), this.activateCallback = t.activateCallback, this.allowedKeys = t.allowedKeys || at.usedKeys, this.handleContentEditableTargets = (o = t.handleContentEditableTargets) != null ? o : !1, this.onArrowLeftCallback = t.onArrowLeft;
|
|
2471
2715
|
}
|
|
2472
2716
|
/**
|
|
2473
2717
|
* True if flipper is currently activated
|
|
@@ -2483,12 +2727,12 @@ class Y {
|
|
|
2483
2727
|
*/
|
|
2484
2728
|
static get usedKeys() {
|
|
2485
2729
|
return [
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2730
|
+
v.TAB,
|
|
2731
|
+
v.LEFT,
|
|
2732
|
+
v.RIGHT,
|
|
2733
|
+
v.ENTER,
|
|
2734
|
+
v.UP,
|
|
2735
|
+
v.DOWN
|
|
2492
2736
|
];
|
|
2493
2737
|
}
|
|
2494
2738
|
/**
|
|
@@ -2497,8 +2741,8 @@ class Y {
|
|
|
2497
2741
|
* @param cursorPosition - index of the item that should be focused once flipper is activated
|
|
2498
2742
|
*/
|
|
2499
2743
|
activate(t, e) {
|
|
2500
|
-
var o,
|
|
2501
|
-
this.activated = !0, t && ((o = this.iterator) == null || o.setItems(t)), e !== void 0 && ((
|
|
2744
|
+
var o, n;
|
|
2745
|
+
this.activated = !0, t && ((o = this.iterator) == null || o.setItems(t)), e !== void 0 && ((n = this.iterator) == null || n.setCursor(e)), document.addEventListener("keydown", this.onKeyDown, !0), window.addEventListener("keydown", this.onKeyDown, !0);
|
|
2502
2746
|
}
|
|
2503
2747
|
/**
|
|
2504
2748
|
* Disable tab/arrows handling by flipper
|
|
@@ -2519,7 +2763,7 @@ class Y {
|
|
|
2519
2763
|
* @param options.skipNextTab - if true, skip the next Tab press (default: true for position 0 when no current item)
|
|
2520
2764
|
*/
|
|
2521
2765
|
focusItem(t, e) {
|
|
2522
|
-
var
|
|
2766
|
+
var r;
|
|
2523
2767
|
const o = this.iterator;
|
|
2524
2768
|
if (!o || !o.hasItems())
|
|
2525
2769
|
return;
|
|
@@ -2527,7 +2771,7 @@ class Y {
|
|
|
2527
2771
|
o.dropCursor();
|
|
2528
2772
|
return;
|
|
2529
2773
|
}
|
|
2530
|
-
((
|
|
2774
|
+
((r = e == null ? void 0 : e.skipNextTab) != null ? r : !o.currentItem && t === 0) && (this.skipNextTabFocus = !0), o.setCursor(t);
|
|
2531
2775
|
}
|
|
2532
2776
|
/**
|
|
2533
2777
|
* Focuses previous flipper iterator item
|
|
@@ -2589,12 +2833,12 @@ class Y {
|
|
|
2589
2833
|
getKeyCode(t) {
|
|
2590
2834
|
var o;
|
|
2591
2835
|
return (o = {
|
|
2592
|
-
Tab:
|
|
2593
|
-
Enter:
|
|
2594
|
-
ArrowLeft:
|
|
2595
|
-
ArrowRight:
|
|
2596
|
-
ArrowUp:
|
|
2597
|
-
ArrowDown:
|
|
2836
|
+
Tab: v.TAB,
|
|
2837
|
+
Enter: v.ENTER,
|
|
2838
|
+
ArrowLeft: v.LEFT,
|
|
2839
|
+
ArrowRight: v.RIGHT,
|
|
2840
|
+
ArrowUp: v.UP,
|
|
2841
|
+
ArrowDown: v.DOWN
|
|
2598
2842
|
}[t.key]) != null ? o : null;
|
|
2599
2843
|
}
|
|
2600
2844
|
/**
|
|
@@ -2625,16 +2869,16 @@ class Y {
|
|
|
2625
2869
|
* @param {KeyboardEvent} event - tab keydown event
|
|
2626
2870
|
*/
|
|
2627
2871
|
handleTabPress(t) {
|
|
2628
|
-
const o = t.shiftKey ?
|
|
2872
|
+
const o = t.shiftKey ? W.directions.LEFT : W.directions.RIGHT;
|
|
2629
2873
|
if (this.skipNextTabFocus) {
|
|
2630
2874
|
this.skipNextTabFocus = !1;
|
|
2631
2875
|
return;
|
|
2632
2876
|
}
|
|
2633
2877
|
switch (o) {
|
|
2634
|
-
case
|
|
2878
|
+
case W.directions.RIGHT:
|
|
2635
2879
|
this.flipRight();
|
|
2636
2880
|
break;
|
|
2637
|
-
case
|
|
2881
|
+
case W.directions.LEFT:
|
|
2638
2882
|
this.flipLeft();
|
|
2639
2883
|
break;
|
|
2640
2884
|
}
|
|
@@ -2652,7 +2896,7 @@ class Y {
|
|
|
2652
2896
|
*/
|
|
2653
2897
|
handleEnterPress(t) {
|
|
2654
2898
|
var e, o;
|
|
2655
|
-
this.activated && ((e = this.iterator) != null && e.currentItem && (t.stopPropagation(), t.preventDefault(), this.iterator.currentItem.click()),
|
|
2899
|
+
this.activated && ((e = this.iterator) != null && e.currentItem && (t.stopPropagation(), t.preventDefault(), this.iterator.currentItem.click()), E(this.activateCallback) && ((o = this.iterator) != null && o.currentItem) && this.activateCallback(this.iterator.currentItem));
|
|
2656
2900
|
}
|
|
2657
2901
|
/**
|
|
2658
2902
|
* Scrolls the given element into view using the best available method
|
|
@@ -2681,15 +2925,236 @@ class Y {
|
|
|
2681
2925
|
shouldSkipTarget(t, e) {
|
|
2682
2926
|
if (!t)
|
|
2683
2927
|
return !1;
|
|
2684
|
-
const o = t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement,
|
|
2685
|
-
return o && !
|
|
2928
|
+
const o = t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement, n = e.key === "Tab" || e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter" || e.key === "ArrowRight" || e.key === "ArrowLeft", r = t.getAttribute("data-blok-flipper-navigation-target") === "true" && n, i = t.isContentEditable, a = t.closest('[data-blok-link-tool-input-opened="true"]') !== null, l = i && !this.handleContentEditableTargets;
|
|
2929
|
+
return o && !r || l || a;
|
|
2686
2930
|
}
|
|
2687
2931
|
}
|
|
2688
|
-
const
|
|
2932
|
+
const ro = [
|
|
2933
|
+
{ name: "gray", text: "#787774", bg: "#f1f1ef" },
|
|
2934
|
+
{ name: "brown", text: "#9f6b53", bg: "#f4eeee" },
|
|
2935
|
+
{ name: "orange", text: "#d9730d", bg: "#fbecdd" },
|
|
2936
|
+
{ name: "yellow", text: "#cb9b00", bg: "#fbf3db" },
|
|
2937
|
+
{ name: "green", text: "#448361", bg: "#edf3ec" },
|
|
2938
|
+
{ name: "teal", text: "#2b9a8f", bg: "#e4f5f3" },
|
|
2939
|
+
{ name: "blue", text: "#337ea9", bg: "#e7f3f8" },
|
|
2940
|
+
{ name: "purple", text: "#9065b0", bg: "#f6f3f9" },
|
|
2941
|
+
{ name: "pink", text: "#c14c8a", bg: "#f9f0f5" },
|
|
2942
|
+
{ name: "red", text: "#d44c47", bg: "#fdebec" }
|
|
2943
|
+
];
|
|
2944
|
+
function io(s, t, e) {
|
|
2945
|
+
const o = t / 100, n = e / 100;
|
|
2946
|
+
if (o === 0) {
|
|
2947
|
+
const d = Math.round(n * 255);
|
|
2948
|
+
return [d, d, d];
|
|
2949
|
+
}
|
|
2950
|
+
const r = (d) => d < 0 ? d + 1 : d > 1 ? d - 1 : d, i = (d, u, h) => {
|
|
2951
|
+
const g = r(h);
|
|
2952
|
+
return g < 1 / 6 ? d + (u - d) * 6 * g : g < 1 / 2 ? u : g < 2 / 3 ? d + (u - d) * (2 / 3 - g) * 6 : d;
|
|
2953
|
+
}, a = n < 0.5 ? n * (1 + o) : n + o - n * o, l = 2 * n - a, c = s / 360;
|
|
2954
|
+
return [
|
|
2955
|
+
Math.round(i(l, a, c + 1 / 3) * 255),
|
|
2956
|
+
Math.round(i(l, a, c) * 255),
|
|
2957
|
+
Math.round(i(l, a, c - 1 / 3) * 255)
|
|
2958
|
+
];
|
|
2959
|
+
}
|
|
2960
|
+
function Wt(s) {
|
|
2961
|
+
const t = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(s);
|
|
2962
|
+
if (t)
|
|
2963
|
+
return [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)];
|
|
2964
|
+
const e = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})[0-9a-f]{2}$/i.exec(s);
|
|
2965
|
+
if (e)
|
|
2966
|
+
return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)];
|
|
2967
|
+
const o = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(s);
|
|
2968
|
+
if (o)
|
|
2969
|
+
return [
|
|
2970
|
+
parseInt(o[1] + o[1], 16),
|
|
2971
|
+
parseInt(o[2] + o[2], 16),
|
|
2972
|
+
parseInt(o[3] + o[3], 16)
|
|
2973
|
+
];
|
|
2974
|
+
const n = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]$/i.exec(s);
|
|
2975
|
+
if (n)
|
|
2976
|
+
return [
|
|
2977
|
+
parseInt(n[1] + n[1], 16),
|
|
2978
|
+
parseInt(n[2] + n[2], 16),
|
|
2979
|
+
parseInt(n[3] + n[3], 16)
|
|
2980
|
+
];
|
|
2981
|
+
const r = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(s);
|
|
2982
|
+
if (r)
|
|
2983
|
+
return [Number(r[1]), Number(r[2]), Number(r[3])];
|
|
2984
|
+
const i = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(s);
|
|
2985
|
+
return i ? io(Number(i[1]), Number(i[2]), Number(i[3])) : null;
|
|
2986
|
+
}
|
|
2987
|
+
const Vt = 0.1;
|
|
2988
|
+
function Ut(s) {
|
|
2989
|
+
const t = s[0] / 255, e = s[1] / 255, o = s[2] / 255, n = Math.max(t, e, o), r = Math.min(t, e, o), i = (n + r) / 2;
|
|
2990
|
+
if (n === r)
|
|
2991
|
+
return [0, 0, i];
|
|
2992
|
+
const a = n - r, l = i > 0.5 ? a / (2 - n - r) : a / (n + r);
|
|
2993
|
+
return [((d) => d === t ? ((e - o) / a + (e < o ? 6 : 0)) / 6 : d === e ? ((o - t) / a + 2) / 6 : ((t - e) / a + 4) / 6)(n) * 360, l, i];
|
|
2994
|
+
}
|
|
2995
|
+
function ao(s, t) {
|
|
2996
|
+
const r = s[1] < Vt, i = t[1] < Vt;
|
|
2997
|
+
if (r && i) {
|
|
2998
|
+
const u = Math.abs(s[2] - t[2]);
|
|
2999
|
+
return u * u;
|
|
3000
|
+
}
|
|
3001
|
+
if (r !== i)
|
|
3002
|
+
return 1e3;
|
|
3003
|
+
const a = Math.abs(s[0] - t[0]), l = Math.min(a, 360 - a) / 180, c = Math.abs(s[1] - t[1]), d = Math.abs(s[2] - t[2]);
|
|
3004
|
+
return 8 * l * l + 1 * c * c + 1 * d * d;
|
|
3005
|
+
}
|
|
3006
|
+
function z(s, t) {
|
|
3007
|
+
const e = Wt(s);
|
|
3008
|
+
if (e === null)
|
|
3009
|
+
return s;
|
|
3010
|
+
const o = Ut(e);
|
|
3011
|
+
return ro.reduce(
|
|
3012
|
+
(r, i) => {
|
|
3013
|
+
const a = Wt(i[t]);
|
|
3014
|
+
if (a === null)
|
|
3015
|
+
return r;
|
|
3016
|
+
const l = ao(o, Ut(a));
|
|
3017
|
+
return l < r.distance ? { color: i[t], distance: l } : r;
|
|
3018
|
+
},
|
|
3019
|
+
{ color: s, distance: 1 / 0 }
|
|
3020
|
+
).color;
|
|
3021
|
+
}
|
|
3022
|
+
const lt = "data-blok-table-cells";
|
|
3023
|
+
function zt(s, t, e) {
|
|
3024
|
+
return s ? `background-color: ${e}` : t ? "background-color: transparent" : "";
|
|
3025
|
+
}
|
|
3026
|
+
function Qo(s) {
|
|
3027
|
+
if (s.length === 0)
|
|
3028
|
+
return { rows: 0, cols: 0, cells: [] };
|
|
3029
|
+
const t = Math.min(...s.map((l) => l.row)), e = Math.min(...s.map((l) => l.col)), o = Math.max(...s.map((l) => l.row)), n = Math.max(...s.map((l) => l.col)), r = o - t + 1, i = n - e + 1, a = Array.from(
|
|
3030
|
+
{ length: r },
|
|
3031
|
+
() => Array.from({ length: i }, () => ({ blocks: [] }))
|
|
3032
|
+
);
|
|
3033
|
+
for (const l of s) {
|
|
3034
|
+
const c = l.row - t, d = l.col - e;
|
|
3035
|
+
a[c][d] = { blocks: l.blocks }, l.color !== void 0 && (a[c][d].color = l.color), l.textColor !== void 0 && (a[c][d].textColor = l.textColor);
|
|
3036
|
+
}
|
|
3037
|
+
return { rows: r, cols: i, cells: a };
|
|
3038
|
+
}
|
|
3039
|
+
function ne(s) {
|
|
3040
|
+
const { data: t } = s;
|
|
3041
|
+
return typeof t.text == "string" ? t.text : Array.isArray(t.items) ? t.items.filter((e) => typeof e == "string").join(" ") : "";
|
|
3042
|
+
}
|
|
3043
|
+
function tn(s) {
|
|
3044
|
+
const t = JSON.stringify(s).replace(/'/g, "'"), e = s.cells.map((o) => `<tr>${o.map((r) => {
|
|
3045
|
+
const i = r.blocks.map(ne).join(" "), a = [
|
|
3046
|
+
r.color ? `background-color: ${r.color}` : "",
|
|
3047
|
+
r.textColor ? `color: ${r.textColor}` : ""
|
|
3048
|
+
].filter(Boolean).join("; ");
|
|
3049
|
+
return `<td${a ? ` style="${a}"` : ""}>${i}</td>`;
|
|
3050
|
+
}).join("")}</tr>`).join("");
|
|
3051
|
+
return `<table ${lt}='${t}'>${e}</table>`;
|
|
3052
|
+
}
|
|
3053
|
+
function en(s) {
|
|
3054
|
+
return s.cells.map(
|
|
3055
|
+
(t) => t.map((e) => e.blocks.map(ne).join(" ")).join(" ")
|
|
3056
|
+
).join(`
|
|
3057
|
+
`);
|
|
3058
|
+
}
|
|
3059
|
+
const lo = /* @__PURE__ */ new Set(["color", "background-color"]), co = {
|
|
3060
|
+
b: !0,
|
|
3061
|
+
strong: !0,
|
|
3062
|
+
i: !0,
|
|
3063
|
+
em: !0,
|
|
3064
|
+
br: !0,
|
|
3065
|
+
a: { href: !0 },
|
|
3066
|
+
mark: (s) => {
|
|
3067
|
+
const e = s.style, o = Array.from({ length: e.length }, (n, r) => e.item(r));
|
|
3068
|
+
for (const n of o)
|
|
3069
|
+
lo.has(n) || e.removeProperty(n);
|
|
3070
|
+
return e.length > 0 ? { style: !0 } : {};
|
|
3071
|
+
}
|
|
3072
|
+
};
|
|
3073
|
+
function Tt(s) {
|
|
3074
|
+
const t = s.replace(/\s/g, "");
|
|
3075
|
+
return t === "rgb(0,0,0)" || t === "#000000";
|
|
3076
|
+
}
|
|
3077
|
+
function ho(s) {
|
|
3078
|
+
var o, n, r, i, a, l;
|
|
3079
|
+
const t = s.cloneNode(!0);
|
|
3080
|
+
for (const c of Array.from(t.querySelectorAll("span"))) {
|
|
3081
|
+
const d = (o = c.getAttribute("style")) != null ? o : "", u = /font-weight\s*:\s*(700|bold)/i.test(d), h = /font-style\s*:\s*italic/i.test(d), g = new RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i").exec(d), f = /background-color\s*:\s*([^;]+)/i.exec(d), b = (n = g == null ? void 0 : g[1]) == null ? void 0 : n.trim(), w = (r = f == null ? void 0 : f[1]) == null ? void 0 : r.trim(), C = b !== void 0 && !Tt(b), k = w !== void 0 && w !== "transparent";
|
|
3082
|
+
if (!u && !h && !C && !k)
|
|
3083
|
+
continue;
|
|
3084
|
+
const x = C ? z(b, "text") : "", I = k ? z(w, "bg") : "", $ = [
|
|
3085
|
+
C ? `color: ${x}` : "",
|
|
3086
|
+
zt(k, C, I)
|
|
3087
|
+
].filter(Boolean).join("; "), M = c.innerHTML, K = $ ? `<mark style="${$};">${M}</mark>` : M, Rt = h ? `<i>${K}</i>` : K, ae = u ? `<b>${Rt}</b>` : Rt;
|
|
3088
|
+
c.replaceWith(document.createRange().createContextualFragment(ae));
|
|
3089
|
+
}
|
|
3090
|
+
for (const c of Array.from(t.querySelectorAll("a[style]"))) {
|
|
3091
|
+
const d = (i = c.getAttribute("style")) != null ? i : "", u = new RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i").exec(d), h = /background-color\s*:\s*([^;]+)/i.exec(d), g = (a = u == null ? void 0 : u[1]) == null ? void 0 : a.trim(), f = (l = h == null ? void 0 : h[1]) == null ? void 0 : l.trim(), b = g !== void 0 && !Tt(g) && g !== "inherit", w = f !== void 0 && f !== "transparent" && f !== "inherit";
|
|
3092
|
+
if (!b && !w)
|
|
3093
|
+
continue;
|
|
3094
|
+
const C = b ? z(g, "text") : "", k = w ? z(f, "bg") : "", x = [
|
|
3095
|
+
b ? `color: ${C}` : "",
|
|
3096
|
+
zt(w, b, k)
|
|
3097
|
+
].filter(Boolean).join("; "), I = c;
|
|
3098
|
+
I.innerHTML = `<mark style="${x};">${I.innerHTML}</mark>`, I.style.removeProperty("color"), I.style.removeProperty("background-color");
|
|
3099
|
+
}
|
|
3100
|
+
for (const c of Array.from(t.querySelectorAll("p"))) {
|
|
3101
|
+
const d = document.createRange().createContextualFragment(c.innerHTML + "<br>");
|
|
3102
|
+
c.replaceWith(d);
|
|
3103
|
+
}
|
|
3104
|
+
return yt(t.innerHTML, co).replace(/(<br\s*\/?>|\s)+$/i, "").trim();
|
|
3105
|
+
}
|
|
3106
|
+
function on(s) {
|
|
3107
|
+
if (!s)
|
|
3108
|
+
return null;
|
|
3109
|
+
const e = new DOMParser().parseFromString(s, "text/html").querySelector("table");
|
|
3110
|
+
if (!e || e.hasAttribute(lt))
|
|
3111
|
+
return null;
|
|
3112
|
+
const o = e.querySelectorAll("tr");
|
|
3113
|
+
if (o.length === 0)
|
|
3114
|
+
return null;
|
|
3115
|
+
const n = [];
|
|
3116
|
+
o.forEach((i) => {
|
|
3117
|
+
const a = i.querySelectorAll("td, th"), l = [];
|
|
3118
|
+
a.forEach((c) => {
|
|
3119
|
+
var C;
|
|
3120
|
+
const u = ho(c).split(/<br\s*\/?>/i).map((k) => k.trim()).filter(Boolean), g = { blocks: u.length > 0 ? u.map((k) => ({ tool: "paragraph", data: { text: k } })) : [{ tool: "paragraph", data: { text: "" } }] }, f = (C = c.getAttribute("style")) != null ? C : "", b = /background-color\s*:\s*([^;]+)/i.exec(f);
|
|
3121
|
+
b != null && b[1] && (g.color = z(b[1].trim(), "bg"));
|
|
3122
|
+
const w = new RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i").exec(f);
|
|
3123
|
+
w != null && w[1] && !Tt(w[1].trim()) && (g.textColor = z(w[1].trim(), "text")), l.push(g);
|
|
3124
|
+
}), n.push(l);
|
|
3125
|
+
});
|
|
3126
|
+
const r = Math.max(0, ...n.map((i) => i.length));
|
|
3127
|
+
if (n.length === 0 || r === 0)
|
|
3128
|
+
return null;
|
|
3129
|
+
for (const i of n)
|
|
3130
|
+
for (; i.length < r; )
|
|
3131
|
+
i.push({ blocks: [{ tool: "paragraph", data: { text: "" } }] });
|
|
3132
|
+
return {
|
|
3133
|
+
rows: n.length,
|
|
3134
|
+
cols: r,
|
|
3135
|
+
cells: n
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
function nn(s) {
|
|
3139
|
+
var o;
|
|
3140
|
+
const e = new RegExp(`${lt}='([^']*)'|${lt}="([^"]*)"`, "s").exec(s);
|
|
3141
|
+
if (!e)
|
|
3142
|
+
return null;
|
|
3143
|
+
try {
|
|
3144
|
+
const n = (o = e[1]) != null ? o : e[2];
|
|
3145
|
+
if (n === void 0)
|
|
3146
|
+
return null;
|
|
3147
|
+
const r = n.replace(/'/g, "'").replace(/"/g, '"');
|
|
3148
|
+
return JSON.parse(r);
|
|
3149
|
+
} catch (n) {
|
|
3150
|
+
return null;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
const sn = `
|
|
2689
3154
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2690
3155
|
<path d="m5 15 10-10m0 10L5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2691
3156
|
</svg>
|
|
2692
|
-
`,
|
|
3157
|
+
`, rn = `
|
|
2693
3158
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2694
3159
|
<path
|
|
2695
3160
|
d="M5.5 11h4.9231c.6528 0 1.2789-.3161 1.7405-.8787.4617-.56259.721-1.32565.721-2.1213 0-.79565-.2593-1.55871-.721-2.12132C11.702 5.31607 11.0759 5 10.4231 5H5.5v6Zm0 0h5.5385c.6528 0 1.2789.3161 1.7405.8787.4617.5626.721 1.3257.721 2.1213 0 .7956-.2593 1.5587-.721 2.1213-.4616.5626-1.0877.8787-1.7405.8787H5.5v-6Z"
|
|
@@ -2699,7 +3164,7 @@ const to = `
|
|
|
2699
3164
|
stroke-linejoin="round"
|
|
2700
3165
|
/>
|
|
2701
3166
|
</svg>
|
|
2702
|
-
`,
|
|
3167
|
+
`, an = `
|
|
2703
3168
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2704
3169
|
<path
|
|
2705
3170
|
d="M8.5 5h6m-10 12h6m1-12-4 12"
|
|
@@ -2709,19 +3174,25 @@ const to = `
|
|
|
2709
3174
|
stroke-linejoin="round"
|
|
2710
3175
|
/>
|
|
2711
3176
|
</svg>
|
|
2712
|
-
`,
|
|
3177
|
+
`, ln = `
|
|
2713
3178
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2714
3179
|
<path d="M8.5 11.5a3.5 3.5 0 0 0 5 0l2-2a3.536 3.536 0 0 0-5-5l-1 1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2715
3180
|
<path d="M11.5 8.5a3.5 3.5 0 0 0-5 0l-2 2a3.536 3.536 0 0 0 5 5l1-1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2716
3181
|
</svg>
|
|
2717
|
-
`,
|
|
3182
|
+
`, cn = `
|
|
3183
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3184
|
+
<path d="M6.5 14L10 5l3.5 9" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3185
|
+
<path d="M7.5 11.5h5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
3186
|
+
<rect x="4.5" y="16" width="11" height="1.5" rx="0.75" fill="currentColor"/>
|
|
3187
|
+
</svg>
|
|
3188
|
+
`, dn = `
|
|
2718
3189
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2719
3190
|
<path d="M14.5 6.5l2-2-2-2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2720
3191
|
<path d="M16.5 4.5h-4a5 5 0 0 0-5 5v1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2721
3192
|
<path d="M5.5 13.5l-2 2 2 2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2722
3193
|
<path d="M3.5 15.5h4a5 5 0 0 0 5-5v-1" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2723
3194
|
</svg>
|
|
2724
|
-
`,
|
|
3195
|
+
`, hn = `
|
|
2725
3196
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2726
3197
|
<circle cx="7.5" cy="5.5" r="1" fill="currentColor"/>
|
|
2727
3198
|
<circle cx="12.5" cy="5.5" r="1" fill="currentColor"/>
|
|
@@ -2730,24 +3201,24 @@ const to = `
|
|
|
2730
3201
|
<circle cx="7.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2731
3202
|
<circle cx="12.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2732
3203
|
</svg>
|
|
2733
|
-
`,
|
|
3204
|
+
`, un = `
|
|
2734
3205
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2735
3206
|
<path d="M4.5 10h11M10 4.5v11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2736
3207
|
</svg>
|
|
2737
|
-
`,
|
|
3208
|
+
`, pn = `
|
|
2738
3209
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2739
3210
|
<path d="m12 5-5 5 5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2740
3211
|
</svg>
|
|
2741
|
-
`,
|
|
3212
|
+
`, uo = `
|
|
2742
3213
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2743
3214
|
<path d="m8 5 5 5-5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2744
3215
|
</svg>
|
|
2745
|
-
`,
|
|
3216
|
+
`, po = `
|
|
2746
3217
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2747
3218
|
<circle cx="9" cy="9" r="4.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2748
3219
|
<path d="m12.5 12.5 3.5 3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2749
3220
|
</svg>
|
|
2750
|
-
`,
|
|
3221
|
+
`, fn = `
|
|
2751
3222
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2752
3223
|
<path
|
|
2753
3224
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 5 2.5-1.66667V15"
|
|
@@ -2757,7 +3228,7 @@ const to = `
|
|
|
2757
3228
|
stroke-linejoin="round"
|
|
2758
3229
|
/>
|
|
2759
3230
|
</svg>
|
|
2760
|
-
`,
|
|
3231
|
+
`, gn = `
|
|
2761
3232
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2762
3233
|
<path
|
|
2763
3234
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m7.5 10h-3.3333c0-3.3333 3.3333-2.5 3.3333-5 0-1.25-1.6667-2.08333-3.3333-.83333"
|
|
@@ -2767,7 +3238,7 @@ const to = `
|
|
|
2767
3238
|
stroke-linejoin="round"
|
|
2768
3239
|
/>
|
|
2769
3240
|
</svg>
|
|
2770
|
-
`,
|
|
3241
|
+
`, mn = `
|
|
2771
3242
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2772
3243
|
<path
|
|
2773
3244
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.5833 3.75C16 7.91667 17.5 8.75 17.5 10c0 .442-.1756.866-.4882 1.1785-.3125.3126-.7364.4882-1.1785.4882.4421 0 .866.1756 1.1785.4881.3126.3126.4882.7365.4882 1.1785 0 1.5-1.6667 2.5-3.3333 1.25"
|
|
@@ -2777,7 +3248,7 @@ const to = `
|
|
|
2777
3248
|
stroke-linejoin="round"
|
|
2778
3249
|
/>
|
|
2779
3250
|
</svg>
|
|
2780
|
-
`,
|
|
3251
|
+
`, vn = `
|
|
2781
3252
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2782
3253
|
<path
|
|
2783
3254
|
d="M10 15V5M14.1667 8.33333V10.8333C14.1667 11.0543 14.2545 11.2663 14.4107 11.4226C14.567 11.5789 14.779 11.6667 15 11.6667H17.5M17.5 8.33333V15M3.33334 10H10M3.33334 15V5"
|
|
@@ -2787,7 +3258,7 @@ const to = `
|
|
|
2787
3258
|
stroke-linejoin="round"
|
|
2788
3259
|
/>
|
|
2789
3260
|
</svg>
|
|
2790
|
-
`,
|
|
3261
|
+
`, bn = `
|
|
2791
3262
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2792
3263
|
<path
|
|
2793
3264
|
d="M3.33334 10H10M3.33334 15V5M10 15V5M17.5 8.33333H14.1667V10.8333H15.25C16.5 10.8333 17.5 11.75 17.5 12.9167C17.5 14.0833 16.5 15 15.25 15C14.8333 15 14.5 14.9167 14.1667 14.75"
|
|
@@ -2797,7 +3268,7 @@ const to = `
|
|
|
2797
3268
|
stroke-linejoin="round"
|
|
2798
3269
|
/>
|
|
2799
3270
|
</svg>
|
|
2800
|
-
`,
|
|
3271
|
+
`, wn = `
|
|
2801
3272
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2802
3273
|
<path
|
|
2803
3274
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 8.3333c0 .9205.7462 1.6667 1.6666 1.6667.9205 0 1.6667-.7462 1.6667-1.6667 0-.9204-.7462-1.6666-1.6667-1.6666-.9204 0-1.6666.7462-1.6666 1.6666Zm0 0c0-2.0833.8333-3.3333 2.5-4.99997"
|
|
@@ -2807,7 +3278,7 @@ const to = `
|
|
|
2807
3278
|
stroke-linejoin="round"
|
|
2808
3279
|
/>
|
|
2809
3280
|
</svg>
|
|
2810
|
-
`,
|
|
3281
|
+
`, kn = `
|
|
2811
3282
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2812
3283
|
<path
|
|
2813
3284
|
d="M6.5 10h6.6667M6.5 15V5m6.6667 10V5"
|
|
@@ -2817,7 +3288,7 @@ const to = `
|
|
|
2817
3288
|
stroke-linejoin="round"
|
|
2818
3289
|
/>
|
|
2819
3290
|
</svg>
|
|
2820
|
-
`,
|
|
3291
|
+
`, Cn = `
|
|
2821
3292
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2822
3293
|
<path
|
|
2823
3294
|
d="M14.5 7.28571V6h-9v1.28571M10 6v9m0 0H8.71429M10 15h1.2857"
|
|
@@ -2827,12 +3298,12 @@ const to = `
|
|
|
2827
3298
|
stroke-linejoin="round"
|
|
2828
3299
|
/>
|
|
2829
3300
|
</svg>
|
|
2830
|
-
`,
|
|
3301
|
+
`, yn = `
|
|
2831
3302
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2832
3303
|
<path d="M10 4 3 16h14Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2833
3304
|
<path d="M10 8.5v3.5m0 2v.01" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2834
3305
|
</svg>
|
|
2835
|
-
`,
|
|
3306
|
+
`, En = `
|
|
2836
3307
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2837
3308
|
<path
|
|
2838
3309
|
d="M8 5h9M8 10h9M8 15h9M4 5h.01M4 10h.01M4 15h.01"
|
|
@@ -2842,7 +3313,7 @@ const to = `
|
|
|
2842
3313
|
stroke-linejoin="round"
|
|
2843
3314
|
/>
|
|
2844
3315
|
</svg>
|
|
2845
|
-
`,
|
|
3316
|
+
`, Tn = `
|
|
2846
3317
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2847
3318
|
<path
|
|
2848
3319
|
d="M8 5h9M8 10h9M8 15h9M3.5 4.5l1-1v3M3.5 9.5a1 1 0 1 1 2 0c0 .75-2 1.25-2 2h2M3.5 13.5h1a.75.75 0 0 1 0 1.5.75.75 0 0 1 0 1.5h-1"
|
|
@@ -2852,7 +3323,7 @@ const to = `
|
|
|
2852
3323
|
stroke-linejoin="round"
|
|
2853
3324
|
/>
|
|
2854
3325
|
</svg>
|
|
2855
|
-
`,
|
|
3326
|
+
`, xn = `
|
|
2856
3327
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2857
3328
|
<path
|
|
2858
3329
|
d="M10 5h7M10 10h7M10 15h7M3 5l1 1 2-2M3 10l1 1 2-2M3 15l1 1 2-2"
|
|
@@ -2862,54 +3333,59 @@ const to = `
|
|
|
2862
3333
|
stroke-linejoin="round"
|
|
2863
3334
|
/>
|
|
2864
3335
|
</svg>
|
|
2865
|
-
`,
|
|
3336
|
+
`, In = `
|
|
2866
3337
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2867
3338
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2868
3339
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2869
3340
|
</svg>
|
|
2870
|
-
`,
|
|
3341
|
+
`, An = `
|
|
2871
3342
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2872
3343
|
<path d="M4.5 4h11A1.5 1.5 0 0 1 17 5.5V8H3V5.5A1.5 1.5 0 0 1 4.5 4Z" fill="currentColor"/>
|
|
2873
3344
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2874
3345
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2875
3346
|
</svg>
|
|
2876
|
-
`,
|
|
3347
|
+
`, Sn = `
|
|
2877
3348
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2878
3349
|
<path d="M4.5 4H7.5v12H4.5A1.5 1.5 0 0 1 3 14.5v-9A1.5 1.5 0 0 1 4.5 4Z" fill="currentColor"/>
|
|
2879
3350
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2880
3351
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2881
3352
|
</svg>
|
|
2882
|
-
`,
|
|
3353
|
+
`, Ln = `
|
|
2883
3354
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2884
3355
|
<path d="M10 4l-3 3m3-3l3 3M10 4v7M5 16h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2885
3356
|
</svg>
|
|
2886
|
-
`,
|
|
3357
|
+
`, Nn = `
|
|
2887
3358
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2888
3359
|
<path d="M10 16l-3-3m3 3l3-3M10 16V9M5 4h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2889
3360
|
</svg>
|
|
2890
|
-
`,
|
|
3361
|
+
`, On = `
|
|
2891
3362
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2892
3363
|
<path d="M4 10l3-3M4 10l3 3M4 10h7M16 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2893
3364
|
</svg>
|
|
2894
|
-
`,
|
|
3365
|
+
`, Rn = `
|
|
2895
3366
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2896
3367
|
<path d="M16 10l-3-3m3 3l-3 3M16 10H9M4 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2897
3368
|
</svg>
|
|
2898
|
-
`,
|
|
3369
|
+
`, Mn = `
|
|
3370
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3371
|
+
<rect x="7" y="7" width="9" height="9" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
3372
|
+
<path d="M5 13h-.5A1.5 1.5 0 0 1 3 11.5v-7A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5V5" stroke="currentColor" stroke-width="1.25"/>
|
|
3373
|
+
</svg>
|
|
3374
|
+
`, Bn = `
|
|
2899
3375
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2900
3376
|
<path d="M4.5 6.5h11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2901
3377
|
<path d="M8 6.5V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2902
3378
|
<path d="M6.5 6.5l.5 8.5a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1l.5-8.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2903
3379
|
<path d="M8.5 9.5v3.5M11.5 9.5v3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2904
3380
|
</svg>
|
|
2905
|
-
`,
|
|
3381
|
+
`, q = {
|
|
2906
3382
|
root: "",
|
|
2907
3383
|
alignedStart: "text-start",
|
|
2908
3384
|
alignedCenter: "text-center",
|
|
2909
3385
|
title: "",
|
|
2910
3386
|
description: "opacity-60 mt-[3px]"
|
|
2911
3387
|
};
|
|
2912
|
-
class
|
|
3388
|
+
class fo {
|
|
2913
3389
|
/**
|
|
2914
3390
|
* Constructs the hint content instance
|
|
2915
3391
|
* @param params - hint content parameters
|
|
@@ -2917,9 +3393,9 @@ class Ce {
|
|
|
2917
3393
|
constructor(t) {
|
|
2918
3394
|
const e = t.alignment === "center" ? "center" : "start";
|
|
2919
3395
|
this.nodes = {
|
|
2920
|
-
root:
|
|
2921
|
-
title:
|
|
2922
|
-
}, this.nodes.root.setAttribute("data-alignment", e), this.nodes.root.appendChild(this.nodes.title), t.description !== void 0 && (this.nodes.description =
|
|
3396
|
+
root: m.make("div", [q.root, e === "center" ? q.alignedCenter : q.alignedStart]),
|
|
3397
|
+
title: m.make("div", q.title, { textContent: t.title })
|
|
3398
|
+
}, this.nodes.root.setAttribute("data-alignment", e), this.nodes.root.appendChild(this.nodes.title), t.description !== void 0 && (this.nodes.description = m.make("div", q.description, { textContent: t.description }), this.nodes.root.appendChild(this.nodes.description));
|
|
2923
3399
|
}
|
|
2924
3400
|
/**
|
|
2925
3401
|
* Returns the root element of the hint content
|
|
@@ -2928,7 +3404,7 @@ class Ce {
|
|
|
2928
3404
|
return this.nodes.root;
|
|
2929
3405
|
}
|
|
2930
3406
|
}
|
|
2931
|
-
class
|
|
3407
|
+
class St {
|
|
2932
3408
|
/**
|
|
2933
3409
|
* Constructs the instance
|
|
2934
3410
|
* @param params - instance parameters
|
|
@@ -2947,7 +3423,7 @@ class ut {
|
|
|
2947
3423
|
* Destroys the instance
|
|
2948
3424
|
*/
|
|
2949
3425
|
destroy() {
|
|
2950
|
-
|
|
3426
|
+
no();
|
|
2951
3427
|
}
|
|
2952
3428
|
/**
|
|
2953
3429
|
* Called when children popover is opened (if exists)
|
|
@@ -2976,8 +3452,8 @@ class ut {
|
|
|
2976
3452
|
* @param hintData - hint data
|
|
2977
3453
|
*/
|
|
2978
3454
|
addHint(t, e) {
|
|
2979
|
-
const o = new
|
|
2980
|
-
|
|
3455
|
+
const o = new fo(e);
|
|
3456
|
+
so(t, o.getElement(), {
|
|
2981
3457
|
placement: e.position
|
|
2982
3458
|
});
|
|
2983
3459
|
}
|
|
@@ -3049,7 +3525,7 @@ class ut {
|
|
|
3049
3525
|
return this.params === void 0 || !("isActive" in this.params) ? !1 : typeof this.params.isActive == "function" ? this.params.isActive() : this.params.isActive === !0;
|
|
3050
3526
|
}
|
|
3051
3527
|
}
|
|
3052
|
-
const
|
|
3528
|
+
const X = {
|
|
3053
3529
|
/**
|
|
3054
3530
|
* Base item styles with hover, focus, and active support
|
|
3055
3531
|
* Hover is applied via can-hover:hover: for real hover and data-blok-force-hover for tests
|
|
@@ -3058,7 +3534,7 @@ const $ = {
|
|
|
3058
3534
|
* Note: noHover state is handled via [data-blok-popover-item-no-hover] which disables hover
|
|
3059
3535
|
* Priority order: active < hover < focus (focus wins when navigating with keyboard)
|
|
3060
3536
|
*/
|
|
3061
|
-
item: 'flex items-center select-none border-none bg-transparent rounded-md px-2 py-
|
|
3537
|
+
item: 'flex items-center select-none border-none bg-transparent rounded-md px-2 py-(--item-padding) text-text-primary mb-px data-blok-popover-item-active:bg-icon-active-bg data-blok-popover-item-active:text-icon-active-text can-hover:hover:cursor-pointer can-hover:hover:bg-item-hover-bg data-blok-force-hover:cursor-pointer data-blok-force-hover:bg-item-hover-bg data-[blok-focused="true"]:bg-item-focus-bg data-blok-popover-item-no-hover:hover:bg-transparent data-blok-popover-item-no-hover:cursor-default can-hover:data-blok-popover-item-destructive:hover:text-item-destructive-text can-hover:data-blok-popover-item-destructive:hover:bg-item-destructive-hover-bg [&[data-blok-popover-item-destructive][data-blok-force-hover]]:text-item-destructive-text [&[data-blok-popover-item-destructive][data-blok-force-hover]]:bg-item-destructive-hover-bg [&[data-blok-popover-item-destructive][data-blok-focused="true"]]:text-item-destructive-text [&[data-blok-popover-item-destructive][data-blok-focused="true"]]:bg-item-destructive-hover-bg',
|
|
3062
3538
|
/**
|
|
3063
3539
|
* Item disabled state
|
|
3064
3540
|
*/
|
|
@@ -3072,18 +3548,18 @@ const $ = {
|
|
|
3072
3548
|
* Used alongside data-blok-focused attribute.
|
|
3073
3549
|
*/
|
|
3074
3550
|
focused: "is-focused"
|
|
3075
|
-
},
|
|
3551
|
+
}, go = {
|
|
3076
3552
|
/**
|
|
3077
3553
|
* Item in inline context - more compact styling
|
|
3078
3554
|
*/
|
|
3079
|
-
item: "rounded p-1"
|
|
3080
|
-
},
|
|
3555
|
+
item: "rounded-sm p-1"
|
|
3556
|
+
}, mo = {
|
|
3081
3557
|
/**
|
|
3082
3558
|
* Nested item - back to desktop popover styling
|
|
3083
3559
|
*/
|
|
3084
3560
|
item: "rounded-md p-[3px] mobile:p-1"
|
|
3085
3561
|
};
|
|
3086
|
-
class
|
|
3562
|
+
class B extends St {
|
|
3087
3563
|
/**
|
|
3088
3564
|
* Constructs popover item instance
|
|
3089
3565
|
* @param params - popover item construction params
|
|
@@ -3143,7 +3619,7 @@ class I extends ut {
|
|
|
3143
3619
|
* True if item is focused in keyboard navigation process
|
|
3144
3620
|
*/
|
|
3145
3621
|
get isFocused() {
|
|
3146
|
-
return this.nodes.root === null ? !1 : this.nodes.root.hasAttribute(
|
|
3622
|
+
return this.nodes.root === null ? !1 : this.nodes.root.hasAttribute(p.focused);
|
|
3147
3623
|
}
|
|
3148
3624
|
/**
|
|
3149
3625
|
* Returns popover item root element
|
|
@@ -3168,7 +3644,7 @@ class I extends ut {
|
|
|
3168
3644
|
toggleActive(t) {
|
|
3169
3645
|
if (this.nodes.root === null)
|
|
3170
3646
|
return;
|
|
3171
|
-
const e = this.nodes.root.hasAttribute(
|
|
3647
|
+
const e = this.nodes.root.hasAttribute(p.popoverItemActive), o = t !== void 0 ? t : !e;
|
|
3172
3648
|
this.setActive(o);
|
|
3173
3649
|
}
|
|
3174
3650
|
/**
|
|
@@ -3196,76 +3672,76 @@ class I extends ut {
|
|
|
3196
3672
|
* @param renderParams - popover item render params
|
|
3197
3673
|
*/
|
|
3198
3674
|
createRootElement(t, e) {
|
|
3199
|
-
var
|
|
3200
|
-
const o = (
|
|
3201
|
-
return o === "button" &&
|
|
3202
|
-
|
|
3203
|
-
}), t.isDisabled &&
|
|
3204
|
-
position: ((
|
|
3205
|
-
alignment: ((
|
|
3206
|
-
})),
|
|
3675
|
+
var i, a, l, c;
|
|
3676
|
+
const o = (i = e == null ? void 0 : e.wrapperTag) != null ? i : "div", n = document.createElement(o);
|
|
3677
|
+
return o === "button" && n.setAttribute("type", "button"), n.className = this.getContainerClass(), n.setAttribute(p.popoverItem, ""), n.setAttribute("data-blok-testid", "popover-item"), t.name && n.setAttribute("data-blok-item-name", t.name), t.dataset && Object.entries(t.dataset).forEach(([d, u]) => {
|
|
3678
|
+
n.setAttribute(`data-${d}`, u);
|
|
3679
|
+
}), t.isDisabled && n.setAttribute(p.disabled, "true"), "isDestructive" in t && t.isDestructive && n.setAttribute(p.popoverItemDestructive, "true"), this.isActive && n.setAttribute(p.popoverItemActive, "true"), this.hasChildren && n.setAttribute(p.hasChildren, "true"), this.createContentElements(n, t, e), t.hint !== void 0 && ((a = e == null ? void 0 : e.hint) == null ? void 0 : a.enabled) !== !1 && t.hint !== void 0 && this.addHint(n, D(L({}, t.hint), {
|
|
3680
|
+
position: ((l = e == null ? void 0 : e.hint) == null ? void 0 : l.position) || "right",
|
|
3681
|
+
alignment: ((c = e == null ? void 0 : e.hint) == null ? void 0 : c.alignment) || "center"
|
|
3682
|
+
})), n;
|
|
3207
3683
|
}
|
|
3208
3684
|
/**
|
|
3209
3685
|
* Creates the content elements (icon, title, secondary label, chevron)
|
|
3210
3686
|
*/
|
|
3211
3687
|
createContentElements(t, e, o) {
|
|
3212
|
-
var
|
|
3213
|
-
const
|
|
3214
|
-
if (e.icon && (this.nodes.icon = this.createIconElement(e.icon,
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3688
|
+
var c, d, u;
|
|
3689
|
+
const n = (c = o == null ? void 0 : o.iconWithGap) != null ? c : !0, r = (d = o == null ? void 0 : o.isInline) != null ? d : !1, i = (u = o == null ? void 0 : o.isNestedInline) != null ? u : !1, a = e.title;
|
|
3690
|
+
if (e.icon && (this.nodes.icon = this.createIconElement(e.icon, n, r, i), t.appendChild(this.nodes.icon)), a !== void 0) {
|
|
3691
|
+
const h = document.createElement("div");
|
|
3692
|
+
h.className = e.secondaryLabel ? "grow truncate text-sm font-medium leading-5" : "mr-auto truncate text-sm font-medium leading-5", h.setAttribute(p.popoverItemTitle, ""), h.setAttribute("data-blok-testid", "popover-item-title"), h.textContent = a, t.appendChild(h), this.nodes.titleEl = h;
|
|
3217
3693
|
}
|
|
3218
3694
|
if (e.secondaryLabel) {
|
|
3219
|
-
const
|
|
3220
|
-
|
|
3695
|
+
const h = document.createElement("div");
|
|
3696
|
+
h.className = "min-w-14 text-right whitespace-nowrap pl-3 pr-1.5 text-xs font-light tracking-[0.25px] text-text-secondary opacity-60", h.setAttribute(p.popoverItemSecondaryTitle, ""), h.setAttribute("data-blok-testid", "popover-item-secondary-title"), h.textContent = e.secondaryLabel, t.appendChild(h), this.nodes.secondaryLabelEl = h;
|
|
3221
3697
|
}
|
|
3222
3698
|
if (this.hasChildren && !this.isChevronHidden) {
|
|
3223
|
-
const
|
|
3224
|
-
|
|
3699
|
+
const h = document.createElement("div");
|
|
3700
|
+
h.className = this.getChevronClass(r), h.setAttribute(p.popoverItemIcon, ""), h.setAttribute(p.popoverItemIconChevronRight, ""), h.setAttribute("data-blok-testid", "popover-item-chevron-right"), h.innerHTML = uo, t.appendChild(h), this.nodes.chevron = h;
|
|
3225
3701
|
}
|
|
3226
3702
|
}
|
|
3227
3703
|
/**
|
|
3228
3704
|
* Creates an icon element
|
|
3229
3705
|
*/
|
|
3230
|
-
createIconElement(t, e, o,
|
|
3231
|
-
const
|
|
3232
|
-
return
|
|
3706
|
+
createIconElement(t, e, o, n) {
|
|
3707
|
+
const r = document.createElement("div");
|
|
3708
|
+
return r.className = this.getIconClass(e, o, n, !1), r.setAttribute(p.popoverItemIcon, ""), r.setAttribute("data-blok-testid", "popover-item-icon"), r.innerHTML = t, e && r.setAttribute(p.tool, ""), r;
|
|
3233
3709
|
}
|
|
3234
3710
|
/**
|
|
3235
3711
|
* Gets the container class based on current state
|
|
3236
3712
|
*/
|
|
3237
3713
|
getContainerClass() {
|
|
3238
|
-
var o,
|
|
3239
|
-
const t = (
|
|
3240
|
-
return
|
|
3241
|
-
|
|
3242
|
-
// Asymmetric padding for
|
|
3243
|
-
!t && !e && "pl-2 pr-8",
|
|
3244
|
-
t &&
|
|
3245
|
-
e &&
|
|
3246
|
-
this.params.isDisabled &&
|
|
3714
|
+
var o, n, r, i;
|
|
3715
|
+
const t = (n = (o = this.renderParams) == null ? void 0 : o.isInline) != null ? n : !1, e = (i = (r = this.renderParams) == null ? void 0 : r.isNestedInline) != null ? i : !1;
|
|
3716
|
+
return A(
|
|
3717
|
+
X.item,
|
|
3718
|
+
// Asymmetric padding: pr-8 for visual balance, pr-2 when secondary label or chevron occupies right edge
|
|
3719
|
+
!t && !e && (this.params.secondaryLabel || this.hasChildren && !this.isChevronHidden ? "pl-2 pr-2" : "pl-2 pr-8"),
|
|
3720
|
+
t && go.item,
|
|
3721
|
+
e && mo.item,
|
|
3722
|
+
this.params.isDisabled && X.itemDisabled
|
|
3247
3723
|
);
|
|
3248
3724
|
}
|
|
3249
3725
|
/**
|
|
3250
3726
|
* Gets the icon class based on context
|
|
3251
3727
|
*/
|
|
3252
|
-
getIconClass(t, e, o,
|
|
3253
|
-
return
|
|
3254
|
-
|
|
3728
|
+
getIconClass(t, e, o, n) {
|
|
3729
|
+
return A(
|
|
3730
|
+
X.icon,
|
|
3255
3731
|
e && "w-auto h-auto [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",
|
|
3256
3732
|
o && "w-toolbox-btn h-toolbox-btn",
|
|
3257
3733
|
t && "mr-3",
|
|
3258
|
-
t && e && "shadow-none bg-transparent
|
|
3259
|
-
t && o && "
|
|
3260
|
-
|
|
3734
|
+
t && e && "shadow-none bg-transparent mr-0!",
|
|
3735
|
+
t && o && "mr-2!",
|
|
3736
|
+
n && "animate-wobble"
|
|
3261
3737
|
);
|
|
3262
3738
|
}
|
|
3263
3739
|
/**
|
|
3264
3740
|
* Gets the chevron class based on context
|
|
3265
3741
|
*/
|
|
3266
3742
|
getChevronClass(t) {
|
|
3267
|
-
return
|
|
3268
|
-
|
|
3743
|
+
return A(
|
|
3744
|
+
X.icon,
|
|
3269
3745
|
t && "rotate-90"
|
|
3270
3746
|
);
|
|
3271
3747
|
}
|
|
@@ -3273,32 +3749,32 @@ class I extends ut {
|
|
|
3273
3749
|
* Sets the active state of the item
|
|
3274
3750
|
*/
|
|
3275
3751
|
setActive(t) {
|
|
3276
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3752
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemActive, "true") : this.nodes.root.removeAttribute(p.popoverItemActive));
|
|
3277
3753
|
}
|
|
3278
3754
|
/**
|
|
3279
3755
|
* Sets the hidden state of the item
|
|
3280
3756
|
*/
|
|
3281
3757
|
setHidden(t) {
|
|
3282
|
-
this.nodes.root && (t ? (this.nodes.root.setAttribute(
|
|
3758
|
+
this.nodes.root && (t ? (this.nodes.root.setAttribute(p.hidden, "true"), this.nodes.root.classList.add("hidden!")) : (this.nodes.root.removeAttribute(p.hidden), this.nodes.root.classList.remove("hidden!")));
|
|
3283
3759
|
}
|
|
3284
3760
|
/**
|
|
3285
3761
|
* Sets the focused state of the item
|
|
3286
3762
|
* @param isFocused - true if item should be focused
|
|
3287
3763
|
*/
|
|
3288
3764
|
setFocused(t) {
|
|
3289
|
-
this.nodes.root && (t ? (this.nodes.root.setAttribute(
|
|
3765
|
+
this.nodes.root && (t ? (this.nodes.root.setAttribute(p.focused, "true"), this.nodes.root.classList.add("bg-item-focus-bg!")) : (this.nodes.root.removeAttribute(p.focused), this.nodes.root.classList.remove("bg-item-focus-bg!")));
|
|
3290
3766
|
}
|
|
3291
3767
|
/**
|
|
3292
3768
|
* Sets the no-hover state
|
|
3293
3769
|
*/
|
|
3294
3770
|
setNoHover(t) {
|
|
3295
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3771
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemNoHover, "true") : this.nodes.root.removeAttribute(p.popoverItemNoHover));
|
|
3296
3772
|
}
|
|
3297
3773
|
/**
|
|
3298
3774
|
* Sets the no-focus state
|
|
3299
3775
|
*/
|
|
3300
3776
|
setNoFocus(t) {
|
|
3301
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3777
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemNoFocus, "true") : this.nodes.root.removeAttribute(p.popoverItemNoFocus));
|
|
3302
3778
|
}
|
|
3303
3779
|
/**
|
|
3304
3780
|
* Activates confirmation mode for the item.
|
|
@@ -3307,7 +3783,7 @@ class I extends ut {
|
|
|
3307
3783
|
enableConfirmationMode(t) {
|
|
3308
3784
|
if (this.nodes.root === null)
|
|
3309
3785
|
return;
|
|
3310
|
-
const e =
|
|
3786
|
+
const e = D(L(L({}, this.params), t), {
|
|
3311
3787
|
confirmation: "confirmation" in t ? t.confirmation : void 0
|
|
3312
3788
|
});
|
|
3313
3789
|
this.setConfirmation(e), this.confirmationState = t, this.enableSpecialHoverAndFocusBehavior();
|
|
@@ -3328,13 +3804,13 @@ class I extends ut {
|
|
|
3328
3804
|
* Clears confirmation state and restores original content
|
|
3329
3805
|
*/
|
|
3330
3806
|
clearConfirmationState() {
|
|
3331
|
-
this.nodes.root && (this.nodes.root.removeAttribute(
|
|
3807
|
+
this.nodes.root && (this.nodes.root.removeAttribute(p.popoverItemConfirmation), this.nodes.root.classList.remove("bg-item-confirm-bg!", "text-white!"), this.restoreOriginalIcon(), this.restoreOriginalTitle(), this.restoreOriginalSecondaryLabel());
|
|
3332
3808
|
}
|
|
3333
3809
|
/**
|
|
3334
3810
|
* Applies confirmation state with new params
|
|
3335
3811
|
*/
|
|
3336
3812
|
applyConfirmationState(t) {
|
|
3337
|
-
this.nodes.root && (this.nodes.root.setAttribute(
|
|
3813
|
+
this.nodes.root && (this.nodes.root.setAttribute(p.popoverItemConfirmation, "true"), this.nodes.root.classList.add("bg-item-confirm-bg!", "text-white!"), this.updateIcon(t.icon), this.updateTitle(t), this.updateSecondaryLabel(t.secondaryLabel));
|
|
3338
3814
|
}
|
|
3339
3815
|
/**
|
|
3340
3816
|
* Restores the original icon
|
|
@@ -3419,15 +3895,15 @@ class I extends ut {
|
|
|
3419
3895
|
* Triggers wobble animation on the icon
|
|
3420
3896
|
*/
|
|
3421
3897
|
triggerWobble() {
|
|
3422
|
-
var
|
|
3898
|
+
var r, i, a, l, c, d;
|
|
3423
3899
|
if (!this.nodes.icon)
|
|
3424
3900
|
return;
|
|
3425
|
-
const t = (
|
|
3426
|
-
this.nodes.icon.setAttribute(
|
|
3427
|
-
const
|
|
3428
|
-
this.nodes.icon && (this.nodes.icon.removeAttribute(
|
|
3901
|
+
const t = (i = (r = this.renderParams) == null ? void 0 : r.isInline) != null ? i : !1, e = (l = (a = this.renderParams) == null ? void 0 : a.isNestedInline) != null ? l : !1, o = (d = (c = this.renderParams) == null ? void 0 : c.iconWithGap) != null ? d : !0;
|
|
3902
|
+
this.nodes.icon.setAttribute(p.popoverItemWobble, "true"), this.nodes.icon.className = this.getIconClass(o, t, e, !0);
|
|
3903
|
+
const n = () => {
|
|
3904
|
+
this.nodes.icon && (this.nodes.icon.removeAttribute(p.popoverItemWobble), this.nodes.icon.className = this.getIconClass(o, t, e, !1));
|
|
3429
3905
|
};
|
|
3430
|
-
this.nodes.icon.addEventListener("animationend",
|
|
3906
|
+
this.nodes.icon.addEventListener("animationend", n, { once: !0 });
|
|
3431
3907
|
}
|
|
3432
3908
|
/**
|
|
3433
3909
|
* Gets reference to the icon element
|
|
@@ -3436,11 +3912,11 @@ class I extends ut {
|
|
|
3436
3912
|
return this.nodes.icon;
|
|
3437
3913
|
}
|
|
3438
3914
|
}
|
|
3439
|
-
const
|
|
3915
|
+
const j = {
|
|
3440
3916
|
container: "py-1 px-[3px]",
|
|
3441
3917
|
containerHidden: "hidden",
|
|
3442
3918
|
line: "h-px w-full bg-popover-border"
|
|
3443
|
-
},
|
|
3919
|
+
}, et = {
|
|
3444
3920
|
// Inline context: horizontal separator
|
|
3445
3921
|
container: "px-1 py-0",
|
|
3446
3922
|
line: "h-full w-px",
|
|
@@ -3448,7 +3924,7 @@ const A = {
|
|
|
3448
3924
|
nestedContainer: "py-1 px-[3px]",
|
|
3449
3925
|
nestedLine: "w-full h-px"
|
|
3450
3926
|
};
|
|
3451
|
-
class
|
|
3927
|
+
class se extends St {
|
|
3452
3928
|
/**
|
|
3453
3929
|
* Constructs the instance
|
|
3454
3930
|
* @param renderParams - optional render params for styling context
|
|
@@ -3471,38 +3947,38 @@ class Mt extends ut {
|
|
|
3471
3947
|
if (!this.nodes.root)
|
|
3472
3948
|
return;
|
|
3473
3949
|
const e = this.getContainerClass(!1), o = this.getContainerClass(!0);
|
|
3474
|
-
this.nodes.root.className = t ? o : e, t ? this.nodes.root.setAttribute(
|
|
3950
|
+
this.nodes.root.className = t ? o : e, t ? this.nodes.root.setAttribute(p.hidden, "true") : this.nodes.root.removeAttribute(p.hidden);
|
|
3475
3951
|
}
|
|
3476
3952
|
/**
|
|
3477
3953
|
* Build container class based on context
|
|
3478
3954
|
*/
|
|
3479
3955
|
getContainerClass(t) {
|
|
3480
|
-
const e =
|
|
3481
|
-
return this.isNestedInline ?
|
|
3956
|
+
const e = j.container;
|
|
3957
|
+
return this.isNestedInline ? A(e, et.nestedContainer, t && j.containerHidden) : this.isInline ? A(e, et.container, t && j.containerHidden) : A(e, t && j.containerHidden);
|
|
3482
3958
|
}
|
|
3483
3959
|
/**
|
|
3484
3960
|
* Build line class based on context
|
|
3485
3961
|
*/
|
|
3486
3962
|
getLineClass() {
|
|
3487
|
-
return this.isNestedInline ?
|
|
3963
|
+
return this.isNestedInline ? A(j.line, et.nestedLine) : this.isInline ? A(j.line, et.line) : j.line;
|
|
3488
3964
|
}
|
|
3489
3965
|
/**
|
|
3490
3966
|
* Creates the root container element
|
|
3491
3967
|
*/
|
|
3492
3968
|
createRootElement() {
|
|
3493
3969
|
const t = document.createElement("div");
|
|
3494
|
-
t.className = this.getContainerClass(!1), t.setAttribute(
|
|
3970
|
+
t.className = this.getContainerClass(!1), t.setAttribute(p.popoverItemSeparator, ""), t.setAttribute("data-blok-testid", "popover-item-separator");
|
|
3495
3971
|
const e = document.createElement("div");
|
|
3496
|
-
return e.className = this.getLineClass(), e.setAttribute(
|
|
3972
|
+
return e.className = this.getLineClass(), e.setAttribute(p.popoverItemSeparatorLine, ""), t.appendChild(e), this.nodes.line = e, t;
|
|
3497
3973
|
}
|
|
3498
3974
|
}
|
|
3499
|
-
const
|
|
3975
|
+
const wt = {
|
|
3500
3976
|
root: "",
|
|
3501
3977
|
rootHidden: "hidden"
|
|
3502
|
-
},
|
|
3978
|
+
}, Kt = {
|
|
3503
3979
|
root: "flex items-center"
|
|
3504
3980
|
};
|
|
3505
|
-
class
|
|
3981
|
+
class ct extends St {
|
|
3506
3982
|
/**
|
|
3507
3983
|
* Constructs the instance
|
|
3508
3984
|
* @param params – instance parameters
|
|
@@ -3524,7 +4000,7 @@ class Z extends ut {
|
|
|
3524
4000
|
* @param isHidden - true if item should be hidden
|
|
3525
4001
|
*/
|
|
3526
4002
|
toggleHidden(t) {
|
|
3527
|
-
this.isHidden = t, this.updateRootClasses(), this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
4003
|
+
this.isHidden = t, this.updateRootClasses(), this.nodes.root && (t ? this.nodes.root.setAttribute(p.hidden, "true") : this.nodes.root.removeAttribute(p.hidden));
|
|
3528
4004
|
}
|
|
3529
4005
|
/**
|
|
3530
4006
|
* Returns list of buttons and inputs inside custom content
|
|
@@ -3533,7 +4009,7 @@ class Z extends ut {
|
|
|
3533
4009
|
if (!this.nodes.root)
|
|
3534
4010
|
return [];
|
|
3535
4011
|
const t = this.nodes.root.querySelectorAll(
|
|
3536
|
-
`button, ${
|
|
4012
|
+
`button, ${m.allInputsSelector}`
|
|
3537
4013
|
);
|
|
3538
4014
|
return Array.from(t);
|
|
3539
4015
|
}
|
|
@@ -3541,10 +4017,10 @@ class Z extends ut {
|
|
|
3541
4017
|
* Updates the root element's class list based on current state
|
|
3542
4018
|
*/
|
|
3543
4019
|
updateRootClasses() {
|
|
3544
|
-
this.nodes.root && (this.nodes.root.className =
|
|
3545
|
-
|
|
3546
|
-
this.isInline &&
|
|
3547
|
-
this.isHidden &&
|
|
4020
|
+
this.nodes.root && (this.nodes.root.className = A(
|
|
4021
|
+
wt.root,
|
|
4022
|
+
this.isInline && Kt.root,
|
|
4023
|
+
this.isHidden && wt.rootHidden
|
|
3548
4024
|
));
|
|
3549
4025
|
}
|
|
3550
4026
|
/**
|
|
@@ -3553,28 +4029,28 @@ class Z extends ut {
|
|
|
3553
4029
|
* @param renderParams - render configuration
|
|
3554
4030
|
*/
|
|
3555
4031
|
createRootElement(t, e) {
|
|
3556
|
-
var
|
|
4032
|
+
var n, r, i;
|
|
3557
4033
|
const o = document.createElement("div");
|
|
3558
|
-
return o.className =
|
|
3559
|
-
|
|
3560
|
-
this.isInline &&
|
|
3561
|
-
), o.setAttribute(
|
|
3562
|
-
position: ((
|
|
3563
|
-
alignment: ((
|
|
4034
|
+
return o.className = A(
|
|
4035
|
+
wt.root,
|
|
4036
|
+
this.isInline && Kt.root
|
|
4037
|
+
), o.setAttribute(p.popoverItemHtml, ""), o.setAttribute("data-blok-testid", "popover-item-html"), t.name && o.setAttribute("data-blok-item-name", t.name), o.appendChild(t.element), t.hint !== void 0 && ((n = e == null ? void 0 : e.hint) == null ? void 0 : n.enabled) !== !1 && this.addHint(o, D(L({}, t.hint), {
|
|
4038
|
+
position: ((r = e == null ? void 0 : e.hint) == null ? void 0 : r.position) || "right",
|
|
4039
|
+
alignment: ((i = e == null ? void 0 : e.hint) == null ? void 0 : i.alignment) || "center"
|
|
3564
4040
|
})), o;
|
|
3565
4041
|
}
|
|
3566
4042
|
}
|
|
3567
|
-
const
|
|
3568
|
-
wrapper: "bg-[#F8F8F8] border border-[rgba(226,226,229,0.20)] rounded p-0.5 grid grid-cols-[auto_auto_1fr] grid-rows-[auto]",
|
|
4043
|
+
const kt = {
|
|
4044
|
+
wrapper: "bg-[#F8F8F8] border border-[rgba(226,226,229,0.20)] rounded-sm p-0.5 grid grid-cols-[auto_auto_1fr] grid-rows-[auto]",
|
|
3569
4045
|
icon: "w-toolbox-btn h-toolbox-btn flex items-center justify-center mr-2 [&_svg]:w-icon [&_svg]:h-icon [&_svg]:text-gray-text",
|
|
3570
|
-
input: "text-sm outline-
|
|
3571
|
-
},
|
|
3572
|
-
var
|
|
3573
|
-
const e = t.toLowerCase(), o = (a = (
|
|
3574
|
-
return o.includes(e) ||
|
|
4046
|
+
input: "text-sm outline-hidden font-medium font-inherit border-0 bg-transparent m-0 p-0 leading-[22px] min-w-[calc(100%-(--spacing(6))-10px)] placeholder:text-gray-text placeholder:font-medium"
|
|
4047
|
+
}, re = (s, t) => {
|
|
4048
|
+
var i, a, l, c, d;
|
|
4049
|
+
const e = t.toLowerCase(), o = (a = (i = s.title) == null ? void 0 : i.toLowerCase()) != null ? a : "", n = (c = (l = s.englishTitle) == null ? void 0 : l.toLowerCase()) != null ? c : "", r = (d = s.searchTerms) != null ? d : [];
|
|
4050
|
+
return o.includes(e) || n.includes(e) || r.some((u) => u.toLowerCase().includes(e));
|
|
3575
4051
|
};
|
|
3576
|
-
var
|
|
3577
|
-
class
|
|
4052
|
+
var Lt = /* @__PURE__ */ ((s) => (s.Search = "search", s))(Lt || {});
|
|
4053
|
+
class vo extends ee {
|
|
3578
4054
|
/**
|
|
3579
4055
|
* @param options - available config
|
|
3580
4056
|
* @param options.items - searchable items list
|
|
@@ -3583,11 +4059,11 @@ class Te extends Bt {
|
|
|
3583
4059
|
constructor({ items: t, placeholder: e }) {
|
|
3584
4060
|
super(), this.searchQuery = "", this.handleValueChange = () => {
|
|
3585
4061
|
this.applySearch(this.input.value);
|
|
3586
|
-
}, this.listeners = new
|
|
3587
|
-
const o =
|
|
3588
|
-
innerHTML:
|
|
4062
|
+
}, this.listeners = new Qt(), this.items = t, this.wrapper = m.make("div", kt.wrapper), this.wrapper.setAttribute("data-blok-testid", "popover-search-field");
|
|
4063
|
+
const o = m.make("div", kt.icon, {
|
|
4064
|
+
innerHTML: po
|
|
3589
4065
|
});
|
|
3590
|
-
this.input =
|
|
4066
|
+
this.input = m.make("input", kt.input, {
|
|
3591
4067
|
type: "search",
|
|
3592
4068
|
placeholder: e,
|
|
3593
4069
|
/**
|
|
@@ -3596,8 +4072,8 @@ class Te extends Bt {
|
|
|
3596
4072
|
* so Tab in the last block will focus this hidden input if this property is not set)
|
|
3597
4073
|
*/
|
|
3598
4074
|
tabIndex: -1
|
|
3599
|
-
}), this.input.setAttribute("data-blok-flipper-navigation-target", "true"), this.input.setAttribute("data-blok-testid", "popover-search-input"), this.wrapper.appendChild(o), this.wrapper.appendChild(this.input), this.overrideValueProperty(), ["input", "keyup", "search", "change"].forEach((
|
|
3600
|
-
this.listeners.on(this.input,
|
|
4075
|
+
}), this.input.setAttribute("data-blok-flipper-navigation-target", "true"), this.input.setAttribute("data-blok-testid", "popover-search-input"), this.wrapper.appendChild(o), this.wrapper.appendChild(this.input), this.overrideValueProperty(), ["input", "keyup", "search", "change"].forEach((r) => {
|
|
4076
|
+
this.listeners.on(this.input, r, this.handleValueChange);
|
|
3601
4077
|
});
|
|
3602
4078
|
}
|
|
3603
4079
|
/**
|
|
@@ -3623,7 +4099,7 @@ class Te extends Bt {
|
|
|
3623
4099
|
* @param query - search query to apply
|
|
3624
4100
|
*/
|
|
3625
4101
|
applySearch(t) {
|
|
3626
|
-
this.searchQuery !== t && (this.searchQuery = t, this.emit(
|
|
4102
|
+
this.searchQuery !== t && (this.searchQuery = t, this.emit(Lt.Search, {
|
|
3627
4103
|
query: t,
|
|
3628
4104
|
items: this.foundItems
|
|
3629
4105
|
}));
|
|
@@ -3632,20 +4108,20 @@ class Te extends Bt {
|
|
|
3632
4108
|
* Overrides value property setter to catch programmatic changes
|
|
3633
4109
|
*/
|
|
3634
4110
|
overrideValueProperty() {
|
|
3635
|
-
var
|
|
4111
|
+
var i, a;
|
|
3636
4112
|
const t = Object.getPrototypeOf(this.input), e = Object.getOwnPropertyDescriptor(t, "value");
|
|
3637
4113
|
if ((e == null ? void 0 : e.set) === void 0 || e.get === void 0)
|
|
3638
4114
|
return;
|
|
3639
|
-
const o = this.applySearch.bind(this),
|
|
4115
|
+
const o = this.applySearch.bind(this), n = e.get, r = e.set;
|
|
3640
4116
|
Object.defineProperty(this.input, "value", {
|
|
3641
|
-
configurable: (
|
|
4117
|
+
configurable: (i = e.configurable) != null ? i : !0,
|
|
3642
4118
|
enumerable: (a = e.enumerable) != null ? a : !1,
|
|
3643
4119
|
get() {
|
|
3644
|
-
const
|
|
3645
|
-
return typeof
|
|
4120
|
+
const l = n == null ? void 0 : n.call(this);
|
|
4121
|
+
return typeof l == "string" ? l : "";
|
|
3646
4122
|
},
|
|
3647
|
-
set(
|
|
3648
|
-
|
|
4123
|
+
set(l) {
|
|
4124
|
+
r == null || r.call(this, l), o(l);
|
|
3649
4125
|
}
|
|
3650
4126
|
});
|
|
3651
4127
|
}
|
|
@@ -3666,10 +4142,10 @@ class Te extends Bt {
|
|
|
3666
4142
|
* @param item - item to be checked
|
|
3667
4143
|
*/
|
|
3668
4144
|
checkItem(t) {
|
|
3669
|
-
return
|
|
4145
|
+
return re(t, this.searchQuery);
|
|
3670
4146
|
}
|
|
3671
4147
|
}
|
|
3672
|
-
const
|
|
4148
|
+
const N = class N {
|
|
3673
4149
|
constructor() {
|
|
3674
4150
|
this.stack = [], this.boundPointerDown = null;
|
|
3675
4151
|
}
|
|
@@ -3677,7 +4153,7 @@ const k = class k {
|
|
|
3677
4153
|
* Returns the singleton instance, creating it if necessary
|
|
3678
4154
|
*/
|
|
3679
4155
|
static get instance() {
|
|
3680
|
-
return
|
|
4156
|
+
return N._instance === null && (N._instance = new N()), N._instance;
|
|
3681
4157
|
}
|
|
3682
4158
|
/**
|
|
3683
4159
|
* Resets the singleton for testing purposes.
|
|
@@ -3685,7 +4161,7 @@ const k = class k {
|
|
|
3685
4161
|
*/
|
|
3686
4162
|
static resetForTests() {
|
|
3687
4163
|
var t;
|
|
3688
|
-
return (t =
|
|
4164
|
+
return (t = N._instance) == null || t.destroy(), N._instance = new N(), N._instance;
|
|
3689
4165
|
}
|
|
3690
4166
|
/**
|
|
3691
4167
|
* Registers a popover with mutual exclusion.
|
|
@@ -3695,8 +4171,8 @@ const k = class k {
|
|
|
3695
4171
|
*/
|
|
3696
4172
|
register(t, e) {
|
|
3697
4173
|
const o = [...this.stack];
|
|
3698
|
-
for (const
|
|
3699
|
-
|
|
4174
|
+
for (const n of o)
|
|
4175
|
+
n.popover !== t && (n.popover.hide(), this.removeFromStack(n.popover));
|
|
3700
4176
|
this.stack.push({ popover: t, triggerElement: e }), this.ensureDocumentListener();
|
|
3701
4177
|
}
|
|
3702
4178
|
/**
|
|
@@ -3739,13 +4215,13 @@ const k = class k {
|
|
|
3739
4215
|
if (!(e instanceof Node))
|
|
3740
4216
|
return;
|
|
3741
4217
|
const o = [];
|
|
3742
|
-
for (const
|
|
3743
|
-
if (
|
|
4218
|
+
for (const n of [...this.stack].reverse()) {
|
|
4219
|
+
if (n.popover.hasNode(e) || n.triggerElement.contains(e))
|
|
3744
4220
|
break;
|
|
3745
|
-
o.push(
|
|
4221
|
+
o.push(n);
|
|
3746
4222
|
}
|
|
3747
|
-
for (const
|
|
3748
|
-
|
|
4223
|
+
for (const n of o)
|
|
4224
|
+
n.popover.hide();
|
|
3749
4225
|
}
|
|
3750
4226
|
/**
|
|
3751
4227
|
* Lazily adds the pointerdown listener to the document when there are entries in the stack
|
|
@@ -3768,27 +4244,27 @@ const k = class k {
|
|
|
3768
4244
|
e !== -1 && this.stack.splice(e, 1);
|
|
3769
4245
|
}
|
|
3770
4246
|
};
|
|
3771
|
-
|
|
3772
|
-
let
|
|
3773
|
-
const
|
|
4247
|
+
N._instance = null;
|
|
4248
|
+
let dt = N;
|
|
4249
|
+
const ot = {
|
|
3774
4250
|
// Popover container - base styles
|
|
3775
|
-
popoverContainer: "absolute flex flex-col overflow-hidden box-border opacity-0 pointer-events-none p-0 border-none z-
|
|
4251
|
+
popoverContainer: "absolute flex flex-col overflow-hidden box-border opacity-0 pointer-events-none p-0 border-none z-4 max-h-0 min-w-(--width) w-(--width) rounded-lg shadow-[0_3px_15px_-3px_var(--color-popover-shadow)] left-(--popover-left) top-(--popover-top) bg-popover-bg",
|
|
3776
4252
|
// Popover container - mobile styles (applied conditionally)
|
|
3777
4253
|
// Reset left/top from base class since inset shorthand may not properly override them in twMerge
|
|
3778
4254
|
popoverContainerMobile: "fixed max-w-none rounded-[10px] min-w-[calc(100%-var(--offset)*2)] left-auto top-auto inset-[auto_var(--offset)_calc(var(--offset)+env(safe-area-inset-bottom))_var(--offset)]",
|
|
3779
4255
|
// Popover container - opened state
|
|
3780
|
-
popoverContainerOpened: "opacity-100 pointer-events-auto p-1 max-h-
|
|
4256
|
+
popoverContainerOpened: "opacity-100 pointer-events-auto p-1 max-h-(--max-height) border border-popover-border animate-[panelShowing_100ms_ease]",
|
|
3781
4257
|
// Popover overlay
|
|
3782
4258
|
popoverOverlay: "hidden bg-dark",
|
|
3783
4259
|
items: "overflow-y-auto overscroll-contain"
|
|
3784
|
-
},
|
|
4260
|
+
}, Hn = {
|
|
3785
4261
|
// Popover root element for inline
|
|
3786
4262
|
popover: "relative",
|
|
3787
4263
|
// Container for inline popover
|
|
3788
4264
|
popoverContainer: "flex-row top-0 min-w-max w-max p-1 mobile:absolute"
|
|
3789
|
-
},
|
|
3790
|
-
var
|
|
3791
|
-
class
|
|
4265
|
+
}, Fn = (s) => `level-${s}`;
|
|
4266
|
+
var O = /* @__PURE__ */ ((s) => (s.NestingLevel = "--nesting-level", s.PopoverHeight = "--popover-height", s.InlinePopoverWidth = "--inline-popover-width", s.PopoverTop = "--popover-top", s.PopoverLeft = "--popover-left", s.TriggerItemLeft = "--trigger-item-left", s.TriggerItemTop = "--trigger-item-top", s))(O || {}), Z = /* @__PURE__ */ ((s) => (s.Closed = "closed", s.ClosedOnActivate = "closed-on-activate", s))(Z || {});
|
|
4267
|
+
class bo extends ee {
|
|
3792
4268
|
/**
|
|
3793
4269
|
* Constructs the instance
|
|
3794
4270
|
* @param params - popover construction params
|
|
@@ -3796,16 +4272,16 @@ class Ie extends Bt {
|
|
|
3796
4272
|
* The parameters that are not set by user via popover api but rather depend on technical implementation
|
|
3797
4273
|
*/
|
|
3798
4274
|
constructor(t, e = {}) {
|
|
3799
|
-
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new
|
|
4275
|
+
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new Qt(), this.messages = {
|
|
3800
4276
|
nothingFound: "Nothing found",
|
|
3801
4277
|
search: "Search"
|
|
3802
|
-
}, this.items = this.buildItems(t.items), t.messages && (this.messages =
|
|
4278
|
+
}, this.permanentlyHiddenNames = /* @__PURE__ */ new Set(), this.items = this.buildItems(t.items), t.messages && (this.messages = L(L({}, this.messages), t.messages)), this.nodes = this.createPopoverDOM(), this.appendItemElements(), this.nodes.popoverContainer && this.listeners.on(this.nodes.popoverContainer, "click", (o) => this.handleClick(o));
|
|
3803
4279
|
}
|
|
3804
4280
|
/**
|
|
3805
4281
|
* List of default popover items that are searchable and may have confirmation state
|
|
3806
4282
|
*/
|
|
3807
4283
|
get itemsDefault() {
|
|
3808
|
-
return this.items.filter((t) => t instanceof
|
|
4284
|
+
return this.items.filter((t) => t instanceof B);
|
|
3809
4285
|
}
|
|
3810
4286
|
/**
|
|
3811
4287
|
* Returns HTML element corresponding to the popover
|
|
@@ -3823,17 +4299,20 @@ class Ie extends Bt {
|
|
|
3823
4299
|
* Open popover
|
|
3824
4300
|
*/
|
|
3825
4301
|
show() {
|
|
3826
|
-
var
|
|
4302
|
+
var n;
|
|
3827
4303
|
const t = this.nodes.popover;
|
|
3828
|
-
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(
|
|
4304
|
+
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(p.popoverOpened, "true"), this.nodes.popoverContainer.className = A(
|
|
4305
|
+
this.nodes.popoverContainer.className,
|
|
4306
|
+
ot.popoverContainerOpened
|
|
4307
|
+
), this.itemsDefault.forEach((r) => this.refreshItemActiveState(r)), this.search !== void 0 && this.search.focus();
|
|
3829
4308
|
const { trigger: e } = this.params;
|
|
3830
|
-
((
|
|
4309
|
+
((n = this.params.nestingLevel) != null ? n : 0) === 0 && e !== void 0 && dt.instance.register(this, e);
|
|
3831
4310
|
}
|
|
3832
4311
|
/**
|
|
3833
4312
|
* Closes popover
|
|
3834
4313
|
*/
|
|
3835
4314
|
hide() {
|
|
3836
|
-
this.nodes.popover.removeAttribute(
|
|
4315
|
+
this.nodes.popover.removeAttribute(p.popoverOpened), this.nodes.popover.removeAttribute(p.popoverOpenTop), this.nodes.popover.removeAttribute(p.popoverOpenLeft), this.nodes.popoverContainer.className = ot.popoverContainer, this.itemsDefault.forEach((t) => t.reset()), this.search !== void 0 && this.search.clear(), dt.instance.unregister(this), this.emit(Z.Closed);
|
|
3837
4316
|
}
|
|
3838
4317
|
/**
|
|
3839
4318
|
* Clears memory
|
|
@@ -3855,7 +4334,15 @@ class Ie extends Bt {
|
|
|
3855
4334
|
* @param isHidden - true to hide, false to show
|
|
3856
4335
|
*/
|
|
3857
4336
|
toggleItemHiddenByName(t, e) {
|
|
3858
|
-
this.items.filter((o) => o.name === t).forEach((o) => o.toggleHidden(e));
|
|
4337
|
+
this.items.filter((o) => o.name === t).forEach((o) => o.toggleHidden(e)), e ? this.permanentlyHiddenNames.add(t) : this.permanentlyHiddenNames.delete(t);
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Returns true if the given item name was explicitly hidden via toggleItemHiddenByName.
|
|
4341
|
+
* Used by subclasses to prevent filter logic from un-hiding restricted items.
|
|
4342
|
+
* @param name - item name to check
|
|
4343
|
+
*/
|
|
4344
|
+
isNamePermanentlyHidden(t) {
|
|
4345
|
+
return this.permanentlyHiddenNames.has(t);
|
|
3859
4346
|
}
|
|
3860
4347
|
/**
|
|
3861
4348
|
* Looks for the item by name and imitates click on it
|
|
@@ -3872,13 +4359,13 @@ class Ie extends Bt {
|
|
|
3872
4359
|
buildItems(t) {
|
|
3873
4360
|
return t.map((e) => {
|
|
3874
4361
|
switch (e.type) {
|
|
3875
|
-
case
|
|
3876
|
-
return new
|
|
3877
|
-
case
|
|
3878
|
-
return new
|
|
3879
|
-
case
|
|
4362
|
+
case _.Separator:
|
|
4363
|
+
return new se(this.itemsRenderParams[_.Separator]);
|
|
4364
|
+
case _.Html:
|
|
4365
|
+
return new ct(e, this.itemsRenderParams[_.Html]);
|
|
4366
|
+
case _.Default:
|
|
3880
4367
|
case void 0:
|
|
3881
|
-
return new
|
|
4368
|
+
return new B(e, this.itemsRenderParams[_.Default]);
|
|
3882
4369
|
}
|
|
3883
4370
|
});
|
|
3884
4371
|
}
|
|
@@ -3887,7 +4374,7 @@ class Ie extends Bt {
|
|
|
3887
4374
|
* @param event - event to retrieve popover item from
|
|
3888
4375
|
*/
|
|
3889
4376
|
getTargetItem(t) {
|
|
3890
|
-
return this.items.filter((e) => e instanceof
|
|
4377
|
+
return this.items.filter((e) => e instanceof B || e instanceof ct).find((e) => {
|
|
3891
4378
|
const o = e.getElement();
|
|
3892
4379
|
return o === null ? !1 : t.composedPath().includes(o);
|
|
3893
4380
|
});
|
|
@@ -3897,12 +4384,12 @@ class Ie extends Bt {
|
|
|
3897
4384
|
* @param item - item to handle click of
|
|
3898
4385
|
*/
|
|
3899
4386
|
handleItemClick(t) {
|
|
3900
|
-
if (!(t instanceof
|
|
4387
|
+
if (!(t instanceof B && t.isDisabled)) {
|
|
3901
4388
|
if (t.hasChildren) {
|
|
3902
4389
|
this.showNestedItems(t), this.callHandleClickIfPresent(t);
|
|
3903
4390
|
return;
|
|
3904
4391
|
}
|
|
3905
|
-
this.itemsDefault.filter((e) => e !== t).forEach((e) => e.reset()), this.callHandleClickIfPresent(t), this.toggleItemActivenessIfNeeded(t), this.refreshItemActiveState(t), t.closeOnActivate === !0 && (this.hide(), this.emit(
|
|
4392
|
+
this.itemsDefault.filter((e) => e !== t).forEach((e) => e.reset()), this.callHandleClickIfPresent(t), this.toggleItemActivenessIfNeeded(t), this.refreshItemActiveState(t), t.closeOnActivate === !0 && (this.hide(), this.emit(Z.ClosedOnActivate));
|
|
3906
4393
|
}
|
|
3907
4394
|
}
|
|
3908
4395
|
/**
|
|
@@ -3921,7 +4408,7 @@ class Ie extends Bt {
|
|
|
3921
4408
|
* @param clickedItem - popover item that was clicked
|
|
3922
4409
|
*/
|
|
3923
4410
|
toggleItemActivenessIfNeeded(t) {
|
|
3924
|
-
if (!(t instanceof
|
|
4411
|
+
if (!(t instanceof B) || (t.toggle === !0 && t.toggleActive(), typeof t.toggle != "string"))
|
|
3925
4412
|
return;
|
|
3926
4413
|
const e = this.itemsDefault.filter((o) => o.toggle === t.toggle);
|
|
3927
4414
|
if (e.length === 1) {
|
|
@@ -3938,7 +4425,7 @@ class Ie extends Bt {
|
|
|
3938
4425
|
* @param item - popover item to refresh
|
|
3939
4426
|
*/
|
|
3940
4427
|
refreshItemActiveState(t) {
|
|
3941
|
-
t instanceof
|
|
4428
|
+
t instanceof B && t.toggle === void 0 && t.toggleActive(t.isActive);
|
|
3942
4429
|
}
|
|
3943
4430
|
/**
|
|
3944
4431
|
* Executes handleClick if it is present on item.
|
|
@@ -3952,21 +4439,21 @@ class Ie extends Bt {
|
|
|
3952
4439
|
* @param isDisplayed - true if the message should be displayed
|
|
3953
4440
|
*/
|
|
3954
4441
|
toggleNothingFoundMessage(t) {
|
|
3955
|
-
t ? (this.nodes.nothingFoundMessage.classList.remove("hidden"), this.nodes.nothingFoundMessage.setAttribute(
|
|
4442
|
+
t ? (this.nodes.nothingFoundMessage.classList.remove("hidden"), this.nodes.nothingFoundMessage.setAttribute(p.nothingFoundDisplayed, "true")) : (this.nodes.nothingFoundMessage.classList.add("hidden"), this.nodes.nothingFoundMessage.removeAttribute(p.nothingFoundDisplayed));
|
|
3956
4443
|
}
|
|
3957
4444
|
/**
|
|
3958
4445
|
* Sets the open-top state for the popover
|
|
3959
4446
|
* @param openTop - true if popover should open above trigger
|
|
3960
4447
|
*/
|
|
3961
4448
|
setOpenTop(t) {
|
|
3962
|
-
t ? this.nodes.popover.setAttribute(
|
|
4449
|
+
t ? this.nodes.popover.setAttribute(p.popoverOpenTop, "true") : this.nodes.popover.removeAttribute(p.popoverOpenTop);
|
|
3963
4450
|
}
|
|
3964
4451
|
/**
|
|
3965
4452
|
* Sets the open-left state for the popover
|
|
3966
4453
|
* @param openLeft - true if popover should open to the left
|
|
3967
4454
|
*/
|
|
3968
4455
|
setOpenLeft(t) {
|
|
3969
|
-
t ? this.nodes.popover.setAttribute(
|
|
4456
|
+
t ? this.nodes.popover.setAttribute(p.popoverOpenLeft, "true") : this.nodes.popover.removeAttribute(p.popoverOpenLeft);
|
|
3970
4457
|
}
|
|
3971
4458
|
/**
|
|
3972
4459
|
* Checks if popover contains the node
|
|
@@ -3980,22 +4467,22 @@ class Ie extends Bt {
|
|
|
3980
4467
|
* @returns PopoverNodes object with all required elements
|
|
3981
4468
|
*/
|
|
3982
4469
|
createPopoverDOM() {
|
|
3983
|
-
var
|
|
4470
|
+
var r, i;
|
|
3984
4471
|
const t = document.createElement("div");
|
|
3985
|
-
this.params.class && (t.className = this.params.class), t.setAttribute(
|
|
4472
|
+
this.params.class && (t.className = this.params.class), t.setAttribute(p.popover, ""), this.params.class && t.setAttribute("data-blok-popover-custom-class", this.params.class), t.setAttribute("data-blok-testid", "popover"), t.style.setProperty("--width", (r = this.params.width) != null ? r : "auto"), t.style.setProperty("--item-padding", "3px"), t.style.setProperty("--item-height", "calc(1.25rem + 2 * var(--item-padding))"), t.style.setProperty("--popover-top", "calc(100% + 0.5rem)"), t.style.setProperty("--popover-left", "0"), t.style.setProperty("--nested-popover-overlap", "0.25rem");
|
|
3986
4473
|
const e = document.createElement("div");
|
|
3987
|
-
e.className =
|
|
4474
|
+
e.className = ot.popoverContainer, e.setAttribute(p.popoverContainer, ""), e.setAttribute("data-blok-testid", "popover-container");
|
|
3988
4475
|
const o = document.createElement("div");
|
|
3989
|
-
o.className =
|
|
4476
|
+
o.className = A(
|
|
3990
4477
|
"cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text p-[3px]",
|
|
3991
4478
|
"hidden"
|
|
3992
|
-
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (
|
|
3993
|
-
const
|
|
3994
|
-
return
|
|
4479
|
+
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (i = this.messages.nothingFound) != null ? i : "Nothing found";
|
|
4480
|
+
const n = document.createElement("div");
|
|
4481
|
+
return n.className = ot.items, n.setAttribute(p.popoverItems, ""), n.setAttribute("data-blok-testid", "popover-items"), e.appendChild(o), e.appendChild(n), t.appendChild(e), {
|
|
3995
4482
|
popover: t,
|
|
3996
4483
|
popoverContainer: e,
|
|
3997
4484
|
nothingFoundMessage: o,
|
|
3998
|
-
items:
|
|
4485
|
+
items: n
|
|
3999
4486
|
};
|
|
4000
4487
|
}
|
|
4001
4488
|
/**
|
|
@@ -4003,13 +4490,13 @@ class Ie extends Bt {
|
|
|
4003
4490
|
*/
|
|
4004
4491
|
appendItemElements() {
|
|
4005
4492
|
this.items.forEach((t) => {
|
|
4006
|
-
var o,
|
|
4007
|
-
const e = (
|
|
4008
|
-
e !== null && ((
|
|
4493
|
+
var o, n, r;
|
|
4494
|
+
const e = (n = (o = t.getMountElement) == null ? void 0 : o.call(t)) != null ? n : t.getElement();
|
|
4495
|
+
e !== null && ((r = this.nodes.items) == null || r.appendChild(e));
|
|
4009
4496
|
});
|
|
4010
4497
|
}
|
|
4011
4498
|
}
|
|
4012
|
-
class
|
|
4499
|
+
class ie extends bo {
|
|
4013
4500
|
/**
|
|
4014
4501
|
* Construct the instance
|
|
4015
4502
|
* @param params - popover params
|
|
@@ -4017,39 +4504,39 @@ class Ht extends Ie {
|
|
|
4017
4504
|
* The parameters that are not set by user via popover api but rather depend on technical implementation
|
|
4018
4505
|
*/
|
|
4019
4506
|
constructor(t, e) {
|
|
4020
|
-
var
|
|
4507
|
+
var n;
|
|
4021
4508
|
if (super(t, e), this.nestingLevel = 0, this.nestedPopoverTriggerItem = null, this.previouslyHoveredItem = null, this.scopeElement = document.body, this.hide = () => {
|
|
4022
|
-
var
|
|
4023
|
-
super.hide(), this.destroyNestedPopoverIfExists(), (
|
|
4509
|
+
var r;
|
|
4510
|
+
super.hide(), this.destroyNestedPopoverIfExists(), (r = this.flipper) == null || r.deactivate(), this.previouslyHoveredItem = null;
|
|
4024
4511
|
}, this.onFlip = () => {
|
|
4025
|
-
const
|
|
4026
|
-
|
|
4027
|
-
}, this.onSearch = (
|
|
4028
|
-
var
|
|
4029
|
-
const
|
|
4512
|
+
const r = this.itemsDefault.find((i) => i.isFocused);
|
|
4513
|
+
r == null || r.onFocus();
|
|
4514
|
+
}, this.onSearch = (r) => {
|
|
4515
|
+
var d;
|
|
4516
|
+
const i = r.query === "", a = r.items.length === 0, l = r.items;
|
|
4030
4517
|
this.items.forEach((u) => {
|
|
4031
|
-
const
|
|
4032
|
-
u.toggleHidden(
|
|
4518
|
+
const h = u instanceof B, g = u instanceof se || u instanceof ct, f = h ? !l.includes(u) || u.name !== void 0 && this.isNamePermanentlyHidden(u.name) : g && (a || !i);
|
|
4519
|
+
u.toggleHidden(f);
|
|
4033
4520
|
}), this.toggleNothingFoundMessage(a);
|
|
4034
|
-
const
|
|
4035
|
-
(
|
|
4036
|
-
}, t.trigger && (this.trigger = t.trigger), t.nestingLevel !== void 0 && (this.nestingLevel = t.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.setAttribute(
|
|
4521
|
+
const c = i ? this.flippableElements : r.items.map((u) => u.getElement());
|
|
4522
|
+
(d = this.flipper) != null && d.isActivated && (this.flipper.deactivate(), this.flipper.activate(c), c.length > 0 && this.flipper.focusItem(0, { skipNextTab: !0 }));
|
|
4523
|
+
}, t.trigger && (this.trigger = t.trigger), t.nestingLevel !== void 0 && (this.nestingLevel = t.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.setAttribute(p.nested, "true"), t.scopeElement !== void 0 && (this.scopeElement = t.scopeElement), this.nodes.popoverContainer !== null && this.listeners.on(this.nodes.popoverContainer, "mouseover", (r) => this.handleHover(r)), t.searchable && this.addSearch(), t.flippable === !1)
|
|
4037
4524
|
return;
|
|
4038
4525
|
const o = t.flipper;
|
|
4039
|
-
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new
|
|
4526
|
+
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new at({
|
|
4040
4527
|
items: this.flippableElements,
|
|
4041
|
-
focusedItemClass:
|
|
4528
|
+
focusedItemClass: X.focused,
|
|
4042
4529
|
allowedKeys: [
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4530
|
+
v.TAB,
|
|
4531
|
+
v.UP,
|
|
4532
|
+
v.DOWN,
|
|
4533
|
+
v.ENTER,
|
|
4534
|
+
v.RIGHT,
|
|
4535
|
+
v.LEFT
|
|
4049
4536
|
],
|
|
4050
4537
|
onArrowLeft: t.onNavigateBack,
|
|
4051
4538
|
handleContentEditableTargets: t.handleContentEditableNavigation
|
|
4052
|
-
}), (
|
|
4539
|
+
}), (n = this.flipper) == null || n.onFlip(this.onFlip);
|
|
4053
4540
|
}
|
|
4054
4541
|
/**
|
|
4055
4542
|
* Returns true if some item inside popover is focused
|
|
@@ -4057,6 +4544,15 @@ class Ht extends Ie {
|
|
|
4057
4544
|
hasFocus() {
|
|
4058
4545
|
return this.flipper === void 0 ? !1 : this.flipper.hasFocus();
|
|
4059
4546
|
}
|
|
4547
|
+
/**
|
|
4548
|
+
* Toggles hidden state of all items matching the given name.
|
|
4549
|
+
* Invalidates the cached size so the next access re-measures the popover.
|
|
4550
|
+
* @param name - name of the items to toggle
|
|
4551
|
+
* @param isHidden - true to hide, false to show
|
|
4552
|
+
*/
|
|
4553
|
+
toggleItemHiddenByName(t, e) {
|
|
4554
|
+
super.toggleItemHiddenByName(t, e), this._size = void 0;
|
|
4555
|
+
}
|
|
4060
4556
|
/**
|
|
4061
4557
|
* Scroll position inside items container of the popover
|
|
4062
4558
|
*/
|
|
@@ -4076,10 +4572,10 @@ class Ht extends Ie {
|
|
|
4076
4572
|
var e;
|
|
4077
4573
|
const t = this.getMountElement();
|
|
4078
4574
|
if (this.trigger && t && document.body.appendChild(t), this.trigger) {
|
|
4079
|
-
const { top: o, left:
|
|
4080
|
-
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${
|
|
4575
|
+
const { top: o, left: n } = this.calculatePosition();
|
|
4576
|
+
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${n}px`, this.nodes.popover.style.setProperty(O.PopoverTop, "0px"), this.nodes.popover.style.setProperty(O.PopoverLeft, "0px");
|
|
4081
4577
|
}
|
|
4082
|
-
this.nodes.popover.style.setProperty(
|
|
4578
|
+
this.nodes.popover.style.setProperty(O.PopoverHeight, this.size.height + "px"), !this.trigger && !this.shouldOpenBottom && (this.setOpenTop(!0), this.nodes.popover.style.setProperty(O.PopoverTop, "calc(-1 * (0.5rem + var(--popover-height)))")), !this.trigger && !this.shouldOpenRight && (this.setOpenLeft(!0), this.nodes.popover.style.setProperty(O.PopoverLeft, "calc(-1 * var(--width) + 100%)")), super.show(), (e = this.flipper) == null || e.activate(this.flippableElements), requestAnimationFrame(() => {
|
|
4083
4579
|
this.focusInitialElement();
|
|
4084
4580
|
});
|
|
4085
4581
|
}
|
|
@@ -4111,16 +4607,16 @@ class Ht extends Ie {
|
|
|
4111
4607
|
* Calculates position for the popover
|
|
4112
4608
|
*/
|
|
4113
4609
|
calculatePosition() {
|
|
4114
|
-
var
|
|
4115
|
-
const t = (
|
|
4610
|
+
var h, g;
|
|
4611
|
+
const t = (g = this.params.position) != null ? g : (h = this.trigger) == null ? void 0 : h.getBoundingClientRect();
|
|
4116
4612
|
if (!t)
|
|
4117
4613
|
return {
|
|
4118
4614
|
top: 0,
|
|
4119
4615
|
left: 0
|
|
4120
4616
|
};
|
|
4121
|
-
const e = this.size, o = window.innerWidth,
|
|
4617
|
+
const e = this.size, o = window.innerWidth, n = window.innerHeight, r = 8, i = t.bottom + r + window.scrollY, l = t.bottom + r + e.height > n + window.scrollY && t.top - r - e.height > window.scrollY ? t.top - r - e.height + window.scrollY : i, c = t.left + window.scrollX, u = c + e.width > o + window.scrollX ? Math.max(0, t.right - e.width + window.scrollX) : c;
|
|
4122
4618
|
return {
|
|
4123
|
-
top:
|
|
4619
|
+
top: l,
|
|
4124
4620
|
left: u
|
|
4125
4621
|
};
|
|
4126
4622
|
}
|
|
@@ -4160,18 +4656,18 @@ class Ht extends Ie {
|
|
|
4160
4656
|
* @param item – item near which nested popover should be displayed
|
|
4161
4657
|
*/
|
|
4162
4658
|
setTriggerItemPosition(t, e) {
|
|
4163
|
-
const o = e.getElement(),
|
|
4164
|
-
(
|
|
4659
|
+
const o = e.getElement(), n = (o ? o.offsetTop : 0) - this.scrollTop, r = this.offsetTop + n, i = t.querySelector(`[${p.popover}]`);
|
|
4660
|
+
(i instanceof HTMLElement ? i : t).style.setProperty(O.TriggerItemTop, r + "px");
|
|
4165
4661
|
}
|
|
4166
4662
|
/**
|
|
4167
4663
|
* Destroys existing nested popover
|
|
4168
4664
|
*/
|
|
4169
4665
|
destroyNestedPopoverIfExists() {
|
|
4170
|
-
var o,
|
|
4666
|
+
var o, n, r;
|
|
4171
4667
|
if (this.nestedPopover === void 0 || this.nestedPopover === null)
|
|
4172
4668
|
return;
|
|
4173
4669
|
const t = (o = this.nestedPopoverTriggerItem) == null ? void 0 : o.getElement(), e = this.nestedPopover.getElement();
|
|
4174
|
-
this.nestedPopover.off(
|
|
4670
|
+
this.nestedPopover.off(Z.ClosedOnActivate, this.hide), this.nestedPopover.hide(), this.nestedPopover.destroy(), e.remove(), this.nestedPopover = null, (n = this.flipper) == null || n.activate(this.flippableElements), this.focusAfterNestedPopoverClose(t), (r = this.nestedPopoverTriggerItem) == null || r.onChildrenClose(), this.nestedPopoverTriggerItem = null;
|
|
4175
4671
|
}
|
|
4176
4672
|
/**
|
|
4177
4673
|
* Focuses the appropriate item after nested popover closes.
|
|
@@ -4197,9 +4693,9 @@ class Ht extends Ie {
|
|
|
4197
4693
|
* @param item - item to display nested popover by
|
|
4198
4694
|
*/
|
|
4199
4695
|
showNestedPopoverForItem(t) {
|
|
4200
|
-
var
|
|
4201
|
-
const e = (
|
|
4202
|
-
this.nestedPopover = new
|
|
4696
|
+
var r, i;
|
|
4697
|
+
const e = (r = this.flipper) == null ? void 0 : r.getHandleContentEditableTargets();
|
|
4698
|
+
this.nestedPopover = new ie({
|
|
4203
4699
|
searchable: t.isChildrenSearchable,
|
|
4204
4700
|
items: t.children,
|
|
4205
4701
|
nestingLevel: this.nestingLevel + 1,
|
|
@@ -4208,9 +4704,11 @@ class Ht extends Ie {
|
|
|
4208
4704
|
onNavigateBack: this.destroyNestedPopoverIfExists.bind(this),
|
|
4209
4705
|
width: t.childrenWidth,
|
|
4210
4706
|
handleContentEditableNavigation: e
|
|
4211
|
-
}), t.onChildrenOpen(), this.nestedPopover.on(
|
|
4212
|
-
const o = this.nestedPopover.getMountElement(),
|
|
4213
|
-
return this.nodes.popover.appendChild(o), this.setTriggerItemPosition(o, t),
|
|
4707
|
+
}), t.onChildrenOpen(), this.nestedPopover.on(Z.ClosedOnActivate, this.hide);
|
|
4708
|
+
const o = this.nestedPopover.getMountElement(), n = this.nestedPopover.getElement();
|
|
4709
|
+
return this.nodes.popover.appendChild(o), this.setTriggerItemPosition(o, t), n.style.setProperty(O.NestingLevel, this.nestedPopover.nestingLevel.toString()), this.applyNestedPopoverPositioning(o), this.listeners.on(o, "click", () => {
|
|
4710
|
+
this.nestedPopoverTriggerItem !== null && this.refreshItemActiveState(this.nestedPopoverTriggerItem);
|
|
4711
|
+
}), this.nestedPopover.show(), (i = this.flipper) == null || i.deactivate(), this.nestedPopover;
|
|
4214
4712
|
}
|
|
4215
4713
|
/**
|
|
4216
4714
|
* Applies positioning styles to nested popover container.
|
|
@@ -4218,13 +4716,13 @@ class Ht extends Ie {
|
|
|
4218
4716
|
* @param nestedPopoverEl - the nested popover element (mount element)
|
|
4219
4717
|
*/
|
|
4220
4718
|
applyNestedPopoverPositioning(t) {
|
|
4221
|
-
const e = t.querySelector(`[${
|
|
4719
|
+
const e = t.querySelector(`[${p.popoverContainer}]`);
|
|
4222
4720
|
if (!(e instanceof HTMLElement))
|
|
4223
4721
|
return;
|
|
4224
|
-
const o = e,
|
|
4722
|
+
const o = e, n = t.querySelector(`[${p.popover}]`), r = n instanceof HTMLElement ? n : t, i = this.nodes.popover.hasAttribute(p.popoverOpenTop), a = this.nodes.popover.hasAttribute(p.popoverOpenLeft);
|
|
4225
4723
|
o.style.position = "absolute";
|
|
4226
|
-
const
|
|
4227
|
-
a ?
|
|
4724
|
+
const l = this.params.width === void 0 || this.params.width === "auto" ? `${this.nodes.popoverContainer.offsetWidth}px` : "var(--width)";
|
|
4725
|
+
a ? r.style.setProperty(O.PopoverLeft, `calc(-1 * (var(--nesting-level) + 1) * ${l} + 100%)`) : r.style.setProperty(O.PopoverLeft, `calc(var(--nesting-level) * (${l} - var(--nested-popover-overlap)))`), i ? o.style.top = "calc(var(--trigger-item-top) - var(--popover-height) + var(--item-height) + 0.5rem + var(--nested-popover-overlap))" : o.style.top = "calc(var(--trigger-item-top) - var(--nested-popover-overlap))";
|
|
4228
4726
|
}
|
|
4229
4727
|
/**
|
|
4230
4728
|
* Checks if popover should be opened bottom.
|
|
@@ -4233,8 +4731,8 @@ class Ht extends Ie {
|
|
|
4233
4731
|
get shouldOpenBottom() {
|
|
4234
4732
|
if (this.nodes.popover === void 0 || this.nodes.popover === null)
|
|
4235
4733
|
return !1;
|
|
4236
|
-
const t = this.nodes.popoverContainer.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.height,
|
|
4237
|
-
return
|
|
4734
|
+
const t = this.nodes.popoverContainer.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.height, n = t.top + o, r = t.top - o, i = Math.min(window.innerHeight, e.bottom);
|
|
4735
|
+
return r < e.top || n <= i;
|
|
4238
4736
|
}
|
|
4239
4737
|
/**
|
|
4240
4738
|
* Checks if popover should be opened left.
|
|
@@ -4243,15 +4741,15 @@ class Ht extends Ie {
|
|
|
4243
4741
|
get shouldOpenRight() {
|
|
4244
4742
|
if (this.nodes.popover === void 0 || this.nodes.popover === null)
|
|
4245
4743
|
return !1;
|
|
4246
|
-
const t = this.nodes.popover.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.width,
|
|
4247
|
-
return
|
|
4744
|
+
const t = this.nodes.popover.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.width, n = t.right + o, r = t.left - o, i = Math.min(window.innerWidth, e.right);
|
|
4745
|
+
return r < e.left || n <= i;
|
|
4248
4746
|
}
|
|
4249
4747
|
/**
|
|
4250
4748
|
* Helps to calculate size of popover that is only resolved when popover is displayed on screen.
|
|
4251
4749
|
* Renders invisible clone of popover to get actual values.
|
|
4252
4750
|
*/
|
|
4253
4751
|
get size() {
|
|
4254
|
-
var
|
|
4752
|
+
var n;
|
|
4255
4753
|
if (this._size)
|
|
4256
4754
|
return this._size;
|
|
4257
4755
|
const t = {
|
|
@@ -4261,8 +4759,8 @@ class Ht extends Ie {
|
|
|
4261
4759
|
if (this.nodes.popover === null)
|
|
4262
4760
|
return t;
|
|
4263
4761
|
const e = this.nodes.popover.cloneNode(!0);
|
|
4264
|
-
e.style.visibility = "hidden", e.style.position = "absolute", e.style.top = "-1000px", e.setAttribute(
|
|
4265
|
-
const o = e.querySelector(`[${
|
|
4762
|
+
e.style.visibility = "hidden", e.style.position = "absolute", e.style.top = "-1000px", e.setAttribute(p.popoverOpened, "true"), (n = e.querySelector(`[${p.nested}]`)) == null || n.remove(), document.body.appendChild(e);
|
|
4763
|
+
const o = e.querySelector(`[${p.popoverContainer}]`);
|
|
4266
4764
|
return t.height = o.offsetHeight, t.width = o.offsetWidth, e.remove(), this._size = t, t;
|
|
4267
4765
|
}
|
|
4268
4766
|
/**
|
|
@@ -4277,11 +4775,11 @@ class Ht extends Ie {
|
|
|
4277
4775
|
* @returns array of HTML elements for keyboard navigation
|
|
4278
4776
|
*/
|
|
4279
4777
|
getFlippableElementsForItem(t) {
|
|
4280
|
-
if (t instanceof
|
|
4778
|
+
if (t instanceof ct) {
|
|
4281
4779
|
const o = t.getElement();
|
|
4282
4780
|
return o ? [o] : [];
|
|
4283
4781
|
}
|
|
4284
|
-
if (!(t instanceof
|
|
4782
|
+
if (!(t instanceof B))
|
|
4285
4783
|
return [];
|
|
4286
4784
|
if (t.isDisabled)
|
|
4287
4785
|
return [];
|
|
@@ -4292,10 +4790,10 @@ class Ht extends Ie {
|
|
|
4292
4790
|
* Adds search to the popover
|
|
4293
4791
|
*/
|
|
4294
4792
|
addSearch() {
|
|
4295
|
-
this.search = new
|
|
4793
|
+
this.search = new vo({
|
|
4296
4794
|
items: this.itemsDefault,
|
|
4297
4795
|
placeholder: this.messages.search
|
|
4298
|
-
}), this.search.on(
|
|
4796
|
+
}), this.search.on(Lt.Search, this.onSearch);
|
|
4299
4797
|
const t = this.search.getElement();
|
|
4300
4798
|
t.classList.add("mb-1.5"), this.nodes.popoverContainer.insertBefore(t, this.nodes.popoverContainer.firstChild);
|
|
4301
4799
|
}
|
|
@@ -4305,25 +4803,25 @@ class Ht extends Ie {
|
|
|
4305
4803
|
* @param query - search query text
|
|
4306
4804
|
*/
|
|
4307
4805
|
filterItems(t) {
|
|
4308
|
-
const e = this.itemsDefault.filter((o) =>
|
|
4806
|
+
const e = this.itemsDefault.filter((o) => re(o, t));
|
|
4309
4807
|
this.onSearch({
|
|
4310
4808
|
query: t,
|
|
4311
4809
|
items: e
|
|
4312
4810
|
});
|
|
4313
4811
|
}
|
|
4314
4812
|
}
|
|
4315
|
-
const
|
|
4316
|
-
const t =
|
|
4317
|
-
return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "4px",
|
|
4318
|
-
const o =
|
|
4319
|
-
if (
|
|
4320
|
-
const
|
|
4321
|
-
a.style.color = "white", o.appendChild(a), o.appendChild(document.createTextNode(
|
|
4813
|
+
const Pn = function(s) {
|
|
4814
|
+
const t = m.make("div");
|
|
4815
|
+
return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "4px", s.forEach((e) => {
|
|
4816
|
+
const o = m.make("div"), n = e.indexOf(" ");
|
|
4817
|
+
if (n > 0) {
|
|
4818
|
+
const r = e.substring(0, n), i = e.substring(n), a = m.make("span", null, { textContent: r });
|
|
4819
|
+
a.style.color = "white", o.appendChild(a), o.appendChild(document.createTextNode(i));
|
|
4322
4820
|
} else
|
|
4323
4821
|
o.appendChild(document.createTextNode(e));
|
|
4324
4822
|
t.appendChild(o);
|
|
4325
4823
|
}), t;
|
|
4326
|
-
},
|
|
4824
|
+
}, Ot = class Ot {
|
|
4327
4825
|
/**
|
|
4328
4826
|
* @param api - Blok API
|
|
4329
4827
|
*/
|
|
@@ -4337,31 +4835,31 @@ const Ro = function(n) {
|
|
|
4337
4835
|
* Returns tool's UI config
|
|
4338
4836
|
*/
|
|
4339
4837
|
async render() {
|
|
4340
|
-
const t =
|
|
4838
|
+
const t = oe.get();
|
|
4341
4839
|
if (t === null)
|
|
4342
4840
|
return [];
|
|
4343
4841
|
const e = this.blocksAPI.getBlockByElement(t.anchorNode);
|
|
4344
4842
|
if (e === void 0)
|
|
4345
4843
|
return [];
|
|
4346
|
-
const o = this.toolsAPI.getBlockTools(),
|
|
4347
|
-
if (
|
|
4844
|
+
const o = this.toolsAPI.getBlockTools(), n = await te(e, o);
|
|
4845
|
+
if (n.length === 0)
|
|
4348
4846
|
return [];
|
|
4349
|
-
const
|
|
4847
|
+
const r = n.reduce((c, d) => {
|
|
4350
4848
|
var u;
|
|
4351
|
-
return (u =
|
|
4352
|
-
var
|
|
4353
|
-
|
|
4354
|
-
icon:
|
|
4355
|
-
title:
|
|
4356
|
-
name: (
|
|
4849
|
+
return (u = d.toolbox) == null || u.forEach((h) => {
|
|
4850
|
+
var g;
|
|
4851
|
+
h.title !== void 0 && c.push({
|
|
4852
|
+
icon: h.icon,
|
|
4853
|
+
title: Ft(this.i18nInstance, h, d.name),
|
|
4854
|
+
name: (g = h.name) != null ? g : d.name,
|
|
4357
4855
|
closeOnActivate: !0,
|
|
4358
4856
|
onActivate: async () => {
|
|
4359
|
-
const
|
|
4360
|
-
this.caretAPI.setToBlock(
|
|
4857
|
+
const f = await this.blocksAPI.convert(e.id, d.name, h.data);
|
|
4858
|
+
this.caretAPI.setToBlock(f, "end");
|
|
4361
4859
|
}
|
|
4362
4860
|
});
|
|
4363
|
-
}),
|
|
4364
|
-
}, []),
|
|
4861
|
+
}), c;
|
|
4862
|
+
}, []), i = await e.getActiveToolboxEntry(), a = i ? Ft(this.i18nInstance, i, e.name) : Ae(this.i18nInstance, e.name, ke(e.name)), l = !we();
|
|
4365
4863
|
return {
|
|
4366
4864
|
name: "convert-to",
|
|
4367
4865
|
title: a,
|
|
@@ -4369,118 +4867,136 @@ const Ro = function(n) {
|
|
|
4369
4867
|
title: this.i18nAPI.t("popover.convertTo")
|
|
4370
4868
|
},
|
|
4371
4869
|
children: {
|
|
4372
|
-
items:
|
|
4870
|
+
items: r,
|
|
4373
4871
|
width: "auto",
|
|
4374
4872
|
onOpen: () => {
|
|
4375
|
-
|
|
4873
|
+
l && (this.selectionAPI.setFakeBackground(), this.selectionAPI.save());
|
|
4376
4874
|
},
|
|
4377
4875
|
onClose: () => {
|
|
4378
|
-
|
|
4876
|
+
l && (this.selectionAPI.restore(), this.selectionAPI.removeFakeBackground());
|
|
4379
4877
|
}
|
|
4380
4878
|
}
|
|
4381
4879
|
};
|
|
4382
4880
|
}
|
|
4383
4881
|
};
|
|
4384
|
-
|
|
4385
|
-
let
|
|
4882
|
+
Ot.isInline = !0;
|
|
4883
|
+
let qt = Ot;
|
|
4386
4884
|
export {
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4885
|
+
ct as $,
|
|
4886
|
+
T as A,
|
|
4887
|
+
Go as B,
|
|
4888
|
+
Yo as C,
|
|
4889
|
+
p as D,
|
|
4890
|
+
ee as E,
|
|
4891
|
+
at as F,
|
|
4892
|
+
st as G,
|
|
4893
|
+
ko as H,
|
|
4894
|
+
Vo as I,
|
|
4895
|
+
z as J,
|
|
4896
|
+
Fo as K,
|
|
4897
|
+
Qt as L,
|
|
4898
|
+
nn as M,
|
|
4899
|
+
Ao as N,
|
|
4900
|
+
Ko as O,
|
|
4901
|
+
_ as P,
|
|
4902
|
+
Io as Q,
|
|
4903
|
+
fe as R,
|
|
4904
|
+
oe as S,
|
|
4905
|
+
ie as T,
|
|
4906
|
+
we as U,
|
|
4907
|
+
X as V,
|
|
4908
|
+
Hn as W,
|
|
4909
|
+
ot as X,
|
|
4910
|
+
dt as Y,
|
|
4911
|
+
Z,
|
|
4912
|
+
B as _,
|
|
4913
|
+
m as a,
|
|
4914
|
+
O as a0,
|
|
4915
|
+
Fn as a1,
|
|
4916
|
+
pn as a2,
|
|
4917
|
+
bo as a3,
|
|
4918
|
+
jo as a4,
|
|
4919
|
+
te as a5,
|
|
4920
|
+
Ft as a6,
|
|
4921
|
+
dn as a7,
|
|
4922
|
+
Bn as a8,
|
|
4923
|
+
Oo as a9,
|
|
4924
|
+
bn as aA,
|
|
4925
|
+
wn as aB,
|
|
4926
|
+
En as aC,
|
|
4927
|
+
Tn as aD,
|
|
4928
|
+
xn as aE,
|
|
4929
|
+
ro as aF,
|
|
4930
|
+
Wt as aG,
|
|
4931
|
+
cn as aH,
|
|
4932
|
+
Mn as aI,
|
|
4933
|
+
sn as aJ,
|
|
4934
|
+
qo as aK,
|
|
4935
|
+
On as aL,
|
|
4936
|
+
Rn as aM,
|
|
4937
|
+
Ln as aN,
|
|
4938
|
+
Nn as aO,
|
|
4939
|
+
Sn as aP,
|
|
4940
|
+
An as aQ,
|
|
4941
|
+
Ho as aR,
|
|
4942
|
+
In as aS,
|
|
4943
|
+
Tt as aT,
|
|
4944
|
+
Qo as aU,
|
|
4945
|
+
tn as aV,
|
|
4946
|
+
en as aW,
|
|
4947
|
+
on as aX,
|
|
4948
|
+
rn as aY,
|
|
4949
|
+
an as aZ,
|
|
4950
|
+
ln as a_,
|
|
4951
|
+
Dt as aa,
|
|
4952
|
+
un as ab,
|
|
4953
|
+
ve as ac,
|
|
4954
|
+
Pn as ad,
|
|
4955
|
+
hn as ae,
|
|
4956
|
+
Ae as af,
|
|
4957
|
+
zo as ag,
|
|
4958
|
+
yn as ah,
|
|
4959
|
+
it as ai,
|
|
4960
|
+
To as aj,
|
|
4961
|
+
qt as ak,
|
|
4962
|
+
xo as al,
|
|
4963
|
+
Wo as am,
|
|
4964
|
+
Uo as an,
|
|
4965
|
+
Lo as ao,
|
|
4966
|
+
No as ap,
|
|
4967
|
+
Co as aq,
|
|
4968
|
+
ge as ar,
|
|
4969
|
+
yo as as,
|
|
4970
|
+
Zo as at,
|
|
4971
|
+
Cn as au,
|
|
4972
|
+
kn as av,
|
|
4973
|
+
fn as aw,
|
|
4974
|
+
gn as ax,
|
|
4975
|
+
mn as ay,
|
|
4976
|
+
vn as az,
|
|
4977
|
+
E as b,
|
|
4978
|
+
_o as c,
|
|
4979
|
+
Se as d,
|
|
4980
|
+
Bo as e,
|
|
4981
|
+
Po as f,
|
|
4982
|
+
Ro as g,
|
|
4983
|
+
$o as h,
|
|
4984
|
+
R as i,
|
|
4985
|
+
ke as j,
|
|
4986
|
+
Eo as k,
|
|
4987
|
+
rt as l,
|
|
4988
|
+
yt as m,
|
|
4989
|
+
no as n,
|
|
4990
|
+
so as o,
|
|
4991
|
+
xt as p,
|
|
4992
|
+
Mo as q,
|
|
4993
|
+
v as r,
|
|
4994
|
+
Jo as s,
|
|
4995
|
+
A as t,
|
|
4996
|
+
So as u,
|
|
4997
|
+
Do as v,
|
|
4998
|
+
me as w,
|
|
4999
|
+
Xo as x,
|
|
5000
|
+
Pt as y,
|
|
5001
|
+
P as z
|
|
4486
5002
|
};
|