@ckeditor/ckeditor5-link 29.2.0 → 32.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 (81) hide show
  1. package/LICENSE.md +2 -2
  2. package/build/link.js +3 -3
  3. package/build/translations/es.js +1 -1
  4. package/build/translations/uz.js +1 -0
  5. package/ckeditor5-metadata.json +2 -0
  6. package/lang/translations/ar.po +1 -1
  7. package/lang/translations/ast.po +1 -1
  8. package/lang/translations/az.po +1 -1
  9. package/lang/translations/bg.po +1 -1
  10. package/lang/translations/cs.po +1 -1
  11. package/lang/translations/da.po +1 -1
  12. package/lang/translations/de-ch.po +1 -1
  13. package/lang/translations/de.po +1 -1
  14. package/lang/translations/el.po +1 -1
  15. package/lang/translations/en-au.po +1 -1
  16. package/lang/translations/en-gb.po +1 -1
  17. package/lang/translations/en.po +1 -1
  18. package/lang/translations/eo.po +1 -1
  19. package/lang/translations/es.po +2 -2
  20. package/lang/translations/et.po +1 -1
  21. package/lang/translations/eu.po +1 -1
  22. package/lang/translations/fa.po +1 -1
  23. package/lang/translations/fi.po +1 -1
  24. package/lang/translations/fr.po +1 -1
  25. package/lang/translations/gl.po +1 -1
  26. package/lang/translations/he.po +1 -1
  27. package/lang/translations/hi.po +1 -1
  28. package/lang/translations/hr.po +1 -1
  29. package/lang/translations/hu.po +1 -1
  30. package/lang/translations/id.po +1 -1
  31. package/lang/translations/it.po +1 -1
  32. package/lang/translations/ja.po +1 -1
  33. package/lang/translations/km.po +1 -1
  34. package/lang/translations/kn.po +1 -1
  35. package/lang/translations/ko.po +1 -1
  36. package/lang/translations/ku.po +1 -1
  37. package/lang/translations/lt.po +1 -1
  38. package/lang/translations/lv.po +1 -1
  39. package/lang/translations/nb.po +1 -1
  40. package/lang/translations/ne.po +1 -1
  41. package/lang/translations/nl.po +1 -1
  42. package/lang/translations/no.po +1 -1
  43. package/lang/translations/pl.po +1 -1
  44. package/lang/translations/pt-br.po +1 -1
  45. package/lang/translations/pt.po +1 -1
  46. package/lang/translations/ro.po +1 -1
  47. package/lang/translations/ru.po +1 -1
  48. package/lang/translations/sk.po +1 -1
  49. package/lang/translations/sq.po +1 -1
  50. package/lang/translations/sr-latn.po +1 -1
  51. package/lang/translations/sr.po +1 -1
  52. package/lang/translations/sv.po +1 -1
  53. package/lang/translations/tk.po +1 -1
  54. package/lang/translations/tr.po +1 -1
  55. package/lang/translations/ug.po +1 -1
  56. package/lang/translations/uk.po +1 -1
  57. package/lang/translations/uz.po +53 -0
  58. package/lang/translations/vi.po +1 -1
  59. package/lang/translations/zh-cn.po +1 -1
  60. package/lang/translations/zh.po +1 -1
  61. package/package.json +24 -24
  62. package/src/autolink.js +15 -5
  63. package/src/index.js +1 -1
  64. package/src/link.js +1 -1
  65. package/src/linkcommand.js +1 -1
  66. package/src/linkediting.js +70 -5
  67. package/src/linkimage.js +1 -1
  68. package/src/linkimageediting.js +8 -5
  69. package/src/linkimageui.js +1 -1
  70. package/src/linkui.js +1 -1
  71. package/src/ui/linkactionsview.js +11 -1
  72. package/src/ui/linkformview.js +11 -1
  73. package/src/unlinkcommand.js +1 -1
  74. package/src/utils/automaticdecorators.js +1 -1
  75. package/src/utils/manualdecorator.js +1 -1
  76. package/src/utils.js +12 -1
  77. package/theme/link.css +1 -1
  78. package/theme/linkactions.css +1 -1
  79. package/theme/linkform.css +1 -1
  80. package/theme/linkimage.css +1 -1
  81. package/CHANGELOG.md +0 -313
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -0,0 +1,53 @@
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Uzbek (https://www.transifex.com/ckeditor/teams/11143/uz/)\n"
16
+ "Language: uz\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ msgctxt "Toolbar button tooltip for the Unlink feature."
20
+ msgid "Unlink"
21
+ msgstr "Havolani olib tashlash"
22
+
23
+ msgctxt "Toolbar button tooltip for the Link feature."
24
+ msgid "Link"
25
+ msgstr "Havola"
26
+
27
+ msgctxt "Label for the URL input in the Link URL editing balloon."
28
+ msgid "Link URL"
29
+ msgstr "\"Havola URL"
30
+
31
+ msgctxt "Label for the image link button."
32
+ msgid "Link image"
33
+ msgstr "Rasmga havola"
34
+
35
+ msgctxt "Button opening the Link URL editing balloon."
36
+ msgid "Edit link"
37
+ msgstr "Havolani tahrirlash"
38
+
39
+ msgctxt "Button opening the link in new browser tab."
40
+ msgid "Open link in new tab"
41
+ msgstr "Havolani yangi oynada ochish"
42
+
43
+ msgctxt "Label explaining that a link has no URL set (the URL is empty)."
44
+ msgid "This link has no URL"
45
+ msgstr "Bu havola uchun URL oʻrnatilmagan"
46
+
47
+ msgctxt "The label of the switch button that controls whether the edited link will open in a new tab."
48
+ msgid "Open in a new tab"
49
+ msgstr "Yangi oynada oching"
50
+
51
+ msgctxt "The label of the switch button that controls whether the edited link refers to downloadable resource."
52
+ msgid "Downloadable"
53
+ msgstr "Yuklab olinadigan"
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-link",
3
- "version": "29.2.0",
3
+ "version": "32.0.0",
4
4
  "description": "Link feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,34 +12,34 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-ui": "^29.2.0",
16
- "ckeditor5": "^29.2.0",
15
+ "@ckeditor/ckeditor5-ui": "^32.0.0",
16
+ "ckeditor5": "^32.0.0",
17
17
  "lodash-es": "^4.17.15"
18
18
  },
