@ckeditor/ckeditor5-link 48.2.0-alpha.7 → 48.3.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/dist/augmentation.d.ts +28 -28
- package/dist/autolink.d.ts +74 -74
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +3014 -3524
- package/dist/index.js.map +1 -1
- package/dist/link.d.ts +26 -26
- package/dist/linkcommand.d.ts +134 -134
- package/dist/linkconfig.d.ts +313 -313
- package/dist/linkediting.d.ts +88 -88
- package/dist/linkimage.d.ts +26 -26
- package/dist/linkimageediting.d.ts +39 -39
- package/dist/linkimageui.d.ts +41 -41
- package/dist/linkui.d.ts +350 -350
- package/dist/ui/linkbuttonview.d.ts +27 -27
- package/dist/ui/linkformview.d.ts +141 -141
- package/dist/ui/linkpreviewbuttonview.d.ts +27 -27
- package/dist/ui/linkpropertiesview.d.ts +80 -80
- package/dist/ui/linkprovideritemsview.d.ts +106 -106
- package/dist/unlinkcommand.d.ts +26 -26
- package/dist/utils/automaticdecorators.d.ts +54 -54
- package/dist/utils/conflictingdecorators.d.ts +32 -32
- package/dist/utils/manualdecorator.d.ts +59 -62
- package/dist/utils.d.ts +62 -62
- package/package.json +11 -11
package/dist/linkediting.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin, type Editor } from
|
|
9
|
-
import { Input, TwoStepCaretMovement } from
|
|
10
|
-
import { ClipboardPipeline } from
|
|
11
|
-
import
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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 {};
|
package/dist/linkimage.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { LinkImageEditing } from
|
|
10
|
-
import { LinkImageUI } from
|
|
11
|
-
import
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { LinkEditing } from
|
|
10
|
-
import { ImageEditing, ImageUtils } from
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
}
|
package/dist/linkimageui.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin } from
|
|
6
|
-
import { ImageBlockEditing } from
|
|
7
|
-
import { LinkUI } from
|
|
8
|
-
import { LinkEditing } from
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
}
|