@ckeditor/ckeditor5-ui 47.6.1-alpha.1 → 48.0.0-alpha.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/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +3 -3
- package/{src → dist}/colorselector/documentcolorcollection.d.ts +4 -4
- package/{src → dist}/dialog/dialog.d.ts +1 -1
- package/dist/index-editor.css +2728 -587
- package/dist/index.css +2673 -850
- package/dist/index.css.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/{src → dist}/menubar/menubarmenuview.d.ts +4 -0
- package/{src → dist}/view.d.ts +1 -1
- package/package.json +25 -47
- package/lang/contexts.json +0 -51
- package/lang/translations/af.po +0 -208
- package/lang/translations/ar.po +0 -208
- package/lang/translations/ast.po +0 -208
- package/lang/translations/az.po +0 -208
- package/lang/translations/be.po +0 -208
- package/lang/translations/bg.po +0 -208
- package/lang/translations/bn.po +0 -208
- package/lang/translations/bs.po +0 -208
- package/lang/translations/ca.po +0 -208
- package/lang/translations/cs.po +0 -208
- package/lang/translations/da.po +0 -208
- package/lang/translations/de-ch.po +0 -208
- package/lang/translations/de.po +0 -208
- package/lang/translations/el.po +0 -208
- package/lang/translations/en-au.po +0 -208
- package/lang/translations/en-gb.po +0 -208
- package/lang/translations/en.po +0 -208
- package/lang/translations/eo.po +0 -208
- package/lang/translations/es-co.po +0 -208
- package/lang/translations/es.po +0 -208
- package/lang/translations/et.po +0 -208
- package/lang/translations/eu.po +0 -208
- package/lang/translations/fa.po +0 -208
- package/lang/translations/fi.po +0 -208
- package/lang/translations/fr.po +0 -208
- package/lang/translations/gl.po +0 -208
- package/lang/translations/gu.po +0 -208
- package/lang/translations/he.po +0 -208
- package/lang/translations/hi.po +0 -208
- package/lang/translations/hr.po +0 -208
- package/lang/translations/hu.po +0 -208
- package/lang/translations/hy.po +0 -208
- package/lang/translations/id.po +0 -208
- package/lang/translations/it.po +0 -208
- package/lang/translations/ja.po +0 -208
- package/lang/translations/jv.po +0 -208
- package/lang/translations/kk.po +0 -208
- package/lang/translations/km.po +0 -208
- package/lang/translations/kn.po +0 -208
- package/lang/translations/ko.po +0 -208
- package/lang/translations/ku.po +0 -208
- package/lang/translations/lt.po +0 -208
- package/lang/translations/lv.po +0 -208
- package/lang/translations/ms.po +0 -208
- package/lang/translations/nb.po +0 -208
- package/lang/translations/ne.po +0 -208
- package/lang/translations/nl.po +0 -208
- package/lang/translations/no.po +0 -208
- package/lang/translations/oc.po +0 -208
- package/lang/translations/pl.po +0 -208
- package/lang/translations/pt-br.po +0 -208
- package/lang/translations/pt.po +0 -208
- package/lang/translations/ro.po +0 -208
- package/lang/translations/ru.po +0 -208
- package/lang/translations/si.po +0 -208
- package/lang/translations/sk.po +0 -208
- package/lang/translations/sl.po +0 -208
- package/lang/translations/sq.po +0 -208
- package/lang/translations/sr-latn.po +0 -208
- package/lang/translations/sr.po +0 -208
- package/lang/translations/sv.po +0 -208
- package/lang/translations/th.po +0 -208
- package/lang/translations/ti.po +0 -208
- package/lang/translations/tk.po +0 -208
- package/lang/translations/tr.po +0 -208
- package/lang/translations/tt.po +0 -208
- package/lang/translations/ug.po +0 -208
- package/lang/translations/uk.po +0 -208
- package/lang/translations/ur.po +0 -208
- package/lang/translations/uz.po +0 -208
- package/lang/translations/vi.po +0 -208
- package/lang/translations/zh-cn.po +0 -208
- package/lang/translations/zh.po +0 -208
- package/src/arialiveannouncer.js +0 -189
- package/src/augmentation.js +0 -5
- package/src/autocomplete/autocompleteview.js +0 -157
- package/src/badge/badge.js +0 -226
- package/src/bindings/addkeyboardhandlingforgrid.js +0 -107
- package/src/bindings/clickoutsidehandler.js +0 -36
- package/src/bindings/csstransitiondisablermixin.js +0 -58
- package/src/bindings/draggableviewmixin.js +0 -144
- package/src/bindings/preventdefault.js +0 -35
- package/src/bindings/submithandler.js +0 -47
- package/src/button/button.js +0 -5
- package/src/button/buttonlabel.js +0 -5
- package/src/button/buttonlabelview.js +0 -42
- package/src/button/buttonview.js +0 -278
- package/src/button/filedialogbuttonview.js +0 -147
- package/src/button/listitembuttonview.js +0 -136
- package/src/button/switchbuttonview.js +0 -79
- package/src/collapsible/collapsibleview.js +0 -106
- package/src/colorgrid/colorgridview.js +0 -140
- package/src/colorgrid/colortileview.js +0 -42
- package/src/colorgrid/utils.js +0 -84
- package/src/colorpicker/colorpickerview.js +0 -356
- package/src/colorpicker/utils.js +0 -108
- package/src/colorselector/colorgridsfragmentview.js +0 -368
- package/src/colorselector/colorpickerfragmentview.js +0 -254
- package/src/colorselector/colorselectorview.js +0 -294
- package/src/colorselector/documentcolorcollection.js +0 -42
- package/src/componentfactory.js +0 -108
- package/src/dialog/dialog.js +0 -325
- package/src/dialog/dialogactionsview.js +0 -118
- package/src/dialog/dialogcontentview.js +0 -39
- package/src/dialog/dialogview.js +0 -507
- package/src/dropdown/button/dropdownbutton.js +0 -5
- package/src/dropdown/button/dropdownbuttonview.js +0 -70
- package/src/dropdown/button/splitbuttonview.js +0 -178
- package/src/dropdown/dropdownpanelfocusable.js +0 -5
- package/src/dropdown/dropdownpanelview.js +0 -106
- package/src/dropdown/dropdownview.js +0 -438
- package/src/dropdown/menu/dropdownmenubehaviors.js +0 -125
- package/src/dropdown/menu/dropdownmenubuttonview.js +0 -69
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +0 -30
- package/src/dropdown/menu/dropdownmenulistitemview.js +0 -38
- package/src/dropdown/menu/dropdownmenulistview.js +0 -29
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +0 -63
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +0 -214
- package/src/dropdown/menu/dropdownmenurootlistview.js +0 -168
- package/src/dropdown/menu/utils.js +0 -61
- package/src/dropdown/utils.js +0 -654
- package/src/editableui/editableuiview.js +0 -130
- package/src/editableui/inline/inlineeditableuiview.js +0 -75
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +0 -142
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +0 -112
- package/src/editorui/bodycollection.js +0 -128
- package/src/editorui/boxed/boxededitoruiview.js +0 -95
- package/src/editorui/editorui.js +0 -586
- package/src/editorui/editoruiview.js +0 -60
- package/src/editorui/evaluationbadge.js +0 -99
- package/src/editorui/poweredby.js +0 -120
- package/src/focuscycler.js +0 -383
- package/src/formheader/formheaderview.js +0 -77
- package/src/formrow/formrowview.js +0 -56
- package/src/highlightedtext/buttonlabelwithhighlightview.js +0 -31
- package/src/highlightedtext/highlightedtextview.js +0 -102
- package/src/highlightedtext/labelwithhighlightview.js +0 -37
- package/src/icon/iconview.js +0 -123
- package/src/iframe/iframeview.js +0 -63
- package/src/index.js +0 -132
- package/src/input/inputbase.js +0 -119
- package/src/input/inputview.js +0 -24
- package/src/inputnumber/inputnumberview.js +0 -40
- package/src/inputtext/inputtextview.js +0 -27
- package/src/label/labelview.js +0 -46
- package/src/labeledfield/labeledfieldview.js +0 -177
- package/src/labeledfield/utils.js +0 -176
- package/src/labeledinput/labeledinputview.js +0 -138
- package/src/legacyerrors.js +0 -20
- package/src/list/listitemgroupview.js +0 -82
- package/src/list/listitemview.js +0 -46
- package/src/list/listseparatorview.js +0 -28
- package/src/list/listview.js +0 -210
- package/src/menubar/menubarmenubuttonview.js +0 -68
- package/src/menubar/menubarmenulistitembuttonview.js +0 -30
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +0 -32
- package/src/menubar/menubarmenulistitemview.js +0 -34
- package/src/menubar/menubarmenulistview.js +0 -72
- package/src/menubar/menubarmenupanelview.js +0 -64
- package/src/menubar/menubarmenuview.js +0 -198
- package/src/menubar/menubarview.js +0 -281
- package/src/menubar/utils.js +0 -1432
- package/src/model.js +0 -31
- package/src/notification/notification.js +0 -192
- package/src/panel/balloon/balloonpanelview.js +0 -1077
- package/src/panel/balloon/contextualballoon.js +0 -616
- package/src/panel/sticky/stickypanelview.js +0 -246
- package/src/search/filteredview.js +0 -5
- package/src/search/filtergroupanditemnames.js +0 -38
- package/src/search/searchinfoview.js +0 -59
- package/src/search/searchresultsview.js +0 -83
- package/src/search/text/searchtextqueryview.js +0 -87
- package/src/search/text/searchtextview.js +0 -242
- package/src/spinner/spinnerview.js +0 -38
- package/src/template.js +0 -1396
- package/src/textarea/textareaview.js +0 -189
- package/src/toolbar/balloon/balloontoolbar.js +0 -358
- package/src/toolbar/block/blockbuttonview.js +0 -41
- package/src/toolbar/block/blocktoolbar.js +0 -507
- package/src/toolbar/normalizetoolbarconfig.js +0 -52
- package/src/toolbar/toolbarlinebreakview.js +0 -28
- package/src/toolbar/toolbarseparatorview.js +0 -28
- package/src/toolbar/toolbarview.js +0 -873
- package/src/tooltipmanager.js +0 -454
- package/src/view.js +0 -471
- package/src/viewcollection.js +0 -210
- package/theme/components/arialiveannouncer/arialiveannouncer.css +0 -14
- package/theme/components/autocomplete/autocomplete.css +0 -22
- package/theme/components/button/button.css +0 -39
- package/theme/components/button/listitembutton.css +0 -48
- package/theme/components/button/switchbutton.css +0 -14
- package/theme/components/collapsible/collapsible.css +0 -10
- package/theme/components/colorgrid/colorgrid.css +0 -8
- package/theme/components/colorpicker/colorpicker.css +0 -34
- package/theme/components/colorselector/colorselector.css +0 -35
- package/theme/components/dialog/dialog.css +0 -42
- package/theme/components/dialog/dialogactions.css +0 -11
- package/theme/components/dropdown/dropdown.css +0 -95
- package/theme/components/dropdown/listdropdown.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenu.css +0 -8
- package/theme/components/dropdown/menu/dropdownmenubutton.css +0 -9
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenupanel.css +0 -11
- package/theme/components/dropdown/splitbutton.css +0 -14
- package/theme/components/dropdown/toolbardropdown.css +0 -20
- package/theme/components/editorui/accessibilityhelp.css +0 -10
- package/theme/components/editorui/editorui.css +0 -10
- package/theme/components/form/form.css +0 -87
- package/theme/components/formheader/formheader.css +0 -18
- package/theme/components/formrow/formrow.css +0 -32
- package/theme/components/highlightedtext/highlightedtext.css +0 -12
- package/theme/components/icon/icon.css +0 -8
- package/theme/components/input/input.css +0 -10
- package/theme/components/label/label.css +0 -12
- package/theme/components/labeledfield/labeledfieldview.css +0 -16
- package/theme/components/labeledinput/labeledinput.css +0 -10
- package/theme/components/list/list.css +0 -26
- package/theme/components/menubar/menubar.css +0 -10
- package/theme/components/menubar/menubarmenu.css +0 -9
- package/theme/components/menubar/menubarmenubutton.css +0 -11
- package/theme/components/menubar/menubarmenulistitem.css +0 -10
- package/theme/components/menubar/menubarmenulistitembutton.css +0 -10
- package/theme/components/menubar/menubarmenupanel.css +0 -62
- package/theme/components/panel/balloonpanel.css +0 -56
- package/theme/components/panel/balloonrotator.css +0 -17
- package/theme/components/panel/fakepanel.css +0 -23
- package/theme/components/panel/stickypanel.css +0 -17
- package/theme/components/responsive-form/responsiveform.css +0 -42
- package/theme/components/search/search.css +0 -43
- package/theme/components/spinner/spinner.css +0 -23
- package/theme/components/textarea/textarea.css +0 -10
- package/theme/components/toolbar/blocktoolbar.css +0 -9
- package/theme/components/toolbar/toolbar.css +0 -58
- package/theme/components/tooltip/tooltip.css +0 -12
- package/theme/globals/_evaluationbadge.css +0 -54
- package/theme/globals/_hidden.css +0 -13
- package/theme/globals/_poweredby.css +0 -84
- package/theme/globals/_transition.css +0 -12
- package/theme/globals/_zindex.css +0 -10
- package/theme/globals/globals.css +0 -10
- package/theme/mixins/_dir.css +0 -10
- package/theme/mixins/_mediacolors.css +0 -20
- package/theme/mixins/_rwd.css +0 -10
- package/theme/mixins/_unselectable.css +0 -14
- /package/{src → dist}/arialiveannouncer.d.ts +0 -0
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/autocomplete/autocompleteview.d.ts +0 -0
- /package/{src → dist}/badge/badge.d.ts +0 -0
- /package/{src → dist}/bindings/addkeyboardhandlingforgrid.d.ts +0 -0
- /package/{src → dist}/bindings/clickoutsidehandler.d.ts +0 -0
- /package/{src → dist}/bindings/csstransitiondisablermixin.d.ts +0 -0
- /package/{src → dist}/bindings/draggableviewmixin.d.ts +0 -0
- /package/{src → dist}/bindings/preventdefault.d.ts +0 -0
- /package/{src → dist}/bindings/submithandler.d.ts +0 -0
- /package/{src → dist}/button/button.d.ts +0 -0
- /package/{src → dist}/button/buttonlabel.d.ts +0 -0
- /package/{src → dist}/button/buttonlabelview.d.ts +0 -0
- /package/{src → dist}/button/buttonview.d.ts +0 -0
- /package/{src → dist}/button/filedialogbuttonview.d.ts +0 -0
- /package/{src → dist}/button/listitembuttonview.d.ts +0 -0
- /package/{src → dist}/button/switchbuttonview.d.ts +0 -0
- /package/{src → dist}/collapsible/collapsibleview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colorgridview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colortileview.d.ts +0 -0
- /package/{src → dist}/colorgrid/utils.d.ts +0 -0
- /package/{src → dist}/colorpicker/colorpickerview.d.ts +0 -0
- /package/{src → dist}/colorpicker/utils.d.ts +0 -0
- /package/{src → dist}/colorselector/colorgridsfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorpickerfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorselectorview.d.ts +0 -0
- /package/{src → dist}/componentfactory.d.ts +0 -0
- /package/{src → dist}/dialog/dialogactionsview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogcontentview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbutton.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/splitbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelfocusable.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubehaviors.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitemview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenuview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenurootlistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/utils.d.ts +0 -0
- /package/{src → dist}/dropdown/utils.d.ts +0 -0
- /package/{src → dist}/editableui/editableuiview.d.ts +0 -0
- /package/{src → dist}/editableui/inline/inlineeditableuiview.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelp.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +0 -0
- /package/{src → dist}/editorui/bodycollection.d.ts +0 -0
- /package/{src → dist}/editorui/boxed/boxededitoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/editorui.d.ts +0 -0
- /package/{src → dist}/editorui/editoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/evaluationbadge.d.ts +0 -0
- /package/{src → dist}/editorui/poweredby.d.ts +0 -0
- /package/{src → dist}/focuscycler.d.ts +0 -0
- /package/{src → dist}/formheader/formheaderview.d.ts +0 -0
- /package/{src → dist}/formrow/formrowview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/buttonlabelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/highlightedtextview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/labelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/icon/iconview.d.ts +0 -0
- /package/{src → dist}/iframe/iframeview.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/input/inputbase.d.ts +0 -0
- /package/{src → dist}/input/inputview.d.ts +0 -0
- /package/{src → dist}/inputnumber/inputnumberview.d.ts +0 -0
- /package/{src → dist}/inputtext/inputtextview.d.ts +0 -0
- /package/{src → dist}/label/labelview.d.ts +0 -0
- /package/{src → dist}/labeledfield/labeledfieldview.d.ts +0 -0
- /package/{src → dist}/labeledfield/utils.d.ts +0 -0
- /package/{src → dist}/labeledinput/labeledinputview.d.ts +0 -0
- /package/{src → dist}/legacyerrors.d.ts +0 -0
- /package/{src → dist}/list/listitemgroupview.d.ts +0 -0
- /package/{src → dist}/list/listitemview.d.ts +0 -0
- /package/{src → dist}/list/listseparatorview.d.ts +0 -0
- /package/{src → dist}/list/listview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenubuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenupanelview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarview.d.ts +0 -0
- /package/{src → dist}/menubar/utils.d.ts +0 -0
- /package/{src → dist}/model.d.ts +0 -0
- /package/{src → dist}/notification/notification.d.ts +0 -0
- /package/{src → dist}/panel/balloon/balloonpanelview.d.ts +0 -0
- /package/{src → dist}/panel/balloon/contextualballoon.d.ts +0 -0
- /package/{src → dist}/panel/sticky/stickypanelview.d.ts +0 -0
- /package/{src → dist}/search/filteredview.d.ts +0 -0
- /package/{src → dist}/search/filtergroupanditemnames.d.ts +0 -0
- /package/{src → dist}/search/searchinfoview.d.ts +0 -0
- /package/{src → dist}/search/searchresultsview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextqueryview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextview.d.ts +0 -0
- /package/{src → dist}/spinner/spinnerview.d.ts +0 -0
- /package/{src → dist}/template.d.ts +0 -0
- /package/{src → dist}/textarea/textareaview.d.ts +0 -0
- /package/{src → dist}/toolbar/balloon/balloontoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blockbuttonview.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blocktoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/normalizetoolbarconfig.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarlinebreakview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarseparatorview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarview.d.ts +0 -0
- /package/{src → dist}/tooltipmanager.d.ts +0 -0
- /package/{src → dist}/viewcollection.d.ts +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editableui/editableuiview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
/**
|
|
10
|
-
* The editable UI view class.
|
|
11
|
-
*/
|
|
12
|
-
export class EditableUIView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* The name of the editable UI view.
|
|
15
|
-
*/
|
|
16
|
-
name = null;
|
|
17
|
-
/**
|
|
18
|
-
* The editing view instance the editable is related to. Editable uses the editing
|
|
19
|
-
* view to dynamically modify its certain DOM attributes after {@link #render rendering}.
|
|
20
|
-
*
|
|
21
|
-
* **Note**: The DOM attributes are performed by the editing view and not UI
|
|
22
|
-
* {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
|
|
23
|
-
* the editable DOM element must remain under the full control of the engine to work properly.
|
|
24
|
-
*/
|
|
25
|
-
_editingView;
|
|
26
|
-
/**
|
|
27
|
-
* The element which is the main editable element (usually the one with `contentEditable="true"`).
|
|
28
|
-
*/
|
|
29
|
-
_editableElement;
|
|
30
|
-
/**
|
|
31
|
-
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
32
|
-
* the view will not render its {@link #template}.
|
|
33
|
-
*/
|
|
34
|
-
_hasExternalElement;
|
|
35
|
-
/**
|
|
36
|
-
* Creates an instance of EditableUIView class.
|
|
37
|
-
*
|
|
38
|
-
* @param locale The locale instance.
|
|
39
|
-
* @param editingView The editing view instance the editable is related to.
|
|
40
|
-
* @param editableElement The editable element. If not specified, this view
|
|
41
|
-
* should create it. Otherwise, the existing element should be used.
|
|
42
|
-
*/
|
|
43
|
-
constructor(locale, editingView, editableElement) {
|
|
44
|
-
super(locale);
|
|
45
|
-
this.setTemplate({
|
|
46
|
-
tag: 'div',
|
|
47
|
-
attributes: {
|
|
48
|
-
class: [
|
|
49
|
-
'ck',
|
|
50
|
-
'ck-content',
|
|
51
|
-
'ck-editor__editable',
|
|
52
|
-
'ck-rounded-corners'
|
|
53
|
-
],
|
|
54
|
-
lang: locale.contentLanguage,
|
|
55
|
-
dir: locale.contentLanguageDirection
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
this.set('isFocused', false);
|
|
59
|
-
this._editableElement = editableElement;
|
|
60
|
-
this._hasExternalElement = !!this._editableElement;
|
|
61
|
-
this._editingView = editingView;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Renders the view by either applying the {@link #template} to the existing
|
|
65
|
-
* {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement} or assigning {@link #element}
|
|
66
|
-
* as {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement}.
|
|
67
|
-
*/
|
|
68
|
-
render() {
|
|
69
|
-
super.render();
|
|
70
|
-
if (this._hasExternalElement) {
|
|
71
|
-
this.template.apply(this.element = this._editableElement);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this._editableElement = this.element;
|
|
75
|
-
}
|
|
76
|
-
this.on('change:isFocused', () => this._updateIsFocusedClasses());
|
|
77
|
-
this._updateIsFocusedClasses();
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* @inheritDoc
|
|
81
|
-
*/
|
|
82
|
-
destroy() {
|
|
83
|
-
if (this._hasExternalElement) {
|
|
84
|
-
this.template.revert(this._editableElement);
|
|
85
|
-
}
|
|
86
|
-
super.destroy();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
90
|
-
* the view will not render its {@link #template}.
|
|
91
|
-
*/
|
|
92
|
-
get hasExternalElement() {
|
|
93
|
-
return this._hasExternalElement;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
|
|
97
|
-
* the {@link #isFocused} property value using the {@link #_editingView editing view} API.
|
|
98
|
-
*/
|
|
99
|
-
_updateIsFocusedClasses() {
|
|
100
|
-
const editingView = this._editingView;
|
|
101
|
-
if (editingView.isRenderingInProgress) {
|
|
102
|
-
updateAfterRender(this);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
update(this);
|
|
106
|
-
}
|
|
107
|
-
function update(view) {
|
|
108
|
-
editingView.change(writer => {
|
|
109
|
-
const viewRoot = editingView.document.getRoot(view.name);
|
|
110
|
-
writer.addClass(view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot);
|
|
111
|
-
writer.removeClass(view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
// In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
|
|
115
|
-
// While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
|
|
116
|
-
// callback and render is called inside the already pending render.
|
|
117
|
-
// We need to be sure that callback is executed only when the value has changed from `true` to `false`.
|
|
118
|
-
// See https://github.com/ckeditor/ckeditor5/issues/1676.
|
|
119
|
-
function updateAfterRender(view) {
|
|
120
|
-
editingView.once('change:isRenderingInProgress', (evt, name, value) => {
|
|
121
|
-
if (!value) {
|
|
122
|
-
update(view);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
updateAfterRender(view);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editableui/inline/inlineeditableuiview
|
|
7
|
-
*/
|
|
8
|
-
import { EditableUIView } from '../editableuiview.js';
|
|
9
|
-
/**
|
|
10
|
-
* The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
|
|
11
|
-
*/
|
|
12
|
-
export class InlineEditableUIView extends EditableUIView {
|
|
13
|
-
/**
|
|
14
|
-
* The cached options object passed to the constructor.
|
|
15
|
-
*/
|
|
16
|
-
_options;
|
|
17
|
-
/**
|
|
18
|
-
* Creates an instance of the InlineEditableUIView class.
|
|
19
|
-
*
|
|
20
|
-
* @param locale The locale instance.
|
|
21
|
-
* @param editingView The editing view instance the editable is related to.
|
|
22
|
-
* @param editableElement The editable element. If not specified, the
|
|
23
|
-
* {@link module:ui/editableui/editableuiview~EditableUIView}
|
|
24
|
-
* will create it. Otherwise, the existing element will be used.
|
|
25
|
-
* @param options Additional configuration of the view.
|
|
26
|
-
* @param options.label The label of the editable for assistive technologies. If not provided, a default label is used or,
|
|
27
|
-
* the existing `aria-label` attribute value from the specified `editableElement` is preserved.
|
|
28
|
-
*/
|
|
29
|
-
constructor(locale, editingView, editableElement, options = {}) {
|
|
30
|
-
super(locale, editingView, editableElement);
|
|
31
|
-
this._options = options;
|
|
32
|
-
this.extendTemplate({
|
|
33
|
-
attributes: {
|
|
34
|
-
role: 'textbox',
|
|
35
|
-
class: 'ck-editor__editable_inline'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
render() {
|
|
43
|
-
super.render();
|
|
44
|
-
const editingView = this._editingView;
|
|
45
|
-
editingView.change(writer => {
|
|
46
|
-
const viewRoot = editingView.document.getRoot(this.name);
|
|
47
|
-
writer.setAttribute('aria-label', this.getEditableAriaLabel(), viewRoot);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Returns a normalized label for the editable view based on the environment.
|
|
52
|
-
*/
|
|
53
|
-
getEditableAriaLabel() {
|
|
54
|
-
const t = this.locale.t;
|
|
55
|
-
const label = this._options.label;
|
|
56
|
-
const editableElement = this._editableElement;
|
|
57
|
-
const editableName = this.name;
|
|
58
|
-
if (typeof label == 'string') {
|
|
59
|
-
return label;
|
|
60
|
-
}
|
|
61
|
-
else if (typeof label === 'object') {
|
|
62
|
-
return label[editableName];
|
|
63
|
-
}
|
|
64
|
-
else if (typeof label === 'function') {
|
|
65
|
-
return label(this);
|
|
66
|
-
}
|
|
67
|
-
else if (editableElement) {
|
|
68
|
-
const existingLabel = editableElement.getAttribute('aria-label');
|
|
69
|
-
if (existingLabel) {
|
|
70
|
-
return existingLabel;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return t('Rich Text Editor. Editing area: %0', editableName);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editorui/accessibilityhelp/accessibilityhelp
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import { IconAccessibility } from '@ckeditor/ckeditor5-icons';
|
|
10
|
-
import { ButtonView } from '../../button/buttonview.js';
|
|
11
|
-
import { Dialog } from '../../dialog/dialog.js';
|
|
12
|
-
import { MenuBarMenuListItemButtonView } from '../../menubar/menubarmenulistitembuttonview.js';
|
|
13
|
-
import { AccessibilityHelpContentView } from './accessibilityhelpcontentview.js';
|
|
14
|
-
import { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils';
|
|
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 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 = null;
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
static get requires() {
|
|
34
|
-
return [Dialog];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @inheritDoc
|
|
38
|
-
*/
|
|
39
|
-
static get pluginName() {
|
|
40
|
-
return 'AccessibilityHelp';
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @inheritDoc
|
|
44
|
-
*/
|
|
45
|
-
static get isOfficialPlugin() {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
init() {
|
|
52
|
-
const editor = this.editor;
|
|
53
|
-
const t = editor.locale.t;
|
|
54
|
-
editor.ui.componentFactory.add('accessibilityHelp', () => {
|
|
55
|
-
const button = this._createButton(ButtonView);
|
|
56
|
-
button.set({
|
|
57
|
-
tooltip: true,
|
|
58
|
-
withText: false,
|
|
59
|
-
label: t('Accessibility help')
|
|
60
|
-
});
|
|
61
|
-
return button;
|
|
62
|
-
});
|
|
63
|
-
editor.ui.componentFactory.add('menuBar:accessibilityHelp', () => {
|
|
64
|
-
const button = this._createButton(MenuBarMenuListItemButtonView);
|
|
65
|
-
button.label = t('Accessibility');
|
|
66
|
-
return button;
|
|
67
|
-
});
|
|
68
|
-
editor.keystrokes.set('Alt+0', (evt, cancel) => {
|
|
69
|
-
this._toggleDialog();
|
|
70
|
-
cancel();
|
|
71
|
-
});
|
|
72
|
-
this._setupRootLabels();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Creates a button to show accessibility help dialog, for use either in toolbar or in menu bar.
|
|
76
|
-
*/
|
|
77
|
-
_createButton(ButtonClass) {
|
|
78
|
-
const editor = this.editor;
|
|
79
|
-
const dialog = editor.plugins.get('Dialog');
|
|
80
|
-
const locale = editor.locale;
|
|
81
|
-
const view = new ButtonClass(locale);
|
|
82
|
-
view.set({
|
|
83
|
-
keystroke: 'Alt+0',
|
|
84
|
-
icon: IconAccessibility,
|
|
85
|
-
isToggleable: true
|
|
86
|
-
});
|
|
87
|
-
view.on('execute', () => this._toggleDialog());
|
|
88
|
-
view.bind('isOn').to(dialog, 'id', id => id === 'accessibilityHelp');
|
|
89
|
-
return view;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Injects a help text into each editing root's `aria-label` attribute allowing assistive technology users
|
|
93
|
-
* to discover the availability of the Accessibility help dialog.
|
|
94
|
-
*/
|
|
95
|
-
_setupRootLabels() {
|
|
96
|
-
const editor = this.editor;
|
|
97
|
-
const editingView = editor.editing.view;
|
|
98
|
-
const t = editor.t;
|
|
99
|
-
editor.ui.on('ready', () => {
|
|
100
|
-
editingView.change(writer => {
|
|
101
|
-
for (const root of editingView.document.roots) {
|
|
102
|
-
addAriaLabelTextToRoot(writer, root);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
editor.on('addRoot', (evt, modelRoot) => {
|
|
106
|
-
const viewRoot = editor.editing.view.document.getRoot(modelRoot.rootName);
|
|
107
|
-
editingView.change(writer => addAriaLabelTextToRoot(writer, viewRoot));
|
|
108
|
-
}, { priority: 'low' });
|
|
109
|
-
});
|
|
110
|
-
function addAriaLabelTextToRoot(writer, viewRoot) {
|
|
111
|
-
const currentAriaLabel = viewRoot.getAttribute('aria-label');
|
|
112
|
-
const newAriaLabel = [currentAriaLabel, t('Press %0 for help.', [getEnvKeystrokeText('Alt+0')])]
|
|
113
|
-
.filter(segment => segment)
|
|
114
|
-
.join('. ');
|
|
115
|
-
writer.setAttribute('aria-label', newAriaLabel, viewRoot);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Shows the accessibility help dialog. Also, creates {@link #contentView} on demand.
|
|
120
|
-
*/
|
|
121
|
-
_toggleDialog() {
|
|
122
|
-
const editor = this.editor;
|
|
123
|
-
const dialog = editor.plugins.get('Dialog');
|
|
124
|
-
const t = editor.locale.t;
|
|
125
|
-
if (!this.contentView) {
|
|
126
|
-
this.contentView = new AccessibilityHelpContentView(editor.locale, editor.accessibility.keystrokeInfos);
|
|
127
|
-
}
|
|
128
|
-
if (dialog.id === 'accessibilityHelp') {
|
|
129
|
-
dialog.hide();
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
dialog.show({
|
|
133
|
-
id: 'accessibilityHelp',
|
|
134
|
-
className: 'ck-accessibility-help-dialog',
|
|
135
|
-
title: t('Accessibility help'),
|
|
136
|
-
icon: IconAccessibility,
|
|
137
|
-
hasCloseButton: true,
|
|
138
|
-
content: this.contentView
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editorui/accessibilityhelp/accessibilityhelpcontentview
|
|
7
|
-
*/
|
|
8
|
-
import { createElement, env, getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import { View } from '../../view.js';
|
|
10
|
-
import { LabelView } from '../../label/labelview.js';
|
|
11
|
-
/**
|
|
12
|
-
* The view displaying keystrokes in the Accessibility help dialog.
|
|
13
|
-
*/
|
|
14
|
-
export class AccessibilityHelpContentView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
constructor(locale, keystrokes) {
|
|
19
|
-
super(locale);
|
|
20
|
-
const t = locale.t;
|
|
21
|
-
const helpLabel = new LabelView();
|
|
22
|
-
helpLabel.text = t('Help Contents. To close this dialog press ESC.');
|
|
23
|
-
this.setTemplate({
|
|
24
|
-
tag: 'div',
|
|
25
|
-
attributes: {
|
|
26
|
-
class: ['ck', 'ck-accessibility-help-dialog__content'],
|
|
27
|
-
'aria-labelledby': helpLabel.id,
|
|
28
|
-
role: 'document',
|
|
29
|
-
tabindex: -1
|
|
30
|
-
},
|
|
31
|
-
children: [
|
|
32
|
-
createElement(document, 'p', {}, t('Below, you can find a list of keyboard shortcuts that can be used in the editor.')),
|
|
33
|
-
...this._createCategories(Array.from(keystrokes.values())),
|
|
34
|
-
helpLabel
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
focus() {
|
|
42
|
-
this.element.focus();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Creates `<section><h3>Category label</h3>...</section>` elements for each category of keystrokes.
|
|
46
|
-
*/
|
|
47
|
-
_createCategories(categories) {
|
|
48
|
-
return categories.map(categoryDefinition => {
|
|
49
|
-
const elements = [
|
|
50
|
-
// Category header.
|
|
51
|
-
createElement(document, 'h3', {}, categoryDefinition.label),
|
|
52
|
-
// Category definitions (<dl>) and their optional headers (<h4>).
|
|
53
|
-
...Array.from(categoryDefinition.groups.values())
|
|
54
|
-
.map(groupDefinition => this._createGroup(groupDefinition))
|
|
55
|
-
.flat()
|
|
56
|
-
];
|
|
57
|
-
// Category description (<p>).
|
|
58
|
-
if (categoryDefinition.description) {
|
|
59
|
-
elements.splice(1, 0, createElement(document, 'p', {}, categoryDefinition.description));
|
|
60
|
-
}
|
|
61
|
-
return createElement(document, 'section', {}, elements);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Creates `[<h4>Optional label</h4>]<dl>...</dl>` elements for each group of keystrokes in a category.
|
|
66
|
-
*/
|
|
67
|
-
_createGroup(groupDefinition) {
|
|
68
|
-
const definitionAndDescriptionElements = groupDefinition.keystrokes
|
|
69
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
70
|
-
.map(keystrokeDefinition => this._createGroupRow(keystrokeDefinition))
|
|
71
|
-
.flat();
|
|
72
|
-
const elements = [
|
|
73
|
-
createElement(document, 'dl', {}, definitionAndDescriptionElements)
|
|
74
|
-
];
|
|
75
|
-
if (groupDefinition.label) {
|
|
76
|
-
elements.unshift(createElement(document, 'h4', {}, groupDefinition.label));
|
|
77
|
-
}
|
|
78
|
-
return elements;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Creates `<dt>Keystroke label</dt><dd>Keystroke definition</dd>` elements for each keystroke in a group.
|
|
82
|
-
*/
|
|
83
|
-
_createGroupRow(keystrokeDefinition) {
|
|
84
|
-
const t = this.locale.t;
|
|
85
|
-
const dt = createElement(document, 'dt');
|
|
86
|
-
const dd = createElement(document, 'dd');
|
|
87
|
-
const normalizedKeystrokeDefinition = normalizeKeystrokeDefinition(keystrokeDefinition.keystroke);
|
|
88
|
-
const keystrokeAlternativeHTMLs = [];
|
|
89
|
-
for (const keystrokeAlternative of normalizedKeystrokeDefinition) {
|
|
90
|
-
keystrokeAlternativeHTMLs.push(keystrokeAlternative.map(keystrokeToEnvKbd).join(''));
|
|
91
|
-
}
|
|
92
|
-
dt.innerHTML = keystrokeDefinition.label;
|
|
93
|
-
dd.innerHTML = keystrokeAlternativeHTMLs.join(', ') +
|
|
94
|
-
(keystrokeDefinition.mayRequireFn && env.isMac ? ` ${t('(may require <kbd>Fn</kbd>)')}` : '');
|
|
95
|
-
return [dt, dd];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function keystrokeToEnvKbd(keystroke) {
|
|
99
|
-
return getEnvKeystrokeText(keystroke)
|
|
100
|
-
.split('+')
|
|
101
|
-
.map(part => `<kbd>${part}</kbd>`)
|
|
102
|
-
.join('+');
|
|
103
|
-
}
|
|
104
|
-
function normalizeKeystrokeDefinition(definition) {
|
|
105
|
-
if (typeof definition === 'string') {
|
|
106
|
-
return [[definition]];
|
|
107
|
-
}
|
|
108
|
-
if (typeof definition[0] === 'string') {
|
|
109
|
-
return [definition];
|
|
110
|
-
}
|
|
111
|
-
return definition;
|
|
112
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editorui/bodycollection
|
|
7
|
-
*/
|
|
8
|
-
import { Template } from '../template.js';
|
|
9
|
-
import { ViewCollection } from '../viewcollection.js';
|
|
10
|
-
import { createElement } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
/**
|
|
12
|
-
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached from the DOM structure of
|
|
13
|
-
* the editor, like floating panels, floating toolbars, dialogs, etc.
|
|
14
|
-
*
|
|
15
|
-
* The body collection is available under the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
|
|
16
|
-
* Any plugin can add a {@link module:ui/view~View view} to this collection.
|
|
17
|
-
*
|
|
18
|
-
* All views added to a body collection render in a dedicated DOM container (`<div class="ck ck-body ...">...</div>`). All body collection
|
|
19
|
-
* containers render in a common shared (`<div class="ck-body-wrapper">...</div>`) in the DOM to limit the pollution of
|
|
20
|
-
* the `<body>` element. The resulting DOM structure is as follows:
|
|
21
|
-
*
|
|
22
|
-
* ```html
|
|
23
|
-
* <body>
|
|
24
|
-
* <!-- Content of the webpage... -->
|
|
25
|
-
*
|
|
26
|
-
* <!-- The shared wrapper for all body collection containers. -->
|
|
27
|
-
* <div class="ck-body-wrapper">
|
|
28
|
-
* <!-- The container of the first body collection instance. -->
|
|
29
|
-
* <div class="ck ck-body ...">
|
|
30
|
-
* <!-- View elements belonging to the first body collection -->
|
|
31
|
-
* </div>
|
|
32
|
-
*
|
|
33
|
-
* <!-- The container of the second body collection instance. -->
|
|
34
|
-
* <div class="ck ck-body ...">...</div>
|
|
35
|
-
*
|
|
36
|
-
* <!-- More body collection containers for the rest of instances... -->
|
|
37
|
-
* </div>
|
|
38
|
-
* </body>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* By default, the {@link module:ui/editorui/editoruiview~EditorUIView `editor.ui.view`} manages the life cycle of the
|
|
42
|
-
* {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} collection, attaching and detaching it
|
|
43
|
-
* when the editor gets created or {@link module:core/editor/editor~Editor#destroy destroyed}.
|
|
44
|
-
*
|
|
45
|
-
* # Custom body collection instances
|
|
46
|
-
*
|
|
47
|
-
* Even though most editor instances come with a built-in body collection
|
|
48
|
-
* ({@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`}), you can create your own instance of this
|
|
49
|
-
* class if you need to control their life cycle.
|
|
50
|
-
*
|
|
51
|
-
* The life cycle of a custom body collection must be handled manually by the developer using the dedicated API:
|
|
52
|
-
* * A body collection will render itself automatically in the DOM as soon as you call {@link ~BodyCollection#attachToDom}.
|
|
53
|
-
* * Calling {@link ~BodyCollection#detachFromDom} will remove the collection from the DOM.
|
|
54
|
-
*
|
|
55
|
-
* **Note**: The shared collection wrapper (`<div class="ck-body-wrapper">...</div>`) gets automatically removed from DOM when the
|
|
56
|
-
* last body collection is {@link ~BodyCollection#detachFromDom detached} and does not require any special handling.
|
|
57
|
-
*/
|
|
58
|
-
export class BodyCollection extends ViewCollection {
|
|
59
|
-
/**
|
|
60
|
-
* The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
|
|
61
|
-
* See the view {@link module:ui/view~View#locale locale} property.
|
|
62
|
-
*/
|
|
63
|
-
locale;
|
|
64
|
-
/**
|
|
65
|
-
* The element holding elements of the body collection.
|
|
66
|
-
*/
|
|
67
|
-
_bodyCollectionContainer;
|
|
68
|
-
/**
|
|
69
|
-
* The wrapper element that holds all of the {@link #_bodyCollectionContainer} elements.
|
|
70
|
-
*/
|
|
71
|
-
static _bodyWrapper;
|
|
72
|
-
/**
|
|
73
|
-
* Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
|
|
74
|
-
*
|
|
75
|
-
* @param locale The {@link module:core/editor/editor~Editor editor's locale} instance.
|
|
76
|
-
* @param initialItems The initial items of the collection.
|
|
77
|
-
*/
|
|
78
|
-
constructor(locale, initialItems = []) {
|
|
79
|
-
super(initialItems);
|
|
80
|
-
this.locale = locale;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The element holding elements of the body collection.
|
|
84
|
-
*/
|
|
85
|
-
get bodyCollectionContainer() {
|
|
86
|
-
return this._bodyCollectionContainer;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Attaches the body collection to the DOM body element. You need to execute this method to render the content of
|
|
90
|
-
* the body collection.
|
|
91
|
-
*/
|
|
92
|
-
attachToDom() {
|
|
93
|
-
this._bodyCollectionContainer = new Template({
|
|
94
|
-
tag: 'div',
|
|
95
|
-
attributes: {
|
|
96
|
-
class: [
|
|
97
|
-
'ck',
|
|
98
|
-
'ck-reset_all',
|
|
99
|
-
'ck-body',
|
|
100
|
-
'ck-rounded-corners'
|
|
101
|
-
],
|
|
102
|
-
dir: this.locale.uiLanguageDirection,
|
|
103
|
-
role: 'application'
|
|
104
|
-
},
|
|
105
|
-
children: this
|
|
106
|
-
}).render();
|
|
107
|
-
// Create a shared wrapper if there were none or the previous one got disconnected from DOM.
|
|
108
|
-
if (!BodyCollection._bodyWrapper || !BodyCollection._bodyWrapper.isConnected) {
|
|
109
|
-
BodyCollection._bodyWrapper = createElement(document, 'div', { class: 'ck-body-wrapper' });
|
|
110
|
-
document.body.appendChild(BodyCollection._bodyWrapper);
|
|
111
|
-
}
|
|
112
|
-
BodyCollection._bodyWrapper.appendChild(this._bodyCollectionContainer);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
|
|
116
|
-
* anymore to clean-up the DOM structure.
|
|
117
|
-
*/
|
|
118
|
-
detachFromDom() {
|
|
119
|
-
super.destroy();
|
|
120
|
-
if (this._bodyCollectionContainer) {
|
|
121
|
-
this._bodyCollectionContainer.remove();
|
|
122
|
-
}
|
|
123
|
-
if (BodyCollection._bodyWrapper && !BodyCollection._bodyWrapper.childElementCount) {
|
|
124
|
-
BodyCollection._bodyWrapper.remove();
|
|
125
|
-
delete BodyCollection._bodyWrapper;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/editorui/boxed/boxededitoruiview
|
|
7
|
-
*/
|
|
8
|
-
import { EditorUIView } from '../editoruiview.js';
|
|
9
|
-
import { LabelView } from '../../label/labelview.js';
|
|
10
|
-
/**
|
|
11
|
-
* The boxed editor UI view class. This class represents an editor interface
|
|
12
|
-
* consisting of a toolbar and an editable area, enclosed within a box.
|
|
13
|
-
*/
|
|
14
|
-
export class BoxedEditorUIView extends EditorUIView {
|
|
15
|
-
/**
|
|
16
|
-
* Collection of the child views located in the top (`.ck-editor__top`)
|
|
17
|
-
* area of the UI.
|
|
18
|
-
*/
|
|
19
|
-
top;
|
|
20
|
-
/**
|
|
21
|
-
* Collection of the child views located in the main (`.ck-editor__main`)
|
|
22
|
-
* area of the UI.
|
|
23
|
-
*/
|
|
24
|
-
main;
|
|
25
|
-
/**
|
|
26
|
-
* Voice label of the UI.
|
|
27
|
-
*/
|
|
28
|
-
_voiceLabelView;
|
|
29
|
-
/**
|
|
30
|
-
* Creates an instance of the boxed editor UI view class.
|
|
31
|
-
*
|
|
32
|
-
* @param locale The locale instance..
|
|
33
|
-
*/
|
|
34
|
-
constructor(locale) {
|
|
35
|
-
super(locale);
|
|
36
|
-
this.top = this.createCollection();
|
|
37
|
-
this.main = this.createCollection();
|
|
38
|
-
this._voiceLabelView = this._createVoiceLabel();
|
|
39
|
-
this.setTemplate({
|
|
40
|
-
tag: 'div',
|
|
41
|
-
attributes: {
|
|
42
|
-
class: [
|
|
43
|
-
'ck',
|
|
44
|
-
'ck-reset',
|
|
45
|
-
'ck-editor',
|
|
46
|
-
'ck-rounded-corners'
|
|
47
|
-
],
|
|
48
|
-
role: 'application',
|
|
49
|
-
dir: locale.uiLanguageDirection,
|
|
50
|
-
lang: locale.uiLanguage,
|
|
51
|
-
'aria-labelledby': this._voiceLabelView.id
|
|
52
|
-
},
|
|
53
|
-
children: [
|
|
54
|
-
this._voiceLabelView,
|
|
55
|
-
{
|
|
56
|
-
tag: 'div',
|
|
57
|
-
attributes: {
|
|
58
|
-
class: [
|
|
59
|
-
'ck',
|
|
60
|
-
'ck-editor__top',
|
|
61
|
-
'ck-reset_all'
|
|
62
|
-
],
|
|
63
|
-
role: 'presentation'
|
|
64
|
-
},
|
|
65
|
-
children: this.top
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
tag: 'div',
|
|
69
|
-
attributes: {
|
|
70
|
-
class: [
|
|
71
|
-
'ck',
|
|
72
|
-
'ck-editor__main'
|
|
73
|
-
],
|
|
74
|
-
role: 'presentation'
|
|
75
|
-
},
|
|
76
|
-
children: this.main
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Creates a voice label view instance.
|
|
83
|
-
*/
|
|
84
|
-
_createVoiceLabel() {
|
|
85
|
-
const t = this.t;
|
|
86
|
-
const voiceLabel = new LabelView();
|
|
87
|
-
voiceLabel.text = t('Rich Text Editor');
|
|
88
|
-
voiceLabel.extendTemplate({
|
|
89
|
-
attributes: {
|
|
90
|
-
class: 'ck-voice-label'
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
return voiceLabel;
|
|
94
|
-
}
|
|
95
|
-
}
|