@jackuait/blok 0.6.0-beta.9 → 0.7.0-beta.1
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-Bn6Q_o8h.mjs → blok-ob9Fwr1L.mjs} +3414 -2975
- package/dist/chunks/i18next-B47TKgbU.mjs +1303 -0
- package/dist/chunks/{i18next-loader-DjR4d8M7.mjs → i18next-loader-Bu3vFvye.mjs} +2 -2
- package/dist/chunks/{index-oe38cp86.mjs → index-CZmRzRIX.mjs} +12 -12
- package/dist/chunks/{inline-tool-convert-SRTkyaZn.mjs → inline-tool-convert-CvFW2iie.mjs} +1579 -961
- 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 +30 -27
- 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 +3537 -1710
- 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/constants/data-attributes.ts +7 -0
- 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 +61 -7
- 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/composers/markdownShortcuts.ts +54 -2
- package/src/components/modules/blockEvents/constants.ts +12 -0
- 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 +27 -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 +3 -3
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +15 -12
- package/src/components/utils/popover/components/search-input/search-input.const.ts +2 -2
- package/src/components/utils/popover/popover-abstract.ts +30 -5
- 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 +3 -3
- package/src/components/utils/sanitizer.ts +24 -3
- package/src/components/utils/tw.ts +17 -5
- package/src/full.ts +4 -0
- package/src/stories/Header.stories.ts +106 -0
- package/src/stories/MarkerColors.stories.ts +730 -0
- package/src/stories/Placeholder.stories.ts +7 -2
- package/src/stories/Popover.stories.ts +1 -3
- package/src/stories/Table.stories.ts +1662 -0
- package/src/stories/helpers.ts +2 -0
- package/src/styles/main.css +217 -39
- package/src/tools/header/index.ts +204 -26
- package/src/tools/index.ts +5 -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 +9 -5
- 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/tools/toggle/block-operations.ts +110 -0
- package/src/tools/toggle/constants.ts +49 -0
- package/src/tools/toggle/dom-builder.ts +125 -0
- package/src/tools/toggle/index.ts +280 -0
- package/src/tools/toggle/toggle-keyboard.ts +139 -0
- package/src/tools/toggle/toggle-lifecycle.ts +80 -0
- package/src/tools/toggle/toggle-shortcuts.ts +107 -0
- package/src/tools/toggle/types.ts +21 -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/full.d.ts +2 -0
- package/types/tools/table.d.ts +2 -0
- package/types/tools-entry.d.ts +2 -1
- 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 de = Object.defineProperty, he = Object.defineProperties;
|
|
2
|
+
var ue = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Rt = Object.getOwnPropertySymbols;
|
|
4
|
+
var pe = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Bt = (s, t, e) => t in s ? de(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, N = (s, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
|
|
7
|
+
pe.call(t, e) && Bt(s, e, t[e]);
|
|
8
|
+
if (Rt)
|
|
9
|
+
for (var e of Rt(t))
|
|
10
|
+
fe.call(t, e) && Bt(s, e, t[e]);
|
|
11
|
+
return s;
|
|
12
|
+
}, D = (s, t) => he(s, ue(t));
|
|
13
|
+
function ge(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
|
// ============================================
|
|
@@ -261,13 +264,18 @@ const d = {
|
|
|
261
264
|
/** Stub subtitle */
|
|
262
265
|
stubSubtitle: "data-blok-stub-subtitle",
|
|
263
266
|
// ============================================
|
|
267
|
+
// Slash Search
|
|
268
|
+
// ============================================
|
|
269
|
+
/** Slash search active on content editable */
|
|
270
|
+
slashSearch: "data-blok-slash-search",
|
|
271
|
+
// ============================================
|
|
264
272
|
// Testing
|
|
265
273
|
// ============================================
|
|
266
274
|
/** Test identifier (for E2E tests) */
|
|
267
275
|
testid: "data-blok-testid",
|
|
268
276
|
/** Force hover state (for tests/storybook) */
|
|
269
277
|
forceHover: "data-blok-force-hover"
|
|
270
|
-
},
|
|
278
|
+
}, st = (s, t) => t === void 0 ? `[${s}]` : `[${s}="${t}"]`, v = {
|
|
271
279
|
BACKSPACE: 8,
|
|
272
280
|
TAB: 9,
|
|
273
281
|
ENTER: 13,
|
|
@@ -276,16 +284,16 @@ const d = {
|
|
|
276
284
|
DOWN: 40,
|
|
277
285
|
RIGHT: 39,
|
|
278
286
|
DELETE: 46
|
|
279
|
-
},
|
|
287
|
+
}, Eo = {
|
|
280
288
|
LEFT: 0
|
|
281
|
-
},
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
289
|
+
}, xo = 650, me = () => "0.7.0-beta.1";
|
|
290
|
+
var ve = /* @__PURE__ */ ((s) => (s.VERBOSE = "VERBOSE", s.INFO = "INFO", s.WARN = "WARN", s.ERROR = "ERROR", s))(ve || {});
|
|
291
|
+
const Q = (s, t, e = "log", o, n = "color: inherit") => {
|
|
292
|
+
const r = typeof console == "undefined" ? void 0 : console;
|
|
293
|
+
if (!r || typeof r[e] != "function")
|
|
286
294
|
return;
|
|
287
|
-
const
|
|
288
|
-
switch (
|
|
295
|
+
const i = ["info", "log", "warn", "error"].includes(e), a = [];
|
|
296
|
+
switch (Q.logLevel) {
|
|
289
297
|
case "VERBOSE":
|
|
290
298
|
break;
|
|
291
299
|
case "ERROR":
|
|
@@ -297,12 +305,12 @@ const V = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
297
305
|
return;
|
|
298
306
|
break;
|
|
299
307
|
case "INFO":
|
|
300
|
-
if (!
|
|
308
|
+
if (!i || s)
|
|
301
309
|
return;
|
|
302
310
|
break;
|
|
303
311
|
}
|
|
304
312
|
o && a.push(o);
|
|
305
|
-
const
|
|
313
|
+
const l = `Blok ${me()}`, d = s ? i ? (a.unshift(`line-height: 1em;
|
|
306
314
|
color: #006FEA;
|
|
307
315
|
display: inline-block;
|
|
308
316
|
font-size: 11px;
|
|
@@ -311,164 +319,164 @@ const V = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
311
319
|
padding: 4px 9px;
|
|
312
320
|
border-radius: 30px;
|
|
313
321
|
border: 1px solid rgba(56, 138, 229, 0.16);
|
|
314
|
-
margin: 4px 5px 4px 0;`,
|
|
322
|
+
margin: 4px 5px 4px 0;`, n), `%c${l}%c ${t}`) : `( ${l} )${t}` : t, h = i ? o !== void 0 ? [`${d} %o`, ...a] : [d, ...a] : [d];
|
|
315
323
|
try {
|
|
316
|
-
|
|
317
|
-
} catch (
|
|
324
|
+
r[e](...h);
|
|
325
|
+
} catch (u) {
|
|
318
326
|
}
|
|
319
327
|
};
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
if (
|
|
328
|
+
Q.logLevel = "VERBOSE";
|
|
329
|
+
const To = (s) => {
|
|
330
|
+
Q.logLevel = s;
|
|
331
|
+
}, rt = (s, t = "log", e, o) => {
|
|
332
|
+
Q(!1, s, t, e, o);
|
|
333
|
+
}, Io = (s, t = "log", e, o) => {
|
|
334
|
+
Q(!0, s, t, e, o);
|
|
335
|
+
}, E = (s) => typeof s == "function", x = (s) => {
|
|
336
|
+
if (s === null || typeof s != "object")
|
|
329
337
|
return !1;
|
|
330
|
-
const t = Object.getPrototypeOf(
|
|
338
|
+
const t = Object.getPrototypeOf(s);
|
|
331
339
|
return t === null || t === Object.prototype;
|
|
332
|
-
},
|
|
333
|
-
return
|
|
334
|
-
},
|
|
335
|
-
setTimeout(() =>
|
|
336
|
-
},
|
|
340
|
+
}, P = (s) => typeof s == "string", Xt = (s) => typeof s == "boolean", Ht = (s) => typeof s == "number", Ao = function(s) {
|
|
341
|
+
return s === void 0;
|
|
342
|
+
}, M = (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, be = (s, t) => function(...e) {
|
|
343
|
+
setTimeout(() => s.apply(this, e), t);
|
|
344
|
+
}, So = (s, t, e) => {
|
|
337
345
|
const o = {
|
|
338
346
|
timeoutId: null
|
|
339
347
|
};
|
|
340
|
-
return function(...
|
|
341
|
-
const
|
|
342
|
-
o.timeoutId = null,
|
|
348
|
+
return function(...n) {
|
|
349
|
+
const r = () => {
|
|
350
|
+
o.timeoutId = null, s.apply(this, n);
|
|
343
351
|
};
|
|
344
|
-
o.timeoutId !== null && clearTimeout(o.timeoutId), o.timeoutId = setTimeout(
|
|
352
|
+
o.timeoutId !== null && clearTimeout(o.timeoutId), o.timeoutId = setTimeout(r, t);
|
|
345
353
|
};
|
|
346
|
-
},
|
|
354
|
+
}, No = (s, t, e) => {
|
|
347
355
|
const o = {
|
|
348
356
|
lastCallTime: void 0,
|
|
349
357
|
lastInvokeTime: 0,
|
|
350
358
|
timerId: void 0,
|
|
351
359
|
lastArgs: void 0,
|
|
352
360
|
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 ||
|
|
361
|
+
}, n = (c) => {
|
|
362
|
+
o.lastInvokeTime = c;
|
|
363
|
+
const d = o.lastArgs, h = o.lastThis;
|
|
364
|
+
return o.lastArgs = void 0, o.lastThis = void 0, s.apply(h, d != null ? d : []);
|
|
365
|
+
}, r = (c) => {
|
|
366
|
+
var g;
|
|
367
|
+
const d = c - ((g = o.lastCallTime) != null ? g : 0), h = c - o.lastInvokeTime, u = t - d;
|
|
368
|
+
return Math.min(u, t - h);
|
|
369
|
+
}, i = (c) => {
|
|
370
|
+
var u;
|
|
371
|
+
const d = c - ((u = o.lastCallTime) != null ? u : 0), h = c - o.lastInvokeTime;
|
|
372
|
+
return o.lastCallTime === void 0 || d >= t || d < 0 || h >= t;
|
|
365
373
|
}, a = () => {
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
368
|
-
o.timerId = setTimeout(a,
|
|
374
|
+
const c = Date.now();
|
|
375
|
+
if (!i(c)) {
|
|
376
|
+
o.timerId = setTimeout(a, r(c));
|
|
369
377
|
return;
|
|
370
378
|
}
|
|
371
|
-
o.timerId = void 0, o.lastArgs !== void 0 &&
|
|
379
|
+
o.timerId = void 0, o.lastArgs !== void 0 && n(c), o.lastArgs = void 0, o.lastThis = void 0;
|
|
372
380
|
};
|
|
373
|
-
return function(...
|
|
374
|
-
const
|
|
375
|
-
if (o.lastArgs =
|
|
376
|
-
return o.lastInvokeTime =
|
|
381
|
+
return function(...c) {
|
|
382
|
+
const d = Date.now(), h = i(d);
|
|
383
|
+
if (o.lastArgs = c, o.lastThis = this, o.lastCallTime = d, !!(h && o.timerId === void 0))
|
|
384
|
+
return o.lastInvokeTime = d, o.timerId = setTimeout(a, t), n(d);
|
|
377
385
|
};
|
|
378
|
-
},
|
|
386
|
+
}, S = (() => {
|
|
379
387
|
try {
|
|
380
388
|
return new Function("return this")();
|
|
381
|
-
} catch (
|
|
389
|
+
} catch (s) {
|
|
382
390
|
return;
|
|
383
391
|
}
|
|
384
392
|
})();
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
return
|
|
389
|
-
},
|
|
390
|
-
if (
|
|
391
|
-
return
|
|
392
|
-
const
|
|
393
|
-
return
|
|
394
|
-
},
|
|
395
|
-
var
|
|
396
|
-
const
|
|
393
|
+
S && typeof S.window == "undefined" && (S.window = S);
|
|
394
|
+
const ht = () => {
|
|
395
|
+
if (S != null && S.window)
|
|
396
|
+
return S.window;
|
|
397
|
+
}, Yt = () => {
|
|
398
|
+
if (S != null && S.navigator)
|
|
399
|
+
return S.navigator;
|
|
400
|
+
const s = ht();
|
|
401
|
+
return s == null ? void 0 : s.navigator;
|
|
402
|
+
}, Lo = (s) => /^[-\w]+\/([-+\w]+|\*)$/.test(s), we = () => {
|
|
403
|
+
var n, r;
|
|
404
|
+
const s = {
|
|
397
405
|
win: !1,
|
|
398
406
|
mac: !1,
|
|
399
407
|
x11: !1,
|
|
400
408
|
linux: !1
|
|
401
|
-
}, t =
|
|
402
|
-
return o !== void 0 && (
|
|
403
|
-
},
|
|
404
|
-
const
|
|
405
|
-
return !
|
|
406
|
-
},
|
|
407
|
-
var
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
409
|
+
}, 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;
|
|
410
|
+
return o !== void 0 && (s[o] = !0), s;
|
|
411
|
+
}, ke = 650, Ce = () => {
|
|
412
|
+
const s = ht();
|
|
413
|
+
return !s || typeof s.matchMedia != "function" ? !1 : s.matchMedia(`(max-width: ${ke}px)`).matches;
|
|
414
|
+
}, Oo = (() => {
|
|
415
|
+
var l;
|
|
416
|
+
const s = Yt();
|
|
417
|
+
if (!s)
|
|
410
418
|
return !1;
|
|
411
|
-
const t =
|
|
419
|
+
const t = s.userAgent || "", e = s.userAgentData, o = e == null ? void 0 : e.platform;
|
|
412
420
|
if (/iP(ad|hone|od)/.test(t) || o !== void 0 && o !== "" && /iP(ad|hone|od)/.test(o))
|
|
413
421
|
return !0;
|
|
414
|
-
const
|
|
422
|
+
const n = ((l = s.maxTouchPoints) != null ? l : 0) > 1, r = () => (
|
|
415
423
|
// 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
|
-
})(),
|
|
424
|
+
s.platform
|
|
425
|
+
), i = o !== void 0 && o !== "" ? o : void 0;
|
|
426
|
+
return (n ? i != null ? i : r() : void 0) === "MacIntel";
|
|
427
|
+
})(), Mo = (s) => {
|
|
420
428
|
try {
|
|
421
|
-
return new URL(
|
|
429
|
+
return new URL(s).href;
|
|
422
430
|
} catch (e) {
|
|
423
431
|
}
|
|
424
|
-
const t =
|
|
425
|
-
return
|
|
426
|
-
},
|
|
427
|
-
const t =
|
|
428
|
-
t && t.open(
|
|
429
|
-
},
|
|
430
|
-
const t =
|
|
432
|
+
const t = ht();
|
|
433
|
+
return s.substring(0, 2) === "//" ? t ? `${t.location.protocol}${s}` : s : t ? `${t.location.origin}${s}` : s;
|
|
434
|
+
}, Ro = (s) => {
|
|
435
|
+
const t = ht();
|
|
436
|
+
t && t.open(s, "_blank");
|
|
437
|
+
}, ye = (s) => s && s.slice(0, 1).toUpperCase() + s.slice(1), Bo = (s) => {
|
|
438
|
+
const t = we(), 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
439
|
return t.mac ? e.replace(/ctrl|cmd/gi, "⌘").replace(/alt/gi, "⌥") : e.replace(/cmd/gi, "Ctrl").replace(/windows/gi, "WIN");
|
|
432
|
-
},
|
|
433
|
-
const e =
|
|
440
|
+
}, Jt = (s, t) => {
|
|
441
|
+
const e = N({}, s);
|
|
434
442
|
return Object.keys(t).forEach((o) => {
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
443
|
+
const n = e[o], r = t[o];
|
|
444
|
+
if (r === void 0)
|
|
437
445
|
return;
|
|
438
|
-
if (
|
|
439
|
-
e[o] =
|
|
440
|
-
|
|
441
|
-
|
|
446
|
+
if (x(r) && x(n) && !Array.isArray(r)) {
|
|
447
|
+
e[o] = Jt(
|
|
448
|
+
n,
|
|
449
|
+
r
|
|
442
450
|
);
|
|
443
451
|
return;
|
|
444
452
|
}
|
|
445
|
-
e[o] =
|
|
453
|
+
e[o] = r;
|
|
446
454
|
}), e;
|
|
447
|
-
},
|
|
448
|
-
if (!
|
|
449
|
-
return
|
|
450
|
-
const e = t.reduce((o,
|
|
451
|
-
return Object.assign(
|
|
452
|
-
},
|
|
453
|
-
if (
|
|
455
|
+
}, it = (s, ...t) => {
|
|
456
|
+
if (!x(s) || t.length === 0)
|
|
457
|
+
return s;
|
|
458
|
+
const e = t.reduce((o, n) => x(n) ? Jt(o, n) : o, s);
|
|
459
|
+
return Object.assign(s, e), s;
|
|
460
|
+
}, Ee = (s, t) => s.length !== t.length ? !1 : s.every((e, o) => Tt(e, t[o])), Tt = (s, t) => {
|
|
461
|
+
if (s === t)
|
|
454
462
|
return !0;
|
|
455
|
-
if (
|
|
463
|
+
if (s === null || t === null || typeof s != "object" || typeof t != "object" || Array.isArray(s) !== Array.isArray(t))
|
|
456
464
|
return !1;
|
|
457
|
-
if (Array.isArray(
|
|
458
|
-
return
|
|
459
|
-
const e = Object.keys(
|
|
465
|
+
if (Array.isArray(s) && Array.isArray(t))
|
|
466
|
+
return Ee(s, t);
|
|
467
|
+
const e = Object.keys(s), o = Object.keys(t);
|
|
460
468
|
return e.length !== o.length ? !1 : e.every(
|
|
461
|
-
(
|
|
469
|
+
(n) => Object.prototype.hasOwnProperty.call(t, n) && Tt(s[n], t[n])
|
|
462
470
|
);
|
|
463
|
-
},
|
|
464
|
-
let
|
|
465
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
466
|
-
for (;
|
|
467
|
-
t +=
|
|
471
|
+
}, xe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
472
|
+
let Te = (s = 21) => {
|
|
473
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(s |= 0));
|
|
474
|
+
for (; s--; )
|
|
475
|
+
t += xe[e[s] & 63];
|
|
468
476
|
return t;
|
|
469
477
|
};
|
|
470
|
-
const
|
|
471
|
-
class
|
|
478
|
+
const Ie = 1e8, Ae = 16, Ho = () => Te(10), Se = (s = "") => `${s}${Math.floor(Math.random() * Ie).toString(Ae)}`;
|
|
479
|
+
class m {
|
|
472
480
|
/**
|
|
473
481
|
* Check if passed tag has no closed tag
|
|
474
482
|
* @param {HTMLElement} tag - element to check
|
|
@@ -523,12 +531,12 @@ class f {
|
|
|
523
531
|
* @param classNames - array of class names to add
|
|
524
532
|
*/
|
|
525
533
|
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",
|
|
534
|
+
const o = [], n = [];
|
|
535
|
+
for (const r of e)
|
|
536
|
+
m.isValidClassName(r) ? o.push(r) : n.push(r);
|
|
537
|
+
if (o.length > 0 && t.classList.add(...o), n.length > 0) {
|
|
538
|
+
const r = t.className, i = r ? `${r} ${n.join(" ")}` : n.join(" ");
|
|
539
|
+
t.setAttribute("class", i);
|
|
532
540
|
}
|
|
533
541
|
}
|
|
534
542
|
/**
|
|
@@ -539,28 +547,28 @@ class f {
|
|
|
539
547
|
* @returns {HTMLElement}
|
|
540
548
|
*/
|
|
541
549
|
static make(t, e = null, o = {}) {
|
|
542
|
-
const
|
|
550
|
+
const n = document.createElement(t);
|
|
543
551
|
if (Array.isArray(e)) {
|
|
544
|
-
const
|
|
545
|
-
|
|
552
|
+
const r = e.filter((i) => i !== void 0 && i !== "").flatMap((i) => i.split(" ")).filter((i) => i !== "");
|
|
553
|
+
m.safelyAddClasses(n, r);
|
|
546
554
|
}
|
|
547
555
|
if (typeof e == "string" && e !== "") {
|
|
548
|
-
const
|
|
549
|
-
|
|
556
|
+
const r = e.split(" ").filter((i) => i !== "");
|
|
557
|
+
m.safelyAddClasses(n, r);
|
|
550
558
|
}
|
|
551
|
-
for (const
|
|
552
|
-
if (!Object.prototype.hasOwnProperty.call(o,
|
|
559
|
+
for (const r in o) {
|
|
560
|
+
if (!Object.prototype.hasOwnProperty.call(o, r))
|
|
553
561
|
continue;
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
if (
|
|
557
|
-
|
|
562
|
+
const i = o[r];
|
|
563
|
+
if (i != null) {
|
|
564
|
+
if (r in n) {
|
|
565
|
+
n[r] = i;
|
|
558
566
|
continue;
|
|
559
567
|
}
|
|
560
|
-
|
|
568
|
+
n.setAttribute(r, String(i));
|
|
561
569
|
}
|
|
562
570
|
}
|
|
563
|
-
return
|
|
571
|
+
return n;
|
|
564
572
|
}
|
|
565
573
|
/**
|
|
566
574
|
* Creates Text Node with the passed content
|
|
@@ -584,7 +592,7 @@ class f {
|
|
|
584
592
|
* @param {Element|Element[]} elements - element or elements list
|
|
585
593
|
*/
|
|
586
594
|
static prepend(t, e) {
|
|
587
|
-
Array.isArray(e) ? [...e].reverse().forEach((
|
|
595
|
+
Array.isArray(e) ? [...e].reverse().forEach((n) => t.prepend(n)) : t.prepend(e);
|
|
588
596
|
}
|
|
589
597
|
/**
|
|
590
598
|
* Selector Decorator
|
|
@@ -627,10 +635,10 @@ class f {
|
|
|
627
635
|
* @param holder - element where to find inputs
|
|
628
636
|
*/
|
|
629
637
|
static findAllInputs(t) {
|
|
630
|
-
const e = Array.from(t.querySelectorAll(
|
|
631
|
-
for (const
|
|
632
|
-
|
|
633
|
-
return o.reduce((
|
|
638
|
+
const e = Array.from(t.querySelectorAll(m.allInputsSelector)), o = [];
|
|
639
|
+
for (const n of e)
|
|
640
|
+
n instanceof HTMLElement && o.push(n);
|
|
641
|
+
return o.reduce((n, r) => m.isNativeInput(r) || m.containsOnlyInlineElements(r) ? [...n, r] : [...n, ...m.getDeepestBlockElements(r)], []);
|
|
634
642
|
}
|
|
635
643
|
/**
|
|
636
644
|
* Search for deepest node which is Leaf.
|
|
@@ -643,21 +651,21 @@ class f {
|
|
|
643
651
|
* Can return null if node is Document or DocumentFragment, or node is not attached to the DOM
|
|
644
652
|
*/
|
|
645
653
|
static getDeepestNode(t, e = !1) {
|
|
646
|
-
var
|
|
647
|
-
const o = e ? "lastChild" : "firstChild",
|
|
654
|
+
var d;
|
|
655
|
+
const o = e ? "lastChild" : "firstChild", n = e ? "previousSibling" : "nextSibling";
|
|
648
656
|
if (t === null || t.nodeType !== Node.ELEMENT_NODE)
|
|
649
657
|
return t;
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
658
|
+
const r = t[o];
|
|
659
|
+
if (r === null)
|
|
652
660
|
return t;
|
|
653
|
-
const
|
|
654
|
-
if (!(
|
|
655
|
-
return this.getDeepestNode(
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
658
|
-
return this.getDeepestNode(
|
|
659
|
-
const
|
|
660
|
-
return
|
|
661
|
+
const i = r;
|
|
662
|
+
if (!(m.isSingleTag(i) && !m.isNativeInput(i) && !m.isLineBreakTag(i)))
|
|
663
|
+
return this.getDeepestNode(i, e);
|
|
664
|
+
const l = i[n];
|
|
665
|
+
if (l)
|
|
666
|
+
return this.getDeepestNode(l, e);
|
|
667
|
+
const c = (d = i.parentNode) == null ? void 0 : d[n];
|
|
668
|
+
return c ? this.getDeepestNode(c, e) : i.parentNode;
|
|
661
669
|
}
|
|
662
670
|
/**
|
|
663
671
|
* Check if object is DOM node
|
|
@@ -665,7 +673,7 @@ class f {
|
|
|
665
673
|
* @returns {boolean}
|
|
666
674
|
*/
|
|
667
675
|
static isElement(t) {
|
|
668
|
-
return
|
|
676
|
+
return Ht(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.ELEMENT_NODE;
|
|
669
677
|
}
|
|
670
678
|
/**
|
|
671
679
|
* Check if object is DocumentFragment node
|
|
@@ -673,7 +681,7 @@ class f {
|
|
|
673
681
|
* @returns {boolean}
|
|
674
682
|
*/
|
|
675
683
|
static isFragment(t) {
|
|
676
|
-
return
|
|
684
|
+
return Ht(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
677
685
|
}
|
|
678
686
|
/**
|
|
679
687
|
* Check if passed element is contenteditable
|
|
@@ -701,7 +709,7 @@ class f {
|
|
|
701
709
|
* @returns {boolean}
|
|
702
710
|
*/
|
|
703
711
|
static canSetCaret(t) {
|
|
704
|
-
return
|
|
712
|
+
return m.isNativeInput(t) ? !(/* @__PURE__ */ new Set([
|
|
705
713
|
"file",
|
|
706
714
|
"checkbox",
|
|
707
715
|
"radio",
|
|
@@ -710,7 +718,7 @@ class f {
|
|
|
710
718
|
"button",
|
|
711
719
|
"image",
|
|
712
720
|
"reset"
|
|
713
|
-
])).has(t.type) :
|
|
721
|
+
])).has(t.type) : m.isContentEditable(t);
|
|
714
722
|
}
|
|
715
723
|
/**
|
|
716
724
|
* Checks node if it is empty
|
|
@@ -721,11 +729,11 @@ class f {
|
|
|
721
729
|
* @returns {boolean} true if it is empty
|
|
722
730
|
*/
|
|
723
731
|
static isNodeEmpty(t, e) {
|
|
724
|
-
var
|
|
732
|
+
var r, i;
|
|
725
733
|
if (this.isSingleTag(t) && !this.isLineBreakTag(t))
|
|
726
734
|
return !1;
|
|
727
|
-
const o = this.isElement(t) && this.isNativeInput(t) ? t.value : (
|
|
728
|
-
return ((
|
|
735
|
+
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;
|
|
736
|
+
return ((i = n == null ? void 0 : n.length) != null ? i : 0) === 0;
|
|
729
737
|
}
|
|
730
738
|
/**
|
|
731
739
|
* checks node if it is doesn't have any child nodes
|
|
@@ -746,11 +754,11 @@ class f {
|
|
|
746
754
|
static isEmpty(t, e) {
|
|
747
755
|
const o = [t];
|
|
748
756
|
for (; o.length > 0; ) {
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
if (this.isLeaf(
|
|
757
|
+
const n = o.shift();
|
|
758
|
+
if (n) {
|
|
759
|
+
if (this.isLeaf(n) && !this.isNodeEmpty(n, e))
|
|
752
760
|
return !1;
|
|
753
|
-
o.push(...Array.from(
|
|
761
|
+
o.push(...Array.from(n.childNodes));
|
|
754
762
|
}
|
|
755
763
|
}
|
|
756
764
|
return !0;
|
|
@@ -761,7 +769,7 @@ class f {
|
|
|
761
769
|
* @returns {boolean}
|
|
762
770
|
*/
|
|
763
771
|
static isHTMLString(t) {
|
|
764
|
-
const e =
|
|
772
|
+
const e = m.make("div");
|
|
765
773
|
return e.innerHTML = t, e.childElementCount > 0;
|
|
766
774
|
}
|
|
767
775
|
/**
|
|
@@ -771,7 +779,7 @@ class f {
|
|
|
771
779
|
*/
|
|
772
780
|
static getContentLength(t) {
|
|
773
781
|
var e, o;
|
|
774
|
-
return
|
|
782
|
+
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
783
|
}
|
|
776
784
|
/**
|
|
777
785
|
* Return array of names of block html elements
|
|
@@ -826,10 +834,10 @@ class f {
|
|
|
826
834
|
* @returns {boolean}
|
|
827
835
|
*/
|
|
828
836
|
static containsOnlyInlineElements(t) {
|
|
829
|
-
const e =
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
})() : t, o = (
|
|
837
|
+
const e = P(t) ? (() => {
|
|
838
|
+
const n = document.createElement("div");
|
|
839
|
+
return n.innerHTML = t, n;
|
|
840
|
+
})() : t, o = (n) => !m.blockElements.includes(n.tagName.toLowerCase()) && Array.from(n.children).every(o);
|
|
833
841
|
return Array.from(e.children).every(o);
|
|
834
842
|
}
|
|
835
843
|
/**
|
|
@@ -838,7 +846,7 @@ class f {
|
|
|
838
846
|
* @returns {HTMLElement[]}
|
|
839
847
|
*/
|
|
840
848
|
static getDeepestBlockElements(t) {
|
|
841
|
-
return
|
|
849
|
+
return m.containsOnlyInlineElements(t) ? [t] : Array.from(t.children).reduce((e, o) => [...e, ...m.getDeepestBlockElements(o)], []);
|
|
842
850
|
}
|
|
843
851
|
/**
|
|
844
852
|
* Helper for get holder from {string} or return HTMLElement
|
|
@@ -846,7 +854,7 @@ class f {
|
|
|
846
854
|
* @returns {HTMLElement}
|
|
847
855
|
*/
|
|
848
856
|
static getHolder(t) {
|
|
849
|
-
if (!
|
|
857
|
+
if (!P(t))
|
|
850
858
|
return t;
|
|
851
859
|
const e = document.getElementById(t);
|
|
852
860
|
if (e !== null)
|
|
@@ -867,12 +875,12 @@ class f {
|
|
|
867
875
|
* @param el - element to compute offset
|
|
868
876
|
*/
|
|
869
877
|
static offset(t) {
|
|
870
|
-
const e = t.getBoundingClientRect(), o = window.scrollX || document.documentElement.scrollLeft,
|
|
878
|
+
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
879
|
return {
|
|
872
|
-
top:
|
|
873
|
-
left:
|
|
874
|
-
bottom:
|
|
875
|
-
right:
|
|
880
|
+
top: r,
|
|
881
|
+
left: i,
|
|
882
|
+
bottom: r + e.height,
|
|
883
|
+
right: i + e.width
|
|
876
884
|
};
|
|
877
885
|
}
|
|
878
886
|
/**
|
|
@@ -886,55 +894,67 @@ class f {
|
|
|
886
894
|
t,
|
|
887
895
|
NodeFilter.SHOW_TEXT,
|
|
888
896
|
null
|
|
889
|
-
),
|
|
890
|
-
var
|
|
891
|
-
if (!
|
|
892
|
-
const
|
|
897
|
+
), n = (c, d, h, u) => {
|
|
898
|
+
var w;
|
|
899
|
+
if (!c && h) {
|
|
900
|
+
const C = d - u, k = Math.max(e - C, 0), T = Math.min(k, u);
|
|
893
901
|
return {
|
|
894
|
-
node:
|
|
895
|
-
offset:
|
|
902
|
+
node: h,
|
|
903
|
+
offset: T
|
|
896
904
|
};
|
|
897
905
|
}
|
|
898
|
-
if (!
|
|
906
|
+
if (!c)
|
|
899
907
|
return {
|
|
900
908
|
node: null,
|
|
901
909
|
offset: 0
|
|
902
910
|
};
|
|
903
|
-
const
|
|
904
|
-
return
|
|
905
|
-
node:
|
|
906
|
-
offset: Math.min(e -
|
|
907
|
-
} :
|
|
911
|
+
const f = ((w = c.textContent) != null ? w : "").length;
|
|
912
|
+
return d + f >= e ? {
|
|
913
|
+
node: c,
|
|
914
|
+
offset: Math.min(e - d, f)
|
|
915
|
+
} : n(
|
|
908
916
|
o.nextNode(),
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
917
|
+
d + f,
|
|
918
|
+
c,
|
|
919
|
+
f
|
|
912
920
|
);
|
|
913
|
-
},
|
|
914
|
-
if (!
|
|
921
|
+
}, r = o.nextNode(), { node: i, offset: a } = n(r, 0, null, 0);
|
|
922
|
+
if (!i)
|
|
915
923
|
return {
|
|
916
924
|
node: null,
|
|
917
925
|
offset: 0
|
|
918
926
|
};
|
|
919
|
-
const
|
|
920
|
-
return !
|
|
927
|
+
const l = i.textContent;
|
|
928
|
+
return !l || l.length === 0 ? {
|
|
921
929
|
node: null,
|
|
922
930
|
offset: 0
|
|
923
931
|
} : {
|
|
924
|
-
node:
|
|
932
|
+
node: i,
|
|
925
933
|
offset: a
|
|
926
934
|
};
|
|
927
935
|
}
|
|
928
936
|
}
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
},
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
937
|
+
const Ne = (s) => !/[^\t\n\r \u200B]/.test(s), Fo = (s) => {
|
|
938
|
+
s.setAttribute("data-blok-empty", m.isEmpty(s) ? "true" : "false");
|
|
939
|
+
}, Zt = ["header", "table"], G = /* @__PURE__ */ new Map(), Po = (s) => {
|
|
940
|
+
var o;
|
|
941
|
+
const t = [...new Set(s)];
|
|
942
|
+
for (const n of t) {
|
|
943
|
+
const r = (o = G.get(n)) != null ? o : 0;
|
|
944
|
+
G.set(n, r + 1);
|
|
945
|
+
}
|
|
946
|
+
const e = { cleanedUp: !1 };
|
|
947
|
+
return () => {
|
|
948
|
+
if (!e.cleanedUp) {
|
|
949
|
+
e.cleanedUp = !0;
|
|
950
|
+
for (const n of t) {
|
|
951
|
+
const r = G.get(n);
|
|
952
|
+
r !== void 0 && (r <= 1 ? G.delete(n) : G.set(n, r - 1));
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
}, $o = () => [...Zt, ...G.keys()], Do = (s) => s ? (s instanceof HTMLElement ? s : s.holder).closest("[data-blok-table-cell-blocks]") !== null : !1, jo = (s) => Zt.includes(s) || G.has(s);
|
|
957
|
+
class Qt {
|
|
938
958
|
constructor() {
|
|
939
959
|
this.allListeners = [];
|
|
940
960
|
}
|
|
@@ -945,17 +965,17 @@ class Nt {
|
|
|
945
965
|
* @param {Function} handler - method that will be fired on event
|
|
946
966
|
* @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}
|
|
947
967
|
*/
|
|
948
|
-
on(t, e, o,
|
|
949
|
-
if (this.findOne(t, e, o,
|
|
968
|
+
on(t, e, o, n = !1) {
|
|
969
|
+
if (this.findOne(t, e, o, n))
|
|
950
970
|
return;
|
|
951
|
-
const
|
|
952
|
-
id:
|
|
971
|
+
const i = Se("l"), a = {
|
|
972
|
+
id: i,
|
|
953
973
|
element: t,
|
|
954
974
|
eventType: e,
|
|
955
975
|
handler: o,
|
|
956
|
-
options:
|
|
976
|
+
options: n
|
|
957
977
|
};
|
|
958
|
-
return this.allListeners.push(a), t.addEventListener(e, o,
|
|
978
|
+
return this.allListeners.push(a), t.addEventListener(e, o, n), i;
|
|
959
979
|
}
|
|
960
980
|
/**
|
|
961
981
|
* Removes event listener from element
|
|
@@ -964,11 +984,11 @@ class Nt {
|
|
|
964
984
|
* @param {Function} handler - remove handler, if element listens several handlers on the same event type
|
|
965
985
|
* @param {boolean|AddEventListenerOptions} options - useCapture or {capture, passive, once}
|
|
966
986
|
*/
|
|
967
|
-
off(t, e, o,
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
987
|
+
off(t, e, o, n) {
|
|
988
|
+
const r = this.findAll(t, e, o, n);
|
|
989
|
+
r.forEach((i, a) => {
|
|
990
|
+
const l = this.allListeners.indexOf(r[a]);
|
|
991
|
+
l > -1 && (this.allListeners.splice(l, 1), i.element.removeEventListener(i.eventType, i.handler, i.options));
|
|
972
992
|
});
|
|
973
993
|
}
|
|
974
994
|
/**
|
|
@@ -991,9 +1011,9 @@ class Nt {
|
|
|
991
1011
|
* @param {boolean|AddEventListenerOptions} [options] - event options
|
|
992
1012
|
* @returns {ListenerData|null}
|
|
993
1013
|
*/
|
|
994
|
-
findOne(t, e, o,
|
|
995
|
-
var
|
|
996
|
-
return (
|
|
1014
|
+
findOne(t, e, o, n) {
|
|
1015
|
+
var i;
|
|
1016
|
+
return (i = this.findAll(t, e, o, n)[0]) != null ? i : null;
|
|
997
1017
|
}
|
|
998
1018
|
/**
|
|
999
1019
|
* Return all stored listeners by passed params
|
|
@@ -1003,10 +1023,10 @@ class Nt {
|
|
|
1003
1023
|
* @param {boolean|AddEventListenerOptions} [options] - event options
|
|
1004
1024
|
* @returns {ListenerData[]}
|
|
1005
1025
|
*/
|
|
1006
|
-
findAll(t, e, o,
|
|
1007
|
-
return t ? this.findByEventTarget(t).filter((
|
|
1008
|
-
const a = e === void 0 ||
|
|
1009
|
-
return a &&
|
|
1026
|
+
findAll(t, e, o, n) {
|
|
1027
|
+
return t ? this.findByEventTarget(t).filter((i) => {
|
|
1028
|
+
const a = e === void 0 || i.eventType === e, l = o === void 0 || i.handler === o, c = this.areOptionsEqual(i.options, n);
|
|
1029
|
+
return a && l && c;
|
|
1010
1030
|
}) : [];
|
|
1011
1031
|
}
|
|
1012
1032
|
/**
|
|
@@ -1061,7 +1081,7 @@ class Nt {
|
|
|
1061
1081
|
* @returns {NormalizedListenerOptions}
|
|
1062
1082
|
*/
|
|
1063
1083
|
normalizeListenerOptions(t) {
|
|
1064
|
-
var e, o,
|
|
1084
|
+
var e, o, n;
|
|
1065
1085
|
return typeof t == "boolean" ? {
|
|
1066
1086
|
capture: t,
|
|
1067
1087
|
once: !1,
|
|
@@ -1069,7 +1089,7 @@ class Nt {
|
|
|
1069
1089
|
} : t ? {
|
|
1070
1090
|
capture: (e = t.capture) != null ? e : !1,
|
|
1071
1091
|
once: (o = t.once) != null ? o : !1,
|
|
1072
|
-
passive: (
|
|
1092
|
+
passive: (n = t.passive) != null ? n : !1,
|
|
1073
1093
|
signal: t.signal
|
|
1074
1094
|
} : {
|
|
1075
1095
|
capture: !1,
|
|
@@ -1086,79 +1106,79 @@ class Nt {
|
|
|
1086
1106
|
areOptionsEqual(t, e) {
|
|
1087
1107
|
if (e === void 0)
|
|
1088
1108
|
return !0;
|
|
1089
|
-
const o = this.normalizeListenerOptions(t),
|
|
1090
|
-
return o.capture ===
|
|
1109
|
+
const o = this.normalizeListenerOptions(t), n = this.normalizeListenerOptions(e);
|
|
1110
|
+
return o.capture === n.capture && o.once === n.once && o.passive === n.passive && o.signal === n.signal;
|
|
1091
1111
|
}
|
|
1092
1112
|
}
|
|
1093
|
-
const
|
|
1094
|
-
if (!
|
|
1113
|
+
const J = (s, t) => {
|
|
1114
|
+
if (!s.conversionConfig)
|
|
1095
1115
|
return !1;
|
|
1096
|
-
const e =
|
|
1097
|
-
return
|
|
1098
|
-
},
|
|
1116
|
+
const e = s.conversionConfig[t];
|
|
1117
|
+
return E(e) || P(e);
|
|
1118
|
+
}, Y = (s, t) => {
|
|
1099
1119
|
const e = t.includes(".") ? t : `toolNames.${t}`;
|
|
1100
|
-
return
|
|
1101
|
-
},
|
|
1102
|
-
const o = t.titleKey ?
|
|
1120
|
+
return s.has(e) ? s.t(e) : void 0;
|
|
1121
|
+
}, Ft = (s, t, e = "") => {
|
|
1122
|
+
const o = t.titleKey ? Y(s, t.titleKey) : void 0;
|
|
1103
1123
|
if (o !== void 0)
|
|
1104
1124
|
return o;
|
|
1105
|
-
const
|
|
1106
|
-
if (
|
|
1107
|
-
return
|
|
1125
|
+
const n = t.title ? Y(s, t.title) : void 0;
|
|
1126
|
+
if (n !== void 0)
|
|
1127
|
+
return n;
|
|
1108
1128
|
if (t.title)
|
|
1109
1129
|
return t.title;
|
|
1110
|
-
const
|
|
1111
|
-
return
|
|
1112
|
-
},
|
|
1113
|
-
const o = t ?
|
|
1130
|
+
const r = e ? Y(s, e) : void 0;
|
|
1131
|
+
return r != null ? r : e;
|
|
1132
|
+
}, Le = (s, t, e) => {
|
|
1133
|
+
const o = t ? Y(s, t) : void 0;
|
|
1114
1134
|
if (o !== void 0)
|
|
1115
1135
|
return o;
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1118
|
-
},
|
|
1119
|
-
const o = (await
|
|
1120
|
-
return
|
|
1121
|
-
if (!
|
|
1122
|
-
return
|
|
1123
|
-
const a =
|
|
1124
|
-
if (
|
|
1136
|
+
const n = Y(s, e);
|
|
1137
|
+
return n != null ? n : e;
|
|
1138
|
+
}, Pt = (s, t) => J(s.tool, t), Oe = (s, t) => Object.entries(s).some((([e, o]) => t[e] && Tt(t[e], o))), te = async (s, t) => {
|
|
1139
|
+
const o = (await s.save()).data, n = t.find((r) => r.name === s.name);
|
|
1140
|
+
return n !== void 0 && !J(n, "export") ? [] : t.reduce((r, i) => {
|
|
1141
|
+
if (!J(i, "import") || i.toolbox === void 0)
|
|
1142
|
+
return r;
|
|
1143
|
+
const a = i.toolbox.filter((l) => {
|
|
1144
|
+
if (M(l) || l.icon === void 0)
|
|
1125
1145
|
return !1;
|
|
1126
|
-
const
|
|
1127
|
-
return !(
|
|
1146
|
+
const c = l.data !== void 0;
|
|
1147
|
+
return !(c && l.data !== void 0 && Oe(l.data, o) || !c && i.name === s.name);
|
|
1128
1148
|
});
|
|
1129
|
-
return
|
|
1149
|
+
return r.push(D(N({}, i), {
|
|
1130
1150
|
toolbox: a
|
|
1131
|
-
})),
|
|
1151
|
+
})), r;
|
|
1132
1152
|
}, []);
|
|
1133
|
-
},
|
|
1134
|
-
if (
|
|
1153
|
+
}, _o = (s, t) => s.mergeable ? s.name === t.name ? !0 : Pt(t, "export") && Pt(s, "import") : !1, Go = async (s, t) => {
|
|
1154
|
+
if (s.length === 0)
|
|
1135
1155
|
return [];
|
|
1136
|
-
if (
|
|
1137
|
-
return
|
|
1138
|
-
for (const o of
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1156
|
+
if (s.length === 1)
|
|
1157
|
+
return te(s[0], t);
|
|
1158
|
+
for (const o of s) {
|
|
1159
|
+
const n = t.find((r) => r.name === o.name);
|
|
1160
|
+
if (n !== void 0 && !J(n, "export"))
|
|
1141
1161
|
return [];
|
|
1142
1162
|
}
|
|
1143
|
-
const e = new Set(
|
|
1144
|
-
return t.reduce((o,
|
|
1145
|
-
if (!
|
|
1163
|
+
const e = new Set(s.map((o) => o.name));
|
|
1164
|
+
return t.reduce((o, n) => {
|
|
1165
|
+
if (!J(n, "import") || n.toolbox === void 0)
|
|
1146
1166
|
return o;
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1149
|
-
toolbox:
|
|
1167
|
+
const r = n.toolbox.filter((i) => !(M(i) || i.icon === void 0 || !(i.data !== void 0) && e.size === 1 && e.has(n.name)));
|
|
1168
|
+
return r.length > 0 && o.push(D(N({}, n), {
|
|
1169
|
+
toolbox: r
|
|
1150
1170
|
})), o;
|
|
1151
1171
|
}, []);
|
|
1152
|
-
},
|
|
1172
|
+
}, Wo = (s, t) => {
|
|
1153
1173
|
const e = t == null ? void 0 : t.export;
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1174
|
+
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."), "");
|
|
1175
|
+
}, Vo = (s, t, e) => {
|
|
1156
1176
|
const o = t == null ? void 0 : t.import;
|
|
1157
|
-
return
|
|
1158
|
-
[o]:
|
|
1159
|
-
} : (o !== void 0 &&
|
|
1177
|
+
return E(o) ? o(s, e) : P(o) ? {
|
|
1178
|
+
[o]: s
|
|
1179
|
+
} : (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
1180
|
};
|
|
1161
|
-
class
|
|
1181
|
+
class ee {
|
|
1162
1182
|
constructor() {
|
|
1163
1183
|
this.subscribers = {};
|
|
1164
1184
|
}
|
|
@@ -1177,9 +1197,9 @@ class Bt {
|
|
|
1177
1197
|
*/
|
|
1178
1198
|
once(t, e) {
|
|
1179
1199
|
t in this.subscribers || (this.subscribers[t] = []);
|
|
1180
|
-
const o = (
|
|
1181
|
-
const
|
|
1182
|
-
return
|
|
1200
|
+
const o = (n) => {
|
|
1201
|
+
const r = e(n), i = this.subscribers[t].indexOf(o);
|
|
1202
|
+
return i !== -1 && this.subscribers[t].splice(i, 1), r;
|
|
1183
1203
|
};
|
|
1184
1204
|
this.subscribers[t].push(o);
|
|
1185
1205
|
}
|
|
@@ -1189,9 +1209,9 @@ class Bt {
|
|
|
1189
1209
|
* @param data - subscribers get this data when they were fired
|
|
1190
1210
|
*/
|
|
1191
1211
|
emit(t, e) {
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
return
|
|
1212
|
+
M(this.subscribers) || !this.subscribers[t] || this.subscribers[t].reduce((o, n) => {
|
|
1213
|
+
const r = n(o);
|
|
1214
|
+
return r !== void 0 ? r : o;
|
|
1195
1215
|
}, e);
|
|
1196
1216
|
}
|
|
1197
1217
|
/**
|
|
@@ -1205,8 +1225,8 @@ class Bt {
|
|
|
1205
1225
|
console.warn(`EventDispatcher .off(): there is no subscribers for event "${t.toString()}". Probably, .off() called before .on()`);
|
|
1206
1226
|
return;
|
|
1207
1227
|
}
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1228
|
+
const n = o.indexOf(e);
|
|
1229
|
+
n !== -1 && o.splice(n, 1);
|
|
1210
1230
|
}
|
|
1211
1231
|
/**
|
|
1212
1232
|
* Destroyer
|
|
@@ -1216,9 +1236,8 @@ class Bt {
|
|
|
1216
1236
|
this.subscribers = {};
|
|
1217
1237
|
}
|
|
1218
1238
|
}
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1221
|
-
class m {
|
|
1239
|
+
const Uo = 180, zo = 400, Ko = "blok", qo = "inline-toolbar", pt = "tooltip", Xo = "[data-blok-interface=inline-toolbar]", Yo = typeof process != "undefined" ? process.platform === "darwin" ? "Meta" : "Control" : typeof navigator != "undefined" && navigator.userAgent.toLowerCase().includes("mac") ? "Meta" : "Control";
|
|
1240
|
+
class y {
|
|
1222
1241
|
/**
|
|
1223
1242
|
* Returns selected anchor node
|
|
1224
1243
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Selection/anchorNode}
|
|
@@ -1235,7 +1254,7 @@ class m {
|
|
|
1235
1254
|
if (!t)
|
|
1236
1255
|
return null;
|
|
1237
1256
|
const e = t.anchorNode;
|
|
1238
|
-
return e ?
|
|
1257
|
+
return e ? m.isElement(e) ? e : e.parentElement : null;
|
|
1239
1258
|
}
|
|
1240
1259
|
/**
|
|
1241
1260
|
* Returns selection offset according to the anchor node
|
|
@@ -1259,8 +1278,8 @@ class m {
|
|
|
1259
1278
|
static isSelectionAtBlok(t) {
|
|
1260
1279
|
if (!t)
|
|
1261
1280
|
return !1;
|
|
1262
|
-
const e = t.anchorNode || t.focusNode, o = e && e.nodeType === Node.TEXT_NODE ? e.parentNode : e,
|
|
1263
|
-
return
|
|
1281
|
+
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;
|
|
1282
|
+
return n ? n.nodeType === Node.ELEMENT_NODE : !1;
|
|
1264
1283
|
}
|
|
1265
1284
|
/**
|
|
1266
1285
|
* Check if current selection is at Blok's zone
|
|
@@ -1275,7 +1294,7 @@ class m {
|
|
|
1275
1294
|
static isRangeAtBlok(t) {
|
|
1276
1295
|
if (!t)
|
|
1277
1296
|
return;
|
|
1278
|
-
const e = t.startContainer && t.startContainer.nodeType === Node.TEXT_NODE ? t.startContainer.parentNode : t.startContainer, o = e && e instanceof Element ? e.closest(
|
|
1297
|
+
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
1298
|
return o ? o.nodeType === Node.ELEMENT_NODE : !1;
|
|
1280
1299
|
}
|
|
1281
1300
|
/**
|
|
@@ -1316,19 +1335,19 @@ class m {
|
|
|
1316
1335
|
height: 0
|
|
1317
1336
|
}, e = window.getSelection();
|
|
1318
1337
|
if (!e)
|
|
1319
|
-
return
|
|
1338
|
+
return rt("Method window.getSelection returned null", "warn"), t;
|
|
1320
1339
|
if (e.rangeCount === null || Number.isNaN(e.rangeCount))
|
|
1321
|
-
return
|
|
1340
|
+
return rt("Method SelectionUtils.rangeCount is not supported", "warn"), t;
|
|
1322
1341
|
if (e.rangeCount === 0)
|
|
1323
1342
|
return t;
|
|
1324
|
-
const o = e.getRangeAt(0).cloneRange(),
|
|
1325
|
-
if (
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
const
|
|
1329
|
-
return a == null || a.removeChild(
|
|
1343
|
+
const o = e.getRangeAt(0).cloneRange(), n = o.getBoundingClientRect();
|
|
1344
|
+
if (n.x === 0 && n.y === 0) {
|
|
1345
|
+
const r = document.createElement("span");
|
|
1346
|
+
r.appendChild(document.createTextNode("")), o.insertNode(r);
|
|
1347
|
+
const i = r.getBoundingClientRect(), a = r.parentNode;
|
|
1348
|
+
return a == null || a.removeChild(r), a == null || a.normalize(), i;
|
|
1330
1349
|
}
|
|
1331
|
-
return
|
|
1350
|
+
return n;
|
|
1332
1351
|
}
|
|
1333
1352
|
/**
|
|
1334
1353
|
* Returns selected text as String
|
|
@@ -1339,22 +1358,22 @@ class m {
|
|
|
1339
1358
|
return (e = t == null ? void 0 : t.toString()) != null ? e : "";
|
|
1340
1359
|
}
|
|
1341
1360
|
}
|
|
1342
|
-
class
|
|
1361
|
+
class ft {
|
|
1343
1362
|
/**
|
|
1344
1363
|
* Set focus to contenteditable or native input element
|
|
1345
1364
|
* @param element - element where to set focus
|
|
1346
1365
|
* @param offset - offset of cursor
|
|
1347
1366
|
*/
|
|
1348
1367
|
static setCursor(t, e = 0) {
|
|
1349
|
-
const o = document.createRange(),
|
|
1350
|
-
return
|
|
1368
|
+
const o = document.createRange(), n = window.getSelection(), r = m.isNativeInput(t);
|
|
1369
|
+
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
1370
|
}
|
|
1352
1371
|
/**
|
|
1353
1372
|
* Check if current range exists and belongs to container
|
|
1354
1373
|
* @param container - where range should be
|
|
1355
1374
|
*/
|
|
1356
1375
|
static isRangeInsideContainer(t) {
|
|
1357
|
-
const e =
|
|
1376
|
+
const e = y.getRange();
|
|
1358
1377
|
return e === null ? !1 : t.contains(e.startContainer);
|
|
1359
1378
|
}
|
|
1360
1379
|
/**
|
|
@@ -1368,7 +1387,7 @@ class st {
|
|
|
1368
1387
|
e.selectNodeContents(t.focusNode), e.collapse(!1), t.removeAllRanges(), t.addRange(e);
|
|
1369
1388
|
}
|
|
1370
1389
|
}
|
|
1371
|
-
const
|
|
1390
|
+
const Lt = class Lt {
|
|
1372
1391
|
/**
|
|
1373
1392
|
* Applies box-shadow to a wrapper to extend the background to fill line-height
|
|
1374
1393
|
* @param wrapper - the wrapper element
|
|
@@ -1377,8 +1396,8 @@ const gt = class gt {
|
|
|
1377
1396
|
const e = t.parentElement;
|
|
1378
1397
|
if (!e)
|
|
1379
1398
|
return;
|
|
1380
|
-
const o = window.getComputedStyle(e),
|
|
1381
|
-
|
|
1399
|
+
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);
|
|
1400
|
+
c > 0 && (t.style.boxShadow = `0 ${c}px 0 ${this.BG_COLOR}, 0 -${c}px 0 ${this.BG_COLOR}`);
|
|
1382
1401
|
}
|
|
1383
1402
|
/**
|
|
1384
1403
|
* Applies additional box-shadow extensions to fill gaps between separate spans
|
|
@@ -1389,10 +1408,10 @@ const gt = class gt {
|
|
|
1389
1408
|
const e = this.collectAllLineRects(t);
|
|
1390
1409
|
if (e.length === 0)
|
|
1391
1410
|
return;
|
|
1392
|
-
e.sort((
|
|
1411
|
+
e.sort((n, r) => n.top - r.top);
|
|
1393
1412
|
const o = this.groupRectsByLine(e);
|
|
1394
|
-
t.forEach((
|
|
1395
|
-
this.applyMultiLineBoxShadow(
|
|
1413
|
+
t.forEach((n) => {
|
|
1414
|
+
this.applyMultiLineBoxShadow(n, o);
|
|
1396
1415
|
});
|
|
1397
1416
|
}
|
|
1398
1417
|
/**
|
|
@@ -1402,11 +1421,11 @@ const gt = class gt {
|
|
|
1402
1421
|
static collectAllLineRects(t) {
|
|
1403
1422
|
const e = [];
|
|
1404
1423
|
return t.forEach((o) => {
|
|
1405
|
-
const
|
|
1406
|
-
Array.from(
|
|
1424
|
+
const n = o.getClientRects();
|
|
1425
|
+
Array.from(n).forEach((r) => {
|
|
1407
1426
|
e.push({
|
|
1408
|
-
top:
|
|
1409
|
-
bottom:
|
|
1427
|
+
top: r.top,
|
|
1428
|
+
bottom: r.bottom,
|
|
1410
1429
|
span: o
|
|
1411
1430
|
});
|
|
1412
1431
|
});
|
|
@@ -1419,9 +1438,9 @@ const gt = class gt {
|
|
|
1419
1438
|
static groupRectsByLine(t) {
|
|
1420
1439
|
const e = [];
|
|
1421
1440
|
return t.forEach((o) => {
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1424
|
-
}), e.sort((o,
|
|
1441
|
+
const n = e.find((r) => Math.abs(r.top - o.top) < 2);
|
|
1442
|
+
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 });
|
|
1443
|
+
}), e.sort((o, n) => o.top - n.top), e;
|
|
1425
1444
|
}
|
|
1426
1445
|
/**
|
|
1427
1446
|
* Applies box-shadow to a span that may span multiple lines
|
|
@@ -1433,11 +1452,11 @@ const gt = class gt {
|
|
|
1433
1452
|
const o = t.getClientRects();
|
|
1434
1453
|
if (o.length === 0)
|
|
1435
1454
|
return;
|
|
1436
|
-
const
|
|
1437
|
-
if (!
|
|
1455
|
+
const n = t.parentElement;
|
|
1456
|
+
if (!n)
|
|
1438
1457
|
return;
|
|
1439
|
-
const
|
|
1440
|
-
t.style.boxShadow =
|
|
1458
|
+
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], h = this.findLineIndex(c.top, e), u = this.findLineIndex(d.top, e), g = o.length > 1 && h !== u, f = h === 0, b = u === e.length - 1, w = Math.max(0, (l - c.height) / 2), C = g ? this.calculateLineTopExtension(w, f, e, h) : w, k = g ? this.calculateLineBottomExtension(w, b, e, u) : w, T = this.buildBoxShadow(C, k);
|
|
1459
|
+
t.style.boxShadow = T;
|
|
1441
1460
|
}
|
|
1442
1461
|
/**
|
|
1443
1462
|
* Finds the line index for a given top position
|
|
@@ -1445,7 +1464,7 @@ const gt = class gt {
|
|
|
1445
1464
|
* @param lineGroups - grouped line rectangles
|
|
1446
1465
|
*/
|
|
1447
1466
|
static findLineIndex(t, e) {
|
|
1448
|
-
const o = e.findIndex((
|
|
1467
|
+
const o = e.findIndex((n) => Math.abs(n.top - t) < 5);
|
|
1449
1468
|
return o >= 0 ? o : 0;
|
|
1450
1469
|
}
|
|
1451
1470
|
/**
|
|
@@ -1456,23 +1475,23 @@ const gt = class gt {
|
|
|
1456
1475
|
* @param _lineGroups - grouped line rectangles
|
|
1457
1476
|
* @param _lineIndex - the line index
|
|
1458
1477
|
*/
|
|
1459
|
-
static calculateLineTopExtension(t, e, o,
|
|
1478
|
+
static calculateLineTopExtension(t, e, o, n) {
|
|
1460
1479
|
return t;
|
|
1461
1480
|
}
|
|
1462
1481
|
/**
|
|
1463
1482
|
* Calculates bottom extension for a line, accounting for gap to next line
|
|
1464
1483
|
* 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
|
|
1484
|
+
* This prevents overlap: line N's bottom shadow-sm meets line N+1's top shadow exactly
|
|
1466
1485
|
* @param baseExtension - the base extension value
|
|
1467
1486
|
* @param isLastLine - whether this is the last line
|
|
1468
1487
|
* @param lineGroups - grouped line rectangles
|
|
1469
1488
|
* @param lineIndex - the line index
|
|
1470
1489
|
*/
|
|
1471
|
-
static calculateLineBottomExtension(t, e, o,
|
|
1490
|
+
static calculateLineBottomExtension(t, e, o, n) {
|
|
1472
1491
|
if (e)
|
|
1473
1492
|
return t;
|
|
1474
|
-
const
|
|
1475
|
-
return t +
|
|
1493
|
+
const r = o[n], a = o[n + 1].top - r.bottom, c = Math.max(0, a - t);
|
|
1494
|
+
return t + c;
|
|
1476
1495
|
}
|
|
1477
1496
|
/**
|
|
1478
1497
|
* Builds box-shadow CSS value from top and bottom extensions
|
|
@@ -1486,9 +1505,9 @@ const gt = class gt {
|
|
|
1486
1505
|
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
1506
|
}
|
|
1488
1507
|
};
|
|
1489
|
-
|
|
1490
|
-
let
|
|
1491
|
-
class
|
|
1508
|
+
Lt.BG_COLOR = "rgba(0, 0, 0, 0.08)";
|
|
1509
|
+
let U = Lt;
|
|
1510
|
+
class Ct {
|
|
1492
1511
|
/**
|
|
1493
1512
|
* Collects text nodes that intersect with the passed range
|
|
1494
1513
|
* @param range - selection range
|
|
@@ -1497,15 +1516,15 @@ class ct {
|
|
|
1497
1516
|
const e = [], { commonAncestorContainer: o } = t;
|
|
1498
1517
|
if (o.nodeType === Node.TEXT_NODE)
|
|
1499
1518
|
return e.push(o), e;
|
|
1500
|
-
const
|
|
1519
|
+
const n = document.createTreeWalker(
|
|
1501
1520
|
o,
|
|
1502
1521
|
NodeFilter.SHOW_TEXT,
|
|
1503
1522
|
{
|
|
1504
|
-
acceptNode: (
|
|
1523
|
+
acceptNode: (r) => t.intersectsNode(r) && r.textContent && r.textContent.length > 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
|
|
1505
1524
|
}
|
|
1506
1525
|
);
|
|
1507
|
-
for (;
|
|
1508
|
-
e.push(
|
|
1526
|
+
for (; n.nextNode(); )
|
|
1527
|
+
e.push(n.currentNode);
|
|
1509
1528
|
return e;
|
|
1510
1529
|
}
|
|
1511
1530
|
/**
|
|
@@ -1514,14 +1533,14 @@ class ct {
|
|
|
1514
1533
|
* @param expectedLines - expected number of lines
|
|
1515
1534
|
*/
|
|
1516
1535
|
static findLineBreakPositions(t, e) {
|
|
1517
|
-
const o = t.textContent || "",
|
|
1518
|
-
return Array.from({ length: o.length }, (a,
|
|
1519
|
-
(a,
|
|
1536
|
+
const o = t.textContent || "", n = document.createRange();
|
|
1537
|
+
return Array.from({ length: o.length }, (a, l) => l).reduce(
|
|
1538
|
+
(a, l) => {
|
|
1520
1539
|
if (a.positions.length >= e - 1)
|
|
1521
1540
|
return a;
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1524
|
-
return a.lastTop !== -1 && Math.abs(
|
|
1541
|
+
n.setStart(t, l), n.setEnd(t, l + 1);
|
|
1542
|
+
const c = n.getBoundingClientRect();
|
|
1543
|
+
return a.lastTop !== -1 && Math.abs(c.top - a.lastTop) > 5 && a.positions.push(l), { positions: a.positions, lastTop: c.top };
|
|
1525
1544
|
},
|
|
1526
1545
|
{ positions: [], lastTop: -1 }
|
|
1527
1546
|
).positions;
|
|
@@ -1533,10 +1552,10 @@ class ct {
|
|
|
1533
1552
|
*/
|
|
1534
1553
|
static splitTextAtPositions(t, e) {
|
|
1535
1554
|
const o = [0, ...e, t.length];
|
|
1536
|
-
return o.slice(0, -1).map((
|
|
1555
|
+
return o.slice(0, -1).map((n, r) => t.substring(n, o[r + 1])).filter((n) => n.length > 0);
|
|
1537
1556
|
}
|
|
1538
1557
|
}
|
|
1539
|
-
class
|
|
1558
|
+
class tt {
|
|
1540
1559
|
/**
|
|
1541
1560
|
* Wraps passed range with a highlight span styled like an unfocused selection (gray)
|
|
1542
1561
|
* @param range - range to wrap
|
|
@@ -1544,7 +1563,7 @@ class _ {
|
|
|
1544
1563
|
static wrapRangeWithHighlight(t) {
|
|
1545
1564
|
if (t.collapsed)
|
|
1546
1565
|
return null;
|
|
1547
|
-
const e =
|
|
1566
|
+
const e = m.make("span");
|
|
1548
1567
|
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
1568
|
const o = t.extractContents();
|
|
1550
1569
|
return o.childNodes.length === 0 ? null : (e.appendChild(o), t.insertNode(e), e);
|
|
@@ -1557,8 +1576,8 @@ class _ {
|
|
|
1557
1576
|
static postProcessHighlightWrappers(t) {
|
|
1558
1577
|
const e = [];
|
|
1559
1578
|
return t.forEach((o) => {
|
|
1560
|
-
const
|
|
1561
|
-
e.push(...
|
|
1579
|
+
const n = this.splitMultiLineWrapper(o);
|
|
1580
|
+
e.push(...n);
|
|
1562
1581
|
}), e;
|
|
1563
1582
|
}
|
|
1564
1583
|
/**
|
|
@@ -1570,23 +1589,23 @@ class _ {
|
|
|
1570
1589
|
static splitMultiLineWrapper(t) {
|
|
1571
1590
|
const e = t.getClientRects();
|
|
1572
1591
|
if (e.length <= 1)
|
|
1573
|
-
return
|
|
1574
|
-
const o = t.textContent || "",
|
|
1575
|
-
if (!
|
|
1576
|
-
return
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1579
|
-
return
|
|
1580
|
-
const a =
|
|
1592
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1593
|
+
const o = t.textContent || "", n = t.parentNode;
|
|
1594
|
+
if (!n || !o)
|
|
1595
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1596
|
+
const r = [], i = t.firstChild;
|
|
1597
|
+
if (!i || i.nodeType !== Node.TEXT_NODE)
|
|
1598
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1599
|
+
const a = Ct.findLineBreakPositions(i, e.length);
|
|
1581
1600
|
if (a.length === 0)
|
|
1582
|
-
return
|
|
1583
|
-
const
|
|
1584
|
-
return
|
|
1585
|
-
if (
|
|
1601
|
+
return U.applyBoxShadowToWrapper(t), [t];
|
|
1602
|
+
const l = Ct.splitTextAtPositions(o, a), c = document.createDocumentFragment();
|
|
1603
|
+
return l.forEach((d) => {
|
|
1604
|
+
if (d.length === 0)
|
|
1586
1605
|
return;
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
}),
|
|
1606
|
+
const h = m.make("span");
|
|
1607
|
+
h.setAttribute("data-blok-testid", "fake-background"), h.setAttribute("data-blok-fake-background", "true"), h.setAttribute("data-blok-mutation-free", "true"), h.style.color = "inherit", h.style.boxDecorationBreak = "clone", h.style["-webkit-box-decoration-break"] = "clone", h.style.whiteSpace = "pre-wrap", h.textContent = d, c.appendChild(h), r.push(h);
|
|
1608
|
+
}), n.replaceChild(c, t), r;
|
|
1590
1609
|
}
|
|
1591
1610
|
/**
|
|
1592
1611
|
* Removes fake background wrapper
|
|
@@ -1601,7 +1620,7 @@ class _ {
|
|
|
1601
1620
|
}
|
|
1602
1621
|
}
|
|
1603
1622
|
}
|
|
1604
|
-
class
|
|
1623
|
+
class Me {
|
|
1605
1624
|
constructor(t) {
|
|
1606
1625
|
this.selectionUtils = t;
|
|
1607
1626
|
}
|
|
@@ -1618,26 +1637,26 @@ class ie {
|
|
|
1618
1637
|
const e = t.getRangeAt(0);
|
|
1619
1638
|
if (e.collapsed)
|
|
1620
1639
|
return;
|
|
1621
|
-
const o =
|
|
1640
|
+
const o = Ct.collectTextNodes(e);
|
|
1622
1641
|
if (o.length === 0)
|
|
1623
1642
|
return;
|
|
1624
|
-
const
|
|
1625
|
-
if (o.forEach((
|
|
1626
|
-
var
|
|
1627
|
-
const
|
|
1628
|
-
if (
|
|
1643
|
+
const n = e.startContainer, r = e.startOffset, i = e.endContainer, a = e.endOffset, l = [];
|
|
1644
|
+
if (o.forEach((u) => {
|
|
1645
|
+
var I, $;
|
|
1646
|
+
const g = document.createRange(), f = u === n, b = u === i, w = f ? r : 0, C = ($ = (I = u.textContent) == null ? void 0 : I.length) != null ? $ : 0, k = b ? a : C;
|
|
1647
|
+
if (w === k)
|
|
1629
1648
|
return;
|
|
1630
|
-
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
}),
|
|
1649
|
+
g.setStart(u, w), g.setEnd(u, k);
|
|
1650
|
+
const T = tt.wrapRangeWithHighlight(g);
|
|
1651
|
+
T && l.push(T);
|
|
1652
|
+
}), l.length === 0)
|
|
1634
1653
|
return;
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1654
|
+
const c = tt.postProcessHighlightWrappers(l);
|
|
1655
|
+
U.applyLineHeightExtensions(c);
|
|
1656
|
+
const d = document.createRange();
|
|
1657
|
+
d.setStartBefore(c[0]), d.setEndAfter(c[c.length - 1]), this.selectionUtils.savedSelectionRange = d.cloneRange();
|
|
1658
|
+
const h = window.getSelection();
|
|
1659
|
+
h && (h.removeAllRanges(), h.addRange(d)), this.selectionUtils.isFakeBackgroundEnabled = !0;
|
|
1641
1660
|
}
|
|
1642
1661
|
/**
|
|
1643
1662
|
* Removes fake background
|
|
@@ -1653,7 +1672,7 @@ class ie {
|
|
|
1653
1672
|
*/
|
|
1654
1673
|
removeOrphanedFakeBackgroundElements() {
|
|
1655
1674
|
document.querySelectorAll('[data-blok-fake-background="true"]').forEach((e) => {
|
|
1656
|
-
|
|
1675
|
+
tt.unwrapFakeBackground(e);
|
|
1657
1676
|
});
|
|
1658
1677
|
}
|
|
1659
1678
|
/**
|
|
@@ -1667,47 +1686,47 @@ class ie {
|
|
|
1667
1686
|
* Removes highlight spans and reconstructs the saved selection range
|
|
1668
1687
|
*/
|
|
1669
1688
|
removeHighlightSpans() {
|
|
1670
|
-
var
|
|
1689
|
+
var i;
|
|
1671
1690
|
const t = document.querySelectorAll('[data-blok-fake-background="true"]');
|
|
1672
1691
|
if (t.length === 0)
|
|
1673
1692
|
return;
|
|
1674
|
-
const e = t[0], o = t[t.length - 1],
|
|
1693
|
+
const e = t[0], o = t[t.length - 1], n = e.firstChild, r = o.lastChild;
|
|
1675
1694
|
if (t.forEach((a) => {
|
|
1676
|
-
|
|
1677
|
-
}),
|
|
1695
|
+
tt.unwrapFakeBackground(a);
|
|
1696
|
+
}), n && r) {
|
|
1678
1697
|
const a = document.createRange();
|
|
1679
|
-
a.setStart(
|
|
1698
|
+
a.setStart(n, 0), a.setEnd(r, ((i = r.textContent) == null ? void 0 : i.length) || 0), this.selectionUtils.savedSelectionRange = a;
|
|
1680
1699
|
}
|
|
1681
1700
|
}
|
|
1682
1701
|
}
|
|
1683
|
-
class
|
|
1702
|
+
class gt {
|
|
1684
1703
|
/**
|
|
1685
1704
|
* Adds fake cursor to the current range
|
|
1686
1705
|
*/
|
|
1687
1706
|
static addFakeCursor() {
|
|
1688
|
-
const t =
|
|
1707
|
+
const t = y.getRange();
|
|
1689
1708
|
if (t === null)
|
|
1690
1709
|
return;
|
|
1691
|
-
const e =
|
|
1692
|
-
e.setAttribute(
|
|
1710
|
+
const e = m.make("span");
|
|
1711
|
+
e.setAttribute(p.fakeCursor, ""), e.setAttribute("data-blok-mutation-free", "true"), t.collapse(), t.insertNode(e);
|
|
1693
1712
|
}
|
|
1694
1713
|
/**
|
|
1695
1714
|
* Check if passed element contains a fake cursor
|
|
1696
1715
|
* @param el - where to check
|
|
1697
1716
|
*/
|
|
1698
1717
|
static isFakeCursorInsideContainer(t) {
|
|
1699
|
-
return
|
|
1718
|
+
return m.find(t, st(p.fakeCursor)) !== null;
|
|
1700
1719
|
}
|
|
1701
1720
|
/**
|
|
1702
1721
|
* Removes fake cursor from a container
|
|
1703
1722
|
* @param container - container to look for
|
|
1704
1723
|
*/
|
|
1705
1724
|
static removeFakeCursor(t = document.body) {
|
|
1706
|
-
const e =
|
|
1725
|
+
const e = m.find(t, st(p.fakeCursor));
|
|
1707
1726
|
e && e.remove();
|
|
1708
1727
|
}
|
|
1709
1728
|
}
|
|
1710
|
-
class
|
|
1729
|
+
class $t {
|
|
1711
1730
|
/**
|
|
1712
1731
|
* Looks ahead to find passed tag from current selection
|
|
1713
1732
|
* @param tagName - tag to find
|
|
@@ -1715,30 +1734,30 @@ class Tt {
|
|
|
1715
1734
|
* @param searchDepth - count of tags that can be included. For better performance.
|
|
1716
1735
|
*/
|
|
1717
1736
|
static findParentTag(t, e, o = 10) {
|
|
1718
|
-
const
|
|
1719
|
-
if (!
|
|
1737
|
+
const n = window.getSelection();
|
|
1738
|
+
if (!n || !n.anchorNode || !n.focusNode)
|
|
1720
1739
|
return null;
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
],
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1740
|
+
const r = [
|
|
1741
|
+
n.anchorNode,
|
|
1742
|
+
n.focusNode
|
|
1743
|
+
], i = (a) => {
|
|
1744
|
+
const l = (c, d) => {
|
|
1745
|
+
if (d <= 0 || !c)
|
|
1727
1746
|
return null;
|
|
1728
|
-
const
|
|
1729
|
-
if (
|
|
1730
|
-
return
|
|
1731
|
-
if (!
|
|
1747
|
+
const h = c.nodeType === Node.ELEMENT_NODE && c.tagName === t, u = !e || c.classList && c.classList.contains(e);
|
|
1748
|
+
if (h && u)
|
|
1749
|
+
return c;
|
|
1750
|
+
if (!c.parentNode)
|
|
1732
1751
|
return null;
|
|
1733
|
-
const
|
|
1734
|
-
return
|
|
1752
|
+
const g = c.parentNode, f = !e || g.classList && g.classList.contains(e);
|
|
1753
|
+
return g.tagName === t && f ? g : l(g, d - 1);
|
|
1735
1754
|
};
|
|
1736
|
-
return
|
|
1755
|
+
return l(a, o);
|
|
1737
1756
|
};
|
|
1738
|
-
for (const a of
|
|
1739
|
-
const
|
|
1740
|
-
if (
|
|
1741
|
-
return
|
|
1757
|
+
for (const a of r) {
|
|
1758
|
+
const l = i(a);
|
|
1759
|
+
if (l)
|
|
1760
|
+
return l;
|
|
1742
1761
|
}
|
|
1743
1762
|
return null;
|
|
1744
1763
|
}
|
|
@@ -1755,9 +1774,9 @@ class Tt {
|
|
|
1755
1774
|
o.selectNodeContents(t), e.addRange(o);
|
|
1756
1775
|
}
|
|
1757
1776
|
}
|
|
1758
|
-
class
|
|
1777
|
+
class oe {
|
|
1759
1778
|
constructor() {
|
|
1760
|
-
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new
|
|
1779
|
+
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new Me(this);
|
|
1761
1780
|
}
|
|
1762
1781
|
// ========================
|
|
1763
1782
|
// Static getters - delegate to core module
|
|
@@ -1768,14 +1787,14 @@ class Ot {
|
|
|
1768
1787
|
* @returns {Node|null}
|
|
1769
1788
|
*/
|
|
1770
1789
|
static get anchorNode() {
|
|
1771
|
-
return
|
|
1790
|
+
return y.getAnchorNode();
|
|
1772
1791
|
}
|
|
1773
1792
|
/**
|
|
1774
1793
|
* Returns selected anchor element
|
|
1775
1794
|
* @returns {Element|null}
|
|
1776
1795
|
*/
|
|
1777
1796
|
static get anchorElement() {
|
|
1778
|
-
return
|
|
1797
|
+
return y.getAnchorElement();
|
|
1779
1798
|
}
|
|
1780
1799
|
/**
|
|
1781
1800
|
* Returns selection offset according to the anchor node
|
|
@@ -1783,69 +1802,69 @@ class Ot {
|
|
|
1783
1802
|
* @returns {number|null}
|
|
1784
1803
|
*/
|
|
1785
1804
|
static get anchorOffset() {
|
|
1786
|
-
return
|
|
1805
|
+
return y.getAnchorOffset();
|
|
1787
1806
|
}
|
|
1788
1807
|
/**
|
|
1789
1808
|
* Is current selection range collapsed
|
|
1790
1809
|
* @returns {boolean|null}
|
|
1791
1810
|
*/
|
|
1792
1811
|
static get isCollapsed() {
|
|
1793
|
-
return
|
|
1812
|
+
return y.getIsCollapsed();
|
|
1794
1813
|
}
|
|
1795
1814
|
/**
|
|
1796
1815
|
* Check current selection if it is at Blok's zone
|
|
1797
1816
|
* @returns {boolean}
|
|
1798
1817
|
*/
|
|
1799
1818
|
static get isAtBlok() {
|
|
1800
|
-
return
|
|
1819
|
+
return y.getIsAtBlok();
|
|
1801
1820
|
}
|
|
1802
1821
|
/**
|
|
1803
1822
|
* Check if passed selection is at Blok's zone
|
|
1804
1823
|
* @param selection - Selection object to check
|
|
1805
1824
|
*/
|
|
1806
1825
|
static isSelectionAtBlok(t) {
|
|
1807
|
-
return
|
|
1826
|
+
return y.isSelectionAtBlok(t);
|
|
1808
1827
|
}
|
|
1809
1828
|
/**
|
|
1810
1829
|
* Check if passed range at Blok zone
|
|
1811
1830
|
* @param range - range to check
|
|
1812
1831
|
*/
|
|
1813
1832
|
static isRangeAtBlok(t) {
|
|
1814
|
-
return
|
|
1833
|
+
return y.isRangeAtBlok(t);
|
|
1815
1834
|
}
|
|
1816
1835
|
/**
|
|
1817
1836
|
* Methods return boolean that true if selection exists on the page
|
|
1818
1837
|
*/
|
|
1819
1838
|
static get isSelectionExists() {
|
|
1820
|
-
return
|
|
1839
|
+
return y.getIsSelectionExists();
|
|
1821
1840
|
}
|
|
1822
1841
|
/**
|
|
1823
1842
|
* Return first range
|
|
1824
1843
|
* @returns {Range|null}
|
|
1825
1844
|
*/
|
|
1826
1845
|
static get range() {
|
|
1827
|
-
return
|
|
1846
|
+
return y.getRange();
|
|
1828
1847
|
}
|
|
1829
1848
|
/**
|
|
1830
1849
|
* Returns range from passed Selection object
|
|
1831
1850
|
* @param selection - Selection object to get Range from
|
|
1832
1851
|
*/
|
|
1833
1852
|
static getRangeFromSelection(t) {
|
|
1834
|
-
return
|
|
1853
|
+
return y.getRangeFromSelection(t);
|
|
1835
1854
|
}
|
|
1836
1855
|
/**
|
|
1837
1856
|
* Calculates position and size of selected text
|
|
1838
1857
|
* @returns {DOMRect}
|
|
1839
1858
|
*/
|
|
1840
1859
|
static get rect() {
|
|
1841
|
-
return
|
|
1860
|
+
return y.getRect();
|
|
1842
1861
|
}
|
|
1843
1862
|
/**
|
|
1844
1863
|
* Returns selected text as String
|
|
1845
1864
|
* @returns {string}
|
|
1846
1865
|
*/
|
|
1847
1866
|
static get text() {
|
|
1848
|
-
return
|
|
1867
|
+
return y.getText();
|
|
1849
1868
|
}
|
|
1850
1869
|
/**
|
|
1851
1870
|
* Returns window Selection
|
|
@@ -1853,7 +1872,7 @@ class Ot {
|
|
|
1853
1872
|
* @returns {Selection}
|
|
1854
1873
|
*/
|
|
1855
1874
|
static get() {
|
|
1856
|
-
return
|
|
1875
|
+
return y.get();
|
|
1857
1876
|
}
|
|
1858
1877
|
// ========================
|
|
1859
1878
|
// Static methods - delegate to appropriate modules
|
|
@@ -1864,34 +1883,34 @@ class Ot {
|
|
|
1864
1883
|
* @param offset - offset of cursor
|
|
1865
1884
|
*/
|
|
1866
1885
|
static setCursor(t, e = 0) {
|
|
1867
|
-
return
|
|
1886
|
+
return ft.setCursor(t, e);
|
|
1868
1887
|
}
|
|
1869
1888
|
/**
|
|
1870
1889
|
* Check if current range exists and belongs to container
|
|
1871
1890
|
* @param container - where range should be
|
|
1872
1891
|
*/
|
|
1873
1892
|
static isRangeInsideContainer(t) {
|
|
1874
|
-
return
|
|
1893
|
+
return ft.isRangeInsideContainer(t);
|
|
1875
1894
|
}
|
|
1876
1895
|
/**
|
|
1877
1896
|
* Adds fake cursor to the current range
|
|
1878
1897
|
*/
|
|
1879
1898
|
static addFakeCursor() {
|
|
1880
|
-
|
|
1899
|
+
gt.addFakeCursor();
|
|
1881
1900
|
}
|
|
1882
1901
|
/**
|
|
1883
1902
|
* Check if passed element contains a fake cursor
|
|
1884
1903
|
* @param el - where to check
|
|
1885
1904
|
*/
|
|
1886
1905
|
static isFakeCursorInsideContainer(t) {
|
|
1887
|
-
return
|
|
1906
|
+
return gt.isFakeCursorInsideContainer(t);
|
|
1888
1907
|
}
|
|
1889
1908
|
/**
|
|
1890
1909
|
* Removes fake cursor from a container
|
|
1891
1910
|
* @param container - container to look for
|
|
1892
1911
|
*/
|
|
1893
1912
|
static removeFakeCursor(t = document.body) {
|
|
1894
|
-
|
|
1913
|
+
gt.removeFakeCursor(t);
|
|
1895
1914
|
}
|
|
1896
1915
|
// ========================
|
|
1897
1916
|
// Instance methods - delegate to FakeBackgroundManager or use instance state
|
|
@@ -1930,7 +1949,7 @@ class Ot {
|
|
|
1930
1949
|
* Save Selection's range
|
|
1931
1950
|
*/
|
|
1932
1951
|
save() {
|
|
1933
|
-
this.savedSelectionRange =
|
|
1952
|
+
this.savedSelectionRange = y.getRange();
|
|
1934
1953
|
}
|
|
1935
1954
|
/**
|
|
1936
1955
|
* Restore saved Selection's range
|
|
@@ -1951,7 +1970,7 @@ class Ot {
|
|
|
1951
1970
|
* Collapse current selection
|
|
1952
1971
|
*/
|
|
1953
1972
|
collapseToEnd() {
|
|
1954
|
-
|
|
1973
|
+
ft.collapseToEnd();
|
|
1955
1974
|
}
|
|
1956
1975
|
/**
|
|
1957
1976
|
* Looks ahead to find passed tag from current selection
|
|
@@ -1961,25 +1980,29 @@ class Ot {
|
|
|
1961
1980
|
* @returns {HTMLElement|null}
|
|
1962
1981
|
*/
|
|
1963
1982
|
findParentTag(t, e, o = 10) {
|
|
1964
|
-
return
|
|
1983
|
+
return $t.findParentTag(t, e, o);
|
|
1965
1984
|
}
|
|
1966
1985
|
/**
|
|
1967
1986
|
* Expands selection range to the passed parent node
|
|
1968
1987
|
* @param element - element which contents should be selected
|
|
1969
1988
|
*/
|
|
1970
1989
|
expandToTag(t) {
|
|
1971
|
-
|
|
1990
|
+
$t.expandToTag(t);
|
|
1972
1991
|
}
|
|
1973
1992
|
}
|
|
1974
|
-
const
|
|
1993
|
+
const Re = [
|
|
1975
1994
|
// Max-width: max-w-* classes conflict with each other
|
|
1976
1995
|
{ pattern: /^max-w-(.+)$/, getGroup: () => "max-w" },
|
|
1977
1996
|
// Width: w-* classes conflict with each other
|
|
1978
1997
|
{ pattern: /^w-(.+)$/, getGroup: () => "w" },
|
|
1979
1998
|
// Min-width: min-w-* classes conflict with each other
|
|
1980
1999
|
{ pattern: /^min-w-(.+)$/, getGroup: () => "min-w" },
|
|
2000
|
+
// Max-height: max-h-* classes conflict with each other
|
|
2001
|
+
{ pattern: /^max-h-(.+)$/, getGroup: () => "max-h" },
|
|
1981
2002
|
// Height: h-* classes conflict with each other
|
|
1982
2003
|
{ pattern: /^h-(.+)$/, getGroup: () => "h" },
|
|
2004
|
+
// Min-height: min-h-* classes conflict with each other
|
|
2005
|
+
{ pattern: /^min-h-(.+)$/, getGroup: () => "min-h" },
|
|
1983
2006
|
// Display: block, inline-block, flex, hidden, etc.
|
|
1984
2007
|
{ pattern: /^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|hidden|contents|flow-root|list-item)$/, getGroup: () => "display" },
|
|
1985
2008
|
// Flex direction: flex-row, flex-col
|
|
@@ -2003,7 +2026,7 @@ const re = [
|
|
|
2003
2026
|
// Inset (all sides): inset-*
|
|
2004
2027
|
{ pattern: /^inset-(.+)$/, getGroup: () => "inset" },
|
|
2005
2028
|
// Top/Right/Bottom/Left positioning
|
|
2006
|
-
{ pattern: /^(top|right|bottom|left)-(.+)$/, getGroup: (
|
|
2029
|
+
{ pattern: /^(top|right|bottom|left)-(.+)$/, getGroup: (s) => s[1] },
|
|
2007
2030
|
// Margin: m-*, mx-*, my-*, mt-*, mr-*, mb-*, ml-*
|
|
2008
2031
|
{ pattern: /^!?m-(.+)$/, getGroup: () => "m" },
|
|
2009
2032
|
{ pattern: /^!?mx-(.+)$/, getGroup: () => "mx" },
|
|
@@ -2023,7 +2046,7 @@ const re = [
|
|
|
2023
2046
|
// Gap: gap-*, gap-x-*, gap-y-*
|
|
2024
2047
|
{ pattern: /^gap-(.+)$/, getGroup: () => "gap" },
|
|
2025
2048
|
// Border radius: rounded-*
|
|
2026
|
-
{ pattern: /^rounded(-.*)?$/, getGroup: () => "rounded" },
|
|
2049
|
+
{ pattern: /^rounded(-.*)?$/, getGroup: () => "rounded-sm" },
|
|
2027
2050
|
// Visibility: visible, invisible
|
|
2028
2051
|
{ pattern: /^(visible|invisible)$/, getGroup: () => "visibility" },
|
|
2029
2052
|
// Overflow: overflow-*
|
|
@@ -2047,33 +2070,37 @@ const re = [
|
|
|
2047
2070
|
// Line height: leading-*
|
|
2048
2071
|
{ pattern: /^leading-(.+)$/, getGroup: () => "leading" },
|
|
2049
2072
|
// Outline: outline-*
|
|
2050
|
-
{ pattern: /^outline(-.*)?$/, getGroup: () => "outline" },
|
|
2051
|
-
// Border: border
|
|
2052
|
-
{ pattern: /^border(
|
|
2073
|
+
{ pattern: /^outline(-.*)?$/, getGroup: () => "outline-solid" },
|
|
2074
|
+
// Border width/style: border, border-0, border-none
|
|
2075
|
+
{ pattern: /^border(?:-(?:none|0))?$/, getGroup: () => "border-w" },
|
|
2076
|
+
// Border side width: border-{t,r,b,l}(-{suffix})?
|
|
2077
|
+
{ pattern: /^border-([trlb])(?:-|$)/, getGroup: (s) => `border-${s[1]}` },
|
|
2078
|
+
// Border color: everything else with border- prefix
|
|
2079
|
+
{ pattern: /^border-.+$/, getGroup: () => "border-color" },
|
|
2053
2080
|
// Shadow: shadow-*
|
|
2054
|
-
{ pattern: /^shadow(-.*)?$/, getGroup: () => "shadow" }
|
|
2055
|
-
],
|
|
2056
|
-
const t =
|
|
2081
|
+
{ pattern: /^shadow(-.*)?$/, getGroup: () => "shadow-sm" }
|
|
2082
|
+
], mt = /* @__PURE__ */ new Map(), Be = (s) => {
|
|
2083
|
+
const t = mt.get(s);
|
|
2057
2084
|
if (t !== void 0)
|
|
2058
2085
|
return t;
|
|
2059
|
-
for (const { pattern: e, getGroup: o } of
|
|
2060
|
-
const
|
|
2061
|
-
if (
|
|
2062
|
-
const
|
|
2063
|
-
return
|
|
2086
|
+
for (const { pattern: e, getGroup: o } of Re) {
|
|
2087
|
+
const n = s.match(e);
|
|
2088
|
+
if (n) {
|
|
2089
|
+
const r = o(n);
|
|
2090
|
+
return mt.set(s, r), r;
|
|
2064
2091
|
}
|
|
2065
2092
|
}
|
|
2066
|
-
return
|
|
2067
|
-
},
|
|
2068
|
-
const o =
|
|
2093
|
+
return mt.set(s, null), null;
|
|
2094
|
+
}, He = (s, t, e) => {
|
|
2095
|
+
const o = Be(s);
|
|
2069
2096
|
if (o) {
|
|
2070
|
-
t.set(o,
|
|
2097
|
+
t.set(o, s);
|
|
2071
2098
|
return;
|
|
2072
2099
|
}
|
|
2073
|
-
e.includes(
|
|
2074
|
-
},
|
|
2100
|
+
e.includes(s) || e.push(s);
|
|
2101
|
+
}, Fe = (s) => {
|
|
2075
2102
|
const t = [];
|
|
2076
|
-
for (const e of
|
|
2103
|
+
for (const e of s)
|
|
2077
2104
|
if (e) {
|
|
2078
2105
|
if (Array.isArray(e)) {
|
|
2079
2106
|
t.push(...e.filter(Boolean));
|
|
@@ -2082,14 +2109,237 @@ const re = [
|
|
|
2082
2109
|
t.push(e);
|
|
2083
2110
|
}
|
|
2084
2111
|
return t;
|
|
2085
|
-
},
|
|
2086
|
-
const t = /* @__PURE__ */ new Map(), e = [], o =
|
|
2087
|
-
for (const
|
|
2088
|
-
|
|
2112
|
+
}, A = (...s) => {
|
|
2113
|
+
const t = /* @__PURE__ */ new Map(), e = [], o = Fe(s);
|
|
2114
|
+
for (const n of o)
|
|
2115
|
+
n.split(/\s+/).filter(Boolean).forEach((i) => He(i, t, e));
|
|
2089
2116
|
return [...e, ...t.values()].join(" ");
|
|
2090
|
-
},
|
|
2091
|
-
var
|
|
2092
|
-
|
|
2117
|
+
}, Dt = (...s) => s.filter(Boolean).join(" ");
|
|
2118
|
+
var _ = /* @__PURE__ */ ((s) => (s.Default = "default", s.Separator = "separator", s.Html = "html", s))(_ || {}), nt = { exports: {} }, Pe = nt.exports, jt;
|
|
2119
|
+
function $e() {
|
|
2120
|
+
return jt || (jt = 1, (function(s, t) {
|
|
2121
|
+
(function(e, o) {
|
|
2122
|
+
s.exports = o();
|
|
2123
|
+
})(Pe, function() {
|
|
2124
|
+
function e(h) {
|
|
2125
|
+
var u = h.tags, g = Object.keys(u), f = g.map(function(b) {
|
|
2126
|
+
return typeof u[b];
|
|
2127
|
+
}).every(function(b) {
|
|
2128
|
+
return b === "object" || b === "boolean" || b === "function";
|
|
2129
|
+
});
|
|
2130
|
+
if (!f)
|
|
2131
|
+
throw new Error("The configuration was invalid");
|
|
2132
|
+
this.config = h;
|
|
2133
|
+
}
|
|
2134
|
+
var o = ["P", "LI", "TD", "TH", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "PRE"];
|
|
2135
|
+
function n(h) {
|
|
2136
|
+
return o.indexOf(h.nodeName) !== -1;
|
|
2137
|
+
}
|
|
2138
|
+
var r = ["A", "B", "STRONG", "I", "EM", "SUB", "SUP", "U", "STRIKE"];
|
|
2139
|
+
function i(h) {
|
|
2140
|
+
return r.indexOf(h.nodeName) !== -1;
|
|
2141
|
+
}
|
|
2142
|
+
e.prototype.clean = function(h) {
|
|
2143
|
+
const u = document.implementation.createHTMLDocument(), g = u.createElement("div");
|
|
2144
|
+
return g.innerHTML = h, this._sanitize(u, g), g.innerHTML;
|
|
2145
|
+
}, e.prototype._sanitize = function(h, u) {
|
|
2146
|
+
var g = a(h, u), f = g.firstChild();
|
|
2147
|
+
if (f)
|
|
2148
|
+
do {
|
|
2149
|
+
if (f.nodeType === Node.TEXT_NODE)
|
|
2150
|
+
if (f.data.trim() === "" && (f.previousElementSibling && n(f.previousElementSibling) || f.nextElementSibling && n(f.nextElementSibling))) {
|
|
2151
|
+
u.removeChild(f), this._sanitize(h, u);
|
|
2152
|
+
break;
|
|
2153
|
+
} else
|
|
2154
|
+
continue;
|
|
2155
|
+
if (f.nodeType === Node.COMMENT_NODE) {
|
|
2156
|
+
u.removeChild(f), this._sanitize(h, u);
|
|
2157
|
+
break;
|
|
2158
|
+
}
|
|
2159
|
+
var b = i(f), w;
|
|
2160
|
+
b && (w = Array.prototype.some.call(f.childNodes, n));
|
|
2161
|
+
var C = !!u.parentNode, k = n(u) && n(f) && C, T = f.nodeName.toLowerCase(), I = l(this.config, T, f), $ = b && w;
|
|
2162
|
+
if ($ || c(f, I) || !this.config.keepNestedBlockElements && k) {
|
|
2163
|
+
if (!(f.nodeName === "SCRIPT" || f.nodeName === "STYLE"))
|
|
2164
|
+
for (; f.childNodes.length > 0; )
|
|
2165
|
+
u.insertBefore(f.childNodes[0], f);
|
|
2166
|
+
u.removeChild(f), this._sanitize(h, u);
|
|
2167
|
+
break;
|
|
2168
|
+
}
|
|
2169
|
+
for (var R = 0; R < f.attributes.length; R += 1) {
|
|
2170
|
+
var K = f.attributes[R];
|
|
2171
|
+
d(K, I, f) && (f.removeAttribute(K.name), R = R - 1);
|
|
2172
|
+
}
|
|
2173
|
+
this._sanitize(h, f);
|
|
2174
|
+
} while (f = g.nextSibling());
|
|
2175
|
+
};
|
|
2176
|
+
function a(h, u) {
|
|
2177
|
+
return h.createTreeWalker(
|
|
2178
|
+
u,
|
|
2179
|
+
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,
|
|
2180
|
+
null,
|
|
2181
|
+
!1
|
|
2182
|
+
);
|
|
2183
|
+
}
|
|
2184
|
+
function l(h, u, g) {
|
|
2185
|
+
return typeof h.tags[u] == "function" ? h.tags[u](g) : h.tags[u];
|
|
2186
|
+
}
|
|
2187
|
+
function c(h, u) {
|
|
2188
|
+
return typeof u == "undefined" ? !0 : typeof u == "boolean" ? !u : !1;
|
|
2189
|
+
}
|
|
2190
|
+
function d(h, u, g) {
|
|
2191
|
+
var f = h.name.toLowerCase();
|
|
2192
|
+
return u === !0 ? !1 : typeof u[f] == "function" ? !u[f](h.value, g) : typeof u[f] == "undefined" || u[f] === !1 ? !0 : typeof u[f] == "string" ? u[f] !== h.value : !1;
|
|
2193
|
+
}
|
|
2194
|
+
return e;
|
|
2195
|
+
});
|
|
2196
|
+
})(nt)), nt.exports;
|
|
2197
|
+
}
|
|
2198
|
+
var De = $e();
|
|
2199
|
+
const je = /* @__PURE__ */ ge(De), _e = /^\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)/i, Ge = /\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, Jo = (s, t, e = {}) => s.map((o) => {
|
|
2200
|
+
const n = E(t) ? t(o.tool) : t, r = n != null ? n : {};
|
|
2201
|
+
return x(r) && M(r) && M(e) ? o : D(N({}, o), {
|
|
2202
|
+
data: It(o.data, r, e)
|
|
2203
|
+
});
|
|
2204
|
+
}), yt = (s, t = {}) => {
|
|
2205
|
+
const e = {
|
|
2206
|
+
tags: t
|
|
2207
|
+
};
|
|
2208
|
+
return new je(e).clean(s);
|
|
2209
|
+
}, It = (s, t, e) => Array.isArray(s) ? We(s, t, e) : x(s) ? Ve(s, t, e) : P(s) ? Ue(s, t, e) : s, We = (s, t, e) => s.map((o) => It(o, t, e)), Ve = (s, t, e) => {
|
|
2210
|
+
const o = {}, n = s;
|
|
2211
|
+
for (const r in s) {
|
|
2212
|
+
if (!Object.prototype.hasOwnProperty.call(s, r))
|
|
2213
|
+
continue;
|
|
2214
|
+
const i = n[r], a = x(t) ? t : void 0, l = a == null ? void 0 : a[r], c = l !== void 0 && ze(l) ? l : t;
|
|
2215
|
+
o[r] = It(i, c, e);
|
|
2216
|
+
}
|
|
2217
|
+
return o;
|
|
2218
|
+
}, Ue = (s, t, e) => {
|
|
2219
|
+
const o = Ze(t, e);
|
|
2220
|
+
if (o) {
|
|
2221
|
+
const n = yt(s, o);
|
|
2222
|
+
return vt(Gt(n, o));
|
|
2223
|
+
}
|
|
2224
|
+
if (!M(e)) {
|
|
2225
|
+
const n = yt(s, e);
|
|
2226
|
+
return vt(Gt(n, e));
|
|
2227
|
+
}
|
|
2228
|
+
return vt(s);
|
|
2229
|
+
}, ze = (s) => x(s) || Xt(s) || E(s), Ke = (s) => s ? _e.test(s) : !1, vt = (s) => {
|
|
2230
|
+
if (!s || s.indexOf("<") === -1)
|
|
2231
|
+
return s;
|
|
2232
|
+
if (typeof document != "undefined") {
|
|
2233
|
+
const t = document.createElement("template");
|
|
2234
|
+
return t.innerHTML = s, t.content.querySelectorAll("[href],[src]").forEach((o) => {
|
|
2235
|
+
["href", "src"].forEach((n) => {
|
|
2236
|
+
const r = o.getAttribute(n);
|
|
2237
|
+
Ke(r) && o.removeAttribute(n);
|
|
2238
|
+
});
|
|
2239
|
+
}), t.innerHTML;
|
|
2240
|
+
}
|
|
2241
|
+
return s.replace(Ge, "");
|
|
2242
|
+
}, At = (s) => {
|
|
2243
|
+
if (M(s))
|
|
2244
|
+
return {};
|
|
2245
|
+
const t = {};
|
|
2246
|
+
for (const e in s)
|
|
2247
|
+
Object.prototype.hasOwnProperty.call(s, e) && (t[e] = F(s[e]));
|
|
2248
|
+
return t;
|
|
2249
|
+
}, _t = (s) => function(e) {
|
|
2250
|
+
const o = s.call(this, e);
|
|
2251
|
+
return o == null ? {} : o;
|
|
2252
|
+
}, qe = /* @__PURE__ */ new Set(["class", "id", "title", "role", "dir", "lang"]), Xe = (s) => {
|
|
2253
|
+
const t = s.toLowerCase();
|
|
2254
|
+
return t.startsWith("data-") || t.startsWith("aria-") || qe.has(t);
|
|
2255
|
+
}, Ye = (s) => {
|
|
2256
|
+
const t = {};
|
|
2257
|
+
return Array.from(s.attributes).forEach((e) => {
|
|
2258
|
+
Xe(e.name) && (t[e.name] = !0);
|
|
2259
|
+
}), t;
|
|
2260
|
+
}, F = (s) => s === !0 ? _t(Ye) : s === !1 ? !1 : E(s) ? _t(s) : P(s) ? s : x(s) ? it({}, s) : s, Je = (s, t) => {
|
|
2261
|
+
if (M(s))
|
|
2262
|
+
return At(t);
|
|
2263
|
+
const e = {};
|
|
2264
|
+
for (const o in s) {
|
|
2265
|
+
if (!Object.prototype.hasOwnProperty.call(s, o))
|
|
2266
|
+
continue;
|
|
2267
|
+
const n = s[o], r = t ? t[o] : void 0;
|
|
2268
|
+
if (E(r)) {
|
|
2269
|
+
e[o] = F(r);
|
|
2270
|
+
continue;
|
|
2271
|
+
}
|
|
2272
|
+
if (E(n)) {
|
|
2273
|
+
e[o] = F(n);
|
|
2274
|
+
continue;
|
|
2275
|
+
}
|
|
2276
|
+
if (x(n) && x(r)) {
|
|
2277
|
+
e[o] = it({}, r, n);
|
|
2278
|
+
continue;
|
|
2279
|
+
}
|
|
2280
|
+
if (r !== void 0) {
|
|
2281
|
+
e[o] = F(r);
|
|
2282
|
+
continue;
|
|
2283
|
+
}
|
|
2284
|
+
e[o] = F(n);
|
|
2285
|
+
}
|
|
2286
|
+
if (!t)
|
|
2287
|
+
return e;
|
|
2288
|
+
for (const o in t)
|
|
2289
|
+
Object.prototype.hasOwnProperty.call(t, o) && (Object.prototype.hasOwnProperty.call(e, o) || (e[o] = F(t[o])));
|
|
2290
|
+
return e;
|
|
2291
|
+
}, Ze = (s, t) => x(s) && !E(s) ? Je(t, s) : s === !1 ? {} : M(t) ? null : At(t), Zo = (s, ...t) => {
|
|
2292
|
+
if (M(s))
|
|
2293
|
+
return Object.assign({}, ...t);
|
|
2294
|
+
const e = At(s);
|
|
2295
|
+
return t.forEach((o) => {
|
|
2296
|
+
if (o)
|
|
2297
|
+
for (const n in o) {
|
|
2298
|
+
if (!Object.prototype.hasOwnProperty.call(o, n))
|
|
2299
|
+
continue;
|
|
2300
|
+
const r = o[n];
|
|
2301
|
+
if (!Object.prototype.hasOwnProperty.call(e, n))
|
|
2302
|
+
continue;
|
|
2303
|
+
const i = e[n];
|
|
2304
|
+
if (E(r)) {
|
|
2305
|
+
e[n] = r;
|
|
2306
|
+
continue;
|
|
2307
|
+
}
|
|
2308
|
+
if (!(r === !0 && E(i))) {
|
|
2309
|
+
if (r === !0) {
|
|
2310
|
+
const a = x(i) && !E(i);
|
|
2311
|
+
e[n] = a ? it({}, i) : F(r);
|
|
2312
|
+
continue;
|
|
2313
|
+
}
|
|
2314
|
+
if (x(r) && x(i)) {
|
|
2315
|
+
e[n] = it({}, i, r);
|
|
2316
|
+
continue;
|
|
2317
|
+
}
|
|
2318
|
+
e[n] = F(r);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
}), e;
|
|
2322
|
+
}, Gt = (s, t) => {
|
|
2323
|
+
if (typeof document == "undefined" || !s || s.indexOf("<") === -1)
|
|
2324
|
+
return s;
|
|
2325
|
+
const e = Object.entries(t).filter(([, n]) => E(n));
|
|
2326
|
+
if (e.length === 0)
|
|
2327
|
+
return s;
|
|
2328
|
+
const o = document.createElement("template");
|
|
2329
|
+
return o.innerHTML = s, e.forEach(([n, r]) => {
|
|
2330
|
+
o.content.querySelectorAll(n).forEach((a) => {
|
|
2331
|
+
const l = r(a);
|
|
2332
|
+
if (!(Xt(l) || E(l) || l == null))
|
|
2333
|
+
for (const [c, d] of Object.entries(l)) {
|
|
2334
|
+
if (d === !1) {
|
|
2335
|
+
a.removeAttribute(c);
|
|
2336
|
+
continue;
|
|
2337
|
+
}
|
|
2338
|
+
d !== !0 && P(d) && a.setAttribute(c, d);
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
}), o.innerHTML;
|
|
2342
|
+
}, bt = 10, Qe = "tooltip", to = "aria-hidden", eo = "false", oo = "true", no = "visibility", so = "visible", ro = "hidden", H = class H {
|
|
2093
2343
|
/**
|
|
2094
2344
|
* Module constructor
|
|
2095
2345
|
*/
|
|
@@ -2097,7 +2347,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2097
2347
|
this.nodes = {
|
|
2098
2348
|
wrapper: null,
|
|
2099
2349
|
content: null
|
|
2100
|
-
}, this.showed = !1, this.offsetTop =
|
|
2350
|
+
}, this.showed = !1, this.offsetTop = bt, this.offsetLeft = bt, this.offsetRight = bt, this.showingTimeout = null, this.ariaObserver = null, this.handleWindowScroll = () => {
|
|
2101
2351
|
this.showed && this.hide();
|
|
2102
2352
|
}, this.prepare(), window.addEventListener("scroll", this.handleWindowScroll, { passive: !0 });
|
|
2103
2353
|
}
|
|
@@ -2107,7 +2357,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2107
2357
|
*/
|
|
2108
2358
|
get CSS() {
|
|
2109
2359
|
return {
|
|
2110
|
-
tooltip:
|
|
2360
|
+
tooltip: Dt(
|
|
2111
2361
|
"absolute z-overlay top-0 left-0",
|
|
2112
2362
|
"bg-tooltip-bg opacity-0",
|
|
2113
2363
|
"select-none pointer-events-none",
|
|
@@ -2115,7 +2365,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2115
2365
|
"before:content-[''] before:absolute before:inset-0 before:bg-tooltip-bg before:-z-10 before:rounded-lg",
|
|
2116
2366
|
"mobile:hidden"
|
|
2117
2367
|
).split(" "),
|
|
2118
|
-
tooltipContent:
|
|
2368
|
+
tooltipContent: Dt(
|
|
2119
2369
|
"px-2.5 py-1.5",
|
|
2120
2370
|
"text-tooltip-font text-xs text-center",
|
|
2121
2371
|
"tracking-[0.02em] leading-[1em]"
|
|
@@ -2127,7 +2377,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2127
2377
|
* Get singleton instance
|
|
2128
2378
|
*/
|
|
2129
2379
|
static getInstance() {
|
|
2130
|
-
return
|
|
2380
|
+
return H.instance || (H.instance = new H()), H.instance;
|
|
2131
2381
|
}
|
|
2132
2382
|
/**
|
|
2133
2383
|
* Show Tooltip near passed element with specified HTML content
|
|
@@ -2137,7 +2387,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2137
2387
|
*/
|
|
2138
2388
|
show(t, e, o = {}) {
|
|
2139
2389
|
this.nodes.wrapper || this.prepare(), this.showingTimeout && (clearTimeout(this.showingTimeout), this.showingTimeout = null);
|
|
2140
|
-
const
|
|
2390
|
+
const r = Object.assign({
|
|
2141
2391
|
placement: "bottom",
|
|
2142
2392
|
marginTop: 0,
|
|
2143
2393
|
marginLeft: 0,
|
|
@@ -2146,34 +2396,33 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2146
2396
|
delay: 0
|
|
2147
2397
|
}, o);
|
|
2148
2398
|
if (this.nodes.content && (this.nodes.content.innerHTML = "", this.nodes.content.appendChild(this.createContentNode(e)), !!this.nodes.wrapper)) {
|
|
2149
|
-
switch (
|
|
2399
|
+
switch (r.placement) {
|
|
2150
2400
|
case "top":
|
|
2151
|
-
this.placeTop(t,
|
|
2401
|
+
this.placeTop(t, r);
|
|
2152
2402
|
break;
|
|
2153
2403
|
case "left":
|
|
2154
|
-
this.placeLeft(t,
|
|
2404
|
+
this.placeLeft(t, r);
|
|
2155
2405
|
break;
|
|
2156
2406
|
case "right":
|
|
2157
|
-
this.placeRight(t,
|
|
2407
|
+
this.placeRight(t, r);
|
|
2158
2408
|
break;
|
|
2159
|
-
case "bottom":
|
|
2160
2409
|
default:
|
|
2161
|
-
this.placeBottom(t,
|
|
2410
|
+
this.placeBottom(t, r);
|
|
2162
2411
|
break;
|
|
2163
2412
|
}
|
|
2164
|
-
if (
|
|
2413
|
+
if (r && r.delay) {
|
|
2165
2414
|
this.showingTimeout = setTimeout(() => {
|
|
2166
2415
|
if (this.showingTimeout = null, this.nodes.wrapper) {
|
|
2167
|
-
const
|
|
2168
|
-
this.nodes.wrapper.classList.add(...
|
|
2416
|
+
const i = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2417
|
+
this.nodes.wrapper.classList.add(...i), this.updateTooltipVisibility();
|
|
2169
2418
|
}
|
|
2170
2419
|
this.showed = !0;
|
|
2171
|
-
},
|
|
2420
|
+
}, r.delay);
|
|
2172
2421
|
return;
|
|
2173
2422
|
}
|
|
2174
2423
|
if (this.nodes.wrapper) {
|
|
2175
|
-
const
|
|
2176
|
-
this.nodes.wrapper.classList.add(...
|
|
2424
|
+
const i = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2425
|
+
this.nodes.wrapper.classList.add(...i), this.updateTooltipVisibility();
|
|
2177
2426
|
}
|
|
2178
2427
|
this.showed = !0;
|
|
2179
2428
|
}
|
|
@@ -2207,8 +2456,8 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2207
2456
|
*/
|
|
2208
2457
|
onHover(t, e, o = {}) {
|
|
2209
2458
|
t.addEventListener("mouseenter", () => {
|
|
2210
|
-
const
|
|
2211
|
-
|
|
2459
|
+
const n = document.querySelector('[data-blok-popover-opened="true"]');
|
|
2460
|
+
n !== null && !n.contains(t) || this.show(t, e, o);
|
|
2212
2461
|
}), t.addEventListener("mouseleave", () => {
|
|
2213
2462
|
this.hide();
|
|
2214
2463
|
});
|
|
@@ -2218,13 +2467,13 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2218
2467
|
*/
|
|
2219
2468
|
destroy() {
|
|
2220
2469
|
var t;
|
|
2221
|
-
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll),
|
|
2470
|
+
(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
2471
|
}
|
|
2223
2472
|
/**
|
|
2224
2473
|
* Module Preparation method
|
|
2225
2474
|
*/
|
|
2226
2475
|
prepare() {
|
|
2227
|
-
this.nodes.wrapper = this.make("div", this.CSS.tooltip), this.nodes.wrapper.setAttribute(
|
|
2476
|
+
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
2477
|
}
|
|
2229
2478
|
/**
|
|
2230
2479
|
* Update tooltip visibility based on shown state
|
|
@@ -2233,7 +2482,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2233
2482
|
if (!this.nodes.wrapper)
|
|
2234
2483
|
return;
|
|
2235
2484
|
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(
|
|
2485
|
+
this.nodes.wrapper.style.setProperty(no, e ? so : ro), this.nodes.wrapper.setAttribute(to, e ? eo : oo), this.nodes.wrapper.setAttribute("data-blok-shown", e ? "true" : "false");
|
|
2237
2486
|
}
|
|
2238
2487
|
/**
|
|
2239
2488
|
* Watch tooltip visibility changes for accessibility
|
|
@@ -2251,7 +2500,7 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2251
2500
|
* Ensure tooltip has proper accessibility attributes
|
|
2252
2501
|
*/
|
|
2253
2502
|
ensureTooltipAttributes() {
|
|
2254
|
-
this.nodes.wrapper && ((!this.nodes.wrapper.hasAttribute(
|
|
2503
|
+
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", Qe), this.watchTooltipVisibility());
|
|
2255
2504
|
}
|
|
2256
2505
|
/**
|
|
2257
2506
|
* Calculates element coords and moves tooltip bottom of the element
|
|
@@ -2259,11 +2508,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2259
2508
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2260
2509
|
*/
|
|
2261
2510
|
placeBottom(t, e) {
|
|
2262
|
-
var
|
|
2511
|
+
var i;
|
|
2263
2512
|
if (!this.nodes.wrapper)
|
|
2264
2513
|
return;
|
|
2265
|
-
const o = t.getBoundingClientRect(),
|
|
2266
|
-
this.applyPlacement("bottom",
|
|
2514
|
+
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);
|
|
2515
|
+
this.applyPlacement("bottom", n, r);
|
|
2267
2516
|
}
|
|
2268
2517
|
/**
|
|
2269
2518
|
* Calculates element coords and moves tooltip top of the element
|
|
@@ -2273,8 +2522,8 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2273
2522
|
placeTop(t, e) {
|
|
2274
2523
|
if (!this.nodes.wrapper)
|
|
2275
2524
|
return;
|
|
2276
|
-
const o = t.getBoundingClientRect(),
|
|
2277
|
-
this.applyPlacement("top",
|
|
2525
|
+
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;
|
|
2526
|
+
this.applyPlacement("top", n, r);
|
|
2278
2527
|
}
|
|
2279
2528
|
/**
|
|
2280
2529
|
* Calculates element coords and moves tooltip left of the element
|
|
@@ -2282,11 +2531,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2282
2531
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2283
2532
|
*/
|
|
2284
2533
|
placeLeft(t, e) {
|
|
2285
|
-
var
|
|
2534
|
+
var i;
|
|
2286
2535
|
if (!this.nodes.wrapper)
|
|
2287
2536
|
return;
|
|
2288
|
-
const o = t.getBoundingClientRect(),
|
|
2289
|
-
this.applyPlacement("left",
|
|
2537
|
+
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;
|
|
2538
|
+
this.applyPlacement("left", n, r);
|
|
2290
2539
|
}
|
|
2291
2540
|
/**
|
|
2292
2541
|
* Calculates element coords and moves tooltip right of the element
|
|
@@ -2294,11 +2543,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2294
2543
|
* @param {TooltipOptions} showingOptions - placement options
|
|
2295
2544
|
*/
|
|
2296
2545
|
placeRight(t, e) {
|
|
2297
|
-
var
|
|
2546
|
+
var i;
|
|
2298
2547
|
if (!this.nodes.wrapper)
|
|
2299
2548
|
return;
|
|
2300
|
-
const o = t.getBoundingClientRect(),
|
|
2301
|
-
this.applyPlacement("right",
|
|
2549
|
+
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;
|
|
2550
|
+
this.applyPlacement("right", n, r);
|
|
2302
2551
|
}
|
|
2303
2552
|
/**
|
|
2304
2553
|
* Set wrapper position
|
|
@@ -2324,11 +2573,11 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2324
2573
|
* @returns {HTMLElement}
|
|
2325
2574
|
*/
|
|
2326
2575
|
make(t, e = null, o = {}) {
|
|
2327
|
-
const
|
|
2328
|
-
Array.isArray(e) &&
|
|
2329
|
-
for (const
|
|
2330
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
2331
|
-
return
|
|
2576
|
+
const n = document.createElement(t);
|
|
2577
|
+
Array.isArray(e) && n.classList.add(...e), typeof e == "string" && n.classList.add(e);
|
|
2578
|
+
for (const r in o)
|
|
2579
|
+
Object.prototype.hasOwnProperty.call(o, r) && (n[r] = o[r]);
|
|
2580
|
+
return n;
|
|
2332
2581
|
}
|
|
2333
2582
|
/**
|
|
2334
2583
|
* Append one or several elements to the parent
|
|
@@ -2339,17 +2588,80 @@ const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe
|
|
|
2339
2588
|
Array.isArray(e) ? e.forEach((o) => t.appendChild(o)) : t.appendChild(e);
|
|
2340
2589
|
}
|
|
2341
2590
|
};
|
|
2342
|
-
|
|
2343
|
-
let
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
},
|
|
2347
|
-
|
|
2348
|
-
},
|
|
2349
|
-
|
|
2350
|
-
},
|
|
2351
|
-
|
|
2352
|
-
},
|
|
2591
|
+
H.instance = null;
|
|
2592
|
+
let Et = H;
|
|
2593
|
+
const ut = () => Et.getInstance(), Qo = (s, t, e) => {
|
|
2594
|
+
ut().show(s, t, e != null ? e : {});
|
|
2595
|
+
}, io = () => {
|
|
2596
|
+
ut().hide();
|
|
2597
|
+
}, ao = (s, t, e) => {
|
|
2598
|
+
ut().onHover(s, t, e != null ? e : {});
|
|
2599
|
+
}, tn = () => {
|
|
2600
|
+
ut().destroy();
|
|
2601
|
+
}, ne = () => {
|
|
2602
|
+
var i, a;
|
|
2603
|
+
const s = window.getSelection();
|
|
2604
|
+
if (s === null)
|
|
2605
|
+
return [null, 0];
|
|
2606
|
+
const t = s.focusNode, e = s.focusOffset;
|
|
2607
|
+
if (t === null)
|
|
2608
|
+
return [null, 0];
|
|
2609
|
+
if (t.nodeType === Node.TEXT_NODE || t.childNodes.length === 0)
|
|
2610
|
+
return [t, e];
|
|
2611
|
+
const o = t.childNodes[e];
|
|
2612
|
+
if (o !== void 0)
|
|
2613
|
+
return [o, 0];
|
|
2614
|
+
const n = (i = t.childNodes[e - 1]) != null ? i : null, r = (a = n == null ? void 0 : n.textContent) != null ? a : null;
|
|
2615
|
+
return [n, r !== null ? r.length : 0];
|
|
2616
|
+
}, en = (s) => {
|
|
2617
|
+
var r;
|
|
2618
|
+
const t = window.getSelection();
|
|
2619
|
+
if (t === null || t.rangeCount === 0)
|
|
2620
|
+
return 0;
|
|
2621
|
+
const e = t.getRangeAt(0), o = s != null ? s : (r = e.startContainer.parentElement) == null ? void 0 : r.closest('[contenteditable="true"]');
|
|
2622
|
+
if (o == null)
|
|
2623
|
+
return 0;
|
|
2624
|
+
const n = document.createRange();
|
|
2625
|
+
return n.selectNodeContents(o), n.setEnd(e.startContainer, e.startOffset), n.toString().length;
|
|
2626
|
+
}, se = (s, t, e, o) => {
|
|
2627
|
+
const n = document.createRange();
|
|
2628
|
+
o === "left" ? (n.selectNodeContents(s), n.setEnd(t, e)) : (n.selectNodeContents(s), n.setStart(t, e));
|
|
2629
|
+
const r = n.cloneContents(), i = document.createElement("div");
|
|
2630
|
+
i.appendChild(r);
|
|
2631
|
+
const a = i.textContent || "";
|
|
2632
|
+
if (i.querySelectorAll(
|
|
2633
|
+
"img, br, hr, input, area, base, col, embed, link, meta, param, source, track, wbr"
|
|
2634
|
+
).length > 0)
|
|
2635
|
+
return !1;
|
|
2636
|
+
const c = a.includes(" ") || i.innerHTML.includes(" ") || n.toString().includes(" "), d = t.nodeType === Node.TEXT_NODE && (o === "left" ? (t.textContent || "").slice(0, e) : (t.textContent || "").slice(e)).includes(" ");
|
|
2637
|
+
if (c || d)
|
|
2638
|
+
return !1;
|
|
2639
|
+
i.style.position = "absolute", i.style.visibility = "hidden", i.style.height = "auto", i.style.width = "auto", i.style.whiteSpace = window.getComputedStyle(s).whiteSpace, document.body.appendChild(i);
|
|
2640
|
+
const h = i.getBoundingClientRect().width;
|
|
2641
|
+
return document.body.removeChild(i), !(h > 0 || !Ne(a) || window.getComputedStyle(s).whiteSpace.startsWith("pre") && a.length > 0);
|
|
2642
|
+
}, on = (s) => {
|
|
2643
|
+
var i;
|
|
2644
|
+
const t = m.getDeepestNode(s);
|
|
2645
|
+
if (t === null || m.isEmpty(s))
|
|
2646
|
+
return !0;
|
|
2647
|
+
if (m.isNativeInput(t))
|
|
2648
|
+
return t.selectionEnd === 0;
|
|
2649
|
+
if (m.isEmpty(s))
|
|
2650
|
+
return !0;
|
|
2651
|
+
const [e, o] = ne();
|
|
2652
|
+
if (e === null)
|
|
2653
|
+
return !1;
|
|
2654
|
+
const n = window.getSelection(), r = (i = n == null ? void 0 : n.focusNode) != null ? i : null;
|
|
2655
|
+
return r !== null && r !== s && !(r.nodeType === Node.TEXT_NODE && r.parentNode === s) ? !1 : se(s, e, o, "left");
|
|
2656
|
+
}, nn = (s) => {
|
|
2657
|
+
const t = m.getDeepestNode(s, !0);
|
|
2658
|
+
if (t === null)
|
|
2659
|
+
return !0;
|
|
2660
|
+
if (m.isNativeInput(t))
|
|
2661
|
+
return t.selectionEnd === t.value.length;
|
|
2662
|
+
const [e, o] = ne();
|
|
2663
|
+
return e === null ? !1 : se(s, e, o, "right");
|
|
2664
|
+
}, V = class V {
|
|
2353
2665
|
/**
|
|
2354
2666
|
* @param {HTMLElement[]} nodeList — the list of iterable HTML-items
|
|
2355
2667
|
* @param {string} focusedCssClass - user-provided CSS-class that will be set in flipping process
|
|
@@ -2388,13 +2700,13 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2388
2700
|
* Sets cursor next to the current
|
|
2389
2701
|
*/
|
|
2390
2702
|
next() {
|
|
2391
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2703
|
+
this.cursor = this.leafNodesAndReturnIndex(V.directions.RIGHT);
|
|
2392
2704
|
}
|
|
2393
2705
|
/**
|
|
2394
2706
|
* Sets cursor before current
|
|
2395
2707
|
*/
|
|
2396
2708
|
previous() {
|
|
2397
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2709
|
+
this.cursor = this.leafNodesAndReturnIndex(V.directions.LEFT);
|
|
2398
2710
|
}
|
|
2399
2711
|
/**
|
|
2400
2712
|
* Sets cursor to the default position and removes CSS-class from previously focused item
|
|
@@ -2410,9 +2722,9 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2410
2722
|
leafNodesAndReturnIndex(t) {
|
|
2411
2723
|
if (this.items.length === 0)
|
|
2412
2724
|
return this.cursor;
|
|
2413
|
-
const e = t ===
|
|
2725
|
+
const e = t === V.directions.RIGHT ? -1 : 0, o = this.cursor === -1 ? e : this.cursor;
|
|
2414
2726
|
o !== -1 && (this.items[o].classList.remove(this.focusedCssClass), this.items[o].removeAttribute("data-blok-focused"));
|
|
2415
|
-
const
|
|
2727
|
+
const n = t === V.directions.RIGHT ? (
|
|
2416
2728
|
/**
|
|
2417
2729
|
* If we go right then choose next (+1) Tool
|
|
2418
2730
|
* @type {number}
|
|
@@ -2426,48 +2738,48 @@ const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
|
2426
2738
|
*/
|
|
2427
2739
|
(this.items.length + o - 1) % this.items.length
|
|
2428
2740
|
);
|
|
2429
|
-
return
|
|
2741
|
+
return m.canSetCaret(this.items[n]) && be(() => oe.setCursor(this.items[n]), 50)(), this.items[n].classList.add(this.focusedCssClass), this.items[n].setAttribute("data-blok-focused", "true"), n;
|
|
2430
2742
|
}
|
|
2431
2743
|
};
|
|
2432
|
-
|
|
2744
|
+
V.directions = {
|
|
2433
2745
|
RIGHT: "right",
|
|
2434
2746
|
LEFT: "left"
|
|
2435
2747
|
};
|
|
2436
|
-
let
|
|
2437
|
-
class
|
|
2748
|
+
let W = V;
|
|
2749
|
+
class at {
|
|
2438
2750
|
/**
|
|
2439
2751
|
* @param options - different constructing settings
|
|
2440
2752
|
*/
|
|
2441
2753
|
constructor(t) {
|
|
2442
2754
|
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(
|
|
2755
|
+
this.iterator = null, this.activated = !1, this.skipNextTabFocus = !1, this.flipCallbacks = [], this.onKeyDown = (n) => {
|
|
2756
|
+
var c, d;
|
|
2757
|
+
const r = n.target;
|
|
2758
|
+
if (this.shouldSkipTarget(r, n))
|
|
2447
2759
|
return;
|
|
2448
|
-
const
|
|
2449
|
-
if (!(
|
|
2450
|
-
switch (
|
|
2451
|
-
case
|
|
2452
|
-
this.handleTabPress(
|
|
2760
|
+
const i = this.getKeyCode(n), a = i === v.LEFT || i === v.RIGHT || i === v.UP || i === v.DOWN;
|
|
2761
|
+
if (!(n.shiftKey && a || !this.isEventReadyForHandling(n)) && !(i === v.ENTER && !((c = this.iterator) != null && c.currentItem)))
|
|
2762
|
+
switch (n.stopPropagation(), n.stopImmediatePropagation(), i !== null && at.usedKeys.includes(i) && n.preventDefault(), i) {
|
|
2763
|
+
case v.TAB:
|
|
2764
|
+
this.handleTabPress(n);
|
|
2453
2765
|
break;
|
|
2454
|
-
case
|
|
2766
|
+
case v.LEFT:
|
|
2455
2767
|
this.onArrowLeftCallback && this.onArrowLeftCallback();
|
|
2456
2768
|
break;
|
|
2457
|
-
case
|
|
2769
|
+
case v.UP:
|
|
2458
2770
|
this.flipLeft();
|
|
2459
2771
|
break;
|
|
2460
|
-
case
|
|
2461
|
-
(
|
|
2772
|
+
case v.RIGHT:
|
|
2773
|
+
(d = this.iterator) != null && d.currentItem && this.currentItemHasChildren() && this.handleEnterPress(n);
|
|
2462
2774
|
break;
|
|
2463
|
-
case
|
|
2775
|
+
case v.DOWN:
|
|
2464
2776
|
this.flipRight();
|
|
2465
2777
|
break;
|
|
2466
|
-
case
|
|
2467
|
-
this.handleEnterPress(
|
|
2778
|
+
case v.ENTER:
|
|
2779
|
+
this.handleEnterPress(n);
|
|
2468
2780
|
break;
|
|
2469
2781
|
}
|
|
2470
|
-
}, this.iterator = new
|
|
2782
|
+
}, 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
2783
|
}
|
|
2472
2784
|
/**
|
|
2473
2785
|
* True if flipper is currently activated
|
|
@@ -2483,12 +2795,12 @@ class Y {
|
|
|
2483
2795
|
*/
|
|
2484
2796
|
static get usedKeys() {
|
|
2485
2797
|
return [
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2798
|
+
v.TAB,
|
|
2799
|
+
v.LEFT,
|
|
2800
|
+
v.RIGHT,
|
|
2801
|
+
v.ENTER,
|
|
2802
|
+
v.UP,
|
|
2803
|
+
v.DOWN
|
|
2492
2804
|
];
|
|
2493
2805
|
}
|
|
2494
2806
|
/**
|
|
@@ -2497,8 +2809,8 @@ class Y {
|
|
|
2497
2809
|
* @param cursorPosition - index of the item that should be focused once flipper is activated
|
|
2498
2810
|
*/
|
|
2499
2811
|
activate(t, e) {
|
|
2500
|
-
var o,
|
|
2501
|
-
this.activated = !0, t && ((o = this.iterator) == null || o.setItems(t)), e !== void 0 && ((
|
|
2812
|
+
var o, n;
|
|
2813
|
+
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
2814
|
}
|
|
2503
2815
|
/**
|
|
2504
2816
|
* Disable tab/arrows handling by flipper
|
|
@@ -2519,7 +2831,7 @@ class Y {
|
|
|
2519
2831
|
* @param options.skipNextTab - if true, skip the next Tab press (default: true for position 0 when no current item)
|
|
2520
2832
|
*/
|
|
2521
2833
|
focusItem(t, e) {
|
|
2522
|
-
var
|
|
2834
|
+
var r;
|
|
2523
2835
|
const o = this.iterator;
|
|
2524
2836
|
if (!o || !o.hasItems())
|
|
2525
2837
|
return;
|
|
@@ -2527,7 +2839,7 @@ class Y {
|
|
|
2527
2839
|
o.dropCursor();
|
|
2528
2840
|
return;
|
|
2529
2841
|
}
|
|
2530
|
-
((
|
|
2842
|
+
((r = e == null ? void 0 : e.skipNextTab) != null ? r : !o.currentItem && t === 0) && (this.skipNextTabFocus = !0), o.setCursor(t);
|
|
2531
2843
|
}
|
|
2532
2844
|
/**
|
|
2533
2845
|
* Focuses previous flipper iterator item
|
|
@@ -2589,12 +2901,12 @@ class Y {
|
|
|
2589
2901
|
getKeyCode(t) {
|
|
2590
2902
|
var o;
|
|
2591
2903
|
return (o = {
|
|
2592
|
-
Tab:
|
|
2593
|
-
Enter:
|
|
2594
|
-
ArrowLeft:
|
|
2595
|
-
ArrowRight:
|
|
2596
|
-
ArrowUp:
|
|
2597
|
-
ArrowDown:
|
|
2904
|
+
Tab: v.TAB,
|
|
2905
|
+
Enter: v.ENTER,
|
|
2906
|
+
ArrowLeft: v.LEFT,
|
|
2907
|
+
ArrowRight: v.RIGHT,
|
|
2908
|
+
ArrowUp: v.UP,
|
|
2909
|
+
ArrowDown: v.DOWN
|
|
2598
2910
|
}[t.key]) != null ? o : null;
|
|
2599
2911
|
}
|
|
2600
2912
|
/**
|
|
@@ -2625,16 +2937,16 @@ class Y {
|
|
|
2625
2937
|
* @param {KeyboardEvent} event - tab keydown event
|
|
2626
2938
|
*/
|
|
2627
2939
|
handleTabPress(t) {
|
|
2628
|
-
const o = t.shiftKey ?
|
|
2940
|
+
const o = t.shiftKey ? W.directions.LEFT : W.directions.RIGHT;
|
|
2629
2941
|
if (this.skipNextTabFocus) {
|
|
2630
2942
|
this.skipNextTabFocus = !1;
|
|
2631
2943
|
return;
|
|
2632
2944
|
}
|
|
2633
2945
|
switch (o) {
|
|
2634
|
-
case
|
|
2946
|
+
case W.directions.RIGHT:
|
|
2635
2947
|
this.flipRight();
|
|
2636
2948
|
break;
|
|
2637
|
-
case
|
|
2949
|
+
case W.directions.LEFT:
|
|
2638
2950
|
this.flipLeft();
|
|
2639
2951
|
break;
|
|
2640
2952
|
}
|
|
@@ -2652,7 +2964,7 @@ class Y {
|
|
|
2652
2964
|
*/
|
|
2653
2965
|
handleEnterPress(t) {
|
|
2654
2966
|
var e, o;
|
|
2655
|
-
this.activated && ((e = this.iterator) != null && e.currentItem && (t.stopPropagation(), t.preventDefault(), this.iterator.currentItem.click()),
|
|
2967
|
+
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
2968
|
}
|
|
2657
2969
|
/**
|
|
2658
2970
|
* Scrolls the given element into view using the best available method
|
|
@@ -2681,15 +2993,236 @@ class Y {
|
|
|
2681
2993
|
shouldSkipTarget(t, e) {
|
|
2682
2994
|
if (!t)
|
|
2683
2995
|
return !1;
|
|
2684
|
-
const o = t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement,
|
|
2685
|
-
return o && !
|
|
2996
|
+
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;
|
|
2997
|
+
return o && !r || l || a;
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
const lo = [
|
|
3001
|
+
{ name: "gray", text: "#787774", bg: "#f1f1ef" },
|
|
3002
|
+
{ name: "brown", text: "#9f6b53", bg: "#f4eeee" },
|
|
3003
|
+
{ name: "orange", text: "#d9730d", bg: "#fbecdd" },
|
|
3004
|
+
{ name: "yellow", text: "#cb9b00", bg: "#fbf3db" },
|
|
3005
|
+
{ name: "green", text: "#448361", bg: "#edf3ec" },
|
|
3006
|
+
{ name: "teal", text: "#2b9a8f", bg: "#e4f5f3" },
|
|
3007
|
+
{ name: "blue", text: "#337ea9", bg: "#e7f3f8" },
|
|
3008
|
+
{ name: "purple", text: "#9065b0", bg: "#f6f3f9" },
|
|
3009
|
+
{ name: "pink", text: "#c14c8a", bg: "#f9f0f5" },
|
|
3010
|
+
{ name: "red", text: "#d44c47", bg: "#fdebec" }
|
|
3011
|
+
];
|
|
3012
|
+
function co(s, t, e) {
|
|
3013
|
+
const o = t / 100, n = e / 100;
|
|
3014
|
+
if (o === 0) {
|
|
3015
|
+
const d = Math.round(n * 255);
|
|
3016
|
+
return [d, d, d];
|
|
3017
|
+
}
|
|
3018
|
+
const r = (d) => d < 0 ? d + 1 : d > 1 ? d - 1 : d, i = (d, h, u) => {
|
|
3019
|
+
const g = r(u);
|
|
3020
|
+
return g < 1 / 6 ? d + (h - d) * 6 * g : g < 1 / 2 ? h : g < 2 / 3 ? d + (h - d) * (2 / 3 - g) * 6 : d;
|
|
3021
|
+
}, a = n < 0.5 ? n * (1 + o) : n + o - n * o, l = 2 * n - a, c = s / 360;
|
|
3022
|
+
return [
|
|
3023
|
+
Math.round(i(l, a, c + 1 / 3) * 255),
|
|
3024
|
+
Math.round(i(l, a, c) * 255),
|
|
3025
|
+
Math.round(i(l, a, c - 1 / 3) * 255)
|
|
3026
|
+
];
|
|
3027
|
+
}
|
|
3028
|
+
function Wt(s) {
|
|
3029
|
+
const t = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(s);
|
|
3030
|
+
if (t)
|
|
3031
|
+
return [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)];
|
|
3032
|
+
const e = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})[0-9a-f]{2}$/i.exec(s);
|
|
3033
|
+
if (e)
|
|
3034
|
+
return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)];
|
|
3035
|
+
const o = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(s);
|
|
3036
|
+
if (o)
|
|
3037
|
+
return [
|
|
3038
|
+
parseInt(o[1] + o[1], 16),
|
|
3039
|
+
parseInt(o[2] + o[2], 16),
|
|
3040
|
+
parseInt(o[3] + o[3], 16)
|
|
3041
|
+
];
|
|
3042
|
+
const n = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]$/i.exec(s);
|
|
3043
|
+
if (n)
|
|
3044
|
+
return [
|
|
3045
|
+
parseInt(n[1] + n[1], 16),
|
|
3046
|
+
parseInt(n[2] + n[2], 16),
|
|
3047
|
+
parseInt(n[3] + n[3], 16)
|
|
3048
|
+
];
|
|
3049
|
+
const r = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(s);
|
|
3050
|
+
if (r)
|
|
3051
|
+
return [Number(r[1]), Number(r[2]), Number(r[3])];
|
|
3052
|
+
const i = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(s);
|
|
3053
|
+
return i ? co(Number(i[1]), Number(i[2]), Number(i[3])) : null;
|
|
3054
|
+
}
|
|
3055
|
+
const Vt = 0.1;
|
|
3056
|
+
function Ut(s) {
|
|
3057
|
+
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;
|
|
3058
|
+
if (n === r)
|
|
3059
|
+
return [0, 0, i];
|
|
3060
|
+
const a = n - r, l = i > 0.5 ? a / (2 - n - r) : a / (n + r);
|
|
3061
|
+
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];
|
|
3062
|
+
}
|
|
3063
|
+
function ho(s, t) {
|
|
3064
|
+
const r = s[1] < Vt, i = t[1] < Vt;
|
|
3065
|
+
if (r && i) {
|
|
3066
|
+
const h = Math.abs(s[2] - t[2]);
|
|
3067
|
+
return h * h;
|
|
3068
|
+
}
|
|
3069
|
+
if (r !== i)
|
|
3070
|
+
return 1e3;
|
|
3071
|
+
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]);
|
|
3072
|
+
return 8 * l * l + 1 * c * c + 1 * d * d;
|
|
3073
|
+
}
|
|
3074
|
+
function z(s, t) {
|
|
3075
|
+
const e = Wt(s);
|
|
3076
|
+
if (e === null)
|
|
3077
|
+
return s;
|
|
3078
|
+
const o = Ut(e);
|
|
3079
|
+
return lo.reduce(
|
|
3080
|
+
(r, i) => {
|
|
3081
|
+
const a = Wt(i[t]);
|
|
3082
|
+
if (a === null)
|
|
3083
|
+
return r;
|
|
3084
|
+
const l = ho(o, Ut(a));
|
|
3085
|
+
return l < r.distance ? { color: i[t], distance: l } : r;
|
|
3086
|
+
},
|
|
3087
|
+
{ color: s, distance: 1 / 0 }
|
|
3088
|
+
).color;
|
|
3089
|
+
}
|
|
3090
|
+
const lt = "data-blok-table-cells";
|
|
3091
|
+
function zt(s, t, e) {
|
|
3092
|
+
return s ? `background-color: ${e}` : t ? "background-color: transparent" : "";
|
|
3093
|
+
}
|
|
3094
|
+
function sn(s) {
|
|
3095
|
+
if (s.length === 0)
|
|
3096
|
+
return { rows: 0, cols: 0, cells: [] };
|
|
3097
|
+
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(
|
|
3098
|
+
{ length: r },
|
|
3099
|
+
() => Array.from({ length: i }, () => ({ blocks: [] }))
|
|
3100
|
+
);
|
|
3101
|
+
for (const l of s) {
|
|
3102
|
+
const c = l.row - t, d = l.col - e;
|
|
3103
|
+
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);
|
|
3104
|
+
}
|
|
3105
|
+
return { rows: r, cols: i, cells: a };
|
|
3106
|
+
}
|
|
3107
|
+
function re(s) {
|
|
3108
|
+
const { data: t } = s;
|
|
3109
|
+
return typeof t.text == "string" ? t.text : Array.isArray(t.items) ? t.items.filter((e) => typeof e == "string").join(" ") : "";
|
|
3110
|
+
}
|
|
3111
|
+
function rn(s) {
|
|
3112
|
+
const t = JSON.stringify(s).replace(/'/g, "'"), e = s.cells.map((o) => `<tr>${o.map((r) => {
|
|
3113
|
+
const i = r.blocks.map(re).join(" "), a = [
|
|
3114
|
+
r.color ? `background-color: ${r.color}` : "",
|
|
3115
|
+
r.textColor ? `color: ${r.textColor}` : ""
|
|
3116
|
+
].filter(Boolean).join("; ");
|
|
3117
|
+
return `<td${a ? ` style="${a}"` : ""}>${i}</td>`;
|
|
3118
|
+
}).join("")}</tr>`).join("");
|
|
3119
|
+
return `<table ${lt}='${t}'>${e}</table>`;
|
|
3120
|
+
}
|
|
3121
|
+
function an(s) {
|
|
3122
|
+
return s.cells.map(
|
|
3123
|
+
(t) => t.map((e) => e.blocks.map(re).join(" ")).join(" ")
|
|
3124
|
+
).join(`
|
|
3125
|
+
`);
|
|
3126
|
+
}
|
|
3127
|
+
const uo = /* @__PURE__ */ new Set(["color", "background-color"]), po = {
|
|
3128
|
+
b: !0,
|
|
3129
|
+
strong: !0,
|
|
3130
|
+
i: !0,
|
|
3131
|
+
em: !0,
|
|
3132
|
+
br: !0,
|
|
3133
|
+
a: { href: !0 },
|
|
3134
|
+
mark: (s) => {
|
|
3135
|
+
const e = s.style, o = Array.from({ length: e.length }, (n, r) => e.item(r));
|
|
3136
|
+
for (const n of o)
|
|
3137
|
+
uo.has(n) || e.removeProperty(n);
|
|
3138
|
+
return e.length > 0 ? { style: !0 } : {};
|
|
3139
|
+
}
|
|
3140
|
+
};
|
|
3141
|
+
function xt(s) {
|
|
3142
|
+
const t = s.replace(/\s/g, "");
|
|
3143
|
+
return t === "rgb(0,0,0)" || t === "#000000";
|
|
3144
|
+
}
|
|
3145
|
+
function fo(s) {
|
|
3146
|
+
var o, n, r, i, a, l;
|
|
3147
|
+
const t = s.cloneNode(!0);
|
|
3148
|
+
for (const c of Array.from(t.querySelectorAll("span"))) {
|
|
3149
|
+
const d = (o = c.getAttribute("style")) != null ? o : "", h = /font-weight\s*:\s*(700|bold)/i.test(d), u = /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 && !xt(b), k = w !== void 0 && w !== "transparent";
|
|
3150
|
+
if (!h && !u && !C && !k)
|
|
3151
|
+
continue;
|
|
3152
|
+
const T = C ? z(b, "text") : "", I = k ? z(w, "bg") : "", $ = [
|
|
3153
|
+
C ? `color: ${T}` : "",
|
|
3154
|
+
zt(k, C, I)
|
|
3155
|
+
].filter(Boolean).join("; "), R = c.innerHTML, K = $ ? `<mark style="${$};">${R}</mark>` : R, Mt = u ? `<i>${K}</i>` : K, ce = h ? `<b>${Mt}</b>` : Mt;
|
|
3156
|
+
c.replaceWith(document.createRange().createContextualFragment(ce));
|
|
3157
|
+
}
|
|
3158
|
+
for (const c of Array.from(t.querySelectorAll("a[style]"))) {
|
|
3159
|
+
const d = (i = c.getAttribute("style")) != null ? i : "", h = new RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i").exec(d), u = /background-color\s*:\s*([^;]+)/i.exec(d), g = (a = h == null ? void 0 : h[1]) == null ? void 0 : a.trim(), f = (l = u == null ? void 0 : u[1]) == null ? void 0 : l.trim(), b = g !== void 0 && !xt(g) && g !== "inherit", w = f !== void 0 && f !== "transparent" && f !== "inherit";
|
|
3160
|
+
if (!b && !w)
|
|
3161
|
+
continue;
|
|
3162
|
+
const C = b ? z(g, "text") : "", k = w ? z(f, "bg") : "", T = [
|
|
3163
|
+
b ? `color: ${C}` : "",
|
|
3164
|
+
zt(w, b, k)
|
|
3165
|
+
].filter(Boolean).join("; "), I = c;
|
|
3166
|
+
I.innerHTML = `<mark style="${T};">${I.innerHTML}</mark>`, I.style.removeProperty("color"), I.style.removeProperty("background-color");
|
|
3167
|
+
}
|
|
3168
|
+
for (const c of Array.from(t.querySelectorAll("p"))) {
|
|
3169
|
+
const d = document.createRange().createContextualFragment(c.innerHTML + "<br>");
|
|
3170
|
+
c.replaceWith(d);
|
|
3171
|
+
}
|
|
3172
|
+
return yt(t.innerHTML, po).replace(/(<br\s*\/?>|\s)+$/i, "").trim();
|
|
3173
|
+
}
|
|
3174
|
+
function ln(s) {
|
|
3175
|
+
if (!s)
|
|
3176
|
+
return null;
|
|
3177
|
+
const e = new DOMParser().parseFromString(s, "text/html").querySelector("table");
|
|
3178
|
+
if (!e || e.hasAttribute(lt))
|
|
3179
|
+
return null;
|
|
3180
|
+
const o = e.querySelectorAll("tr");
|
|
3181
|
+
if (o.length === 0)
|
|
3182
|
+
return null;
|
|
3183
|
+
const n = [];
|
|
3184
|
+
o.forEach((i) => {
|
|
3185
|
+
const a = i.querySelectorAll("td, th"), l = [];
|
|
3186
|
+
a.forEach((c) => {
|
|
3187
|
+
var C;
|
|
3188
|
+
const h = fo(c).split(/<br\s*\/?>/i).map((k) => k.trim()).filter(Boolean), g = { blocks: h.length > 0 ? h.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);
|
|
3189
|
+
b != null && b[1] && (g.color = z(b[1].trim(), "bg"));
|
|
3190
|
+
const w = new RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i").exec(f);
|
|
3191
|
+
w != null && w[1] && !xt(w[1].trim()) && (g.textColor = z(w[1].trim(), "text")), l.push(g);
|
|
3192
|
+
}), n.push(l);
|
|
3193
|
+
});
|
|
3194
|
+
const r = Math.max(0, ...n.map((i) => i.length));
|
|
3195
|
+
if (n.length === 0 || r === 0)
|
|
3196
|
+
return null;
|
|
3197
|
+
for (const i of n)
|
|
3198
|
+
for (; i.length < r; )
|
|
3199
|
+
i.push({ blocks: [{ tool: "paragraph", data: { text: "" } }] });
|
|
3200
|
+
return {
|
|
3201
|
+
rows: n.length,
|
|
3202
|
+
cols: r,
|
|
3203
|
+
cells: n
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
function cn(s) {
|
|
3207
|
+
var o;
|
|
3208
|
+
const e = new RegExp(`${lt}='([^']*)'|${lt}="([^"]*)"`, "s").exec(s);
|
|
3209
|
+
if (!e)
|
|
3210
|
+
return null;
|
|
3211
|
+
try {
|
|
3212
|
+
const n = (o = e[1]) != null ? o : e[2];
|
|
3213
|
+
if (n === void 0)
|
|
3214
|
+
return null;
|
|
3215
|
+
const r = n.replace(/'/g, "'").replace(/"/g, '"');
|
|
3216
|
+
return JSON.parse(r);
|
|
3217
|
+
} catch (n) {
|
|
3218
|
+
return null;
|
|
2686
3219
|
}
|
|
2687
3220
|
}
|
|
2688
|
-
const
|
|
3221
|
+
const dn = `
|
|
2689
3222
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2690
3223
|
<path d="m5 15 10-10m0 10L5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2691
3224
|
</svg>
|
|
2692
|
-
`,
|
|
3225
|
+
`, hn = `
|
|
2693
3226
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2694
3227
|
<path
|
|
2695
3228
|
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 +3232,7 @@ const to = `
|
|
|
2699
3232
|
stroke-linejoin="round"
|
|
2700
3233
|
/>
|
|
2701
3234
|
</svg>
|
|
2702
|
-
`,
|
|
3235
|
+
`, un = `
|
|
2703
3236
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2704
3237
|
<path
|
|
2705
3238
|
d="M8.5 5h6m-10 12h6m1-12-4 12"
|
|
@@ -2709,19 +3242,25 @@ const to = `
|
|
|
2709
3242
|
stroke-linejoin="round"
|
|
2710
3243
|
/>
|
|
2711
3244
|
</svg>
|
|
2712
|
-
`,
|
|
3245
|
+
`, pn = `
|
|
2713
3246
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2714
3247
|
<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
3248
|
<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
3249
|
</svg>
|
|
2717
|
-
`,
|
|
3250
|
+
`, fn = `
|
|
3251
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3252
|
+
<path d="M6.5 14L10 5l3.5 9" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3253
|
+
<path d="M7.5 11.5h5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
3254
|
+
<rect x="4.5" y="16" width="11" height="1.5" rx="0.75" fill="currentColor"/>
|
|
3255
|
+
</svg>
|
|
3256
|
+
`, gn = `
|
|
2718
3257
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2719
3258
|
<path d="M14.5 6.5l2-2-2-2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2720
3259
|
<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
3260
|
<path d="M5.5 13.5l-2 2 2 2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2722
3261
|
<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
3262
|
</svg>
|
|
2724
|
-
`,
|
|
3263
|
+
`, mn = `
|
|
2725
3264
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2726
3265
|
<circle cx="7.5" cy="5.5" r="1" fill="currentColor"/>
|
|
2727
3266
|
<circle cx="12.5" cy="5.5" r="1" fill="currentColor"/>
|
|
@@ -2730,24 +3269,24 @@ const to = `
|
|
|
2730
3269
|
<circle cx="7.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2731
3270
|
<circle cx="12.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2732
3271
|
</svg>
|
|
2733
|
-
`,
|
|
3272
|
+
`, vn = `
|
|
2734
3273
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2735
3274
|
<path d="M4.5 10h11M10 4.5v11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2736
3275
|
</svg>
|
|
2737
|
-
`,
|
|
3276
|
+
`, bn = `
|
|
2738
3277
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2739
3278
|
<path d="m12 5-5 5 5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2740
3279
|
</svg>
|
|
2741
|
-
`,
|
|
3280
|
+
`, go = `
|
|
2742
3281
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2743
3282
|
<path d="m8 5 5 5-5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2744
3283
|
</svg>
|
|
2745
|
-
`,
|
|
3284
|
+
`, mo = `
|
|
2746
3285
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2747
3286
|
<circle cx="9" cy="9" r="4.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2748
3287
|
<path d="m12.5 12.5 3.5 3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2749
3288
|
</svg>
|
|
2750
|
-
`,
|
|
3289
|
+
`, wn = `
|
|
2751
3290
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2752
3291
|
<path
|
|
2753
3292
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 5 2.5-1.66667V15"
|
|
@@ -2757,7 +3296,7 @@ const to = `
|
|
|
2757
3296
|
stroke-linejoin="round"
|
|
2758
3297
|
/>
|
|
2759
3298
|
</svg>
|
|
2760
|
-
`,
|
|
3299
|
+
`, kn = `
|
|
2761
3300
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2762
3301
|
<path
|
|
2763
3302
|
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 +3306,7 @@ const to = `
|
|
|
2767
3306
|
stroke-linejoin="round"
|
|
2768
3307
|
/>
|
|
2769
3308
|
</svg>
|
|
2770
|
-
`,
|
|
3309
|
+
`, Cn = `
|
|
2771
3310
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2772
3311
|
<path
|
|
2773
3312
|
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 +3316,7 @@ const to = `
|
|
|
2777
3316
|
stroke-linejoin="round"
|
|
2778
3317
|
/>
|
|
2779
3318
|
</svg>
|
|
2780
|
-
`,
|
|
3319
|
+
`, yn = `
|
|
2781
3320
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2782
3321
|
<path
|
|
2783
3322
|
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 +3326,7 @@ const to = `
|
|
|
2787
3326
|
stroke-linejoin="round"
|
|
2788
3327
|
/>
|
|
2789
3328
|
</svg>
|
|
2790
|
-
`,
|
|
3329
|
+
`, En = `
|
|
2791
3330
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2792
3331
|
<path
|
|
2793
3332
|
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 +3336,7 @@ const to = `
|
|
|
2797
3336
|
stroke-linejoin="round"
|
|
2798
3337
|
/>
|
|
2799
3338
|
</svg>
|
|
2800
|
-
`,
|
|
3339
|
+
`, xn = `
|
|
2801
3340
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2802
3341
|
<path
|
|
2803
3342
|
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 +3346,7 @@ const to = `
|
|
|
2807
3346
|
stroke-linejoin="round"
|
|
2808
3347
|
/>
|
|
2809
3348
|
</svg>
|
|
2810
|
-
`,
|
|
3349
|
+
`, Tn = `
|
|
2811
3350
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2812
3351
|
<path
|
|
2813
3352
|
d="M6.5 10h6.6667M6.5 15V5m6.6667 10V5"
|
|
@@ -2817,7 +3356,7 @@ const to = `
|
|
|
2817
3356
|
stroke-linejoin="round"
|
|
2818
3357
|
/>
|
|
2819
3358
|
</svg>
|
|
2820
|
-
`,
|
|
3359
|
+
`, In = `
|
|
2821
3360
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2822
3361
|
<path
|
|
2823
3362
|
d="M14.5 7.28571V6h-9v1.28571M10 6v9m0 0H8.71429M10 15h1.2857"
|
|
@@ -2827,32 +3366,41 @@ const to = `
|
|
|
2827
3366
|
stroke-linejoin="round"
|
|
2828
3367
|
/>
|
|
2829
3368
|
</svg>
|
|
2830
|
-
`,
|
|
3369
|
+
`, An = `
|
|
2831
3370
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2832
3371
|
<path d="M10 4 3 16h14Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2833
3372
|
<path d="M10 8.5v3.5m0 2v.01" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2834
3373
|
</svg>
|
|
2835
|
-
`,
|
|
3374
|
+
`, Sn = `
|
|
2836
3375
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2837
3376
|
<path
|
|
2838
|
-
d="
|
|
3377
|
+
d="M3 3l3 2-3 2M9 5h8M6 10h11M6 15h11"
|
|
2839
3378
|
stroke="currentColor"
|
|
2840
3379
|
stroke-width="1.25"
|
|
2841
3380
|
stroke-linecap="round"
|
|
2842
3381
|
stroke-linejoin="round"
|
|
2843
3382
|
/>
|
|
2844
3383
|
</svg>
|
|
2845
|
-
`,
|
|
3384
|
+
`, Nn = `
|
|
2846
3385
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2847
3386
|
<path
|
|
2848
|
-
d="M8 5h9M8 10h9M8
|
|
3387
|
+
d="M8 5h9M8 10h9M8 15h9"
|
|
2849
3388
|
stroke="currentColor"
|
|
2850
3389
|
stroke-width="1.25"
|
|
2851
3390
|
stroke-linecap="round"
|
|
2852
|
-
stroke-linejoin="round"
|
|
2853
3391
|
/>
|
|
3392
|
+
<circle cx="4" cy="5" r="1" fill="currentColor"/>
|
|
3393
|
+
<circle cx="4" cy="10" r="1" fill="currentColor"/>
|
|
3394
|
+
<circle cx="4" cy="15" r="1" fill="currentColor"/>
|
|
2854
3395
|
</svg>
|
|
2855
|
-
`,
|
|
3396
|
+
`, Ln = `
|
|
3397
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3398
|
+
<path d="M8 5h9M8 10h9M8 15h9" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
3399
|
+
<text x="4" y="6" fill="currentColor" font-size="5" font-family="sans-serif" text-anchor="middle" dominant-baseline="central">1</text>
|
|
3400
|
+
<text x="4" y="11" fill="currentColor" font-size="5" font-family="sans-serif" text-anchor="middle" dominant-baseline="central">2</text>
|
|
3401
|
+
<text x="4" y="16" fill="currentColor" font-size="5" font-family="sans-serif" text-anchor="middle" dominant-baseline="central">3</text>
|
|
3402
|
+
</svg>
|
|
3403
|
+
`, On = `
|
|
2856
3404
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2857
3405
|
<path
|
|
2858
3406
|
d="M10 5h7M10 10h7M10 15h7M3 5l1 1 2-2M3 10l1 1 2-2M3 15l1 1 2-2"
|
|
@@ -2862,54 +3410,75 @@ const to = `
|
|
|
2862
3410
|
stroke-linejoin="round"
|
|
2863
3411
|
/>
|
|
2864
3412
|
</svg>
|
|
2865
|
-
`,
|
|
3413
|
+
`, Mn = `
|
|
2866
3414
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2867
3415
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2868
3416
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2869
3417
|
</svg>
|
|
2870
|
-
`,
|
|
3418
|
+
`, Rn = `
|
|
2871
3419
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2872
3420
|
<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
3421
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2874
3422
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2875
3423
|
</svg>
|
|
2876
|
-
`,
|
|
3424
|
+
`, Bn = `
|
|
2877
3425
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2878
3426
|
<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
3427
|
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2880
3428
|
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2881
3429
|
</svg>
|
|
2882
|
-
`,
|
|
3430
|
+
`, Hn = `
|
|
2883
3431
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2884
3432
|
<path d="M10 4l-3 3m3-3l3 3M10 4v7M5 16h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2885
3433
|
</svg>
|
|
2886
|
-
`,
|
|
3434
|
+
`, Fn = `
|
|
2887
3435
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2888
3436
|
<path d="M10 16l-3-3m3 3l3-3M10 16V9M5 4h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2889
3437
|
</svg>
|
|
2890
|
-
`,
|
|
3438
|
+
`, Pn = `
|
|
2891
3439
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2892
3440
|
<path d="M4 10l3-3M4 10l3 3M4 10h7M16 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2893
3441
|
</svg>
|
|
2894
|
-
`,
|
|
3442
|
+
`, $n = `
|
|
2895
3443
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2896
3444
|
<path d="M16 10l-3-3m3 3l-3 3M16 10H9M4 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2897
3445
|
</svg>
|
|
2898
|
-
`,
|
|
3446
|
+
`, Dn = `
|
|
3447
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3448
|
+
<rect x="7" y="7" width="9" height="9" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
3449
|
+
<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"/>
|
|
3450
|
+
</svg>
|
|
3451
|
+
`, jn = `
|
|
2899
3452
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2900
3453
|
<path d="M4.5 6.5h11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2901
3454
|
<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
3455
|
<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
3456
|
<path d="M8.5 9.5v3.5M11.5 9.5v3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2904
3457
|
</svg>
|
|
2905
|
-
`,
|
|
3458
|
+
`, _n = `
|
|
3459
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3460
|
+
<path d="M2.5 10h5M2.5 15V5M7.5 15V5m3.5 5 2-1.5V15" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3461
|
+
<path d="M16 7l2.5 3-2.5 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3462
|
+
</svg>
|
|
3463
|
+
`, Gn = `
|
|
3464
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3465
|
+
<path d="M2.5 10h5M2.5 15V5M7.5 15V5m7 10h-3c0-3 3-2.25 3-4.5 0-1.125-1.5-1.875-3-.75" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3466
|
+
<path d="M16 7l2.5 3-2.5 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3467
|
+
</svg>
|
|
3468
|
+
`, Wn = `
|
|
3469
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3470
|
+
<path d="M2.5 10h5M2.5 15V5M7.5 15V5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3471
|
+
<path d="M11 8.5c1.25-.75 2.5-.25 2.5.75 0 .75-1 1.25-1 1.25s1 .5 1 1.25c0 1-1.25 1.5-2.5.75" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3472
|
+
<path d="M16 7l2.5 3-2.5 3" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3473
|
+
</svg>
|
|
3474
|
+
`, q = {
|
|
2906
3475
|
root: "",
|
|
2907
3476
|
alignedStart: "text-start",
|
|
2908
3477
|
alignedCenter: "text-center",
|
|
2909
3478
|
title: "",
|
|
2910
3479
|
description: "opacity-60 mt-[3px]"
|
|
2911
3480
|
};
|
|
2912
|
-
class
|
|
3481
|
+
class vo {
|
|
2913
3482
|
/**
|
|
2914
3483
|
* Constructs the hint content instance
|
|
2915
3484
|
* @param params - hint content parameters
|
|
@@ -2917,9 +3486,9 @@ class Ce {
|
|
|
2917
3486
|
constructor(t) {
|
|
2918
3487
|
const e = t.alignment === "center" ? "center" : "start";
|
|
2919
3488
|
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 =
|
|
3489
|
+
root: m.make("div", [q.root, e === "center" ? q.alignedCenter : q.alignedStart]),
|
|
3490
|
+
title: m.make("div", q.title, { textContent: t.title })
|
|
3491
|
+
}, 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
3492
|
}
|
|
2924
3493
|
/**
|
|
2925
3494
|
* Returns the root element of the hint content
|
|
@@ -2928,7 +3497,7 @@ class Ce {
|
|
|
2928
3497
|
return this.nodes.root;
|
|
2929
3498
|
}
|
|
2930
3499
|
}
|
|
2931
|
-
class
|
|
3500
|
+
class St {
|
|
2932
3501
|
/**
|
|
2933
3502
|
* Constructs the instance
|
|
2934
3503
|
* @param params - instance parameters
|
|
@@ -2947,7 +3516,7 @@ class ut {
|
|
|
2947
3516
|
* Destroys the instance
|
|
2948
3517
|
*/
|
|
2949
3518
|
destroy() {
|
|
2950
|
-
|
|
3519
|
+
io();
|
|
2951
3520
|
}
|
|
2952
3521
|
/**
|
|
2953
3522
|
* Called when children popover is opened (if exists)
|
|
@@ -2976,8 +3545,8 @@ class ut {
|
|
|
2976
3545
|
* @param hintData - hint data
|
|
2977
3546
|
*/
|
|
2978
3547
|
addHint(t, e) {
|
|
2979
|
-
const o = new
|
|
2980
|
-
|
|
3548
|
+
const o = new vo(e);
|
|
3549
|
+
ao(t, o.getElement(), {
|
|
2981
3550
|
placement: e.position
|
|
2982
3551
|
});
|
|
2983
3552
|
}
|
|
@@ -3049,7 +3618,7 @@ class ut {
|
|
|
3049
3618
|
return this.params === void 0 || !("isActive" in this.params) ? !1 : typeof this.params.isActive == "function" ? this.params.isActive() : this.params.isActive === !0;
|
|
3050
3619
|
}
|
|
3051
3620
|
}
|
|
3052
|
-
const
|
|
3621
|
+
const X = {
|
|
3053
3622
|
/**
|
|
3054
3623
|
* Base item styles with hover, focus, and active support
|
|
3055
3624
|
* Hover is applied via can-hover:hover: for real hover and data-blok-force-hover for tests
|
|
@@ -3058,7 +3627,7 @@ const $ = {
|
|
|
3058
3627
|
* Note: noHover state is handled via [data-blok-popover-item-no-hover] which disables hover
|
|
3059
3628
|
* Priority order: active < hover < focus (focus wins when navigating with keyboard)
|
|
3060
3629
|
*/
|
|
3061
|
-
item: 'flex items-center select-none border-none bg-transparent rounded-
|
|
3630
|
+
item: 'flex items-center select-none border-none bg-transparent rounded-lg px-2 py-(--item-padding) text-text-primary mb-0.5 transition-colors duration-150 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
3631
|
/**
|
|
3063
3632
|
* Item disabled state
|
|
3064
3633
|
*/
|
|
@@ -3066,24 +3635,24 @@ const $ = {
|
|
|
3066
3635
|
/**
|
|
3067
3636
|
* Icon container styles
|
|
3068
3637
|
*/
|
|
3069
|
-
icon: "flex items-center justify-center w-[26px] h-[26px] [&_svg]:w-icon [&_svg]:h-icon",
|
|
3638
|
+
icon: "flex items-center justify-center w-[26px] h-[26px] rounded-lg [&_svg]:w-icon [&_svg]:h-icon",
|
|
3070
3639
|
/**
|
|
3071
3640
|
* Focused state class for DomIterator/Flipper keyboard navigation.
|
|
3072
3641
|
* Used alongside data-blok-focused attribute.
|
|
3073
3642
|
*/
|
|
3074
3643
|
focused: "is-focused"
|
|
3075
|
-
},
|
|
3644
|
+
}, bo = {
|
|
3076
3645
|
/**
|
|
3077
3646
|
* Item in inline context - more compact styling
|
|
3078
3647
|
*/
|
|
3079
|
-
item: "rounded p-1"
|
|
3080
|
-
},
|
|
3648
|
+
item: "rounded-sm p-1"
|
|
3649
|
+
}, wo = {
|
|
3081
3650
|
/**
|
|
3082
3651
|
* Nested item - back to desktop popover styling
|
|
3083
3652
|
*/
|
|
3084
3653
|
item: "rounded-md p-[3px] mobile:p-1"
|
|
3085
3654
|
};
|
|
3086
|
-
class
|
|
3655
|
+
class B extends St {
|
|
3087
3656
|
/**
|
|
3088
3657
|
* Constructs popover item instance
|
|
3089
3658
|
* @param params - popover item construction params
|
|
@@ -3143,7 +3712,7 @@ class I extends ut {
|
|
|
3143
3712
|
* True if item is focused in keyboard navigation process
|
|
3144
3713
|
*/
|
|
3145
3714
|
get isFocused() {
|
|
3146
|
-
return this.nodes.root === null ? !1 : this.nodes.root.hasAttribute(
|
|
3715
|
+
return this.nodes.root === null ? !1 : this.nodes.root.hasAttribute(p.focused);
|
|
3147
3716
|
}
|
|
3148
3717
|
/**
|
|
3149
3718
|
* Returns popover item root element
|
|
@@ -3168,7 +3737,7 @@ class I extends ut {
|
|
|
3168
3737
|
toggleActive(t) {
|
|
3169
3738
|
if (this.nodes.root === null)
|
|
3170
3739
|
return;
|
|
3171
|
-
const e = this.nodes.root.hasAttribute(
|
|
3740
|
+
const e = this.nodes.root.hasAttribute(p.popoverItemActive), o = t !== void 0 ? t : !e;
|
|
3172
3741
|
this.setActive(o);
|
|
3173
3742
|
}
|
|
3174
3743
|
/**
|
|
@@ -3196,76 +3765,77 @@ class I extends ut {
|
|
|
3196
3765
|
* @param renderParams - popover item render params
|
|
3197
3766
|
*/
|
|
3198
3767
|
createRootElement(t, e) {
|
|
3199
|
-
var
|
|
3200
|
-
const o = (
|
|
3201
|
-
return o === "button" &&
|
|
3202
|
-
|
|
3203
|
-
}), t.isDisabled &&
|
|
3204
|
-
position: ((
|
|
3205
|
-
alignment: ((
|
|
3206
|
-
})),
|
|
3768
|
+
var i, a, l, c;
|
|
3769
|
+
const o = (i = e == null ? void 0 : e.wrapperTag) != null ? i : "div", n = document.createElement(o);
|
|
3770
|
+
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, h]) => {
|
|
3771
|
+
n.setAttribute(`data-${d}`, h);
|
|
3772
|
+
}), 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(N({}, t.hint), {
|
|
3773
|
+
position: ((l = e == null ? void 0 : e.hint) == null ? void 0 : l.position) || "right",
|
|
3774
|
+
alignment: ((c = e == null ? void 0 : e.hint) == null ? void 0 : c.alignment) || "center"
|
|
3775
|
+
})), n;
|
|
3207
3776
|
}
|
|
3208
3777
|
/**
|
|
3209
3778
|
* Creates the content elements (icon, title, secondary label, chevron)
|
|
3210
3779
|
*/
|
|
3211
3780
|
createContentElements(t, e, o) {
|
|
3212
|
-
var
|
|
3213
|
-
const
|
|
3214
|
-
if (e.icon && (this.nodes.icon = this.createIconElement(e.icon,
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3781
|
+
var c, d, h;
|
|
3782
|
+
const n = (c = o == null ? void 0 : o.iconWithGap) != null ? c : !0, r = (d = o == null ? void 0 : o.isInline) != null ? d : !1, i = (h = o == null ? void 0 : o.isNestedInline) != null ? h : !1, a = e.title;
|
|
3783
|
+
if (e.icon && (this.nodes.icon = this.createIconElement(e.icon, n, r, i), t.appendChild(this.nodes.icon)), a !== void 0) {
|
|
3784
|
+
const u = document.createElement("div");
|
|
3785
|
+
u.className = e.secondaryLabel ? "grow truncate text-sm font-medium leading-5" : "mr-auto truncate text-sm font-medium leading-5", u.setAttribute(p.popoverItemTitle, ""), u.setAttribute("data-blok-testid", "popover-item-title"), u.textContent = a, t.appendChild(u), this.nodes.titleEl = u;
|
|
3217
3786
|
}
|
|
3218
3787
|
if (e.secondaryLabel) {
|
|
3219
|
-
const
|
|
3220
|
-
|
|
3788
|
+
const u = document.createElement("div");
|
|
3789
|
+
u.className = "ml-auto flex items-center whitespace-nowrap pl-3 text-[11px] font-medium tracking-wide text-text-secondary/50", u.setAttribute(p.popoverItemSecondaryTitle, ""), u.setAttribute("data-blok-testid", "popover-item-secondary-title"), u.textContent = e.secondaryLabel, t.appendChild(u), this.nodes.secondaryLabelEl = u;
|
|
3221
3790
|
}
|
|
3222
3791
|
if (this.hasChildren && !this.isChevronHidden) {
|
|
3223
|
-
const
|
|
3224
|
-
|
|
3792
|
+
const u = document.createElement("div");
|
|
3793
|
+
u.className = this.getChevronClass(r), u.setAttribute(p.popoverItemIcon, ""), u.setAttribute(p.popoverItemIconChevronRight, ""), u.setAttribute("data-blok-testid", "popover-item-chevron-right"), u.innerHTML = go, t.appendChild(u), this.nodes.chevron = u;
|
|
3225
3794
|
}
|
|
3226
3795
|
}
|
|
3227
3796
|
/**
|
|
3228
3797
|
* Creates an icon element
|
|
3229
3798
|
*/
|
|
3230
|
-
createIconElement(t, e, o,
|
|
3231
|
-
const
|
|
3232
|
-
return
|
|
3799
|
+
createIconElement(t, e, o, n) {
|
|
3800
|
+
const r = document.createElement("div");
|
|
3801
|
+
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
3802
|
}
|
|
3234
3803
|
/**
|
|
3235
3804
|
* Gets the container class based on current state
|
|
3236
3805
|
*/
|
|
3237
3806
|
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 &&
|
|
3807
|
+
var o, n, r, i;
|
|
3808
|
+
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;
|
|
3809
|
+
return A(
|
|
3810
|
+
X.item,
|
|
3811
|
+
// Asymmetric padding: pr-8 for visual balance, pr-4 when secondary label or chevron occupies right edge
|
|
3812
|
+
!t && !e && (this.params.secondaryLabel || this.hasChildren && !this.isChevronHidden ? "pl-2 pr-4" : "pl-2 pr-8"),
|
|
3813
|
+
t && bo.item,
|
|
3814
|
+
e && wo.item,
|
|
3815
|
+
this.params.isDisabled && X.itemDisabled
|
|
3247
3816
|
);
|
|
3248
3817
|
}
|
|
3249
3818
|
/**
|
|
3250
3819
|
* Gets the icon class based on context
|
|
3251
3820
|
*/
|
|
3252
|
-
getIconClass(t, e, o,
|
|
3253
|
-
return
|
|
3254
|
-
|
|
3821
|
+
getIconClass(t, e, o, n) {
|
|
3822
|
+
return A(
|
|
3823
|
+
X.icon,
|
|
3255
3824
|
e && "w-auto h-auto [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",
|
|
3256
3825
|
o && "w-toolbox-btn h-toolbox-btn",
|
|
3257
3826
|
t && "mr-3",
|
|
3258
|
-
t && e && "
|
|
3259
|
-
t &&
|
|
3260
|
-
|
|
3827
|
+
t && !e && "bg-icon-bg",
|
|
3828
|
+
t && e && "shadow-none bg-transparent mr-0!",
|
|
3829
|
+
t && o && "mr-2!",
|
|
3830
|
+
n && "animate-wobble"
|
|
3261
3831
|
);
|
|
3262
3832
|
}
|
|
3263
3833
|
/**
|
|
3264
3834
|
* Gets the chevron class based on context
|
|
3265
3835
|
*/
|
|
3266
3836
|
getChevronClass(t) {
|
|
3267
|
-
return
|
|
3268
|
-
|
|
3837
|
+
return A(
|
|
3838
|
+
X.icon,
|
|
3269
3839
|
t && "rotate-90"
|
|
3270
3840
|
);
|
|
3271
3841
|
}
|
|
@@ -3273,32 +3843,32 @@ class I extends ut {
|
|
|
3273
3843
|
* Sets the active state of the item
|
|
3274
3844
|
*/
|
|
3275
3845
|
setActive(t) {
|
|
3276
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3846
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemActive, "true") : this.nodes.root.removeAttribute(p.popoverItemActive));
|
|
3277
3847
|
}
|
|
3278
3848
|
/**
|
|
3279
3849
|
* Sets the hidden state of the item
|
|
3280
3850
|
*/
|
|
3281
3851
|
setHidden(t) {
|
|
3282
|
-
this.nodes.root && (t ? (this.nodes.root.setAttribute(
|
|
3852
|
+
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
3853
|
}
|
|
3284
3854
|
/**
|
|
3285
3855
|
* Sets the focused state of the item
|
|
3286
3856
|
* @param isFocused - true if item should be focused
|
|
3287
3857
|
*/
|
|
3288
3858
|
setFocused(t) {
|
|
3289
|
-
this.nodes.root && (t ? (this.nodes.root.setAttribute(
|
|
3859
|
+
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
3860
|
}
|
|
3291
3861
|
/**
|
|
3292
3862
|
* Sets the no-hover state
|
|
3293
3863
|
*/
|
|
3294
3864
|
setNoHover(t) {
|
|
3295
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3865
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemNoHover, "true") : this.nodes.root.removeAttribute(p.popoverItemNoHover));
|
|
3296
3866
|
}
|
|
3297
3867
|
/**
|
|
3298
3868
|
* Sets the no-focus state
|
|
3299
3869
|
*/
|
|
3300
3870
|
setNoFocus(t) {
|
|
3301
|
-
this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
3871
|
+
this.nodes.root && (t ? this.nodes.root.setAttribute(p.popoverItemNoFocus, "true") : this.nodes.root.removeAttribute(p.popoverItemNoFocus));
|
|
3302
3872
|
}
|
|
3303
3873
|
/**
|
|
3304
3874
|
* Activates confirmation mode for the item.
|
|
@@ -3307,7 +3877,7 @@ class I extends ut {
|
|
|
3307
3877
|
enableConfirmationMode(t) {
|
|
3308
3878
|
if (this.nodes.root === null)
|
|
3309
3879
|
return;
|
|
3310
|
-
const e =
|
|
3880
|
+
const e = D(N(N({}, this.params), t), {
|
|
3311
3881
|
confirmation: "confirmation" in t ? t.confirmation : void 0
|
|
3312
3882
|
});
|
|
3313
3883
|
this.setConfirmation(e), this.confirmationState = t, this.enableSpecialHoverAndFocusBehavior();
|
|
@@ -3328,13 +3898,13 @@ class I extends ut {
|
|
|
3328
3898
|
* Clears confirmation state and restores original content
|
|
3329
3899
|
*/
|
|
3330
3900
|
clearConfirmationState() {
|
|
3331
|
-
this.nodes.root && (this.nodes.root.removeAttribute(
|
|
3901
|
+
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
3902
|
}
|
|
3333
3903
|
/**
|
|
3334
3904
|
* Applies confirmation state with new params
|
|
3335
3905
|
*/
|
|
3336
3906
|
applyConfirmationState(t) {
|
|
3337
|
-
this.nodes.root && (this.nodes.root.setAttribute(
|
|
3907
|
+
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
3908
|
}
|
|
3339
3909
|
/**
|
|
3340
3910
|
* Restores the original icon
|
|
@@ -3419,15 +3989,15 @@ class I extends ut {
|
|
|
3419
3989
|
* Triggers wobble animation on the icon
|
|
3420
3990
|
*/
|
|
3421
3991
|
triggerWobble() {
|
|
3422
|
-
var
|
|
3992
|
+
var r, i, a, l, c, d;
|
|
3423
3993
|
if (!this.nodes.icon)
|
|
3424
3994
|
return;
|
|
3425
|
-
const t = (
|
|
3426
|
-
this.nodes.icon.setAttribute(
|
|
3427
|
-
const
|
|
3428
|
-
this.nodes.icon && (this.nodes.icon.removeAttribute(
|
|
3995
|
+
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;
|
|
3996
|
+
this.nodes.icon.setAttribute(p.popoverItemWobble, "true"), this.nodes.icon.className = this.getIconClass(o, t, e, !0);
|
|
3997
|
+
const n = () => {
|
|
3998
|
+
this.nodes.icon && (this.nodes.icon.removeAttribute(p.popoverItemWobble), this.nodes.icon.className = this.getIconClass(o, t, e, !1));
|
|
3429
3999
|
};
|
|
3430
|
-
this.nodes.icon.addEventListener("animationend",
|
|
4000
|
+
this.nodes.icon.addEventListener("animationend", n, { once: !0 });
|
|
3431
4001
|
}
|
|
3432
4002
|
/**
|
|
3433
4003
|
* Gets reference to the icon element
|
|
@@ -3436,11 +4006,11 @@ class I extends ut {
|
|
|
3436
4006
|
return this.nodes.icon;
|
|
3437
4007
|
}
|
|
3438
4008
|
}
|
|
3439
|
-
const
|
|
4009
|
+
const j = {
|
|
3440
4010
|
container: "py-1 px-[3px]",
|
|
3441
4011
|
containerHidden: "hidden",
|
|
3442
4012
|
line: "h-px w-full bg-popover-border"
|
|
3443
|
-
},
|
|
4013
|
+
}, et = {
|
|
3444
4014
|
// Inline context: horizontal separator
|
|
3445
4015
|
container: "px-1 py-0",
|
|
3446
4016
|
line: "h-full w-px",
|
|
@@ -3448,7 +4018,7 @@ const A = {
|
|
|
3448
4018
|
nestedContainer: "py-1 px-[3px]",
|
|
3449
4019
|
nestedLine: "w-full h-px"
|
|
3450
4020
|
};
|
|
3451
|
-
class
|
|
4021
|
+
class ie extends St {
|
|
3452
4022
|
/**
|
|
3453
4023
|
* Constructs the instance
|
|
3454
4024
|
* @param renderParams - optional render params for styling context
|
|
@@ -3471,38 +4041,38 @@ class Mt extends ut {
|
|
|
3471
4041
|
if (!this.nodes.root)
|
|
3472
4042
|
return;
|
|
3473
4043
|
const e = this.getContainerClass(!1), o = this.getContainerClass(!0);
|
|
3474
|
-
this.nodes.root.className = t ? o : e, t ? this.nodes.root.setAttribute(
|
|
4044
|
+
this.nodes.root.className = t ? o : e, t ? this.nodes.root.setAttribute(p.hidden, "true") : this.nodes.root.removeAttribute(p.hidden);
|
|
3475
4045
|
}
|
|
3476
4046
|
/**
|
|
3477
4047
|
* Build container class based on context
|
|
3478
4048
|
*/
|
|
3479
4049
|
getContainerClass(t) {
|
|
3480
|
-
const e =
|
|
3481
|
-
return this.isNestedInline ?
|
|
4050
|
+
const e = j.container;
|
|
4051
|
+
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
4052
|
}
|
|
3483
4053
|
/**
|
|
3484
4054
|
* Build line class based on context
|
|
3485
4055
|
*/
|
|
3486
4056
|
getLineClass() {
|
|
3487
|
-
return this.isNestedInline ?
|
|
4057
|
+
return this.isNestedInline ? A(j.line, et.nestedLine) : this.isInline ? A(j.line, et.line) : j.line;
|
|
3488
4058
|
}
|
|
3489
4059
|
/**
|
|
3490
4060
|
* Creates the root container element
|
|
3491
4061
|
*/
|
|
3492
4062
|
createRootElement() {
|
|
3493
4063
|
const t = document.createElement("div");
|
|
3494
|
-
t.className = this.getContainerClass(!1), t.setAttribute(
|
|
4064
|
+
t.className = this.getContainerClass(!1), t.setAttribute(p.popoverItemSeparator, ""), t.setAttribute("data-blok-testid", "popover-item-separator");
|
|
3495
4065
|
const e = document.createElement("div");
|
|
3496
|
-
return e.className = this.getLineClass(), e.setAttribute(
|
|
4066
|
+
return e.className = this.getLineClass(), e.setAttribute(p.popoverItemSeparatorLine, ""), t.appendChild(e), this.nodes.line = e, t;
|
|
3497
4067
|
}
|
|
3498
4068
|
}
|
|
3499
|
-
const
|
|
4069
|
+
const wt = {
|
|
3500
4070
|
root: "",
|
|
3501
4071
|
rootHidden: "hidden"
|
|
3502
|
-
},
|
|
4072
|
+
}, Kt = {
|
|
3503
4073
|
root: "flex items-center"
|
|
3504
4074
|
};
|
|
3505
|
-
class
|
|
4075
|
+
class ct extends St {
|
|
3506
4076
|
/**
|
|
3507
4077
|
* Constructs the instance
|
|
3508
4078
|
* @param params – instance parameters
|
|
@@ -3524,7 +4094,7 @@ class Z extends ut {
|
|
|
3524
4094
|
* @param isHidden - true if item should be hidden
|
|
3525
4095
|
*/
|
|
3526
4096
|
toggleHidden(t) {
|
|
3527
|
-
this.isHidden = t, this.updateRootClasses(), this.nodes.root && (t ? this.nodes.root.setAttribute(
|
|
4097
|
+
this.isHidden = t, this.updateRootClasses(), this.nodes.root && (t ? this.nodes.root.setAttribute(p.hidden, "true") : this.nodes.root.removeAttribute(p.hidden));
|
|
3528
4098
|
}
|
|
3529
4099
|
/**
|
|
3530
4100
|
* Returns list of buttons and inputs inside custom content
|
|
@@ -3533,7 +4103,7 @@ class Z extends ut {
|
|
|
3533
4103
|
if (!this.nodes.root)
|
|
3534
4104
|
return [];
|
|
3535
4105
|
const t = this.nodes.root.querySelectorAll(
|
|
3536
|
-
`button, ${
|
|
4106
|
+
`button, ${m.allInputsSelector}`
|
|
3537
4107
|
);
|
|
3538
4108
|
return Array.from(t);
|
|
3539
4109
|
}
|
|
@@ -3541,10 +4111,10 @@ class Z extends ut {
|
|
|
3541
4111
|
* Updates the root element's class list based on current state
|
|
3542
4112
|
*/
|
|
3543
4113
|
updateRootClasses() {
|
|
3544
|
-
this.nodes.root && (this.nodes.root.className =
|
|
3545
|
-
|
|
3546
|
-
this.isInline &&
|
|
3547
|
-
this.isHidden &&
|
|
4114
|
+
this.nodes.root && (this.nodes.root.className = A(
|
|
4115
|
+
wt.root,
|
|
4116
|
+
this.isInline && Kt.root,
|
|
4117
|
+
this.isHidden && wt.rootHidden
|
|
3548
4118
|
));
|
|
3549
4119
|
}
|
|
3550
4120
|
/**
|
|
@@ -3553,28 +4123,28 @@ class Z extends ut {
|
|
|
3553
4123
|
* @param renderParams - render configuration
|
|
3554
4124
|
*/
|
|
3555
4125
|
createRootElement(t, e) {
|
|
3556
|
-
var
|
|
4126
|
+
var n, r, i;
|
|
3557
4127
|
const o = document.createElement("div");
|
|
3558
|
-
return o.className =
|
|
3559
|
-
|
|
3560
|
-
this.isInline &&
|
|
3561
|
-
), o.setAttribute(
|
|
3562
|
-
position: ((
|
|
3563
|
-
alignment: ((
|
|
4128
|
+
return o.className = A(
|
|
4129
|
+
wt.root,
|
|
4130
|
+
this.isInline && Kt.root
|
|
4131
|
+
), 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(N({}, t.hint), {
|
|
4132
|
+
position: ((r = e == null ? void 0 : e.hint) == null ? void 0 : r.position) || "right",
|
|
4133
|
+
alignment: ((i = e == null ? void 0 : e.hint) == null ? void 0 : i.alignment) || "center"
|
|
3564
4134
|
})), o;
|
|
3565
4135
|
}
|
|
3566
4136
|
}
|
|
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]",
|
|
4137
|
+
const kt = {
|
|
4138
|
+
wrapper: "bg-[#F8F8F8] border border-[rgba(226,226,229,0.20)] rounded-lg p-0.5 grid grid-cols-[auto_auto_1fr] grid-rows-[auto] transition-colors duration-150 focus-within:bg-white focus-within:border-[rgba(56,138,229,0.3)]",
|
|
3569
4139
|
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) ||
|
|
4140
|
+
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"
|
|
4141
|
+
}, ae = (s, t) => {
|
|
4142
|
+
var i, a, l, c, d;
|
|
4143
|
+
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 : [];
|
|
4144
|
+
return o.includes(e) || n.includes(e) || r.some((h) => h.toLowerCase().includes(e));
|
|
3575
4145
|
};
|
|
3576
|
-
var
|
|
3577
|
-
class
|
|
4146
|
+
var Nt = /* @__PURE__ */ ((s) => (s.Search = "search", s))(Nt || {});
|
|
4147
|
+
class ko extends ee {
|
|
3578
4148
|
/**
|
|
3579
4149
|
* @param options - available config
|
|
3580
4150
|
* @param options.items - searchable items list
|
|
@@ -3583,11 +4153,11 @@ class Te extends Bt {
|
|
|
3583
4153
|
constructor({ items: t, placeholder: e }) {
|
|
3584
4154
|
super(), this.searchQuery = "", this.handleValueChange = () => {
|
|
3585
4155
|
this.applySearch(this.input.value);
|
|
3586
|
-
}, this.listeners = new
|
|
3587
|
-
const o =
|
|
3588
|
-
innerHTML:
|
|
4156
|
+
}, this.listeners = new Qt(), this.items = t, this.wrapper = m.make("div", kt.wrapper), this.wrapper.setAttribute("data-blok-testid", "popover-search-field");
|
|
4157
|
+
const o = m.make("div", kt.icon, {
|
|
4158
|
+
innerHTML: mo
|
|
3589
4159
|
});
|
|
3590
|
-
this.input =
|
|
4160
|
+
this.input = m.make("input", kt.input, {
|
|
3591
4161
|
type: "search",
|
|
3592
4162
|
placeholder: e,
|
|
3593
4163
|
/**
|
|
@@ -3596,8 +4166,8 @@ class Te extends Bt {
|
|
|
3596
4166
|
* so Tab in the last block will focus this hidden input if this property is not set)
|
|
3597
4167
|
*/
|
|
3598
4168
|
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,
|
|
4169
|
+
}), 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) => {
|
|
4170
|
+
this.listeners.on(this.input, r, this.handleValueChange);
|
|
3601
4171
|
});
|
|
3602
4172
|
}
|
|
3603
4173
|
/**
|
|
@@ -3623,7 +4193,7 @@ class Te extends Bt {
|
|
|
3623
4193
|
* @param query - search query to apply
|
|
3624
4194
|
*/
|
|
3625
4195
|
applySearch(t) {
|
|
3626
|
-
this.searchQuery !== t && (this.searchQuery = t, this.emit(
|
|
4196
|
+
this.searchQuery !== t && (this.searchQuery = t, this.emit(Nt.Search, {
|
|
3627
4197
|
query: t,
|
|
3628
4198
|
items: this.foundItems
|
|
3629
4199
|
}));
|
|
@@ -3632,20 +4202,20 @@ class Te extends Bt {
|
|
|
3632
4202
|
* Overrides value property setter to catch programmatic changes
|
|
3633
4203
|
*/
|
|
3634
4204
|
overrideValueProperty() {
|
|
3635
|
-
var
|
|
4205
|
+
var i, a;
|
|
3636
4206
|
const t = Object.getPrototypeOf(this.input), e = Object.getOwnPropertyDescriptor(t, "value");
|
|
3637
4207
|
if ((e == null ? void 0 : e.set) === void 0 || e.get === void 0)
|
|
3638
4208
|
return;
|
|
3639
|
-
const o = this.applySearch.bind(this),
|
|
4209
|
+
const o = this.applySearch.bind(this), n = e.get, r = e.set;
|
|
3640
4210
|
Object.defineProperty(this.input, "value", {
|
|
3641
|
-
configurable: (
|
|
4211
|
+
configurable: (i = e.configurable) != null ? i : !0,
|
|
3642
4212
|
enumerable: (a = e.enumerable) != null ? a : !1,
|
|
3643
4213
|
get() {
|
|
3644
|
-
const
|
|
3645
|
-
return typeof
|
|
4214
|
+
const l = n == null ? void 0 : n.call(this);
|
|
4215
|
+
return typeof l == "string" ? l : "";
|
|
3646
4216
|
},
|
|
3647
|
-
set(
|
|
3648
|
-
|
|
4217
|
+
set(l) {
|
|
4218
|
+
r == null || r.call(this, l), o(l);
|
|
3649
4219
|
}
|
|
3650
4220
|
});
|
|
3651
4221
|
}
|
|
@@ -3666,10 +4236,10 @@ class Te extends Bt {
|
|
|
3666
4236
|
* @param item - item to be checked
|
|
3667
4237
|
*/
|
|
3668
4238
|
checkItem(t) {
|
|
3669
|
-
return
|
|
4239
|
+
return ae(t, this.searchQuery);
|
|
3670
4240
|
}
|
|
3671
4241
|
}
|
|
3672
|
-
const
|
|
4242
|
+
const L = class L {
|
|
3673
4243
|
constructor() {
|
|
3674
4244
|
this.stack = [], this.boundPointerDown = null;
|
|
3675
4245
|
}
|
|
@@ -3677,7 +4247,7 @@ const k = class k {
|
|
|
3677
4247
|
* Returns the singleton instance, creating it if necessary
|
|
3678
4248
|
*/
|
|
3679
4249
|
static get instance() {
|
|
3680
|
-
return
|
|
4250
|
+
return L._instance === null && (L._instance = new L()), L._instance;
|
|
3681
4251
|
}
|
|
3682
4252
|
/**
|
|
3683
4253
|
* Resets the singleton for testing purposes.
|
|
@@ -3685,7 +4255,7 @@ const k = class k {
|
|
|
3685
4255
|
*/
|
|
3686
4256
|
static resetForTests() {
|
|
3687
4257
|
var t;
|
|
3688
|
-
return (t =
|
|
4258
|
+
return (t = L._instance) == null || t.destroy(), L._instance = new L(), L._instance;
|
|
3689
4259
|
}
|
|
3690
4260
|
/**
|
|
3691
4261
|
* Registers a popover with mutual exclusion.
|
|
@@ -3695,8 +4265,8 @@ const k = class k {
|
|
|
3695
4265
|
*/
|
|
3696
4266
|
register(t, e) {
|
|
3697
4267
|
const o = [...this.stack];
|
|
3698
|
-
for (const
|
|
3699
|
-
|
|
4268
|
+
for (const n of o)
|
|
4269
|
+
n.popover !== t && (n.popover.hide(), this.removeFromStack(n.popover));
|
|
3700
4270
|
this.stack.push({ popover: t, triggerElement: e }), this.ensureDocumentListener();
|
|
3701
4271
|
}
|
|
3702
4272
|
/**
|
|
@@ -3739,13 +4309,13 @@ const k = class k {
|
|
|
3739
4309
|
if (!(e instanceof Node))
|
|
3740
4310
|
return;
|
|
3741
4311
|
const o = [];
|
|
3742
|
-
for (const
|
|
3743
|
-
if (
|
|
4312
|
+
for (const n of [...this.stack].reverse()) {
|
|
4313
|
+
if (n.popover.hasNode(e) || n.triggerElement.contains(e))
|
|
3744
4314
|
break;
|
|
3745
|
-
o.push(
|
|
4315
|
+
o.push(n);
|
|
3746
4316
|
}
|
|
3747
|
-
for (const
|
|
3748
|
-
|
|
4317
|
+
for (const n of o)
|
|
4318
|
+
n.popover.hide();
|
|
3749
4319
|
}
|
|
3750
4320
|
/**
|
|
3751
4321
|
* Lazily adds the pointerdown listener to the document when there are entries in the stack
|
|
@@ -3768,27 +4338,27 @@ const k = class k {
|
|
|
3768
4338
|
e !== -1 && this.stack.splice(e, 1);
|
|
3769
4339
|
}
|
|
3770
4340
|
};
|
|
3771
|
-
|
|
3772
|
-
let
|
|
3773
|
-
const
|
|
4341
|
+
L._instance = null;
|
|
4342
|
+
let dt = L;
|
|
4343
|
+
const ot = {
|
|
3774
4344
|
// Popover container - base styles
|
|
3775
|
-
popoverContainer: "absolute flex flex-col overflow-hidden box-border opacity-0 pointer-events-none p-0 border-none z-
|
|
4345
|
+
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-xl shadow-[0_4px_20px_-4px_var(--color-popover-shadow),0_0_0_0.5px_rgba(0,0,0,0.06)] left-(--popover-left) top-(--popover-top) bg-popover-bg",
|
|
3776
4346
|
// Popover container - mobile styles (applied conditionally)
|
|
3777
4347
|
// Reset left/top from base class since inset shorthand may not properly override them in twMerge
|
|
3778
4348
|
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
4349
|
// Popover container - opened state
|
|
3780
|
-
popoverContainerOpened: "opacity-100 pointer-events-auto p-1 max-h-
|
|
4350
|
+
popoverContainerOpened: "opacity-100 pointer-events-auto p-1.5 max-h-(--max-height) border border-popover-border animate-[panelShowing_100ms_ease]",
|
|
3781
4351
|
// Popover overlay
|
|
3782
4352
|
popoverOverlay: "hidden bg-dark",
|
|
3783
|
-
items: "overflow-y-auto overscroll-contain"
|
|
3784
|
-
},
|
|
4353
|
+
items: "overflow-y-auto overscroll-contain [scrollbar-gutter:stable] pr-1"
|
|
4354
|
+
}, Vn = {
|
|
3785
4355
|
// Popover root element for inline
|
|
3786
4356
|
popover: "relative",
|
|
3787
4357
|
// Container for inline popover
|
|
3788
4358
|
popoverContainer: "flex-row top-0 min-w-max w-max p-1 mobile:absolute"
|
|
3789
|
-
},
|
|
3790
|
-
var
|
|
3791
|
-
class
|
|
4359
|
+
}, Un = (s) => `level-${s}`;
|
|
4360
|
+
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 || {});
|
|
4361
|
+
class Co extends ee {
|
|
3792
4362
|
/**
|
|
3793
4363
|
* Constructs the instance
|
|
3794
4364
|
* @param params - popover construction params
|
|
@@ -3796,16 +4366,16 @@ class Ie extends Bt {
|
|
|
3796
4366
|
* The parameters that are not set by user via popover api but rather depend on technical implementation
|
|
3797
4367
|
*/
|
|
3798
4368
|
constructor(t, e = {}) {
|
|
3799
|
-
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new
|
|
4369
|
+
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new Qt(), this.messages = {
|
|
3800
4370
|
nothingFound: "Nothing found",
|
|
3801
4371
|
search: "Search"
|
|
3802
|
-
}, this.items = this.buildItems(t.items), t.messages && (this.messages =
|
|
4372
|
+
}, this.permanentlyHiddenNames = /* @__PURE__ */ new Set(), this.items = this.buildItems(t.items), t.messages && (this.messages = N(N({}, 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
4373
|
}
|
|
3804
4374
|
/**
|
|
3805
4375
|
* List of default popover items that are searchable and may have confirmation state
|
|
3806
4376
|
*/
|
|
3807
4377
|
get itemsDefault() {
|
|
3808
|
-
return this.items.filter((t) => t instanceof
|
|
4378
|
+
return this.items.filter((t) => t instanceof B);
|
|
3809
4379
|
}
|
|
3810
4380
|
/**
|
|
3811
4381
|
* Returns HTML element corresponding to the popover
|
|
@@ -3823,17 +4393,20 @@ class Ie extends Bt {
|
|
|
3823
4393
|
* Open popover
|
|
3824
4394
|
*/
|
|
3825
4395
|
show() {
|
|
3826
|
-
var
|
|
4396
|
+
var n;
|
|
3827
4397
|
const t = this.nodes.popover;
|
|
3828
|
-
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(
|
|
4398
|
+
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(p.popoverOpened, "true"), this.nodes.popoverContainer.className = A(
|
|
4399
|
+
this.nodes.popoverContainer.className,
|
|
4400
|
+
ot.popoverContainerOpened
|
|
4401
|
+
), this.itemsDefault.forEach((r) => this.refreshItemActiveState(r)), this.search !== void 0 && this.search.focus();
|
|
3829
4402
|
const { trigger: e } = this.params;
|
|
3830
|
-
((
|
|
4403
|
+
((n = this.params.nestingLevel) != null ? n : 0) === 0 && e !== void 0 && dt.instance.register(this, e);
|
|
3831
4404
|
}
|
|
3832
4405
|
/**
|
|
3833
4406
|
* Closes popover
|
|
3834
4407
|
*/
|
|
3835
4408
|
hide() {
|
|
3836
|
-
this.nodes.popover.removeAttribute(
|
|
4409
|
+
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
4410
|
}
|
|
3838
4411
|
/**
|
|
3839
4412
|
* Clears memory
|
|
@@ -3855,7 +4428,15 @@ class Ie extends Bt {
|
|
|
3855
4428
|
* @param isHidden - true to hide, false to show
|
|
3856
4429
|
*/
|
|
3857
4430
|
toggleItemHiddenByName(t, e) {
|
|
3858
|
-
this.items.filter((o) => o.name === t).forEach((o) => o.toggleHidden(e));
|
|
4431
|
+
this.items.filter((o) => o.name === t).forEach((o) => o.toggleHidden(e)), e ? this.permanentlyHiddenNames.add(t) : this.permanentlyHiddenNames.delete(t);
|
|
4432
|
+
}
|
|
4433
|
+
/**
|
|
4434
|
+
* Returns true if the given item name was explicitly hidden via toggleItemHiddenByName.
|
|
4435
|
+
* Used by subclasses to prevent filter logic from un-hiding restricted items.
|
|
4436
|
+
* @param name - item name to check
|
|
4437
|
+
*/
|
|
4438
|
+
isNamePermanentlyHidden(t) {
|
|
4439
|
+
return this.permanentlyHiddenNames.has(t);
|
|
3859
4440
|
}
|
|
3860
4441
|
/**
|
|
3861
4442
|
* Looks for the item by name and imitates click on it
|
|
@@ -3872,13 +4453,13 @@ class Ie extends Bt {
|
|
|
3872
4453
|
buildItems(t) {
|
|
3873
4454
|
return t.map((e) => {
|
|
3874
4455
|
switch (e.type) {
|
|
3875
|
-
case
|
|
3876
|
-
return new
|
|
3877
|
-
case
|
|
3878
|
-
return new
|
|
3879
|
-
case
|
|
4456
|
+
case _.Separator:
|
|
4457
|
+
return new ie(this.itemsRenderParams[_.Separator]);
|
|
4458
|
+
case _.Html:
|
|
4459
|
+
return new ct(e, this.itemsRenderParams[_.Html]);
|
|
4460
|
+
case _.Default:
|
|
3880
4461
|
case void 0:
|
|
3881
|
-
return new
|
|
4462
|
+
return new B(e, this.itemsRenderParams[_.Default]);
|
|
3882
4463
|
}
|
|
3883
4464
|
});
|
|
3884
4465
|
}
|
|
@@ -3887,7 +4468,7 @@ class Ie extends Bt {
|
|
|
3887
4468
|
* @param event - event to retrieve popover item from
|
|
3888
4469
|
*/
|
|
3889
4470
|
getTargetItem(t) {
|
|
3890
|
-
return this.items.filter((e) => e instanceof
|
|
4471
|
+
return this.items.filter((e) => e instanceof B || e instanceof ct).find((e) => {
|
|
3891
4472
|
const o = e.getElement();
|
|
3892
4473
|
return o === null ? !1 : t.composedPath().includes(o);
|
|
3893
4474
|
});
|
|
@@ -3897,12 +4478,12 @@ class Ie extends Bt {
|
|
|
3897
4478
|
* @param item - item to handle click of
|
|
3898
4479
|
*/
|
|
3899
4480
|
handleItemClick(t) {
|
|
3900
|
-
if (!(t instanceof
|
|
4481
|
+
if (!(t instanceof B && t.isDisabled)) {
|
|
3901
4482
|
if (t.hasChildren) {
|
|
3902
4483
|
this.showNestedItems(t), this.callHandleClickIfPresent(t);
|
|
3903
4484
|
return;
|
|
3904
4485
|
}
|
|
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(
|
|
4486
|
+
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
4487
|
}
|
|
3907
4488
|
}
|
|
3908
4489
|
/**
|
|
@@ -3921,7 +4502,7 @@ class Ie extends Bt {
|
|
|
3921
4502
|
* @param clickedItem - popover item that was clicked
|
|
3922
4503
|
*/
|
|
3923
4504
|
toggleItemActivenessIfNeeded(t) {
|
|
3924
|
-
if (!(t instanceof
|
|
4505
|
+
if (!(t instanceof B) || (t.toggle === !0 && t.toggleActive(), typeof t.toggle != "string"))
|
|
3925
4506
|
return;
|
|
3926
4507
|
const e = this.itemsDefault.filter((o) => o.toggle === t.toggle);
|
|
3927
4508
|
if (e.length === 1) {
|
|
@@ -3938,7 +4519,7 @@ class Ie extends Bt {
|
|
|
3938
4519
|
* @param item - popover item to refresh
|
|
3939
4520
|
*/
|
|
3940
4521
|
refreshItemActiveState(t) {
|
|
3941
|
-
t instanceof
|
|
4522
|
+
t instanceof B && t.toggle === void 0 && t.toggleActive(t.isActive);
|
|
3942
4523
|
}
|
|
3943
4524
|
/**
|
|
3944
4525
|
* Executes handleClick if it is present on item.
|
|
@@ -3952,21 +4533,21 @@ class Ie extends Bt {
|
|
|
3952
4533
|
* @param isDisplayed - true if the message should be displayed
|
|
3953
4534
|
*/
|
|
3954
4535
|
toggleNothingFoundMessage(t) {
|
|
3955
|
-
t ? (this.nodes.nothingFoundMessage.classList.remove("hidden"), this.nodes.nothingFoundMessage.setAttribute(
|
|
4536
|
+
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
4537
|
}
|
|
3957
4538
|
/**
|
|
3958
4539
|
* Sets the open-top state for the popover
|
|
3959
4540
|
* @param openTop - true if popover should open above trigger
|
|
3960
4541
|
*/
|
|
3961
4542
|
setOpenTop(t) {
|
|
3962
|
-
t ? this.nodes.popover.setAttribute(
|
|
4543
|
+
t ? this.nodes.popover.setAttribute(p.popoverOpenTop, "true") : this.nodes.popover.removeAttribute(p.popoverOpenTop);
|
|
3963
4544
|
}
|
|
3964
4545
|
/**
|
|
3965
4546
|
* Sets the open-left state for the popover
|
|
3966
4547
|
* @param openLeft - true if popover should open to the left
|
|
3967
4548
|
*/
|
|
3968
4549
|
setOpenLeft(t) {
|
|
3969
|
-
t ? this.nodes.popover.setAttribute(
|
|
4550
|
+
t ? this.nodes.popover.setAttribute(p.popoverOpenLeft, "true") : this.nodes.popover.removeAttribute(p.popoverOpenLeft);
|
|
3970
4551
|
}
|
|
3971
4552
|
/**
|
|
3972
4553
|
* Checks if popover contains the node
|
|
@@ -3980,22 +4561,22 @@ class Ie extends Bt {
|
|
|
3980
4561
|
* @returns PopoverNodes object with all required elements
|
|
3981
4562
|
*/
|
|
3982
4563
|
createPopoverDOM() {
|
|
3983
|
-
var
|
|
4564
|
+
var r, i;
|
|
3984
4565
|
const t = document.createElement("div");
|
|
3985
|
-
this.params.class && (t.className = this.params.class), t.setAttribute(
|
|
4566
|
+
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", "4px"), 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"), t.style.setProperty("--max-height", "400px");
|
|
3986
4567
|
const e = document.createElement("div");
|
|
3987
|
-
e.className =
|
|
4568
|
+
e.className = ot.popoverContainer, e.setAttribute(p.popoverContainer, ""), e.setAttribute("data-blok-testid", "popover-container");
|
|
3988
4569
|
const o = document.createElement("div");
|
|
3989
|
-
o.className =
|
|
3990
|
-
"cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text
|
|
4570
|
+
o.className = A(
|
|
4571
|
+
"cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text px-3 py-3 text-center",
|
|
3991
4572
|
"hidden"
|
|
3992
|
-
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (
|
|
3993
|
-
const
|
|
3994
|
-
return
|
|
4573
|
+
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (i = this.messages.nothingFound) != null ? i : "Nothing found";
|
|
4574
|
+
const n = document.createElement("div");
|
|
4575
|
+
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
4576
|
popover: t,
|
|
3996
4577
|
popoverContainer: e,
|
|
3997
4578
|
nothingFoundMessage: o,
|
|
3998
|
-
items:
|
|
4579
|
+
items: n
|
|
3999
4580
|
};
|
|
4000
4581
|
}
|
|
4001
4582
|
/**
|
|
@@ -4003,13 +4584,13 @@ class Ie extends Bt {
|
|
|
4003
4584
|
*/
|
|
4004
4585
|
appendItemElements() {
|
|
4005
4586
|
this.items.forEach((t) => {
|
|
4006
|
-
var o,
|
|
4007
|
-
const e = (
|
|
4008
|
-
e !== null && ((
|
|
4587
|
+
var o, n, r;
|
|
4588
|
+
const e = (n = (o = t.getMountElement) == null ? void 0 : o.call(t)) != null ? n : t.getElement();
|
|
4589
|
+
e !== null && ((r = this.nodes.items) == null || r.appendChild(e));
|
|
4009
4590
|
});
|
|
4010
4591
|
}
|
|
4011
4592
|
}
|
|
4012
|
-
class
|
|
4593
|
+
class le extends Co {
|
|
4013
4594
|
/**
|
|
4014
4595
|
* Construct the instance
|
|
4015
4596
|
* @param params - popover params
|
|
@@ -4017,39 +4598,39 @@ class Ht extends Ie {
|
|
|
4017
4598
|
* The parameters that are not set by user via popover api but rather depend on technical implementation
|
|
4018
4599
|
*/
|
|
4019
4600
|
constructor(t, e) {
|
|
4020
|
-
var
|
|
4601
|
+
var n;
|
|
4021
4602
|
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(), (
|
|
4603
|
+
var r;
|
|
4604
|
+
super.hide(), this.destroyNestedPopoverIfExists(), (r = this.flipper) == null || r.deactivate(), this.previouslyHoveredItem = null;
|
|
4024
4605
|
}, this.onFlip = () => {
|
|
4025
|
-
const
|
|
4026
|
-
|
|
4027
|
-
}, this.onSearch = (
|
|
4028
|
-
var
|
|
4029
|
-
const
|
|
4030
|
-
this.items.forEach((
|
|
4031
|
-
const
|
|
4032
|
-
|
|
4606
|
+
const r = this.itemsDefault.find((i) => i.isFocused);
|
|
4607
|
+
r == null || r.onFocus();
|
|
4608
|
+
}, this.onSearch = (r) => {
|
|
4609
|
+
var d;
|
|
4610
|
+
const i = r.query === "", a = r.items.length === 0, l = r.items;
|
|
4611
|
+
this.items.forEach((h) => {
|
|
4612
|
+
const u = h instanceof B, g = h instanceof ie || h instanceof ct, f = u ? !l.includes(h) || h.name !== void 0 && this.isNamePermanentlyHidden(h.name) : g && (a || !i);
|
|
4613
|
+
h.toggleHidden(f);
|
|
4033
4614
|
}), 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(
|
|
4615
|
+
const c = i ? this.flippableElements : r.items.map((h) => h.getElement());
|
|
4616
|
+
(d = this.flipper) != null && d.isActivated && (this.flipper.deactivate(), this.flipper.activate(c), c.length > 0 && this.flipper.focusItem(0, { skipNextTab: !0 }));
|
|
4617
|
+
}, 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
4618
|
return;
|
|
4038
4619
|
const o = t.flipper;
|
|
4039
|
-
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new
|
|
4620
|
+
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new at({
|
|
4040
4621
|
items: this.flippableElements,
|
|
4041
|
-
focusedItemClass:
|
|
4622
|
+
focusedItemClass: X.focused,
|
|
4042
4623
|
allowedKeys: [
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4624
|
+
v.TAB,
|
|
4625
|
+
v.UP,
|
|
4626
|
+
v.DOWN,
|
|
4627
|
+
v.ENTER,
|
|
4628
|
+
v.RIGHT,
|
|
4629
|
+
v.LEFT
|
|
4049
4630
|
],
|
|
4050
4631
|
onArrowLeft: t.onNavigateBack,
|
|
4051
4632
|
handleContentEditableTargets: t.handleContentEditableNavigation
|
|
4052
|
-
}), (
|
|
4633
|
+
}), (n = this.flipper) == null || n.onFlip(this.onFlip);
|
|
4053
4634
|
}
|
|
4054
4635
|
/**
|
|
4055
4636
|
* Returns true if some item inside popover is focused
|
|
@@ -4057,6 +4638,15 @@ class Ht extends Ie {
|
|
|
4057
4638
|
hasFocus() {
|
|
4058
4639
|
return this.flipper === void 0 ? !1 : this.flipper.hasFocus();
|
|
4059
4640
|
}
|
|
4641
|
+
/**
|
|
4642
|
+
* Toggles hidden state of all items matching the given name.
|
|
4643
|
+
* Invalidates the cached size so the next access re-measures the popover.
|
|
4644
|
+
* @param name - name of the items to toggle
|
|
4645
|
+
* @param isHidden - true to hide, false to show
|
|
4646
|
+
*/
|
|
4647
|
+
toggleItemHiddenByName(t, e) {
|
|
4648
|
+
super.toggleItemHiddenByName(t, e), this._size = void 0;
|
|
4649
|
+
}
|
|
4060
4650
|
/**
|
|
4061
4651
|
* Scroll position inside items container of the popover
|
|
4062
4652
|
*/
|
|
@@ -4076,10 +4666,10 @@ class Ht extends Ie {
|
|
|
4076
4666
|
var e;
|
|
4077
4667
|
const t = this.getMountElement();
|
|
4078
4668
|
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 = `${
|
|
4669
|
+
const { top: o, left: n } = this.calculatePosition();
|
|
4670
|
+
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
4671
|
}
|
|
4082
|
-
this.nodes.popover.style.setProperty(
|
|
4672
|
+
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
4673
|
this.focusInitialElement();
|
|
4084
4674
|
});
|
|
4085
4675
|
}
|
|
@@ -4111,17 +4701,17 @@ class Ht extends Ie {
|
|
|
4111
4701
|
* Calculates position for the popover
|
|
4112
4702
|
*/
|
|
4113
4703
|
calculatePosition() {
|
|
4114
|
-
var
|
|
4115
|
-
const t = (
|
|
4704
|
+
var u, g;
|
|
4705
|
+
const t = (g = this.params.position) != null ? g : (u = this.trigger) == null ? void 0 : u.getBoundingClientRect();
|
|
4116
4706
|
if (!t)
|
|
4117
4707
|
return {
|
|
4118
4708
|
top: 0,
|
|
4119
4709
|
left: 0
|
|
4120
4710
|
};
|
|
4121
|
-
const e = this.size, o = window.innerWidth,
|
|
4711
|
+
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, h = c + e.width > o + window.scrollX ? Math.max(0, t.right - e.width + window.scrollX) : c;
|
|
4122
4712
|
return {
|
|
4123
|
-
top:
|
|
4124
|
-
left:
|
|
4713
|
+
top: l,
|
|
4714
|
+
left: h
|
|
4125
4715
|
};
|
|
4126
4716
|
}
|
|
4127
4717
|
/**
|
|
@@ -4160,18 +4750,18 @@ class Ht extends Ie {
|
|
|
4160
4750
|
* @param item – item near which nested popover should be displayed
|
|
4161
4751
|
*/
|
|
4162
4752
|
setTriggerItemPosition(t, e) {
|
|
4163
|
-
const o = e.getElement(),
|
|
4164
|
-
(
|
|
4753
|
+
const o = e.getElement(), n = (o ? o.offsetTop : 0) - this.scrollTop, r = this.offsetTop + n, i = t.querySelector(`[${p.popover}]`);
|
|
4754
|
+
(i instanceof HTMLElement ? i : t).style.setProperty(O.TriggerItemTop, r + "px");
|
|
4165
4755
|
}
|
|
4166
4756
|
/**
|
|
4167
4757
|
* Destroys existing nested popover
|
|
4168
4758
|
*/
|
|
4169
4759
|
destroyNestedPopoverIfExists() {
|
|
4170
|
-
var o,
|
|
4760
|
+
var o, n, r;
|
|
4171
4761
|
if (this.nestedPopover === void 0 || this.nestedPopover === null)
|
|
4172
4762
|
return;
|
|
4173
4763
|
const t = (o = this.nestedPopoverTriggerItem) == null ? void 0 : o.getElement(), e = this.nestedPopover.getElement();
|
|
4174
|
-
this.nestedPopover.off(
|
|
4764
|
+
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
4765
|
}
|
|
4176
4766
|
/**
|
|
4177
4767
|
* Focuses the appropriate item after nested popover closes.
|
|
@@ -4197,9 +4787,9 @@ class Ht extends Ie {
|
|
|
4197
4787
|
* @param item - item to display nested popover by
|
|
4198
4788
|
*/
|
|
4199
4789
|
showNestedPopoverForItem(t) {
|
|
4200
|
-
var
|
|
4201
|
-
const e = (
|
|
4202
|
-
this.nestedPopover = new
|
|
4790
|
+
var r, i;
|
|
4791
|
+
const e = (r = this.flipper) == null ? void 0 : r.getHandleContentEditableTargets();
|
|
4792
|
+
this.nestedPopover = new le({
|
|
4203
4793
|
searchable: t.isChildrenSearchable,
|
|
4204
4794
|
items: t.children,
|
|
4205
4795
|
nestingLevel: this.nestingLevel + 1,
|
|
@@ -4208,9 +4798,11 @@ class Ht extends Ie {
|
|
|
4208
4798
|
onNavigateBack: this.destroyNestedPopoverIfExists.bind(this),
|
|
4209
4799
|
width: t.childrenWidth,
|
|
4210
4800
|
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),
|
|
4801
|
+
}), t.onChildrenOpen(), this.nestedPopover.on(Z.ClosedOnActivate, this.hide);
|
|
4802
|
+
const o = this.nestedPopover.getMountElement(), n = this.nestedPopover.getElement();
|
|
4803
|
+
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", () => {
|
|
4804
|
+
this.nestedPopoverTriggerItem !== null && this.refreshItemActiveState(this.nestedPopoverTriggerItem);
|
|
4805
|
+
}), this.nestedPopover.show(), (i = this.flipper) == null || i.deactivate(), this.nestedPopover;
|
|
4214
4806
|
}
|
|
4215
4807
|
/**
|
|
4216
4808
|
* Applies positioning styles to nested popover container.
|
|
@@ -4218,13 +4810,13 @@ class Ht extends Ie {
|
|
|
4218
4810
|
* @param nestedPopoverEl - the nested popover element (mount element)
|
|
4219
4811
|
*/
|
|
4220
4812
|
applyNestedPopoverPositioning(t) {
|
|
4221
|
-
const e = t.querySelector(`[${
|
|
4813
|
+
const e = t.querySelector(`[${p.popoverContainer}]`);
|
|
4222
4814
|
if (!(e instanceof HTMLElement))
|
|
4223
4815
|
return;
|
|
4224
|
-
const o = e,
|
|
4816
|
+
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
4817
|
o.style.position = "absolute";
|
|
4226
|
-
const
|
|
4227
|
-
a ?
|
|
4818
|
+
const l = this.params.width === void 0 || this.params.width === "auto" ? `${this.nodes.popoverContainer.offsetWidth}px` : "var(--width)";
|
|
4819
|
+
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
4820
|
}
|
|
4229
4821
|
/**
|
|
4230
4822
|
* Checks if popover should be opened bottom.
|
|
@@ -4233,8 +4825,8 @@ class Ht extends Ie {
|
|
|
4233
4825
|
get shouldOpenBottom() {
|
|
4234
4826
|
if (this.nodes.popover === void 0 || this.nodes.popover === null)
|
|
4235
4827
|
return !1;
|
|
4236
|
-
const t = this.nodes.popoverContainer.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.height,
|
|
4237
|
-
return
|
|
4828
|
+
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);
|
|
4829
|
+
return r < e.top || n <= i;
|
|
4238
4830
|
}
|
|
4239
4831
|
/**
|
|
4240
4832
|
* Checks if popover should be opened left.
|
|
@@ -4243,15 +4835,15 @@ class Ht extends Ie {
|
|
|
4243
4835
|
get shouldOpenRight() {
|
|
4244
4836
|
if (this.nodes.popover === void 0 || this.nodes.popover === null)
|
|
4245
4837
|
return !1;
|
|
4246
|
-
const t = this.nodes.popover.getBoundingClientRect(), e = this.scopeElement.getBoundingClientRect(), o = this.size.width,
|
|
4247
|
-
return
|
|
4838
|
+
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);
|
|
4839
|
+
return r < e.left || n <= i;
|
|
4248
4840
|
}
|
|
4249
4841
|
/**
|
|
4250
4842
|
* Helps to calculate size of popover that is only resolved when popover is displayed on screen.
|
|
4251
4843
|
* Renders invisible clone of popover to get actual values.
|
|
4252
4844
|
*/
|
|
4253
4845
|
get size() {
|
|
4254
|
-
var
|
|
4846
|
+
var n;
|
|
4255
4847
|
if (this._size)
|
|
4256
4848
|
return this._size;
|
|
4257
4849
|
const t = {
|
|
@@ -4261,8 +4853,8 @@ class Ht extends Ie {
|
|
|
4261
4853
|
if (this.nodes.popover === null)
|
|
4262
4854
|
return t;
|
|
4263
4855
|
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(`[${
|
|
4856
|
+
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);
|
|
4857
|
+
const o = e.querySelector(`[${p.popoverContainer}]`);
|
|
4266
4858
|
return t.height = o.offsetHeight, t.width = o.offsetWidth, e.remove(), this._size = t, t;
|
|
4267
4859
|
}
|
|
4268
4860
|
/**
|
|
@@ -4277,11 +4869,11 @@ class Ht extends Ie {
|
|
|
4277
4869
|
* @returns array of HTML elements for keyboard navigation
|
|
4278
4870
|
*/
|
|
4279
4871
|
getFlippableElementsForItem(t) {
|
|
4280
|
-
if (t instanceof
|
|
4872
|
+
if (t instanceof ct) {
|
|
4281
4873
|
const o = t.getElement();
|
|
4282
4874
|
return o ? [o] : [];
|
|
4283
4875
|
}
|
|
4284
|
-
if (!(t instanceof
|
|
4876
|
+
if (!(t instanceof B))
|
|
4285
4877
|
return [];
|
|
4286
4878
|
if (t.isDisabled)
|
|
4287
4879
|
return [];
|
|
@@ -4292,10 +4884,10 @@ class Ht extends Ie {
|
|
|
4292
4884
|
* Adds search to the popover
|
|
4293
4885
|
*/
|
|
4294
4886
|
addSearch() {
|
|
4295
|
-
this.search = new
|
|
4887
|
+
this.search = new ko({
|
|
4296
4888
|
items: this.itemsDefault,
|
|
4297
4889
|
placeholder: this.messages.search
|
|
4298
|
-
}), this.search.on(
|
|
4890
|
+
}), this.search.on(Nt.Search, this.onSearch);
|
|
4299
4891
|
const t = this.search.getElement();
|
|
4300
4892
|
t.classList.add("mb-1.5"), this.nodes.popoverContainer.insertBefore(t, this.nodes.popoverContainer.firstChild);
|
|
4301
4893
|
}
|
|
@@ -4305,25 +4897,25 @@ class Ht extends Ie {
|
|
|
4305
4897
|
* @param query - search query text
|
|
4306
4898
|
*/
|
|
4307
4899
|
filterItems(t) {
|
|
4308
|
-
const e = this.itemsDefault.filter((o) =>
|
|
4900
|
+
const e = this.itemsDefault.filter((o) => ae(o, t));
|
|
4309
4901
|
this.onSearch({
|
|
4310
4902
|
query: t,
|
|
4311
4903
|
items: e
|
|
4312
4904
|
});
|
|
4313
4905
|
}
|
|
4314
4906
|
}
|
|
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(
|
|
4907
|
+
const zn = function(s) {
|
|
4908
|
+
const t = m.make("div");
|
|
4909
|
+
return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "4px", s.forEach((e) => {
|
|
4910
|
+
const o = m.make("div"), n = e.indexOf(" ");
|
|
4911
|
+
if (n > 0) {
|
|
4912
|
+
const r = e.substring(0, n), i = e.substring(n), a = m.make("span", null, { textContent: r });
|
|
4913
|
+
a.style.color = "white", o.appendChild(a), o.appendChild(document.createTextNode(i));
|
|
4322
4914
|
} else
|
|
4323
4915
|
o.appendChild(document.createTextNode(e));
|
|
4324
4916
|
t.appendChild(o);
|
|
4325
4917
|
}), t;
|
|
4326
|
-
},
|
|
4918
|
+
}, Ot = class Ot {
|
|
4327
4919
|
/**
|
|
4328
4920
|
* @param api - Blok API
|
|
4329
4921
|
*/
|
|
@@ -4337,31 +4929,31 @@ const Ro = function(n) {
|
|
|
4337
4929
|
* Returns tool's UI config
|
|
4338
4930
|
*/
|
|
4339
4931
|
async render() {
|
|
4340
|
-
const t =
|
|
4932
|
+
const t = oe.get();
|
|
4341
4933
|
if (t === null)
|
|
4342
4934
|
return [];
|
|
4343
4935
|
const e = this.blocksAPI.getBlockByElement(t.anchorNode);
|
|
4344
4936
|
if (e === void 0)
|
|
4345
4937
|
return [];
|
|
4346
|
-
const o = this.toolsAPI.getBlockTools(),
|
|
4347
|
-
if (
|
|
4938
|
+
const o = this.toolsAPI.getBlockTools(), n = await te(e, o);
|
|
4939
|
+
if (n.length === 0)
|
|
4348
4940
|
return [];
|
|
4349
|
-
const
|
|
4350
|
-
var
|
|
4351
|
-
return (
|
|
4352
|
-
var
|
|
4353
|
-
|
|
4354
|
-
icon:
|
|
4355
|
-
title:
|
|
4356
|
-
name: (
|
|
4941
|
+
const r = n.reduce((c, d) => {
|
|
4942
|
+
var h;
|
|
4943
|
+
return (h = d.toolbox) == null || h.forEach((u) => {
|
|
4944
|
+
var g;
|
|
4945
|
+
u.title !== void 0 && c.push({
|
|
4946
|
+
icon: u.icon,
|
|
4947
|
+
title: Ft(this.i18nInstance, u, d.name),
|
|
4948
|
+
name: (g = u.name) != null ? g : d.name,
|
|
4357
4949
|
closeOnActivate: !0,
|
|
4358
4950
|
onActivate: async () => {
|
|
4359
|
-
const
|
|
4360
|
-
this.caretAPI.setToBlock(
|
|
4951
|
+
const f = await this.blocksAPI.convert(e.id, d.name, u.data);
|
|
4952
|
+
this.caretAPI.setToBlock(f, "end");
|
|
4361
4953
|
}
|
|
4362
4954
|
});
|
|
4363
|
-
}),
|
|
4364
|
-
}, []),
|
|
4955
|
+
}), c;
|
|
4956
|
+
}, []), i = await e.getActiveToolboxEntry(), a = i ? Ft(this.i18nInstance, i, e.name) : Le(this.i18nInstance, e.name, ye(e.name)), l = !Ce();
|
|
4365
4957
|
return {
|
|
4366
4958
|
name: "convert-to",
|
|
4367
4959
|
title: a,
|
|
@@ -4369,118 +4961,144 @@ const Ro = function(n) {
|
|
|
4369
4961
|
title: this.i18nAPI.t("popover.convertTo")
|
|
4370
4962
|
},
|
|
4371
4963
|
children: {
|
|
4372
|
-
items:
|
|
4964
|
+
items: r,
|
|
4373
4965
|
width: "auto",
|
|
4374
4966
|
onOpen: () => {
|
|
4375
|
-
|
|
4967
|
+
l && (this.selectionAPI.setFakeBackground(), this.selectionAPI.save());
|
|
4376
4968
|
},
|
|
4377
4969
|
onClose: () => {
|
|
4378
|
-
|
|
4970
|
+
l && (this.selectionAPI.restore(), this.selectionAPI.removeFakeBackground());
|
|
4379
4971
|
}
|
|
4380
4972
|
}
|
|
4381
4973
|
};
|
|
4382
4974
|
}
|
|
4383
4975
|
};
|
|
4384
|
-
|
|
4385
|
-
let
|
|
4976
|
+
Ot.isInline = !0;
|
|
4977
|
+
let qt = Ot;
|
|
4386
4978
|
export {
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4979
|
+
ot as $,
|
|
4980
|
+
be as A,
|
|
4981
|
+
Jo as B,
|
|
4982
|
+
Pt as C,
|
|
4983
|
+
p as D,
|
|
4984
|
+
ee as E,
|
|
4985
|
+
at as F,
|
|
4986
|
+
P as G,
|
|
4987
|
+
x as H,
|
|
4988
|
+
Vo as I,
|
|
4989
|
+
Zo as J,
|
|
4990
|
+
st as K,
|
|
4991
|
+
Qt as L,
|
|
4992
|
+
Eo as M,
|
|
4993
|
+
zo as N,
|
|
4994
|
+
z as O,
|
|
4995
|
+
_ as P,
|
|
4996
|
+
$o as Q,
|
|
4997
|
+
cn as R,
|
|
4998
|
+
oe as S,
|
|
4999
|
+
Lo as T,
|
|
5000
|
+
Xo as U,
|
|
4409
5001
|
No as V,
|
|
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
|
-
|
|
5002
|
+
me as W,
|
|
5003
|
+
le as X,
|
|
5004
|
+
Ce as Y,
|
|
5005
|
+
X as Z,
|
|
5006
|
+
Vn as _,
|
|
5007
|
+
m as a,
|
|
5008
|
+
sn as a$,
|
|
5009
|
+
dt as a0,
|
|
5010
|
+
Z as a1,
|
|
5011
|
+
B as a2,
|
|
5012
|
+
ct as a3,
|
|
5013
|
+
O as a4,
|
|
5014
|
+
Un as a5,
|
|
5015
|
+
bn as a6,
|
|
5016
|
+
Co as a7,
|
|
5017
|
+
Go as a8,
|
|
5018
|
+
te as a9,
|
|
5019
|
+
wn as aA,
|
|
5020
|
+
kn as aB,
|
|
5021
|
+
Cn as aC,
|
|
5022
|
+
yn as aD,
|
|
5023
|
+
En as aE,
|
|
5024
|
+
xn as aF,
|
|
5025
|
+
Wn as aG,
|
|
5026
|
+
Gn as aH,
|
|
5027
|
+
_n as aI,
|
|
5028
|
+
Nn as aJ,
|
|
5029
|
+
Ln as aK,
|
|
5030
|
+
On as aL,
|
|
5031
|
+
lo as aM,
|
|
5032
|
+
Wt as aN,
|
|
5033
|
+
fn as aO,
|
|
5034
|
+
Dn as aP,
|
|
5035
|
+
dn as aQ,
|
|
5036
|
+
Yo as aR,
|
|
5037
|
+
Pn as aS,
|
|
5038
|
+
$n as aT,
|
|
5039
|
+
Hn as aU,
|
|
5040
|
+
Fn as aV,
|
|
5041
|
+
Bn as aW,
|
|
5042
|
+
Rn as aX,
|
|
5043
|
+
Po as aY,
|
|
5044
|
+
Mn as aZ,
|
|
5045
|
+
xt as a_,
|
|
5046
|
+
Ft as aa,
|
|
5047
|
+
gn as ab,
|
|
5048
|
+
jn as ac,
|
|
5049
|
+
Bo as ad,
|
|
5050
|
+
Dt as ae,
|
|
5051
|
+
vn as af,
|
|
5052
|
+
we as ag,
|
|
5053
|
+
zn as ah,
|
|
5054
|
+
mn as ai,
|
|
5055
|
+
Le as aj,
|
|
5056
|
+
qo as ak,
|
|
5057
|
+
An as al,
|
|
5058
|
+
it as am,
|
|
5059
|
+
Ao as an,
|
|
5060
|
+
qt as ao,
|
|
5061
|
+
So as ap,
|
|
5062
|
+
Uo as aq,
|
|
5063
|
+
Ko as ar,
|
|
5064
|
+
Mo as as,
|
|
5065
|
+
Ro as at,
|
|
5066
|
+
xo as au,
|
|
5067
|
+
ve as av,
|
|
5068
|
+
To as aw,
|
|
5069
|
+
tn as ax,
|
|
5070
|
+
In as ay,
|
|
5071
|
+
Tn as az,
|
|
5072
|
+
E as b,
|
|
5073
|
+
rn as b0,
|
|
5074
|
+
an as b1,
|
|
5075
|
+
ln as b2,
|
|
5076
|
+
Sn as b3,
|
|
5077
|
+
hn as b4,
|
|
5078
|
+
un as b5,
|
|
5079
|
+
pn as b6,
|
|
5080
|
+
Wo as c,
|
|
5081
|
+
Oe as d,
|
|
5082
|
+
Fo as e,
|
|
5083
|
+
Do as f,
|
|
5084
|
+
Ho as g,
|
|
5085
|
+
jo as h,
|
|
5086
|
+
M as i,
|
|
5087
|
+
ye as j,
|
|
5088
|
+
Io as k,
|
|
5089
|
+
rt as l,
|
|
5090
|
+
yt as m,
|
|
5091
|
+
io as n,
|
|
5092
|
+
ao as o,
|
|
5093
|
+
Tt as p,
|
|
5094
|
+
ne as q,
|
|
5095
|
+
Ne as r,
|
|
5096
|
+
Qo as s,
|
|
5097
|
+
A as t,
|
|
5098
|
+
en as u,
|
|
5099
|
+
v,
|
|
5100
|
+
Oo as w,
|
|
5101
|
+
on as x,
|
|
5102
|
+
nn as y,
|
|
5103
|
+
_o as z
|
|
4486
5104
|
};
|