19
19
  "devDependencies": {
20
- "@ckeditor/ckeditor5-basic-styles": "^29.2.0",
21
- "@ckeditor/ckeditor5-block-quote": "^29.2.0",
22
- "@ckeditor/ckeditor5-clipboard": "^29.2.0",
23
- "@ckeditor/ckeditor5-cloud-services": "^29.2.0",
24
- "@ckeditor/ckeditor5-code-block": "^29.2.0",
25
- "@ckeditor/ckeditor5-core": "^29.2.0",
26
- "@ckeditor/ckeditor5-dev-utils": "^25.4.0",
27
- "@ckeditor/ckeditor5-easy-image": "^29.2.0",
28
- "@ckeditor/ckeditor5-editor-classic": "^29.2.0",
29
- "@ckeditor/ckeditor5-engine": "^29.2.0",
30
- "@ckeditor/ckeditor5-enter": "^29.2.0",
31
- "@ckeditor/ckeditor5-image": "^29.2.0",
32
- "@ckeditor/ckeditor5-paragraph": "^29.2.0",
33
- "@ckeditor/ckeditor5-theme-lark": "^29.2.0",
34
- "@ckeditor/ckeditor5-typing": "^29.2.0",
35
- "@ckeditor/ckeditor5-undo": "^29.2.0",
36
- "@ckeditor/ckeditor5-utils": "^29.2.0",
37
- "@ckeditor/ckeditor5-widget": "^29.2.0",
38
- "webpack": "^4.43.0",
39
- "webpack-cli": "^3.3.11"
20
+ "@ckeditor/ckeditor5-basic-styles": "^32.0.0",
21
+ "@ckeditor/ckeditor5-block-quote": "^32.0.0",
22
+ "@ckeditor/ckeditor5-clipboard": "^32.0.0",
23
+ "@ckeditor/ckeditor5-cloud-services": "^32.0.0",
24
+ "@ckeditor/ckeditor5-code-block": "^32.0.0",
25
+ "@ckeditor/ckeditor5-core": "^32.0.0",
26
+ "@ckeditor/ckeditor5-dev-utils": "^27.1.0",
27
+ "@ckeditor/ckeditor5-easy-image": "^32.0.0",
28
+ "@ckeditor/ckeditor5-editor-classic": "^32.0.0",
29
+ "@ckeditor/ckeditor5-engine": "^32.0.0",
30
+ "@ckeditor/ckeditor5-enter": "^32.0.0",
31
+ "@ckeditor/ckeditor5-image": "^32.0.0",
32
+ "@ckeditor/ckeditor5-paragraph": "^32.0.0",
33
+ "@ckeditor/ckeditor5-theme-lark": "^32.0.0",
34
+ "@ckeditor/ckeditor5-typing": "^32.0.0",
35
+ "@ckeditor/ckeditor5-undo": "^32.0.0",
36
+ "@ckeditor/ckeditor5-utils": "^32.0.0",
37
+ "@ckeditor/ckeditor5-widget": "^32.0.0",
38
+ "webpack": "^5.58.1",
39
+ "webpack-cli": "^4.9.0"
40
40
  },
