@ckeditor/ckeditor5-link 28.0.0 → 30.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +6 -2
  3. package/build/link.js +1 -1
  4. package/build/translations/ar.js +1 -0
  5. package/build/translations/ast.js +1 -0
  6. package/build/translations/az.js +1 -0
  7. package/build/translations/bg.js +1 -0
  8. package/build/translations/cs.js +1 -0
  9. package/build/translations/da.js +1 -0
  10. package/build/translations/de-ch.js +1 -0
  11. package/build/translations/de.js +1 -0
  12. package/build/translations/el.js +1 -0
  13. package/build/translations/en-au.js +1 -0
  14. package/build/translations/en-gb.js +1 -0
  15. package/build/translations/eo.js +1 -0
  16. package/build/translations/es.js +1 -0
  17. package/build/translations/et.js +1 -0
  18. package/build/translations/eu.js +1 -0
  19. package/build/translations/fa.js +1 -0
  20. package/build/translations/fi.js +1 -0
  21. package/build/translations/fr.js +1 -0
  22. package/build/translations/gl.js +1 -0
  23. package/build/translations/he.js +1 -0
  24. package/build/translations/hi.js +1 -0
  25. package/build/translations/hr.js +1 -0
  26. package/build/translations/hu.js +1 -0
  27. package/build/translations/id.js +1 -0
  28. package/build/translations/it.js +1 -0
  29. package/build/translations/ja.js +1 -0
  30. package/build/translations/km.js +1 -0
  31. package/build/translations/kn.js +1 -0
  32. package/build/translations/ko.js +1 -0
  33. package/build/translations/ku.js +1 -0
  34. package/build/translations/lt.js +1 -0
  35. package/build/translations/lv.js +1 -0
  36. package/build/translations/nb.js +1 -0
  37. package/build/translations/ne.js +1 -0
  38. package/build/translations/nl.js +1 -0
  39. package/build/translations/no.js +1 -0
  40. package/build/translations/pl.js +1 -0
  41. package/build/translations/pt-br.js +1 -0
  42. package/build/translations/pt.js +1 -0
  43. package/build/translations/ro.js +1 -0
  44. package/build/translations/ru.js +1 -0
  45. package/build/translations/sk.js +1 -0
  46. package/build/translations/sq.js +1 -0
  47. package/build/translations/sr-latn.js +1 -0
  48. package/build/translations/sr.js +1 -0
  49. package/build/translations/sv.js +1 -0
  50. package/build/translations/tk.js +1 -0
  51. package/build/translations/tr.js +1 -0
  52. package/build/translations/ug.js +1 -0
  53. package/build/translations/uk.js +1 -0
  54. package/build/translations/vi.js +1 -0
  55. package/build/translations/zh-cn.js +1 -0
  56. package/build/translations/zh.js +1 -0
  57. package/ckeditor5-metadata.json +76 -0
  58. package/lang/translations/ro.po +1 -1
  59. package/package.json +25 -20
  60. package/src/autolink.js +13 -1
  61. package/src/link.js +14 -2
  62. package/src/linkcommand.js +13 -15
  63. package/src/linkediting.js +15 -5
  64. package/src/linkimageediting.js +79 -67
  65. package/src/linkimageui.js +21 -19
  66. package/src/linkui.js +20 -12
  67. package/src/unlinkcommand.js +6 -8
  68. package/src/utils/automaticdecorators.js +33 -6
  69. package/src/utils/manualdecorator.js +31 -1
  70. package/src/utils.js +3 -3
  71. package/theme/linkimage.css +9 -12
  72. package/CHANGELOG.md +0 -313
  73. package/build/link.js.map +0 -1
package/src/linkui.js CHANGED
@@ -10,7 +10,7 @@
10
10
  import { Plugin } from 'ckeditor5/src/core';
11
11
  import { ClickObserver } from 'ckeditor5/src/engine';
12
12
  import { ButtonView, ContextualBalloon, clickOutsideHandler } from 'ckeditor5/src/ui';
13
-
13
+ import { isWidget } from 'ckeditor5/src/widget';
14
14
  import LinkFormView from './ui/linkformview';
15
15
  import LinkActionsView from './ui/linkactionsview';
16
16
  import { addLinkProtocolIfApplicable, isLinkElement, LINK_KEYSTROKE } from './utils';
