@jackuait/blok 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -17
- package/codemod/README.md +16 -0
- package/codemod/migrate-editorjs-to-blok.js +859 -92
- package/codemod/test.js +682 -77
- package/dist/blok.mjs +5 -2
- package/dist/chunks/blok-BjgH1REI.mjs +12838 -0
- package/dist/chunks/i18next-CugVlwWp.mjs +1292 -0
- package/dist/chunks/i18next-loader-DfiUa_gd.mjs +43 -0
- package/dist/{index-CBkApZKo.mjs → chunks/index-5m5JWNey.mjs} +2 -2
- package/dist/chunks/inline-tool-convert-Bx5BVd8I.mjs +1988 -0
- package/dist/chunks/messages-2434tVOK.mjs +47 -0
- package/dist/chunks/messages-3DcCwXMF.mjs +47 -0
- package/dist/chunks/messages-4kMwVAKY.mjs +47 -0
- package/dist/chunks/messages-57uL5htT.mjs +47 -0
- package/dist/chunks/messages-76-iJV9Q.mjs +47 -0
- package/dist/chunks/messages-8p86Eyf2.mjs +47 -0
- package/dist/chunks/messages-BBX0p0Pi.mjs +47 -0
- package/dist/chunks/messages-BCm2eudQ.mjs +47 -0
- package/dist/chunks/messages-BFiUomgG.mjs +47 -0
- package/dist/chunks/messages-BIPNHHAV.mjs +47 -0
- package/dist/chunks/messages-BUlwu9mo.mjs +47 -0
- package/dist/chunks/messages-BX-DPa-z.mjs +47 -0
- package/dist/chunks/messages-BextV3Qh.mjs +47 -0
- package/dist/chunks/messages-BiPSFlUG.mjs +47 -0
- package/dist/chunks/messages-BiXe9G-O.mjs +47 -0
- package/dist/chunks/messages-Bl5z_Igo.mjs +47 -0
- package/dist/chunks/messages-BnsE97ku.mjs +47 -0
- package/dist/chunks/messages-BoO8gsVD.mjs +47 -0
- package/dist/chunks/messages-BqWaOGMn.mjs +47 -0
- package/dist/chunks/messages-BqkL2_Ro.mjs +47 -0
- package/dist/chunks/messages-BvCkXKX-.mjs +47 -0
- package/dist/chunks/messages-C6tbPLoj.mjs +47 -0
- package/dist/chunks/messages-CA6T3-gQ.mjs +47 -0
- package/dist/chunks/messages-CFFPFdWP.mjs +47 -0
- package/dist/chunks/messages-CFrKE-TN.mjs +47 -0
- package/dist/chunks/messages-CHz8VlG-.mjs +47 -0
- package/dist/chunks/messages-CLixzySl.mjs +47 -0
- package/dist/chunks/messages-CV7OM_qk.mjs +47 -0
- package/dist/chunks/messages-CXHt3eCC.mjs +47 -0
- package/dist/chunks/messages-CbmsBrB0.mjs +47 -0
- package/dist/chunks/messages-Ceo1KtFx.mjs +47 -0
- package/dist/chunks/messages-Cm0LJLtB.mjs +47 -0
- package/dist/chunks/messages-CmymP_Ar.mjs +47 -0
- package/dist/chunks/messages-D0ohMB5H.mjs +47 -0
- package/dist/chunks/messages-D3GrDwXh.mjs +47 -0
- package/dist/chunks/messages-D3vTzIpL.mjs +47 -0
- package/dist/chunks/messages-D5WeksbV.mjs +47 -0
- package/dist/chunks/messages-DGaab4EP.mjs +47 -0
- package/dist/chunks/messages-DKha57ZU.mjs +47 -0
- package/dist/chunks/messages-DOaujgMW.mjs +47 -0
- package/dist/chunks/messages-DVbPLd_0.mjs +47 -0
- package/dist/chunks/messages-D_FCyfW6.mjs +47 -0
- package/dist/chunks/messages-Dd5iZN3c.mjs +47 -0
- package/dist/chunks/messages-DehM7135.mjs +47 -0
- package/dist/chunks/messages-Dg1OHftD.mjs +47 -0
- package/dist/chunks/messages-Di6Flq-b.mjs +47 -0
- package/dist/chunks/messages-Dqhhex6e.mjs +47 -0
- package/dist/chunks/messages-DueVe0F1.mjs +47 -0
- package/dist/chunks/messages-Dx3eFwI0.mjs +47 -0
- package/dist/chunks/messages-FOtiUoKl.mjs +47 -0
- package/dist/chunks/messages-FTOZNhRD.mjs +47 -0
- package/dist/chunks/messages-IQxGfQIV.mjs +47 -0
- package/dist/chunks/messages-JF2fzCkK.mjs +47 -0
- package/dist/chunks/messages-MOGl7I5v.mjs +47 -0
- package/dist/chunks/messages-QgYhPL-3.mjs +47 -0
- package/dist/chunks/messages-WYWIbQwo.mjs +47 -0
- package/dist/chunks/messages-a6A_LgDv.mjs +47 -0
- package/dist/chunks/messages-bSf31LJi.mjs +47 -0
- package/dist/chunks/messages-diGozhTn.mjs +47 -0
- package/dist/chunks/messages-er-kd-VO.mjs +47 -0
- package/dist/chunks/messages-ez3w5NBn.mjs +47 -0
- package/dist/chunks/messages-f3uXjegd.mjs +47 -0
- package/dist/chunks/messages-ohwI1UGv.mjs +47 -0
- package/dist/chunks/messages-p9BZJaFV.mjs +47 -0
- package/dist/chunks/messages-qIQ4L4rw.mjs +47 -0
- package/dist/chunks/messages-qWkXPggi.mjs +47 -0
- package/dist/chunks/messages-w5foGze_.mjs +47 -0
- package/dist/full.mjs +50 -0
- package/dist/locales.mjs +227 -0
- package/dist/messages-2434tVOK.mjs +47 -0
- package/dist/messages-3DcCwXMF.mjs +47 -0
- package/dist/messages-4kMwVAKY.mjs +47 -0
- package/dist/messages-57uL5htT.mjs +47 -0
- package/dist/messages-76-iJV9Q.mjs +47 -0
- package/dist/messages-8p86Eyf2.mjs +47 -0
- package/dist/messages-BBX0p0Pi.mjs +47 -0
- package/dist/messages-BCm2eudQ.mjs +47 -0
- package/dist/messages-BFiUomgG.mjs +47 -0
- package/dist/messages-BIPNHHAV.mjs +47 -0
- package/dist/messages-BUlwu9mo.mjs +47 -0
- package/dist/messages-BX-DPa-z.mjs +47 -0
- package/dist/messages-BextV3Qh.mjs +47 -0
- package/dist/messages-BiPSFlUG.mjs +47 -0
- package/dist/messages-BiXe9G-O.mjs +47 -0
- package/dist/messages-Bl5z_Igo.mjs +47 -0
- package/dist/messages-BnsE97ku.mjs +47 -0
- package/dist/messages-BoO8gsVD.mjs +47 -0
- package/dist/messages-BqWaOGMn.mjs +47 -0
- package/dist/messages-BqkL2_Ro.mjs +47 -0
- package/dist/messages-BvCkXKX-.mjs +47 -0
- package/dist/messages-C6tbPLoj.mjs +47 -0
- package/dist/messages-CA6T3-gQ.mjs +47 -0
- package/dist/messages-CFFPFdWP.mjs +47 -0
- package/dist/messages-CFrKE-TN.mjs +47 -0
- package/dist/messages-CHz8VlG-.mjs +47 -0
- package/dist/messages-CLixzySl.mjs +47 -0
- package/dist/messages-CV7OM_qk.mjs +47 -0
- package/dist/messages-CXHt3eCC.mjs +47 -0
- package/dist/messages-CbmsBrB0.mjs +47 -0
- package/dist/messages-Ceo1KtFx.mjs +47 -0
- package/dist/messages-Cm0LJLtB.mjs +47 -0
- package/dist/messages-CmymP_Ar.mjs +47 -0
- package/dist/messages-D0ohMB5H.mjs +47 -0
- package/dist/messages-D3GrDwXh.mjs +47 -0
- package/dist/messages-D3vTzIpL.mjs +47 -0
- package/dist/messages-D5WeksbV.mjs +47 -0
- package/dist/messages-DGaab4EP.mjs +47 -0
- package/dist/messages-DKha57ZU.mjs +47 -0
- package/dist/messages-DOaujgMW.mjs +47 -0
- package/dist/messages-DVbPLd_0.mjs +47 -0
- package/dist/messages-D_FCyfW6.mjs +47 -0
- package/dist/messages-Dd5iZN3c.mjs +47 -0
- package/dist/messages-DehM7135.mjs +47 -0
- package/dist/messages-Dg1OHftD.mjs +47 -0
- package/dist/messages-Di6Flq-b.mjs +47 -0
- package/dist/messages-Dqhhex6e.mjs +47 -0
- package/dist/messages-DueVe0F1.mjs +47 -0
- package/dist/messages-Dx3eFwI0.mjs +47 -0
- package/dist/messages-FOtiUoKl.mjs +47 -0
- package/dist/messages-FTOZNhRD.mjs +47 -0
- package/dist/messages-IQxGfQIV.mjs +47 -0
- package/dist/messages-JF2fzCkK.mjs +47 -0
- package/dist/messages-MOGl7I5v.mjs +47 -0
- package/dist/messages-QgYhPL-3.mjs +47 -0
- package/dist/messages-WYWIbQwo.mjs +47 -0
- package/dist/messages-a6A_LgDv.mjs +47 -0
- package/dist/messages-bSf31LJi.mjs +47 -0
- package/dist/messages-diGozhTn.mjs +47 -0
- package/dist/messages-er-kd-VO.mjs +47 -0
- package/dist/messages-ez3w5NBn.mjs +47 -0
- package/dist/messages-f3uXjegd.mjs +47 -0
- package/dist/messages-ohwI1UGv.mjs +47 -0
- package/dist/messages-p9BZJaFV.mjs +47 -0
- package/dist/messages-qIQ4L4rw.mjs +47 -0
- package/dist/messages-qWkXPggi.mjs +47 -0
- package/dist/messages-w5foGze_.mjs +47 -0
- package/dist/tools.mjs +3073 -0
- package/dist/vendor.LICENSE.txt +59 -156
- package/package.json +47 -15
- package/src/blok.ts +267 -0
- package/src/components/__module.ts +139 -0
- package/src/components/block/api.ts +155 -0
- package/src/components/block/index.ts +1427 -0
- package/src/components/block-tunes/block-tune-delete.ts +51 -0
- package/src/components/blocks.ts +338 -0
- package/src/components/constants/data-attributes.ts +342 -0
- package/src/components/constants.ts +76 -0
- package/src/components/core.ts +392 -0
- package/src/components/dom.ts +773 -0
- package/src/components/domIterator.ts +189 -0
- package/src/components/errors/critical.ts +5 -0
- package/src/components/events/BlockChanged.ts +16 -0
- package/src/components/events/BlockHovered.ts +21 -0
- package/src/components/events/BlockSettingsClosed.ts +12 -0
- package/src/components/events/BlockSettingsOpened.ts +12 -0
- package/src/components/events/BlokMobileLayoutToggled.ts +15 -0
- package/src/components/events/FakeCursorAboutToBeToggled.ts +17 -0
- package/src/components/events/FakeCursorHaveBeenSet.ts +17 -0
- package/src/components/events/HistoryStateChanged.ts +19 -0
- package/src/components/events/RedactorDomChanged.ts +14 -0
- package/src/components/events/index.ts +46 -0
- package/src/components/flipper.ts +481 -0
- package/src/components/i18n/i18next-loader.ts +84 -0
- package/src/components/i18n/lightweight-i18n.ts +86 -0
- package/src/components/i18n/locales/TRANSLATION_GUIDELINES.md +113 -0
- package/src/components/i18n/locales/am/messages.json +44 -0
- package/src/components/i18n/locales/ar/messages.json +44 -0
- package/src/components/i18n/locales/az/messages.json +44 -0
- package/src/components/i18n/locales/bg/messages.json +44 -0
- package/src/components/i18n/locales/bn/messages.json +44 -0
- package/src/components/i18n/locales/bs/messages.json +44 -0
- package/src/components/i18n/locales/cs/messages.json +44 -0
- package/src/components/i18n/locales/da/messages.json +44 -0
- package/src/components/i18n/locales/de/messages.json +44 -0
- package/src/components/i18n/locales/dv/messages.json +44 -0
- package/src/components/i18n/locales/el/messages.json +44 -0
- package/src/components/i18n/locales/en/messages.json +44 -0
- package/src/components/i18n/locales/es/messages.json +44 -0
- package/src/components/i18n/locales/et/messages.json +44 -0
- package/src/components/i18n/locales/fa/messages.json +44 -0
- package/src/components/i18n/locales/fi/messages.json +44 -0
- package/src/components/i18n/locales/fil/messages.json +44 -0
- package/src/components/i18n/locales/fr/messages.json +44 -0
- package/src/components/i18n/locales/gu/messages.json +44 -0
- package/src/components/i18n/locales/he/messages.json +44 -0
- package/src/components/i18n/locales/hi/messages.json +44 -0
- package/src/components/i18n/locales/hr/messages.json +44 -0
- package/src/components/i18n/locales/hu/messages.json +44 -0
- package/src/components/i18n/locales/hy/messages.json +44 -0
- package/src/components/i18n/locales/id/messages.json +44 -0
- package/src/components/i18n/locales/index.ts +225 -0
- package/src/components/i18n/locales/it/messages.json +44 -0
- package/src/components/i18n/locales/ja/messages.json +44 -0
- package/src/components/i18n/locales/ka/messages.json +44 -0
- package/src/components/i18n/locales/km/messages.json +44 -0
- package/src/components/i18n/locales/kn/messages.json +44 -0
- package/src/components/i18n/locales/ko/messages.json +44 -0
- package/src/components/i18n/locales/ku/messages.json +44 -0
- package/src/components/i18n/locales/lo/messages.json +44 -0
- package/src/components/i18n/locales/lt/messages.json +44 -0
- package/src/components/i18n/locales/lv/messages.json +44 -0
- package/src/components/i18n/locales/mk/messages.json +44 -0
- package/src/components/i18n/locales/ml/messages.json +44 -0
- package/src/components/i18n/locales/mn/messages.json +44 -0
- package/src/components/i18n/locales/mr/messages.json +44 -0
- package/src/components/i18n/locales/ms/messages.json +44 -0
- package/src/components/i18n/locales/my/messages.json +44 -0
- package/src/components/i18n/locales/ne/messages.json +44 -0
- package/src/components/i18n/locales/nl/messages.json +44 -0
- package/src/components/i18n/locales/no/messages.json +44 -0
- package/src/components/i18n/locales/pa/messages.json +44 -0
- package/src/components/i18n/locales/pl/messages.json +44 -0
- package/src/components/i18n/locales/ps/messages.json +44 -0
- package/src/components/i18n/locales/pt/messages.json +44 -0
- package/src/components/i18n/locales/ro/messages.json +44 -0
- package/src/components/i18n/locales/ru/messages.json +44 -0
- package/src/components/i18n/locales/sd/messages.json +44 -0
- package/src/components/i18n/locales/si/messages.json +44 -0
- package/src/components/i18n/locales/sk/messages.json +44 -0
- package/src/components/i18n/locales/sl/messages.json +44 -0
- package/src/components/i18n/locales/sq/messages.json +44 -0
- package/src/components/i18n/locales/sr/messages.json +44 -0
- package/src/components/i18n/locales/sv/messages.json +44 -0
- package/src/components/i18n/locales/sw/messages.json +44 -0
- package/src/components/i18n/locales/ta/messages.json +44 -0
- package/src/components/i18n/locales/te/messages.json +44 -0
- package/src/components/i18n/locales/th/messages.json +44 -0
- package/src/components/i18n/locales/tr/messages.json +44 -0
- package/src/components/i18n/locales/ug/messages.json +44 -0
- package/src/components/i18n/locales/uk/messages.json +44 -0
- package/src/components/i18n/locales/ur/messages.json +44 -0
- package/src/components/i18n/locales/vi/messages.json +44 -0
- package/src/components/i18n/locales/yi/messages.json +44 -0
- package/src/components/i18n/locales/zh/messages.json +44 -0
- package/src/components/icons/index.ts +242 -0
- package/src/components/inline-tools/inline-tool-bold.ts +2213 -0
- package/src/components/inline-tools/inline-tool-convert.ts +141 -0
- package/src/components/inline-tools/inline-tool-italic.ts +500 -0
- package/src/components/inline-tools/inline-tool-link.ts +539 -0
- package/src/components/modules/api/blocks.ts +363 -0
- package/src/components/modules/api/caret.ts +125 -0
- package/src/components/modules/api/events.ts +51 -0
- package/src/components/modules/api/history.ts +73 -0
- package/src/components/modules/api/i18n.ts +33 -0
- package/src/components/modules/api/index.ts +39 -0
- package/src/components/modules/api/inlineToolbar.ts +33 -0
- package/src/components/modules/api/listeners.ts +56 -0
- package/src/components/modules/api/notifier.ts +46 -0
- package/src/components/modules/api/readonly.ts +39 -0
- package/src/components/modules/api/sanitizer.ts +30 -0
- package/src/components/modules/api/saver.ts +52 -0
- package/src/components/modules/api/selection.ts +48 -0
- package/src/components/modules/api/styles.ts +72 -0
- package/src/components/modules/api/toolbar.ts +79 -0
- package/src/components/modules/api/tools.ts +16 -0
- package/src/components/modules/api/tooltip.ts +67 -0
- package/src/components/modules/api/ui.ts +36 -0
- package/src/components/modules/blockEvents.ts +1375 -0
- package/src/components/modules/blockManager.ts +1348 -0
- package/src/components/modules/blockSelection.ts +708 -0
- package/src/components/modules/caret.ts +853 -0
- package/src/components/modules/crossBlockSelection.ts +329 -0
- package/src/components/modules/dragManager.ts +1141 -0
- package/src/components/modules/history.ts +1098 -0
- package/src/components/modules/i18n.ts +325 -0
- package/src/components/modules/index.ts +139 -0
- package/src/components/modules/modificationsObserver.ts +147 -0
- package/src/components/modules/paste.ts +1092 -0
- package/src/components/modules/readonly.ts +136 -0
- package/src/components/modules/rectangleSelection.ts +668 -0
- package/src/components/modules/renderer.ts +155 -0
- package/src/components/modules/saver.ts +283 -0
- package/src/components/modules/toolbar/blockSettings.ts +776 -0
- package/src/components/modules/toolbar/index.ts +1311 -0
- package/src/components/modules/toolbar/inline.ts +956 -0
- package/src/components/modules/tools.ts +589 -0
- package/src/components/modules/ui.ts +1179 -0
- package/src/components/polyfills.ts +113 -0
- package/src/components/selection.ts +1189 -0
- package/src/components/tools/base.ts +274 -0
- package/src/components/tools/block.ts +291 -0
- package/src/components/tools/collection.ts +67 -0
- package/src/components/tools/factory.ts +85 -0
- package/src/components/tools/inline.ts +71 -0
- package/src/components/tools/tune.ts +33 -0
- package/src/components/ui/toolbox.ts +497 -0
- package/src/components/utils/announcer.ts +205 -0
- package/src/components/utils/api.ts +20 -0
- package/src/components/utils/bem.ts +26 -0
- package/src/components/utils/blocks.ts +284 -0
- package/src/components/utils/caret.ts +1067 -0
- package/src/components/utils/data-model-transform.ts +382 -0
- package/src/components/utils/events.ts +117 -0
- package/src/components/utils/keyboard.ts +60 -0
- package/src/components/utils/listeners.ts +296 -0
- package/src/components/utils/mutations.ts +39 -0
- package/src/components/utils/notifier/draw.ts +190 -0
- package/src/components/utils/notifier/index.ts +66 -0
- package/src/components/utils/notifier/types.ts +1 -0
- package/src/components/utils/notifier.ts +77 -0
- package/src/components/utils/placeholder.ts +140 -0
- package/src/components/utils/popover/components/hint/hint.const.ts +10 -0
- package/src/components/utils/popover/components/hint/hint.ts +46 -0
- package/src/components/utils/popover/components/hint/index.ts +6 -0
- package/src/components/utils/popover/components/popover-header/index.ts +2 -0
- package/src/components/utils/popover/components/popover-header/popover-header.const.ts +8 -0
- package/src/components/utils/popover/components/popover-header/popover-header.ts +80 -0
- package/src/components/utils/popover/components/popover-header/popover-header.types.ts +14 -0
- package/src/components/utils/popover/components/popover-item/index.ts +13 -0
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.const.ts +50 -0
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +666 -0
- package/src/components/utils/popover/components/popover-item/popover-item-html/popover-item-html.const.ts +14 -0
- package/src/components/utils/popover/components/popover-item/popover-item-html/popover-item-html.ts +136 -0
- package/src/components/utils/popover/components/popover-item/popover-item-separator/popover-item-separator.const.ts +20 -0
- package/src/components/utils/popover/components/popover-item/popover-item-separator/popover-item-separator.ts +117 -0
- package/src/components/utils/popover/components/popover-item/popover-item.ts +187 -0
- package/src/components/utils/popover/components/search-input/index.ts +2 -0
- package/src/components/utils/popover/components/search-input/search-input.const.ts +8 -0
- package/src/components/utils/popover/components/search-input/search-input.ts +181 -0
- package/src/components/utils/popover/components/search-input/search-input.types.ts +30 -0
- package/src/components/utils/popover/index.ts +13 -0
- package/src/components/utils/popover/popover-abstract.ts +448 -0
- package/src/components/utils/popover/popover-desktop.ts +643 -0
- package/src/components/utils/popover/popover-inline.ts +338 -0
- package/src/components/utils/popover/popover-mobile.ts +201 -0
- package/src/components/utils/popover/popover.const.ts +81 -0
- package/src/components/utils/popover/utils/popover-states-history.ts +72 -0
- package/src/components/utils/promise-queue.ts +43 -0
- package/src/components/utils/sanitizer.ts +537 -0
- package/src/components/utils/scroll-locker.ts +87 -0
- package/src/components/utils/shortcut.ts +231 -0
- package/src/components/utils/shortcuts.ts +113 -0
- package/src/components/utils/tools.ts +105 -0
- package/src/components/utils/tooltip.ts +642 -0
- package/src/components/utils/tw.ts +241 -0
- package/src/components/utils.ts +1081 -0
- package/src/env.d.ts +13 -0
- package/src/full.ts +69 -0
- package/src/locales.ts +51 -0
- package/src/stories/Block.stories.ts +498 -0
- package/src/stories/EditorModes.stories.ts +505 -0
- package/src/stories/Header.stories.ts +137 -0
- package/src/stories/InlineToolbar.stories.ts +498 -0
- package/src/stories/List.stories.ts +259 -0
- package/src/stories/Notifier.stories.ts +340 -0
- package/src/stories/Paragraph.stories.ts +112 -0
- package/src/stories/Placeholder.stories.ts +319 -0
- package/src/stories/Popover.stories.ts +844 -0
- package/src/stories/Selection.stories.ts +250 -0
- package/src/stories/StubBlock.stories.ts +156 -0
- package/src/stories/Toolbar.stories.ts +223 -0
- package/src/stories/Toolbox.stories.ts +166 -0
- package/src/stories/Tooltip.stories.ts +198 -0
- package/src/stories/helpers.ts +463 -0
- package/src/styles/main.css +123 -0
- package/src/tools/header/index.ts +570 -0
- package/src/tools/index.ts +38 -0
- package/src/tools/list/index.ts +1803 -0
- package/src/tools/paragraph/index.ts +411 -0
- package/src/tools/stub/index.ts +107 -0
- package/src/types-internal/blok-modules.d.ts +87 -0
- package/src/types-internal/html-janitor.d.ts +28 -0
- package/src/types-internal/module-config.d.ts +11 -0
- package/src/variants/all-locales.ts +155 -0
- package/src/variants/blok-maximum.ts +20 -0
- package/src/variants/blok-minimum.ts +243 -0
- package/types/api/blocks.d.ts +1 -1
- package/types/api/i18n.d.ts +5 -3
- package/types/api/selection.d.ts +6 -0
- package/types/api/styles.d.ts +0 -5
- package/types/configs/blok-config.d.ts +21 -0
- package/types/configs/i18n-config.d.ts +52 -2
- package/types/configs/i18n-dictionary.d.ts +16 -90
- package/types/data-attributes.d.ts +169 -0
- package/types/data-formats/output-data.d.ts +15 -0
- package/types/full.d.ts +80 -0
- package/types/index.d.ts +9 -24
- package/types/locales.d.ts +59 -0
- package/types/tools/adapters/inline-tool-adapter.d.ts +10 -0
- package/types/tools/block-tool.d.ts +9 -0
- package/types/tools/list.d.ts +25 -18
- package/types/tools/tool-settings.d.ts +8 -1
- package/types/tools/tool.d.ts +6 -0
- package/types/tools-entry.d.ts +49 -0
- package/types/utils/popover/popover-item.d.ts +0 -5
- package/dist/blok-BwPfU8ro.mjs +0 -21510
- package/dist/blok.umd.js +0 -198
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/html-vite';
|
|
2
|
+
import { userEvent, waitFor, expect } from 'storybook/test';
|
|
3
|
+
import type { OutputData } from '@/types';
|
|
4
|
+
import { createEditorContainer, simulateClick, waitForToolbar, selectTextInBlock, waitForPointerEvents } from './helpers';
|
|
5
|
+
import type { EditorFactoryOptions } from './helpers';
|
|
6
|
+
import { Header } from '../tools/header';
|
|
7
|
+
|
|
8
|
+
interface InlineToolbarArgs extends EditorFactoryOptions {
|
|
9
|
+
minHeight: number;
|
|
10
|
+
data: OutputData | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Constants
|
|
14
|
+
const BLOCK_TESTID = '[data-blok-testid="block-wrapper"]';
|
|
15
|
+
const INLINE_TOOLBAR_TESTID = '[data-blok-testid="inline-toolbar"]';
|
|
16
|
+
const INLINE_TOOL_INPUT_TESTID = '[data-blok-testid="inline-tool-input"]';
|
|
17
|
+
const CONTENTEDITABLE_SELECTOR = '[contenteditable="true"]';
|
|
18
|
+
const LINK_TOOL_SELECTOR = '[data-blok-item-name="link"]';
|
|
19
|
+
const CONVERT_TO_SELECTOR = '[data-blok-item-name="convert-to"]';
|
|
20
|
+
const POPOVER_OPENED_SELECTOR = '[data-blok-popover-opened="true"]';
|
|
21
|
+
const NESTED_POPOVER_SELECTOR = '[data-blok-nested="true"]';
|
|
22
|
+
|
|
23
|
+
const TIMEOUT_INIT = { timeout: 5000 };
|
|
24
|
+
const TIMEOUT_ACTION = { timeout: 5000 };
|
|
25
|
+
|
|
26
|
+
const sampleData: OutputData = {
|
|
27
|
+
time: Date.now(),
|
|
28
|
+
version: '1.0.0',
|
|
29
|
+
blocks: [
|
|
30
|
+
{
|
|
31
|
+
id: 'inline-block-1',
|
|
32
|
+
type: 'paragraph',
|
|
33
|
+
data: { text: 'Select this text to see the inline toolbar appear with formatting options.' },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'inline-block-2',
|
|
37
|
+
type: 'paragraph',
|
|
38
|
+
data: { text: 'This paragraph has <strong>bold text</strong> and <em>italic text</em> already applied.' },
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'inline-block-3',
|
|
42
|
+
type: 'paragraph',
|
|
43
|
+
data: { text: 'This paragraph contains a <a href="https://example.com">link to example</a> website.' },
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const createEditor = (args: InlineToolbarArgs): HTMLElement => createEditorContainer(args);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Helper to select text within an element
|
|
52
|
+
*/
|
|
53
|
+
const selectText = (element: Element, start: number, end: number): void => {
|
|
54
|
+
const range = document.createRange();
|
|
55
|
+
const textNode = element.firstChild;
|
|
56
|
+
|
|
57
|
+
if (textNode && textNode.nodeType === Node.TEXT_NODE) {
|
|
58
|
+
range.setStart(textNode, start);
|
|
59
|
+
range.setEnd(textNode, end);
|
|
60
|
+
|
|
61
|
+
const selection = window.getSelection();
|
|
62
|
+
|
|
63
|
+
selection?.removeAllRanges();
|
|
64
|
+
selection?.addRange(range);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const meta: Meta<InlineToolbarArgs> = {
|
|
69
|
+
title: 'Components/Inline Toolbar',
|
|
70
|
+
tags: ['autodocs'],
|
|
71
|
+
args: {
|
|
72
|
+
minHeight: 300,
|
|
73
|
+
data: sampleData,
|
|
74
|
+
tools: {
|
|
75
|
+
header: Header,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
render: createEditor,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default meta;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
type Story = StoryObj<InlineToolbarArgs>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Default state: Inline toolbar is hidden until text is selected.
|
|
88
|
+
*/
|
|
89
|
+
export const Default: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
data: sampleData,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Inline toolbar visible after selecting text.
|
|
97
|
+
*/
|
|
98
|
+
export const WithTextSelection: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
data: sampleData,
|
|
101
|
+
},
|
|
102
|
+
play: async ({ canvasElement, step }) => {
|
|
103
|
+
await step('Wait for editor to initialize', async () => {
|
|
104
|
+
await waitFor(
|
|
105
|
+
() => {
|
|
106
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
107
|
+
|
|
108
|
+
expect(block).toBeInTheDocument();
|
|
109
|
+
},
|
|
110
|
+
TIMEOUT_INIT
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
await step('Select text to show inline toolbar', async () => {
|
|
115
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
116
|
+
const contentEditable = block?.querySelector(CONTENTEDITABLE_SELECTOR);
|
|
117
|
+
|
|
118
|
+
if (contentEditable) {
|
|
119
|
+
simulateClick(contentEditable);
|
|
120
|
+
selectText(contentEditable, 0, 11);
|
|
121
|
+
document.dispatchEvent(new Event('selectionchange'));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
await waitFor(
|
|
125
|
+
() => {
|
|
126
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
127
|
+
|
|
128
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
129
|
+
},
|
|
130
|
+
TIMEOUT_ACTION
|
|
131
|
+
);
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Bold tool active state when selected text is bold.
|
|
138
|
+
*/
|
|
139
|
+
export const BoldActive: Story = {
|
|
140
|
+
args: {
|
|
141
|
+
data: sampleData,
|
|
142
|
+
},
|
|
143
|
+
play: async ({ canvasElement, step }) => {
|
|
144
|
+
await step('Wait for editor to initialize', async () => {
|
|
145
|
+
await waitFor(
|
|
146
|
+
() => {
|
|
147
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
148
|
+
|
|
149
|
+
expect(blocks.length).toBeGreaterThan(1);
|
|
150
|
+
},
|
|
151
|
+
TIMEOUT_INIT
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
await step('Select bold text to show active state', async () => {
|
|
156
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
157
|
+
const secondBlock = blocks[1];
|
|
158
|
+
|
|
159
|
+
// Use 'strong' selector - browsers normalize <b> to <strong>
|
|
160
|
+
if (secondBlock) {
|
|
161
|
+
selectTextInBlock(secondBlock, 'strong');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
await waitFor(
|
|
165
|
+
() => {
|
|
166
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
167
|
+
|
|
168
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
169
|
+
|
|
170
|
+
// Verify bold tool shows active state
|
|
171
|
+
const boldTool = document.querySelector('[data-blok-item-name="bold"]');
|
|
172
|
+
|
|
173
|
+
expect(boldTool).toHaveAttribute('data-blok-popover-item-active', 'true');
|
|
174
|
+
},
|
|
175
|
+
TIMEOUT_ACTION
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Italic tool active state when selected text is italic.
|
|
183
|
+
*/
|
|
184
|
+
export const ItalicActive: Story = {
|
|
185
|
+
args: {
|
|
186
|
+
data: sampleData,
|
|
187
|
+
},
|
|
188
|
+
play: async ({ canvasElement, step }) => {
|
|
189
|
+
await step('Wait for editor to initialize', async () => {
|
|
190
|
+
await waitFor(
|
|
191
|
+
() => {
|
|
192
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
193
|
+
|
|
194
|
+
expect(blocks.length).toBeGreaterThan(1);
|
|
195
|
+
},
|
|
196
|
+
TIMEOUT_INIT
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
await step('Select italic text to show active state', async () => {
|
|
201
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
202
|
+
const secondBlock = blocks[1];
|
|
203
|
+
|
|
204
|
+
// Use 'em' selector - browsers normalize <i> to <em>
|
|
205
|
+
if (secondBlock) {
|
|
206
|
+
selectTextInBlock(secondBlock, 'em');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
await waitFor(
|
|
210
|
+
() => {
|
|
211
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
212
|
+
|
|
213
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
214
|
+
|
|
215
|
+
// Verify italic tool shows active state
|
|
216
|
+
const italicTool = document.querySelector('[data-blok-item-name="italic"]');
|
|
217
|
+
|
|
218
|
+
expect(italicTool).toHaveAttribute('data-blok-popover-item-active', 'true');
|
|
219
|
+
},
|
|
220
|
+
TIMEOUT_ACTION
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Link tool active state when cursor is in a link.
|
|
228
|
+
*/
|
|
229
|
+
export const LinkActive: Story = {
|
|
230
|
+
args: {
|
|
231
|
+
data: sampleData,
|
|
232
|
+
},
|
|
233
|
+
play: async ({ canvasElement, step }) => {
|
|
234
|
+
await step('Wait for editor to initialize', async () => {
|
|
235
|
+
await waitFor(
|
|
236
|
+
() => {
|
|
237
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
238
|
+
|
|
239
|
+
expect(blocks.length).toBeGreaterThan(2);
|
|
240
|
+
},
|
|
241
|
+
TIMEOUT_INIT
|
|
242
|
+
);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
await step('Select link text to show active/unlink state', async () => {
|
|
246
|
+
const blocks = canvasElement.querySelectorAll(BLOCK_TESTID);
|
|
247
|
+
const thirdBlock = blocks[2];
|
|
248
|
+
|
|
249
|
+
if (thirdBlock) {
|
|
250
|
+
selectTextInBlock(thirdBlock, 'a');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
await waitFor(
|
|
254
|
+
() => {
|
|
255
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
256
|
+
|
|
257
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
258
|
+
|
|
259
|
+
// Verify link tool shows active state
|
|
260
|
+
const linkTool = document.querySelector(LINK_TOOL_SELECTOR);
|
|
261
|
+
|
|
262
|
+
expect(linkTool).toHaveAttribute('data-blok-popover-item-active', 'true');
|
|
263
|
+
},
|
|
264
|
+
TIMEOUT_ACTION
|
|
265
|
+
);
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Link input field shown when clicking the link tool.
|
|
272
|
+
*/
|
|
273
|
+
export const LinkInputShown: Story = {
|
|
274
|
+
args: {
|
|
275
|
+
data: sampleData,
|
|
276
|
+
},
|
|
277
|
+
play: async ({ canvasElement, step }) => {
|
|
278
|
+
await step('Wait for editor and toolbar to initialize', async () => {
|
|
279
|
+
await waitFor(
|
|
280
|
+
() => {
|
|
281
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
282
|
+
|
|
283
|
+
expect(block).toBeInTheDocument();
|
|
284
|
+
},
|
|
285
|
+
TIMEOUT_INIT
|
|
286
|
+
);
|
|
287
|
+
// Wait for toolbar to be created (happens in requestIdleCallback)
|
|
288
|
+
await waitForToolbar(canvasElement);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
await step('Select text to show inline toolbar', async () => {
|
|
292
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
293
|
+
const contentEditable = block?.querySelector(CONTENTEDITABLE_SELECTOR);
|
|
294
|
+
|
|
295
|
+
if (contentEditable) {
|
|
296
|
+
// Focus the element first
|
|
297
|
+
simulateClick(contentEditable);
|
|
298
|
+
|
|
299
|
+
// Create a proper selection using the same pattern as other working tests
|
|
300
|
+
const range = document.createRange();
|
|
301
|
+
const textNode = contentEditable.firstChild;
|
|
302
|
+
|
|
303
|
+
if (textNode && textNode.nodeType === Node.TEXT_NODE) {
|
|
304
|
+
// Select "Select this" (11 characters)
|
|
305
|
+
range.setStart(textNode, 0);
|
|
306
|
+
range.setEnd(textNode, 11);
|
|
307
|
+
} else {
|
|
308
|
+
// Fallback: select all content
|
|
309
|
+
range.selectNodeContents(contentEditable);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const selection = window.getSelection();
|
|
313
|
+
|
|
314
|
+
selection?.removeAllRanges();
|
|
315
|
+
selection?.addRange(range);
|
|
316
|
+
|
|
317
|
+
// Focus the element to ensure selection is active
|
|
318
|
+
(contentEditable as HTMLElement).focus();
|
|
319
|
+
|
|
320
|
+
// Dispatch selectionchange event
|
|
321
|
+
document.dispatchEvent(new Event('selectionchange'));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Wait for the debounced selection handler (180ms) plus popover creation
|
|
325
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
326
|
+
|
|
327
|
+
await waitFor(
|
|
328
|
+
() => {
|
|
329
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
330
|
+
|
|
331
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
332
|
+
|
|
333
|
+
// Also verify the popover is populated
|
|
334
|
+
const popoverContainer = inlineToolbar?.querySelector('[data-blok-testid="popover-container"]');
|
|
335
|
+
|
|
336
|
+
expect(popoverContainer).toBeInTheDocument();
|
|
337
|
+
},
|
|
338
|
+
TIMEOUT_ACTION
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
await step('Click link tool to show input', async () => {
|
|
343
|
+
// The link tool should now be available
|
|
344
|
+
const linkTool = document.querySelector(LINK_TOOL_SELECTOR);
|
|
345
|
+
|
|
346
|
+
expect(linkTool).toBeInTheDocument();
|
|
347
|
+
|
|
348
|
+
if (linkTool) {
|
|
349
|
+
// Click the link tool
|
|
350
|
+
(linkTool as HTMLElement).click();
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Wait for nested popover to appear
|
|
354
|
+
await waitFor(
|
|
355
|
+
() => {
|
|
356
|
+
// The input is inside a nested popover
|
|
357
|
+
const linkInput = document.querySelector(INLINE_TOOL_INPUT_TESTID);
|
|
358
|
+
|
|
359
|
+
expect(linkInput).toBeInTheDocument();
|
|
360
|
+
},
|
|
361
|
+
TIMEOUT_ACTION
|
|
362
|
+
);
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Convert-to dropdown opened in inline toolbar.
|
|
369
|
+
*/
|
|
370
|
+
export const ConvertToDropdownOpen: Story = {
|
|
371
|
+
args: {
|
|
372
|
+
data: sampleData,
|
|
373
|
+
},
|
|
374
|
+
play: async ({ canvasElement, step }) => {
|
|
375
|
+
await step('Wait for editor to initialize', async () => {
|
|
376
|
+
await waitFor(
|
|
377
|
+
() => {
|
|
378
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
379
|
+
|
|
380
|
+
expect(block).toBeInTheDocument();
|
|
381
|
+
},
|
|
382
|
+
TIMEOUT_INIT
|
|
383
|
+
);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
await step('Select text to show inline toolbar', async () => {
|
|
387
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
388
|
+
const contentEditable = block?.querySelector(CONTENTEDITABLE_SELECTOR);
|
|
389
|
+
|
|
390
|
+
if (contentEditable) {
|
|
391
|
+
simulateClick(contentEditable);
|
|
392
|
+
selectText(contentEditable, 0, 11);
|
|
393
|
+
document.dispatchEvent(new Event('selectionchange'));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
await waitFor(
|
|
397
|
+
() => {
|
|
398
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
399
|
+
|
|
400
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
401
|
+
},
|
|
402
|
+
TIMEOUT_ACTION
|
|
403
|
+
);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
await step('Click convert-to button to open nested popover', async () => {
|
|
407
|
+
// Wait for the convert-to button to appear (it's rendered async after inline toolbar opens)
|
|
408
|
+
await waitFor(
|
|
409
|
+
() => {
|
|
410
|
+
const convertToButton = document.querySelector(CONVERT_TO_SELECTOR);
|
|
411
|
+
|
|
412
|
+
expect(convertToButton).toBeInTheDocument();
|
|
413
|
+
},
|
|
414
|
+
TIMEOUT_ACTION
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
const convertToButton = document.querySelector(CONVERT_TO_SELECTOR);
|
|
418
|
+
|
|
419
|
+
if (convertToButton) {
|
|
420
|
+
// Use simulateClick helper which dispatches mousedown, mouseup, and click events
|
|
421
|
+
// This is needed for proper popover event handling
|
|
422
|
+
simulateClick(convertToButton);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Wait a bit for the popover animation
|
|
426
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
427
|
+
|
|
428
|
+
await waitFor(
|
|
429
|
+
() => {
|
|
430
|
+
// The nested popover should be opened
|
|
431
|
+
const nestedPopover = document.querySelector(NESTED_POPOVER_SELECTOR + POPOVER_OPENED_SELECTOR);
|
|
432
|
+
|
|
433
|
+
expect(nestedPopover).toBeInTheDocument();
|
|
434
|
+
},
|
|
435
|
+
TIMEOUT_ACTION
|
|
436
|
+
);
|
|
437
|
+
});
|
|
438
|
+
},
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Inline toolbar tool hover state.
|
|
443
|
+
* Note: Adds --force-hover class to bypass @media (hover: hover) in headless browsers.
|
|
444
|
+
*/
|
|
445
|
+
export const ToolHoverState: Story = {
|
|
446
|
+
args: {
|
|
447
|
+
data: sampleData,
|
|
448
|
+
},
|
|
449
|
+
play: async ({ canvasElement, step }) => {
|
|
450
|
+
await step('Wait for editor to initialize', async () => {
|
|
451
|
+
await waitFor(
|
|
452
|
+
() => {
|
|
453
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
454
|
+
|
|
455
|
+
expect(block).toBeInTheDocument();
|
|
456
|
+
},
|
|
457
|
+
TIMEOUT_INIT
|
|
458
|
+
);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
await step('Select text to show inline toolbar', async () => {
|
|
462
|
+
const block = canvasElement.querySelector(BLOCK_TESTID);
|
|
463
|
+
const contentEditable = block?.querySelector(CONTENTEDITABLE_SELECTOR);
|
|
464
|
+
|
|
465
|
+
if (contentEditable) {
|
|
466
|
+
simulateClick(contentEditable);
|
|
467
|
+
selectText(contentEditable, 0, 11);
|
|
468
|
+
document.dispatchEvent(new Event('selectionchange'));
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
await waitFor(
|
|
472
|
+
() => {
|
|
473
|
+
const inlineToolbar = document.querySelector(INLINE_TOOLBAR_TESTID);
|
|
474
|
+
|
|
475
|
+
expect(inlineToolbar).toBeInTheDocument();
|
|
476
|
+
},
|
|
477
|
+
TIMEOUT_ACTION
|
|
478
|
+
);
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
await step('Hover over bold tool', async () => {
|
|
482
|
+
// Wait for popover to open AND for pointer-events to be enabled
|
|
483
|
+
await waitForPointerEvents(`${INLINE_TOOLBAR_TESTID} [data-blok-testid="popover-container"]`);
|
|
484
|
+
|
|
485
|
+
// Small delay for CSS animation to complete
|
|
486
|
+
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
487
|
+
|
|
488
|
+
// Find the bold tool specifically by its data attribute
|
|
489
|
+
const boldTool = document.querySelector('[data-blok-item-name="bold"]');
|
|
490
|
+
|
|
491
|
+
if (boldTool) {
|
|
492
|
+
// Add force-hover state to show hover styles in headless browsers
|
|
493
|
+
boldTool.setAttribute('data-blok-force-hover', 'true');
|
|
494
|
+
await userEvent.hover(boldTool);
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
},
|
|
498
|
+
};
|