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