Browse Source

Merge pull request #7642 from ckeditor/i/7575

Docs: Align API docs to new API docs extractor, fix minor issues. Part of #7575.
Kamil Piechaczek 5 years ago
parent
commit
ec2b8a758a

+ 3 - 3
docs/framework/guides/architecture/ui-library.md

@@ -310,7 +310,7 @@ The dropdown panel exposes its {@link module:ui/dropdown/dropdownpanelview~Dropd
 
 The framework provides a set of helpers to make the dropdown creation process easier, although it is still possible to compose a custom dropdown from scratch using the base classes.
 
-The {@link module:ui/dropdown/utils#createDropdown} helper creates a {@link module:ui/dropdown/dropdownview~DropdownView} with either a {@link module:ui/button/buttonview~ButtonView} or a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView}.
+The {@link module:ui/dropdown/utils~createDropdown} helper creates a {@link module:ui/dropdown/dropdownview~DropdownView} with either a {@link module:ui/button/buttonview~ButtonView} or a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView}.
 
 ```js
 import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
@@ -376,7 +376,7 @@ dropdownView.buttonView.set( {
 
 #### Adding a list to a dropdown
 
-The {@link module:ui/list/listview~ListView} can be added to a dropdown using the {@link module:ui/dropdown/utils#addListToDropdown} helper.
+The {@link module:ui/list/listview~ListView} can be added to a dropdown using the {@link module:ui/dropdown/utils~addListToDropdown} helper.
 
 ```js
 import Model from '@ckeditor/ckeditor5-ui/src/model';
@@ -411,7 +411,7 @@ addListToDropdown( dropdownView, items );
 
 #### Adding a toolbar to a dropdown
 
-A {@link module:ui/toolbar/toolbarview~ToolbarView} can be added to a dropdown using  the {@link module:ui/dropdown/utils#addToolbarToDropdown} helper.
+A {@link module:ui/toolbar/toolbarview~ToolbarView} can be added to a dropdown using  the {@link module:ui/dropdown/utils~addToolbarToDropdown} helper.
 
 ```js
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';

+ 1 - 1
docs/framework/guides/deep-dive/localization.md

@@ -149,7 +149,7 @@ Adding translations to the editor can be done in three ways to satisfy various n
 
 ### Using the `add()` function
 
-The first option for adding translations is via {@link module:utils/translation-service.add the translation-service's `add()` helper}. This utility adds translations to the global `window.CKEDITOR_TRANSLATIONS` object by extending it. Since it needs to be imported, it works only before building the editor.
+The first option for adding translations is via {@link module:utils/translation-service~add the translation-service's `add()` helper}. This utility adds translations to the global `window.CKEDITOR_TRANSLATIONS` object by extending it. Since it needs to be imported, it works only before building the editor.
 
 Starting with the CKEditor 5 v19.0.0 release, the `add()` method now accepts an optional `getPluralForm()` function as the third argument. This function is only needed for defining the plural form if no language file was loaded for a particular language. It also accepts an array of translations for a *message* if the *message* should support singular and plural forms.
 

+ 1 - 1
docs/framework/guides/development-tools.md

@@ -90,7 +90,7 @@ They allow for "stringifying" the {@link framework/guides/architecture/editing-e
 	Both tools are designed for prototyping, debugging, and testing purposes. Do not use them in production-grade code.
 </info-box>
 
-For instance, to take a peek at the editor model, you could use the {@link module:engine/dev-utils/model#static-function-getData `getData()`} helper:
+For instance, to take a peek at the editor model, you could use the {@link module:engine/dev-utils/model~getData `getData()`} helper:
 
 ```js
 import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';

+ 1 - 1
packages/ckeditor5-autosave/src/autosave.js

@@ -139,7 +139,7 @@ export default class Autosave extends Plugin {
 		 * Editor's pending actions manager.
 		 *
 		 * @private
-		 * @member {@module:core/pendingactions~PendingActions} #_pendingActions
+		 * @member {module:core/pendingactions~PendingActions} #_pendingActions
 		 */
 	}
 

+ 2 - 0
packages/ckeditor5-core/src/editor/editor.js

@@ -90,6 +90,8 @@ export default class Editor {
 		this.plugins = new PluginCollection( this, availablePlugins, this._context.plugins );
 
 		/**
+		 * The locale instance.
+		 *
 		 * @readonly
 		 * @type {module:utils/locale~Locale}
 		 */

+ 0 - 3
packages/ckeditor5-engine/src/model/position.js

@@ -146,9 +146,6 @@ export default class Position {
 		return this.path[ this.path.length - 1 ];
 	}
 
-	/**
-	 * @param {Number} newOffset
-	 */
 	set offset( newOffset ) {
 		this.path[ this.path.length - 1 ] = newOffset;
 	}

+ 1 - 1
packages/ckeditor5-engine/src/model/treewalker.js

@@ -410,5 +410,5 @@ function formatReturnValue( type, item, previousPosition, nextPosition, length )
 /**
  * Tree walking directions.
  *
- * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection
+ * @typedef {'forward'|'backward'} module:engine/model/treewalker~TreeWalkerDirection
  */

+ 2 - 0
packages/ckeditor5-engine/src/view/filler.js

@@ -64,6 +64,8 @@ export const INLINE_FILLER_LENGTH = 7;
 
 /**
  * Inline filler which is a sequence of the zero width spaces.
+ *
+ * @type {String}
  */
 export const INLINE_FILLER = ( () => {
 	let inlineFiller = '';

+ 5 - 8
packages/ckeditor5-engine/src/view/text.js

@@ -76,7 +76,9 @@ export default class Text extends Node {
 	}
 
 	/**
-	 * This getter is required when using the addition assignment operator on protected property:
+	 * The `_data` property is controlled by a getter and a setter.
+	 *
+	 * The getter is required when using the addition assignment operator on protected property:
 	 *
 	 *		const foo = downcastWriter.createText( 'foo' );
 	 *		const bar = downcastWriter.createText( 'bar' );
@@ -86,6 +88,8 @@ export default class Text extends Node {
 	 *
 	 * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.
 	 *
+	 * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
+	 *
 	 * @protected
 	 * @type {String}
 	 */
@@ -93,13 +97,6 @@ export default class Text extends Node {
 		return this.data;
 	}
 
-	/**
-	 * Sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
-	 *
-	 * @protected
-	 * @fires change:text
-	 * @param {String} data New data for the text node.
-	 */
 	set _data( data ) {
 		this._fireChange( 'text', this );
 

+ 1 - 9
packages/ckeditor5-media-embed/src/ui/mediaformview.js

@@ -210,20 +210,12 @@ export default class MediaFormView extends View {
 	 * **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}
 	 * which works one way only and may not represent the actual state of the component in the DOM.
 	 *
-	 * @type {Number}
+	 * @type {String}
 	 */
 	get url() {
 		return this.urlInputView.fieldView.element.value.trim();
 	}
 
-	/**
-	 * Sets the native DOM `value` of the {@link #urlInputView} element.
-	 *
-	 * **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}
-	 * which works one way only and may not represent the actual state of the component in the DOM.
-	 *
-	 * @param {String} url
-	 */
 	set url( url ) {
 		this.urlInputView.fieldView.element.value = url.trim();
 	}

+ 2 - 0
packages/ckeditor5-mention/src/ui/domwrapperview.js

@@ -13,6 +13,8 @@ import View from '@ckeditor/ckeditor5-ui/src/view';
  * This class wraps DOM element as a CKEditor5 UI View.
  *
  * It allows to render any DOM element and use it in mentions list.
+ *
+ * @extends {module:ui/view~View}
  */
 export default class DomWrapperView extends View {
 	/**

+ 1 - 1
packages/ckeditor5-typing/src/deletecommand.js

@@ -43,7 +43,7 @@ export default class DeleteCommand extends Command {
 		 *
 		 * @readonly
 		 * @private
-		 * @member {typing.ChangeBuffer} #buffer
+		 * @type {module:typing/utils/changebuffer~ChangeBuffer}
 		 */
 		this._buffer = new ChangeBuffer( editor.model, editor.config.get( 'typing.undoStep' ) );
 	}

+ 3 - 3
packages/ckeditor5-ui/src/editableui/editableuiview.js

@@ -59,7 +59,7 @@ export default class EditableUIView extends View {
 		 * The element which is the main editable element (usually the one with `contentEditable="true"`).
 		 *
 		 * @private
-		 * @member {HTMLElement} #_editableElement
+		 * @type {HTMLElement}
 		 */
 		this._editableElement = editableElement;
 
@@ -68,7 +68,7 @@ export default class EditableUIView extends View {
 		 * the view will not render its {@link #template}.
 		 *
 		 * @private
-		 * @member {Boolean} #_hasExternalElement
+		 * @type {Boolean}
 		 */
 		this._hasExternalElement = !!this._editableElement;
 
@@ -81,7 +81,7 @@ export default class EditableUIView extends View {
 		 * the editable DOM element must remain under the full control of the engine to work properly.
 		 *
 		 * @protected
-		 * @member {module:engine/view/view~View} #isFocused
+		 * @type {module:engine/view/view~View}
 		 */
 		this._editingView = editingView;
 	}

+ 1 - 1
packages/ckeditor5-utils/src/keyboard.js

@@ -77,7 +77,7 @@ export function getCode( key ) {
 
 /**
  * Parses keystroke and returns a keystroke code that will match the code returned by
- * link {@link module:utils/keyboard.getCode} for a corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
+ * link {@link module:utils/keyboard~getCode} for a corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
  *
  * The keystroke can be passed in two formats:
  *

+ 1 - 1
packages/ckeditor5-watchdog/src/watchdog.js

@@ -49,7 +49,7 @@ export default class Watchdog {
 		 * * `destroyed` &ndash; A state when the item is manually destroyed by the user after calling `watchdog.destroy()`.
 		 *
 		 * @public
-		 * @member {'initializing'|'ready'|'crashed'|'crashedPermanently'|'destroyed'} #state
+		 * @type {'initializing'|'ready'|'crashed'|'crashedPermanently'|'destroyed'}
 		 */
 		this.state = 'initializing';
 

+ 0 - 2
packages/ckeditor5-widget/src/utils.js

@@ -44,7 +44,6 @@ export function isWidget( node ) {
 	return !!node.getCustomProperty( 'widget' );
 }
 
-/* eslint-disable max-len */
 /**
  * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
  *
@@ -91,7 +90,6 @@ export function isWidget( node ) {
  * @param {Boolean} [options.hasSelectionHandle=false] If `true`, the widget will have a selection handle added.
  * @returns {module:engine/view/element~Element} Returns the same element.
  */
-/* eslint-enable max-len */
 export function toWidget( element, writer, options = {} ) {
 	writer.setAttribute( 'contenteditable', 'false', element );
 

+ 1 - 1
packages/ckeditor5-word-count/src/wordcount.js

@@ -20,7 +20,7 @@ import env from '@ckeditor/ckeditor5-utils/src/env';
  * This plugin calculates all words and characters in all {@link module:engine/model/text~Text text nodes} available in the model.
  * It also provides an HTML element that updates its state whenever the editor content is changed.
  *
- * The model's data is first converted to plain text using {@link module:word-count/utils.modelElementToPlainText}.
+ * The model's data is first converted to plain text using {@link module:word-count/utils~modelElementToPlainText}.
  * The number of words and characters in your text are determined based on the created plain text. Please keep in mind
  * that every block in the editor is separated with a newline character, which is included in the calculation.
  *