@@ -593,14 +593,19 @@ export default class LinkUI extends Plugin {
593
593
 
594
594
  target = view.domConverter.viewRangeToDom( newRange );
595
595
  } else {
596
- const targetLink = this._getSelectedLinkElement();
597
- const range = viewDocument.selection.getFirstRange();
598
-
599
- target = targetLink ?
600
- // When selection is inside link element, then attach panel to this element.
601
- view.domConverter.mapViewToDom( targetLink ) :
602
- // Otherwise attach panel to the selection.
603
- view.domConverter.viewRangeToDom( range );
596
+ // Make sure the target is calculated on demand at the last moment because a cached DOM range
597
+ // (which is very fragile) can desynchronize with the state of the editing view if there was
598
+ // any rendering done in the meantime. This can happen, for instance, when an inline widget
599
+ // gets unlinked.
600
+ target = () => {
601
+ const targetLink = this._getSelectedLinkElement();
602
+
603
+ return targetLink ?
604
+ // When selection is inside link element, then attach panel to this element.
605
+ view.domConverter.mapViewToDom( targetLink ) :
606
+ // Otherwise attach panel to the selection.
607
+ view.domConverter.viewRangeToDom( viewDocument.selection.getFirstRange() );
608
+ };
604
609
  }
605
610
 
606
611
  return { target };
