Browse Source

Rename decorator's 'options' to 'definitiaon' to have more apropriate name.

Mateusz Samsel 6 years ago
parent
commit
69acbb857d

+ 10 - 10
packages/ckeditor5-link/src/link.js

@@ -65,12 +65,12 @@ export default class Link extends Plugin {
  * which extends all external links with the `target` and `rel` attributes without additional configuration.
  *
  * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated
- * {@link module:link/link~LinkDecoratorManualOption manual} decorator must be defined in the
+ * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the
  * {@link module:link/link~LinkConfig#decorators `config.link.decodators`} array. In such scenario,
  * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.
  *
- * **Note**: It is possible to add other {@link module:link/link~LinkDecoratorAutomaticOption automatic}
- * or {@link module:link/link~LinkDecoratorManualOption manual} link decorators when this option is active.
+ * **Note**: It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
+ * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.
  *
  * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}
  * reference.
@@ -83,9 +83,9 @@ export default class Link extends Plugin {
  * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are
  * two types of link decorators:
  *
- * * {@link module:link/link~LinkDecoratorAutomaticOption automatic} – they match links against pre–defined rules and
+ * * {@link module:link/link~LinkDecoratorAutomaticDefinition automatic} – they match links against pre–defined rules and
  * manage their attributes based on the results,
- * * {@link module:link/link~LinkDecoratorManualOption manual} – they allow users to control link attributes individually
+ * * {@link module:link/link~LinkDecoratorManualDefinition manual} – they allow users to control link attributes individually
  *  using the editor UI.
  *
  * Link decorators are defined as an array of objects:
@@ -111,8 +111,8 @@ export default class Link extends Plugin {
  *			]
  *		}
  *
- * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticOption automatic}
- * and {@link module:link/link~LinkDecoratorManualOption manual} decorator option reference.
+ * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
+ * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
  *
  * **Warning:** Currently, link decorators work independently and no conflict resolution mechanism exists.
  * For example, configuring the `target` attribute using both an automatic and a manual decorator at a time could end up with a
@@ -123,7 +123,7 @@ export default class Link extends Plugin {
  * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  * configuration description to learn more.
  *
- * @member {Array.<module:link/link~LinkDecoratorAutomaticOption|module:link/link~LinkDecoratorManualOption>}
+ * @member {Array.<module:link/link~LinkDecoratorAutomaticDefinition|module:link/link~LinkDecoratorManualDefinition>}
  * module:link/link~LinkConfig#decorators
  */
 
@@ -151,7 +151,7 @@ export default class Link extends Plugin {
  * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  * configuration description to learn more.
  *
- * @typedef {Object} module:link/link~LinkDecoratorAutomaticOption
+ * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition
  * @property {'automatic'} mode The kind of the decorator. `'automatic'` for all automatic decorators.
  * @property {Function} callback Takes an `url` as a parameter and returns `true` if the `attributes` should be applied to the link.
  * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
@@ -176,7 +176,7 @@ export default class Link extends Plugin {
  *			}
  *		}
  *
- * @typedef {Object} module:link/link~LinkDecoratorManualOption
+ * @typedef {Object} module:link/link~LinkDecoratorManualDefinition
  * @property {'automatic'} mode The kind of the decorator. `'manual'` for all manual decorators.
  * @property {String} label The label of the UI button the user can use to control the presence of link attributes.
  * @property {Object} attributes Key-value pairs used as link attributes added to the output during the

+ 4 - 4
packages/ckeditor5-link/src/linkediting.js

@@ -90,7 +90,7 @@ export default class LinkEditing extends Plugin {
 	}
 
 	/**
-	 * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticOption automatic decorators}
+	 * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}
 	 * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
 	 * for each one of them. Downcast dispatchers are obtained using the
 	 * {@link module:link/utils~AutomaticDecorators#getDispatcher} method.
@@ -99,7 +99,7 @@ export default class LinkEditing extends Plugin {
 	 * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
 	 *
 	 * @private
-	 * @param {Array.<module:link/link~LinkDecoratorAutomaticOption>} automaticDecoratorDefinitions
+	 * @param {Array.<module:link/link~LinkDecoratorAutomaticDefinition>} automaticDecoratorDefinitions
 	 */
 	_enableAutomaticDecorators( automaticDecoratorDefinitions ) {
 		const editor = this.editor;
@@ -125,7 +125,7 @@ export default class LinkEditing extends Plugin {
 	}
 
 	/**
-	 * Processes an array of configured {@link module:link/link~LinkDecoratorManualOption manual decorators}
+	 * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators}
 	 * and transforms them into {@link module:link/utils~ManualDecorator} instances and stores them in the
 	 * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
 	 *
@@ -134,7 +134,7 @@ export default class LinkEditing extends Plugin {
 	 * with adequate model attributes.
 	 *
 	 * @private
-	 * @param {Array.<module:link/link~LinkDecoratorManualOption>} manualDecoratorDefinitions
+	 * @param {Array.<module:link/link~LinkDecoratorManualDefinition>} manualDecoratorDefinitions
 	 */
 	_enableManualDecorators( manualDecoratorDefinitions ) {
 		if ( !manualDecoratorDefinitions.length ) {

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

@@ -8,13 +8,13 @@
  */
 
 /**
- * Helper class which tight together all {@link module:link/link~LinkDecoratorAutomaticOption} and provides
+ * Helper class which tight together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides
  * a {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatcher} for them.
  */
 export default class AutomaticDecorators {
 	constructor() {
 		/**
-		 * Stores definition of {@link module:link/link~LinkDecoratorAutomaticOption automatic decorators}.
+		 * Stores definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.
 		 * Those data are used as source for a downcast dispatcher to make proper conversion to output data.
 		 *
 		 * @private
@@ -37,7 +37,7 @@ export default class AutomaticDecorators {
 	/**
 	 * Add automatic decorator objects or array with them to be used during downcasting.
 	 *
-	 * @param {module:link/link~LinkDecoratorAutomaticOption|Array.<module:link/link~LinkDecoratorAutomaticOption>} item
+	 * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.<module:link/link~LinkDecoratorAutomaticDefinition>} item
 	 * configuration object of automatic rules for decorating links. It might be also array of such objects.
 	 */
 	add( item ) {