@ckeditor/ckeditor5-link 48.2.0 → 48.3.0-alpha.1

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.
@@ -1,96 +1,96 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module link/linkediting
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
9
- import { Input, TwoStepCaretMovement } from '@ckeditor/ckeditor5-typing';
10
- import { ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard';
11
- import '../theme/link.css';
6
+ * @module link/linkediting
7
+ */
8
+ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { Input, TwoStepCaretMovement } from "@ckeditor/ckeditor5-typing";
10
+ import { ClipboardPipeline } from "@ckeditor/ckeditor5-clipboard";
11
+ import "../theme/link.css";
12
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
- */
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
18
  export declare class LinkEditing extends Plugin {
19
- /**
20
- * A list of functions that handles opening links. If any of them returns `true`, the link is considered to be opened.
21
- */
22
- private readonly _linkOpeners;
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName(): "LinkEditing";
27
- /**
28
- * @inheritDoc
29
- */
30
- static get isOfficialPlugin(): true;
31
- /**
32
- * @inheritDoc
33
- */
34
- static get requires(): readonly [typeof TwoStepCaretMovement, typeof Input, typeof ClipboardPipeline];
35
- /**
36
- * @inheritDoc
37
- */
38
- constructor(editor: Editor);
39
- /**
40
- * @inheritDoc
41
- */
42
- init(): void;
43
- /**
44
- * Registers a function that opens links in a new browser tab.
45
- *
46
- * @param linkOpener The function that opens a link in a new browser tab.
47
- * @internal
48
- */
49
- _registerLinkOpener(linkOpener: LinkOpener): void;
50
- /**
51
- * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}
52
- * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
53
- * for each one of them. Downcast dispatchers are obtained using the
54
- * {@link module:link/utils/automaticdecorators~AutomaticLinkDecorators#getDispatcher} method.
55
- *
56
- * **Note**: This method also activates the automatic external link decorator if enabled with
57
- * {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
58
- */
59
- private _enableAutomaticDecorators;
60
- /**
61
- * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},
62
- * transforms them into {@link module:link/utils/manualdecorator~LinkManualDecorator} instances and stores them in the
63
- * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
64
- *
65
- * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
66
- * converter for each manual decorator and extends the {@link module:engine/model/schema~ModelSchema model's schema}
67
- * with adequate model attributes.
68
- */
69
- private _enableManualDecorators;
70
- /**
71
- * Attaches handlers for {@link module:engine/view/document~ViewDocument#event:enter} and
72
- * {@link module:engine/view/document~ViewDocument#event:click} to enable link following.
73
- */
74
- private _enableLinkOpen;
75
- /**
76
- * Watches the ModelDocumentSelection attribute changes and removes link decorator attributes when the linkHref attribute is removed.
77
- *
78
- * This is to ensure that there is no left-over link decorator attributes on the document selection that is no longer in a link.
79
- */
80
- private _enableSelectionAttributesFixer;
81
- /**
82
- * Enables URL fixing on pasting.
83
- */
84
- private _enableClipboardIntegration;
85
- /**
86
- * Registers a postfixer that resolves conflicting decorator attributes on elements.
87
- */
88
- private _enableDecoratorConflictPostfixer;
19
+ /**
20
+ * A list of functions that handles opening links. If any of them returns `true`, the link is considered to be opened.
21
+ */
22
+ private readonly _linkOpeners;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName(): "LinkEditing";
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static override get isOfficialPlugin(): true;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires(): PluginDependenciesOf<[TwoStepCaretMovement, Input, ClipboardPipeline]>;
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ constructor(editor: Editor);
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ init(): void;
43
+ /**
44
+ * Registers a function that opens links in a new browser tab.
45
+ *
46
+ * @param linkOpener The function that opens a link in a new browser tab.
47
+ * @internal
48
+ */
49
+ _registerLinkOpener(linkOpener: LinkOpener): void;
50
+ /**
51
+ * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}
52
+ * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
53
+ * for each one of them. Downcast dispatchers are obtained using the
54
+ * {@link module:link/utils/automaticdecorators~AutomaticLinkDecorators#getDispatcher} method.
55
+ *
56
+ * **Note**: This method also activates the automatic external link decorator if enabled with
57
+ * {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
58
+ */
59
+ private _enableAutomaticDecorators;
60
+ /**
61
+ * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},
62
+ * transforms them into {@link module:link/utils/manualdecorator~LinkManualDecorator} instances and stores them in the
63
+ * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
64
+ *
65
+ * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
66
+ * converter for each manual decorator and extends the {@link module:engine/model/schema~ModelSchema model's schema}
67
+ * with adequate model attributes.
68
+ */
69
+ private _enableManualDecorators;
70
+ /**
71
+ * Attaches handlers for {@link module:engine/view/document~ViewDocument#event:enter} and
72
+ * {@link module:engine/view/document~ViewDocument#event:click} to enable link following.
73
+ */
74
+ private _enableLinkOpen;
75
+ /**
76
+ * Watches the ModelDocumentSelection attribute changes and removes link decorator attributes when the linkHref attribute is removed.
77
+ *
78
+ * This is to ensure that there is no left-over link decorator attributes on the document selection that is no longer in a link.
79
+ */
80
+ private _enableSelectionAttributesFixer;
81
+ /**
82
+ * Enables URL fixing on pasting.
83
+ */
84
+ private _enableClipboardIntegration;
85
+ /**
86
+ * Registers a postfixer that resolves conflicting decorator attributes on elements.
87
+ */
88
+ private _enableDecoratorConflictPostfixer;
89
89
  }
90
90
  /**
91
- * A function that handles opening links. It may be used to define custom link handlers.
92
- *
93
- * @returns `true` if the link was opened successfully.
94
- */
91
+ * A function that handles opening links. It may be used to define custom link handlers.
92
+ *
93
+ * @returns `true` if the link was opened successfully.
94
+ */
95
95
  type LinkOpener = (url: string) => boolean;
96
96
  export {};
@@ -1,31 +1,31 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module link/linkimage
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { LinkImageEditing } from './linkimageediting.js';
10
- import { LinkImageUI } from './linkimageui.js';
11
- import '../theme/linkimage.css';
6
+ * @module link/linkimage
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { LinkImageEditing } from "./linkimageediting.js";
10
+ import { LinkImageUI } from "./linkimageui.js";
11
+ import "../theme/linkimage.css";
12
12
  /**
13
- * The `LinkImage` plugin.
14
- *
15
- * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
16
- * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
17
- */
13
+ * The `LinkImage` plugin.
14
+ *
15
+ * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
16
+ * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
17
+ */
18
18
  export declare class LinkImage extends Plugin {
19
- /**
20
- * @inheritDoc
21
- */
22
- static get requires(): readonly [typeof LinkImageEditing, typeof LinkImageUI];
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName(): "LinkImage";
27
- /**
28
- * @inheritDoc
29
- */
30
- static get isOfficialPlugin(): true;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ static get requires(): PluginDependenciesOf<[LinkImageEditing, LinkImageUI]>;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName(): "LinkImage";
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static override get isOfficialPlugin(): true;
31
31
  }
@@ -1,44 +1,44 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module link/linkimageediting
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { LinkEditing } from './linkediting.js';
10
- import { ImageEditing, ImageUtils } from '@ckeditor/ckeditor5-image';
6
+ * @module link/linkimageediting
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { LinkEditing } from "./linkediting.js";
10
+ import { ImageEditing, ImageUtils } from "@ckeditor/ckeditor5-image";
11
11
  /**
12
- * The link image engine feature.
13
- *
14
- * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<imageBlock>`} element
15
- * which allows linking images.
16
- */
12
+ * The link image engine feature.
13
+ *
14
+ * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<imageBlock>`} element
15
+ * which allows linking images.
16
+ */
17
17
  export declare class LinkImageEditing extends Plugin {
18
- /**
19
- * @inheritDoc
20
- */
21
- static get requires(): readonly [typeof ImageEditing, typeof ImageUtils, typeof LinkEditing];
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "LinkImageEditing";
26
- /**
27
- * @inheritDoc
28
- */
29
- static get isOfficialPlugin(): true;
30
- /**
31
- * @inheritDoc
32
- */
33
- afterInit(): void;
34
- /**
35
- * Processes {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
36
- * attaches proper converters that will work when linking an image.`
37
- */
38
- private _enableAutomaticDecorators;
39
- /**
40
- * Processes transformed {@link module:link/utils/manualdecorator~LinkManualDecorator} instances and attaches proper converters
41
- * that will work when linking an image.
42
- */
43
- private _enableManualDecorators;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get requires(): PluginDependenciesOf<[ImageEditing, ImageUtils, LinkEditing]>;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "LinkImageEditing";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static override get isOfficialPlugin(): true;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ afterInit(): void;
34
+ /**
35
+ * Processes {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
36
+ * attaches proper converters that will work when linking an image.`
37
+ */
38
+ private _enableAutomaticDecorators;
39
+ /**
40
+ * Processes transformed {@link module:link/utils/manualdecorator~LinkManualDecorator} instances and attaches proper converters
41
+ * that will work when linking an image.
42
+ */
43
+ private _enableManualDecorators;
44
44
  }
