1 | /**
|
2 | * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4 | */
|
5 | /**
|
6 | * @module image/imageresize/imagecustomresizeui
|
7 | */
|
8 | import { Plugin } from 'ckeditor5/src/core.js';
|
9 | import { ContextualBalloon } from 'ckeditor5/src/ui.js';
|
10 | /**
|
11 | * The custom resize image UI plugin.
|
12 | *
|
13 | * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
|
14 | */
|
15 | export default class ImageCustomResizeUI extends Plugin {
|
16 | /**
|
17 | * The contextual balloon plugin instance.
|
18 | */
|
19 | private _balloon?;
|
20 | /**
|
21 | * A form containing a textarea and buttons, used to change the `alt` text value.
|
22 | */
|
23 | private _form?;
|
24 | /**
|
25 | * @inheritDoc
|
26 | */
|
27 | static get requires(): readonly [typeof ContextualBalloon];
|
28 | /**
|
29 | * @inheritDoc
|
30 | */
|
31 | static get pluginName(): "ImageCustomResizeUI";
|
32 | /**
|
33 | * @inheritDoc
|
34 | */
|
35 | destroy(): void;
|
36 | /**
|
37 | * Creates the {@link module:image/imageresize/ui/imagecustomresizeformview~ImageCustomResizeFormView}
|
38 | * form.
|
39 | */
|
40 | private _createForm;
|
41 | /**
|
42 | * Shows the {@link #_form} in the {@link #_balloon}.
|
43 | *
|
44 | * @internal
|
45 | */
|
46 | _showForm(unit: string): void;
|
47 | /**
|
48 | * Removes the {@link #_form} from the {@link #_balloon}.
|
49 | *
|
50 | * @param focusEditable Controls whether the editing view is focused afterwards.
|
51 | */
|
52 | private _hideForm;
|
53 | /**
|
54 | * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
|
55 | */
|
56 | private get _isVisible();
|
57 | /**
|
58 | * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
|
59 | */
|
60 | private get _isInBalloon();
|
61 | }
|