8
0
Piotrek Koszuliński 9 лет назад
Родитель
Сommit
44f6ac3232

+ 42 - 40
packages/ckeditor5-list/src/converters.js

@@ -1,8 +1,10 @@
 /**
- * The list indent command. It is used by the {@link list.List list feature}.
- *
- * @memberOf list
- * @namespace list.converters
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module list/converters
  */
 
 import ViewListItemElement from './viewlistitemelement.js';
@@ -135,10 +137,10 @@ function injectViewList( modelItem, injectedItem, mapper ) {
  * It creates `<ul><li></li><ul>` (or `<ol>`) view structure out of `listItem` model element, inserts it at correct
  * position, and merges the list with surrounding lists (if able).
  *
- * @see engine.conversion.ModelConversionDispatcher#event:insert
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:insert
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewInsertion( evt, data, consumable, conversionApi ) {
@@ -165,10 +167,10 @@ export function modelViewInsertion( evt, data, consumable, conversionApi ) {
  * This change means that `<li>`s parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished by breaking
  * view elements, changing their name and merging them.
  *
- * @see engine.conversion.ModelConversionDispatcher#event:changeAttribute
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:changeAttribute
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewChangeType( evt, data, consumable, conversionApi ) {
@@ -197,10 +199,10 @@ export function modelViewChangeType( evt, data, consumable, conversionApi ) {
 /**
  * Model to view converter for `listItem` model element remove.
  *
- * @see engine.conversion.ModelConversionDispatcher#event:remove
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:remove
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewRemove( evt, data, consumable, conversionApi ) {
@@ -223,10 +225,10 @@ export function modelViewRemove( evt, data, consumable, conversionApi ) {
 /**
  * Model to view converter for `listItem` model element move.
  *
- * @see engine.conversion.ModelConversionDispatcher#event:move
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:move
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewMove( evt, data, consumable, conversionApi ) {
@@ -263,10 +265,10 @@ export function modelViewMove( evt, data, consumable, conversionApi ) {
 /**
  * Model to view converter for `indent` attribute change on `listItem` model element.
  *
- * @see engine.conversion.ModelConversionDispatcher#event:changeAttribute
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:changeAttribute
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewChangeIndent( evt, data, consumable, conversionApi ) {
@@ -296,7 +298,7 @@ export function modelViewChangeIndent( evt, data, consumable, conversionApi ) {
 }
 
 /**
- * A special model to view converter introduced by {@link list.List List feature}. This converter is fired for
+ * A special model to view converter introduced by {@link module:list/list~List List feature}. This converter is fired for
  * insert change of every model item, and should be fired before actual converter. The converter checks whether inserted
  * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
  * list so the model element is inserted to the view parent element corresponding to its model parent element.
@@ -314,10 +316,10 @@ export function modelViewChangeIndent( evt, data, consumable, conversionApi ) {
  *		<paragraph>xxx</paragraph>       // Instead of this wrong view state:
  *		<listItem>bar</listItem>         <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
  *
- * @see engine.conversion.ModelConversionDispatcher#event:insert
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:insert
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewSplitOnInsert( evt, data, consumable, conversionApi ) {
@@ -340,7 +342,7 @@ export function modelViewSplitOnInsert( evt, data, consumable, conversionApi ) {
 }
 
 /**
- * A special model to view converter introduced by {@link list.List List feature}. This converter takes care of
+ * A special model to view converter introduced by {@link module:list/list~List List feature}. This converter takes care of
  * merging view lists after something is removed or moved from near them.
  *
  * Example:
@@ -356,11 +358,11 @@ export function modelViewSplitOnInsert( evt, data, consumable, conversionApi ) {
  *		                                     <li>bar</li>
  *		                                 </ul>
  *
- * @see engine.conversion.ModelConversionDispatcher#event:remove
- * @see engine.conversion.ModelConversionDispatcher#event:move
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:remove
+ * @see module:engine/conversion/modelconversiondispatcher~ModelConversionDispatcher#event:move
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Additional information about the change.
- * @param {engine.conversion.ModelConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface.
  */
 export function modelViewMergeAfter( evt, data, consumable, conversionApi ) {
@@ -381,10 +383,10 @@ export function modelViewMergeAfter( evt, data, consumable, conversionApi ) {
  * * checks `<li>`'s parent,
  * * passes `data.indent` value when `<li>`'s sub-items are converted.
  *
- * @see engine.conversion.ViewConversionDispatcher#event:element
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/viewconversiondispatcher~ViewConversionDispatcher#event:element
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Object containing conversion input and a placeholder for conversion output and possibly other values.
- * @param {engine.conversion.ViewConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/viewconsumable~ViewConsumable} consumable Values to consume.
  * @param {Object} conversionApi Conversion interface to be used by callback.
  */
 export function viewModelConverter( evt, data, consumable, conversionApi ) {
@@ -439,10 +441,10 @@ export function viewModelConverter( evt, data, consumable, conversionApi ) {
  * This is mostly to clean white spaces from between `<li>` view elements inside the view list element, however also
  * incorrect data can be cleared if the view was incorrect.
  *
- * @see engine.conversion.ViewConversionDispatcher#event:element
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/viewconversiondispatcher~ViewConversionDispatcher#event:element
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Object containing conversion input and a placeholder for conversion output and possibly other values.
- * @param {engine.conversion.ViewConsumable} consumable Values to consume.
+ * @param {module:engine/conversion/viewconsumable~ViewConsumable} consumable Values to consume.
  */
 export function cleanList( evt, data, consumable ) {
 	if ( consumable.test( data.input, { name: true } ) ) {
@@ -458,12 +460,12 @@ export function cleanList( evt, data, consumable ) {
 }
 
 /**
- * Callback for model position to view position mapping for {@link engine.conversion.Mapper}. The callback fixes positions
+ * Callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes positions
  * between `listItem` elements, that would be incorrectly mapped because of how list items are represented in model
  * and view.
  *
- * @see engine.conversion.Mapper#event:modelToViewPosition
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/mapper~Mapper#event:modelToViewPosition
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Object containing additional data and placeholder for mapping result.
  */
 export function modelToViewPosition( evt, data ) {
@@ -488,12 +490,12 @@ export function modelToViewPosition( evt, data ) {
 }
 
 /**
- * Callback for view position to model position mapping for {@link engine.conversion.Mapper}. The callback fixes positions
+ * Callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes positions
  * between `<li>` elements, that would be incorrectly mapped because of how list items are represented in model
  * and view.
  *
- * @see engine.conversion.Mapper#event:viewToModelPosition
- * @param {utils.EventInfo} evt Object containing information about the fired event.
+ * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
+ * @param {module:utils/eventinfo~EventInfo} evt Object containing information about the fired event.
  * @param {Object} data Object containing additional data and placeholder for mapping result.
  */
 export function viewToModelPosition( evt, data ) {

+ 6 - 3
packages/ckeditor5-list/src/indentcommand.js

@@ -3,20 +3,23 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module list/indentcommand
+ */
+
 import Command from '../core/command/command.js';
 import { getClosestListItem } from './utils.js';
 
 /**
- * The list indent command. It is used by the {@link list.List list feature}.
+ * The list indent command. It is used by the {@link module:list/list~List list feature}.
  *
- * @memberOf list
  * @extends core.command.Command
  */
 export default class IndentCommand extends Command {
 	/**
 	 * Creates an instance of the command.
 	 *
-	 * @param {core.editor.Editor} editor Editor instance.
+	 * @param {module:core/editor/editor~Editor} editor Editor instance.
 	 * @param {'forward'|'backward'} indentDirection Direction of indent. If it is equal to `backward`, the command
 	 * will outdent a list item.
 	 */

+ 6 - 3
packages/ckeditor5-list/src/list.js

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module list/list
+ */
+
 import Plugin from '../core/plugin.js';
 import ListEngine from './listengine.js';
 import ButtonView from '../ui/button/buttonview.js';
@@ -12,10 +16,9 @@ import { parseKeystroke } from '../utils/keyboard.js';
  * The lists feature. It introduces the `numberedList` and `bulletedList` buttons which
  * allows to convert paragraphs to/from list items and indent/outdent them.
  *
- * See also {@link list.ListEngine}.
+ * See also {@link module:list/list~ListEngine}.
  *
- * @memberOf list
- * @extends core.Plugin
+ * @extends module:core/plugin~Plugin
  */
 export default class List extends Plugin {
 	/**

+ 10 - 7
packages/ckeditor5-list/src/listcommand.js

@@ -3,20 +3,23 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module list/listcommand
+ */
+
 import Command from '../core/command/command.js';
 import { getClosestListItem, getSelectedBlocks, getPositionBeforeBlock } from './utils.js';
 
 /**
- * The list command. It is used by the {@link list.List list feature}.
+ * The list command. It is used by the {@link module:list/list~List list feature}.
  *
- * @memberOf list
- * @extends core.command.Command
+ * @extends module:core/command/command~Command
  */
 export default class ListCommand extends Command {
 	/**
 	 * Creates an instance of the command.
 	 *
-	 * @param {core.editor.Editor} editor Editor instance.
+	 * @param {module:core/editor/editor~Editor} editor Editor instance.
 	 * @param {'numbered'|'bulleted'} type List type that will be handled by this command.
 	 */
 	constructor( editor, type ) {
@@ -26,7 +29,7 @@ export default class ListCommand extends Command {
 		 * The type of list created by the command.
 		 *
 		 * @readonly
-		 * @member {'numbered'|'bulleted'} list.ListCommand#type
+		 * @member {'numbered'|'bulleted'}
 		 */
 		this.type = type == 'bulleted' ? 'bulleted' : 'numbered';
 
@@ -34,7 +37,7 @@ export default class ListCommand extends Command {
 		 * Flag indicating whether the command is active, which means that selection starts in a list of the same type.
 		 *
 		 * @observable
-		 * @member {Boolean} list.ListCommand#value
+		 * @member {Boolean}
 		 */
 		this.set( 'value', false );
 
@@ -64,7 +67,7 @@ export default class ListCommand extends Command {
 	 *
 	 * @protected
 	 * @param {Object} [options] Options for executed command.
-	 * @param {engine.model.Batch} [options.batch] Batch to collect all the change steps.
+	 * @param {module:engine/model/batch~Batch} [options.batch] Batch to collect all the change steps.
 	 * New batch will be created if this option is not set.
 	 */
 	_doExecute( options = {} ) {

+ 5 - 2
packages/ckeditor5-list/src/listengine.js

@@ -3,6 +3,10 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module list/listengine
+ */
+
 import Plugin from '../core/plugin.js';
 import ListCommand from './listcommand.js';
 import IndentCommand from './indentcommand.js';
@@ -25,8 +29,7 @@ import {
  * The engine of the lists feature. It handles creating, editing and removing lists and list items.
  * It registers the `numberedList`, `bulletedList`, `indentList` and `outdentList` commands.
  *
- * @memberOf list
- * @extends core.Plugin
+ * @extends module:core/plugin~Plugin
  */
 export default class ListEngine extends Plugin {
 	/**

+ 10 - 13
packages/ckeditor5-list/src/utils.js

@@ -6,19 +6,17 @@
 /**
  * Utilities used in modules from {@link list list} package.
  *
- * @memberOf list
- * @namespace list.utils
+ * @module list/utils
  */
 
 import Position from '../engine/model/position.js';
 
 /**
- * For given {@link engine.model.Position position}, returns the closest ancestor of that position which is a
+ * For given {@link module:engine/model/position~Position position}, returns the closest ancestor of that position which is a
  * `listItem` element.
  *
- * @function list.utils.getClosestListItem
- * @param {engine.model.Position} position Position which ancestor should be check looking for `listItem` element.
- * @returns {engine.model.Element|null} Element with `listItem` name that is a closest ancestor of given `position`, or
+ * @param {module:engine/model/position~Position} position Position which ancestor should be check looking for `listItem` element.
+ * @returns {module:engine/model/element~Element|null} Element with `listItem` name that is a closest ancestor of given `position`, or
  * `null` if neither of `position` ancestors is a `listItem`.
  */
 export function getClosestListItem( position ) {
@@ -26,13 +24,12 @@ export function getClosestListItem( position ) {
 }
 
 /**
- * For given {@link engine.model.Selection selection} and {@link engine.model.Schema schema}, returns an array with
- * all elements that are in the selection and are extending `$block` schema item.
+ * For given {@link module:engine/model/selection~Selection selection} and {@link module:engine/model/schema~Schema schema},
+ * returns an array with all elements that are in the selection and are extending `$block` schema item.
  *
- * @function list.utils.getSelectedBlocks
- * @param {engine.model.Selection} selection Selection from which blocks will be taken.
- * @param {engine.model.Schema} schema Schema which will be used to check if a model element extends `$block`.
- * @returns {Array.<engine.model.Element>} All blocks from the selection.
+ * @param {module:engine/model/selection~Selection} selection Selection from which blocks will be taken.
+ * @param {module:engine/model/schema~Schema} schema Schema which will be used to check if a model element extends `$block`.
+ * @returns {Array.<module:engine/model/element~Element>} All blocks from the selection.
  */
 export function getSelectedBlocks( selection, schema ) {
 	let position = getPositionBeforeBlock( selection.getFirstPosition(), schema );
@@ -53,7 +50,7 @@ export function getSelectedBlocks( selection, schema ) {
 }
 
 /**
- * For given {@link engine.model.Position position}, finds a model element extending `$block` schema item which is
+ * For given {@link module:engine/model/position~Position position}, finds a model element extending `$block` schema item which is
  * closest element to that position. First node after the position is checked and then the position's ancestors. `null`
  * is returned if such element has not been found or found element is a root element.
  *

+ 4 - 1
packages/ckeditor5-list/src/viewlistitemelement.js

@@ -3,13 +3,16 @@
  * For licensing, see LICENSE.md.
  */
 
+/**
+ * @module list/viewlistitemelement
+ */
+
 import ViewContainerElement from '../engine/view/containerelement.js';
 
 /**
  * View element class representing list item (`<li>`). It extends {@link engine.view.ContainerElement} and overwrites
  * {@link list.ViewListItemElement#getFillerOffset evaluating whether filler offset} is needed.
  *
- * @memberOf list
  * @extends engine.view.ContainerElement
  */
 export default class ViewListItemElement extends ViewContainerElement {