@ckeditor/ckeditor5-ui 43.0.0 → 43.1.0-alpha.1
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/bindings/clickoutsidehandler.d.ts +5 -3
- package/dist/dropdown/dropdownview.d.ts +21 -8
- package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +48 -0
- package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +40 -0
- package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +21 -0
- package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +26 -0
- package/dist/dropdown/menu/dropdownmenulistview.d.ts +28 -0
- package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +38 -0
- package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +135 -0
- package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +144 -0
- package/dist/dropdown/menu/utils.d.ts +128 -0
- package/dist/dropdown/utils.d.ts +58 -0
- package/dist/editableui/editableuiview.d.ts +1 -1
- package/dist/editableui/inline/inlineeditableuiview.d.ts +13 -9
- package/dist/editorui/editorui.d.ts +4 -0
- package/dist/index-editor.css +16 -0
- package/dist/index.css +31 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +4717 -3869
- package/dist/index.js.map +1 -1
- package/dist/menubar/utils.d.ts +5 -5
- package/dist/panel/balloon/contextualballoon.d.ts +12 -6
- package/dist/toolbar/balloon/balloontoolbar.d.ts +5 -0
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +1 -1
- package/lang/translations/af.po +4 -4
- package/lang/translations/ar.po +4 -4
- package/lang/translations/ast.po +4 -4
- package/lang/translations/az.po +4 -4
- package/lang/translations/bg.po +4 -4
- package/lang/translations/bn.po +4 -4
- package/lang/translations/bs.po +4 -4
- package/lang/translations/ca.po +4 -4
- package/lang/translations/cs.po +4 -4
- package/lang/translations/da.po +4 -4
- package/lang/translations/de-ch.po +4 -4
- package/lang/translations/de.po +4 -4
- package/lang/translations/el.po +4 -4
- package/lang/translations/en-au.po +4 -4
- package/lang/translations/en-gb.po +4 -4
- package/lang/translations/en.po +4 -4
- package/lang/translations/eo.po +4 -4
- package/lang/translations/es-co.po +4 -4
- package/lang/translations/es.po +4 -4
- package/lang/translations/et.po +4 -4
- package/lang/translations/eu.po +4 -4
- package/lang/translations/fa.po +4 -4
- package/lang/translations/fi.po +4 -4
- package/lang/translations/fr.po +4 -4
- package/lang/translations/gl.po +4 -4
- package/lang/translations/he.po +4 -4
- package/lang/translations/hi.po +4 -4
- package/lang/translations/hr.po +4 -4
- package/lang/translations/hu.po +4 -4
- package/lang/translations/id.po +4 -4
- package/lang/translations/it.po +4 -4
- package/lang/translations/ja.po +4 -4
- package/lang/translations/jv.po +4 -4
- package/lang/translations/km.po +4 -4
- package/lang/translations/kn.po +4 -4
- package/lang/translations/ko.po +4 -4
- package/lang/translations/ku.po +4 -4
- package/lang/translations/lt.po +4 -4
- package/lang/translations/lv.po +4 -4
- package/lang/translations/ms.po +4 -4
- package/lang/translations/nb.po +4 -4
- package/lang/translations/ne.po +4 -4
- package/lang/translations/nl.po +4 -4
- package/lang/translations/no.po +4 -4
- package/lang/translations/pl.po +4 -4
- package/lang/translations/pt-br.po +4 -4
- package/lang/translations/pt.po +4 -4
- package/lang/translations/ro.po +4 -4
- package/lang/translations/ru.po +4 -4
- package/lang/translations/sk.po +4 -4
- package/lang/translations/sl.po +4 -4
- package/lang/translations/sq.po +4 -4
- package/lang/translations/sr-latn.po +4 -4
- package/lang/translations/sr.po +4 -4
- package/lang/translations/sv.po +4 -4
- package/lang/translations/th.po +4 -4
- package/lang/translations/ti.po +4 -4
- package/lang/translations/tk.po +4 -4
- package/lang/translations/tr.po +4 -4
- package/lang/translations/tt.po +4 -4
- package/lang/translations/ug.po +4 -4
- package/lang/translations/uk.po +4 -4
- package/lang/translations/ur.po +4 -4
- package/lang/translations/uz.po +4 -4
- package/lang/translations/vi.po +4 -4
- package/lang/translations/zh-cn.po +4 -4
- package/lang/translations/zh.po +4 -4
- package/package.json +4 -3
- package/src/bindings/clickoutsidehandler.d.ts +5 -3
- package/src/bindings/clickoutsidehandler.js +3 -2
- package/src/dialog/dialog.js +0 -1
- package/src/dropdown/dropdownview.d.ts +21 -8
- package/src/dropdown/menu/dropdownmenubehaviors.d.ts +44 -0
- package/src/dropdown/menu/dropdownmenubehaviors.js +119 -0
- package/src/dropdown/menu/dropdownmenubuttonview.d.ts +36 -0
- package/src/dropdown/menu/dropdownmenubuttonview.js +65 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.d.ts +17 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +29 -0
- package/src/dropdown/menu/dropdownmenulistitemview.d.ts +22 -0
- package/src/dropdown/menu/dropdownmenulistitemview.js +34 -0
- package/src/dropdown/menu/dropdownmenulistview.d.ts +24 -0
- package/src/dropdown/menu/dropdownmenulistview.js +29 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +34 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +63 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.d.ts +131 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +191 -0
- package/src/dropdown/menu/dropdownmenurootlistview.d.ts +140 -0
- package/src/dropdown/menu/dropdownmenurootlistview.js +160 -0
- package/src/dropdown/menu/utils.d.ts +124 -0
- package/src/dropdown/menu/utils.js +61 -0
- package/src/dropdown/utils.d.ts +58 -0
- package/src/dropdown/utils.js +101 -18
- package/src/editableui/editableuiview.d.ts +1 -1
- package/src/editableui/inline/inlineeditableuiview.d.ts +13 -9
- package/src/editableui/inline/inlineeditableuiview.js +29 -6
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +3 -1
- package/src/editorui/editorui.d.ts +4 -0
- package/src/editorui/editorui.js +16 -1
- package/src/editorui/poweredby.js +0 -1
- package/src/index.d.ts +7 -1
- package/src/index.js +6 -0
- package/src/menubar/menubarmenuview.js +1 -0
- package/src/menubar/utils.d.ts +5 -5
- package/src/menubar/utils.js +21 -12
- package/src/panel/balloon/balloonpanelview.js +19 -12
- package/src/panel/balloon/contextualballoon.d.ts +12 -6
- package/src/panel/balloon/contextualballoon.js +24 -24
- package/src/toolbar/balloon/balloontoolbar.d.ts +5 -0
- package/src/toolbar/balloon/balloontoolbar.js +26 -5
- package/src/toolbar/block/blocktoolbar.js +0 -2
- package/theme/components/dropdown/menu/dropdownmenu.css +8 -0
- package/theme/components/dropdown/menu/dropdownmenubutton.css +9 -0
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenupanel.css +11 -0
|
@@ -0,0 +1,128 @@
|
|
|
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/dropdown/menu/utils
|
|
11
|
+
*/
|
|
12
|
+
import type { PositioningFunction } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
/**
|
|
14
|
+
* Contains every positioning function used by {@link module:ui/dropdown/menu/dropdownmenunestedmenuview~DropdownMenuNestedMenuView} that
|
|
15
|
+
* decides where the {@link module:ui/dropdown/menu/dropdownmenunestedmenuview~DropdownMenuNestedMenuView#panelView} should be placed.
|
|
16
|
+
*
|
|
17
|
+
* Positioning functions:
|
|
18
|
+
*
|
|
19
|
+
* ┌──────┬───────────────┐
|
|
20
|
+
* │ │ │
|
|
21
|
+
* └──────┤ │
|
|
22
|
+
* │ │
|
|
23
|
+
* │ ES │
|
|
24
|
+
* └───────────────┘
|
|
25
|
+
*
|
|
26
|
+
* ┌───────────────┬──────┐
|
|
27
|
+
* │ │ │
|
|
28
|
+
* │ ├──────┘
|
|
29
|
+
* │ │
|
|
30
|
+
* │ WS │
|
|
31
|
+
* └───────────────┘
|
|
32
|
+
*
|
|
33
|
+
* ┌───────────────┐
|
|
34
|
+
* │ EN │
|
|
35
|
+
* │ │
|
|
36
|
+
* ┌──────┤ │
|
|
37
|
+
* │ │ │
|
|
38
|
+
* └──────┴───────────────┘
|
|
39
|
+
*
|
|
40
|
+
* ┌───────────────┐
|
|
41
|
+
* │ WN │
|
|
42
|
+
* │ │
|
|
43
|
+
* │ ├──────┐
|
|
44
|
+
* │ │ │
|
|
45
|
+
* └───────────────┴──────┘
|
|
46
|
+
*/
|
|
47
|
+
export declare const DropdownMenuPanelPositioningFunctions: Record<string, PositioningFunction>;
|
|
48
|
+
/**
|
|
49
|
+
* Represents the definition of a dropdown menu.
|
|
50
|
+
*/
|
|
51
|
+
export type DropdownNestedMenuDefinition = {
|
|
52
|
+
/**
|
|
53
|
+
* Unique ID for the menu.
|
|
54
|
+
*/
|
|
55
|
+
id: string;
|
|
56
|
+
/**
|
|
57
|
+
* The menu name. It is used as a label for the button which opens the menu list.
|
|
58
|
+
*/
|
|
59
|
+
menu: string;
|
|
60
|
+
/**
|
|
61
|
+
* The children of the dropdown menu.
|
|
62
|
+
*/
|
|
63
|
+
children: DropdownMenuDefinition;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Represents the definition of a dropdown menu item.
|
|
67
|
+
*/
|
|
68
|
+
export type DropdownMenuButtonDefinition = {
|
|
69
|
+
/**
|
|
70
|
+
* Unique ID for the button.
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
/**
|
|
74
|
+
* The label for the button.
|
|
75
|
+
*/
|
|
76
|
+
label: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* A definition for a nestable menu component.
|
|
80
|
+
*
|
|
81
|
+
* The menu can be flat and include only top-level items, or it can include multiple levels of nested sub-menus.
|
|
82
|
+
*
|
|
83
|
+
* Example:
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* [
|
|
87
|
+
* {
|
|
88
|
+
* id: 'menu_1',
|
|
89
|
+
* menu: 'Menu 1',
|
|
90
|
+
* children: [
|
|
91
|
+
* {
|
|
92
|
+
* id: 'menu_1_1',
|
|
93
|
+
* menu: 'Nested menu 1',
|
|
94
|
+
* children: [
|
|
95
|
+
* {
|
|
96
|
+
* id: 'item_x',
|
|
97
|
+
* label: 'Item X'
|
|
98
|
+
* }
|
|
99
|
+
* ]
|
|
100
|
+
* },
|
|
101
|
+
* {
|
|
102
|
+
* id: 'menu_1_2',
|
|
103
|
+
* menu: 'Nested menu 2',
|
|
104
|
+
* children: [
|
|
105
|
+
* {
|
|
106
|
+
* id: 'item_y',
|
|
107
|
+
* label: 'Item Y'
|
|
108
|
+
* },
|
|
109
|
+
* {
|
|
110
|
+
* id: 'item_z',
|
|
111
|
+
* label: 'Item Z'
|
|
112
|
+
* }
|
|
113
|
+
* ]
|
|
114
|
+
* }
|
|
115
|
+
* ]
|
|
116
|
+
* },
|
|
117
|
+
* {
|
|
118
|
+
* id: 'top_a',
|
|
119
|
+
* label: 'Top Item A'
|
|
120
|
+
* },
|
|
121
|
+
* {
|
|
122
|
+
* id: 'top_b',
|
|
123
|
+
* label: 'Top Item B'
|
|
124
|
+
* }
|
|
125
|
+
* ];
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export type DropdownMenuDefinition = Array<DropdownNestedMenuDefinition | DropdownMenuButtonDefinition>;
|
package/dist/dropdown/utils.d.ts
CHANGED
|
@@ -13,9 +13,11 @@ import type Model from '../model.js';
|
|
|
13
13
|
import type DropdownButton from './button/dropdownbutton.js';
|
|
14
14
|
import type { FocusableView } from '../focuscycler.js';
|
|
15
15
|
import type { FalsyValue } from '../template.js';
|
|
16
|
+
import type BodyCollection from '../editorui/bodycollection.js';
|
|
16
17
|
import { type Collection, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
17
18
|
import '../../theme/components/dropdown/toolbardropdown.css';
|
|
18
19
|
import '../../theme/components/dropdown/listdropdown.css';
|
|
20
|
+
import type { DropdownMenuDefinition } from './menu/utils.js';
|
|
19
21
|
/**
|
|
20
22
|
* A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
|
|
21
23
|
* with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
|
|
@@ -81,10 +83,66 @@ import '../../theme/components/dropdown/listdropdown.css';
|
|
|
81
83
|
*
|
|
82
84
|
* @param locale The locale instance.
|
|
83
85
|
* @param ButtonClassOrInstance The dropdown button view class. Needs to implement the
|
|
86
|
+
* @param behaviorOptions Attributes for the default behavior of the dropdown.
|
|
87
|
+
*
|
|
84
88
|
* {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
|
|
85
89
|
* @returns The dropdown view instance.
|
|
86
90
|
*/
|
|
87
91
|
export declare function createDropdown(locale: Locale | undefined, ButtonClassOrInstance?: (new (locale?: Locale) => DropdownButton & FocusableView) | (DropdownButton & FocusableView)): DropdownView;
|
|
92
|
+
/**
|
|
93
|
+
* Adds a menu UI component to a dropdown and sets all common behaviors and interactions between the dropdown and the menu.
|
|
94
|
+
*
|
|
95
|
+
* Use this helper to create multi-level dropdown menus that are displayed in a toolbar.
|
|
96
|
+
*
|
|
97
|
+
* Internally, it creates an instance of {@link module:ui/dropdown/menu/dropdownmenurootlistview~DropdownMenuRootListView}.
|
|
98
|
+
*
|
|
99
|
+
* Example:
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* const definitions = [
|
|
103
|
+
* {
|
|
104
|
+
* id: 'menu_1',
|
|
105
|
+
* menu: 'Menu 1',
|
|
106
|
+
* children: [
|
|
107
|
+
* {
|
|
108
|
+
* id: 'menu_1_a',
|
|
109
|
+
* label: 'Item A'
|
|
110
|
+
* },
|
|
111
|
+
* {
|
|
112
|
+
* id: 'menu_1_b',
|
|
113
|
+
* label: 'Item B'
|
|
114
|
+
* }
|
|
115
|
+
* ]
|
|
116
|
+
* },
|
|
117
|
+
* {
|
|
118
|
+
* id: 'top_a',
|
|
119
|
+
* label: 'Top Item A'
|
|
120
|
+
* },
|
|
121
|
+
* {
|
|
122
|
+
* id: 'top_b',
|
|
123
|
+
* label: 'Top Item B'
|
|
124
|
+
* }
|
|
125
|
+
* ];
|
|
126
|
+
*
|
|
127
|
+
* const dropdownView = createDropdown( editor.locale );
|
|
128
|
+
*
|
|
129
|
+
* addMenuToDropdown( dropdownView, editor.ui.view.body, definitions );
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* After using this helper, the `dropdown` will fire {@link module:ui/dropdown/dropdownview~DropdownViewEvent `execute`} event when
|
|
133
|
+
* a nested menu button is pressed.
|
|
134
|
+
*
|
|
135
|
+
* The helper will make sure that the `dropdownMenuRootListView` is lazy loaded, i.e., the menu component structure will be initialized
|
|
136
|
+
* and rendered only after the `dropdown` is opened for the first time.
|
|
137
|
+
*
|
|
138
|
+
* @param dropdownView A dropdown instance to which the menu component will be added.
|
|
139
|
+
* @param body Body collection to which floating menu panels will be added.
|
|
140
|
+
* @param definition The menu component definition.
|
|
141
|
+
* @param options.ariaLabel Label used by assistive technologies to describe the top-level menu.
|
|
142
|
+
*/
|
|
143
|
+
export declare function addMenuToDropdown(dropdownView: DropdownView, body: BodyCollection, definition: DropdownMenuDefinition, options?: {
|
|
144
|
+
ariaLabel?: string;
|
|
145
|
+
}): void;
|
|
88
146
|
/**
|
|
89
147
|
* Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
|
|
90
148
|
*
|
|
@@ -38,7 +38,7 @@ export default class EditableUIView extends View {
|
|
|
38
38
|
/**
|
|
39
39
|
* The element which is the main editable element (usually the one with `contentEditable="true"`).
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
protected _editableElement: HTMLElement | null | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
44
44
|
* the view will not render its {@link #template}.
|
|
@@ -17,10 +17,9 @@ import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
|
17
17
|
*/
|
|
18
18
|
export default class InlineEditableUIView extends EditableUIView {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* represents the label of the editable for assistive technologies.
|
|
20
|
+
* The cached options object passed to the constructor.
|
|
22
21
|
*/
|
|
23
|
-
private readonly
|
|
22
|
+
private readonly _options;
|
|
24
23
|
/**
|
|
25
24
|
* Creates an instance of the InlineEditableUIView class.
|
|
26
25
|
*
|
|
@@ -30,15 +29,20 @@ export default class InlineEditableUIView extends EditableUIView {
|
|
|
30
29
|
* {@link module:ui/editableui/editableuiview~EditableUIView}
|
|
31
30
|
* will create it. Otherwise, the existing element will be used.
|
|
32
31
|
* @param options Additional configuration of the view.
|
|
33
|
-
* @param options.label
|
|
34
|
-
*
|
|
35
|
-
* a default label generator is used.
|
|
32
|
+
* @param options.label The label of the editable for assistive technologies. If not provided, a default label is used or,
|
|
33
|
+
* the existing `aria-label` attribute value from the specified `editableElement` is preserved.
|
|
36
34
|
*/
|
|
37
|
-
constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?:
|
|
38
|
-
label?: (view: InlineEditableUIView) => string;
|
|
39
|
-
});
|
|
35
|
+
constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?: InlineEditableUIViewOptions);
|
|
40
36
|
/**
|
|
41
37
|
* @inheritDoc
|
|
42
38
|
*/
|
|
43
39
|
render(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Returns a normalized label for the editable view based on the environment.
|
|
42
|
+
*/
|
|
43
|
+
getEditableAriaLabel(): string;
|
|
44
44
|
}
|
|
45
|
+
type InlineEditableUIViewOptions = {
|
|
46
|
+
label?: ((view: InlineEditableUIView) => string) | string | Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
@@ -286,6 +286,10 @@ export default abstract class EditorUI extends /* #__PURE__ */ EditorUI_base {
|
|
|
286
286
|
* @param data The payload carried by the `scrollToTheSelection` event.
|
|
287
287
|
*/
|
|
288
288
|
private _handleScrollToTheSelection;
|
|
289
|
+
/**
|
|
290
|
+
* Ensures that the focus tracker is aware of all views' DOM elements in the body collection.
|
|
291
|
+
*/
|
|
292
|
+
private _bindBodyCollectionWithFocusTracker;
|
|
289
293
|
}
|
|
290
294
|
/**
|
|
291
295
|
* Fired when the editor UI is ready.
|
package/dist/index-editor.css
CHANGED
|
@@ -352,6 +352,22 @@ a.ck.ck-button{
|
|
|
352
352
|
z-index:calc(var(--ck-z-default) + 1);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
.ck.ck-dropdown-menu-list__nested-menu__button > .ck-dropdown-menu-list__nested-menu__button__arrow{
|
|
356
|
+
pointer-events:none;
|
|
357
|
+
z-index:var(--ck-z-default);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.ck.ck-dropdown-menu__nested-menu__panel{
|
|
361
|
+
position:absolute;
|
|
362
|
+
max-height:314px;
|
|
363
|
+
overflow-y:auto;
|
|
364
|
+
z-index:calc(var(--ck-z-panel) + 1);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.ck.ck-dropdown-menu-list__nested-menu{
|
|
368
|
+
display:block;
|
|
369
|
+
}
|
|
370
|
+
|
|
355
371
|
.ck.ck-aria-live-announcer{
|
|
356
372
|
position:absolute;
|
|
357
373
|
left:-10000px;
|
package/dist/index.css
CHANGED
|
@@ -489,6 +489,37 @@ a.ck.ck-button {
|
|
|
489
489
|
z-index: calc(var(--ck-z-default) + 1);
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
+
/*
|
|
493
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
494
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
495
|
+
*/
|
|
496
|
+
|
|
497
|
+
.ck.ck-dropdown-menu-list__nested-menu__button > .ck-dropdown-menu-list__nested-menu__button__arrow {
|
|
498
|
+
pointer-events: none;
|
|
499
|
+
z-index: var(--ck-z-default);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/*
|
|
503
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
504
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
505
|
+
*/
|
|
506
|
+
|
|
507
|
+
.ck.ck-dropdown-menu__nested-menu__panel {
|
|
508
|
+
position: absolute;
|
|
509
|
+
max-height: 314px; /* With the default settings, this is equal to 10 menu items. */
|
|
510
|
+
overflow-y: auto;
|
|
511
|
+
z-index: calc(var(--ck-z-panel) + 1);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/*
|
|
515
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
516
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
517
|
+
*/
|
|
518
|
+
|
|
519
|
+
.ck.ck-dropdown-menu-list__nested-menu {
|
|
520
|
+
display: block;
|
|
521
|
+
}
|
|
522
|
+
|
|
492
523
|
/*
|
|
493
524
|
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
494
525
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|