@ckeditor/ckeditor5-link 35.2.0 → 35.3.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.
- package/build/link.js +1 -1
- package/build/link.js.map +1 -1
- package/package.json +20 -20
- package/src/linkediting.js +6 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-link",
|
|
3
|
-
"version": "35.
|
|
3
|
+
"version": "35.3.0",
|
|
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.
|
|
16
|
-
"ckeditor5": "^35.
|
|
15
|
+
"@ckeditor/ckeditor5-ui": "^35.3.0",
|
|
16
|
+
"ckeditor5": "^35.3.0",
|
|
17
17
|
"lodash-es": "^4.17.15"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ckeditor/ckeditor5-basic-styles": "^35.
|
|
21
|
-
"@ckeditor/ckeditor5-block-quote": "^35.
|
|
22
|
-
"@ckeditor/ckeditor5-clipboard": "^35.
|
|
23
|
-
"@ckeditor/ckeditor5-cloud-services": "^35.
|
|
24
|
-
"@ckeditor/ckeditor5-code-block": "^35.
|
|
25
|
-
"@ckeditor/ckeditor5-core": "^35.
|
|
20
|
+
"@ckeditor/ckeditor5-basic-styles": "^35.3.0",
|
|
21
|
+
"@ckeditor/ckeditor5-block-quote": "^35.3.0",
|
|
22
|
+
"@ckeditor/ckeditor5-clipboard": "^35.3.0",
|
|
23
|
+
"@ckeditor/ckeditor5-cloud-services": "^35.3.0",
|
|
24
|
+
"@ckeditor/ckeditor5-code-block": "^35.3.0",
|
|
25
|
+
"@ckeditor/ckeditor5-core": "^35.3.0",
|
|
26
26
|
"@ckeditor/ckeditor5-dev-utils": "^31.0.0",
|
|
27
|
-
"@ckeditor/ckeditor5-easy-image": "^35.
|
|
28
|
-
"@ckeditor/ckeditor5-editor-classic": "^35.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "^35.
|
|
30
|
-
"@ckeditor/ckeditor5-enter": "^35.
|
|
31
|
-
"@ckeditor/ckeditor5-image": "^35.
|
|
32
|
-
"@ckeditor/ckeditor5-paragraph": "^35.
|
|
33
|
-
"@ckeditor/ckeditor5-theme-lark": "^35.
|
|
34
|
-
"@ckeditor/ckeditor5-typing": "^35.
|
|
35
|
-
"@ckeditor/ckeditor5-undo": "^35.
|
|
36
|
-
"@ckeditor/ckeditor5-utils": "^35.
|
|
37
|
-
"@ckeditor/ckeditor5-widget": "^35.
|
|
27
|
+
"@ckeditor/ckeditor5-easy-image": "^35.3.0",
|
|
28
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.3.0",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "^35.3.0",
|
|
30
|
+
"@ckeditor/ckeditor5-enter": "^35.3.0",
|
|
31
|
+
"@ckeditor/ckeditor5-image": "^35.3.0",
|
|
32
|
+
"@ckeditor/ckeditor5-paragraph": "^35.3.0",
|
|
33
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.3.0",
|
|
34
|
+
"@ckeditor/ckeditor5-typing": "^35.3.0",
|
|
35
|
+
"@ckeditor/ckeditor5-undo": "^35.3.0",
|
|
36
|
+
"@ckeditor/ckeditor5-utils": "^35.3.0",
|
|
37
|
+
"@ckeditor/ckeditor5-widget": "^35.3.0",
|
|
38
38
|
"webpack": "^5.58.1",
|
|
39
39
|
"webpack-cli": "^4.9.0"
|
|
40
40
|
},
|
package/src/linkediting.js
CHANGED
|
@@ -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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const
|
|
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
|
-
}
|
|
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.
|
|
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.
|