@ckeditor/ckeditor5-engine 35.3.2 → 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 +22 -22
- package/src/controller/datacontroller.js +5 -7
- package/src/controller/editingcontroller.js +2 -3
- package/src/conversion/conversion.js +1 -2
- package/src/conversion/downcastdispatcher.js +2 -2
- package/src/conversion/downcasthelpers.js +1 -2
- package/src/conversion/mapper.js +2 -3
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.js +2 -3
- package/src/conversion/upcasthelpers.js +2 -2
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/htmldataprocessor.js +2 -1
- package/src/dataprocessor/xmldataprocessor.js +5 -1
- package/src/dev-utils/model.js +2 -2
- package/src/index.js +11 -2
- package/src/model/batch.js +1 -1
- package/src/model/document.js +2 -5
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.js +1 -6
- package/src/model/element.js +1 -1
- package/src/model/liveposition.js +1 -3
- package/src/model/liverange.js +1 -2
- package/src/model/markercollection.js +2 -4
- package/src/model/model.js +2 -3
- package/src/model/node.js +1 -3
- package/src/model/nodelist.js +1 -2
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.js +1 -2
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.js +1 -2
- package/src/model/position.js +1 -2
- package/src/model/range.js +1 -2
- package/src/model/schema.js +9 -10
- package/src/model/selection.js +1 -4
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.js +1 -1
- package/src/model/utils/findoptimalinsertionrange.js +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/insertobject.js +21 -19
- package/src/model/utils/modifyselection.js +1 -1
- package/src/model/writer.js +1 -2
- package/src/view/attributeelement.js +1 -1
- package/src/view/document.js +18 -4
- package/src/view/documentfragment.js +1 -3
- package/src/view/documentselection.js +1 -2
- package/src/view/domconverter.js +1 -6
- package/src/view/downcastwriter.js +1 -2
- package/src/view/editableelement.js +1 -2
- package/src/view/element.js +1 -3
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.js +1 -2
- package/src/view/matcher.js +1 -1
- package/src/view/node.js +1 -4
- package/src/view/observer/bubblingemittermixin.js +2 -5
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.js +5 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/observer.js +2 -2
- package/src/view/observer/selectionobserver.js +9 -2
- package/src/view/observer/tabobserver.js +1 -1
- package/src/view/position.js +1 -2
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.js +15 -11
- package/src/view/selection.js +1 -5
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.js +1 -1
- package/src/view/uielement.js +1 -2
- package/src/view/view.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "35.
|
|
3
|
+
"version": "35.4.0",
|
|
4
4
|
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
],
|
|
24
24
|
"main": "src/index.js",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ckeditor/ckeditor5-utils": "^35.
|
|
26
|
+
"@ckeditor/ckeditor5-utils": "^35.4.0",
|
|
27
27
|
"lodash-es": "^4.17.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ckeditor/ckeditor5-basic-styles": "^35.
|
|
31
|
-
"@ckeditor/ckeditor5-block-quote": "^35.
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "^35.
|
|
33
|
-
"@ckeditor/ckeditor5-cloud-services": "^35.
|
|
34
|
-
"@ckeditor/ckeditor5-core": "^35.
|
|
35
|
-
"@ckeditor/ckeditor5-editor-classic": "^35.
|
|
36
|
-
"@ckeditor/ckeditor5-enter": "^35.
|
|
37
|
-
"@ckeditor/ckeditor5-essentials": "^35.
|
|
38
|
-
"@ckeditor/ckeditor5-heading": "^35.
|
|
39
|
-
"@ckeditor/ckeditor5-image": "^35.
|
|
40
|
-
"@ckeditor/ckeditor5-link": "^35.
|
|
41
|
-
"@ckeditor/ckeditor5-list": "^35.
|
|
42
|
-
"@ckeditor/ckeditor5-mention": "^35.
|
|
43
|
-
"@ckeditor/ckeditor5-paragraph": "^35.
|
|
44
|
-
"@ckeditor/ckeditor5-table": "^35.
|
|
45
|
-
"@ckeditor/ckeditor5-theme-lark": "^35.
|
|
46
|
-
"@ckeditor/ckeditor5-typing": "^35.
|
|
47
|
-
"@ckeditor/ckeditor5-ui": "^35.
|
|
48
|
-
"@ckeditor/ckeditor5-undo": "^35.
|
|
49
|
-
"@ckeditor/ckeditor5-widget": "^35.
|
|
30
|
+
"@ckeditor/ckeditor5-basic-styles": "^35.4.0",
|
|
31
|
+
"@ckeditor/ckeditor5-block-quote": "^35.4.0",
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "^35.4.0",
|
|
33
|
+
"@ckeditor/ckeditor5-cloud-services": "^35.4.0",
|
|
34
|
+
"@ckeditor/ckeditor5-core": "^35.4.0",
|
|
35
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.4.0",
|
|
36
|
+
"@ckeditor/ckeditor5-enter": "^35.4.0",
|
|
37
|
+
"@ckeditor/ckeditor5-essentials": "^35.4.0",
|
|
38
|
+
"@ckeditor/ckeditor5-heading": "^35.4.0",
|
|
39
|
+
"@ckeditor/ckeditor5-image": "^35.4.0",
|
|
40
|
+
"@ckeditor/ckeditor5-link": "^35.4.0",
|
|
41
|
+
"@ckeditor/ckeditor5-list": "^35.4.0",
|
|
42
|
+
"@ckeditor/ckeditor5-mention": "^35.4.0",
|
|
43
|
+
"@ckeditor/ckeditor5-paragraph": "^35.4.0",
|
|
44
|
+
"@ckeditor/ckeditor5-table": "^35.4.0",
|
|
45
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.4.0",
|
|
46
|
+
"@ckeditor/ckeditor5-typing": "^35.4.0",
|
|
47
|
+
"@ckeditor/ckeditor5-ui": "^35.4.0",
|
|
48
|
+
"@ckeditor/ckeditor5-undo": "^35.4.0",
|
|
49
|
+
"@ckeditor/ckeditor5-widget": "^35.4.0",
|
|
50
50
|
"typescript": "^4.8.4",
|
|
51
51
|
"webpack": "^5.58.1",
|
|
52
52
|
"webpack-cli": "^4.9.0"
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/controller/datacontroller
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
10
|
-
import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
8
|
+
import { CKEditorError, EmitterMixin, ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
11
9
|
import Mapper from '../conversion/mapper';
|
|
12
10
|
import DowncastDispatcher from '../conversion/downcastdispatcher';
|
|
13
11
|
import { insertAttributesAndChildren, insertText } from '../conversion/downcasthelpers';
|
|
@@ -36,7 +34,7 @@ import HtmlDataProcessor from '../dataprocessor/htmldataprocessor';
|
|
|
36
34
|
*
|
|
37
35
|
* @mixes module:utils/emittermixin~EmitterMixin
|
|
38
36
|
*/
|
|
39
|
-
export default class DataController extends
|
|
37
|
+
export default class DataController extends EmitterMixin() {
|
|
40
38
|
/**
|
|
41
39
|
* Creates a data controller instance.
|
|
42
40
|
*
|
|
@@ -127,9 +125,9 @@ export default class DataController extends Emitter {
|
|
|
127
125
|
this.upcastDispatcher.on('text', convertText(), { priority: 'lowest' });
|
|
128
126
|
this.upcastDispatcher.on('element', convertToModelFragment(), { priority: 'lowest' });
|
|
129
127
|
this.upcastDispatcher.on('documentFragment', convertToModelFragment(), { priority: 'lowest' });
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
ObservableMixin().prototype.decorate.call(this, 'init');
|
|
129
|
+
ObservableMixin().prototype.decorate.call(this, 'set');
|
|
130
|
+
ObservableMixin().prototype.decorate.call(this, 'get');
|
|
133
131
|
// Fire the `ready` event when the initialization has completed. Such low-level listener offers the possibility
|
|
134
132
|
// to plug into the initialization pipeline without interrupting the initialization flow.
|
|
135
133
|
this.on('init', () => {
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/controller/editingcontroller
|
|
7
7
|
*/
|
|
8
|
+
import { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
8
9
|
import RootEditableElement from '../view/rooteditableelement';
|
|
9
10
|
import View from '../view/view';
|
|
10
11
|
import Mapper from '../conversion/mapper';
|
|
11
12
|
import DowncastDispatcher from '../conversion/downcastdispatcher';
|
|
12
13
|
import { clearAttributes, convertCollapsedSelection, convertRangeSelection, insertAttributesAndChildren, insertText, remove } from '../conversion/downcasthelpers';
|
|
13
|
-
import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
|
|
14
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
15
14
|
import { convertSelectionChange } from '../conversion/upcasthelpers';
|
|
16
15
|
// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
|
|
17
16
|
/**
|
|
@@ -21,7 +20,7 @@ import { convertSelectionChange } from '../conversion/upcasthelpers';
|
|
|
21
20
|
*
|
|
22
21
|
* @mixes module:utils/observablemixin~ObservableMixin
|
|
23
22
|
*/
|
|
24
|
-
export default class EditingController extends
|
|
23
|
+
export default class EditingController extends ObservableMixin() {
|
|
25
24
|
/**
|
|
26
25
|
* Creates an editing controller instance.
|
|
27
26
|
*
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/conversion/conversion
|
|
7
7
|
*/
|
|
8
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
8
|
+
import { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
import UpcastHelpers from './upcasthelpers';
|
|
10
10
|
import DowncastHelpers from './downcasthelpers';
|
|
11
|
-
import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
|
|
12
11
|
/**
|
|
13
12
|
* A utility class that helps add converters to upcast and downcast dispatchers.
|
|
14
13
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import Consumable from './modelconsumable';
|
|
9
9
|
import Range from '../model/range';
|
|
10
|
-
import {
|
|
10
|
+
import { EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
/**
|
|
12
12
|
* The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting
|
|
13
13
|
* to changes in the model and firing a set of events. The callbacks listening to these events are called converters. The
|
|
@@ -97,7 +97,7 @@ import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
|
97
97
|
* conversionApi.writer.insert( viewPosition, viewElement );
|
|
98
98
|
* } );
|
|
99
99
|
*/
|
|
100
|
-
export default class DowncastDispatcher extends
|
|
100
|
+
export default class DowncastDispatcher extends EmitterMixin() {
|
|
101
101
|
/**
|
|
102
102
|
* Creates a downcast dispatcher instance.
|
|
103
103
|
*
|
|
@@ -15,8 +15,7 @@ import ModelPosition from '../model/position';
|
|
|
15
15
|
import ViewAttributeElement from '../view/attributeelement';
|
|
16
16
|
import ConversionHelpers from './conversionhelpers';
|
|
17
17
|
import { cloneDeep } from 'lodash-es';
|
|
18
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
19
|
-
import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
|
|
18
|
+
import { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';
|
|
20
19
|
/**
|
|
21
20
|
* Downcast conversion helper functions.
|
|
22
21
|
*
|
package/src/conversion/mapper.js
CHANGED
|
@@ -10,8 +10,7 @@ import ModelRange from '../model/range';
|
|
|
10
10
|
import ViewPosition from '../view/position';
|
|
11
11
|
import ViewRange from '../view/range';
|
|
12
12
|
import ViewText from '../view/text';
|
|
13
|
-
import {
|
|
14
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
13
|
+
import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
15
14
|
/**
|
|
16
15
|
* Maps elements, positions and markers between the {@link module:engine/view/document~Document view} and
|
|
17
16
|
* the {@link module:engine/model/model model}.
|
|
@@ -32,7 +31,7 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
32
31
|
* stop the event.
|
|
33
32
|
* @mixes module:utils/emittermixin~EmitterMixin
|
|
34
33
|
*/
|
|
35
|
-
export default class Mapper extends
|
|
34
|
+
export default class Mapper extends EmitterMixin() {
|
|
36
35
|
/**
|
|
37
36
|
* Creates an instance of the mapper.
|
|
38
37
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module engine/conversion/modelconsumable
|
|
7
7
|
*/
|
|
8
8
|
import TextProxy from '../model/textproxy';
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
9
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.
|
|
12
12
|
*
|
|
@@ -10,8 +10,7 @@ import ModelRange from '../model/range';
|
|
|
10
10
|
import ModelPosition from '../model/position';
|
|
11
11
|
import { SchemaContext } from '../model/schema'; // eslint-disable-line no-duplicate-imports
|
|
12
12
|
import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';
|
|
13
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
14
|
-
import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
13
|
+
import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
15
14
|
/**
|
|
16
15
|
* Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
|
|
17
16
|
* converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
|
|
@@ -107,7 +106,7 @@ import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
|
107
106
|
* @fires text
|
|
108
107
|
* @fires documentFragment
|
|
109
108
|
*/
|
|
110
|
-
export default class UpcastDispatcher extends
|
|
109
|
+
export default class UpcastDispatcher extends EmitterMixin() {
|
|
111
110
|
/**
|
|
112
111
|
* Creates an upcast dispatcher that operates using the passed API.
|
|
113
112
|
*
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Matcher from '../view/matcher';
|
|
6
6
|
import ConversionHelpers from './conversionhelpers';
|
|
7
|
-
import { cloneDeep } from 'lodash-es';
|
|
8
|
-
import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
|
|
9
7
|
import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';
|
|
8
|
+
import { priorities } from '@ckeditor/ckeditor5-utils';
|
|
9
|
+
import { cloneDeep } from 'lodash-es';
|
|
10
10
|
/**
|
|
11
11
|
* Contains the {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
|
|
12
12
|
* {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/conversion/viewconsumable
|
|
7
7
|
*/
|
|
8
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
8
9
|
import { isArray } from 'lodash-es';
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
10
10
|
/**
|
|
11
11
|
* Class used for handling consumption of view {@link module:engine/view/element~Element elements},
|
|
12
12
|
* {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
|
|
@@ -21,6 +21,7 @@ export default class HtmlDataProcessor {
|
|
|
21
21
|
* @param {module:engine/view/document~Document} document The view document instance.
|
|
22
22
|
*/
|
|
23
23
|
constructor(document) {
|
|
24
|
+
this.skipComments = true;
|
|
24
25
|
/**
|
|
25
26
|
* A DOM parser instance used to parse an HTML string to an HTML document.
|
|
26
27
|
*
|
|
@@ -63,7 +64,7 @@ export default class HtmlDataProcessor {
|
|
|
63
64
|
// Convert input HTML data to DOM DocumentFragment.
|
|
64
65
|
const domFragment = this._toDom(data);
|
|
65
66
|
// Convert DOM DocumentFragment to view DocumentFragment.
|
|
66
|
-
return this.domConverter.domToView(domFragment);
|
|
67
|
+
return this.domConverter.domToView(domFragment, { skipComments: this.skipComments });
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
|
|
@@ -25,6 +25,7 @@ export default class XmlDataProcessor {
|
|
|
25
25
|
* @param {Array.<String>} [options.namespaces=[]] A list of namespaces allowed to use in the XML input.
|
|
26
26
|
*/
|
|
27
27
|
constructor(document, options = {}) {
|
|
28
|
+
this.skipComments = true;
|
|
28
29
|
/**
|
|
29
30
|
* A list of namespaces allowed to use in the XML input.
|
|
30
31
|
*
|
|
@@ -78,7 +79,10 @@ export default class XmlDataProcessor {
|
|
|
78
79
|
// Convert input XML data to DOM DocumentFragment.
|
|
79
80
|
const domFragment = this._toDom(data);
|
|
80
81
|
// Convert DOM DocumentFragment to view DocumentFragment.
|
|
81
|
-
return this.domConverter.domToView(domFragment, {
|
|
82
|
+
return this.domConverter.domToView(domFragment, {
|
|
83
|
+
keepOriginalCase: true,
|
|
84
|
+
skipComments: this.skipComments
|
|
85
|
+
});
|
|
82
86
|
}
|
|
83
87
|
/**
|
|
84
88
|
* Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
|
package/src/dev-utils/model.js
CHANGED
|
@@ -21,11 +21,11 @@ import ViewRootEditableElement from '../view/rooteditableelement';
|
|
|
21
21
|
import { parse as viewParse, stringify as viewStringify } from '../../src/dev-utils/view';
|
|
22
22
|
import Mapper from '../conversion/mapper';
|
|
23
23
|
import { convertCollapsedSelection, convertRangeSelection, insertAttributesAndChildren, insertElement, insertText, insertUIElement, wrap } from '../conversion/downcasthelpers';
|
|
24
|
-
import { isPlainObject } from 'lodash-es';
|
|
25
|
-
import toMap from '@ckeditor/ckeditor5-utils/src/tomap';
|
|
26
24
|
import { StylesProcessor } from '../view/stylesmap';
|
|
27
25
|
import DowncastDispatcher from '../conversion/downcastdispatcher';
|
|
28
26
|
import UpcastDispatcher from '../conversion/upcastdispatcher';
|
|
27
|
+
import { toMap } from '@ckeditor/ckeditor5-utils';
|
|
28
|
+
import { isPlainObject } from 'lodash-es';
|
|
29
29
|
/**
|
|
30
30
|
* Writes the content of a model {@link module:engine/model/document~Document document} to an HTML-like string.
|
|
31
31
|
*
|
package/src/index.js
CHANGED
|
@@ -6,15 +6,18 @@
|
|
|
6
6
|
* @module engine
|
|
7
7
|
*/
|
|
8
8
|
export * from './view/placeholder';
|
|
9
|
+
// Controller.
|
|
9
10
|
export { default as EditingController } from './controller/editingcontroller';
|
|
10
11
|
export { default as DataController } from './controller/datacontroller';
|
|
12
|
+
// Conversion.
|
|
11
13
|
export { default as Conversion } from './conversion/conversion';
|
|
14
|
+
// DataProcessor.
|
|
12
15
|
export { default as HtmlDataProcessor } from './dataprocessor/htmldataprocessor';
|
|
13
16
|
export { default as InsertOperation } from './model/operation/insertoperation';
|
|
14
17
|
export { default as MarkerOperation } from './model/operation/markeroperation';
|
|
15
18
|
export { default as OperationFactory } from './model/operation/operationfactory';
|
|
16
19
|
export { transformSets } from './model/operation/transform';
|
|
17
|
-
|
|
20
|
+
// Model.
|
|
18
21
|
export { default as DocumentSelection } from './model/documentselection';
|
|
19
22
|
export { default as Range } from './model/range';
|
|
20
23
|
export { default as LiveRange } from './model/liverange';
|
|
@@ -26,7 +29,9 @@ export { default as Position } from './model/position';
|
|
|
26
29
|
export { default as DocumentFragment } from './model/documentfragment';
|
|
27
30
|
export { default as History } from './model/history';
|
|
28
31
|
export { default as Text } from './model/text';
|
|
29
|
-
export {
|
|
32
|
+
export { findOptimalInsertionRange } from './model/utils/findoptimalinsertionrange';
|
|
33
|
+
// View.
|
|
34
|
+
export { default as DataTransfer } from './view/datatransfer';
|
|
30
35
|
export { default as DomConverter } from './view/domconverter';
|
|
31
36
|
export { default as Renderer } from './view/renderer';
|
|
32
37
|
export { default as View } from './view/view';
|
|
@@ -34,12 +39,14 @@ export { default as ViewDocument } from './view/document';
|
|
|
34
39
|
export { default as ViewText } from './view/text';
|
|
35
40
|
export { default as ViewElement } from './view/element';
|
|
36
41
|
export { default as ViewContainerElement } from './view/containerelement';
|
|
42
|
+
export { default as ViewEditableElement } from './view/editableelement';
|
|
37
43
|
export { default as ViewAttributeElement } from './view/attributeelement';
|
|
38
44
|
export { default as ViewEmptyElement } from './view/emptyelement';
|
|
39
45
|
export { default as ViewRawElement } from './view/rawelement';
|
|
40
46
|
export { default as ViewUIElement } from './view/uielement';
|
|
41
47
|
export { default as ViewDocumentFragment } from './view/documentfragment';
|
|
42
48
|
export { getFillerOffset } from './view/containerelement';
|
|
49
|
+
// View / Observer.
|
|
43
50
|
export { default as Observer } from './view/observer/observer';
|
|
44
51
|
export { default as ClickObserver } from './view/observer/clickobserver';
|
|
45
52
|
export { default as DomEventObserver } from './view/observer/domeventobserver';
|
|
@@ -47,7 +54,9 @@ export { default as MouseObserver } from './view/observer/mouseobserver';
|
|
|
47
54
|
export { default as DowncastWriter } from './view/downcastwriter';
|
|
48
55
|
export { default as UpcastWriter } from './view/upcastwriter';
|
|
49
56
|
export { default as Matcher } from './view/matcher';
|
|
57
|
+
export { default as BubblingEventInfo } from './view/observer/bubblingeventinfo';
|
|
50
58
|
export { default as DomEventData } from './view/observer/domeventdata';
|
|
59
|
+
// View / Styles.
|
|
51
60
|
export { StylesProcessor } from './view/stylesmap';
|
|
52
61
|
export * from './view/styles/background';
|
|
53
62
|
export * from './view/styles/border';
|
package/src/model/batch.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/batch
|
|
7
7
|
*/
|
|
8
|
-
import { logWarning } from '@ckeditor/ckeditor5-utils
|
|
8
|
+
import { logWarning } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
/**
|
|
10
10
|
* A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations
|
|
11
11
|
* grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want
|
package/src/model/document.js
CHANGED
|
@@ -9,10 +9,7 @@ import Differ from './differ';
|
|
|
9
9
|
import DocumentSelection from './documentselection';
|
|
10
10
|
import History from './history';
|
|
11
11
|
import RootElement from './rootelement';
|
|
12
|
-
import Collection from '@ckeditor/ckeditor5-utils
|
|
13
|
-
import { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
14
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
15
|
-
import { isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils/src/unicode';
|
|
12
|
+
import { CKEditorError, Collection, EmitterMixin, isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils';
|
|
16
13
|
import { clone } from 'lodash-es';
|
|
17
14
|
// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
|
|
18
15
|
const graveyardName = '$graveyard';
|
|
@@ -32,7 +29,7 @@ const graveyardName = '$graveyard';
|
|
|
32
29
|
*
|
|
33
30
|
* @mixes module:utils/emittermixin~EmitterMixin
|
|
34
31
|
*/
|
|
35
|
-
export default class Document extends
|
|
32
|
+
export default class Document extends EmitterMixin() {
|
|
36
33
|
/**
|
|
37
34
|
* Creates an empty document instance with no {@link #roots} (other than
|
|
38
35
|
* the {@link #graveyard graveyard root}).
|
|
@@ -10,7 +10,7 @@ import Element from './element';
|
|
|
10
10
|
import NodeList from './nodelist';
|
|
11
11
|
import Text from './text';
|
|
12
12
|
import TextProxy from './textproxy';
|
|
13
|
-
import isIterable from '@ckeditor/ckeditor5-utils
|
|
13
|
+
import { isIterable } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
// @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );
|
|
15
15
|
/**
|
|
16
16
|
* DocumentFragment represents a part of model which does not have a common root but its top-level nodes
|
|
@@ -2,7 +2,6 @@
|
|
|
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 new-cap */
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/documentselection
|
|
8
7
|
*/
|
|
@@ -11,11 +10,7 @@ import LiveRange from './liverange';
|
|
|
11
10
|
import Selection from './selection';
|
|
12
11
|
import Text from './text';
|
|
13
12
|
import TextProxy from './textproxy';
|
|
14
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
15
|
-
import Collection from '@ckeditor/ckeditor5-utils/src/collection';
|
|
16
|
-
import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
17
|
-
import toMap from '@ckeditor/ckeditor5-utils/src/tomap';
|
|
18
|
-
import uid from '@ckeditor/ckeditor5-utils/src/uid';
|
|
13
|
+
import { CKEditorError, Collection, EmitterMixin, toMap, uid } from '@ckeditor/ckeditor5-utils';
|
|
19
14
|
const storePrefix = 'selection:';
|
|
20
15
|
/**
|
|
21
16
|
* `DocumentSelection` is a special selection which is used as the
|
package/src/model/element.js
CHANGED
|
@@ -9,7 +9,7 @@ import Node from './node';
|
|
|
9
9
|
import NodeList from './nodelist';
|
|
10
10
|
import Text from './text';
|
|
11
11
|
import TextProxy from './textproxy';
|
|
12
|
-
import isIterable from '@ckeditor/ckeditor5-utils
|
|
12
|
+
import { isIterable } from '@ckeditor/ckeditor5-utils';
|
|
13
13
|
// @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );
|
|
14
14
|
/**
|
|
15
15
|
* Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and
|
|
@@ -2,13 +2,11 @@
|
|
|
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 new-cap */
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/liveposition
|
|
8
7
|
*/
|
|
9
8
|
import Position from './position';
|
|
10
|
-
import EmitterMixin from '@ckeditor/ckeditor5-utils
|
|
11
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
9
|
+
import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
12
10
|
/**
|
|
13
11
|
* `LivePosition` is a type of {@link module:engine/model/position~Position Position}
|
|
14
12
|
* that updates itself as {@link module:engine/model/document~Document document}
|
package/src/model/liverange.js
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
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 new-cap */
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/liverange
|
|
8
7
|
*/
|
|
9
8
|
import Range from './range';
|
|
10
|
-
import EmitterMixin from '@ckeditor/ckeditor5-utils
|
|
9
|
+
import { EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
11
10
|
/**
|
|
12
11
|
* `LiveRange` is a type of {@link module:engine/model/range~Range Range}
|
|
13
12
|
* that updates itself as {@link module:engine/model/document~Document document}
|
|
@@ -2,14 +2,12 @@
|
|
|
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 new-cap */
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/markercollection
|
|
8
7
|
*/
|
|
9
8
|
import TypeCheckable from './typecheckable';
|
|
10
9
|
import LiveRange from './liverange';
|
|
11
|
-
import
|
|
12
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
10
|
+
import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
13
11
|
/**
|
|
14
12
|
* The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
|
|
15
13
|
* It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
|
|
@@ -24,7 +22,7 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
|
24
22
|
*
|
|
25
23
|
* @see module:engine/model/markercollection~Marker
|
|
26
24
|
*/
|
|
27
|
-
export default class MarkerCollection extends
|
|
25
|
+
export default class MarkerCollection extends EmitterMixin() {
|
|
28
26
|
/**
|
|
29
27
|
* Creates a markers collection.
|
|
30
28
|
*/
|
package/src/model/model.js
CHANGED
|
@@ -21,8 +21,7 @@ import getSelectedContent from './utils/getselectedcontent';
|
|
|
21
21
|
import insertContent from './utils/insertcontent';
|
|
22
22
|
import insertObject from './utils/insertobject';
|
|
23
23
|
import modifySelection from './utils/modifyselection';
|
|
24
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
25
|
-
import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
|
|
24
|
+
import { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
26
25
|
// @if CK_DEBUG_ENGINE // const { dumpTrees } = require( '../dev-utils/utils' );
|
|
27
26
|
// @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
|
|
28
27
|
/**
|
|
@@ -31,7 +30,7 @@ import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
|
|
|
31
30
|
*
|
|
32
31
|
* @mixes module:utils/observablemixin~ObservableMixin
|
|
33
32
|
*/
|
|
34
|
-
export default class Model extends
|
|
33
|
+
export default class Model extends ObservableMixin() {
|
|
35
34
|
constructor() {
|
|
36
35
|
super();
|
|
37
36
|
/**
|
package/src/model/node.js
CHANGED
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
* @module engine/model/node
|
|
8
8
|
*/
|
|
9
9
|
import TypeCheckable from './typecheckable';
|
|
10
|
-
import toMap from '@ckeditor/ckeditor5-utils
|
|
11
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
12
|
-
import compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';
|
|
10
|
+
import { CKEditorError, compareArrays, toMap } from '@ckeditor/ckeditor5-utils';
|
|
13
11
|
// To check if component is loaded more than once.
|
|
14
12
|
import '@ckeditor/ckeditor5-utils/src/version';
|
|
15
13
|
/**
|
package/src/model/nodelist.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* @module engine/model/nodelist
|
|
7
7
|
*/
|
|
8
8
|
import Node from './node';
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
10
|
-
import spliceArray from '@ckeditor/ckeditor5-utils/src/splicearray';
|
|
9
|
+
import { CKEditorError, spliceArray } from '@ckeditor/ckeditor5-utils';
|
|
11
10
|
/**
|
|
12
11
|
* Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
|
|
13
12
|
* in classes like {@link module:engine/model/element~Element Element}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import Operation from './operation';
|
|
9
9
|
import { _setAttribute } from './utils';
|
|
10
10
|
import Range from '../range';
|
|
11
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
11
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
import { isEqual } from 'lodash-es';
|
|
13
13
|
/**
|
|
14
14
|
* Operation to change nodes' attribute.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import Operation from './operation';
|
|
9
9
|
import Range from '../range';
|
|
10
10
|
import { _remove } from './utils';
|
|
11
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
11
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
13
13
|
/**
|
|
14
14
|
* Operation to permanently remove node from detached root.
|
|
@@ -12,7 +12,7 @@ import MoveOperation from './moveoperation';
|
|
|
12
12
|
import { _insert, _normalizeNodes } from './utils';
|
|
13
13
|
import Text from '../text';
|
|
14
14
|
import Element from '../element';
|
|
15
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
15
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
16
16
|
/**
|
|
17
17
|
* Operation to insert one or more nodes at given position in the model.
|
|
18
18
|
*
|
|
@@ -10,7 +10,7 @@ import SplitOperation from './splitoperation';
|
|
|
10
10
|
import Position from '../position';
|
|
11
11
|
import Range from '../range';
|
|
12
12
|
import { _move } from './utils';
|
|
13
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
13
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
15
|
* Operation to merge two {@link module:engine/model/element~Element elements}.
|
|
16
16
|
*
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
import Operation from './operation';
|
|
9
9
|
import Position from '../position';
|
|
10
10
|
import Range from '../range';
|
|
11
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
12
|
-
import compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';
|
|
13
11
|
import { _move } from './utils';
|
|
12
|
+
import { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';
|
|
14
13
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
15
14
|
/**
|
|
16
15
|
* Operation to move a range of {@link module:engine/model/item~Item model items}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import Operation from './operation';
|
|
9
9
|
import Element from '../element';
|
|
10
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
11
10
|
import Position from '../position';
|
|
11
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to change element's name.
|
|
14
14
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module engine/model/operation/rootattributeoperation
|
|
7
7
|
*/
|
|
8
8
|
import Operation from './operation';
|
|
9
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
9
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
|
|
12
12
|
*
|
|
@@ -10,7 +10,7 @@ import MergeOperation from './mergeoperation';
|
|
|
10
10
|
import Position from '../position';
|
|
11
11
|
import Range from '../range';
|
|
12
12
|
import { _insert, _move } from './utils';
|
|
13
|
-
import CKEditorError from '@ckeditor/ckeditor5-utils
|
|
13
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
15
|
* Operation to split {@link module:engine/model/element~Element an element} at given
|
|
16
16
|
* {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
|
|
@@ -13,7 +13,7 @@ import SplitOperation from './splitoperation';
|
|
|
13
13
|
import NoOperation from './nooperation';
|
|
14
14
|
import Range from '../range';
|
|
15
15
|
import Position from '../position';
|
|
16
|
-
import compareArrays from '@ckeditor/ckeditor5-utils
|
|
16
|
+
import { compareArrays } from '@ckeditor/ckeditor5-utils';
|
|
17
17
|
const transformations = new Map();
|
|
18
18
|
/**
|
|
19
19
|
* @module engine/model/operation/transform
|