@ckeditor/ckeditor5-link 40.2.0 → 41.1.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 (103) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/link.js +2 -2
  3. package/lang/translations/ar.po +1 -1
  4. package/lang/translations/ast.po +1 -1
  5. package/lang/translations/az.po +1 -1
  6. package/lang/translations/bg.po +1 -1
  7. package/lang/translations/bn.po +1 -1
  8. package/lang/translations/ca.po +1 -1
  9. package/lang/translations/cs.po +1 -1
  10. package/lang/translations/da.po +1 -1
  11. package/lang/translations/de-ch.po +1 -1
  12. package/lang/translations/de.po +1 -1
  13. package/lang/translations/el.po +1 -1
  14. package/lang/translations/en-au.po +1 -1
  15. package/lang/translations/en-gb.po +1 -1
  16. package/lang/translations/en.po +1 -1
  17. package/lang/translations/eo.po +1 -1
  18. package/lang/translations/es.po +1 -1
  19. package/lang/translations/et.po +1 -1
  20. package/lang/translations/eu.po +1 -1
  21. package/lang/translations/fa.po +1 -1
  22. package/lang/translations/fi.po +1 -1
  23. package/lang/translations/fr.po +1 -1
  24. package/lang/translations/gl.po +1 -1
  25. package/lang/translations/he.po +1 -1
  26. package/lang/translations/hi.po +1 -1
  27. package/lang/translations/hr.po +1 -1
  28. package/lang/translations/hu.po +1 -1
  29. package/lang/translations/hy.po +1 -1
  30. package/lang/translations/id.po +1 -1
  31. package/lang/translations/it.po +1 -1
  32. package/lang/translations/ja.po +1 -1
  33. package/lang/translations/km.po +1 -1
  34. package/lang/translations/kn.po +1 -1
  35. package/lang/translations/ko.po +1 -1
  36. package/lang/translations/ku.po +1 -1
  37. package/lang/translations/lt.po +1 -1
  38. package/lang/translations/lv.po +1 -1
  39. package/lang/translations/ms.po +1 -1
  40. package/lang/translations/nb.po +1 -1
  41. package/lang/translations/ne.po +1 -1
  42. package/lang/translations/nl.po +1 -1
  43. package/lang/translations/no.po +1 -1
  44. package/lang/translations/pl.po +1 -1
  45. package/lang/translations/pt-br.po +1 -1
  46. package/lang/translations/pt.po +1 -1
  47. package/lang/translations/ro.po +1 -1
  48. package/lang/translations/ru.po +1 -1
  49. package/lang/translations/sk.po +1 -1
  50. package/lang/translations/sq.po +1 -1
  51. package/lang/translations/sr-latn.po +1 -1
  52. package/lang/translations/sr.po +1 -1
  53. package/lang/translations/sv.po +1 -1
  54. package/lang/translations/th.po +1 -1
  55. package/lang/translations/tk.po +1 -1
  56. package/lang/translations/tr.po +1 -1
  57. package/lang/translations/tt.po +1 -1
  58. package/lang/translations/ug.po +1 -1
  59. package/lang/translations/uk.po +1 -1
  60. package/lang/translations/ur.po +1 -1
  61. package/lang/translations/uz.po +1 -1
  62. package/lang/translations/vi.po +1 -1
  63. package/lang/translations/zh-cn.po +1 -1
  64. package/lang/translations/zh.po +1 -1
  65. package/package.json +4 -3
  66. package/src/augmentation.d.ts +2 -2
  67. package/src/augmentation.js +1 -1
  68. package/src/autolink.d.ts +4 -4
  69. package/src/autolink.js +6 -6
  70. package/src/index.d.ts +12 -12
  71. package/src/index.js +11 -11
  72. package/src/link.d.ts +5 -5
  73. package/src/link.js +5 -5
  74. package/src/linkcommand.d.ts +5 -5
  75. package/src/linkcommand.js +6 -6
  76. package/src/linkconfig.d.ts +21 -2
  77. package/src/linkconfig.js +1 -1
  78. package/src/linkediting.d.ts +4 -4
  79. package/src/linkediting.js +10 -9
  80. package/src/linkimage.d.ts +4 -4
  81. package/src/linkimage.js +4 -4
  82. package/src/linkimageediting.d.ts +4 -4
  83. package/src/linkimageediting.js +6 -6
  84. package/src/linkimageui.d.ts +4 -4
  85. package/src/linkimageui.js +6 -6
  86. package/src/linkui.d.ts +5 -5
  87. package/src/linkui.js +19 -15
  88. package/src/ui/linkactionsview.d.ts +4 -4
  89. package/src/ui/linkactionsview.js +5 -5
  90. package/src/ui/linkformview.d.ts +4 -4
  91. package/src/ui/linkformview.js +4 -4
  92. package/src/unlinkcommand.d.ts +2 -2
  93. package/src/unlinkcommand.js +4 -4
  94. package/src/utils/automaticdecorators.d.ts +4 -4
  95. package/src/utils/automaticdecorators.js +2 -2
  96. package/src/utils/manualdecorator.d.ts +6 -6
  97. package/src/utils/manualdecorator.js +2 -2
  98. package/src/utils.d.ts +4 -4
  99. package/src/utils.js +1 -1
  100. package/theme/link.css +1 -1
  101. package/theme/linkactions.css +1 -1
  102. package/theme/linkform.css +1 -1
  103. package/theme/linkimage.css +1 -1
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-link",
3
- "version": "40.2.0",
3
+ "version": "41.1.0",
4
4
  "description": "Link feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -10,10 +10,11 @@
