瀏覽代碼

erge branch 'master' into i/8204

Kamil Piechaczek 5 年之前
父節點
當前提交
ba209ff585
共有 36 個文件被更改,包括 367 次插入119 次删除
  1. 1 1
      docs/builds/guides/integration/advanced-setup.md
  2. 2 0
      docs/features/image-upload.md
  3. 2 2
      docs/features/index.md
  4. 9 3
      docs/framework/guides/contributing/development-environment.md
  5. 1 1
      docs/index.md
  6. 9 0
      packages/ckeditor5-alignment/docs/features/text-alignment.md
  7. 10 1
      packages/ckeditor5-basic-styles/docs/features/basic-styles.md
  8. 3 2
      packages/ckeditor5-block-quote/docs/features/block-quote.md
  9. 7 0
      packages/ckeditor5-code-block/docs/features/code-blocks.md
  10. 3 5
      packages/ckeditor5-core/src/plugincollection.js
  11. 2 4
      packages/ckeditor5-engine/src/conversion/upcasthelpers.js
  12. 10 1
      packages/ckeditor5-font/docs/features/font.md
  13. 12 0
      packages/ckeditor5-heading/docs/_snippets/features/default-headings.html
  14. 30 0
      packages/ckeditor5-heading/docs/_snippets/features/default-headings.js
  15. 16 1
      packages/ckeditor5-heading/docs/features/headings.md
  16. 7 0
      packages/ckeditor5-heading/docs/features/title.md
  17. 8 0
      packages/ckeditor5-highlight/docs/features/highlight.md
  18. 4 1
      packages/ckeditor5-image/src/imageinsert/imageinsertui.js
  19. 3 8
      packages/ckeditor5-image/src/imagestyle/utils.js
  20. 14 0
      packages/ckeditor5-image/tests/imageinsert/imageinsertui.js
  21. 2 1
      packages/ckeditor5-image/tests/imagestyle/utils.js
  22. 8 0
      packages/ckeditor5-indent/docs/features/indent.md
  23. 27 15
      packages/ckeditor5-list/docs/_snippets/features/lists-style.html
  24. 8 6
      packages/ckeditor5-list/docs/features/lists.md
  25. 2 4
      packages/ckeditor5-media-embed/src/mediaregistry.js
  26. 5 8
      packages/ckeditor5-mention/src/mentionui.js
  27. 9 4
      packages/ckeditor5-mention/tests/mentionui.js
  28. 7 0
      packages/ckeditor5-remove-format/docs/features/remove-format.md
  29. 2 4
      packages/ckeditor5-ui/src/toolbar/toolbarview.js
  30. 2 1
      packages/ckeditor5-ui/tests/toolbar/toolbarview.js
  31. 3 3
      packages/ckeditor5-upload/src/adapters/simpleuploadadapter.js
  32. 2 4
      packages/ckeditor5-upload/src/filerepository.js
  33. 2 1
      packages/ckeditor5-upload/tests/filerepository.js
  34. 62 23
      packages/ckeditor5-utils/src/ckeditorerror.js
  35. 71 9
      packages/ckeditor5-utils/tests/ckeditorerror.js
  36. 2 6
      packages/ckeditor5-widget/src/widgettoolbarrepository.js

+ 1 - 1
docs/builds/guides/integration/advanced-setup.md

@@ -602,7 +602,7 @@ index c57e371..04fc9fe 100644
 Once you changed the `src/ckeditor.js` and `webpack.config.js` files it is time to rebuild the build:
 
 ```bash
-yarn run build
+npm run build
 ```
 
 Finally, when webpack finishes compiling your super build, you can change the `samples/index.html` file to test both editors:

+ 2 - 0
docs/features/image-upload.md

