8
0
Piotr Jasiun 9 лет назад
Родитель
Сommit
b0d53192a7

+ 2 - 2
packages/ckeditor5-engine/src/treemodel/characterproxy.js

@@ -13,8 +13,8 @@ import Node from './node.js';
  * the actual nodes in tree model.
  *
  * Keep in mind that CharacterProxy is static, meaning that it won't change when tree model changes. For example, if you
- * have a {treeModel.Element element} `myEl` containing text `foobar` and then assign `let b = myEl.getChild( 3 )` and
- * then remove all nodes from `myEl`, `b` will still have character `b`, parent `myEl` and offset `3`.
+ * have a {core.treeModel.Element element} `myEl` containing text `foobar` and then assign `let b = myEl.getChild( 3 )`
+ * and then remove all nodes from `myEl`, `b` will still have character `b`, parent `myEl` and offset `3`.
  *
  * CharacterProxy is created on the fly basing on tree model. It is not an explicit node in a tree model but
  * rather represents it. Because of this, it is not advised to store or compare instances of CharacterProxy class.

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/liveposition.js

@@ -48,7 +48,7 @@ export default class LivePosition extends Position {
 		 * - | sticks to previous node: `<p>f|[oo]</p><p>b^ar</p>` => `<p>f|</p><p>booar</p>`
 		 * - | sticks to next node: `<p>f|[oo]</p><p>b^ar</p>` => `<p>f</p><p>b|ooar</p>`
 		 *
-		 * @member {treeModel.PositionStickiness} core.treeModel.LivePosition#stickiness
+		 * @member {core.treeModel.PositionStickiness} core.treeModel.LivePosition#stickiness
 		 */
 		this.stickiness = stickiness || 'STICKS_TO_NEXT';
 

+ 2 - 3
packages/ckeditor5-engine/src/treemodel/nodelist.js

@@ -442,12 +442,11 @@ export default class NodeList {
 /**
  * Value that is convertible to an item kept in {@link core.treeModel.NodeList} or an iterable collection of such items.
  * In other words, this is anything that {@link core.treeModel.NodeList#constructor} is able to take and convert to node:
- * * {@link core.treeModel.Element} will be left as is
- * * {@link core.treeModel.CharacterProxy} will be left as is
+ * * {@link core.treeModel.Node} will be left as is
  * * {@link core.treeModel.Text} and {String} will be converted to a set of {@link core.treeModel.CharacterProxy}
  * * {@link core.treeModel.NodeList} will clone a node list (but not the nodes inside, so the new and passed list will
  * point to the same nodes.
  * * Iterable collection of above items will be iterated over and all items will be added to the node list.
  *
- * @typedef {treeModel.Element|treeModel.CharacterProxy|treeModel.Text|String|treeModel.NodeList|Iterable} core.treeModel.NodeSet
+ * @typedef {core.treeModel.Node|core.treeModel.Text|String|core.treeModel.NodeList|Iterable} core.treeModel.NodeSet
  */

+ 3 - 3
packages/ckeditor5-engine/src/treemodel/position.js

@@ -301,7 +301,7 @@ export default class Position {
 	/**
 	 * Checks whether this position is after given position.
 	 *
-	 * **Note:** see {treeModel.Position#isBefore}.
+	 * **Note:** see {@link core.treeModel.Position#isBefore}.
 	 *
 	 * @param {core.treeModel.Position} otherPosition Position to compare with.
 	 * @returns {Boolean} True if this position is after given position.
@@ -411,7 +411,7 @@ export default class Position {
 	/**
 	 * Creates a new position after given node.
 	 *
-	 * @see core.treeModel.TreeWalkerValue
+	 * @see {@link core.treeModel.TreeWalkerValue}
 	 *
 	 * @param {core.treeModel.Node} node Node the position should be directly after.
 	 * @returns {core.treeModel.Position}
@@ -433,7 +433,7 @@ export default class Position {
 	/**
 	 * Creates a new position before the given node.
 	 *
-	 * @see core.treeModel.TreeWalkerValue
+	 * @see {@link core.treeModel.TreeWalkerValue}
 	 *
 	 * @param {core.treeModel.node} node Node the position should be directly before.
 	 * @returns {core.treeModel.Position}

+ 6 - 6
packages/ckeditor5-engine/src/treemodel/range.js

@@ -253,7 +253,7 @@ export default class Range {
 
 	/**
 	 * Returns an iterator that iterates over all {@link core.treeModel.Item items} that are in this range and returns
-	 * them together together with additional information like length or {@link core.treeModel.Position positions},
+	 * them together with additional information like length or {@link core.treeModel.Position positions},
 	 * grouped as {@link core.treeModel.TreeWalkerValue}.
 	 *
 	 * A node is in the range when it is after a {@link core.treeModel.Position position} contained in this range.
@@ -265,11 +265,11 @@ export default class Range {
 	 * returns each {@link core.treeModel.Element} once, while simply used {@link core.treeModel.TreeWalker} might
 	 * return it twice: for `'ELEMENT_START'` and `'ELEMENT_END'`.
 	 *
-	 * **Node:*** because this method does not return {@link core.treeModel.TreeWalkerValue values} with the type of
+	 * **Note:** because this method does not return {@link core.treeModel.TreeWalkerValue values} with the type of
 	 * `'ELEMENT_END'`, you can use {@link core.treeModel.TreeWalkerValue.previousPosition} as a position before the
 	 * item.
 	 *
-	 * @see {treeModel.TreeWalker}
+	 * @see {core.treeModel.TreeWalker}
 	 * @param {Boolean} [mergeCharacters] Flag indicating whether all consecutive characters with the same attributes
 	 * should be returned as one {@link core.treeModel.TextFragment} (`true`) or one by one as multiple
 	 * {@link core.treeModel.CharacterProxy} (`false`) objects. Defaults to `false`.
@@ -360,7 +360,7 @@ export default class Range {
 	}
 
 	/**
-	 * Returns an array containing one or two {treeModel.Range ranges} that are a result of transforming this
+	 * Returns an array containing one or two {core.treeModel.Range ranges} that are a result of transforming this
 	 * {@link core.treeModel.Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link core.treeModel.Range ranges} are
 	 * returned if the insertion was inside this {@link core.treeModel.Range range}.
 	 *
@@ -378,8 +378,8 @@ export default class Range {
 	 *
 	 * @param {core.treeModel.Position} insertPosition Position where nodes are inserted.
 	 * @param {Number} howMany How many nodes are inserted.
-	 * @param {Boolean} spreadOnlyOnSameLevel Flag indicating whether this {treeModel.Range range} should be spread
-	 * if insertion was inside a node from this {treeModel.Range range} but not in the range itself.
+	 * @param {Boolean} spreadOnlyOnSameLevel Flag indicating whether this {core.treeModel.Range range} should be spread
+	 * if insertion was inside a node from this {core.treeModel.Range range} but not in the range itself.
 	 * @returns {Array.<core.treeModel.Range>} Result of the transformation.
 	 */
 	getTransformedByInsertion( insertPosition, howMany, spreadOnlyOnSameLevel ) {

+ 4 - 4
packages/ckeditor5-engine/src/treemodel/treewalker.js

@@ -257,15 +257,15 @@ function formatReturnValue( type, item, previousPosition, nextPosition, length )
  * Object returned by {@link core.treeModel.TreeWalker} when traversing tree model.
  *
  * @typedef {Object} core.treeModel.TreeWalkerValue
- * @property {treeModel.TreeWalkerValueType} type
- * @property {core.treeModel.Item} item Item between previous and next positions of {@link core.treeModel.TreeWalker}.
- * @property {treeModel.Position} previousPosition Previous position of the iterator. For `'ELEMENT_END'` it is the last
+ * @property {core.treeModel.TreeWalkerValueType} type
+ * @property {core.treeModel.Item} item Item between old and new positions of {@link core.treeModel.TreeWalker}.
+ * @property {core.treeModel.Position} previousPosition Previous position of the iterator. For `'ELEMENT_END'` it is the last
  * position inside the element. For all other types it is the position before the item. Note that it is more
  * efficient to use this position then calculate the position before the node using
  * {@link core.treeModel.Position.createBefore}. It is also more efficient to get the position after node by shifting
  * `previousPosition` by `length`, using {@link core.treeModel.Position#getShiftedBy}, then calculate the position using
  * {@link core.treeModel.Position.createAfter}.
- * @property {treeModel.Position} nextPosition Next position of the iterator. For `'ELEMENT_START'` it is the first
+ * @property {core.treeModel.Position} nextPosition Next position of the iterator. For `'ELEMENT_START'` it is the first
  * position inside the element. For all other types it is the position after the item.
  * @property {Number} [length] Length of the item. For `'ELEMENT_START'` and `'CHARACTER'` it is 1. For `'TEXT'` it is
  * the length of the text. For `'ELEMENT_END'` it is undefined.

+ 1 - 1
packages/ckeditor5-engine/tests/treemodel/_utils/utils.js

@@ -15,7 +15,7 @@ const utils = {
 	 *		let element = new Element( 'div', [], [ 'abc', new Element( 'p', [], 'foo' ), 'xyz' ] );
 	 *		treemodelUtils.getNodesAndText( element ); // abcPfooPxyz
 	 *
-	 * @param {treeModel.Range} range Range to stringify.
+	 * @param {core.treeModel.Range} range Range to stringify.
 	 * @returns {String} String representing element inner structure.
 	 */
 	getNodesAndText( range ) {