@ckeditor/ckeditor5-editor-multi-root 41.4.0-alpha.0 → 41.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.
@@ -9,7 +9,7 @@
9
9
  /**
10
10
  * @module editor-multi-root/multirooteditoruiview
11
11
  */
12
- import { EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
12
+ import { EditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';
13
13
  import type { Locale } from 'ckeditor5/src/utils.js';
14
14
  import type { EditingView } from 'ckeditor5/src/engine.js';
15
15
  /**
@@ -26,6 +26,10 @@ export default class MultiRootEditorUIView extends EditorUIView {
26
26
  * The main toolbar of the multi-root editor UI.
27
27
  */
28
28
  readonly toolbar: ToolbarView;
29
+ /**
30
+ * Menu bar view instance.
31
+ */
32
+ readonly menuBarView: MenuBarView;
29
33
  /**
30
34
  * Editable elements used by the multi-root editor UI.
31
35
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-editor-multi-root",
3
- "version": "41.4.0-alpha.0",
3
+ "version": "41.4.0",
4
4
  "description": "Multi-root editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "41.4.0-alpha.0",
15
+ "ckeditor5": "41.4.0",
16
16
  "lodash-es": "4.17.21"
17
17
  },
18
18
  "author": "CKSource (http://cksource.com/)",
@@ -2,7 +2,7 @@
2
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
- import { EditorUI } from 'ckeditor5/src/ui.js';
5
+ import { EditorUI, _initMenuBar } from 'ckeditor5/src/ui.js';
6
6
  import { enablePlaceholder } from 'ckeditor5/src/engine.js';
7
7
  /**
8
8
  * The multi-root editor UI class.
@@ -50,6 +50,7 @@ export default class MultiRootEditorUI extends EditorUI {
50
50
  this.addEditable(editable);
51
51
  }
52
52
  this._initToolbar();
53
+ _initMenuBar(this.editor, this.view.menuBarView);
53
54
  this.fire('ready');
54
55
  }
55
56
  /**
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module editor-multi-root/multirooteditoruiview
7
7
  */
8
- import { EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
8
+ import { EditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';
9
9
  import type { Locale } from 'ckeditor5/src/utils.js';
10
10
  import type { EditingView } from 'ckeditor5/src/engine.js';
11
11
  /**
@@ -22,6 +22,10 @@ export default class MultiRootEditorUIView extends EditorUIView {
22
22
  * The main toolbar of the multi-root editor UI.
23
23
  */
24
24
  readonly toolbar: ToolbarView;
25
+ /**
26
+ * Menu bar view instance.
27
+ */
28
+ readonly menuBarView: MenuBarView;
25
29
  /**
26
30
  * Editable elements used by the multi-root editor UI.
27
31
  */
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module editor-multi-root/multirooteditoruiview
7
7
  */
8
- import { EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
8
+ import { EditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';
9
9
  /**
10
10
  * The multi-root editor UI view. It is a virtual view providing an inline
11
11
  * {@link module:editor-multi-root/multirooteditoruiview~MultiRootEditorUIView#editable} and a
@@ -37,6 +37,7 @@ export default class MultiRootEditorUIView extends EditorUIView {
37
37
  this.toolbar = new ToolbarView(locale, {
38
38
  shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
39
39
  });
40
+ this.menuBarView = new MenuBarView(locale);
40
41
  this.editables = {};
41
42
  // Create `InlineEditableUIView` instance for each editable.
42
43
  for (const editableName of editableNames) {
@@ -57,6 +58,15 @@ export default class MultiRootEditorUIView extends EditorUIView {
57
58
  dir: locale.uiLanguageDirection
58
59
  }
59
60
  });
61
+ this.menuBarView.extendTemplate({
62
+ attributes: {
63
+ class: [
64
+ 'ck-reset_all',
65
+ 'ck-rounded-corners'
66
+ ],
67
+ dir: locale.uiLanguageDirection
68
+ }
69
+ });
60
70
  }
61
71
  /**
62
72
  * Creates an editable instance with given name and registers it in the editor UI view.
@@ -102,5 +112,6 @@ export default class MultiRootEditorUIView extends EditorUIView {
102
112
  super.render();
103
113
  this.registerChild(Object.values(this.editables));
104
114
  this.registerChild(this.toolbar);
115
+ this.registerChild(this.menuBarView);
105
116
  }
106
117
  }