@ckeditor/ckeditor5-ui 35.3.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ui",
3
- "version": "35.3.1",
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.3.1",
15
- "@ckeditor/ckeditor5-core": "^35.3.1",
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.3.1",
20
- "@ckeditor/ckeditor5-block-quote": "^35.3.1",
21
- "@ckeditor/ckeditor5-editor-balloon": "^35.3.1",
22
- "@ckeditor/ckeditor5-editor-classic": "^35.3.1",
23
- "@ckeditor/ckeditor5-engine": "^35.3.1",
24
- "@ckeditor/ckeditor5-enter": "^35.3.1",
25
- "@ckeditor/ckeditor5-essentials": "^35.3.1",
26
- "@ckeditor/ckeditor5-font": "^35.3.1",
27
- "@ckeditor/ckeditor5-find-and-replace": "^35.3.1",
28
- "@ckeditor/ckeditor5-heading": "^35.3.1",
29
- "@ckeditor/ckeditor5-image": "^35.3.1",
30
- "@ckeditor/ckeditor5-link": "^35.3.1",
31
- "@ckeditor/ckeditor5-list": "^35.3.1",
32
- "@ckeditor/ckeditor5-mention": "^35.3.1",
33
- "@ckeditor/ckeditor5-paragraph": "^35.3.1",
34
- "@ckeditor/ckeditor5-horizontal-line": "^35.3.1",
35
- "@ckeditor/ckeditor5-table": "^35.3.1",
36
- "@ckeditor/ckeditor5-typing": "^35.3.1",
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
- if (focusedElementIndex === gridItems.length - 1) {
23
- return 0;
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
- if (focusedElementIndex === 0) {
31
- return gridItems.length - 1;
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
  }
@@ -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/src/uid';
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
  /**
@@ -5,13 +5,13 @@
5
5
  /**
6
6
  * @module ui/componentfactory
7
7
  */
8
- import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
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/src/keystrokehandler';
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,7 +6,7 @@
6
6
  * @module ui/dropdown/dropdownpanelview
7
7
  */
8
8
  import View from '../view';
9
- import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
9
+ import { logWarning } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * The dropdown panel view class.
12
12
  *
@@ -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/src/keystrokehandler';
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/src/dom/createelement';
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.
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module ui/focuscycler
7
7
  */
8
- import isVisible from '@ckeditor/ckeditor5-utils/src/dom/isvisible';
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
@@ -68,7 +68,7 @@ export default class FormHeaderView extends View {
68
68
  });
69
69
  const label = new View(locale);
70
70
  label.setTemplate({
71
- tag: 'span',
71
+ tag: 'h2',
72
72
  attributes: {
73
73
  class: [
74
74
  'ck',
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';
@@ -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/src/focustracker';
9
+ import { FocusTracker } from '@ckeditor/ckeditor5-utils';
10
10
  import '../../theme/components/input/input.css';
11
11
  /**
12
12
  * The base input view class.
@@ -6,7 +6,7 @@
6
6
  * @module ui/label/labelview
7
7
  */
8
8
  import View from '../view';
9
- import uid from '@ckeditor/ckeditor5-utils/src/uid';
9
+ import { uid } from '@ckeditor/ckeditor5-utils';
10
10
  import '../../theme/components/label/label.css';
11
11
  /**
12
12
  * The label view class.
@@ -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.
@@ -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/src/keystrokehandler';
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 { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
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 Observable {
15
+ export default class Model extends ObservableMixin() {
16
16
  /**
17
17
  * Creates a new Model instance.
18
18
  *
@@ -6,7 +6,7 @@
6
6
  * @module ui/notification/notification
7
7
  */
8
8
  /* globals window */
9
- import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin';
9
+ import { ContextPlugin } from '@ckeditor/ckeditor5-core';
10
10
  /**
11
11
  * The Notification plugin.
12
12
  *
@@ -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/src/dom/position';
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/src/plugin';
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/src/ckeditorerror';
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';
@@ -55,6 +52,12 @@ const toPx = toUnit('px');
55
52
  * @extends module:core/plugin~Plugin
56
53
  */
57
54
  export default class ContextualBalloon extends Plugin {
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ static get pluginName() {
59
+ return 'ContextualBalloon';
60
+ }
58
61
  /**
59
62
  * @inheritDoc
60
63
  */
@@ -145,12 +148,6 @@ export default class ContextualBalloon extends Plugin {
145
148
  */
146
149
  this._fakePanelsView = this._createFakePanelsView();
147
150
  }
148
- /**
149
- * @inheritDoc
150
- */
151
- static get pluginName() {
152
- return 'ContextualBalloon';
153
- }
154
151
  /**
155
152
  * @inheritDoc
156
153
  */
@@ -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/src/dom/tounit';
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/src/dom/isnode';
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 Emitter {
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/src/plugin';
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.
@@ -25,6 +21,18 @@ const toPx = toUnit('px');
25
21
  * @extends module:core/plugin~Plugin
26
22
  */
27
23
  export default class BalloonToolbar extends Plugin {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName() {
28
+ return 'BalloonToolbar';
29
+ }
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get requires() {
34
+ return [ContextualBalloon];
35
+ }
28
36
  /**
29
37
  * @inheritDoc
30
38
  */
@@ -96,18 +104,6 @@ export default class BalloonToolbar extends Plugin {
96
104
  // It is possible to stop the #show event and this prevent the toolbar from showing up.
97
105
  this.decorate('show');
98
106
  }
99
- /**
100
- * @inheritDoc
101
- */
102
- static get pluginName() {
103
- return 'BalloonToolbar';
104
- }
105
- /**
106
- * @inheritDoc
107
- */
108
- static get requires() {
109
- return [ContextualBalloon];
110
- }
111
107
  /**
112
108
  * @inheritDoc
113
109
  */
@@ -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/src/plugin';
10
- import pilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg';
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
  *
@@ -61,6 +57,12 @@ const toPx = toUnit('px');
61
57
  * @extends module:core/plugin~Plugin
62
58
  */
63
59
  export default class BlockToolbar extends Plugin {
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ static get pluginName() {
64
+ return 'BlockToolbar';
65
+ }
64
66
  /**
65
67
  * @inheritDoc
66
68
  */
@@ -112,12 +114,6 @@ export default class BlockToolbar extends Plugin {
112
114
  callback: () => this._hidePanel()
113
115
  });
114
116
  }
115
- /**
116
- * @inheritDoc
117
- */
118
- static get pluginName() {
119
- return 'BlockToolbar';
120
- }
121
117
  /**
122
118
  * @inheritDoc
123
119
  */
@@ -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('add', this._updateFocusCycleableItems.bind(this));
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('add', this._updateFocusCycleableItems.bind(this));
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 )
@@ -7,8 +7,7 @@
7
7
  */
8
8
  import View from './view';
9
9
  import BalloonPanelView, { generatePositions } from './panel/balloon/balloonpanelview';
10
- import { Emitter as DomEmitter } from '@ckeditor/ckeditor5-utils/src/dom/emittermixin';
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 DomEmitter {
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, new-cap */
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/src/dom/emittermixin';
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(Observable) {
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
  *
@@ -5,8 +5,7 @@
5
5
  /**
6
6
  * @module ui/viewcollection
7
7
  */
8
- import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
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
  *