@ckeditor/ckeditor5-ui 43.0.0 → 43.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
package/lang/translations/sr.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Проширен уређивач текста"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "Област за уређивање уредника: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Блок уређивач"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Падајућа трака са алаткама"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Црна"
|
package/lang/translations/sv.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Rich Text-editor"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "Ordbehandlares redigeringsområde: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Redigera block"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Rullgardinsverktygsfält"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Svart"
|
package/lang/translations/th.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "โปรแกรมแก้ไข Rich Text"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "พื้นที่แก้ไขของตัวแก้ไข: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "แก้ไขบล็อก"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "แถบเครื่องมือแบบเลื่อนลง"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "สีดำ"
|
package/lang/translations/ti.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr ""
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr ""
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr ""
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr ""
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr ""
|
package/lang/translations/tk.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Baý Tekst Redaktory"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr ""
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Bloky redaktirläň"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Açylýan gurallar paneli"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Gara"
|
package/lang/translations/tr.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Zengin İçerik Editörü"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "Editör düzenleme alanı: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Bloğu Düzenle"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Açılır araç çubuğu"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Siyah"
|
package/lang/translations/tt.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr ""
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr ""
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr ""
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr ""
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Кара"
|
package/lang/translations/ug.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "تېكىست تەھرىرلىگۈچ"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "تەھرىرلىگۈچ تەھرىرلەش رايونى: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "بۆلەك تەھرىر"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "سىرىلما قورال بالداق"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "قارا"
|
package/lang/translations/uk.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Розширений текстовий редактор"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "Область редагування редактора: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Редагувати блок"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Випадаюча панель інструментів"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Чорний"
|
package/lang/translations/ur.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "خانۂ ترمیم"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "رقبہ خانۂ ترمیم: 0%"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "خانہ کی تدوین"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "آلہ جات برائے فہرست "
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "سیاہ"
|
package/lang/translations/uz.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Tahrirlovchi"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr ""
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Blokni tahrirlash"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Ochiladigan asboblar paneli"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Qora"
|
package/lang/translations/vi.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "Trình soạn thảo văn bản"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "Vùng chỉnh sửa của trình chỉnh sửa: %0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "Chỉnh sửa đoạn"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "Thanh công cụ danh mục"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "Đen"
|
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "富文本编辑器"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "编辑器编辑区域:%0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "编辑框"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "下拉工具栏"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "黑色"
|
package/lang/translations/zh.po
CHANGED
|
@@ -21,10 +21,6 @@ msgctxt "Title of the CKEditor5 editor."
|
|
|
21
21
|
msgid "Rich Text Editor"
|
|
22
22
|
msgstr "富文本編輯器"
|
|
23
23
|
|
|
24
|
-
msgctxt "Accessible label of the specific editing area belonging to a container with an ARIA application role."
|
|
25
|
-
msgid "Editor editing area: %0"
|
|
26
|
-
msgstr "編輯器編輯區:%0"
|
|
27
|
-
|
|
28
24
|
msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
|
|
29
25
|
msgid "Edit block"
|
|
30
26
|
msgstr "編輯區塊"
|
|
@@ -53,6 +49,10 @@ msgctxt "Label used by assistive technologies describing a toolbar displayed ins
|
|
|
53
49
|
msgid "Dropdown toolbar"
|
|
54
50
|
msgstr "下拉選單"
|
|
55
51
|
|
|
52
|
+
msgctxt "Label used by assistive technologies describing a menu displayed inside a dropdown."
|
|
53
|
+
msgid "Dropdown menu"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
56
|
msgctxt "Label of a button that applies a black color in color pickers."
|
|
57
57
|
msgid "Black"
|
|
58
58
|
msgstr "黑色"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ui",
|
|
3
|
-
"version": "43.0.0",
|
|
3
|
+
"version": "43.1.0-alpha.0",
|
|
4
4
|
"description": "The UI framework and standard UI library of CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ckeditor/ckeditor5-core": "43.0.0",
|
|
16
|
-
"@ckeditor/ckeditor5-
|
|
15
|
+
"@ckeditor/ckeditor5-core": "43.1.0-alpha.0",
|
|
16
|
+
"@ckeditor/ckeditor5-engine": "43.1.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-utils": "43.1.0-alpha.0",
|
|
17
18
|
"color-convert": "2.0.1",
|
|
18
19
|
"color-parse": "1.4.2",
|
|
19
20
|
"lodash-es": "4.17.21",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/bindings/clickoutsidehandler
|
|
7
7
|
*/
|
|
8
|
-
import type { DomEmitter } from '@ckeditor/ckeditor5-utils';
|
|
8
|
+
import type { CallbackOptions, DomEmitter } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
/**
|
|
10
10
|
* Handles clicking **outside** of a specified set of elements, then fires an action.
|
|
11
11
|
*
|
|
@@ -19,10 +19,12 @@ import type { DomEmitter } from '@ckeditor/ckeditor5-utils';
|
|
|
19
19
|
* @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements
|
|
20
20
|
* that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.
|
|
21
21
|
* @param options.callback An action executed by the handler.
|
|
22
|
+
* @param options.listenerOptions Additional options for the listener (like priority).
|
|
22
23
|
*/
|
|
23
|
-
export default function clickOutsideHandler({ emitter, activator, callback, contextElements }: {
|
|
24
|
+
export default function clickOutsideHandler({ emitter, activator, callback, contextElements, listenerOptions }: {
|
|
24
25
|
emitter: DomEmitter;
|
|
25
26
|
activator: () => boolean;
|
|
26
|
-
contextElements: Array<
|
|
27
|
+
contextElements: Array<Element> | (() => Array<Element>);
|
|
27
28
|
callback: () => void;
|
|
29
|
+
listenerOptions?: CallbackOptions;
|
|
28
30
|
}): void;
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
* @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements
|
|
17
17
|
* that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.
|
|
18
18
|
* @param options.callback An action executed by the handler.
|
|
19
|
+
* @param options.listenerOptions Additional options for the listener (like priority).
|
|
19
20
|
*/
|
|
20
|
-
export default function clickOutsideHandler({ emitter, activator, callback, contextElements }) {
|
|
21
|
+
export default function clickOutsideHandler({ emitter, activator, callback, contextElements, listenerOptions }) {
|
|
21
22
|
emitter.listenTo(document, 'mousedown', (evt, domEvt) => {
|
|
22
23
|
if (!activator()) {
|
|
23
24
|
return;
|
|
@@ -32,5 +33,5 @@ export default function clickOutsideHandler({ emitter, activator, callback, cont
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
callback();
|
|
35
|
-
});
|
|
36
|
+
}, listenerOptions);
|
|
36
37
|
}
|
package/src/dialog/dialog.js
CHANGED
|
@@ -209,7 +209,6 @@ export default class Dialog extends Plugin {
|
|
|
209
209
|
this.hide();
|
|
210
210
|
});
|
|
211
211
|
editor.ui.view.body.add(view);
|
|
212
|
-
editor.ui.focusTracker.add(view.element);
|
|
213
212
|
editor.keystrokes.listenTo(view.element);
|
|
214
213
|
// Unless the user specified a position, modals should always be centered on the screen.
|
|
215
214
|
// Otherwise, let's keep dialogs centered in the editing root by default.
|
|
@@ -11,6 +11,7 @@ import type { default as DropdownPanelView, PanelPosition } from './dropdownpane
|
|
|
11
11
|
import type { FocusableView } from '../focuscycler.js';
|
|
12
12
|
import type ListView from '../list/listview.js';
|
|
13
13
|
import type ToolbarView from '../toolbar/toolbarview.js';
|
|
14
|
+
import type DropdownMenuRootListView from './menu/dropdownmenurootlistview.js';
|
|
14
15
|
import { KeystrokeHandler, FocusTracker, type Locale, type PositioningFunction } from '@ckeditor/ckeditor5-utils';
|
|
15
16
|
import '../../theme/components/dropdown/dropdown.css';
|
|
16
17
|
/**
|
|
@@ -107,9 +108,16 @@ export default class DropdownView extends View<HTMLDivElement> {
|
|
|
107
108
|
* A child toolbar of the dropdown located in the
|
|
108
109
|
* {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
|
|
109
110
|
*
|
|
110
|
-
* **Note**: Only supported when dropdown has
|
|
111
|
+
* **Note**: Only supported when dropdown has a toolbar added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
|
|
111
112
|
*/
|
|
112
113
|
toolbarView?: ToolbarView;
|
|
114
|
+
/**
|
|
115
|
+
* A child menu component of the dropdown located
|
|
116
|
+
* in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
|
|
117
|
+
*
|
|
118
|
+
* **Note**: Only supported when dropdown has a menu added using {@link module:ui/dropdown/utils~addMenuToDropdown}.
|
|
119
|
+
*/
|
|
120
|
+
menuView?: DropdownMenuRootListView;
|
|
113
121
|
/**
|
|
114
122
|
* Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
|
|
115
123
|
*
|
|
@@ -296,16 +304,21 @@ export default class DropdownView extends View<HTMLDivElement> {
|
|
|
296
304
|
private static _getOptimalPosition;
|
|
297
305
|
}
|
|
298
306
|
/**
|
|
299
|
-
* Fired when
|
|
307
|
+
* Fired when an item inside the dropdown is executed.
|
|
308
|
+
*
|
|
309
|
+
* **Note**: Only supported when dropdown was integrated with its child view using one of the helper functions:
|
|
310
|
+
* {@link module:ui/dropdown/utils~addListToDropdown}, {@link module:ui/dropdown/utils~addToolbarToDropdown}, or
|
|
311
|
+
* {@link module:ui/dropdown/utils~addMenuToDropdown}.
|
|
312
|
+
*
|
|
313
|
+
* When integrated with a list, it fires when a child of one of {@link module:ui/list/listitemview~ListItemView}s
|
|
314
|
+
* fired `execute` event.
|
|
300
315
|
*
|
|
301
|
-
*
|
|
302
|
-
* fired `execute`.
|
|
316
|
+
* When integrated with a toolbar, it fires when one of the buttons has been {@link module:ui/button/button~Button#event:execute executed}.
|
|
303
317
|
*
|
|
304
|
-
*
|
|
305
|
-
* {@link module:ui/button/button~Button#event:execute executed}.
|
|
318
|
+
* When integrated with a nested menu, it fires when one of the menu buttons has been executed.
|
|
306
319
|
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
320
|
+
* In each case, the event is delegated from the component which fired it. It does not have additional parameters and `event.source` is the
|
|
321
|
+
* original component.
|
|
309
322
|
*
|
|
310
323
|
* @eventName ~DropdownView#execute
|
|
311
324
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import type DropdownMenuNestedMenuView from './dropdownmenunestedmenuview.js';
|
|
6
|
+
import type DropdownMenuRootListView from './dropdownmenurootlistview.js';
|
|
7
|
+
export declare const DropdownRootMenuBehaviors: {
|
|
8
|
+
/**
|
|
9
|
+
* Move focus to a menu item on mouse hover. If it is a button to open a nested menu, open that menu.
|
|
10
|
+
*/
|
|
11
|
+
toggleMenusAndFocusItemsOnHover(rootList: DropdownMenuRootListView): void;
|
|
12
|
+
/**
|
|
13
|
+
* Handles the following case:
|
|
14
|
+
*
|
|
15
|
+
* 1. Hover to open a sub-menu (A). The button has focus.
|
|
16
|
+
* 2. Press arrow up/down to move focus to another sub-menu (B) button.
|
|
17
|
+
* 3. Press arrow right to open the sub-menu (B).
|
|
18
|
+
* 4. The sub-menu (A) should close (if not, there are two open menus).
|
|
19
|
+
*/
|
|
20
|
+
closeMenuWhenAnotherOnTheSameLevelOpens(rootList: DropdownMenuRootListView): void;
|
|
21
|
+
};
|
|
22
|
+
export declare const DropdownMenuBehaviors: {
|
|
23
|
+
/**
|
|
24
|
+
* Open the menu on the right arrow key press (left, in RTL mode). This allows for navigating to sub-menus using the keyboard.
|
|
25
|
+
*/
|
|
26
|
+
openOnArrowRightKey(menuView: DropdownMenuNestedMenuView): void;
|
|
27
|
+
/**
|
|
28
|
+
* Opens the menu on its button click as well as enter and space keys press (if the button is focused).
|
|
29
|
+
*/
|
|
30
|
+
openOnButtonClick(menuView: DropdownMenuNestedMenuView): void;
|
|
31
|
+
/**
|
|
32
|
+
* Opens the menu and focuses the panel content upon pressing the Enter key.
|
|
33
|
+
*/
|
|
34
|
+
openAndFocusOnEnterKeyPress(menuView: DropdownMenuNestedMenuView): void;
|
|
35
|
+
/**
|
|
36
|
+
* Closes the menu on the left key press (right, in RTL mode). This allows for navigating to sub-menus using the keyboard.
|
|
37
|
+
*/
|
|
38
|
+
closeOnArrowLeftKey(menuView: DropdownMenuNestedMenuView): void;
|
|
39
|
+
closeOnEscKey(menuView: DropdownMenuNestedMenuView): void;
|
|
40
|
+
/**
|
|
41
|
+
* Closes the menu when its parent menu closes. This prevents from leaving orphaned open menus.
|
|
42
|
+
*/
|
|
43
|
+
closeOnParentClose(menuView: DropdownMenuNestedMenuView, parentMenuView: DropdownMenuNestedMenuView): void;
|
|
44
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
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 DropdownMenuListItemView from './dropdownmenulistitemview.js';
|
|
6
|
+
export const DropdownRootMenuBehaviors = {
|
|
7
|
+
/**
|
|
8
|
+
* Move focus to a menu item on mouse hover. If it is a button to open a nested menu, open that menu.
|
|
9
|
+
*/
|
|
10
|
+
toggleMenusAndFocusItemsOnHover(rootList) {
|
|
11
|
+
rootList.on('menu:mouseenter', evt => {
|
|
12
|
+
const [pathLeaf] = evt.path;
|
|
13
|
+
evt.source.focus();
|
|
14
|
+
for (const menuView of rootList.menus) {
|
|
15
|
+
const isListItemContainingMenu = pathLeaf instanceof DropdownMenuListItemView && pathLeaf.childView === menuView;
|
|
16
|
+
menuView.isOpen = (evt.path.includes(menuView) || isListItemContainingMenu) && menuView.isEnabled;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Handles the following case:
|
|
22
|
+
*
|
|
23
|
+
* 1. Hover to open a sub-menu (A). The button has focus.
|
|
24
|
+
* 2. Press arrow up/down to move focus to another sub-menu (B) button.
|
|
25
|
+
* 3. Press arrow right to open the sub-menu (B).
|
|
26
|
+
* 4. The sub-menu (A) should close (if not, there are two open menus).
|
|
27
|
+
*/
|
|
28
|
+
closeMenuWhenAnotherOnTheSameLevelOpens(rootList) {
|
|
29
|
+
rootList.on('menu:change:isOpen', (evt, name, isOpen) => {
|
|
30
|
+
if (!isOpen) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const evtMenu = evt.source;
|
|
34
|
+
for (const menuView of rootList.menus) {
|
|
35
|
+
if (evtMenu.parentMenuView === menuView.parentMenuView && evtMenu !== menuView) {
|
|
36
|
+
menuView.isOpen = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const DropdownMenuBehaviors = {
|
|
43
|
+
/**
|
|
44
|
+
* Open the menu on the right arrow key press (left, in RTL mode). This allows for navigating to sub-menus using the keyboard.
|
|
45
|
+
*/
|
|
46
|
+
openOnArrowRightKey(menuView) {
|
|
47
|
+
const keystroke = menuView.locale.uiLanguageDirection === 'rtl' ? 'arrowleft' : 'arrowright';
|
|
48
|
+
menuView.keystrokes.set(keystroke, (data, cancel) => {
|
|
49
|
+
if (menuView.focusTracker.focusedElement !== menuView.buttonView.element || !menuView.isEnabled) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (!menuView.isOpen) {
|
|
53
|
+
menuView.isOpen = true;
|
|
54
|
+
}
|
|
55
|
+
menuView.panelView.focus();
|
|
56
|
+
cancel();
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Opens the menu on its button click as well as enter and space keys press (if the button is focused).
|
|
61
|
+
*/
|
|
62
|
+
openOnButtonClick(menuView) {
|
|
63
|
+
menuView.buttonView.on('execute', () => {
|
|
64
|
+
if (menuView.isEnabled) {
|
|
65
|
+
menuView.isOpen = true;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* Opens the menu and focuses the panel content upon pressing the Enter key.
|
|
71
|
+
*/
|
|
72
|
+
openAndFocusOnEnterKeyPress(menuView) {
|
|
73
|
+
menuView.keystrokes.set('enter', (data, cancel) => {
|
|
74
|
+
// Engage only for Enter key press when the button is focused. The panel can contain
|
|
75
|
+
// other UI components and features that rely on the Enter key press.
|
|
76
|
+
if (menuView.focusTracker.focusedElement !== menuView.buttonView.element) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
menuView.isOpen = true;
|
|
80
|
+
menuView.panelView.focus();
|
|
81
|
+
cancel();
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Closes the menu on the left key press (right, in RTL mode). This allows for navigating to sub-menus using the keyboard.
|
|
86
|
+
*/
|
|
87
|
+
closeOnArrowLeftKey(menuView) {
|
|
88
|
+
const keystroke = menuView.locale.uiLanguageDirection === 'rtl' ? 'arrowright' : 'arrowleft';
|
|
89
|
+
menuView.keystrokes.set(keystroke, (data, cancel) => {
|
|
90
|
+
if (menuView.isOpen) {
|
|
91
|
+
// Focus first, then close the panel. Otherwise, Safari won't send blur events for detached DOM elements, leading to errors.
|
|
92
|
+
menuView.focus();
|
|
93
|
+
menuView.isOpen = false;
|
|
94
|
+
cancel();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
closeOnEscKey(menuView) {
|
|
99
|
+
menuView.keystrokes.set('esc', (data, cancel) => {
|
|
100
|
+
if (menuView.isOpen) {
|
|
101
|
+
// Focus first, then close the panel. Otherwise, Safari won't send blur events for detached DOM elements, leading to errors.
|
|
102
|
+
menuView.focus();
|
|
103
|
+
menuView.isOpen = false;
|
|
104
|
+
cancel();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Closes the menu when its parent menu closes. This prevents from leaving orphaned open menus.
|
|
110
|
+
*/
|
|
111
|
+
closeOnParentClose(menuView, parentMenuView) {
|
|
112
|
+
parentMenuView.on('change:isOpen', (evt, name, isOpen) => {
|
|
113
|
+
// TODO: Remove checking `evt.source` if `change:isOpen` is no longer delegated.
|
|
114
|
+
if (!isOpen && evt.source === parentMenuView) {
|
|
115
|
+
menuView.isOpen = false;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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/dropdown/menu/dropdownmenubuttonview
|
|
7
|
+
*/
|
|
8
|
+
import IconView from '../../icon/iconview.js';
|
|
9
|
+
import ListItemButtonView from '../../button/listitembuttonview.js';
|
|
10
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
11
|
+
import '../../../theme/components/dropdown/menu/dropdownmenubutton.css';
|
|
12
|
+
/**
|
|
13
|
+
* Represents a view for a dropdown menu button.
|
|
14
|
+
*/
|
|
15
|
+
export default class DropdownMenuButtonView extends ListItemButtonView {
|
|
16
|
+
/**
|
|
17
|
+
* An icon that displays an arrow to indicate a direction of the menu.
|
|
18
|
+
*/
|
|
19
|
+
readonly arrowView: IconView;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the dropdown menu button view.
|
|
22
|
+
*
|
|
23
|
+
* @param locale The localization services instance.
|
|
24
|
+
*/
|
|
25
|
+
constructor(locale: Locale);
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
render(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Creates the arrow view instance.
|
|
32
|
+
*
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
private _createArrowView;
|
|
36
|
+
}
|