@ckeditor/ckeditor5-editor-multi-root 41.4.2 → 42.0.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/README.md +8 -2
- package/build/editor-multi-root.js +1 -1
- package/dist/index.js +715 -724
- package/dist/index.js.map +1 -1
- package/dist/types/multirooteditor.d.ts +2 -49
- package/package.json +2 -2
- package/src/multirooteditor.d.ts +2 -49
- package/src/multirooteditor.js +3 -51
@@ -9,13 +9,12 @@
|
|
9
9
|
/**
|
10
10
|
* @module editor-multi-root/multirooteditor
|
11
11
|
*/
|
12
|
-
import { Editor,
|
12
|
+
import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
|
13
13
|
import { type DecoratedMethodEvent } from 'ckeditor5/src/utils.js';
|
14
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
15
14
|
import MultiRootEditorUI from './multirooteditorui.js';
|
16
15
|
import { type RootElement } from 'ckeditor5/src/engine.js';
|
17
16
|
/**
|
18
|
-
* The
|
17
|
+
* The multi-root editor implementation.
|
19
18
|
*
|
20
19
|
* The multi-root editor provides multiple inline editable elements and a toolbar. All editable areas are controlled by one editor
|
21
20
|
* instance, which means that they share common configuration, document ID, or undo stack.
|
@@ -27,22 +26,6 @@ import { type RootElement } from 'ckeditor5/src/engine.js';
|
|
27
26
|
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`} method.
|
28
27
|
*
|
29
28
|
* Note that you will need to attach the editor toolbar to your web page manually, in a desired place, after the editor is initialized.
|
30
|
-
*
|
31
|
-
* # Multi-root editor and multi-root editor build
|
32
|
-
*
|
33
|
-
* The multi-root editor can be used directly from source (if you installed the
|
34
|
-
* [`@ckeditor/ckeditor5-editor-multi-root`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-multi-root) package)
|
35
|
-
* but it is also available in the
|
36
|
-
* {@glink installation/getting-started/predefined-builds#multi-root-editor multi-root editor build}.
|
37
|
-
*
|
38
|
-
* {@glink installation/getting-started/predefined-builds Builds} are ready-to-use editors with plugins bundled in.
|
39
|
-
*
|
40
|
-
* When using the editor from source you need to take care of loading all plugins by yourself
|
41
|
-
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
42
|
-
* Using the editor from source gives much better flexibility and allows for easier customization.
|
43
|
-
*
|
44
|
-
* Read more about initializing the editor from source or as a build in
|
45
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`}.
|
46
29
|
*/
|
47
30
|
export default class MultiRootEditor extends Editor {
|
48
31
|
/**
|
@@ -466,18 +449,6 @@ export default class MultiRootEditor extends Editor {
|
|
466
449
|
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
467
450
|
* customizing plugins, toolbar and more.
|
468
451
|
*
|
469
|
-
* # Using the editor from source
|
470
|
-
*
|
471
|
-
* The code samples listed in the previous sections of this documentation assume that you are using an
|
472
|
-
* {@glink installation/getting-started/predefined-builds editor build}
|
473
|
-
* (for example – `@ckeditor/ckeditor5-build-multi-root`).
|
474
|
-
*
|
475
|
-
* If you want to use the multi-root editor from source (`@ckeditor/ckeditor5-editor-multi-root-editor/src/multirooteditor`),
|
476
|
-
* you need to define the list of
|
477
|
-
* {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
|
478
|
-
* {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
|
479
|
-
* source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
|
480
|
-
*
|
481
452
|
* @param sourceElementsOrData The DOM elements that will be the source for the created editor
|
482
453
|
* or the editor's initial data. The editor will initialize multiple roots with names according to the keys in the passed object.
|
483
454
|
*
|
@@ -494,24 +465,6 @@ export default class MultiRootEditor extends Editor {
|
|
494
465
|
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
495
466
|
*/
|
496
467
|
static create(sourceElementsOrData: Record<string, HTMLElement> | Record<string, string>, config?: EditorConfig): Promise<MultiRootEditor>;
|
497
|
-
/**
|
498
|
-
* The {@link module:core/context~Context} class.
|
499
|
-
*
|
500
|
-
* Exposed as static editor field for easier access in editor builds.
|
501
|
-
*/
|
502
|
-
static Context: typeof Context;
|
503
|
-
/**
|
504
|
-
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
505
|
-
*
|
506
|
-
* Exposed as static editor field for easier access in editor builds.
|
507
|
-
*/
|
508
|
-
static EditorWatchdog: typeof EditorWatchdog;
|
509
|
-
/**
|
510
|
-
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
511
|
-
*
|
512
|
-
* Exposed as static editor field for easier access in editor builds.
|
513
|
-
*/
|
514
|
-
static ContextWatchdog: typeof ContextWatchdog;
|
515
468
|
/**
|
516
469
|
* @internal
|
517
470
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-multi-root",
|
3
|
-
"version": "
|
3
|
+
"version": "42.0.0-alpha.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": "
|
15
|
+
"ckeditor5": "42.0.0-alpha.0",
|
16
16
|
"lodash-es": "4.17.21"
|
17
17
|
},
|
18
18
|
"author": "CKSource (http://cksource.com/)",
|
package/src/multirooteditor.d.ts
CHANGED
@@ -5,13 +5,12 @@
|
|
5
5
|
/**
|
6
6
|
* @module editor-multi-root/multirooteditor
|
7
7
|
*/
|
8
|
-
import { Editor,
|
8
|
+
import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
|
9
9
|
import { type DecoratedMethodEvent } from 'ckeditor5/src/utils.js';
|
10
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
11
10
|
import MultiRootEditorUI from './multirooteditorui.js';
|
12
11
|
import { type RootElement } from 'ckeditor5/src/engine.js';
|
13
12
|
/**
|
14
|
-
* The
|
13
|
+
* The multi-root editor implementation.
|
15
14
|
*
|
16
15
|
* The multi-root editor provides multiple inline editable elements and a toolbar. All editable areas are controlled by one editor
|
17
16
|
* instance, which means that they share common configuration, document ID, or undo stack.
|
@@ -23,22 +22,6 @@ import { type RootElement } from 'ckeditor5/src/engine.js';
|
|
23
22
|
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`} method.
|
24
23
|
*
|
25
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.
|
26
|
-
*
|
27
|
-
* # Multi-root editor and multi-root editor build
|
28
|
-
*
|
29
|
-
* The multi-root editor can be used directly from source (if you installed the
|
30
|
-
* [`@ckeditor/ckeditor5-editor-multi-root`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-multi-root) package)
|
31
|
-
* but it is also available in the
|
32
|
-
* {@glink installation/getting-started/predefined-builds#multi-root-editor multi-root editor build}.
|
33
|
-
*
|
34
|
-
* {@glink installation/getting-started/predefined-builds Builds} are ready-to-use editors with plugins bundled in.
|
35
|
-
*
|
36
|
-
* When using the editor from source you need to take care of loading all plugins by yourself
|
37
|
-
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
38
|
-
* Using the editor from source gives much better flexibility and allows for easier customization.
|
39
|
-
*
|
40
|
-
* Read more about initializing the editor from source or as a build in
|
41
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`}.
|
42
25
|
*/
|
43
26
|
export default class MultiRootEditor extends Editor {
|
44
27
|
/**
|
@@ -462,18 +445,6 @@ export default class MultiRootEditor extends Editor {
|
|
462
445
|
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
463
446
|
* customizing plugins, toolbar and more.
|
464
447
|
*
|
465
|
-
* # Using the editor from source
|
466
|
-
*
|
467
|
-
* The code samples listed in the previous sections of this documentation assume that you are using an
|
468
|
-
* {@glink installation/getting-started/predefined-builds editor build}
|
469
|
-
* (for example – `@ckeditor/ckeditor5-build-multi-root`).
|
470
|
-
*
|
471
|
-
* If you want to use the multi-root editor from source (`@ckeditor/ckeditor5-editor-multi-root-editor/src/multirooteditor`),
|
472
|
-
* you need to define the list of
|
473
|
-
* {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
|
474
|
-
* {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
|
475
|
-
* source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
|
476
|
-
*
|
477
448
|
* @param sourceElementsOrData The DOM elements that will be the source for the created editor
|
478
449
|
* or the editor's initial data. The editor will initialize multiple roots with names according to the keys in the passed object.
|
479
450
|
*
|
@@ -490,24 +461,6 @@ export default class MultiRootEditor extends Editor {
|
|
490
461
|
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
491
462
|
*/
|
492
463
|
static create(sourceElementsOrData: Record<string, HTMLElement> | Record<string, string>, config?: EditorConfig): Promise<MultiRootEditor>;
|
493
|
-
/**
|
494
|
-
* The {@link module:core/context~Context} class.
|
495
|
-
*
|
496
|
-
* Exposed as static editor field for easier access in editor builds.
|
497
|
-
*/
|
498
|
-
static Context: typeof Context;
|
499
|
-
/**
|
500
|
-
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
501
|
-
*
|
502
|
-
* Exposed as static editor field for easier access in editor builds.
|
503
|
-
*/
|
504
|
-
static EditorWatchdog: typeof EditorWatchdog;
|
505
|
-
/**
|
506
|
-
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
507
|
-
*
|
508
|
-
* Exposed as static editor field for easier access in editor builds.
|
509
|
-
*/
|
510
|
-
static ContextWatchdog: typeof ContextWatchdog;
|
511
464
|
/**
|
512
465
|
* @internal
|
513
466
|
*/
|
package/src/multirooteditor.js
CHANGED
@@ -5,14 +5,13 @@
|
|
5
5
|
/**
|
6
6
|
* @module editor-multi-root/multirooteditor
|
7
7
|
*/
|
8
|
-
import { Editor,
|
8
|
+
import { Editor, secureSourceElement } from 'ckeditor5/src/core.js';
|
9
9
|
import { CKEditorError, getDataFromElement, setDataInElement, logWarning } from 'ckeditor5/src/utils.js';
|
10
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
11
10
|
import MultiRootEditorUI from './multirooteditorui.js';
|
12
11
|
import MultiRootEditorUIView from './multirooteditoruiview.js';
|
13
12
|
import { isElement as _isElement } from 'lodash-es';
|
14
13
|
/**
|
15
|
-
* The
|
14
|
+
* The multi-root editor implementation.
|
16
15
|
*
|
17
16
|
* The multi-root editor provides multiple inline editable elements and a toolbar. All editable areas are controlled by one editor
|
18
17
|
* instance, which means that they share common configuration, document ID, or undo stack.
|
@@ -24,24 +23,8 @@ import { isElement as _isElement } from 'lodash-es';
|
|
24
23
|
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`} method.
|
25
24
|
*
|
26
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.
|
27
|
-
*
|
28
|
-
* # Multi-root editor and multi-root editor build
|
29
|
-
*
|
30
|
-
* The multi-root editor can be used directly from source (if you installed the
|
31
|
-
* [`@ckeditor/ckeditor5-editor-multi-root`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-multi-root) package)
|
32
|
-
* but it is also available in the
|
33
|
-
* {@glink installation/getting-started/predefined-builds#multi-root-editor multi-root editor build}.
|
34
|
-
*
|
35
|
-
* {@glink installation/getting-started/predefined-builds Builds} are ready-to-use editors with plugins bundled in.
|
36
|
-
*
|
37
|
-
* When using the editor from source you need to take care of loading all plugins by yourself
|
38
|
-
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
39
|
-
* Using the editor from source gives much better flexibility and allows for easier customization.
|
40
|
-
*
|
41
|
-
* Read more about initializing the editor from source or as a build in
|
42
|
-
* {@link module:editor-multi-root/multirooteditor~MultiRootEditor.create `MultiRootEditor.create()`}.
|
43
26
|
*/
|
44
|
-
class MultiRootEditor extends Editor {
|
27
|
+
export default class MultiRootEditor extends Editor {
|
45
28
|
/**
|
46
29
|
* Creates an instance of the multi-root editor.
|
47
30
|
*
|
@@ -735,18 +718,6 @@ class MultiRootEditor extends Editor {
|
|
735
718
|
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
736
719
|
* customizing plugins, toolbar and more.
|
737
720
|
*
|
738
|
-
* # Using the editor from source
|
739
|
-
*
|
740
|
-
* The code samples listed in the previous sections of this documentation assume that you are using an
|
741
|
-
* {@glink installation/getting-started/predefined-builds editor build}
|
742
|
-
* (for example – `@ckeditor/ckeditor5-build-multi-root`).
|
743
|
-
*
|
744
|
-
* If you want to use the multi-root editor from source (`@ckeditor/ckeditor5-editor-multi-root-editor/src/multirooteditor`),
|
745
|
-
* you need to define the list of
|
746
|
-
* {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
|
747
|
-
* {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
|
748
|
-
* source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
|
749
|
-
*
|
750
721
|
* @param sourceElementsOrData The DOM elements that will be the source for the created editor
|
751
722
|
* or the editor's initial data. The editor will initialize multiple roots with names according to the keys in the passed object.
|
752
723
|
*
|
@@ -819,25 +790,6 @@ class MultiRootEditor extends Editor {
|
|
819
790
|
}
|
820
791
|
}
|
821
792
|
}
|
822
|
-
/**
|
823
|
-
* The {@link module:core/context~Context} class.
|
824
|
-
*
|
825
|
-
* Exposed as static editor field for easier access in editor builds.
|
826
|
-
*/
|
827
|
-
MultiRootEditor.Context = Context;
|
828
|
-
/**
|
829
|
-
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
830
|
-
*
|
831
|
-
* Exposed as static editor field for easier access in editor builds.
|
832
|
-
*/
|
833
|
-
MultiRootEditor.EditorWatchdog = EditorWatchdog;
|
834
|
-
/**
|
835
|
-
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
836
|
-
*
|
837
|
-
* Exposed as static editor field for easier access in editor builds.
|
838
|
-
*/
|
839
|
-
MultiRootEditor.ContextWatchdog = ContextWatchdog;
|
840
|
-
export default MultiRootEditor;
|
841
793
|
function getInitialData(sourceElementOrData) {
|
842
794
|
return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
|
843
795
|
}
|