@@ -1,45 +1,45 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { Plugin } from '@ckeditor/ckeditor5-core';
6
- import { ImageBlockEditing } from '@ckeditor/ckeditor5-image';
7
- import { LinkUI } from './linkui.js';
8
- import { LinkEditing } from './linkediting.js';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
6
+ import { ImageBlockEditing } from "@ckeditor/ckeditor5-image";
7
+ import { LinkUI } from "./linkui.js";
8
+ import { LinkEditing } from "./linkediting.js";
9
9
  /**
10
- * The link image UI plugin.
11
- *
12
- * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
13
- * It can be used to wrap images in links.
14
- */
10
+ * The link image UI plugin.
11
+ *
12
+ * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
13
+ * It can be used to wrap images in links.
14
+ */
15
15
  export declare class LinkImageUI extends Plugin {
16
- /**
17
- * @inheritDoc
18
- */
19
- static get requires(): readonly [typeof LinkEditing, typeof LinkUI, typeof ImageBlockEditing];
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "LinkImageUI";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- init(): void;
32
- /**
33
- * Creates a `LinkImageUI` button view.
34
- *
35
- * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
36
- * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#toolbarView} or
37
- * {@link module:link/linkui~LinkUI#formView} if it is not.
38
- */
39
- private _createToolbarLinkImageButton;
40
- /**
41
- * Returns true if a linked image (either block or inline) is the only selected element
42
- * in the model document.
43
- */
44
- private _isSelectedLinkedImage;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get requires(): PluginDependenciesOf<[LinkEditing, LinkUI, ImageBlockEditing]>;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get pluginName(): "LinkImageUI";
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static override get isOfficialPlugin(): true;
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ init(): void;
32
+ /**
33
+ * Creates a `LinkImageUI` button view.
34
+ *
35
+ * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
36
+ * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#toolbarView} or
37
+ * {@link module:link/linkui~LinkUI#formView} if it is not.
38
+ */
39
+ private _createToolbarLinkImageButton;
40
+ /**
41
+ * Returns true if a linked image (either block or inline) is the only selected element
42
+ * in the model document.
43
+ */
44
+ private _isSelectedLinkedImage;
45
45
  }