@ckeditor/ckeditor5-link 35.2.1 → 35.3.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-link",
3
- "version": "35.2.1",
3
+ "version": "35.3.1",
4
4
  "description": "Link feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,29 +12,29 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-ui": "^35.2.1",
16
- "ckeditor5": "^35.2.1",
15
+ "@ckeditor/ckeditor5-ui": "^35.3.1",
16
+ "ckeditor5": "^35.3.1",
17
17
  "lodash-es": "^4.17.15"
18
18
  },
19
19
  "devDependencies": {
20
- "@ckeditor/ckeditor5-basic-styles": "^35.2.1",
21
- "@ckeditor/ckeditor5-block-quote": "^35.2.1",
22
- "@ckeditor/ckeditor5-clipboard": "^35.2.1",
23
- "@ckeditor/ckeditor5-cloud-services": "^35.2.1",
24
- "@ckeditor/ckeditor5-code-block": "^35.2.1",
25
- "@ckeditor/ckeditor5-core": "^35.2.1",
20
+ "@ckeditor/ckeditor5-basic-styles": "^35.3.1",
21
+ "@ckeditor/ckeditor5-block-quote": "^35.3.1",
22
+ "@ckeditor/ckeditor5-clipboard": "^35.3.1",
23
+ "@ckeditor/ckeditor5-cloud-services": "^35.3.1",
24
+ "@ckeditor/ckeditor5-code-block": "^35.3.1",
25
+ "@ckeditor/ckeditor5-core": "^35.3.1",
26
26
  "@ckeditor/ckeditor5-dev-utils": "^31.0.0",
27
- "@ckeditor/ckeditor5-easy-image": "^35.2.1",
28
- "@ckeditor/ckeditor5-editor-classic": "^35.2.1",
29
- "@ckeditor/ckeditor5-engine": "^35.2.1",
30
- "@ckeditor/ckeditor5-enter": "^35.2.1",
31
- "@ckeditor/ckeditor5-image": "^35.2.1",
32
- "@ckeditor/ckeditor5-paragraph": "^35.2.1",
33
- "@ckeditor/ckeditor5-theme-lark": "^35.2.1",
34
- "@ckeditor/ckeditor5-typing": "^35.2.1",
35
- "@ckeditor/ckeditor5-undo": "^35.2.1",
36
- "@ckeditor/ckeditor5-utils": "^35.2.1",
37
- "@ckeditor/ckeditor5-widget": "^35.2.1",
27
+ "@ckeditor/ckeditor5-easy-image": "^35.3.1",
28
+ "@ckeditor/ckeditor5-editor-classic": "^35.3.1",
29
+ "@ckeditor/ckeditor5-engine": "^35.3.1",
30
+ "@ckeditor/ckeditor5-enter": "^35.3.1",
31
+ "@ckeditor/ckeditor5-image": "^35.3.1",
32
+ "@ckeditor/ckeditor5-paragraph": "^35.3.1",
33
+ "@ckeditor/ckeditor5-theme-lark": "^35.3.1",
34
+ "@ckeditor/ckeditor5-typing": "^35.3.1",
35
+ "@ckeditor/ckeditor5-undo": "^35.3.1",
36
+ "@ckeditor/ckeditor5-utils": "^35.3.1",
37
+ "@ckeditor/ckeditor5-widget": "^35.3.1",
38
38
  "webpack": "^5.58.1",
39
39
  "webpack-cli": "^4.9.0"
40
40
  },
@@ -239,7 +239,6 @@ export default class LinkEditing extends Plugin {
239
239
  const editor = this.editor;
240
240
  const view = editor.editing.view;
241
241
  const viewDocument = view.document;
242
- const modelDocument = editor.model.document;
243
242
 
244
243
  this.listenTo( viewDocument, 'click', ( evt, data ) => {
245
244
  const shouldOpen = env.isMac ? data.domEvent.metaKey : data.domEvent.ctrlKey;
@@ -270,16 +269,10 @@ export default class LinkEditing extends Plugin {
270
269
  openLink( url );
271
270
  }, { context: '$capture' } );
272
271
 
273
- this.listenTo( viewDocument, 'enter', ( evt, data ) => {
274
- const selection = modelDocument.selection;
275
-
276
- const selectedElement = selection.getSelectedElement();
277
-
278
- const url = selectedElement ?
279
- selectedElement.getAttribute( 'linkHref' ) :
280
- selection.getAttribute( 'linkHref' );
281
-
282
- const shouldOpen = url && data.domEvent.altKey;
272
+ // Open link on Alt+Enter.
273
+ this.listenTo( viewDocument, 'keydown', ( evt, data ) => {
274
+ const url = editor.commands.get( 'link' ).value;
275
+ const shouldOpen = url && data.keyCode === keyCodes.enter && data.altKey;
283
276
 
284
277
  if ( !shouldOpen ) {
285
278
  return;
@@ -288,7 +281,7 @@ export default class LinkEditing extends Plugin {
288
281
  evt.stop();
289
282
 
290
283
  openLink( url );
291
- }, { context: 'a' } );
284
+ } );
292
285
  }
293
286
 
294
287
  /**
@@ -542,7 +535,7 @@ export default class LinkEditing extends Plugin {
542
535
 
543
536
  // Detect pressing `Backspace`.
544
537
  this.listenTo( view.document, 'delete', ( evt, data ) => {
545
- hasBackspacePressed = data.domEvent.keyCode === keyCodes.backspace;
538
+ hasBackspacePressed = data.direction === 'backward';
546
539
  }, { priority: 'high' } );
547
540
 
548
541
  // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.