ソースを参照

Update docs descriptions.

Mateusz Samsel 6 年 前
コミット
18b9762186

+ 8 - 7
packages/ckeditor5-link/src/link.js

@@ -102,7 +102,7 @@ export default class Link extends Plugin {
 /**
  * This object defining automatic decorator for the links. Based on this option data pipeline will extend links with proper attributes.
  * For example, you can define rules, when attribute `target="_blank"` will be added to links.
- * There is a default option which might be activated with {@link module:link/link~LinkConfig#targetDecorator},
+ * Please notice that, there is a default option which can be activated with {@link module:link/link~LinkConfig#targetDecorator},
  * which automatically adds attributes:
  *   * `target="_blank"`
  *   * `rel="noopener noreferrer"`
@@ -124,15 +124,15 @@ export default class Link extends Plugin {
  * @property {Function} callback takes `url` as parameter and should return `true`
  * for urls that be decorate with this decorator.
  * @property {Object} attributes key-value pairs used as attributes added to anchor during downcasting.
+ * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  */
 
 /**
- * This object defining manual decorator for the links. Based on this options, there will be added UI switches do link balloon.
- * User will be able activate pre-configured attributes for the link by simple switch button change.
- * For example, you can define rules, when attribute `target="_blank"` will be added to links, which adds attributes
- * when user select proper options in UI:
- *   * `target="_blank"`
- *   * `rel="noopener noreferrer"`
+ * This object defining manual decorator for the links. Based on this options, there will be added UI switches to link balloon.
+ * User will be able to activate pre-configured attributes for the link by simple switch button change.
+ *
+ * For example, you can define decorator, which show up switch responsible for adding attributes `target="_blank"` and
+ * `rel="noopener noreferrer"` when user select proper options in UI.
  *
  *```js
  *	{
@@ -149,4 +149,5 @@ export default class Link extends Plugin {
  * @property {'manual'} mode it should has always string value 'manual' for manual decorators
  * @property {String} label the label for ui switch, which will be responsible for activation of given attributes set
  * @property {Object} attributes key-value pairs used as attributes added to anchor during downcasting.
+ * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  */

+ 3 - 2
packages/ckeditor5-link/src/linkcommand.js

@@ -30,8 +30,9 @@ export default class LinkCommand extends Command {
 		super( editor );
 
 		/**
-		 * Keeps collection of {@link module:link/utils/manualdecorator~ManualDecorator}
-		 * recognized in {@link module:link/link~LinkConfig#decorators}.
+		 * Keeps collection of {@link module:link/utils~ManualDecorator}
+		 * recognized from {@link module:link/link~LinkConfig#decorators}.
+		 * You can consider it as a model of states for custom attributes added to links.
 		 *
 		 * @readonly
 		 * @type {module:utils/collection~Collection}

+ 6 - 3
packages/ckeditor5-link/src/linkediting.js

@@ -90,10 +90,13 @@ export default class LinkEditing extends Plugin {
 
 	/**
 	 * Method process {@link module:link/link~LinkDecoratorAutomaticOption} by creating instance of
-	 * {@link module:link/utils/automaticdecorators~AutomaticDecorators}. If there are available automatic decorators, then
+	 * {@link module:link/utils~AutomaticDecorators}. If there are available automatic decorators, then
 	 * there is registered {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to handle
 	 * those configurations.
 	 *
+	 * Please notice, that automatic decorator will be also added, when {@link module:link/link~LinkConfig#targetDecorator}
+	 * will be set to `true`.
+	 *
 	 * @private
 	 * @param {Array.<module:link/link~LinkDecoratorAutomaticOption>} automaticDecoratorDefinitions
 	 */
@@ -123,11 +126,11 @@ export default class LinkEditing extends Plugin {
 
 	/**
 	 * Method process {@link module:link/link~LinkDecoratorManualOption} by transformation those configuration options into
-	 * {@link module:link/utils/manualdecorator~ManualDecorator}. Manual decorators are added to
+	 * {@link module:link/utils~ManualDecorator}. Manual decorators are added to
 	 * {@link module:link/linkcommand~LinkCommand#customAttributes} collections, which might be considered as a model
 	 * for manual decorators state. It also provides proper
 	 * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attributeToElement} converter for each
-	 * manual decorator and extends model schema with adequate attributes.
+	 * manual decorator and extends {@link module:engine/model/schema~Schema model's schema} with adequate model attributes.
 	 *
 	 * @private
 	 * @param {Array.<module:link/link~LinkDecoratorManualOption>} manualDecoratorDefinitions

+ 4 - 4
packages/ckeditor5-link/src/utils/automaticdecorators.js

@@ -4,7 +4,7 @@
  */
 
 /**
- * @module link/utils/automaticdecorators
+ * @module link/utils
  */
 
 /**
@@ -23,7 +23,7 @@ export default class AutomaticDecorators {
 	}
 
 	/**
-	 * Gives information how many decorators is stored in {@link module:link/utils/automaticdecorators~AutomaticDecorators} instance.
+	 * Gives information how many decorators is stored in {@link module:link/utils~AutomaticDecorators} instance.
 	 *
 	 * @readonly
 	 * @protected
@@ -36,8 +36,8 @@ export default class AutomaticDecorators {
 	/**
 	 * Add item or array of items with automatic rules for applying decorators to link plugin.
 	 *
-	 * @param {Object|Array.<Object>} item configuration object of automatic rules for decorating links.
-	 * It might be also array of such objects.
+	 * @param {module:link/link~LinkDecoratorAutomaticOption|Array.<module:link/link~LinkDecoratorAutomaticOption>} item
+	 * configuration object of automatic rules for decorating links. It might be also array of such objects.
 	 */
 	add( item ) {
 		if ( Array.isArray( item ) ) {

+ 4 - 4
packages/ckeditor5-link/src/utils/manualdecorator.js

@@ -4,21 +4,21 @@
  */
 
 /**
- * @module link/utils/manualdecorator
+ * @module link/utils
  */
 
 import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
 
 /**
- * Class which stores manual decorators with observable {@link module:link/utils/manualdecorator~ManualDecorator#value}
+ * Class which stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}
  * to handle integration with ui state.
  *
  * @mixes module:utils/observablemixin~ObservableMixin
  */
 export default class ManualDecorator {
 	/**
-	 * Creates new instance of {@link module:link/utils/manualdecorator~ManualDecorator}.
+	 * Creates new instance of {@link module:link/utils~ManualDecorator}.
 	 *
 	 * @param {Object} config
 	 * @param {String} config.id Manual decorator id, which is a name of attribute in model, for example 'linkManualDecorator0'.
@@ -38,7 +38,7 @@ export default class ManualDecorator {
 		 * Value of current manual decorator. It reflects its state from UI.
 		 *
 		 * @observable
-		 * @member {Boolean} module:link/utils/manualdecorator~ManualDecorator#value
+		 * @member {Boolean} module:link/utils~ManualDecorator#value
 		 */
 		this.set( 'value' );