@@ -22,6 +22,8 @@ The software that makes the image upload possible is called an **upload adapter*
 * [**Official upload adapters**](#official-upload-adapters) – There are several features providing upload adapters developed and maintained by the CKEditor team. Pick the best one for your integration and let it handle the image upload in your project.
 * [**Custom upload adapters**](#implementing-your-own-upload-adapter) – Create your own upload adapter from scratch using the open API architecture of CKEditor 5.
 
+Read our comprehensive blog post about [Managing images with CKEditor 5](https://ckeditor.com/blog/managing-images-with-ckeditor-5/) to find out more details about image upload and management and to compare the available options.
+
 <info-box>
 	If you want to get a better look under the hood and learn more about the upload process, you can check out the {@link framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide} covering that topic.
 </info-box>

+ 2 - 2
docs/features/index.md

@@ -20,8 +20,8 @@ The number of features available for CKEditor 5 is constantly growing. Plenty of
 Each rich-text editor feature is presented on a separate page, with one or more working demos showcasing a feature along with some customization ideas that you can use in your implementation.
 
 <info-box>
-	**In most demos the number of features enabled is limited** to make the currently highlighted piece of functionality stand out more. However, in your CKEditor 5 WYSIWYG editor implementation you are free to choose and combine any features you like from those available.
-</info-box> 
+	**In most demos the number of features enabled is limited** to make the currently highlighted piece of functionality stand out more. However, in your CKEditor 5 WYSIWYG editor implementation you are free to choose and combine any features you like from those available. This can be easily and conveniently done in the [CKEditor 5 online builder](https://ckeditor.com/ckeditor-5/online-builder/).
+</info-box>
 
 ## Looking for more?
 

+ 9 - 3
docs/framework/guides/contributing/development-environment.md

@@ -95,9 +95,15 @@ This task accepts the following arguments:
 
 * `--skip-api` &ndash; Skips building the API documentation (which takes the majority of the total time).
 * `--skip-snippets` &ndash; Skips building live snippets.
-* `--snippets=snippet-name` &ndash; Snippets to build (accepts glob patterns). If a snippet that you want to build uses another snippet as a source that provides an editor instance, you need to specify both snippets. See examples:
-    - `--snippets=features/*` - all snippets that starts with `features/` in their names will be built,
-    - `--snippets=classic-editor,build-classic-source` - all snippets that contains the specified strings in their names will be built.
+* `--snippets=snippet-name` &ndash; Snippets to build. Accepts glob patterns that are matched against snippet names used in `{@snippet ...}` tags. Examples:
+
+	```
+	--snippets=image         // matches roughly {@snippet *image*}
+	--snippets="features/*"  // matches roughly {@snippet *features/*}
+	--snippets=classic-editor,build-classic-source
+	```
+
+	Note: If a snippet that you want to build uses another snippet as a source that provides an editor instance, you need to specify both snippets (e.g. `--files=features/default-headings,build-classic-source`).
 * `--skip-validation` &ndash; Skips the final link validation.
 * `--watch` &ndash; Runs the documentation generator in a watch mode. It covers guides but it does not cover API docs.
 * `--production` &ndash; Minifies the assets and performs other actions which are unnecessary during CKEditor 5 development.

+ 1 - 1
docs/index.md

@@ -11,7 +11,7 @@ meta-description: Learn how to install, integrate, configure and develop CKEdito
 <dl><dt>{@link builds/guides/overview CKEditor 5 Builds documentation}</dt><dd>Learn how to install, integrate and configure CKEditor 5 Builds. More complex aspects, like creating custom builds, are explained here, too.</dd>
 <dt>{@link framework/guides/overview CKEditor 5 Framework documentation}</dt><dd>Learn how to work with CKEditor 5 Framework, customize it, create your own plugins and custom editors, change the UI or even bring your own UI to the editor.</dd>
 <dt>{@link examples/index CKEditor 5 Examples}</dt><dd>Try out all CKEditor 5 Builds. See some of the possible customizations of CKEditor.</dd>
-<dt>{@link features/index CKEditor 5 Features}</dt><dd>Learn about selected features included in CKEditor 5 Builds.</dd>
+<dt>{@link features/index CKEditor 5 Features}</dt><dd>Learn about the features available for CKEditor 5 &mdash; both the ones included in Builds and a plethora of others.</dd>
 <dt>{@link api/index CKEditor 5 API Reference}</dt><dd>A complete API documentation.</dd></dl>
 
 ## Contribute

+ 9 - 0
packages/ckeditor5-alignment/docs/features/text-alignment.md

@@ -11,6 +11,15 @@ The {@link module:alignment/alignment~Alignment} feature enables support for tex
 
 {@snippet features/text-alignment}
 
+## Related features
+
+There are more CKEditor 5 features that can help you organize your content:
+* {@link features/title Document title} &ndash; Clearly divide your content into a title and body.
+* {@link features/headings Headings} &ndash; Split your content into logical sections.
+* {@link features/indent Block indentation} &ndash; Organize your content into visually separated blocks, indent crucial paragraphs, etc.
+* {@link features/block-quote Block quote} &ndash; Include block quotations or pull quotes in the rich-text content.
+* {@link features/remove-format Remove format} &ndash; Easily clean basic text formatting.
+
 ## Configuring alignment options
 
 It is possible to configure which alignment options are available in the editor by setting the {@link module:alignment/alignment~AlignmentConfig#options `alignment.options`} configuration option. You can choose from `'left'`, `'right'`, `'center'` and `'justify'`.

+ 10 - 1
packages/ckeditor5-basic-styles/docs/features/basic-styles.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-basic-styles-source}
 
-The {@link api/basic-styles basic styles} package provides text formatting features such as bold, italic, underline, strikethrough, subscript, superscript, and code.
+The {@link api/basic-styles basic styles} feature allows you to apply the most frequently used formatting indispensable for content creation. This package provides essential text styling features such as bold, italic, underline, strikethrough, subscript, superscript, and code. Coupled with more [formatting features](#related-features), these serve as a base for any WYSIWYG editor toolset.
 
 <info-box info>
 	All basic text styles can be removed with the {@link features/remove-format remove format} feature.
@@ -15,6 +15,15 @@ The {@link api/basic-styles basic styles} package provides text formatting featu
 
 {@snippet features/basic-styles}
 
+## Related features
+
+Check out also these CKEditor 5 features to gain better control over your content style and format:
+* {@link features/font Font styles} &ndash; Easily and efficiently control the font {@link features/font#configuring-the-font-family-feature family}, {@link features/font#configuring-the-font-size-feature size}, {@link features/font#configuring-the-font-color-and-font-background-color-features text or background color}.
+* {@link features/text-alignment Text alignment} &ndash; Because it does matter whether the content is left, right, centered or justified.
+* {@link features/code-blocks Code blocks}  &ndash; Insert longer, multiline code listings, expanding the inline code style greatly.
+* {@link features/highlight Highlight} &ndash; Mark important words and passages, aiding a review or drawing attention to specific parts of content.
+* {@link features/remove-format Remove format} &ndash; Easily clean basic text formatting.
+
 ## Available text styles
 
 | Style feature | {@link framework/guides/architecture/core-editor-architecture#commands Command} name | {@link builds/guides/integration/configuration#toolbar-setup Toolbar} component name | Output element |

+ 3 - 2
packages/ckeditor5-block-quote/docs/features/block-quote.md

@@ -17,8 +17,9 @@ Use the editor below to see the block quote plugin in action.
 
 Here are some other CKEditor 5 features that you can use similarly to the block quote plugin to structure your text better:
 
-* The {@link features/indent block indentation feature} allows you to set indentation for text blocks such as paragraphs or lists.
-* The {@link features/code-blocks code block feature} allows for insertion of various code listings.
+* {@link features/indent Block indentation}  &ndash; Set indentation for text blocks such as paragraphs or lists.
+* {@link features/code-blocks Code block}  &ndash; Insert longer, multiline code listings.
+* {@link features/text-alignment Text alignment} &ndash; Align your content left, right, center it or justify.
 
 ## Installation
 

+ 7 - 0
packages/ckeditor5-code-block/docs/features/code-blocks.md

@@ -16,6 +16,13 @@ The {@link module:code-block/codeblock~CodeBlock} feature allows inserting and e
 
 {@snippet features/code-block}
 
+## Related features
+
+Here are some CKEditor 5 features that you may find helpfully similar:
+* {@link features/basic-styles Basic text styles} &ndash; Use the `code` formatting for short inline code chunks.
+* {@link features/block-quote Block quote} &ndash; Include block quotations or pull quotes in your rich-text content.
+* {@link features/indent Block indentation} &ndash; Set indentation for text blocks such as paragraphs or lists.
+
 ## Configuring code block languages
 
 Each code block can be assigned a programming language. The language of the code block is represented as a CSS class of the `<code>` element, both when editing and in the editor data:

+ 3 - 5
packages/ckeditor5-core/src/plugincollection.js

@@ -7,9 +7,7 @@
  * @module core/plugincollection
  */
 
-/* globals console */
-
-import CKEditorError, { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import CKEditorError, { logError } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
@@ -207,7 +205,7 @@ export default class PluginCollection {
 			const errorId = 'plugincollection-plugin-not-found';
 
 			// Log the error, so it's more visible on the console. Hopefully, for better DX.
-			console.error( attachLinkToDocumentation( errorId ), { plugins: missingPlugins } );
+			logError( errorId, { plugins: missingPlugins } );
 
 			return Promise.reject( new CKEditorError( errorId, context, { plugins: missingPlugins } ) );
 		}
@@ -249,7 +247,7 @@ export default class PluginCollection {
 					 * @error plugincollection-load
 					 * @param {String} plugin The name of the plugin that could not be loaded.
 					 */
-					console.error( attachLinkToDocumentation( 'plugincollection-load' ), { plugin: PluginConstructor } );
+					logError( 'plugincollection-load', { plugin: PluginConstructor } );
 
 					throw err;
 				} );

+ 2 - 4
packages/ckeditor5-engine/src/conversion/upcasthelpers.js

@@ -7,13 +7,11 @@ import Matcher from '../view/matcher';
 import ConversionHelpers from './conversionhelpers';
 
 import { cloneDeep } from 'lodash-es';
-import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
 import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';
 
-/* global console */
-
 /**
  * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
  * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
@@ -349,7 +347,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 		 *
 		 * @error upcast-helpers-element-to-marker-deprecated
 		 */
-		console.warn( attachLinkToDocumentation( 'upcast-helpers-element-to-marker-deprecated' ) );
+		logWarning( 'upcast-helpers-element-to-marker-deprecated' );
 
 		return this.add( upcastElementToMarker( config ) );
 	}

+ 10 - 1
packages/ckeditor5-font/docs/features/font.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-font-source}
 
-The {@link module:font/font~Font} plugin enables the following features in the rich-text editor:
+The {@link module:font/font~Font} plugin provides extended text formatting options for the document content. It enables the following features in the rich-text editor:
 * {@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.
 * {@link module:font/fontcolor~FontColor} &ndash; Allows to control the font color by applying inline `<span>` elements with a `color` in the `style` attribute.
@@ -19,6 +19,15 @@ The {@link module:font/font~Font} plugin enables the following features in the r
 
 {@snippet features/font}
 
+## Related features
+
+Here are some more CKEditor 5 features that can help you format your content:
+* {@link features/basic-styles Basic font styles} &ndash; The essentials, like **bold**, *italic* and others.
+* {@link features/text-alignment Text alignment} &ndash; Because it does matter whether the content is left, right, centered or justified.
+* {@link features/headings Headings} &ndash; Divide your content into sections.
+* {@link features/highlight Highlight} &ndash; Mark important words and passages, aiding a review or drawing attention to specific parts of content.
+* {@link features/remove-format Remove format} &ndash; Easily clean basic text formatting.
+
 ## Configuring the font family feature
 
 It is possible to configure which font family options are supported by the WYSIWYG editor. Use the {@link module:font/fontfamily~FontFamilyConfig#options `config.fontFamily.options`} configuration option to do so.

+ 12 - 0
packages/ckeditor5-heading/docs/_snippets/features/default-headings.html

@@ -0,0 +1,12 @@
+
+<div id="snippet-default-headings">
+	<h1>On the importance of headings</h1>
+	<h2>What is a heading?</h2>
+	<p>A heading should be viewed as a title or a subtitle displayed in the document or a webpage. These are created with the &lt;h1&gt; to &lt;h6&gt; HTML tags where  1 is the largest (and most important) while 6 is the lowest level heading.</p>
+	<h2>The reason to use headings</h2>
+	<p>Headings serve dual purpose in the documents: they help the creators and readers interact with the content and they also affect the way search engines index the webpage.</p>
+	<h3>Human interaction</h3>
+	<p>Having a clearly defined structure with sections and subsections is beneficial for both the creator, who can convey their message better as well as for the readers, who can access the content with ease. Having a few good headings aids scanning and searching for specific information in the document as well as structuring the data contained.</p>
+	<h3>Search engine indexing algorithms</h3>
+	<p>Search engines use the headings to index the structure of the document and point to important keywords.</p>
+</div>

+ 30 - 0
packages/ckeditor5-heading/docs/_snippets/features/default-headings.js

@@ -0,0 +1,30 @@
+/**
+ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/* globals ClassicEditor, console, window, document */
+
+import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
+
+ClassicEditor
+	.create( document.querySelector( '#snippet-default-headings' ), {
+		cloudServices: CS_CONFIG,
+		heading: {
+			options: [
+				{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
+				{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
+				{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
+				{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }
+			]
+		},
+		toolbar: {
+			viewportTopOffset: window.getViewportTopOffsetConfig()
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 16 - 1
packages/ckeditor5-heading/docs/features/headings.md

@@ -6,7 +6,7 @@ category: features
 
 {@snippet build-classic-source}
 
-The {@link module:heading/heading~Heading} feature enables support for headings.
+The {@link module:heading/heading~Heading} feature enables support for headings. These are used by the creators to structure their documents. They also aid both the readers, making the content more organized and easier to read, and the search indexers scanning for crucial information.
 
 <info-box info>
 	This feature is enabled by default in all builds.
@@ -26,6 +26,21 @@ By default, when your editor build does not include the title plugin, a `<h1>` e
 	You can read more about why the editor should not create `<h1>` elements for content headings in the [Headings section of Editor Recommendations](http://ckeditor.github.io/editor-recommendations/features/headings.html).
 </info-box>
 
+## Demo
+
+{@snippet features/default-headings}
+
+## Related features
+
+There are more CKEditor 5 features that can help you format your content:
+* {@link features/basic-styles Basic font styles} &ndash; The essentials, like **bold**, *italic* and others.
+* {@link features/title Document title} &ndash; Clearly divide your content into a title and body.
+* {@link features/indent Block indentation}  &ndash; Set indentation for text blocks such as paragraphs or lists.
+* {@link features/lists Lists}  &ndash; Organize your content better with ordered and unordered list you can style.
+* {@link features/remove-format Remove format} &ndash; Easily clean basic text formatting.
+
+## Configuration
+
 ### Configuring heading levels
 
 It is, of course, possible to configure which heading levels the editor should support and how they should be named in the Headings dropdown. Use the {@link module:heading/heading~HeadingConfig#options `heading.options`} configuration option to do so.

+ 7 - 0
packages/ckeditor5-heading/docs/features/title.md

@@ -15,6 +15,13 @@ Use the editor below to create a document with clearly separated title and body
 
 {@snippet features/title}
 
+## Related features
+
+There are more CKEditor 5 features that can help you structure your document better:
+* {@link features/headings Headings} &ndash; Divide your content into sections.
+* {@link features/indent Block indentation} &ndash; Organize your content into visually separated blocks, indent crucial paragraphs, etc.
+* {@link features/editor-placeholder Editor placeholder} &ndash; Set placeholder text to display when the content is empty. It helps users locate the editor in the application and prompts to input the content.
+
 ## Keyboard navigation
 
 The title plugin lets you move from the title to the body element using the <kbd>Tab</kbd> key, providing form-like experience. When the selection is at the beginning of the first body element, you can go back to the title element using <kbd>Shift</kbd>+<kbd>Tab</kbd>. You can also use <kbd>Enter</kbd> and <kbd>Backspace</kbd> keys to move the caret between the title and the body.

+ 8 - 0
packages/ckeditor5-highlight/docs/features/highlight.md

@@ -14,6 +14,14 @@ The highlight plugin always comes with a predefined and limited number of availa
 
 {@snippet features/highlight}
 
+## Related features
+
+There are more CKEditor 5 features that can help you style your content:
+* {@link features/basic-styles Basic font styles} &ndash; The essentials, like **bold**, *italic* and others.
+* {@link features/font Font styles} &ndash; Easily and efficiently control the font {@link features/font#configuring-the-font-family-feature family}, {@link features/font#configuring-the-font-size-feature size}, {@link features/font#configuring-the-font-color-and-font-background-color-features text or background color}.
+* {@link features/block-quote Block quote} &ndash; Include block quotations or pull quotes in your rich-text content.
+* {@link features/remove-format Remove format} &ndash; Easily clean basic text formatting.
+
 ## Configuring the highlight options
 
 ### Dropdown

+ 4 - 1
packages/ckeditor5-image/src/imageinsert/imageinsertui.js

@@ -113,7 +113,10 @@ export default class ImageInsertUI extends Plugin {
 					insertImageViaUrlForm.label = t( 'Insert image via URL' );
 				}
 			}
-		} );
+		// Note: Use the low priority to make sure the following listener starts working after the
+		// default action of the drop-down is executed (i.e. the panel showed up). Otherwise, the
+		// invisible form/input cannot be focused/selected.
+		}, { priority: 'low' } );
 
 		imageInsertView.delegate( 'submit', 'cancel' ).to( dropdownView );
 		this.delegate( 'cancel' ).to( dropdownView );

+ 3 - 8
packages/ckeditor5-image/src/imagestyle/utils.js

@@ -7,13 +7,11 @@
  * @module image/imagestyle/utils
  */
 
-/* globals console */
-
 import fullWidthIcon from '@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg';
 import leftIcon from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg';
 import centerIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg';
 import rightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
-import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 /**
  * Default image styles provided by the plugin that can be referred in the
@@ -120,12 +118,9 @@ function _normalizeStyle( style ) {
 			 * There is no such image style of given name.
 			 *
 			 * @error image-style-not-found
-		 	 * @param {String} name Name of a missing style name.
+			 * @param {String} name Name of a missing style name.
 			 */
-			console.warn(
-				attachLinkToDocumentation( 'image-style-not-found' ),
-				{ name: styleName }
-			);
+			logWarning( 'image-style-not-found', { name: styleName } );
 
 			// Normalize the style anyway to prevent errors.
 			style = {

+ 14 - 0
packages/ckeditor5-image/tests/imageinsert/imageinsertui.js

@@ -278,6 +278,20 @@ describe( 'ImageInsertUI', () => {
 				sinon.assert.notCalled( commandSpy );
 				sinon.assert.calledOnce( cancelSpy );
 			} );
+
+			it( 'should focus on "insert image via URL" input after opening', () => {
+				let spy;
+
+				// The ImageInsertPanelView is added on first open.
+				// See https://github.com/ckeditor/ckeditor5/pull/8019#discussion_r484069652
+				dropdown.on( 'change:isOpen', () => {
+					const imageInsertPanelView = dropdown.panelView.children.first;
+					spy = sinon.spy( imageInsertPanelView, 'focus' );
+				}, { priority: 'highest' } );
+
+				dropdown.buttonView.fire( 'open' );
+				sinon.assert.calledOnce( spy );
+			} );
 		} );
 
 		it( 'should inject integrations to the dropdown panel view from the config', async () => {

+ 2 - 1
packages/ckeditor5-image/tests/imagestyle/utils.js

@@ -109,7 +109,8 @@ describe( 'ImageStyle utils', () => {
 				sinon.assert.calledOnce( console.warn );
 				sinon.assert.calledWithExactly( console.warn,
 					sinon.match( /^image-style-not-found/ ),
-					{ name: 'foo' }
+					{ name: 'foo' },
+					sinon.match.string // Link to the documentation
 				);
 			} );
 		} );

+ 8 - 0
packages/ckeditor5-indent/docs/features/indent.md

@@ -15,6 +15,14 @@ The block indentation feature allows you to set indentation for text blocks such
 
 {@snippet features/indent}
 
+## Related features
+
+Here are some CKEditor 5 features that may aid structuring your content better:
+* {@link features/block-quote Block quote} &ndash; Include block quotations or pull quotes in your rich-text content.
+* {@link features/headings Headings} &ndash; Divide your content into sections.
+* {@link features/code-blocks Code block} &ndash; Insert longer, multiline code listings.
+* {@link features/text-alignment Text alignment} &ndash; Because it does matter whether the content is left, right, centered or justified.
+
 ## Configuring the block indentation feature
 
 This feature offers a few configuration options that can be used to adjust the text block indentation behavior.

+ 27 - 15
packages/ckeditor5-list/docs/_snippets/features/lists-style.html

@@ -1,18 +1,30 @@
 <div id="snippet-lists-styles">
-    <h2>Ingredients</h2>
-    <p>Ingredients required for making a coffee:</p>
-    <ul style="list-style-type:circle;">
-        <li>15g ground coffee</li>
-        <li>water</li>
-        <li>milk <i>(optional)</i></li>
-    </ul>
-    <h2>Instructions</h2>
-    <p>How to prepare a cup of coffee:</p>
-    <ol style="list-style-type:decimal-leading-zero;">
-        <li>Gather the ingredients.</li>
-        <li>Put 15g of ground coffee in the cup.</li>
-        <li>Boil 200ml of water.</li>
-        <li>Pour the water into the cup.</li>
-        <li>Optional: Add milk.</li>
+    <h2>Modern manned spacecraft</h2>
+    <ol style="list-style-type:upper-roman;">
+        <li>Soyuz (Soviet/Russian)</li>
+            <ol style="list-style-type:decimal;">
+                <li>Early stage (all retired)</li>
+                    <ol style="list-style-type:lower-latin;">
+                        <li>7K-OK</li>
+                        <li>7KT-OK</li>
+                        <li>7K-T</li>
+                        <li>7K-TM</li>
+                    </ol>
+                <li>Soyuz T (retired)</li>
+                <li>Soyuz TM (retired)</li>
+                <li>Soyuz TMA (retired)</li>
+                <li>Soyuz TMA-M (retired)</li>
+                <li>Soyuz MS</li>
+            </ol>
+        <li>STS orbiter (American; all retired)</li>
+            <ol style="list-style-type:decimal;">
+                <li>Columbia</li>
+                <li>Challenger</li>
+                <li>Discovery</li>
+                <li>Atlantis</li>
+                <li>Endeavour</li>
+            </ol>
+        <li>SpaceX Crew Dragon (American)</li>
+        <li>Shenzhou (Chinese)</li>
     </ol>
 </div>

+ 8 - 6
packages/ckeditor5-list/docs/features/lists.md

@@ -4,7 +4,7 @@ category: features
 
 # Lists
 
-The {@link module:list/list~List list} feature allows creating ordered (numbered) and unordered (bulleted) lists in the editor.
+The {@link module:list/list~List list} feature allows creating ordered (numbered) and unordered (bulleted) lists. This allows for better structuring and presenting specific content such as enumerating elements, creating tables of content or {@link features/todo-lists to-do lists}.
 
 <info-box info>
 	The feature is enabled by default in all CKEditor 5 WYSIWYG editor builds.
@@ -34,7 +34,13 @@ Use the editor below to see the list style plugin in action.
 
 {@snippet features/lists-style}
 
-### Installation
+## Related features
+
+These features also provide similar functionality:
+* {@link features/todo-lists To-do lists} &ndash; Create a list of interactive checkboxes with labels.
+* {@link features/indent Block indentation} &ndash; Set indentation for text blocks such as paragraphs or headings and lists.
+
+## Installation
 
 To add this feature to your editor, install the [`@ckeditor/ckeditor5-list`](https://www.npmjs.com/package/@ckeditor/ckeditor5-list) package:
 
@@ -68,10 +74,6 @@ ClassicEditor
 
 Refer to the {@link features/indent Indenting lists} section of the Block indentation feature guide.
 
-## To-do list
-
-You can read more about the feature in the {@link features/todo-lists To-do lists} feature guide.
-
 ## Common API
 
 The {@link module:list/list~List} plugin registers:

+ 2 - 4
packages/ckeditor5-media-embed/src/mediaregistry.js

@@ -7,13 +7,11 @@
  * @module media-embed/mediaregistry
  */
 
-/* globals console */
-
 import mediaPlaceholderIcon from '../theme/icons/media-placeholder.svg';
 import TooltipView from '@ckeditor/ckeditor5-ui/src/tooltip/tooltipview';
 import IconView from '@ckeditor/ckeditor5-ui/src/icon/iconview';
 import Template from '@ckeditor/ckeditor5-ui/src/template';
-import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 const mediaPlaceholderIconViewBox = '0 0 64 42';
 
@@ -48,7 +46,7 @@ export default class MediaRegistry {
 					 *
 					 * @error media-embed-no-provider-name
 					 */
-					console.warn( attachLinkToDocumentation( 'media-embed-no-provider-name' ), { provider } );
+					logWarning( 'media-embed-no-provider-name', { provider } );
 
 					return false;
 				}

+ 5 - 8
packages/ckeditor5-mention/src/mentionui.js

@@ -7,8 +7,6 @@
  * @module mention/mentionui
  */
 
-/* global console */
-
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
@@ -16,7 +14,7 @@ import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsid
 import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
 import env from '@ckeditor/ckeditor5-utils/src/env';
 import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
-import CKEditorError, { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import CKEditorError, { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon';
 import { debounce } from 'lodash-es';
 
@@ -156,11 +154,9 @@ export default class MentionUI extends Plugin {
 				 * See {@link module:mention/mention~MentionConfig}.
 				 *
 				 * @error mentionconfig-incorrect-marker
+				 * @param {String} marker Configured marker
 				 */
-				throw new CKEditorError(
-					'mentionconfig-incorrect-marker',
-					null
-				);
+				throw new CKEditorError( 'mentionconfig-incorrect-marker', null, { marker } );
 			}
 
 			const minimumCharacters = mentionDescription.minimumCharacters || 0;
@@ -348,8 +344,9 @@ export default class MentionUI extends Plugin {
 				 * not displayed at all.
 				 *
 				 * @error mention-feed-callback-error
+				 * @param {String} marker Configured marker for which error occurred.
 				 */
-				console.warn( attachLinkToDocumentation( 'mention-feed-callback-error' ) );
+				logWarning( 'mention-feed-callback-error', { marker } );
 			} );
 	}
 

+ 9 - 4
packages/ckeditor5-mention/tests/mentionui.js

@@ -66,19 +66,19 @@ describe( 'MentionUI', () => {
 	describe( 'init()', () => {
 		it( 'should throw if marker was not provided for feed', () => {
 			return createClassicTestEditor( { feeds: [ { feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null, { marker: undefined } );
 			} );
 		} );
 
 		it( 'should throw if marker is empty string', () => {
 			return createClassicTestEditor( { feeds: [ { marker: '', feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null, { marker: '' } );
 			} );
 		} );
 
 		it( 'should throw if marker is longer then 1 character', () => {
 			return createClassicTestEditor( { feeds: [ { marker: '$$', feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null, { marker: '$$' } );
 			} );
 		} );
 	} );
@@ -1249,7 +1249,12 @@ describe( 'MentionUI', () => {
 						expect( panelView.isVisible, 'panel is hidden' ).to.be.false;
 						expect( editor.model.markers.has( 'mention' ), 'there is no marker' ).to.be.false;
 
-						sinon.assert.calledWithExactly( warnSpy, sinon.match( /^mention-feed-callback-error/ ) );
+						sinon.assert.calledWithExactly(
+							warnSpy,
+							sinon.match( /^mention-feed-callback-error/ ),
+							sinon.match( { marker: '#' } ),
+							sinon.match.string // Link to the documentation
+						);
 						sinon.assert.calledOnce( eventSpy );
 					} );
 			} );

+ 7 - 0
packages/ckeditor5-remove-format/docs/features/remove-format.md

@@ -16,6 +16,13 @@ Select the content you want to clean up and press the "Remove Format" button in
 
 {@snippet features/remove-format}
 
+## Related features
+
+There are more CKEditor 5 features that can help you format your content:
+* {@link features/basic-styles Basic font styles} &ndash; The essentials, like **bold**, *italic* and others.
+* {@link features/font Font styles} &ndash; Easily and efficiently control the font {@link features/font#configuring-the-font-family-feature family}, {@link features/font#configuring-the-font-size-feature size}, {@link features/font#configuring-the-font-color-and-font-background-color-features text or background color}.
+* {@link features/text-alignment Text alignment} &ndash; Align your content left, align it right, center it or justify.
+
 ## Configuring the remove format feature
 
 This feature has no integration–level configuration. Once enabled, it works out–of–the–box with all {@link features/index core editor features}.

+ 2 - 4
packages/ckeditor5-ui/src/toolbar/toolbarview.js

@@ -7,8 +7,6 @@
  * @module ui/toolbar/toolbarview
  */
 
-/* globals console */
-
 import View from '../view';
 import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
 import FocusCycler from '../focuscycler';
@@ -19,7 +17,7 @@ import preventDefault from '../bindings/preventdefault.js';
 import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect';
 import global from '@ckeditor/ckeditor5-utils/src/dom/global';
 import { createDropdown, addToolbarToDropdown } from '../dropdown/utils';
-import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import verticalDotsIcon from '@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg';
 
 import '../../theme/components/toolbar/toolbar.css';
@@ -299,7 +297,7 @@ export default class ToolbarView extends View {
 				 * @error toolbarview-item-unavailable
 				 * @param {String} name The name of the component.
 				 */
-				console.warn( attachLinkToDocumentation( 'toolbarview-item-unavailable' ), { name } );
+				logWarning( 'toolbarview-item-unavailable', { name } );
 			}
 		} ).filter( item => item !== undefined ) );
 	}

+ 2 - 1
packages/ckeditor5-ui/tests/toolbar/toolbarview.js

@@ -421,7 +421,8 @@ describe( 'ToolbarView', () => {
 			sinon.assert.calledOnce( consoleWarnStub );
 			sinon.assert.calledWithExactly( consoleWarnStub,
 				sinon.match( /^toolbarview-item-unavailable/ ),
-				{ name: 'baz' }
+				sinon.match( { name: 'baz' } ),
+				sinon.match.string // Link to the documentation.
 			);
 		} );
 	} );

+ 3 - 3
packages/ckeditor5-upload/src/adapters/simpleuploadadapter.js

@@ -7,11 +7,11 @@
  * @module upload/adapters/simpleuploadadapter
  */
 
-/* globals XMLHttpRequest, FormData, console */
+/* globals XMLHttpRequest, FormData */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import FileRepository from '../filerepository';
-import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 /**
  * The Simple upload adapter allows uploading images to an application running on your server using
@@ -71,7 +71,7 @@ export default class SimpleUploadAdapter extends Plugin {
 			 *
 			 * @error simple-upload-adapter-missing-uploadurl
 			 */
-			console.warn( attachLinkToDocumentation( 'simple-upload-adapter-missing-uploadurl' ) );
+			logWarning( 'simple-upload-adapter-missing-uploadurl' );
 
 			return;
 		}

+ 2 - 4
packages/ckeditor5-upload/src/filerepository.js

@@ -7,12 +7,10 @@
  * @module upload/filerepository
  */
 
-/* globals console */
-
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 
 import PendingActions from '@ckeditor/ckeditor5-core/src/pendingactions';
-import CKEditorError, { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import CKEditorError, { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
@@ -172,7 +170,7 @@ export default class FileRepository extends Plugin {
 			 *
 			 * @error filerepository-no-upload-adapter
 			 */
-			console.warn( attachLinkToDocumentation( 'filerepository-no-upload-adapter' ) );
+			logWarning( 'filerepository-no-upload-adapter' );
 
 			return null;
 		}

+ 2 - 1
packages/ckeditor5-upload/tests/filerepository.js

@@ -178,7 +178,8 @@ describe( 'FileRepository', () => {
 			sinon.assert.calledOnce( consoleWarnStub );
 			sinon.assert.calledWithExactly(
 				consoleWarnStub,
-				sinon.match( /^filerepository-no-upload-adapter/ )
+				sinon.match( /^filerepository-no-upload-adapter/ ),
+				sinon.match.string // Link to the documentation
 			);
 		} );
 

+ 62 - 23
packages/ckeditor5-utils/src/ckeditorerror.js

@@ -7,6 +7,8 @@
  * @module utils/ckeditorerror
  */
 
+/* globals console */
+
 /**
  * URL to the documentation with error codes.
  */
@@ -22,9 +24,10 @@ export const DOCUMENTATION_URL =
  * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
  * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
  * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
- * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use `console.warn()` with
- * {@link module:utils/ckeditorerror~attachLinkToDocumentation `attachLinkToDocumentation()`}
- * to improve developers experience and let them see the working editor as soon as possible.
+ * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
+ * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
+ * {@link module:utils/ckeditorerror~logError `logError()`}
+ * to improve developers experience and let them see the a working editor as soon as possible.
  *
  *		/**
  *		 * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
@@ -56,11 +59,7 @@ export default class CKEditorError extends Error {
 	 * data object will also be later available under the {@link #data} property.
 	 */
 	constructor( errorName, context, data ) {
-		let message = attachLinkToDocumentation( errorName );
-
-		if ( data ) {
-			message += ' ' + JSON.stringify( data );
-		}
+		const message = `${ errorName }${ ( data ? ` ${ JSON.stringify( data ) }` : '' ) }${ getLinkToDocumentationMessage( errorName ) }`;
 
 		super( message );
 
@@ -92,11 +91,12 @@ export default class CKEditorError extends Error {
 	}
 
 	/**
-	 * A utility that ensures the the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
+	 * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
 	 * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
 	 * of a {@link module:utils/ckeditorerror~CKEditorError} error.
 	 *
-	 * @param {Error} err An error.
+	 * @static
+	 * @param {Error} err The error to rethrow.
 	 * @param {Object} context An object connected through properties with the editor instance. This context will be used
 	 * by the watchdog to verify which editor should be restarted.
 	 */
@@ -125,21 +125,60 @@ export default class CKEditorError extends Error {
 }
 
 /**
- * Attaches the link to the documentation at the end of the error message. Use whenever you log a warning or error on the
- * console. It is also used by {@link module:utils/ckeditorerror~CKEditorError}.
+ * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
+ * Use whenever you want to log a warning to the console.
+ *
+ *		/**
+ *		 * There was a problem processing the configuration of the toolbar. The item with the given
+ *		 * name does not exist, so it was omitted when rendering the toolbar.
+ *		 *
+ *		 * @error toolbarview-item-unavailable
+ *		 * @param {String} name The name of the component.
+ *		 * /
+ *		logWarning( 'toolbarview-item-unavailable', { name } );
+ *
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
+ * a warning or an error to the console.
+ *
+ * @param {String} errorName Error name to be logged.
+ * @param {Object} [data] Additional data to be logged.
+ * @returns {String}
+ */
+export function logWarning( errorName, data ) {
+	console.warn( ...formatConsoleArguments( errorName, data ) );
+}
+
+/**
+ * Logs an error to the console with properly formatted message and adds a link to the documentation.
+ * Use whenever you want to log a error to the console.
+ *
+ *		/**
+ *		 * There was a problem processing the configuration of the toolbar. The item with the given
+ *		 * name does not exist, so it was omitted when rendering the toolbar.
+ *		 *
+ *		 * @error toolbarview-item-unavailable
+ *		 * @param {String} name The name of the component.
+ *		 * /
+ *		 logError( 'toolbarview-item-unavailable', { name } );
  *
- *		 /**
- *		  * There was a problem processing the configuration of the toolbar. The item with the given
- *		  * name does not exist so it was omitted when rendering the toolbar.
- *		  *
- *		  * @error toolbarview-item-unavailable
- *		  * @param {String} name The name of the component.
- *		  * /
- *		 console.warn( attachLinkToDocumentation( 'toolbarview-item-unavailable' ), { name } );
+ * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
  *
- * @param {String} errorName Error name to be linked.
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
+ *
+ * @param {String} errorName Error name to be logged.
+ * @param {Object} [data] Additional data to be logged.
  * @returns {String}
  */
-export function attachLinkToDocumentation( errorName ) {
-	return errorName + ` Read more: ${ DOCUMENTATION_URL }#error-${ errorName }\n`;
+export function logError( errorName, data ) {
+	console.error( ...formatConsoleArguments( errorName, data ) );
+}
+
+function getLinkToDocumentationMessage( errorName ) {
+	return `\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;
+}
+
+function formatConsoleArguments( errorName, data ) {
+	const documentationMessage = getLinkToDocumentationMessage( errorName );
+
+	return data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];
 }

+ 71 - 9
packages/ckeditor5-utils/tests/ckeditorerror.js

@@ -5,8 +5,11 @@
 
 /* eslint-disable ckeditor5-rules/ckeditor-error-message */
 
-import { default as CKEditorError, DOCUMENTATION_URL } from '../src/ckeditorerror';
+/* global console */
+
+import { default as CKEditorError, DOCUMENTATION_URL, logError, logWarning } from '../src/ckeditorerror';
 import { expectToThrowCKEditorError } from './_utils/utils';
+import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 
 describe( 'CKEditorError', () => {
 	it( 'inherits from Error', () => {
@@ -35,7 +38,7 @@ describe( 'CKEditorError', () => {
 
 		expect( error ).to.have.property(
 			'message',
-			`foo Read more: ${ DOCUMENTATION_URL }#error-foo\n {"bar":1}`
+			`foo {"bar":1}\nRead more: ${ DOCUMENTATION_URL }#error-foo`
 		);
 		expect( error ).to.have.property( 'data', data );
 	} );
@@ -64,7 +67,7 @@ describe( 'CKEditorError', () => {
 
 		expect( error ).to.have.property(
 			'message',
-			`foo Read more: ${ DOCUMENTATION_URL }#error-foo\n {"bar":"a","bom":{"x":1},"bim":10}`
+			`foo {"bar":"a","bom":{"x":1},"bim":10}\nRead more: ${ DOCUMENTATION_URL }#error-foo`
 		);
 		expect( error ).to.have.property( 'data', data );
 	} );
@@ -72,18 +75,15 @@ describe( 'CKEditorError', () => {
 	it( 'contains a link which leads to the documentation', () => {
 		const error = new CKEditorError( 'model-schema-no-item', null );
 
-		const errorMessage = 'model-schema-no-item' +
-			` Read more: ${ DOCUMENTATION_URL }#error-model-schema-no-item\n`;
+		const errorMessage = `model-schema-no-item\nRead more: ${ DOCUMENTATION_URL }#error-model-schema-no-item`;
 
 		expect( error ).to.have.property( 'message', errorMessage );
 	} );
 
-	it( 'link to documentation is added before the additional data message', () => {
+	it( 'link to documentation is added after the additional data message', () => {
 		const error = new CKEditorError( 'model-schema-no-item', null, { foo: 1, bar: 2 } );
 
-		const errorMessage = 'model-schema-no-item ' +
-			`Read more: ${ DOCUMENTATION_URL }#error-model-schema-no-item\n ` +
-			'{"foo":1,"bar":2}';
+		const errorMessage = `model-schema-no-item {"foo":1,"bar":2}\nRead more: ${ DOCUMENTATION_URL }#error-model-schema-no-item`;
 
 		expect( error ).to.have.property( 'message', errorMessage );
 	} );
@@ -117,4 +117,66 @@ describe( 'CKEditorError', () => {
 			}, /foo/, context );
 		} );
 	} );
+
+	describe( 'logWarning()', () => {
+		beforeEach( () => {
+			testUtils.sinon.stub( console, 'warn' );
+		} );
+
+		afterEach( () => {
+			console.warn.restore();
+		} );
+
+		it( 'should log warning with data and link to the documentation', () => {
+			logWarning( 'foo', { name: 'foo' } );
+
+			sinon.assert.calledOnce( console.warn );
+			sinon.assert.calledWithExactly( console.warn,
+				sinon.match( 'foo' ),
+				{ name: 'foo' },
+				`\nRead more: ${ DOCUMENTATION_URL }#error-foo`
+			);
+		} );
+
+		it( 'should log warning without data and with a link to the documentation', () => {
+			logWarning( 'foo' );
+
+			sinon.assert.calledOnce( console.warn );
+			sinon.assert.calledWithExactly( console.warn,
+				sinon.match( 'foo' ),
+				`\nRead more: ${ DOCUMENTATION_URL }#error-foo`
+			);
+		} );
+	} );
+
+	describe( 'logError()', () => {
+		beforeEach( () => {
+			testUtils.sinon.stub( console, 'error' );
+		} );
+
+		afterEach( () => {
+			console.error.restore();
+		} );
+
+		it( 'should log error with data and link to the documentation', () => {
+			logError( 'foo', { name: 'foo' } );
+
+			sinon.assert.calledOnce( console.error );
+			sinon.assert.calledWithExactly( console.error,
+				sinon.match( 'foo' ),
+				{ name: 'foo' },
+				`\nRead more: ${ DOCUMENTATION_URL }#error-foo`
+			);
+		} );
+
+		it( 'should log error without data and with a link to the documentation', () => {
+			logError( 'foo' );
+
+			sinon.assert.calledOnce( console.error );
+			sinon.assert.calledWithExactly( console.error,
+				sinon.match( 'foo' ),
+				`\nRead more: ${ DOCUMENTATION_URL }#error-foo`
+			);
+		} );
+	} );
 } );

+ 2 - 6
packages/ckeditor5-widget/src/widgettoolbarrepository.js

@@ -7,8 +7,6 @@
  * @module widget/widgettoolbarrepository
  */
 
-/* global console */
-
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon';
 import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';
@@ -17,7 +15,7 @@ import {
 	isWidget,
 	centeredBalloonPositionForLongWidgets
 } from './utils';
-import CKEditorError, { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import CKEditorError, { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 /**
  * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
@@ -134,9 +132,7 @@ export default class WidgetToolbarRepository extends Plugin {
 			 *
 			 * @error widget-toolbar-no-items
 			 */
-			console.warn(
-				attachLinkToDocumentation( 'widget-toolbar-no-items' ), { toolbarId }
-			);
+			logWarning( 'widget-toolbar-no-items', { toolbarId } );
 
 			return;
 		}