@ckeditor/ckeditor5-ui 40.2.0 → 41.1.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/CHANGELOG.md +8 -8
- package/LICENSE.md +1 -1
- package/lang/contexts.json +3 -1
- package/lang/translations/ar.po +9 -1
- package/lang/translations/ast.po +9 -1
- package/lang/translations/az.po +9 -1
- package/lang/translations/bg.po +9 -1
- package/lang/translations/bn.po +9 -1
- package/lang/translations/ca.po +9 -1
- package/lang/translations/cs.po +9 -1
- package/lang/translations/da.po +9 -1
- package/lang/translations/de-ch.po +9 -1
- package/lang/translations/de.po +9 -1
- package/lang/translations/el.po +9 -1
- package/lang/translations/en-au.po +9 -1
- package/lang/translations/en-gb.po +9 -1
- package/lang/translations/en.po +9 -1
- package/lang/translations/eo.po +9 -1
- package/lang/translations/es.po +14 -6
- package/lang/translations/et.po +9 -1
- package/lang/translations/eu.po +9 -1
- package/lang/translations/fa.po +9 -1
- package/lang/translations/fi.po +9 -1
- package/lang/translations/fr.po +9 -1
- package/lang/translations/gl.po +9 -1
- package/lang/translations/he.po +9 -1
- package/lang/translations/hi.po +9 -1
- package/lang/translations/hr.po +9 -1
- package/lang/translations/hu.po +9 -1
- package/lang/translations/id.po +9 -1
- package/lang/translations/it.po +9 -1
- package/lang/translations/ja.po +9 -1
- package/lang/translations/km.po +9 -1
- package/lang/translations/kn.po +9 -1
- package/lang/translations/ko.po +9 -1
- package/lang/translations/ku.po +9 -1
- package/lang/translations/lt.po +9 -1
- package/lang/translations/lv.po +9 -1
- package/lang/translations/ms.po +9 -1
- package/lang/translations/nb.po +9 -1
- package/lang/translations/ne.po +9 -1
- package/lang/translations/nl.po +9 -1
- package/lang/translations/no.po +9 -1
- package/lang/translations/pl.po +9 -1
- package/lang/translations/pt-br.po +9 -1
- package/lang/translations/pt.po +9 -1
- package/lang/translations/ro.po +9 -1
- package/lang/translations/ru.po +9 -1
- package/lang/translations/sk.po +9 -1
- package/lang/translations/sl.po +9 -1
- package/lang/translations/sq.po +9 -1
- package/lang/translations/sr-latn.po +9 -1
- package/lang/translations/sr.po +9 -1
- package/lang/translations/sv.po +9 -1
- package/lang/translations/th.po +9 -1
- package/lang/translations/tk.po +9 -1
- package/lang/translations/tr.po +9 -1
- package/lang/translations/tt.po +9 -1
- package/lang/translations/ug.po +9 -1
- package/lang/translations/uk.po +9 -1
- package/lang/translations/ur.po +9 -1
- package/lang/translations/uz.po +9 -1
- package/lang/translations/vi.po +9 -1
- package/lang/translations/zh-cn.po +9 -1
- package/lang/translations/zh.po +9 -1
- package/package.json +4 -3
- package/src/arialiveannouncer.d.ts +14 -10
- package/src/arialiveannouncer.js +11 -8
- package/src/augmentation.d.ts +3 -2
- package/src/augmentation.js +1 -1
- package/src/autocomplete/autocompleteview.d.ts +4 -4
- package/src/autocomplete/autocompleteview.js +4 -3
- package/src/bindings/addkeyboardhandlingforgrid.d.ts +2 -2
- package/src/bindings/addkeyboardhandlingforgrid.js +1 -1
- package/src/bindings/clickoutsidehandler.d.ts +1 -1
- package/src/bindings/clickoutsidehandler.js +1 -1
- package/src/bindings/csstransitiondisablermixin.d.ts +2 -2
- package/src/bindings/csstransitiondisablermixin.js +1 -1
- package/src/bindings/draggableviewmixin.d.ts +46 -0
- package/src/bindings/draggableviewmixin.js +144 -0
- package/src/bindings/injectcsstransitiondisabler.d.ts +2 -2
- package/src/bindings/injectcsstransitiondisabler.js +1 -1
- package/src/bindings/preventdefault.d.ts +3 -3
- package/src/bindings/preventdefault.js +1 -1
- package/src/bindings/submithandler.d.ts +2 -2
- package/src/bindings/submithandler.js +1 -1
- package/src/button/button.d.ts +4 -1
- package/src/button/button.js +1 -1
- package/src/button/buttonlabel.d.ts +2 -2
- package/src/button/buttonlabel.js +1 -1
- package/src/button/buttonlabelview.d.ts +3 -3
- package/src/button/buttonlabelview.js +2 -2
- package/src/button/buttonview.d.ts +6 -6
- package/src/button/buttonview.js +4 -4
- package/src/button/switchbuttonview.d.ts +3 -3
- package/src/button/switchbuttonview.js +3 -3
- package/src/collapsible/collapsibleview.d.ts +7 -6
- package/src/collapsible/collapsibleview.js +3 -3
- package/src/colorgrid/colorgridview.d.ts +5 -5
- package/src/colorgrid/colorgridview.js +4 -4
- package/src/colorgrid/colortileview.d.ts +2 -2
- package/src/colorgrid/colortileview.js +2 -2
- package/src/colorgrid/utils.d.ts +1 -1
- package/src/colorgrid/utils.js +1 -1
- package/src/colorpicker/colorpickerview.d.ts +12 -7
- package/src/colorpicker/colorpickerview.js +12 -9
- package/src/colorpicker/utils.d.ts +6 -1
- package/src/colorpicker/utils.js +10 -1
- package/src/colorselector/colorgridsfragmentview.d.ts +9 -8
- package/src/colorselector/colorgridsfragmentview.js +10 -11
- package/src/colorselector/colorpickerfragmentview.d.ts +9 -8
- package/src/colorselector/colorpickerfragmentview.js +7 -8
- package/src/colorselector/colorselectorview.d.ts +9 -9
- package/src/colorselector/colorselectorview.js +6 -6
- package/src/colorselector/documentcolorcollection.d.ts +2 -2
- package/src/colorselector/documentcolorcollection.js +1 -1
- package/src/componentfactory.d.ts +2 -2
- package/src/componentfactory.js +1 -1
- package/src/dialog/dialog.d.ts +273 -0
- package/src/dialog/dialog.js +261 -0
- package/src/dialog/dialogactionsview.d.ts +69 -0
- package/src/dialog/dialogactionsview.js +98 -0
- package/src/dialog/dialogcontentview.d.ts +27 -0
- package/src/dialog/dialogcontentview.js +35 -0
- package/src/dialog/dialogview.d.ts +256 -0
- package/src/dialog/dialogview.js +466 -0
- package/src/dropdown/button/dropdownbutton.d.ts +3 -3
- package/src/dropdown/button/dropdownbutton.js +1 -1
- package/src/dropdown/button/dropdownbuttonview.d.ts +4 -4
- package/src/dropdown/button/dropdownbuttonview.js +3 -3
- package/src/dropdown/button/splitbuttonview.d.ts +7 -7
- package/src/dropdown/button/splitbuttonview.js +3 -3
- package/src/dropdown/dropdownpanelfocusable.d.ts +1 -1
- package/src/dropdown/dropdownpanelfocusable.js +1 -1
- package/src/dropdown/dropdownpanelview.d.ts +4 -4
- package/src/dropdown/dropdownpanelview.js +2 -2
- package/src/dropdown/dropdownview.d.ts +8 -8
- package/src/dropdown/dropdownview.js +5 -4
- package/src/dropdown/utils.d.ts +9 -9
- package/src/dropdown/utils.js +15 -15
- package/src/editableui/editableuiview.d.ts +3 -3
- package/src/editableui/editableuiview.js +2 -2
- package/src/editableui/inline/inlineeditableuiview.d.ts +4 -4
- package/src/editableui/inline/inlineeditableuiview.js +2 -2
- package/src/editorui/bodycollection.d.ts +3 -3
- package/src/editorui/bodycollection.js +3 -3
- package/src/editorui/boxed/boxededitoruiview.d.ts +3 -3
- package/src/editorui/boxed/boxededitoruiview.js +3 -3
- package/src/editorui/editorui.d.ts +7 -7
- package/src/editorui/editorui.js +5 -5
- package/src/editorui/editoruiview.d.ts +4 -4
- package/src/editorui/editoruiview.js +3 -3
- package/src/editorui/poweredby.d.ts +1 -1
- package/src/editorui/poweredby.js +4 -4
- package/src/focuscycler.d.ts +29 -10
- package/src/focuscycler.js +46 -17
- package/src/formheader/formheaderview.d.ts +4 -4
- package/src/formheader/formheaderview.js +3 -3
- package/src/highlightedtext/highlightedtextview.d.ts +2 -2
- package/src/highlightedtext/highlightedtextview.js +2 -2
- package/src/icon/iconview.d.ts +5 -2
- package/src/icon/iconview.js +4 -3
- package/src/iframe/iframeview.d.ts +2 -2
- package/src/iframe/iframeview.js +2 -2
- package/src/index.d.ts +67 -68
- package/src/index.js +63 -65
- package/src/input/inputbase.d.ts +2 -2
- package/src/input/inputbase.js +2 -2
- package/src/input/inputview.d.ts +2 -2
- package/src/input/inputview.js +2 -2
- package/src/inputnumber/inputnumberview.d.ts +2 -2
- package/src/inputnumber/inputnumberview.js +2 -2
- package/src/inputtext/inputtextview.d.ts +2 -2
- package/src/inputtext/inputtextview.js +2 -2
- package/src/label/labelview.d.ts +2 -2
- package/src/label/labelview.js +2 -2
- package/src/labeledfield/labeledfieldview.d.ts +5 -5
- package/src/labeledfield/labeledfieldview.js +3 -3
- package/src/labeledfield/utils.d.ts +14 -14
- package/src/labeledfield/utils.js +13 -13
- package/src/labeledinput/labeledinputview.d.ts +4 -4
- package/src/labeledinput/labeledinputview.js +3 -3
- package/src/list/listitemgroupview.d.ts +5 -5
- package/src/list/listitemgroupview.js +5 -5
- package/src/list/listitemview.d.ts +4 -4
- package/src/list/listitemview.js +2 -2
- package/src/list/listseparatorview.d.ts +2 -2
- package/src/list/listseparatorview.js +2 -2
- package/src/list/listview.d.ts +9 -8
- package/src/list/listview.js +7 -7
- package/src/model.d.ts +1 -1
- package/src/model.js +1 -1
- package/src/notification/notification.d.ts +1 -1
- package/src/notification/notification.js +1 -1
- package/src/panel/balloon/balloonpanelview.d.ts +4 -4
- package/src/panel/balloon/balloonpanelview.js +5 -4
- package/src/panel/balloon/contextualballoon.d.ts +5 -5
- package/src/panel/balloon/contextualballoon.js +7 -9
- package/src/panel/sticky/stickypanelview.d.ts +9 -9
- package/src/panel/sticky/stickypanelview.js +7 -7
- package/src/search/filteredview.d.ts +2 -2
- package/src/search/filteredview.js +1 -1
- package/src/search/searchinfoview.d.ts +3 -3
- package/src/search/searchinfoview.js +2 -2
- package/src/search/searchresultsview.d.ts +5 -5
- package/src/search/searchresultsview.js +3 -3
- package/src/search/text/searchtextqueryview.d.ts +5 -5
- package/src/search/text/searchtextqueryview.js +5 -5
- package/src/search/text/searchtextview.d.ts +12 -12
- package/src/search/text/searchtextview.js +6 -6
- package/src/spinner/spinnerview.d.ts +2 -2
- package/src/spinner/spinnerview.js +2 -2
- package/src/template.d.ts +3 -3
- package/src/template.js +3 -3
- package/src/textarea/textareaview.d.ts +18 -2
- package/src/textarea/textareaview.js +46 -6
- package/src/toolbar/balloon/balloontoolbar.d.ts +3 -3
- package/src/toolbar/balloon/balloontoolbar.js +5 -5
- package/src/toolbar/block/blockbuttonview.d.ts +2 -2
- package/src/toolbar/block/blockbuttonview.js +2 -2
- package/src/toolbar/block/blocktoolbar.d.ts +4 -4
- package/src/toolbar/block/blocktoolbar.js +6 -6
- package/src/toolbar/normalizetoolbarconfig.d.ts +1 -1
- package/src/toolbar/normalizetoolbarconfig.js +1 -1
- package/src/toolbar/toolbarlinebreakview.d.ts +2 -2
- package/src/toolbar/toolbarlinebreakview.js +2 -2
- package/src/toolbar/toolbarseparatorview.d.ts +2 -2
- package/src/toolbar/toolbarseparatorview.js +2 -2
- package/src/toolbar/toolbarview.d.ts +7 -6
- package/src/toolbar/toolbarview.js +17 -15
- package/src/tooltipmanager.d.ts +3 -3
- package/src/tooltipmanager.js +5 -4
- package/src/view.d.ts +3 -3
- package/src/view.js +3 -3
- package/src/viewcollection.d.ts +2 -2
- package/src/viewcollection.js +1 -1
- package/theme/components/arialiveannouncer/arialiveannouncer.css +1 -1
- package/theme/components/autocomplete/autocomplete.css +2 -2
- package/theme/components/button/button.css +1 -1
- package/theme/components/button/switchbutton.css +1 -1
- package/theme/components/collapsible/collapsible.css +1 -1
- package/theme/components/colorgrid/colorgrid.css +1 -1
- package/theme/components/colorpicker/colorpicker.css +1 -1
- package/theme/components/colorselector/colorselector.css +1 -1
- package/theme/components/dialog/dialog.css +39 -0
- package/theme/components/dialog/dialogactions.css +11 -0
- package/theme/components/dropdown/dropdown.css +3 -3
- package/theme/components/dropdown/listdropdown.css +1 -1
- package/theme/components/dropdown/splitbutton.css +1 -1
- package/theme/components/dropdown/toolbardropdown.css +1 -1
- package/theme/components/editorui/editorui.css +1 -1
- package/theme/components/formheader/formheader.css +1 -1
- package/theme/components/highlightedtext/highlightedtext.css +1 -1
- package/theme/components/icon/icon.css +1 -1
- package/theme/components/input/input.css +1 -1
- package/theme/components/label/label.css +1 -1
- package/theme/components/labeledfield/labeledfieldview.css +1 -1
- package/theme/components/labeledinput/labeledinput.css +1 -1
- package/theme/components/list/list.css +1 -1
- package/theme/components/panel/balloonpanel.css +2 -2
- package/theme/components/panel/balloonrotator.css +1 -1
- package/theme/components/panel/fakepanel.css +2 -2
- package/theme/components/panel/stickypanel.css +2 -2
- package/theme/components/responsive-form/responsiveform.css +1 -1
- package/theme/components/search/search.css +1 -1
- package/theme/components/spinner/spinner.css +1 -1
- package/theme/components/textarea/textarea.css +1 -1
- package/theme/components/toolbar/blocktoolbar.css +1 -1
- package/theme/components/toolbar/toolbar.css +1 -1
- package/theme/components/tooltip/tooltip.css +2 -2
- package/theme/globals/_hidden.css +1 -1
- package/theme/globals/_poweredby.css +2 -2
- package/theme/globals/_reset.css +1 -1
- package/theme/globals/_transition.css +1 -1
- package/theme/globals/_zindex.css +3 -2
- package/theme/globals/globals.css +1 -1
- package/theme/mixins/_dir.css +1 -1
- package/theme/mixins/_rwd.css +1 -1
- package/theme/mixins/_unselectable.css +1 -1
- package/theme/icons/color-palette.svg +0 -1
- package/theme/icons/next-arrow.svg +0 -1
- package/theme/icons/previous-arrow.svg +0 -1
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/dialog/dialogview
|
|
7
|
+
*/
|
|
8
|
+
import { KeystrokeHandler, FocusTracker, Rect, global, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import { icons } from '@ckeditor/ckeditor5-core';
|
|
10
|
+
import ViewCollection from '../viewcollection.js';
|
|
11
|
+
import View from '../view.js';
|
|
12
|
+
import FormHeaderView from '../formheader/formheaderview.js';
|
|
13
|
+
import ButtonView from '../button/buttonview.js';
|
|
14
|
+
import FocusCycler, { isViewWithFocusCycler, isFocusable } from '../focuscycler.js';
|
|
15
|
+
import DraggableViewMixin from '../bindings/draggableviewmixin.js';
|
|
16
|
+
import DialogActionsView from './dialogactionsview.js';
|
|
17
|
+
import DialogContentView from './dialogcontentview.js';
|
|
18
|
+
import '../../theme/components/dialog/dialog.css';
|
|
19
|
+
// @if CK_DEBUG_DIALOG // const RectDrawer = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' ).default;
|
|
20
|
+
/**
|
|
21
|
+
* Available dialog view positions:
|
|
22
|
+
*
|
|
23
|
+
* * `DialogViewPosition.SCREEN_CENTER` – A fixed position in the center of the screen.
|
|
24
|
+
* * `DialogViewPosition.EDITOR_CENTER` – A dynamic position in the center of the editor editable area.
|
|
25
|
+
* * `DialogViewPosition.EDITOR_TOP_SIDE` – A dynamic position at the top-right (for the left-to-right languages)
|
|
26
|
+
* or top-left (for right-to-left languages) corner of the editor editable area.
|
|
27
|
+
* * `DialogViewPosition.EDITOR_TOP_CENTER` – A dynamic position at the top-center of the editor editable area.
|
|
28
|
+
* * `DialogViewPosition.EDITOR_BOTTOM_CENTER` – A dynamic position at the bottom-center of the editor editable area.
|
|
29
|
+
* * `DialogViewPosition.EDITOR_ABOVE_CENTER` – A dynamic position centered above the editor editable area.
|
|
30
|
+
* * `DialogViewPosition.EDITOR_BELOW_CENTER` – A dynamic position centered below the editor editable area.
|
|
31
|
+
*
|
|
32
|
+
* The position of a dialog is specified by a {@link module:ui/dialog/dialog~DialogDefinition#position `position` property} of a
|
|
33
|
+
* definition passed to the {@link module:ui/dialog/dialog~Dialog#show} method.
|
|
34
|
+
*/
|
|
35
|
+
export const DialogViewPosition = {
|
|
36
|
+
SCREEN_CENTER: 'screen-center',
|
|
37
|
+
EDITOR_CENTER: 'editor-center',
|
|
38
|
+
EDITOR_TOP_SIDE: 'editor-top-side',
|
|
39
|
+
EDITOR_TOP_CENTER: 'editor-top-center',
|
|
40
|
+
EDITOR_BOTTOM_CENTER: 'editor-bottom-center',
|
|
41
|
+
EDITOR_ABOVE_CENTER: 'editor-above-center',
|
|
42
|
+
EDITOR_BELOW_CENTER: 'editor-below-center'
|
|
43
|
+
};
|
|
44
|
+
const toPx = toUnit('px');
|
|
45
|
+
/**
|
|
46
|
+
* A dialog view class.
|
|
47
|
+
*/
|
|
48
|
+
class DialogView extends DraggableViewMixin(View) {
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
constructor(locale, { getCurrentDomRoot, getViewportOffset }) {
|
|
53
|
+
super(locale);
|
|
54
|
+
/**
|
|
55
|
+
* A flag indicating if the dialog was moved manually. If so, its position
|
|
56
|
+
* will not be updated automatically upon window resize or document scroll.
|
|
57
|
+
*/
|
|
58
|
+
this.wasMoved = false;
|
|
59
|
+
const bind = this.bindTemplate;
|
|
60
|
+
const t = locale.t;
|
|
61
|
+
this.set('className', '');
|
|
62
|
+
this.set('ariaLabel', t('Editor dialog'));
|
|
63
|
+
this.set('isModal', false);
|
|
64
|
+
this.set('position', DialogViewPosition.SCREEN_CENTER);
|
|
65
|
+
this.set('_isVisible', false);
|
|
66
|
+
this.set('_isTransparent', false);
|
|
67
|
+
this.set('_top', 0);
|
|
68
|
+
this.set('_left', 0);
|
|
69
|
+
this._getCurrentDomRoot = getCurrentDomRoot;
|
|
70
|
+
this._getViewportOffset = getViewportOffset;
|
|
71
|
+
this.decorate('moveTo');
|
|
72
|
+
this.parts = this.createCollection();
|
|
73
|
+
this.keystrokes = new KeystrokeHandler();
|
|
74
|
+
this.focusTracker = new FocusTracker();
|
|
75
|
+
this._focusables = new ViewCollection();
|
|
76
|
+
this._focusCycler = new FocusCycler({
|
|
77
|
+
focusables: this._focusables,
|
|
78
|
+
focusTracker: this.focusTracker,
|
|
79
|
+
keystrokeHandler: this.keystrokes,
|
|
80
|
+
actions: {
|
|
81
|
+
// Navigate form fields backwards using the Shift + Tab keystroke.
|
|
82
|
+
focusPrevious: 'shift + tab',
|
|
83
|
+
// Navigate form fields forwards using the Tab key.
|
|
84
|
+
focusNext: 'tab'
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
this.setTemplate({
|
|
88
|
+
tag: 'div',
|
|
89
|
+
attributes: {
|
|
90
|
+
class: [
|
|
91
|
+
'ck',
|
|
92
|
+
'ck-dialog-overlay',
|
|
93
|
+
bind.if('isModal', 'ck-dialog-overlay__transparent', isModal => !isModal),
|
|
94
|
+
bind.if('_isVisible', 'ck-hidden', value => !value)
|
|
95
|
+
],
|
|
96
|
+
// Prevent from editor losing focus when clicking on the modal overlay.
|
|
97
|
+
tabindex: '-1'
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
tag: 'div',
|
|
102
|
+
attributes: {
|
|
103
|
+
tabindex: '-1',
|
|
104
|
+
class: [
|
|
105
|
+
'ck',
|
|
106
|
+
'ck-dialog',
|
|
107
|
+
bind.to('className')
|
|
108
|
+
],
|
|
109
|
+
role: 'dialog',
|
|
110
|
+
'aria-label': bind.to('ariaLabel'),
|
|
111
|
+
style: {
|
|
112
|
+
top: bind.to('_top', top => toPx(top)),
|
|
113
|
+
left: bind.to('_left', left => toPx(left)),
|
|
114
|
+
visibility: bind.if('_isTransparent', 'hidden')
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
children: this.parts
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @inheritDoc
|
|
124
|
+
*/
|
|
125
|
+
render() {
|
|
126
|
+
super.render();
|
|
127
|
+
this.keystrokes.set('Esc', (data, cancel) => {
|
|
128
|
+
this.fire('close', { source: 'escKeyPress' });
|
|
129
|
+
cancel();
|
|
130
|
+
});
|
|
131
|
+
// Support for dragging the modal.
|
|
132
|
+
this.on('drag', (evt, { deltaX, deltaY }) => {
|
|
133
|
+
this.wasMoved = true;
|
|
134
|
+
this.moveBy(deltaX, deltaY);
|
|
135
|
+
});
|
|
136
|
+
// Update dialog position upon window resize, if the position was not changed manually.
|
|
137
|
+
this.listenTo(global.window, 'resize', () => {
|
|
138
|
+
if (this._isVisible && !this.wasMoved) {
|
|
139
|
+
this.updatePosition();
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
// Update dialog position upon document scroll, if the position was not changed manually.
|
|
143
|
+
this.listenTo(global.document, 'scroll', () => {
|
|
144
|
+
if (this._isVisible && !this.wasMoved) {
|
|
145
|
+
this.updatePosition();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
this.on('change:_isVisible', (evt, name, isVisible) => {
|
|
149
|
+
if (isVisible) {
|
|
150
|
+
// Let the content render first, then apply the position. Otherwise, the calculated DOM Rects
|
|
151
|
+
// will not reflect the final look of the dialog. Note that we're not using #_moveOffScreen() here because
|
|
152
|
+
// it causes a violent movement of the viewport on iOS (because the dialog still keeps the DOM focus).
|
|
153
|
+
this._isTransparent = true;
|
|
154
|
+
// FYI: RAF is too short. We need to wait a bit longer.
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
this.updatePosition();
|
|
157
|
+
this._isTransparent = false;
|
|
158
|
+
// The view must get the focus after it gets visible. But this is only possible
|
|
159
|
+
// after the dialog is no longer transparent.
|
|
160
|
+
this.focus();
|
|
161
|
+
}, 10);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
this.keystrokes.listenTo(this.element);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Returns the element that should be used as a drag handle.
|
|
168
|
+
*/
|
|
169
|
+
get dragHandleElement() {
|
|
170
|
+
if (this.headerView) {
|
|
171
|
+
return this.headerView.element;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Creates the dialog parts. Which of them are created depends on the arguments passed to the method.
|
|
179
|
+
* There are no rules regarding the dialog construction, that is, no part is mandatory.
|
|
180
|
+
* Each part can only be created once.
|
|
181
|
+
*
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
setupParts({ icon, title, hasCloseButton = true, content, actionButtons }) {
|
|
185
|
+
if (title) {
|
|
186
|
+
this.headerView = new FormHeaderView(this.locale, { icon });
|
|
187
|
+
if (hasCloseButton) {
|
|
188
|
+
this.closeButtonView = this._createCloseButton();
|
|
189
|
+
this.headerView.children.add(this.closeButtonView);
|
|
190
|
+
}
|
|
191
|
+
this.headerView.label = title;
|
|
192
|
+
this.ariaLabel = title;
|
|
193
|
+
this.parts.add(this.headerView, 0);
|
|
194
|
+
}
|
|
195
|
+
if (content) {
|
|
196
|
+
// Normalize the content specified in the arguments.
|
|
197
|
+
if (content instanceof View) {
|
|
198
|
+
content = [content];
|
|
199
|
+
}
|
|
200
|
+
this.contentView = new DialogContentView(this.locale);
|
|
201
|
+
this.contentView.children.addMany(content);
|
|
202
|
+
this.parts.add(this.contentView);
|
|
203
|
+
}
|
|
204
|
+
if (actionButtons) {
|
|
205
|
+
this.actionsView = new DialogActionsView(this.locale);
|
|
206
|
+
this.actionsView.setButtons(actionButtons);
|
|
207
|
+
this.parts.add(this.actionsView);
|
|
208
|
+
}
|
|
209
|
+
this._updateFocusCyclableItems();
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Focuses the first focusable element inside the dialog.
|
|
213
|
+
*/
|
|
214
|
+
focus() {
|
|
215
|
+
this._focusCycler.focusFirst();
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Normalizes the passed coordinates to make sure the dialog view
|
|
219
|
+
* is displayed within the visible viewport and moves it there.
|
|
220
|
+
*
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
moveTo(left, top) {
|
|
224
|
+
const viewportRect = this._getViewportRect();
|
|
225
|
+
const dialogRect = this._getDialogRect();
|
|
226
|
+
// Don't let the dialog go beyond the right edge of the viewport.
|
|
227
|
+
if (left + dialogRect.width > viewportRect.right) {
|
|
228
|
+
left = viewportRect.right - dialogRect.width;
|
|
229
|
+
}
|
|
230
|
+
// Don't let the dialog go beyond the left edge of the viewport.
|
|
231
|
+
if (left < viewportRect.left) {
|
|
232
|
+
left = viewportRect.left;
|
|
233
|
+
}
|
|
234
|
+
// Don't let the dialog go beyond the top edge of the viewport.
|
|
235
|
+
if (top < viewportRect.top) {
|
|
236
|
+
top = viewportRect.top;
|
|
237
|
+
}
|
|
238
|
+
// Note: We don't do the same for the bottom edge to allow users to resize the window vertically
|
|
239
|
+
// and let the dialog to stay put instead of covering the editing root.
|
|
240
|
+
this._moveTo(left, top);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Moves the dialog to the specified coordinates.
|
|
244
|
+
*/
|
|
245
|
+
_moveTo(left, top) {
|
|
246
|
+
this._left = left;
|
|
247
|
+
this._top = top;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Moves the dialog by the specified offset.
|
|
251
|
+
*
|
|
252
|
+
* @internal
|
|
253
|
+
*/
|
|
254
|
+
moveBy(left, top) {
|
|
255
|
+
this.moveTo(this._left + left, this._top + top);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Moves the dialog view to the off-screen position.
|
|
259
|
+
* Used when there is no space to display the dialog.
|
|
260
|
+
*/
|
|
261
|
+
_moveOffScreen() {
|
|
262
|
+
this._moveTo(-9999, -9999);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Recalculates the dialog according to the set position and viewport,
|
|
266
|
+
* and moves it to the new position.
|
|
267
|
+
*/
|
|
268
|
+
updatePosition() {
|
|
269
|
+
if (!this.element || !this.element.parentNode) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const viewportRect = this._getViewportRect();
|
|
273
|
+
// Actual position may be different from the configured one if there's no DOM root.
|
|
274
|
+
let configuredPosition = this.position;
|
|
275
|
+
let domRootRect;
|
|
276
|
+
if (!this._getCurrentDomRoot()) {
|
|
277
|
+
configuredPosition = DialogViewPosition.SCREEN_CENTER;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
domRootRect = this._getVisibleDomRootRect(viewportRect);
|
|
281
|
+
}
|
|
282
|
+
const defaultOffset = DialogView.defaultOffset;
|
|
283
|
+
const dialogRect = this._getDialogRect();
|
|
284
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.clear();
|
|
285
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( viewportRect, { outlineColor: 'blue' }, 'Viewport' );
|
|
286
|
+
switch (configuredPosition) {
|
|
287
|
+
case DialogViewPosition.EDITOR_TOP_SIDE: {
|
|
288
|
+
// @if CK_DEBUG_DIALOG // if ( domRootRect ) {
|
|
289
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );
|
|
290
|
+
// @if CK_DEBUG_DIALOG // }
|
|
291
|
+
if (domRootRect) {
|
|
292
|
+
const leftCoordinate = this.locale.contentLanguageDirection === 'ltr' ?
|
|
293
|
+
domRootRect.right - dialogRect.width - defaultOffset :
|
|
294
|
+
domRootRect.left + defaultOffset;
|
|
295
|
+
this.moveTo(leftCoordinate, domRootRect.top + defaultOffset);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
this._moveOffScreen();
|
|
299
|
+
}
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case DialogViewPosition.EDITOR_CENTER: {
|
|
303
|
+
if (domRootRect) {
|
|
304
|
+
this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), Math.round(domRootRect.top + domRootRect.height / 2 - dialogRect.height / 2));
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
this._moveOffScreen();
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
case DialogViewPosition.SCREEN_CENTER: {
|
|
312
|
+
this.moveTo(Math.round((viewportRect.width - dialogRect.width) / 2), Math.round((viewportRect.height - dialogRect.height) / 2));
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
case DialogViewPosition.EDITOR_TOP_CENTER: {
|
|
316
|
+
// @if CK_DEBUG_DIALOG // if ( domRootRect ) {
|
|
317
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );
|
|
318
|
+
// @if CK_DEBUG_DIALOG // }
|
|
319
|
+
if (domRootRect) {
|
|
320
|
+
this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.top + defaultOffset);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
this._moveOffScreen();
|
|
324
|
+
}
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case DialogViewPosition.EDITOR_BOTTOM_CENTER: {
|
|
328
|
+
// @if CK_DEBUG_DIALOG // if ( domRootRect ) {
|
|
329
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );
|
|
330
|
+
// @if CK_DEBUG_DIALOG // }
|
|
331
|
+
if (domRootRect) {
|
|
332
|
+
this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.bottom - dialogRect.height - defaultOffset);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
this._moveOffScreen();
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
case DialogViewPosition.EDITOR_ABOVE_CENTER: {
|
|
340
|
+
// @if CK_DEBUG_DIALOG // if ( domRootRect ) {
|
|
341
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );
|
|
342
|
+
// @if CK_DEBUG_DIALOG // }
|
|
343
|
+
if (domRootRect) {
|
|
344
|
+
this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.top - dialogRect.height - defaultOffset);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
this._moveOffScreen();
|
|
348
|
+
}
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
case DialogViewPosition.EDITOR_BELOW_CENTER: {
|
|
352
|
+
// @if CK_DEBUG_DIALOG // if ( domRootRect ) {
|
|
353
|
+
// @if CK_DEBUG_DIALOG // RectDrawer.draw( domRootRect, { outlineColor: 'red', zIndex: 9999999 }, 'DOM ROOT' );
|
|
354
|
+
// @if CK_DEBUG_DIALOG // }
|
|
355
|
+
if (domRootRect) {
|
|
356
|
+
this.moveTo(Math.round(domRootRect.left + domRootRect.width / 2 - dialogRect.width / 2), domRootRect.bottom + defaultOffset);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
this._moveOffScreen();
|
|
360
|
+
}
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Calculates the visible DOM root part.
|
|
367
|
+
*/
|
|
368
|
+
_getVisibleDomRootRect(viewportRect) {
|
|
369
|
+
let visibleDomRootRect = new Rect(this._getCurrentDomRoot()).getVisible();
|
|
370
|
+
if (!visibleDomRootRect) {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
visibleDomRootRect = viewportRect.getIntersection(visibleDomRootRect);
|
|
375
|
+
if (!visibleDomRootRect) {
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return visibleDomRootRect;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Calculates the dialog element rect.
|
|
383
|
+
*/
|
|
384
|
+
_getDialogRect() {
|
|
385
|
+
return new Rect(this.element.firstElementChild);
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Calculates the viewport rect.
|
|
389
|
+
*/
|
|
390
|
+
_getViewportRect() {
|
|
391
|
+
return getConstrainedViewportRect(this._getViewportOffset());
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Collects all focusable elements inside the dialog parts
|
|
395
|
+
* and adds them to the focus tracker and focus cycler.
|
|
396
|
+
*/
|
|
397
|
+
_updateFocusCyclableItems() {
|
|
398
|
+
const focusables = [];
|
|
399
|
+
if (this.contentView) {
|
|
400
|
+
for (const child of this.contentView.children) {
|
|
401
|
+
if (isFocusable(child)) {
|
|
402
|
+
focusables.push(child);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (this.actionsView) {
|
|
407
|
+
focusables.push(this.actionsView);
|
|
408
|
+
}
|
|
409
|
+
if (this.closeButtonView) {
|
|
410
|
+
focusables.push(this.closeButtonView);
|
|
411
|
+
}
|
|
412
|
+
focusables.forEach(focusable => {
|
|
413
|
+
this._focusables.add(focusable);
|
|
414
|
+
this.focusTracker.add(focusable.element);
|
|
415
|
+
if (isViewWithFocusCycler(focusable)) {
|
|
416
|
+
this.listenTo(focusable.focusCycler, 'forwardCycle', evt => {
|
|
417
|
+
this._focusCycler.focusNext();
|
|
418
|
+
// Stop the event propagation only if there are more focusables.
|
|
419
|
+
if (this._focusCycler.next !== this._focusCycler.focusables.get(this._focusCycler.current)) {
|
|
420
|
+
evt.stop();
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
this.listenTo(focusable.focusCycler, 'backwardCycle', evt => {
|
|
424
|
+
this._focusCycler.focusPrevious();
|
|
425
|
+
// Stop the event propagation only if there are more focusables.
|
|
426
|
+
if (this._focusCycler.previous !== this._focusCycler.focusables.get(this._focusCycler.current)) {
|
|
427
|
+
evt.stop();
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Creates the close button view that is displayed in the header view corner.
|
|
435
|
+
*/
|
|
436
|
+
_createCloseButton() {
|
|
437
|
+
const buttonView = new ButtonView(this.locale);
|
|
438
|
+
const t = this.locale.t;
|
|
439
|
+
buttonView.set({
|
|
440
|
+
label: t('Close'),
|
|
441
|
+
tooltip: true,
|
|
442
|
+
icon: icons.cancel
|
|
443
|
+
});
|
|
444
|
+
buttonView.on('execute', () => this.fire('close', { source: 'closeButton' }));
|
|
445
|
+
return buttonView;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* A default dialog element offset from the reference element (e.g. editor editable area).
|
|
450
|
+
*/
|
|
451
|
+
DialogView.defaultOffset = 15;
|
|
452
|
+
export default DialogView;
|
|
453
|
+
// Returns a viewport `Rect` shrunk by the viewport offset config from all sides.
|
|
454
|
+
// TODO: This is a duplicate from position.ts module. It should either be exported there or land somewhere in utils.
|
|
455
|
+
function getConstrainedViewportRect(viewportOffset) {
|
|
456
|
+
viewportOffset = Object.assign({ top: 0, bottom: 0, left: 0, right: 0 }, viewportOffset);
|
|
457
|
+
const viewportRect = new Rect(global.window);
|
|
458
|
+
viewportRect.top += viewportOffset.top;
|
|
459
|
+
viewportRect.height -= viewportOffset.top;
|
|
460
|
+
viewportRect.bottom -= viewportOffset.bottom;
|
|
461
|
+
viewportRect.height -= viewportOffset.bottom;
|
|
462
|
+
viewportRect.left += viewportOffset.left;
|
|
463
|
+
viewportRect.right -= viewportOffset.right;
|
|
464
|
+
viewportRect.width -= viewportOffset.left + viewportOffset.right;
|
|
465
|
+
return viewportRect;
|
|
466
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/button/dropdownbutton
|
|
7
7
|
*/
|
|
8
|
-
import type Button from '../../button/button';
|
|
9
|
-
import type ViewCollection from '../../viewcollection';
|
|
8
|
+
import type Button from '../../button/button.js';
|
|
9
|
+
import type ViewCollection from '../../viewcollection.js';
|
|
10
10
|
/**
|
|
11
11
|
* The dropdown button interface.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/button/dropdownbuttonview
|
|
7
7
|
*/
|
|
8
|
-
import ButtonView from '../../button/buttonview';
|
|
9
|
-
import type DropdownButton from './dropdownbutton';
|
|
10
|
-
import IconView from '../../icon/iconview';
|
|
8
|
+
import ButtonView from '../../button/buttonview.js';
|
|
9
|
+
import type DropdownButton from './dropdownbutton.js';
|
|
10
|
+
import IconView from '../../icon/iconview.js';
|
|
11
11
|
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* The default dropdown button view class.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/button/dropdownbuttonview
|
|
7
7
|
*/
|
|
8
|
-
import ButtonView from '../../button/buttonview';
|
|
9
|
-
import IconView from '../../icon/iconview';
|
|
8
|
+
import ButtonView from '../../button/buttonview.js';
|
|
9
|
+
import IconView from '../../icon/iconview.js';
|
|
10
10
|
import dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';
|
|
11
11
|
/**
|
|
12
12
|
* The default dropdown button view class.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/button/splitbuttonview
|
|
7
7
|
*/
|
|
8
|
-
import View from '../../view';
|
|
9
|
-
import ButtonView from '../../button/buttonview';
|
|
10
|
-
import type ViewCollection from '../../viewcollection';
|
|
11
|
-
import type Button from '../../button/button';
|
|
12
|
-
import type DropdownButton from './dropdownbutton';
|
|
13
|
-
import type { FocusableView } from '../../focuscycler';
|
|
8
|
+
import View from '../../view.js';
|
|
9
|
+
import ButtonView from '../../button/buttonview.js';
|
|
10
|
+
import type ViewCollection from '../../viewcollection.js';
|
|
11
|
+
import type Button from '../../button/button.js';
|
|
12
|
+
import type DropdownButton from './dropdownbutton.js';
|
|
13
|
+
import type { FocusableView } from '../../focuscycler.js';
|
|
14
14
|
import { KeystrokeHandler, FocusTracker, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
15
15
|
import '../../../theme/components/dropdown/splitbutton.css';
|
|
16
16
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/button/splitbuttonview
|
|
7
7
|
*/
|
|
8
|
-
import View from '../../view';
|
|
9
|
-
import ButtonView from '../../button/buttonview';
|
|
8
|
+
import View from '../../view.js';
|
|
9
|
+
import ButtonView from '../../button/buttonview.js';
|
|
10
10
|
import { KeystrokeHandler, FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';
|
|
12
12
|
import '../../../theme/components/dropdown/splitbutton.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/dropdownpanelview
|
|
7
7
|
*/
|
|
8
|
-
import View from '../view';
|
|
9
|
-
import type ViewCollection from '../viewcollection';
|
|
10
|
-
import type DropdownPanelFocusable from './dropdownpanelfocusable';
|
|
8
|
+
import View from '../view.js';
|
|
9
|
+
import type ViewCollection from '../viewcollection.js';
|
|
10
|
+
import type DropdownPanelFocusable from './dropdownpanelfocusable.js';
|
|
11
11
|
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* The dropdown panel view class.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/dropdownpanelview
|
|
7
7
|
*/
|
|
8
|
-
import View from '../view';
|
|
8
|
+
import View from '../view.js';
|
|
9
9
|
import { logWarning } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* The dropdown panel view class.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/dropdown/dropdownview
|
|
7
7
|
*/
|
|
8
|
-
import View from '../view';
|
|
9
|
-
import type { default as DropdownButton } from './button/dropdownbutton';
|
|
10
|
-
import type { default as DropdownPanelView, PanelPosition } from './dropdownpanelview';
|
|
11
|
-
import type { FocusableView } from '../focuscycler';
|
|
12
|
-
import type ListView from '../list/listview';
|
|
13
|
-
import type ToolbarView from '../toolbar/toolbarview';
|
|
8
|
+
import View from '../view.js';
|
|
9
|
+
import type { default as DropdownButton } from './button/dropdownbutton.js';
|
|
10
|
+
import type { default as DropdownPanelView, PanelPosition } from './dropdownpanelview.js';
|
|
11
|
+
import type { FocusableView } from '../focuscycler.js';
|
|
12
|
+
import type ListView from '../list/listview.js';
|
|
13
|
+
import type ToolbarView from '../toolbar/toolbarview.js';
|
|
14
14
|
import { KeystrokeHandler, FocusTracker, type Locale, type PositioningFunction } from '@ckeditor/ckeditor5-utils';
|
|
15
15
|
import '../../theme/components/dropdown/dropdown.css';
|
|
16
16
|
/**
|
|
@@ -283,7 +283,7 @@ export default class DropdownView extends View<HTMLDivElement> {
|
|
|
283
283
|
* [ Button ]
|
|
284
284
|
* ```
|
|
285
285
|
*
|
|
286
|
-
* Positioning functions are compatible with {@link module:utils/dom/position~
|
|
286
|
+
* Positioning functions are compatible with {@link module:utils/dom/position~DomPoint}.
|
|
287
287
|
*
|
|
288
288
|
* The name that position function returns will be reflected in dropdown panel's class that
|
|
289
289
|
* controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
|