Răsfoiți Sursa

Merge branch 'stable'

Piotrek Koszuliński 7 ani în urmă
părinte
comite
b7a3996f38

+ 1 - 1
packages/ckeditor5-font/README.md

@@ -9,7 +9,7 @@ CKEditor 5 font feature
 [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-font/status.svg)](https://david-dm.org/ckeditor/ckeditor5-font)
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-font/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-font?type=dev)
 
-This package implements font size support for CKEditor 5.
+This package implements font size and font family support for CKEditor 5.
 
 ## Documentation
 

+ 2 - 4
packages/ckeditor5-font/docs/_snippets/features/custom-font-family-options.html

@@ -1,13 +1,11 @@
 <link href="https://fonts.googleapis.com/css?family=Ubuntu|Ubuntu+Mono" rel="stylesheet">
 
 <div id="snippet-custom-font-family-options">
-	<h2>Font Family feature sample.</h2>
-
 	<p>
-		<span style="font-family: Ubuntu, Arial, sans-serif;">This text has "Ubuntu, Arial, Helvetica, sans-serif" font family set.</span>
+		<span style="font-family: Ubuntu, Arial, sans-serif;">This text has the "Ubuntu, Arial, sans-serif" font family set.</span>
 	</p>
 
 	<p>
-		<span style="font-family: 'Ubuntu Mono', 'Courier New', Courier, monospace;">This text has "Ubuntu Mono, Courier New, Courier, monospace" font family set.</span>
+		<span style="font-family: 'Ubuntu Mono', 'Courier New', Courier, monospace;">This text has the "Ubuntu Mono, Courier New, Courier, monospace" font family set.</span>
 	</p>
 </div>

+ 1 - 3
packages/ckeditor5-font/docs/_snippets/features/custom-font-size-named-options.html

@@ -1,8 +1,6 @@
 <div id="snippet-custom-font-size-named-options">
-	<h2>Font Size named options sample.</h2>
-
 	<p>
-		This is a mixed text with different sizes of text:
+		This is a mixed text with different font sizes:
 		<span class="text-small">small</span> and
 		<span class="text-big">big</span>
 	</p>

+ 0 - 2
packages/ckeditor5-font/docs/_snippets/features/custom-font-size-numeric-options.html

@@ -1,6 +1,4 @@
 <div id="snippet-custom-font-size-numeric-options">
-	<h2>Font Size feature numerical options sample.</h2>
-
 	<p><span style="font-size: 9px">9px</span></p>
 	<p><span style="font-size: 11px">11px</span></p>
 	<p><span style="font-size: 13px">13px</span></p>

+ 3 - 5
packages/ckeditor5-font/docs/_snippets/features/font.html

@@ -1,8 +1,6 @@
 <div id="snippet-font">
-	<h2>Font feature sample.</h2>
-
 	<p>
-		This is a mixed text with different sizes of text:
+		This is a mixed text with different font sizes:
 		<span class="text-tiny">tiny</span>,
 		<span class="text-small">small</span>,
 		<span class="text-big">big</span> and
@@ -10,11 +8,11 @@
 	</p>
 
 	<p>
-		<span style="font-family: Arial, Helvetica, sans-serif;">This text has "Arial, Helvetica, sans-serif" family set.</span>
+		<span style="font-family: Arial, Helvetica, sans-serif;">This text has the "Arial, Helvetica, sans-serif" family set.</span>
 	</p>
 
 	<p>
-		<span style="font-family: 'Courier New', Courier, monospace;">This text has "Courier New, Courier, monospace" family set.</span>
+		<span style="font-family: 'Courier New', Courier, monospace;">This text has the "Courier New, Courier, monospace" family set.</span>
 	</p>
 
 </div>

+ 1 - 1
packages/ckeditor5-font/docs/api/font.md

@@ -11,7 +11,7 @@ This package implements the font family and font size features for CKEditor 5.
 ## Documentation
 
 See the {@link features/font Font feature} guide 
-with corresponding {@link module:font/fontfamily~FontFamily} and {@link module:font/fontsize~FontSize} plugin documentation.
+with the corresponding {@link module:font/fontfamily~FontFamily} and {@link module:font/fontsize~FontSize} plugins documentation.
 
 ## Installation
 

