@jackuait/blok 0.4.1-beta.4 → 0.4.1-beta.6
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 +868 -92
- package/codemod/test.js +682 -77
- package/dist/blok.mjs +5 -2
- package/dist/chunks/blok-B5qs7C5l.mjs +12838 -0
- package/dist/chunks/i18next-CugVlwWp.mjs +1292 -0
- package/dist/chunks/i18next-loader-CTrK3HzG.mjs +43 -0
- package/dist/{index-XWGz4gev.mjs → chunks/index-DDpzQn-0.mjs} +2 -2
- package/dist/chunks/inline-tool-convert-RBcopmCh.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 +26 -225
- package/package.json +49 -23
- 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 +23 -10
- package/types/configs/blok-config.d.ts +29 -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 -12
- 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/header.d.ts +18 -0
- package/types/tools/index.d.ts +1 -0
- package/types/tools/list.d.ts +91 -0
- package/types/tools/paragraph.d.ts +71 -0
- package/types/tools/tool-settings.d.ts +16 -2
- package/types/tools/tool.d.ts +6 -0
- package/types/tools-entry.d.ts +49 -0
- package/types/utils/popover/popover-item.d.ts +6 -5
- package/dist/blok-B870U2fw.mjs +0 -25803
- package/dist/blok.umd.js +0 -181
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized data attributes used across the Blok editor.
|
|
3
|
+
* This is the single source of truth for all data-blok-* attributes.
|
|
4
|
+
*
|
|
5
|
+
* Exported as Blok.DATA_ATTR for users.
|
|
6
|
+
*
|
|
7
|
+
* Naming convention:
|
|
8
|
+
* - Remove 'data-blok-' prefix and convert to camelCase
|
|
9
|
+
* - Global attributes: hidden, disabled, focused
|
|
10
|
+
* - Component prefixed: popover, popoverItem, toolbar, etc.
|
|
11
|
+
*/
|
|
12
|
+
export const DATA_ATTR = {
|
|
13
|
+
// ============================================
|
|
14
|
+
// Core Element Identifiers
|
|
15
|
+
// ============================================
|
|
16
|
+
|
|
17
|
+
/** Interface type identifier (blok, inline-toolbar, tooltip) */
|
|
18
|
+
interface: 'data-blok-interface',
|
|
19
|
+
/** Block element wrapper */
|
|
20
|
+
element: 'data-blok-element',
|
|
21
|
+
/** Block element content wrapper */
|
|
22
|
+
elementContent: 'data-blok-element-content',
|
|
23
|
+
/** Editor wrapper container */
|
|
24
|
+
editor: 'data-blok-editor',
|
|
25
|
+
/** Redactor zone */
|
|
26
|
+
redactor: 'data-blok-redactor',
|
|
27
|
+
|
|
28
|
+
// ============================================
|
|
29
|
+
// Block Identifiers
|
|
30
|
+
// ============================================
|
|
31
|
+
|
|
32
|
+
/** Block unique identifier */
|
|
33
|
+
id: 'data-blok-id',
|
|
34
|
+
/** Block component/tool type */
|
|
35
|
+
component: 'data-blok-component',
|
|
36
|
+
/** Tool type attribute */
|
|
37
|
+
tool: 'data-blok-tool',
|
|
38
|
+
/** Block nesting depth */
|
|
39
|
+
depth: 'data-blok-depth',
|
|
40
|
+
|
|
41
|
+
// ============================================
|
|
42
|
+
// Global States
|
|
43
|
+
// ============================================
|
|
44
|
+
|
|
45
|
+
/** Element is hidden from view */
|
|
46
|
+
hidden: 'data-blok-hidden',
|
|
47
|
+
/** Element is disabled and non-interactive */
|
|
48
|
+
disabled: 'data-blok-disabled',
|
|
49
|
+
/** Element is focused via keyboard navigation */
|
|
50
|
+
focused: 'data-blok-focused',
|
|
51
|
+
/** Block is selected */
|
|
52
|
+
selected: 'data-blok-selected',
|
|
53
|
+
/** Block is stretched */
|
|
54
|
+
stretched: 'data-blok-stretched',
|
|
55
|
+
/** Editor or element is empty */
|
|
56
|
+
empty: 'data-blok-empty',
|
|
57
|
+
|
|
58
|
+
// ============================================
|
|
59
|
+
// Editor Modes
|
|
60
|
+
// ============================================
|
|
61
|
+
|
|
62
|
+
/** Narrow mode state */
|
|
63
|
+
narrow: 'data-blok-narrow',
|
|
64
|
+
/** Right-to-left mode */
|
|
65
|
+
rtl: 'data-blok-rtl',
|
|
66
|
+
|
|
67
|
+
// ============================================
|
|
68
|
+
// Drag and Drop
|
|
69
|
+
// ============================================
|
|
70
|
+
|
|
71
|
+
/** Block is being dragged */
|
|
72
|
+
dragging: 'data-blok-dragging',
|
|
73
|
+
/** Multiple blocks being dragged */
|
|
74
|
+
draggingMulti: 'data-blok-dragging-multi',
|
|
75
|
+
/** Block is being duplicated (Alt+drag) */
|
|
76
|
+
duplicating: 'data-blok-duplicating',
|
|
77
|
+
/** Drag handle element */
|
|
78
|
+
dragHandle: 'data-blok-drag-handle',
|
|
79
|
+
|
|
80
|
+
// ============================================
|
|
81
|
+
// Toolbar
|
|
82
|
+
// ============================================
|
|
83
|
+
|
|
84
|
+
/** Toolbar element */
|
|
85
|
+
toolbar: 'data-blok-toolbar',
|
|
86
|
+
/** Settings toggler button */
|
|
87
|
+
settingsToggler: 'data-blok-settings-toggler',
|
|
88
|
+
/** Toolbox is open */
|
|
89
|
+
toolboxOpened: 'data-blok-toolbox-opened',
|
|
90
|
+
/** Element is opened (generic) */
|
|
91
|
+
opened: 'data-blok-opened',
|
|
92
|
+
|
|
93
|
+
// ============================================
|
|
94
|
+
// Popover Container
|
|
95
|
+
// ============================================
|
|
96
|
+
|
|
97
|
+
/** Root popover element */
|
|
98
|
+
popover: 'data-blok-popover',
|
|
99
|
+
/** Popover container wrapper */
|
|
100
|
+
popoverContainer: 'data-blok-popover-container',
|
|
101
|
+
/** Popover items list */
|
|
102
|
+
popoverItems: 'data-blok-popover-items',
|
|
103
|
+
/** Popover overlay element */
|
|
104
|
+
popoverOverlay: 'data-blok-popover-overlay',
|
|
105
|
+
/** Popover custom content area */
|
|
106
|
+
popoverCustomContent: 'data-blok-popover-custom-content',
|
|
107
|
+
/** Popover custom class */
|
|
108
|
+
popoverCustomClass: 'data-blok-popover-custom-class',
|
|
109
|
+
/** Inline popover variant */
|
|
110
|
+
popoverInline: 'data-blok-popover-inline',
|
|
111
|
+
/** Popover is open */
|
|
112
|
+
popoverOpened: 'data-blok-popover-opened',
|
|
113
|
+
/** Popover opens upward */
|
|
114
|
+
popoverOpenTop: 'data-blok-popover-open-top',
|
|
115
|
+
/** Popover opens leftward */
|
|
116
|
+
popoverOpenLeft: 'data-blok-popover-open-left',
|
|
117
|
+
|
|
118
|
+
// ============================================
|
|
119
|
+
// Popover Nesting
|
|
120
|
+
// ============================================
|
|
121
|
+
|
|
122
|
+
/** Nested popover indicator */
|
|
123
|
+
nested: 'data-blok-nested',
|
|
124
|
+
/** Nesting level value */
|
|
125
|
+
nestedLevel: 'data-blok-nested-level',
|
|
126
|
+
|
|
127
|
+
// ============================================
|
|
128
|
+
// Popover Header
|
|
129
|
+
// ============================================
|
|
130
|
+
|
|
131
|
+
/** Header container */
|
|
132
|
+
popoverHeader: 'data-blok-popover-header',
|
|
133
|
+
/** Header text element */
|
|
134
|
+
popoverHeaderText: 'data-blok-popover-header-text',
|
|
135
|
+
/** Back button in nested popover */
|
|
136
|
+
popoverHeaderBackButton: 'data-blok-popover-header-back-button',
|
|
137
|
+
|
|
138
|
+
// ============================================
|
|
139
|
+
// Popover Items
|
|
140
|
+
// ============================================
|
|
141
|
+
|
|
142
|
+
/** Item container */
|
|
143
|
+
popoverItem: 'data-blok-popover-item',
|
|
144
|
+
/** Item icon wrapper */
|
|
145
|
+
popoverItemIcon: 'data-blok-popover-item-icon',
|
|
146
|
+
/** Chevron icon for nested items */
|
|
147
|
+
popoverItemIconChevronRight: 'data-blok-popover-item-icon-chevron-right',
|
|
148
|
+
/** Item title text */
|
|
149
|
+
popoverItemTitle: 'data-blok-popover-item-title',
|
|
150
|
+
/** Item secondary title */
|
|
151
|
+
popoverItemSecondaryTitle: 'data-blok-popover-item-secondary-title',
|
|
152
|
+
/** Item is active/selected */
|
|
153
|
+
popoverItemActive: 'data-blok-popover-item-active',
|
|
154
|
+
/** Confirmation state */
|
|
155
|
+
popoverItemConfirmation: 'data-blok-popover-item-confirmation',
|
|
156
|
+
/** Disable hover styling */
|
|
157
|
+
popoverItemNoHover: 'data-blok-popover-item-no-hover',
|
|
158
|
+
/** Disable focus handling */
|
|
159
|
+
popoverItemNoFocus: 'data-blok-popover-item-no-focus',
|
|
160
|
+
/** Wobble animation */
|
|
161
|
+
popoverItemWobble: 'data-blok-popover-item-wobble',
|
|
162
|
+
/** Separator item */
|
|
163
|
+
popoverItemSeparator: 'data-blok-popover-item-separator',
|
|
164
|
+
/** Separator line element */
|
|
165
|
+
popoverItemSeparatorLine: 'data-blok-popover-item-separator-line',
|
|
166
|
+
/** HTML-based item */
|
|
167
|
+
popoverItemHtml: 'data-blok-popover-item-html',
|
|
168
|
+
/** Item has child menu */
|
|
169
|
+
hasChildren: 'data-blok-has-children',
|
|
170
|
+
/** Item name identifier */
|
|
171
|
+
itemName: 'data-blok-item-name',
|
|
172
|
+
/** No search results shown */
|
|
173
|
+
nothingFoundDisplayed: 'data-blok-nothing-found-displayed',
|
|
174
|
+
|
|
175
|
+
// ============================================
|
|
176
|
+
// Overlay / Selection
|
|
177
|
+
// ============================================
|
|
178
|
+
|
|
179
|
+
/** Selection overlay */
|
|
180
|
+
overlay: 'data-blok-overlay',
|
|
181
|
+
/** Overlay container */
|
|
182
|
+
overlayContainer: 'data-blok-overlay-container',
|
|
183
|
+
/** Selection rectangle */
|
|
184
|
+
overlayRectangle: 'data-blok-overlay-rectangle',
|
|
185
|
+
/** Overlay is hidden */
|
|
186
|
+
overlayHidden: 'data-blok-overlay-hidden',
|
|
187
|
+
/** Fake cursor indicator */
|
|
188
|
+
fakeCursor: 'data-blok-fake-cursor',
|
|
189
|
+
/** Fake background for selection */
|
|
190
|
+
fakeBackground: 'data-blok-fake-background',
|
|
191
|
+
|
|
192
|
+
// ============================================
|
|
193
|
+
// Scroll
|
|
194
|
+
// ============================================
|
|
195
|
+
|
|
196
|
+
/** Auto-scroll zone (top/bottom) */
|
|
197
|
+
scrollZone: 'data-blok-scroll-zone',
|
|
198
|
+
/** Scroll is locked */
|
|
199
|
+
scrollLocked: 'data-blok-scroll-locked',
|
|
200
|
+
/** Hard scroll lock */
|
|
201
|
+
scrollLockedHard: 'data-blok-scroll-locked-hard',
|
|
202
|
+
|
|
203
|
+
// ============================================
|
|
204
|
+
// Caret
|
|
205
|
+
// ============================================
|
|
206
|
+
|
|
207
|
+
/** Shadow caret element */
|
|
208
|
+
shadowCaret: 'data-blok-shadow-caret',
|
|
209
|
+
|
|
210
|
+
// ============================================
|
|
211
|
+
// Placeholders
|
|
212
|
+
// ============================================
|
|
213
|
+
|
|
214
|
+
/** Placeholder text */
|
|
215
|
+
placeholder: 'data-blok-placeholder',
|
|
216
|
+
/** Active placeholder text */
|
|
217
|
+
placeholderActive: 'data-blok-placeholder-active',
|
|
218
|
+
|
|
219
|
+
// ============================================
|
|
220
|
+
// Mutation Tracking
|
|
221
|
+
// ============================================
|
|
222
|
+
|
|
223
|
+
/** Element excluded from mutation tracking */
|
|
224
|
+
mutationFree: 'data-blok-mutation-free',
|
|
225
|
+
|
|
226
|
+
// ============================================
|
|
227
|
+
// Navigation
|
|
228
|
+
// ============================================
|
|
229
|
+
|
|
230
|
+
/** Block has navigation focus */
|
|
231
|
+
navigationFocused: 'data-blok-navigation-focused',
|
|
232
|
+
/** Flipper navigation target */
|
|
233
|
+
flipperNavigationTarget: 'data-blok-flipper-navigation-target',
|
|
234
|
+
|
|
235
|
+
// ============================================
|
|
236
|
+
// Inline Toolbar
|
|
237
|
+
// ============================================
|
|
238
|
+
|
|
239
|
+
/** Inline toolbar enabled on external element */
|
|
240
|
+
inlineToolbar: 'data-blok-inline-toolbar',
|
|
241
|
+
|
|
242
|
+
// ============================================
|
|
243
|
+
// Link Tool
|
|
244
|
+
// ============================================
|
|
245
|
+
|
|
246
|
+
/** Link tool is active */
|
|
247
|
+
linkToolActive: 'data-blok-link-tool-active',
|
|
248
|
+
/** Link tool unlink mode */
|
|
249
|
+
linkToolUnlink: 'data-blok-link-tool-unlink',
|
|
250
|
+
/** Link tool input is opened */
|
|
251
|
+
linkToolInputOpened: 'data-blok-link-tool-input-opened',
|
|
252
|
+
|
|
253
|
+
// ============================================
|
|
254
|
+
// Bold Tool
|
|
255
|
+
// ============================================
|
|
256
|
+
|
|
257
|
+
/** Bold collapsed length tracking */
|
|
258
|
+
boldCollapsedLength: 'data-blok-bold-collapsed-length',
|
|
259
|
+
/** Bold collapsed active state */
|
|
260
|
+
boldCollapsedActive: 'data-blok-bold-collapsed-active',
|
|
261
|
+
/** Bold previous length tracking */
|
|
262
|
+
boldPrevLength: 'data-blok-bold-prev-length',
|
|
263
|
+
/** Bold leading whitespace */
|
|
264
|
+
boldLeadingWs: 'data-blok-bold-leading-ws',
|
|
265
|
+
/** Bold marker */
|
|
266
|
+
boldMarker: 'data-blok-bold-marker',
|
|
267
|
+
|
|
268
|
+
// ============================================
|
|
269
|
+
// Tooltip
|
|
270
|
+
// ============================================
|
|
271
|
+
|
|
272
|
+
/** Tooltip is shown */
|
|
273
|
+
shown: 'data-blok-shown',
|
|
274
|
+
/** Tooltip placement */
|
|
275
|
+
placement: 'data-blok-placement',
|
|
276
|
+
|
|
277
|
+
// ============================================
|
|
278
|
+
// Notifier
|
|
279
|
+
// ============================================
|
|
280
|
+
|
|
281
|
+
/** Bounce in animation */
|
|
282
|
+
bounceIn: 'data-blok-bounce-in',
|
|
283
|
+
|
|
284
|
+
// ============================================
|
|
285
|
+
// Announcer (Accessibility)
|
|
286
|
+
// ============================================
|
|
287
|
+
|
|
288
|
+
/** Live region announcer */
|
|
289
|
+
announcer: 'data-blok-announcer',
|
|
290
|
+
|
|
291
|
+
// ============================================
|
|
292
|
+
// Stub Block
|
|
293
|
+
// ============================================
|
|
294
|
+
|
|
295
|
+
/** Stub block element */
|
|
296
|
+
stub: 'data-blok-stub',
|
|
297
|
+
/** Stub info section */
|
|
298
|
+
stubInfo: 'data-blok-stub-info',
|
|
299
|
+
/** Stub title */
|
|
300
|
+
stubTitle: 'data-blok-stub-title',
|
|
301
|
+
/** Stub subtitle */
|
|
302
|
+
stubSubtitle: 'data-blok-stub-subtitle',
|
|
303
|
+
|
|
304
|
+
// ============================================
|
|
305
|
+
// Testing
|
|
306
|
+
// ============================================
|
|
307
|
+
|
|
308
|
+
/** Test identifier (for E2E tests) */
|
|
309
|
+
testid: 'data-blok-testid',
|
|
310
|
+
/** Force hover state (for tests/storybook) */
|
|
311
|
+
forceHover: 'data-blok-force-hover',
|
|
312
|
+
} as const;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Type for DATA_ATTR keys
|
|
316
|
+
*/
|
|
317
|
+
export type DataAttrKey = keyof typeof DATA_ATTR;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Type for DATA_ATTR values
|
|
321
|
+
*/
|
|
322
|
+
export type DataAttrValue = (typeof DATA_ATTR)[DataAttrKey];
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Helper function to create a CSS selector from an attribute
|
|
326
|
+
*
|
|
327
|
+
* @param attr - The data attribute name from DATA_ATTR
|
|
328
|
+
* @param value - Optional value for the attribute (defaults to presence selector)
|
|
329
|
+
* @returns CSS selector string
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* createSelector(DATA_ATTR.element) // '[data-blok-element]'
|
|
333
|
+
* createSelector(DATA_ATTR.selected, true) // '[data-blok-selected="true"]'
|
|
334
|
+
* createSelector(DATA_ATTR.tool, 'paragraph') // '[data-blok-tool="paragraph"]'
|
|
335
|
+
*/
|
|
336
|
+
export const createSelector = (attr: DataAttrValue, value?: string | boolean): string => {
|
|
337
|
+
if (value === undefined) {
|
|
338
|
+
return `[${attr}]`;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return `[${attr}="${value}"]`;
|
|
342
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export DATA_ATTR from the single source of truth
|
|
3
|
+
*/
|
|
4
|
+
export { DATA_ATTR, createSelector } from './constants/data-attributes';
|
|
5
|
+
export type { DataAttrKey, DataAttrValue } from './constants/data-attributes';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Debounce timeout for selection change event
|
|
9
|
+
* {@link modules/ui.ts}
|
|
10
|
+
*/
|
|
11
|
+
export const selectionChangeDebounceTimeout = 180;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Timeout for batching of DOM changes used by the ModificationObserver
|
|
15
|
+
* {@link modules/modificationsObserver.ts}
|
|
16
|
+
*/
|
|
17
|
+
export const modificationsObserverBatchTimeout = 400;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Value for the data-blok-interface attribute on blok wrapper elements
|
|
21
|
+
* Used as a single source of truth for blok identification
|
|
22
|
+
*/
|
|
23
|
+
export const BLOK_INTERFACE_VALUE = 'blok';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Value for the data-blok-interface attribute on inline toolbar elements
|
|
27
|
+
* Used as a single source of truth for inline toolbar identification
|
|
28
|
+
*/
|
|
29
|
+
export const INLINE_TOOLBAR_INTERFACE_VALUE = 'inline-toolbar';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Value for the data-blok-interface attribute on tooltip elements
|
|
33
|
+
* Used as a single source of truth for tooltip identification
|
|
34
|
+
*/
|
|
35
|
+
export const TOOLTIP_INTERFACE_VALUE = 'tooltip';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* CSS selector for the main blok wrapper element
|
|
39
|
+
* Used to identify the blok container in the DOM
|
|
40
|
+
*/
|
|
41
|
+
export const BLOK_INTERFACE_SELECTOR = '[data-blok-interface=blok]';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* CSS selector for tooltip elements
|
|
45
|
+
* Used to identify tooltip elements in the DOM
|
|
46
|
+
*/
|
|
47
|
+
export const TOOLTIP_INTERFACE_SELECTOR = '[data-blok-interface="tooltip"]';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* CSS selector for inline toolbar elements
|
|
51
|
+
* Used to identify inline toolbar elements in the DOM
|
|
52
|
+
*/
|
|
53
|
+
export const INLINE_TOOLBAR_INTERFACE_SELECTOR = '[data-blok-interface=inline-toolbar]';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Platform-specific modifier key for keyboard shortcuts
|
|
57
|
+
* Returns 'Meta' on macOS (darwin) and 'Control' on other platforms
|
|
58
|
+
* Used in tests for keyboard shortcut interactions
|
|
59
|
+
*/
|
|
60
|
+
export const MODIFIER_KEY = (() => {
|
|
61
|
+
// Check if we're in a Node.js environment
|
|
62
|
+
if (typeof process !== 'undefined' && process.platform) {
|
|
63
|
+
return process.platform === 'darwin' ? 'Meta' : 'Control';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Browser environment: detect macOS using navigator
|
|
67
|
+
if (typeof navigator !== 'undefined') {
|
|
68
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
69
|
+
const isMacOS = userAgent.includes('mac');
|
|
70
|
+
|
|
71
|
+
return isMacOS ? 'Meta' : 'Control';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Fallback to Control if platform detection fails
|
|
75
|
+
return 'Control';
|
|
76
|
+
})();
|