1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
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 | import '../theme/link.css';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export default class LinkEditing extends Plugin {
|
19 | |
20 |
|
21 |
|
22 | static get pluginName(): "LinkEditing";
|
23 | |
24 |
|
25 |
|
26 | static get requires(): readonly [typeof TwoStepCaretMovement, typeof Input, typeof ClipboardPipeline];
|
27 | |
28 |
|
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 | * Watches the DocumentSelection attribute changes and removes link decorator attributes when the linkHref attribute is removed.
|
62 | *
|
63 | * This is to ensure that there is no left-over link decorator attributes on the document selection that is no longer in a link.
|
64 | */
|
65 | private _enableSelectionAttributesFixer;
|
66 | /**
|
67 | * Enables URL fixing on pasting.
|
68 | */
|
69 | private _enableClipboardIntegration;
|
70 | }
|