@ckeditor/ckeditor5-ui 0.0.0-internal-20241017.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +21 -0
- package/README.md +26 -0
- package/ckeditor5-metadata.json +25 -0
- package/dist/arialiveannouncer.d.ts +113 -0
- package/dist/augmentation.d.ts +92 -0
- package/dist/autocomplete/autocompleteview.d.ts +85 -0
- package/dist/badge/badge.d.ts +133 -0
- package/dist/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
- package/dist/bindings/clickoutsidehandler.d.ts +34 -0
- package/dist/bindings/csstransitiondisablermixin.d.ts +44 -0
- package/dist/bindings/draggableviewmixin.d.ts +50 -0
- package/dist/bindings/injectcsstransitiondisabler.d.ts +63 -0
- package/dist/bindings/preventdefault.d.ts +37 -0
- package/dist/bindings/submithandler.d.ts +61 -0
- package/dist/button/button.d.ts +179 -0
- package/dist/button/buttonlabel.d.ts +38 -0
- package/dist/button/buttonlabelview.d.ts +35 -0
- package/dist/button/buttonview.d.ts +201 -0
- package/dist/button/filedialogbuttonview.d.ts +111 -0
- package/dist/button/listitembuttonview.d.ts +82 -0
- package/dist/button/switchbuttonview.d.ts +49 -0
- package/dist/collapsible/collapsibleview.d.ts +74 -0
- package/dist/colorgrid/colorgridview.d.ts +136 -0
- package/dist/colorgrid/colortileview.d.ts +32 -0
- package/dist/colorgrid/utils.d.ts +51 -0
- package/dist/colorpicker/colorpickerview.d.ts +177 -0
- package/dist/colorpicker/utils.d.ts +52 -0
- package/dist/colorselector/colorgridsfragmentview.d.ts +199 -0
- package/dist/colorselector/colorpickerfragmentview.d.ts +137 -0
- package/dist/colorselector/colorselectorview.d.ts +246 -0
- package/dist/colorselector/documentcolorcollection.d.ts +74 -0
- package/dist/componentfactory.d.ts +85 -0
- package/dist/dialog/dialog.d.ts +281 -0
- package/dist/dialog/dialogactionsview.d.ts +73 -0
- package/dist/dialog/dialogcontentview.d.ts +31 -0
- package/dist/dialog/dialogview.d.ts +260 -0
- package/dist/dropdown/button/dropdownbutton.d.ts +29 -0
- package/dist/dropdown/button/dropdownbuttonview.d.ts +52 -0
- package/dist/dropdown/button/splitbuttonview.d.ts +166 -0
- package/dist/dropdown/dropdownpanelfocusable.d.ts +25 -0
- package/dist/dropdown/dropdownpanelview.d.ts +66 -0
- package/dist/dropdown/dropdownview.d.ts +332 -0
- package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +48 -0
- package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +40 -0
- package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +21 -0
- package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +26 -0
- package/dist/dropdown/menu/dropdownmenulistview.d.ts +28 -0
- package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +38 -0
- package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +135 -0
- package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +144 -0
- package/dist/dropdown/menu/utils.d.ts +128 -0
- package/dist/dropdown/utils.d.ts +297 -0
- package/dist/editableui/editableuiview.d.ts +76 -0
- package/dist/editableui/inline/inlineeditableuiview.d.ts +48 -0
- package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +59 -0
- package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
- package/dist/editorui/bodycollection.d.ts +59 -0
- package/dist/editorui/boxed/boxededitoruiview.d.ts +44 -0
- package/dist/editorui/editorui.d.ts +358 -0
- package/dist/editorui/editoruiview.d.ts +48 -0
- package/dist/editorui/evaluationbadge.d.ts +37 -0
- package/dist/editorui/poweredby.d.ts +38 -0
- package/dist/focuscycler.d.ts +295 -0
- package/dist/formheader/formheaderview.d.ts +62 -0
- package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +34 -0
- package/dist/highlightedtext/highlightedtextview.d.ts +42 -0
- package/dist/highlightedtext/labelwithhighlightview.d.ts +30 -0
- package/dist/icon/iconview.d.ts +92 -0
- package/dist/iframe/iframeview.d.ts +54 -0
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +754 -0
- package/dist/index.css +1063 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +17688 -0
- package/dist/index.js.map +1 -0
- package/dist/input/inputbase.d.ts +123 -0
- package/dist/input/inputview.d.ts +40 -0
- package/dist/inputnumber/inputnumberview.d.ts +53 -0
- package/dist/inputtext/inputtextview.d.ts +22 -0
- package/dist/label/labelview.d.ts +40 -0
- package/dist/labeledfield/labeledfieldview.d.ts +191 -0
- package/dist/labeledfield/utils.d.ts +127 -0
- package/dist/labeledinput/labeledinputview.d.ts +129 -0
- package/dist/list/listitemgroupview.d.ts +63 -0
- package/dist/list/listitemview.d.ts +40 -0
- package/dist/list/listseparatorview.d.ts +22 -0
- package/dist/list/listview.d.ts +128 -0
- package/dist/menubar/menubarmenubuttonview.d.ts +39 -0
- package/dist/menubar/menubarmenulistitembuttonview.d.ts +25 -0
- package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
- package/dist/menubar/menubarmenulistitemview.d.ts +29 -0
- package/dist/menubar/menubarmenulistview.d.ts +33 -0
- package/dist/menubar/menubarmenupanelview.d.ts +57 -0
- package/dist/menubar/menubarmenuview.d.ts +113 -0
- package/dist/menubar/menubarview.d.ts +177 -0
- package/dist/menubar/utils.d.ts +451 -0
- package/dist/model.d.ts +26 -0
- package/dist/notification/notification.d.ts +219 -0
- package/dist/panel/balloon/balloonpanelview.d.ts +701 -0
- package/dist/panel/balloon/contextualballoon.d.ts +313 -0
- package/dist/panel/sticky/stickypanelview.d.ts +160 -0
- package/dist/search/filteredview.d.ts +35 -0
- package/dist/search/filtergroupanditemnames.d.ts +19 -0
- package/dist/search/searchinfoview.d.ts +49 -0
- package/dist/search/searchresultsview.d.ts +58 -0
- package/dist/search/text/searchtextqueryview.d.ts +80 -0
- package/dist/search/text/searchtextview.d.ts +223 -0
- package/dist/spinner/spinnerview.d.ts +29 -0
- package/dist/template.d.ts +946 -0
- package/dist/textarea/textareaview.d.ts +108 -0
- package/dist/toolbar/balloon/balloontoolbar.d.ts +130 -0
- package/dist/toolbar/block/blockbuttonview.d.ts +39 -0
- package/dist/toolbar/block/blocktoolbar.d.ts +175 -0
- package/dist/toolbar/normalizetoolbarconfig.d.ts +44 -0
- package/dist/toolbar/toolbarlinebreakview.d.ts +22 -0
- package/dist/toolbar/toolbarseparatorview.d.ts +22 -0
- package/dist/toolbar/toolbarview.d.ts +271 -0
- package/dist/tooltipmanager.d.ts +192 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +5 -0
- package/dist/translations/af.umd.js +11 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/ast.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/eo.umd.js +11 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/eu.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/km.umd.js +11 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/kn.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/view.d.ts +426 -0
- package/dist/viewcollection.d.ts +143 -0
- package/lang/contexts.json +51 -0
- package/lang/translations/af.po +214 -0
- package/lang/translations/ar.po +214 -0
- package/lang/translations/ast.po +214 -0
- package/lang/translations/az.po +214 -0
- package/lang/translations/bg.po +214 -0
- package/lang/translations/bn.po +214 -0
- package/lang/translations/bs.po +214 -0
- package/lang/translations/ca.po +214 -0
- package/lang/translations/cs.po +214 -0
- package/lang/translations/da.po +214 -0
- package/lang/translations/de-ch.po +214 -0
- package/lang/translations/de.po +214 -0
- package/lang/translations/el.po +214 -0
- package/lang/translations/en-au.po +214 -0
- package/lang/translations/en-gb.po +214 -0
- package/lang/translations/en.po +214 -0
- package/lang/translations/eo.po +214 -0
- package/lang/translations/es-co.po +214 -0
- package/lang/translations/es.po +214 -0
- package/lang/translations/et.po +214 -0
- package/lang/translations/eu.po +214 -0
- package/lang/translations/fa.po +214 -0
- package/lang/translations/fi.po +214 -0
- package/lang/translations/fr.po +214 -0
- package/lang/translations/gl.po +214 -0
- package/lang/translations/he.po +214 -0
- package/lang/translations/hi.po +214 -0
- package/lang/translations/hr.po +214 -0
- package/lang/translations/hu.po +214 -0
- package/lang/translations/id.po +214 -0
- package/lang/translations/it.po +214 -0
- package/lang/translations/ja.po +214 -0
- package/lang/translations/jv.po +214 -0
- package/lang/translations/km.po +214 -0
- package/lang/translations/kn.po +214 -0
- package/lang/translations/ko.po +214 -0
- package/lang/translations/ku.po +214 -0
- package/lang/translations/lt.po +214 -0
- package/lang/translations/lv.po +214 -0
- package/lang/translations/ms.po +214 -0
- package/lang/translations/nb.po +214 -0
- package/lang/translations/ne.po +214 -0
- package/lang/translations/nl.po +214 -0
- package/lang/translations/no.po +214 -0
- package/lang/translations/pl.po +214 -0
- package/lang/translations/pt-br.po +214 -0
- package/lang/translations/pt.po +214 -0
- package/lang/translations/ro.po +214 -0
- package/lang/translations/ru.po +214 -0
- package/lang/translations/sk.po +214 -0
- package/lang/translations/sl.po +214 -0
- package/lang/translations/sq.po +214 -0
- package/lang/translations/sr-latn.po +214 -0
- package/lang/translations/sr.po +214 -0
- package/lang/translations/sv.po +214 -0
- package/lang/translations/th.po +214 -0
- package/lang/translations/ti.po +214 -0
- package/lang/translations/tk.po +214 -0
- package/lang/translations/tr.po +214 -0
- package/lang/translations/tt.po +214 -0
- package/lang/translations/ug.po +214 -0
- package/lang/translations/uk.po +214 -0
- package/lang/translations/ur.po +214 -0
- package/lang/translations/uz.po +214 -0
- package/lang/translations/vi.po +214 -0
- package/lang/translations/zh-cn.po +214 -0
- package/lang/translations/zh.po +214 -0
- package/package.json +42 -0
- package/src/arialiveannouncer.d.ts +109 -0
- package/src/arialiveannouncer.js +165 -0
- package/src/augmentation.d.ts +88 -0
- package/src/augmentation.js +5 -0
- package/src/autocomplete/autocompleteview.d.ts +81 -0
- package/src/autocomplete/autocompleteview.js +154 -0
- package/src/badge/badge.d.ts +129 -0
- package/src/badge/badge.js +218 -0
- package/src/bindings/addkeyboardhandlingforgrid.d.ts +27 -0
- package/src/bindings/addkeyboardhandlingforgrid.js +107 -0
- package/src/bindings/clickoutsidehandler.d.ts +30 -0
- package/src/bindings/clickoutsidehandler.js +37 -0
- package/src/bindings/csstransitiondisablermixin.d.ts +40 -0
- package/src/bindings/csstransitiondisablermixin.js +55 -0
- package/src/bindings/draggableviewmixin.d.ts +46 -0
- package/src/bindings/draggableviewmixin.js +144 -0
- package/src/bindings/injectcsstransitiondisabler.d.ts +59 -0
- package/src/bindings/injectcsstransitiondisabler.js +71 -0
- package/src/bindings/preventdefault.d.ts +33 -0
- package/src/bindings/preventdefault.js +34 -0
- package/src/bindings/submithandler.d.ts +57 -0
- package/src/bindings/submithandler.js +47 -0
- package/src/button/button.d.ts +175 -0
- package/src/button/button.js +5 -0
- package/src/button/buttonlabel.d.ts +34 -0
- package/src/button/buttonlabel.js +5 -0
- package/src/button/buttonlabelview.d.ts +31 -0
- package/src/button/buttonlabelview.js +42 -0
- package/src/button/buttonview.d.ts +197 -0
- package/src/button/buttonview.js +248 -0
- package/src/button/filedialogbuttonview.d.ts +107 -0
- package/src/button/filedialogbuttonview.js +145 -0
- package/src/button/listitembuttonview.d.ts +78 -0
- package/src/button/listitembuttonview.js +129 -0
- package/src/button/switchbuttonview.d.ts +45 -0
- package/src/button/switchbuttonview.js +75 -0
- package/src/collapsible/collapsibleview.d.ts +70 -0
- package/src/collapsible/collapsibleview.js +95 -0
- package/src/colorgrid/colorgridview.d.ts +132 -0
- package/src/colorgrid/colorgridview.js +124 -0
- package/src/colorgrid/colortileview.d.ts +28 -0
- package/src/colorgrid/colortileview.js +42 -0
- package/src/colorgrid/utils.d.ts +47 -0
- package/src/colorgrid/utils.js +84 -0
- package/src/colorpicker/colorpickerview.d.ts +173 -0
- package/src/colorpicker/colorpickerview.js +326 -0
- package/src/colorpicker/utils.d.ts +48 -0
- package/src/colorpicker/utils.js +108 -0
- package/src/colorselector/colorgridsfragmentview.d.ts +195 -0
- package/src/colorselector/colorgridsfragmentview.js +291 -0
- package/src/colorselector/colorpickerfragmentview.d.ts +133 -0
- package/src/colorselector/colorpickerfragmentview.js +212 -0
- package/src/colorselector/colorselectorview.d.ts +242 -0
- package/src/colorselector/colorselectorview.js +257 -0
- package/src/colorselector/documentcolorcollection.d.ts +70 -0
- package/src/colorselector/documentcolorcollection.js +42 -0
- package/src/componentfactory.d.ts +81 -0
- package/src/componentfactory.js +104 -0
- package/src/dialog/dialog.d.ts +277 -0
- package/src/dialog/dialog.js +279 -0
- package/src/dialog/dialogactionsview.d.ts +69 -0
- package/src/dialog/dialogactionsview.js +98 -0
- package/src/dialog/dialogcontentview.d.ts +27 -0
- package/src/dialog/dialogcontentview.js +35 -0
- package/src/dialog/dialogview.d.ts +256 -0
- package/src/dialog/dialogview.js +453 -0
- package/src/dropdown/button/dropdownbutton.d.ts +25 -0
- package/src/dropdown/button/dropdownbutton.js +5 -0
- package/src/dropdown/button/dropdownbuttonview.d.ts +48 -0
- package/src/dropdown/button/dropdownbuttonview.js +66 -0
- package/src/dropdown/button/splitbuttonview.d.ts +162 -0
- package/src/dropdown/button/splitbuttonview.js +154 -0
- package/src/dropdown/dropdownpanelfocusable.d.ts +21 -0
- package/src/dropdown/dropdownpanelfocusable.js +5 -0
- package/src/dropdown/dropdownpanelview.d.ts +62 -0
- package/src/dropdown/dropdownpanelview.js +97 -0
- package/src/dropdown/dropdownview.d.ts +328 -0
- package/src/dropdown/dropdownview.js +380 -0
- package/src/dropdown/menu/dropdownmenubehaviors.d.ts +44 -0
- package/src/dropdown/menu/dropdownmenubehaviors.js +119 -0
- package/src/dropdown/menu/dropdownmenubuttonview.d.ts +36 -0
- package/src/dropdown/menu/dropdownmenubuttonview.js +65 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.d.ts +17 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +29 -0
- package/src/dropdown/menu/dropdownmenulistitemview.d.ts +22 -0
- package/src/dropdown/menu/dropdownmenulistitemview.js +34 -0
- package/src/dropdown/menu/dropdownmenulistview.d.ts +24 -0
- package/src/dropdown/menu/dropdownmenulistview.js +29 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +34 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +63 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.d.ts +131 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +191 -0
- package/src/dropdown/menu/dropdownmenurootlistview.d.ts +140 -0
- package/src/dropdown/menu/dropdownmenurootlistview.js +160 -0
- package/src/dropdown/menu/utils.d.ts +124 -0
- package/src/dropdown/menu/utils.js +61 -0
- package/src/dropdown/utils.d.ts +293 -0
- package/src/dropdown/utils.js +562 -0
- package/src/editableui/editableuiview.d.ts +72 -0
- package/src/editableui/editableuiview.js +112 -0
- package/src/editableui/inline/inlineeditableuiview.d.ts +44 -0
- package/src/editableui/inline/inlineeditableuiview.js +71 -0
- package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +145 -0
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +35 -0
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +112 -0
- package/src/editorui/bodycollection.d.ts +55 -0
- package/src/editorui/bodycollection.js +85 -0
- package/src/editorui/boxed/boxededitoruiview.d.ts +40 -0
- package/src/editorui/boxed/boxededitoruiview.js +81 -0
- package/src/editorui/editorui.d.ts +354 -0
- package/src/editorui/editorui.js +522 -0
- package/src/editorui/editoruiview.d.ts +44 -0
- package/src/editorui/editoruiview.js +38 -0
- package/src/editorui/evaluationbadge.d.ts +33 -0
- package/src/editorui/evaluationbadge.js +99 -0
- package/src/editorui/poweredby.d.ts +34 -0
- package/src/editorui/poweredby.js +127 -0
- package/src/focuscycler.d.ts +291 -0
- package/src/focuscycler.js +352 -0
- package/src/formheader/formheaderview.d.ts +58 -0
- package/src/formheader/formheaderview.js +69 -0
- package/src/highlightedtext/buttonlabelwithhighlightview.d.ts +30 -0
- package/src/highlightedtext/buttonlabelwithhighlightview.js +31 -0
- package/src/highlightedtext/highlightedtextview.d.ts +38 -0
- package/src/highlightedtext/highlightedtextview.js +102 -0
- package/src/highlightedtext/labelwithhighlightview.d.ts +26 -0
- package/src/highlightedtext/labelwithhighlightview.js +33 -0
- package/src/icon/iconview.d.ts +88 -0
- package/src/icon/iconview.js +115 -0
- package/src/iframe/iframeview.d.ts +50 -0
- package/src/iframe/iframeview.js +63 -0
- package/src/index.d.ts +93 -0
- package/src/index.js +90 -0
- package/src/input/inputbase.d.ts +119 -0
- package/src/input/inputbase.js +114 -0
- package/src/input/inputview.d.ts +36 -0
- package/src/input/inputview.js +24 -0
- package/src/inputnumber/inputnumberview.d.ts +49 -0
- package/src/inputnumber/inputnumberview.js +40 -0
- package/src/inputtext/inputtextview.d.ts +18 -0
- package/src/inputtext/inputtextview.js +27 -0
- package/src/label/labelview.d.ts +36 -0
- package/src/label/labelview.js +41 -0
- package/src/labeledfield/labeledfieldview.d.ts +187 -0
- package/src/labeledfield/labeledfieldview.js +157 -0
- package/src/labeledfield/utils.d.ts +123 -0
- package/src/labeledfield/utils.js +176 -0
- package/src/labeledinput/labeledinputview.d.ts +125 -0
- package/src/labeledinput/labeledinputview.js +125 -0
- package/src/list/listitemgroupview.d.ts +59 -0
- package/src/list/listitemgroupview.js +67 -0
- package/src/list/listitemview.d.ts +36 -0
- package/src/list/listitemview.js +42 -0
- package/src/list/listseparatorview.d.ts +18 -0
- package/src/list/listseparatorview.js +28 -0
- package/src/list/listview.d.ts +124 -0
- package/src/list/listview.js +188 -0
- package/src/menubar/menubarmenubuttonview.d.ts +35 -0
- package/src/menubar/menubarmenubuttonview.js +64 -0
- package/src/menubar/menubarmenulistitembuttonview.d.ts +21 -0
- package/src/menubar/menubarmenulistitembuttonview.js +30 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +23 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +32 -0
- package/src/menubar/menubarmenulistitemview.d.ts +25 -0
- package/src/menubar/menubarmenulistitemview.js +34 -0
- package/src/menubar/menubarmenulistview.d.ts +29 -0
- package/src/menubar/menubarmenulistview.js +72 -0
- package/src/menubar/menubarmenupanelview.d.ts +53 -0
- package/src/menubar/menubarmenupanelview.js +60 -0
- package/src/menubar/menubarmenuview.d.ts +109 -0
- package/src/menubar/menubarmenuview.js +160 -0
- package/src/menubar/menubarview.d.ts +173 -0
- package/src/menubar/menubarview.js +261 -0
- package/src/menubar/utils.d.ts +447 -0
- package/src/menubar/utils.js +1388 -0
- package/src/model.d.ts +22 -0
- package/src/model.js +31 -0
- package/src/notification/notification.d.ts +215 -0
- package/src/notification/notification.js +193 -0
- package/src/panel/balloon/balloonpanelview.d.ts +697 -0
- package/src/panel/balloon/balloonpanelview.js +1055 -0
- package/src/panel/balloon/contextualballoon.d.ts +309 -0
- package/src/panel/balloon/contextualballoon.js +576 -0
- package/src/panel/sticky/stickypanelview.d.ts +156 -0
- package/src/panel/sticky/stickypanelview.js +234 -0
- package/src/search/filteredview.d.ts +31 -0
- package/src/search/filteredview.js +5 -0
- package/src/search/filtergroupanditemnames.d.ts +15 -0
- package/src/search/filtergroupanditemnames.js +38 -0
- package/src/search/searchinfoview.d.ts +45 -0
- package/src/search/searchinfoview.js +59 -0
- package/src/search/searchresultsview.d.ts +54 -0
- package/src/search/searchresultsview.js +65 -0
- package/src/search/text/searchtextqueryview.d.ts +76 -0
- package/src/search/text/searchtextqueryview.js +75 -0
- package/src/search/text/searchtextview.d.ts +219 -0
- package/src/search/text/searchtextview.js +202 -0
- package/src/spinner/spinnerview.d.ts +25 -0
- package/src/spinner/spinnerview.js +38 -0
- package/src/template.d.ts +942 -0
- package/src/template.js +1294 -0
- package/src/textarea/textareaview.d.ts +104 -0
- package/src/textarea/textareaview.js +182 -0
- package/src/toolbar/balloon/balloontoolbar.d.ts +126 -0
- package/src/toolbar/balloon/balloontoolbar.js +324 -0
- package/src/toolbar/block/blockbuttonview.d.ts +35 -0
- package/src/toolbar/block/blockbuttonview.js +41 -0
- package/src/toolbar/block/blocktoolbar.d.ts +171 -0
- package/src/toolbar/block/blocktoolbar.js +492 -0
- package/src/toolbar/normalizetoolbarconfig.d.ts +40 -0
- package/src/toolbar/normalizetoolbarconfig.js +52 -0
- package/src/toolbar/toolbarlinebreakview.d.ts +18 -0
- package/src/toolbar/toolbarlinebreakview.js +28 -0
- package/src/toolbar/toolbarseparatorview.d.ts +18 -0
- package/src/toolbar/toolbarseparatorview.js +28 -0
- package/src/toolbar/toolbarview.d.ts +267 -0
- package/src/toolbar/toolbarview.js +721 -0
- package/src/tooltipmanager.d.ts +188 -0
- package/src/tooltipmanager.js +413 -0
- package/src/view.d.ts +422 -0
- package/src/view.js +396 -0
- package/src/viewcollection.d.ts +139 -0
- package/src/viewcollection.js +206 -0
- package/theme/components/arialiveannouncer/arialiveannouncer.css +14 -0
- package/theme/components/autocomplete/autocomplete.css +22 -0
- package/theme/components/button/button.css +39 -0
- package/theme/components/button/listitembutton.css +48 -0
- package/theme/components/button/switchbutton.css +14 -0
- package/theme/components/collapsible/collapsible.css +10 -0
- package/theme/components/colorgrid/colorgrid.css +8 -0
- package/theme/components/colorpicker/colorpicker.css +34 -0
- package/theme/components/colorselector/colorselector.css +35 -0
- package/theme/components/dialog/dialog.css +39 -0
- package/theme/components/dialog/dialogactions.css +11 -0
- package/theme/components/dropdown/dropdown.css +95 -0
- package/theme/components/dropdown/listdropdown.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenu.css +8 -0
- package/theme/components/dropdown/menu/dropdownmenubutton.css +9 -0
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenupanel.css +11 -0
- package/theme/components/dropdown/splitbutton.css +14 -0
- package/theme/components/dropdown/toolbardropdown.css +20 -0
- package/theme/components/editorui/accessibilityhelp.css +10 -0
- package/theme/components/editorui/editorui.css +10 -0
- package/theme/components/formheader/formheader.css +16 -0
- package/theme/components/highlightedtext/highlightedtext.css +12 -0
- package/theme/components/icon/icon.css +8 -0
- package/theme/components/input/input.css +10 -0
- package/theme/components/label/label.css +12 -0
- package/theme/components/labeledfield/labeledfieldview.css +16 -0
- package/theme/components/labeledinput/labeledinput.css +10 -0
- package/theme/components/list/list.css +26 -0
- package/theme/components/menubar/menubar.css +10 -0
- package/theme/components/menubar/menubarmenu.css +9 -0
- package/theme/components/menubar/menubarmenubutton.css +11 -0
- package/theme/components/menubar/menubarmenulistitem.css +10 -0
- package/theme/components/menubar/menubarmenulistitembutton.css +10 -0
- package/theme/components/menubar/menubarmenupanel.css +62 -0
- package/theme/components/panel/balloonpanel.css +56 -0
- package/theme/components/panel/balloonrotator.css +17 -0
- package/theme/components/panel/fakepanel.css +23 -0
- package/theme/components/panel/stickypanel.css +17 -0
- package/theme/components/responsive-form/responsiveform.css +42 -0
- package/theme/components/search/search.css +43 -0
- package/theme/components/spinner/spinner.css +23 -0
- package/theme/components/textarea/textarea.css +10 -0
- package/theme/components/toolbar/blocktoolbar.css +9 -0
- package/theme/components/toolbar/toolbar.css +58 -0
- package/theme/components/tooltip/tooltip.css +12 -0
- package/theme/globals/_evaluationbadge.css +50 -0
- package/theme/globals/_hidden.css +13 -0
- package/theme/globals/_poweredby.css +72 -0
- package/theme/globals/_transition.css +12 -0
- package/theme/globals/_zindex.css +10 -0
- package/theme/globals/globals.css +10 -0
- package/theme/icons/accessibility.svg +1 -0
- package/theme/icons/color-tile-check.svg +1 -0
- package/theme/icons/dropdown-arrow.svg +1 -0
- package/theme/icons/project-logo.svg +1 -0
- package/theme/mixins/_dir.css +10 -0
- package/theme/mixins/_mediacolors.css +20 -0
- package/theme/mixins/_rwd.css +10 -0
- package/theme/mixins/_unselectable.css +14 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/toolbar/balloon/balloontoolbar
|
|
7
|
+
*/
|
|
8
|
+
import ContextualBalloon from '../../panel/balloon/contextualballoon.js';
|
|
9
|
+
import ToolbarView from '../toolbarview.js';
|
|
10
|
+
import BalloonPanelView from '../../panel/balloon/balloonpanelview.js';
|
|
11
|
+
import normalizeToolbarConfig from '../normalizetoolbarconfig.js';
|
|
12
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
13
|
+
import { FocusTracker, Rect, ResizeObserver, env, global, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
14
|
+
import { Observer } from '@ckeditor/ckeditor5-engine';
|
|
15
|
+
import { debounce } from 'lodash-es';
|
|
16
|
+
const toPx = /* #__PURE__ */ toUnit('px');
|
|
17
|
+
/**
|
|
18
|
+
* The contextual toolbar.
|
|
19
|
+
*
|
|
20
|
+
* It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
|
|
21
|
+
*/
|
|
22
|
+
export default class BalloonToolbar extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName() {
|
|
27
|
+
return 'BalloonToolbar';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get isOfficialPlugin() {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
static get requires() {
|
|
39
|
+
return [ContextualBalloon];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
44
|
+
constructor(editor) {
|
|
45
|
+
super(editor);
|
|
46
|
+
/**
|
|
47
|
+
* An instance of the resize observer that allows to respond to changes in editable's geometry
|
|
48
|
+
* so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
|
|
49
|
+
*
|
|
50
|
+
* **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
|
|
51
|
+
* {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.
|
|
52
|
+
*
|
|
53
|
+
* **Note:** Created in {@link #init}.
|
|
54
|
+
*/
|
|
55
|
+
this._resizeObserver = null;
|
|
56
|
+
this._balloonConfig = normalizeToolbarConfig(editor.config.get('balloonToolbar'));
|
|
57
|
+
this.toolbarView = this._createToolbarView();
|
|
58
|
+
this.focusTracker = new FocusTracker();
|
|
59
|
+
// Track focusable elements in the toolbar and the editable elements.
|
|
60
|
+
this._trackFocusableEditableElements();
|
|
61
|
+
this.focusTracker.add(this.toolbarView.element);
|
|
62
|
+
// Register the toolbar so it becomes available for Alt+F10 and Esc navigation.
|
|
63
|
+
editor.ui.addToolbar(this.toolbarView, {
|
|
64
|
+
beforeFocus: () => this.show(true),
|
|
65
|
+
afterBlur: () => this.hide(),
|
|
66
|
+
isContextual: true
|
|
67
|
+
});
|
|
68
|
+
this._balloon = editor.plugins.get(ContextualBalloon);
|
|
69
|
+
this._fireSelectionChangeDebounced = debounce(() => this.fire('_selectionChangeDebounced'), 200);
|
|
70
|
+
// The appearance of the BalloonToolbar method is event–driven.
|
|
71
|
+
// It is possible to stop the #show event and this prevent the toolbar from showing up.
|
|
72
|
+
this.decorate('show');
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
init() {
|
|
78
|
+
const editor = this.editor;
|
|
79
|
+
const selection = editor.model.document.selection;
|
|
80
|
+
// Show/hide the toolbar on editable focus/blur.
|
|
81
|
+
this.listenTo(this.focusTracker, 'change:isFocused', (evt, name, isFocused) => {
|
|
82
|
+
const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
|
|
83
|
+
if (!isFocused && isToolbarVisible) {
|
|
84
|
+
this.hide();
|
|
85
|
+
}
|
|
86
|
+
else if (isFocused) {
|
|
87
|
+
this.show();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
// Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.
|
|
91
|
+
this.listenTo(selection, 'change:range', (evt, data) => {
|
|
92
|
+
if (data.directChange || selection.isCollapsed) {
|
|
93
|
+
this.hide();
|
|
94
|
+
}
|
|
95
|
+
// Fire internal `_selectionChangeDebounced` event to use it for showing
|
|
96
|
+
// the toolbar after the selection stops changing.
|
|
97
|
+
this._fireSelectionChangeDebounced();
|
|
98
|
+
});
|
|
99
|
+
// Show the toolbar when the selection stops changing.
|
|
100
|
+
this.listenTo(this, '_selectionChangeDebounced', () => {
|
|
101
|
+
if (this.editor.editing.view.document.isFocused) {
|
|
102
|
+
this.show();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (!this._balloonConfig.shouldNotGroupWhenFull) {
|
|
106
|
+
this.listenTo(editor, 'ready', () => {
|
|
107
|
+
const editableElement = editor.ui.view.editable.element;
|
|
108
|
+
// Set #toolbarView's max-width on the initialization and update it on the editable resize.
|
|
109
|
+
this._resizeObserver = new ResizeObserver(editableElement, entry => {
|
|
110
|
+
// The max-width equals 90% of the editable's width for the best user experience.
|
|
111
|
+
// The value keeps the balloon very close to the boundaries of the editable and limits the cases
|
|
112
|
+
// when the balloon juts out from the editable element it belongs to.
|
|
113
|
+
this.toolbarView.maxWidth = toPx(entry.contentRect.width * .9);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// Listen to the toolbar view and whenever it changes its geometry due to some items being
|
|
118
|
+
// grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar
|
|
119
|
+
// means the balloon could be pointing at the wrong place. Once updated, the balloon will point
|
|
120
|
+
// at the right selection in the content again.
|
|
121
|
+
// https://github.com/ckeditor/ckeditor5/issues/6444
|
|
122
|
+
this.listenTo(this.toolbarView, 'groupedItemsUpdate', () => {
|
|
123
|
+
this._updatePosition();
|
|
124
|
+
});
|
|
125
|
+
// Creates toolbar components based on given configuration.
|
|
126
|
+
// This needs to be done when all plugins are ready.
|
|
127
|
+
editor.ui.once('ready', () => {
|
|
128
|
+
this.toolbarView.fillFromConfig(this._balloonConfig, this.editor.ui.componentFactory);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Creates the toolbar view instance.
|
|
133
|
+
*/
|
|
134
|
+
_createToolbarView() {
|
|
135
|
+
const t = this.editor.locale.t;
|
|
136
|
+
const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;
|
|
137
|
+
const toolbarView = new ToolbarView(this.editor.locale, {
|
|
138
|
+
shouldGroupWhenFull,
|
|
139
|
+
isFloating: true
|
|
140
|
+
});
|
|
141
|
+
toolbarView.ariaLabel = t('Editor contextual toolbar');
|
|
142
|
+
toolbarView.render();
|
|
143
|
+
return toolbarView;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Shows the toolbar and attaches it to the selection.
|
|
147
|
+
*
|
|
148
|
+
* Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.
|
|
149
|
+
*
|
|
150
|
+
* @param showForCollapsedSelection When set `true`, the toolbar will show despite collapsed selection in the
|
|
151
|
+
* editing view.
|
|
152
|
+
*/
|
|
153
|
+
show(showForCollapsedSelection = false) {
|
|
154
|
+
const editor = this.editor;
|
|
155
|
+
const selection = editor.model.document.selection;
|
|
156
|
+
const schema = editor.model.schema;
|
|
157
|
+
// Do not add the toolbar to the balloon stack twice.
|
|
158
|
+
if (this._balloon.hasView(this.toolbarView)) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// Do not show the toolbar when the selection is collapsed.
|
|
162
|
+
if (selection.isCollapsed && !showForCollapsedSelection) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
// Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.
|
|
166
|
+
// See https://github.com/ckeditor/ckeditor5/issues/6443.
|
|
167
|
+
if (selectionContainsOnlyMultipleSelectables(selection, schema)) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// Do not show the toolbar when all components inside are disabled
|
|
171
|
+
// see https://github.com/ckeditor/ckeditor5-ui/issues/269.
|
|
172
|
+
if (Array.from(this.toolbarView.items).every((item) => item.isEnabled !== undefined && !item.isEnabled)) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// Update the toolbar position when the editor ui should be refreshed.
|
|
176
|
+
this.listenTo(this.editor.ui, 'update', () => {
|
|
177
|
+
this._updatePosition();
|
|
178
|
+
});
|
|
179
|
+
// Add the toolbar to the common editor contextual balloon.
|
|
180
|
+
this._balloon.add({
|
|
181
|
+
view: this.toolbarView,
|
|
182
|
+
position: this._getBalloonPositionData(),
|
|
183
|
+
balloonClassName: 'ck-toolbar-container'
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Hides the toolbar.
|
|
188
|
+
*/
|
|
189
|
+
hide() {
|
|
190
|
+
if (this._balloon.hasView(this.toolbarView)) {
|
|
191
|
+
this.stopListening(this.editor.ui, 'update');
|
|
192
|
+
this._balloon.remove(this.toolbarView);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Add or remove editable elements to the focus tracker. It watches added and removed roots
|
|
197
|
+
* and adds or removes their editable elements to the focus tracker.
|
|
198
|
+
*/
|
|
199
|
+
_trackFocusableEditableElements() {
|
|
200
|
+
const { editor, focusTracker } = this;
|
|
201
|
+
const { editing } = editor;
|
|
202
|
+
editing.view.addObserver(class TrackEditableElements extends Observer {
|
|
203
|
+
/**
|
|
204
|
+
* @inheritDoc
|
|
205
|
+
*/
|
|
206
|
+
observe(domElement) {
|
|
207
|
+
focusTracker.add(domElement);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @inheritDoc
|
|
211
|
+
*/
|
|
212
|
+
stopObserving(domElement) {
|
|
213
|
+
focusTracker.remove(domElement);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Returns positioning options for the {@link #_balloon}. They control the way balloon is attached
|
|
219
|
+
* to the selection.
|
|
220
|
+
*/
|
|
221
|
+
_getBalloonPositionData() {
|
|
222
|
+
const editor = this.editor;
|
|
223
|
+
const view = editor.editing.view;
|
|
224
|
+
const viewDocument = view.document;
|
|
225
|
+
const viewSelection = viewDocument.selection;
|
|
226
|
+
// Get direction of the selection.
|
|
227
|
+
const isBackward = viewDocument.selection.isBackward;
|
|
228
|
+
return {
|
|
229
|
+
// Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed
|
|
230
|
+
// as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously
|
|
231
|
+
// computed and hence, the target is defined as a function instead of a static value.
|
|
232
|
+
// https://github.com/ckeditor/ckeditor5-ui/issues/195
|
|
233
|
+
target: () => {
|
|
234
|
+
const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();
|
|
235
|
+
const rangeRects = Rect.getDomRangeRects(view.domConverter.viewRangeToDom(range));
|
|
236
|
+
// Select the proper range rect depending on the direction of the selection.
|
|
237
|
+
if (isBackward) {
|
|
238
|
+
return rangeRects[0];
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// Ditch the zero-width "orphan" rect in the next line for the forward selection if there's
|
|
242
|
+
// another one preceding it. It is not rendered as a selection by the web browser anyway.
|
|
243
|
+
// https://github.com/ckeditor/ckeditor5-ui/issues/308
|
|
244
|
+
if (rangeRects.length > 1 && rangeRects[rangeRects.length - 1].width === 0) {
|
|
245
|
+
rangeRects.pop();
|
|
246
|
+
}
|
|
247
|
+
return rangeRects[rangeRects.length - 1];
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
positions: this._getBalloonPositions(isBackward)
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Updates the position of the {@link #_balloon} to make up for changes:
|
|
255
|
+
*
|
|
256
|
+
* * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),
|
|
257
|
+
* * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
|
|
258
|
+
*/
|
|
259
|
+
_updatePosition() {
|
|
260
|
+
this._balloon.updatePosition(this._getBalloonPositionData());
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* @inheritDoc
|
|
264
|
+
*/
|
|
265
|
+
destroy() {
|
|
266
|
+
super.destroy();
|
|
267
|
+
this.stopListening();
|
|
268
|
+
this._fireSelectionChangeDebounced.cancel();
|
|
269
|
+
this.toolbarView.destroy();
|
|
270
|
+
this.focusTracker.destroy();
|
|
271
|
+
if (this._resizeObserver) {
|
|
272
|
+
this._resizeObserver.destroy();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Returns toolbar positions for the given direction of the selection.
|
|
277
|
+
*/
|
|
278
|
+
_getBalloonPositions(isBackward) {
|
|
279
|
+
const isSafariIniOS = env.isSafari && env.isiOS;
|
|
280
|
+
// https://github.com/ckeditor/ckeditor5/issues/7707
|
|
281
|
+
const positions = isSafariIniOS ? BalloonPanelView.generatePositions({
|
|
282
|
+
// 20px when zoomed out. Less then 20px when zoomed in; the "radius" of the native selection handle gets
|
|
283
|
+
// smaller as the user zooms in. No less than the default v-offset, though.
|
|
284
|
+
heightOffset: Math.max(BalloonPanelView.arrowHeightOffset, Math.round(20 / global.window.visualViewport.scale))
|
|
285
|
+
}) : BalloonPanelView.defaultPositions;
|
|
286
|
+
return isBackward ? [
|
|
287
|
+
positions.northWestArrowSouth,
|
|
288
|
+
positions.northWestArrowSouthWest,
|
|
289
|
+
positions.northWestArrowSouthEast,
|
|
290
|
+
positions.northWestArrowSouthMiddleEast,
|
|
291
|
+
positions.northWestArrowSouthMiddleWest,
|
|
292
|
+
positions.southWestArrowNorth,
|
|
293
|
+
positions.southWestArrowNorthWest,
|
|
294
|
+
positions.southWestArrowNorthEast,
|
|
295
|
+
positions.southWestArrowNorthMiddleWest,
|
|
296
|
+
positions.southWestArrowNorthMiddleEast
|
|
297
|
+
] : [
|
|
298
|
+
positions.southEastArrowNorth,
|
|
299
|
+
positions.southEastArrowNorthEast,
|
|
300
|
+
positions.southEastArrowNorthWest,
|
|
301
|
+
positions.southEastArrowNorthMiddleEast,
|
|
302
|
+
positions.southEastArrowNorthMiddleWest,
|
|
303
|
+
positions.northEastArrowSouth,
|
|
304
|
+
positions.northEastArrowSouthEast,
|
|
305
|
+
positions.northEastArrowSouthWest,
|
|
306
|
+
positions.northEastArrowSouthMiddleEast,
|
|
307
|
+
positions.northEastArrowSouthMiddleWest
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Returns "true" when the selection has multiple ranges and each range contains a selectable element
|
|
313
|
+
* and nothing else.
|
|
314
|
+
*/
|
|
315
|
+
function selectionContainsOnlyMultipleSelectables(selection, schema) {
|
|
316
|
+
// It doesn't contain multiple objects if there is only one range.
|
|
317
|
+
if (selection.rangeCount === 1) {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
return [...selection.getRanges()].every(range => {
|
|
321
|
+
const element = range.getContainedElement();
|
|
322
|
+
return element && schema.isSelectable(element);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/toolbar/block/blockbuttonview
|
|
7
|
+
*/
|
|
8
|
+
import ButtonView from '../../button/buttonview.js';
|
|
9
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import '../../../theme/components/toolbar/blocktoolbar.css';
|
|
11
|
+
/**
|
|
12
|
+
* The block button view class.
|
|
13
|
+
*
|
|
14
|
+
* This view represents a button attached next to block element where the selection is anchored.
|
|
15
|
+
*
|
|
16
|
+
* See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.
|
|
17
|
+
*/
|
|
18
|
+
export default class BlockButtonView extends ButtonView {
|
|
19
|
+
/**
|
|
20
|
+
* Top offset.
|
|
21
|
+
*
|
|
22
|
+
* @observable
|
|
23
|
+
*/
|
|
24
|
+
top: number;
|
|
25
|
+
/**
|
|
26
|
+
* Left offset.
|
|
27
|
+
*
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
left: number;
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
constructor(locale?: Locale);
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/toolbar/block/blockbuttonview
|
|
7
|
+
*/
|
|
8
|
+
import ButtonView from '../../button/buttonview.js';
|
|
9
|
+
import { toUnit } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import '../../../theme/components/toolbar/blocktoolbar.css';
|
|
11
|
+
const toPx = /* #__PURE__ */ toUnit('px');
|
|
12
|
+
/**
|
|
13
|
+
* The block button view class.
|
|
14
|
+
*
|
|
15
|
+
* This view represents a button attached next to block element where the selection is anchored.
|
|
16
|
+
*
|
|
17
|
+
* See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.
|
|
18
|
+
*/
|
|
19
|
+
export default class BlockButtonView extends ButtonView {
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
constructor(locale) {
|
|
24
|
+
super(locale);
|
|
25
|
+
const bind = this.bindTemplate;
|
|
26
|
+
// Hide button on init.
|
|
27
|
+
this.isVisible = false;
|
|
28
|
+
this.isToggleable = true;
|
|
29
|
+
this.set('top', 0);
|
|
30
|
+
this.set('left', 0);
|
|
31
|
+
this.extendTemplate({
|
|
32
|
+
attributes: {
|
|
33
|
+
class: 'ck-block-toolbar-button',
|
|
34
|
+
style: {
|
|
35
|
+
top: bind.to('top', val => toPx(val)),
|
|
36
|
+
left: bind.to('left', val => toPx(val))
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/toolbar/block/blocktoolbar
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
import BlockButtonView from './blockbuttonview.js';
|
|
10
|
+
import BalloonPanelView from '../../panel/balloon/balloonpanelview.js';
|
|
11
|
+
import ToolbarView from '../toolbarview.js';
|
|
12
|
+
/**
|
|
13
|
+
* The block toolbar plugin.
|
|
14
|
+
*
|
|
15
|
+
* This plugin provides a button positioned next to the block of content where the selection is anchored.
|
|
16
|
+
* Upon clicking the button, a dropdown providing access to editor features shows up, as configured in
|
|
17
|
+
* {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.
|
|
18
|
+
*
|
|
19
|
+
* By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}
|
|
20
|
+
* as `$block` for which the toolbar provides at least one option.
|
|
21
|
+
*
|
|
22
|
+
* By default, the button is attached so its right boundary is touching the
|
|
23
|
+
* {@link module:engine/view/editableelement~EditableElement}:
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
26
|
+
* __ |
|
|
27
|
+
* | || This is a block of content that the
|
|
28
|
+
* ¯¯ | button is attached to. This is a
|
|
29
|
+
* | block of content that the button is
|
|
30
|
+
* | attached to.
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* The position of the button can be adjusted using the CSS `transform` property:
|
|
34
|
+
*
|
|
35
|
+
* ```css
|
|
36
|
+
* .ck-block-toolbar-button {
|
|
37
|
+
* transform: translateX( -10px );
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* ```
|
|
42
|
+
* __ |
|
|
43
|
+
* | | | This is a block of content that the
|
|
44
|
+
* ¯¯ | button is attached to. This is a
|
|
45
|
+
* | block of content that the button is
|
|
46
|
+
* | attached to.
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* **Note**: If you plan to run the editor in a right–to–left (RTL) language, keep in mind the button
|
|
50
|
+
* will be attached to the **right** boundary of the editable area. In that case, make sure the
|
|
51
|
+
* CSS position adjustment works properly by adding the following styles:
|
|
52
|
+
*
|
|
53
|
+
* ```css
|
|
54
|
+
* .ck[dir="rtl"] .ck-block-toolbar-button {
|
|
55
|
+
* transform: translateX( 10px );
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export default class BlockToolbar extends Plugin {
|
|
60
|
+
/**
|
|
61
|
+
* The toolbar view.
|
|
62
|
+
*/
|
|
63
|
+
readonly toolbarView: ToolbarView;
|
|
64
|
+
/**
|
|
65
|
+
* The balloon panel view, containing the {@link #toolbarView}.
|
|
66
|
+
*/
|
|
67
|
+
readonly panelView: BalloonPanelView;
|
|
68
|
+
/**
|
|
69
|
+
* The button view that opens the {@link #toolbarView}.
|
|
70
|
+
*/
|
|
71
|
+
readonly buttonView: BlockButtonView;
|
|
72
|
+
/**
|
|
73
|
+
* An instance of the resize observer that allows to respond to changes in editable's geometry
|
|
74
|
+
* so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
|
|
75
|
+
*
|
|
76
|
+
* **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
|
|
77
|
+
* {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.
|
|
78
|
+
*/
|
|
79
|
+
private _resizeObserver;
|
|
80
|
+
/**
|
|
81
|
+
* A cached and normalized `config.blockToolbar` object.
|
|
82
|
+
*/
|
|
83
|
+
private _blockToolbarConfig;
|
|
84
|
+
/**
|
|
85
|
+
* @inheritDoc
|
|
86
|
+
*/
|
|
87
|
+
static get pluginName(): "BlockToolbar";
|
|
88
|
+
/**
|
|
89
|
+
* @inheritDoc
|
|
90
|
+
*/
|
|
91
|
+
static get isOfficialPlugin(): true;
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
constructor(editor: Editor);
|
|
96
|
+
/**
|
|
97
|
+
* @inheritDoc
|
|
98
|
+
*/
|
|
99
|
+
init(): void;
|
|
100
|
+
/**
|
|
101
|
+
* @inheritDoc
|
|
102
|
+
*/
|
|
103
|
+
destroy(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Creates the {@link #toolbarView}.
|
|
106
|
+
*/
|
|
107
|
+
private _createToolbarView;
|
|
108
|
+
/**
|
|
109
|
+
* Creates the {@link #panelView}.
|
|
110
|
+
*/
|
|
111
|
+
private _createPanelView;
|
|
112
|
+
/**
|
|
113
|
+
* Creates the {@link #buttonView}.
|
|
114
|
+
*/
|
|
115
|
+
private _createButtonView;
|
|
116
|
+
/**
|
|
117
|
+
* Shows or hides the button.
|
|
118
|
+
* When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.
|
|
119
|
+
*/
|
|
120
|
+
private _updateButton;
|
|
121
|
+
/**
|
|
122
|
+
* Hides the button.
|
|
123
|
+
*/
|
|
124
|
+
private _hideButton;
|
|
125
|
+
/**
|
|
126
|
+
* Shows the {@link #toolbarView} attached to the {@link #buttonView}.
|
|
127
|
+
* If the toolbar is already visible, then it simply repositions it.
|
|
128
|
+
*/
|
|
129
|
+
private _showPanel;
|
|
130
|
+
/**
|
|
131
|
+
* Returns currently selected editable, based on the model selection.
|
|
132
|
+
*/
|
|
133
|
+
private _getSelectedEditableElement;
|
|
134
|
+
/**
|
|
135
|
+
* Hides the {@link #toolbarView}.
|
|
136
|
+
*
|
|
137
|
+
* @param focusEditable When `true`, the editable will be focused after hiding the panel.
|
|
138
|
+
*/
|
|
139
|
+
private _hidePanel;
|
|
140
|
+
/**
|
|
141
|
+
* Repositions the button on scroll.
|
|
142
|
+
*/
|
|
143
|
+
private _repositionButtonOnScroll;
|
|
144
|
+
/**
|
|
145
|
+
* Attaches the {@link #buttonView} to the target block of content.
|
|
146
|
+
*
|
|
147
|
+
* @param targetElement Target element.
|
|
148
|
+
*/
|
|
149
|
+
private _attachButtonToElement;
|
|
150
|
+
/**
|
|
151
|
+
* Clips the button element to the viewport of the editable element.
|
|
152
|
+
*
|
|
153
|
+
* * If the button overflows the editable viewport, it is clipped to make it look like it's cut off by the editable scrollable region.
|
|
154
|
+
* * If the button is fully hidden by the top of the editable, it is not clickable but still visible in the DOM.
|
|
155
|
+
*
|
|
156
|
+
* @param buttonView The button view to clip.
|
|
157
|
+
* @param editableElement The editable element whose viewport is used for clipping.
|
|
158
|
+
*/
|
|
159
|
+
private _clipButtonToViewport;
|
|
160
|
+
/**
|
|
161
|
+
* Creates a resize observer that observes selected editable and resizes the toolbar panel accordingly.
|
|
162
|
+
*/
|
|
163
|
+
private _setupToolbarResize;
|
|
164
|
+
/**
|
|
165
|
+
* Gets the {@link #toolbarView} max-width, based on given `editableElement` width plus the distance between the farthest
|
|
166
|
+
* edge of the {@link #buttonView} and the editable.
|
|
167
|
+
*
|
|
168
|
+
* @returns A maximum width that toolbar can have, in pixels.
|
|
169
|
+
*/
|
|
170
|
+
private _getToolbarMaxWidth;
|
|
171
|
+
}
|