10
10
  "ckeditor5-plugin",
11
11
  "ckeditor5-dll"
12
12
  ],
13
+ "type": "module",
13
14
  "main": "src/index.js",
14
15
  "dependencies": {
15
- "@ckeditor/ckeditor5-ui": "40.2.0",
16
- "ckeditor5": "40.2.0",
16
+ "@ckeditor/ckeditor5-ui": "41.1.0",
17
+ "ckeditor5": "41.1.0",
17
18
  "lodash-es": "4.17.21"
18
19
  },
19
20
  "author": "CKSource (http://cksource.com/)",
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type { LinkConfig, AutoLink, Link, LinkEditing, LinkImage, LinkImageEditing, LinkImageUI, LinkUI, LinkCommand, UnlinkCommand } from './index';
5
+ import type { LinkConfig, AutoLink, Link, LinkEditing, LinkImage, LinkImageEditing, LinkImageUI, LinkUI, LinkCommand, UnlinkCommand } from './index.js';
6
6
  declare module '@ckeditor/ckeditor5-core' {
7
7
  interface EditorConfig {
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  export {};
package/src/autolink.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/autolink
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Delete } from 'ckeditor5/src/typing';
10
- import LinkEditing from './linkediting';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { Delete } from 'ckeditor5/src/typing.js';
10
+ import LinkEditing from './linkediting.js';
11
11
  /**
12
12
  * The autolink plugin.
13
13
  */
package/src/autolink.js CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/autolink
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Delete, TextWatcher, getLastTextLine, findAttributeRange } from 'ckeditor5/src/typing';
10
- import { addLinkProtocolIfApplicable, linkHasProtocol } from './utils';
11
- import LinkEditing from './linkediting';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { Delete, TextWatcher, getLastTextLine, findAttributeRange } from 'ckeditor5/src/typing.js';
10
+ import { addLinkProtocolIfApplicable, linkHasProtocol } from './utils.js';
11
+ import LinkEditing from './linkediting.js';
12
12
  const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
13
13
  // This was a tweak from https://gist.github.com/dperini/729294.
