8
0
Quellcode durchsuchen

Docs: Table API docs improvements, part 2. [skip ci]

Anna Tomanek vor 5 Jahren
Ursprung
Commit
77ec129812

+ 1 - 1
packages/ckeditor5-table/src/commands/insertcolumncommand.js

@@ -13,7 +13,7 @@ import { findAncestor } from './utils';
 /**
  * The insert column command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'insertTableColumnLeft'` and
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
  * `'insertTableColumnRight'` editor commands.
  *
  * To insert a column to the left of the selected cell, execute the following command:

+ 1 - 1
packages/ckeditor5-table/src/commands/insertrowcommand.js

@@ -13,7 +13,7 @@ import { findAncestor } from './utils';
 /**
  * The insert row command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'insertTableRowBelow'` and
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
  * `'insertTableRowAbove'` editor commands.
  *
  * To insert a row below the selected cell, execute the following command:

+ 1 - 1
packages/ckeditor5-table/src/commands/inserttablecommand.js

@@ -13,7 +13,7 @@ import { findOptimalInsertionPosition } from '@ckeditor/ckeditor5-widget/src/uti
 /**
  * The insert table command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'insertTable'` editor command.
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
  *
  * To insert a table at the current selection, execute the command and specify the dimensions:
  *

+ 6 - 6
packages/ckeditor5-table/src/commands/mergecellcommand.js

@@ -14,7 +14,7 @@ import { findAncestor, updateNumericAttribute } from './utils';
 /**
  * The merge cell command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
  * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
  *
  * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
@@ -240,7 +240,7 @@ function getVerticalCell( tableCell, direction ) {
 	return cellToMergeData && cellToMergeData.cell;
 }
 
-// Properly removes empty row from a table. Will update `rowspan` attribute of cells that overlaps removed row.
+// Properly removes an empty row from a table. It will update the `rowspan` attribute of cells that overlap the removed row.
 //
 // @param {module:engine/model/element~Element} removedTableCellRow
 // @param {module:engine/model/writer~Writer} writer
@@ -260,9 +260,9 @@ function removeEmptyRow( removedTableCellRow, writer ) {
 	writer.remove( removedTableCellRow );
 }
 
-// Merges two table cells - will ensure that after merging cells with empty paragraph the result table cell will only have one paragraph.
-// If one of the merged table cell is empty the merged table cell will have contents of the non-empty table cell.
-// If both are empty the merged table cell will have only one empty paragraph.
+// Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
+// paragraph. If one of the merged table cell is empty, the merged table cell will have the contents of the non-empty table cell.
+// If both are empty, the merged table cell will have only one empty paragraph.
 //
 // @param {module:engine/model/element~Element} cellToRemove
 // @param {module:engine/model/element~Element} cellToExpand
@@ -280,7 +280,7 @@ function mergeTableCells( cellToRemove, cellToExpand, writer ) {
 	writer.remove( cellToRemove );
 }
 
-// Checks if passed table cell contains empty paragraph.
+// Checks if the passed table cell contains an empty paragraph.
 //
 // @param {module:engine/model/element~Element} tableCell
 // @returns {Boolean}

+ 1 - 1
packages/ckeditor5-table/src/commands/removecolumncommand.js

@@ -15,7 +15,7 @@ import { findAncestor, updateNumericAttribute } from './utils';
 /**
  * The remove column command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'removeTableColumn'` editor command.
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
  *
  * To remove the column containing the selected cell, execute the command:
  *

+ 1 - 1
packages/ckeditor5-table/src/commands/removerowcommand.js

@@ -15,7 +15,7 @@ import { findAncestor, updateNumericAttribute } from './utils';
 /**
  * The remove row command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'removeTableRow'` editor command.
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
  *
  * To remove the row containing the selected cell, execute the command:
  *

+ 3 - 3
packages/ckeditor5-table/src/commands/setheadercolumncommand.js

@@ -14,7 +14,7 @@ import { findAncestor, updateNumericAttribute } from './utils';
 /**
  * The header column command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'setTableColumnHeader'` editor command.
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  *
  * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
  * by executing:
@@ -62,8 +62,8 @@ export default class SetHeaderColumnCommand extends Command {
 	 *
 	 * @fires execute
 	 * @param {Object} [options]
-	 * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) header columns according to
-	 * `forceValue` parameter instead of the current model state.
+	 * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
+	 * the `forceValue` parameter instead of the current model state.
 	 */
 	execute( options = {} ) {
 		const model = this.editor.model;

+ 3 - 3
packages/ckeditor5-table/src/commands/setheaderrowcommand.js

@@ -15,7 +15,7 @@ import TableWalker from '../tablewalker';
 /**
  * The header row command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'setTableColumnHeader'` editor command.
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  *
  * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
  *
@@ -61,8 +61,8 @@ export default class SetHeaderRowCommand extends Command {
 	 *
 	 * @fires execute
 	 * @param {Object} options
-	 * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) header rows according to `forceValue`
-	 * parameter instead of the current model state.
+	 * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
+	 * the `forceValue` parameter instead of the current model state.
 	 */
 	execute( options = {} ) {
 		const model = this.editor.model;

+ 1 - 1
packages/ckeditor5-table/src/commands/splitcellcommand.js

@@ -13,7 +13,7 @@ import { findAncestor } from './utils';
 /**
  * The split cell command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'splitTableCellVertically'`
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
  * and `'splitTableCellHorizontally'`  editor commands.
  *
  * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:

+ 11 - 11
packages/ckeditor5-table/src/commands/utils.js

@@ -10,10 +10,10 @@
 import { isObject } from 'lodash-es';
 
 /**
- * Returns the parent element of given name. Returns undefined if position is not inside desired parent.
+ * Returns the parent element of the given name. Returns undefined if the position is not inside the desired parent.
  *
- * @param {String} parentName Name of parent element to find.
- * @param {module:engine/model/position~Position|module:engine/model/position~Position} position Position to start searching.
+ * @param {String} parentName The name of the parent element to find.
+ * @param {module:engine/model/position~Position|module:engine/model/position~Position} position The position to start searching.
  * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  */
 export function findAncestor( parentName, position ) {
@@ -31,11 +31,11 @@ export function findAncestor( parentName, position ) {
 /**
  * A common method to update the numeric value. If a value is the default one, it will be unset.
  *
- * @param {String} key Attribute key.
+ * @param {String} key An attribute key.
  * @param {*} value The new attribute value.
- * @param {module:engine/model/item~Item} item Model item on which the attribute will be set.
+ * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
  * @param {module:engine/model/writer~Writer} writer
- * @param {*} defaultValue Default attribute value. If a value is lower or equal, it will be unset.
+ * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
  */
 export function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
 	if ( value > defaultValue ) {
@@ -46,11 +46,11 @@ export function updateNumericAttribute( key, value, item, writer, defaultValue =
 }
 
 /**
- * Common method to create empty table cell - it will create proper model structure as table cell must have at least one block inside.
+ * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
  *
- * @param {module:engine/model/writer~Writer} writer Model writer.
- * @param {module:engine/model/position~Position} insertPosition Position at which table cell should be inserted.
- * @param {Object} attributes Element's attributes.
+ * @param {module:engine/model/writer~Writer} writer The model writer.
+ * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
+ * @param {Object} attributes The element attributes.
  */
 export function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
 	const tableCell = writer.createElement( 'tableCell', attributes );
@@ -63,7 +63,7 @@ export function createEmptyTableCell( writer, insertPosition, attributes = {} )
  *
  * If a string is passed, it is treated as a single value (pass-through).
  *
- *		// returns 'foo':
+ *		// Returns 'foo':
  *		getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );
  *		getSingleValue( 'foo' );
  *