@ckeditor/ckeditor5-ui 41.3.1 → 41.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +497 -0
- package/dist/index.css +942 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +14343 -0
- package/dist/index.js.map +1 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +5 -0
- package/dist/translations/af.umd.js +11 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/ast.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/eo.umd.js +11 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/eu.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/km.umd.js +11 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/kn.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/types/arialiveannouncer.d.ts +113 -0
- package/dist/types/augmentation.d.ts +92 -0
- package/dist/types/autocomplete/autocompleteview.d.ts +85 -0
- package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
- package/dist/types/bindings/clickoutsidehandler.d.ts +32 -0
- package/dist/types/bindings/csstransitiondisablermixin.d.ts +44 -0
- package/dist/types/bindings/draggableviewmixin.d.ts +50 -0
- package/dist/types/bindings/injectcsstransitiondisabler.d.ts +63 -0
- package/dist/types/bindings/preventdefault.d.ts +37 -0
- package/dist/types/bindings/submithandler.d.ts +61 -0
- package/dist/types/button/button.d.ts +185 -0
- package/dist/types/button/buttonlabel.d.ts +38 -0
- package/dist/types/button/buttonlabelview.d.ts +35 -0
- package/dist/types/button/buttonview.d.ts +189 -0
- package/dist/types/button/filedialogbuttonview.d.ts +84 -0
- package/dist/types/button/switchbuttonview.d.ts +49 -0
- package/dist/types/collapsible/collapsibleview.d.ts +74 -0
- package/dist/types/colorgrid/colorgridview.d.ts +136 -0
- package/dist/types/colorgrid/colortileview.d.ts +32 -0
- package/dist/types/colorgrid/utils.d.ts +51 -0
- package/dist/types/colorpicker/colorpickerview.d.ts +177 -0
- package/dist/types/colorpicker/utils.d.ts +52 -0
- package/dist/types/colorselector/colorgridsfragmentview.d.ts +199 -0
- package/dist/types/colorselector/colorpickerfragmentview.d.ts +137 -0
- package/dist/types/colorselector/colorselectorview.d.ts +246 -0
- package/dist/types/colorselector/documentcolorcollection.d.ts +74 -0
- package/dist/types/componentfactory.d.ts +85 -0
- package/dist/types/dialog/dialog.d.ts +277 -0
- package/dist/types/dialog/dialogactionsview.d.ts +73 -0
- package/dist/types/dialog/dialogcontentview.d.ts +31 -0
- package/dist/types/dialog/dialogview.d.ts +260 -0
- package/dist/types/dropdown/button/dropdownbutton.d.ts +29 -0
- package/dist/types/dropdown/button/dropdownbuttonview.d.ts +52 -0
- package/dist/types/dropdown/button/splitbuttonview.d.ts +166 -0
- package/dist/types/dropdown/dropdownpanelfocusable.d.ts +25 -0
- package/dist/types/dropdown/dropdownpanelview.d.ts +66 -0
- package/dist/types/dropdown/dropdownview.d.ts +319 -0
- package/dist/types/dropdown/utils.d.ts +239 -0
- package/dist/types/editableui/editableuiview.d.ts +76 -0
- package/dist/types/editableui/inline/inlineeditableuiview.d.ts +44 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
- package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
- package/dist/types/editorui/bodycollection.d.ts +59 -0
- package/dist/types/editorui/boxed/boxededitoruiview.d.ts +44 -0
- package/dist/types/editorui/editorui.d.ts +292 -0
- package/dist/types/editorui/editoruiview.d.ts +43 -0
- package/dist/types/editorui/poweredby.d.ts +75 -0
- package/dist/types/focuscycler.d.ts +249 -0
- package/dist/types/formheader/formheaderview.d.ts +63 -0
- package/dist/types/highlightedtext/highlightedtextview.d.ts +42 -0
- package/dist/types/icon/iconview.d.ts +92 -0
- package/dist/types/iframe/iframeview.d.ts +54 -0
- package/dist/types/index.d.ts +87 -0
- package/dist/types/input/inputbase.d.ts +123 -0
- package/dist/types/input/inputview.d.ts +40 -0
- package/dist/types/inputnumber/inputnumberview.d.ts +53 -0
- package/dist/types/inputtext/inputtextview.d.ts +22 -0
- package/dist/types/label/labelview.d.ts +40 -0
- package/dist/types/labeledfield/labeledfieldview.d.ts +191 -0
- package/dist/types/labeledfield/utils.d.ts +127 -0
- package/dist/types/labeledinput/labeledinputview.d.ts +129 -0
- package/dist/types/list/listitemgroupview.d.ts +63 -0
- package/dist/types/list/listitemview.d.ts +40 -0
- package/dist/types/list/listseparatorview.d.ts +22 -0
- package/dist/types/list/listview.d.ts +128 -0
- package/dist/types/menubar/menubarmenubuttonview.d.ts +39 -0
- package/dist/types/menubar/menubarmenulistitembuttonview.d.ts +25 -0
- package/dist/types/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
- package/dist/types/menubar/menubarmenulistitemview.d.ts +29 -0
- package/dist/types/menubar/menubarmenulistview.d.ts +28 -0
- package/dist/types/menubar/menubarmenupanelview.d.ts +57 -0
- package/dist/types/menubar/menubarmenuview.d.ts +113 -0
- package/dist/types/menubar/menubarview.d.ts +168 -0
- package/dist/types/menubar/utils.d.ts +443 -0
- package/dist/types/model.d.ts +26 -0
- package/dist/types/notification/notification.d.ts +215 -0
- package/dist/types/panel/balloon/balloonpanelview.d.ts +689 -0
- package/dist/types/panel/balloon/contextualballoon.d.ts +303 -0
- package/dist/types/panel/sticky/stickypanelview.d.ts +160 -0
- package/dist/types/search/filteredview.d.ts +35 -0
- package/dist/types/search/searchinfoview.d.ts +49 -0
- package/dist/types/search/searchresultsview.d.ts +58 -0
- package/dist/types/search/text/searchtextqueryview.d.ts +80 -0
- package/dist/types/search/text/searchtextview.d.ts +223 -0
- package/dist/types/spinner/spinnerview.d.ts +29 -0
- package/dist/types/template.d.ts +946 -0
- package/dist/types/textarea/textareaview.d.ts +108 -0
- package/dist/types/toolbar/balloon/balloontoolbar.d.ts +121 -0
- package/dist/types/toolbar/block/blockbuttonview.d.ts +39 -0
- package/dist/types/toolbar/block/blocktoolbar.d.ts +157 -0
- package/dist/types/toolbar/normalizetoolbarconfig.d.ts +44 -0
- package/dist/types/toolbar/toolbarlinebreakview.d.ts +22 -0
- package/dist/types/toolbar/toolbarseparatorview.d.ts +22 -0
- package/dist/types/toolbar/toolbarview.d.ts +271 -0
- package/dist/types/tooltipmanager.d.ts +199 -0
- package/dist/types/view.d.ts +426 -0
- package/dist/types/viewcollection.d.ts +143 -0
- package/lang/contexts.json +2 -1
- package/lang/translations/af.po +4 -0
- package/lang/translations/ar.po +4 -0
- package/lang/translations/ast.po +4 -0
- package/lang/translations/az.po +4 -0
- package/lang/translations/bg.po +4 -0
- package/lang/translations/bn.po +4 -0
- package/lang/translations/bs.po +4 -0
- package/lang/translations/ca.po +4 -0
- package/lang/translations/cs.po +4 -0
- package/lang/translations/da.po +4 -0
- package/lang/translations/de-ch.po +4 -0
- package/lang/translations/de.po +4 -0
- package/lang/translations/el.po +4 -0
- package/lang/translations/en-au.po +4 -0
- package/lang/translations/en-gb.po +4 -0
- package/lang/translations/en.po +4 -0
- package/lang/translations/eo.po +4 -0
- package/lang/translations/es-co.po +4 -0
- package/lang/translations/es.po +4 -0
- package/lang/translations/et.po +4 -0
- package/lang/translations/eu.po +4 -0
- package/lang/translations/fa.po +4 -0
- package/lang/translations/fi.po +4 -0
- package/lang/translations/fr.po +4 -0
- package/lang/translations/gl.po +4 -0
- package/lang/translations/he.po +4 -0
- package/lang/translations/hi.po +4 -0
- package/lang/translations/hr.po +4 -0
- package/lang/translations/hu.po +4 -0
- package/lang/translations/id.po +4 -0
- package/lang/translations/it.po +4 -0
- package/lang/translations/ja.po +4 -0
- package/lang/translations/jv.po +4 -0
- package/lang/translations/km.po +4 -0
- package/lang/translations/kn.po +4 -0
- package/lang/translations/ko.po +4 -0
- package/lang/translations/ku.po +4 -0
- package/lang/translations/lt.po +4 -0
- package/lang/translations/lv.po +4 -0
- package/lang/translations/ms.po +4 -0
- package/lang/translations/nb.po +4 -0
- package/lang/translations/ne.po +4 -0
- package/lang/translations/nl.po +4 -0
- package/lang/translations/no.po +4 -0
- package/lang/translations/pl.po +4 -0
- package/lang/translations/pt-br.po +4 -0
- package/lang/translations/pt.po +4 -0
- package/lang/translations/ro.po +4 -0
- package/lang/translations/ru.po +4 -0
- package/lang/translations/sk.po +4 -0
- package/lang/translations/sl.po +4 -0
- package/lang/translations/sq.po +4 -0
- package/lang/translations/sr-latn.po +4 -0
- package/lang/translations/sr.po +4 -0
- package/lang/translations/sv.po +4 -0
- package/lang/translations/th.po +4 -0
- package/lang/translations/ti.po +214 -0
- package/lang/translations/tk.po +4 -0
- package/lang/translations/tr.po +4 -0
- package/lang/translations/tt.po +4 -0
- package/lang/translations/ug.po +4 -0
- package/lang/translations/uk.po +4 -0
- package/lang/translations/ur.po +4 -0
- package/lang/translations/uz.po +4 -0
- package/lang/translations/vi.po +4 -0
- package/lang/translations/zh-cn.po +4 -0
- package/lang/translations/zh.po +4 -0
- package/package.json +4 -3
- package/src/arialiveannouncer.d.ts +34 -23
- package/src/arialiveannouncer.js +80 -30
- package/src/colorgrid/colortileview.d.ts +1 -1
- package/src/colorgrid/colortileview.js +3 -1
- package/src/colorpicker/colorpickerview.d.ts +32 -1
- package/src/colorpicker/colorpickerview.js +62 -13
- package/src/colorselector/colorpickerfragmentview.d.ts +4 -0
- package/src/colorselector/colorpickerfragmentview.js +13 -5
- package/src/colorselector/colorselectorview.js +1 -0
- package/src/index.d.ts +4 -4
- package/src/index.js +3 -2
- package/src/menubar/utils.d.ts +8 -1
- package/src/menubar/utils.js +26 -2
- package/src/toolbar/toolbarview.js +2 -3
- package/theme/components/arialiveannouncer/arialiveannouncer.css +4 -0
- package/theme/components/tooltip/tooltip.css +4 -0
- package/theme/globals/globals.css +0 -1
- package/theme/mixins/_mediacolors.css +20 -0
- package/theme/globals/_reset.css +0 -13
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
import type { BalloonToolbar, BlockToolbar, ContextualBalloon, Notification, Dialog, AccessibilityHelp } from './index.js';
|
|
10
|
+
import type { ToolbarConfig } from '@ckeditor/ckeditor5-core';
|
|
11
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
12
|
+
interface EditorConfig {
|
|
13
|
+
/**
|
|
14
|
+
* Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
|
|
15
|
+
* feature.
|
|
16
|
+
*
|
|
17
|
+
* ## Configuring toolbar items
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* const config = {
|
|
21
|
+
* balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
|
|
22
|
+
* };
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* You can also use `'|'` to create a separator between groups of items:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const config = {
|
|
29
|
+
* balloonToolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
|
|
34
|
+
*
|
|
35
|
+
* ## Configuring items grouping
|
|
36
|
+
*
|
|
37
|
+
* You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const config = {
|
|
41
|
+
* balloonToolbar: {
|
|
42
|
+
* items: [ 'bold', 'italic', 'undo', 'redo' ],
|
|
43
|
+
* shouldNotGroupWhenFull: true
|
|
44
|
+
* },
|
|
45
|
+
* };
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
balloonToolbar?: ToolbarConfig;
|
|
49
|
+
/**
|
|
50
|
+
* The block toolbar configuration. Used by the {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}
|
|
51
|
+
* feature.
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* const config = {
|
|
55
|
+
* blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'bulletedList', 'numberedList' ]
|
|
56
|
+
* };
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* You can also use `'|'` to create a separator between groups of items:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* const config = {
|
|
63
|
+
* blockToolbar: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ]
|
|
64
|
+
* };
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* ## Configuring items grouping
|
|
68
|
+
*
|
|
69
|
+
* You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const config = {
|
|
73
|
+
* blockToolbar: {
|
|
74
|
+
* items: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ],
|
|
75
|
+
* shouldNotGroupWhenFull: true
|
|
76
|
+
* },
|
|
77
|
+
* };
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* Read more about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
|
|
81
|
+
*/
|
|
82
|
+
blockToolbar?: ToolbarConfig;
|
|
83
|
+
}
|
|
84
|
+
interface PluginsMap {
|
|
85
|
+
[BalloonToolbar.pluginName]: BalloonToolbar;
|
|
86
|
+
[BlockToolbar.pluginName]: BlockToolbar;
|
|
87
|
+
[ContextualBalloon.pluginName]: ContextualBalloon;
|
|
88
|
+
[Dialog.pluginName]: Dialog;
|
|
89
|
+
[Notification.pluginName]: Notification;
|
|
90
|
+
[AccessibilityHelp.pluginName]: AccessibilityHelp;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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/autocomplete/autocompleteview
|
|
11
|
+
*/
|
|
12
|
+
import { type PositioningFunction, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import SearchTextView, { type SearchTextViewConfig } from '../search/text/searchtextview.js';
|
|
14
|
+
import type SearchResultsView from '../search/searchresultsview.js';
|
|
15
|
+
import type InputBase from '../input/inputbase.js';
|
|
16
|
+
import '../../theme/components/autocomplete/autocomplete.css';
|
|
17
|
+
/**
|
|
18
|
+
* The autocomplete component's view class. It extends the {@link module:ui/search/text/searchtextview~SearchTextView} class
|
|
19
|
+
* with a floating {@link #resultsView} that shows up when the user starts typing and hides when they blur
|
|
20
|
+
* the component.
|
|
21
|
+
*/
|
|
22
|
+
export default class AutocompleteView<TQueryFieldView extends InputBase<HTMLInputElement | HTMLTextAreaElement>> extends SearchTextView<TQueryFieldView> {
|
|
23
|
+
/**
|
|
24
|
+
* The configuration of the autocomplete view.
|
|
25
|
+
*/
|
|
26
|
+
protected _config: AutocompleteViewConfig<TQueryFieldView>;
|
|
27
|
+
resultsView: AutocompleteResultsView;
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
constructor(locale: Locale, config: AutocompleteViewConfig<TQueryFieldView>);
|
|
32
|
+
/**
|
|
33
|
+
* Updates the position of the results view on demand.
|
|
34
|
+
*/
|
|
35
|
+
private _updateResultsViewWidthAndPosition;
|
|
36
|
+
/**
|
|
37
|
+
* Updates the visibility of the results view on demand.
|
|
38
|
+
*/
|
|
39
|
+
private _updateResultsVisibility;
|
|
40
|
+
/**
|
|
41
|
+
* Positions for the autocomplete results view. Two positions are defined by default:
|
|
42
|
+
* * `s` - below the search field,
|
|
43
|
+
* * `n` - above the search field.
|
|
44
|
+
*/
|
|
45
|
+
static defaultResultsPositions: Array<PositioningFunction>;
|
|
46
|
+
/**
|
|
47
|
+
* A function used to calculate the optimal position for the dropdown panel.
|
|
48
|
+
*/
|
|
49
|
+
private static _getOptimalPosition;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* An interface describing additional properties of the floating search results view used by the autocomplete plugin.
|
|
53
|
+
*/
|
|
54
|
+
export interface AutocompleteResultsView extends SearchResultsView {
|
|
55
|
+
/**
|
|
56
|
+
* Controls the visibility of the results view.
|
|
57
|
+
*
|
|
58
|
+
* @observable
|
|
59
|
+
*/
|
|
60
|
+
isVisible: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Controls the position (CSS class suffix) of the results view.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
_position?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The observable property determining the CSS width of the results view.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
_width: number;
|
|
73
|
+
}
|
|
74
|
+
export interface AutocompleteViewConfig<TConfigInputCreator extends InputBase<HTMLInputElement | HTMLTextAreaElement>> extends SearchTextViewConfig<TConfigInputCreator> {
|
|
75
|
+
/**
|
|
76
|
+
* When set `true`, the query view will be reset when the autocomplete view loses focus.
|
|
77
|
+
*/
|
|
78
|
+
resetOnBlur?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Minimum number of characters that need to be typed before the search is performed.
|
|
81
|
+
*
|
|
82
|
+
* @default 0
|
|
83
|
+
*/
|
|
84
|
+
queryMinChars?: number;
|
|
85
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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/bindings/addkeyboardhandlingforgrid
|
|
11
|
+
*/
|
|
12
|
+
import type { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import type ViewCollection from '../viewcollection.js';
|
|
14
|
+
/**
|
|
15
|
+
* A helper that adds a keyboard navigation support (arrow up/down/left/right) for grids.
|
|
16
|
+
*
|
|
17
|
+
* @param options Configuration options.
|
|
18
|
+
* @param options.keystrokeHandler Keystroke handler to register navigation with arrow keys.
|
|
19
|
+
* @param options.focusTracker A focus tracker for grid elements.
|
|
20
|
+
* @param options.gridItems A collection of grid items.
|
|
21
|
+
* @param options.numberOfColumns Number of columns in the grid. Can be specified as a function that returns
|
|
22
|
+
* the number (e.g. for responsive grids).
|
|
23
|
+
* @param options.uiLanguageDirection String of ui language direction.
|
|
24
|
+
*/
|
|
25
|
+
export default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }: {
|
|
26
|
+
keystrokeHandler: KeystrokeHandler;
|
|
27
|
+
focusTracker: FocusTracker;
|
|
28
|
+
gridItems: ViewCollection;
|
|
29
|
+
numberOfColumns: number | (() => number);
|
|
30
|
+
uiLanguageDirection?: string;
|
|
31
|
+
}): void;
|
|
@@ -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
|
+
/**
|
|
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/bindings/clickoutsidehandler
|
|
11
|
+
*/
|
|
12
|
+
import type { DomEmitter } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
/**
|
|
14
|
+
* Handles clicking **outside** of a specified set of elements, then fires an action.
|
|
15
|
+
*
|
|
16
|
+
* **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
|
|
17
|
+
* certain issues when the user keeps holding the mouse button and the UI cannot react
|
|
18
|
+
* properly.
|
|
19
|
+
*
|
|
20
|
+
* @param options Configuration options.
|
|
21
|
+
* @param options.emitter The emitter to which this behavior should be added.
|
|
22
|
+
* @param options.activator Function returning a `Boolean`, to determine whether the handler is active.
|
|
23
|
+
* @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements
|
|
24
|
+
* that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.
|
|
25
|
+
* @param options.callback An action executed by the handler.
|
|
26
|
+
*/
|
|
27
|
+
export default function clickOutsideHandler({ emitter, activator, callback, contextElements }: {
|
|
28
|
+
emitter: DomEmitter;
|
|
29
|
+
activator: () => boolean;
|
|
30
|
+
contextElements: Array<HTMLElement> | (() => Array<HTMLElement>);
|
|
31
|
+
callback: () => void;
|
|
32
|
+
}): void;
|
|
@@ -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
|
+
/**
|
|
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/bindings/csstransitiondisablermixin
|
|
11
|
+
*/
|
|
12
|
+
import type { Constructor, Mixed } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import type View from '../view.js';
|
|
14
|
+
/**
|
|
15
|
+
* A mixin that brings the possibility to temporarily disable CSS transitions using
|
|
16
|
+
* {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
|
|
17
|
+
* when the view is first displayed but they should work normal in other cases.
|
|
18
|
+
*
|
|
19
|
+
* The methods to control the CSS transitions are:
|
|
20
|
+
* * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
|
|
21
|
+
* {@link module:ui/view~View#element view element}.
|
|
22
|
+
* * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
|
|
23
|
+
* {@link module:ui/view~View#element view element}.
|
|
24
|
+
*
|
|
25
|
+
* The usage comes down to:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const MyViewWithCssTransitionDisabler = CssTransitionDisablerMixin( MyView );
|
|
29
|
+
* const view = new MyViewWithCssTransitionDisabler();
|
|
30
|
+
*
|
|
31
|
+
* // ...
|
|
32
|
+
*
|
|
33
|
+
* view.disableCssTransitions();
|
|
34
|
+
* view.show();
|
|
35
|
+
* view.enableCssTransitions();
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param view View instance that should get this functionality.
|
|
39
|
+
*/
|
|
40
|
+
export default function CssTransitionDisablerMixin<Base extends Constructor<View>>(view: Base): Mixed<Base, ViewWithCssTransitionDisabler>;
|
|
41
|
+
export type ViewWithCssTransitionDisabler = View & {
|
|
42
|
+
disableCssTransitions(): void;
|
|
43
|
+
enableCssTransitions(): void;
|
|
44
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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/bindings/draggableviewmixin
|
|
11
|
+
*/
|
|
12
|
+
import type View from '../view.js';
|
|
13
|
+
import { type Constructor, type Mixed } from '@ckeditor/ckeditor5-utils';
|
|
14
|
+
/**
|
|
15
|
+
* A mixin that brings the possibility to observe dragging of the view element.
|
|
16
|
+
* The view has to implement the {@link ~DraggableView} interface to use it:
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* export default class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView {
|
|
20
|
+
* // ...
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
|
|
25
|
+
* * `mousedown` and `touchstart` on the view element - starting the dragging.
|
|
26
|
+
* * `mousemove` and `touchmove` on the document - updating the view coordinates.
|
|
27
|
+
* * `mouseup` and `touchend` on the document - stopping the dragging.
|
|
28
|
+
*
|
|
29
|
+
* The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -
|
|
30
|
+
* it is up to the developer to implement it.
|
|
31
|
+
*/
|
|
32
|
+
export default function DraggableViewMixin<Base extends Constructor<View>>(view: Base): Mixed<Base, DraggableView>;
|
|
33
|
+
/**
|
|
34
|
+
* An interface that should be implemented by views that want to be draggable.
|
|
35
|
+
*/
|
|
36
|
+
export interface DraggableView extends View {
|
|
37
|
+
get dragHandleElement(): HTMLElement | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An event data object for the {@link ~DraggableView} `drag` event. Fired when the view is dragged.
|
|
41
|
+
*/
|
|
42
|
+
export type DraggableViewDragEvent = {
|
|
43
|
+
name: 'drag';
|
|
44
|
+
args: [
|
|
45
|
+
{
|
|
46
|
+
deltaX: number;
|
|
47
|
+
deltaY: number;
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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/bindings/injectcsstransitiondisabler
|
|
11
|
+
*/
|
|
12
|
+
import type View from '../view.js';
|
|
13
|
+
/**
|
|
14
|
+
* A decorator that brings the possibility to temporarily disable CSS transitions using
|
|
15
|
+
* {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
|
|
16
|
+
* when the view is first displayed but they should work normal in other cases.
|
|
17
|
+
*
|
|
18
|
+
* The methods to control the CSS transitions are:
|
|
19
|
+
* * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
|
|
20
|
+
* {@link module:ui/view~View#element view element}.
|
|
21
|
+
* * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
|
|
22
|
+
* {@link module:ui/view~View#element view element}.
|
|
23
|
+
*
|
|
24
|
+
* **Note**: This helper extends the {@link module:ui/view~View#template template} and must be used **after**
|
|
25
|
+
* {@link module:ui/view~View#setTemplate} is called:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler';
|
|
29
|
+
*
|
|
30
|
+
* class MyView extends View {
|
|
31
|
+
* constructor() {
|
|
32
|
+
* super();
|
|
33
|
+
*
|
|
34
|
+
* // ...
|
|
35
|
+
*
|
|
36
|
+
* this.setTemplate( { ... } );
|
|
37
|
+
*
|
|
38
|
+
* // ...
|
|
39
|
+
*
|
|
40
|
+
* injectCssTransitionDisabler( this );
|
|
41
|
+
*
|
|
42
|
+
* // ...
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* The usage comes down to:
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const view = new MyView();
|
|
51
|
+
*
|
|
52
|
+
* // ...
|
|
53
|
+
*
|
|
54
|
+
* view.disableCssTransitions();
|
|
55
|
+
* view.show();
|
|
56
|
+
* view.enableCssTransitions();
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @deprecated
|
|
60
|
+
* @see module:ui/bindings/csstransitiondisablermixin~CssTransitionDisablerMixin
|
|
61
|
+
* @param view View instance that should get this functionality.
|
|
62
|
+
*/
|
|
63
|
+
export default function injectCssTransitionDisabler(view: View): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
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/bindings/preventdefault
|
|
11
|
+
*/
|
|
12
|
+
import type { ListenerBinding } from '../template.js';
|
|
13
|
+
import type View from '../view.js';
|
|
14
|
+
/**
|
|
15
|
+
* A helper which executes a native `Event.preventDefault()` if the target of an event equals the
|
|
16
|
+
* {@link module:ui/view~View#element element of the view}. It shortens the definition of a
|
|
17
|
+
* {@link module:ui/view~View#template template}.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* // In a class extending View.
|
|
21
|
+
* import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
|
|
22
|
+
*
|
|
23
|
+
* // ...
|
|
24
|
+
*
|
|
25
|
+
* this.setTemplate( {
|
|
26
|
+
* tag: 'div',
|
|
27
|
+
*
|
|
28
|
+
* on: {
|
|
29
|
+
* // Prevent the default mousedown action on this view.
|
|
30
|
+
* mousedown: preventDefault( this )
|
|
31
|
+
* }
|
|
32
|
+
* } );
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param view View instance that defines the template.
|
|
36
|
+
*/
|
|
37
|
+
export default function preventDefault(view: View): ListenerBinding;
|
|
@@ -0,0 +1,61 @@
|
|
|
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/bindings/submithandler
|
|
11
|
+
*/
|
|
12
|
+
import type View from '../view.js';
|
|
13
|
+
/**
|
|
14
|
+
* A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
|
|
15
|
+
* `submit` event, prevents the default web browser behavior (navigation and page reload) and
|
|
16
|
+
* fires the `submit` event on a view instead. Such a custom event can be then used by any
|
|
17
|
+
* {@link module:utils/dom/emittermixin~DomEmitter emitter}, e.g. to serialize the form data.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';
|
|
21
|
+
*
|
|
22
|
+
* // ...
|
|
23
|
+
*
|
|
24
|
+
* class AnyFormView extends View {
|
|
25
|
+
* constructor() {
|
|
26
|
+
* super();
|
|
27
|
+
*
|
|
28
|
+
* // ...
|
|
29
|
+
*
|
|
30
|
+
* submitHandler( {
|
|
31
|
+
* view: this
|
|
32
|
+
* } );
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* // ...
|
|
37
|
+
*
|
|
38
|
+
* const view = new AnyFormView();
|
|
39
|
+
*
|
|
40
|
+
* // A sample listener attached by an emitter working with the view.
|
|
41
|
+
* this.listenTo( view, 'submit', () => {
|
|
42
|
+
* saveTheFormData();
|
|
43
|
+
* hideTheForm();
|
|
44
|
+
* } );
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param options Configuration options.
|
|
48
|
+
* @param options.view The view which DOM `submit` events should be handled.
|
|
49
|
+
*/
|
|
50
|
+
export default function submitHandler({ view }: {
|
|
51
|
+
view: View;
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Fired by {@link module:ui/bindings/submithandler~submitHandler} helper.
|
|
55
|
+
*
|
|
56
|
+
* @eventName module:ui/view~View#submit
|
|
57
|
+
*/
|
|
58
|
+
export type SubmitHandlerEvent = {
|
|
59
|
+
name: 'submit';
|
|
60
|
+
args: [];
|
|
61
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
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/button/button
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The button interface. Implemented by, among others, {@link module:ui/button/buttonview~ButtonView},
|
|
14
|
+
* {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} and
|
|
15
|
+
* {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView}.
|
|
16
|
+
*/
|
|
17
|
+
export default interface Button {
|
|
18
|
+
/**
|
|
19
|
+
* The label of the button view visible to the user when {@link #withText} is `true`.
|
|
20
|
+
* It can also be used to create a {@link #tooltip}.
|
|
21
|
+
*
|
|
22
|
+
* @observable
|
|
23
|
+
*/
|
|
24
|
+
label: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* (Optional) The keystroke associated with the button, i.e. <kbd>CTRL+B</kbd>,
|
|
27
|
+
* in the string format compatible with {@link module:utils/keyboard}.
|
|
28
|
+
*
|
|
29
|
+
* **Note**: Use {@link module:ui/button/button~Button#withKeystroke} if you want to display
|
|
30
|
+
* the keystroke information next to the {@link module:ui/button/button~Button#label label}.
|
|
31
|
+
*
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
keystroke: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* (Optional) Tooltip of the button, i.e. displayed when hovering the button with the mouse cursor.
|
|
37
|
+
*
|
|
38
|
+
* * If defined as a `Boolean` (e.g. `true`), then combination of `label` and `keystroke` will be set as a tooltip.
|
|
39
|
+
* * If defined as a `String`, tooltip will equal the exact text of that `String`.
|
|
40
|
+
* * If defined as a `Function`, `label` and `keystroke` will be passed to that function, which is to return
|
|
41
|
+
* a string with the tooltip text.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* const view = new ButtonView( locale );
|
|
45
|
+
* view.tooltip = ( label, keystroke ) => `A tooltip for ${ label } and ${ keystroke }.`
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @observable
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
tooltip: boolean | string | ((label: string, keystroke: string | undefined) => string);
|
|
52
|
+
/**
|
|
53
|
+
* (Optional) The position of the tooltip. See {@link module:ui/tooltipmanager~TooltipManager}
|
|
54
|
+
* to learn more about the tooltip system.
|
|
55
|
+
*
|
|
56
|
+
* **Note:** It makes sense only when the {@link #tooltip `tooltip` attribute} is defined.
|
|
57
|
+
*
|
|
58
|
+
* @observable
|
|
59
|
+
* @default 's'
|
|
60
|
+
*/
|
|
61
|
+
tooltipPosition: 's' | 'n' | 'e' | 'w' | 'sw' | 'se';
|
|
62
|
+
/**
|
|
63
|
+
* The HTML type of the button.
|
|
64
|
+
*
|
|
65
|
+
* @observable
|
|
66
|
+
* @default 'button'
|
|
67
|
+
*/
|
|
68
|
+
type: 'button' | 'submit' | 'reset' | 'menu';
|
|
69
|
+
/**
|
|
70
|
+
* Controls whether the button view is "on". It makes sense when a feature it represents
|
|
71
|
+
* is currently active, e.g. a bold button is "on" when the selection is in the bold text.
|
|
72
|
+
*
|
|
73
|
+
* To disable the button, use {@link #isEnabled} instead.
|
|
74
|
+
*
|
|
75
|
+
* @observable
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
isOn: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Controls whether the button view is enabled, i.e. it can be clicked and execute an action.
|
|
81
|
+
*
|
|
82
|
+
* To change the "on" state of the button, use {@link #isOn} instead.
|
|
83
|
+
*
|
|
84
|
+
* @observable
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
isEnabled: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Controls whether the button view is visible. Visible by default, buttons are hidden
|
|
90
|
+
* using a CSS class.
|
|
91
|
+
*
|
|
92
|
+
* @observable
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
95
|
+
isVisible: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Controls whether the button view is a toggle button (two–state) for assistive technologies.
|
|
98
|
+
*
|
|
99
|
+
* @observable
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
isToggleable: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* (Optional) Controls whether the label of the button is hidden (e.g. an icon–only button).
|
|
105
|
+
*
|
|
106
|
+
* @observable
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
withText: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* (Optional) Controls whether the keystroke of the button is displayed next to its
|
|
112
|
+
* {@link module:ui/button/button~Button#label label}.
|
|
113
|
+
*
|
|
114
|
+
* **Note**: This property requires a {@link module:ui/button/button~Button#keystroke keystroke}
|
|
115
|
+
* to be defined in the first place.
|
|
116
|
+
*
|
|
117
|
+
* @observable
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
withKeystroke: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* (Optional) An XML {@link module:ui/icon/iconview~IconView#content content} of the icon.
|
|
123
|
+
* When defined, an `iconView` should be added to the button.
|
|
124
|
+
*
|
|
125
|
+
* The user must provide the entire XML string, not just the path. See the
|
|
126
|
+
* {@glink framework/architecture/ui-library#setting-label-icon-and-tooltip UI library} guide for details.
|
|
127
|
+
*
|
|
128
|
+
* @observable
|
|
129
|
+
*/
|
|
130
|
+
icon: string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* (Optional) Controls the `tabindex` HTML attribute of the button. By default, the button is focusable
|
|
133
|
+
* but does not included in the <kbd>Tab</kbd> order.
|
|
134
|
+
*
|
|
135
|
+
* @observable
|
|
136
|
+
* @default -1
|
|
137
|
+
*/
|
|
138
|
+
tabindex: number;
|
|
139
|
+
/**
|
|
140
|
+
* (Optional) The additional CSS class set on the button.
|
|
141
|
+
*
|
|
142
|
+
* @observable
|
|
143
|
+
*/
|
|
144
|
+
class: string | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* (Optional) The ARIA property reflected by the `aria-checked` DOM attribute used by assistive technologies.
|
|
147
|
+
*
|
|
148
|
+
* @observable
|
|
149
|
+
*/
|
|
150
|
+
ariaChecked?: boolean | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* (Optional) The ARIA property reflected by the `aria-label` DOM attribute used by assistive technologies.
|
|
153
|
+
*
|
|
154
|
+
* @observable
|
|
155
|
+
*/
|
|
156
|
+
ariaLabel?: string | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* (Optional) The ARIA property reflected by the `aria-ariaLabelledBy` DOM attribute used by assistive technologies.
|
|
159
|
+
*
|
|
160
|
+
* @observable
|
|
161
|
+
*/
|
|
162
|
+
ariaLabelledBy?: string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* (Optional) The property reflected by the `role` DOM attribute to be used by assistive technologies.
|
|
165
|
+
*
|
|
166
|
+
* @observable
|
|
167
|
+
*/
|
|
168
|
+
role?: string | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* (Optional) The value of the `style` attribute of the label.
|
|
171
|
+
*
|
|
172
|
+
* @observable
|
|
173
|
+
*/
|
|
174
|
+
labelStyle: string | undefined;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Fired when the button view is clicked. It won't be fired when the button {@link module:ui/button/button~Button#isEnabled}
|
|
178
|
+
* is `false`.
|
|
179
|
+
*
|
|
180
|
+
* @eventName ~Button#execute
|
|
181
|
+
*/
|
|
182
|
+
export type ButtonExecuteEvent = {
|
|
183
|
+
name: 'execute';
|
|
184
|
+
args: [];
|
|
185
|
+
};
|