+ 13 - 12
packages/ckeditor5-font/docs/features/font.md

@@ -6,8 +6,8 @@ category: features
 {@snippet features/build-font-source}
 
 The {@link module:font/font~Font} plugin enables the following features in the editor:
-* {@link module:font/fontfamily~FontFamily} – allows to change the font family by applying inline `<span>` elements with a `font-family` in the `style` attribute,
-* {@link module:font/fontsize~FontSize} – allows to control size by applying inline `<span>` elements that either have a CSS class or a `font-size` in the `style` attribute.
+* {@link module:font/fontfamily~FontFamily} &ndash; Allows to change the font family by applying inline `<span>` elements with a `font-family` in the `style` attribute.
+* {@link module:font/fontsize~FontSize} &ndash; Allows to control the font size by applying inline `<span>` elements that either have a CSS class or a `font-size` in the `style` attribute.
 
 ## Demo
 
@@ -17,9 +17,9 @@ The {@link module:font/font~Font} plugin enables the following features in the e
 
 It is possible to configure which font family options are supported by the editor. Use the {@link module:font/fontfamily~FontFamilyConfig#options `fontFamily.options`} configuration option to do so.
 
-Use the special `'default'` keyword to use the default `font-family` defined in the web page styles (removes any custom font family).
+Use the special `'default'` keyword to use the default font family defined in the web page styles. It removes any custom font family.
 
-For example, the following editor supports only two font families besides the "default" one:
+For example, the following editor supports only two font families besides the default one:
 
 ```js
 ClassicEditor
@@ -45,9 +45,9 @@ ClassicEditor
 
 It is possible to configure which font size options are supported by the editor. Use the {@link module:font/fontsize~FontSizeConfig#options `fontSize.options`} configuration option to do so.
 
-Use the special `'normal'` keyword to use the default font size defined in the web page styles (removes any custom size).
+Use the special `'normal'` keyword to use the default font size defined in the web page styles. It removes any custom font size.
 
-The font size feature supports two ways of defining configuration: using  predefined (named) presets or simple numeric values.
+The font size feature supports two ways of defining the configuration: using  predefined (named) presets or simple numeric values.
 
 ### Using the predefined presets
 
@@ -64,7 +64,7 @@ Each size is represented in the view as a `<span>` element with the `text-*` cla
 <span class="text-tiny">...</span>
 ```
 
-The CSS definition for the classes (presets) must be included in the web page's styles where the edited content is rendered.
+The CSS definition for the classes (presets) must be included in the web page styles where the edited content is rendered.
 
 Here is an example of the font size CSS classes:
 
@@ -147,13 +147,13 @@ ClassicEditor
 
 ## Installation
 
-To add this feature to your editor install the [`@ckeditor/ckeditor5-font`](https://www.npmjs.com/package/@ckeditor/ckeditor5-font) package:
+To add this feature to your editor, install the [`@ckeditor/ckeditor5-font`](https://www.npmjs.com/package/@ckeditor/ckeditor5-font) package:
 
-```
+```bash
 npm install --save @ckeditor/ckeditor5-font
 ```
 
-And add it to your plugin list and the toolbar configuration:
+Then add it to your plugin list and the toolbar configuration:
 
 ```js
 import Font from '@ckeditor/ckeditor5-font/src/font';
@@ -167,7 +167,7 @@ ClassicEditor
 	.catch( ... );
 ```
 
-or add one of the font features to your plugin list and the toolbar configuration:
+You can also add one of the font features to your plugin list and the toolbar configuration:
 
 ```js
 import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily';
@@ -249,7 +249,8 @@ The {@link module:font/fontsize~FontSize} plugin registers the following compone
 	// For named presets:
 	editor.execute( 'fontSize', { value: 'small' } );
 	```
-	passing an empty value will remove any `fontSize` set:
+	
+	Passing an empty value will remove any `fontSize` set:
 
 	```js
 	editor.execute( 'fontSize' );

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

@@ -17,7 +17,7 @@ import FontSize from './fontsize';
  * * {@link module:font/fontsize~FontSize},
  * * {@link module:font/fontfamily~FontFamily}.
  *
- * Read more about the feature in the {@glink api/font font package} page.
+ * For a detailed overview, check the {@glink features/font font feature} documentation.
  *
  * @extends module:core/plugin~Plugin
  */

+ 2 - 2
packages/ckeditor5-font/src/fontcommand.js

@@ -19,7 +19,7 @@ export default class FontCommand extends Command {
 	 * Creates an instance of the command.
 	 *
 	 * @param {module:core/editor/editor~Editor} editor Editor instance.
-	 * @param {String} attributeKey Name of an model attribute on which this command operates.
+	 * @param {String} attributeKey The name of a model attribute on which this command operates.
 	 */
 	constructor( editor, attributeKey ) {
 		super( editor );
@@ -58,7 +58,7 @@ export default class FontCommand extends Command {
 	 *
 	 * @protected
 	 * @param {Object} [options] Options for the executed command.
-	 * @param {String} [options.value] a value to apply.
+	 * @param {String} [options.value] The value to apply.
 	 * @fires execute
 	 */
 	execute( options = {} ) {

+ 11 - 9
packages/ckeditor5-font/src/fontfamily.js

@@ -17,6 +17,8 @@ import FontFamilyUI from './fontfamily/fontfamilyui';
  * It enables {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} and
  * {@link module:font/fontfamily/fontfamilyui~FontFamilyUI} features in the editor.
  *
+ * For a detailed overview, check the {@glink features/font font feature} documentation.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class FontFamily extends Plugin {
@@ -36,20 +38,20 @@ export default class FontFamily extends Plugin {
 }
 
 /**
- * Font family option descriptor.
+ * The font family option descriptor.
  *
  * @typedef {Object} module:font/fontfamily~FontFamilyOption
  *
  * @property {String} title The user-readable title of the option.
- * @property {String} model Attribute's unique value in the model.
+ * @property {String} model The attribute's unique value in the model.
  * @property {module:engine/view/elementdefinition~ElementDefinition} view View element configuration.
  * @property {Array.<module:engine/view/elementdefinition~ElementDefinition>} [upcastAlso] An array with all matched elements that
- * view to model conversion should also accept.
+ * the view-to-model conversion should also accept.
  */
 
 /**
  * The configuration of the font family feature.
- * Introduced by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
+ * It is introduced by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
  *
  * Read more in {@link module:font/fontfamily~FontFamilyConfig}.
  *
@@ -58,11 +60,11 @@ export default class FontFamily extends Plugin {
 
 /**
  * The configuration of the font family feature.
- * The option is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
+ * This option is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
  *
  *		ClassicEditor
  *			.create( {
- * 				fontFamily: ... // Font family feature config.
+ * 				fontFamily: ... // Font family feature configuration.
  *			} )
  *			.then( ... )
  *			.catch( ... );
@@ -89,8 +91,8 @@ export default class FontFamily extends Plugin {
  *			]
  *		};
  *
- * which configures 8 font family options. Each option consist of one or more comma–separated font-family names. The first font name is
- * used as a dropdown item description in the UI.
+ * which configures 8 font family options. Each option consists of one or more comma–separated font family names. The first font name is
+ * used as the dropdown item description in the UI.
  *
  * **Note:** The family names that consist of spaces should not have quotes (as opposed to the CSS standard). The necessary quotes
  * will be added automatically in the view. For example, the `"Lucida Sans Unicode"` will render as follows:
@@ -105,7 +107,7 @@ export default class FontFamily extends Plugin {
  *
  *		editor.execute( 'fontFamily', { value: 'Arial' } );
  *
- * Executing `fontFamily` command without any value will remove `fontFamily` attribute from the current selection.
+ * Executing the `fontFamily` command without any value will remove the `fontFamily` attribute from the current selection.
  *
  * @member {Array.<String|module:font/fontfamily~FontFamilyOption>} module:font/fontfamily~FontFamilyConfig#options
  */

+ 1 - 1
packages/ckeditor5-font/src/fontfamily/fontfamilycommand.js

@@ -10,7 +10,7 @@
 import FontCommand from '../fontcommand';
 
 /**
- * The font family command. It is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
+ * The font family command. It is used by {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
  * to apply the font family.
  *
  *		editor.execute( 'fontFamily', { value: 'Arial' } );

+ 1 - 1
packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js

@@ -20,7 +20,7 @@ const FONT_FAMILY = 'fontFamily';
  *
  * It introduces the {@link module:font/fontfamily/fontfamilycommand~FontFamilyCommand command} and
  * the `fontFamily` attribute in the {@link module:engine/model/model~Model model} which renders
- * in the {@link module:engine/view/view view} as an inline span (`<span style="font-family: Arial">`),
+ * in the {@link module:engine/view/view view} as an inline `<span>` element (`<span style="font-family: Arial">`),
  * depending on the {@link module:font/fontfamily~FontFamilyConfig configuration}.
  *
  * @extends module:core/plugin~Plugin

+ 3 - 3
packages/ckeditor5-font/src/fontfamily/fontfamilyui.js

@@ -62,12 +62,12 @@ export default class FontFamilyUI extends Plugin {
 	}
 
 	/**
-	 * Returns options as defined in `config.fontFamily.options` but processed to consider
+	 * Returns options as defined in `config.fontFamily.options` but processed to account for
 	 * editor localization, i.e. to display {@link module:font/fontfamily~FontFamilyOption}
 	 * in the correct language.
 	 *
-	 * Note: The reason behind this method is that there's no way to use {@link module:utils/locale~Locale#t}
-	 * when the user config is defined because the editor does not exist yet.
+	 * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
+	 * when the user configuration is defined because the editor does not exist yet.
 	 *
 	 * @private
 	 * @returns {Array.<module:font/fontfamily~FontFamilyOption>}.

+ 2 - 2
packages/ckeditor5-font/src/fontfamily/utils.js

@@ -8,10 +8,10 @@
  */
 
 /**
- * Normalizes the {@link module:font/fontfamily~FontFamilyConfig#options config options}
+ * Normalizes the {@link module:font/fontfamily~FontFamilyConfig#options configuration options}
  * to the {@link module:font/fontfamily~FontFamilyOption} format.
  *
- * @param {Array.<String|Object>} configuredOptions An array of options taken from configuration.
+ * @param {Array.<String|Object>} configuredOptions An array of options taken from the configuration.
  * @returns {Array.<module:font/fontfamily~FontFamilyOption>}
  */
 export function normalizeOptions( configuredOptions ) {

+ 13 - 11
packages/ckeditor5-font/src/fontsize.js

@@ -17,6 +17,8 @@ import FontSizeUI from './fontsize/fontsizeui';
  * It enables {@link module:font/fontsize/fontsizeediting~FontSizeEditing} and
  * {@link module:font/fontsize/fontsizeui~FontSizeUI} features in the editor.
  *
+ * For a detailed overview, check the {@glink features/font font feature} documentation.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class FontSize extends Plugin {
@@ -36,20 +38,20 @@ export default class FontSize extends Plugin {
 }
 
 /**
- * Font size option descriptor.
+ * The font size option descriptor.
  *
  * @typedef {Object} module:font/fontsize~FontSizeOption
  *
  * @property {String} title The user-readable title of the option.
- * @property {String} model Attribute's unique value in the model.
+ * @property {String} model The attribute's unique value in the model.
  * @property {module:engine/view/elementdefinition~ElementDefinition} view View element configuration.
  * @property {Array.<module:engine/view/elementdefinition~ElementDefinition>} [upcastAlso] An array with all matched elements that
- * view to model conversion should also accept.
+ * the view-to-model conversion should also accept.
  */
 
 /**
  * The configuration of the font size feature.
- * Introduced by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
+ * It is introduced by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
  *
  * Read more in {@link module:font/fontsize~FontSizeConfig}.
  *
@@ -58,11 +60,11 @@ export default class FontSize extends Plugin {
 
 /**
  * The configuration of the font size feature.
- * The option is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
+ * This option is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
  *
  * 		ClassicEditor
  * 			.create( {
- * 				fontSize: ... // Font size feature config.
+ * 				fontSize: ... // Font size feature configuration.
  *			} )
  * 			.then( ... )
  * 			.catch( ... );
@@ -88,26 +90,26 @@ export default class FontSize extends Plugin {
  *			]
  *		};
  *
- * It defines 4 sizes: **tiny**, **small**, **big**, and **huge**. These values will be rendered as `span` elements in view.
+ * It defines 4 sizes: **tiny**, **small**, **big**, and **huge**. These values will be rendered as `<span>` elements in the view.
  * The **default** defines a text without the `fontSize` attribute.
  *
- * Each `span` has the `class` attribute set to the corresponding size name. For instance, this is what the **small** size looks
+ * Each `<span>` has the the `class` attribute set to the corresponding size name. For instance, this is what the **small** size looks
  * like in the view:
  *
  * 		<span class="text-small">...</span>
  *
- * As an alternative, the font size might be defined using the numerical values (either as a `Number` or as a `String`):
+ * As an alternative, the font size might be defined using numerical values (either as a `Number` or as a `String`):
  *
  * 		const fontSizeConfig = {
  * 			options: [ 9, 10, 11, 12, 13, 14, 15 ]
  * 		};
  *
  * Font size can be applied using the command API. To do that, use the `fontSize` command and pass the desired font size as a `value`.
- * For example, the below code will apply the `fontSize` attribute with the **tiny** value to the current selection:
+ * For example, the following code will apply the `fontSize` attribute with the **tiny** value to the current selection:
  *
  *		editor.execute( 'fontSize', { value: 'tiny' } );
  *
- * Executing `fontSize` command without value will remove `fontSize` attribute from the current selection.
+ * Executing the `fontSize` command without value will remove the `fontSize` attribute from the current selection.
  *
  * @member {Array.<String|Number|module:font/fontsize~FontSizeOption>} module:font/fontsize~FontSizeConfig#options
  */

+ 1 - 1
packages/ckeditor5-font/src/fontsize/fontsizecommand.js

@@ -10,7 +10,7 @@
 import FontCommand from '../fontcommand';
 
 /**
- * The font size command. It is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
+ * The font size command. It is used by {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
  * to apply the font size.
  *
  *		editor.execute( 'fontSize', { value: 'small' } );

+ 4 - 4
packages/ckeditor5-font/src/fontsize/fontsizeui.js

@@ -18,7 +18,7 @@ import fontSizeIcon from '../../theme/icons/font-size.svg';
 import '../../theme/fontsize.css';
 
 /**
- * The font family UI plugin. It introduces the `'fontSize'` dropdown.
+ * The font size UI plugin. It introduces the `'fontSize'` dropdown.
  *
  * @extends module:core/plugin~Plugin
  */
@@ -67,12 +67,12 @@ export default class FontSizeUI extends Plugin {
 	}
 
 	/**
-	 * Returns options as defined in `config.fontSize.options` but processed to consider
+	 * Returns options as defined in `config.fontSize.options` but processed to account for
 	 * editor localization, i.e. to display {@link module:font/fontsize~FontSizeOption}
 	 * in the correct language.
 	 *
-	 * Note: The reason behind this method is that there's no way to use {@link module:utils/locale~Locale#t}
-	 * when the user config is defined because the editor does not exist yet.
+	 * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
+	 * when the user configuration is defined because the editor does not exist yet.
 	 *
 	 * @private
 	 * @returns {Array.<module:font/fontsize~FontSizeOption>}.

+ 2 - 2
packages/ckeditor5-font/src/fontsize/utils.js

@@ -8,10 +8,10 @@
  */
 
 /**
- * Normalizes and translates the {@link module:font/fontsize~FontSizeConfig#options config options}
+ * Normalizes and translates the {@link module:font/fontsize~FontSizeConfig#options configuration options}
  * to the {@link module:font/fontsize~FontSizeOption} format.
  *
- * @param {Array.<String|Number|Object>} configuredOptions An array of options taken from configuration.
+ * @param {Array.<String|Number|Object>} configuredOptions An array of options taken from the configuration.
  * @returns {Array.<module:font/fontsize~FontSizeOption>}
  */
 export function normalizeOptions( configuredOptions ) {