14
14
  const URL_REG_EXP = new RegExp(
@@ -134,7 +134,7 @@ export default class AutoLink extends Plugin {
134
134
  const clipboardPipeline = editor.plugins.get('ClipboardPipeline');
135
135
  const linkCommand = editor.commands.get('link');
136
136
  clipboardPipeline.on('inputTransformation', (evt, data) => {
137
- if (!this.isEnabled || !linkCommand.isEnabled || selection.isCollapsed) {
137
+ if (!this.isEnabled || !linkCommand.isEnabled || selection.isCollapsed || data.method !== 'paste') {
138
138
  // Abort if we are disabled or the selection is collapsed.
139
139
  return;
140
140
  }
package/src/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link
7
7
  */
8
- export { default as Link } from './link';
9
- export { default as LinkEditing } from './linkediting';
10
- export { default as LinkUI } from './linkui';
11
- export { default as LinkImage } from './linkimage';
12
- export { default as LinkImageEditing } from './linkimageediting';
13
- export { default as LinkImageUI } from './linkimageui';
14
- export { default as AutoLink } from './autolink';
15
- export { LinkConfig, type LinkDecoratorDefinition } from './linkconfig';
16
- export { default as LinkCommand } from './linkcommand';
17
- export { default as UnlinkCommand } from './unlinkcommand';
18
- import './augmentation';
8
+ export { default as Link } from './link.js';
9
+ export { default as LinkEditing } from './linkediting.js';
10
+ export { default as LinkUI } from './linkui.js';
11
+ export { default as LinkImage } from './linkimage.js';
12
+ export { default as LinkImageEditing } from './linkimageediting.js';
13
+ export { default as LinkImageUI } from './linkimageui.js';
14
+ export { default as AutoLink } from './autolink.js';
15
+ export { LinkConfig, type LinkDecoratorDefinition } from './linkconfig.js';
16
+ export { default as LinkCommand } from './linkcommand.js';
17
+ export { default as UnlinkCommand } from './unlinkcommand.js';
18
+ import './augmentation.js';
package/src/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link
7
7
  */
8
- export { default as Link } from './link';
9
- export { default as LinkEditing } from './linkediting';
10
- export { default as LinkUI } from './linkui';
11
- export { default as LinkImage } from './linkimage';
12
- export { default as LinkImageEditing } from './linkimageediting';
13
- export { default as LinkImageUI } from './linkimageui';
14
- export { default as AutoLink } from './autolink';
15
- export { default as LinkCommand } from './linkcommand';
16
- export { default as UnlinkCommand } from './unlinkcommand';
17
- import './augmentation';
8
+ export { default as Link } from './link.js';
9
+ export { default as LinkEditing } from './linkediting.js';
10
+ export { default as LinkUI } from './linkui.js';
11
+ export { default as LinkImage } from './linkimage.js';
12
+ export { default as LinkImageEditing } from './linkimageediting.js';
13
+ export { default as LinkImageUI } from './linkimageui.js';
14
+ export { default as AutoLink } from './autolink.js';
15
+ export { default as LinkCommand } from './linkcommand.js';
16
+ export { default as UnlinkCommand } from './unlinkcommand.js';
17
+ import './augmentation.js';
package/src/link.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/link
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import LinkEditing from './linkediting';
10
- import LinkUI from './linkui';
11
- import AutoLink from './autolink';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import LinkEditing from './linkediting.js';
10
+ import LinkUI from './linkui.js';
11
+ import AutoLink from './autolink.js';
12
12
  /**
13
13
  * The link plugin.
14
14
  *
package/src/link.js CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/link
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import LinkEditing from './linkediting';
10
- import LinkUI from './linkui';
11
- import AutoLink from './autolink';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import LinkEditing from './linkediting.js';
10
+ import LinkUI from './linkui.js';
11
+ import AutoLink from './autolink.js';
12
12
  /**
13
13
  * The link plugin.
14
14
  *
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkcommand
7
7
  */
8
- import { Command } from 'ckeditor5/src/core';
9
- import { Collection } from 'ckeditor5/src/utils';
10
- import AutomaticDecorators from './utils/automaticdecorators';
11
- import type ManualDecorator from './utils/manualdecorator';
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ import { Collection } from 'ckeditor5/src/utils.js';
10
+ import AutomaticDecorators from './utils/automaticdecorators.js';
11
+ import type ManualDecorator from './utils/manualdecorator.js';
12
12
  /**
13
13
  * The link command. It is used by the {@link module:link/link~Link link feature}.
14
14
  */
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkcommand
7
7
  */
8
- import { Command } from 'ckeditor5/src/core';
9
- import { findAttributeRange } from 'ckeditor5/src/typing';
10
- import { Collection, first, toMap } from 'ckeditor5/src/utils';
11
- import AutomaticDecorators from './utils/automaticdecorators';
12
- import { isLinkableElement } from './utils';
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ import { findAttributeRange } from 'ckeditor5/src/typing.js';
10
+ import { Collection, first, toMap } from 'ckeditor5/src/utils.js';
11
+ import AutomaticDecorators from './utils/automaticdecorators.js';
12
+ import { isLinkableElement } from './utils.js';
13
13
  /**
14
14
  * The link command. It is used by the {@link module:link/link~Link link feature}.
15
15
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkconfig
7
7
  */
8
- import type { ArrayOrItem } from 'ckeditor5/src/utils';
8
+ import type { ArrayOrItem } from 'ckeditor5/src/utils.js';
9
9
  /**
10
10
  * The configuration of the {@link module:link/link~Link link feature}.
11
11
  *
@@ -43,6 +43,25 @@ export interface LinkConfig {
43
43
  * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.
44
44
  */
45
45
  defaultProtocol?: string;
46
+ /**
47
+ * When set to `true`, the form will accept an empty value in the URL field, creating a link with an empty `href` (`<a href="">`).
48
+ *
49
+ * ```ts
50
+ * ClassicEditor
51
+ * .create( editorElement, {
52
+ * link: {
53
+ * allowCreatingEmptyLinks: true
54
+ * }
55
+ * } )
56
+ * .then( ... )
57
+ * .catch( ... );
58
+ * ```
59
+ *
60
+ * **NOTE:** This option only adds form validation. If a link with an empty `href` is loaded into the editor, it will be left as-is.
61
+ *
62
+ * @default false
63
+ */
64
+ allowCreatingEmptyLinks?: boolean;
46
65
  /**
47
66
  * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
48
67
  * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`.
package/src/linkconfig.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  export {};
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkediting
7
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';
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
+ import { Input, TwoStepCaretMovement } from 'ckeditor5/src/typing.js';
10
+ import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
11
11
  import '../theme/link.css';
12
12
  /**
13
13
  * The link engine feature.
@@ -1,18 +1,18 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkediting
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Input, TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing';
10
- import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
11
- import { keyCodes, env } from 'ckeditor5/src/utils';
12
- import LinkCommand from './linkcommand';
13
- import UnlinkCommand from './unlinkcommand';
14
- import ManualDecorator from './utils/manualdecorator';
15
- import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, openLink, addLinkProtocolIfApplicable } from './utils';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { Input, TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing.js';
10
+ import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
11
+ import { keyCodes, env } from 'ckeditor5/src/utils.js';
12
+ import LinkCommand from './linkcommand.js';
13
+ import UnlinkCommand from './unlinkcommand.js';
14
+ import ManualDecorator from './utils/manualdecorator.js';
15
+ import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, openLink, addLinkProtocolIfApplicable } from './utils.js';
16
16
  import '../theme/link.css';
17
17
  const HIGHLIGHT_CLASS = 'ck-link_selected';
18
18
  const DECORATOR_AUTOMATIC = 'automatic';
@@ -44,6 +44,7 @@ export default class LinkEditing extends Plugin {
44
44
  constructor(editor) {
45
45
  super(editor);
46
46
  editor.config.define('link', {
47
+ allowCreatingEmptyLinks: false,
47
48
  addTargetToExternalLinks: false
48
49
  });
49
50
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkimage
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import LinkImageEditing from './linkimageediting';
10
- import LinkImageUI from './linkimageui';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import LinkImageEditing from './linkimageediting.js';
10
+ import LinkImageUI from './linkimageui.js';
11
11
  import '../theme/linkimage.css';
12
12
  /**
13
13
  * The `LinkImage` plugin.
package/src/linkimage.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkimage
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import LinkImageEditing from './linkimageediting';
10
- import LinkImageUI from './linkimageui';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import LinkImageEditing from './linkimageediting.js';
10
+ import LinkImageUI from './linkimageui.js';
11
11
  import '../theme/linkimage.css';
12
12
  /**
13
13
  * The `LinkImage` plugin.
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkimageediting
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import LinkEditing from './linkediting';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import LinkEditing from './linkediting.js';
10
10
  /**
11
11
  * The link image engine feature.
12
12
  *
@@ -25,7 +25,7 @@ export default class LinkImageEditing extends Plugin {
25
25
  /**
26
26
  * @inheritDoc
27
27
  */
28
- init(): void;
28
+ afterInit(): void;
29
29
  /**
30
30
  * Processes {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
31
31
  * attaches proper converters that will work when linking an image.`
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkimageediting
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Matcher } from 'ckeditor5/src/engine';
10
- import { toMap } from 'ckeditor5/src/utils';
11
- import LinkEditing from './linkediting';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { Matcher } from 'ckeditor5/src/engine.js';
10
+ import { toMap } from 'ckeditor5/src/utils.js';
11
+ import LinkEditing from './linkediting.js';
12
12
  /**
13
13
  * The link image engine feature.
14
14
  *
@@ -31,7 +31,7 @@ export default class LinkImageEditing extends Plugin {
31
31
  /**
32
32
  * @inheritDoc
33
33
  */
34
- init() {
34
+ afterInit() {
35
35
  const editor = this.editor;
36
36
  const schema = editor.model.schema;
37
37
  if (editor.plugins.has('ImageBlockEditing')) {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import { Plugin } from 'ckeditor5/src/core';
6
- import LinkUI from './linkui';
7
- import LinkEditing from './linkediting';
5
+ import { Plugin } from 'ckeditor5/src/core.js';
6
+ import LinkUI from './linkui.js';
7
+ import LinkEditing from './linkediting.js';
8
8
  /**
9
9
  * The link image UI plugin.
10
10
  *
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkimageui
7
7
  */
8
- import { ButtonView } from 'ckeditor5/src/ui';
9
- import { Plugin } from 'ckeditor5/src/core';
10
- import LinkUI from './linkui';
11
- import LinkEditing from './linkediting';
12
- import { LINK_KEYSTROKE } from './utils';
8
+ import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { Plugin } from 'ckeditor5/src/core.js';
10
+ import LinkUI from './linkui.js';
11
+ import LinkEditing from './linkediting.js';
12
+ import { LINK_KEYSTROKE } from './utils.js';
13
13
  import linkIcon from '../theme/icons/link.svg';
14
14
  /**
15
15
  * The link image UI plugin.
package/src/linkui.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module link/linkui
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { ContextualBalloon, type ViewWithCssTransitionDisabler } from 'ckeditor5/src/ui';
10
- import LinkFormView from './ui/linkformview';
11
- import LinkActionsView from './ui/linkactionsview';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { ContextualBalloon, type ViewWithCssTransitionDisabler } from 'ckeditor5/src/ui.js';
10
+ import LinkFormView from './ui/linkformview.js';
11
+ import LinkActionsView from './ui/linkactionsview.js';
12
12
  /**
13
13
  * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
14
14
  *