From 67d7387ae71ceafc3c581f748bbc5a02a54ac222 Mon Sep 17 00:00:00 2001 From: Anna Tomanek Date: Tue, 16 Jul 2019 08:50:12 +0200 Subject: [PATCH 01/40] Docs: Link feature guide corrected. [skip ci] --- docs/features/link.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/features/link.md b/docs/features/link.md index bd636da..a5538b6 100644 --- a/docs/features/link.md +++ b/docs/features/link.md @@ -5,7 +5,7 @@ category: features {@snippet features/build-link-source} -The {@link module:link/link~Link} feature brings support for link editing to the editor. It allows for inserting hyperlinks into the edited content and offers the UI to create and edit them. +The {@link module:link/link~Link} feature brings support for link editing to the rich-text editor. It allows for inserting hyperlinks into the edited content and offers the UI to create and edit them. ## Demo @@ -27,13 +27,15 @@ CKEditor 5 allows for typing both at inner and outer boundaries of links to make ## Custom link attributes (decorators) -By default, all links created in the editor have the `href="..."` attribute in the {@link builds/guides/integration/basic-api#getting-the-editor-data editor data}. If you want your links to have additional link attributes, {@link module:link/link~LinkConfig#decorators link decorators} provide an easy way to configure and manage them. There are two types of link decorators you can make use of: +By default, all links created in the editor have the `href="..."` attribute in the {@link builds/guides/integration/basic-api#getting-the-editor-data editor data}. If you want your links to have additional link attributes, {@link module:link/link~LinkConfig#decorators link decorators} provide an easy way to configure and manage them. -* [**automatic**](#adding-attributes-to-links-based-on-predefined-rules-automatic-decorators) – they match links against pre–defined rules and manage their attributes based on the results, -* [**manual**](#adding-attributes-to-links-using-the-ui-manual-decorators) – they allow users to control link attributes individually using the editor UI. +There are two types of link decorators you can use: + +* [**Automatic**](#adding-attributes-to-links-based-on-predefined-rules-automatic-decorators) – They match links against pre–defined rules and manage their attributes based on the results. +* [**Manual**](#adding-attributes-to-links-using-the-ui-manual-decorators) – They allow users to control link attributes individually using the editor UI. - Link decorators are disabled by default and it takes a proper [configuration](#configuration) to enable them in your editor. If you do not want to use them in your application, you do not need to do anything. + Link decorators are disabled by default and it takes a proper [configuration](#configuration) to enable them in your rich-text editor. ### Demo @@ -57,7 +59,7 @@ ClassicEditor // Automatically add target="_blank" and rel="noopener noreferrer" to all external links. addTargetToExternalLinks: true, - // Allow users control the "download" attribute of each link. + // Let the users control the "download" attribute of each link. decorators: [ { mode: 'manual', @@ -75,15 +77,17 @@ ClassicEditor ### Configuration -Decorators are configured via definitions in {@link module:link/link~LinkConfig#decorators `config.link.decorators`}. Each decorator definition must have its own unique name. In case of [manual decorators](#adding-attributes-to-links-using-the-ui-manual-decorators), that name also represents the decorator in the {@link framework/guides/architecture/editing-engine#text-attributes document model}. +Decorators are configured through definitions provided in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration option. + +Each decorator definition must have its own unique name. In case of [manual decorators](#adding-attributes-to-links-using-the-ui-manual-decorators), that name also represents the decorator in the {@link framework/guides/architecture/editing-engine#text-attributes document model}. - 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 quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute. + Link decorators work independently of one another and no conflict resolution mechanism exists. For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute. #### Adding `target` and `rel` attributes to external links -A very common use case for (automatic) link decorators is adding `target="_blank"` and `rel="noopener noreferrer"` attributes to all external links in the document. A dedicated {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`} configuration has been created for that purpose. When this option is set `true`, all links starting with `http://`, `https://` or `//` are "decorated" with `target` and `rel` attributes. +A very common use case for (automatic) link decorators is adding `target="_blank"` and `rel="noopener noreferrer"` attributes to all external links in the document. A dedicated {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`} configuration has been created for that purpose. When this option is set to `true`, all links starting with `http://`, `https://` or `//` are "decorated" with `target` and `rel` attributes. ```js ClassicEditor @@ -120,7 +124,7 @@ ClassicEditor .catch( ... ); ``` -**Note**: If you want to leave the decision whether a link should open in new tab to the users, do not use the `config.link.addTargetToExternalLinks` configuration but define a new [manual decorator](#adding-attributes-to-links-using-the-ui-manual-decorators) with the proper definition: +If you want to leave the decision whether a link should open in a new tab to the users, do not use the `config.link.addTargetToExternalLinks` configuration but define a new [manual decorator](#adding-attributes-to-links-using-the-ui-manual-decorators) with the following definition instead: ```js ClassicEditor @@ -145,7 +149,7 @@ ClassicEditor #### Adding attributes to links based on pre–defined rules (automatic decorators) -Automatic link decorators match all links in the editor content against a {@link module:link/link~LinkDecoratorAutomaticDefinition function} which decides whether the link should gain some set of attributes or not, considering the URL (`href`) of the link. These decorators work silently being applied during {@link framework/guides/architecture/editing-engine#conversion data downcast} only. +Automatic link decorators match all links in the editor content against a {@link module:link/link~LinkDecoratorAutomaticDefinition function} which decides whether the link should receive some set of attributes, considering the URL (`href`) of the link. These decorators work silently and are being applied during the {@link framework/guides/architecture/editing-engine#conversion data downcast} only. For instance, to create an automatic decorator that adds the `download="file.pdf"` attribute to all links ending with the `".pdf"` extension, you should add the following {@link module:link/link~LinkDecoratorAutomaticDefinition definition} to {@link module:link/link~LinkConfig#decorators `config.link.decorators`}: @@ -170,12 +174,12 @@ ClassicEditor ``` - If you want `target` and `rel` attributes to be added to all external links in your content, we prepared a [dedicated configuration](#adding-target-and-rel-attributes-to-external-links) exactly for that purpose so you do not have to define the automatic decorator by yourself. + If you want the `target` and `rel` attributes to be added to all external links in your content, we prepared a [dedicated configuration](#adding-target-and-rel-attributes-to-external-links) exactly for that purpose so you do not have to define the automatic decorator by yourself. #### Adding attributes to links using the UI (manual decorators) -Manual link decorators are represented in the link editing balloon as switch buttons users can use to control the presence of attributes of a particular link (check out the [demo](#demo) to learn more). Each manual decorator {@link module:link/link~LinkDecoratorManualDefinition definition} contains a human–readable label displayed next to the switch button in the link editing balloon. Make sure it is compact and precise for the convenience of the users. +Manual link decorators are represented in the link editing balloon as switch buttons that the users can use to control the presence of attributes of a particular link (check out the [demo](#demo) to learn more). Each manual decorator {@link module:link/link~LinkDecoratorManualDefinition definition} contains a human–readable label displayed next to the switch button in the link editing balloon. Make sure it is compact and precise for the convenience of the users. To configure a "Downloadable" switch button in the link editing balloon that adds the `download="file"` attribute to the link when turned on, add the following definition to {@link module:link/link~LinkConfig#decorators `config.link.decorators`}: @@ -246,7 +250,7 @@ editor.execute( 'link', 'http://example.com', { linkIsExternal: true } ); editor.execute( 'unlink' ); ``` -Links are represented in the {@link module:engine/model/model~Model model} using the `linkHref` attribute. [Manual link decorators](#adding-attributes-to-links-using-the-ui-manual-decorators) are represented in the model using text attributes corresponding to their names as configured in {@link module:link/link~LinkConfig#decorators `config.link.decorators`}. +Links are represented in the {@link module:engine/model/model~Model model} using the `linkHref` attribute. [Manual link decorators](#adding-attributes-to-links-using-the-ui-manual-decorators) are represented in the model using text attributes corresponding to their names, as configured in {@link module:link/link~LinkConfig#decorators `config.link.decorators`}. We recommend using the official {@link framework/guides/development-tools#ckeditor-5-inspector CKEditor 5 inspector} for development and debugging. It will give you tons of useful information about the state of the editor such as internal data structures, selection, commands, and many more. From dd72ae91d2531842ba36932caa71c9b5e745cbcf Mon Sep 17 00:00:00 2001 From: Anna Tomanek Date: Tue, 16 Jul 2019 11:49:17 +0200 Subject: [PATCH 02/40] Docs: API docs for links and link decorators corrected. [skip ci] --- src/link.js | 59 ++++++++++++++++---------------- src/linkcommand.js | 28 +++++++-------- src/linkediting.js | 20 +++++------ src/linkui.js | 30 ++++++++-------- src/ui/linkactionsview.js | 8 ++--- src/ui/linkformview.js | 30 ++++++++-------- src/unlinkcommand.js | 4 +-- src/utils.js | 18 +++++----- src/utils/automaticdecorators.js | 18 +++++----- src/utils/manualdecorator.js | 24 ++++++------- 10 files changed, 119 insertions(+), 120 deletions(-) diff --git a/src/link.js b/src/link.js index 7ad546a..7d881d3 100644 --- a/src/link.js +++ b/src/link.js @@ -14,7 +14,7 @@ import LinkUI from './linkui'; /** * The link plugin. * - * This is a "glue" plugin which loads the {@link module:link/linkediting~LinkEditing link editing feature} + * This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature} * and {@link module:link/linkui~LinkUI link UI feature}. * * @extends module:core/plugin~Plugin @@ -58,8 +58,8 @@ export default class Link extends Plugin { */ /** - * When set `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links - * in the editor. By external are meant all links in the editor content starting with `http`, `https`, or `//`. + * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links + * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`. * * ClassicEditor * .create( editorElement, { @@ -70,15 +70,15 @@ export default class Link extends Plugin { * .then( ... ) * .catch( ... ); * - * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}, - * which extends all external links with the `target` and `rel` attributes without additional configuration. + * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator} + * that extends all external links with the `target` and `rel` attributes. * * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} 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~LinkDecoratorAutomaticDefinition automatic} + * 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} @@ -92,12 +92,12 @@ 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~LinkDecoratorAutomaticDefinition automatic} – they match links against pre–defined rules and - * manage their attributes based on the results, - * * {@link module:link/link~LinkDecoratorManualDefinition manual} – they allow users to control link attributes individually + * * {@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~LinkDecoratorManualDefinition Manual} – They allow users to control link attributes individually, * using the editor UI. * - * Link decorators are defined as an object with key-value pairs, where the key is a name provided for a given decorator and the + * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the * value is the decorator definition. * * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute} @@ -132,8 +132,8 @@ export default class Link extends Plugin { * 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 + * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists. + * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute. * * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator @@ -141,7 +141,7 @@ export default class Link extends Plugin { * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`} * configuration description to learn more. * - * See also {@glink features/link#custom-link-attributes-decorators link's feature} guide for more information. + * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information. * * @member {Object.} module:link/link~LinkConfig#decorators */ @@ -154,23 +154,22 @@ export default class Link extends Plugin { */ /** - * The kind of the decorator. + * Link decorator type. * - * Check out the {@glink features/link#custom-link-attributes-decorators link feature} guide for more information. + * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information. * * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode */ /** - * Describes an automatic link {@link module:link/link~LinkConfig#decorators decorator}. This kind of a decorator matches - * all links in the editor content against a function which decides whether the link should gain a pre–defined set of attributes - * or not. + * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches + * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes. * - * It takes an object with key-value pairs of attributes and a callback function which must return a boolean based on link's + * It takes an object with key-value pairs of attributes and a callback function that must return a Boolean value based on the link's * `href` (URL). When the callback returns `true`, attributes are applied to the link. * - * For example, to add the `target="_blank"` attribute to all links in the editor starting with the `http://`, - * then configuration could look like this: + * For example, to add the `target="_blank"` attribute to all links in the editor starting with `http://`, the + * configuration could look like this: * * { * mode: 'automatic', @@ -181,24 +180,24 @@ export default class Link extends Plugin { * } * * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator - * dedicated for that purpose which can be enabled by turning a single option on. Check out the + * dedicated for that purpose that can be enabled by turning a single option on. Check out the * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`} * configuration description to learn more. * * @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 {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators. + * @property {Function} callback Takes a `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 * {@glink framework/guides/architecture/editing-engine#conversion downcasting}. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax. */ /** - * Describes a manual link {@link module:link/link~LinkConfig#decorators decorator}. This kind of a decorator is represented in - * the link feature's {@link module:link/linkui user interface} as a switch the user can use to control the presence - * of a pre–defined set of attributes. + * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in + * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence + * of a predefined set of attributes. * - * For instance, to allow users to manually control the presence of the `target="_blank"` and + * For instance, to allow the users to manually control the presence of the `target="_blank"` and * `rel="noopener noreferrer"` attributes on specific links, the decorator could look as follows: * * { @@ -211,8 +210,8 @@ export default class Link extends Plugin { * } * * @typedef {Object} module:link/link~LinkDecoratorManualDefinition - * @property {'manual'} 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 {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators. + * @property {String} label The label of the UI button that 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 * {@glink framework/guides/architecture/editing-engine#conversion downcasting}. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax. diff --git a/src/linkcommand.js b/src/linkcommand.js index 6334d55..f1d1f14 100644 --- a/src/linkcommand.js +++ b/src/linkcommand.js @@ -33,7 +33,7 @@ export default class LinkCommand extends Command { * A collection of {@link module:link/utils~ManualDecorator manual decorators} * corresponding to the {@link module:link/link~LinkConfig#decorators decorator configuration}. * - * You can consider it a model with states of manual decorators added to currently selected link. + * You can consider it a model with states of manual decorators added to the currently selected link. * * @readonly * @type {module:utils/collection~Collection} @@ -42,7 +42,7 @@ export default class LinkCommand extends Command { } /** - * Synchronize state of {@link #manualDecorators} with actually present elements in the model. + * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model. */ restoreManualDecoratorStates() { for ( const manualDecorator of this.manualDecorators ) { @@ -72,8 +72,8 @@ export default class LinkCommand extends Command { * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted). * - * When the selection is collapsed and is not inside the text with the `linkHref` attribute, the - * new {@link module:engine/model/text~Text Text node} with the `linkHref` attribute will be inserted in place of caret, but + * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a + * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter. * The selection will be updated to wrap the just inserted text node. * @@ -81,18 +81,18 @@ export default class LinkCommand extends Command { * * # Decorators and model attribute management * - * There is an optional argument to this command, which applies or removes model + * There is an optional argument to this command that applies or removes model * {@glink framework/guides/architecture/editing-engine#text-attributes text attributes} brought by * {@link module:link/utils~ManualDecorator manual link decorators}. * * Text attribute names in the model correspond to the entries in the {@link module:link/link~LinkConfig#decorators configuration}. * For every decorator configured, a model text attribute exists with the "link" prefix. For example, a `'linkMyDecorator'` attribute - * corresponds to the `'myDecorator'` in the configuration. + * corresponds to `'myDecorator'` in the configuration. * * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} * documentation. * - * Here is how to manage decorator attributes via the link command: + * Here is how to manage decorator attributes with the link command: * * const linkCommand = editor.commands.get( 'link' ); * @@ -101,25 +101,25 @@ export default class LinkCommand extends Command { * linkIsExternal: true * } ); * - * // Removing a decorator attribute from a selection. + * // Removing a decorator attribute from the selection. * linkCommand.execute( 'http://example.com', { * linkIsExternal: false * } ); * - * // Adding multiple decorator attributes at a time. + * // Adding multiple decorator attributes at the same time. * linkCommand.execute( 'http://example.com', { * linkIsExternal: true, * linkIsDownloadable: true, * } ); * - * // Removing and adding decorator attributes at a time. + * // Removing and adding decorator attributes at the same time. * linkCommand.execute( 'http://example.com', { * linkIsExternal: false, * linkFoo: true, * linkIsDownloadable: false, * } ); * - * **Note**: If decorator attribute name is not specified its state remains untouched. + * **Note**: If the decorator attribute name is not specified, its state remains untouched. * * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all * decorator attributes. @@ -206,11 +206,11 @@ export default class LinkCommand extends Command { } /** - * Method provides the information if a decorator with given name is present in currently processed selection. + * Provides information whether a decorator with a given name is present in the currently processed selection. * * @private - * @param {String} decoratorName name of a manual decorator used in the model - * @returns {Boolean} The information if a given decorator is currently present in a selection + * @param {String} decoratorName The name of the manual decorator used in the model + * @returns {Boolean} The information whether a given decorator is currently present in the selection. */ _getDecoratorStateFromModel( decoratorName ) { const doc = this.editor.model.document; diff --git a/src/linkediting.js b/src/linkediting.js index b2275f7..a5733e2 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -95,7 +95,7 @@ export default class LinkEditing extends Plugin { * for each one of them. Downcast dispatchers are obtained using the * {@link module:link/utils~AutomaticDecorators#getDispatcher} method. * - * **Note**: This method also activates the automatic external link decorator if enabled via + * **Note**: This method also activates the automatic external link decorator if enabled with * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}. * * @private @@ -105,7 +105,7 @@ export default class LinkEditing extends Plugin { const editor = this.editor; const automaticDecorators = new AutomaticDecorators(); - // Adds default decorator for external links. + // Adds a default decorator for external links. if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) { automaticDecorators.add( { id: 'linkIsExternal', @@ -126,11 +126,11 @@ export default class LinkEditing extends Plugin { } /** - * 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 + * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators}, + * 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). * - * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attributeToElement} + * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element} * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema} * with adequate model attributes. * @@ -180,13 +180,13 @@ export default class LinkEditing extends Plugin { * Adds a visual highlight style to a link in which the selection is anchored. * Together with two-step caret movement, they indicate that the user is typing inside the link. * - * Highlight is turned on by adding `.ck-link_selected` class to the link in the view: + * Highlight is turned on by adding the `.ck-link_selected` class to the link in the view: * - * * the class is removed before conversion has started, as callbacks added with `'highest'` priority - * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events, - * * the class is added in the view post fixer, after other changes in the model tree were converted to the view. + * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority + * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events. + * * The class is added in the view post fixer, after other changes in the model tree were converted to the view. * - * This way, adding and removing highlight does not interfere with conversion. + * This way, adding and removing the highlight does not interfere with conversion. * * @private */ diff --git a/src/linkui.js b/src/linkui.js index ecee3a7..0c0ee8c 100644 --- a/src/linkui.js +++ b/src/linkui.js @@ -138,7 +138,7 @@ export default class LinkUI extends Plugin { * Creates the {@link module:link/ui/linkformview~LinkFormView} instance. * * @private - * @returns {module:link/ui/linkformview~LinkFormView} The link form instance. + * @returns {module:link/ui/linkformview~LinkFormView} The link form view instance. */ _createFormView() { const editor = this.editor; @@ -311,19 +311,19 @@ export default class LinkUI extends Plugin { } /** - * Closes form view. Decides whether the balloon should be hidden completely or if action view should be shown. This is decided upon - * link command value (which has value if the document selection is in link). + * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is + * decided upon the link command value (which has a value if the document selection is in the link). * - * If there are defined {@link module:link/link~LinkConfig#decorators} in editor's config, then there are additionally - * rest switch buttons state responsible for manual decorators handling. + * Additionally, if any {@link module:link/link~LinkConfig#decorators} are defined in the editor configuration, the state of + * switch buttons responsible for manual decorator handling is restored. * * @private */ _closeFormView() { const linkCommand = this.editor.commands.get( 'link' ); - // Reset manual decorator states to represent current model state. This case is important to reset switch buttons, - // when user cancel editing form. + // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons + // when the user cancels the editing form. linkCommand.restoreManualDecoratorStates(); if ( linkCommand.value !== undefined ) { @@ -353,7 +353,7 @@ export default class LinkUI extends Plugin { } /** - * Shows the right kind of the UI for current state of the command. It's either + * Shows the correct UI type for the current state of the command. It is either * {@link #formView} or {@link #actionsView}. * * @param {Boolean} forceVisible @@ -428,7 +428,7 @@ export default class LinkUI extends Plugin { /** * Makes the UI react to the {@link module:core/editor/editorui~EditorUI#event:update} event to - * reposition itself when the editor ui should be refreshed. + * reposition itself when the editor UI should be refreshed. * * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event. * @@ -481,7 +481,7 @@ export default class LinkUI extends Plugin { } /** - * Returns true when {@link #formView} is in the {@link #_balloon}. + * Returns `true` when {@link #formView} is in the {@link #_balloon}. * * @readonly * @protected @@ -492,7 +492,7 @@ export default class LinkUI extends Plugin { } /** - * Returns true when {@link #actionsView} is in the {@link #_balloon}. + * Returns `true` when {@link #actionsView} is in the {@link #_balloon}. * * @readonly * @protected @@ -503,7 +503,7 @@ export default class LinkUI extends Plugin { } /** - * Returns true when {@link #actionsView} is in the {@link #_balloon} and it is + * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is * currently visible. * * @readonly @@ -515,7 +515,7 @@ export default class LinkUI extends Plugin { } /** - * Returns true when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}. + * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}. * * @readonly * @protected @@ -526,7 +526,7 @@ export default class LinkUI extends Plugin { } /** - * Returns true when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is + * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is * currently visible. * * @readonly @@ -568,7 +568,7 @@ export default class LinkUI extends Plugin { * the {@link module:engine/view/document~Document editing view's} selection or `null` * if there is none. * - * **Note**: For a non–collapsed selection the link element is only returned when **fully** + * **Note**: For a non–collapsed selection, the link element is only returned when **fully** * selected and the **only** element within the selection boundaries. * * @private diff --git a/src/ui/linkactionsview.js b/src/ui/linkactionsview.js index 886b546..cfeeee2 100644 --- a/src/ui/linkactionsview.js +++ b/src/ui/linkactionsview.js @@ -23,7 +23,7 @@ import pencilIcon from '@ckeditor/ckeditor5-core/theme/icons/pencil.svg'; import '../../theme/linkactions.css'; /** - * The link actions view class. This view displays link preview, allows + * The link actions view class. This view displays the link preview, allows * unlinking or editing the link. * * @extends module:ui/view~View @@ -75,7 +75,7 @@ export default class LinkActionsView extends View { this.editButtonView = this._createButton( t( 'Edit link' ), pencilIcon, 'edit' ); /** - * Value of the "href" attribute of the link to use in the {@link #previewButtonView}. + * The value of the "href" attribute of the link to use in the {@link #previewButtonView}. * * @observable * @member {String} @@ -83,7 +83,7 @@ export default class LinkActionsView extends View { this.set( 'href' ); /** - * A collection of views which can be focused in the view. + * A collection of views that can be focused in the view. * * @readonly * @protected @@ -168,7 +168,7 @@ export default class LinkActionsView extends View { * * @private * @param {String} label The button label. - * @param {String} icon The button's icon. + * @param {String} icon The button icon. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to. * @returns {module:ui/button/buttonview~ButtonView} The button view instance. */ diff --git a/src/ui/linkformview.js b/src/ui/linkformview.js index 6205d64..226377c 100644 --- a/src/ui/linkformview.js +++ b/src/ui/linkformview.js @@ -96,7 +96,7 @@ export default class LinkFormView extends View { this._manualDecoratorSwitches = this._createManualDecoratorSwitches( manualDecorators ); /** - * Collection of child views in the form. + * A collection of child views in the form. * * @readonly * @type {module:ui/viewcollection~ViewCollection} @@ -104,7 +104,7 @@ export default class LinkFormView extends View { this.children = this._createFormChildren( manualDecorators ); /** - * A collection of views which can be focused in the form. + * A collection of views that can be focused in the form. * * @readonly * @protected @@ -157,7 +157,7 @@ export default class LinkFormView extends View { * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators} * in the {@link module:link/ui/linkformview~LinkFormView}. * - * @returns {Object.} key-value pairs, where the key is the name of the decorator and the value is + * @returns {Object.} Key-value pairs, where the key is the name of the decorator and the value is * its state. */ getDecoratorSwitchesState() { @@ -225,7 +225,7 @@ export default class LinkFormView extends View { * * @private * @param {String} label The button label. - * @param {String} icon The button's icon. + * @param {String} icon The button icon. * @param {String} className The additional button CSS class name. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to. * @returns {module:ui/button/buttonview~ButtonView} The button view instance. @@ -254,12 +254,12 @@ export default class LinkFormView extends View { /** * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView} - * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators} + * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}. * * @private - * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators reference to - * collection of manual decorators stored in link's command. - * @returns {module:ui/viewcollection~ViewCollection} of Switch Buttons. + * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators A reference to the + * collection of manual decorators stored in the link command. + * @returns {module:ui/viewcollection~ViewCollection} of switch buttons. */ _createManualDecoratorSwitches( manualDecorators ) { const switches = this.createCollection(); @@ -288,14 +288,14 @@ export default class LinkFormView extends View { /** * Populates the {@link #children} collection of the form. * - * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, creates an + * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding - * to those decorators. + * to these decorators. * * @private - * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators reference to - * collection of manual decorators stored in link's command. - * @returns {module:ui/viewcollection~ViewCollection} children of LinkFormView. + * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators A reference to + * the collection of manual decorators stored in the link command. + * @returns {module:ui/viewcollection~ViewCollection} The children of link form view. */ _createFormChildren( manualDecorators ) { const children = this.createCollection(); @@ -337,13 +337,13 @@ export default class LinkFormView extends View { /** * Fired when the form view is submitted (when one of the children triggered the submit event), - * e.g. click on {@link #saveButtonView}. + * for example with a click on {@link #saveButtonView}. * * @event submit */ /** - * Fired when the form view is canceled, e.g. click on {@link #cancelButtonView}. + * Fired when the form view is canceled, for example with a click on {@link #cancelButtonView}. * * @event cancel */ diff --git a/src/unlinkcommand.js b/src/unlinkcommand.js index 84f3846..8837415 100644 --- a/src/unlinkcommand.js +++ b/src/unlinkcommand.js @@ -26,8 +26,8 @@ export default class UnlinkCommand extends Command { /** * Executes the command. * - * When the selection is collapsed, removes the `linkHref` attribute from each node with the same `linkHref` attribute value. - * When the selection is non-collapsed, removes the `linkHref` attribute from each node in selected ranges. + * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value. + * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges. * * # Decorators * diff --git a/src/utils.js b/src/utils.js index bed11e9..e209ff8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -23,7 +23,7 @@ export function isLinkElement( node ) { } /** - * Creates link {@link module:engine/view/attributeelement~AttributeElement} with provided `href` attribute. + * Creates link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute. * * @param {String} href * @returns {module:engine/view/attributeelement~AttributeElement} @@ -39,9 +39,9 @@ export function createLinkElement( href, writer ) { /** * Returns a safe URL based on a given value. * - * An URL is considered safe if it is safe for the user (does not contain any malicious code). + * A URL is considered safe if it is safe for the user (does not contain any malicious code). * - * If URL is considered unsafe, a simple `"#"` is returned. + * If a URL is considered unsafe, a simple `"#"` is returned. * * @protected * @param {*} url @@ -63,16 +63,16 @@ function isSafeUrl( url ) { } /** - * Returns {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed - * to respect the locale of the editor, i.e. to display {@link module:link/link~LinkDecoratorManualDefinition label} + * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed + * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label} * in the correct language. * * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration. * * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t} - * @param {Array.} decorators reference - * where labels' values should be localized. + * @param {Array.} The decorator reference + * where the label values should be localized. * @returns {Array.} */ export function getLocalizedDecorators( t, decorators ) { @@ -92,8 +92,8 @@ export function getLocalizedDecorators( t, decorators ) { } /** - * Converts an object with defined decorators to a normalized array of decorators. There is also added `id` key for each decorator, - * which is used as attribute's name in the model. + * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and + * is used as the attribute's name in the model. * * @param {Object.} decorators * @returns {Array.} diff --git a/src/utils/automaticdecorators.js b/src/utils/automaticdecorators.js index d0d4be4..1d18253 100644 --- a/src/utils/automaticdecorators.js +++ b/src/utils/automaticdecorators.js @@ -8,14 +8,14 @@ */ /** - * Helper class which tight together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides + * Helper class that ties 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~LinkDecoratorAutomaticDefinition automatic decorators}. - * Those data are used as source for a downcast dispatcher to make proper conversion to output data. + * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}. + * This data is used as a source for a downcast dispatcher to create a proper conversion to output data. * * @private * @type {Set} @@ -24,7 +24,7 @@ export default class AutomaticDecorators { } /** - * Gives information how many decorators is stored in {@link module:link/utils~AutomaticDecorators} instance. + * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance. * * @readonly * @protected @@ -35,10 +35,10 @@ export default class AutomaticDecorators { } /** - * Add automatic decorator objects or array with them to be used during downcasting. + * Adds automatic decorator objects or an array with them to be used during downcasting. * * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.} item - * configuration object of automatic rules for decorating links. It might be also array of such objects. + * A configuration object of automatic rules for decorating links. It might also be an array of such objects. */ add( item ) { if ( Array.isArray( item ) ) { @@ -49,10 +49,10 @@ export default class AutomaticDecorators { } /** - * Provides the conversion helper used in an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method. + * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method. * - * @returns {Function} dispatcher function used as conversion helper - * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} + * @returns {Function} A dispatcher function used as conversion helper + * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}. */ getDispatcher() { return dispatcher => { diff --git a/src/utils/manualdecorator.js b/src/utils/manualdecorator.js index 9d4ef59..8b5baed 100644 --- a/src/utils/manualdecorator.js +++ b/src/utils/manualdecorator.js @@ -11,33 +11,33 @@ import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; import mix from '@ckeditor/ckeditor5-utils/src/mix'; /** - * Helper class which stores manual decorators with observable {@link module:link/utils~ManualDecorator#value} - * to support integration with the UI state. An instance of this class is a model with state of single manual decorators. + * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value} + * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators. * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}. * * @mixes module:utils/observablemixin~ObservableMixin */ export default class ManualDecorator { /** - * Creates new instance of {@link module:link/utils~ManualDecorator}. + * Creates a new instance of {@link module:link/utils~ManualDecorator}. * * @param {Object} config - * @param {String} config.id name of attribute used in model, which represents given manual decorator. - * For example `'linkIsExternal'`. - * @param {String} config.label The label used in user interface to toggle manual decorator. - * @param {Object} config.attributes Set of attributes added to output data, when decorator is active for specific link. - * Attributes should keep format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}. + * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator. + * For example: `'linkIsExternal'`. + * @param {String} config.label The label used in the user interface to toggle the manual decorator. + * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link. + * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}. */ constructor( { id, label, attributes } ) { /** - * Id of manual decorator, which is a name of attribute in model, for example 'linkManualDecorator0'. + * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'. * * @type {String} */ this.id = id; /** - * Value of current manual decorator. It reflects its state from UI. + * The value of the current manual decorator. It reflects its state from the UI. * * @observable * @member {Boolean} module:link/utils~ManualDecorator#value @@ -45,14 +45,14 @@ export default class ManualDecorator { this.set( 'value' ); /** - * The label used in user interface to toggle manual decorator. + * The label used in the user interface to toggle the manual decorator. * * @type {String} */ this.label = label; /** - * Set of attributes added to downcasted data, when decorator is activated for specific link. + * A set of attributes added to downcasted data when the decorator is activated for a specific link. * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}. * * @type {Object} From 7bdbca0a61f31617e34d86f26da64bb20efa6754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Wed, 17 Jul 2019 16:22:11 +0200 Subject: [PATCH 03/40] Docs: Use the right label. Match the predefined decorator's one. --- docs/features/link.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/link.md b/docs/features/link.md index a5538b6..ccf7b55 100644 --- a/docs/features/link.md +++ b/docs/features/link.md @@ -134,7 +134,7 @@ ClassicEditor decorators: { addTargetToLinks: { mode: 'manual', - label: 'Open link in a new tab', + label: 'Open in a new tab', attributes: { target: '_blank', rel: 'noopener noreferrer' From ecc35500f6605f97f74bf78498869a8549661450 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 30 Jul 2019 14:03:18 +0200 Subject: [PATCH 04/40] Passed editor content direction to the bindTwoStepCaretToAttribute() helper in the LinkEditing plugin. --- src/linkediting.js | 3 ++- tests/linkediting.js | 58 +++++++++++++++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/linkediting.js b/src/linkediting.js index b2275f7..1a1d5e4 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -47,6 +47,7 @@ export default class LinkEditing extends Plugin { */ init() { const editor = this.editor; + const locale = editor.locale; // Allow link attribute on all inline nodes. editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } ); @@ -83,7 +84,7 @@ export default class LinkEditing extends Plugin { this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) ); // Enable two-step caret movement for `linkHref` attribute. - bindTwoStepCaretToAttribute( editor.editing.view, editor.model, this, 'linkHref' ); + bindTwoStepCaretToAttribute( editor.editing.view, editor.model, this, 'linkHref', locale.contentLanguageDirection ); // Setup highlight over selected link. this._setupLinkHighlight(); diff --git a/tests/linkediting.js b/tests/linkediting.js index 0c07d35..d6f3c27 100644 --- a/tests/linkediting.js +++ b/tests/linkediting.js @@ -48,24 +48,54 @@ describe( 'LinkEditing', () => { expect( model.schema.checkAttribute( [ '$block' ], 'linkHref' ) ).to.be.false; } ); - it( 'should bind two-step caret movement to `linkHref` attribute', () => { - // Let's check only the minimum to not duplicated `bindTwoStepCaretToAttribute()` tests. - // Testing minimum is better then testing using spies that might give false positive results. + // Let's check only the minimum to not duplicate `bindTwoStepCaretToAttribute()` tests. + // Testing minimum is better than testing using spies that might give false positive results. + describe( 'two-step caret movement', () => { + it( 'should be bound to th `linkHref` attribute (LTR)', () => { + // Put selection before the link element. + setModelData( editor.model, 'foo[]<$text linkHref="url">bar' ); + + // The selection's gravity is not overridden because selection landed here not because of `keydown`. + expect( editor.model.document.selection.isGravityOverridden ).to.false; + + // So let's simulate the `keydown` event. + editor.editing.view.document.fire( 'keydown', { + keyCode: keyCodes.arrowright, + preventDefault: () => {}, + domTarget: document.body + } ); + + expect( editor.model.document.selection.isGravityOverridden ).to.true; + } ); - // Put selection before the link element. - setModelData( editor.model, 'foo[]<$text linkHref="url">bar' ); + it( 'should be bound to th `linkHref` attribute (RTL)', () => { + return VirtualTestEditor + .create( { + plugins: [ Paragraph, LinkEditing, Enter ], + contentLanguage: 'ar' + } ) + .then( editor => { + model = editor.model; + view = editor.editing.view; + + // Put selection before the link element. + setModelData( editor.model, 'foo[]<$text linkHref="url">bar' ); + + // The selection's gravity is not overridden because selection landed here not because of `keydown`. + expect( editor.model.document.selection.isGravityOverridden ).to.false; + + // So let's simulate the `keydown` event. + editor.editing.view.document.fire( 'keydown', { + keyCode: keyCodes.arrowleft, + preventDefault: () => {}, + domTarget: document.body + } ); - // The selection's gravity is not overridden because selection land here not as a result of `keydown`. - expect( editor.model.document.selection.isGravityOverridden ).to.false; + expect( editor.model.document.selection.isGravityOverridden ).to.true; - // So let's simulate `keydown` event. - editor.editing.view.document.fire( 'keydown', { - keyCode: keyCodes.arrowright, - preventDefault: () => {}, - domTarget: document.body + return editor.destroy(); + } ); } ); - - expect( editor.model.document.selection.isGravityOverridden ).to.true; } ); describe( 'command', () => { From f1eb91e3b41c633beae1775379a002f23508f8b1 Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Wed, 31 Jul 2019 16:15:19 +0200 Subject: [PATCH 05/40] Fix: missing return value for link postfixer. --- src/linkediting.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/linkediting.js b/src/linkediting.js index b2275f7..9d68757 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -198,6 +198,7 @@ export default class LinkEditing extends Plugin { // Adding the class. view.document.registerPostFixer( writer => { const selection = editor.model.document.selection; + let changed = false; if ( selection.hasAttribute( 'linkHref' ) ) { const modelRange = findLinkRange( selection.getFirstPosition(), selection.getAttribute( 'linkHref' ), editor.model ); @@ -206,12 +207,15 @@ export default class LinkEditing extends Plugin { // There might be multiple `a` elements in the `viewRange`, for example, when the `a` element is // broken by a UIElement. for ( const item of viewRange.getItems() ) { - if ( item.is( 'a' ) ) { + if ( item.is( 'a' ) && !item.hasClass( HIGHLIGHT_CLASS ) ) { writer.addClass( HIGHLIGHT_CLASS, item ); highlightedLinks.add( item ); + changed = true; } } } + + return changed; } ); // Removing the class. From 62306e69d5a5816558102832113e4042e4f443d2 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 8 Aug 2019 15:20:50 +0200 Subject: [PATCH 06/40] Aligned LinkEditing to the latest bindTwoStepCaretToAttribute() helper API. --- src/linkediting.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/linkediting.js b/src/linkediting.js index 58aacc6..81fefab 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -84,7 +84,13 @@ export default class LinkEditing extends Plugin { this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) ); // Enable two-step caret movement for `linkHref` attribute. - bindTwoStepCaretToAttribute( editor.editing.view, editor.model, this, 'linkHref', locale.contentLanguageDirection ); + bindTwoStepCaretToAttribute( { + view: editor.editing.view, + model: editor.model, + emitter: this, + attribute: 'linkHref', + contentDirection: locale.contentLanguageDirection + } ); // Setup highlight over selected link. this._setupLinkHighlight(); From ca86b18953938db0ab3216611a7515b77f73ea7f Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Fri, 9 Aug 2019 15:04:35 +0200 Subject: [PATCH 07/40] Set buttons as toggleable and add unit test checking it. --- src/linkui.js | 1 + tests/linkui.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/linkui.js b/src/linkui.js index 2ef5245..bc37e39 100644 --- a/src/linkui.js +++ b/src/linkui.js @@ -201,6 +201,7 @@ export default class LinkUI extends Plugin { button.icon = linkIcon; button.keystroke = linkKeystroke; button.tooltip = true; + button.isToggleable = true; // Bind button to the command. button.bind( 'isOn', 'isEnabled' ).to( linkCommand, 'value', 'isEnabled' ); diff --git a/tests/linkui.js b/tests/linkui.js index 652b2b5..f927a4c 100644 --- a/tests/linkui.js +++ b/tests/linkui.js @@ -85,6 +85,10 @@ describe( 'LinkUI', () => { expect( linkButton ).to.be.instanceOf( ButtonView ); } ); + it( 'should be toggleable button', () => { + expect( linkButton.isToggleable ).to.be.true; + } ); + it( 'should be bound to the link command', () => { const command = editor.commands.get( 'link' ); From b36af4f3b6b94260f0121cb93debb18cc6614ef5 Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Fri, 9 Aug 2019 15:10:06 +0200 Subject: [PATCH 08/40] Make sure that link's button#isOn property has boolean value. --- src/linkui.js | 3 ++- tests/linkui.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/linkui.js b/src/linkui.js index bc37e39..391d576 100644 --- a/src/linkui.js +++ b/src/linkui.js @@ -204,7 +204,8 @@ export default class LinkUI extends Plugin { button.isToggleable = true; // Bind button to the command. - button.bind( 'isOn', 'isEnabled' ).to( linkCommand, 'value', 'isEnabled' ); + button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' ); + button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value ); // Show the panel on button click. this.listenTo( button, 'execute', () => this._showUI( true ) ); diff --git a/tests/linkui.js b/tests/linkui.js index f927a4c..bdab445 100644 --- a/tests/linkui.js +++ b/tests/linkui.js @@ -93,13 +93,13 @@ describe( 'LinkUI', () => { const command = editor.commands.get( 'link' ); command.isEnabled = true; - command.value = true; + command.value = 'http://ckeditor.com'; expect( linkButton.isOn ).to.be.true; expect( linkButton.isEnabled ).to.be.true; command.isEnabled = false; - command.value = false; + command.value = undefined; expect( linkButton.isOn ).to.be.false; expect( linkButton.isEnabled ).to.be.false; From 80a845a69fc55f38058b31ea3d9685bbc940bf31 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Fri, 9 Aug 2019 16:52:22 +0200 Subject: [PATCH 09/40] Used the latest EditorConfig#language syntax. --- tests/linkediting.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/linkediting.js b/tests/linkediting.js index d6f3c27..b0a017d 100644 --- a/tests/linkediting.js +++ b/tests/linkediting.js @@ -72,7 +72,9 @@ describe( 'LinkEditing', () => { return VirtualTestEditor .create( { plugins: [ Paragraph, LinkEditing, Enter ], - contentLanguage: 'ar' + language: { + content: 'ar' + } } ) .then( editor => { model = editor.model; From dbe66319ec49e5a7e227b4d9d2263d236348c63e Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Fri, 9 Aug 2019 17:04:28 +0200 Subject: [PATCH 10/40] Aligned LinkEditing to the latest bindTwoStepCaretToAttribute() helper API. --- src/linkediting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkediting.js b/src/linkediting.js index 81fefab..deec637 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -89,7 +89,7 @@ export default class LinkEditing extends Plugin { model: editor.model, emitter: this, attribute: 'linkHref', - contentDirection: locale.contentLanguageDirection + locale } ); // Setup highlight over selected link. From 7285a2069edb5b8bb6ecbf8a1fec1f82417211bc Mon Sep 17 00:00:00 2001 From: Maciej Bukowski Date: Mon, 12 Aug 2019 13:58:39 +0200 Subject: [PATCH 11/40] Fixed API docs. --- src/ui/linkformview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/linkformview.js b/src/ui/linkformview.js index 6205d64..f1de78e 100644 --- a/src/ui/linkformview.js +++ b/src/ui/linkformview.js @@ -257,7 +257,7 @@ export default class LinkFormView extends View { * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators} * * @private - * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators reference to + * @param {module:utils/collection~Collection} manualDecorators A reference to the * collection of manual decorators stored in link's command. * @returns {module:ui/viewcollection~ViewCollection} of Switch Buttons. */ @@ -293,7 +293,7 @@ export default class LinkFormView extends View { * to those decorators. * * @private - * @param {module:link/linkcommand~LinkCommand#manualDecorators} manualDecorators reference to + * @param {module:utils/collection~Collection} manualDecorators A reference to the * collection of manual decorators stored in link's command. * @returns {module:ui/viewcollection~ViewCollection} children of LinkFormView. */ From 43455461626e433de86b2c99f435490077cdca60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 19 Aug 2019 12:36:47 +0200 Subject: [PATCH 12/40] Other: Updated translations. [skip ci] --- lang/translations/da.po | 10 ++++---- lang/translations/en-gb.po | 49 ++++++++++++++++++++++++++++++++++++ lang/translations/ku.po | 4 +-- lang/translations/nl.po | 4 +-- lang/translations/sr-latn.po | 4 +-- lang/translations/sr.po | 4 +-- 6 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 lang/translations/en-gb.po diff --git a/lang/translations/da.po b/lang/translations/da.po index db21522..0c87bea 100644 --- a/lang/translations/da.po +++ b/lang/translations/da.po @@ -30,20 +30,20 @@ msgstr "Link URL" msgctxt "Button opening the Link URL editing balloon." msgid "Edit link" -msgstr "" +msgstr "Redigér link" msgctxt "Button opening the link in new browser tab." msgid "Open link in new tab" -msgstr "" +msgstr "Åben link i ny fane" msgctxt "Label explaining that a link has no URL set (the URL is empty)." msgid "This link has no URL" -msgstr "" +msgstr "Dette link har ingen URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Åben i ny fane" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Kan downloades" diff --git a/lang/translations/en-gb.po b/lang/translations/en-gb.po new file mode 100644 index 0000000..1e54a5c --- /dev/null +++ b/lang/translations/en-gb.po @@ -0,0 +1,49 @@ +# Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +# +# !!! IMPORTANT !!! +# +# Before you edit this file, please keep in mind that contributing to the project +# translations is possible ONLY via the Transifex online service. +# +# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5. +# +# To learn more, check out the official contributor's guide: +# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html +# +msgid "" +msgstr "" +"Language-Team: English (United Kingdom) (https://www.transifex.com/ckeditor/teams/11143/en_GB/)\n" +"Language: en_GB\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgctxt "Toolbar button tooltip for the Unlink feature." +msgid "Unlink" +msgstr "Unlink" + +msgctxt "Toolbar button tooltip for the Link feature." +msgid "Link" +msgstr "Link" + +msgctxt "Label for the URL input in the Link URL editing balloon." +msgid "Link URL" +msgstr "Link URL" + +msgctxt "Button opening the Link URL editing balloon." +msgid "Edit link" +msgstr "Edit link" + +msgctxt "Button opening the link in new browser tab." +msgid "Open link in new tab" +msgstr "Open link in new tab" + +msgctxt "Label explaining that a link has no URL set (the URL is empty)." +msgid "This link has no URL" +msgstr "This link has no URL" + +msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." +msgid "Open in a new tab" +msgstr "Open in a new tab" + +msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." +msgid "Downloadable" +msgstr "Downloadable" diff --git a/lang/translations/ku.po b/lang/translations/ku.po index 2ada3ff..2c3ffa0 100644 --- a/lang/translations/ku.po +++ b/lang/translations/ku.po @@ -42,8 +42,8 @@ msgstr "ئەم بەستەرە ناونیشانی نیە" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "کردنەوەی لە پەنجەرەیەکی نوێ" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Downloadable" diff --git a/lang/translations/nl.po b/lang/translations/nl.po index 1f70d84..7f593d2 100644 --- a/lang/translations/nl.po +++ b/lang/translations/nl.po @@ -42,8 +42,8 @@ msgstr "Deze link heeft geen URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Open een nieuw tabblad" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Downloadbaar" diff --git a/lang/translations/sr-latn.po b/lang/translations/sr-latn.po index 5d00366..1f8f72c 100644 --- a/lang/translations/sr-latn.po +++ b/lang/translations/sr-latn.po @@ -42,8 +42,8 @@ msgstr "Link ne sadrži URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Otvori u novoj kartici" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Moguće preuzimanje" diff --git a/lang/translations/sr.po b/lang/translations/sr.po index 0f8aaf1..5b0eb82 100644 --- a/lang/translations/sr.po +++ b/lang/translations/sr.po @@ -42,8 +42,8 @@ msgstr "Линк не садржи УРЛ" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Отвори у новој картици" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Могуће преузимање" From cea8fa23d55ef46d58f8e1d086d62e8ed42b2090 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Fri, 23 Aug 2019 16:25:11 +0200 Subject: [PATCH 13/40] Other: Changed the URL under bugs key in package.json file. Now we have one issue tracker. See ckeditor/ckeditor5#1988. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6eade76..3d99288 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "author": "CKSource (http://cksource.com/)", "license": "GPL-2.0-or-later", "homepage": "https://ckeditor.com/ckeditor-5", - "bugs": "https://github.com/ckeditor/ckeditor5-link/issues", + "bugs": "https://github.com/ckeditor/ckeditor5/issues", "repository": { "type": "git", "url": "https://github.com/ckeditor/ckeditor5-link.git" From 87b8f51049cdd472d944c1f9025bafecd2fb0b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 26 Aug 2019 11:09:16 +0200 Subject: [PATCH 14/40] Docs: Changelog. [skip ci] --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42b5787..bbf01df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ Changelog ========= +## [11.1.2](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.1...v11.1.2) (2019-08-26) + +### Bug fixes + +* Add missing return value for link post-fixer. Closes [#241](https://github.com/ckeditor/ckeditor5-link/issues/241). ([14e5803](https://github.com/ckeditor/ckeditor5-link/commit/14e5803)) +* Improved balloon positioning when there is more than one stack in the rotator. ([d6c45df](https://github.com/ckeditor/ckeditor5-link/commit/d6c45df)) +* The UI buttons should be marked as toggleable for better assistive technologies support (see [ckeditor/ckeditor5#1403](https://github.com/ckeditor/ckeditor5/issues/1403)). ([b9e31a0](https://github.com/ckeditor/ckeditor5-link/commit/b9e31a0)) + +### Other changes + +* Changed the URL under bugs key in package.json file. Now we have one issue tracker. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([cea8fa2](https://github.com/ckeditor/ckeditor5-link/commit/cea8fa2)) +* Passed editor content direction to the `bindTwoStepCaretToAttribute()` helper in the `LinkEditing` plugin. See [ckeditor/ckeditor5#1151](https://github.com/ckeditor/ckeditor5/issues/1151). ([73bf132](https://github.com/ckeditor/ckeditor5-link/commit/73bf132)) +* Updated translations. ([4345546](https://github.com/ckeditor/ckeditor5-link/commit/4345546)) + + ## [11.1.1](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.0...v11.1.1) (2019-07-10) ### Other changes From 6ce9bc5079fcb4c961c84f73700089cbc4b14e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 26 Aug 2019 11:22:32 +0200 Subject: [PATCH 15/40] Docs: Corrected the changelog. [skip ci] --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbf01df..347a491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,16 +11,16 @@ Changelog ### Other changes -* Changed the URL under bugs key in package.json file. Now we have one issue tracker. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([cea8fa2](https://github.com/ckeditor/ckeditor5-link/commit/cea8fa2)) +* The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([cea8fa2](https://github.com/ckeditor/ckeditor5-link/commit/cea8fa2)) * Passed editor content direction to the `bindTwoStepCaretToAttribute()` helper in the `LinkEditing` plugin. See [ckeditor/ckeditor5#1151](https://github.com/ckeditor/ckeditor5/issues/1151). ([73bf132](https://github.com/ckeditor/ckeditor5-link/commit/73bf132)) -* Updated translations. ([4345546](https://github.com/ckeditor/ckeditor5-link/commit/4345546)) +* Updated translations. ([4345546](https://github.com/ckeditor/ckeditor5-link/commit/4345546)) ## [11.1.1](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.0...v11.1.1) (2019-07-10) ### Other changes -* Updated translations. ([6b720be](https://github.com/ckeditor/ckeditor5-link/commit/6b720be)) +* Updated translations. ([6b720be](https://github.com/ckeditor/ckeditor5-link/commit/6b720be)) ## [11.1.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.0.2...v11.1.0) (2019-07-04) From e52162df0747ea22c497e86e904c09099de1d06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 26 Aug 2019 11:35:17 +0200 Subject: [PATCH 16/40] Internal: Updated dependencies. [skip ci] --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 3d99288..e5899bb 100644 --- a/package.json +++ b/package.json @@ -10,21 +10,21 @@ "ckeditor5-plugin" ], "dependencies": { - "@ckeditor/ckeditor5-core": "^12.2.1", - "@ckeditor/ckeditor5-engine": "^13.2.1", - "@ckeditor/ckeditor5-ui": "^13.0.2", + "@ckeditor/ckeditor5-core": "^12.3.0", + "@ckeditor/ckeditor5-engine": "^14.0.0", + "@ckeditor/ckeditor5-ui": "^14.0.0", "lodash-es": "^4.17.10" }, "devDependencies": { - "@ckeditor/ckeditor5-block-quote": "^11.1.2", - "@ckeditor/ckeditor5-clipboard": "^12.0.1", - "@ckeditor/ckeditor5-editor-classic": "^12.1.3", - "@ckeditor/ckeditor5-enter": "^11.0.4", - "@ckeditor/ckeditor5-paragraph": "^11.0.4", - "@ckeditor/ckeditor5-theme-lark": "^14.1.1", - "@ckeditor/ckeditor5-typing": "^12.1.1", - "@ckeditor/ckeditor5-undo": "^11.0.4", - "@ckeditor/ckeditor5-utils": "^13.0.1", + "@ckeditor/ckeditor5-block-quote": "^11.1.3", + "@ckeditor/ckeditor5-clipboard": "^12.0.2", + "@ckeditor/ckeditor5-editor-classic": "^12.1.4", + "@ckeditor/ckeditor5-enter": "^11.1.0", + "@ckeditor/ckeditor5-paragraph": "^11.0.5", + "@ckeditor/ckeditor5-theme-lark": "^14.2.0", + "@ckeditor/ckeditor5-typing": "^12.2.0", + "@ckeditor/ckeditor5-undo": "^11.0.5", + "@ckeditor/ckeditor5-utils": "^14.0.0", "eslint": "^5.5.0", "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", From ece87bc83c29370c58cbe65f66ddbf633556ca42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 26 Aug 2019 11:38:27 +0200 Subject: [PATCH 17/40] Release: v11.1.2. [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5899bb..86229de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ckeditor/ckeditor5-link", - "version": "11.1.1", + "version": "11.1.2", "description": "Link feature for CKEditor 5.", "keywords": [ "ckeditor", From 3980920c6265217a0b030672be83089bdb5a6db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Mon, 2 Sep 2019 11:55:20 +0200 Subject: [PATCH 18/40] Return editor promise from asynchronous tests. --- tests/linkediting.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/linkediting.js b/tests/linkediting.js index b0a017d..e659af9 100644 --- a/tests/linkediting.js +++ b/tests/linkediting.js @@ -621,8 +621,8 @@ describe( 'LinkEditing', () => { } ); describe( 'upcast converter', () => { - it( 'should upcast attributes from initial data', done => { - VirtualTestEditor + it( 'should upcast attributes from initial data', () => { + return VirtualTestEditor .create( { initialData: '

