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 | import { Plugin } from 'ckeditor5/src/core.js';
|
6 | import LinkUI from './linkui.js';
|
7 | import LinkEditing from './linkediting.js';
|
8 | /**
|
9 | * The link image UI plugin.
|
10 | *
|
11 | * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
|
12 | * It can be used to wrap images in links.
|
13 | */
|
14 | export default class LinkImageUI extends Plugin {
|
15 | /**
|
16 | * @inheritDoc
|
17 | */
|
18 | static get requires(): readonly [typeof LinkEditing, typeof LinkUI, "ImageBlockEditing"];
|
19 | /**
|
20 | * @inheritDoc
|
21 | */
|
22 | static get pluginName(): "LinkImageUI";
|
23 | /**
|
24 | * @inheritDoc
|
25 | */
|
26 | init(): void;
|
27 | /**
|
28 | * Creates a `LinkImageUI` button view.
|
29 | *
|
30 | * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
|
31 | * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or
|
32 | * {@link module:link/linkui~LinkUI#formView} if it is not.
|
33 | */
|
34 | private _createToolbarLinkImageButton;
|
35 | /**
|
36 | * Returns true if a linked image (either block or inline) is the only selected element
|
37 | * in the model document.
|
38 | */
|
39 | private _isSelectedLinkedImage;
|
40 | }
|