@ckeditor/ckeditor5-ui 41.3.1 → 41.4.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/dist/index-content.css +4 -0
- package/dist/index-editor.css +497 -0
- package/dist/index.css +942 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +14343 -0
- package/dist/index.js.map +1 -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/types/arialiveannouncer.d.ts +113 -0
- package/dist/types/augmentation.d.ts +92 -0
- package/dist/types/autocomplete/autocompleteview.d.ts +85 -0
- package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
- package/dist/types/bindings/clickoutsidehandler.d.ts +32 -0
- package/dist/types/bindings/csstransitiondisablermixin.d.ts +44 -0
- package/dist/types/bindings/draggableviewmixin.d.ts +50 -0
- package/dist/types/bindings/injectcsstransitiondisabler.d.ts +63 -0
- package/dist/types/bindings/preventdefault.d.ts +37 -0
- package/dist/types/bindings/submithandler.d.ts +61 -0
- package/dist/types/button/button.d.ts +185 -0
- package/dist/types/button/buttonlabel.d.ts +38 -0
- package/dist/types/button/buttonlabelview.d.ts +35 -0
- package/dist/types/button/buttonview.d.ts +189 -0
- package/dist/types/button/filedialogbuttonview.d.ts +84 -0
- package/dist/types/button/switchbuttonview.d.ts +49 -0
- package/dist/types/collapsible/collapsibleview.d.ts +74 -0
- package/dist/types/colorgrid/colorgridview.d.ts +136 -0
- package/dist/types/colorgrid/colortileview.d.ts +32 -0
- package/dist/types/colorgrid/utils.d.ts +51 -0
- package/dist/types/colorpicker/colorpickerview.d.ts +177 -0
- package/dist/types/colorpicker/utils.d.ts +52 -0
- package/dist/types/colorselector/colorgridsfragmentview.d.ts +199 -0
- package/dist/types/colorselector/colorpickerfragmentview.d.ts +137 -0
- package/dist/types/colorselector/colorselectorview.d.ts +246 -0
- package/dist/types/colorselector/documentcolorcollection.d.ts +74 -0
- package/dist/types/componentfactory.d.ts +85 -0
- package/dist/types/dialog/dialog.d.ts +277 -0
- package/dist/types/dialog/dialogactionsview.d.ts +73 -0
- package/dist/types/dialog/dialogcontentview.d.ts +31 -0
- package/dist/types/dialog/dialogview.d.ts +260 -0
- package/dist/types/dropdown/button/dropdownbutton.d.ts +29 -0
- package/dist/types/dropdown/button/dropdownbuttonview.d.ts +52 -0
- package/dist/types/dropdown/button/splitbuttonview.d.ts +166 -0
- package/dist/types/dropdown/dropdownpanelfocusable.d.ts +25 -0
- package/dist/types/dropdown/dropdownpanelview.d.ts +66 -0
- package/dist/types/dropdown/dropdownview.d.ts +319 -0
- package/dist/types/dropdown/utils.d.ts +239 -0
- package/dist/types/editableui/editableuiview.d.ts +76 -0
- package/dist/types/editableui/inline/inlineeditableuiview.d.ts +44 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
- package/dist/types/editorui/bodycollection.d.ts +59 -0
- package/dist/types/editorui/boxed/boxededitoruiview.d.ts +44 -0
- package/dist/types/editorui/editorui.d.ts +292 -0
- package/dist/types/editorui/editoruiview.d.ts +43 -0
- package/dist/types/editorui/poweredby.d.ts +75 -0
- package/dist/types/focuscycler.d.ts +249 -0
- package/dist/types/formheader/formheaderview.d.ts +63 -0
- package/dist/types/highlightedtext/highlightedtextview.d.ts +42 -0
- package/dist/types/icon/iconview.d.ts +92 -0
- package/dist/types/iframe/iframeview.d.ts +54 -0
- package/dist/types/index.d.ts +87 -0
- package/dist/types/input/inputbase.d.ts +123 -0
- package/dist/types/input/inputview.d.ts +40 -0
- package/dist/types/inputnumber/inputnumberview.d.ts +53 -0
- package/dist/types/inputtext/inputtextview.d.ts +22 -0
- package/dist/types/label/labelview.d.ts +40 -0
- package/dist/types/labeledfield/labeledfieldview.d.ts +191 -0
- package/dist/types/labeledfield/utils.d.ts +127 -0
- package/dist/types/labeledinput/labeledinputview.d.ts +129 -0
- package/dist/types/list/listitemgroupview.d.ts +63 -0
- package/dist/types/list/listitemview.d.ts +40 -0
- package/dist/types/list/listseparatorview.d.ts +22 -0
- package/dist/types/list/listview.d.ts +128 -0
- package/dist/types/menubar/menubarmenubuttonview.d.ts +39 -0
- package/dist/types/menubar/menubarmenulistitembuttonview.d.ts +25 -0
- package/dist/types/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
- package/dist/types/menubar/menubarmenulistitemview.d.ts +29 -0
- package/dist/types/menubar/menubarmenulistview.d.ts +28 -0
- package/dist/types/menubar/menubarmenupanelview.d.ts +57 -0
- package/dist/types/menubar/menubarmenuview.d.ts +113 -0
- package/dist/types/menubar/menubarview.d.ts +168 -0
- package/dist/types/menubar/utils.d.ts +443 -0
- package/dist/types/model.d.ts +26 -0
- package/dist/types/notification/notification.d.ts +215 -0
- package/dist/types/panel/balloon/balloonpanelview.d.ts +689 -0
- package/dist/types/panel/balloon/contextualballoon.d.ts +303 -0
- package/dist/types/panel/sticky/stickypanelview.d.ts +160 -0
- package/dist/types/search/filteredview.d.ts +35 -0
- package/dist/types/search/searchinfoview.d.ts +49 -0
- package/dist/types/search/searchresultsview.d.ts +58 -0
- package/dist/types/search/text/searchtextqueryview.d.ts +80 -0
- package/dist/types/search/text/searchtextview.d.ts +223 -0
- package/dist/types/spinner/spinnerview.d.ts +29 -0
- package/dist/types/template.d.ts +946 -0
- package/dist/types/textarea/textareaview.d.ts +108 -0
- package/dist/types/toolbar/balloon/balloontoolbar.d.ts +121 -0
- package/dist/types/toolbar/block/blockbuttonview.d.ts +39 -0
- package/dist/types/toolbar/block/blocktoolbar.d.ts +157 -0
- package/dist/types/toolbar/normalizetoolbarconfig.d.ts +44 -0
- package/dist/types/toolbar/toolbarlinebreakview.d.ts +22 -0
- package/dist/types/toolbar/toolbarseparatorview.d.ts +22 -0
- package/dist/types/toolbar/toolbarview.d.ts +271 -0
- package/dist/types/tooltipmanager.d.ts +199 -0
- package/dist/types/view.d.ts +426 -0
- package/dist/types/viewcollection.d.ts +143 -0
- package/lang/contexts.json +2 -1
- package/lang/translations/af.po +4 -0
- package/lang/translations/ar.po +4 -0
- package/lang/translations/ast.po +4 -0
- package/lang/translations/az.po +4 -0
- package/lang/translations/bg.po +4 -0
- package/lang/translations/bn.po +4 -0
- package/lang/translations/bs.po +4 -0
- package/lang/translations/ca.po +4 -0
- package/lang/translations/cs.po +4 -0
- package/lang/translations/da.po +4 -0
- package/lang/translations/de-ch.po +4 -0
- package/lang/translations/de.po +4 -0
- package/lang/translations/el.po +4 -0
- package/lang/translations/en-au.po +4 -0
- package/lang/translations/en-gb.po +4 -0
- package/lang/translations/en.po +4 -0
- package/lang/translations/eo.po +4 -0
- package/lang/translations/es-co.po +4 -0
- package/lang/translations/es.po +4 -0
- package/lang/translations/et.po +4 -0
- package/lang/translations/eu.po +4 -0
- package/lang/translations/fa.po +4 -0
- package/lang/translations/fi.po +4 -0
- package/lang/translations/fr.po +4 -0
- package/lang/translations/gl.po +4 -0
- package/lang/translations/he.po +4 -0
- package/lang/translations/hi.po +4 -0
- package/lang/translations/hr.po +4 -0
- package/lang/translations/hu.po +4 -0
- package/lang/translations/id.po +4 -0
- package/lang/translations/it.po +4 -0
- package/lang/translations/ja.po +4 -0
- package/lang/translations/jv.po +4 -0
- package/lang/translations/km.po +4 -0
- package/lang/translations/kn.po +4 -0
- package/lang/translations/ko.po +4 -0
- package/lang/translations/ku.po +4 -0
- package/lang/translations/lt.po +4 -0
- package/lang/translations/lv.po +4 -0
- package/lang/translations/ms.po +4 -0
- package/lang/translations/nb.po +4 -0
- package/lang/translations/ne.po +4 -0
- package/lang/translations/nl.po +4 -0
- package/lang/translations/no.po +4 -0
- package/lang/translations/pl.po +4 -0
- package/lang/translations/pt-br.po +4 -0
- package/lang/translations/pt.po +4 -0
- package/lang/translations/ro.po +4 -0
- package/lang/translations/ru.po +4 -0
- package/lang/translations/sk.po +4 -0
- package/lang/translations/sl.po +4 -0
- package/lang/translations/sq.po +4 -0
- package/lang/translations/sr-latn.po +4 -0
- package/lang/translations/sr.po +4 -0
- package/lang/translations/sv.po +4 -0
- package/lang/translations/th.po +4 -0
- package/lang/translations/ti.po +214 -0
- package/lang/translations/tk.po +4 -0
- package/lang/translations/tr.po +4 -0
- package/lang/translations/tt.po +4 -0
- package/lang/translations/ug.po +4 -0
- package/lang/translations/uk.po +4 -0
- package/lang/translations/ur.po +4 -0
- package/lang/translations/uz.po +4 -0
- package/lang/translations/vi.po +4 -0
- package/lang/translations/zh-cn.po +4 -0
- package/lang/translations/zh.po +4 -0
- package/package.json +4 -3
- package/src/arialiveannouncer.d.ts +34 -23
- package/src/arialiveannouncer.js +80 -30
- package/src/colorgrid/colortileview.d.ts +1 -1
- package/src/colorgrid/colortileview.js +3 -1
- package/src/colorpicker/colorpickerview.d.ts +32 -1
- package/src/colorpicker/colorpickerview.js +62 -13
- package/src/colorselector/colorpickerfragmentview.d.ts +4 -0
- package/src/colorselector/colorpickerfragmentview.js +13 -5
- package/src/colorselector/colorselectorview.js +1 -0
- package/src/index.d.ts +4 -4
- package/src/index.js +3 -2
- package/src/menubar/utils.d.ts +8 -1
- package/src/menubar/utils.js +26 -2
- package/src/toolbar/toolbarview.js +2 -3
- package/theme/components/arialiveannouncer/arialiveannouncer.css +4 -0
- package/theme/components/tooltip/tooltip.css +4 -0
- package/theme/globals/globals.css +0 -1
- package/theme/mixins/_mediacolors.css +20 -0
- package/theme/globals/_reset.css +0 -13
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editableui/editableuiview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import type { EditingView } from '@ckeditor/ckeditor5-engine';
|
|
14
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
15
|
+
/**
|
|
16
|
+
* The editable UI view class.
|
|
17
|
+
*/
|
|
18
|
+
export default class EditableUIView extends View {
|
|
19
|
+
/**
|
|
20
|
+
* The name of the editable UI view.
|
|
21
|
+
*/
|
|
22
|
+
name: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Controls whether the editable is focused, i.e. the user is typing in it.
|
|
25
|
+
*
|
|
26
|
+
* @observable
|
|
27
|
+
*/
|
|
28
|
+
isFocused: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The editing view instance the editable is related to. Editable uses the editing
|
|
31
|
+
* view to dynamically modify its certain DOM attributes after {@link #render rendering}.
|
|
32
|
+
*
|
|
33
|
+
* **Note**: The DOM attributes are performed by the editing view and not UI
|
|
34
|
+
* {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
|
|
35
|
+
* the editable DOM element must remain under the full control of the engine to work properly.
|
|
36
|
+
*/
|
|
37
|
+
protected _editingView: EditingView;
|
|
38
|
+
/**
|
|
39
|
+
* The element which is the main editable element (usually the one with `contentEditable="true"`).
|
|
40
|
+
*/
|
|
41
|
+
private _editableElement;
|
|
42
|
+
/**
|
|
43
|
+
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
44
|
+
* the view will not render its {@link #template}.
|
|
45
|
+
*/
|
|
46
|
+
private _hasExternalElement;
|
|
47
|
+
/**
|
|
48
|
+
* Creates an instance of EditableUIView class.
|
|
49
|
+
*
|
|
50
|
+
* @param locale The locale instance.
|
|
51
|
+
* @param editingView The editing view instance the editable is related to.
|
|
52
|
+
* @param editableElement The editable element. If not specified, this view
|
|
53
|
+
* should create it. Otherwise, the existing element should be used.
|
|
54
|
+
*/
|
|
55
|
+
constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement);
|
|
56
|
+
/**
|
|
57
|
+
* Renders the view by either applying the {@link #template} to the existing
|
|
58
|
+
* {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement} or assigning {@link #element}
|
|
59
|
+
* as {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement}.
|
|
60
|
+
*/
|
|
61
|
+
render(): void;
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
destroy(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
68
|
+
* the view will not render its {@link #template}.
|
|
69
|
+
*/
|
|
70
|
+
get hasExternalElement(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
|
|
73
|
+
* the {@link #isFocused} property value using the {@link #_editingView editing view} API.
|
|
74
|
+
*/
|
|
75
|
+
private _updateIsFocusedClasses;
|
|
76
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editableui/inline/inlineeditableuiview
|
|
11
|
+
*/
|
|
12
|
+
import EditableUIView from '../editableuiview.js';
|
|
13
|
+
import type { EditingView } from '@ckeditor/ckeditor5-engine';
|
|
14
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
15
|
+
/**
|
|
16
|
+
* The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
|
|
17
|
+
*/
|
|
18
|
+
export default class InlineEditableUIView extends EditableUIView {
|
|
19
|
+
/**
|
|
20
|
+
* A function that gets called with the instance of this view as an argument and should return a string that
|
|
21
|
+
* represents the label of the editable for assistive technologies.
|
|
22
|
+
*/
|
|
23
|
+
private readonly _generateLabel;
|
|
24
|
+
/**
|
|
25
|
+
* Creates an instance of the InlineEditableUIView class.
|
|
26
|
+
*
|
|
27
|
+
* @param locale The locale instance.
|
|
28
|
+
* @param editingView The editing view instance the editable is related to.
|
|
29
|
+
* @param editableElement The editable element. If not specified, the
|
|
30
|
+
* {@link module:ui/editableui/editableuiview~EditableUIView}
|
|
31
|
+
* will create it. Otherwise, the existing element will be used.
|
|
32
|
+
* @param options Additional configuration of the view.
|
|
33
|
+
* @param options.label A function that gets called with the instance of this view as an argument
|
|
34
|
+
* and should return a string that represents the label of the editable for assistive technologies. If not provided,
|
|
35
|
+
* a default label generator is used.
|
|
36
|
+
*/
|
|
37
|
+
constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?: {
|
|
38
|
+
label?: (view: InlineEditableUIView) => string;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
render(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/accessibilityhelp/accessibilityhelp
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
13
|
+
import { Dialog } from '../../index.js';
|
|
14
|
+
import AccessibilityHelpContentView from './accessibilityhelpcontentview.js';
|
|
15
|
+
import '../../../theme/components/editorui/accessibilityhelp.css';
|
|
16
|
+
/**
|
|
17
|
+
* A plugin that brings the accessibility help dialog to the editor available under the <kbd>Alt</kbd>+<kbd>0</kbd>
|
|
18
|
+
* keystroke and via the "Accessibility help" toolbar button. The dialog displays a list of keystrokes that can be used
|
|
19
|
+
* by the user to perform various actions in the editor.
|
|
20
|
+
*
|
|
21
|
+
* Keystroke information is loaded from {@link module:core/accessibility~Accessibility#keystrokeInfos}. New entries can be
|
|
22
|
+
* added using the API provided by the {@link module:core/accessibility~Accessibility} class.
|
|
23
|
+
*/
|
|
24
|
+
export default class AccessibilityHelp extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* The view that displays the dialog content (list of keystrokes).
|
|
27
|
+
* Created when the dialog is opened for the first time.
|
|
28
|
+
*/
|
|
29
|
+
contentView: AccessibilityHelpContentView | null;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get requires(): readonly [typeof Dialog];
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static get pluginName(): "AccessibilityHelp";
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
init(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a button to show accessibility help dialog, for use either in toolbar or in menu bar.
|
|
44
|
+
*/
|
|
45
|
+
private _createButton;
|
|
46
|
+
/**
|
|
47
|
+
* Injects a help text into each editing root's `aria-label` attribute allowing assistive technology users
|
|
48
|
+
* to discover the availability of the Accessibility help dialog.
|
|
49
|
+
*/
|
|
50
|
+
private _setupRootLabels;
|
|
51
|
+
/**
|
|
52
|
+
* Shows the accessibility help dialog. Also, creates {@link #contentView} on demand.
|
|
53
|
+
*/
|
|
54
|
+
private _showDialog;
|
|
55
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/accessibilityhelp/accessibilityhelpcontentview
|
|
11
|
+
*/
|
|
12
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import View from '../../view.js';
|
|
14
|
+
import type { KeystrokeInfoDefinitions } from '@ckeditor/ckeditor5-core';
|
|
15
|
+
/**
|
|
16
|
+
* The view displaying keystrokes in the Accessibility help dialog.
|
|
17
|
+
*/
|
|
18
|
+
export default class AccessibilityHelpContentView extends View<HTMLDivElement> {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
constructor(locale: Locale, keystrokes: KeystrokeInfoDefinitions);
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
focus(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Creates `<section><h3>Category label</h3>...</section>` elements for each category of keystrokes.
|
|
29
|
+
*/
|
|
30
|
+
private _createCategories;
|
|
31
|
+
/**
|
|
32
|
+
* Creates `[<h4>Optional label</h4>]<dl>...</dl>` elements for each group of keystrokes in a category.
|
|
33
|
+
*/
|
|
34
|
+
private _createGroup;
|
|
35
|
+
/**
|
|
36
|
+
* Creates `<dt>Keystroke label</dt><dd>Keystroke definition</dd>` elements for each keystroke in a group.
|
|
37
|
+
*/
|
|
38
|
+
private _createGroupRow;
|
|
39
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import ViewCollection from '../viewcollection.js';
|
|
10
|
+
import type View from '../view.js';
|
|
11
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
|
+
/**
|
|
13
|
+
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
|
|
14
|
+
* from the DOM structure of the editor, like panels, icons, etc.
|
|
15
|
+
*
|
|
16
|
+
* The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
|
|
17
|
+
* Any plugin can add a {@link module:ui/view~View view} to this collection.
|
|
18
|
+
* These views will render in a container placed directly in the `<body>` element.
|
|
19
|
+
* The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
|
|
20
|
+
*
|
|
21
|
+
* If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.
|
|
22
|
+
*
|
|
23
|
+
* A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
|
|
24
|
+
* If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of
|
|
25
|
+
* elements created directly in the body and remove it when the last body collection will be
|
|
26
|
+
* {@link ~BodyCollection#detachFromDom detached}.
|
|
27
|
+
*/
|
|
28
|
+
export default class BodyCollection extends ViewCollection {
|
|
29
|
+
/**
|
|
30
|
+
* The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
|
|
31
|
+
* See the view {@link module:ui/view~View#locale locale} property.
|
|
32
|
+
*/
|
|
33
|
+
readonly locale: Locale;
|
|
34
|
+
/**
|
|
35
|
+
* The element holding elements of the body region.
|
|
36
|
+
*/
|
|
37
|
+
private _bodyCollectionContainer?;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
|
|
40
|
+
*
|
|
41
|
+
* @param locale The {@link module:core/editor/editor~Editor editor's locale} instance.
|
|
42
|
+
* @param initialItems The initial items of the collection.
|
|
43
|
+
*/
|
|
44
|
+
constructor(locale: Locale, initialItems?: Iterable<View>);
|
|
45
|
+
/**
|
|
46
|
+
* The element holding elements of the body region.
|
|
47
|
+
*/
|
|
48
|
+
get bodyCollectionContainer(): HTMLElement | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Attaches the body collection to the DOM body element. You need to execute this method to render the content of
|
|
51
|
+
* the body collection.
|
|
52
|
+
*/
|
|
53
|
+
attachToDom(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
|
|
56
|
+
* anymore to clean-up the DOM structure.
|
|
57
|
+
*/
|
|
58
|
+
detachFromDom(): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/boxed/boxededitoruiview
|
|
11
|
+
*/
|
|
12
|
+
import EditorUIView from '../editoruiview.js';
|
|
13
|
+
import type ViewCollection from '../../viewcollection.js';
|
|
14
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
15
|
+
/**
|
|
16
|
+
* The boxed editor UI view class. This class represents an editor interface
|
|
17
|
+
* consisting of a toolbar and an editable area, enclosed within a box.
|
|
18
|
+
*/
|
|
19
|
+
export default abstract class BoxedEditorUIView extends EditorUIView {
|
|
20
|
+
/**
|
|
21
|
+
* Collection of the child views located in the top (`.ck-editor__top`)
|
|
22
|
+
* area of the UI.
|
|
23
|
+
*/
|
|
24
|
+
readonly top: ViewCollection;
|
|
25
|
+
/**
|
|
26
|
+
* Collection of the child views located in the main (`.ck-editor__main`)
|
|
27
|
+
* area of the UI.
|
|
28
|
+
*/
|
|
29
|
+
readonly main: ViewCollection;
|
|
30
|
+
/**
|
|
31
|
+
* Voice label of the UI.
|
|
32
|
+
*/
|
|
33
|
+
private readonly _voiceLabelView;
|
|
34
|
+
/**
|
|
35
|
+
* Creates an instance of the boxed editor UI view class.
|
|
36
|
+
*
|
|
37
|
+
* @param locale The locale instance..
|
|
38
|
+
*/
|
|
39
|
+
constructor(locale: Locale);
|
|
40
|
+
/**
|
|
41
|
+
* Creates a voice label view instance.
|
|
42
|
+
*/
|
|
43
|
+
private _createVoiceLabel;
|
|
44
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/editorui
|
|
11
|
+
*/
|
|
12
|
+
import ComponentFactory from '../componentfactory.js';
|
|
13
|
+
import TooltipManager from '../tooltipmanager.js';
|
|
14
|
+
import PoweredBy from './poweredby.js';
|
|
15
|
+
import AriaLiveAnnouncer from '../arialiveannouncer.js';
|
|
16
|
+
import type EditorUIView from './editoruiview.js';
|
|
17
|
+
import type ToolbarView from '../toolbar/toolbarview.js';
|
|
18
|
+
import { FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
19
|
+
import type { Editor } from '@ckeditor/ckeditor5-core';
|
|
20
|
+
declare const EditorUI_base: {
|
|
21
|
+
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
22
|
+
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A class providing the minimal interface that is required to successfully bootstrap any editor UI.
|
|
26
|
+
*/
|
|
27
|
+
export default abstract class EditorUI extends EditorUI_base {
|
|
28
|
+
/**
|
|
29
|
+
* The editor that the UI belongs to.
|
|
30
|
+
*/
|
|
31
|
+
readonly editor: Editor;
|
|
32
|
+
/**
|
|
33
|
+
* An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
|
|
34
|
+
* to register factories of specific UI components.
|
|
35
|
+
*/
|
|
36
|
+
readonly componentFactory: ComponentFactory;
|
|
37
|
+
/**
|
|
38
|
+
* Stores the information about the editor UI focus and propagates it so various plugins and components
|
|
39
|
+
* are unified as a focus group.
|
|
40
|
+
*/
|
|
41
|
+
readonly focusTracker: FocusTracker;
|
|
42
|
+
/**
|
|
43
|
+
* Manages the tooltips displayed on mouseover and focus across the UI.
|
|
44
|
+
*/
|
|
45
|
+
readonly tooltipManager: TooltipManager;
|
|
46
|
+
/**
|
|
47
|
+
* A helper that enables the "powered by" feature in the editor and renders a link to the project's webpage.
|
|
48
|
+
*/
|
|
49
|
+
readonly poweredBy: PoweredBy;
|
|
50
|
+
/**
|
|
51
|
+
* A helper that manages the content of an `aria-live` regions used by editor features to announce status changes
|
|
52
|
+
* to screen readers.
|
|
53
|
+
*/
|
|
54
|
+
readonly ariaLiveAnnouncer: AriaLiveAnnouncer;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates the UI is ready. Set `true` after {@link #event:ready} event is fired.
|
|
57
|
+
*
|
|
58
|
+
* @readonly
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
isReady: boolean;
|
|
62
|
+
abstract get view(): EditorUIView;
|
|
63
|
+
/**
|
|
64
|
+
* Stores viewport offsets from every direction.
|
|
65
|
+
*
|
|
66
|
+
* Viewport offset can be used to constrain balloons or other UI elements into an element smaller than the viewport.
|
|
67
|
+
* This can be useful if there are any other absolutely positioned elements that may interfere with editor UI.
|
|
68
|
+
*
|
|
69
|
+
* Example `editor.ui.viewportOffset` returns:
|
|
70
|
+
*
|
|
71
|
+
* ```js
|
|
72
|
+
* {
|
|
73
|
+
* top: 50,
|
|
74
|
+
* right: 50,
|
|
75
|
+
* bottom: 50,
|
|
76
|
+
* left: 50
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* This property can be overriden after editor already being initialized:
|
|
81
|
+
*
|
|
82
|
+
* ```js
|
|
83
|
+
* editor.ui.viewportOffset = {
|
|
84
|
+
* top: 100,
|
|
85
|
+
* right: 0,
|
|
86
|
+
* bottom: 0,
|
|
87
|
+
* left: 0
|
|
88
|
+
* };
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @observable
|
|
92
|
+
*/
|
|
93
|
+
viewportOffset: {
|
|
94
|
+
left?: number;
|
|
95
|
+
right?: number;
|
|
96
|
+
top?: number;
|
|
97
|
+
bottom?: number;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Stores all editable elements used by the editor instance.
|
|
101
|
+
*/
|
|
102
|
+
private _editableElementsMap;
|
|
103
|
+
/**
|
|
104
|
+
* All available & focusable toolbars.
|
|
105
|
+
*/
|
|
106
|
+
private _focusableToolbarDefinitions;
|
|
107
|
+
/**
|
|
108
|
+
* Creates an instance of the editor UI class.
|
|
109
|
+
*
|
|
110
|
+
* @param editor The editor instance.
|
|
111
|
+
*/
|
|
112
|
+
constructor(editor: Editor);
|
|
113
|
+
/**
|
|
114
|
+
* The main (outermost) DOM element of the editor UI.
|
|
115
|
+
*
|
|
116
|
+
* For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
|
|
117
|
+
* wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
|
|
118
|
+
* it is the editable element itself (as there is no other wrapper). However, in
|
|
119
|
+
* {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
|
|
120
|
+
* come with a single "main" HTML element (its editable element and toolbar are separate).
|
|
121
|
+
*
|
|
122
|
+
* This property can be understood as a shorthand for retrieving the element that a specific editor integration
|
|
123
|
+
* considers to be its main DOM element.
|
|
124
|
+
*/
|
|
125
|
+
get element(): HTMLElement | null;
|
|
126
|
+
/**
|
|
127
|
+
* Fires the {@link module:ui/editorui/editorui~EditorUI#event:update `update`} event.
|
|
128
|
+
*
|
|
129
|
+
* This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
|
|
130
|
+
* some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
|
|
131
|
+
*/
|
|
132
|
+
update(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Destroys the UI.
|
|
135
|
+
*/
|
|
136
|
+
destroy(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Stores the native DOM editable element used by the editor under a unique name.
|
|
139
|
+
*
|
|
140
|
+
* Also, registers the element in the editor to maintain the accessibility of the UI. When the user is editing text in a focusable
|
|
141
|
+
* editable area, they can use the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke to navigate over editor toolbars. See {@link #addToolbar}.
|
|
142
|
+
*
|
|
143
|
+
* @param rootName The unique name of the editable element.
|
|
144
|
+
* @param domElement The native DOM editable element.
|
|
145
|
+
*/
|
|
146
|
+
setEditableElement(rootName: string, domElement: HTMLElement): void;
|
|
147
|
+
/**
|
|
148
|
+
* Removes the editable from the editor UI. Removes all handlers added by {@link #setEditableElement}.
|
|
149
|
+
*
|
|
150
|
+
* @param rootName The name of the editable element to remove.
|
|
151
|
+
*/
|
|
152
|
+
removeEditableElement(rootName: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* Returns the editable editor element with the given name or null if editable does not exist.
|
|
155
|
+
*
|
|
156
|
+
* @param rootName The editable name.
|
|
157
|
+
*/
|
|
158
|
+
getEditableElement(rootName?: string): HTMLElement | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Returns array of names of all editor editable elements.
|
|
161
|
+
*/
|
|
162
|
+
getEditableElementsNames(): IterableIterator<string>;
|
|
163
|
+
/**
|
|
164
|
+
* Adds a toolbar to the editor UI. Used primarily to maintain the accessibility of the UI.
|
|
165
|
+
*
|
|
166
|
+
* Focusable toolbars can be accessed (focused) by users by pressing the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.
|
|
167
|
+
* Successive keystroke presses navigate over available toolbars.
|
|
168
|
+
*
|
|
169
|
+
* @param toolbarView A instance of the toolbar to be registered.
|
|
170
|
+
*/
|
|
171
|
+
addToolbar(toolbarView: ToolbarView, options?: FocusableToolbarOptions): void;
|
|
172
|
+
/**
|
|
173
|
+
* Stores all editable elements used by the editor instance.
|
|
174
|
+
*
|
|
175
|
+
* @deprecated
|
|
176
|
+
*/
|
|
177
|
+
protected get _editableElements(): unknown;
|
|
178
|
+
/**
|
|
179
|
+
* Returns viewport offsets object:
|
|
180
|
+
*
|
|
181
|
+
* ```js
|
|
182
|
+
* {
|
|
183
|
+
* top: Number,
|
|
184
|
+
* right: Number,
|
|
185
|
+
* bottom: Number,
|
|
186
|
+
* left: Number
|
|
187
|
+
* }
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* Only top property is currently supported.
|
|
191
|
+
*/
|
|
192
|
+
private _readViewportOffsetFromConfig;
|
|
193
|
+
/**
|
|
194
|
+
* Starts listening for <kbd>Alt</kbd> + <kbd>F10</kbd> and <kbd>Esc</kbd> keystrokes in the context of focusable
|
|
195
|
+
* {@link #setEditableElement editable elements} and {@link #addToolbar toolbars}
|
|
196
|
+
* to allow users navigate across the UI.
|
|
197
|
+
*/
|
|
198
|
+
private _initFocusTracking;
|
|
199
|
+
/**
|
|
200
|
+
* Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.
|
|
201
|
+
*
|
|
202
|
+
* Focusable toolbars candidates are either:
|
|
203
|
+
* * already visible,
|
|
204
|
+
* * have `beforeFocus()` set in their {@link module:ui/editorui/editorui~FocusableToolbarDefinition definition} that suggests that
|
|
205
|
+
* they might show up when called. Keep in mind that determining whether a toolbar will show up (and become focusable) is impossible
|
|
206
|
+
* at this stage because it depends on its implementation, that in turn depends on the editing context (selection).
|
|
207
|
+
*
|
|
208
|
+
* **Note**: Contextual toolbars take precedence over regular toolbars.
|
|
209
|
+
*/
|
|
210
|
+
private _getFocusableCandidateToolbarDefinitions;
|
|
211
|
+
/**
|
|
212
|
+
* Returns a definition of the toolbar that is currently visible and focused (one of its children has focus).
|
|
213
|
+
*
|
|
214
|
+
* `null` is returned when no toolbar is currently focused.
|
|
215
|
+
*/
|
|
216
|
+
private _getCurrentFocusedToolbarDefinition;
|
|
217
|
+
/**
|
|
218
|
+
* Focuses a focusable toolbar candidate using its definition.
|
|
219
|
+
*
|
|
220
|
+
* @param candidateToolbarDefinition A definition of the toolbar to focus.
|
|
221
|
+
* @returns `true` when the toolbar candidate was focused. `false` otherwise.
|
|
222
|
+
*/
|
|
223
|
+
private _focusFocusableCandidateToolbar;
|
|
224
|
+
/**
|
|
225
|
+
* Provides an integration between {@link #viewportOffset} and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.
|
|
226
|
+
* It allows the UI-agnostic engine method to consider user-configured viewport offsets specific for the integration.
|
|
227
|
+
*
|
|
228
|
+
* @param evt The `scrollToTheSelection` event info.
|
|
229
|
+
* @param data The payload carried by the `scrollToTheSelection` event.
|
|
230
|
+
*/
|
|
231
|
+
private _handleScrollToTheSelection;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Fired when the editor UI is ready.
|
|
235
|
+
*
|
|
236
|
+
* Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
|
|
237
|
+
*
|
|
238
|
+
* @eventName ~EditorUI#ready
|
|
239
|
+
*/
|
|
240
|
+
export type EditorUIReadyEvent = {
|
|
241
|
+
name: 'ready';
|
|
242
|
+
args: [];
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Fired whenever the UI (all related components) should be refreshed.
|
|
246
|
+
*
|
|
247
|
+
* **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.
|
|
248
|
+
* It can also be fired manually via the {@link module:ui/editorui/editorui~EditorUI#update} method.
|
|
249
|
+
*
|
|
250
|
+
* @eventName ~EditorUI#update
|
|
251
|
+
*/
|
|
252
|
+
export type EditorUIUpdateEvent = {
|
|
253
|
+
name: 'update';
|
|
254
|
+
args: [];
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* A definition of a focusable toolbar. Used by {@link module:ui/editorui/editorui~EditorUI#addToolbar}.
|
|
258
|
+
*/
|
|
259
|
+
export interface FocusableToolbarDefinition {
|
|
260
|
+
/**
|
|
261
|
+
* An instance of a focusable toolbar view.
|
|
262
|
+
*/
|
|
263
|
+
toolbarView: ToolbarView;
|
|
264
|
+
/**
|
|
265
|
+
* Options of a focusable toolbar view:
|
|
266
|
+
*
|
|
267
|
+
* * `isContextual`: Marks the higher priority toolbar. For example when there are 2 visible toolbars,
|
|
268
|
+
* it allows to distinguish which toolbar should be focused first after the `alt+f10` keystroke
|
|
269
|
+
* * `beforeFocus`: A callback executed before the `ToolbarView` gains focus upon the `Alt+F10` keystroke.
|
|
270
|
+
* * `afterBlur`: A callback executed after `ToolbarView` loses focus upon `Esc` keystroke but before
|
|
271
|
+
* the focus goes back to the `origin`.
|
|
272
|
+
*/
|
|
273
|
+
options: FocusableToolbarOptions;
|
|
274
|
+
}
|
|
275
|
+
export interface FocusableToolbarOptions {
|
|
276
|
+
/**
|
|
277
|
+
* Set `true` if the toolbar is attached to the content of the editor. Such toolbar takes
|
|
278
|
+
* a precedence over other toolbars when a user pressed <kbd>Alt</kbd> + <kbd>F10</kbd>.
|
|
279
|
+
*/
|
|
280
|
+
isContextual?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Specify a callback executed before the toolbar instance DOM element gains focus
|
|
283
|
+
* upon the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.
|
|
284
|
+
*/
|
|
285
|
+
beforeFocus?: () => void;
|
|
286
|
+
/**
|
|
287
|
+
* Specify a callback executed after the toolbar instance DOM element loses focus upon
|
|
288
|
+
* <kbd>Esc</kbd> keystroke but before the focus goes back to the {@link ~EditorUI#setEditableElement editable element}.
|
|
289
|
+
*/
|
|
290
|
+
afterBlur?: () => void;
|
|
291
|
+
}
|
|
292
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module ui/editorui/editoruiview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import BodyCollection from './bodycollection.js';
|
|
14
|
+
import type EditableUIView from '../editableui/editableuiview.js';
|
|
15
|
+
import type { Locale, LocaleTranslate } from '@ckeditor/ckeditor5-utils';
|
|
16
|
+
import '../../theme/components/editorui/editorui.css';
|
|
17
|
+
/**
|
|
18
|
+
* The editor UI view class. Base class for the editor main views.
|
|
19
|
+
*/
|
|
20
|
+
export default abstract class EditorUIView extends View {
|
|
21
|
+
/**
|
|
22
|
+
* Collection of the child views, detached from the DOM
|
|
23
|
+
* structure of the editor, like panels, icons etc.
|
|
24
|
+
*/
|
|
25
|
+
readonly body: BodyCollection;
|
|
26
|
+
locale: Locale;
|
|
27
|
+
t: LocaleTranslate;
|
|
28
|
+
abstract get editable(): EditableUIView;
|
|
29
|
+
/**
|
|
30
|
+
* Creates an instance of the editor UI view class.
|
|
31
|
+
*
|
|
32
|
+
* @param locale The locale instance.
|
|
33
|
+
*/
|
|
34
|
+
constructor(locale: Locale);
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
render(): void;
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|