@ckeditor/ckeditor5-ui 35.3.2 → 35.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -21
- package/src/bindings/addkeyboardhandlingforgrid.js +48 -13
- package/src/button/buttonview.js +1 -3
- package/src/colorgrid/colorgridview.js +3 -2
- package/src/componentfactory.js +2 -2
- package/src/dropdown/button/splitbuttonview.js +1 -2
- package/src/dropdown/dropdownpanelview.js +1 -1
- package/src/dropdown/dropdownview.js +1 -3
- package/src/editorui/bodycollection.js +1 -1
- package/src/focuscycler.js +1 -1
- package/src/formheader/formheaderview.js +1 -1
- package/src/index.js +1 -0
- package/src/input/inputview.js +1 -1
- package/src/label/labelview.js +1 -1
- package/src/labeledfield/labeledfieldview.js +1 -1
- package/src/labeledinput/labeledinputview.js +1 -1
- package/src/list/listview.js +1 -2
- package/src/model.js +2 -2
- package/src/notification/notification.js +1 -1
- package/src/panel/balloon/balloonpanelview.js +1 -4
- package/src/panel/balloon/contextualballoon.js +2 -5
- package/src/panel/sticky/stickypanelview.js +1 -2
- package/src/template.js +2 -5
- package/src/toolbar/balloon/balloontoolbar.js +2 -6
- package/src/toolbar/block/blockbuttonview.js +1 -1
- package/src/toolbar/block/blocktoolbar.js +3 -7
- package/src/toolbar/toolbarview.js +4 -12
- package/src/tooltipmanager.js +2 -3
- package/src/view.js +3 -7
- package/src/viewcollection.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ui",
|
|
3
|
-
"version": "35.
|
|
3
|
+
"version": "35.4.0",
|
|
4
4
|
"description": "The UI framework and standard UI library of CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -11,29 +11,29 @@
|
|
|
11
11
|
],
|
|
12
12
|
"main": "src/index.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ckeditor/ckeditor5-utils": "^35.
|
|
15
|
-
"@ckeditor/ckeditor5-core": "^35.
|
|
14
|
+
"@ckeditor/ckeditor5-utils": "^35.4.0",
|
|
15
|
+
"@ckeditor/ckeditor5-core": "^35.4.0",
|
|
16
16
|
"lodash-es": "^4.17.15"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ckeditor/ckeditor5-basic-styles": "^35.
|
|
20
|
-
"@ckeditor/ckeditor5-block-quote": "^35.
|
|
21
|
-
"@ckeditor/ckeditor5-editor-balloon": "^35.
|
|
22
|
-
"@ckeditor/ckeditor5-editor-classic": "^35.
|
|
23
|
-
"@ckeditor/ckeditor5-engine": "^35.
|
|
24
|
-
"@ckeditor/ckeditor5-enter": "^35.
|
|
25
|
-
"@ckeditor/ckeditor5-essentials": "^35.
|
|
26
|
-
"@ckeditor/ckeditor5-font": "^35.
|
|
27
|
-
"@ckeditor/ckeditor5-find-and-replace": "^35.
|
|
28
|
-
"@ckeditor/ckeditor5-heading": "^35.
|
|
29
|
-
"@ckeditor/ckeditor5-image": "^35.
|
|
30
|
-
"@ckeditor/ckeditor5-link": "^35.
|
|
31
|
-
"@ckeditor/ckeditor5-list": "^35.
|
|
32
|
-
"@ckeditor/ckeditor5-mention": "^35.
|
|
33
|
-
"@ckeditor/ckeditor5-paragraph": "^35.
|
|
34
|
-
"@ckeditor/ckeditor5-horizontal-line": "^35.
|
|
35
|
-
"@ckeditor/ckeditor5-table": "^35.
|
|
36
|
-
"@ckeditor/ckeditor5-typing": "^35.
|
|
19
|
+
"@ckeditor/ckeditor5-basic-styles": "^35.4.0",
|
|
20
|
+
"@ckeditor/ckeditor5-block-quote": "^35.4.0",
|
|
21
|
+
"@ckeditor/ckeditor5-editor-balloon": "^35.4.0",
|
|
22
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.4.0",
|
|
23
|
+
"@ckeditor/ckeditor5-engine": "^35.4.0",
|
|
24
|
+
"@ckeditor/ckeditor5-enter": "^35.4.0",
|
|
25
|
+
"@ckeditor/ckeditor5-essentials": "^35.4.0",
|
|
26
|
+
"@ckeditor/ckeditor5-font": "^35.4.0",
|
|
27
|
+
"@ckeditor/ckeditor5-find-and-replace": "^35.4.0",
|
|
28
|
+
"@ckeditor/ckeditor5-heading": "^35.4.0",
|
|
29
|
+
"@ckeditor/ckeditor5-image": "^35.4.0",
|
|
30
|
+
"@ckeditor/ckeditor5-link": "^35.4.0",
|
|
31
|
+
"@ckeditor/ckeditor5-list": "^35.4.0",
|
|
32
|
+
"@ckeditor/ckeditor5-mention": "^35.4.0",
|
|
33
|
+
"@ckeditor/ckeditor5-paragraph": "^35.4.0",
|
|
34
|
+
"@ckeditor/ckeditor5-horizontal-line": "^35.4.0",
|
|
35
|
+
"@ckeditor/ckeditor5-table": "^35.4.0",
|
|
36
|
+
"@ckeditor/ckeditor5-typing": "^35.4.0",
|
|
37
37
|
"typescript": "^4.8.4",
|
|
38
38
|
"webpack": "^5.58.1",
|
|
39
39
|
"webpack-cli": "^4.9.0"
|
|
@@ -15,24 +15,19 @@
|
|
|
15
15
|
* @param {module:ui/viewcollection~ViewCollection} options.gridItems A collection of grid items.
|
|
16
16
|
* @param {Number|Function} options.numberOfColumns Number of columns in the grid. Can be specified as a function that returns
|
|
17
17
|
* the number (e.g. for responsive grids).
|
|
18
|
+
* @param {String|undefined} options.uiLanguageDirection String of ui language direction.
|
|
18
19
|
*/
|
|
19
|
-
export default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns }) {
|
|
20
|
+
export default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }) {
|
|
20
21
|
const getNumberOfColumns = typeof numberOfColumns === 'number' ? () => numberOfColumns : numberOfColumns;
|
|
21
22
|
keystrokeHandler.set('arrowright', getGridItemFocuser((focusedElementIndex, gridItems) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
else {
|
|
26
|
-
return focusedElementIndex + 1;
|
|
27
|
-
}
|
|
23
|
+
return uiLanguageDirection === 'rtl' ?
|
|
24
|
+
getLeftElementIndex(focusedElementIndex, gridItems.length) :
|
|
25
|
+
getRightElementIndex(focusedElementIndex, gridItems.length);
|
|
28
26
|
}));
|
|
29
27
|
keystrokeHandler.set('arrowleft', getGridItemFocuser((focusedElementIndex, gridItems) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
else {
|
|
34
|
-
return focusedElementIndex - 1;
|
|
35
|
-
}
|
|
28
|
+
return uiLanguageDirection === 'rtl' ?
|
|
29
|
+
getRightElementIndex(focusedElementIndex, gridItems.length) :
|
|
30
|
+
getLeftElementIndex(focusedElementIndex, gridItems.length);
|
|
36
31
|
}));
|
|
37
32
|
keystrokeHandler.set('arrowup', getGridItemFocuser((focusedElementIndex, gridItems) => {
|
|
38
33
|
let nextIndex = focusedElementIndex - getNumberOfColumns();
|
|
@@ -61,4 +56,44 @@ export default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTrac
|
|
|
61
56
|
evt.preventDefault();
|
|
62
57
|
};
|
|
63
58
|
}
|
|
59
|
+
// Function returning the next index.
|
|
60
|
+
//
|
|
61
|
+
// before: [ ][x][ ] after: [ ][ ][x]
|
|
62
|
+
// index = 1 index = 2
|
|
63
|
+
//
|
|
64
|
+
// If current index is last, function returns first index.
|
|
65
|
+
//
|
|
66
|
+
// before: [ ][ ][x] after: [x][ ][ ]
|
|
67
|
+
// index = 2 index = 0
|
|
68
|
+
//
|
|
69
|
+
// @param {number} [elementIndex] Number of current index.
|
|
70
|
+
// @param {number} [collectionLength] A count of collection items.
|
|
71
|
+
function getRightElementIndex(elementIndex, collectionLength) {
|
|
72
|
+
if (elementIndex === collectionLength - 1) {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return elementIndex + 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Function returning the previous index.
|
|
80
|
+
//
|
|
81
|
+
// before: [ ][x][ ] after: [x][ ][ ]
|
|
82
|
+
// index = 1 index = 0
|
|
83
|
+
//
|
|
84
|
+
// If current index is first, function returns last index.
|
|
85
|
+
//
|
|
86
|
+
// before: [x][ ][ ] after: [ ][ ][x]
|
|
87
|
+
// index = 0 index = 2
|
|
88
|
+
//
|
|
89
|
+
// @param {number} [elementIndex] Number of current index.
|
|
90
|
+
// @param {number} [collectionLength] A count of collection items.
|
|
91
|
+
function getLeftElementIndex(elementIndex, collectionLength) {
|
|
92
|
+
if (elementIndex === 0) {
|
|
93
|
+
return collectionLength - 1;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return elementIndex - 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
64
99
|
}
|
package/src/button/buttonview.js
CHANGED
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
9
|
import IconView from '../icon/iconview';
|
|
10
|
-
import uid from '@ckeditor/ckeditor5-utils
|
|
11
|
-
import { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils/src/keyboard';
|
|
12
|
-
import env from '@ckeditor/ckeditor5-utils/src/env';
|
|
10
|
+
import { env, getEnvKeystrokeText, uid } from '@ckeditor/ckeditor5-utils';
|
|
13
11
|
import '../../theme/components/button/button.css';
|
|
14
12
|
/**
|
|
15
13
|
* The button view class.
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
9
|
import ColorTileView from './colortileview';
|
|
10
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
11
10
|
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
|
|
12
11
|
import addKeyboardHandlingForGrid from '../bindings/addkeyboardhandlingforgrid';
|
|
12
|
+
import { FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
13
13
|
import '../../theme/components/colorgrid/colorgrid.css';
|
|
14
14
|
/**
|
|
15
15
|
* A grid of {@link module:ui/colorgrid/colortile~ColorTileView color tiles}.
|
|
@@ -141,7 +141,8 @@ export default class ColorGridView extends View {
|
|
|
141
141
|
keystrokeHandler: this.keystrokes,
|
|
142
142
|
focusTracker: this.focusTracker,
|
|
143
143
|
gridItems: this.items,
|
|
144
|
-
numberOfColumns: this.columns
|
|
144
|
+
numberOfColumns: this.columns,
|
|
145
|
+
uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
/**
|
package/src/componentfactory.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/componentfactory
|
|
7
7
|
*/
|
|
8
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
8
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
/**
|
|
10
10
|
* A helper class implementing the UI component ({@link module:ui/view~View view}) factory.
|
|
11
11
|
*
|
|
12
12
|
* It allows functions producing specific UI components to be registered under their unique names
|
|
13
13
|
* in the factory. A registered component can be then instantiated by providing its name.
|
|
14
|
-
* Note that names are case insensitive.
|
|
14
|
+
* Note that the names are case insensitive.
|
|
15
15
|
*
|
|
16
16
|
* // The editor provides localization tools for the factory.
|
|
17
17
|
* const factory = new ComponentFactory( editor );
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import View from '../../view';
|
|
9
9
|
import ButtonView from '../../button/buttonview';
|
|
10
|
-
import KeystrokeHandler from '@ckeditor/ckeditor5-utils
|
|
11
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
10
|
+
import { KeystrokeHandler, FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
12
11
|
import dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';
|
|
13
12
|
import '../../../theme/components/dropdown/splitbutton.css';
|
|
14
13
|
/**
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
* @module ui/dropdown/dropdownview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import KeystrokeHandler from '@ckeditor/ckeditor5-utils
|
|
10
|
-
import { FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
import { getOptimalPosition } from '@ckeditor/ckeditor5-utils/src/dom/position';
|
|
9
|
+
import { KeystrokeHandler, FocusTracker, getOptimalPosition } from '@ckeditor/ckeditor5-utils';
|
|
12
10
|
import '../../theme/components/dropdown/dropdown.css';
|
|
13
11
|
/**
|
|
14
12
|
* The dropdown view class. It manages the dropdown button and dropdown panel.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/* globals document */
|
|
9
9
|
import Template from '../template';
|
|
10
10
|
import ViewCollection from '../viewcollection';
|
|
11
|
-
import createElement from '@ckeditor/ckeditor5-utils
|
|
11
|
+
import { createElement } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
|
|
14
14
|
* from the DOM structure of the editor, like panels, icons, etc.
|
package/src/focuscycler.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/focuscycler
|
|
7
7
|
*/
|
|
8
|
-
import isVisible from '@ckeditor/ckeditor5-utils
|
|
8
|
+
import { isVisible } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
/**
|
|
10
10
|
* A utility class that helps cycling over focusable {@link module:ui/view~View views} in a
|
|
11
11
|
* {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the
|
package/src/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { default as SwitchButtonView } from './button/switchbuttonview';
|
|
|
15
15
|
export * from './colorgrid/utils';
|
|
16
16
|
export { default as ColorGridView } from './colorgrid/colorgridview';
|
|
17
17
|
export { default as ColorTileView } from './colorgrid/colortileview';
|
|
18
|
+
export { default as ComponentFactory } from './componentfactory';
|
|
18
19
|
export { default as DropdownButtonView } from './dropdown/button/dropdownbuttonview';
|
|
19
20
|
export { default as SplitButtonView } from './dropdown/button/splitbuttonview';
|
|
20
21
|
export * from './dropdown/utils';
|
package/src/input/inputview.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module ui/input/inputview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils
|
|
9
|
+
import { FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
import '../../theme/components/input/input.css';
|
|
11
11
|
/**
|
|
12
12
|
* The base input view class.
|
package/src/label/labelview.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module ui/labeledfield/labeledfieldview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import uid from '@ckeditor/ckeditor5-utils/src/uid';
|
|
10
9
|
import LabelView from '../label/labelview';
|
|
10
|
+
import { uid } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import '../../theme/components/labeledfield/labeledfieldview.css';
|
|
12
12
|
/**
|
|
13
13
|
* The labeled field view class. It can be used to enhance any view with the following features:
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module ui/labeledinput/labeledinputview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import uid from '@ckeditor/ckeditor5-utils/src/uid';
|
|
10
9
|
import LabelView from '../label/labelview';
|
|
10
|
+
import { uid } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import '../../theme/components/labeledinput/labeledinput.css';
|
|
12
12
|
/**
|
|
13
13
|
* The labeled input view class.
|
package/src/list/listview.js
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* @module ui/list/listview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
10
9
|
import FocusCycler from '../focuscycler';
|
|
11
|
-
import KeystrokeHandler from '@ckeditor/ckeditor5-utils
|
|
10
|
+
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
12
11
|
import '../../theme/components/list/list.css';
|
|
13
12
|
/**
|
|
14
13
|
* The list view class.
|
package/src/model.js
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/model
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
import { extend } from 'lodash-es';
|
|
10
10
|
/**
|
|
11
11
|
* The base MVC model class.
|
|
12
12
|
*
|
|
13
13
|
* @mixes module:utils/observablemixin~ObservableMixin
|
|
14
14
|
*/
|
|
15
|
-
export default class Model extends
|
|
15
|
+
export default class Model extends ObservableMixin() {
|
|
16
16
|
/**
|
|
17
17
|
* Creates a new Model instance.
|
|
18
18
|
*
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
* @module ui/panel/balloon/balloonpanelview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../../view';
|
|
9
|
-
import { getOptimalPosition } from '@ckeditor/ckeditor5-utils
|
|
10
|
-
import isRange from '@ckeditor/ckeditor5-utils/src/dom/isrange';
|
|
11
|
-
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
|
|
12
|
-
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
|
|
9
|
+
import { getOptimalPosition, global, isRange, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
13
10
|
import { isElement } from 'lodash-es';
|
|
14
11
|
import '../../../theme/components/panel/balloonpanel.css';
|
|
15
12
|
const toPx = toUnit('px');
|
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/panel/balloon/contextualballoon
|
|
7
7
|
*/
|
|
8
|
-
import Plugin from '@ckeditor/ckeditor5-core
|
|
8
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
9
|
import BalloonPanelView from './balloonpanelview';
|
|
10
10
|
import View from '../../view';
|
|
11
11
|
import ButtonView from '../../button/buttonview';
|
|
12
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
13
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
14
|
-
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
|
|
15
|
-
import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
|
|
12
|
+
import { CKEditorError, FocusTracker, Rect, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
16
13
|
import prevIcon from '../../../theme/icons/previous-arrow.svg';
|
|
17
14
|
import nextIcon from '../../../theme/icons/next-arrow.svg';
|
|
18
15
|
import '../../../theme/components/panel/balloonrotator.css';
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/panel/sticky/stickypanelview
|
|
7
7
|
*/
|
|
8
|
-
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
|
|
9
8
|
import View from '../../view';
|
|
10
9
|
import Template from '../../template';
|
|
11
|
-
import toUnit from '@ckeditor/ckeditor5-utils
|
|
10
|
+
import { global, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
12
11
|
import '../../../theme/components/panel/stickypanel.css';
|
|
13
12
|
const toPx = toUnit('px');
|
|
14
13
|
/**
|
package/src/template.js
CHANGED
|
@@ -6,13 +6,10 @@
|
|
|
6
6
|
* @module ui/template
|
|
7
7
|
*/
|
|
8
8
|
/* global document */
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
10
|
-
import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
11
9
|
import View from './view';
|
|
12
10
|
import ViewCollection from './viewcollection';
|
|
13
|
-
import isNode from '@ckeditor/ckeditor5-utils
|
|
11
|
+
import { CKEditorError, EmitterMixin, isNode, toArray } from '@ckeditor/ckeditor5-utils';
|
|
14
12
|
import { isObject, cloneDeepWith } from 'lodash-es';
|
|
15
|
-
import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
|
|
16
13
|
const xhtmlNs = 'http://www.w3.org/1999/xhtml';
|
|
17
14
|
/**
|
|
18
15
|
* A basic Template class. It renders a DOM HTML element or text from a
|
|
@@ -50,7 +47,7 @@ const xhtmlNs = 'http://www.w3.org/1999/xhtml';
|
|
|
50
47
|
*
|
|
51
48
|
* @mixes module:utils/emittermixin~EmitterMixin
|
|
52
49
|
*/
|
|
53
|
-
export default class Template extends
|
|
50
|
+
export default class Template extends EmitterMixin() {
|
|
54
51
|
/**
|
|
55
52
|
* Creates an instance of the {@link ~Template} class.
|
|
56
53
|
*
|
|
@@ -5,17 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/toolbar/balloon/balloontoolbar
|
|
7
7
|
*/
|
|
8
|
-
import Plugin from '@ckeditor/ckeditor5-core
|
|
8
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
import { FocusTracker, Rect, ResizeObserver, env, global, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
9
10
|
import ContextualBalloon from '../../panel/balloon/contextualballoon';
|
|
10
11
|
import ToolbarView from '../toolbarview';
|
|
11
12
|
import BalloonPanelView, { generatePositions } from '../../panel/balloon/balloonpanelview';
|
|
12
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
13
|
-
import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
|
|
14
13
|
import normalizeToolbarConfig from '../normalizetoolbarconfig';
|
|
15
14
|
import { debounce } from 'lodash-es';
|
|
16
|
-
import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver';
|
|
17
|
-
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
|
|
18
|
-
import { env, global } from '@ckeditor/ckeditor5-utils';
|
|
19
15
|
const toPx = toUnit('px');
|
|
20
16
|
/**
|
|
21
17
|
* The contextual toolbar.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module ui/toolbar/block/blockbuttonview
|
|
7
7
|
*/
|
|
8
8
|
import ButtonView from '../../button/buttonview';
|
|
9
|
-
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
|
|
10
9
|
import '../../../theme/components/toolbar/blocktoolbar.css';
|
|
10
|
+
import { toUnit } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
const toPx = toUnit('px');
|
|
12
12
|
/**
|
|
13
13
|
* The block button view class.
|
|
@@ -6,19 +6,15 @@
|
|
|
6
6
|
* @module ui/toolbar/block/blocktoolbar
|
|
7
7
|
*/
|
|
8
8
|
/* global window */
|
|
9
|
-
import Plugin from '@ckeditor/ckeditor5-core
|
|
10
|
-
import
|
|
9
|
+
import { Plugin, icons } from '@ckeditor/ckeditor5-core';
|
|
10
|
+
import { Rect, ResizeObserver, getOptimalPosition, env, toUnit } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import BlockButtonView from './blockbuttonview';
|
|
12
12
|
import BalloonPanelView from '../../panel/balloon/balloonpanelview';
|
|
13
13
|
import ToolbarView from '../toolbarview';
|
|
14
14
|
import clickOutsideHandler from '../../bindings/clickoutsidehandler';
|
|
15
|
-
import { getOptimalPosition } from '@ckeditor/ckeditor5-utils/src/dom/position';
|
|
16
|
-
import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
|
|
17
15
|
import normalizeToolbarConfig from '../normalizetoolbarconfig';
|
|
18
|
-
import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver';
|
|
19
|
-
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
|
|
20
|
-
import env from '@ckeditor/ckeditor5-utils/src/env';
|
|
21
16
|
const toPx = toUnit('px');
|
|
17
|
+
const { pilcrow } = icons;
|
|
22
18
|
/**
|
|
23
19
|
* The block toolbar plugin.
|
|
24
20
|
*
|
|
@@ -6,22 +6,16 @@
|
|
|
6
6
|
* @module ui/toolbar/toolbarview
|
|
7
7
|
*/
|
|
8
8
|
import View from '../view';
|
|
9
|
-
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
|
|
10
9
|
import FocusCycler from '../focuscycler';
|
|
11
|
-
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
|
|
12
10
|
import ToolbarSeparatorView from './toolbarseparatorview';
|
|
13
11
|
import ToolbarLineBreakView from './toolbarlinebreakview';
|
|
14
|
-
import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver';
|
|
15
12
|
import preventDefault from '../bindings/preventdefault';
|
|
16
|
-
import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
|
|
17
|
-
import isVisible from '@ckeditor/ckeditor5-utils/src/dom/isvisible';
|
|
18
|
-
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
|
|
19
13
|
import { createDropdown, addToolbarToDropdown } from '../dropdown/utils';
|
|
20
|
-
import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
21
14
|
import normalizeToolbarConfig from './normalizetoolbarconfig';
|
|
15
|
+
import { FocusTracker, KeystrokeHandler, Rect, ResizeObserver, global, isVisible, logWarning } from '@ckeditor/ckeditor5-utils';
|
|
16
|
+
import { icons } from '@ckeditor/ckeditor5-core';
|
|
22
17
|
import { isObject } from 'lodash-es';
|
|
23
18
|
import '../../theme/components/toolbar/toolbar.css';
|
|
24
|
-
import { icons } from '@ckeditor/ckeditor5-core';
|
|
25
19
|
const { threeVerticalDots } = icons;
|
|
26
20
|
const NESTED_TOOLBAR_ICONS = {
|
|
27
21
|
alignLeft: icons.alignLeft,
|
|
@@ -666,11 +660,9 @@ class DynamicGrouping {
|
|
|
666
660
|
// Only those items that were not grouped are visible to the user.
|
|
667
661
|
view.itemsView.children.bindTo(this.ungroupedItems).using(item => item);
|
|
668
662
|
// Make sure all #items visible in the main space of the toolbar are "focuscycleable".
|
|
669
|
-
this.ungroupedItems.on('
|
|
670
|
-
this.ungroupedItems.on('remove', this._updateFocusCycleableItems.bind(this));
|
|
663
|
+
this.ungroupedItems.on('change', this._updateFocusCycleableItems.bind(this));
|
|
671
664
|
// Make sure the #groupedItemsDropdown is also included in cycling when it appears.
|
|
672
|
-
view.children.on('
|
|
673
|
-
view.children.on('remove', this._updateFocusCycleableItems.bind(this));
|
|
665
|
+
view.children.on('change', this._updateFocusCycleableItems.bind(this));
|
|
674
666
|
// ToolbarView#items is dynamic. When an item is added or removed, it should be automatically
|
|
675
667
|
// represented in either grouped or ungrouped items at the right index.
|
|
676
668
|
// In other words #items == concat( #ungroupedItems, #groupedItems )
|
package/src/tooltipmanager.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import View from './view';
|
|
9
9
|
import BalloonPanelView, { generatePositions } from './panel/balloon/balloonpanelview';
|
|
10
|
-
import {
|
|
11
|
-
import { global, isVisible, first, ResizeObserver } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import { DomEmitterMixin, ResizeObserver, first, global, isVisible } from '@ckeditor/ckeditor5-utils';
|
|
12
11
|
import { isElement, debounce } from 'lodash-es';
|
|
13
12
|
import '../theme/components/tooltip/tooltip.css';
|
|
14
13
|
const BALLOON_CLASS = 'ck-tooltip';
|
|
@@ -59,7 +58,7 @@ const BALLOON_CLASS = 'ck-tooltip';
|
|
|
59
58
|
*
|
|
60
59
|
* @mixes module:utils/domemittermixin~DomEmitterMixin
|
|
61
60
|
*/
|
|
62
|
-
export default class TooltipManager extends
|
|
61
|
+
export default class TooltipManager extends DomEmitterMixin() {
|
|
63
62
|
/**
|
|
64
63
|
* Creates an instance of the tooltip manager.
|
|
65
64
|
*
|
package/src/view.js
CHANGED
|
@@ -2,17 +2,13 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, 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
|
-
/* eslint-disable @typescript-eslint/no-invalid-void-type
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
|
6
6
|
/**
|
|
7
7
|
* @module ui/view
|
|
8
8
|
*/
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
10
9
|
import ViewCollection from './viewcollection';
|
|
11
10
|
import Template from './template';
|
|
12
|
-
import DomEmitterMixin from '@ckeditor/ckeditor5-utils
|
|
13
|
-
import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
|
|
14
|
-
import Collection from '@ckeditor/ckeditor5-utils/src/collection';
|
|
15
|
-
import isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';
|
|
11
|
+
import { CKEditorError, Collection, DomEmitterMixin, ObservableMixin, isIterable } from '@ckeditor/ckeditor5-utils';
|
|
16
12
|
import '../theme/globals/globals.css';
|
|
17
13
|
/**
|
|
18
14
|
* The basic view class, which represents an HTML element created out of a
|
|
@@ -79,7 +75,7 @@ import '../theme/globals/globals.css';
|
|
|
79
75
|
*
|
|
80
76
|
* @mixes module:utils/observablemixin~ObservableMixin
|
|
81
77
|
*/
|
|
82
|
-
export default class View extends DomEmitterMixin(
|
|
78
|
+
export default class View extends DomEmitterMixin(ObservableMixin()) {
|
|
83
79
|
/**
|
|
84
80
|
* Creates an instance of the {@link module:ui/view~View} class.
|
|
85
81
|
*
|
package/src/viewcollection.js
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/viewcollection
|
|
7
7
|
*/
|
|
8
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
9
|
-
import Collection from '@ckeditor/ckeditor5-utils/src/collection';
|
|
8
|
+
import { CKEditorError, Collection } from '@ckeditor/ckeditor5-utils';
|
|
10
9
|
/**
|
|
11
10
|
* Collects {@link module:ui/view~View} instances.
|
|
12
11
|
*
|