Foo' + 'Bar

', @@ -657,13 +657,11 @@ describe( 'LinkEditing', () => { '<$text linkHref="example.com" linkIsDownloadable="true">Bar' + '' ); - } ) - .then( done ) - .catch( done ); + } ); } ); - it( 'should not upcast partial and incorrect attributes', done => { - VirtualTestEditor + it( 'should not upcast partial and incorrect attributes', () => { + return VirtualTestEditor .create( { initialData: '

Foo' + 'Bar

', @@ -698,9 +696,7 @@ describe( 'LinkEditing', () => { '<$text linkHref="example.com">Bar' + '' ); - } ) - .then( done ) - .catch( done ); + } ); } ); } ); } ); From a8b76dc8b95f609df19a00d348951111680a58b9 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Fri, 6 Sep 2019 14:47:17 +0200 Subject: [PATCH 19/40] Docs: The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See ckeditor/ckeditor5#2002. --- docs/api/link.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/link.md b/docs/api/link.md index 456767c..bee5dc7 100644 --- a/docs/api/link.md +++ b/docs/api/link.md @@ -26,5 +26,5 @@ The source code of this package is available on GitHub in https://github.com/cke * [`@ckeditor/ckeditor5-link` on npm](https://www.npmjs.com/package/@ckeditor/ckeditor5-link) * [`ckeditor/ckeditor5-link` on GitHub](https://github.com/ckeditor/ckeditor5-link) -* [Issue tracker](https://github.com/ckeditor/ckeditor5-link/issues) +* [Issue tracker](https://github.com/ckeditor/ckeditor5/issues) * [Changelog](https://github.com/ckeditor/ckeditor5-link/blob/master/CHANGELOG.md) From 5624160d8805fdc156dac88d5368eea8dcb07ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Wed, 11 Sep 2019 12:35:45 +0200 Subject: [PATCH 20/40] Docs: Removed gitter badge. See ckeditor/ckeditor5#2037. [skip ci] --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 76bf3be..8220ed6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ CKEditor 5 link feature ======================================== -[![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-link.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-link) [![Build Status](https://travis-ci.org/ckeditor/ckeditor5-link.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-link) [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-link/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-link?branch=master) From 1fcda64d21ad900ce0cc9ef3e2142fda88d5cfdc Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 12 Sep 2019 10:13:54 +0200 Subject: [PATCH 21/40] Internal: Upgraded CI environment to use Xenial version of the distro. See ckeditor/ckeditor#2041. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8f6e6b..6c0ac4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ sudo: required -dist: trusty +dist: xenial addons: chrome: stable firefox: latest language: node_js +services: +- xvfb node_js: - '8' cache: @@ -13,8 +15,6 @@ branches: - stable before_install: - export START_TIME=$( date +%s ) -- export DISPLAY=:99.0 -- sh -e /etc/init.d/xvfb start - npm i -g yarn install: - yarn add @ckeditor/ckeditor5-dev-tests From a3bf92895210fd3c3f79f002901db697ba64476f Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Thu, 10 Oct 2019 16:24:18 +0200 Subject: [PATCH 22/40] Other: Added `pluginName` property to editing plugin. --- src/linkediting.js | 7 +++++++ tests/linkediting.js | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/linkediting.js b/src/linkediting.js index 19974cf..85cee39 100644 --- a/src/linkediting.js +++ b/src/linkediting.js @@ -31,6 +31,13 @@ const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//; * @extends module:core/plugin~Plugin */ export default class LinkEditing extends Plugin { + /** + * @inheritDoc + */ + static get pluginName() { + return 'LinkEditing'; + } + /** * @inheritDoc */ diff --git a/tests/linkediting.js b/tests/linkediting.js index e659af9..f813598 100644 --- a/tests/linkediting.js +++ b/tests/linkediting.js @@ -37,6 +37,10 @@ describe( 'LinkEditing', () => { editor.destroy(); } ); + it( 'should have pluginName', () => { + expect( LinkEditing.pluginName ).to.equal( 'LinkEditing' ); + } ); + it( 'should be loaded', () => { expect( editor.plugins.get( LinkEditing ) ).to.be.instanceOf( LinkEditing ); } ); From c564d18c0c32b182f2bc7f52b48c161d8e28faa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Wed, 16 Oct 2019 13:55:05 +0200 Subject: [PATCH 23/40] Docs: Added indent/outdent buttons. See ckeditor/ckeditor5#1844. --- docs/_snippets/features/link.js | 12 ------------ docs/_snippets/features/linkdecorators.js | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/docs/_snippets/features/link.js b/docs/_snippets/features/link.js index e6bcd2e..d0d6450 100644 --- a/docs/_snippets/features/link.js +++ b/docs/_snippets/features/link.js @@ -9,18 +9,6 @@ ClassicEditor .create( document.querySelector( '#snippet-link' ), { cloudServices: CS_CONFIG, toolbar: { - items: [ - 'heading', - '|', - 'bold', - 'italic', - 'link', - 'bulletedList', - 'numberedList', - 'blockQuote', - 'undo', - 'redo' - ], viewportTopOffset: window.getViewportTopOffsetConfig() } } ) diff --git a/docs/_snippets/features/linkdecorators.js b/docs/_snippets/features/linkdecorators.js index f200898..a0fab06 100644 --- a/docs/_snippets/features/linkdecorators.js +++ b/docs/_snippets/features/linkdecorators.js @@ -9,18 +9,6 @@ ClassicEditor .create( document.querySelector( '#snippet-link-decorators' ), { cloudServices: CS_CONFIG, toolbar: { - items: [ - 'heading', - '|', - 'bold', - 'italic', - 'link', - 'bulletedList', - 'numberedList', - 'blockQuote', - 'undo', - 'redo' - ], viewportTopOffset: window.getViewportTopOffsetConfig() }, link: { From 9653092018fb75e286ae53cebaab74f21da6617d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Wed, 16 Oct 2019 20:54:12 +0200 Subject: [PATCH 24/40] Other: Updated translations. [skip ci] --- lang/translations/az.po | 4 ++-- lang/translations/cs.po | 4 ++-- lang/translations/fa.po | 4 ++-- lang/translations/hr.po | 4 ++-- lang/translations/ro.po | 10 +++++----- lang/translations/sk.po | 4 ++-- lang/translations/zh-cn.po | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lang/translations/az.po b/lang/translations/az.po index e9da3e7..905dc0d 100644 --- a/lang/translations/az.po +++ b/lang/translations/az.po @@ -42,8 +42,8 @@ msgstr "Bu linkdə URL yoxdur" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Yeni pəncərədə aç" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Yüklənə bilər" diff --git a/lang/translations/cs.po b/lang/translations/cs.po index 1931484..f08b00a 100644 --- a/lang/translations/cs.po +++ b/lang/translations/cs.po @@ -42,8 +42,8 @@ msgstr "Tento odkaz nemá žádnou URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Otevřít v nové kartě" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Ke stažení" diff --git a/lang/translations/fa.po b/lang/translations/fa.po index 29d82b9..681b8e3 100644 --- a/lang/translations/fa.po +++ b/lang/translations/fa.po @@ -42,8 +42,8 @@ msgstr "این پیوند نشانی اینترنتی ندارد" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "بازکردن در برگه جدید" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "قابل بارگیری" diff --git a/lang/translations/hr.po b/lang/translations/hr.po index 70c8f74..e30368b 100644 --- a/lang/translations/hr.po +++ b/lang/translations/hr.po @@ -42,8 +42,8 @@ msgstr "Ova veza nema URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Otvori u novoj kartici" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Moguće preuzeti" diff --git a/lang/translations/ro.po b/lang/translations/ro.po index 4a500e3..ad087f9 100644 --- a/lang/translations/ro.po +++ b/lang/translations/ro.po @@ -30,20 +30,20 @@ msgstr "Link URL" msgctxt "Button opening the Link URL editing balloon." msgid "Edit link" -msgstr "" +msgstr "Modifică link" msgctxt "Button opening the link in new browser tab." msgid "Open link in new tab" -msgstr "" +msgstr "Deschide link în tab nou" msgctxt "Label explaining that a link has no URL set (the URL is empty)." msgid "This link has no URL" -msgstr "" +msgstr "Acest link nu are niciun URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Deschide în tab nou" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Descărcabil" diff --git a/lang/translations/sk.po b/lang/translations/sk.po index 659d359..acaa136 100644 --- a/lang/translations/sk.po +++ b/lang/translations/sk.po @@ -42,8 +42,8 @@ msgstr "Tento odkaz nemá nastavenú URL adresu" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Otvoriť v novej záložke" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Na stiahnutie" diff --git a/lang/translations/zh-cn.po b/lang/translations/zh-cn.po index 4a85c90..0a05b4d 100644 --- a/lang/translations/zh-cn.po +++ b/lang/translations/zh-cn.po @@ -42,8 +42,8 @@ msgstr "此链接没有设置网址" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "在新标签页中打开" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "可下载" From 34b55523d4b789558aa30d77aadcfacc261256f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Tue, 22 Oct 2019 14:26:01 +0200 Subject: [PATCH 25/40] Other: Updated translations. [skip ci] --- lang/translations/et.po | 4 ++-- lang/translations/lv.po | 49 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 lang/translations/lv.po diff --git a/lang/translations/et.po b/lang/translations/et.po index be2fe1e..8e0df0d 100644 --- a/lang/translations/et.po +++ b/lang/translations/et.po @@ -42,8 +42,8 @@ msgstr "Sellel lingil puudub URL" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Ava uuel kaardil" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Allalaaditav" diff --git a/lang/translations/lv.po b/lang/translations/lv.po new file mode 100644 index 0000000..4f5b712 --- /dev/null +++ b/lang/translations/lv.po @@ -0,0 +1,49 @@ +# Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +# +# !!! IMPORTANT !!! +# +# Before you edit this file, please keep in mind that contributing to the project +# translations is possible ONLY via the Transifex online service. +# +# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5. +# +# To learn more, check out the official contributor's guide: +# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html +# +msgid "" +msgstr "" +"Language-Team: Latvian (https://www.transifex.com/ckeditor/teams/11143/lv/)\n" +"Language: lv\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n" + +msgctxt "Toolbar button tooltip for the Unlink feature." +msgid "Unlink" +msgstr "Noņemt Saiti" + +msgctxt "Toolbar button tooltip for the Link feature." +msgid "Link" +msgstr "Saite" + +msgctxt "Label for the URL input in the Link URL editing balloon." +msgid "Link URL" +msgstr "Saites URL" + +msgctxt "Button opening the Link URL editing balloon." +msgid "Edit link" +msgstr "Labot Saiti" + +msgctxt "Button opening the link in new browser tab." +msgid "Open link in new tab" +msgstr "Atvērt saiti jaunā cilnē" + +msgctxt "Label explaining that a link has no URL set (the URL is empty)." +msgid "This link has no URL" +msgstr "Saitei nav norādīts URL" + +msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." +msgid "Open in a new tab" +msgstr "Atvērt jaunā cilnē" + +msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." +msgid "Downloadable" +msgstr "Lejupielādējams" From cf0edd525847ea53b095acd02e1e175299fd0df8 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 23 Oct 2019 09:12:39 +0200 Subject: [PATCH 26/40] Docs: Changelog. [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 347a491..c0fefe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========= +## [15.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.2...v15.0.0) (2019-10-23) + +### Other changes + +* Added `pluginName` property to editing plugin. ([a3bf928](https://github.com/ckeditor/ckeditor5-link/commit/a3bf928)) +* Updated translations. ([34b5552](https://github.com/ckeditor/ckeditor5-link/commit/34b5552)) ([9653092](https://github.com/ckeditor/ckeditor5-link/commit/9653092)) + + ## [11.1.2](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.1...v11.1.2) (2019-08-26) ### Bug fixes From eb83631759f695509571943134cf8df12f391896 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 23 Oct 2019 10:30:36 +0200 Subject: [PATCH 27/40] Internal: Updated dependencies. [skip ci] --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 86229de..545a4b5 100644 --- a/package.json +++ b/package.json @@ -10,21 +10,21 @@ "ckeditor5-plugin" ], "dependencies": { - "@ckeditor/ckeditor5-core": "^12.3.0", - "@ckeditor/ckeditor5-engine": "^14.0.0", - "@ckeditor/ckeditor5-ui": "^14.0.0", + "@ckeditor/ckeditor5-core": "^15.0.0", + "@ckeditor/ckeditor5-engine": "^15.0.0", + "@ckeditor/ckeditor5-ui": "^15.0.0", "lodash-es": "^4.17.10" }, "devDependencies": { - "@ckeditor/ckeditor5-block-quote": "^11.1.3", - "@ckeditor/ckeditor5-clipboard": "^12.0.2", - "@ckeditor/ckeditor5-editor-classic": "^12.1.4", - "@ckeditor/ckeditor5-enter": "^11.1.0", - "@ckeditor/ckeditor5-paragraph": "^11.0.5", - "@ckeditor/ckeditor5-theme-lark": "^14.2.0", - "@ckeditor/ckeditor5-typing": "^12.2.0", - "@ckeditor/ckeditor5-undo": "^11.0.5", - "@ckeditor/ckeditor5-utils": "^14.0.0", + "@ckeditor/ckeditor5-block-quote": "^15.0.0", + "@ckeditor/ckeditor5-clipboard": "^15.0.0", + "@ckeditor/ckeditor5-editor-classic": "^15.0.0", + "@ckeditor/ckeditor5-enter": "^15.0.0", + "@ckeditor/ckeditor5-paragraph": "^15.0.0", + "@ckeditor/ckeditor5-theme-lark": "^15.0.0", + "@ckeditor/ckeditor5-typing": "^15.0.0", + "@ckeditor/ckeditor5-undo": "^15.0.0", + "@ckeditor/ckeditor5-utils": "^15.0.0", "eslint": "^5.5.0", "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", From 688dd63b34c9795ef239e3f6df221e54e5aa35bf Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 23 Oct 2019 10:35:39 +0200 Subject: [PATCH 28/40] Release: v15.0.0. [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 545a4b5..4855905 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ckeditor/ckeditor5-link", - "version": "11.1.2", + "version": "15.0.0", "description": "Link feature for CKEditor 5.", "keywords": [ "ckeditor", From f75bf0032f721f92199bd3416f975736d63f216d Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 29 Oct 2019 10:02:24 +0100 Subject: [PATCH 29/40] Internal: Updated the GitHub PR template because all packages share the same issue tracker now (see ckeditor/ckeditor5#5576). --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 027bd80..a96ebad 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ ### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention)) -Type: Message. Closes #000. +Type: Message. Closes ckeditor/ckeditor5#000. --- From a9a781e21fcfe9ea7ba77eade37ed8dfb90d8fa7 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 31 Oct 2019 11:17:44 +0100 Subject: [PATCH 30/40] Internal: Enabled stylelint in the package. --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4855905..c91fa11 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "eslint": "^5.5.0", "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", - "lint-staged": "^7.0.0" + "lint-staged": "^7.0.0", + "stylelint": "^11.1.1" }, "engines": { "node": ">=8.0.0", @@ -48,11 +49,15 @@ "theme" ], "scripts": { - "lint": "eslint --quiet '**/*.js'" + "lint": "eslint --quiet '**/*.js'", + "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'" }, "lint-staged": { "**/*.js": [ "eslint --quiet" + ], + "**/*.css": [ + "stylelint --quiet" ] }, "eslintIgnore": [ From 5c462973e4c65c1aac20e3c7981841c308903d11 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Mon, 18 Nov 2019 14:14:11 +0100 Subject: [PATCH 31/40] Link preview in the balloon should have rel="noopener noreferrer" set for security reasons. --- src/ui/linkactionsview.js | 3 ++- tests/ui/linkactionsview.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/linkactionsview.js b/src/ui/linkactionsview.js index cfeeee2..e2b6932 100644 --- a/src/ui/linkactionsview.js +++ b/src/ui/linkactionsview.js @@ -209,7 +209,8 @@ export default class LinkActionsView extends View { 'ck-link-actions__preview' ], href: bind.to( 'href', href => href && ensureSafeUrl( href ) ), - target: '_blank' + target: '_blank', + rel: 'noopener noreferrer' } } ); diff --git a/tests/ui/linkactionsview.js b/tests/ui/linkactionsview.js index ddb2b82..b119a1c 100644 --- a/tests/ui/linkactionsview.js +++ b/tests/ui/linkactionsview.js @@ -84,10 +84,14 @@ describe( 'LinkActionsView', () => { expect( view.previewButtonView.element.classList.contains( 'ck-link-actions__preview' ) ).to.be.true; } ); - it( 'has a target attribute', () => { + it( 'has a "target" attribute', () => { expect( view.previewButtonView.element.getAttribute( 'target' ) ).to.equal( '_blank' ); } ); + it( 'has a "rel" attribute', () => { + expect( view.previewButtonView.element.getAttribute( 'rel' ) ).to.equal( 'noopener noreferrer' ); + } ); + describe( ' bindings', () => { it( 'binds href DOM attribute to view#href', () => { expect( view.previewButtonView.element.getAttribute( 'href' ) ).to.be.null; From 58b1b0c0a200adf372c4a5c4ffec548611ec61b0 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 10:52:06 +0100 Subject: [PATCH 32/40] Internal: Allowed empty input in the stylelint script to avoid errors when no files are found. Added missing stylelint-config-recommended dependency. --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c91fa11..eb5e0ca 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", "lint-staged": "^7.0.0", - "stylelint": "^11.1.1" + "stylelint": "^11.1.1", + "stylelint-config-recommended": "^3.0.0" }, "engines": { "node": ">=8.0.0", @@ -50,14 +51,14 @@ ], "scripts": { "lint": "eslint --quiet '**/*.js'", - "stylelint": "stylelint --quiet 'theme/**/*.css' 'docs/**/*.css'" + "stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'" }, "lint-staged": { "**/*.js": [ "eslint --quiet" ], "**/*.css": [ - "stylelint --quiet" + "stylelint --quiet --allow-empty-input" ] }, "eslintIgnore": [ From 4225aec4466f4ae775cb383c0aa55ac47b8f2e6f Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 11:00:48 +0100 Subject: [PATCH 33/40] Internal: Added the stylelintrc config. [skip ci] --- .stylelintrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000..4b35039 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,6 @@ +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": null + } +} From 35237384d31e91b2bc3305442f17e3963d62c216 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 20 Nov 2019 12:54:06 +0100 Subject: [PATCH 34/40] Used the external stylelint-config-ckeditor5 package for stylelint configuration. --- .stylelintrc | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 4b35039..1d86a41 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,6 +1,3 @@ { - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": null - } + "extends": "stylelint-config-ckeditor5" } diff --git a/package.json b/package.json index eb5e0ca..85cdde3 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "husky": "^1.3.1", "lint-staged": "^7.0.0", "stylelint": "^11.1.1", - "stylelint-config-recommended": "^3.0.0" + "stylelint-config-ckeditor5": "^1.0.0" }, "engines": { "node": ">=8.0.0", From 5c84f57b7f1849605f99746bd32b2c13fdc72135 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 27 Nov 2019 11:42:34 +0100 Subject: [PATCH 35/40] Other: Updated translations. [skip ci] --- lang/translations/vi.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/translations/vi.po b/lang/translations/vi.po index 6ba1c55..9a4897e 100644 --- a/lang/translations/vi.po +++ b/lang/translations/vi.po @@ -42,8 +42,8 @@ msgstr "Liên kết không có đường dẫn" msgctxt "The label of the switch button that controls whether the edited link will open in a new tab." msgid "Open in a new tab" -msgstr "" +msgstr "Mở trên tab mới" msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource." msgid "Downloadable" -msgstr "" +msgstr "Có thể tải về" From ad874eb8280a7c231dd3e15481c3dfcf3480717d Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 4 Dec 2019 08:50:48 +0100 Subject: [PATCH 36/40] Docs: Changelog. [skip ci] --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fefe2..ffe5e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Changelog ========= +## [16.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v15.0.0...v16.0.0) (2019-12-04) + +### Bug fixes + +* Link preview in the balloon should have `rel="noopener noreferrer"` set for security reasons. Closes [ckeditor/ckeditor5#5746](https://github.com/ckeditor/ckeditor5/issues/5746). ([5b921b4](https://github.com/ckeditor/ckeditor5-link/commit/5b921b4)) + +### Other changes + +* Updated translations. ([5c84f57](https://github.com/ckeditor/ckeditor5-link/commit/5c84f57)) + + ## [15.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.2...v15.0.0) (2019-10-23) ### Other changes From bf851ef68c0a113259a9fabaac663ac1ea2e356f Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 4 Dec 2019 10:56:29 +0100 Subject: [PATCH 37/40] Docs: Corrected the changelog. [skip ci] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe5e00..103f6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ Changelog ### Other changes -* Updated translations. ([5c84f57](https://github.com/ckeditor/ckeditor5-link/commit/5c84f57)) +* Updated translations. ([5c84f57](https://github.com/ckeditor/ckeditor5-link/commit/5c84f57)) ## [15.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.2...v15.0.0) (2019-10-23) From bda9d2e8228fd41e3ae2b9e66942cc99fd86446e Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 4 Dec 2019 11:16:48 +0100 Subject: [PATCH 38/40] Internal: Updated dependencies. [skip ci] --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 85cdde3..9e1bfd6 100644 --- a/package.json +++ b/package.json @@ -10,21 +10,21 @@ "ckeditor5-plugin" ], "dependencies": { - "@ckeditor/ckeditor5-core": "^15.0.0", - "@ckeditor/ckeditor5-engine": "^15.0.0", - "@ckeditor/ckeditor5-ui": "^15.0.0", + "@ckeditor/ckeditor5-core": "^16.0.0", + "@ckeditor/ckeditor5-engine": "^16.0.0", + "@ckeditor/ckeditor5-ui": "^16.0.0", "lodash-es": "^4.17.10" }, "devDependencies": { - "@ckeditor/ckeditor5-block-quote": "^15.0.0", - "@ckeditor/ckeditor5-clipboard": "^15.0.0", - "@ckeditor/ckeditor5-editor-classic": "^15.0.0", - "@ckeditor/ckeditor5-enter": "^15.0.0", - "@ckeditor/ckeditor5-paragraph": "^15.0.0", - "@ckeditor/ckeditor5-theme-lark": "^15.0.0", - "@ckeditor/ckeditor5-typing": "^15.0.0", - "@ckeditor/ckeditor5-undo": "^15.0.0", - "@ckeditor/ckeditor5-utils": "^15.0.0", + "@ckeditor/ckeditor5-block-quote": "^16.0.0", + "@ckeditor/ckeditor5-clipboard": "^16.0.0", + "@ckeditor/ckeditor5-editor-classic": "^16.0.0", + "@ckeditor/ckeditor5-enter": "^16.0.0", + "@ckeditor/ckeditor5-paragraph": "^16.0.0", + "@ckeditor/ckeditor5-theme-lark": "^16.0.0", + "@ckeditor/ckeditor5-typing": "^16.0.0", + "@ckeditor/ckeditor5-undo": "^16.0.0", + "@ckeditor/ckeditor5-utils": "^16.0.0", "eslint": "^5.5.0", "eslint-config-ckeditor5": "^2.0.0", "husky": "^1.3.1", From 2de03db9da2d8df2af818235720a44f37a5ed489 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 4 Dec 2019 11:22:13 +0100 Subject: [PATCH 39/40] Release: v16.0.0. [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e1bfd6..2764fa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ckeditor/ckeditor5-link", - "version": "15.0.0", + "version": "16.0.0", "description": "Link feature for CKEditor 5.", "keywords": [ "ckeditor", From eb9dfea19eaee180970836276c3689ae271b4d75 Mon Sep 17 00:00:00 2001 From: "Christian Z. Tamayo" Date: Sun, 8 Dec 2019 23:26:35 +0800 Subject: [PATCH 40/40] Docs: Fix addTargetToLinks typo --- docs/features/link.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/link.md b/docs/features/link.md index ccf7b55..75789d0 100644 --- a/docs/features/link.md +++ b/docs/features/link.md @@ -132,7 +132,7 @@ ClassicEditor // ... link: { decorators: { - addTargetToLinks: { + addTargetToExternalLinks: { mode: 'manual', label: 'Open in a new tab', attributes: {