@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
package/src/dialog/dialog.js
DELETED
|
@@ -1,325 +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 { Plugin } from '@ckeditor/ckeditor5-core';
|
|
6
|
-
import { DialogView, DialogViewPosition } from './dialogview.js';
|
|
7
|
-
/**
|
|
8
|
-
* The dialog controller class. It is used to show and hide the {@link module:ui/dialog/dialogview~DialogView}.
|
|
9
|
-
*/
|
|
10
|
-
export class Dialog extends Plugin {
|
|
11
|
-
/**
|
|
12
|
-
* The currently visible dialog view instance.
|
|
13
|
-
*/
|
|
14
|
-
view;
|
|
15
|
-
/**
|
|
16
|
-
* The `Dialog` plugin instance which most recently showed the dialog.
|
|
17
|
-
*
|
|
18
|
-
* Only one dialog can be visible at once, even if there are many editor instances on the page.
|
|
19
|
-
* If an editor wants to show a dialog, it should first hide the dialog that is already opened.
|
|
20
|
-
* But only the `Dialog` instance that showed the dialog is able able to properly hide it.
|
|
21
|
-
* This is why we need to store it in a globally available space (static property).
|
|
22
|
-
* This way every `Dialog` plugin in every editor is able to correctly close any open dialog window.
|
|
23
|
-
*/
|
|
24
|
-
static _visibleDialogPlugin;
|
|
25
|
-
/**
|
|
26
|
-
* A configurable callback called when the dialog is hidden.
|
|
27
|
-
*/
|
|
28
|
-
_onHide;
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
static get pluginName() {
|
|
33
|
-
return 'Dialog';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
static get isOfficialPlugin() {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @inheritDoc
|
|
43
|
-
*/
|
|
44
|
-
constructor(editor) {
|
|
45
|
-
super(editor);
|
|
46
|
-
const t = editor.t;
|
|
47
|
-
this._initShowHideListeners();
|
|
48
|
-
this._initFocusToggler();
|
|
49
|
-
this._initMultiRootIntegration();
|
|
50
|
-
this.set({
|
|
51
|
-
id: null,
|
|
52
|
-
isOpen: false
|
|
53
|
-
});
|
|
54
|
-
// Add the information about the keystroke to the accessibility database.
|
|
55
|
-
editor.accessibility.addKeystrokeInfos({
|
|
56
|
-
categoryId: 'navigation',
|
|
57
|
-
keystrokes: [{
|
|
58
|
-
label: t('Move focus in and out of an active dialog window'),
|
|
59
|
-
keystroke: 'Ctrl+F6',
|
|
60
|
-
mayRequireFn: true
|
|
61
|
-
}]
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
destroy() {
|
|
68
|
-
super.destroy();
|
|
69
|
-
if (Dialog._visibleDialogPlugin === this) {
|
|
70
|
-
this._unlockBodyScroll();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Initiates listeners for the `show` and `hide` events emitted by this plugin.
|
|
75
|
-
*
|
|
76
|
-
* We could not simply decorate the {@link #show} and {@link #hide} methods to fire events,
|
|
77
|
-
* because they would be fired in the wrong order – first would be `show` and then `hide`
|
|
78
|
-
* (because showing the dialog actually starts with hiding the previously visible one).
|
|
79
|
-
* Hence, we added private methods {@link #_show} and {@link #_hide} which are called on events
|
|
80
|
-
* in the desired sequence.
|
|
81
|
-
*/
|
|
82
|
-
_initShowHideListeners() {
|
|
83
|
-
this.on('show', (evt, args) => {
|
|
84
|
-
this._show(args);
|
|
85
|
-
});
|
|
86
|
-
// 'low' priority allows to add custom callback between `_show()` and `onShow()`.
|
|
87
|
-
this.on('show', (evt, args) => {
|
|
88
|
-
if (args.onShow) {
|
|
89
|
-
args.onShow(this);
|
|
90
|
-
}
|
|
91
|
-
}, { priority: 'low' });
|
|
92
|
-
this.on('hide', () => {
|
|
93
|
-
if (Dialog._visibleDialogPlugin) {
|
|
94
|
-
Dialog._visibleDialogPlugin._hide();
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
// 'low' priority allows to add custom callback between `_hide()` and `onHide()`.
|
|
98
|
-
this.on('hide', () => {
|
|
99
|
-
if (this._onHide) {
|
|
100
|
-
this._onHide(this);
|
|
101
|
-
this._onHide = undefined;
|
|
102
|
-
}
|
|
103
|
-
}, { priority: 'low' });
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Initiates keystroke handler for toggling the focus between the editor and the dialog view.
|
|
107
|
-
*/
|
|
108
|
-
_initFocusToggler() {
|
|
109
|
-
const editor = this.editor;
|
|
110
|
-
editor.keystrokes.set('Ctrl+F6', (data, cancel) => {
|
|
111
|
-
if (!this.isOpen || this.view.isModal) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (this.view.focusTracker.isFocused) {
|
|
115
|
-
editor.editing.view.focus();
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
this.view.focus();
|
|
119
|
-
}
|
|
120
|
-
cancel();
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Provides an integration between the root attaching and detaching and positioning of the view.
|
|
125
|
-
*/
|
|
126
|
-
_initMultiRootIntegration() {
|
|
127
|
-
const model = this.editor.model;
|
|
128
|
-
model.document.on('change:data', () => {
|
|
129
|
-
if (!this.view) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const changedRoots = model.document.differ.getChangedRoots();
|
|
133
|
-
for (const changes of changedRoots) {
|
|
134
|
-
if (changes.state) {
|
|
135
|
-
this.view.updatePosition();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Displays a dialog window.
|
|
142
|
-
*
|
|
143
|
-
* This method requires a {@link ~DialogDefinition} that defines the dialog's content, title, icon, action buttons, etc.
|
|
144
|
-
*
|
|
145
|
-
* For example, the following definition will create a dialog with:
|
|
146
|
-
* * A header consisting of an icon, a title, and a "Close" button (it is added by default).
|
|
147
|
-
* * A content consisting of a view with a single paragraph.
|
|
148
|
-
* * A footer consisting of two buttons: "Yes" and "No".
|
|
149
|
-
*
|
|
150
|
-
* ```js
|
|
151
|
-
* // Create the view that will be used as the dialog's content.
|
|
152
|
-
* const textView = new View( locale );
|
|
153
|
-
*
|
|
154
|
-
* textView.setTemplate( {
|
|
155
|
-
* tag: 'div',
|
|
156
|
-
* attributes: {
|
|
157
|
-
* style: {
|
|
158
|
-
* padding: 'var(--ck-spacing-large)',
|
|
159
|
-
* whiteSpace: 'initial',
|
|
160
|
-
* width: '100%',
|
|
161
|
-
* maxWidth: '500px'
|
|
162
|
-
* },
|
|
163
|
-
* tabindex: -1
|
|
164
|
-
* },
|
|
165
|
-
* children: [
|
|
166
|
-
* 'Lorem ipsum dolor sit amet...'
|
|
167
|
-
* ]
|
|
168
|
-
* } );
|
|
169
|
-
*
|
|
170
|
-
* // Show the dialog.
|
|
171
|
-
* editor.plugins.get( 'Dialog' ).show( {
|
|
172
|
-
* id: 'myDialog',
|
|
173
|
-
* icon: 'myIcon', // This should be an SVG string.
|
|
174
|
-
* title: 'My dialog',
|
|
175
|
-
* content: textView,
|
|
176
|
-
* actionButtons: [
|
|
177
|
-
* {
|
|
178
|
-
* label: t( 'Yes' ),
|
|
179
|
-
* class: 'ck-button-action',
|
|
180
|
-
* withText: true,
|
|
181
|
-
* onExecute: () => dialog.hide()
|
|
182
|
-
* },
|
|
183
|
-
* {
|
|
184
|
-
* label: t( 'No' ),
|
|
185
|
-
* withText: true,
|
|
186
|
-
* onExecute: () => dialog.hide()
|
|
187
|
-
* }
|
|
188
|
-
* ]
|
|
189
|
-
* } );
|
|
190
|
-
* ```
|
|
191
|
-
*
|
|
192
|
-
* By specifying the {@link ~DialogDefinition#onShow} and {@link ~DialogDefinition#onHide} callbacks
|
|
193
|
-
* it is also possible to add callbacks that will be called when the dialog is shown or hidden.
|
|
194
|
-
*
|
|
195
|
-
* For example, the callbacks in the following definition:
|
|
196
|
-
* * Disable the default behavior of the <kbd>Esc</kbd> key.
|
|
197
|
-
* * Fire a custom event when the dialog gets hidden.
|
|
198
|
-
*
|
|
199
|
-
* ```js
|
|
200
|
-
* editor.plugins.get( 'Dialog' ).show( {
|
|
201
|
-
* // ...
|
|
202
|
-
* onShow: dialog => {
|
|
203
|
-
* dialog.view.on( 'close', ( evt, data ) => {
|
|
204
|
-
* // Only prevent the event from the "Esc" key - do not affect the other ways of closing the dialog.
|
|
205
|
-
* if ( data.source === 'escKeyPress' ) {
|
|
206
|
-
* evt.stop();
|
|
207
|
-
* }
|
|
208
|
-
* } );
|
|
209
|
-
* },
|
|
210
|
-
* onHide: dialog => {
|
|
211
|
-
* dialog.fire( 'dialogDestroyed' );
|
|
212
|
-
* }
|
|
213
|
-
* } );
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
* Internally, calling this method:
|
|
217
|
-
* 1. Hides the currently visible dialog (if any) calling the {@link #hide} method
|
|
218
|
-
* (fires the {@link ~DialogHideEvent hide event}).
|
|
219
|
-
* 2. Fires the {@link ~DialogShowEvent show event} which allows for adding callbacks that customize the
|
|
220
|
-
* behavior of the dialog.
|
|
221
|
-
* 3. Shows the dialog.
|
|
222
|
-
*/
|
|
223
|
-
show(dialogDefinition) {
|
|
224
|
-
this.hide();
|
|
225
|
-
this.fire(`show:${dialogDefinition.id}`, dialogDefinition);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Handles creating the {@link module:ui/dialog/dialogview~DialogView} instance and making it visible.
|
|
229
|
-
*/
|
|
230
|
-
_show({ id, icon, title, hasCloseButton = true, content, actionButtons, className, isModal, position, onHide, keystrokeHandlerOptions }) {
|
|
231
|
-
const editor = this.editor;
|
|
232
|
-
this.view = new DialogView(editor.locale, {
|
|
233
|
-
getCurrentDomRoot: () => {
|
|
234
|
-
return editor.editing.view.getDomRoot(editor.model.document.selection.anchor.root.rootName);
|
|
235
|
-
},
|
|
236
|
-
getViewportOffset: () => {
|
|
237
|
-
return editor.ui.viewportOffset;
|
|
238
|
-
},
|
|
239
|
-
keystrokeHandlerOptions
|
|
240
|
-
});
|
|
241
|
-
const view = this.view;
|
|
242
|
-
view.on('close', () => {
|
|
243
|
-
this.hide();
|
|
244
|
-
});
|
|
245
|
-
editor.ui.view.body.add(view);
|
|
246
|
-
editor.keystrokes.listenTo(view.element);
|
|
247
|
-
// Unless the user specified a position, modals should always be centered on the screen.
|
|
248
|
-
// Otherwise, let's keep dialogs centered in the editing root by default.
|
|
249
|
-
if (!position) {
|
|
250
|
-
position = isModal ? DialogViewPosition.SCREEN_CENTER : DialogViewPosition.EDITOR_CENTER;
|
|
251
|
-
}
|
|
252
|
-
if (isModal) {
|
|
253
|
-
this._lockBodyScroll();
|
|
254
|
-
}
|
|
255
|
-
view.set({
|
|
256
|
-
position,
|
|
257
|
-
_isVisible: true,
|
|
258
|
-
className,
|
|
259
|
-
isModal
|
|
260
|
-
});
|
|
261
|
-
view.setupParts({
|
|
262
|
-
icon,
|
|
263
|
-
title,
|
|
264
|
-
hasCloseButton,
|
|
265
|
-
content,
|
|
266
|
-
actionButtons
|
|
267
|
-
});
|
|
268
|
-
this.id = id;
|
|
269
|
-
if (onHide) {
|
|
270
|
-
this._onHide = onHide;
|
|
271
|
-
}
|
|
272
|
-
this.isOpen = true;
|
|
273
|
-
Dialog._visibleDialogPlugin = this;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Hides the dialog. This method is decorated to enable interacting on the {@link ~DialogHideEvent hide event}.
|
|
277
|
-
*
|
|
278
|
-
* See {@link #show}.
|
|
279
|
-
*/
|
|
280
|
-
hide() {
|
|
281
|
-
if (Dialog._visibleDialogPlugin) {
|
|
282
|
-
Dialog._visibleDialogPlugin.fire(`hide:${Dialog._visibleDialogPlugin.id}`);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Destroys the {@link module:ui/dialog/dialogview~DialogView} and cleans up the stored dialog state.
|
|
287
|
-
*/
|
|
288
|
-
_hide() {
|
|
289
|
-
if (!this.view) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const editor = this.editor;
|
|
293
|
-
const view = this.view;
|
|
294
|
-
if (view.isModal) {
|
|
295
|
-
this._unlockBodyScroll();
|
|
296
|
-
}
|
|
297
|
-
// Reset the content view to prevent its children from being destroyed in the standard
|
|
298
|
-
// View#destroy() (and collections) chain. If the content children were left in there,
|
|
299
|
-
// they would have to be re-created by the feature using the dialog every time the dialog
|
|
300
|
-
// shows up.
|
|
301
|
-
if (view.contentView) {
|
|
302
|
-
view.contentView.reset();
|
|
303
|
-
}
|
|
304
|
-
editor.ui.view.body.remove(view);
|
|
305
|
-
editor.ui.focusTracker.remove(view.element);
|
|
306
|
-
editor.keystrokes.stopListening(view.element);
|
|
307
|
-
view.destroy();
|
|
308
|
-
editor.editing.view.focus();
|
|
309
|
-
this.id = null;
|
|
310
|
-
this.isOpen = false;
|
|
311
|
-
Dialog._visibleDialogPlugin = null;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Makes the <body> unscrollable (e.g. when the modal shows up).
|
|
315
|
-
*/
|
|
316
|
-
_lockBodyScroll() {
|
|
317
|
-
document.documentElement.classList.add('ck-dialog-scroll-locked');
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Makes the <body> scrollable again (e.g. once the modal hides).
|
|
321
|
-
*/
|
|
322
|
-
_unlockBodyScroll() {
|
|
323
|
-
document.documentElement.classList.remove('ck-dialog-scroll-locked');
|
|
324
|
-
}
|
|
325
|
-
}
|
|
@@ -1,118 +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/dialog/dialogactionsview
|
|
7
|
-
*/
|
|
8
|
-
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import { ButtonView } from '../button/buttonview.js';
|
|
10
|
-
import { View } from '../view.js';
|
|
11
|
-
import { ViewCollection } from '../viewcollection.js';
|
|
12
|
-
import { FocusCycler } from '../focuscycler.js';
|
|
13
|
-
import '../../theme/components/dialog/dialogactions.css';
|
|
14
|
-
/**
|
|
15
|
-
* A dialog actions view class. It contains button views which are used to execute dialog actions.
|
|
16
|
-
*/
|
|
17
|
-
export class DialogActionsView extends View {
|
|
18
|
-
/**
|
|
19
|
-
* A collection of button views.
|
|
20
|
-
*/
|
|
21
|
-
children;
|
|
22
|
-
/**
|
|
23
|
-
* A keystroke handler instance.
|
|
24
|
-
*/
|
|
25
|
-
keystrokes;
|
|
26
|
-
/**
|
|
27
|
-
* A focus cycler instance.
|
|
28
|
-
*/
|
|
29
|
-
focusCycler;
|
|
30
|
-
/**
|
|
31
|
-
* A focus tracker instance.
|
|
32
|
-
*/
|
|
33
|
-
_focusTracker;
|
|
34
|
-
/**
|
|
35
|
-
* A collection of focusable views.
|
|
36
|
-
*/
|
|
37
|
-
_focusables;
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
constructor(locale) {
|
|
42
|
-
super(locale);
|
|
43
|
-
this.children = this.createCollection();
|
|
44
|
-
this.keystrokes = new KeystrokeHandler();
|
|
45
|
-
this._focusTracker = new FocusTracker();
|
|
46
|
-
this._focusables = new ViewCollection();
|
|
47
|
-
this.focusCycler = new FocusCycler({
|
|
48
|
-
focusables: this._focusables,
|
|
49
|
-
focusTracker: this._focusTracker,
|
|
50
|
-
keystrokeHandler: this.keystrokes,
|
|
51
|
-
actions: {
|
|
52
|
-
// Navigate form fields backwards using the Shift + Tab keystroke.
|
|
53
|
-
focusPrevious: 'shift + tab',
|
|
54
|
-
// Navigate form fields forwards using the Tab key.
|
|
55
|
-
focusNext: 'tab'
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
this.setTemplate({
|
|
59
|
-
tag: 'div',
|
|
60
|
-
attributes: {
|
|
61
|
-
class: [
|
|
62
|
-
'ck',
|
|
63
|
-
'ck-dialog__actions'
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
children: this.children
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @inheritDoc
|
|
71
|
-
*/
|
|
72
|
-
render() {
|
|
73
|
-
super.render();
|
|
74
|
-
this.keystrokes.listenTo(this.element);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Creates the button views based on the given definitions.
|
|
78
|
-
* Then adds them to the {@link #children} collection and to the focus cycler.
|
|
79
|
-
*/
|
|
80
|
-
setButtons(definitions) {
|
|
81
|
-
for (const definition of definitions) {
|
|
82
|
-
const button = new ButtonView(this.locale);
|
|
83
|
-
let property;
|
|
84
|
-
button.on('execute', () => definition.onExecute());
|
|
85
|
-
if (definition.onCreate) {
|
|
86
|
-
definition.onCreate(button);
|
|
87
|
-
}
|
|
88
|
-
for (property in definition) {
|
|
89
|
-
if (property != 'onExecute' && property != 'onCreate') {
|
|
90
|
-
button.set(property, definition[property]);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
this.children.add(button);
|
|
94
|
-
}
|
|
95
|
-
this._updateFocusCyclableItems();
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @inheritDoc
|
|
99
|
-
*/
|
|
100
|
-
focus(direction) {
|
|
101
|
-
if (direction === -1) {
|
|
102
|
-
this.focusCycler.focusLast();
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
this.focusCycler.focusFirst();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Adds all elements from the {@link #children} collection to the {@link #_focusables} collection
|
|
110
|
-
* and to the {@link #_focusTracker} instance.
|
|
111
|
-
*/
|
|
112
|
-
_updateFocusCyclableItems() {
|
|
113
|
-
Array.from(this.children).forEach(v => {
|
|
114
|
-
this._focusables.add(v);
|
|
115
|
-
this._focusTracker.add(v.element);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,39 +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/dialog/dialogcontentview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
/**
|
|
10
|
-
* A dialog content view class.
|
|
11
|
-
*/
|
|
12
|
-
export class DialogContentView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* A collection of content items.
|
|
15
|
-
*/
|
|
16
|
-
children;
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
constructor(locale) {
|
|
21
|
-
super(locale);
|
|
22
|
-
this.children = this.createCollection();
|
|
23
|
-
this.setTemplate({
|
|
24
|
-
tag: 'div',
|
|
25
|
-
attributes: {
|
|
26
|
-
class: ['ck', 'ck-dialog__content']
|
|
27
|
-
},
|
|
28
|
-
children: this.children
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Removes all the child views.
|
|
33
|
-
*/
|
|
34
|
-
reset() {
|
|
35
|
-
while (this.children.length) {
|
|
36
|
-
this.children.remove(0);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|