1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
9 | import { Clipboard } from 'ckeditor5/src/clipboard.js';
|
10 | import { Undo } from 'ckeditor5/src/undo.js';
|
11 | import { Delete } from 'ckeditor5/src/typing.js';
|
12 | import ImageUtils from './imageutils.js';
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export default class AutoImage extends Plugin {
|
18 | |
19 |
|
20 |
|
21 | static get requires(): readonly [typeof Clipboard, typeof ImageUtils, typeof Undo, typeof Delete];
|
22 | |
23 |
|
24 |
|
25 | static get pluginName(): "AutoImage";
|
26 | |
27 |
|
28 |
|
29 |
|
30 | private _timeoutId;
|
31 | |
32 |
|
33 |
|
34 |
|
35 | private _positionToInsert;
|
36 | |
37 |
|
38 |
|
39 | constructor(editor: Editor);
|
40 | /**
|
41 | * @inheritDoc
|
42 | */
|
43 | init(): void;
|
44 | /**
|
45 | * Analyzes the part of the document between provided positions in search for a URL representing an image.
|
46 | * When the URL is found, it is automatically converted into an image.
|
47 | *
|
48 | * @param leftPosition Left position of the selection.
|
49 | * @param rightPosition Right position of the selection.
|
50 | */
|
51 | private _embedImageBetweenPositions;
|
52 | }
|