@jackuait/blok 0.6.0-beta.0 → 0.6.0-beta.10
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/README.md +16 -169
- package/bin/blok.mjs +10 -0
- package/dist/blok.mjs +2 -2
- package/dist/chunks/{blok-Bu9S3SsR.mjs → blok-Buf0btS7.mjs} +2267 -2024
- package/dist/chunks/{i18next-loader-CKuXJ0Av.mjs → i18next-loader-CVf_ZfwA.mjs} +1 -1
- package/dist/chunks/{index-jtZaryNw.mjs → index-C6jsfLLp.mjs} +1 -1
- package/dist/chunks/{inline-tool-convert-CFjyrH30.mjs → inline-tool-convert-BKKEoOqB.mjs} +710 -570
- package/dist/chunks/{messages-C5b7hr_E.mjs → messages-1fC8IMyX.mjs} +16 -2
- package/dist/chunks/{messages-CQj2JU2j.mjs → messages-7QoX8DkW.mjs} +23 -9
- package/dist/{messages-LvFKBBPa.mjs → chunks/messages-7W4d0DwD.mjs} +15 -1
- package/dist/{messages-Bn253WWC.mjs → chunks/messages-9SihnaXQ.mjs} +14 -0
- package/dist/{messages-Bf6Y3_GI.mjs → chunks/messages-B1Aww8q7.mjs} +16 -2
- package/dist/{messages-pA5TvcAj.mjs → chunks/messages-BB5z9Uba.mjs} +14 -0
- package/dist/chunks/{messages-wdqp4610.mjs → messages-BC86qLvI.mjs} +17 -3
- package/dist/chunks/{messages-o24dK6CU.mjs → messages-BELRf6DU.mjs} +16 -2
- package/dist/chunks/{messages-CUZ1x1QD.mjs → messages-BFG6Wlgy.mjs} +16 -2
- package/dist/{messages-B5puUm7R.mjs → chunks/messages-BL0tXcDf.mjs} +15 -1
- package/dist/chunks/{messages-zS1AXZ0y.mjs → messages-BMXCuEKO.mjs} +19 -5
- package/dist/{messages-CyDU5lz9.mjs → chunks/messages-BMv4xwIr.mjs} +16 -2
- package/dist/chunks/{messages-BeUhMpsr.mjs → messages-BSbjsyHY.mjs} +25 -11
- package/dist/chunks/{messages-JGsXAReJ.mjs → messages-BU2nlrLK.mjs} +16 -2
- package/dist/chunks/{messages-srxrv8Yh.mjs → messages-BWF-zUpY.mjs} +17 -3
- package/dist/{messages-CXHd9SUK.mjs → chunks/messages-BYyy6Wqf.mjs} +14 -0
- package/dist/chunks/{messages-DOlC_Tty.mjs → messages-BdeLo0N9.mjs} +24 -10
- package/dist/chunks/{messages-B5jGUnOy.mjs → messages-Bmu_S7GM.mjs} +14 -0
- package/dist/chunks/{messages-BmKCChWZ.mjs → messages-BoJc_p1r.mjs} +14 -0
- package/dist/chunks/{messages-CvaqJFN-.mjs → messages-BogRq8lt.mjs} +15 -1
- package/dist/chunks/{messages-NP1myMGI.mjs → messages-BrPFGbM-.mjs} +14 -0
- package/dist/chunks/{messages-D00OjS2n.mjs → messages-C2htQ_3F.mjs} +24 -10
- package/dist/chunks/{messages-BiExzWJv.mjs → messages-C99mq906.mjs} +15 -1
- package/dist/chunks/{messages-CkFT2gle.mjs → messages-C9eaarcK.mjs} +20 -6
- package/dist/chunks/{messages-BrJHUxQL.mjs → messages-CJdUsQ-c.mjs} +15 -1
- package/dist/chunks/messages-CKI54h6O.mjs +62 -0
- package/dist/{messages-CrsJ1TEJ.mjs → chunks/messages-CLhcMlTc.mjs} +15 -1
- package/dist/{messages-CnvW8Slp.mjs → chunks/messages-CMkNSDTo.mjs} +17 -3
- package/dist/{messages-BlpqL8vG.mjs → chunks/messages-CQwpzUFp.mjs} +19 -5
- package/dist/chunks/{messages-Cu08aLS3.mjs → messages-CVw84KdI.mjs} +21 -7
- package/dist/chunks/{messages-B9Oba7sq.mjs → messages-CY8_RyFE.mjs} +15 -1
- package/dist/chunks/{messages-B5hdXZwA.mjs → messages-CZygwLwM.mjs} +15 -1
- package/dist/chunks/{messages-CVeWVKsV.mjs → messages-CnwibSvh.mjs} +14 -0
- package/dist/chunks/{messages-DbVquYKN.mjs → messages-CqWJcCbY.mjs} +14 -0
- package/dist/{messages-Dg92dXZ5.mjs → chunks/messages-CvGLfqmV.mjs} +14 -0
- package/dist/{messages-AHESHJm_.mjs → chunks/messages-CzTufCHu.mjs} +14 -0
- package/dist/chunks/{messages-Cj-t1bdy.mjs → messages-CznZadDf.mjs} +15 -1
- package/dist/chunks/{messages-DMQIHGRj.mjs → messages-D-ZtY5v0.mjs} +14 -0
- package/dist/chunks/{messages-rRSHQDCX.mjs → messages-D1Hv8XGo.mjs} +14 -0
- package/dist/chunks/{messages-0tDXLuyH.mjs → messages-D5C3J9qr.mjs} +15 -1
- package/dist/chunks/{messages-RvMHb2Ht.mjs → messages-D5iv1Kox.mjs} +16 -2
- package/dist/{messages-zSzDzXej.mjs → chunks/messages-DBRw-7Zc.mjs} +16 -2
- package/dist/chunks/{messages-CeCjVKMW.mjs → messages-DBn76jVV.mjs} +16 -2
- package/dist/chunks/{messages-C7I_AVH2.mjs → messages-DJDG55Vq.mjs} +16 -2
- package/dist/{messages-DDLgIPDF.mjs → chunks/messages-DLfR5bMd.mjs} +16 -2
- package/dist/{messages-CbhuIWRJ.mjs → chunks/messages-DT4dP5uK.mjs} +15 -1
- package/dist/chunks/{messages-B66ZSDCJ.mjs → messages-DhLKYm2j.mjs} +15 -1
- package/dist/{messages-BPqWKx5Z.mjs → chunks/messages-Diu6jAaR.mjs} +17 -3
- package/dist/{messages-BA0rcTCY.mjs → chunks/messages-DnIhyAJk.mjs} +18 -4
- package/dist/chunks/{messages-DV6shA9b.mjs → messages-DnXLrlHh.mjs} +14 -0
- package/dist/chunks/{messages-DcKOuncK.mjs → messages-DprmQg6V.mjs} +16 -2
- package/dist/{messages-CJoBtXU6.mjs → chunks/messages-DqM1LFg5.mjs} +14 -0
- package/dist/chunks/{messages-Cyi2AMmz.mjs → messages-DvFLX36Q.mjs} +25 -11
- package/dist/chunks/{messages-DnbbyJT3.mjs → messages-Dz9L52ol.mjs} +16 -2
- package/dist/chunks/{messages-GC2PhgV3.mjs → messages-Dzwxv9v1.mjs} +23 -9
- package/dist/chunks/{messages-Q4kc_ZtL.mjs → messages-JELdtT6E.mjs} +15 -1
- package/dist/{messages-DY94ykcE.mjs → chunks/messages-LPVfA-8K.mjs} +14 -0
- package/dist/{messages-Cr-RJ7YB.mjs → chunks/messages-O5tQus_0.mjs} +14 -0
- package/dist/chunks/{messages-CbMyJSzS.mjs → messages-Q7AO_FLv.mjs} +17 -3
- package/dist/chunks/{messages-2_xedlYw.mjs → messages-R3hUSvr3.mjs} +15 -1
- package/dist/{messages-CUy1vn-b.mjs → chunks/messages-Xq8UmkVs.mjs} +14 -0
- package/dist/chunks/{messages-BBJgd5jG.mjs → messages-Z9nEU2xK.mjs} +16 -2
- package/dist/chunks/{messages-Cm9aLHeX.mjs → messages-_ErNTNhk.mjs} +15 -1
- package/dist/chunks/{messages-JZUhXTuV.mjs → messages-_ncGrKHh.mjs} +16 -2
- package/dist/chunks/{messages-ftMcCEuO.mjs → messages-kep5wtm4.mjs} +15 -1
- package/dist/chunks/{messages-DteYq0rv.mjs → messages-uKX8WBaD.mjs} +16 -2
- package/dist/chunks/{messages-Bdv-IkfG.mjs → messages-w7v1GNaE.mjs} +15 -1
- package/dist/cli.mjs +50 -0
- package/dist/full.mjs +15 -15
- package/dist/locales.mjs +102 -88
- package/dist/{messages-C5b7hr_E.mjs → messages-1fC8IMyX.mjs} +16 -2
- package/dist/{messages-CQj2JU2j.mjs → messages-7QoX8DkW.mjs} +23 -9
- package/dist/{chunks/messages-LvFKBBPa.mjs → messages-7W4d0DwD.mjs} +15 -1
- package/dist/{chunks/messages-Bn253WWC.mjs → messages-9SihnaXQ.mjs} +14 -0
- package/dist/{chunks/messages-Bf6Y3_GI.mjs → messages-B1Aww8q7.mjs} +16 -2
- package/dist/{chunks/messages-pA5TvcAj.mjs → messages-BB5z9Uba.mjs} +14 -0
- package/dist/{messages-wdqp4610.mjs → messages-BC86qLvI.mjs} +17 -3
- package/dist/{messages-o24dK6CU.mjs → messages-BELRf6DU.mjs} +16 -2
- package/dist/{messages-CUZ1x1QD.mjs → messages-BFG6Wlgy.mjs} +16 -2
- package/dist/{chunks/messages-B5puUm7R.mjs → messages-BL0tXcDf.mjs} +15 -1
- package/dist/{messages-zS1AXZ0y.mjs → messages-BMXCuEKO.mjs} +19 -5
- package/dist/{chunks/messages-CyDU5lz9.mjs → messages-BMv4xwIr.mjs} +16 -2
- package/dist/{messages-BeUhMpsr.mjs → messages-BSbjsyHY.mjs} +25 -11
- package/dist/{messages-JGsXAReJ.mjs → messages-BU2nlrLK.mjs} +16 -2
- package/dist/{messages-srxrv8Yh.mjs → messages-BWF-zUpY.mjs} +17 -3
- package/dist/{chunks/messages-CXHd9SUK.mjs → messages-BYyy6Wqf.mjs} +14 -0
- package/dist/{messages-DOlC_Tty.mjs → messages-BdeLo0N9.mjs} +24 -10
- package/dist/{messages-B5jGUnOy.mjs → messages-Bmu_S7GM.mjs} +14 -0
- package/dist/{messages-BmKCChWZ.mjs → messages-BoJc_p1r.mjs} +14 -0
- package/dist/{messages-CvaqJFN-.mjs → messages-BogRq8lt.mjs} +15 -1
- package/dist/{messages-NP1myMGI.mjs → messages-BrPFGbM-.mjs} +14 -0
- package/dist/{messages-D00OjS2n.mjs → messages-C2htQ_3F.mjs} +24 -10
- package/dist/{messages-BiExzWJv.mjs → messages-C99mq906.mjs} +15 -1
- package/dist/{messages-CkFT2gle.mjs → messages-C9eaarcK.mjs} +20 -6
- package/dist/{messages-BrJHUxQL.mjs → messages-CJdUsQ-c.mjs} +15 -1
- package/dist/messages-CKI54h6O.mjs +62 -0
- package/dist/{chunks/messages-CrsJ1TEJ.mjs → messages-CLhcMlTc.mjs} +15 -1
- package/dist/{chunks/messages-CnvW8Slp.mjs → messages-CMkNSDTo.mjs} +17 -3
- package/dist/{chunks/messages-BlpqL8vG.mjs → messages-CQwpzUFp.mjs} +19 -5
- package/dist/{messages-Cu08aLS3.mjs → messages-CVw84KdI.mjs} +21 -7
- package/dist/{messages-B9Oba7sq.mjs → messages-CY8_RyFE.mjs} +15 -1
- package/dist/{messages-B5hdXZwA.mjs → messages-CZygwLwM.mjs} +15 -1
- package/dist/{messages-CVeWVKsV.mjs → messages-CnwibSvh.mjs} +14 -0
- package/dist/{messages-DbVquYKN.mjs → messages-CqWJcCbY.mjs} +14 -0
- package/dist/{chunks/messages-Dg92dXZ5.mjs → messages-CvGLfqmV.mjs} +14 -0
- package/dist/{chunks/messages-AHESHJm_.mjs → messages-CzTufCHu.mjs} +14 -0
- package/dist/{messages-Cj-t1bdy.mjs → messages-CznZadDf.mjs} +15 -1
- package/dist/{messages-DMQIHGRj.mjs → messages-D-ZtY5v0.mjs} +14 -0
- package/dist/{messages-rRSHQDCX.mjs → messages-D1Hv8XGo.mjs} +14 -0
- package/dist/{messages-0tDXLuyH.mjs → messages-D5C3J9qr.mjs} +15 -1
- package/dist/{messages-RvMHb2Ht.mjs → messages-D5iv1Kox.mjs} +16 -2
- package/dist/{chunks/messages-zSzDzXej.mjs → messages-DBRw-7Zc.mjs} +16 -2
- package/dist/{messages-CeCjVKMW.mjs → messages-DBn76jVV.mjs} +16 -2
- package/dist/{messages-C7I_AVH2.mjs → messages-DJDG55Vq.mjs} +16 -2
- package/dist/{chunks/messages-DDLgIPDF.mjs → messages-DLfR5bMd.mjs} +16 -2
- package/dist/{chunks/messages-CbhuIWRJ.mjs → messages-DT4dP5uK.mjs} +15 -1
- package/dist/{messages-B66ZSDCJ.mjs → messages-DhLKYm2j.mjs} +15 -1
- package/dist/{chunks/messages-BPqWKx5Z.mjs → messages-Diu6jAaR.mjs} +17 -3
- package/dist/{chunks/messages-BA0rcTCY.mjs → messages-DnIhyAJk.mjs} +18 -4
- package/dist/{messages-DV6shA9b.mjs → messages-DnXLrlHh.mjs} +14 -0
- package/dist/{messages-DcKOuncK.mjs → messages-DprmQg6V.mjs} +16 -2
- package/dist/{chunks/messages-CJoBtXU6.mjs → messages-DqM1LFg5.mjs} +14 -0
- package/dist/{messages-Cyi2AMmz.mjs → messages-DvFLX36Q.mjs} +25 -11
- package/dist/{messages-DnbbyJT3.mjs → messages-Dz9L52ol.mjs} +16 -2
- package/dist/{messages-GC2PhgV3.mjs → messages-Dzwxv9v1.mjs} +23 -9
- package/dist/{messages-Q4kc_ZtL.mjs → messages-JELdtT6E.mjs} +15 -1
- package/dist/{chunks/messages-DY94ykcE.mjs → messages-LPVfA-8K.mjs} +14 -0
- package/dist/{chunks/messages-Cr-RJ7YB.mjs → messages-O5tQus_0.mjs} +14 -0
- package/dist/{messages-CbMyJSzS.mjs → messages-Q7AO_FLv.mjs} +17 -3
- package/dist/{messages-2_xedlYw.mjs → messages-R3hUSvr3.mjs} +15 -1
- package/dist/{chunks/messages-CUy1vn-b.mjs → messages-Xq8UmkVs.mjs} +14 -0
- package/dist/{messages-BBJgd5jG.mjs → messages-Z9nEU2xK.mjs} +16 -2
- package/dist/{messages-Cm9aLHeX.mjs → messages-_ErNTNhk.mjs} +15 -1
- package/dist/{messages-JZUhXTuV.mjs → messages-_ncGrKHh.mjs} +16 -2
- package/dist/{messages-ftMcCEuO.mjs → messages-kep5wtm4.mjs} +15 -1
- package/dist/{messages-DteYq0rv.mjs → messages-uKX8WBaD.mjs} +16 -2
- package/dist/{messages-Bdv-IkfG.mjs → messages-w7v1GNaE.mjs} +15 -1
- package/dist/tools.mjs +2005 -1267
- package/dist/vendor.LICENSE.txt +1 -1
- package/package.json +15 -14
- package/src/cli/commands/migration.ts +16 -0
- package/src/cli/commands/migrationContent.ts +6 -0
- package/src/cli/index.ts +47 -0
- package/src/cli/utils/output.ts +10 -0
- package/src/components/block-tunes/block-tune-delete.ts +3 -2
- package/src/components/blocks.ts +23 -6
- package/src/components/constants/data-attributes.ts +2 -0
- package/src/components/i18n/locales/am/messages.json +15 -1
- package/src/components/i18n/locales/ar/messages.json +14 -0
- package/src/components/i18n/locales/az/messages.json +14 -0
- package/src/components/i18n/locales/bg/messages.json +14 -0
- package/src/components/i18n/locales/bn/messages.json +25 -11
- package/src/components/i18n/locales/bs/messages.json +15 -1
- package/src/components/i18n/locales/cs/messages.json +14 -0
- package/src/components/i18n/locales/da/messages.json +14 -0
- package/src/components/i18n/locales/de/messages.json +14 -0
- package/src/components/i18n/locales/dv/messages.json +15 -1
- package/src/components/i18n/locales/el/messages.json +15 -1
- package/src/components/i18n/locales/en/messages.json +14 -0
- package/src/components/i18n/locales/es/messages.json +14 -0
- package/src/components/i18n/locales/et/messages.json +14 -0
- package/src/components/i18n/locales/fa/messages.json +15 -1
- package/src/components/i18n/locales/fi/messages.json +15 -1
- package/src/components/i18n/locales/fil/messages.json +20 -6
- package/src/components/i18n/locales/fr/messages.json +15 -1
- package/src/components/i18n/locales/gu/messages.json +15 -1
- package/src/components/i18n/locales/he/messages.json +14 -0
- package/src/components/i18n/locales/hi/messages.json +23 -9
- package/src/components/i18n/locales/hr/messages.json +14 -0
- package/src/components/i18n/locales/hu/messages.json +14 -0
- package/src/components/i18n/locales/hy/messages.json +16 -2
- package/src/components/i18n/locales/id/messages.json +19 -5
- package/src/components/i18n/locales/it/messages.json +14 -0
- package/src/components/i18n/locales/ja/messages.json +14 -0
- package/src/components/i18n/locales/ka/messages.json +15 -1
- package/src/components/i18n/locales/km/messages.json +16 -2
- package/src/components/i18n/locales/kn/messages.json +16 -2
- package/src/components/i18n/locales/ko/messages.json +14 -0
- package/src/components/i18n/locales/ku/messages.json +16 -2
- package/src/components/i18n/locales/lo/messages.json +15 -1
- package/src/components/i18n/locales/lt/messages.json +15 -1
- package/src/components/i18n/locales/lv/messages.json +15 -1
- package/src/components/i18n/locales/mk/messages.json +16 -2
- package/src/components/i18n/locales/ml/messages.json +16 -2
- package/src/components/i18n/locales/mn/messages.json +16 -2
- package/src/components/i18n/locales/mr/messages.json +24 -10
- package/src/components/i18n/locales/ms/messages.json +17 -3
- package/src/components/i18n/locales/my/messages.json +16 -2
- package/src/components/i18n/locales/ne/messages.json +24 -10
- package/src/components/i18n/locales/nl/messages.json +15 -1
- package/src/components/i18n/locales/no/messages.json +16 -2
- package/src/components/i18n/locales/pa/messages.json +15 -1
- package/src/components/i18n/locales/pl/messages.json +14 -0
- package/src/components/i18n/locales/ps/messages.json +17 -3
- package/src/components/i18n/locales/pt/messages.json +14 -0
- package/src/components/i18n/locales/ro/messages.json +15 -1
- package/src/components/i18n/locales/ru/messages.json +14 -0
- package/src/components/i18n/locales/sd/messages.json +16 -2
- package/src/components/i18n/locales/si/messages.json +23 -9
- package/src/components/i18n/locales/sk/messages.json +15 -1
- package/src/components/i18n/locales/sl/messages.json +16 -2
- package/src/components/i18n/locales/sq/messages.json +16 -2
- package/src/components/i18n/locales/sr/messages.json +16 -2
- package/src/components/i18n/locales/sv/messages.json +16 -2
- package/src/components/i18n/locales/sw/messages.json +16 -2
- package/src/components/i18n/locales/ta/messages.json +21 -7
- package/src/components/i18n/locales/te/messages.json +40 -26
- package/src/components/i18n/locales/th/messages.json +19 -5
- package/src/components/i18n/locales/tr/messages.json +15 -1
- package/src/components/i18n/locales/ug/messages.json +16 -2
- package/src/components/i18n/locales/uk/messages.json +15 -1
- package/src/components/i18n/locales/ur/messages.json +15 -1
- package/src/components/i18n/locales/vi/messages.json +25 -11
- package/src/components/i18n/locales/yi/messages.json +16 -2
- package/src/components/i18n/locales/zh/messages.json +15 -1
- package/src/components/icons/index.ts +104 -83
- package/src/components/modules/api/blocks.ts +35 -2
- package/src/components/modules/api/history.ts +64 -0
- package/src/components/modules/api/index.ts +2 -0
- package/src/components/modules/api/readonly.ts +11 -1
- package/src/components/modules/blockEvents/composers/markdownShortcuts.ts +12 -1
- package/src/components/modules/blockManager/blockManager.ts +7 -0
- package/src/components/modules/blockManager/operations.ts +3 -2
- package/src/components/modules/blockManager/types.ts +3 -1
- package/src/components/modules/blockManager/yjs-sync.ts +12 -2
- package/src/components/modules/index.ts +3 -0
- package/src/components/modules/normalizeInlineImages.ts +263 -0
- package/src/components/modules/readonly.ts +11 -0
- package/src/components/modules/rectangleSelection.ts +19 -3
- package/src/components/modules/saver.ts +7 -3
- package/src/components/modules/toolbar/blockSettings.ts +3 -3
- package/src/components/modules/toolbar/index.ts +72 -14
- package/src/components/modules/toolbar/plus-button.ts +24 -3
- package/src/components/modules/toolbar/settings-toggler.ts +3 -5
- package/src/components/modules/ui.ts +46 -68
- package/src/components/modules/uiControllers/controllers/blockHover.ts +49 -61
- package/src/components/modules/uiControllers/controllers/keyboard.ts +17 -11
- package/src/components/modules/uiControllers/handlers/click.ts +0 -12
- package/src/components/modules/yjs/index.ts +23 -0
- package/src/components/ui/toolbox.ts +41 -6
- package/src/components/utils/placeholder.ts +16 -0
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +2 -1
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +6 -1
- package/src/components/utils/popover/index.ts +1 -0
- package/src/components/utils/popover/popover-abstract.ts +11 -1
- package/src/components/utils/popover/popover-desktop.ts +27 -8
- package/src/components/utils/popover/popover-registry.ts +188 -0
- package/src/components/utils/sanitizer.ts +23 -2
- package/src/components/utils/tooltip.ts +2 -24
- package/src/styles/main.css +22 -0
- package/src/tools/paragraph/index.ts +12 -4
- package/src/tools/table/data-normalizer.ts +1 -0
- package/src/tools/table/index.ts +283 -346
- package/src/tools/table/table-add-controls.ts +353 -47
- package/src/tools/table/table-cell-blocks.ts +95 -7
- package/src/tools/table/table-cell-selection.ts +648 -0
- package/src/tools/table/table-core.ts +21 -32
- package/src/tools/table/table-grip-visuals.ts +96 -0
- package/src/tools/table/table-heading-toggle.ts +127 -0
- package/src/tools/table/table-operations.ts +475 -0
- package/src/tools/table/table-resize.ts +27 -6
- package/src/tools/table/table-restrictions.ts +64 -0
- package/src/tools/table/table-row-col-action-handler.ts +190 -0
- package/src/tools/table/table-row-col-controls.ts +265 -211
- package/src/tools/table/table-row-col-drag.ts +4 -4
- package/src/tools/table/table-row-col-popover.ts +225 -0
- package/src/tools/table/types.ts +4 -0
- package/src/types-internal/blok-modules.d.ts +2 -0
- package/types/api/blocks.d.ts +8 -0
- package/types/api/history.d.ts +33 -0
- package/types/api/index.d.ts +1 -0
- package/types/api/readonly.d.ts +12 -2
- package/types/index.d.ts +10 -0
- package/types/tools/table.d.ts +67 -0
- package/types/tools-entry.d.ts +4 -0
- package/types/utils/popover/popover-item.d.ts +6 -0
- package/types/utils/popover/popover.d.ts +7 -0
- package/dist/chunks/messages-CySyfkMU.mjs +0 -48
- package/dist/messages-CySyfkMU.mjs +0 -48
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Pt = Object.defineProperty, $t = Object.defineProperties;
|
|
2
|
+
var Dt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var wt = Object.getOwnPropertySymbols;
|
|
4
|
+
var jt = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var kt = (n, t, e) => t in n ? Pt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, E = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
jt.call(t, e) && kt(n, e, t[e]);
|
|
8
|
+
if (wt)
|
|
9
|
+
for (var e of wt(t))
|
|
10
|
+
Gt.call(t, e) && kt(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
12
|
+
}, M = (n, t) => $t(n, Dt(t));
|
|
13
13
|
const d = {
|
|
14
14
|
// ============================================
|
|
15
15
|
// Core Element Identifiers
|
|
@@ -143,6 +143,8 @@ const d = {
|
|
|
143
143
|
popoverItemNoFocus: "data-blok-popover-item-no-focus",
|
|
144
144
|
/** Wobble animation */
|
|
145
145
|
popoverItemWobble: "data-blok-popover-item-wobble",
|
|
146
|
+
/** Destructive action item (e.g. delete) */
|
|
147
|
+
popoverItemDestructive: "data-blok-popover-item-destructive",
|
|
146
148
|
/** Separator item */
|
|
147
149
|
popoverItemSeparator: "data-blok-popover-item-separator",
|
|
148
150
|
/** Separator line element */
|
|
@@ -265,7 +267,7 @@ const d = {
|
|
|
265
267
|
testid: "data-blok-testid",
|
|
266
268
|
/** Force hover state (for tests/storybook) */
|
|
267
269
|
forceHover: "data-blok-force-hover"
|
|
268
|
-
},
|
|
270
|
+
}, z = (n, t) => t === void 0 ? `[${n}]` : `[${n}="${t}"]`, g = {
|
|
269
271
|
BACKSPACE: 8,
|
|
270
272
|
TAB: 9,
|
|
271
273
|
ENTER: 13,
|
|
@@ -274,16 +276,16 @@ const d = {
|
|
|
274
276
|
DOWN: 40,
|
|
275
277
|
RIGHT: 39,
|
|
276
278
|
DELETE: 46
|
|
277
|
-
},
|
|
279
|
+
}, Ae = {
|
|
278
280
|
LEFT: 0
|
|
279
|
-
},
|
|
280
|
-
var
|
|
281
|
-
const
|
|
281
|
+
}, Se = 650, Wt = () => "0.6.0-beta.10";
|
|
282
|
+
var Vt = /* @__PURE__ */ ((n) => (n.VERBOSE = "VERBOSE", n.INFO = "INFO", n.WARN = "WARN", n.ERROR = "ERROR", n))(Vt || {});
|
|
283
|
+
const V = (n, t, e = "log", o, s = "color: inherit") => {
|
|
282
284
|
const i = typeof console == "undefined" ? void 0 : console;
|
|
283
285
|
if (!i || typeof i[e] != "function")
|
|
284
286
|
return;
|
|
285
287
|
const r = ["info", "log", "warn", "error"].includes(e), a = [];
|
|
286
|
-
switch (
|
|
288
|
+
switch (V.logLevel) {
|
|
287
289
|
case "VERBOSE":
|
|
288
290
|
break;
|
|
289
291
|
case "ERROR":
|
|
@@ -300,7 +302,7 @@ const j = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
300
302
|
break;
|
|
301
303
|
}
|
|
302
304
|
o && a.push(o);
|
|
303
|
-
const c = `Blok ${
|
|
305
|
+
const c = `Blok ${Wt()}`, l = `line-height: 1em;
|
|
304
306
|
color: #006FEA;
|
|
305
307
|
display: inline-block;
|
|
306
308
|
font-size: 11px;
|
|
@@ -309,29 +311,29 @@ const j = (n, t, e = "log", o, s = "color: inherit") => {
|
|
|
309
311
|
padding: 4px 9px;
|
|
310
312
|
border-radius: 30px;
|
|
311
313
|
border: 1px solid rgba(56, 138, 229, 0.16);
|
|
312
|
-
margin: 4px 5px 4px 0;`, h = n ? r ? (a.unshift(l, s), `%c${c}%c ${t}`) : `( ${c} )${t}` : t,
|
|
314
|
+
margin: 4px 5px 4px 0;`, h = n ? r ? (a.unshift(l, s), `%c${c}%c ${t}`) : `( ${c} )${t}` : t, u = r ? o !== void 0 ? [`${h} %o`, ...a] : [h, ...a] : [h];
|
|
313
315
|
try {
|
|
314
|
-
i[e](...
|
|
315
|
-
} catch (
|
|
316
|
+
i[e](...u);
|
|
317
|
+
} catch (p) {
|
|
316
318
|
}
|
|
317
319
|
};
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
},
|
|
320
|
+
V.logLevel = "VERBOSE";
|
|
321
|
+
const Le = (n) => {
|
|
322
|
+
V.logLevel = n;
|
|
323
|
+
}, q = (n, t = "log", e, o) => {
|
|
324
|
+
V(!1, n, t, e, o);
|
|
325
|
+
}, Ne = (n, t = "log", e, o) => {
|
|
326
|
+
V(!0, n, t, e, o);
|
|
327
|
+
}, J = (n) => typeof n == "function", X = (n) => {
|
|
326
328
|
if (n === null || typeof n != "object")
|
|
327
329
|
return !1;
|
|
328
330
|
const t = Object.getPrototypeOf(n);
|
|
329
331
|
return t === null || t === Object.prototype;
|
|
330
|
-
},
|
|
332
|
+
}, j = (n) => typeof n == "string", Re = (n) => typeof n == "boolean", Ct = (n) => typeof n == "number", Be = function(n) {
|
|
331
333
|
return n === void 0;
|
|
332
|
-
},
|
|
334
|
+
}, ht = (n) => n == null ? !0 : typeof n == "string" || Array.isArray(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : typeof n == "object" ? Object.keys(n).length === 0 : !1, _t = (n, t) => function(...e) {
|
|
333
335
|
setTimeout(() => n.apply(this, e), t);
|
|
334
|
-
},
|
|
336
|
+
}, Oe = (n, t, e) => {
|
|
335
337
|
const o = {
|
|
336
338
|
timeoutId: null
|
|
337
339
|
};
|
|
@@ -341,7 +343,7 @@ const xe = (n) => {
|
|
|
341
343
|
};
|
|
342
344
|
o.timeoutId !== null && clearTimeout(o.timeoutId), o.timeoutId = setTimeout(i, t);
|
|
343
345
|
};
|
|
344
|
-
},
|
|
346
|
+
}, Me = (n, t, e) => {
|
|
345
347
|
const o = {
|
|
346
348
|
lastCallTime: void 0,
|
|
347
349
|
lastInvokeTime: 0,
|
|
@@ -350,16 +352,16 @@ const xe = (n) => {
|
|
|
350
352
|
lastThis: void 0
|
|
351
353
|
}, s = (l) => {
|
|
352
354
|
o.lastInvokeTime = l;
|
|
353
|
-
const h = o.lastArgs,
|
|
354
|
-
return o.lastArgs = void 0, o.lastThis = void 0, n.apply(
|
|
355
|
+
const h = o.lastArgs, u = o.lastThis;
|
|
356
|
+
return o.lastArgs = void 0, o.lastThis = void 0, n.apply(u, h != null ? h : []);
|
|
355
357
|
}, i = (l) => {
|
|
356
|
-
var
|
|
357
|
-
const h = l - ((
|
|
358
|
-
return Math.min(
|
|
358
|
+
var v;
|
|
359
|
+
const h = l - ((v = o.lastCallTime) != null ? v : 0), u = l - o.lastInvokeTime, p = t - h;
|
|
360
|
+
return Math.min(p, t - u);
|
|
359
361
|
}, r = (l) => {
|
|
360
|
-
var
|
|
361
|
-
const h = l - ((
|
|
362
|
-
return o.lastCallTime === void 0 || h >= t || h < 0 ||
|
|
362
|
+
var p;
|
|
363
|
+
const h = l - ((p = o.lastCallTime) != null ? p : 0), u = l - o.lastInvokeTime;
|
|
364
|
+
return o.lastCallTime === void 0 || h >= t || h < 0 || u >= t;
|
|
363
365
|
}, a = () => {
|
|
364
366
|
const l = Date.now();
|
|
365
367
|
if (!r(l)) {
|
|
@@ -369,8 +371,8 @@ const xe = (n) => {
|
|
|
369
371
|
o.timerId = void 0, o.lastArgs !== void 0 && s(l), o.lastArgs = void 0, o.lastThis = void 0;
|
|
370
372
|
};
|
|
371
373
|
return function(...l) {
|
|
372
|
-
const h = Date.now(),
|
|
373
|
-
if (o.lastArgs = l, o.lastThis = this, o.lastCallTime = h, !!(
|
|
374
|
+
const h = Date.now(), u = r(h);
|
|
375
|
+
if (o.lastArgs = l, o.lastThis = this, o.lastCallTime = h, !!(u && o.timerId === void 0))
|
|
374
376
|
return o.lastInvokeTime = h, o.timerId = setTimeout(a, t), s(h);
|
|
375
377
|
};
|
|
376
378
|
}, w = (() => {
|
|
@@ -381,29 +383,29 @@ const xe = (n) => {
|
|
|
381
383
|
}
|
|
382
384
|
})();
|
|
383
385
|
w && typeof w.window == "undefined" && (w.window = w);
|
|
384
|
-
const
|
|
386
|
+
const tt = () => {
|
|
385
387
|
if (w != null && w.window)
|
|
386
388
|
return w.window;
|
|
387
|
-
},
|
|
389
|
+
}, St = () => {
|
|
388
390
|
if (w != null && w.navigator)
|
|
389
391
|
return w.navigator;
|
|
390
|
-
const n =
|
|
392
|
+
const n = tt();
|
|
391
393
|
return n == null ? void 0 : n.navigator;
|
|
392
|
-
},
|
|
394
|
+
}, Fe = (n) => /^[-\w]+\/([-+\w]+|\*)$/.test(n), Ut = () => {
|
|
393
395
|
var s, i;
|
|
394
396
|
const n = {
|
|
395
397
|
win: !1,
|
|
396
398
|
mac: !1,
|
|
397
399
|
x11: !1,
|
|
398
400
|
linux: !1
|
|
399
|
-
}, t =
|
|
401
|
+
}, t = St(), e = (i = (s = t == null ? void 0 : t.userAgent) == null ? void 0 : s.toLowerCase()) != null ? i : "", o = e ? Object.keys(n).find((r) => e.indexOf(r) !== -1) : void 0;
|
|
400
402
|
return o !== void 0 && (n[o] = !0), n;
|
|
401
|
-
},
|
|
402
|
-
const n =
|
|
403
|
-
return !n || typeof n.matchMedia != "function" ? !1 : n.matchMedia(`(max-width: ${
|
|
404
|
-
},
|
|
403
|
+
}, Kt = 650, zt = () => {
|
|
404
|
+
const n = tt();
|
|
405
|
+
return !n || typeof n.matchMedia != "function" ? !1 : n.matchMedia(`(max-width: ${Kt}px)`).matches;
|
|
406
|
+
}, He = (() => {
|
|
405
407
|
var c;
|
|
406
|
-
const n =
|
|
408
|
+
const n = St();
|
|
407
409
|
if (!n)
|
|
408
410
|
return !1;
|
|
409
411
|
const t = n.userAgent || "", e = n.userAgentData, o = e == null ? void 0 : e.platform;
|
|
@@ -414,27 +416,27 @@ const Q = () => {
|
|
|
414
416
|
n.platform
|
|
415
417
|
), r = o !== void 0 && o !== "" ? o : void 0;
|
|
416
418
|
return (s ? r != null ? r : i() : void 0) === "MacIntel";
|
|
417
|
-
})(),
|
|
419
|
+
})(), Pe = (n) => {
|
|
418
420
|
try {
|
|
419
421
|
return new URL(n).href;
|
|
420
422
|
} catch (e) {
|
|
421
423
|
}
|
|
422
|
-
const t =
|
|
424
|
+
const t = tt();
|
|
423
425
|
return n.substring(0, 2) === "//" ? t ? `${t.location.protocol}${n}` : n : t ? `${t.location.origin}${n}` : n;
|
|
424
|
-
},
|
|
425
|
-
const t =
|
|
426
|
+
}, $e = (n) => {
|
|
427
|
+
const t = tt();
|
|
426
428
|
t && t.open(n, "_blank");
|
|
427
|
-
},
|
|
428
|
-
const t =
|
|
429
|
+
}, qt = (n) => n && n.slice(0, 1).toUpperCase() + n.slice(1), De = (n) => {
|
|
430
|
+
const t = Ut(), e = n.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, " + ");
|
|
429
431
|
return t.mac ? e.replace(/ctrl|cmd/gi, "⌘").replace(/alt/gi, "⌥") : e.replace(/cmd/gi, "Ctrl").replace(/windows/gi, "WIN");
|
|
430
|
-
},
|
|
431
|
-
const e =
|
|
432
|
+
}, Lt = (n, t) => {
|
|
433
|
+
const e = E({}, n);
|
|
432
434
|
return Object.keys(t).forEach((o) => {
|
|
433
435
|
const s = e[o], i = t[o];
|
|
434
436
|
if (i === void 0)
|
|
435
437
|
return;
|
|
436
|
-
if (
|
|
437
|
-
e[o] =
|
|
438
|
+
if (X(i) && X(s) && !Array.isArray(i)) {
|
|
439
|
+
e[o] = Lt(
|
|
438
440
|
s,
|
|
439
441
|
i
|
|
440
442
|
);
|
|
@@ -442,30 +444,30 @@ const Q = () => {
|
|
|
442
444
|
}
|
|
443
445
|
e[o] = i;
|
|
444
446
|
}), e;
|
|
445
|
-
},
|
|
446
|
-
if (!
|
|
447
|
+
}, je = (n, ...t) => {
|
|
448
|
+
if (!X(n) || t.length === 0)
|
|
447
449
|
return n;
|
|
448
|
-
const e = t.reduce((o, s) =>
|
|
450
|
+
const e = t.reduce((o, s) => X(s) ? Lt(o, s) : o, n);
|
|
449
451
|
return Object.assign(n, e), n;
|
|
450
|
-
},
|
|
452
|
+
}, Xt = (n, t) => n.length !== t.length ? !1 : n.every((e, o) => pt(e, t[o])), pt = (n, t) => {
|
|
451
453
|
if (n === t)
|
|
452
454
|
return !0;
|
|
453
455
|
if (n === null || t === null || typeof n != "object" || typeof t != "object" || Array.isArray(n) !== Array.isArray(t))
|
|
454
456
|
return !1;
|
|
455
457
|
if (Array.isArray(n) && Array.isArray(t))
|
|
456
|
-
return
|
|
458
|
+
return Xt(n, t);
|
|
457
459
|
const e = Object.keys(n), o = Object.keys(t);
|
|
458
460
|
return e.length !== o.length ? !1 : e.every(
|
|
459
|
-
(s) => Object.prototype.hasOwnProperty.call(t, s) &&
|
|
461
|
+
(s) => Object.prototype.hasOwnProperty.call(t, s) && pt(n[s], t[s])
|
|
460
462
|
);
|
|
461
|
-
},
|
|
463
|
+
}, Yt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
462
464
|
let Zt = (n = 21) => {
|
|
463
465
|
let t = "", e = crypto.getRandomValues(new Uint8Array(n |= 0));
|
|
464
466
|
for (; n--; )
|
|
465
|
-
t +=
|
|
467
|
+
t += Yt[e[n] & 63];
|
|
466
468
|
return t;
|
|
467
469
|
};
|
|
468
|
-
const
|
|
470
|
+
const Qt = 1e8, Jt = 16, Ge = () => Zt(10), te = (n = "") => `${n}${Math.floor(Math.random() * Qt).toString(Jt)}`;
|
|
469
471
|
class f {
|
|
470
472
|
/**
|
|
471
473
|
* Check if passed tag has no closed tag
|
|
@@ -663,7 +665,7 @@ class f {
|
|
|
663
665
|
* @returns {boolean}
|
|
664
666
|
*/
|
|
665
667
|
static isElement(t) {
|
|
666
|
-
return
|
|
668
|
+
return Ct(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.ELEMENT_NODE;
|
|
667
669
|
}
|
|
668
670
|
/**
|
|
669
671
|
* Check if object is DocumentFragment node
|
|
@@ -671,7 +673,7 @@ class f {
|
|
|
671
673
|
* @returns {boolean}
|
|
672
674
|
*/
|
|
673
675
|
static isFragment(t) {
|
|
674
|
-
return
|
|
676
|
+
return Ct(t) ? !1 : t != null && typeof t == "object" && "nodeType" in t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
675
677
|
}
|
|
676
678
|
/**
|
|
677
679
|
* Check if passed element is contenteditable
|
|
@@ -824,7 +826,7 @@ class f {
|
|
|
824
826
|
* @returns {boolean}
|
|
825
827
|
*/
|
|
826
828
|
static containsOnlyInlineElements(t) {
|
|
827
|
-
const e =
|
|
829
|
+
const e = j(t) ? (() => {
|
|
828
830
|
const s = document.createElement("div");
|
|
829
831
|
return s.innerHTML = t, s;
|
|
830
832
|
})() : t, o = (s) => !f.blockElements.includes(s.tagName.toLowerCase()) && Array.from(s.children).every(o);
|
|
@@ -844,7 +846,7 @@ class f {
|
|
|
844
846
|
* @returns {HTMLElement}
|
|
845
847
|
*/
|
|
846
848
|
static getHolder(t) {
|
|
847
|
-
if (!
|
|
849
|
+
if (!j(t))
|
|
848
850
|
return t;
|
|
849
851
|
const e = document.getElementById(t);
|
|
850
852
|
if (e !== null)
|
|
@@ -884,12 +886,12 @@ class f {
|
|
|
884
886
|
t,
|
|
885
887
|
NodeFilter.SHOW_TEXT,
|
|
886
888
|
null
|
|
887
|
-
), s = (l, h,
|
|
888
|
-
var
|
|
889
|
-
if (!l &&
|
|
890
|
-
const
|
|
889
|
+
), s = (l, h, u, p) => {
|
|
890
|
+
var y;
|
|
891
|
+
if (!l && u) {
|
|
892
|
+
const H = h - p, B = Math.max(e - H, 0), O = Math.min(B, p);
|
|
891
893
|
return {
|
|
892
|
-
node:
|
|
894
|
+
node: u,
|
|
893
895
|
offset: O
|
|
894
896
|
};
|
|
895
897
|
}
|
|
@@ -898,7 +900,7 @@ class f {
|
|
|
898
900
|
node: null,
|
|
899
901
|
offset: 0
|
|
900
902
|
};
|
|
901
|
-
const b = ((
|
|
903
|
+
const b = ((y = l.textContent) != null ? y : "").length;
|
|
902
904
|
return h + b >= e ? {
|
|
903
905
|
node: l,
|
|
904
906
|
offset: Math.min(e - h, b)
|
|
@@ -924,15 +926,15 @@ class f {
|
|
|
924
926
|
};
|
|
925
927
|
}
|
|
926
928
|
}
|
|
927
|
-
const
|
|
929
|
+
const ee = (n) => !/[^\t\n\r \u200B]/.test(n), oe = (n) => {
|
|
928
930
|
n.setAttribute("data-blok-empty", f.isEmpty(n) ? "true" : "false");
|
|
929
|
-
},
|
|
931
|
+
}, We = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
930
932
|
__proto__: null,
|
|
931
933
|
Dom: f,
|
|
932
|
-
isCollapsedWhitespaces:
|
|
933
|
-
toggleEmptyMark:
|
|
934
|
+
isCollapsedWhitespaces: ee,
|
|
935
|
+
toggleEmptyMark: oe
|
|
934
936
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
935
|
-
class
|
|
937
|
+
class Nt {
|
|
936
938
|
constructor() {
|
|
937
939
|
this.allListeners = [];
|
|
938
940
|
}
|
|
@@ -946,7 +948,7 @@ class St {
|
|
|
946
948
|
on(t, e, o, s = !1) {
|
|
947
949
|
if (this.findOne(t, e, o, s))
|
|
948
950
|
return;
|
|
949
|
-
const r =
|
|
951
|
+
const r = te("l"), a = {
|
|
950
952
|
id: r,
|
|
951
953
|
element: t,
|
|
952
954
|
eventType: e,
|
|
@@ -1092,47 +1094,47 @@ const G = (n, t) => {
|
|
|
1092
1094
|
if (!n.conversionConfig)
|
|
1093
1095
|
return !1;
|
|
1094
1096
|
const e = n.conversionConfig[t];
|
|
1095
|
-
return
|
|
1096
|
-
},
|
|
1097
|
+
return J(e) || j(e);
|
|
1098
|
+
}, D = (n, t) => {
|
|
1097
1099
|
const e = t.includes(".") ? t : `toolNames.${t}`;
|
|
1098
1100
|
return n.has(e) ? n.t(e) : void 0;
|
|
1099
|
-
},
|
|
1100
|
-
const o = t.titleKey ?
|
|
1101
|
+
}, yt = (n, t, e = "") => {
|
|
1102
|
+
const o = t.titleKey ? D(n, t.titleKey) : void 0;
|
|
1101
1103
|
if (o !== void 0)
|
|
1102
1104
|
return o;
|
|
1103
|
-
const s = t.title ?
|
|
1105
|
+
const s = t.title ? D(n, t.title) : void 0;
|
|
1104
1106
|
if (s !== void 0)
|
|
1105
1107
|
return s;
|
|
1106
1108
|
if (t.title)
|
|
1107
1109
|
return t.title;
|
|
1108
|
-
const i = e ?
|
|
1110
|
+
const i = e ? D(n, e) : void 0;
|
|
1109
1111
|
return i != null ? i : e;
|
|
1110
|
-
},
|
|
1111
|
-
const o = t ?
|
|
1112
|
+
}, se = (n, t, e) => {
|
|
1113
|
+
const o = t ? D(n, t) : void 0;
|
|
1112
1114
|
if (o !== void 0)
|
|
1113
1115
|
return o;
|
|
1114
|
-
const s =
|
|
1116
|
+
const s = D(n, e);
|
|
1115
1117
|
return s != null ? s : e;
|
|
1116
|
-
},
|
|
1118
|
+
}, Et = (n, t) => G(n.tool, t), ne = (n, t) => Object.entries(n).some((([e, o]) => t[e] && pt(t[e], o))), Rt = async (n, t) => {
|
|
1117
1119
|
const o = (await n.save()).data, s = t.find((i) => i.name === n.name);
|
|
1118
1120
|
return s !== void 0 && !G(s, "export") ? [] : t.reduce((i, r) => {
|
|
1119
1121
|
if (!G(r, "import") || r.toolbox === void 0)
|
|
1120
1122
|
return i;
|
|
1121
1123
|
const a = r.toolbox.filter((c) => {
|
|
1122
|
-
if (
|
|
1124
|
+
if (ht(c) || c.icon === void 0)
|
|
1123
1125
|
return !1;
|
|
1124
1126
|
const l = c.data !== void 0;
|
|
1125
|
-
return !(l && c.data !== void 0 &&
|
|
1127
|
+
return !(l && c.data !== void 0 && ne(c.data, o) || !l && r.name === n.name);
|
|
1126
1128
|
});
|
|
1127
|
-
return i.push(
|
|
1129
|
+
return i.push(M(E({}, r), {
|
|
1128
1130
|
toolbox: a
|
|
1129
1131
|
})), i;
|
|
1130
1132
|
}, []);
|
|
1131
|
-
},
|
|
1133
|
+
}, Ve = (n, t) => n.mergeable ? n.name === t.name ? !0 : Et(t, "export") && Et(n, "import") : !1, _e = async (n, t) => {
|
|
1132
1134
|
if (n.length === 0)
|
|
1133
1135
|
return [];
|
|
1134
1136
|
if (n.length === 1)
|
|
1135
|
-
return
|
|
1137
|
+
return Rt(n[0], t);
|
|
1136
1138
|
for (const o of n) {
|
|
1137
1139
|
const s = t.find((i) => i.name === o.name);
|
|
1138
1140
|
if (s !== void 0 && !G(s, "export"))
|
|
@@ -1142,21 +1144,21 @@ const G = (n, t) => {
|
|
|
1142
1144
|
return t.reduce((o, s) => {
|
|
1143
1145
|
if (!G(s, "import") || s.toolbox === void 0)
|
|
1144
1146
|
return o;
|
|
1145
|
-
const i = s.toolbox.filter((r) => !(
|
|
1146
|
-
return i.length > 0 && o.push(
|
|
1147
|
+
const i = s.toolbox.filter((r) => !(ht(r) || r.icon === void 0 || !(r.data !== void 0) && e.size === 1 && e.has(s.name)));
|
|
1148
|
+
return i.length > 0 && o.push(M(E({}, s), {
|
|
1147
1149
|
toolbox: i
|
|
1148
1150
|
})), o;
|
|
1149
1151
|
}, []);
|
|
1150
|
-
},
|
|
1152
|
+
}, Ue = (n, t) => {
|
|
1151
1153
|
const e = t == null ? void 0 : t.export;
|
|
1152
|
-
return
|
|
1153
|
-
},
|
|
1154
|
+
return J(e) ? e(n) : j(e) ? n[e] : (e !== void 0 && q("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."), "");
|
|
1155
|
+
}, Ke = (n, t, e) => {
|
|
1154
1156
|
const o = t == null ? void 0 : t.import;
|
|
1155
|
-
return
|
|
1157
|
+
return J(o) ? o(n, e) : j(o) ? {
|
|
1156
1158
|
[o]: n
|
|
1157
|
-
} : (o !== void 0 &&
|
|
1159
|
+
} : (o !== void 0 && q("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."), {});
|
|
1158
1160
|
};
|
|
1159
|
-
class
|
|
1161
|
+
class Bt {
|
|
1160
1162
|
constructor() {
|
|
1161
1163
|
this.subscribers = {};
|
|
1162
1164
|
}
|
|
@@ -1187,7 +1189,7 @@ class Nt {
|
|
|
1187
1189
|
* @param data - subscribers get this data when they were fired
|
|
1188
1190
|
*/
|
|
1189
1191
|
emit(t, e) {
|
|
1190
|
-
|
|
1192
|
+
ht(this.subscribers) || !this.subscribers[t] || this.subscribers[t].reduce((o, s) => {
|
|
1191
1193
|
const i = s(o);
|
|
1192
1194
|
return i !== void 0 ? i : o;
|
|
1193
1195
|
}, e);
|
|
@@ -1214,9 +1216,9 @@ class Nt {
|
|
|
1214
1216
|
this.subscribers = {};
|
|
1215
1217
|
}
|
|
1216
1218
|
}
|
|
1217
|
-
const
|
|
1219
|
+
const ze = 180, qe = 400, Xe = "blok", Ye = "inline-toolbar", ot = "tooltip", Ze = "[data-blok-interface=inline-toolbar]";
|
|
1218
1220
|
typeof process != "undefined" ? process.platform === "darwin" ? "Meta" : "Control" : typeof navigator != "undefined" && navigator.userAgent.toLowerCase().includes("mac") ? "Meta" : "Control";
|
|
1219
|
-
class
|
|
1221
|
+
class m {
|
|
1220
1222
|
/**
|
|
1221
1223
|
* Returns selected anchor node
|
|
1222
1224
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Selection/anchorNode}
|
|
@@ -1257,7 +1259,7 @@ class v {
|
|
|
1257
1259
|
static isSelectionAtBlok(t) {
|
|
1258
1260
|
if (!t)
|
|
1259
1261
|
return !1;
|
|
1260
|
-
const e = t.anchorNode || t.focusNode, o = e && e.nodeType === Node.TEXT_NODE ? e.parentNode : e, s = o && o instanceof Element ? o.closest(
|
|
1262
|
+
const e = t.anchorNode || t.focusNode, o = e && e.nodeType === Node.TEXT_NODE ? e.parentNode : e, s = o && o instanceof Element ? o.closest(z(d.redactor)) : null;
|
|
1261
1263
|
return s ? s.nodeType === Node.ELEMENT_NODE : !1;
|
|
1262
1264
|
}
|
|
1263
1265
|
/**
|
|
@@ -1273,7 +1275,7 @@ class v {
|
|
|
1273
1275
|
static isRangeAtBlok(t) {
|
|
1274
1276
|
if (!t)
|
|
1275
1277
|
return;
|
|
1276
|
-
const e = t.startContainer && t.startContainer.nodeType === Node.TEXT_NODE ? t.startContainer.parentNode : t.startContainer, o = e && e instanceof Element ? e.closest(
|
|
1278
|
+
const e = t.startContainer && t.startContainer.nodeType === Node.TEXT_NODE ? t.startContainer.parentNode : t.startContainer, o = e && e instanceof Element ? e.closest(z(d.redactor)) : null;
|
|
1277
1279
|
return o ? o.nodeType === Node.ELEMENT_NODE : !1;
|
|
1278
1280
|
}
|
|
1279
1281
|
/**
|
|
@@ -1314,9 +1316,9 @@ class v {
|
|
|
1314
1316
|
height: 0
|
|
1315
1317
|
}, e = window.getSelection();
|
|
1316
1318
|
if (!e)
|
|
1317
|
-
return
|
|
1319
|
+
return q("Method window.getSelection returned null", "warn"), t;
|
|
1318
1320
|
if (e.rangeCount === null || Number.isNaN(e.rangeCount))
|
|
1319
|
-
return
|
|
1321
|
+
return q("Method SelectionUtils.rangeCount is not supported", "warn"), t;
|
|
1320
1322
|
if (e.rangeCount === 0)
|
|
1321
1323
|
return t;
|
|
1322
1324
|
const o = e.getRangeAt(0).cloneRange(), s = o.getBoundingClientRect();
|
|
@@ -1337,7 +1339,7 @@ class v {
|
|
|
1337
1339
|
return (e = t == null ? void 0 : t.toString()) != null ? e : "";
|
|
1338
1340
|
}
|
|
1339
1341
|
}
|
|
1340
|
-
class
|
|
1342
|
+
class st {
|
|
1341
1343
|
/**
|
|
1342
1344
|
* Set focus to contenteditable or native input element
|
|
1343
1345
|
* @param element - element where to set focus
|
|
@@ -1352,7 +1354,7 @@ class et {
|
|
|
1352
1354
|
* @param container - where range should be
|
|
1353
1355
|
*/
|
|
1354
1356
|
static isRangeInsideContainer(t) {
|
|
1355
|
-
const e =
|
|
1357
|
+
const e = m.getRange();
|
|
1356
1358
|
return e === null ? !1 : t.contains(e.startContainer);
|
|
1357
1359
|
}
|
|
1358
1360
|
/**
|
|
@@ -1366,7 +1368,7 @@ class et {
|
|
|
1366
1368
|
e.selectNodeContents(t.focusNode), e.collapse(!1), t.removeAllRanges(), t.addRange(e);
|
|
1367
1369
|
}
|
|
1368
1370
|
}
|
|
1369
|
-
const
|
|
1371
|
+
const gt = class gt {
|
|
1370
1372
|
/**
|
|
1371
1373
|
* Applies box-shadow to a wrapper to extend the background to fill line-height
|
|
1372
1374
|
* @param wrapper - the wrapper element
|
|
@@ -1434,7 +1436,7 @@ const ut = class ut {
|
|
|
1434
1436
|
const s = t.parentElement;
|
|
1435
1437
|
if (!s)
|
|
1436
1438
|
return;
|
|
1437
|
-
const i = window.getComputedStyle(s), r = parseFloat(i.lineHeight), a = parseFloat(window.getComputedStyle(t).fontSize), c = Number.isNaN(r) ? a * 1.2 : r, l = o[0], h = o[o.length - 1],
|
|
1439
|
+
const i = window.getComputedStyle(s), r = parseFloat(i.lineHeight), a = parseFloat(window.getComputedStyle(t).fontSize), c = Number.isNaN(r) ? a * 1.2 : r, l = o[0], h = o[o.length - 1], u = this.findLineIndex(l.top, e), p = this.findLineIndex(h.top, e), v = o.length > 1 && u !== p, b = u === 0, F = p === e.length - 1, y = Math.max(0, (c - l.height) / 2), H = v ? this.calculateLineTopExtension(y, b, e, u) : y, B = v ? this.calculateLineBottomExtension(y, F, e, p) : y, O = this.buildBoxShadow(H, B);
|
|
1438
1440
|
t.style.boxShadow = O;
|
|
1439
1441
|
}
|
|
1440
1442
|
/**
|
|
@@ -1484,9 +1486,9 @@ const ut = class ut {
|
|
|
1484
1486
|
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(", ");
|
|
1485
1487
|
}
|
|
1486
1488
|
};
|
|
1487
|
-
|
|
1488
|
-
let
|
|
1489
|
-
class
|
|
1489
|
+
gt.BG_COLOR = "rgba(0, 0, 0, 0.08)";
|
|
1490
|
+
let R = gt;
|
|
1491
|
+
class ct {
|
|
1490
1492
|
/**
|
|
1491
1493
|
* Collects text nodes that intersect with the passed range
|
|
1492
1494
|
* @param range - selection range
|
|
@@ -1568,22 +1570,22 @@ class _ {
|
|
|
1568
1570
|
static splitMultiLineWrapper(t) {
|
|
1569
1571
|
const e = t.getClientRects();
|
|
1570
1572
|
if (e.length <= 1)
|
|
1571
|
-
return
|
|
1573
|
+
return R.applyBoxShadowToWrapper(t), [t];
|
|
1572
1574
|
const o = t.textContent || "", s = t.parentNode;
|
|
1573
1575
|
if (!s || !o)
|
|
1574
|
-
return
|
|
1576
|
+
return R.applyBoxShadowToWrapper(t), [t];
|
|
1575
1577
|
const i = [], r = t.firstChild;
|
|
1576
1578
|
if (!r || r.nodeType !== Node.TEXT_NODE)
|
|
1577
|
-
return
|
|
1578
|
-
const a =
|
|
1579
|
+
return R.applyBoxShadowToWrapper(t), [t];
|
|
1580
|
+
const a = ct.findLineBreakPositions(r, e.length);
|
|
1579
1581
|
if (a.length === 0)
|
|
1580
|
-
return
|
|
1581
|
-
const c =
|
|
1582
|
+
return R.applyBoxShadowToWrapper(t), [t];
|
|
1583
|
+
const c = ct.splitTextAtPositions(o, a), l = document.createDocumentFragment();
|
|
1582
1584
|
return c.forEach((h) => {
|
|
1583
1585
|
if (h.length === 0)
|
|
1584
1586
|
return;
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
+
const u = f.make("span");
|
|
1588
|
+
u.setAttribute("data-blok-testid", "fake-background"), u.setAttribute("data-blok-fake-background", "true"), u.setAttribute("data-blok-mutation-free", "true"), u.style.color = "inherit", u.style.boxDecorationBreak = "clone", u.style["-webkit-box-decoration-break"] = "clone", u.style.whiteSpace = "pre-wrap", u.textContent = h, l.appendChild(u), i.push(u);
|
|
1587
1589
|
}), s.replaceChild(l, t), i;
|
|
1588
1590
|
}
|
|
1589
1591
|
/**
|
|
@@ -1599,7 +1601,7 @@ class _ {
|
|
|
1599
1601
|
}
|
|
1600
1602
|
}
|
|
1601
1603
|
}
|
|
1602
|
-
class
|
|
1604
|
+
class ie {
|
|
1603
1605
|
constructor(t) {
|
|
1604
1606
|
this.selectionUtils = t;
|
|
1605
1607
|
}
|
|
@@ -1616,26 +1618,26 @@ class se {
|
|
|
1616
1618
|
const e = t.getRangeAt(0);
|
|
1617
1619
|
if (e.collapsed)
|
|
1618
1620
|
return;
|
|
1619
|
-
const o =
|
|
1621
|
+
const o = ct.collectTextNodes(e);
|
|
1620
1622
|
if (o.length === 0)
|
|
1621
1623
|
return;
|
|
1622
1624
|
const s = e.startContainer, i = e.startOffset, r = e.endContainer, a = e.endOffset, c = [];
|
|
1623
|
-
if (o.forEach((
|
|
1624
|
-
var
|
|
1625
|
-
const
|
|
1626
|
-
if (
|
|
1625
|
+
if (o.forEach((p) => {
|
|
1626
|
+
var mt, bt;
|
|
1627
|
+
const v = document.createRange(), b = p === s, F = p === r, y = b ? i : 0, H = (bt = (mt = p.textContent) == null ? void 0 : mt.length) != null ? bt : 0, B = F ? a : H;
|
|
1628
|
+
if (y === B)
|
|
1627
1629
|
return;
|
|
1628
|
-
|
|
1629
|
-
const O = _.wrapRangeWithHighlight(
|
|
1630
|
+
v.setStart(p, y), v.setEnd(p, B);
|
|
1631
|
+
const O = _.wrapRangeWithHighlight(v);
|
|
1630
1632
|
O && c.push(O);
|
|
1631
1633
|
}), c.length === 0)
|
|
1632
1634
|
return;
|
|
1633
1635
|
const l = _.postProcessHighlightWrappers(c);
|
|
1634
|
-
|
|
1636
|
+
R.applyLineHeightExtensions(l);
|
|
1635
1637
|
const h = document.createRange();
|
|
1636
1638
|
h.setStartBefore(l[0]), h.setEndAfter(l[l.length - 1]), this.selectionUtils.savedSelectionRange = h.cloneRange();
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1639
|
+
const u = window.getSelection();
|
|
1640
|
+
u && (u.removeAllRanges(), u.addRange(h)), this.selectionUtils.isFakeBackgroundEnabled = !0;
|
|
1639
1641
|
}
|
|
1640
1642
|
/**
|
|
1641
1643
|
* Removes fake background
|
|
@@ -1678,12 +1680,12 @@ class se {
|
|
|
1678
1680
|
}
|
|
1679
1681
|
}
|
|
1680
1682
|
}
|
|
1681
|
-
class
|
|
1683
|
+
class nt {
|
|
1682
1684
|
/**
|
|
1683
1685
|
* Adds fake cursor to the current range
|
|
1684
1686
|
*/
|
|
1685
1687
|
static addFakeCursor() {
|
|
1686
|
-
const t =
|
|
1688
|
+
const t = m.getRange();
|
|
1687
1689
|
if (t === null)
|
|
1688
1690
|
return;
|
|
1689
1691
|
const e = f.make("span");
|
|
@@ -1694,18 +1696,18 @@ class ot {
|
|
|
1694
1696
|
* @param el - where to check
|
|
1695
1697
|
*/
|
|
1696
1698
|
static isFakeCursorInsideContainer(t) {
|
|
1697
|
-
return f.find(t,
|
|
1699
|
+
return f.find(t, z(d.fakeCursor)) !== null;
|
|
1698
1700
|
}
|
|
1699
1701
|
/**
|
|
1700
1702
|
* Removes fake cursor from a container
|
|
1701
1703
|
* @param container - container to look for
|
|
1702
1704
|
*/
|
|
1703
1705
|
static removeFakeCursor(t = document.body) {
|
|
1704
|
-
const e = f.find(t,
|
|
1706
|
+
const e = f.find(t, z(d.fakeCursor));
|
|
1705
1707
|
e && e.remove();
|
|
1706
1708
|
}
|
|
1707
1709
|
}
|
|
1708
|
-
class
|
|
1710
|
+
class Tt {
|
|
1709
1711
|
/**
|
|
1710
1712
|
* Looks ahead to find passed tag from current selection
|
|
1711
1713
|
* @param tagName - tag to find
|
|
@@ -1723,13 +1725,13 @@ class yt {
|
|
|
1723
1725
|
const c = (l, h) => {
|
|
1724
1726
|
if (h <= 0 || !l)
|
|
1725
1727
|
return null;
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1728
|
+
const u = l.nodeType === Node.ELEMENT_NODE && l.tagName === t, p = !e || l.classList && l.classList.contains(e);
|
|
1729
|
+
if (u && p)
|
|
1728
1730
|
return l;
|
|
1729
1731
|
if (!l.parentNode)
|
|
1730
1732
|
return null;
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1733
|
+
const v = l.parentNode, b = !e || v.classList && v.classList.contains(e);
|
|
1734
|
+
return v.tagName === t && b ? v : c(v, h - 1);
|
|
1733
1735
|
};
|
|
1734
1736
|
return c(a, o);
|
|
1735
1737
|
};
|
|
@@ -1753,9 +1755,9 @@ class yt {
|
|
|
1753
1755
|
o.selectNodeContents(t), e.addRange(o);
|
|
1754
1756
|
}
|
|
1755
1757
|
}
|
|
1756
|
-
class
|
|
1758
|
+
class Ot {
|
|
1757
1759
|
constructor() {
|
|
1758
|
-
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new
|
|
1760
|
+
this.instance = null, this.selection = null, this.savedSelectionRange = null, this.isFakeBackgroundEnabled = !1, this.fakeBackgroundManager = new ie(this);
|
|
1759
1761
|
}
|
|
1760
1762
|
// ========================
|
|
1761
1763
|
// Static getters - delegate to core module
|
|
@@ -1766,14 +1768,14 @@ class Rt {
|
|
|
1766
1768
|
* @returns {Node|null}
|
|
1767
1769
|
*/
|
|
1768
1770
|
static get anchorNode() {
|
|
1769
|
-
return
|
|
1771
|
+
return m.getAnchorNode();
|
|
1770
1772
|
}
|
|
1771
1773
|
/**
|
|
1772
1774
|
* Returns selected anchor element
|
|
1773
1775
|
* @returns {Element|null}
|
|
1774
1776
|
*/
|
|
1775
1777
|
static get anchorElement() {
|
|
1776
|
-
return
|
|
1778
|
+
return m.getAnchorElement();
|
|
1777
1779
|
}
|
|
1778
1780
|
/**
|
|
1779
1781
|
* Returns selection offset according to the anchor node
|
|
@@ -1781,69 +1783,69 @@ class Rt {
|
|
|
1781
1783
|
* @returns {number|null}
|
|
1782
1784
|
*/
|
|
1783
1785
|
static get anchorOffset() {
|
|
1784
|
-
return
|
|
1786
|
+
return m.getAnchorOffset();
|
|
1785
1787
|
}
|
|
1786
1788
|
/**
|
|
1787
1789
|
* Is current selection range collapsed
|
|
1788
1790
|
* @returns {boolean|null}
|
|
1789
1791
|
*/
|
|
1790
1792
|
static get isCollapsed() {
|
|
1791
|
-
return
|
|
1793
|
+
return m.getIsCollapsed();
|
|
1792
1794
|
}
|
|
1793
1795
|
/**
|
|
1794
1796
|
* Check current selection if it is at Blok's zone
|
|
1795
1797
|
* @returns {boolean}
|
|
1796
1798
|
*/
|
|
1797
1799
|
static get isAtBlok() {
|
|
1798
|
-
return
|
|
1800
|
+
return m.getIsAtBlok();
|
|
1799
1801
|
}
|
|
1800
1802
|
/**
|
|
1801
1803
|
* Check if passed selection is at Blok's zone
|
|
1802
1804
|
* @param selection - Selection object to check
|
|
1803
1805
|
*/
|
|
1804
1806
|
static isSelectionAtBlok(t) {
|
|
1805
|
-
return
|
|
1807
|
+
return m.isSelectionAtBlok(t);
|
|
1806
1808
|
}
|
|
1807
1809
|
/**
|
|
1808
1810
|
* Check if passed range at Blok zone
|
|
1809
1811
|
* @param range - range to check
|
|
1810
1812
|
*/
|
|
1811
1813
|
static isRangeAtBlok(t) {
|
|
1812
|
-
return
|
|
1814
|
+
return m.isRangeAtBlok(t);
|
|
1813
1815
|
}
|
|
1814
1816
|
/**
|
|
1815
1817
|
* Methods return boolean that true if selection exists on the page
|
|
1816
1818
|
*/
|
|
1817
1819
|
static get isSelectionExists() {
|
|
1818
|
-
return
|
|
1820
|
+
return m.getIsSelectionExists();
|
|
1819
1821
|
}
|
|
1820
1822
|
/**
|
|
1821
1823
|
* Return first range
|
|
1822
1824
|
* @returns {Range|null}
|
|
1823
1825
|
*/
|
|
1824
1826
|
static get range() {
|
|
1825
|
-
return
|
|
1827
|
+
return m.getRange();
|
|
1826
1828
|
}
|
|
1827
1829
|
/**
|
|
1828
1830
|
* Returns range from passed Selection object
|
|
1829
1831
|
* @param selection - Selection object to get Range from
|
|
1830
1832
|
*/
|
|
1831
1833
|
static getRangeFromSelection(t) {
|
|
1832
|
-
return
|
|
1834
|
+
return m.getRangeFromSelection(t);
|
|
1833
1835
|
}
|
|
1834
1836
|
/**
|
|
1835
1837
|
* Calculates position and size of selected text
|
|
1836
1838
|
* @returns {DOMRect}
|
|
1837
1839
|
*/
|
|
1838
1840
|
static get rect() {
|
|
1839
|
-
return
|
|
1841
|
+
return m.getRect();
|
|
1840
1842
|
}
|
|
1841
1843
|
/**
|
|
1842
1844
|
* Returns selected text as String
|
|
1843
1845
|
* @returns {string}
|
|
1844
1846
|
*/
|
|
1845
1847
|
static get text() {
|
|
1846
|
-
return
|
|
1848
|
+
return m.getText();
|
|
1847
1849
|
}
|
|
1848
1850
|
/**
|
|
1849
1851
|
* Returns window Selection
|
|
@@ -1851,7 +1853,7 @@ class Rt {
|
|
|
1851
1853
|
* @returns {Selection}
|
|
1852
1854
|
*/
|
|
1853
1855
|
static get() {
|
|
1854
|
-
return
|
|
1856
|
+
return m.get();
|
|
1855
1857
|
}
|
|
1856
1858
|
// ========================
|
|
1857
1859
|
// Static methods - delegate to appropriate modules
|
|
@@ -1862,34 +1864,34 @@ class Rt {
|
|
|
1862
1864
|
* @param offset - offset of cursor
|
|
1863
1865
|
*/
|
|
1864
1866
|
static setCursor(t, e = 0) {
|
|
1865
|
-
return
|
|
1867
|
+
return st.setCursor(t, e);
|
|
1866
1868
|
}
|
|
1867
1869
|
/**
|
|
1868
1870
|
* Check if current range exists and belongs to container
|
|
1869
1871
|
* @param container - where range should be
|
|
1870
1872
|
*/
|
|
1871
1873
|
static isRangeInsideContainer(t) {
|
|
1872
|
-
return
|
|
1874
|
+
return st.isRangeInsideContainer(t);
|
|
1873
1875
|
}
|
|
1874
1876
|
/**
|
|
1875
1877
|
* Adds fake cursor to the current range
|
|
1876
1878
|
*/
|
|
1877
1879
|
static addFakeCursor() {
|
|
1878
|
-
|
|
1880
|
+
nt.addFakeCursor();
|
|
1879
1881
|
}
|
|
1880
1882
|
/**
|
|
1881
1883
|
* Check if passed element contains a fake cursor
|
|
1882
1884
|
* @param el - where to check
|
|
1883
1885
|
*/
|
|
1884
1886
|
static isFakeCursorInsideContainer(t) {
|
|
1885
|
-
return
|
|
1887
|
+
return nt.isFakeCursorInsideContainer(t);
|
|
1886
1888
|
}
|
|
1887
1889
|
/**
|
|
1888
1890
|
* Removes fake cursor from a container
|
|
1889
1891
|
* @param container - container to look for
|
|
1890
1892
|
*/
|
|
1891
1893
|
static removeFakeCursor(t = document.body) {
|
|
1892
|
-
|
|
1894
|
+
nt.removeFakeCursor(t);
|
|
1893
1895
|
}
|
|
1894
1896
|
// ========================
|
|
1895
1897
|
// Instance methods - delegate to FakeBackgroundManager or use instance state
|
|
@@ -1928,7 +1930,7 @@ class Rt {
|
|
|
1928
1930
|
* Save Selection's range
|
|
1929
1931
|
*/
|
|
1930
1932
|
save() {
|
|
1931
|
-
this.savedSelectionRange =
|
|
1933
|
+
this.savedSelectionRange = m.getRange();
|
|
1932
1934
|
}
|
|
1933
1935
|
/**
|
|
1934
1936
|
* Restore saved Selection's range
|
|
@@ -1949,7 +1951,7 @@ class Rt {
|
|
|
1949
1951
|
* Collapse current selection
|
|
1950
1952
|
*/
|
|
1951
1953
|
collapseToEnd() {
|
|
1952
|
-
|
|
1954
|
+
st.collapseToEnd();
|
|
1953
1955
|
}
|
|
1954
1956
|
/**
|
|
1955
1957
|
* Looks ahead to find passed tag from current selection
|
|
@@ -1959,17 +1961,17 @@ class Rt {
|
|
|
1959
1961
|
* @returns {HTMLElement|null}
|
|
1960
1962
|
*/
|
|
1961
1963
|
findParentTag(t, e, o = 10) {
|
|
1962
|
-
return
|
|
1964
|
+
return Tt.findParentTag(t, e, o);
|
|
1963
1965
|
}
|
|
1964
1966
|
/**
|
|
1965
1967
|
* Expands selection range to the passed parent node
|
|
1966
1968
|
* @param element - element which contents should be selected
|
|
1967
1969
|
*/
|
|
1968
1970
|
expandToTag(t) {
|
|
1969
|
-
|
|
1971
|
+
Tt.expandToTag(t);
|
|
1970
1972
|
}
|
|
1971
1973
|
}
|
|
1972
|
-
const
|
|
1974
|
+
const re = [
|
|
1973
1975
|
// Max-width: max-w-* classes conflict with each other
|
|
1974
1976
|
{ pattern: /^max-w-(.+)$/, getGroup: () => "max-w" },
|
|
1975
1977
|
// Width: w-* classes conflict with each other
|
|
@@ -2050,26 +2052,26 @@ const ne = [
|
|
|
2050
2052
|
{ pattern: /^border(-.*)?$/, getGroup: () => "border" },
|
|
2051
2053
|
// Shadow: shadow-*
|
|
2052
2054
|
{ pattern: /^shadow(-.*)?$/, getGroup: () => "shadow" }
|
|
2053
|
-
],
|
|
2054
|
-
const t =
|
|
2055
|
+
], it = /* @__PURE__ */ new Map(), ae = (n) => {
|
|
2056
|
+
const t = it.get(n);
|
|
2055
2057
|
if (t !== void 0)
|
|
2056
2058
|
return t;
|
|
2057
|
-
for (const { pattern: e, getGroup: o } of
|
|
2059
|
+
for (const { pattern: e, getGroup: o } of re) {
|
|
2058
2060
|
const s = n.match(e);
|
|
2059
2061
|
if (s) {
|
|
2060
2062
|
const i = o(s);
|
|
2061
|
-
return
|
|
2063
|
+
return it.set(n, i), i;
|
|
2062
2064
|
}
|
|
2063
2065
|
}
|
|
2064
|
-
return
|
|
2065
|
-
},
|
|
2066
|
-
const o =
|
|
2066
|
+
return it.set(n, null), null;
|
|
2067
|
+
}, le = (n, t, e) => {
|
|
2068
|
+
const o = ae(n);
|
|
2067
2069
|
if (o) {
|
|
2068
2070
|
t.set(o, n);
|
|
2069
2071
|
return;
|
|
2070
2072
|
}
|
|
2071
2073
|
e.includes(n) || e.push(n);
|
|
2072
|
-
},
|
|
2074
|
+
}, ce = (n) => {
|
|
2073
2075
|
const t = [];
|
|
2074
2076
|
for (const e of n)
|
|
2075
2077
|
if (e) {
|
|
@@ -2080,14 +2082,14 @@ const ne = [
|
|
|
2080
2082
|
t.push(e);
|
|
2081
2083
|
}
|
|
2082
2084
|
return t;
|
|
2083
|
-
},
|
|
2084
|
-
const t = /* @__PURE__ */ new Map(), e = [], o =
|
|
2085
|
+
}, C = (...n) => {
|
|
2086
|
+
const t = /* @__PURE__ */ new Map(), e = [], o = ce(n);
|
|
2085
2087
|
for (const s of o)
|
|
2086
|
-
s.split(/\s+/).filter(Boolean).forEach((r) =>
|
|
2088
|
+
s.split(/\s+/).filter(Boolean).forEach((r) => le(r, t, e));
|
|
2087
2089
|
return [...e, ...t.values()].join(" ");
|
|
2088
|
-
},
|
|
2089
|
-
var
|
|
2090
|
-
const
|
|
2090
|
+
}, It = (...n) => n.filter(Boolean).join(" ");
|
|
2091
|
+
var S = /* @__PURE__ */ ((n) => (n.Default = "default", n.Separator = "separator", n.Html = "html", n))(S || {});
|
|
2092
|
+
const rt = 10, de = "tooltip", he = "aria-hidden", pe = "false", ue = "true", fe = "visibility", ge = "visible", ve = "hidden", x = class x {
|
|
2091
2093
|
/**
|
|
2092
2094
|
* Module constructor
|
|
2093
2095
|
*/
|
|
@@ -2095,7 +2097,7 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2095
2097
|
this.nodes = {
|
|
2096
2098
|
wrapper: null,
|
|
2097
2099
|
content: null
|
|
2098
|
-
}, this.showed = !1, this.offsetTop =
|
|
2100
|
+
}, this.showed = !1, this.offsetTop = rt, this.offsetLeft = rt, this.offsetRight = rt, this.showingTimeout = null, this.ariaObserver = null, this.handleWindowScroll = () => {
|
|
2099
2101
|
this.showed && this.hide();
|
|
2100
2102
|
}, this.prepare(), window.addEventListener("scroll", this.handleWindowScroll, { passive: !0 });
|
|
2101
2103
|
}
|
|
@@ -2105,35 +2107,27 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2105
2107
|
*/
|
|
2106
2108
|
get CSS() {
|
|
2107
2109
|
return {
|
|
2108
|
-
tooltip:
|
|
2110
|
+
tooltip: It(
|
|
2109
2111
|
"absolute z-overlay top-0 left-0",
|
|
2110
2112
|
"bg-tooltip-bg opacity-0",
|
|
2111
2113
|
"select-none pointer-events-none",
|
|
2112
|
-
"transition-[opacity,transform] duration-[50ms,70ms] ease-in",
|
|
2113
2114
|
"rounded-lg shadow-tooltip",
|
|
2114
|
-
"will-change-[opacity,top,left]",
|
|
2115
2115
|
"before:content-[''] before:absolute before:inset-0 before:bg-tooltip-bg before:-z-10 before:rounded-lg",
|
|
2116
2116
|
"mobile:hidden"
|
|
2117
2117
|
).split(" "),
|
|
2118
|
-
tooltipContent:
|
|
2118
|
+
tooltipContent: It(
|
|
2119
2119
|
"px-2.5 py-1.5",
|
|
2120
2120
|
"text-tooltip-font text-xs text-center",
|
|
2121
2121
|
"tracking-[0.02em] leading-[1em]"
|
|
2122
2122
|
).split(" "),
|
|
2123
|
-
tooltipShown: ["opacity-100"
|
|
2124
|
-
placement: {
|
|
2125
|
-
left: ["-translate-x-[5px]"],
|
|
2126
|
-
bottom: ["translate-y-[5px]"],
|
|
2127
|
-
right: ["translate-x-[5px]"],
|
|
2128
|
-
top: ["-translate-y-[5px]"]
|
|
2129
|
-
}
|
|
2123
|
+
tooltipShown: ["opacity-100"]
|
|
2130
2124
|
};
|
|
2131
2125
|
}
|
|
2132
2126
|
/**
|
|
2133
2127
|
* Get singleton instance
|
|
2134
2128
|
*/
|
|
2135
2129
|
static getInstance() {
|
|
2136
|
-
return
|
|
2130
|
+
return x.instance || (x.instance = new x()), x.instance;
|
|
2137
2131
|
}
|
|
2138
2132
|
/**
|
|
2139
2133
|
* Show Tooltip near passed element with specified HTML content
|
|
@@ -2149,41 +2143,40 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2149
2143
|
marginLeft: 0,
|
|
2150
2144
|
marginRight: 0,
|
|
2151
2145
|
marginBottom: 0,
|
|
2152
|
-
delay:
|
|
2146
|
+
delay: 0
|
|
2153
2147
|
}, o);
|
|
2154
|
-
if (
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
this.
|
|
2177
|
-
}
|
|
2178
|
-
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
this.
|
|
2148
|
+
if (this.nodes.content && (this.nodes.content.innerHTML = "", this.nodes.content.appendChild(this.createContentNode(e)), !!this.nodes.wrapper)) {
|
|
2149
|
+
switch (i.placement) {
|
|
2150
|
+
case "top":
|
|
2151
|
+
this.placeTop(t, i);
|
|
2152
|
+
break;
|
|
2153
|
+
case "left":
|
|
2154
|
+
this.placeLeft(t, i);
|
|
2155
|
+
break;
|
|
2156
|
+
case "right":
|
|
2157
|
+
this.placeRight(t, i);
|
|
2158
|
+
break;
|
|
2159
|
+
case "bottom":
|
|
2160
|
+
default:
|
|
2161
|
+
this.placeBottom(t, i);
|
|
2162
|
+
break;
|
|
2163
|
+
}
|
|
2164
|
+
if (i && i.delay) {
|
|
2165
|
+
this.showingTimeout = setTimeout(() => {
|
|
2166
|
+
if (this.showingTimeout = null, this.nodes.wrapper) {
|
|
2167
|
+
const r = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2168
|
+
this.nodes.wrapper.classList.add(...r), this.updateTooltipVisibility();
|
|
2169
|
+
}
|
|
2170
|
+
this.showed = !0;
|
|
2171
|
+
}, i.delay);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (this.nodes.wrapper) {
|
|
2175
|
+
const r = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown : [this.CSS.tooltipShown];
|
|
2176
|
+
this.nodes.wrapper.classList.add(...r), this.updateTooltipVisibility();
|
|
2177
|
+
}
|
|
2178
|
+
this.showed = !0;
|
|
2185
2179
|
}
|
|
2186
|
-
this.showed = !0;
|
|
2187
2180
|
}
|
|
2188
2181
|
/**
|
|
2189
2182
|
* Prepare tooltip content node
|
|
@@ -2225,13 +2218,13 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2225
2218
|
*/
|
|
2226
2219
|
destroy() {
|
|
2227
2220
|
var t;
|
|
2228
|
-
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll),
|
|
2221
|
+
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll), x.instance = null;
|
|
2229
2222
|
}
|
|
2230
2223
|
/**
|
|
2231
2224
|
* Module Preparation method
|
|
2232
2225
|
*/
|
|
2233
2226
|
prepare() {
|
|
2234
|
-
this.nodes.wrapper = this.make("div", this.CSS.tooltip), this.nodes.wrapper.setAttribute(d.interface,
|
|
2227
|
+
this.nodes.wrapper = this.make("div", this.CSS.tooltip), this.nodes.wrapper.setAttribute(d.interface, ot), 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());
|
|
2235
2228
|
}
|
|
2236
2229
|
/**
|
|
2237
2230
|
* Update tooltip visibility based on shown state
|
|
@@ -2240,7 +2233,7 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2240
2233
|
if (!this.nodes.wrapper)
|
|
2241
2234
|
return;
|
|
2242
2235
|
const t = Array.isArray(this.CSS.tooltipShown) ? this.CSS.tooltipShown[0] : this.CSS.tooltipShown, e = this.nodes.wrapper.classList.contains(t);
|
|
2243
|
-
this.nodes.wrapper.style.setProperty(
|
|
2236
|
+
this.nodes.wrapper.style.setProperty(fe, e ? ge : ve), this.nodes.wrapper.setAttribute(he, e ? pe : ue), this.nodes.wrapper.setAttribute("data-blok-shown", e ? "true" : "false");
|
|
2244
2237
|
}
|
|
2245
2238
|
/**
|
|
2246
2239
|
* Watch tooltip visibility changes for accessibility
|
|
@@ -2258,7 +2251,7 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2258
2251
|
* Ensure tooltip has proper accessibility attributes
|
|
2259
2252
|
*/
|
|
2260
2253
|
ensureTooltipAttributes() {
|
|
2261
|
-
this.nodes.wrapper && ((!this.nodes.wrapper.hasAttribute(d.interface) || this.nodes.wrapper.getAttribute(d.interface) !==
|
|
2254
|
+
this.nodes.wrapper && ((!this.nodes.wrapper.hasAttribute(d.interface) || this.nodes.wrapper.getAttribute(d.interface) !== ot) && this.nodes.wrapper.setAttribute(d.interface, ot), this.nodes.wrapper.setAttribute("role", de), this.watchTooltipVisibility());
|
|
2262
2255
|
}
|
|
2263
2256
|
/**
|
|
2264
2257
|
* Calculates element coords and moves tooltip bottom of the element
|
|
@@ -2314,10 +2307,7 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2314
2307
|
* @param {number} top - top position in pixels
|
|
2315
2308
|
*/
|
|
2316
2309
|
applyPlacement(t, e, o) {
|
|
2317
|
-
|
|
2318
|
-
return;
|
|
2319
|
-
const s = Array.isArray(this.CSS.placement[t]) ? this.CSS.placement[t] : [this.CSS.placement[t]];
|
|
2320
|
-
this.nodes.wrapper.classList.add(...s), this.nodes.wrapper.setAttribute("data-blok-placement", t), this.nodes.wrapper.style.left = `${e}px`, this.nodes.wrapper.style.top = `${o}px`;
|
|
2310
|
+
this.nodes.wrapper && (this.nodes.wrapper.setAttribute("data-blok-placement", t), this.nodes.wrapper.style.left = `${e}px`, this.nodes.wrapper.style.top = `${o}px`);
|
|
2321
2311
|
}
|
|
2322
2312
|
/**
|
|
2323
2313
|
* Get current page vertical scroll offset
|
|
@@ -2349,17 +2339,17 @@ const nt = 10, le = "tooltip", ce = "aria-hidden", de = "false", he = "true", pe
|
|
|
2349
2339
|
Array.isArray(e) ? e.forEach((o) => t.appendChild(o)) : t.appendChild(e);
|
|
2350
2340
|
}
|
|
2351
2341
|
};
|
|
2352
|
-
|
|
2353
|
-
let
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2356
|
-
},
|
|
2357
|
-
|
|
2358
|
-
},
|
|
2359
|
-
|
|
2360
|
-
},
|
|
2361
|
-
|
|
2362
|
-
},
|
|
2342
|
+
x.instance = null;
|
|
2343
|
+
let dt = x;
|
|
2344
|
+
const et = () => dt.getInstance(), Qe = (n, t, e) => {
|
|
2345
|
+
et().show(n, t, e != null ? e : {});
|
|
2346
|
+
}, me = () => {
|
|
2347
|
+
et().hide();
|
|
2348
|
+
}, be = (n, t, e) => {
|
|
2349
|
+
et().onHover(n, t, e != null ? e : {});
|
|
2350
|
+
}, Je = () => {
|
|
2351
|
+
et().destroy();
|
|
2352
|
+
}, N = class N {
|
|
2363
2353
|
/**
|
|
2364
2354
|
* @param {HTMLElement[]} nodeList — the list of iterable HTML-items
|
|
2365
2355
|
* @param {string} focusedCssClass - user-provided CSS-class that will be set in flipping process
|
|
@@ -2398,13 +2388,13 @@ const J = () => lt.getInstance(), Xe = (n, t, e) => {
|
|
|
2398
2388
|
* Sets cursor next to the current
|
|
2399
2389
|
*/
|
|
2400
2390
|
next() {
|
|
2401
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2391
|
+
this.cursor = this.leafNodesAndReturnIndex(N.directions.RIGHT);
|
|
2402
2392
|
}
|
|
2403
2393
|
/**
|
|
2404
2394
|
* Sets cursor before current
|
|
2405
2395
|
*/
|
|
2406
2396
|
previous() {
|
|
2407
|
-
this.cursor = this.leafNodesAndReturnIndex(
|
|
2397
|
+
this.cursor = this.leafNodesAndReturnIndex(N.directions.LEFT);
|
|
2408
2398
|
}
|
|
2409
2399
|
/**
|
|
2410
2400
|
* Sets cursor to the default position and removes CSS-class from previously focused item
|
|
@@ -2420,9 +2410,9 @@ const J = () => lt.getInstance(), Xe = (n, t, e) => {
|
|
|
2420
2410
|
leafNodesAndReturnIndex(t) {
|
|
2421
2411
|
if (this.items.length === 0)
|
|
2422
2412
|
return this.cursor;
|
|
2423
|
-
const e = t ===
|
|
2413
|
+
const e = t === N.directions.RIGHT ? -1 : 0, o = this.cursor === -1 ? e : this.cursor;
|
|
2424
2414
|
o !== -1 && (this.items[o].classList.remove(this.focusedCssClass), this.items[o].removeAttribute("data-blok-focused"));
|
|
2425
|
-
const s = t ===
|
|
2415
|
+
const s = t === N.directions.RIGHT ? (
|
|
2426
2416
|
/**
|
|
2427
2417
|
* If we go right then choose next (+1) Tool
|
|
2428
2418
|
* @type {number}
|
|
@@ -2436,15 +2426,15 @@ const J = () => lt.getInstance(), Xe = (n, t, e) => {
|
|
|
2436
2426
|
*/
|
|
2437
2427
|
(this.items.length + o - 1) % this.items.length
|
|
2438
2428
|
);
|
|
2439
|
-
return f.canSetCaret(this.items[s]) &&
|
|
2429
|
+
return f.canSetCaret(this.items[s]) && _t(() => Ot.setCursor(this.items[s]), 50)(), this.items[s].classList.add(this.focusedCssClass), this.items[s].setAttribute("data-blok-focused", "true"), s;
|
|
2440
2430
|
}
|
|
2441
2431
|
};
|
|
2442
|
-
|
|
2432
|
+
N.directions = {
|
|
2443
2433
|
RIGHT: "right",
|
|
2444
2434
|
LEFT: "left"
|
|
2445
2435
|
};
|
|
2446
|
-
let
|
|
2447
|
-
class
|
|
2436
|
+
let L = N;
|
|
2437
|
+
class Y {
|
|
2448
2438
|
/**
|
|
2449
2439
|
* @param options - different constructing settings
|
|
2450
2440
|
*/
|
|
@@ -2457,7 +2447,7 @@ class Z {
|
|
|
2457
2447
|
return;
|
|
2458
2448
|
const r = this.getKeyCode(s), a = r === g.LEFT || r === g.RIGHT || r === g.UP || r === g.DOWN;
|
|
2459
2449
|
if (!(s.shiftKey && a || !this.isEventReadyForHandling(s)) && !(r === g.ENTER && !((l = this.iterator) != null && l.currentItem)))
|
|
2460
|
-
switch (s.stopPropagation(), s.stopImmediatePropagation(), r !== null &&
|
|
2450
|
+
switch (s.stopPropagation(), s.stopImmediatePropagation(), r !== null && Y.usedKeys.includes(r) && s.preventDefault(), r) {
|
|
2461
2451
|
case g.TAB:
|
|
2462
2452
|
this.handleTabPress(s);
|
|
2463
2453
|
break;
|
|
@@ -2477,7 +2467,7 @@ class Z {
|
|
|
2477
2467
|
this.handleEnterPress(s);
|
|
2478
2468
|
break;
|
|
2479
2469
|
}
|
|
2480
|
-
}, this.iterator = new
|
|
2470
|
+
}, this.iterator = new L(t.items || [], (e = t.focusedItemClass) != null ? e : ""), this.activateCallback = t.activateCallback, this.allowedKeys = t.allowedKeys || Y.usedKeys, this.handleContentEditableTargets = (o = t.handleContentEditableTargets) != null ? o : !1, this.onArrowLeftCallback = t.onArrowLeft;
|
|
2481
2471
|
}
|
|
2482
2472
|
/**
|
|
2483
2473
|
* True if flipper is currently activated
|
|
@@ -2635,16 +2625,16 @@ class Z {
|
|
|
2635
2625
|
* @param {KeyboardEvent} event - tab keydown event
|
|
2636
2626
|
*/
|
|
2637
2627
|
handleTabPress(t) {
|
|
2638
|
-
const o = t.shiftKey ?
|
|
2628
|
+
const o = t.shiftKey ? L.directions.LEFT : L.directions.RIGHT;
|
|
2639
2629
|
if (this.skipNextTabFocus) {
|
|
2640
2630
|
this.skipNextTabFocus = !1;
|
|
2641
2631
|
return;
|
|
2642
2632
|
}
|
|
2643
2633
|
switch (o) {
|
|
2644
|
-
case
|
|
2634
|
+
case L.directions.RIGHT:
|
|
2645
2635
|
this.flipRight();
|
|
2646
2636
|
break;
|
|
2647
|
-
case
|
|
2637
|
+
case L.directions.LEFT:
|
|
2648
2638
|
this.flipLeft();
|
|
2649
2639
|
break;
|
|
2650
2640
|
}
|
|
@@ -2662,7 +2652,7 @@ class Z {
|
|
|
2662
2652
|
*/
|
|
2663
2653
|
handleEnterPress(t) {
|
|
2664
2654
|
var e, o;
|
|
2665
|
-
this.activated && ((e = this.iterator) != null && e.currentItem && (t.stopPropagation(), t.preventDefault(), this.iterator.currentItem.click()),
|
|
2655
|
+
this.activated && ((e = this.iterator) != null && e.currentItem && (t.stopPropagation(), t.preventDefault(), this.iterator.currentItem.click()), J(this.activateCallback) && ((o = this.iterator) != null && o.currentItem) && this.activateCallback(this.iterator.currentItem));
|
|
2666
2656
|
}
|
|
2667
2657
|
/**
|
|
2668
2658
|
* Scrolls the given element into view using the best available method
|
|
@@ -2695,12 +2685,12 @@ class Z {
|
|
|
2695
2685
|
return o && !i || c || a;
|
|
2696
2686
|
}
|
|
2697
2687
|
}
|
|
2698
|
-
const
|
|
2699
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2700
|
-
<path d="
|
|
2688
|
+
const to = `
|
|
2689
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2690
|
+
<path d="m5 15 10-10m0 10L5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2701
2691
|
</svg>
|
|
2702
|
-
`,
|
|
2703
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2692
|
+
`, eo = `
|
|
2693
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2704
2694
|
<path
|
|
2705
2695
|
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"
|
|
2706
2696
|
stroke="currentColor"
|
|
@@ -2709,201 +2699,217 @@ const Qe = `
|
|
|
2709
2699
|
stroke-linejoin="round"
|
|
2710
2700
|
/>
|
|
2711
2701
|
</svg>
|
|
2712
|
-
`,
|
|
2713
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2702
|
+
`, oo = `
|
|
2703
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2714
2704
|
<path
|
|
2715
2705
|
d="M8.5 5h6m-10 12h6m1-12-4 12"
|
|
2716
2706
|
stroke="currentColor"
|
|
2707
|
+
stroke-width="1.25"
|
|
2717
2708
|
stroke-linecap="round"
|
|
2718
2709
|
stroke-linejoin="round"
|
|
2719
2710
|
/>
|
|
2720
2711
|
</svg>
|
|
2721
|
-
`, eo = `
|
|
2722
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2723
|
-
<path
|
|
2724
|
-
d="m9.98288 15.0959-.91628.9157c-.29867.3092-.65593.5559-1.05095.7255-.39502.1697-.81987.259-1.24978.2628-.4299.0037-.85625-.0782-1.25415-.241-.39791-.1628-.75941-.4032-1.06341-.7072-.304-.304-.54441-.6655-.70721-1.0634-.16279-.3979-.24471-.8243-.24098-1.2542.00374-.4299.09306-.8547.26274-1.2497.16969-.3951.41635-.7523.72558-1.051l.91499-.9163m8.24197.9156.9163-.9156c.6028-.60809.9402-1.43021.9383-2.28645-.0019-.85625-.3429-1.67688-.9483-2.28234-.6055-.60546-1.4261-.94643-2.2823-.9483-.8563-.00188-1.6784.3355-2.28652.9383l-.91628.91563M7.258 13.2413l4.5328-4.53278"
|
|
2725
|
-
stroke="currentColor"
|
|
2726
|
-
stroke-width=".784151"
|
|
2727
|
-
stroke-linecap="round"
|
|
2728
|
-
stroke-linejoin="round"
|
|
2729
|
-
/>
|
|
2730
|
-
</svg>
|
|
2731
|
-
`, oo = `
|
|
2732
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2733
|
-
<path
|
|
2734
|
-
d="M15.5 14.003h-3v-3.0004m-9-6.00078h3v3.0004m1.55478-3.80901A5.2170862 5.2170862 0 0 1 9.5 4.00014c1.1682.00058 2.3059.37321 3.2481 1.06388.9422.69067 1.64 1.66348 1.9923 2.77744.3523 1.11396.3407 2.31114-.033 3.41814-.3738 1.1069-1.0903 2.0661-2.0457 2.7384m-1.7165.8088c-.4703.1317-.9568.1967-1.4452.1931-1.16819-.0006-2.30585-.3733-3.24807-1.0639-.94222-.6907-1.64004-1.6635-1.99232-2.7775-.35229-1.1139-.34072-2.31114.03302-3.41808.37375-1.10694 1.09024-2.06608 2.04563-2.73841"
|
|
2735
|
-
stroke="currentColor"
|
|
2736
|
-
stroke-miterlimit="10"
|
|
2737
|
-
stroke-linecap="round"
|
|
2738
|
-
/>
|
|
2739
|
-
</svg>
|
|
2740
2712
|
`, so = `
|
|
2741
|
-
<svg width="
|
|
2742
|
-
<path
|
|
2743
|
-
|
|
2744
|
-
fill="currentColor"
|
|
2745
|
-
/>
|
|
2713
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2714
|
+
<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
|
+
<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"/>
|
|
2746
2716
|
</svg>
|
|
2747
2717
|
`, no = `
|
|
2748
|
-
<svg width="
|
|
2749
|
-
<path d="
|
|
2718
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2719
|
+
<path d="M14.5 6.5l2-2-2-2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2720
|
+
<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
|
+
<path d="M5.5 13.5l-2 2 2 2" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2722
|
+
<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"/>
|
|
2750
2723
|
</svg>
|
|
2751
2724
|
`, io = `
|
|
2752
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2753
|
-
<
|
|
2725
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2726
|
+
<circle cx="7.5" cy="5.5" r="1" fill="currentColor"/>
|
|
2727
|
+
<circle cx="12.5" cy="5.5" r="1" fill="currentColor"/>
|
|
2728
|
+
<circle cx="7.5" cy="10" r="1" fill="currentColor"/>
|
|
2729
|
+
<circle cx="12.5" cy="10" r="1" fill="currentColor"/>
|
|
2730
|
+
<circle cx="7.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2731
|
+
<circle cx="12.5" cy="14.5" r="1" fill="currentColor"/>
|
|
2754
2732
|
</svg>
|
|
2755
|
-
`,
|
|
2756
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2757
|
-
<path d="
|
|
2733
|
+
`, ro = `
|
|
2734
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2735
|
+
<path d="M4.5 10h11M10 4.5v11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2758
2736
|
</svg>
|
|
2759
|
-
`,
|
|
2760
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2761
|
-
<path
|
|
2762
|
-
d="m17.5 17.5-5-5m1.6667-4.16667c0 .76605-.1509 1.52459-.4441 2.23237-.2931.7077-.7228 1.3507-1.2645 1.8924-.5417.5417-1.1847.9714-1.8924 1.2645-.70778.2932-1.46632.4441-2.23237.4441-.76604 0-1.52458-.1509-2.23232-.4441-.70773-.2931-1.35079-.7228-1.89247-1.2645-.54167-.5417-.97135-1.1847-1.2645-1.8924C2.65088 9.85792 2.5 9.09938 2.5 8.33333c0-1.54709.61458-3.03082 1.70854-4.12479C5.30251 3.11458 6.78624 2.5 8.33333 2.5c1.5471 0 3.03087.61458 4.12477 1.70854 1.094 1.09397 1.7086 2.5777 1.7086 4.12479Z"
|
|
2763
|
-
stroke="currentColor"
|
|
2764
|
-
stroke-linecap="round"
|
|
2765
|
-
stroke-linejoin="round"
|
|
2766
|
-
/>
|
|
2737
|
+
`, ao = `
|
|
2738
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2739
|
+
<path d="m12 5-5 5 5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2767
2740
|
</svg>
|
|
2768
|
-
`,
|
|
2769
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2741
|
+
`, we = `
|
|
2742
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2743
|
+
<path d="m8 5 5 5-5 5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2744
|
+
</svg>
|
|
2745
|
+
`, ke = `
|
|
2746
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2747
|
+
<circle cx="9" cy="9" r="4.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2748
|
+
<path d="m12.5 12.5 3.5 3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2749
|
+
</svg>
|
|
2750
|
+
`, lo = `
|
|
2751
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2770
2752
|
<path
|
|
2771
2753
|
d="M3.33334 10H10m-6.66666 5V5M10 15V5m4.1667 5 2.5-1.66667V15"
|
|
2772
2754
|
stroke="currentColor"
|
|
2755
|
+
stroke-width="1.25"
|
|
2773
2756
|
stroke-linecap="round"
|
|
2774
2757
|
stroke-linejoin="round"
|
|
2775
2758
|
/>
|
|
2776
2759
|
</svg>
|
|
2777
|
-
`,
|
|
2778
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2760
|
+
`, co = `
|
|
2761
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2779
2762
|
<path
|
|
2780
2763
|
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"
|
|
2781
2764
|
stroke="currentColor"
|
|
2765
|
+
stroke-width="1.25"
|
|
2782
2766
|
stroke-linecap="round"
|
|
2783
2767
|
stroke-linejoin="round"
|
|
2784
2768
|
/>
|
|
2785
2769
|
</svg>
|
|
2786
|
-
`,
|
|
2787
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2770
|
+
`, ho = `
|
|
2771
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2788
2772
|
<path
|
|
2789
2773
|
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"
|
|
2790
2774
|
stroke="currentColor"
|
|
2775
|
+
stroke-width="1.25"
|
|
2791
2776
|
stroke-linecap="round"
|
|
2792
2777
|
stroke-linejoin="round"
|
|
2793
2778
|
/>
|
|
2794
2779
|
</svg>
|
|
2795
|
-
`,
|
|
2780
|
+
`, po = `
|
|
2796
2781
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2797
2782
|
<path
|
|
2798
2783
|
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"
|
|
2799
|
-
stroke="
|
|
2784
|
+
stroke="currentColor"
|
|
2785
|
+
stroke-width="1.25"
|
|
2800
2786
|
stroke-linecap="round"
|
|
2801
2787
|
stroke-linejoin="round"
|
|
2802
2788
|
/>
|
|
2803
2789
|
</svg>
|
|
2804
|
-
`,
|
|
2790
|
+
`, uo = `
|
|
2805
2791
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2806
2792
|
<path
|
|
2807
2793
|
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"
|
|
2808
|
-
stroke="
|
|
2794
|
+
stroke="currentColor"
|
|
2795
|
+
stroke-width="1.25"
|
|
2809
2796
|
stroke-linecap="round"
|
|
2810
2797
|
stroke-linejoin="round"
|
|
2811
2798
|
/>
|
|
2812
2799
|
</svg>
|
|
2813
|
-
`,
|
|
2814
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2800
|
+
`, fo = `
|
|
2801
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2815
2802
|
<path
|
|
2816
2803
|
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"
|
|
2817
2804
|
stroke="currentColor"
|
|
2805
|
+
stroke-width="1.25"
|
|
2818
2806
|
stroke-linecap="round"
|
|
2819
2807
|
stroke-linejoin="round"
|
|
2820
2808
|
/>
|
|
2821
2809
|
</svg>
|
|
2822
|
-
`,
|
|
2823
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2810
|
+
`, go = `
|
|
2811
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2824
2812
|
<path
|
|
2825
2813
|
d="M6.5 10h6.6667M6.5 15V5m6.6667 10V5"
|
|
2826
2814
|
stroke="currentColor"
|
|
2815
|
+
stroke-width="1.25"
|
|
2827
2816
|
stroke-linecap="round"
|
|
2828
2817
|
stroke-linejoin="round"
|
|
2829
2818
|
/>
|
|
2830
2819
|
</svg>
|
|
2831
|
-
`,
|
|
2832
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2820
|
+
`, vo = `
|
|
2821
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2833
2822
|
<path
|
|
2834
2823
|
d="M14.5 7.28571V6h-9v1.28571M10 6v9m0 0H8.71429M10 15h1.2857"
|
|
2835
2824
|
stroke="currentColor"
|
|
2825
|
+
stroke-width="1.25"
|
|
2836
2826
|
stroke-linecap="round"
|
|
2837
2827
|
stroke-linejoin="round"
|
|
2838
2828
|
/>
|
|
2839
2829
|
</svg>
|
|
2840
|
-
`,
|
|
2841
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2830
|
+
`, mo = `
|
|
2831
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2832
|
+
<path d="M10 4 3 16h14Z" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2833
|
+
<path d="M10 8.5v3.5m0 2v.01" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2834
|
+
</svg>
|
|
2835
|
+
`, bo = `
|
|
2836
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2842
2837
|
<path
|
|
2843
|
-
d="
|
|
2838
|
+
d="M8 5h9M8 10h9M8 15h9M4 5h.01M4 10h.01M4 15h.01"
|
|
2844
2839
|
stroke="currentColor"
|
|
2845
|
-
stroke-width="1.
|
|
2840
|
+
stroke-width="1.25"
|
|
2846
2841
|
stroke-linecap="round"
|
|
2847
2842
|
stroke-linejoin="round"
|
|
2848
2843
|
/>
|
|
2849
|
-
<rect x="9.75" y="14.25" width=".5" height=".5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
|
|
2850
|
-
<rect x="9.75" y="8.25" width=".5" height="4.5" rx=".25" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
|
|
2851
2844
|
</svg>
|
|
2852
|
-
`,
|
|
2853
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2845
|
+
`, wo = `
|
|
2846
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2854
2847
|
<path
|
|
2855
|
-
d="M8 5h9M8 10h9M8
|
|
2848
|
+
d="M8 5h9M8 10h9M8 15h9M3.5 4.5l1-1v3M3.5 9.5a1 1 0 1 1 2 0c0 .75-2 1.25-2 2h2M3.5 13.5h1a.75.75 0 0 1 0 1.5.75.75 0 0 1 0 1.5h-1"
|
|
2856
2849
|
stroke="currentColor"
|
|
2850
|
+
stroke-width="1.25"
|
|
2857
2851
|
stroke-linecap="round"
|
|
2858
2852
|
stroke-linejoin="round"
|
|
2859
2853
|
/>
|
|
2860
2854
|
</svg>
|
|
2861
|
-
`,
|
|
2862
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2863
|
-
<path d="M7.90873 4.60317h9.61907M4.70238 6.20635V3L3.5 4.20238m1.60317 7.61512H3.5l1.52702-2.37514c.02625-.03721.04486-.07925.05477-.12369.0099-.04444.01091-.09039.00295-.13523-.04569-.2068-.20922-.57233-.78315-.57233-.80159 0-.80159.71261-.80159.71261v.17795m0 7.92693h.80159c.21259 0 .41648-.0845.56681-.2348.15032-.1503.23477-.3542.23477-.5668 0-.2126-.08445-.4165-.23477-.5668-.15033-.1503-.35422-.2348-.56681-.2348h-.4008l1.20238-1.6032H3.5m4.40873-4.0079h9.61907m-9.61907 5.6111h9.61907" stroke="#000" stroke-width=".841667" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2864
|
-
</svg>
|
|
2865
|
-
`, bo = `
|
|
2866
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2855
|
+
`, ko = `
|
|
2856
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2867
2857
|
<path
|
|
2868
2858
|
d="M10 5h7M10 10h7M10 15h7M3 5l1 1 2-2M3 10l1 1 2-2M3 15l1 1 2-2"
|
|
2869
2859
|
stroke="currentColor"
|
|
2860
|
+
stroke-width="1.25"
|
|
2870
2861
|
stroke-linecap="round"
|
|
2871
2862
|
stroke-linejoin="round"
|
|
2872
2863
|
/>
|
|
2873
2864
|
</svg>
|
|
2874
|
-
`, wo = `
|
|
2875
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2876
|
-
<path d="M3 4h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z" stroke="currentColor" stroke-width="1.25"/>
|
|
2877
|
-
<path d="M2 8h16M2 12h16M7 4v12M13 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2878
|
-
</svg>
|
|
2879
|
-
`, ko = `
|
|
2880
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2881
|
-
<path d="M10 3v6m-3-3h6M4 13h12" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2882
|
-
</svg>
|
|
2883
2865
|
`, Co = `
|
|
2884
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2885
|
-
<
|
|
2866
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2867
|
+
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2868
|
+
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2886
2869
|
</svg>
|
|
2887
2870
|
`, yo = `
|
|
2888
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2889
|
-
<path d="
|
|
2871
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2872
|
+
<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
|
+
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2874
|
+
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2890
2875
|
</svg>
|
|
2891
2876
|
`, Eo = `
|
|
2892
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2893
|
-
<path d="
|
|
2877
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2878
|
+
<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
|
+
<rect x="3" y="4" width="14" height="12" rx="1.5" stroke="currentColor" stroke-width="1.25"/>
|
|
2880
|
+
<path d="M3 8h14M3 12h14M7.5 4v12M12.5 4v12" stroke="currentColor" stroke-width="1.25"/>
|
|
2894
2881
|
</svg>
|
|
2895
2882
|
`, To = `
|
|
2896
|
-
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2897
|
-
<path d="
|
|
2883
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2884
|
+
<path d="M10 4l-3 3m3-3l3 3M10 4v7M5 16h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2898
2885
|
</svg>
|
|
2899
|
-
`,
|
|
2886
|
+
`, Io = `
|
|
2887
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2888
|
+
<path d="M10 16l-3-3m3 3l3-3M10 16V9M5 4h10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2889
|
+
</svg>
|
|
2890
|
+
`, xo = `
|
|
2891
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2892
|
+
<path d="M4 10l3-3M4 10l3 3M4 10h7M16 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2893
|
+
</svg>
|
|
2894
|
+
`, Ao = `
|
|
2895
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2896
|
+
<path d="M16 10l-3-3m3 3l-3 3M16 10H9M4 5v10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2897
|
+
</svg>
|
|
2898
|
+
`, So = `
|
|
2899
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2900
|
+
<path d="M4.5 6.5h11" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2901
|
+
<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
|
+
<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
|
+
<path d="M8.5 9.5v3.5M11.5 9.5v3.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>
|
|
2904
|
+
</svg>
|
|
2905
|
+
`, P = {
|
|
2900
2906
|
root: "",
|
|
2901
2907
|
alignedStart: "text-start",
|
|
2902
2908
|
alignedCenter: "text-center",
|
|
2903
2909
|
title: "",
|
|
2904
2910
|
description: "opacity-60 mt-[3px]"
|
|
2905
2911
|
};
|
|
2906
|
-
class
|
|
2912
|
+
class Ce {
|
|
2907
2913
|
/**
|
|
2908
2914
|
* Constructs the hint content instance
|
|
2909
2915
|
* @param params - hint content parameters
|
|
@@ -2911,9 +2917,9 @@ class we {
|
|
|
2911
2917
|
constructor(t) {
|
|
2912
2918
|
const e = t.alignment === "center" ? "center" : "start";
|
|
2913
2919
|
this.nodes = {
|
|
2914
|
-
root: f.make("div", [
|
|
2915
|
-
title: f.make("div",
|
|
2916
|
-
}, this.nodes.root.setAttribute("data-alignment", e), this.nodes.root.appendChild(this.nodes.title), t.description !== void 0 && (this.nodes.description = f.make("div",
|
|
2920
|
+
root: f.make("div", [P.root, e === "center" ? P.alignedCenter : P.alignedStart]),
|
|
2921
|
+
title: f.make("div", P.title, { textContent: t.title })
|
|
2922
|
+
}, this.nodes.root.setAttribute("data-alignment", e), this.nodes.root.appendChild(this.nodes.title), t.description !== void 0 && (this.nodes.description = f.make("div", P.description, { textContent: t.description }), this.nodes.root.appendChild(this.nodes.description));
|
|
2917
2923
|
}
|
|
2918
2924
|
/**
|
|
2919
2925
|
* Returns the root element of the hint content
|
|
@@ -2922,7 +2928,7 @@ class we {
|
|
|
2922
2928
|
return this.nodes.root;
|
|
2923
2929
|
}
|
|
2924
2930
|
}
|
|
2925
|
-
class
|
|
2931
|
+
class ut {
|
|
2926
2932
|
/**
|
|
2927
2933
|
* Constructs the instance
|
|
2928
2934
|
* @param params - instance parameters
|
|
@@ -2941,7 +2947,7 @@ class ht {
|
|
|
2941
2947
|
* Destroys the instance
|
|
2942
2948
|
*/
|
|
2943
2949
|
destroy() {
|
|
2944
|
-
|
|
2950
|
+
me();
|
|
2945
2951
|
}
|
|
2946
2952
|
/**
|
|
2947
2953
|
* Called when children popover is opened (if exists)
|
|
@@ -2970,8 +2976,8 @@ class ht {
|
|
|
2970
2976
|
* @param hintData - hint data
|
|
2971
2977
|
*/
|
|
2972
2978
|
addHint(t, e) {
|
|
2973
|
-
const o = new
|
|
2974
|
-
|
|
2979
|
+
const o = new Ce(e);
|
|
2980
|
+
be(t, o.getElement(), {
|
|
2975
2981
|
placement: e.position
|
|
2976
2982
|
});
|
|
2977
2983
|
}
|
|
@@ -3043,7 +3049,7 @@ class ht {
|
|
|
3043
3049
|
return this.params === void 0 || !("isActive" in this.params) ? !1 : typeof this.params.isActive == "function" ? this.params.isActive() : this.params.isActive === !0;
|
|
3044
3050
|
}
|
|
3045
3051
|
}
|
|
3046
|
-
const
|
|
3052
|
+
const $ = {
|
|
3047
3053
|
/**
|
|
3048
3054
|
* Base item styles with hover, focus, and active support
|
|
3049
3055
|
* Hover is applied via can-hover:hover: for real hover and data-blok-force-hover for tests
|
|
@@ -3052,7 +3058,7 @@ const P = {
|
|
|
3052
3058
|
* Note: noHover state is handled via [data-blok-popover-item-no-hover] which disables hover
|
|
3053
3059
|
* Priority order: active < hover < focus (focus wins when navigating with keyboard)
|
|
3054
3060
|
*/
|
|
3055
|
-
item: 'flex items-center select-none border-none bg-transparent rounded-md
|
|
3061
|
+
item: 'flex items-center select-none border-none bg-transparent rounded-md px-2 py-[var(--item-padding)] text-text-primary mb-px [&[data-blok-popover-item-active]]:bg-icon-active-bg [&[data-blok-popover-item-active]]:text-icon-active-text can-hover:hover:cursor-pointer can-hover:hover:bg-item-hover-bg [&[data-blok-force-hover]]:cursor-pointer [&[data-blok-force-hover]]:bg-item-hover-bg [&[data-blok-focused="true"]]:bg-item-focus-bg [&[data-blok-popover-item-no-hover]]:hover:bg-transparent [&[data-blok-popover-item-no-hover]]:cursor-default can-hover:[&[data-blok-popover-item-destructive]]:hover:text-item-destructive-text can-hover:[&[data-blok-popover-item-destructive]]:hover:bg-item-destructive-hover-bg [&[data-blok-popover-item-destructive][data-blok-force-hover]]:text-item-destructive-text [&[data-blok-popover-item-destructive][data-blok-force-hover]]:bg-item-destructive-hover-bg [&[data-blok-popover-item-destructive][data-blok-focused="true"]]:text-item-destructive-text [&[data-blok-popover-item-destructive][data-blok-focused="true"]]:bg-item-destructive-hover-bg',
|
|
3056
3062
|
/**
|
|
3057
3063
|
* Item disabled state
|
|
3058
3064
|
*/
|
|
@@ -3066,18 +3072,18 @@ const P = {
|
|
|
3066
3072
|
* Used alongside data-blok-focused attribute.
|
|
3067
3073
|
*/
|
|
3068
3074
|
focused: "is-focused"
|
|
3069
|
-
},
|
|
3075
|
+
}, ye = {
|
|
3070
3076
|
/**
|
|
3071
3077
|
* Item in inline context - more compact styling
|
|
3072
3078
|
*/
|
|
3073
3079
|
item: "rounded p-1"
|
|
3074
|
-
},
|
|
3080
|
+
}, Ee = {
|
|
3075
3081
|
/**
|
|
3076
3082
|
* Nested item - back to desktop popover styling
|
|
3077
3083
|
*/
|
|
3078
3084
|
item: "rounded-md p-[3px] mobile:p-1"
|
|
3079
3085
|
};
|
|
3080
|
-
class
|
|
3086
|
+
class I extends ut {
|
|
3081
3087
|
/**
|
|
3082
3088
|
* Constructs popover item instance
|
|
3083
3089
|
* @param params - popover item construction params
|
|
@@ -3192,9 +3198,9 @@ class T extends ht {
|
|
|
3192
3198
|
createRootElement(t, e) {
|
|
3193
3199
|
var r, a, c, l;
|
|
3194
3200
|
const o = (r = e == null ? void 0 : e.wrapperTag) != null ? r : "div", s = document.createElement(o);
|
|
3195
|
-
return o === "button" && s.setAttribute("type", "button"), s.className = this.getContainerClass(), s.setAttribute(d.popoverItem, ""), s.setAttribute("data-blok-testid", "popover-item"), t.name && s.setAttribute("data-blok-item-name", t.name), t.dataset && Object.entries(t.dataset).forEach(([h,
|
|
3196
|
-
s.setAttribute(`data-${h}`,
|
|
3197
|
-
}), t.isDisabled && s.setAttribute(d.disabled, "true"), this.isActive && s.setAttribute(d.popoverItemActive, "true"), this.hasChildren && s.setAttribute(d.hasChildren, "true"), this.createContentElements(s, 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(s,
|
|
3201
|
+
return o === "button" && s.setAttribute("type", "button"), s.className = this.getContainerClass(), s.setAttribute(d.popoverItem, ""), s.setAttribute("data-blok-testid", "popover-item"), t.name && s.setAttribute("data-blok-item-name", t.name), t.dataset && Object.entries(t.dataset).forEach(([h, u]) => {
|
|
3202
|
+
s.setAttribute(`data-${h}`, u);
|
|
3203
|
+
}), t.isDisabled && s.setAttribute(d.disabled, "true"), "isDestructive" in t && t.isDestructive && s.setAttribute(d.popoverItemDestructive, "true"), this.isActive && s.setAttribute(d.popoverItemActive, "true"), this.hasChildren && s.setAttribute(d.hasChildren, "true"), this.createContentElements(s, 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(s, M(E({}, t.hint), {
|
|
3198
3204
|
position: ((c = e == null ? void 0 : e.hint) == null ? void 0 : c.position) || "right",
|
|
3199
3205
|
alignment: ((l = e == null ? void 0 : e.hint) == null ? void 0 : l.alignment) || "center"
|
|
3200
3206
|
})), s;
|
|
@@ -3203,19 +3209,19 @@ class T extends ht {
|
|
|
3203
3209
|
* Creates the content elements (icon, title, secondary label, chevron)
|
|
3204
3210
|
*/
|
|
3205
3211
|
createContentElements(t, e, o) {
|
|
3206
|
-
var l, h,
|
|
3207
|
-
const s = (l = o == null ? void 0 : o.iconWithGap) != null ? l : !0, i = (h = o == null ? void 0 : o.isInline) != null ? h : !1, r = (
|
|
3212
|
+
var l, h, u;
|
|
3213
|
+
const s = (l = o == null ? void 0 : o.iconWithGap) != null ? l : !0, i = (h = o == null ? void 0 : o.isInline) != null ? h : !1, r = (u = o == null ? void 0 : o.isNestedInline) != null ? u : !1, a = e.title;
|
|
3208
3214
|
if (e.icon && (this.nodes.icon = this.createIconElement(e.icon, s, i, r), t.appendChild(this.nodes.icon)), a !== void 0) {
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3215
|
+
const p = document.createElement("div");
|
|
3216
|
+
p.className = "mr-auto truncate text-sm font-medium leading-5", p.setAttribute(d.popoverItemTitle, ""), p.setAttribute("data-blok-testid", "popover-item-title"), p.textContent = a, t.appendChild(p), this.nodes.titleEl = p;
|
|
3211
3217
|
}
|
|
3212
3218
|
if (e.secondaryLabel) {
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3219
|
+
const p = document.createElement("div");
|
|
3220
|
+
p.className = "whitespace-nowrap pr-1.5 text-xs font-light tracking-[0.25px] text-text-secondary opacity-60", p.setAttribute(d.popoverItemSecondaryTitle, ""), p.setAttribute("data-blok-testid", "popover-item-secondary-title"), p.textContent = e.secondaryLabel, t.appendChild(p), this.nodes.secondaryLabelEl = p;
|
|
3215
3221
|
}
|
|
3216
3222
|
if (this.hasChildren && !this.isChevronHidden) {
|
|
3217
|
-
const
|
|
3218
|
-
|
|
3223
|
+
const p = document.createElement("div");
|
|
3224
|
+
p.className = this.getChevronClass(i), p.setAttribute(d.popoverItemIcon, ""), p.setAttribute(d.popoverItemIconChevronRight, ""), p.setAttribute("data-blok-testid", "popover-item-chevron-right"), p.innerHTML = we, t.appendChild(p), this.nodes.chevron = p;
|
|
3219
3225
|
}
|
|
3220
3226
|
}
|
|
3221
3227
|
/**
|
|
@@ -3231,22 +3237,24 @@ class T extends ht {
|
|
|
3231
3237
|
getContainerClass() {
|
|
3232
3238
|
var o, s, i, r;
|
|
3233
3239
|
const t = (s = (o = this.renderParams) == null ? void 0 : o.isInline) != null ? s : !1, e = (r = (i = this.renderParams) == null ? void 0 : i.isNestedInline) != null ? r : !1;
|
|
3234
|
-
return
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
e &&
|
|
3238
|
-
|
|
3240
|
+
return C(
|
|
3241
|
+
$.item,
|
|
3242
|
+
// Asymmetric padding for vertical popovers (better visual balance)
|
|
3243
|
+
!t && !e && "pl-2 pr-8",
|
|
3244
|
+
t && ye.item,
|
|
3245
|
+
e && Ee.item,
|
|
3246
|
+
this.params.isDisabled && $.itemDisabled
|
|
3239
3247
|
);
|
|
3240
3248
|
}
|
|
3241
3249
|
/**
|
|
3242
3250
|
* Gets the icon class based on context
|
|
3243
3251
|
*/
|
|
3244
3252
|
getIconClass(t, e, o, s) {
|
|
3245
|
-
return
|
|
3246
|
-
|
|
3253
|
+
return C(
|
|
3254
|
+
$.icon,
|
|
3247
3255
|
e && "w-auto h-auto [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",
|
|
3248
3256
|
o && "w-toolbox-btn h-toolbox-btn",
|
|
3249
|
-
t && "mr-
|
|
3257
|
+
t && "mr-3",
|
|
3250
3258
|
t && e && "shadow-none bg-transparent !mr-0",
|
|
3251
3259
|
t && o && "!mr-2",
|
|
3252
3260
|
s && "animate-wobble"
|
|
@@ -3256,8 +3264,8 @@ class T extends ht {
|
|
|
3256
3264
|
* Gets the chevron class based on context
|
|
3257
3265
|
*/
|
|
3258
3266
|
getChevronClass(t) {
|
|
3259
|
-
return
|
|
3260
|
-
|
|
3267
|
+
return C(
|
|
3268
|
+
$.icon,
|
|
3261
3269
|
t && "rotate-90"
|
|
3262
3270
|
);
|
|
3263
3271
|
}
|
|
@@ -3299,7 +3307,7 @@ class T extends ht {
|
|
|
3299
3307
|
enableConfirmationMode(t) {
|
|
3300
3308
|
if (this.nodes.root === null)
|
|
3301
3309
|
return;
|
|
3302
|
-
const e =
|
|
3310
|
+
const e = M(E(E({}, this.params), t), {
|
|
3303
3311
|
confirmation: "confirmation" in t ? t.confirmation : void 0
|
|
3304
3312
|
});
|
|
3305
3313
|
this.setConfirmation(e), this.confirmationState = t, this.enableSpecialHoverAndFocusBehavior();
|
|
@@ -3432,7 +3440,7 @@ const A = {
|
|
|
3432
3440
|
container: "py-1 px-[3px]",
|
|
3433
3441
|
containerHidden: "hidden",
|
|
3434
3442
|
line: "h-px w-full bg-popover-border"
|
|
3435
|
-
},
|
|
3443
|
+
}, U = {
|
|
3436
3444
|
// Inline context: horizontal separator
|
|
3437
3445
|
container: "px-1 py-0",
|
|
3438
3446
|
line: "h-full w-px",
|
|
@@ -3440,7 +3448,7 @@ const A = {
|
|
|
3440
3448
|
nestedContainer: "py-1 px-[3px]",
|
|
3441
3449
|
nestedLine: "w-full h-px"
|
|
3442
3450
|
};
|
|
3443
|
-
class
|
|
3451
|
+
class Mt extends ut {
|
|
3444
3452
|
/**
|
|
3445
3453
|
* Constructs the instance
|
|
3446
3454
|
* @param renderParams - optional render params for styling context
|
|
@@ -3470,13 +3478,13 @@ class Ot extends ht {
|
|
|
3470
3478
|
*/
|
|
3471
3479
|
getContainerClass(t) {
|
|
3472
3480
|
const e = A.container;
|
|
3473
|
-
return this.isNestedInline ?
|
|
3481
|
+
return this.isNestedInline ? C(e, U.nestedContainer, t && A.containerHidden) : this.isInline ? C(e, U.container, t && A.containerHidden) : C(e, t && A.containerHidden);
|
|
3474
3482
|
}
|
|
3475
3483
|
/**
|
|
3476
3484
|
* Build line class based on context
|
|
3477
3485
|
*/
|
|
3478
3486
|
getLineClass() {
|
|
3479
|
-
return this.isNestedInline ?
|
|
3487
|
+
return this.isNestedInline ? C(A.line, U.nestedLine) : this.isInline ? C(A.line, U.line) : A.line;
|
|
3480
3488
|
}
|
|
3481
3489
|
/**
|
|
3482
3490
|
* Creates the root container element
|
|
@@ -3488,13 +3496,13 @@ class Ot extends ht {
|
|
|
3488
3496
|
return e.className = this.getLineClass(), e.setAttribute(d.popoverItemSeparatorLine, ""), t.appendChild(e), this.nodes.line = e, t;
|
|
3489
3497
|
}
|
|
3490
3498
|
}
|
|
3491
|
-
const
|
|
3499
|
+
const at = {
|
|
3492
3500
|
root: "",
|
|
3493
3501
|
rootHidden: "hidden"
|
|
3494
|
-
},
|
|
3502
|
+
}, xt = {
|
|
3495
3503
|
root: "flex items-center"
|
|
3496
3504
|
};
|
|
3497
|
-
class
|
|
3505
|
+
class Z extends ut {
|
|
3498
3506
|
/**
|
|
3499
3507
|
* Constructs the instance
|
|
3500
3508
|
* @param params – instance parameters
|
|
@@ -3533,10 +3541,10 @@ class X extends ht {
|
|
|
3533
3541
|
* Updates the root element's class list based on current state
|
|
3534
3542
|
*/
|
|
3535
3543
|
updateRootClasses() {
|
|
3536
|
-
this.nodes.root && (this.nodes.root.className =
|
|
3537
|
-
|
|
3538
|
-
this.isInline &&
|
|
3539
|
-
this.isHidden &&
|
|
3544
|
+
this.nodes.root && (this.nodes.root.className = C(
|
|
3545
|
+
at.root,
|
|
3546
|
+
this.isInline && xt.root,
|
|
3547
|
+
this.isHidden && at.rootHidden
|
|
3540
3548
|
));
|
|
3541
3549
|
}
|
|
3542
3550
|
/**
|
|
@@ -3547,26 +3555,26 @@ class X extends ht {
|
|
|
3547
3555
|
createRootElement(t, e) {
|
|
3548
3556
|
var s, i, r;
|
|
3549
3557
|
const o = document.createElement("div");
|
|
3550
|
-
return o.className =
|
|
3551
|
-
|
|
3552
|
-
this.isInline &&
|
|
3553
|
-
), o.setAttribute(d.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 && ((s = e == null ? void 0 : e.hint) == null ? void 0 : s.enabled) !== !1 && this.addHint(o,
|
|
3558
|
+
return o.className = C(
|
|
3559
|
+
at.root,
|
|
3560
|
+
this.isInline && xt.root
|
|
3561
|
+
), o.setAttribute(d.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 && ((s = e == null ? void 0 : e.hint) == null ? void 0 : s.enabled) !== !1 && this.addHint(o, M(E({}, t.hint), {
|
|
3554
3562
|
position: ((i = e == null ? void 0 : e.hint) == null ? void 0 : i.position) || "right",
|
|
3555
3563
|
alignment: ((r = e == null ? void 0 : e.hint) == null ? void 0 : r.alignment) || "center"
|
|
3556
3564
|
})), o;
|
|
3557
3565
|
}
|
|
3558
3566
|
}
|
|
3559
|
-
const
|
|
3567
|
+
const lt = {
|
|
3560
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]",
|
|
3561
3569
|
icon: "w-toolbox-btn h-toolbox-btn flex items-center justify-center mr-2 [&_svg]:w-icon [&_svg]:h-icon [&_svg]:text-gray-text",
|
|
3562
3570
|
input: "text-sm outline-none font-medium font-inherit border-0 bg-transparent m-0 p-0 leading-[22px] min-w-[calc(100%-theme('spacing.6')-10px)] placeholder:text-gray-text placeholder:font-medium"
|
|
3563
|
-
},
|
|
3571
|
+
}, Ft = (n, t) => {
|
|
3564
3572
|
var r, a, c, l, h;
|
|
3565
3573
|
const e = t.toLowerCase(), o = (a = (r = n.title) == null ? void 0 : r.toLowerCase()) != null ? a : "", s = (l = (c = n.englishTitle) == null ? void 0 : c.toLowerCase()) != null ? l : "", i = (h = n.searchTerms) != null ? h : [];
|
|
3566
|
-
return o.includes(e) || s.includes(e) || i.some((
|
|
3574
|
+
return o.includes(e) || s.includes(e) || i.some((u) => u.toLowerCase().includes(e));
|
|
3567
3575
|
};
|
|
3568
|
-
var
|
|
3569
|
-
class
|
|
3576
|
+
var ft = /* @__PURE__ */ ((n) => (n.Search = "search", n))(ft || {});
|
|
3577
|
+
class Te extends Bt {
|
|
3570
3578
|
/**
|
|
3571
3579
|
* @param options - available config
|
|
3572
3580
|
* @param options.items - searchable items list
|
|
@@ -3575,11 +3583,11 @@ class ye extends Nt {
|
|
|
3575
3583
|
constructor({ items: t, placeholder: e }) {
|
|
3576
3584
|
super(), this.searchQuery = "", this.handleValueChange = () => {
|
|
3577
3585
|
this.applySearch(this.input.value);
|
|
3578
|
-
}, this.listeners = new
|
|
3579
|
-
const o = f.make("div",
|
|
3580
|
-
innerHTML:
|
|
3586
|
+
}, this.listeners = new Nt(), this.items = t, this.wrapper = f.make("div", lt.wrapper), this.wrapper.setAttribute("data-blok-testid", "popover-search-field");
|
|
3587
|
+
const o = f.make("div", lt.icon, {
|
|
3588
|
+
innerHTML: ke
|
|
3581
3589
|
});
|
|
3582
|
-
this.input = f.make("input",
|
|
3590
|
+
this.input = f.make("input", lt.input, {
|
|
3583
3591
|
type: "search",
|
|
3584
3592
|
placeholder: e,
|
|
3585
3593
|
/**
|
|
@@ -3615,7 +3623,7 @@ class ye extends Nt {
|
|
|
3615
3623
|
* @param query - search query to apply
|
|
3616
3624
|
*/
|
|
3617
3625
|
applySearch(t) {
|
|
3618
|
-
this.searchQuery !== t && (this.searchQuery = t, this.emit(
|
|
3626
|
+
this.searchQuery !== t && (this.searchQuery = t, this.emit(ft.Search, {
|
|
3619
3627
|
query: t,
|
|
3620
3628
|
items: this.foundItems
|
|
3621
3629
|
}));
|
|
@@ -3658,10 +3666,111 @@ class ye extends Nt {
|
|
|
3658
3666
|
* @param item - item to be checked
|
|
3659
3667
|
*/
|
|
3660
3668
|
checkItem(t) {
|
|
3661
|
-
return
|
|
3669
|
+
return Ft(t, this.searchQuery);
|
|
3662
3670
|
}
|
|
3663
3671
|
}
|
|
3664
|
-
const
|
|
3672
|
+
const k = class k {
|
|
3673
|
+
constructor() {
|
|
3674
|
+
this.stack = [], this.boundPointerDown = null;
|
|
3675
|
+
}
|
|
3676
|
+
/**
|
|
3677
|
+
* Returns the singleton instance, creating it if necessary
|
|
3678
|
+
*/
|
|
3679
|
+
static get instance() {
|
|
3680
|
+
return k._instance === null && (k._instance = new k()), k._instance;
|
|
3681
|
+
}
|
|
3682
|
+
/**
|
|
3683
|
+
* Resets the singleton for testing purposes.
|
|
3684
|
+
* Destroys the existing instance and creates a fresh one.
|
|
3685
|
+
*/
|
|
3686
|
+
static resetForTests() {
|
|
3687
|
+
var t;
|
|
3688
|
+
return (t = k._instance) == null || t.destroy(), k._instance = new k(), k._instance;
|
|
3689
|
+
}
|
|
3690
|
+
/**
|
|
3691
|
+
* Registers a popover with mutual exclusion.
|
|
3692
|
+
* Closes all existing popovers, then adds the new one to the stack.
|
|
3693
|
+
* @param popover - the popover instance to register
|
|
3694
|
+
* @param triggerElement - the element that triggered this popover
|
|
3695
|
+
*/
|
|
3696
|
+
register(t, e) {
|
|
3697
|
+
const o = [...this.stack];
|
|
3698
|
+
for (const s of o)
|
|
3699
|
+
s.popover !== t && (s.popover.hide(), this.removeFromStack(s.popover));
|
|
3700
|
+
this.stack.push({ popover: t, triggerElement: e }), this.ensureDocumentListener();
|
|
3701
|
+
}
|
|
3702
|
+
/**
|
|
3703
|
+
* Unregisters a popover, removing it from the stack.
|
|
3704
|
+
* Removes the document listener if the stack becomes empty.
|
|
3705
|
+
* @param popover - the popover instance to unregister
|
|
3706
|
+
*/
|
|
3707
|
+
unregister(t) {
|
|
3708
|
+
this.removeFromStack(t), this.stack.length === 0 && this.removeDocumentListener();
|
|
3709
|
+
}
|
|
3710
|
+
/**
|
|
3711
|
+
* Closes the topmost popover on the stack by calling hide().
|
|
3712
|
+
* @returns true if a popover was closed, false if the stack was empty
|
|
3713
|
+
*/
|
|
3714
|
+
closeTopmost() {
|
|
3715
|
+
return this.stack.length === 0 ? !1 : (this.stack[this.stack.length - 1].popover.hide(), !0);
|
|
3716
|
+
}
|
|
3717
|
+
/**
|
|
3718
|
+
* Checks whether any popovers are currently registered
|
|
3719
|
+
*/
|
|
3720
|
+
hasOpenPopovers() {
|
|
3721
|
+
return this.stack.length > 0;
|
|
3722
|
+
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Cleans up the registry: removes the document listener and clears the stack
|
|
3725
|
+
*/
|
|
3726
|
+
destroy() {
|
|
3727
|
+
this.removeDocumentListener(), this.stack = [];
|
|
3728
|
+
}
|
|
3729
|
+
/**
|
|
3730
|
+
* Handles pointerdown events on the document.
|
|
3731
|
+
* Walks the stack in reverse (topmost first). For each entry:
|
|
3732
|
+
* - If the click target is inside the popover, stop (click is inside).
|
|
3733
|
+
* - If the click target is inside the trigger element, stop (click is on trigger).
|
|
3734
|
+
* - Otherwise, close the popover by calling hide().
|
|
3735
|
+
* @param event - the pointerdown event
|
|
3736
|
+
*/
|
|
3737
|
+
handleDocumentPointerDown(t) {
|
|
3738
|
+
const e = t.target;
|
|
3739
|
+
if (!(e instanceof Node))
|
|
3740
|
+
return;
|
|
3741
|
+
const o = [];
|
|
3742
|
+
for (const s of [...this.stack].reverse()) {
|
|
3743
|
+
if (s.popover.hasNode(e) || s.triggerElement.contains(e))
|
|
3744
|
+
break;
|
|
3745
|
+
o.push(s);
|
|
3746
|
+
}
|
|
3747
|
+
for (const s of o)
|
|
3748
|
+
s.popover.hide();
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Lazily adds the pointerdown listener to the document when there are entries in the stack
|
|
3752
|
+
*/
|
|
3753
|
+
ensureDocumentListener() {
|
|
3754
|
+
this.boundPointerDown === null && (this.boundPointerDown = (t) => this.handleDocumentPointerDown(t), document.addEventListener("pointerdown", this.boundPointerDown));
|
|
3755
|
+
}
|
|
3756
|
+
/**
|
|
3757
|
+
* Removes the pointerdown listener from the document
|
|
3758
|
+
*/
|
|
3759
|
+
removeDocumentListener() {
|
|
3760
|
+
this.boundPointerDown !== null && (document.removeEventListener("pointerdown", this.boundPointerDown), this.boundPointerDown = null);
|
|
3761
|
+
}
|
|
3762
|
+
/**
|
|
3763
|
+
* Removes a popover from the stack by reference
|
|
3764
|
+
* @param popover - popover to remove
|
|
3765
|
+
*/
|
|
3766
|
+
removeFromStack(t) {
|
|
3767
|
+
const e = this.stack.findIndex((o) => o.popover === t);
|
|
3768
|
+
e !== -1 && this.stack.splice(e, 1);
|
|
3769
|
+
}
|
|
3770
|
+
};
|
|
3771
|
+
k._instance = null;
|
|
3772
|
+
let Q = k;
|
|
3773
|
+
const K = {
|
|
3665
3774
|
// Popover container - base styles
|
|
3666
3775
|
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-[var(--width)] w-[var(--width)] rounded-lg shadow-[0_3px_15px_-3px_theme(colors.popover-shadow)] left-[var(--popover-left)] top-[var(--popover-top)] bg-popover-bg",
|
|
3667
3776
|
// Popover container - mobile styles (applied conditionally)
|
|
@@ -3672,14 +3781,14 @@ const U = {
|
|
|
3672
3781
|
// Popover overlay
|
|
3673
3782
|
popoverOverlay: "hidden bg-dark",
|
|
3674
3783
|
items: "overflow-y-auto overscroll-contain"
|
|
3675
|
-
},
|
|
3784
|
+
}, Lo = {
|
|
3676
3785
|
// Popover root element for inline
|
|
3677
3786
|
popover: "relative",
|
|
3678
3787
|
// Container for inline popover
|
|
3679
3788
|
popoverContainer: "flex-row top-0 min-w-max w-max p-1 mobile:absolute"
|
|
3680
|
-
},
|
|
3681
|
-
var
|
|
3682
|
-
class
|
|
3789
|
+
}, No = (n) => `level-${n}`;
|
|
3790
|
+
var T = /* @__PURE__ */ ((n) => (n.NestingLevel = "--nesting-level", n.PopoverHeight = "--popover-height", n.InlinePopoverWidth = "--inline-popover-width", n.PopoverTop = "--popover-top", n.PopoverLeft = "--popover-left", n.TriggerItemLeft = "--trigger-item-left", n.TriggerItemTop = "--trigger-item-top", n))(T || {}), W = /* @__PURE__ */ ((n) => (n.Closed = "closed", n.ClosedOnActivate = "closed-on-activate", n))(W || {});
|
|
3791
|
+
class Ie extends Bt {
|
|
3683
3792
|
/**
|
|
3684
3793
|
* Constructs the instance
|
|
3685
3794
|
* @param params - popover construction params
|
|
@@ -3687,16 +3796,16 @@ class Ee extends Nt {
|
|
|
3687
3796
|
* The parameters that are not set by user via popover api but rather depend on technical implementation
|
|
3688
3797
|
*/
|
|
3689
3798
|
constructor(t, e = {}) {
|
|
3690
|
-
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new
|
|
3799
|
+
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new Nt(), this.messages = {
|
|
3691
3800
|
nothingFound: "Nothing found",
|
|
3692
3801
|
search: "Search"
|
|
3693
|
-
}, this.items = this.buildItems(t.items), t.messages && (this.messages =
|
|
3802
|
+
}, this.items = this.buildItems(t.items), t.messages && (this.messages = E(E({}, this.messages), t.messages)), this.nodes = this.createPopoverDOM(), this.appendItemElements(), this.nodes.popoverContainer && this.listeners.on(this.nodes.popoverContainer, "click", (o) => this.handleClick(o));
|
|
3694
3803
|
}
|
|
3695
3804
|
/**
|
|
3696
3805
|
* List of default popover items that are searchable and may have confirmation state
|
|
3697
3806
|
*/
|
|
3698
3807
|
get itemsDefault() {
|
|
3699
|
-
return this.items.filter((t) => t instanceof
|
|
3808
|
+
return this.items.filter((t) => t instanceof I);
|
|
3700
3809
|
}
|
|
3701
3810
|
/**
|
|
3702
3811
|
* Returns HTML element corresponding to the popover
|
|
@@ -3714,14 +3823,17 @@ class Ee extends Nt {
|
|
|
3714
3823
|
* Open popover
|
|
3715
3824
|
*/
|
|
3716
3825
|
show() {
|
|
3826
|
+
var s;
|
|
3717
3827
|
const t = this.nodes.popover;
|
|
3718
|
-
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(d.popoverOpened, "true"), this.nodes.popoverContainer.classList.add(...
|
|
3828
|
+
t !== null && !t.isConnected && document.body.appendChild(t), this.nodes.popover.setAttribute(d.popoverOpened, "true"), this.nodes.popoverContainer.classList.add(...K.popoverContainerOpened.split(" ")), this.itemsDefault.forEach((i) => this.refreshItemActiveState(i)), this.search !== void 0 && this.search.focus();
|
|
3829
|
+
const { trigger: e } = this.params;
|
|
3830
|
+
((s = this.params.nestingLevel) != null ? s : 0) === 0 && e !== void 0 && Q.instance.register(this, e);
|
|
3719
3831
|
}
|
|
3720
3832
|
/**
|
|
3721
3833
|
* Closes popover
|
|
3722
3834
|
*/
|
|
3723
3835
|
hide() {
|
|
3724
|
-
this.nodes.popover.removeAttribute(d.popoverOpened), this.nodes.popover.removeAttribute(d.popoverOpenTop), this.nodes.popover.removeAttribute(d.popoverOpenLeft), this.nodes.popoverContainer.classList.remove(...
|
|
3836
|
+
this.nodes.popover.removeAttribute(d.popoverOpened), this.nodes.popover.removeAttribute(d.popoverOpenTop), this.nodes.popover.removeAttribute(d.popoverOpenLeft), this.nodes.popoverContainer.classList.remove(...K.popoverContainerOpened.split(" ")), this.itemsDefault.forEach((t) => t.reset()), this.search !== void 0 && this.search.clear(), Q.instance.unregister(this), this.emit(W.Closed);
|
|
3725
3837
|
}
|
|
3726
3838
|
/**
|
|
3727
3839
|
* Clears memory
|
|
@@ -3760,13 +3872,13 @@ class Ee extends Nt {
|
|
|
3760
3872
|
buildItems(t) {
|
|
3761
3873
|
return t.map((e) => {
|
|
3762
3874
|
switch (e.type) {
|
|
3763
|
-
case
|
|
3764
|
-
return new
|
|
3765
|
-
case
|
|
3766
|
-
return new
|
|
3767
|
-
case
|
|
3875
|
+
case S.Separator:
|
|
3876
|
+
return new Mt(this.itemsRenderParams[S.Separator]);
|
|
3877
|
+
case S.Html:
|
|
3878
|
+
return new Z(e, this.itemsRenderParams[S.Html]);
|
|
3879
|
+
case S.Default:
|
|
3768
3880
|
case void 0:
|
|
3769
|
-
return new
|
|
3881
|
+
return new I(e, this.itemsRenderParams[S.Default]);
|
|
3770
3882
|
}
|
|
3771
3883
|
});
|
|
3772
3884
|
}
|
|
@@ -3775,7 +3887,7 @@ class Ee extends Nt {
|
|
|
3775
3887
|
* @param event - event to retrieve popover item from
|
|
3776
3888
|
*/
|
|
3777
3889
|
getTargetItem(t) {
|
|
3778
|
-
return this.items.filter((e) => e instanceof
|
|
3890
|
+
return this.items.filter((e) => e instanceof I || e instanceof Z).find((e) => {
|
|
3779
3891
|
const o = e.getElement();
|
|
3780
3892
|
return o === null ? !1 : t.composedPath().includes(o);
|
|
3781
3893
|
});
|
|
@@ -3785,7 +3897,7 @@ class Ee extends Nt {
|
|
|
3785
3897
|
* @param item - item to handle click of
|
|
3786
3898
|
*/
|
|
3787
3899
|
handleItemClick(t) {
|
|
3788
|
-
if (!(t instanceof
|
|
3900
|
+
if (!(t instanceof I && t.isDisabled)) {
|
|
3789
3901
|
if (t.hasChildren) {
|
|
3790
3902
|
this.showNestedItems(t), this.callHandleClickIfPresent(t);
|
|
3791
3903
|
return;
|
|
@@ -3809,7 +3921,7 @@ class Ee extends Nt {
|
|
|
3809
3921
|
* @param clickedItem - popover item that was clicked
|
|
3810
3922
|
*/
|
|
3811
3923
|
toggleItemActivenessIfNeeded(t) {
|
|
3812
|
-
if (!(t instanceof
|
|
3924
|
+
if (!(t instanceof I) || (t.toggle === !0 && t.toggleActive(), typeof t.toggle != "string"))
|
|
3813
3925
|
return;
|
|
3814
3926
|
const e = this.itemsDefault.filter((o) => o.toggle === t.toggle);
|
|
3815
3927
|
if (e.length === 1) {
|
|
@@ -3826,7 +3938,7 @@ class Ee extends Nt {
|
|
|
3826
3938
|
* @param item - popover item to refresh
|
|
3827
3939
|
*/
|
|
3828
3940
|
refreshItemActiveState(t) {
|
|
3829
|
-
t instanceof
|
|
3941
|
+
t instanceof I && t.toggle === void 0 && t.toggleActive(t.isActive);
|
|
3830
3942
|
}
|
|
3831
3943
|
/**
|
|
3832
3944
|
* Executes handleClick if it is present on item.
|
|
@@ -3870,16 +3982,16 @@ class Ee extends Nt {
|
|
|
3870
3982
|
createPopoverDOM() {
|
|
3871
3983
|
var i, r;
|
|
3872
3984
|
const t = document.createElement("div");
|
|
3873
|
-
this.params.class && (t.className = this.params.class), t.setAttribute(d.popover, ""), this.params.class && t.setAttribute("data-blok-popover-custom-class", this.params.class), t.setAttribute("data-blok-testid", "popover"), t.style.setProperty("--width", (i = this.params.width) != null ? i : "
|
|
3985
|
+
this.params.class && (t.className = this.params.class), t.setAttribute(d.popover, ""), this.params.class && t.setAttribute("data-blok-popover-custom-class", this.params.class), t.setAttribute("data-blok-testid", "popover"), t.style.setProperty("--width", (i = this.params.width) != null ? i : "auto"), t.style.setProperty("--item-padding", "3px"), t.style.setProperty("--item-height", "calc(1.25rem + 2 * var(--item-padding))"), t.style.setProperty("--popover-top", "calc(100% + 0.5rem)"), t.style.setProperty("--popover-left", "0"), t.style.setProperty("--nested-popover-overlap", "0.25rem");
|
|
3874
3986
|
const e = document.createElement("div");
|
|
3875
|
-
e.className =
|
|
3987
|
+
e.className = K.popoverContainer, e.setAttribute(d.popoverContainer, ""), e.setAttribute("data-blok-testid", "popover-container");
|
|
3876
3988
|
const o = document.createElement("div");
|
|
3877
|
-
o.className =
|
|
3989
|
+
o.className = C(
|
|
3878
3990
|
"cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text p-[3px]",
|
|
3879
3991
|
"hidden"
|
|
3880
3992
|
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (r = this.messages.nothingFound) != null ? r : "Nothing found";
|
|
3881
3993
|
const s = document.createElement("div");
|
|
3882
|
-
return s.className =
|
|
3994
|
+
return s.className = K.items, s.setAttribute(d.popoverItems, ""), s.setAttribute("data-blok-testid", "popover-items"), e.appendChild(o), e.appendChild(s), t.appendChild(e), {
|
|
3883
3995
|
popover: t,
|
|
3884
3996
|
popoverContainer: e,
|
|
3885
3997
|
nothingFoundMessage: o,
|
|
@@ -3897,7 +4009,7 @@ class Ee extends Nt {
|
|
|
3897
4009
|
});
|
|
3898
4010
|
}
|
|
3899
4011
|
}
|
|
3900
|
-
class
|
|
4012
|
+
class Ht extends Ie {
|
|
3901
4013
|
/**
|
|
3902
4014
|
* Construct the instance
|
|
3903
4015
|
* @param params - popover params
|
|
@@ -3915,18 +4027,18 @@ class Mt extends Ee {
|
|
|
3915
4027
|
}, this.onSearch = (i) => {
|
|
3916
4028
|
var h;
|
|
3917
4029
|
const r = i.query === "", a = i.items.length === 0, c = i.items;
|
|
3918
|
-
this.items.forEach((
|
|
3919
|
-
const
|
|
3920
|
-
|
|
4030
|
+
this.items.forEach((u) => {
|
|
4031
|
+
const p = u instanceof I, v = u instanceof Mt || u instanceof Z, b = p ? !c.includes(u) : v && (a || !r);
|
|
4032
|
+
u.toggleHidden(b);
|
|
3921
4033
|
}), this.toggleNothingFoundMessage(a);
|
|
3922
|
-
const l = r ? this.flippableElements : i.items.map((
|
|
4034
|
+
const l = r ? this.flippableElements : i.items.map((u) => u.getElement());
|
|
3923
4035
|
(h = this.flipper) != null && h.isActivated && (this.flipper.deactivate(), this.flipper.activate(l), l.length > 0 && this.flipper.focusItem(0, { skipNextTab: !0 }));
|
|
3924
4036
|
}, t.trigger && (this.trigger = t.trigger), t.nestingLevel !== void 0 && (this.nestingLevel = t.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.setAttribute(d.nested, "true"), t.scopeElement !== void 0 && (this.scopeElement = t.scopeElement), this.nodes.popoverContainer !== null && this.listeners.on(this.nodes.popoverContainer, "mouseover", (i) => this.handleHover(i)), t.searchable && this.addSearch(), t.flippable === !1)
|
|
3925
4037
|
return;
|
|
3926
4038
|
const o = t.flipper;
|
|
3927
|
-
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new
|
|
4039
|
+
o !== void 0 ? (o.deactivate(), o.removeOnFlip(this.onFlip), this.flipper = o) : this.flipper = new Y({
|
|
3928
4040
|
items: this.flippableElements,
|
|
3929
|
-
focusedItemClass:
|
|
4041
|
+
focusedItemClass: $.focused,
|
|
3930
4042
|
allowedKeys: [
|
|
3931
4043
|
g.TAB,
|
|
3932
4044
|
g.UP,
|
|
@@ -3965,9 +4077,9 @@ class Mt extends Ee {
|
|
|
3965
4077
|
const t = this.getMountElement();
|
|
3966
4078
|
if (this.trigger && t && document.body.appendChild(t), this.trigger) {
|
|
3967
4079
|
const { top: o, left: s } = this.calculatePosition();
|
|
3968
|
-
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${s}px`, this.nodes.popover.style.setProperty(
|
|
4080
|
+
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${s}px`, this.nodes.popover.style.setProperty(T.PopoverTop, "0px"), this.nodes.popover.style.setProperty(T.PopoverLeft, "0px");
|
|
3969
4081
|
}
|
|
3970
|
-
this.nodes.popover.style.setProperty(
|
|
4082
|
+
this.nodes.popover.style.setProperty(T.PopoverHeight, this.size.height + "px"), !this.trigger && !this.shouldOpenBottom && (this.setOpenTop(!0), this.nodes.popover.style.setProperty(T.PopoverTop, "calc(-1 * (0.5rem + var(--popover-height)))")), !this.trigger && !this.shouldOpenRight && (this.setOpenLeft(!0), this.nodes.popover.style.setProperty(T.PopoverLeft, "calc(-1 * var(--width) + 100%)")), super.show(), (e = this.flipper) == null || e.activate(this.flippableElements), requestAnimationFrame(() => {
|
|
3971
4083
|
this.focusInitialElement();
|
|
3972
4084
|
});
|
|
3973
4085
|
}
|
|
@@ -3984,19 +4096,32 @@ class Mt extends Ee {
|
|
|
3984
4096
|
}
|
|
3985
4097
|
(t = this.flipper) == null || t.focusItem(0, { skipNextTab: !0 });
|
|
3986
4098
|
}
|
|
4099
|
+
/**
|
|
4100
|
+
* Updates the popover position dynamically.
|
|
4101
|
+
* Used when the trigger position changes or when positioning at caret location.
|
|
4102
|
+
* @param position - new DOMRect position for the popover
|
|
4103
|
+
*/
|
|
4104
|
+
updatePosition(t) {
|
|
4105
|
+
if (this.params.position = t, this.nodes.popover.hasAttribute("data-blok-popover-opened")) {
|
|
4106
|
+
const { top: e, left: o } = this.calculatePosition();
|
|
4107
|
+
this.nodes.popover.style.top = `${e}px`, this.nodes.popover.style.left = `${o}px`;
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
3987
4110
|
/**
|
|
3988
4111
|
* Calculates position for the popover
|
|
3989
4112
|
*/
|
|
3990
4113
|
calculatePosition() {
|
|
3991
|
-
|
|
4114
|
+
var p, v;
|
|
4115
|
+
const t = (v = this.params.position) != null ? v : (p = this.trigger) == null ? void 0 : p.getBoundingClientRect();
|
|
4116
|
+
if (!t)
|
|
3992
4117
|
return {
|
|
3993
4118
|
top: 0,
|
|
3994
4119
|
left: 0
|
|
3995
4120
|
};
|
|
3996
|
-
const
|
|
4121
|
+
const e = this.size, o = window.innerWidth, s = window.innerHeight, i = 8, r = t.bottom + i + window.scrollY, c = t.bottom + i + e.height > s + window.scrollY && t.top - i - e.height > window.scrollY ? t.top - i - e.height + window.scrollY : r, l = t.left + window.scrollX, u = l + e.width > o + window.scrollX ? Math.max(0, t.right - e.width + window.scrollX) : l;
|
|
3997
4122
|
return {
|
|
3998
4123
|
top: c,
|
|
3999
|
-
left:
|
|
4124
|
+
left: u
|
|
4000
4125
|
};
|
|
4001
4126
|
}
|
|
4002
4127
|
/**
|
|
@@ -4036,7 +4161,7 @@ class Mt extends Ee {
|
|
|
4036
4161
|
*/
|
|
4037
4162
|
setTriggerItemPosition(t, e) {
|
|
4038
4163
|
const o = e.getElement(), s = (o ? o.offsetTop : 0) - this.scrollTop, i = this.offsetTop + s, r = t.querySelector(`[${d.popover}]`);
|
|
4039
|
-
(r instanceof HTMLElement ? r : t).style.setProperty(
|
|
4164
|
+
(r instanceof HTMLElement ? r : t).style.setProperty(T.TriggerItemTop, i + "px");
|
|
4040
4165
|
}
|
|
4041
4166
|
/**
|
|
4042
4167
|
* Destroys existing nested popover
|
|
@@ -4074,7 +4199,7 @@ class Mt extends Ee {
|
|
|
4074
4199
|
showNestedPopoverForItem(t) {
|
|
4075
4200
|
var i, r;
|
|
4076
4201
|
const e = (i = this.flipper) == null ? void 0 : i.getHandleContentEditableTargets();
|
|
4077
|
-
this.nestedPopover = new
|
|
4202
|
+
this.nestedPopover = new Ht({
|
|
4078
4203
|
searchable: t.isChildrenSearchable,
|
|
4079
4204
|
items: t.children,
|
|
4080
4205
|
nestingLevel: this.nestingLevel + 1,
|
|
@@ -4085,7 +4210,7 @@ class Mt extends Ee {
|
|
|
4085
4210
|
handleContentEditableNavigation: e
|
|
4086
4211
|
}), t.onChildrenOpen(), this.nestedPopover.on(W.ClosedOnActivate, this.hide);
|
|
4087
4212
|
const o = this.nestedPopover.getMountElement(), s = this.nestedPopover.getElement();
|
|
4088
|
-
return this.nodes.popover.appendChild(o), this.setTriggerItemPosition(o, t), s.style.setProperty(
|
|
4213
|
+
return this.nodes.popover.appendChild(o), this.setTriggerItemPosition(o, t), s.style.setProperty(T.NestingLevel, this.nestedPopover.nestingLevel.toString()), this.applyNestedPopoverPositioning(o), this.nestedPopover.show(), (r = this.flipper) == null || r.deactivate(), this.nestedPopover;
|
|
4089
4214
|
}
|
|
4090
4215
|
/**
|
|
4091
4216
|
* Applies positioning styles to nested popover container.
|
|
@@ -4099,7 +4224,7 @@ class Mt extends Ee {
|
|
|
4099
4224
|
const o = e, s = t.querySelector(`[${d.popover}]`), i = s instanceof HTMLElement ? s : t, r = this.nodes.popover.hasAttribute(d.popoverOpenTop), a = this.nodes.popover.hasAttribute(d.popoverOpenLeft);
|
|
4100
4225
|
o.style.position = "absolute";
|
|
4101
4226
|
const c = this.params.width === "auto" ? `${this.nodes.popoverContainer.offsetWidth}px` : "var(--width)";
|
|
4102
|
-
a ? i.style.setProperty(
|
|
4227
|
+
a ? i.style.setProperty(T.PopoverLeft, `calc(-1 * (var(--nesting-level) + 1) * ${c} + 100%)`) : i.style.setProperty(T.PopoverLeft, `calc(var(--nesting-level) * (${c} - var(--nested-popover-overlap)))`), r ? 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))";
|
|
4103
4228
|
}
|
|
4104
4229
|
/**
|
|
4105
4230
|
* Checks if popover should be opened bottom.
|
|
@@ -4152,11 +4277,11 @@ class Mt extends Ee {
|
|
|
4152
4277
|
* @returns array of HTML elements for keyboard navigation
|
|
4153
4278
|
*/
|
|
4154
4279
|
getFlippableElementsForItem(t) {
|
|
4155
|
-
if (t instanceof
|
|
4280
|
+
if (t instanceof Z) {
|
|
4156
4281
|
const o = t.getElement();
|
|
4157
4282
|
return o ? [o] : [];
|
|
4158
4283
|
}
|
|
4159
|
-
if (!(t instanceof
|
|
4284
|
+
if (!(t instanceof I))
|
|
4160
4285
|
return [];
|
|
4161
4286
|
if (t.isDisabled)
|
|
4162
4287
|
return [];
|
|
@@ -4167,10 +4292,10 @@ class Mt extends Ee {
|
|
|
4167
4292
|
* Adds search to the popover
|
|
4168
4293
|
*/
|
|
4169
4294
|
addSearch() {
|
|
4170
|
-
this.search = new
|
|
4295
|
+
this.search = new Te({
|
|
4171
4296
|
items: this.itemsDefault,
|
|
4172
4297
|
placeholder: this.messages.search
|
|
4173
|
-
}), this.search.on(
|
|
4298
|
+
}), this.search.on(ft.Search, this.onSearch);
|
|
4174
4299
|
const t = this.search.getElement();
|
|
4175
4300
|
t.classList.add("mb-1.5"), this.nodes.popoverContainer.insertBefore(t, this.nodes.popoverContainer.firstChild);
|
|
4176
4301
|
}
|
|
@@ -4180,14 +4305,25 @@ class Mt extends Ee {
|
|
|
4180
4305
|
* @param query - search query text
|
|
4181
4306
|
*/
|
|
4182
4307
|
filterItems(t) {
|
|
4183
|
-
const e = this.itemsDefault.filter((o) =>
|
|
4308
|
+
const e = this.itemsDefault.filter((o) => Ft(o, t));
|
|
4184
4309
|
this.onSearch({
|
|
4185
4310
|
query: t,
|
|
4186
4311
|
items: e
|
|
4187
4312
|
});
|
|
4188
4313
|
}
|
|
4189
4314
|
}
|
|
4190
|
-
const
|
|
4315
|
+
const Ro = function(n) {
|
|
4316
|
+
const t = f.make("div");
|
|
4317
|
+
return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "4px", n.forEach((e) => {
|
|
4318
|
+
const o = f.make("div"), s = e.indexOf(" ");
|
|
4319
|
+
if (s > 0) {
|
|
4320
|
+
const i = e.substring(0, s), r = e.substring(s), a = f.make("span", null, { textContent: i });
|
|
4321
|
+
a.style.color = "white", o.appendChild(a), o.appendChild(document.createTextNode(r));
|
|
4322
|
+
} else
|
|
4323
|
+
o.appendChild(document.createTextNode(e));
|
|
4324
|
+
t.appendChild(o);
|
|
4325
|
+
}), t;
|
|
4326
|
+
}, vt = class vt {
|
|
4191
4327
|
/**
|
|
4192
4328
|
* @param api - Blok API
|
|
4193
4329
|
*/
|
|
@@ -4201,31 +4337,31 @@ const ft = class ft {
|
|
|
4201
4337
|
* Returns tool's UI config
|
|
4202
4338
|
*/
|
|
4203
4339
|
async render() {
|
|
4204
|
-
const t =
|
|
4340
|
+
const t = Ot.get();
|
|
4205
4341
|
if (t === null)
|
|
4206
4342
|
return [];
|
|
4207
4343
|
const e = this.blocksAPI.getBlockByElement(t.anchorNode);
|
|
4208
4344
|
if (e === void 0)
|
|
4209
4345
|
return [];
|
|
4210
|
-
const o = this.toolsAPI.getBlockTools(), s = await
|
|
4346
|
+
const o = this.toolsAPI.getBlockTools(), s = await Rt(e, o);
|
|
4211
4347
|
if (s.length === 0)
|
|
4212
4348
|
return [];
|
|
4213
4349
|
const i = s.reduce((l, h) => {
|
|
4214
|
-
var
|
|
4215
|
-
return (
|
|
4216
|
-
var
|
|
4217
|
-
|
|
4218
|
-
icon:
|
|
4219
|
-
title:
|
|
4220
|
-
name: (
|
|
4350
|
+
var u;
|
|
4351
|
+
return (u = h.toolbox) == null || u.forEach((p) => {
|
|
4352
|
+
var v;
|
|
4353
|
+
p.title !== void 0 && l.push({
|
|
4354
|
+
icon: p.icon,
|
|
4355
|
+
title: yt(this.i18nInstance, p, h.name),
|
|
4356
|
+
name: (v = p.name) != null ? v : h.name,
|
|
4221
4357
|
closeOnActivate: !0,
|
|
4222
4358
|
onActivate: async () => {
|
|
4223
|
-
const b = await this.blocksAPI.convert(e.id, h.name,
|
|
4359
|
+
const b = await this.blocksAPI.convert(e.id, h.name, p.data);
|
|
4224
4360
|
this.caretAPI.setToBlock(b, "end");
|
|
4225
4361
|
}
|
|
4226
4362
|
});
|
|
4227
4363
|
}), l;
|
|
4228
|
-
}, []), r = await e.getActiveToolboxEntry(), a = r ?
|
|
4364
|
+
}, []), r = await e.getActiveToolboxEntry(), a = r ? yt(this.i18nInstance, r, e.name) : se(this.i18nInstance, e.name, qt(e.name)), c = !zt();
|
|
4229
4365
|
return {
|
|
4230
4366
|
name: "convert-to",
|
|
4231
4367
|
title: a,
|
|
@@ -4245,102 +4381,106 @@ const ft = class ft {
|
|
|
4245
4381
|
};
|
|
4246
4382
|
}
|
|
4247
4383
|
};
|
|
4248
|
-
|
|
4249
|
-
let
|
|
4384
|
+
vt.isInline = !0;
|
|
4385
|
+
let At = vt;
|
|
4250
4386
|
export {
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4387
|
+
no as $,
|
|
4388
|
+
Ae as A,
|
|
4389
|
+
qe as B,
|
|
4390
|
+
Fe as C,
|
|
4255
4391
|
d as D,
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4392
|
+
Bt as E,
|
|
4393
|
+
Y as F,
|
|
4394
|
+
Me as G,
|
|
4395
|
+
Wt as H,
|
|
4260
4396
|
Ze as I,
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4397
|
+
Ht as J,
|
|
4398
|
+
zt as K,
|
|
4399
|
+
Nt as L,
|
|
4400
|
+
$ as M,
|
|
4401
|
+
Lo as N,
|
|
4402
|
+
K as O,
|
|
4403
|
+
S as P,
|
|
4268
4404
|
W as Q,
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4405
|
+
I as R,
|
|
4406
|
+
Ot as S,
|
|
4407
|
+
Z as T,
|
|
4408
|
+
T as U,
|
|
4409
|
+
No as V,
|
|
4410
|
+
ao as W,
|
|
4411
|
+
Ie as X,
|
|
4412
|
+
_e as Y,
|
|
4413
|
+
Rt as Z,
|
|
4414
|
+
yt as _,
|
|
4279
4415
|
f as a,
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4416
|
+
So as a0,
|
|
4417
|
+
De as a1,
|
|
4418
|
+
It as a2,
|
|
4419
|
+
ro as a3,
|
|
4420
|
+
Ut as a4,
|
|
4421
|
+
Ro as a5,
|
|
4422
|
+
io as a6,
|
|
4423
|
+
se as a7,
|
|
4424
|
+
Ye as a8,
|
|
4425
|
+
mo as a9,
|
|
4426
|
+
To as aA,
|
|
4427
|
+
Io as aB,
|
|
4428
|
+
Eo as aC,
|
|
4429
|
+
yo as aD,
|
|
4430
|
+
Co as aE,
|
|
4431
|
+
eo as aF,
|
|
4432
|
+
oo as aG,
|
|
4433
|
+
so as aH,
|
|
4434
|
+
We as aI,
|
|
4435
|
+
Be as aa,
|
|
4436
|
+
At as ab,
|
|
4437
|
+
Q as ac,
|
|
4438
|
+
Oe as ad,
|
|
4439
|
+
ze as ae,
|
|
4440
|
+
Xe as af,
|
|
4441
|
+
Pe as ag,
|
|
4442
|
+
$e as ah,
|
|
4443
|
+
Se as ai,
|
|
4444
|
+
Vt as aj,
|
|
4445
|
+
Le as ak,
|
|
4446
|
+
Je as al,
|
|
4447
|
+
vo as am,
|
|
4448
|
+
go as an,
|
|
4309
4449
|
lo as ao,
|
|
4310
4450
|
co as ap,
|
|
4311
4451
|
ho as aq,
|
|
4312
4452
|
po as ar,
|
|
4313
|
-
|
|
4314
|
-
|
|
4453
|
+
uo as as,
|
|
4454
|
+
fo as at,
|
|
4315
4455
|
bo as au,
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4456
|
+
wo as av,
|
|
4457
|
+
ko as aw,
|
|
4458
|
+
to as ax,
|
|
4459
|
+
xo as ay,
|
|
4460
|
+
Ao as az,
|
|
4461
|
+
J as b,
|
|
4462
|
+
Ue as c,
|
|
4463
|
+
ne as d,
|
|
4464
|
+
oe as e,
|
|
4465
|
+
qt as f,
|
|
4466
|
+
Ge as g,
|
|
4467
|
+
Ne as h,
|
|
4468
|
+
ht as i,
|
|
4469
|
+
X as j,
|
|
4470
|
+
je as k,
|
|
4471
|
+
q as l,
|
|
4472
|
+
j as m,
|
|
4473
|
+
Re as n,
|
|
4474
|
+
me as o,
|
|
4475
|
+
be as p,
|
|
4476
|
+
ee as q,
|
|
4337
4477
|
g as r,
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4478
|
+
Qe as s,
|
|
4479
|
+
C as t,
|
|
4480
|
+
He as u,
|
|
4481
|
+
Ve as v,
|
|
4482
|
+
_t as w,
|
|
4483
|
+
Et as x,
|
|
4484
|
+
Ke as y,
|
|
4485
|
+
z
|
|
4346
4486
|
};
|