@ckeditor/ckeditor5-engine 38.2.0-alpha.1 → 39.0.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 +0 -1
- package/package.json +3 -4
- package/src/controller/datacontroller.d.ts +15 -15
- package/src/controller/datacontroller.js +11 -11
- package/src/controller/editingcontroller.d.ts +7 -7
- package/src/controller/editingcontroller.js +8 -8
- package/src/conversion/conversion.d.ts +6 -6
- package/src/conversion/conversion.js +2 -2
- package/src/conversion/downcastdispatcher.d.ts +28 -13
- package/src/conversion/downcastdispatcher.js +30 -21
- package/src/conversion/downcasthelpers.d.ts +21 -21
- package/src/conversion/downcasthelpers.js +11 -11
- package/src/conversion/mapper.d.ts +9 -9
- package/src/conversion/mapper.js +5 -5
- package/src/conversion/modelconsumable.d.ts +5 -5
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.d.ts +12 -12
- package/src/conversion/upcastdispatcher.js +5 -5
- package/src/conversion/upcasthelpers.d.ts +9 -9
- package/src/conversion/upcasthelpers.js +3 -3
- package/src/conversion/viewconsumable.d.ts +5 -5
- package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
- package/src/dataprocessor/dataprocessor.d.ts +2 -2
- package/src/dataprocessor/htmldataprocessor.d.ts +6 -6
- package/src/dataprocessor/htmldataprocessor.js +2 -2
- package/src/dataprocessor/xmldataprocessor.d.ts +6 -6
- package/src/dataprocessor/xmldataprocessor.js +2 -2
- package/src/dev-utils/model.d.ts +10 -10
- package/src/dev-utils/model.js +16 -16
- package/src/dev-utils/operationreplayer.d.ts +2 -2
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/view.d.ts +8 -8
- package/src/dev-utils/view.js +15 -15
- package/src/index.d.ts +107 -106
- package/src/index.js +65 -64
- package/src/model/batch.d.ts +1 -1
- package/src/model/differ.d.ts +19 -5
- package/src/model/differ.js +72 -13
- package/src/model/document.d.ts +18 -12
- package/src/model/document.js +18 -13
- package/src/model/documentfragment.d.ts +4 -4
- package/src/model/documentfragment.js +5 -5
- package/src/model/documentselection.d.ts +8 -8
- package/src/model/documentselection.js +8 -5
- package/src/model/element.d.ts +2 -2
- package/src/model/element.js +4 -4
- package/src/model/history.d.ts +1 -1
- package/src/model/item.d.ts +2 -2
- package/src/model/liveposition.d.ts +4 -4
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.d.ts +5 -5
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.d.ts +4 -4
- package/src/model/markercollection.js +2 -2
- package/src/model/model.d.ts +14 -15
- package/src/model/model.js +18 -19
- package/src/model/node.d.ts +5 -5
- package/src/model/node.js +2 -2
- package/src/model/nodelist.d.ts +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.d.ts +4 -4
- package/src/model/operation/attributeoperation.js +3 -3
- package/src/model/operation/detachoperation.d.ts +3 -3
- package/src/model/operation/detachoperation.js +3 -3
- package/src/model/operation/insertoperation.d.ts +6 -6
- package/src/model/operation/insertoperation.js +7 -7
- package/src/model/operation/markeroperation.d.ts +5 -5
- package/src/model/operation/markeroperation.js +2 -2
- package/src/model/operation/mergeoperation.d.ts +5 -5
- package/src/model/operation/mergeoperation.js +5 -5
- package/src/model/operation/moveoperation.d.ts +4 -4
- package/src/model/operation/moveoperation.js +4 -4
- package/src/model/operation/nooperation.d.ts +2 -2
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.d.ts +3 -3
- package/src/model/operation/operationfactory.d.ts +2 -2
- package/src/model/operation/operationfactory.js +11 -11
- package/src/model/operation/renameoperation.d.ts +4 -4
- package/src/model/operation/renameoperation.js +3 -3
- package/src/model/operation/rootattributeoperation.d.ts +4 -4
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/rootoperation.d.ts +3 -7
- package/src/model/operation/rootoperation.js +1 -25
- package/src/model/operation/splitoperation.d.ts +5 -5
- package/src/model/operation/splitoperation.js +5 -5
- package/src/model/operation/transform.d.ts +2 -2
- package/src/model/operation/transform.js +14 -14
- package/src/model/operation/utils.d.ts +6 -6
- package/src/model/operation/utils.js +4 -4
- package/src/model/position.d.ts +14 -14
- package/src/model/position.js +3 -3
- package/src/model/range.d.ts +12 -12
- package/src/model/range.js +3 -3
- package/src/model/rootelement.d.ts +8 -2
- package/src/model/rootelement.js +7 -1
- package/src/model/schema.d.ts +9 -9
- package/src/model/schema.js +10 -5
- package/src/model/selection.d.ts +7 -7
- package/src/model/selection.js +4 -4
- package/src/model/text.d.ts +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.d.ts +5 -5
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.d.ts +3 -3
- package/src/model/treewalker.js +4 -4
- package/src/model/typecheckable.d.ts +13 -13
- package/src/model/utils/autoparagraphing.d.ts +4 -4
- package/src/model/utils/autoparagraphing.js +1 -2
- package/src/model/utils/deletecontent.d.ts +3 -3
- package/src/model/utils/deletecontent.js +3 -3
- package/src/model/utils/findoptimalinsertionrange.d.ts +4 -4
- package/src/model/utils/getselectedcontent.d.ts +4 -4
- package/src/model/utils/insertcontent.d.ts +6 -6
- package/src/model/utils/insertcontent.js +6 -6
- package/src/model/utils/insertobject.d.ts +5 -5
- package/src/model/utils/insertobject.js +1 -1
- package/src/model/utils/modifyselection.d.ts +3 -3
- package/src/model/utils/modifyselection.js +4 -4
- package/src/model/utils/selection-post-fixer.d.ts +3 -3
- package/src/model/utils/selection-post-fixer.js +2 -2
- package/src/model/writer.d.ts +12 -12
- package/src/model/writer.js +17 -17
- package/src/view/attributeelement.d.ts +3 -3
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.d.ts +3 -3
- package/src/view/containerelement.js +1 -1
- package/src/view/document.d.ts +4 -4
- package/src/view/document.js +2 -2
- package/src/view/documentfragment.d.ts +4 -4
- package/src/view/documentfragment.js +3 -3
- package/src/view/documentselection.d.ts +8 -8
- package/src/view/documentselection.js +2 -2
- package/src/view/domconverter.d.ts +19 -13
- package/src/view/domconverter.js +28 -10
- package/src/view/downcastwriter.d.ts +17 -17
- package/src/view/downcastwriter.js +11 -11
- package/src/view/editableelement.d.ts +14 -4
- package/src/view/editableelement.js +2 -1
- package/src/view/element.d.ts +5 -5
- package/src/view/element.js +5 -5
- package/src/view/emptyelement.d.ts +4 -4
- package/src/view/emptyelement.js +2 -2
- package/src/view/filler.d.ts +1 -1
- package/src/view/item.d.ts +2 -2
- package/src/view/matcher.d.ts +1 -1
- package/src/view/node.d.ts +5 -5
- package/src/view/node.js +2 -2
- package/src/view/observer/arrowkeysobserver.d.ts +4 -4
- package/src/view/observer/arrowkeysobserver.js +2 -2
- package/src/view/observer/bubblingemittermixin.d.ts +2 -2
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.d.ts +3 -3
- package/src/view/observer/clickobserver.d.ts +3 -3
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.d.ts +3 -3
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.d.ts +3 -3
- package/src/view/observer/domeventobserver.d.ts +1 -1
- package/src/view/observer/domeventobserver.js +2 -2
- package/src/view/observer/fakeselectionobserver.d.ts +2 -2
- package/src/view/observer/fakeselectionobserver.js +2 -2
- package/src/view/observer/focusobserver.d.ts +3 -3
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.d.ts +4 -4
- package/src/view/observer/inputobserver.js +2 -2
- package/src/view/observer/keyobserver.d.ts +2 -2
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.d.ts +2 -2
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.d.ts +4 -4
- package/src/view/observer/mutationobserver.js +2 -2
- package/src/view/observer/observer.d.ts +2 -2
- package/src/view/observer/selectionobserver.d.ts +7 -7
- package/src/view/observer/selectionobserver.js +5 -5
- package/src/view/observer/tabobserver.d.ts +4 -4
- package/src/view/observer/tabobserver.js +2 -2
- package/src/view/placeholder.d.ts +16 -8
- package/src/view/placeholder.js +21 -12
- package/src/view/position.d.ts +7 -7
- package/src/view/position.js +4 -4
- package/src/view/range.d.ts +7 -7
- package/src/view/range.js +3 -3
- package/src/view/rawelement.d.ts +5 -5
- package/src/view/rawelement.js +2 -2
- package/src/view/renderer.d.ts +5 -5
- package/src/view/renderer.js +4 -5
- package/src/view/rooteditableelement.d.ts +2 -2
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.d.ts +8 -8
- package/src/view/selection.js +5 -5
- package/src/view/styles/background.d.ts +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.d.ts +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.d.ts +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.d.ts +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.d.ts +1 -1
- package/src/view/text.d.ts +2 -2
- package/src/view/text.js +1 -1
- package/src/view/textproxy.d.ts +6 -6
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.d.ts +3 -3
- package/src/view/treewalker.js +4 -4
- package/src/view/typecheckable.d.ts +16 -16
- package/src/view/uielement.d.ts +6 -6
- package/src/view/uielement.js +2 -2
- package/src/view/upcastwriter.d.ts +9 -9
- package/src/view/upcastwriter.js +6 -6
- package/src/view/view.d.ts +26 -19
- package/src/view/view.js +31 -19
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/markercollection
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
9
|
-
import LiveRange, { type LiveRangeChangeContentEvent, type LiveRangeChangeRangeEvent, type LiveRangeChangeEvent } from './liverange
|
|
10
|
-
import type Position from './position
|
|
11
|
-
import type Range from './range
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
|
+
import LiveRange, { type LiveRangeChangeContentEvent, type LiveRangeChangeRangeEvent, type LiveRangeChangeEvent } from './liverange';
|
|
10
|
+
import type Position from './position';
|
|
11
|
+
import type Range from './range';
|
|
12
12
|
declare const MarkerCollection_base: {
|
|
13
13
|
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
14
14
|
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/markercollection
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
9
|
-
import LiveRange from './liverange
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
|
+
import LiveRange from './liverange';
|
|
10
10
|
import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
/**
|
|
12
12
|
* The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
|
package/src/model/model.d.ts
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/model
|
|
7
7
|
*/
|
|
8
|
-
import Batch, { type BatchType } from './batch
|
|
9
|
-
import Document from './document
|
|
10
|
-
import MarkerCollection from './markercollection
|
|
11
|
-
import ModelPosition, { type PositionOffset, type PositionStickiness } from './position
|
|
12
|
-
import ModelRange from './range
|
|
13
|
-
import ModelSelection, { type PlaceOrOffset, type Selectable } from './selection
|
|
14
|
-
import DocumentSelection from './documentselection
|
|
15
|
-
import Schema from './schema
|
|
16
|
-
import Writer from './writer
|
|
17
|
-
import Node from './node
|
|
18
|
-
import type ModelDocumentFragment from './documentfragment
|
|
19
|
-
import type Item from './item
|
|
20
|
-
import type ModelElement from './element
|
|
21
|
-
import type Operation from './operation/operation
|
|
8
|
+
import Batch, { type BatchType } from './batch';
|
|
9
|
+
import Document from './document';
|
|
10
|
+
import MarkerCollection from './markercollection';
|
|
11
|
+
import ModelPosition, { type PositionOffset, type PositionStickiness } from './position';
|
|
12
|
+
import ModelRange from './range';
|
|
13
|
+
import ModelSelection, { type PlaceOrOffset, type Selectable } from './selection';
|
|
14
|
+
import DocumentSelection from './documentselection';
|
|
15
|
+
import Schema from './schema';
|
|
16
|
+
import Writer from './writer';
|
|
17
|
+
import Node from './node';
|
|
18
|
+
import type ModelDocumentFragment from './documentfragment';
|
|
19
|
+
import type Item from './item';
|
|
20
|
+
import type ModelElement from './element';
|
|
21
|
+
import type Operation from './operation/operation';
|
|
22
22
|
import { type DecoratedMethodEvent } from '@ckeditor/ckeditor5-utils';
|
|
23
23
|
declare const Model_base: {
|
|
24
24
|
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
@@ -769,7 +769,6 @@ export default class Model extends Model_base {
|
|
|
769
769
|
/**
|
|
770
770
|
* Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
|
|
771
771
|
* which calls callbacks and returns array of values returned by these callbacks.
|
|
772
|
-
*
|
|
773
772
|
*/
|
|
774
773
|
private _runPendingChanges;
|
|
775
774
|
}
|
package/src/model/model.js
CHANGED
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/model
|
|
7
7
|
*/
|
|
8
|
-
import Batch from './batch
|
|
9
|
-
import Document from './document
|
|
10
|
-
import MarkerCollection from './markercollection
|
|
11
|
-
import ModelPosition from './position
|
|
12
|
-
import ModelRange from './range
|
|
13
|
-
import ModelSelection from './selection
|
|
14
|
-
import OperationFactory from './operation/operationfactory
|
|
15
|
-
import DocumentSelection from './documentselection
|
|
16
|
-
import Schema from './schema
|
|
17
|
-
import Writer from './writer
|
|
18
|
-
import Node from './node
|
|
19
|
-
import { autoParagraphEmptyRoots } from './utils/autoparagraphing
|
|
20
|
-
import { injectSelectionPostFixer } from './utils/selection-post-fixer
|
|
21
|
-
import deleteContent from './utils/deletecontent
|
|
22
|
-
import getSelectedContent from './utils/getselectedcontent
|
|
23
|
-
import insertContent from './utils/insertcontent
|
|
24
|
-
import insertObject from './utils/insertobject
|
|
25
|
-
import modifySelection from './utils/modifyselection
|
|
8
|
+
import Batch from './batch';
|
|
9
|
+
import Document from './document';
|
|
10
|
+
import MarkerCollection from './markercollection';
|
|
11
|
+
import ModelPosition from './position';
|
|
12
|
+
import ModelRange from './range';
|
|
13
|
+
import ModelSelection from './selection';
|
|
14
|
+
import OperationFactory from './operation/operationfactory';
|
|
15
|
+
import DocumentSelection from './documentselection';
|
|
16
|
+
import Schema from './schema';
|
|
17
|
+
import Writer from './writer';
|
|
18
|
+
import Node from './node';
|
|
19
|
+
import { autoParagraphEmptyRoots } from './utils/autoparagraphing';
|
|
20
|
+
import { injectSelectionPostFixer } from './utils/selection-post-fixer';
|
|
21
|
+
import deleteContent from './utils/deletecontent';
|
|
22
|
+
import getSelectedContent from './utils/getselectedcontent';
|
|
23
|
+
import insertContent from './utils/insertcontent';
|
|
24
|
+
import insertObject from './utils/insertobject';
|
|
25
|
+
import modifySelection from './utils/modifyselection';
|
|
26
26
|
import { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
27
27
|
// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
|
|
28
28
|
// @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
|
|
@@ -792,7 +792,6 @@ export default class Model extends ObservableMixin() {
|
|
|
792
792
|
/**
|
|
793
793
|
* Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
|
|
794
794
|
* which calls callbacks and returns array of values returned by these callbacks.
|
|
795
|
-
*
|
|
796
795
|
*/
|
|
797
796
|
_runPendingChanges() {
|
|
798
797
|
const ret = [];
|
package/src/model/node.d.ts
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/node
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
9
|
-
import type Document from './document
|
|
10
|
-
import type DocumentFragment from './documentfragment
|
|
11
|
-
import type Element from './element
|
|
12
|
-
import '@ckeditor/ckeditor5-utils/src/version
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
|
+
import type Document from './document';
|
|
10
|
+
import type DocumentFragment from './documentfragment';
|
|
11
|
+
import type Element from './element';
|
|
12
|
+
import '@ckeditor/ckeditor5-utils/src/version';
|
|
13
13
|
/**
|
|
14
14
|
* Model node. Most basic structure of model tree.
|
|
15
15
|
*
|
package/src/model/node.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module engine/model/node
|
|
8
8
|
*/
|
|
9
|
-
import TypeCheckable from './typecheckable
|
|
9
|
+
import TypeCheckable from './typecheckable';
|
|
10
10
|
import { CKEditorError, compareArrays, toMap } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
// To check if component is loaded more than once.
|
|
12
|
-
import '@ckeditor/ckeditor5-utils/src/version
|
|
12
|
+
import '@ckeditor/ckeditor5-utils/src/version';
|
|
13
13
|
/**
|
|
14
14
|
* Model node. Most basic structure of model tree.
|
|
15
15
|
*
|
package/src/model/nodelist.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/nodelist
|
|
7
7
|
*/
|
|
8
|
-
import Node from './node
|
|
8
|
+
import Node from './node';
|
|
9
9
|
/**
|
|
10
10
|
* Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
|
|
11
11
|
* in classes like {@link module:engine/model/element~Element Element}
|
package/src/model/nodelist.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/nodelist
|
|
7
7
|
*/
|
|
8
|
-
import Node from './node
|
|
8
|
+
import Node from './node';
|
|
9
9
|
import { CKEditorError, spliceArray } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/attributeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Range from '../range
|
|
10
|
-
import type Document from '../document
|
|
11
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Range from '../range';
|
|
10
|
+
import type Document from '../document';
|
|
11
|
+
import type { Selectable } from '../selection';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to change nodes' attribute.
|
|
14
14
|
*
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/attributeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import { _setAttribute } from './utils
|
|
10
|
-
import Range from '../range
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import { _setAttribute } from './utils';
|
|
10
|
+
import Range from '../range';
|
|
11
11
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
import { isEqual } from 'lodash-es';
|
|
13
13
|
/**
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/detachoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import type Position from '../position
|
|
10
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import type Position from '../position';
|
|
10
|
+
import type { Selectable } from '../selection';
|
|
11
11
|
/**
|
|
12
12
|
* Operation to permanently remove node from detached root.
|
|
13
13
|
* Note this operation is only a local operation and won't be send to the other clients.
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/detachoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Range from '../range
|
|
10
|
-
import { _remove } from './utils
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Range from '../range';
|
|
10
|
+
import { _remove } from './utils';
|
|
11
11
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
13
13
|
/**
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/insertoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import NodeList from '../nodelist
|
|
11
|
-
import { type NodeSet } from './utils
|
|
12
|
-
import type { Selectable } from '../selection
|
|
13
|
-
import type Document from '../document
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import NodeList from '../nodelist';
|
|
11
|
+
import { type NodeSet } from './utils';
|
|
12
|
+
import type { Selectable } from '../selection';
|
|
13
|
+
import type Document from '../document';
|
|
14
14
|
/**
|
|
15
15
|
* Operation to insert one or more nodes at given position in the model.
|
|
16
16
|
*/
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/insertoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import NodeList from '../nodelist
|
|
11
|
-
import MoveOperation from './moveoperation
|
|
12
|
-
import { _insert, _normalizeNodes } from './utils
|
|
13
|
-
import Text from '../text
|
|
14
|
-
import Element from '../element
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import NodeList from '../nodelist';
|
|
11
|
+
import MoveOperation from './moveoperation';
|
|
12
|
+
import { _insert, _normalizeNodes } from './utils';
|
|
13
|
+
import Text from '../text';
|
|
14
|
+
import Element from '../element';
|
|
15
15
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
16
16
|
/**
|
|
17
17
|
* Operation to insert one or more nodes at given position in the model.
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/markeroperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Range from '../range
|
|
10
|
-
import type Document from '../document
|
|
11
|
-
import type MarkerCollection from '../markercollection
|
|
12
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Range from '../range';
|
|
10
|
+
import type Document from '../document';
|
|
11
|
+
import type MarkerCollection from '../markercollection';
|
|
12
|
+
import type { Selectable } from '../selection';
|
|
13
13
|
export default class MarkerOperation extends Operation {
|
|
14
14
|
/**
|
|
15
15
|
* Marker name.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/markeroperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Range from '../range
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Range from '../range';
|
|
10
10
|
export default class MarkerOperation extends Operation {
|
|
11
11
|
/**
|
|
12
12
|
* @param name Marker name.
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/mergeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import Range from '../range
|
|
11
|
-
import type Document from '../document
|
|
12
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import Range from '../range';
|
|
11
|
+
import type Document from '../document';
|
|
12
|
+
import type { Selectable } from '../selection';
|
|
13
13
|
/**
|
|
14
14
|
* Operation to merge two {@link module:engine/model/element~Element elements}.
|
|
15
15
|
*
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/mergeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import SplitOperation from './splitoperation
|
|
10
|
-
import Position from '../position
|
|
11
|
-
import Range from '../range
|
|
12
|
-
import { _move } from './utils
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import SplitOperation from './splitoperation';
|
|
10
|
+
import Position from '../position';
|
|
11
|
+
import Range from '../range';
|
|
12
|
+
import { _move } from './utils';
|
|
13
13
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
15
|
* Operation to merge two {@link module:engine/model/element~Element elements}.
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/moveoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import type { Selectable } from '../selection
|
|
11
|
-
import type Document from '../document
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import type { Selectable } from '../selection';
|
|
11
|
+
import type Document from '../document';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to move a range of {@link module:engine/model/item~Item model items}
|
|
14
14
|
* to given {@link module:engine/model/position~Position target position}.
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/moveoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import Range from '../range
|
|
11
|
-
import { _move } from './utils
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import Range from '../range';
|
|
11
|
+
import { _move } from './utils';
|
|
12
12
|
import { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';
|
|
13
13
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
14
14
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/nooperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import type { Selectable } from '../selection';
|
|
10
10
|
/**
|
|
11
11
|
* Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
|
|
12
12
|
* which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/nooperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
8
|
+
import Operation from './operation';
|
|
9
9
|
/**
|
|
10
10
|
* Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
|
|
11
11
|
* which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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 type Batch from '../batch
|
|
6
|
-
import type Document from '../document
|
|
7
|
-
import type { Selectable } from '../selection
|
|
5
|
+
import type Batch from '../batch';
|
|
6
|
+
import type Document from '../document';
|
|
7
|
+
import type { Selectable } from '../selection';
|
|
8
8
|
/**
|
|
9
9
|
* @module engine/model/operation/operation
|
|
10
10
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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 Operation from './operation
|
|
6
|
-
import type Document from '../document
|
|
5
|
+
import Operation from './operation';
|
|
6
|
+
import type Document from '../document';
|
|
7
7
|
/**
|
|
8
8
|
* A factory class for creating operations.
|
|
9
9
|
*/
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/operationfactory
|
|
7
7
|
*/
|
|
8
|
-
import AttributeOperation from './attributeoperation
|
|
9
|
-
import InsertOperation from './insertoperation
|
|
10
|
-
import MarkerOperation from './markeroperation
|
|
11
|
-
import MoveOperation from './moveoperation
|
|
12
|
-
import NoOperation from './nooperation
|
|
13
|
-
import Operation from './operation
|
|
14
|
-
import RenameOperation from './renameoperation
|
|
15
|
-
import RootAttributeOperation from './rootattributeoperation
|
|
16
|
-
import RootOperation from './rootoperation
|
|
17
|
-
import SplitOperation from './splitoperation
|
|
18
|
-
import MergeOperation from './mergeoperation
|
|
8
|
+
import AttributeOperation from './attributeoperation';
|
|
9
|
+
import InsertOperation from './insertoperation';
|
|
10
|
+
import MarkerOperation from './markeroperation';
|
|
11
|
+
import MoveOperation from './moveoperation';
|
|
12
|
+
import NoOperation from './nooperation';
|
|
13
|
+
import Operation from './operation';
|
|
14
|
+
import RenameOperation from './renameoperation';
|
|
15
|
+
import RootAttributeOperation from './rootattributeoperation';
|
|
16
|
+
import RootOperation from './rootoperation';
|
|
17
|
+
import SplitOperation from './splitoperation';
|
|
18
|
+
import MergeOperation from './mergeoperation';
|
|
19
19
|
const operations = {};
|
|
20
20
|
operations[AttributeOperation.className] = AttributeOperation;
|
|
21
21
|
operations[InsertOperation.className] = InsertOperation;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/renameoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import type Document from '../document
|
|
11
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import type Document from '../document';
|
|
11
|
+
import type { Selectable } from '../selection';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to change element's name.
|
|
14
14
|
*
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/renameoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Element from '../element
|
|
10
|
-
import Position from '../position
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Element from '../element';
|
|
10
|
+
import Position from '../position';
|
|
11
11
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to change element's name.
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/rootattributeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import type Document from '../document
|
|
10
|
-
import type RootElement from '../rootelement
|
|
11
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import type Document from '../document';
|
|
10
|
+
import type RootElement from '../rootelement';
|
|
11
|
+
import type { Selectable } from '../selection';
|
|
12
12
|
/**
|
|
13
13
|
* Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
|
|
14
14
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/rootattributeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
8
|
+
import Operation from './operation';
|
|
9
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.
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/rootoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import type Document from '../document
|
|
10
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import type Document from '../document';
|
|
10
|
+
import type { Selectable } from '../selection';
|
|
11
11
|
/**
|
|
12
12
|
* Operation that creates (or attaches) or detaches a root element.
|
|
13
13
|
*/
|
|
@@ -54,10 +54,6 @@ export default class RootOperation extends Operation {
|
|
|
54
54
|
* @inheritDoc
|
|
55
55
|
*/
|
|
56
56
|
getReversed(): RootOperation;
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
_validate(): void;
|
|
61
57
|
/**
|
|
62
58
|
* @inheritDoc
|
|
63
59
|
*/
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/rootoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
8
|
+
import Operation from './operation';
|
|
10
9
|
/**
|
|
11
10
|
* Operation that creates (or attaches) or detaches a root element.
|
|
12
11
|
*/
|
|
@@ -59,29 +58,6 @@ export default class RootOperation extends Operation {
|
|
|
59
58
|
getReversed() {
|
|
60
59
|
return new RootOperation(this.rootName, this.elementName, !this.isAdd, this._document, this.baseVersion + 1);
|
|
61
60
|
}
|
|
62
|
-
/**
|
|
63
|
-
* @inheritDoc
|
|
64
|
-
*/
|
|
65
|
-
_validate() {
|
|
66
|
-
// Keep in mind that at this point the root will always exist as it was created in the `constructor()`, even for detach operation.
|
|
67
|
-
const root = this._document.getRoot(this.rootName);
|
|
68
|
-
if (root.isAttached() && this.isAdd) {
|
|
69
|
-
/**
|
|
70
|
-
* Trying to attach a root that is already attached.
|
|
71
|
-
*
|
|
72
|
-
* @error root-operation-root-attached
|
|
73
|
-
*/
|
|
74
|
-
throw new CKEditorError('root-operation-root-attached', this);
|
|
75
|
-
}
|
|
76
|
-
else if (!root.isAttached() && !this.isAdd) {
|
|
77
|
-
/**
|
|
78
|
-
* Trying to detach a root that is already detached.
|
|
79
|
-
*
|
|
80
|
-
* @error root-operation-root-detached
|
|
81
|
-
*/
|
|
82
|
-
throw new CKEditorError('root-operation-root-detached', this);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
61
|
/**
|
|
86
62
|
* @inheritDoc
|
|
87
63
|
*/
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/splitoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import Position from '../position
|
|
10
|
-
import Range from '../range
|
|
11
|
-
import type Document from '../document
|
|
12
|
-
import type { Selectable } from '../selection
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import Position from '../position';
|
|
10
|
+
import Range from '../range';
|
|
11
|
+
import type Document from '../document';
|
|
12
|
+
import type { Selectable } from '../selection';
|
|
13
13
|
/**
|
|
14
14
|
* Operation to split {@link module:engine/model/element~Element an element} at given
|
|
15
15
|
* {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/splitoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation
|
|
9
|
-
import MergeOperation from './mergeoperation
|
|
10
|
-
import Position from '../position
|
|
11
|
-
import Range from '../range
|
|
12
|
-
import { _insert, _move } from './utils
|
|
8
|
+
import Operation from './operation';
|
|
9
|
+
import MergeOperation from './mergeoperation';
|
|
10
|
+
import Position from '../position';
|
|
11
|
+
import Range from '../range';
|
|
12
|
+
import { _insert, _move } from './utils';
|
|
13
13
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
15
|
* Operation to split {@link module:engine/model/element~Element an element} at given
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, 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 type Operation from './operation
|
|
6
|
-
import type Document from '../document
|
|
5
|
+
import type Operation from './operation';
|
|
6
|
+
import type Document from '../document';
|
|
7
7
|
/**
|
|
8
8
|
* Transforms operation `a` by operation `b`.
|
|
9
9
|
*
|