@ckeditor/ckeditor5-editor-multi-root 44.1.0-alpha.5 → 44.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/build/editor-multi-root.js +2 -2
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +27 -7
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/multirooteditor.d.ts +1 -1
- package/src/multirooteditor.js +1 -1
- package/src/multirooteditorui.d.ts +1 -1
- package/src/multirooteditorui.js +5 -2
- package/src/multirooteditoruiview.d.ts +1 -1
- package/src/multirooteditoruiview.js +1 -1
- package/dist/augmentation.d.ts +0 -94
- package/dist/index.d.ts +0 -14
- package/dist/multirooteditor.d.ts +0 -548
- package/dist/multirooteditorui.d.ts +0 -78
- package/dist/multirooteditoruiview.d.ts +0 -86
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-multi-root",
|
3
|
-
"version": "44.
|
3
|
+
"version": "44.2.0-alpha.0",
|
4
4
|
"description": "Multi-root editor implementation for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,11 +12,11 @@
|
|
12
12
|
"type": "module",
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"@ckeditor/ckeditor5-core": "44.
|
16
|
-
"@ckeditor/ckeditor5-engine": "44.
|
17
|
-
"@ckeditor/ckeditor5-ui": "44.
|
18
|
-
"@ckeditor/ckeditor5-utils": "44.
|
19
|
-
"ckeditor5": "44.
|
15
|
+
"@ckeditor/ckeditor5-core": "44.2.0-alpha.0",
|
16
|
+
"@ckeditor/ckeditor5-engine": "44.2.0-alpha.0",
|
17
|
+
"@ckeditor/ckeditor5-ui": "44.2.0-alpha.0",
|
18
|
+
"@ckeditor/ckeditor5-utils": "44.2.0-alpha.0",
|
19
|
+
"ckeditor5": "44.2.0-alpha.0",
|
20
20
|
"lodash-es": "4.17.21"
|
21
21
|
},
|
22
22
|
"author": "CKSource (http://cksource.com/)",
|
@@ -38,5 +38,25 @@
|
|
38
38
|
"ckeditor5-metadata.json",
|
39
39
|
"CHANGELOG.md"
|
40
40
|
],
|
41
|
-
"types": "src/index.d.ts"
|
41
|
+
"types": "src/index.d.ts",
|
42
|
+
"exports": {
|
43
|
+
".": {
|
44
|
+
"types": "./src/index.d.ts",
|
45
|
+
"import": "./src/index.js",
|
46
|
+
"default": "./src/index.js"
|
47
|
+
},
|
48
|
+
"./dist/*": {
|
49
|
+
"types": "./src/index.d.ts",
|
50
|
+
"import": "./dist/*",
|
51
|
+
"default": "./dist/*"
|
52
|
+
},
|
53
|
+
"./src/*": {
|
54
|
+
"types": "./src/*.d.ts",
|
55
|
+
"import": "./src/*",
|
56
|
+
"default": "./src/*"
|
57
|
+
},
|
58
|
+
"./build/*": "./build/*",
|
59
|
+
"./ckeditor5-metadata.json": "./ckeditor5-metadata.json",
|
60
|
+
"./package.json": "./package.json"
|
61
|
+
}
|
42
62
|
}
|
package/src/augmentation.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
import { type RootAttributes } from './multirooteditor.js';
|
package/src/augmentation.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
export {};
|
package/src/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
package/src/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
package/src/multirooteditor.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
package/src/multirooteditor.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
package/src/multirooteditorui.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
import { EditorUI } from 'ckeditor5/src/ui.js';
|
@@ -115,7 +115,10 @@ export default class MultiRootEditorUI extends EditorUI {
|
|
115
115
|
* @param editable Editable to remove from the editor UI.
|
116
116
|
*/
|
117
117
|
removeEditable(editable) {
|
118
|
-
this.editor.editing.view
|
118
|
+
const editingView = this.editor.editing.view;
|
119
|
+
if (editingView.getDomRoot(editable.name)) {
|
120
|
+
editingView.detachDomRoot(editable.name);
|
121
|
+
}
|
119
122
|
editable.unbind('isFocused');
|
120
123
|
this.removeEditableElement(editable.name);
|
121
124
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
5
|
/**
|
package/dist/augmentation.d.ts
DELETED
@@ -1,94 +0,0 @@
|
|
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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
import { type RootAttributes } from './multirooteditor.js';
|
10
|
-
declare module '@ckeditor/ckeditor5-core' {
|
11
|
-
interface EditorConfig {
|
12
|
-
/**
|
13
|
-
* Initial roots attributes for the document roots.
|
14
|
-
*
|
15
|
-
* **Note: This configuration option is supported only by the
|
16
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor multi-root} editor type.**
|
17
|
-
*
|
18
|
-
* **Note: You must provide full set of attributes for each root. If an attribute is not set on a root, set the value to `null`.
|
19
|
-
* Only provided attribute keys will be returned by
|
20
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor#getRootsAttributes}.**
|
21
|
-
*
|
22
|
-
* Roots attributes hold additional data related to the document roots, in addition to the regular document data (which usually is
|
23
|
-
* HTML). In roots attributes, for each root, you can store arbitrary key-value pairs with attributes connected with that root.
|
24
|
-
* Use it to store any custom data that is specific to your integration or custom features.
|
25
|
-
*
|
26
|
-
* Currently, roots attributes are not used only by any official plugins. This is a mechanism that is prepared for custom features
|
27
|
-
* and non-standard integrations. If you do not provide any custom feature that would use root attributes, you do not need to
|
28
|
-
* handle (save and load) this property.
|
29
|
-
*
|
30
|
-
* ```ts
|
31
|
-
* MultiRootEditor.create(
|
32
|
-
* // Roots for the editor:
|
33
|
-
* {
|
34
|
-
* uid1: document.querySelector( '#uid1' ),
|
35
|
-
* uid2: document.querySelector( '#uid2' ),
|
36
|
-
* uid3: document.querySelector( '#uid3' ),
|
37
|
-
* uid4: document.querySelector( '#uid4' )
|
38
|
-
* },
|
39
|
-
* // Config:
|
40
|
-
* {
|
41
|
-
* rootsAttributes: {
|
42
|
-
* uid1: { order: 20, isLocked: false }, // Third, unlocked.
|
43
|
-
* uid2: { order: 10, isLocked: true }, // Second, locked.
|
44
|
-
* uid3: { order: 30, isLocked: true }, // Fourth, locked.
|
45
|
-
* uid4: { order: 0, isLocked: false } // First, unlocked.
|
46
|
-
* }
|
47
|
-
* }
|
48
|
-
* )
|
49
|
-
* .then( ... )
|
50
|
-
* .catch( ... );
|
51
|
-
* ```
|
52
|
-
*
|
53
|
-
* Note, that the above code snippet is only an example. You need to implement your own features that will use these attributes.
|
54
|
-
*
|
55
|
-
* Roots attributes can be changed the same way as attributes set on other model nodes:
|
56
|
-
*
|
57
|
-
* ```ts
|
58
|
-
* editor.model.change( writer => {
|
59
|
-
* const root = editor.model.getRoot( 'uid3' );
|
60
|
-
*
|
61
|
-
* writer.setAttribute( 'order', 40, root );
|
62
|
-
* } );
|
63
|
-
* ```
|
64
|
-
*
|
65
|
-
* You can react to root attributes changes by listening to
|
66
|
-
* {@link module:engine/model/document~Document#event:change:data document `change:data` event}:
|
67
|
-
*
|
68
|
-
* ```ts
|
69
|
-
* editor.model.document.on( 'change:data', () => {
|
70
|
-
* const changedRoots = editor.model.document.differ.getChangedRoots();
|
71
|
-
*
|
72
|
-
* for ( const change of changedRoots ) {
|
73
|
-
* if ( change.attributes ) {
|
74
|
-
* const root = editor.model.getRoot( change.name );
|
75
|
-
*
|
76
|
-
* // ...
|
77
|
-
* }
|
78
|
-
* }
|
79
|
-
* } );
|
80
|
-
* ```
|
81
|
-
*/
|
82
|
-
rootsAttributes?: Record<string, RootAttributes>;
|
83
|
-
/**
|
84
|
-
* A list of names of all the roots that exist in the document but are not initially loaded by the editor.
|
85
|
-
*
|
86
|
-
* These roots can be loaded at any time after the editor has been initialized, using
|
87
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor#loadRoot `MultiRootEditor#lazyRoot()`}.
|
88
|
-
*
|
89
|
-
* This is useful for handling big documents that contain hundreds of roots, or contain very large roots, which may have
|
90
|
-
* impact editor performance if loaded all at once.
|
91
|
-
*/
|
92
|
-
lazyRoots?: Array<string>;
|
93
|
-
}
|
94
|
-
}
|
package/dist/index.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module editor-multi-root
|
11
|
-
*/
|
12
|
-
export { default as MultiRootEditor } from './multirooteditor.js';
|
13
|
-
export type { RootAttributes, AddRootEvent, DetachRootEvent } from './multirooteditor.js';
|
14
|
-
import './augmentation.js';
|