@ckeditor/ckeditor5-ui 47.6.1-alpha.1 → 48.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +3 -3
- package/{src → dist}/colorselector/documentcolorcollection.d.ts +4 -4
- package/{src → dist}/dialog/dialog.d.ts +1 -1
- package/dist/index-editor.css +2728 -587
- package/dist/index.css +2673 -850
- package/dist/index.css.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/{src → dist}/menubar/menubarmenuview.d.ts +4 -0
- package/{src → dist}/view.d.ts +1 -1
- package/package.json +25 -47
- package/lang/contexts.json +0 -51
- package/lang/translations/af.po +0 -208
- package/lang/translations/ar.po +0 -208
- package/lang/translations/ast.po +0 -208
- package/lang/translations/az.po +0 -208
- package/lang/translations/be.po +0 -208
- package/lang/translations/bg.po +0 -208
- package/lang/translations/bn.po +0 -208
- package/lang/translations/bs.po +0 -208
- package/lang/translations/ca.po +0 -208
- package/lang/translations/cs.po +0 -208
- package/lang/translations/da.po +0 -208
- package/lang/translations/de-ch.po +0 -208
- package/lang/translations/de.po +0 -208
- package/lang/translations/el.po +0 -208
- package/lang/translations/en-au.po +0 -208
- package/lang/translations/en-gb.po +0 -208
- package/lang/translations/en.po +0 -208
- package/lang/translations/eo.po +0 -208
- package/lang/translations/es-co.po +0 -208
- package/lang/translations/es.po +0 -208
- package/lang/translations/et.po +0 -208
- package/lang/translations/eu.po +0 -208
- package/lang/translations/fa.po +0 -208
- package/lang/translations/fi.po +0 -208
- package/lang/translations/fr.po +0 -208
- package/lang/translations/gl.po +0 -208
- package/lang/translations/gu.po +0 -208
- package/lang/translations/he.po +0 -208
- package/lang/translations/hi.po +0 -208
- package/lang/translations/hr.po +0 -208
- package/lang/translations/hu.po +0 -208
- package/lang/translations/hy.po +0 -208
- package/lang/translations/id.po +0 -208
- package/lang/translations/it.po +0 -208
- package/lang/translations/ja.po +0 -208
- package/lang/translations/jv.po +0 -208
- package/lang/translations/kk.po +0 -208
- package/lang/translations/km.po +0 -208
- package/lang/translations/kn.po +0 -208
- package/lang/translations/ko.po +0 -208
- package/lang/translations/ku.po +0 -208
- package/lang/translations/lt.po +0 -208
- package/lang/translations/lv.po +0 -208
- package/lang/translations/ms.po +0 -208
- package/lang/translations/nb.po +0 -208
- package/lang/translations/ne.po +0 -208
- package/lang/translations/nl.po +0 -208
- package/lang/translations/no.po +0 -208
- package/lang/translations/oc.po +0 -208
- package/lang/translations/pl.po +0 -208
- package/lang/translations/pt-br.po +0 -208
- package/lang/translations/pt.po +0 -208
- package/lang/translations/ro.po +0 -208
- package/lang/translations/ru.po +0 -208
- package/lang/translations/si.po +0 -208
- package/lang/translations/sk.po +0 -208
- package/lang/translations/sl.po +0 -208
- package/lang/translations/sq.po +0 -208
- package/lang/translations/sr-latn.po +0 -208
- package/lang/translations/sr.po +0 -208
- package/lang/translations/sv.po +0 -208
- package/lang/translations/th.po +0 -208
- package/lang/translations/ti.po +0 -208
- package/lang/translations/tk.po +0 -208
- package/lang/translations/tr.po +0 -208
- package/lang/translations/tt.po +0 -208
- package/lang/translations/ug.po +0 -208
- package/lang/translations/uk.po +0 -208
- package/lang/translations/ur.po +0 -208
- package/lang/translations/uz.po +0 -208
- package/lang/translations/vi.po +0 -208
- package/lang/translations/zh-cn.po +0 -208
- package/lang/translations/zh.po +0 -208
- package/src/arialiveannouncer.js +0 -189
- package/src/augmentation.js +0 -5
- package/src/autocomplete/autocompleteview.js +0 -157
- package/src/badge/badge.js +0 -226
- package/src/bindings/addkeyboardhandlingforgrid.js +0 -107
- package/src/bindings/clickoutsidehandler.js +0 -36
- package/src/bindings/csstransitiondisablermixin.js +0 -58
- package/src/bindings/draggableviewmixin.js +0 -144
- package/src/bindings/preventdefault.js +0 -35
- package/src/bindings/submithandler.js +0 -47
- package/src/button/button.js +0 -5
- package/src/button/buttonlabel.js +0 -5
- package/src/button/buttonlabelview.js +0 -42
- package/src/button/buttonview.js +0 -278
- package/src/button/filedialogbuttonview.js +0 -147
- package/src/button/listitembuttonview.js +0 -136
- package/src/button/switchbuttonview.js +0 -79
- package/src/collapsible/collapsibleview.js +0 -106
- package/src/colorgrid/colorgridview.js +0 -140
- package/src/colorgrid/colortileview.js +0 -42
- package/src/colorgrid/utils.js +0 -84
- package/src/colorpicker/colorpickerview.js +0 -356
- package/src/colorpicker/utils.js +0 -108
- package/src/colorselector/colorgridsfragmentview.js +0 -368
- package/src/colorselector/colorpickerfragmentview.js +0 -254
- package/src/colorselector/colorselectorview.js +0 -294
- package/src/colorselector/documentcolorcollection.js +0 -42
- package/src/componentfactory.js +0 -108
- package/src/dialog/dialog.js +0 -325
- package/src/dialog/dialogactionsview.js +0 -118
- package/src/dialog/dialogcontentview.js +0 -39
- package/src/dialog/dialogview.js +0 -507
- package/src/dropdown/button/dropdownbutton.js +0 -5
- package/src/dropdown/button/dropdownbuttonview.js +0 -70
- package/src/dropdown/button/splitbuttonview.js +0 -178
- package/src/dropdown/dropdownpanelfocusable.js +0 -5
- package/src/dropdown/dropdownpanelview.js +0 -106
- package/src/dropdown/dropdownview.js +0 -438
- package/src/dropdown/menu/dropdownmenubehaviors.js +0 -125
- package/src/dropdown/menu/dropdownmenubuttonview.js +0 -69
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +0 -30
- package/src/dropdown/menu/dropdownmenulistitemview.js +0 -38
- package/src/dropdown/menu/dropdownmenulistview.js +0 -29
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +0 -63
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +0 -214
- package/src/dropdown/menu/dropdownmenurootlistview.js +0 -168
- package/src/dropdown/menu/utils.js +0 -61
- package/src/dropdown/utils.js +0 -654
- package/src/editableui/editableuiview.js +0 -130
- package/src/editableui/inline/inlineeditableuiview.js +0 -75
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +0 -142
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +0 -112
- package/src/editorui/bodycollection.js +0 -128
- package/src/editorui/boxed/boxededitoruiview.js +0 -95
- package/src/editorui/editorui.js +0 -586
- package/src/editorui/editoruiview.js +0 -60
- package/src/editorui/evaluationbadge.js +0 -99
- package/src/editorui/poweredby.js +0 -120
- package/src/focuscycler.js +0 -383
- package/src/formheader/formheaderview.js +0 -77
- package/src/formrow/formrowview.js +0 -56
- package/src/highlightedtext/buttonlabelwithhighlightview.js +0 -31
- package/src/highlightedtext/highlightedtextview.js +0 -102
- package/src/highlightedtext/labelwithhighlightview.js +0 -37
- package/src/icon/iconview.js +0 -123
- package/src/iframe/iframeview.js +0 -63
- package/src/index.js +0 -132
- package/src/input/inputbase.js +0 -119
- package/src/input/inputview.js +0 -24
- package/src/inputnumber/inputnumberview.js +0 -40
- package/src/inputtext/inputtextview.js +0 -27
- package/src/label/labelview.js +0 -46
- package/src/labeledfield/labeledfieldview.js +0 -177
- package/src/labeledfield/utils.js +0 -176
- package/src/labeledinput/labeledinputview.js +0 -138
- package/src/legacyerrors.js +0 -20
- package/src/list/listitemgroupview.js +0 -82
- package/src/list/listitemview.js +0 -46
- package/src/list/listseparatorview.js +0 -28
- package/src/list/listview.js +0 -210
- package/src/menubar/menubarmenubuttonview.js +0 -68
- package/src/menubar/menubarmenulistitembuttonview.js +0 -30
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +0 -32
- package/src/menubar/menubarmenulistitemview.js +0 -34
- package/src/menubar/menubarmenulistview.js +0 -72
- package/src/menubar/menubarmenupanelview.js +0 -64
- package/src/menubar/menubarmenuview.js +0 -198
- package/src/menubar/menubarview.js +0 -281
- package/src/menubar/utils.js +0 -1432
- package/src/model.js +0 -31
- package/src/notification/notification.js +0 -192
- package/src/panel/balloon/balloonpanelview.js +0 -1077
- package/src/panel/balloon/contextualballoon.js +0 -616
- package/src/panel/sticky/stickypanelview.js +0 -246
- package/src/search/filteredview.js +0 -5
- package/src/search/filtergroupanditemnames.js +0 -38
- package/src/search/searchinfoview.js +0 -59
- package/src/search/searchresultsview.js +0 -83
- package/src/search/text/searchtextqueryview.js +0 -87
- package/src/search/text/searchtextview.js +0 -242
- package/src/spinner/spinnerview.js +0 -38
- package/src/template.js +0 -1396
- package/src/textarea/textareaview.js +0 -189
- package/src/toolbar/balloon/balloontoolbar.js +0 -358
- package/src/toolbar/block/blockbuttonview.js +0 -41
- package/src/toolbar/block/blocktoolbar.js +0 -507
- package/src/toolbar/normalizetoolbarconfig.js +0 -52
- package/src/toolbar/toolbarlinebreakview.js +0 -28
- package/src/toolbar/toolbarseparatorview.js +0 -28
- package/src/toolbar/toolbarview.js +0 -873
- package/src/tooltipmanager.js +0 -454
- package/src/view.js +0 -471
- package/src/viewcollection.js +0 -210
- package/theme/components/arialiveannouncer/arialiveannouncer.css +0 -14
- package/theme/components/autocomplete/autocomplete.css +0 -22
- package/theme/components/button/button.css +0 -39
- package/theme/components/button/listitembutton.css +0 -48
- package/theme/components/button/switchbutton.css +0 -14
- package/theme/components/collapsible/collapsible.css +0 -10
- package/theme/components/colorgrid/colorgrid.css +0 -8
- package/theme/components/colorpicker/colorpicker.css +0 -34
- package/theme/components/colorselector/colorselector.css +0 -35
- package/theme/components/dialog/dialog.css +0 -42
- package/theme/components/dialog/dialogactions.css +0 -11
- package/theme/components/dropdown/dropdown.css +0 -95
- package/theme/components/dropdown/listdropdown.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenu.css +0 -8
- package/theme/components/dropdown/menu/dropdownmenubutton.css +0 -9
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenupanel.css +0 -11
- package/theme/components/dropdown/splitbutton.css +0 -14
- package/theme/components/dropdown/toolbardropdown.css +0 -20
- package/theme/components/editorui/accessibilityhelp.css +0 -10
- package/theme/components/editorui/editorui.css +0 -10
- package/theme/components/form/form.css +0 -87
- package/theme/components/formheader/formheader.css +0 -18
- package/theme/components/formrow/formrow.css +0 -32
- package/theme/components/highlightedtext/highlightedtext.css +0 -12
- package/theme/components/icon/icon.css +0 -8
- package/theme/components/input/input.css +0 -10
- package/theme/components/label/label.css +0 -12
- package/theme/components/labeledfield/labeledfieldview.css +0 -16
- package/theme/components/labeledinput/labeledinput.css +0 -10
- package/theme/components/list/list.css +0 -26
- package/theme/components/menubar/menubar.css +0 -10
- package/theme/components/menubar/menubarmenu.css +0 -9
- package/theme/components/menubar/menubarmenubutton.css +0 -11
- package/theme/components/menubar/menubarmenulistitem.css +0 -10
- package/theme/components/menubar/menubarmenulistitembutton.css +0 -10
- package/theme/components/menubar/menubarmenupanel.css +0 -62
- package/theme/components/panel/balloonpanel.css +0 -56
- package/theme/components/panel/balloonrotator.css +0 -17
- package/theme/components/panel/fakepanel.css +0 -23
- package/theme/components/panel/stickypanel.css +0 -17
- package/theme/components/responsive-form/responsiveform.css +0 -42
- package/theme/components/search/search.css +0 -43
- package/theme/components/spinner/spinner.css +0 -23
- package/theme/components/textarea/textarea.css +0 -10
- package/theme/components/toolbar/blocktoolbar.css +0 -9
- package/theme/components/toolbar/toolbar.css +0 -58
- package/theme/components/tooltip/tooltip.css +0 -12
- package/theme/globals/_evaluationbadge.css +0 -54
- package/theme/globals/_hidden.css +0 -13
- package/theme/globals/_poweredby.css +0 -84
- package/theme/globals/_transition.css +0 -12
- package/theme/globals/_zindex.css +0 -10
- package/theme/globals/globals.css +0 -10
- package/theme/mixins/_dir.css +0 -10
- package/theme/mixins/_mediacolors.css +0 -20
- package/theme/mixins/_rwd.css +0 -10
- package/theme/mixins/_unselectable.css +0 -14
- /package/{src → dist}/arialiveannouncer.d.ts +0 -0
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/autocomplete/autocompleteview.d.ts +0 -0
- /package/{src → dist}/badge/badge.d.ts +0 -0
- /package/{src → dist}/bindings/addkeyboardhandlingforgrid.d.ts +0 -0
- /package/{src → dist}/bindings/clickoutsidehandler.d.ts +0 -0
- /package/{src → dist}/bindings/csstransitiondisablermixin.d.ts +0 -0
- /package/{src → dist}/bindings/draggableviewmixin.d.ts +0 -0
- /package/{src → dist}/bindings/preventdefault.d.ts +0 -0
- /package/{src → dist}/bindings/submithandler.d.ts +0 -0
- /package/{src → dist}/button/button.d.ts +0 -0
- /package/{src → dist}/button/buttonlabel.d.ts +0 -0
- /package/{src → dist}/button/buttonlabelview.d.ts +0 -0
- /package/{src → dist}/button/buttonview.d.ts +0 -0
- /package/{src → dist}/button/filedialogbuttonview.d.ts +0 -0
- /package/{src → dist}/button/listitembuttonview.d.ts +0 -0
- /package/{src → dist}/button/switchbuttonview.d.ts +0 -0
- /package/{src → dist}/collapsible/collapsibleview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colorgridview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colortileview.d.ts +0 -0
- /package/{src → dist}/colorgrid/utils.d.ts +0 -0
- /package/{src → dist}/colorpicker/colorpickerview.d.ts +0 -0
- /package/{src → dist}/colorpicker/utils.d.ts +0 -0
- /package/{src → dist}/colorselector/colorgridsfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorpickerfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorselectorview.d.ts +0 -0
- /package/{src → dist}/componentfactory.d.ts +0 -0
- /package/{src → dist}/dialog/dialogactionsview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogcontentview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbutton.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/splitbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelfocusable.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubehaviors.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitemview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenuview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenurootlistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/utils.d.ts +0 -0
- /package/{src → dist}/dropdown/utils.d.ts +0 -0
- /package/{src → dist}/editableui/editableuiview.d.ts +0 -0
- /package/{src → dist}/editableui/inline/inlineeditableuiview.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelp.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +0 -0
- /package/{src → dist}/editorui/bodycollection.d.ts +0 -0
- /package/{src → dist}/editorui/boxed/boxededitoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/editorui.d.ts +0 -0
- /package/{src → dist}/editorui/editoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/evaluationbadge.d.ts +0 -0
- /package/{src → dist}/editorui/poweredby.d.ts +0 -0
- /package/{src → dist}/focuscycler.d.ts +0 -0
- /package/{src → dist}/formheader/formheaderview.d.ts +0 -0
- /package/{src → dist}/formrow/formrowview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/buttonlabelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/highlightedtextview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/labelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/icon/iconview.d.ts +0 -0
- /package/{src → dist}/iframe/iframeview.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/input/inputbase.d.ts +0 -0
- /package/{src → dist}/input/inputview.d.ts +0 -0
- /package/{src → dist}/inputnumber/inputnumberview.d.ts +0 -0
- /package/{src → dist}/inputtext/inputtextview.d.ts +0 -0
- /package/{src → dist}/label/labelview.d.ts +0 -0
- /package/{src → dist}/labeledfield/labeledfieldview.d.ts +0 -0
- /package/{src → dist}/labeledfield/utils.d.ts +0 -0
- /package/{src → dist}/labeledinput/labeledinputview.d.ts +0 -0
- /package/{src → dist}/legacyerrors.d.ts +0 -0
- /package/{src → dist}/list/listitemgroupview.d.ts +0 -0
- /package/{src → dist}/list/listitemview.d.ts +0 -0
- /package/{src → dist}/list/listseparatorview.d.ts +0 -0
- /package/{src → dist}/list/listview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenubuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenupanelview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarview.d.ts +0 -0
- /package/{src → dist}/menubar/utils.d.ts +0 -0
- /package/{src → dist}/model.d.ts +0 -0
- /package/{src → dist}/notification/notification.d.ts +0 -0
- /package/{src → dist}/panel/balloon/balloonpanelview.d.ts +0 -0
- /package/{src → dist}/panel/balloon/contextualballoon.d.ts +0 -0
- /package/{src → dist}/panel/sticky/stickypanelview.d.ts +0 -0
- /package/{src → dist}/search/filteredview.d.ts +0 -0
- /package/{src → dist}/search/filtergroupanditemnames.d.ts +0 -0
- /package/{src → dist}/search/searchinfoview.d.ts +0 -0
- /package/{src → dist}/search/searchresultsview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextqueryview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextview.d.ts +0 -0
- /package/{src → dist}/spinner/spinnerview.d.ts +0 -0
- /package/{src → dist}/template.d.ts +0 -0
- /package/{src → dist}/textarea/textareaview.d.ts +0 -0
- /package/{src → dist}/toolbar/balloon/balloontoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blockbuttonview.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blocktoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/normalizetoolbarconfig.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarlinebreakview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarseparatorview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarview.d.ts +0 -0
- /package/{src → dist}/tooltipmanager.d.ts +0 -0
- /package/{src → dist}/viewcollection.d.ts +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/button/filedialogbuttonview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { ButtonView } from './buttonview.js';
|
|
10
|
-
import { ListItemButtonView } from './listitembuttonview.js';
|
|
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 class FileDialogButtonView extends /* #__PURE__ */ FileDialogViewMixin(ButtonView) {
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The file dialog button view used in a lists.
|
|
39
|
-
*
|
|
40
|
-
* This component provides a button that opens the native file selection dialog.
|
|
41
|
-
* It can be used to implement the UI of a file upload feature.
|
|
42
|
-
*
|
|
43
|
-
* ```ts
|
|
44
|
-
* const view = new FileDialogListItemButtonView( locale );
|
|
45
|
-
*
|
|
46
|
-
* view.set( {
|
|
47
|
-
* acceptedType: 'image/*',
|
|
48
|
-
* allowMultipleFiles: true
|
|
49
|
-
* label: t( 'Insert image' ),
|
|
50
|
-
* icon: imageIcon,
|
|
51
|
-
* tooltip: true
|
|
52
|
-
* } );
|
|
53
|
-
*
|
|
54
|
-
* view.on( 'done', ( evt, files ) => {
|
|
55
|
-
* for ( const file of Array.from( files ) ) {
|
|
56
|
-
* console.log( 'Selected file', file );
|
|
57
|
-
* }
|
|
58
|
-
* } );
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export class FileDialogListItemButtonView extends /* #__PURE__ */ FileDialogViewMixin(ListItemButtonView) {
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Mixin function that enhances a base button view class with file dialog functionality. It is used
|
|
65
|
-
* to create a button view class that opens the native select file dialog when clicked.
|
|
66
|
-
*
|
|
67
|
-
* The enhanced view includes a button and a hidden file input. When the button is clicked, the file dialog is opened.
|
|
68
|
-
* The mixin adds properties and methods to the base class to handle the file selection.
|
|
69
|
-
*
|
|
70
|
-
* @param view The base class to be enhanced with file dialog functionality.
|
|
71
|
-
* @returns A new class that extends the base class and includes the file dialog functionality.
|
|
72
|
-
*/
|
|
73
|
-
export function FileDialogViewMixin(view) {
|
|
74
|
-
class FileDialogView extends view {
|
|
75
|
-
/**
|
|
76
|
-
* A hidden `<input>` view used to execute file dialog.
|
|
77
|
-
*/
|
|
78
|
-
_fileInputView;
|
|
79
|
-
/**
|
|
80
|
-
* @inheritDoc
|
|
81
|
-
*/
|
|
82
|
-
constructor(...args) {
|
|
83
|
-
super(...args);
|
|
84
|
-
this._fileInputView = new FileInputView(this.locale);
|
|
85
|
-
this._fileInputView.bind('acceptedType').to(this);
|
|
86
|
-
this._fileInputView.bind('allowMultipleFiles').to(this);
|
|
87
|
-
this._fileInputView.delegate('done').to(this);
|
|
88
|
-
this.on('execute', () => {
|
|
89
|
-
this._fileInputView.open();
|
|
90
|
-
});
|
|
91
|
-
this.extendTemplate({
|
|
92
|
-
attributes: {
|
|
93
|
-
class: 'ck-file-dialog-button'
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @inheritDoc
|
|
99
|
-
*/
|
|
100
|
-
render() {
|
|
101
|
-
super.render();
|
|
102
|
-
this.children.add(this._fileInputView);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return FileDialogView;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* The hidden file input view class.
|
|
109
|
-
*/
|
|
110
|
-
class FileInputView extends View {
|
|
111
|
-
/**
|
|
112
|
-
* @inheritDoc
|
|
113
|
-
*/
|
|
114
|
-
constructor(locale) {
|
|
115
|
-
super(locale);
|
|
116
|
-
this.set('acceptedType', undefined);
|
|
117
|
-
this.set('allowMultipleFiles', false);
|
|
118
|
-
const bind = this.bindTemplate;
|
|
119
|
-
this.setTemplate({
|
|
120
|
-
tag: 'input',
|
|
121
|
-
attributes: {
|
|
122
|
-
class: [
|
|
123
|
-
'ck-hidden'
|
|
124
|
-
],
|
|
125
|
-
type: 'file',
|
|
126
|
-
tabindex: '-1',
|
|
127
|
-
accept: bind.to('acceptedType'),
|
|
128
|
-
multiple: bind.to('allowMultipleFiles')
|
|
129
|
-
},
|
|
130
|
-
on: {
|
|
131
|
-
// Removing from code coverage since we cannot programmatically set input element files.
|
|
132
|
-
change: bind.to(/* istanbul ignore next -- @preserve */ () => {
|
|
133
|
-
if (this.element?.files?.length) {
|
|
134
|
-
this.fire('done', this.element.files);
|
|
135
|
-
}
|
|
136
|
-
this.element.value = '';
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Opens file dialog.
|
|
143
|
-
*/
|
|
144
|
-
open() {
|
|
145
|
-
this.element.click();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
import { IconCheck } from '@ckeditor/ckeditor5-icons';
|
|
6
|
-
import { ButtonView } from './buttonview.js';
|
|
7
|
-
import { ButtonLabelView } from './buttonlabelview.js';
|
|
8
|
-
import { IconView } from '../icon/iconview.js';
|
|
9
|
-
import { View } from '../view.js';
|
|
10
|
-
import '../../theme/components/button/listitembutton.css';
|
|
11
|
-
/**
|
|
12
|
-
* Button that is used as dropdown list item entry.
|
|
13
|
-
*/
|
|
14
|
-
export class ListItemButtonView extends ButtonView {
|
|
15
|
-
/**
|
|
16
|
-
* Holds the view for the check icon of a button list item.
|
|
17
|
-
*/
|
|
18
|
-
_checkIconHolderView = new CheckIconHolderView();
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
constructor(locale, labelView = new ButtonLabelView()) {
|
|
23
|
-
super(locale, labelView);
|
|
24
|
-
this.set({
|
|
25
|
-
hasCheckSpace: false,
|
|
26
|
-
_hasCheck: this.isToggleable
|
|
27
|
-
});
|
|
28
|
-
const bind = this.bindTemplate;
|
|
29
|
-
this.extendTemplate({
|
|
30
|
-
attributes: {
|
|
31
|
-
class: [
|
|
32
|
-
'ck-list-item-button',
|
|
33
|
-
bind.if('isToggleable', 'ck-list-item-button_toggleable')
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
this.bind('_hasCheck').to(this, 'hasCheckSpace', this, 'isToggleable', (hasCheckSpace, isToggleable) => hasCheckSpace || isToggleable);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
render() {
|
|
43
|
-
super.render();
|
|
44
|
-
if (this._hasCheck) {
|
|
45
|
-
this.children.add(this._checkIconHolderView, 0);
|
|
46
|
-
}
|
|
47
|
-
this._watchCheckIconHolderMount();
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Renders the check icon if the button is toggleable.
|
|
51
|
-
*/
|
|
52
|
-
_watchCheckIconHolderMount() {
|
|
53
|
-
this._checkIconHolderView
|
|
54
|
-
.bind('isOn')
|
|
55
|
-
.to(this, 'isOn', value => this.isToggleable && value);
|
|
56
|
-
this.on('change:_hasCheck', (evt, propertyName, hasCheck) => {
|
|
57
|
-
const { children, _checkIconHolderView } = this;
|
|
58
|
-
if (hasCheck) {
|
|
59
|
-
children.add(_checkIconHolderView, 0);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
children.remove(_checkIconHolderView);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export class CheckIconHolderView extends View {
|
|
71
|
-
/**
|
|
72
|
-
* Collection of child views.
|
|
73
|
-
*/
|
|
74
|
-
children;
|
|
75
|
-
/**
|
|
76
|
-
* The view for the check icon of the button list item.
|
|
77
|
-
*/
|
|
78
|
-
_checkIconView = this._createCheckIconView();
|
|
79
|
-
/**
|
|
80
|
-
* @inheritDoc
|
|
81
|
-
*/
|
|
82
|
-
constructor() {
|
|
83
|
-
super();
|
|
84
|
-
const bind = this.bindTemplate;
|
|
85
|
-
this.children = this.createCollection();
|
|
86
|
-
this.set('isOn', false);
|
|
87
|
-
this.setTemplate({
|
|
88
|
-
tag: 'span',
|
|
89
|
-
children: this.children,
|
|
90
|
-
attributes: {
|
|
91
|
-
class: [
|
|
92
|
-
'ck',
|
|
93
|
-
'ck-list-item-button__check-holder',
|
|
94
|
-
bind.to('isOn', isOn => isOn ? 'ck-on' : 'ck-off')
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* @inheritDoc
|
|
101
|
-
*/
|
|
102
|
-
render() {
|
|
103
|
-
super.render();
|
|
104
|
-
if (this.isOn) {
|
|
105
|
-
this.children.add(this._checkIconView, 0);
|
|
106
|
-
}
|
|
107
|
-
this._watchCheckIconMount();
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Renders the check icon if the button is toggleable.
|
|
111
|
-
*/
|
|
112
|
-
_watchCheckIconMount() {
|
|
113
|
-
this.on('change:isOn', (evt, propertyName, isOn) => {
|
|
114
|
-
const { children, _checkIconView } = this;
|
|
115
|
-
if (isOn && !children.has(_checkIconView)) {
|
|
116
|
-
children.add(_checkIconView);
|
|
117
|
-
}
|
|
118
|
-
else if (!isOn && children.has(_checkIconView)) {
|
|
119
|
-
children.remove(_checkIconView);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Creates a check icon view.
|
|
125
|
-
*/
|
|
126
|
-
_createCheckIconView() {
|
|
127
|
-
const iconView = new IconView();
|
|
128
|
-
iconView.content = IconCheck;
|
|
129
|
-
iconView.extendTemplate({
|
|
130
|
-
attributes: {
|
|
131
|
-
class: 'ck-list-item-button__check-icon'
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
return iconView;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/button/switchbuttonview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { ButtonView } from './buttonview.js';
|
|
10
|
-
import '../../theme/components/button/switchbutton.css';
|
|
11
|
-
/**
|
|
12
|
-
* The switch button view class.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* const view = new SwitchButtonView();
|
|
16
|
-
*
|
|
17
|
-
* view.set( {
|
|
18
|
-
* withText: true,
|
|
19
|
-
* label: 'Switch me!'
|
|
20
|
-
* } );
|
|
21
|
-
*
|
|
22
|
-
* view.render();
|
|
23
|
-
*
|
|
24
|
-
* document.body.append( view.element );
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export class SwitchButtonView extends ButtonView {
|
|
28
|
-
/**
|
|
29
|
-
* The toggle switch of the button.
|
|
30
|
-
*/
|
|
31
|
-
toggleSwitchView;
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
constructor(locale) {
|
|
36
|
-
super(locale);
|
|
37
|
-
this.isToggleable = true;
|
|
38
|
-
this.toggleSwitchView = this._createToggleView();
|
|
39
|
-
this.extendTemplate({
|
|
40
|
-
attributes: {
|
|
41
|
-
class: 'ck-switchbutton'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @inheritDoc
|
|
47
|
-
*/
|
|
48
|
-
render() {
|
|
49
|
-
super.render();
|
|
50
|
-
this.children.add(this.toggleSwitchView);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Creates a toggle child view.
|
|
54
|
-
*/
|
|
55
|
-
_createToggleView() {
|
|
56
|
-
const toggleSwitchView = new View();
|
|
57
|
-
toggleSwitchView.setTemplate({
|
|
58
|
-
tag: 'span',
|
|
59
|
-
attributes: {
|
|
60
|
-
class: [
|
|
61
|
-
'ck',
|
|
62
|
-
'ck-button__toggle'
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
children: [
|
|
66
|
-
{
|
|
67
|
-
tag: 'span',
|
|
68
|
-
attributes: {
|
|
69
|
-
class: [
|
|
70
|
-
'ck',
|
|
71
|
-
'ck-button__toggle__inner'
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
return toggleSwitchView;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/collapsible/collapsibleview
|
|
7
|
-
*/
|
|
8
|
-
import { IconDropdownArrow } from '@ckeditor/ckeditor5-icons';
|
|
9
|
-
import { View } from '../view.js';
|
|
10
|
-
import { ButtonView } from '../button/buttonview.js';
|
|
11
|
-
import '../../theme/components/collapsible/collapsible.css';
|
|
12
|
-
/**
|
|
13
|
-
* A collapsible UI component. Consists of a labeled button and a container which can be collapsed
|
|
14
|
-
* by clicking the button. The collapsible container can be a host to other UI views.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export class CollapsibleView extends View {
|
|
19
|
-
/**
|
|
20
|
-
* The main button that, when clicked, collapses or expands the container with {@link #children}.
|
|
21
|
-
*/
|
|
22
|
-
buttonView;
|
|
23
|
-
/**
|
|
24
|
-
* A collection of the child views that can be collapsed by clicking the {@link #buttonView}.
|
|
25
|
-
*/
|
|
26
|
-
children;
|
|
27
|
-
/**
|
|
28
|
-
* Creates an instance of the collapsible view.
|
|
29
|
-
*
|
|
30
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
31
|
-
* @param childViews An optional array of initial child views to be inserted into the collapsible.
|
|
32
|
-
*/
|
|
33
|
-
constructor(locale, childViews) {
|
|
34
|
-
super(locale);
|
|
35
|
-
const bind = this.bindTemplate;
|
|
36
|
-
this.set('isCollapsed', false);
|
|
37
|
-
this.set('label', '');
|
|
38
|
-
this.buttonView = this._createButtonView();
|
|
39
|
-
this.children = this.createCollection();
|
|
40
|
-
this.set('_collapsibleAriaLabelUid', undefined);
|
|
41
|
-
if (childViews) {
|
|
42
|
-
this.children.addMany(childViews);
|
|
43
|
-
}
|
|
44
|
-
this.setTemplate({
|
|
45
|
-
tag: 'div',
|
|
46
|
-
attributes: {
|
|
47
|
-
class: [
|
|
48
|
-
'ck',
|
|
49
|
-
'ck-collapsible',
|
|
50
|
-
bind.if('isCollapsed', 'ck-collapsible_collapsed')
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
children: [
|
|
54
|
-
this.buttonView,
|
|
55
|
-
{
|
|
56
|
-
tag: 'div',
|
|
57
|
-
attributes: {
|
|
58
|
-
class: [
|
|
59
|
-
'ck',
|
|
60
|
-
'ck-collapsible__children'
|
|
61
|
-
],
|
|
62
|
-
role: 'region',
|
|
63
|
-
hidden: bind.if('isCollapsed', 'hidden'),
|
|
64
|
-
'aria-labelledby': bind.to('_collapsibleAriaLabelUid')
|
|
65
|
-
},
|
|
66
|
-
children: this.children
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @inheritDoc
|
|
73
|
-
*/
|
|
74
|
-
render() {
|
|
75
|
-
super.render();
|
|
76
|
-
this._collapsibleAriaLabelUid = this.buttonView.labelView.element.id;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Focuses the first focusable.
|
|
80
|
-
*/
|
|
81
|
-
focus() {
|
|
82
|
-
this.buttonView.focus();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Creates the main {@link #buttonView} of the collapsible.
|
|
86
|
-
*/
|
|
87
|
-
_createButtonView() {
|
|
88
|
-
const buttonView = new ButtonView(this.locale);
|
|
89
|
-
const bind = buttonView.bindTemplate;
|
|
90
|
-
buttonView.set({
|
|
91
|
-
withText: true,
|
|
92
|
-
icon: IconDropdownArrow
|
|
93
|
-
});
|
|
94
|
-
buttonView.extendTemplate({
|
|
95
|
-
attributes: {
|
|
96
|
-
'aria-expanded': bind.to('isOn', value => String(value))
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
buttonView.bind('label').to(this);
|
|
100
|
-
buttonView.bind('isOn').to(this, 'isCollapsed', isCollapsed => !isCollapsed);
|
|
101
|
-
buttonView.on('execute', () => {
|
|
102
|
-
this.isCollapsed = !this.isCollapsed;
|
|
103
|
-
});
|
|
104
|
-
return buttonView;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/colorgrid/colorgridview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { ColorTileView } from './colortileview.js';
|
|
10
|
-
import { addKeyboardHandlingForGrid } from '../bindings/addkeyboardhandlingforgrid.js';
|
|
11
|
-
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
12
|
-
import '../../theme/components/colorgrid/colorgrid.css';
|
|
13
|
-
/**
|
|
14
|
-
* A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.
|
|
15
|
-
*/
|
|
16
|
-
export class ColorGridView extends View {
|
|
17
|
-
/**
|
|
18
|
-
* A number of columns for the tiles grid.
|
|
19
|
-
*/
|
|
20
|
-
columns;
|
|
21
|
-
/**
|
|
22
|
-
* Collection of the child tile views.
|
|
23
|
-
*/
|
|
24
|
-
items;
|
|
25
|
-
/**
|
|
26
|
-
* Tracks information about DOM focus in the grid.
|
|
27
|
-
*/
|
|
28
|
-
focusTracker;
|
|
29
|
-
/**
|
|
30
|
-
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
31
|
-
*/
|
|
32
|
-
keystrokes;
|
|
33
|
-
/**
|
|
34
|
-
* Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
35
|
-
*
|
|
36
|
-
* @fires execute
|
|
37
|
-
* @param locale The localization services instance.
|
|
38
|
-
* @param options Component configuration
|
|
39
|
-
* @param options.colorDefinitions Array with definitions
|
|
40
|
-
* required to create the {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
41
|
-
* @param options.columns A number of columns to display the tiles.
|
|
42
|
-
*/
|
|
43
|
-
constructor(locale, options) {
|
|
44
|
-
super(locale);
|
|
45
|
-
const colorDefinitions = options && options.colorDefinitions ? options.colorDefinitions : [];
|
|
46
|
-
this.columns = options?.columns || 5;
|
|
47
|
-
const viewStyleAttribute = {
|
|
48
|
-
gridTemplateColumns: `repeat( ${this.columns}, 1fr)`
|
|
49
|
-
};
|
|
50
|
-
this.set('selectedColor', undefined);
|
|
51
|
-
this.items = this.createCollection();
|
|
52
|
-
this.focusTracker = new FocusTracker();
|
|
53
|
-
this.keystrokes = new KeystrokeHandler();
|
|
54
|
-
this.items.on('add', (evt, colorTile) => {
|
|
55
|
-
colorTile.isOn = colorTile.color === this.selectedColor;
|
|
56
|
-
});
|
|
57
|
-
colorDefinitions.forEach(color => {
|
|
58
|
-
const colorTile = new ColorTileView();
|
|
59
|
-
colorTile.set({
|
|
60
|
-
color: color.color,
|
|
61
|
-
label: color.label,
|
|
62
|
-
tooltip: true,
|
|
63
|
-
hasBorder: color.options.hasBorder
|
|
64
|
-
});
|
|
65
|
-
colorTile.on('execute', () => {
|
|
66
|
-
this.fire('execute', {
|
|
67
|
-
value: color.color,
|
|
68
|
-
hasBorder: color.options.hasBorder,
|
|
69
|
-
label: color.label
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
this.items.add(colorTile);
|
|
73
|
-
});
|
|
74
|
-
this.setTemplate({
|
|
75
|
-
tag: 'div',
|
|
76
|
-
children: this.items,
|
|
77
|
-
attributes: {
|
|
78
|
-
class: [
|
|
79
|
-
'ck',
|
|
80
|
-
'ck-color-grid'
|
|
81
|
-
],
|
|
82
|
-
style: viewStyleAttribute
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
this.on('change:selectedColor', (evt, name, selectedColor) => {
|
|
86
|
-
for (const item of this.items) {
|
|
87
|
-
item.isOn = item.color === selectedColor;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Focuses the first focusable in {@link #items}.
|
|
93
|
-
*/
|
|
94
|
-
focus() {
|
|
95
|
-
if (this.items.length) {
|
|
96
|
-
this.items.first.focus();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Focuses the last focusable in {@link #items}.
|
|
101
|
-
*/
|
|
102
|
-
focusLast() {
|
|
103
|
-
if (this.items.length) {
|
|
104
|
-
this.items.last.focus();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @inheritDoc
|
|
109
|
-
*/
|
|
110
|
-
render() {
|
|
111
|
-
super.render();
|
|
112
|
-
// Items added before rendering should be known to the #focusTracker.
|
|
113
|
-
for (const item of this.items) {
|
|
114
|
-
this.focusTracker.add(item.element);
|
|
115
|
-
}
|
|
116
|
-
this.items.on('add', (evt, item) => {
|
|
117
|
-
this.focusTracker.add(item.element);
|
|
118
|
-
});
|
|
119
|
-
this.items.on('remove', (evt, item) => {
|
|
120
|
-
this.focusTracker.remove(item.element);
|
|
121
|
-
});
|
|
122
|
-
// Start listening for the keystrokes coming from #element.
|
|
123
|
-
this.keystrokes.listenTo(this.element);
|
|
124
|
-
addKeyboardHandlingForGrid({
|
|
125
|
-
keystrokeHandler: this.keystrokes,
|
|
126
|
-
focusTracker: this.focusTracker,
|
|
127
|
-
gridItems: this.items,
|
|
128
|
-
numberOfColumns: this.columns,
|
|
129
|
-
uiLanguageDirection: this.locale?.uiLanguageDirection
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* @inheritDoc
|
|
134
|
-
*/
|
|
135
|
-
destroy() {
|
|
136
|
-
super.destroy();
|
|
137
|
-
this.focusTracker.destroy();
|
|
138
|
-
this.keystrokes.destroy();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/colorgrid/colortileview
|
|
7
|
-
*/
|
|
8
|
-
import { IconColorTileCheck } from '@ckeditor/ckeditor5-icons';
|
|
9
|
-
import { env } from '@ckeditor/ckeditor5-utils';
|
|
10
|
-
import { ButtonView } from '../button/buttonview.js';
|
|
11
|
-
/**
|
|
12
|
-
* This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.
|
|
13
|
-
*/
|
|
14
|
-
export class ColorTileView extends ButtonView {
|
|
15
|
-
constructor(locale) {
|
|
16
|
-
super(locale);
|
|
17
|
-
const bind = this.bindTemplate;
|
|
18
|
-
this.set('color', undefined);
|
|
19
|
-
this.set('hasBorder', false);
|
|
20
|
-
this.icon = IconColorTileCheck;
|
|
21
|
-
this.extendTemplate({
|
|
22
|
-
attributes: {
|
|
23
|
-
style: {
|
|
24
|
-
// https://github.com/ckeditor/ckeditor5/issues/14907
|
|
25
|
-
backgroundColor: bind.to('color', color => env.isMediaForcedColors ? null : color)
|
|
26
|
-
},
|
|
27
|
-
class: [
|
|
28
|
-
'ck',
|
|
29
|
-
'ck-color-grid__tile',
|
|
30
|
-
bind.if('hasBorder', 'ck-color-selector__color-tile_bordered')
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
render() {
|
|
39
|
-
super.render();
|
|
40
|
-
this.iconView.fillColor = 'hsl(0, 0%, 100%)';
|
|
41
|
-
}
|
|
42
|
-
}
|