@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,113 @@
|
|
|
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/menubar/menubarmenuview
|
|
11
|
+
*/
|
|
12
|
+
import { FocusTracker, KeystrokeHandler, type Locale, type PositioningFunction } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import MenuBarMenuButtonView from './menubarmenubuttonview.js';
|
|
14
|
+
import type { FocusableView } from '../focuscycler.js';
|
|
15
|
+
import View from '../view.js';
|
|
16
|
+
import { default as MenuBarMenuPanelView, type MenuBarMenuPanelPosition } from './menubarmenupanelview.js';
|
|
17
|
+
import '../../theme/components/menubar/menubarmenu.css';
|
|
18
|
+
/**
|
|
19
|
+
* A menu view for the {@link module:ui/menubar/menubarview~MenuBarView}. Menus are building blocks of the menu bar,
|
|
20
|
+
* they host other sub-menus and menu items (buttons) that users can interact with.
|
|
21
|
+
*/
|
|
22
|
+
export default class MenuBarMenuView extends View implements FocusableView {
|
|
23
|
+
/**
|
|
24
|
+
* Button of the menu view.
|
|
25
|
+
*/
|
|
26
|
+
readonly buttonView: MenuBarMenuButtonView;
|
|
27
|
+
/**
|
|
28
|
+
* Panel of the menu. It hosts children of the menu.
|
|
29
|
+
*/
|
|
30
|
+
readonly panelView: MenuBarMenuPanelView;
|
|
31
|
+
/**
|
|
32
|
+
* Tracks information about the DOM focus in the menu.
|
|
33
|
+
*/
|
|
34
|
+
readonly focusTracker: FocusTracker;
|
|
35
|
+
/**
|
|
36
|
+
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
|
|
37
|
+
* keystrokes of the menu.
|
|
38
|
+
*/
|
|
39
|
+
readonly keystrokes: KeystrokeHandler;
|
|
40
|
+
/**
|
|
41
|
+
* Controls whether the menu is open, i.e. shows or hides the {@link #panelView panel}.
|
|
42
|
+
*
|
|
43
|
+
* @observable
|
|
44
|
+
*/
|
|
45
|
+
isOpen: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Controls whether the menu is enabled, i.e. its {@link #buttonView} can be clicked.
|
|
48
|
+
*
|
|
49
|
+
* @observable
|
|
50
|
+
*/
|
|
51
|
+
isEnabled: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* (Optional) The additional CSS class set on the menu {@link #element}.
|
|
54
|
+
*
|
|
55
|
+
* @observable
|
|
56
|
+
*/
|
|
57
|
+
class: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The name of the position of the {@link #panelView}, relative to the menu.
|
|
60
|
+
*
|
|
61
|
+
* **Note**: The value is updated each time the panel gets {@link #isOpen open}.
|
|
62
|
+
*
|
|
63
|
+
* @observable
|
|
64
|
+
* @default 'w'
|
|
65
|
+
*/
|
|
66
|
+
panelPosition: MenuBarMenuPanelPosition;
|
|
67
|
+
/**
|
|
68
|
+
* The parent menu view of the menu. It is `null` for top-level menus.
|
|
69
|
+
*
|
|
70
|
+
* See {@link module:ui/menubar/menubarview~MenuBarView#registerMenu}.
|
|
71
|
+
*/
|
|
72
|
+
parentMenuView: MenuBarMenuView | null;
|
|
73
|
+
/**
|
|
74
|
+
* Creates an instance of the menu view.
|
|
75
|
+
*
|
|
76
|
+
* @param locale The localization services instance.
|
|
77
|
+
*/
|
|
78
|
+
constructor(locale: Locale);
|
|
79
|
+
/**
|
|
80
|
+
* @inheritDoc
|
|
81
|
+
*/
|
|
82
|
+
render(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Attach all keyboard behaviors for the menu bar view.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
_attachBehaviors(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Fires `arrowright` and `arrowleft` events when the user pressed corresponding arrow keys.
|
|
91
|
+
*/
|
|
92
|
+
private _propagateArrowKeystrokeEvents;
|
|
93
|
+
/**
|
|
94
|
+
* Sets the position of the panel when the menu opens. The panel is positioned
|
|
95
|
+
* so that it optimally uses the available space in the viewport.
|
|
96
|
+
*/
|
|
97
|
+
private _repositionPanelOnOpen;
|
|
98
|
+
/**
|
|
99
|
+
* @inheritDoc
|
|
100
|
+
*/
|
|
101
|
+
focus(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Positioning functions for the {@link #panelView} . They change depending on the role of the menu (top-level vs sub-menu) in
|
|
104
|
+
* the {@link module:ui/menubar/menubarview~MenuBarView menu bar} and the UI language direction.
|
|
105
|
+
*/
|
|
106
|
+
get _panelPositions(): Array<PositioningFunction>;
|
|
107
|
+
/**
|
|
108
|
+
* A function used to calculate the optimal position for the dropdown panel.
|
|
109
|
+
*
|
|
110
|
+
* Referenced for unit testing purposes.
|
|
111
|
+
*/
|
|
112
|
+
private static _getOptimalPosition;
|
|
113
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
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/menubar/menubarview
|
|
11
|
+
*/
|
|
12
|
+
import { type BaseEvent, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import { type FocusableView } from '../focuscycler.js';
|
|
14
|
+
import View from '../view.js';
|
|
15
|
+
import type ViewCollection from '../viewcollection.js';
|
|
16
|
+
import type ComponentFactory from '../componentfactory.js';
|
|
17
|
+
import MenuBarMenuView from './menubarmenuview.js';
|
|
18
|
+
import '../../theme/components/menubar/menubar.css';
|
|
19
|
+
/**
|
|
20
|
+
* The application menu bar component. It brings a set of top-level menus (and sub-menus) that can be used
|
|
21
|
+
* to organize and access a large number of buttons.
|
|
22
|
+
*/
|
|
23
|
+
export default class MenuBarView extends View implements FocusableView {
|
|
24
|
+
/**
|
|
25
|
+
* Collection of the child views inside the {@link #element}.
|
|
26
|
+
*/
|
|
27
|
+
children: ViewCollection<MenuBarMenuView>;
|
|
28
|
+
/**
|
|
29
|
+
* Indicates whether any of top-level menus are open in the menu bar. To close
|
|
30
|
+
* the menu bar use the {@link #close} method.
|
|
31
|
+
*
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
isOpen: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* A list of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instances registered in the menu bar.
|
|
37
|
+
*
|
|
38
|
+
* @observable
|
|
39
|
+
*/
|
|
40
|
+
menus: Array<MenuBarMenuView>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of the menu bar view.
|
|
43
|
+
*
|
|
44
|
+
* @param locale The localization services instance.
|
|
45
|
+
*/
|
|
46
|
+
constructor(locale: Locale);
|
|
47
|
+
/**
|
|
48
|
+
* A utility that expands a plain menu bar configuration into a structure of menus (also: sub-menus)
|
|
49
|
+
* and items using a given {@link module:ui/componentfactory~ComponentFactory component factory}.
|
|
50
|
+
*
|
|
51
|
+
* See the {@link module:core/editor/editorconfig~EditorConfig#menuBar menu bar} in the editor
|
|
52
|
+
* configuration reference to learn how to configure the menu bar.
|
|
53
|
+
*/
|
|
54
|
+
fillFromConfig(config: NormalizedMenuBarConfigObject, componentFactory: ComponentFactory): void;
|
|
55
|
+
/**
|
|
56
|
+
* @inheritDoc
|
|
57
|
+
*/
|
|
58
|
+
render(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Focuses the menu bar.
|
|
61
|
+
*/
|
|
62
|
+
focus(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Closes all menus in the bar.
|
|
65
|
+
*/
|
|
66
|
+
close(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Registers a menu view in the menu bar. Every {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance must be registered
|
|
69
|
+
* in the menu bar to be properly managed.
|
|
70
|
+
*/
|
|
71
|
+
registerMenu(menuView: MenuBarMenuView, parentMenuView?: MenuBarMenuView | null): void;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} based on the given definition.
|
|
74
|
+
*/
|
|
75
|
+
private _createMenu;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} items based on the given definition.
|
|
78
|
+
*/
|
|
79
|
+
private _createMenuItems;
|
|
80
|
+
/**
|
|
81
|
+
* Uses the component factory to create a content of the menu item (a button or a sub-menu).
|
|
82
|
+
*/
|
|
83
|
+
private _createMenuItemContentFromFactory;
|
|
84
|
+
/**
|
|
85
|
+
* Checks component and its children recursively and calls {@link #registerMenu}
|
|
86
|
+
* for each item that is {@link module:ui/menubar/menubarmenuview~MenuBarMenuView}.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
private _registerMenuTree;
|
|
91
|
+
/**
|
|
92
|
+
* Manages the state of the {@link #isOpen} property of the menu bar. Because the state is a sum of individual
|
|
93
|
+
* top-level menus' states, it's necessary to listen to their changes and update the state accordingly.
|
|
94
|
+
*
|
|
95
|
+
* Additionally, it prevents from unnecessary changes of `isOpen` when one top-level menu opens and another closes
|
|
96
|
+
* (regardless of in which order), maintaining a stable `isOpen === true` in that situation.
|
|
97
|
+
*/
|
|
98
|
+
private _setupIsOpenUpdater;
|
|
99
|
+
}
|
|
100
|
+
export type MenuBarConfig = MenuBarConfigObject;
|
|
101
|
+
export type MenuBarConfigObject = {
|
|
102
|
+
items?: Array<MenuBarMenuDefinition>;
|
|
103
|
+
removeItems?: Array<string>;
|
|
104
|
+
addItems?: Array<MenuBarConfigAddedItem | MenuBarConfigAddedGroup | MenuBarConfigAddedMenu>;
|
|
105
|
+
isVisible?: boolean;
|
|
106
|
+
};
|
|
107
|
+
export type NormalizedMenuBarConfigObject = Required<MenuBarConfigObject> & {
|
|
108
|
+
isUsingDefaultConfig: boolean;
|
|
109
|
+
};
|
|
110
|
+
export type MenuBarMenuGroupDefinition = {
|
|
111
|
+
groupId: string;
|
|
112
|
+
items: Array<MenuBarMenuDefinition | string>;
|
|
113
|
+
};
|
|
114
|
+
export type MenuBarMenuDefinition = {
|
|
115
|
+
menuId: string;
|
|
116
|
+
label: string;
|
|
117
|
+
groups: Array<MenuBarMenuGroupDefinition>;
|
|
118
|
+
};
|
|
119
|
+
export type MenuBarConfigAddedPosition = `start:${string}` | `end:${string}` | 'start' | 'end' | `after:${string}` | `before:${string}`;
|
|
120
|
+
export type MenuBarConfigAddedItem = {
|
|
121
|
+
item: string;
|
|
122
|
+
position: MenuBarConfigAddedPosition;
|
|
123
|
+
};
|
|
124
|
+
export type MenuBarConfigAddedGroup = {
|
|
125
|
+
group: MenuBarMenuGroupDefinition;
|
|
126
|
+
position: MenuBarConfigAddedPosition;
|
|
127
|
+
};
|
|
128
|
+
export type MenuBarConfigAddedMenu = {
|
|
129
|
+
menu: MenuBarMenuDefinition;
|
|
130
|
+
position: MenuBarConfigAddedPosition;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Any namespaced event fired by menu a {@link module:ui/menubar/menubarview~MenuBarView#menus menu view instance} of the
|
|
134
|
+
* {@link module:ui/menubar/menubarview~MenuBarView menu bar}.
|
|
135
|
+
*/
|
|
136
|
+
interface MenuBarMenuEvent extends BaseEvent {
|
|
137
|
+
name: `menu:${string}` | `menu:change:${string}`;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A `mouseenter` event originating from a {@link module:ui/menubar/menubarview~MenuBarView#menus menu view instance} of the
|
|
141
|
+
* {@link module:ui/menubar/menubarview~MenuBarView menu bar}.
|
|
142
|
+
*/
|
|
143
|
+
export interface MenuBarMenuMouseEnterEvent extends MenuBarMenuEvent {
|
|
144
|
+
name: 'menu:mouseenter';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* An `arrowleft` event originating from a {@link module:ui/menubar/menubarview~MenuBarView#menus menu view instance} of the
|
|
148
|
+
* {@link module:ui/menubar/menubarview~MenuBarView menu bar}.
|
|
149
|
+
*/
|
|
150
|
+
export interface MenuBarMenuArrowLeftEvent extends MenuBarMenuEvent {
|
|
151
|
+
name: 'menu:arrowleft';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* An `arrowright` event originating from a {@link module:ui/menubar/menubarview~MenuBarView#menus menu view instance} of the
|
|
155
|
+
* {@link module:ui/menubar/menubarview~MenuBarView menu bar}.
|
|
156
|
+
*/
|
|
157
|
+
export interface MenuBarMenuArrowRightEvent extends MenuBarMenuEvent {
|
|
158
|
+
name: 'menu:arrowright';
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A `change:isOpen` event originating from a {@link module:ui/menubar/menubarview~MenuBarView#menus menu view instance} of the
|
|
162
|
+
* {@link module:ui/menubar/menubarview~MenuBarView menu bar}.
|
|
163
|
+
*/
|
|
164
|
+
export interface MenuBarMenuChangeIsOpenEvent extends MenuBarMenuEvent {
|
|
165
|
+
name: 'menu:change:isOpen';
|
|
166
|
+
args: [name: string, value: boolean, oldValue: boolean];
|
|
167
|
+
}
|
|
168
|
+
export {};
|