Socket
Socket
Sign inDemoInstall

@ckeditor/ckeditor5-link

Package Overview
Dependencies
Maintainers
1
Versions
620
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-link - npm Package Compare versions

Comparing version 11.1.1 to 11.1.2

lang/translations/en-gb.po

17

CHANGELOG.md
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
* 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))
## [11.1.1](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.0...v11.1.1) (2019-07-10)

@@ -8,3 +23,3 @@

* Updated translations. ([6b720be](https://github.com/ckeditor/ckeditor5-link/commit/6b720be))
* Updated translations. ([6b720be](https://github.com/ckeditor/ckeditor5-link/commit/6b720be))

@@ -11,0 +26,0 @@

27

package.json
{
"name": "@ckeditor/ckeditor5-link",
"version": "11.1.1",
"version": "11.1.2",
"description": "Link feature for CKEditor 5.",

@@ -13,16 +13,17 @@ "keywords": [

"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-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",

@@ -40,3 +41,3 @@ "eslint-config-ckeditor5": "^2.0.0",

"homepage": "https://ckeditor.com/ckeditor-5",
"bugs": "https://github.com/ckeditor/ckeditor5-link/issues",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {

@@ -43,0 +44,0 @@ "type": "git",

@@ -17,3 +17,3 @@ /**

*
* 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}.

@@ -62,4 +62,4 @@ *

/**
* 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 `//`.
*

@@ -75,4 +75,4 @@ * ClassicEditor

*
* 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.
*

@@ -84,3 +84,3 @@ * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated

*
* **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.

@@ -99,8 +99,8 @@ *

*
* * {@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.

@@ -140,4 +140,4 @@ *

*
* **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.

@@ -150,3 +150,3 @@ *

*
* 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.
*

@@ -164,5 +164,5 @@ * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators

/**
* 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.
*

@@ -173,11 +173,10 @@ * @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:
*

@@ -193,3 +192,3 @@ * {

* **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`}

@@ -199,4 +198,4 @@ * 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

@@ -208,7 +207,7 @@ * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.

/**
* 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:

@@ -226,4 +225,4 @@ *

* @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

@@ -230,0 +229,0 @@ * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.

@@ -36,3 +36,3 @@ /**

*
* 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.
*

@@ -46,3 +46,3 @@ * @readonly

/**
* 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.
*/

@@ -77,4 +77,4 @@ restoreManualDecoratorStates() {

*
* 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.

@@ -87,3 +87,3 @@ * The selection will be updated to wrap the just inserted text node.

*
* 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

@@ -94,3 +94,3 @@ * {@link module:link/utils~ManualDecorator manual link decorators}.

* 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.
*

@@ -100,3 +100,3 @@ * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`}

*
* Here is how to manage decorator attributes via the link command:
* Here is how to manage decorator attributes with the link command:
*

@@ -110,3 +110,3 @@ * const linkCommand = editor.commands.get( 'link' );

*
* // Removing a decorator attribute from a selection.
* // Removing a decorator attribute from the selection.
* linkCommand.execute( 'http://example.com', {

@@ -116,3 +116,3 @@ * linkIsExternal: false

*
* // Adding multiple decorator attributes at a time.
* // Adding multiple decorator attributes at the same time.
* linkCommand.execute( 'http://example.com', {

@@ -123,3 +123,3 @@ * linkIsExternal: true,

*
* // Removing and adding decorator attributes at a time.
* // Removing and adding decorator attributes at the same time.
* linkCommand.execute( 'http://example.com', {

@@ -131,3 +131,3 @@ * linkIsExternal: 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.
*

@@ -219,7 +219,7 @@ * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all

/**
* 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.
*/

@@ -226,0 +226,0 @@ _getDecoratorStateFromModel( decoratorName ) {

@@ -50,2 +50,3 @@ /**

const editor = this.editor;
const locale = editor.locale;

@@ -87,3 +88,9 @@ // Allow link attribute on all inline nodes.

// Enable two-step caret movement for `linkHref` attribute.
bindTwoStepCaretToAttribute( editor.editing.view, editor.model, this, 'linkHref' );
bindTwoStepCaretToAttribute( {
view: editor.editing.view,
model: editor.model,
emitter: this,
attribute: 'linkHref',
locale
} );

@@ -100,3 +107,3 @@ // Setup highlight over selected link.

*
* **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`}.

@@ -111,3 +118,3 @@ *

// Adds default decorator for external links.
// Adds a default decorator for external links.
if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) {

@@ -133,7 +140,7 @@ automaticDecorators.add( {

/**
* 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}

@@ -188,9 +195,9 @@ * with adequate model attributes.

*
* 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.
*

@@ -207,2 +214,3 @@ * @private

const selection = editor.model.document.selection;
let changed = false;

@@ -216,8 +224,11 @@ if ( selection.hasAttribute( 'linkHref' ) ) {

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;
} );

@@ -224,0 +235,0 @@

@@ -141,3 +141,3 @@ /**

* @private
* @returns {module:link/ui/linkformview~LinkFormView} The link form instance.
* @returns {module:link/ui/linkformview~LinkFormView} The link form view instance.
*/

@@ -205,5 +205,7 @@ _createFormView() {

button.tooltip = true;
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 );

@@ -316,7 +318,7 @@ // Show the panel on button click.

/**
* 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.
*

@@ -328,4 +330,4 @@ * @private

// 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();

@@ -360,3 +362,3 @@

/**
* 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}.

@@ -422,2 +424,3 @@ *

this.stopListening( editor.ui, 'update' );
this.stopListening( this._balloon, 'change:visibleView' );

@@ -437,3 +440,3 @@ // Make sure the focus always gets back to the editable _before_ removing the focused form view.

* 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.
*

@@ -451,3 +454,3 @@ * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.

this.listenTo( editor.ui, 'update', () => {
const update = () => {
const selectedLink = this._getSelectedLinkElement();

@@ -471,5 +474,6 @@ const selectionParent = getSelectionParent();

// Update the position of the panel when:
// * link panel is in the visible stack
// * the selection remains in the original link element,
// * there was no link element in the first place, i.e. creating a new link
else {
else if ( this._isUIVisible ) {
// If still in a link element, simply update the position of the balloon.

@@ -483,3 +487,3 @@ // If there was no link (e.g. inserting one), the balloon must be moved

prevSelectionParent = selectionParent;
} );
};

@@ -491,6 +495,9 @@ function getSelectionParent() {

}
this.listenTo( editor.ui, 'update', update );
this.listenTo( this._balloon, 'change:visibleView', update );
}
/**
* Returns true when {@link #formView} is in the {@link #_balloon}.
* Returns `true` when {@link #formView} is in the {@link #_balloon}.
*

@@ -506,3 +513,3 @@ * @readonly

/**
* Returns true when {@link #actionsView} is in the {@link #_balloon}.
* Returns `true` when {@link #actionsView} is in the {@link #_balloon}.
*

@@ -518,3 +525,3 @@ * @readonly

/**
* 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.

@@ -531,3 +538,3 @@ *

/**
* 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}.
*

@@ -543,3 +550,3 @@ * @readonly

/**
* 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.

@@ -586,3 +593,3 @@ *

*
* **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.

@@ -589,0 +596,0 @@ *

@@ -26,3 +26,3 @@ /**

/**
* 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.

@@ -79,3 +79,3 @@ *

/**
* 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}.
*

@@ -88,3 +88,3 @@ * @observable

/**
* A collection of views which can be focused in the view.
* A collection of views that can be focused in the view.
*

@@ -174,3 +174,3 @@ * @readonly

* @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.

@@ -177,0 +177,0 @@ * @returns {module:ui/button/buttonview~ButtonView} The button view instance.

@@ -99,3 +99,3 @@ /**

/**
* Collection of child views in the form.
* A collection of child views in the form.
*

@@ -108,3 +108,3 @@ * @readonly

/**
* A collection of views which can be focused in the form.
* A collection of views that can be focused in the form.
*

@@ -162,3 +162,3 @@ * @readonly

*
* @returns {Object.<String,Boolean>} key-value pairs, where the key is the name of the decorator and the value is
* @returns {Object.<String,Boolean>} Key-value pairs, where the key is the name of the decorator and the value is
* its state.

@@ -231,3 +231,3 @@ */

* @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.

@@ -261,8 +261,8 @@ * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.

* 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:utils/collection~Collection} manualDecorators A reference to the
* collection of manual decorators stored in the link command.
* @returns {module:ui/viewcollection~ViewCollection} of switch buttons.
*/

@@ -296,10 +296,10 @@ _createManualDecoratorSwitches( manualDecorators ) {

*
* 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:utils/collection~Collection} 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.
*/

@@ -346,3 +346,3 @@ _createFormChildren( manualDecorators ) {

* 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}.
*

@@ -353,5 +353,5 @@ * @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
*/

@@ -29,4 +29,4 @@ /**

*
* 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.
*

@@ -33,0 +33,0 @@ * # Decorators

@@ -26,3 +26,3 @@ /**

/**
* 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.
*

@@ -43,5 +43,5 @@ * @param {String} href

*
* 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.
*

@@ -68,4 +68,4 @@ * @protected

/**
* 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.

@@ -77,4 +77,4 @@ *

* @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}
* @param {Array.<module:link/link~LinkDecoratorDefinition>} decorators reference
* where labels' values should be localized.
* @param {Array.<module:link/link~LinkDecoratorDefinition>} The decorator reference
* where the label values should be localized.
* @returns {Array.<module:link/link~LinkDecoratorDefinition>}

@@ -99,4 +99,4 @@ */

/**
* 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.
*

@@ -103,0 +103,0 @@ * @param {Object.<String, module:link/link~LinkDecoratorDefinition>} decorators

@@ -11,3 +11,3 @@ /**

/**
* 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.

@@ -18,4 +18,4 @@ */

/**
* 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.
*

@@ -29,3 +29,3 @@ * @private

/**
* 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.
*

@@ -41,6 +41,6 @@ * @readonly

/**
* 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.<module:link/link~LinkDecoratorAutomaticDefinition>} 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.
*/

@@ -56,6 +56,6 @@ add( item ) {

/**
* 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}.
*/

@@ -62,0 +62,0 @@ getDispatcher() {

@@ -14,4 +14,4 @@ /**

/**
* 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}.

@@ -23,14 +23,14 @@ *

/**
* 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'.
*

@@ -42,3 +42,3 @@ * @type {String}

/**
* 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.
*

@@ -51,3 +51,3 @@ * @observable

/**
* The label used in user interface to toggle manual decorator.
* The label used in the user interface to toggle the manual decorator.
*

@@ -59,3 +59,3 @@ * @type {String}

/**
* 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}.

@@ -62,0 +62,0 @@ *

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc