@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.
Files changed (104) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +3 -3
  4. package/build/link.js.map +1 -0
  5. package/build/translations/de.js +1 -1
  6. package/build/translations/hy.js +1 -0
  7. package/build/translations/pt-br.js +1 -1
  8. package/lang/translations/ar.po +1 -0
  9. package/lang/translations/ast.po +1 -0
  10. package/lang/translations/az.po +1 -0
  11. package/lang/translations/bg.po +1 -0
  12. package/lang/translations/bn.po +1 -0
  13. package/lang/translations/ca.po +1 -0
  14. package/lang/translations/cs.po +1 -0
  15. package/lang/translations/da.po +1 -0
  16. package/lang/translations/de-ch.po +1 -0
  17. package/lang/translations/de.po +2 -1
  18. package/lang/translations/el.po +1 -0
  19. package/lang/translations/en-au.po +1 -0
  20. package/lang/translations/en-gb.po +1 -0
  21. package/lang/translations/en.po +1 -0
  22. package/lang/translations/eo.po +1 -0
  23. package/lang/translations/es.po +1 -0
  24. package/lang/translations/et.po +1 -0
  25. package/lang/translations/eu.po +1 -0
  26. package/lang/translations/fa.po +1 -0
  27. package/lang/translations/fi.po +1 -0
  28. package/lang/translations/fr.po +1 -0
  29. package/lang/translations/gl.po +1 -0
  30. package/lang/translations/he.po +1 -0
  31. package/lang/translations/hi.po +1 -0
  32. package/lang/translations/hr.po +1 -0
  33. package/lang/translations/hu.po +1 -0
  34. package/lang/translations/hy.po +54 -0
  35. package/lang/translations/id.po +1 -0
  36. package/lang/translations/it.po +1 -0
  37. package/lang/translations/ja.po +1 -0
  38. package/lang/translations/km.po +1 -0
  39. package/lang/translations/kn.po +1 -0
  40. package/lang/translations/ko.po +1 -0
  41. package/lang/translations/ku.po +1 -0
  42. package/lang/translations/lt.po +1 -0
  43. package/lang/translations/lv.po +1 -0
  44. package/lang/translations/ms.po +1 -0
  45. package/lang/translations/nb.po +1 -0
  46. package/lang/translations/ne.po +1 -0
  47. package/lang/translations/nl.po +1 -0
  48. package/lang/translations/no.po +1 -0
  49. package/lang/translations/pl.po +1 -0
  50. package/lang/translations/pt-br.po +3 -2
  51. package/lang/translations/pt.po +1 -0
  52. package/lang/translations/ro.po +1 -0
  53. package/lang/translations/ru.po +1 -0
  54. package/lang/translations/sk.po +1 -0
  55. package/lang/translations/sq.po +1 -0
  56. package/lang/translations/sr-latn.po +1 -0
  57. package/lang/translations/sr.po +1 -0
  58. package/lang/translations/sv.po +1 -0
  59. package/lang/translations/th.po +1 -0
  60. package/lang/translations/tk.po +1 -0
  61. package/lang/translations/tr.po +1 -0
  62. package/lang/translations/tt.po +1 -0
  63. package/lang/translations/ug.po +1 -0
  64. package/lang/translations/uk.po +1 -0
  65. package/lang/translations/ur.po +1 -0
  66. package/lang/translations/uz.po +1 -0
  67. package/lang/translations/vi.po +1 -0
  68. package/lang/translations/zh-cn.po +1 -0
  69. package/lang/translations/zh.po +1 -0
  70. package/package.json +3 -7
  71. package/src/augmentation.d.ts +30 -30
  72. package/src/augmentation.js +5 -5
  73. package/src/autolink.d.ts +60 -60
  74. package/src/autolink.js +216 -216
  75. package/src/index.d.ts +18 -18
  76. package/src/index.js +17 -17
  77. package/src/link.d.ts +27 -27
  78. package/src/link.js +31 -31
  79. package/src/linkcommand.d.ts +132 -132
  80. package/src/linkcommand.js +285 -285
  81. package/src/linkconfig.d.ts +251 -251
  82. package/src/linkconfig.js +5 -5
  83. package/src/linkediting.d.ts +106 -106
  84. package/src/linkediting.js +547 -547
  85. package/src/linkimage.d.ts +27 -27
  86. package/src/linkimage.js +31 -31
  87. package/src/linkimageediting.d.ts +39 -39
  88. package/src/linkimageediting.js +245 -245
  89. package/src/linkimageui.d.ts +40 -40
  90. package/src/linkimageui.js +96 -96
  91. package/src/linkui.d.ts +165 -165
  92. package/src/linkui.js +581 -581
  93. package/src/ui/linkactionsview.d.ts +101 -101
  94. package/src/ui/linkactionsview.js +156 -156
  95. package/src/ui/linkformview.d.ts +141 -141
  96. package/src/ui/linkformview.js +232 -232
  97. package/src/unlinkcommand.d.ts +31 -31
  98. package/src/unlinkcommand.js +66 -66
  99. package/src/utils/automaticdecorators.d.ts +45 -45
  100. package/src/utils/automaticdecorators.js +140 -140
  101. package/src/utils/manualdecorator.d.ts +72 -72
  102. package/src/utils/manualdecorator.js +47 -47
  103. package/src/utils.d.ts +80 -80
  104. package/src/utils.js +128 -128
@@ -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
+ }