41
41
  "engines": {
42
- "node": ">=12.0.0",
42
+ "node": ">=14.0.0",
43
43
  "npm": ">=5.7.1"
44
44
  },
45
45
  "author": "CKSource (http://cksource.com/)",
package/src/autolink.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { Plugin } from 'ckeditor5/src/core';
11
- import { TextWatcher, getLastTextLine } from 'ckeditor5/src/typing';
11
+ import { Delete, TextWatcher, getLastTextLine } from 'ckeditor5/src/typing';
12
12
 
13
13
  import { addLinkProtocolIfApplicable } from './utils';
14
14
 
@@ -69,6 +69,13 @@ const URL_GROUP_IN_MATCH = 2;
69
69
  * @extends module:core/plugin~Plugin
70
70
  */
71
71
  export default class AutoLink extends Plugin {
72
+ /**
73
+ * @inheritDoc
74
+ */
75
+ static get requires() {
76
+ return [ Delete ];
77
+ }
78
+
72
79
  /**
73
80
  * @inheritDoc
74
81
  */
@@ -121,12 +128,10 @@ export default class AutoLink extends Plugin {
121
128
  }
122
129
  } );
123
130
 
124
- const input = editor.plugins.get( 'Input' );
125
-
126
131
  watcher.on( 'matched:data', ( evt, data ) => {
127
132
  const { batch, range, url } = data;
128
133
 
129
- if ( !input.isInput( batch ) ) {
134
+ if ( !batch.isTyping ) {
130
135
  return;
131
136
  }
132
137
 
@@ -226,6 +231,7 @@ export default class AutoLink extends Plugin {
226
231
  */
227
232
  _applyAutoLink( link, range ) {
228
233
  const model = this.editor.model;
234
+ const deletePlugin = this.editor.plugins.get( 'Delete' );
229
235
 
230
236
  if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {
231
237
  return;
@@ -236,6 +242,10 @@ export default class AutoLink extends Plugin {
236
242
  const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
237
243
  const parsedUrl = addLinkProtocolIfApplicable( link, defaultProtocol );
238
244
  writer.setAttribute( 'linkHref', parsedUrl, range );
245
+
246
+ model.enqueueChange( () => {
247
+ deletePlugin.requestUndoOnBackspace();
248
+ } );
239
249
  } );
240
250
  }
241
251
  }
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/link.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -11,12 +11,12 @@ import { Plugin } from 'ckeditor5/src/core';
11
11
  import { MouseObserver } from 'ckeditor5/src/engine';
12
12
  import { Input, TwoStepCaretMovement, inlineHighlight, findAttributeRange } from 'ckeditor5/src/typing';
13
13
  import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
14
- import { keyCodes } from 'ckeditor5/src/utils';
14
+ import { keyCodes, env } from 'ckeditor5/src/utils';
15
15
 
16
16
  import LinkCommand from './linkcommand';
17
17
  import UnlinkCommand from './unlinkcommand';
18
18
  import ManualDecorator from './utils/manualdecorator';
19
- import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators } from './utils';
19
+ import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, openLink } from './utils';
20
20
 
21
21
  import '../theme/link.css';
22
22
 
@@ -107,6 +107,9 @@ export default class LinkEditing extends Plugin {
107
107
  // Setup highlight over selected link.
108
108
  inlineHighlight( editor, 'linkHref', 'a', HIGHLIGHT_CLASS );
109
109
 
110
+ // Handle link following by CTRL+click or ALT+ENTER
111
+ this._enableLinkOpen();
112
+
110
113
  // Change the attributes of the selection in certain situations after the link was inserted into the document.
111
114
  this._enableInsertContentSelectionAttributesFixer();
112
115
 
@@ -220,6 +223,68 @@ export default class LinkEditing extends Plugin {
220
223
  } );
221
224
  }
