@ckeditor/ckeditor5-editor-multi-root 45.2.1 → 46.0.0-alpha.1
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/build/editor-multi-root.js +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/augmentation.d.ts +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +3 -1
- package/src/multirooteditor.d.ts +10 -10
- package/src/multirooteditor.js +6 -6
- package/src/multirooteditorui.d.ts +2 -2
- package/src/multirooteditorui.js +3 -3
- package/src/multirooteditoruiview.d.ts +1 -1
- package/src/multirooteditoruiview.js +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-multi-root",
|
3
|
-
"version": "
|
3
|
+
"version": "46.0.0-alpha.1",
|
4
4
|
"description": "Multi-root editor implementation for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,12 +12,12 @@
|
|
12
12
|
"type": "module",
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"@ckeditor/ckeditor5-core": "
|
16
|
-
"@ckeditor/ckeditor5-engine": "
|
17
|
-
"@ckeditor/ckeditor5-ui": "
|
18
|
-
"@ckeditor/ckeditor5-utils": "
|
19
|
-
"ckeditor5": "
|
20
|
-
"es-toolkit": "1.
|
15
|
+
"@ckeditor/ckeditor5-core": "46.0.0-alpha.1",
|
16
|
+
"@ckeditor/ckeditor5-engine": "46.0.0-alpha.1",
|
17
|
+
"@ckeditor/ckeditor5-ui": "46.0.0-alpha.1",
|
18
|
+
"@ckeditor/ckeditor5-utils": "46.0.0-alpha.1",
|
19
|
+
"ckeditor5": "46.0.0-alpha.1",
|
20
|
+
"es-toolkit": "1.39.5"
|
21
21
|
},
|
22
22
|
"author": "CKSource (http://cksource.com/)",
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/augmentation.d.ts
CHANGED
@@ -59,7 +59,7 @@ declare module '@ckeditor/ckeditor5-core' {
|
|
59
59
|
* ```
|
60
60
|
*
|
61
61
|
* You can react to root attributes changes by listening to
|
62
|
-
* {@link module:engine/model/document~
|
62
|
+
* {@link module:engine/model/document~ModelDocument#event:change:data document `change:data` event}:
|
63
63
|
*
|
64
64
|
* ```ts
|
65
65
|
* editor.model.document.on( 'change:data', () => {
|
package/src/index.d.ts
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
/**
|
6
6
|
* @module editor-multi-root
|
7
7
|
*/
|
8
|
-
export {
|
9
|
-
export
|
8
|
+
export { MultiRootEditor } from './multirooteditor.js';
|
9
|
+
export { MultiRootEditorUI } from './multirooteditorui.js';
|
10
|
+
export { MultiRootEditorUIView } from './multirooteditoruiview.js';
|
11
|
+
export type { RootAttributes, AddRootEvent, DetachRootEvent, LoadRootEvent, AddRootOptions, LoadRootOptions } from './multirooteditor.js';
|
10
12
|
import './augmentation.js';
|
package/src/index.js
CHANGED
@@ -5,5 +5,7 @@
|
|
5
5
|
/**
|
6
6
|
* @module editor-multi-root
|
7
7
|
*/
|
8
|
-
export {
|
8
|
+
export { MultiRootEditor } from './multirooteditor.js';
|
9
|
+
export { MultiRootEditorUI } from './multirooteditorui.js';
|
10
|
+
export { MultiRootEditorUIView } from './multirooteditoruiview.js';
|
9
11
|
import './augmentation.js';
|
package/src/multirooteditor.d.ts
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
*/
|
8
8
|
import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
|
9
9
|
import { type DecoratedMethodEvent } from 'ckeditor5/src/utils.js';
|
10
|
-
import MultiRootEditorUI from './multirooteditorui.js';
|
11
|
-
import { type
|
10
|
+
import { MultiRootEditorUI } from './multirooteditorui.js';
|
11
|
+
import { type ModelRootElement } from 'ckeditor5/src/engine.js';
|
12
12
|
/**
|
13
13
|
* The multi-root editor implementation.
|
14
14
|
*
|
@@ -23,7 +23,7 @@ import { type RootElement } from 'ckeditor5/src/engine.js';
|
|
23
23
|
*
|
24
24
|
* Note that you will need to attach the editor toolbar to your web page manually, in a desired place, after the editor is initialized.
|
25
25
|
*/
|
26
|
-
export
|
26
|
+
export declare class MultiRootEditor extends Editor {
|
27
27
|
/**
|
28
28
|
* @inheritDoc
|
29
29
|
*/
|
@@ -167,7 +167,7 @@ export default class MultiRootEditor extends Editor {
|
|
167
167
|
*
|
168
168
|
* After a root is detached all its children are removed, all markers inside it are removed, and whenever something is inserted to it,
|
169
169
|
* it is automatically removed as well. Finally, a detached root is not returned by
|
170
|
-
* {@link module:engine/model/document~
|
170
|
+
* {@link module:engine/model/document~ModelDocument#getRootNames} by default.
|
171
171
|
*
|
172
172
|
* It is possible to re-add a previously detached root calling {@link #addRoot}.
|
173
173
|
*
|
@@ -222,14 +222,14 @@ export default class MultiRootEditor extends Editor {
|
|
222
222
|
* @param label The accessible label text describing the editable to the assistive technologies.
|
223
223
|
* @returns The created DOM element. Append it in a desired place in your application.
|
224
224
|
*/
|
225
|
-
createEditable(root:
|
225
|
+
createEditable(root: ModelRootElement, placeholder?: string, label?: string): HTMLElement;
|
226
226
|
/**
|
227
227
|
* Detaches the DOM editable element that was attached to the given root.
|
228
228
|
*
|
229
229
|
* @param root Root for which the editable element should be detached.
|
230
230
|
* @returns The DOM element that was detached. You may want to remove it from your application DOM structure.
|
231
231
|
*/
|
232
|
-
detachEditable(root:
|
232
|
+
detachEditable(root: ModelRootElement): HTMLElement;
|
233
233
|
/**
|
234
234
|
* Loads a root that has previously been declared in {@link module:core/editor/editorconfig~EditorConfig#lazyRoots `lazyRoots`}
|
235
235
|
* configuration option.
|
@@ -252,7 +252,7 @@ export default class MultiRootEditor extends Editor {
|
|
252
252
|
*
|
253
253
|
* When a root becomes loaded, it will be treated by the editor as though it was just added. This, among others, means that all
|
254
254
|
* related events and mechanisms will be fired, including {@link ~MultiRootEditor#event:addRoot `addRoot` event},
|
255
|
-
* {@link module:engine/model/document~
|
255
|
+
* {@link module:engine/model/document~ModelDocument#event:change `model.Document` `change` event}, model post-fixers and conversion.
|
256
256
|
*
|
257
257
|
* Until the root becomes loaded, all above mechanisms are suppressed.
|
258
258
|
*
|
@@ -302,7 +302,7 @@ export default class MultiRootEditor extends Editor {
|
|
302
302
|
getRootAttributes(rootName: string): RootAttributes;
|
303
303
|
/**
|
304
304
|
* Registers given string as a root attribute key. Registered root attributes are added to
|
305
|
-
* {@link module:engine/model/schema~
|
305
|
+
* {@link module:engine/model/schema~ModelSchema schema}, and also returned by
|
306
306
|
* {@link ~MultiRootEditor#getRootAttributes `getRootAttributes()`} and
|
307
307
|
* {@link ~MultiRootEditor#getRootsAttributes `getRootsAttributes()`}.
|
308
308
|
*
|
@@ -498,7 +498,7 @@ export default class MultiRootEditor extends Editor {
|
|
498
498
|
*/
|
499
499
|
export type AddRootEvent = {
|
500
500
|
name: 'addRoot';
|
501
|
-
args: [root:
|
501
|
+
args: [root: ModelRootElement];
|
502
502
|
};
|
503
503
|
/**
|
504
504
|
* Fired whenever a root is {@link ~MultiRootEditor#detachRoot detached} from the editor model.
|
@@ -514,7 +514,7 @@ export type AddRootEvent = {
|
|
514
514
|
*/
|
515
515
|
export type DetachRootEvent = {
|
516
516
|
name: 'detachRoot';
|
517
|
-
args: [root:
|
517
|
+
args: [root: ModelRootElement];
|
518
518
|
};
|
519
519
|
/**
|
520
520
|
* Event fired when {@link ~MultiRootEditor#loadRoot} method is called.
|
package/src/multirooteditor.js
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
*/
|
8
8
|
import { Editor, secureSourceElement } from 'ckeditor5/src/core.js';
|
9
9
|
import { CKEditorError, getDataFromElement, setDataInElement, logWarning } from 'ckeditor5/src/utils.js';
|
10
|
-
import MultiRootEditorUI from './multirooteditorui.js';
|
11
|
-
import MultiRootEditorUIView from './multirooteditoruiview.js';
|
10
|
+
import { MultiRootEditorUI } from './multirooteditorui.js';
|
11
|
+
import { MultiRootEditorUIView } from './multirooteditoruiview.js';
|
12
12
|
import { isElement as _isElement } from 'es-toolkit/compat';
|
13
13
|
/**
|
14
14
|
* The multi-root editor implementation.
|
@@ -24,7 +24,7 @@ import { isElement as _isElement } from 'es-toolkit/compat';
|
|
24
24
|
*
|
25
25
|
* Note that you will need to attach the editor toolbar to your web page manually, in a desired place, after the editor is initialized.
|
26
26
|
*/
|
27
|
-
export
|
27
|
+
export class MultiRootEditor extends Editor {
|
28
28
|
/**
|
29
29
|
* @inheritDoc
|
30
30
|
*/
|
@@ -359,7 +359,7 @@ export default class MultiRootEditor extends Editor {
|
|
359
359
|
*
|
360
360
|
* After a root is detached all its children are removed, all markers inside it are removed, and whenever something is inserted to it,
|
361
361
|
* it is automatically removed as well. Finally, a detached root is not returned by
|
362
|
-
* {@link module:engine/model/document~
|
362
|
+
* {@link module:engine/model/document~ModelDocument#getRootNames} by default.
|
363
363
|
*
|
364
364
|
* It is possible to re-add a previously detached root calling {@link #addRoot}.
|
365
365
|
*
|
@@ -462,7 +462,7 @@ export default class MultiRootEditor extends Editor {
|
|
462
462
|
*
|
463
463
|
* When a root becomes loaded, it will be treated by the editor as though it was just added. This, among others, means that all
|
464
464
|
* related events and mechanisms will be fired, including {@link ~MultiRootEditor#event:addRoot `addRoot` event},
|
465
|
-
* {@link module:engine/model/document~
|
465
|
+
* {@link module:engine/model/document~ModelDocument#event:change `model.Document` `change` event}, model post-fixers and conversion.
|
466
466
|
*
|
467
467
|
* Until the root becomes loaded, all above mechanisms are suppressed.
|
468
468
|
*
|
@@ -545,7 +545,7 @@ export default class MultiRootEditor extends Editor {
|
|
545
545
|
}
|
546
546
|
/**
|
547
547
|
* Registers given string as a root attribute key. Registered root attributes are added to
|
548
|
-
* {@link module:engine/model/schema~
|
548
|
+
* {@link module:engine/model/schema~ModelSchema schema}, and also returned by
|
549
549
|
* {@link ~MultiRootEditor#getRootAttributes `getRootAttributes()`} and
|
550
550
|
* {@link ~MultiRootEditor#getRootsAttributes `getRootsAttributes()`}.
|
551
551
|
*
|
@@ -7,11 +7,11 @@
|
|
7
7
|
*/
|
8
8
|
import { type Editor } from 'ckeditor5/src/core.js';
|
9
9
|
import { EditorUI, type InlineEditableUIView } from 'ckeditor5/src/ui.js';
|
10
|
-
import type MultiRootEditorUIView from './multirooteditoruiview.js';
|
10
|
+
import { type MultiRootEditorUIView } from './multirooteditoruiview.js';
|
11
11
|
/**
|
12
12
|
* The multi-root editor UI class.
|
13
13
|
*/
|
14
|
-
export
|
14
|
+
export declare class MultiRootEditorUI extends EditorUI {
|
15
15
|
/**
|
16
16
|
* The main (top–most) view of the editor UI.
|
17
17
|
*/
|
package/src/multirooteditorui.js
CHANGED
@@ -3,11 +3,11 @@
|
|
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';
|
6
|
-
import {
|
6
|
+
import { enableViewPlaceholder } from 'ckeditor5/src/engine.js';
|
7
7
|
/**
|
8
8
|
* The multi-root editor UI class.
|
9
9
|
*/
|
10
|
-
export
|
10
|
+
export class MultiRootEditorUI extends EditorUI {
|
11
11
|
/**
|
12
12
|
* The main (top–most) view of the editor UI.
|
13
13
|
*/
|
@@ -170,7 +170,7 @@ export default class MultiRootEditorUI extends EditorUI {
|
|
170
170
|
if (placeholder) {
|
171
171
|
editingRoot.placeholder = placeholder;
|
172
172
|
}
|
173
|
-
|
173
|
+
enableViewPlaceholder({
|
174
174
|
view: editingView,
|
175
175
|
element: editingRoot,
|
176
176
|
isDirectHost: false,
|
@@ -17,7 +17,7 @@ import type { EditingView } from 'ckeditor5/src/engine.js';
|
|
17
17
|
* See {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`}
|
18
18
|
* to learn more about this view.
|
19
19
|
*/
|
20
|
-
export
|
20
|
+
export declare class MultiRootEditorUIView extends EditorUIView {
|
21
21
|
/**
|
22
22
|
* The main toolbar of the multi-root editor UI.
|
23
23
|
*/
|
@@ -15,7 +15,7 @@ import { EditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ck
|
|
15
15
|
* See {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`}
|
16
16
|
* to learn more about this view.
|
17
17
|
*/
|
18
|
-
export
|
18
|
+
export class MultiRootEditorUIView extends EditorUIView {
|
19
19
|
/**
|
20
20
|
* The main toolbar of the multi-root editor UI.
|
21
21
|
*/
|