@ckeditor/ckeditor5-engine 30.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/LICENSE.md +17 -0
- package/README.md +30 -0
- package/package.json +70 -0
- package/src/controller/datacontroller.js +563 -0
- package/src/controller/editingcontroller.js +149 -0
- package/src/conversion/conversion.js +644 -0
- package/src/conversion/conversionhelpers.js +40 -0
- package/src/conversion/downcastdispatcher.js +914 -0
- package/src/conversion/downcasthelpers.js +1706 -0
- package/src/conversion/mapper.js +696 -0
- package/src/conversion/modelconsumable.js +329 -0
- package/src/conversion/upcastdispatcher.js +807 -0
- package/src/conversion/upcasthelpers.js +997 -0
- package/src/conversion/viewconsumable.js +623 -0
- package/src/dataprocessor/basichtmlwriter.js +32 -0
- package/src/dataprocessor/dataprocessor.jsdoc +64 -0
- package/src/dataprocessor/htmldataprocessor.js +159 -0
- package/src/dataprocessor/htmlwriter.js +22 -0
- package/src/dataprocessor/xmldataprocessor.js +161 -0
- package/src/dev-utils/model.js +482 -0
- package/src/dev-utils/operationreplayer.js +140 -0
- package/src/dev-utils/utils.js +103 -0
- package/src/dev-utils/view.js +1091 -0
- package/src/index.js +52 -0
- package/src/model/batch.js +82 -0
- package/src/model/differ.js +1282 -0
- package/src/model/document.js +483 -0
- package/src/model/documentfragment.js +390 -0
- package/src/model/documentselection.js +1261 -0
- package/src/model/element.js +438 -0
- package/src/model/history.js +138 -0
- package/src/model/item.jsdoc +14 -0
- package/src/model/liveposition.js +182 -0
- package/src/model/liverange.js +221 -0
- package/src/model/markercollection.js +553 -0
- package/src/model/model.js +934 -0
- package/src/model/node.js +507 -0
- package/src/model/nodelist.js +217 -0
- package/src/model/operation/attributeoperation.js +202 -0
- package/src/model/operation/detachoperation.js +103 -0
- package/src/model/operation/insertoperation.js +188 -0
- package/src/model/operation/markeroperation.js +154 -0
- package/src/model/operation/mergeoperation.js +216 -0
- package/src/model/operation/moveoperation.js +209 -0
- package/src/model/operation/nooperation.js +58 -0
- package/src/model/operation/operation.js +139 -0
- package/src/model/operation/operationfactory.js +49 -0
- package/src/model/operation/renameoperation.js +155 -0
- package/src/model/operation/rootattributeoperation.js +211 -0
- package/src/model/operation/splitoperation.js +254 -0
- package/src/model/operation/transform.js +2389 -0
- package/src/model/operation/utils.js +292 -0
- package/src/model/position.js +1164 -0
- package/src/model/range.js +1049 -0
- package/src/model/rootelement.js +111 -0
- package/src/model/schema.js +1851 -0
- package/src/model/selection.js +902 -0
- package/src/model/text.js +138 -0
- package/src/model/textproxy.js +279 -0
- package/src/model/treewalker.js +414 -0
- package/src/model/utils/autoparagraphing.js +77 -0
- package/src/model/utils/deletecontent.js +528 -0
- package/src/model/utils/getselectedcontent.js +150 -0
- package/src/model/utils/insertcontent.js +824 -0
- package/src/model/utils/modifyselection.js +229 -0
- package/src/model/utils/selection-post-fixer.js +297 -0
- package/src/model/writer.js +1574 -0
- package/src/view/attributeelement.js +274 -0
- package/src/view/containerelement.js +123 -0
- package/src/view/document.js +221 -0
- package/src/view/documentfragment.js +273 -0
- package/src/view/documentselection.js +387 -0
- package/src/view/domconverter.js +1437 -0
- package/src/view/downcastwriter.js +2121 -0
- package/src/view/editableelement.js +118 -0
- package/src/view/element.js +945 -0
- package/src/view/elementdefinition.jsdoc +59 -0
- package/src/view/emptyelement.js +119 -0
- package/src/view/filler.js +161 -0
- package/src/view/item.jsdoc +14 -0
- package/src/view/matcher.js +776 -0
- package/src/view/node.js +391 -0
- package/src/view/observer/arrowkeysobserver.js +58 -0
- package/src/view/observer/bubblingemittermixin.js +307 -0
- package/src/view/observer/bubblingeventinfo.js +71 -0
- package/src/view/observer/clickobserver.js +46 -0
- package/src/view/observer/compositionobserver.js +79 -0
- package/src/view/observer/domeventdata.js +82 -0
- package/src/view/observer/domeventobserver.js +99 -0
- package/src/view/observer/fakeselectionobserver.js +118 -0
- package/src/view/observer/focusobserver.js +106 -0
- package/src/view/observer/inputobserver.js +44 -0
- package/src/view/observer/keyobserver.js +83 -0
- package/src/view/observer/mouseobserver.js +56 -0
- package/src/view/observer/mutationobserver.js +345 -0
- package/src/view/observer/observer.js +118 -0
- package/src/view/observer/selectionobserver.js +242 -0
- package/src/view/placeholder.js +285 -0
- package/src/view/position.js +426 -0
- package/src/view/range.js +533 -0
- package/src/view/rawelement.js +148 -0
- package/src/view/renderer.js +1037 -0
- package/src/view/rooteditableelement.js +107 -0
- package/src/view/selection.js +718 -0
- package/src/view/styles/background.js +73 -0
- package/src/view/styles/border.js +362 -0
- package/src/view/styles/margin.js +41 -0
- package/src/view/styles/padding.js +40 -0
- package/src/view/styles/utils.js +277 -0
- package/src/view/stylesmap.js +938 -0
- package/src/view/text.js +147 -0
- package/src/view/textproxy.js +199 -0
- package/src/view/treewalker.js +496 -0
- package/src/view/uielement.js +238 -0
- package/src/view/upcastwriter.js +484 -0
- package/src/view/view.js +721 -0
- package/theme/placeholder.css +27 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Note: This package is used only internally for debugging purposes and should not be used
|
|
8
|
+
* in other environments. It uses a few special methods not existing in the default
|
|
9
|
+
* building process. That is also why there are no tests for this file.
|
|
10
|
+
*
|
|
11
|
+
* @module engine/dev-utils/utils
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* globals console */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Helper function, converts a map to the 'key1="value1" key2="value1"' format.
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
* @param {Map} map Map to convert.
|
|
21
|
+
* @returns {String} Converted map.
|
|
22
|
+
*/
|
|
23
|
+
export function convertMapToTags( map ) {
|
|
24
|
+
let string = '';
|
|
25
|
+
|
|
26
|
+
for ( const entry of map ) {
|
|
27
|
+
string += ` ${ entry[ 0 ] }=${ JSON.stringify( entry[ 1 ] ) }`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Helper function, converts a map to the '{"key1":"value1","key2":"value2"}' format.
|
|
35
|
+
*
|
|
36
|
+
* @private
|
|
37
|
+
* @param {Map} map Map to convert.
|
|
38
|
+
* @returns {String} Converted map.
|
|
39
|
+
*/
|
|
40
|
+
export function convertMapToStringifiedObject( map ) {
|
|
41
|
+
const obj = {};
|
|
42
|
+
|
|
43
|
+
for ( const entry of map ) {
|
|
44
|
+
obj[ entry[ 0 ] ] = entry[ 1 ];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return JSON.stringify( obj );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const treeDump = Symbol( '_treeDump' );
|
|
51
|
+
const maxTreeDumpLength = 20;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Helper function that stores the `document` state for a given `version`.
|
|
55
|
+
*
|
|
56
|
+
* @private
|
|
57
|
+
* @param {*} document
|
|
58
|
+
* @param {*} version
|
|
59
|
+
*/
|
|
60
|
+
export function dumpTrees( document, version ) {
|
|
61
|
+
console.log( document, version );
|
|
62
|
+
|
|
63
|
+
let string = '';
|
|
64
|
+
|
|
65
|
+
for ( const root of document.roots ) {
|
|
66
|
+
string += root.printTree() + '\n';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
document[ treeDump ][ version ] = string.substr( 0, string.length - 1 ); // Remove the last "\n".
|
|
70
|
+
|
|
71
|
+
const overflow = document[ treeDump ].length - maxTreeDumpLength;
|
|
72
|
+
|
|
73
|
+
if ( overflow > 0 ) {
|
|
74
|
+
document[ treeDump ][ overflow - 1 ] = null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Helper function that initializes document dumping.
|
|
80
|
+
*
|
|
81
|
+
* @private
|
|
82
|
+
* @param {*} document
|
|
83
|
+
*/
|
|
84
|
+
export function initDocumentDumping( document ) {
|
|
85
|
+
document[ treeDump ] = [];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Helper function that logs document for the given version.
|
|
90
|
+
*
|
|
91
|
+
* @private
|
|
92
|
+
* @param {*} document
|
|
93
|
+
* @param {*} version
|
|
94
|
+
*/
|
|
95
|
+
export function logDocument( document, version ) {
|
|
96
|
+
console.log( '--------------------' );
|
|
97
|
+
|
|
98
|
+
if ( document[ treeDump ][ version ] ) {
|
|
99
|
+
console.log( document[ treeDump ][ version ] );
|
|
100
|
+
} else {
|
|
101
|
+
console.log( 'Tree log unavailable for given version: ' + version );
|
|
102
|
+
}
|
|
103
|
+
}
|