@@ -611,8 +616,9 @@ export default class LinkUI extends Plugin {
611
616
  * the {@link module:engine/view/document~Document editing view's} selection or `null`
612
617
  * if there is none.
613
618
  *
614
- * **Note**: For a non–collapsed selection, the link element is only returned when **fully**
615
- * selected and the **only** element within the selection boundaries.
619
+ * **Note**: For a non–collapsed selection, the link element is returned when **fully**
620
+ * selected and the **only** element within the selection boundaries, or when
621
+ * a linked widget is selected.
616
622
  *
617
623
  * @private
618
624
  * @returns {module:engine/view/attributeelement~AttributeElement|null}
@@ -620,8 +626,10 @@ export default class LinkUI extends Plugin {
620
626
  _getSelectedLinkElement() {
621
627
  const view = this.editor.editing.view;
622
628
  const selection = view.document.selection;
629
+ const selectedElement = selection.getSelectedElement();
623
630
 
624
- if ( selection.isCollapsed ) {
631
+ // The selection is collapsed or some widget is selected (especially inline widget).
632
+ if ( selection.isCollapsed || selectedElement && isWidget( selectedElement ) ) {
625
633
  return findLinkElementAncestor( selection.getFirstPosition() );
626
634
  } else {
627
635
  // The range for fully selected link is usually anchored in adjacent text nodes.
@@ -9,9 +9,8 @@
9
9
 
10
10
  import { Command } from 'ckeditor5/src/core';
11
11
  import { findAttributeRange } from 'ckeditor5/src/typing';
12
- import { first } from 'ckeditor5/src/utils';
13
12
 
14
- import { isImageAllowed } from './utils';
13
+ import { isLinkableElement } from './utils';
15
14
 
16
15
  /**
17
16
  * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
@@ -24,16 +23,15 @@ export default class UnlinkCommand extends Command {
24
23
  */
25
24
  refresh() {
26
25
  const model = this.editor.model;
27
- const doc = model.document;
28
-
29
- const selectedElement = first( doc.selection.getSelectedBlocks() );
26
+ const selection = model.document.selection;
27
+ const selectedElement = selection.getSelectedElement();
30
28
 
31
- // A check for the `LinkImage` plugin. If the selection contains an image element, get values from the element.
29
+ // A check for any integration that allows linking elements (e.g. `LinkImage`).
32
30
  // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
33
- if ( isImageAllowed( selectedElement, model.schema ) ) {
31
+ if ( isLinkableElement( selectedElement, model.schema ) ) {
34
32
  this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
35
33
  } else {
36
- this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
34
+ this.isEnabled = model.schema.checkAttributeInSelection( selection, 'linkHref' );
37
35
  }
38
36
  }
39
37
 
@@ -73,6 +73,15 @@ export default class AutomaticDecorators {
73
73
  const viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {
74
74
  priority: 5
75
75
  } );
76
+
77
+ if ( item.classes ) {
78
+ viewWriter.addClass( item.classes, viewElement );
79
+ }
80
+
81
+ for ( const key in item.styles ) {
82
+ viewWriter.setStyle( key, item.styles[ key ], viewElement );
83
+ }
84
+
76
85
  viewWriter.setCustomProperty( 'link', true, viewElement );
77
86
  if ( item.callback( data.attributeNewValue ) ) {
78
87
  if ( data.item.is( 'selection' ) ) {
@@ -97,8 +106,8 @@ export default class AutomaticDecorators {
97
106
  */
98
107
  getDispatcherForLinkedImage() {
99
108
  return dispatcher => {
100
- dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
101
- const viewFigure = conversionApi.mapper.toViewElement( data.item );
109
+ dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, { writer, mapper } ) => {
110
+ const viewFigure = mapper.toViewElement( data.item );
102
111
  const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
103
112
 
104
113
  for ( const item of this._definitions ) {
@@ -106,20 +115,38 @@ export default class AutomaticDecorators {
106
115
 
107
116
  if ( item.callback( data.attributeNewValue ) ) {
108
117
  for ( const [ key, val ] of attributes ) {
118
+ // Left for backward compatibility. Since v30 decorator should
119
+ // accept `classes` and `styles` separately from `attributes`.
109
120
  if ( key === 'class' ) {
110
- conversionApi.writer.addClass( val, linkInImage );
121
+ writer.addClass( val, linkInImage );
111
122
  } else {
112
- conversionApi.writer.setAttribute( key, val, linkInImage );
123
+ writer.setAttribute( key, val, linkInImage );
113
124
  }
114
125
  }
126
+
127
+ if ( item.classes ) {
128
+ writer.addClass( item.classes, linkInImage );
129
+ }
130
+
131
+ for ( const key in item.styles ) {
132
+ writer.setStyle( key, item.styles[ key ], linkInImage );
133
+ }
115
134
  } else {
116
135
  for ( const [ key, val ] of attributes ) {
117
136
  if ( key === 'class' ) {
118
- conversionApi.writer.removeClass( val, linkInImage );
137
+ writer.removeClass( val, linkInImage );
119
138
  } else {
120
- conversionApi.writer.removeAttribute( key, linkInImage );
139
+ writer.removeAttribute( key, linkInImage );
121
140
  }
122
141
  }
142
+
143
+ if ( item.classes ) {
144
+ writer.removeClass( item.classes, linkInImage );
145
+ }
146
+
147
+ for ( const key in item.styles ) {
148
+ writer.removeStyle( key, linkInImage );
149
+ }
123
150
  }
124
151
  }
125
152
  } );
@@ -28,7 +28,7 @@ export default class ManualDecorator {
28
28
  * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
29
29
  * @param {Boolean} [config.defaultValue] Controls whether the decorator is "on" by default.
30
30
  */
31
- constructor( { id, label, attributes, defaultValue } ) {
31
+ constructor( { id, label, attributes, classes, styles, defaultValue } ) {
32
32
  /**
33
33
  * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.
34
34
  *
@@ -65,6 +65,36 @@ export default class ManualDecorator {
65
65
  * @type {Object}
66
66
  */
67
67
  this.attributes = attributes;
68
+
69
+ /**
70
+ * A set of classes added to downcasted data when the decorator is activated for a specific link.
71
+ * Classes should be added in a form of classes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
72
+ *
73
+ * @type {Object}
74
+ */
75
+ this.classes = classes;
76
+
77
+ /**
78
+ * A set of styles added to downcasted data when the decorator is activated for a specific link.
79
+ * Styles should be added in a form of styles defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
80
+ *
81
+ * @type {Object}
82
+ */
83
+ this.styles = styles;
84
+ }
85
+
86
+ /**
87
+ * Returns {@link module:engine/view/matcher~MatcherPattern} with decorator attributes.
88
+ *
89
+ * @protected
90
+ * @returns {module:engine/view/matcher~MatcherPattern}
91
+ */
92
+ _createPattern() {
93
+ return {
94
+ attributes: this.attributes,
95
+ classes: this.classes,
96
+ styles: this.styles
97
+ };
68
98
  }
69
99
  }
70
100
 
package/src/utils.js CHANGED
@@ -129,18 +129,18 @@ export function normalizeDecorators( decorators ) {
129
129
  }
130
130
 
131
131
  /**
132
- * Returns `true` if the specified `element` is an image and it can be linked (the element allows having the `linkHref` attribute).
132
+ * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).
133
133
  *
134
134
  * @params {module:engine/model/element~Element|null} element
135
135
  * @params {module:engine/model/schema~Schema} schema
136
136
  * @returns {Boolean}
137
137
  */
138
- export function isImageAllowed( element, schema ) {
138
+ export function isLinkableElement( element, schema ) {
139
139
  if ( !element ) {
140
140
  return false;
141
141
  }
142
142
 
143
- return element.is( 'element', 'image' ) && schema.checkAttribute( 'image', 'linkHref' );
143
+ return schema.checkAttribute( element.name, 'linkHref' );
144
144
  }
145
145
 
146
146
  /**
@@ -3,17 +3,14 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
6
- .ck.ck-link-image_icon {
7
- position: absolute;
8
- top: var(--ck-spacing-medium);
9
- right: var(--ck-spacing-medium);
10
- width: 28px;
11
- height: 28px;
12
- padding: 4px;
13
- box-sizing: border-box;
14
- border-radius: var(--ck-border-radius);
15
-
16
- & svg {
17
- fill: currentColor;
6
+ .ck.ck-editor__editable {
7
+ /* Linked image indicator */
8
+ & figure.image > a,
9
+ & a span.image-inline {
10
+ &::after {
11
+ display: block;
12
+ position: absolute;
13
+ }
18
14
  }
19
15
  }
16
+
package/CHANGELOG.md DELETED
@@ -1,313 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
5
-
6
- Changes for the past releases are available below.
7
-
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v18.0.0...v19.0.0) (2020-04-29)
9
-
10
- ### Features
11
-
12
- * Introduced the `defaultValue` option to allow enabling a particular manual decorator by default. Closes [ckeditor/ckeditor5#6031](https://github.com/ckeditor/ckeditor5/issues/6031). ([82f966e](https://github.com/ckeditor/ckeditor5-link/commit/82f966e))
13
- * After pasting a link the selection is now moved outside of a link to improve UX. This is done by change in the `Model#insertContent()` handling. Closes [ckeditor/ckeditor5#6053](https://github.com/ckeditor/ckeditor5/issues/6053). ([afabf03](https://github.com/ckeditor/ckeditor5-link/commit/afabf03))
14
-
15
- ### Other changes
16
-
17
- * Replaced `LabeledInputView` with `LabeledFieldView`. See [ckeditor/ckeditor5#6110](https://github.com/ckeditor/ckeditor5/issues/6110). ([e4e9ba9](https://github.com/ckeditor/ckeditor5-link/commit/e4e9ba9))
18
- * Updated translations. ([00c5a5c](https://github.com/ckeditor/ckeditor5-link/commit/00c5a5c))
19
-
20
-
21
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v17.0.0...v18.0.0) (2020-03-19)
22
-
23
- Internal changes only (updated dependencies, documentation, etc.).
24
-
25
-
26
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v16.0.0...v17.0.0) (2020-02-19)
27
-
28
- ### Bug fixes
29
-
30
- * The link balloon toolbar will be displayed on links even if the `link` command is disabled. ([163684e](https://github.com/ckeditor/ckeditor5-link/commit/163684e))
31
-
32
- ### Other changes
33
-
34
- * Updated translations. ([c0830b9](https://github.com/ckeditor/ckeditor5-link/commit/c0830b9))
35
-
36
-
37
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v15.0.0...v16.0.0) (2019-12-04)
38
-
39
- ### Bug fixes
40
-
41
- * 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))
42
-
43
- ### Other changes
44
-
45
- * Updated translations. ([5c84f57](https://github.com/ckeditor/ckeditor5-link/commit/5c84f57))
46
-
47
-
48
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.2...v15.0.0) (2019-10-23)
49
-
50
- ### Other changes
51
-
52
- * Added `pluginName` property to editing plugin. ([a3bf928](https://github.com/ckeditor/ckeditor5-link/commit/a3bf928))
53
- * Updated translations. ([34b5552](https://github.com/ckeditor/ckeditor5-link/commit/34b5552)) ([9653092](https://github.com/ckeditor/ckeditor5-link/commit/9653092))
54
-
55
-
56
- ## [11.1.2](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.1...v11.1.2) (2019-08-26)
57
-
58
- ### Bug fixes
59
-
60
- * 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))
61
- * Improved balloon positioning when there is more than one stack in the rotator. ([d6c45df](https://github.com/ckeditor/ckeditor5-link/commit/d6c45df))
62
- * 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))
63
-
64
- ### Other changes
65
-
66
- * 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))
67
- * 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))
68
- * Updated translations. ([4345546](https://github.com/ckeditor/ckeditor5-link/commit/4345546))
69
-
70
-
71
- ## [11.1.1](https://github.com/ckeditor/ckeditor5-link/compare/v11.1.0...v11.1.1) (2019-07-10)
72
-
73
- ### Other changes
74
-
75
- * Updated translations. ([6b720be](https://github.com/ckeditor/ckeditor5-link/commit/6b720be))
76
-
77
-
78
- ## [11.1.0](https://github.com/ckeditor/ckeditor5-link/compare/v11.0.2...v11.1.0) (2019-07-04)
79
-
80
- ### Features
81
-
82
- * Introduced configurable link decorators allowing customization of link attributes in the editor data. Closes [#186](https://github.com/ckeditor/ckeditor5-link/issues/186). ([40d8266](https://github.com/ckeditor/ckeditor5-link/commit/40d8266))
83
-
84
- ### Other changes
85
-
86
- * Updated translations. ([b1b157f](https://github.com/ckeditor/ckeditor5-link/commit/b1b157f)) ([77a2171](https://github.com/ckeditor/ckeditor5-link/commit/77a2171))
87
-
88
-
89
- ## [11.0.2](https://github.com/ckeditor/ckeditor5-link/compare/v11.0.1...v11.0.2) (2019-06-05)
90
-
91
- ### Bug fixes
92
-
93
- * The link balloon will not be shown if no link was added after command execution. Closes [#171](https://github.com/ckeditor/ckeditor5-link/issues/171). ([0069dc7](https://github.com/ckeditor/ckeditor5-link/commit/0069dc7))
94
-
95
- ### Other changes
96
-
97
- * Use `Model#insertContent()` instead of `model.Writer#insert()`. Closes [#224](https://github.com/ckeditor/ckeditor5-link/issues/224). ([e3c8676](https://github.com/ckeditor/ckeditor5-link/commit/e3c8676))
98
- * Updated translations. ([ba97a60](https://github.com/ckeditor/ckeditor5-link/commit/ba97a60))
99
-
100
-
101
- ## [11.0.1](https://github.com/ckeditor/ckeditor5-link/compare/v11.0.0...v11.0.1) (2019-04-10)
102
-
103
- ### Other changes
104
-
105
- * Updated translations. ([9332478](https://github.com/ckeditor/ckeditor5-link/commit/9332478))
106
-
107
-
108
- ## [11.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v10.1.0...v11.0.0) (2019-02-28)
109
-
110
- ### Bug fixes
111
-
112
- * Improved the focus management when removing the link form from the DOM. Closes [ckeditor/ckeditor5#1501](https://github.com/ckeditor/ckeditor5/issues/1501). ([9dd756c](https://github.com/ckeditor/ckeditor5-link/commit/9dd756c))
113
- * Fixed memory leaks during editor initialization and destruction (see [ckeditor/ckeditor5#1341](https://github.com/ckeditor/ckeditor5/issues/1341)). ([bb24b88](https://github.com/ckeditor/ckeditor5-link/commit/bb24b88))
114
-
115
- ### Other changes
116
-
117
- * Updated translations. ([012557b](https://github.com/ckeditor/ckeditor5-link/commit/012557b)) ([b2990a9](https://github.com/ckeditor/ckeditor5-link/commit/b2990a9)) ([f8573c2](https://github.com/ckeditor/ckeditor5-link/commit/f8573c2))
118
-
119
- ### BREAKING CHANGES
120
-
121
- * Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
122
-
123
-
124
- ## [10.1.0](https://github.com/ckeditor/ckeditor5-link/compare/v10.0.4...v10.1.0) (2018-12-05)
125
-
126
- ### Features
127
-
128
- * Improved responsiveness of the form and actions views in narrow viewports (see [ckeditor/ckeditor5#416](https://github.com/ckeditor/ckeditor5/issues/416)). ([74dbe69](https://github.com/ckeditor/ckeditor5-link/commit/74dbe69))
129
-
130
- ### Other changes
131
-
132
- * Improved SVG icons size. See [ckeditor/ckeditor5-theme-lark#206](https://github.com/ckeditor/ckeditor5-theme-lark/issues/206). ([5b12f81](https://github.com/ckeditor/ckeditor5-link/commit/5b12f81))
133
- * Updated translations. ([9d7b042](https://github.com/ckeditor/ckeditor5-link/commit/9d7b042)) ([6ac7e41](https://github.com/ckeditor/ckeditor5-link/commit/6ac7e41))
134
-
135
-
136
- ## [10.0.4](https://github.com/ckeditor/ckeditor5-link/compare/v10.0.3...v10.0.4) (2018-10-08)
137
-
138
- ### Other changes
139
-
140
- * The link button will be active when the selection is placed inside a link. Closes [#173](https://github.com/ckeditor/ckeditor5-link/issues/173). ([c9e4bc3](https://github.com/ckeditor/ckeditor5-link/commit/c9e4bc3))
141
- * Updated translations. ([6d0ce97](https://github.com/ckeditor/ckeditor5-link/commit/6d0ce97))
142
-
143
-
144
- ## [10.0.3](https://github.com/ckeditor/ckeditor5-link/compare/v10.0.2...v10.0.3) (2018-07-18)
145
-
146
- ### Other changes
147
-
148
- * Updated translations. ([e1e2f56](https://github.com/ckeditor/ckeditor5-link/commit/e1e2f56))
149
-
150
-
151
- ## [10.0.2](https://github.com/ckeditor/ckeditor5-link/compare/v10.0.1...v10.0.2) (2018-06-21)
152
-
153
- ### Other changes
154
-
155
- * Updated translations.
156
-
157
-
158
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-link/compare/v10.0.0...v10.0.1) (2018-05-22)
159
-
160
- ### Bug fixes
161
-
162
- * Fixed a cross-site scripting (XSS) vulnerability which allowed remote attackers to inject arbitrary web script through a crafted href attribute of a link (A) element. [CVE-2018-11093](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11093). ([8cb782e](https://github.com/ckeditor/ckeditor5-link/commit/8cb782e))
163
-
164
- This issue was reported indepdentently by [Toan Chi Nguyen](https://www.linkedin.com/in/toan-nguyen-chi/) from [Techlab Corporation](https://www.techlabcorp.com/) and [Michal Bazyli](https://www.linkedin.com/in/michal-bazyli-6a3111144/). Thank you!
165
-
166
-
167
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-link/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
168
-
169
- ### Other changes
170
-
171
- * Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([32a80fb](https://github.com/ckeditor/ckeditor5-link/commit/32a80fb))
172
- * Updated translations. ([c6d5333](https://github.com/ckeditor/ckeditor5-link/commit/c6d5333))
173
-
174
- ### BREAKING CHANGES
175
-
176
- * The license under which CKEditor 5 is released has been changed from a triple GPL, LGPL and MPL license to a GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991) for more information.
177
-
178
-
179
- ## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-link/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
180
-
181
- ### Other changes
182
-
183
- * Updated translations. ([f6ab11a](https://github.com/ckeditor/ckeditor5-link/commit/f6ab11a))
184
-
185
-
186
- ## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-link/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
187
-
188
- ### Features
189
-
190
- * Made the link form buttons thicker with a fill color and no background (see [ckeditor/ckeditor5#810](https://github.com/ckeditor/ckeditor5/issues/810)). ([45292f1](https://github.com/ckeditor/ckeditor5-link/commit/45292f1))
191
- * The <kbd>Ctrl</kbd>+<kbd>K</kbd> keystroke should open link URL editing dialog. Closes [#181](https://github.com/ckeditor/ckeditor5-link/issues/181). ([56047b5](https://github.com/ckeditor/ckeditor5-link/commit/56047b5))
192
-
193
- ### Bug fixes
194
-
195
- * The selected link should be highlighted using the class instead of a marker. Closes [#180](https://github.com/ckeditor/ckeditor5-link/issues/180). Closes [#176](https://github.com/ckeditor/ckeditor5-link/issues/176). Closes [ckeditor/ckeditor5#888](https://github.com/ckeditor/ckeditor5/issues/888). ([c75c4ca](https://github.com/ckeditor/ckeditor5-link/commit/c75c4ca))
196
-
197
- ### Other changes
198
-
199
- * Increased the specificity of CSS rules. Introduced the `.ck` class for editor UI components (see: [ckeditor/ckeditor5#494](https://github.com/ckeditor/ckeditor5/issues/494)). ([e66f921](https://github.com/ckeditor/ckeditor5-link/commit/e66f921))
200
- * Used `.ck-button_sav`e and `_cancel` CSS classes to make the link form view buttons colorful (see [ckeditor/ckeditor5-image#187](https://github.com/ckeditor/ckeditor5-image/issues/187)). ([a5eebdb](https://github.com/ckeditor/ckeditor5-link/commit/a5eebdb))
201
-
202
-
203
- ## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-link/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018-03-15)
204
-
205
- ### Features
206
-
207
- * Added two-step caret movement for links. Closes [#72](https://github.com/ckeditor/ckeditor5-link/issues/72). ([985bb40](https://github.com/ckeditor/ckeditor5-link/commit/985bb40))
208
- * Implemented a 2–step link UI with a refreshed look&feel (see [ckeditor/ckeditor5#645](https://github.com/ckeditor/ckeditor5/issues/645)). Closes [#31](https://github.com/ckeditor/ckeditor5-link/issues/31). ([6baee95](https://github.com/ckeditor/ckeditor5-link/commit/6baee95))
209
-
210
- ### Bug fixes
211
-
212
- * Link feature should not create empty text nodes with `linkHref` attribute. Closes [#169](https://github.com/ckeditor/ckeditor5-link/issues/169). ([0641978](https://github.com/ckeditor/ckeditor5-link/commit/0641978))
213
-
214
- ### Other changes
215
-
216
- * Aligned feature class naming to the new scheme. ([5d8e67d](https://github.com/ckeditor/ckeditor5-link/commit/5d8e67d))
217
- * Migrated package styles to PostCSS. Moved visual styles to `@ckeditor/ckeditor5-theme-lark` (see [ckeditor/ckeditor5-ui#144](https://github.com/ckeditor/ckeditor5-ui/issues/144)). ([f16d263](https://github.com/ckeditor/ckeditor5-link/commit/f16d263))
218
- * Removed `LinkElement`. We should be using custom properties instead. Closes [#162](https://github.com/ckeditor/ckeditor5-link/issues/162). ([3785e50](https://github.com/ckeditor/ckeditor5-link/commit/3785e50))
219
- * Updated translations. ([d285ad3](https://github.com/ckeditor/ckeditor5-link/commit/d285ad3))
220
-
221
- ### BREAKING CHANGES
222
-
223
- * The structure of the link UI has changed dramatically. Some pieces of the `LinkFormView` belong now to the `LinkActionsView` class. The CSS classes have also changed along with component templates.
224
-
225
-
226
- ## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-link/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017-11-14)
227
-
228
- ### Other changes
229
-
230
- * Updated translations. ([ea343cd](https://github.com/ckeditor/ckeditor5-link/commit/ea343cd))
231
- * Aligned UI library usage to the [changes in the UI framework](https://github.com/ckeditor/ckeditor5-ui/pull/332).
232
-
233
-
234
- ## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-link/compare/v0.8.0...v1.0.0-alpha.1) (2017-10-03)
235
-
236
- ### Bug fixes
237
-
238
- * Prevented default browser actions on <kbd>Ctrl</kbd>+<kbd>K</kbd> (which should move focus to "URL" input in the link balloon). Closes [#153](https://github.com/ckeditor/ckeditor5-link/issues/153). Closes [#154](https://github.com/ckeditor/ckeditor5-link/issues/154). ([5360fce](https://github.com/ckeditor/ckeditor5-link/commit/5360fce))
239
- * The URL input should span the width of the balloon. Closes [#145](https://github.com/ckeditor/ckeditor5-link/issues/145). ([05b3bf4](https://github.com/ckeditor/ckeditor5-link/commit/05b3bf4))
240
-
241
-
242
- ## [0.8.0](https://github.com/ckeditor/ckeditor5-link/compare/v0.7.0...v0.8.0) (2017-09-03)
243
-
244
- ### Bug fixes
245
-
246
- * `<a>` elements without the `href` attribute should not be picked up by the converter when loading data or pasting. Closes [#139](https://github.com/ckeditor/ckeditor5-link/issues/139). ([80e4c03](https://github.com/ckeditor/ckeditor5-link/commit/80e4c03))
247
- * `LinkCommand` and `UnlinkCommand` should update their state upon editor load. Closes [#93](https://github.com/ckeditor/ckeditor5-link/issues/93). ([1784eb6](https://github.com/ckeditor/ckeditor5-link/commit/1784eb6))
248
- * It should be possible to paste links. See https://github.com/ckeditor/ckeditor5/issues/477. ([4f24219](https://github.com/ckeditor/ckeditor5-link/commit/4f24219))
249
- * Keyboard listener should check if the command is enabled before opening the balloon. Closes [#128](https://github.com/ckeditor/ckeditor5-link/issues/128). ([be4b9eb](https://github.com/ckeditor/ckeditor5-link/commit/be4b9eb))
250
- * Link should have a higher priority than all other attribute elements. Closes [#121](https://github.com/ckeditor/ckeditor5-link/issues/121). ([9dc8973](https://github.com/ckeditor/ckeditor5-link/commit/9dc8973))
251
- * Linking an entire image should not be possible. Closes [#85](https://github.com/ckeditor/ckeditor5-link/issues/85). ([1a4e110](https://github.com/ckeditor/ckeditor5-link/commit/1a4e110))
252
- * The editing UI should show up when the selection encloses a link. Closes [#23](https://github.com/ckeditor/ckeditor5-link/issues/23). ([ae43103](https://github.com/ckeditor/ckeditor5-link/commit/ae43103))
253
- * The link feature's keystrokes should properly integrate with the list feature. Improved balloon positioning. Closes [#146](https://github.com/ckeditor/ckeditor5-link/issues/146). ([4d808b7](https://github.com/ckeditor/ckeditor5-link/commit/4d808b7))
254
- * The URL field's value should be updated each time the form shows up. Closes [#78](https://github.com/ckeditor/ckeditor5-link/issues/78). ([3b702aa](https://github.com/ckeditor/ckeditor5-link/commit/3b702aa))
255
- * Then unlink button in the link balloon should be visible when a link is partially selected. Closes [#141](https://github.com/ckeditor/ckeditor5-link/issues/141). ([2a4e9d8](https://github.com/ckeditor/ckeditor5-link/commit/2a4e9d8))
256
- * URL input value should not be `'undefined'` when no link is selected. Closes [#123](https://github.com/ckeditor/ckeditor5-link/issues/123). ([22893d3](https://github.com/ckeditor/ckeditor5-link/commit/22893d3))
257
-
258
- ### Features
259
-
260
- * `LinkFormView` controls should enter the read-only mode when `LinkCommand` and `UnlinkCommand` are disabled. Closes [#135](https://github.com/ckeditor/ckeditor5-link/issues/135). ([50da835](https://github.com/ckeditor/ckeditor5-link/commit/50da835))
261
- * URL input field should provide a placeholder. Closes [#109](https://github.com/ckeditor/ckeditor5-link/issues/109). ([6d18c55](https://github.com/ckeditor/ckeditor5-link/commit/6d18c55))
262
-
263
- ### Other changes
264
-
265
- * Aligned the implementation to the new Command API (see https://github.com/ckeditor/ckeditor5-core/issues/88). ([919b497](https://github.com/ckeditor/ckeditor5-link/commit/919b497))
266
- * Cleaning up svg icons. ([af73903](https://github.com/ckeditor/ckeditor5-link/commit/af73903))
267
- * Removed the "Unlink" button. Closes [#52](https://github.com/ckeditor/ckeditor5-link/issues/52). ([3b7fda7](https://github.com/ckeditor/ckeditor5-link/commit/3b7fda7))
268
-
269
- See https://github.com/ckeditor/ckeditor5-link/issues/31#issuecomment-316992952 and https://github.com/ckeditor/ckeditor5-link/issues/149 for plans how unlinking will be exposed in the future.
270
-
271
- ### BREAKING CHANGES
272
-
273
- * The `unlink` UI component was removed from the component factory.
274
- * The command API has been changed.
275
-
276
-
277
- ## [0.7.0](https://github.com/ckeditor/ckeditor5-link/compare/v0.6.0...v0.6.1) (2017-05-07)
278
-
279
- ### Bug fixes
280
-
281
- * `Esc` key should close the link panel even if none of the `LinkFormView` fields is focused. Closes [#90](https://github.com/ckeditor/ckeditor5-link/issues/90). ([866fa49](https://github.com/ckeditor/ckeditor5-link/commit/866fa49))
282
- * The link balloon should hide the "Unlink" button when creating a link. Closes [#53](https://github.com/ckeditor/ckeditor5-link/issues/53). ([686e625](https://github.com/ckeditor/ckeditor5-link/commit/686e625))
283
- * The link balloon should update its position upon external document changes. Closes [#113](https://github.com/ckeditor/ckeditor5-link/issues/113). ([18a5b90](https://github.com/ckeditor/ckeditor5-link/commit/18a5b90))
284
- * The link plugin should manage focus when the balloon is open. Made Link plugins `_showPanel()` and `_hidePanel()` methods protected. Closes [#95](https://github.com/ckeditor/ckeditor5-link/issues/95). Closes [#94](https://github.com/ckeditor/ckeditor5-link/issues/94). ([5a83b70](https://github.com/ckeditor/ckeditor5-link/commit/5a83b70))
285
- * Link should not be allowed directly in the root element. Closes [#97](https://github.com/ckeditor/ckeditor5-link/issues/97). ([81d4ba5](https://github.com/ckeditor/ckeditor5-link/commit/81d4ba5))
286
-
287
- ### Other changes
288
-
289
- * Integrated the link plugin with the `ContextualBalloon` plugin. Closes [#91](https://github.com/ckeditor/ckeditor5-link/issues/91). ([26f148e](https://github.com/ckeditor/ckeditor5-link/commit/26f148e))
290
- * Updated translations. ([7a35617](https://github.com/ckeditor/ckeditor5-link/commit/7a35617))
291
-
292
-
293
- ## [0.6.0](https://github.com/ckeditor/ckeditor5-link/compare/v0.5.1...v0.6.0) (2017-04-05)
294
-
295
- ### Features
296
-
297
- * Named existing plugin(s). ([ae8fcd7](https://github.com/ckeditor/ckeditor5-link/commit/ae8fcd7))
298
-
299
- ### Other changes
300
-
301
- * Fixed import paths after [refactoring in ckeditor5-ui](https://github.com/ckeditor/ckeditor5-ui/pull/156). Closes [#83](https://github.com/ckeditor/ckeditor5-link/issues/83). ([b235415](https://github.com/ckeditor/ckeditor5-link/commit/b235415))
302
- * Updated translations. ([0589bf0](https://github.com/ckeditor/ckeditor5-link/commit/0589bf0))
303
-
304
-
305
- ## [0.5.1](https://github.com/ckeditor/ckeditor5-link/compare/v0.5.0...v0.5.1) (2017-03-06)
306
-
307
- ### Bug fixes
308
-
309
- * The "Save" button label should be localizable. ([eb78861](https://github.com/ckeditor/ckeditor5-link/commit/eb78861))
310
-
311
- ### Other changes
312
-
313
- * Updated translations. ([7a0a8d3](https://github.com/ckeditor/ckeditor5-link/commit/7a0a8d3))