@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,38 @@
|
|
|
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/buttonlabel
|
|
11
|
+
*/
|
|
12
|
+
import type View from '../view.js';
|
|
13
|
+
/**
|
|
14
|
+
* The button label interface. Implemented by the {@link module:ui/button/buttonlabelview~ButtonLabelView}
|
|
15
|
+
* and any label view that can be used with the {@link module:ui/button/buttonview~ButtonView}.
|
|
16
|
+
*/
|
|
17
|
+
export default interface ButtonLabel extends View {
|
|
18
|
+
/**
|
|
19
|
+
* The `id` attribute of the button label. It is used for accessibility purposes
|
|
20
|
+
* to describe the button.
|
|
21
|
+
*
|
|
22
|
+
* @observable
|
|
23
|
+
*/
|
|
24
|
+
id: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The `style` attribute of the button label. It allows customizing the presentation
|
|
27
|
+
* of the label.
|
|
28
|
+
*
|
|
29
|
+
* @observable
|
|
30
|
+
*/
|
|
31
|
+
style: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The human-readable text of the label.
|
|
34
|
+
*
|
|
35
|
+
* @observable
|
|
36
|
+
*/
|
|
37
|
+
text: string | undefined;
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @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/buttonlabelview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import type ButtonLabel from './buttonlabel.js';
|
|
14
|
+
/**
|
|
15
|
+
* A default implementation of the button view's label. It comes with a dynamic text support
|
|
16
|
+
* via {@link module:ui/button/buttonlabelview~ButtonLabelView#text} property.
|
|
17
|
+
*/
|
|
18
|
+
export default class ButtonLabelView extends View implements ButtonLabel {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
id: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
style: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
text: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
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/buttonview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import IconView from '../icon/iconview.js';
|
|
14
|
+
import type ViewCollection from '../viewcollection.js';
|
|
15
|
+
import type { default as Button } from './button.js';
|
|
16
|
+
import type ButtonLabel from './buttonlabel.js';
|
|
17
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
18
|
+
import '../../theme/components/button/button.css';
|
|
19
|
+
/**
|
|
20
|
+
* The button view class.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const view = new ButtonView();
|
|
24
|
+
*
|
|
25
|
+
* view.set( {
|
|
26
|
+
* label: 'A button',
|
|
27
|
+
* keystroke: 'Ctrl+B',
|
|
28
|
+
* tooltip: true,
|
|
29
|
+
* withText: true
|
|
30
|
+
* } );
|
|
31
|
+
*
|
|
32
|
+
* view.render();
|
|
33
|
+
*
|
|
34
|
+
* document.body.append( view.element );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export default class ButtonView extends View<HTMLButtonElement> implements Button {
|
|
38
|
+
/**
|
|
39
|
+
* Collection of the child views inside of the button {@link #element}.
|
|
40
|
+
*/
|
|
41
|
+
readonly children: ViewCollection;
|
|
42
|
+
/**
|
|
43
|
+
* Label of the button view. Its text is configurable using the {@link #label label attribute}.
|
|
44
|
+
*
|
|
45
|
+
* If not configured otherwise in the `constructor()`, by default the label is an instance
|
|
46
|
+
* of {@link module:ui/button/buttonlabelview~ButtonLabelView}.
|
|
47
|
+
*/
|
|
48
|
+
readonly labelView: ButtonLabel;
|
|
49
|
+
/**
|
|
50
|
+
* The icon view of the button. Will be added to {@link #children} when the
|
|
51
|
+
* {@link #icon icon attribute} is defined.
|
|
52
|
+
*/
|
|
53
|
+
readonly iconView: IconView;
|
|
54
|
+
/**
|
|
55
|
+
* A view displaying the keystroke of the button next to the {@link #labelView label}.
|
|
56
|
+
* Added to {@link #children} when the {@link #withKeystroke `withKeystroke` attribute}
|
|
57
|
+
* is defined.
|
|
58
|
+
*/
|
|
59
|
+
readonly keystrokeView: View;
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
class: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
labelStyle: string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
icon: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
isEnabled: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @inheritDoc
|
|
78
|
+
*/
|
|
79
|
+
isOn: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @inheritDoc
|
|
82
|
+
*/
|
|
83
|
+
isVisible: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @inheritDoc
|
|
86
|
+
*/
|
|
87
|
+
isToggleable: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* @inheritDoc
|
|
90
|
+
*/
|
|
91
|
+
keystroke: string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
label: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* @inheritDoc
|
|
98
|
+
*/
|
|
99
|
+
tabindex: number;
|
|
100
|
+
/**
|
|
101
|
+
* @inheritDoc
|
|
102
|
+
*/
|
|
103
|
+
tooltip: Button['tooltip'];
|
|
104
|
+
/**
|
|
105
|
+
* @inheritDoc
|
|
106
|
+
*/
|
|
107
|
+
tooltipPosition: Button['tooltipPosition'];
|
|
108
|
+
/**
|
|
109
|
+
* @inheritDoc
|
|
110
|
+
*/
|
|
111
|
+
type: Button['type'];
|
|
112
|
+
/**
|
|
113
|
+
* @inheritDoc
|
|
114
|
+
*/
|
|
115
|
+
withText: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* @inheritDoc
|
|
118
|
+
*/
|
|
119
|
+
withKeystroke: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* @inheritDoc
|
|
122
|
+
*/
|
|
123
|
+
role: string | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* @inheritDoc
|
|
126
|
+
*/
|
|
127
|
+
ariaChecked: boolean | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* @inheritDoc
|
|
130
|
+
*/
|
|
131
|
+
ariaLabel?: string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* @inheritDoc
|
|
134
|
+
*/
|
|
135
|
+
ariaLabelledBy: string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Tooltip of the button bound to the template.
|
|
138
|
+
*
|
|
139
|
+
* @see #tooltip
|
|
140
|
+
* @see module:ui/button/buttonview~ButtonView#_getTooltipString
|
|
141
|
+
* @internal
|
|
142
|
+
* @observable
|
|
143
|
+
*/
|
|
144
|
+
_tooltipString: string;
|
|
145
|
+
/**
|
|
146
|
+
* Delayed focus function for focus handling in Safari.
|
|
147
|
+
*/
|
|
148
|
+
private _focusDelayed;
|
|
149
|
+
/**
|
|
150
|
+
* Creates an instance of the button view class.
|
|
151
|
+
*
|
|
152
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
153
|
+
* @param labelView The instance of the button's label. If not provided, an instance of
|
|
154
|
+
* {@link module:ui/button/buttonlabelview~ButtonLabelView} is used.
|
|
155
|
+
*/
|
|
156
|
+
constructor(locale?: Locale, labelView?: ButtonLabel);
|
|
157
|
+
/**
|
|
158
|
+
* @inheritDoc
|
|
159
|
+
*/
|
|
160
|
+
render(): void;
|
|
161
|
+
/**
|
|
162
|
+
* Focuses the {@link #element} of the button.
|
|
163
|
+
*/
|
|
164
|
+
focus(): void;
|
|
165
|
+
/**
|
|
166
|
+
* @inheritDoc
|
|
167
|
+
*/
|
|
168
|
+
destroy(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Binds the label view instance it with button attributes.
|
|
171
|
+
*/
|
|
172
|
+
private _setupLabelView;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a view that displays a keystroke next to a {@link #labelView label }
|
|
175
|
+
* and binds it with button attributes.
|
|
176
|
+
*/
|
|
177
|
+
private _createKeystrokeView;
|
|
178
|
+
/**
|
|
179
|
+
* Gets the text for the tooltip from the combination of
|
|
180
|
+
* {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.
|
|
181
|
+
*
|
|
182
|
+
* @see #tooltip
|
|
183
|
+
* @see #_tooltipString
|
|
184
|
+
* @param tooltip Button tooltip.
|
|
185
|
+
* @param label Button label.
|
|
186
|
+
* @param keystroke Button keystroke.
|
|
187
|
+
*/
|
|
188
|
+
private _getTooltipString;
|
|
189
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 ButtonView from './buttonview.js';
|
|
10
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
11
|
+
/**
|
|
12
|
+
* The file dialog button view.
|
|
13
|
+
*
|
|
14
|
+
* This component provides a button that opens the native file selection dialog.
|
|
15
|
+
* It can be used to implement the UI of a file upload feature.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const view = new FileDialogButtonView( locale );
|
|
19
|
+
*
|
|
20
|
+
* view.set( {
|
|
21
|
+
* acceptedType: 'image/*',
|
|
22
|
+
* allowMultipleFiles: true
|
|
23
|
+
* label: t( 'Insert image' ),
|
|
24
|
+
* icon: imageIcon,
|
|
25
|
+
* tooltip: true
|
|
26
|
+
* } );
|
|
27
|
+
*
|
|
28
|
+
* view.on( 'done', ( evt, files ) => {
|
|
29
|
+
* for ( const file of Array.from( files ) ) {
|
|
30
|
+
* console.log( 'Selected file', file );
|
|
31
|
+
* }
|
|
32
|
+
* } );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export default class FileDialogButtonView extends ButtonView {
|
|
36
|
+
/**
|
|
37
|
+
* The button view of the component.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated
|
|
40
|
+
*/
|
|
41
|
+
buttonView: ButtonView;
|
|
42
|
+
/**
|
|
43
|
+
* A hidden `<input>` view used to execute file dialog.
|
|
44
|
+
*/
|
|
45
|
+
private _fileInputView;
|
|
46
|
+
/**
|
|
47
|
+
* Accepted file types. Can be provided in form of file extensions, media type or one of:
|
|
48
|
+
* * `audio/*`,
|
|
49
|
+
* * `video/*`,
|
|
50
|
+
* * `image/*`.
|
|
51
|
+
*
|
|
52
|
+
* @observable
|
|
53
|
+
*/
|
|
54
|
+
acceptedType: string;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates if multiple files can be selected. Defaults to `true`.
|
|
57
|
+
*
|
|
58
|
+
* @observable
|
|
59
|
+
*/
|
|
60
|
+
allowMultipleFiles: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
constructor(locale?: Locale);
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
render(): void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Fired when file dialog is closed with file selected.
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* view.on( 'done', ( evt, files ) => {
|
|
75
|
+
* for ( const file of files ) {
|
|
76
|
+
* console.log( 'Selected file', file );
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export type FileInputViewDoneEvent = {
|
|
82
|
+
name: 'done';
|
|
83
|
+
args: [files: FileList];
|
|
84
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
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/switchbuttonview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import ButtonView from './buttonview.js';
|
|
14
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
15
|
+
import '../../theme/components/button/switchbutton.css';
|
|
16
|
+
/**
|
|
17
|
+
* The switch button view class.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* const view = new SwitchButtonView();
|
|
21
|
+
*
|
|
22
|
+
* view.set( {
|
|
23
|
+
* withText: true,
|
|
24
|
+
* label: 'Switch me!'
|
|
25
|
+
* } );
|
|
26
|
+
*
|
|
27
|
+
* view.render();
|
|
28
|
+
*
|
|
29
|
+
* document.body.append( view.element );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export default class SwitchButtonView extends ButtonView {
|
|
33
|
+
/**
|
|
34
|
+
* The toggle switch of the button.
|
|
35
|
+
*/
|
|
36
|
+
readonly toggleSwitchView: View;
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
constructor(locale?: Locale);
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
44
|
+
render(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a toggle child view.
|
|
47
|
+
*/
|
|
48
|
+
private _createToggleView;
|
|
49
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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/collapsible/collapsibleview
|
|
11
|
+
*/
|
|
12
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
import View from '../view.js';
|
|
14
|
+
import ButtonView from '../button/buttonview.js';
|
|
15
|
+
import type ViewCollection from '../viewcollection.js';
|
|
16
|
+
import type { FocusableView } from '../focuscycler.js';
|
|
17
|
+
import '../../theme/components/collapsible/collapsible.css';
|
|
18
|
+
/**
|
|
19
|
+
* A collapsible UI component. Consists of a labeled button and a container which can be collapsed
|
|
20
|
+
* by clicking the button. The collapsible container can be a host to other UI views.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export default class CollapsibleView extends View {
|
|
25
|
+
/**
|
|
26
|
+
* `true` when the container with {@link #children} is collapsed. `false` otherwise.
|
|
27
|
+
*
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
isCollapsed: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The text label of the {@link #buttonView}.
|
|
33
|
+
*
|
|
34
|
+
* @observable
|
|
35
|
+
* @default 'Show more'
|
|
36
|
+
*/
|
|
37
|
+
label: string;
|
|
38
|
+
/**
|
|
39
|
+
* The ID of the label inside the {@link #buttonView} that describes the collapsible
|
|
40
|
+
* container for assistive technologies. Set after the button was {@link #render rendered}.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
* @readonly
|
|
44
|
+
* @observable
|
|
45
|
+
*/
|
|
46
|
+
_collapsibleAriaLabelUid: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The main button that, when clicked, collapses or expands the container with {@link #children}.
|
|
49
|
+
*/
|
|
50
|
+
readonly buttonView: ButtonView;
|
|
51
|
+
/**
|
|
52
|
+
* A collection of the child views that can be collapsed by clicking the {@link #buttonView}.
|
|
53
|
+
*/
|
|
54
|
+
readonly children: ViewCollection<FocusableView>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates an instance of the collapsible view.
|
|
57
|
+
*
|
|
58
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
59
|
+
* @param childViews An optional array of initial child views to be inserted into the collapsible.
|
|
60
|
+
*/
|
|
61
|
+
constructor(locale: Locale, childViews?: Array<FocusableView>);
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
render(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Focuses the first focusable.
|
|
68
|
+
*/
|
|
69
|
+
focus(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Creates the main {@link #buttonView} of the collapsible.
|
|
72
|
+
*/
|
|
73
|
+
private _createButtonView;
|
|
74
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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/colorgrid/colorgridview
|
|
11
|
+
*/
|
|
12
|
+
import View from '../view.js';
|
|
13
|
+
import ColorTileView from './colortileview.js';
|
|
14
|
+
import type DropdownPanelFocusable from '../dropdown/dropdownpanelfocusable.js';
|
|
15
|
+
import type ViewCollection from '../viewcollection.js';
|
|
16
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
17
|
+
import '../../theme/components/colorgrid/colorgrid.css';
|
|
18
|
+
/**
|
|
19
|
+
* A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.
|
|
20
|
+
*/
|
|
21
|
+
export default class ColorGridView extends View implements DropdownPanelFocusable {
|
|
22
|
+
/**
|
|
23
|
+
* A number of columns for the tiles grid.
|
|
24
|
+
*/
|
|
25
|
+
readonly columns: number;
|
|
26
|
+
/**
|
|
27
|
+
* Collection of the child tile views.
|
|
28
|
+
*/
|
|
29
|
+
readonly items: ViewCollection<ColorTileView>;
|
|
30
|
+
/**
|
|
31
|
+
* Tracks information about DOM focus in the grid.
|
|
32
|
+
*/
|
|
33
|
+
readonly focusTracker: FocusTracker;
|
|
34
|
+
/**
|
|
35
|
+
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
36
|
+
*/
|
|
37
|
+
readonly keystrokes: KeystrokeHandler;
|
|
38
|
+
/**
|
|
39
|
+
* The color of the currently selected color tile in {@link #items}.
|
|
40
|
+
*
|
|
41
|
+
* @observable
|
|
42
|
+
*/
|
|
43
|
+
selectedColor: string | undefined | null;
|
|
44
|
+
/**
|
|
45
|
+
* Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
46
|
+
*
|
|
47
|
+
* @fires execute
|
|
48
|
+
* @param locale The localization services instance.
|
|
49
|
+
* @param options Component configuration
|
|
50
|
+
* @param options.colorDefinitions Array with definitions
|
|
51
|
+
* required to create the {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
52
|
+
* @param options.columns A number of columns to display the tiles.
|
|
53
|
+
*/
|
|
54
|
+
constructor(locale?: Locale, options?: {
|
|
55
|
+
colorDefinitions?: Array<ColorDefinition>;
|
|
56
|
+
columns?: number;
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Focuses the first focusable in {@link #items}.
|
|
60
|
+
*/
|
|
61
|
+
focus(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Focuses the last focusable in {@link #items}.
|
|
64
|
+
*/
|
|
65
|
+
focusLast(): void;
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
render(): void;
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
destroy(): void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A color definition used to create a {@link module:ui/colorgrid/colortileview~ColorTileView}.
|
|
77
|
+
*
|
|
78
|
+
* ```json
|
|
79
|
+
* {
|
|
80
|
+
* color: 'hsl(0, 0%, 75%)',
|
|
81
|
+
* label: 'Light Grey',
|
|
82
|
+
* options: {
|
|
83
|
+
* hasBorder: true
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export interface ColorDefinition {
|
|
89
|
+
/**
|
|
90
|
+
* String representing a color.
|
|
91
|
+
* It is used as value of background-color style in {@link module:ui/colorgrid/colortileview~ColorTileView}.
|
|
92
|
+
*/
|
|
93
|
+
color: string;
|
|
94
|
+
/**
|
|
95
|
+
* String used as label for {@link module:ui/colorgrid/colortileview~ColorTileView}.
|
|
96
|
+
*/
|
|
97
|
+
label: string;
|
|
98
|
+
/**
|
|
99
|
+
* Additional options passed to create a {@link module:ui/colorgrid/colortileview~ColorTileView}.
|
|
100
|
+
*/
|
|
101
|
+
options: {
|
|
102
|
+
/**
|
|
103
|
+
* A flag that indicates if special a CSS class should be added
|
|
104
|
+
* to {@link module:ui/colorgrid/colortileview~ColorTileView}, which renders a border around it.
|
|
105
|
+
*/
|
|
106
|
+
hasBorder: boolean;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Fired when the `ColorTileView` for the picked item is executed.
|
|
111
|
+
*
|
|
112
|
+
* @eventName ~ColorGridView#execute
|
|
113
|
+
* @param data Additional information about the event.
|
|
114
|
+
*/
|
|
115
|
+
export type ColorGridViewExecuteEvent = {
|
|
116
|
+
name: 'execute';
|
|
117
|
+
args: [data: ColorGridViewExecuteEventData];
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The data of {@link ~ColorGridViewExecuteEvent execute event}.
|
|
121
|
+
*/
|
|
122
|
+
export interface ColorGridViewExecuteEventData {
|
|
123
|
+
/**
|
|
124
|
+
* The value of the selected color ({@link module:ui/colorgrid/colorgridview~ColorDefinition#color `color.color`}).
|
|
125
|
+
*/
|
|
126
|
+
value: string;
|
|
127
|
+
/**
|
|
128
|
+
* The `hasBorder` property of the selected color
|
|
129
|
+
* ({@link module:ui/colorgrid/colorgridview~ColorDefinition#options `color.options.hasBorder`}).
|
|
130
|
+
*/
|
|
131
|
+
hasBorder: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The label of the selected color ({@link module:ui/colorgrid/colorgridview~ColorDefinition#label `color.label`})
|
|
134
|
+
*/
|
|
135
|
+
label: string;
|
|
136
|
+
}
|
|
@@ -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/colorgrid/colortileview
|
|
11
|
+
*/
|
|
12
|
+
import ButtonView from '../button/buttonview.js';
|
|
13
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
14
|
+
/**
|
|
15
|
+
* This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.
|
|
16
|
+
*/
|
|
17
|
+
export default class ColorTileView extends ButtonView {
|
|
18
|
+
/**
|
|
19
|
+
* String representing a color shown as tile's background.
|
|
20
|
+
*/
|
|
21
|
+
color: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A flag that toggles a special CSS class responsible for displaying
|
|
24
|
+
* a border around the button.
|
|
25
|
+
*/
|
|
26
|
+
hasBorder: boolean;
|
|
27
|
+
constructor(locale?: Locale);
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
render(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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/colorgrid/utils
|
|
11
|
+
*/
|
|
12
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
13
|
+
export type ColorOption = string | {
|
|
14
|
+
color: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
hasBorder?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export interface NormalizedColorOption {
|
|
19
|
+
model: string;
|
|
20
|
+
label: string;
|
|
21
|
+
hasBorder: boolean;
|
|
22
|
+
view: {
|
|
23
|
+
name: string;
|
|
24
|
+
styles: {
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
|
|
31
|
+
* `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
|
|
32
|
+
* but processed to account for editor localization in the correct language.
|
|
33
|
+
*
|
|
34
|
+
* Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
|
|
35
|
+
* when the user configuration is defined because the editor does not exist yet.
|
|
36
|
+
*
|
|
37
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getLocalizedColorOptions(locale: Locale, options: Array<NormalizedColorOption>): Array<NormalizedColorOption>;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a unified color definition object from color configuration options.
|
|
42
|
+
* The object contains the information necessary to both render the UI and initialize the conversion.
|
|
43
|
+
*/
|
|
44
|
+
export declare function normalizeColorOptions(options: Array<ColorOption>): Array<NormalizedColorOption>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a normalized color definition from the user-defined configuration.
|
|
47
|
+
* The "normalization" means it will create full
|
|
48
|
+
* {@link module:ui/colorgrid/colorgridview~ColorDefinition `ColorDefinition-like`}
|
|
49
|
+
* object for string values, and add a `view` property, for each definition.
|
|
50
|
+
*/
|
|
51
|
+
export declare function normalizeSingleColorDefinition(color: ColorOption): NormalizedColorOption;
|