222
225
 
226
+ /**
227
+ * Attaches handlers for {@link module:engine/view/document~Document#event:enter} and
228
+ * {@link module:engine/view/document~Document#event:click} to enable link following.
229
+ *
230
+ * @private
231
+ */
232
+ _enableLinkOpen() {
233
+ const editor = this.editor;
234
+ const view = editor.editing.view;
235
+ const viewDocument = view.document;
236
+ const modelDocument = editor.model.document;
237
+
238
+ this.listenTo( viewDocument, 'click', ( evt, data ) => {
239
+ const shouldOpen = env.isMac ? data.domEvent.metaKey : data.domEvent.ctrlKey;
240
+
241
+ if ( !shouldOpen ) {
242
+ return;
243
+ }
244
+
245
+ let clickedElement = data.domTarget;
246
+
247
+ if ( clickedElement.tagName.toLowerCase() != 'a' ) {
248
+ clickedElement = clickedElement.closest( 'a' );
249
+ }
250
+
251
+ if ( !clickedElement ) {
252
+ return;
253
+ }
254
+
255
+ const url = clickedElement.getAttribute( 'href' );
256
+
257
+ if ( !url ) {
258
+ return;
259
+ }
260
+
261
+ evt.stop();
262
+ data.preventDefault();
263
+
264
+ openLink( url );
265
+ }, { context: '$capture' } );
266
+
267
+ this.listenTo( viewDocument, 'enter', ( evt, data ) => {
268
+ const selection = modelDocument.selection;
269
+
270
+ const selectedElement = selection.getSelectedElement();
271
+
272
+ const url = selectedElement ?
273
+ selectedElement.getAttribute( 'linkHref' ) :
274
+ selection.getAttribute( 'linkHref' );
275
+
276
+ const shouldOpen = url && data.domEvent.altKey;
277
+
278
+ if ( !shouldOpen ) {
279
+ return;
280
+ }
281
+
282
+ evt.stop();
283
+
284
+ openLink( url );
285
+ }, { context: 'a' } );
286
+ }
287
+
223
288
  /**
224
289
  * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
225
290
  * selection attributes if the selection is at the end of a link after inserting the content.
@@ -577,9 +642,9 @@ function shouldCopyAttributes( model ) {
577
642
  // @params {module:core/editor/editor~Editor} editor
578
643
  // @returns {Boolean}
579
644
  function isTyping( editor ) {
580
- const input = editor.plugins.get( 'Input' );
645
+ const currentBatch = editor.model.change( writer => writer.batch );
581
646
 
582
- return input.isInput( editor.model.change( writer => writer.batch ) );
647
+ return currentBatch.isTyping;
583
648
  }
584
649
 
585
650
  // Returns an array containing names of the attributes allowed on `$text` that describes the link item.
package/src/linkimage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -44,10 +44,6 @@ export default class LinkImageEditing extends Plugin {
44
44
  schema.extend( 'imageBlock', { allowAttributes: [ 'linkHref' ] } );
45
45
  }
46
46
 
47
- if ( editor.plugins.has( 'ImageInlineEditing' ) ) {
48
- schema.extend( 'imageInline', { allowAttributes: [ 'linkHref' ] } );
49
- }
50
-
51
47
  editor.conversion.for( 'upcast' ).add( upcastLink( editor ) );
52
48
  editor.conversion.for( 'downcast' ).add( downcastImageLink( editor ) );
53
49
 
@@ -256,6 +252,7 @@ function downcastImageLinkManualDecorator( decorator ) {
256
252
  // @private
257
253
  // @returns {Function}
258
254
  function upcastImageLinkManualDecorator( editor, decorator ) {
255
+ const isImageInlinePluginLoaded = editor.plugins.has( 'ImageInlineEditing' );
259
256
  const imageUtils = editor.plugins.get( 'ImageUtils' );
260
257
 
261
258
  return dispatcher => {
@@ -269,6 +266,12 @@ function upcastImageLinkManualDecorator( editor, decorator ) {
269
266
  return;
270
267
  }
271
268
 
269
+ const blockImageView = imageInLink.findAncestor( element => imageUtils.isBlockImageView( element ) );
270
+
271
+ if ( isImageInlinePluginLoaded && !blockImageView ) {
272
+ return;
273
+ }
274
+
272
275
  const matcher = new Matcher( decorator._createPattern() );
273
276
  const result = matcher.match( viewLink );
274
277
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/linkui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -155,6 +155,16 @@ export default class LinkActionsView extends View {
155
155
  this.keystrokes.listenTo( this.element );
156
156
  }
157
157
 
158
+ /**
159
+ * @inheritDoc
160
+ */
161
+ destroy() {
162
+ super.destroy();
163
+
164
+ this.focusTracker.destroy();
165
+ this.keystrokes.destroy();
166
+ }
167
+
158
168
  /**
159
169
  * Focuses the fist {@link #_focusables} in the actions.
160
170
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -200,6 +200,16 @@ export default class LinkFormView extends View {
200
200
  this.keystrokes.listenTo( this.element );
201
201
  }
202
202
 
203
+ /**
204
+ * @inheritDoc
205
+ */
206
+ destroy() {
207
+ super.destroy();
208
+
209
+ this.focusTracker.destroy();
210
+ this.keystrokes.destroy();
211
+ }
212
+
203
213
  /**
204
214
  * Focuses the fist {@link #_focusables} in the form.
205
215
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -7,6 +7,8 @@
7
7
  * @module link/utils
8
8
  */
9
9
 
10
+ /* global window */
11
+
10
12
  import { upperFirst } from 'lodash-es';
11
13
 
12
14
  const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
@@ -171,3 +173,12 @@ export function addLinkProtocolIfApplicable( link, defaultProtocol ) {
171
173
 
172
174
  return link && isProtocolNeeded ? protocol + link : link;
173
175
  }
176
+
177
+ /**
178
+ * Opens the link in a new browser tab.
179
+ *
180
+ * @param {String} link
181
+ */
182
+ export function openLink( link ) {
183
+ window.open( link, '_blank', 'noopener' );
184
+ }
package/theme/link.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5