@ckeditor/ckeditor5-ui 41.3.0-alpha.3 → 41.3.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/ckeditor5-metadata.json +1 -1
- package/lang/contexts.json +12 -2
- package/lang/translations/af.po +210 -0
- package/lang/translations/ar.po +44 -4
- package/lang/translations/ast.po +44 -4
- package/lang/translations/az.po +44 -4
- package/lang/translations/bg.po +44 -4
- package/lang/translations/bn.po +44 -4
- package/lang/translations/bs.po +210 -0
- package/lang/translations/ca.po +44 -4
- package/lang/translations/cs.po +44 -4
- package/lang/translations/da.po +44 -4
- package/lang/translations/de-ch.po +44 -4
- package/lang/translations/de.po +44 -4
- package/lang/translations/el.po +44 -4
- package/lang/translations/en-au.po +44 -4
- package/lang/translations/en-gb.po +44 -4
- package/lang/translations/en.po +44 -4
- package/lang/translations/eo.po +44 -4
- package/lang/translations/es-co.po +210 -0
- package/lang/translations/es.po +44 -4
- package/lang/translations/et.po +44 -4
- package/lang/translations/eu.po +44 -4
- package/lang/translations/fa.po +44 -4
- package/lang/translations/fi.po +44 -4
- package/lang/translations/fr.po +44 -4
- package/lang/translations/gl.po +44 -4
- package/lang/translations/he.po +44 -4
- package/lang/translations/hi.po +44 -4
- package/lang/translations/hr.po +44 -4
- package/lang/translations/hu.po +44 -4
- package/lang/translations/id.po +44 -4
- package/lang/translations/it.po +44 -4
- package/lang/translations/ja.po +44 -4
- package/lang/translations/jv.po +210 -0
- package/lang/translations/km.po +44 -4
- package/lang/translations/kn.po +44 -4
- package/lang/translations/ko.po +44 -4
- package/lang/translations/ku.po +44 -4
- package/lang/translations/lt.po +44 -4
- package/lang/translations/lv.po +44 -4
- package/lang/translations/ms.po +44 -4
- package/lang/translations/nb.po +44 -4
- package/lang/translations/ne.po +44 -4
- package/lang/translations/nl.po +44 -4
- package/lang/translations/no.po +44 -4
- package/lang/translations/pl.po +44 -4
- package/lang/translations/pt-br.po +44 -4
- package/lang/translations/pt.po +44 -4
- package/lang/translations/ro.po +44 -4
- package/lang/translations/ru.po +44 -4
- package/lang/translations/sk.po +44 -4
- package/lang/translations/sl.po +44 -4
- package/lang/translations/sq.po +44 -4
- package/lang/translations/sr-latn.po +44 -4
- package/lang/translations/sr.po +44 -4
- package/lang/translations/sv.po +44 -4
- package/lang/translations/th.po +44 -4
- package/lang/translations/tk.po +44 -4
- package/lang/translations/tr.po +44 -4
- package/lang/translations/tt.po +44 -4
- package/lang/translations/ug.po +44 -4
- package/lang/translations/uk.po +44 -4
- package/lang/translations/ur.po +44 -4
- package/lang/translations/uz.po +44 -4
- package/lang/translations/vi.po +44 -4
- package/lang/translations/zh-cn.po +44 -4
- package/lang/translations/zh.po +44 -4
- package/package.json +3 -4
- package/src/button/button.d.ts +6 -0
- package/src/button/buttonview.d.ts +4 -0
- package/src/button/buttonview.js +1 -0
- package/src/button/filedialogbuttonview.d.ts +80 -0
- package/src/button/filedialogbuttonview.js +103 -0
- package/src/dropdown/utils.js +1 -5
- package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +4 -0
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +25 -9
- package/src/index.d.ts +12 -3
- package/src/index.js +10 -2
- package/src/menubar/menubarmenubuttonview.d.ts +35 -0
- package/src/menubar/menubarmenubuttonview.js +64 -0
- package/src/menubar/menubarmenulistitembuttonview.d.ts +21 -0
- package/src/menubar/menubarmenulistitembuttonview.js +30 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +23 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +32 -0
- package/src/menubar/menubarmenulistitemview.d.ts +25 -0
- package/src/menubar/menubarmenulistitemview.js +34 -0
- package/src/menubar/menubarmenulistview.d.ts +24 -0
- package/src/menubar/menubarmenulistview.js +23 -0
- package/src/menubar/menubarmenupanelview.d.ts +53 -0
- package/src/menubar/menubarmenupanelview.js +60 -0
- package/src/menubar/menubarmenuview.d.ts +109 -0
- package/src/menubar/menubarmenuview.js +159 -0
- package/src/menubar/menubarview.d.ts +164 -0
- package/src/menubar/menubarview.js +254 -0
- package/src/menubar/utils.d.ts +432 -0
- package/src/menubar/utils.js +1320 -0
- package/src/toolbar/toolbarview.js +5 -3
- package/src/tooltipmanager.d.ts +11 -0
- package/src/tooltipmanager.js +37 -6
- package/theme/components/menubar/menubar.css +10 -0
- package/theme/components/menubar/menubarmenu.css +9 -0
- package/theme/components/menubar/menubarmenubutton.css +11 -0
- package/theme/components/menubar/menubarmenulistitem.css +10 -0
- package/theme/components/menubar/menubarmenulistitembutton.css +10 -0
- package/theme/components/menubar/menubarmenupanel.css +62 -0
- package/theme/components/tooltip/tooltip.css +0 -3
- package/theme/globals/_reset.css +13 -0
- package/theme/globals/globals.css +1 -0
- package/dist/content-index.css +0 -4
- package/dist/editor-index.css +0 -445
- package/dist/index.css +0 -844
- package/dist/index.css.map +0 -1
- package/dist/translations/ar.d.ts +0 -8
- package/dist/translations/ar.js +0 -5
- package/dist/translations/ast.d.ts +0 -8
- package/dist/translations/ast.js +0 -5
- package/dist/translations/az.d.ts +0 -8
- package/dist/translations/az.js +0 -5
- package/dist/translations/bg.d.ts +0 -8
- package/dist/translations/bg.js +0 -5
- package/dist/translations/bn.d.ts +0 -8
- package/dist/translations/bn.js +0 -5
- package/dist/translations/ca.d.ts +0 -8
- package/dist/translations/ca.js +0 -5
- package/dist/translations/cs.d.ts +0 -8
- package/dist/translations/cs.js +0 -5
- package/dist/translations/da.d.ts +0 -8
- package/dist/translations/da.js +0 -5
- package/dist/translations/de-ch.d.ts +0 -8
- package/dist/translations/de-ch.js +0 -5
- package/dist/translations/de.d.ts +0 -8
- package/dist/translations/de.js +0 -5
- package/dist/translations/el.d.ts +0 -8
- package/dist/translations/el.js +0 -5
- package/dist/translations/en-au.d.ts +0 -8
- package/dist/translations/en-au.js +0 -5
- package/dist/translations/en-gb.d.ts +0 -8
- package/dist/translations/en-gb.js +0 -5
- package/dist/translations/en.d.ts +0 -8
- package/dist/translations/en.js +0 -5
- package/dist/translations/eo.d.ts +0 -8
- package/dist/translations/eo.js +0 -5
- package/dist/translations/es.d.ts +0 -8
- package/dist/translations/es.js +0 -5
- package/dist/translations/et.d.ts +0 -8
- package/dist/translations/et.js +0 -5
- package/dist/translations/eu.d.ts +0 -8
- package/dist/translations/eu.js +0 -5
- package/dist/translations/fa.d.ts +0 -8
- package/dist/translations/fa.js +0 -5
- package/dist/translations/fi.d.ts +0 -8
- package/dist/translations/fi.js +0 -5
- package/dist/translations/fr.d.ts +0 -8
- package/dist/translations/fr.js +0 -5
- package/dist/translations/gl.d.ts +0 -8
- package/dist/translations/gl.js +0 -5
- package/dist/translations/he.d.ts +0 -8
- package/dist/translations/he.js +0 -5
- package/dist/translations/hi.d.ts +0 -8
- package/dist/translations/hi.js +0 -5
- package/dist/translations/hr.d.ts +0 -8
- package/dist/translations/hr.js +0 -5
- package/dist/translations/hu.d.ts +0 -8
- package/dist/translations/hu.js +0 -5
- package/dist/translations/id.d.ts +0 -8
- package/dist/translations/id.js +0 -5
- package/dist/translations/it.d.ts +0 -8
- package/dist/translations/it.js +0 -5
- package/dist/translations/ja.d.ts +0 -8
- package/dist/translations/ja.js +0 -5
- package/dist/translations/km.d.ts +0 -8
- package/dist/translations/km.js +0 -5
- package/dist/translations/kn.d.ts +0 -8
- package/dist/translations/kn.js +0 -5
- package/dist/translations/ko.d.ts +0 -8
- package/dist/translations/ko.js +0 -5
- package/dist/translations/ku.d.ts +0 -8
- package/dist/translations/ku.js +0 -5
- package/dist/translations/lt.d.ts +0 -8
- package/dist/translations/lt.js +0 -5
- package/dist/translations/lv.d.ts +0 -8
- package/dist/translations/lv.js +0 -5
- package/dist/translations/ms.d.ts +0 -8
- package/dist/translations/ms.js +0 -5
- package/dist/translations/nb.d.ts +0 -8
- package/dist/translations/nb.js +0 -5
- package/dist/translations/ne.d.ts +0 -8
- package/dist/translations/ne.js +0 -5
- package/dist/translations/nl.d.ts +0 -8
- package/dist/translations/nl.js +0 -5
- package/dist/translations/no.d.ts +0 -8
- package/dist/translations/no.js +0 -5
- package/dist/translations/pl.d.ts +0 -8
- package/dist/translations/pl.js +0 -5
- package/dist/translations/pt-br.d.ts +0 -8
- package/dist/translations/pt-br.js +0 -5
- package/dist/translations/pt.d.ts +0 -8
- package/dist/translations/pt.js +0 -5
- package/dist/translations/ro.d.ts +0 -8
- package/dist/translations/ro.js +0 -5
- package/dist/translations/ru.d.ts +0 -8
- package/dist/translations/ru.js +0 -5
- package/dist/translations/sk.d.ts +0 -8
- package/dist/translations/sk.js +0 -5
- package/dist/translations/sl.d.ts +0 -8
- package/dist/translations/sl.js +0 -5
- package/dist/translations/sq.d.ts +0 -8
- package/dist/translations/sq.js +0 -5
- package/dist/translations/sr-latn.d.ts +0 -8
- package/dist/translations/sr-latn.js +0 -5
- package/dist/translations/sr.d.ts +0 -8
- package/dist/translations/sr.js +0 -5
- package/dist/translations/sv.d.ts +0 -8
- package/dist/translations/sv.js +0 -5
- package/dist/translations/th.d.ts +0 -8
- package/dist/translations/th.js +0 -5
- package/dist/translations/tk.d.ts +0 -8
- package/dist/translations/tk.js +0 -5
- package/dist/translations/tr.d.ts +0 -8
- package/dist/translations/tr.js +0 -5
- package/dist/translations/tt.d.ts +0 -8
- package/dist/translations/tt.js +0 -5
- package/dist/translations/ug.d.ts +0 -8
- package/dist/translations/ug.js +0 -5
- package/dist/translations/uk.d.ts +0 -8
- package/dist/translations/uk.js +0 -5
- package/dist/translations/ur.d.ts +0 -8
- package/dist/translations/ur.js +0 -5
- package/dist/translations/uz.d.ts +0 -8
- package/dist/translations/uz.js +0 -5
- package/dist/translations/vi.d.ts +0 -8
- package/dist/translations/vi.js +0 -5
- package/dist/translations/zh-cn.d.ts +0 -8
- package/dist/translations/zh-cn.js +0 -5
- package/dist/translations/zh.d.ts +0 -8
- package/dist/translations/zh.js +0 -5
- package/dist/types/arialiveannouncer.d.ts +0 -102
- package/dist/types/augmentation.d.ts +0 -92
- package/dist/types/autocomplete/autocompleteview.d.ts +0 -85
- package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +0 -31
- package/dist/types/bindings/clickoutsidehandler.d.ts +0 -32
- package/dist/types/bindings/csstransitiondisablermixin.d.ts +0 -44
- package/dist/types/bindings/draggableviewmixin.d.ts +0 -50
- package/dist/types/bindings/injectcsstransitiondisabler.d.ts +0 -63
- package/dist/types/bindings/preventdefault.d.ts +0 -37
- package/dist/types/bindings/submithandler.d.ts +0 -61
- package/dist/types/button/button.d.ts +0 -179
- package/dist/types/button/buttonlabel.d.ts +0 -38
- package/dist/types/button/buttonlabelview.d.ts +0 -35
- package/dist/types/button/buttonview.d.ts +0 -185
- package/dist/types/button/switchbuttonview.d.ts +0 -49
- package/dist/types/collapsible/collapsibleview.d.ts +0 -74
- package/dist/types/colorgrid/colorgridview.d.ts +0 -136
- package/dist/types/colorgrid/colortileview.d.ts +0 -32
- package/dist/types/colorgrid/utils.d.ts +0 -51
- package/dist/types/colorpicker/colorpickerview.d.ts +0 -146
- package/dist/types/colorpicker/utils.d.ts +0 -52
- package/dist/types/colorselector/colorgridsfragmentview.d.ts +0 -199
- package/dist/types/colorselector/colorpickerfragmentview.d.ts +0 -133
- package/dist/types/colorselector/colorselectorview.d.ts +0 -246
- package/dist/types/colorselector/documentcolorcollection.d.ts +0 -74
- package/dist/types/componentfactory.d.ts +0 -85
- package/dist/types/dialog/dialog.d.ts +0 -277
- package/dist/types/dialog/dialogactionsview.d.ts +0 -73
- package/dist/types/dialog/dialogcontentview.d.ts +0 -31
- package/dist/types/dialog/dialogview.d.ts +0 -260
- package/dist/types/dropdown/button/dropdownbutton.d.ts +0 -29
- package/dist/types/dropdown/button/dropdownbuttonview.d.ts +0 -52
- package/dist/types/dropdown/button/splitbuttonview.d.ts +0 -166
- package/dist/types/dropdown/dropdownpanelfocusable.d.ts +0 -25
- package/dist/types/dropdown/dropdownpanelview.d.ts +0 -66
- package/dist/types/dropdown/dropdownview.d.ts +0 -319
- package/dist/types/dropdown/utils.d.ts +0 -239
- package/dist/types/editableui/editableuiview.d.ts +0 -76
- package/dist/types/editableui/inline/inlineeditableuiview.d.ts +0 -44
- package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +0 -51
- package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +0 -39
- package/dist/types/editorui/bodycollection.d.ts +0 -59
- package/dist/types/editorui/boxed/boxededitoruiview.d.ts +0 -44
- package/dist/types/editorui/editorui.d.ts +0 -292
- package/dist/types/editorui/editoruiview.d.ts +0 -43
- package/dist/types/editorui/poweredby.d.ts +0 -75
- package/dist/types/focuscycler.d.ts +0 -249
- package/dist/types/formheader/formheaderview.d.ts +0 -63
- package/dist/types/highlightedtext/highlightedtextview.d.ts +0 -42
- package/dist/types/icon/iconview.d.ts +0 -92
- package/dist/types/iframe/iframeview.d.ts +0 -54
- package/dist/types/index.d.ts +0 -78
- package/dist/types/input/inputbase.d.ts +0 -123
- package/dist/types/input/inputview.d.ts +0 -40
- package/dist/types/inputnumber/inputnumberview.d.ts +0 -53
- package/dist/types/inputtext/inputtextview.d.ts +0 -22
- package/dist/types/label/labelview.d.ts +0 -40
- package/dist/types/labeledfield/labeledfieldview.d.ts +0 -191
- package/dist/types/labeledfield/utils.d.ts +0 -127
- package/dist/types/labeledinput/labeledinputview.d.ts +0 -129
- package/dist/types/list/listitemgroupview.d.ts +0 -63
- package/dist/types/list/listitemview.d.ts +0 -40
- package/dist/types/list/listseparatorview.d.ts +0 -22
- package/dist/types/list/listview.d.ts +0 -128
- package/dist/types/model.d.ts +0 -26
- package/dist/types/notification/notification.d.ts +0 -215
- package/dist/types/panel/balloon/balloonpanelview.d.ts +0 -689
- package/dist/types/panel/balloon/contextualballoon.d.ts +0 -303
- package/dist/types/panel/sticky/stickypanelview.d.ts +0 -160
- package/dist/types/search/filteredview.d.ts +0 -35
- package/dist/types/search/searchinfoview.d.ts +0 -49
- package/dist/types/search/searchresultsview.d.ts +0 -58
- package/dist/types/search/text/searchtextqueryview.d.ts +0 -80
- package/dist/types/search/text/searchtextview.d.ts +0 -223
- package/dist/types/spinner/spinnerview.d.ts +0 -29
- package/dist/types/template.d.ts +0 -946
- package/dist/types/textarea/textareaview.d.ts +0 -108
- package/dist/types/toolbar/balloon/balloontoolbar.d.ts +0 -121
- package/dist/types/toolbar/block/blockbuttonview.d.ts +0 -39
- package/dist/types/toolbar/block/blocktoolbar.d.ts +0 -157
- package/dist/types/toolbar/normalizetoolbarconfig.d.ts +0 -44
- package/dist/types/toolbar/toolbarlinebreakview.d.ts +0 -22
- package/dist/types/toolbar/toolbarseparatorview.d.ts +0 -22
- package/dist/types/toolbar/toolbarview.d.ts +0 -271
- package/dist/types/tooltipmanager.d.ts +0 -188
- package/dist/types/view.d.ts +0 -426
- package/dist/types/viewcollection.d.ts +0 -143
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module ui/editorui/accessibilityhelp/accessibilityhelp
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import { ButtonView, Dialog } from '../../index.js';
|
|
9
|
+
import { ButtonView, MenuBarMenuListItemButtonView, Dialog } from '../../index.js';
|
|
10
10
|
import AccessibilityHelpContentView from './accessibilityhelpcontentview.js';
|
|
11
11
|
import { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
import accessibilityIcon from '../../../theme/icons/accessibility.svg';
|
|
@@ -46,17 +46,19 @@ export default class AccessibilityHelp extends Plugin {
|
|
|
46
46
|
init() {
|
|
47
47
|
const editor = this.editor;
|
|
48
48
|
const t = editor.locale.t;
|
|
49
|
-
editor.ui.componentFactory.add('accessibilityHelp',
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
label: t('Accessibility help'),
|
|
49
|
+
editor.ui.componentFactory.add('accessibilityHelp', () => {
|
|
50
|
+
const button = this._createButton(ButtonView);
|
|
51
|
+
button.set({
|
|
53
52
|
tooltip: true,
|
|
54
53
|
withText: false,
|
|
55
|
-
|
|
56
|
-
icon: accessibilityIcon
|
|
54
|
+
label: t('Accessibility help')
|
|
57
55
|
});
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
return button;
|
|
57
|
+
});
|
|
58
|
+
editor.ui.componentFactory.add('menuBar:accessibilityHelp', () => {
|
|
59
|
+
const button = this._createButton(MenuBarMenuListItemButtonView);
|
|
60
|
+
button.label = t('Accessibility');
|
|
61
|
+
return button;
|
|
60
62
|
});
|
|
61
63
|
editor.keystrokes.set('Alt+0', (evt, cancel) => {
|
|
62
64
|
this._showDialog();
|
|
@@ -64,6 +66,20 @@ export default class AccessibilityHelp extends Plugin {
|
|
|
64
66
|
});
|
|
65
67
|
this._setupRootLabels();
|
|
66
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a button to show accessibility help dialog, for use either in toolbar or in menu bar.
|
|
71
|
+
*/
|
|
72
|
+
_createButton(ButtonClass) {
|
|
73
|
+
const editor = this.editor;
|
|
74
|
+
const locale = editor.locale;
|
|
75
|
+
const view = new ButtonClass(locale);
|
|
76
|
+
view.set({
|
|
77
|
+
keystroke: 'Alt+0',
|
|
78
|
+
icon: accessibilityIcon
|
|
79
|
+
});
|
|
80
|
+
view.on('execute', () => this._showDialog());
|
|
81
|
+
return view;
|
|
82
|
+
}
|
|
67
83
|
/**
|
|
68
84
|
* Injects a help text into each editing root's `aria-label` attribute allowing assistive technology users
|
|
69
85
|
* to discover the availability of the Accessibility help dialog.
|
package/src/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui
|
|
7
7
|
*/
|
|
8
|
-
export { default as View, type UIViewRenderEvent } from './view.js';
|
|
9
8
|
export { default as clickOutsideHandler } from './bindings/clickoutsidehandler.js';
|
|
10
9
|
export { default as injectCssTransitionDisabler } from './bindings/injectcsstransitiondisabler.js';
|
|
11
10
|
export { default as CssTransitionDisablerMixin, type ViewWithCssTransitionDisabler } from './bindings/csstransitiondisablermixin.js';
|
|
@@ -13,11 +12,12 @@ export { default as submitHandler } from './bindings/submithandler.js';
|
|
|
13
12
|
export { default as addKeyboardHandlingForGrid } from './bindings/addkeyboardhandlingforgrid.js';
|
|
14
13
|
export { default as AccessibilityHelp } from './editorui/accessibilityhelp/accessibilityhelp.js';
|
|
15
14
|
export { default as BodyCollection } from './editorui/bodycollection.js';
|
|
16
|
-
export { type ButtonExecuteEvent } from './button/button.js';
|
|
15
|
+
export { default as Button, type ButtonExecuteEvent } from './button/button.js';
|
|
17
16
|
export type { default as ButtonLabel } from './button/buttonlabel.js';
|
|
18
17
|
export { default as ButtonView } from './button/buttonview.js';
|
|
19
18
|
export { default as ButtonLabelView } from './button/buttonlabelview.js';
|
|
20
19
|
export { default as SwitchButtonView } from './button/switchbuttonview.js';
|
|
20
|
+
export { default as FileDialogButtonView } from './button/filedialogbuttonview.js';
|
|
21
21
|
export { default as CollapsibleView } from './collapsible/collapsibleview.js';
|
|
22
22
|
export * from './colorgrid/utils.js';
|
|
23
23
|
export { default as ColorGridView, type ColorDefinition } from './colorgrid/colorgridview.js';
|
|
@@ -50,6 +50,7 @@ export { type LabeledFieldViewCreator, default as LabeledFieldView } from './lab
|
|
|
50
50
|
export * from './labeledfield/utils.js';
|
|
51
51
|
export { default as ListItemGroupView } from './list/listitemgroupview.js';
|
|
52
52
|
export { default as ListItemView } from './list/listitemview.js';
|
|
53
|
+
export { default as ListSeparatorView } from './list/listseparatorview.js';
|
|
53
54
|
export { default as ListView } from './list/listview.js';
|
|
54
55
|
export { default as Notification } from './notification/notification.js';
|
|
55
56
|
export { default as ViewModel } from './model.js';
|
|
@@ -59,7 +60,7 @@ export { default as StickyPanelView } from './panel/sticky/stickypanelview.js';
|
|
|
59
60
|
export { default as AutocompleteView, type AutocompleteViewConfig, type AutocompleteResultsView } from './autocomplete/autocompleteview.js';
|
|
60
61
|
export { default as SearchTextView, type SearchTextViewSearchEvent, type SearchTextViewConfig } from './search/text/searchtextview.js';
|
|
61
62
|
export { default as SearchInfoView } from './search/searchinfoview.js';
|
|
62
|
-
export
|
|
63
|
+
export { default as FilteredView, type FilteredViewExecuteEvent } from './search/filteredview.js';
|
|
63
64
|
export { default as HighlightedTextView } from './highlightedtext/highlightedtextview.js';
|
|
64
65
|
export { default as TooltipManager } from './tooltipmanager.js';
|
|
65
66
|
export { default as Template, type TemplateDefinition } from './template.js';
|
|
@@ -70,5 +71,13 @@ export { default as ToolbarSeparatorView } from './toolbar/toolbarseparatorview.
|
|
|
70
71
|
export { default as normalizeToolbarConfig } from './toolbar/normalizetoolbarconfig.js';
|
|
71
72
|
export { default as BalloonToolbar, type BalloonToolbarShowEvent } from './toolbar/balloon/balloontoolbar.js';
|
|
72
73
|
export { default as BlockToolbar } from './toolbar/block/blocktoolbar.js';
|
|
74
|
+
export { default as View, type UIViewRenderEvent } from './view.js';
|
|
73
75
|
export { default as ViewCollection } from './viewcollection.js';
|
|
76
|
+
export { default as MenuBarView, type MenuBarConfig } from './menubar/menubarview.js';
|
|
77
|
+
export { default as MenuBarMenuView } from './menubar/menubarmenuview.js';
|
|
78
|
+
export { default as MenuBarMenuListView } from './menubar/menubarmenulistview.js';
|
|
79
|
+
export { default as MenuBarMenuListItemView } from './menubar/menubarmenulistitemview.js';
|
|
80
|
+
export { default as MenuBarMenuListItemButtonView } from './menubar/menubarmenulistitembuttonview.js';
|
|
81
|
+
export { default as MenuBarMenuListItemFileDialogButtonView } from './menubar/menubarmenulistitemfiledialogbuttonview.js';
|
|
82
|
+
export { normalizeMenuBarConfig, DefaultMenuBarItems } from './menubar/utils.js';
|
|
74
83
|
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui
|
|
7
7
|
*/
|
|
8
|
-
// This import must be at the top to ensure that `globals.css` is imported first
|
|
9
|
-
export { default as View } from './view.js';
|
|
10
8
|
export { default as clickOutsideHandler } from './bindings/clickoutsidehandler.js';
|
|
11
9
|
export { default as injectCssTransitionDisabler } from './bindings/injectcsstransitiondisabler.js';
|
|
12
10
|
export { default as CssTransitionDisablerMixin } from './bindings/csstransitiondisablermixin.js';
|
|
@@ -17,6 +15,7 @@ export { default as BodyCollection } from './editorui/bodycollection.js';
|
|
|
17
15
|
export { default as ButtonView } from './button/buttonview.js';
|
|
18
16
|
export { default as ButtonLabelView } from './button/buttonlabelview.js';
|
|
19
17
|
export { default as SwitchButtonView } from './button/switchbuttonview.js';
|
|
18
|
+
export { default as FileDialogButtonView } from './button/filedialogbuttonview.js';
|
|
20
19
|
export { default as CollapsibleView } from './collapsible/collapsibleview.js';
|
|
21
20
|
export * from './colorgrid/utils.js';
|
|
22
21
|
export { default as ColorGridView } from './colorgrid/colorgridview.js';
|
|
@@ -48,6 +47,7 @@ export { default as LabeledFieldView } from './labeledfield/labeledfieldview.js'
|
|
|
48
47
|
export * from './labeledfield/utils.js';
|
|
49
48
|
export { default as ListItemGroupView } from './list/listitemgroupview.js';
|
|
50
49
|
export { default as ListItemView } from './list/listitemview.js';
|
|
50
|
+
export { default as ListSeparatorView } from './list/listseparatorview.js';
|
|
51
51
|
export { default as ListView } from './list/listview.js';
|
|
52
52
|
export { default as Notification } from './notification/notification.js';
|
|
53
53
|
export { default as ViewModel } from './model.js';
|
|
@@ -67,5 +67,13 @@ export { default as ToolbarSeparatorView } from './toolbar/toolbarseparatorview.
|
|
|
67
67
|
export { default as normalizeToolbarConfig } from './toolbar/normalizetoolbarconfig.js';
|
|
68
68
|
export { default as BalloonToolbar } from './toolbar/balloon/balloontoolbar.js';
|
|
69
69
|
export { default as BlockToolbar } from './toolbar/block/blocktoolbar.js';
|
|
70
|
+
export { default as View } from './view.js';
|
|
70
71
|
export { default as ViewCollection } from './viewcollection.js';
|
|
72
|
+
export { default as MenuBarView } from './menubar/menubarview.js';
|
|
73
|
+
export { default as MenuBarMenuView } from './menubar/menubarmenuview.js';
|
|
74
|
+
export { default as MenuBarMenuListView } from './menubar/menubarmenulistview.js';
|
|
75
|
+
export { default as MenuBarMenuListItemView } from './menubar/menubarmenulistitemview.js';
|
|
76
|
+
export { default as MenuBarMenuListItemButtonView } from './menubar/menubarmenulistitembuttonview.js';
|
|
77
|
+
export { default as MenuBarMenuListItemFileDialogButtonView } from './menubar/menubarmenulistitemfiledialogbuttonview.js';
|
|
78
|
+
export { normalizeMenuBarConfig, DefaultMenuBarItems } from './menubar/utils.js';
|
|
71
79
|
import './augmentation.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenubuttonview
|
|
7
|
+
*/
|
|
8
|
+
import IconView from '../icon/iconview.js';
|
|
9
|
+
import ButtonView from '../button/buttonview.js';
|
|
10
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
11
|
+
import '../../theme/components/menubar/menubarmenubutton.css';
|
|
12
|
+
/**
|
|
13
|
+
* A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one
|
|
14
|
+
* open both top-level bar menus as well as sub-menus.
|
|
15
|
+
*/
|
|
16
|
+
export default class MenuBarMenuButtonView extends ButtonView {
|
|
17
|
+
/**
|
|
18
|
+
* An icon that displays an arrow to indicate a direction of the menu.
|
|
19
|
+
*/
|
|
20
|
+
readonly arrowView: IconView;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of the menu bar button view.
|
|
23
|
+
*
|
|
24
|
+
* @param locale The localization services instance.
|
|
25
|
+
*/
|
|
26
|
+
constructor(locale: Locale);
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
render(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Creates the {@link #arrowView} instance.
|
|
33
|
+
*/
|
|
34
|
+
private _createArrowView;
|
|
35
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenubuttonview
|
|
7
|
+
*/
|
|
8
|
+
import IconView from '../icon/iconview.js';
|
|
9
|
+
import ButtonView from '../button/buttonview.js';
|
|
10
|
+
import dropdownArrowIcon from '../../theme/icons/dropdown-arrow.svg';
|
|
11
|
+
import '../../theme/components/menubar/menubarmenubutton.css';
|
|
12
|
+
/**
|
|
13
|
+
* A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one
|
|
14
|
+
* open both top-level bar menus as well as sub-menus.
|
|
15
|
+
*/
|
|
16
|
+
export default class MenuBarMenuButtonView extends ButtonView {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of the menu bar button view.
|
|
19
|
+
*
|
|
20
|
+
* @param locale The localization services instance.
|
|
21
|
+
*/
|
|
22
|
+
constructor(locale) {
|
|
23
|
+
super(locale);
|
|
24
|
+
const bind = this.bindTemplate;
|
|
25
|
+
this.set({
|
|
26
|
+
withText: true,
|
|
27
|
+
role: 'menuitem'
|
|
28
|
+
});
|
|
29
|
+
this.arrowView = this._createArrowView();
|
|
30
|
+
this.extendTemplate({
|
|
31
|
+
attributes: {
|
|
32
|
+
class: [
|
|
33
|
+
'ck-menu-bar__menu__button'
|
|
34
|
+
],
|
|
35
|
+
'aria-haspopup': true,
|
|
36
|
+
'aria-expanded': this.bindTemplate.to('isOn', value => String(value)),
|
|
37
|
+
'data-cke-tooltip-disabled': bind.to('isOn')
|
|
38
|
+
},
|
|
39
|
+
on: {
|
|
40
|
+
'mouseenter': bind.to('mouseenter')
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
render() {
|
|
48
|
+
super.render();
|
|
49
|
+
this.children.add(this.arrowView);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates the {@link #arrowView} instance.
|
|
53
|
+
*/
|
|
54
|
+
_createArrowView() {
|
|
55
|
+
const arrowView = new IconView();
|
|
56
|
+
arrowView.content = dropdownArrowIcon;
|
|
57
|
+
arrowView.extendTemplate({
|
|
58
|
+
attributes: {
|
|
59
|
+
class: 'ck-menu-bar__menu__button__arrow'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return arrowView;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenulistitembuttonview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import ButtonView from '../button/buttonview.js';
|
|
10
|
+
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
11
|
+
/**
|
|
12
|
+
* A menu bar list button view. Buttons like this one execute user actions.
|
|
13
|
+
*/
|
|
14
|
+
export default class MenuBarMenuListItemButtonView extends ButtonView {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the menu bar list button view.
|
|
17
|
+
*
|
|
18
|
+
* @param locale The localization services instance.
|
|
19
|
+
*/
|
|
20
|
+
constructor(locale: Locale);
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import ButtonView from '../button/buttonview.js';
|
|
6
|
+
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
7
|
+
/**
|
|
8
|
+
* A menu bar list button view. Buttons like this one execute user actions.
|
|
9
|
+
*/
|
|
10
|
+
export default class MenuBarMenuListItemButtonView extends ButtonView {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of the menu bar list button view.
|
|
13
|
+
*
|
|
14
|
+
* @param locale The localization services instance.
|
|
15
|
+
*/
|
|
16
|
+
constructor(locale) {
|
|
17
|
+
super(locale);
|
|
18
|
+
this.set({
|
|
19
|
+
withText: true,
|
|
20
|
+
withKeystroke: true,
|
|
21
|
+
tooltip: false,
|
|
22
|
+
role: 'menuitem'
|
|
23
|
+
});
|
|
24
|
+
this.extendTemplate({
|
|
25
|
+
attributes: {
|
|
26
|
+
class: ['ck-menu-bar__menu__item__button']
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenulistitemfiledialogbuttonview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import FileDialogButtonView from '../button/filedialogbuttonview.js';
|
|
10
|
+
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
11
|
+
/**
|
|
12
|
+
* A menu bar list file dialog button view. Buttons like this one execute user actions.
|
|
13
|
+
*
|
|
14
|
+
* This component provides a button that opens the native file selection dialog.
|
|
15
|
+
*/
|
|
16
|
+
export default class MenuBarMenuListItemFileDialogButtonView extends FileDialogButtonView {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of the menu bar list button view.
|
|
19
|
+
*
|
|
20
|
+
* @param locale The localization services instance.
|
|
21
|
+
*/
|
|
22
|
+
constructor(locale: Locale);
|
|
23
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import FileDialogButtonView from '../button/filedialogbuttonview.js';
|
|
6
|
+
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
7
|
+
/**
|
|
8
|
+
* A menu bar list file dialog button view. Buttons like this one execute user actions.
|
|
9
|
+
*
|
|
10
|
+
* This component provides a button that opens the native file selection dialog.
|
|
11
|
+
*/
|
|
12
|
+
export default class MenuBarMenuListItemFileDialogButtonView extends FileDialogButtonView {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of the menu bar list button view.
|
|
15
|
+
*
|
|
16
|
+
* @param locale The localization services instance.
|
|
17
|
+
*/
|
|
18
|
+
constructor(locale) {
|
|
19
|
+
super(locale);
|
|
20
|
+
this.set({
|
|
21
|
+
withText: true,
|
|
22
|
+
withKeystroke: true,
|
|
23
|
+
tooltip: false,
|
|
24
|
+
role: 'menuitem'
|
|
25
|
+
});
|
|
26
|
+
this.extendTemplate({
|
|
27
|
+
attributes: {
|
|
28
|
+
class: ['ck-menu-bar__menu__item__button']
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenulistitemview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import ListItemView from '../list/listitemview.js';
|
|
10
|
+
import type MenuBarMenuView from './menubarmenuview.js';
|
|
11
|
+
import '../../theme/components/menubar/menubarmenulistitem.css';
|
|
12
|
+
/**
|
|
13
|
+
* A menu bar list item view, a child of {@link module:ui/menubar/menubarmenulistview~MenuBarMenuListView}.
|
|
14
|
+
*
|
|
15
|
+
* Populate this item with a {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} instance
|
|
16
|
+
* or a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance to create a sub-menu.
|
|
17
|
+
*/
|
|
18
|
+
export default class MenuBarMenuListItemView extends ListItemView {
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of the list item view.
|
|
21
|
+
*
|
|
22
|
+
* @param locale The localization services instance.
|
|
23
|
+
*/
|
|
24
|
+
constructor(locale: Locale, parentMenuView: MenuBarMenuView);
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import ListItemView from '../list/listitemview.js';
|
|
6
|
+
import '../../theme/components/menubar/menubarmenulistitem.css';
|
|
7
|
+
/**
|
|
8
|
+
* A menu bar list item view, a child of {@link module:ui/menubar/menubarmenulistview~MenuBarMenuListView}.
|
|
9
|
+
*
|
|
10
|
+
* Populate this item with a {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} instance
|
|
11
|
+
* or a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance to create a sub-menu.
|
|
12
|
+
*/
|
|
13
|
+
export default class MenuBarMenuListItemView extends ListItemView {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of the list item view.
|
|
16
|
+
*
|
|
17
|
+
* @param locale The localization services instance.
|
|
18
|
+
*/
|
|
19
|
+
constructor(locale, parentMenuView) {
|
|
20
|
+
super(locale);
|
|
21
|
+
const bind = this.bindTemplate;
|
|
22
|
+
this.extendTemplate({
|
|
23
|
+
attributes: {
|
|
24
|
+
class: [
|
|
25
|
+
'ck-menu-bar__menu__item'
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
on: {
|
|
29
|
+
'mouseenter': bind.to('mouseenter')
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
this.delegate('mouseenter').to(parentMenuView);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenulistview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import ListView from '../list/listview.js';
|
|
10
|
+
/**
|
|
11
|
+
* A list of menu bar items, a child of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView}.
|
|
12
|
+
*
|
|
13
|
+
* Use this class to create a list of items (options, buttons) to be displayed in a menu bar.
|
|
14
|
+
*
|
|
15
|
+
* To populate this list, use {@link module:ui/menubar/menubarmenulistitemview~MenuBarMenuListItemView} instances.
|
|
16
|
+
*/
|
|
17
|
+
export default class MenuBarMenuListView extends ListView {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the list view.
|
|
20
|
+
*
|
|
21
|
+
* @param locale The localization services instance.
|
|
22
|
+
*/
|
|
23
|
+
constructor(locale: Locale);
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import ListView from '../list/listview.js';
|
|
6
|
+
/**
|
|
7
|
+
* A list of menu bar items, a child of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView}.
|
|
8
|
+
*
|
|
9
|
+
* Use this class to create a list of items (options, buttons) to be displayed in a menu bar.
|
|
10
|
+
*
|
|
11
|
+
* To populate this list, use {@link module:ui/menubar/menubarmenulistitemview~MenuBarMenuListItemView} instances.
|
|
12
|
+
*/
|
|
13
|
+
export default class MenuBarMenuListView extends ListView {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of the list view.
|
|
16
|
+
*
|
|
17
|
+
* @param locale The localization services instance.
|
|
18
|
+
*/
|
|
19
|
+
constructor(locale) {
|
|
20
|
+
super(locale);
|
|
21
|
+
this.role = 'menu';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/menubar/menubarmenupanelview
|
|
7
|
+
*/
|
|
8
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import type { FocusableView } from '../focuscycler.js';
|
|
10
|
+
import type ViewCollection from '../viewcollection.js';
|
|
11
|
+
import View from '../view.js';
|
|
12
|
+
import '../../theme/components/menubar/menubarmenupanel.css';
|
|
13
|
+
/**
|
|
14
|
+
* A view representing a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView} of a menu.
|
|
15
|
+
*/
|
|
16
|
+
export default class MenuBarMenuPanelView extends View implements FocusableView {
|
|
17
|
+
/**
|
|
18
|
+
* Collection of the child views in this panel.
|
|
19
|
+
*/
|
|
20
|
+
readonly children: ViewCollection<FocusableView>;
|
|
21
|
+
/**
|
|
22
|
+
* Controls whether the panel is visible.
|
|
23
|
+
*
|
|
24
|
+
* @observable
|
|
25
|
+
*/
|
|
26
|
+
isVisible: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the position of the panel, relative to the parent.
|
|
29
|
+
*
|
|
30
|
+
* This property is reflected in the CSS class suffix set to {@link #element} that controls
|
|
31
|
+
* the position of the panel.
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
* @default 'se'
|
|
35
|
+
*/
|
|
36
|
+
position: MenuBarMenuPanelPosition;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an instance of the menu panel view.
|
|
39
|
+
*
|
|
40
|
+
* @param locale The localization services instance.
|
|
41
|
+
*/
|
|
42
|
+
constructor(locale?: Locale);
|
|
43
|
+
/**
|
|
44
|
+
* Focuses the first child of the panel (default) or the last one if the `direction` is `-1`.
|
|
45
|
+
*/
|
|
46
|
+
focus(direction?: -1 | 1): void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The names of the positions of the {@link module:ui/menubar/menubarmenupanelview~MenuBarMenuPanelView}.
|
|
50
|
+
*
|
|
51
|
+
* They are reflected as CSS class suffixes on the panel view element.
|
|
52
|
+
*/
|
|
53
|
+
export type MenuBarMenuPanelPosition = 'se' | 'sw' | 'ne' | 'nw' | 'w' | 'e';
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
import View from '../view.js';
|
|
6
|
+
import '../../theme/components/menubar/menubarmenupanel.css';
|
|
7
|
+
/**
|
|
8
|
+
* A view representing a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView} of a menu.
|
|
9
|
+
*/
|
|
10
|
+
export default class MenuBarMenuPanelView extends View {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of the menu panel view.
|
|
13
|
+
*
|
|
14
|
+
* @param locale The localization services instance.
|
|
15
|
+
*/
|
|
16
|
+
constructor(locale) {
|
|
17
|
+
super(locale);
|
|
18
|
+
const bind = this.bindTemplate;
|
|
19
|
+
this.set('isVisible', false);
|
|
20
|
+
this.set('position', 'se');
|
|
21
|
+
this.children = this.createCollection();
|
|
22
|
+
this.setTemplate({
|
|
23
|
+
tag: 'div',
|
|
24
|
+
attributes: {
|
|
25
|
+
class: [
|
|
26
|
+
'ck',
|
|
27
|
+
'ck-reset',
|
|
28
|
+
'ck-menu-bar__menu__panel',
|
|
29
|
+
bind.to('position', value => `ck-menu-bar__menu__panel_position_${value}`),
|
|
30
|
+
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
31
|
+
],
|
|
32
|
+
tabindex: '-1'
|
|
33
|
+
},
|
|
34
|
+
children: this.children,
|
|
35
|
+
on: {
|
|
36
|
+
// Drag and drop in the panel should not break the selection in the editor.
|
|
37
|
+
// https://github.com/ckeditor/ckeditor5-ui/issues/228
|
|
38
|
+
selectstart: bind.to(evt => {
|
|
39
|
+
if (evt.target.tagName.toLocaleLowerCase() === 'input') {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
evt.preventDefault();
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Focuses the first child of the panel (default) or the last one if the `direction` is `-1`.
|
|
49
|
+
*/
|
|
50
|
+
focus(direction = 1) {
|
|
51
|
+
if (this.children.length) {
|
|
52
|
+
if (direction === 1) {
|
|
53
|
+
this.children.first.focus();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.children.last.focus();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|