@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,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/rooteditableelement
|
|
7
7
|
*/
|
|
8
|
-
import EditableElement from './editableelement
|
|
8
|
+
import EditableElement from './editableelement';
|
|
9
9
|
const rootNameSymbol = Symbol('rootName');
|
|
10
10
|
/**
|
|
11
11
|
* Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},
|
package/src/view/selection.d.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/selection
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
9
|
-
import Range from './range
|
|
10
|
-
import Position, { type PositionOffset } from './position
|
|
11
|
-
import Node from './node
|
|
12
|
-
import DocumentSelection from './documentselection
|
|
13
|
-
import type Element from './element
|
|
14
|
-
import type Item from './item
|
|
15
|
-
import type EditableElement from './editableelement
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
|
+
import Range from './range';
|
|
10
|
+
import Position, { type PositionOffset } from './position';
|
|
11
|
+
import Node from './node';
|
|
12
|
+
import DocumentSelection from './documentselection';
|
|
13
|
+
import type Element from './element';
|
|
14
|
+
import type Item from './item';
|
|
15
|
+
import type EditableElement from './editableelement';
|
|
16
16
|
declare const Selection_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
17
17
|
/**
|
|
18
18
|
* Class representing an arbirtary selection in the view.
|
package/src/view/selection.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/selection
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
9
|
-
import Range from './range
|
|
10
|
-
import Position from './position
|
|
11
|
-
import Node from './node
|
|
12
|
-
import DocumentSelection from './documentselection
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
|
+
import Range from './range';
|
|
10
|
+
import Position from './position';
|
|
11
|
+
import Node from './node';
|
|
12
|
+
import DocumentSelection from './documentselection';
|
|
13
13
|
import { CKEditorError, EmitterMixin, count, isIterable } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
15
|
* Class representing an arbirtary selection in the view.
|
|
@@ -2,7 +2,7 @@
|
|
|
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 { getShorthandValues, isAttachment, isColor, isPosition, isRepeat, isURL } from './utils
|
|
5
|
+
import { getShorthandValues, isAttachment, isColor, isPosition, isRepeat, isURL } from './utils';
|
|
6
6
|
/**
|
|
7
7
|
* Adds a background CSS styles processing rules.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
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 { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLength, isLineStyle } from './utils
|
|
5
|
+
import { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLength, isLineStyle } from './utils';
|
|
6
6
|
/**
|
|
7
7
|
* Adds a border CSS styles processing rules.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
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 { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils
|
|
5
|
+
import { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils';
|
|
6
6
|
/**
|
|
7
7
|
* Adds a margin CSS styles processing rules.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
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 { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils
|
|
5
|
+
import { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils';
|
|
6
6
|
/**
|
|
7
7
|
* Adds a margin CSS styles processing rules.
|
|
8
8
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/styles/utils
|
|
7
7
|
*/
|
|
8
|
-
import type { BoxSides, PropertyDescriptor, StyleValue } from '../stylesmap
|
|
8
|
+
import type { BoxSides, PropertyDescriptor, StyleValue } from '../stylesmap';
|
|
9
9
|
/**
|
|
10
10
|
* Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
|
|
11
11
|
*
|
package/src/view/text.d.ts
CHANGED
package/src/view/text.js
CHANGED
package/src/view/textproxy.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/textproxy
|
|
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 type Node from './node
|
|
13
|
-
import type Text from './text
|
|
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 type Node from './node';
|
|
13
|
+
import type Text from './text';
|
|
14
14
|
/**
|
|
15
15
|
* TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
|
|
16
16
|
* {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.
|
package/src/view/textproxy.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/textproxy
|
|
7
7
|
*/
|
|
8
|
-
import TypeCheckable from './typecheckable
|
|
8
|
+
import TypeCheckable from './typecheckable';
|
|
9
9
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
|
package/src/view/treewalker.d.ts
CHANGED
|
@@ -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 Position from './position
|
|
6
|
-
import type Item from './item
|
|
7
|
-
import type Range from './range
|
|
5
|
+
import Position from './position';
|
|
6
|
+
import type Item from './item';
|
|
7
|
+
import type Range from './range';
|
|
8
8
|
/**
|
|
9
9
|
* Position iterator class. It allows to iterate forward and backward over the document.
|
|
10
10
|
*/
|
package/src/view/treewalker.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/treewalker
|
|
7
7
|
*/
|
|
8
|
-
import Element from './element
|
|
9
|
-
import Text from './text
|
|
10
|
-
import TextProxy from './textproxy
|
|
11
|
-
import Position from './position
|
|
8
|
+
import Element from './element';
|
|
9
|
+
import Text from './text';
|
|
10
|
+
import TextProxy from './textproxy';
|
|
11
|
+
import Position from './position';
|
|
12
12
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
13
13
|
/**
|
|
14
14
|
* Position iterator class. It allows to iterate forward and backward over the document.
|
|
@@ -2,22 +2,22 @@
|
|
|
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 AttributeElement from './attributeelement
|
|
6
|
-
import type ContainerElement from './containerelement
|
|
7
|
-
import type DocumentFragment from './documentfragment
|
|
8
|
-
import type DocumentSelection from './documentselection
|
|
9
|
-
import type EditableElement from './editableelement
|
|
10
|
-
import type Element from './element
|
|
11
|
-
import type EmptyElement from './emptyelement
|
|
12
|
-
import type Node from './node
|
|
13
|
-
import type Position from './position
|
|
14
|
-
import type Range from './range
|
|
15
|
-
import type RawElement from './rawelement
|
|
16
|
-
import type RootEditableElement from './rooteditableelement
|
|
17
|
-
import type Selection from './selection
|
|
18
|
-
import type Text from './text
|
|
19
|
-
import type TextProxy from './textproxy
|
|
20
|
-
import type UIElement from './uielement
|
|
5
|
+
import type AttributeElement from './attributeelement';
|
|
6
|
+
import type ContainerElement from './containerelement';
|
|
7
|
+
import type DocumentFragment from './documentfragment';
|
|
8
|
+
import type DocumentSelection from './documentselection';
|
|
9
|
+
import type EditableElement from './editableelement';
|
|
10
|
+
import type Element from './element';
|
|
11
|
+
import type EmptyElement from './emptyelement';
|
|
12
|
+
import type Node from './node';
|
|
13
|
+
import type Position from './position';
|
|
14
|
+
import type Range from './range';
|
|
15
|
+
import type RawElement from './rawelement';
|
|
16
|
+
import type RootEditableElement from './rooteditableelement';
|
|
17
|
+
import type Selection from './selection';
|
|
18
|
+
import type Text from './text';
|
|
19
|
+
import type TextProxy from './textproxy';
|
|
20
|
+
import type UIElement from './uielement';
|
|
21
21
|
/**
|
|
22
22
|
* @module engine/view/typecheckable
|
|
23
23
|
*/
|
package/src/view/uielement.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/uielement
|
|
7
7
|
*/
|
|
8
|
-
import Element, { type ElementAttributes } from './element
|
|
9
|
-
import Node from './node
|
|
10
|
-
import type View from './view
|
|
11
|
-
import type Document from './document
|
|
12
|
-
import type DomConverter from './domconverter
|
|
13
|
-
import type Item from './item
|
|
8
|
+
import Element, { type ElementAttributes } from './element';
|
|
9
|
+
import Node from './node';
|
|
10
|
+
import type View from './view';
|
|
11
|
+
import type Document from './document';
|
|
12
|
+
import type DomConverter from './domconverter';
|
|
13
|
+
import type Item from './item';
|
|
14
14
|
type DomDocument = globalThis.Document;
|
|
15
15
|
type DomElement = globalThis.HTMLElement;
|
|
16
16
|
/**
|
package/src/view/uielement.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/uielement
|
|
7
7
|
*/
|
|
8
|
-
import Element from './element
|
|
9
|
-
import Node from './node
|
|
8
|
+
import Element from './element';
|
|
9
|
+
import Node from './node';
|
|
10
10
|
import { CKEditorError, keyCodes } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
/**
|
|
12
12
|
* UI element class. It should be used to represent editing UI which needs to be injected into the editing view
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/upcastwriter
|
|
7
7
|
*/
|
|
8
|
-
import DocumentFragment from './documentfragment
|
|
9
|
-
import Element, { type ElementAttributes } from './element
|
|
10
|
-
import Text from './text
|
|
11
|
-
import Position, { type PositionOffset } from './position
|
|
12
|
-
import Range from './range
|
|
13
|
-
import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions } from './selection
|
|
14
|
-
import type Document from './document
|
|
15
|
-
import type Item from './item
|
|
16
|
-
import type Node from './node
|
|
8
|
+
import DocumentFragment from './documentfragment';
|
|
9
|
+
import Element, { type ElementAttributes } from './element';
|
|
10
|
+
import Text from './text';
|
|
11
|
+
import Position, { type PositionOffset } from './position';
|
|
12
|
+
import Range from './range';
|
|
13
|
+
import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions } from './selection';
|
|
14
|
+
import type Document from './document';
|
|
15
|
+
import type Item from './item';
|
|
16
|
+
import type Node from './node';
|
|
17
17
|
/**
|
|
18
18
|
* View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
|
|
19
19
|
*
|
package/src/view/upcastwriter.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/upcastwriter
|
|
7
7
|
*/
|
|
8
|
-
import DocumentFragment from './documentfragment
|
|
9
|
-
import Element from './element
|
|
10
|
-
import Text from './text
|
|
8
|
+
import DocumentFragment from './documentfragment';
|
|
9
|
+
import Element from './element';
|
|
10
|
+
import Text from './text';
|
|
11
11
|
import { isPlainObject } from 'lodash-es';
|
|
12
|
-
import Position from './position
|
|
13
|
-
import Range from './range
|
|
14
|
-
import Selection from './selection
|
|
12
|
+
import Position from './position';
|
|
13
|
+
import Range from './range';
|
|
14
|
+
import Selection from './selection';
|
|
15
15
|
/**
|
|
16
16
|
* View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
|
|
17
17
|
*
|
package/src/view/view.d.ts
CHANGED
|
@@ -5,18 +5,27 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/view
|
|
7
7
|
*/
|
|
8
|
-
import Document from './document
|
|
9
|
-
import DowncastWriter from './downcastwriter
|
|
10
|
-
import Renderer from './renderer
|
|
11
|
-
import DomConverter from './domconverter
|
|
12
|
-
import Position, { type PositionOffset } from './position
|
|
13
|
-
import Range from './range
|
|
14
|
-
import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions } from './selection
|
|
15
|
-
import type { default as Observer, ObserverConstructor } from './observer/observer
|
|
16
|
-
import type { StylesProcessor } from './stylesmap
|
|
17
|
-
import type Element from './element
|
|
18
|
-
import type Node from './node
|
|
19
|
-
import type Item from './item
|
|
8
|
+
import Document from './document';
|
|
9
|
+
import DowncastWriter from './downcastwriter';
|
|
10
|
+
import Renderer from './renderer';
|
|
11
|
+
import DomConverter from './domconverter';
|
|
12
|
+
import Position, { type PositionOffset } from './position';
|
|
13
|
+
import Range from './range';
|
|
14
|
+
import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions } from './selection';
|
|
15
|
+
import type { default as Observer, ObserverConstructor } from './observer/observer';
|
|
16
|
+
import type { StylesProcessor } from './stylesmap';
|
|
17
|
+
import type Element from './element';
|
|
18
|
+
import type Node from './node';
|
|
19
|
+
import type Item from './item';
|
|
20
|
+
import KeyObserver from './observer/keyobserver';
|
|
21
|
+
import FakeSelectionObserver from './observer/fakeselectionobserver';
|
|
22
|
+
import MutationObserver from './observer/mutationobserver';
|
|
23
|
+
import SelectionObserver from './observer/selectionobserver';
|
|
24
|
+
import FocusObserver from './observer/focusobserver';
|
|
25
|
+
import CompositionObserver from './observer/compositionobserver';
|
|
26
|
+
import InputObserver from './observer/inputobserver';
|
|
27
|
+
import ArrowKeysObserver from './observer/arrowkeysobserver';
|
|
28
|
+
import TabObserver from './observer/tabobserver';
|
|
20
29
|
type IfTrue<T> = T extends true ? true : never;
|
|
21
30
|
type DomRange = globalThis.Range;
|
|
22
31
|
declare const View_base: {
|
|
@@ -168,13 +177,7 @@ export default class View extends View_base {
|
|
|
168
177
|
* @returns Added observer instance.
|
|
169
178
|
*/
|
|
170
179
|
addObserver(ObserverConstructor: ObserverConstructor): Observer;
|
|
171
|
-
|
|
172
|
-
* Returns observer of the given type or `undefined` if such observer has not been added yet.
|
|
173
|
-
*
|
|
174
|
-
* @param ObserverConstructor The constructor of an observer to get.
|
|
175
|
-
* @returns Observer instance or undefined.
|
|
176
|
-
*/
|
|
177
|
-
getObserver<T extends ObserverConstructor>(ObserverConstructor: T): InstanceType<T> | undefined;
|
|
180
|
+
getObserver<T extends ObserverConstructor>(ObserverConstructor: T): T extends AlwaysRegisteredObservers ? InstanceType<T> : InstanceType<T> | undefined;
|
|
178
181
|
/**
|
|
179
182
|
* Disables all added observers.
|
|
180
183
|
*/
|
|
@@ -477,4 +480,8 @@ export type ViewScrollToTheSelectionEventData = {
|
|
|
477
480
|
alignToTop?: boolean;
|
|
478
481
|
forceScroll?: boolean;
|
|
479
482
|
};
|
|
483
|
+
/**
|
|
484
|
+
* Observers that are always registered.
|
|
485
|
+
*/
|
|
486
|
+
export type AlwaysRegisteredObservers = typeof MutationObserver | typeof FocusObserver | typeof SelectionObserver | typeof KeyObserver | typeof FakeSelectionObserver | typeof CompositionObserver | typeof ArrowKeysObserver | typeof InputObserver | typeof TabObserver;
|
|
480
487
|
export {};
|
package/src/view/view.js
CHANGED
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/view
|
|
7
7
|
*/
|
|
8
|
-
import Document from './document
|
|
9
|
-
import DowncastWriter from './downcastwriter
|
|
10
|
-
import Renderer from './renderer
|
|
11
|
-
import DomConverter from './domconverter
|
|
12
|
-
import Position from './position
|
|
13
|
-
import Range from './range
|
|
14
|
-
import Selection from './selection
|
|
15
|
-
import KeyObserver from './observer/keyobserver
|
|
16
|
-
import FakeSelectionObserver from './observer/fakeselectionobserver
|
|
17
|
-
import MutationObserver from './observer/mutationobserver
|
|
18
|
-
import SelectionObserver from './observer/selectionobserver
|
|
19
|
-
import FocusObserver from './observer/focusobserver
|
|
20
|
-
import CompositionObserver from './observer/compositionobserver
|
|
21
|
-
import InputObserver from './observer/inputobserver
|
|
22
|
-
import ArrowKeysObserver from './observer/arrowkeysobserver
|
|
23
|
-
import TabObserver from './observer/tabobserver
|
|
24
|
-
import { CKEditorError, ObservableMixin, scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils';
|
|
25
|
-
import { injectUiElementHandling } from './uielement
|
|
26
|
-
import { injectQuirksHandling } from './filler
|
|
8
|
+
import Document from './document';
|
|
9
|
+
import DowncastWriter from './downcastwriter';
|
|
10
|
+
import Renderer from './renderer';
|
|
11
|
+
import DomConverter from './domconverter';
|
|
12
|
+
import Position from './position';
|
|
13
|
+
import Range from './range';
|
|
14
|
+
import Selection from './selection';
|
|
15
|
+
import KeyObserver from './observer/keyobserver';
|
|
16
|
+
import FakeSelectionObserver from './observer/fakeselectionobserver';
|
|
17
|
+
import MutationObserver from './observer/mutationobserver';
|
|
18
|
+
import SelectionObserver from './observer/selectionobserver';
|
|
19
|
+
import FocusObserver from './observer/focusobserver';
|
|
20
|
+
import CompositionObserver from './observer/compositionobserver';
|
|
21
|
+
import InputObserver from './observer/inputobserver';
|
|
22
|
+
import ArrowKeysObserver from './observer/arrowkeysobserver';
|
|
23
|
+
import TabObserver from './observer/tabobserver';
|
|
24
|
+
import { CKEditorError, env, ObservableMixin, scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils';
|
|
25
|
+
import { injectUiElementHandling } from './uielement';
|
|
26
|
+
import { injectQuirksHandling } from './filler';
|
|
27
27
|
import { cloneDeep } from 'lodash-es';
|
|
28
28
|
/**
|
|
29
29
|
* Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
|
|
@@ -104,6 +104,7 @@ export default class View extends ObservableMixin() {
|
|
|
104
104
|
.to(this.document, 'isFocused', 'isSelecting', 'isComposing');
|
|
105
105
|
this._writer = new DowncastWriter(this.document);
|
|
106
106
|
// Add default observers.
|
|
107
|
+
// Make sure that this list matches AlwaysRegisteredObservers type.
|
|
107
108
|
this.addObserver(MutationObserver);
|
|
108
109
|
this.addObserver(FocusObserver);
|
|
109
110
|
this.addObserver(SelectionObserver);
|
|
@@ -132,6 +133,17 @@ export default class View extends ObservableMixin() {
|
|
|
132
133
|
this.listenTo(this.document, 'change:isFocused', () => {
|
|
133
134
|
this._hasChangedSinceTheLastRendering = true;
|
|
134
135
|
});
|
|
136
|
+
// Remove ranges from DOM selection if editor is blurred.
|
|
137
|
+
// See https://github.com/ckeditor/ckeditor5/issues/5753.
|
|
138
|
+
if (env.isiOS) {
|
|
139
|
+
this.listenTo(this.document, 'blur', (evt, data) => {
|
|
140
|
+
const relatedViewElement = this.domConverter.mapDomToView(data.domEvent.relatedTarget);
|
|
141
|
+
// Do not modify DOM selection if focus is moved to other editable of the same editor.
|
|
142
|
+
if (!relatedViewElement) {
|
|
143
|
+
this.domConverter._clearDomSelection();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
135
147
|
}
|
|
136
148
|
/**
|
|
137
149
|
* Attaches a DOM root element to the view element and enable all observers on that element.
|