@ckeditor/ckeditor5-link 39.0.1 → 40.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.
- package/CHANGELOG.md +1 -1
- package/LICENSE.md +1 -1
- package/README.md +3 -3
- package/build/link.js.map +1 -0
- package/build/translations/de.js +1 -1
- package/build/translations/hy.js +1 -0
- package/build/translations/pt-br.js +1 -1
- package/lang/translations/ar.po +1 -0
- package/lang/translations/ast.po +1 -0
- package/lang/translations/az.po +1 -0
- package/lang/translations/bg.po +1 -0
- package/lang/translations/bn.po +1 -0
- package/lang/translations/ca.po +1 -0
- package/lang/translations/cs.po +1 -0
- package/lang/translations/da.po +1 -0
- package/lang/translations/de-ch.po +1 -0
- package/lang/translations/de.po +2 -1
- package/lang/translations/el.po +1 -0
- package/lang/translations/en-au.po +1 -0
- package/lang/translations/en-gb.po +1 -0
- package/lang/translations/en.po +1 -0
- package/lang/translations/eo.po +1 -0
- package/lang/translations/es.po +1 -0
- package/lang/translations/et.po +1 -0
- package/lang/translations/eu.po +1 -0
- package/lang/translations/fa.po +1 -0
- package/lang/translations/fi.po +1 -0
- package/lang/translations/fr.po +1 -0
- package/lang/translations/gl.po +1 -0
- package/lang/translations/he.po +1 -0
- package/lang/translations/hi.po +1 -0
- package/lang/translations/hr.po +1 -0
- package/lang/translations/hu.po +1 -0
- package/lang/translations/hy.po +54 -0
- package/lang/translations/id.po +1 -0
- package/lang/translations/it.po +1 -0
- package/lang/translations/ja.po +1 -0
- package/lang/translations/km.po +1 -0
- package/lang/translations/kn.po +1 -0
- package/lang/translations/ko.po +1 -0
- package/lang/translations/ku.po +1 -0
- package/lang/translations/lt.po +1 -0
- package/lang/translations/lv.po +1 -0
- package/lang/translations/ms.po +1 -0
- package/lang/translations/nb.po +1 -0
- package/lang/translations/ne.po +1 -0
- package/lang/translations/nl.po +1 -0
- package/lang/translations/no.po +1 -0
- package/lang/translations/pl.po +1 -0
- package/lang/translations/pt-br.po +3 -2
- package/lang/translations/pt.po +1 -0
- package/lang/translations/ro.po +1 -0
- package/lang/translations/ru.po +1 -0
- package/lang/translations/sk.po +1 -0
- package/lang/translations/sq.po +1 -0
- package/lang/translations/sr-latn.po +1 -0
- package/lang/translations/sr.po +1 -0
- package/lang/translations/sv.po +1 -0
- package/lang/translations/th.po +1 -0
- package/lang/translations/tk.po +1 -0
- package/lang/translations/tr.po +1 -0
- package/lang/translations/tt.po +1 -0
- package/lang/translations/ug.po +1 -0
- package/lang/translations/uk.po +1 -0
- package/lang/translations/ur.po +1 -0
- package/lang/translations/uz.po +1 -0
- package/lang/translations/vi.po +1 -0
- package/lang/translations/zh-cn.po +1 -0
- package/lang/translations/zh.po +1 -0
- package/package.json +3 -7
- package/src/augmentation.d.ts +30 -30
- package/src/augmentation.js +5 -5
- package/src/autolink.d.ts +60 -60
- package/src/autolink.js +216 -216
- package/src/index.d.ts +18 -18
- package/src/index.js +17 -17
- package/src/link.d.ts +27 -27
- package/src/link.js +31 -31
- package/src/linkcommand.d.ts +132 -132
- package/src/linkcommand.js +285 -285
- package/src/linkconfig.d.ts +251 -251
- package/src/linkconfig.js +5 -5
- package/src/linkediting.d.ts +106 -106
- package/src/linkediting.js +547 -547
- package/src/linkimage.d.ts +27 -27
- package/src/linkimage.js +31 -31
- package/src/linkimageediting.d.ts +39 -39
- package/src/linkimageediting.js +245 -245
- package/src/linkimageui.d.ts +40 -40
- package/src/linkimageui.js +96 -96
- package/src/linkui.d.ts +165 -165
- package/src/linkui.js +581 -581
- package/src/ui/linkactionsview.d.ts +101 -101
- package/src/ui/linkactionsview.js +156 -156
- package/src/ui/linkformview.d.ts +141 -141
- package/src/ui/linkformview.js +232 -232
- package/src/unlinkcommand.d.ts +31 -31
- package/src/unlinkcommand.js +66 -66
- package/src/utils/automaticdecorators.d.ts +45 -45
- package/src/utils/automaticdecorators.js +140 -140
- package/src/utils/manualdecorator.d.ts +72 -72
- package/src/utils/manualdecorator.js +47 -47
- package/src/utils.d.ts +80 -80
- package/src/utils.js +128 -128
package/src/linkediting.d.ts
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module link/linkediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
9
|
-
import { Input, TwoStepCaretMovement } from 'ckeditor5/src/typing';
|
|
10
|
-
import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
|
|
11
|
-
import '../theme/link.css';
|
|
12
|
-
/**
|
|
13
|
-
* The link engine feature.
|
|
14
|
-
*
|
|
15
|
-
* It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
|
|
16
|
-
* as well as `'link'` and `'unlink'` commands.
|
|
17
|
-
*/
|
|
18
|
-
export default class LinkEditing extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get pluginName(): "LinkEditing";
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get requires(): readonly [typeof TwoStepCaretMovement, typeof Input, typeof ClipboardPipeline];
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
constructor(editor: Editor);
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
init(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}
|
|
37
|
-
* and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
|
|
38
|
-
* for each one of them. Downcast dispatchers are obtained using the
|
|
39
|
-
* {@link module:link/utils/automaticdecorators~AutomaticDecorators#getDispatcher} method.
|
|
40
|
-
*
|
|
41
|
-
* **Note**: This method also activates the automatic external link decorator if enabled with
|
|
42
|
-
* {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
|
|
43
|
-
*/
|
|
44
|
-
private _enableAutomaticDecorators;
|
|
45
|
-
/**
|
|
46
|
-
* Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},
|
|
47
|
-
* transforms them into {@link module:link/utils/manualdecorator~ManualDecorator} instances and stores them in the
|
|
48
|
-
* {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
|
|
49
|
-
*
|
|
50
|
-
* Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
|
|
51
|
-
* converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
|
|
52
|
-
* with adequate model attributes.
|
|
53
|
-
*/
|
|
54
|
-
private _enableManualDecorators;
|
|
55
|
-
/**
|
|
56
|
-
* Attaches handlers for {@link module:engine/view/document~Document#event:enter} and
|
|
57
|
-
* {@link module:engine/view/document~Document#event:click} to enable link following.
|
|
58
|
-
*/
|
|
59
|
-
private _enableLinkOpen;
|
|
60
|
-
/**
|
|
61
|
-
* Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
|
|
62
|
-
* selection attributes if the selection is at the end of a link after inserting the content.
|
|
63
|
-
*
|
|
64
|
-
* The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
|
|
65
|
-
* `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
|
|
66
|
-
*
|
|
67
|
-
* See https://github.com/ckeditor/ckeditor5/issues/6053.
|
|
68
|
-
*/
|
|
69
|
-
private _enableInsertContentSelectionAttributesFixer;
|
|
70
|
-
/**
|
|
71
|
-
* Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
|
|
72
|
-
* {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
|
|
73
|
-
* if clicked at the beginning/ending of the link.
|
|
74
|
-
*
|
|
75
|
-
* The purpose of this action is to allow typing around the link node directly after a click.
|
|
76
|
-
*
|
|
77
|
-
* See https://github.com/ckeditor/ckeditor5/issues/1016.
|
|
78
|
-
*/
|
|
79
|
-
private _enableClickingAfterLink;
|
|
80
|
-
/**
|
|
81
|
-
* Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
|
|
82
|
-
* and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
|
|
83
|
-
*
|
|
84
|
-
* The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
|
|
85
|
-
*
|
|
86
|
-
* See https://github.com/ckeditor/ckeditor5/issues/4762.
|
|
87
|
-
*/
|
|
88
|
-
private _enableTypingOverLink;
|
|
89
|
-
/**
|
|
90
|
-
* Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
|
|
91
|
-
* removing a content right after the "linkHref" attribute.
|
|
92
|
-
*
|
|
93
|
-
* If so, the selection should not preserve the `linkHref` attribute. However, if
|
|
94
|
-
* the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
|
|
95
|
-
* the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
|
|
96
|
-
*
|
|
97
|
-
* The purpose of this action is to allow removing the link text and keep the selection outside the link.
|
|
98
|
-
*
|
|
99
|
-
* See https://github.com/ckeditor/ckeditor5/issues/7521.
|
|
100
|
-
*/
|
|
101
|
-
private _handleDeleteContentAfterLink;
|
|
102
|
-
/**
|
|
103
|
-
* Enables URL fixing on pasting.
|
|
104
|
-
*/
|
|
105
|
-
private _enableClipboardIntegration;
|
|
106
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module link/linkediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
9
|
+
import { Input, TwoStepCaretMovement } from 'ckeditor5/src/typing';
|
|
10
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
|
|
11
|
+
import '../theme/link.css';
|
|
12
|
+
/**
|
|
13
|
+
* The link engine feature.
|
|
14
|
+
*
|
|
15
|
+
* It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
|
|
16
|
+
* as well as `'link'` and `'unlink'` commands.
|
|
17
|
+
*/
|
|
18
|
+
export default class LinkEditing extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "LinkEditing";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof TwoStepCaretMovement, typeof Input, typeof ClipboardPipeline];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
constructor(editor: Editor);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}
|
|
37
|
+
* and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
|
|
38
|
+
* for each one of them. Downcast dispatchers are obtained using the
|
|
39
|
+
* {@link module:link/utils/automaticdecorators~AutomaticDecorators#getDispatcher} method.
|
|
40
|
+
*
|
|
41
|
+
* **Note**: This method also activates the automatic external link decorator if enabled with
|
|
42
|
+
* {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
|
|
43
|
+
*/
|
|
44
|
+
private _enableAutomaticDecorators;
|
|
45
|
+
/**
|
|
46
|
+
* Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},
|
|
47
|
+
* transforms them into {@link module:link/utils/manualdecorator~ManualDecorator} instances and stores them in the
|
|
48
|
+
* {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
|
|
49
|
+
*
|
|
50
|
+
* Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
|
|
51
|
+
* converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
|
|
52
|
+
* with adequate model attributes.
|
|
53
|
+
*/
|
|
54
|
+
private _enableManualDecorators;
|
|
55
|
+
/**
|
|
56
|
+
* Attaches handlers for {@link module:engine/view/document~Document#event:enter} and
|
|
57
|
+
* {@link module:engine/view/document~Document#event:click} to enable link following.
|
|
58
|
+
*/
|
|
59
|
+
private _enableLinkOpen;
|
|
60
|
+
/**
|
|
61
|
+
* Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
|
|
62
|
+
* selection attributes if the selection is at the end of a link after inserting the content.
|
|
63
|
+
*
|
|
64
|
+
* The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
|
|
65
|
+
* `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
|
|
66
|
+
*
|
|
67
|
+
* See https://github.com/ckeditor/ckeditor5/issues/6053.
|
|
68
|
+
*/
|
|
69
|
+
private _enableInsertContentSelectionAttributesFixer;
|
|
70
|
+
/**
|
|
71
|
+
* Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
|
|
72
|
+
* {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
|
|
73
|
+
* if clicked at the beginning/ending of the link.
|
|
74
|
+
*
|
|
75
|
+
* The purpose of this action is to allow typing around the link node directly after a click.
|
|
76
|
+
*
|
|
77
|
+
* See https://github.com/ckeditor/ckeditor5/issues/1016.
|
|
78
|
+
*/
|
|
79
|
+
private _enableClickingAfterLink;
|
|
80
|
+
/**
|
|
81
|
+
* Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
|
|
82
|
+
* and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
|
|
83
|
+
*
|
|
84
|
+
* The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
|
|
85
|
+
*
|
|
86
|
+
* See https://github.com/ckeditor/ckeditor5/issues/4762.
|
|
87
|
+
*/
|
|
88
|
+
private _enableTypingOverLink;
|
|
89
|
+
/**
|
|
90
|
+
* Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
|
|
91
|
+
* removing a content right after the "linkHref" attribute.
|
|
92
|
+
*
|
|
93
|
+
* If so, the selection should not preserve the `linkHref` attribute. However, if
|
|
94
|
+
* the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
|
|
95
|
+
* the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
|
|
96
|
+
*
|
|
97
|
+
* The purpose of this action is to allow removing the link text and keep the selection outside the link.
|
|
98
|
+
*
|
|
99
|
+
* See https://github.com/ckeditor/ckeditor5/issues/7521.
|
|
100
|
+
*/
|
|
101
|
+
private _handleDeleteContentAfterLink;
|
|
102
|
+
/**
|
|
103
|
+
* Enables URL fixing on pasting.
|
|
104
|
+
*/
|
|
105
|
+
private _enableClipboardIntegration;
|
|
106
|
+
}
|