@ckeditor/ckeditor5-link 45.0.0-alpha.9 → 45.1.0-alpha.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/LICENSE.md +1 -0
- package/build/link.js +1 -1
- package/dist/index.js +7 -9
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/autolink.js +7 -3
- package/src/utils/manualdecorator.d.ts +1 -6
- package/src/utils/manualdecorator.js +1 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-link",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.1.0-alpha.0",
|
|
4
4
|
"description": "Link feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-clipboard": "45.
|
|
17
|
-
"@ckeditor/ckeditor5-core": "45.
|
|
18
|
-
"@ckeditor/ckeditor5-engine": "45.
|
|
19
|
-
"@ckeditor/ckeditor5-icons": "45.
|
|
20
|
-
"@ckeditor/ckeditor5-image": "45.
|
|
21
|
-
"@ckeditor/ckeditor5-typing": "45.
|
|
22
|
-
"@ckeditor/ckeditor5-ui": "45.
|
|
23
|
-
"@ckeditor/ckeditor5-utils": "45.
|
|
24
|
-
"@ckeditor/ckeditor5-widget": "45.
|
|
25
|
-
"ckeditor5": "45.
|
|
16
|
+
"@ckeditor/ckeditor5-clipboard": "45.1.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-core": "45.1.0-alpha.0",
|
|
18
|
+
"@ckeditor/ckeditor5-engine": "45.1.0-alpha.0",
|
|
19
|
+
"@ckeditor/ckeditor5-icons": "45.1.0-alpha.0",
|
|
20
|
+
"@ckeditor/ckeditor5-image": "45.1.0-alpha.0",
|
|
21
|
+
"@ckeditor/ckeditor5-typing": "45.1.0-alpha.0",
|
|
22
|
+
"@ckeditor/ckeditor5-ui": "45.1.0-alpha.0",
|
|
23
|
+
"@ckeditor/ckeditor5-utils": "45.1.0-alpha.0",
|
|
24
|
+
"@ckeditor/ckeditor5-widget": "45.1.0-alpha.0",
|
|
25
|
+
"ckeditor5": "45.1.0-alpha.0",
|
|
26
26
|
"es-toolkit": "1.32.0"
|
|
27
27
|
},
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
package/src/autolink.js
CHANGED
|
@@ -218,10 +218,14 @@ export default class AutoLink extends Plugin {
|
|
|
218
218
|
}
|
|
219
219
|
enterCommand.on('execute', () => {
|
|
220
220
|
const position = model.document.selection.getFirstPosition();
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
let rangeToCheck;
|
|
222
|
+
// Previous sibling might not be an element if enter was blocked due to be triggered in a limit element.
|
|
223
|
+
if (position.parent.previousSibling?.is('element')) {
|
|
224
|
+
rangeToCheck = model.createRangeIn(position.parent.previousSibling);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
rangeToCheck = model.createRange(model.createPositionAt(position.parent, 0), position);
|
|
223
228
|
}
|
|
224
|
-
const rangeToCheck = model.createRangeIn(position.parent.previousSibling);
|
|
225
229
|
this._checkAndApplyAutoLinkOnRange(rangeToCheck);
|
|
226
230
|
});
|
|
227
231
|
}
|
|
@@ -54,12 +54,7 @@ export default class ManualDecorator extends /* #__PURE__ */ ManualDecorator_bas
|
|
|
54
54
|
/**
|
|
55
55
|
* Creates a new instance of {@link module:link/utils/manualdecorator~ManualDecorator}.
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* For example: `'linkIsExternal'`.
|
|
59
|
-
* @param config.label The label used in the user interface to toggle the manual decorator.
|
|
60
|
-
* @param config.attributes A set of attributes added to output data when the decorator is active for a specific link.
|
|
61
|
-
* Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
|
|
62
|
-
* @param [config.defaultValue] Controls whether the decorator is "on" by default.
|
|
57
|
+
* @param options The configuration object.
|
|
63
58
|
*/
|
|
64
59
|
constructor({ id, label, attributes, classes, styles, defaultValue }: NormalizedLinkDecoratorManualDefinition);
|
|
65
60
|
/**
|
|
@@ -42,12 +42,7 @@ export default class ManualDecorator extends /* #__PURE__ */ ObservableMixin() {
|
|
|
42
42
|
/**
|
|
43
43
|
* Creates a new instance of {@link module:link/utils/manualdecorator~ManualDecorator}.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* For example: `'linkIsExternal'`.
|
|
47
|
-
* @param config.label The label used in the user interface to toggle the manual decorator.
|
|
48
|
-
* @param config.attributes A set of attributes added to output data when the decorator is active for a specific link.
|
|
49
|
-
* Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
|
|
50
|
-
* @param [config.defaultValue] Controls whether the decorator is "on" by default.
|
|
45
|
+
* @param options The configuration object.
|
|
51
46
|
*/
|
|
52
47
|
constructor({ id, label, attributes, classes, styles, defaultValue }) {
|
|
53
48
|
super();
|