@ckeditor/ckeditor5-widget 41.3.1 → 41.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. package/dist/index-content.css +4 -0
  2. package/dist/index-editor.css +144 -0
  3. package/dist/index.css +257 -0
  4. package/dist/index.css.map +1 -0
  5. package/dist/index.js +2881 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/translations/ar.d.ts +8 -0
  8. package/dist/translations/ar.js +5 -0
  9. package/dist/translations/ar.umd.js +11 -0
  10. package/dist/translations/az.d.ts +8 -0
  11. package/dist/translations/az.js +5 -0
  12. package/dist/translations/az.umd.js +11 -0
  13. package/dist/translations/bg.d.ts +8 -0
  14. package/dist/translations/bg.js +5 -0
  15. package/dist/translations/bg.umd.js +11 -0
  16. package/dist/translations/bn.d.ts +8 -0
  17. package/dist/translations/bn.js +5 -0
  18. package/dist/translations/bn.umd.js +11 -0
  19. package/dist/translations/ca.d.ts +8 -0
  20. package/dist/translations/ca.js +5 -0
  21. package/dist/translations/ca.umd.js +11 -0
  22. package/dist/translations/cs.d.ts +8 -0
  23. package/dist/translations/cs.js +5 -0
  24. package/dist/translations/cs.umd.js +11 -0
  25. package/dist/translations/da.d.ts +8 -0
  26. package/dist/translations/da.js +5 -0
  27. package/dist/translations/da.umd.js +11 -0
  28. package/dist/translations/de-ch.d.ts +8 -0
  29. package/dist/translations/de-ch.js +5 -0
  30. package/dist/translations/de-ch.umd.js +11 -0
  31. package/dist/translations/de.d.ts +8 -0
  32. package/dist/translations/de.js +5 -0
  33. package/dist/translations/de.umd.js +11 -0
  34. package/dist/translations/el.d.ts +8 -0
  35. package/dist/translations/el.js +5 -0
  36. package/dist/translations/el.umd.js +11 -0
  37. package/dist/translations/en-au.d.ts +8 -0
  38. package/dist/translations/en-au.js +5 -0
  39. package/dist/translations/en-au.umd.js +11 -0
  40. package/dist/translations/en.d.ts +8 -0
  41. package/dist/translations/en.js +5 -0
  42. package/dist/translations/en.umd.js +11 -0
  43. package/dist/translations/es.d.ts +8 -0
  44. package/dist/translations/es.js +5 -0
  45. package/dist/translations/es.umd.js +11 -0
  46. package/dist/translations/et.d.ts +8 -0
  47. package/dist/translations/et.js +5 -0
  48. package/dist/translations/et.umd.js +11 -0
  49. package/dist/translations/fa.d.ts +8 -0
  50. package/dist/translations/fa.js +5 -0
  51. package/dist/translations/fa.umd.js +11 -0
  52. package/dist/translations/fi.d.ts +8 -0
  53. package/dist/translations/fi.js +5 -0
  54. package/dist/translations/fi.umd.js +11 -0
  55. package/dist/translations/fr.d.ts +8 -0
  56. package/dist/translations/fr.js +5 -0
  57. package/dist/translations/fr.umd.js +11 -0
  58. package/dist/translations/gl.d.ts +8 -0
  59. package/dist/translations/gl.js +5 -0
  60. package/dist/translations/gl.umd.js +11 -0
  61. package/dist/translations/he.d.ts +8 -0
  62. package/dist/translations/he.js +5 -0
  63. package/dist/translations/he.umd.js +11 -0
  64. package/dist/translations/hi.d.ts +8 -0
  65. package/dist/translations/hi.js +5 -0
  66. package/dist/translations/hi.umd.js +11 -0
  67. package/dist/translations/hr.d.ts +8 -0
  68. package/dist/translations/hr.js +5 -0
  69. package/dist/translations/hr.umd.js +11 -0
  70. package/dist/translations/hu.d.ts +8 -0
  71. package/dist/translations/hu.js +5 -0
  72. package/dist/translations/hu.umd.js +11 -0
  73. package/dist/translations/id.d.ts +8 -0
  74. package/dist/translations/id.js +5 -0
  75. package/dist/translations/id.umd.js +11 -0
  76. package/dist/translations/it.d.ts +8 -0
  77. package/dist/translations/it.js +5 -0
  78. package/dist/translations/it.umd.js +11 -0
  79. package/dist/translations/ja.d.ts +8 -0
  80. package/dist/translations/ja.js +5 -0
  81. package/dist/translations/ja.umd.js +11 -0
  82. package/dist/translations/ko.d.ts +8 -0
  83. package/dist/translations/ko.js +5 -0
  84. package/dist/translations/ko.umd.js +11 -0
  85. package/dist/translations/ku.d.ts +8 -0
  86. package/dist/translations/ku.js +5 -0
  87. package/dist/translations/ku.umd.js +11 -0
  88. package/dist/translations/lt.d.ts +8 -0
  89. package/dist/translations/lt.js +5 -0
  90. package/dist/translations/lt.umd.js +11 -0
  91. package/dist/translations/lv.d.ts +8 -0
  92. package/dist/translations/lv.js +5 -0
  93. package/dist/translations/lv.umd.js +11 -0
  94. package/dist/translations/ms.d.ts +8 -0
  95. package/dist/translations/ms.js +5 -0
  96. package/dist/translations/ms.umd.js +11 -0
  97. package/dist/translations/nl.d.ts +8 -0
  98. package/dist/translations/nl.js +5 -0
  99. package/dist/translations/nl.umd.js +11 -0
  100. package/dist/translations/no.d.ts +8 -0
  101. package/dist/translations/no.js +5 -0
  102. package/dist/translations/no.umd.js +11 -0
  103. package/dist/translations/pl.d.ts +8 -0
  104. package/dist/translations/pl.js +5 -0
  105. package/dist/translations/pl.umd.js +11 -0
  106. package/dist/translations/pt-br.d.ts +8 -0
  107. package/dist/translations/pt-br.js +5 -0
  108. package/dist/translations/pt-br.umd.js +11 -0
  109. package/dist/translations/pt.d.ts +8 -0
  110. package/dist/translations/pt.js +5 -0
  111. package/dist/translations/pt.umd.js +11 -0
  112. package/dist/translations/ro.d.ts +8 -0
  113. package/dist/translations/ro.js +5 -0
  114. package/dist/translations/ro.umd.js +11 -0
  115. package/dist/translations/ru.d.ts +8 -0
  116. package/dist/translations/ru.js +5 -0
  117. package/dist/translations/ru.umd.js +11 -0
  118. package/dist/translations/sk.d.ts +8 -0
  119. package/dist/translations/sk.js +5 -0
  120. package/dist/translations/sk.umd.js +11 -0
  121. package/dist/translations/sq.d.ts +8 -0
  122. package/dist/translations/sq.js +5 -0
  123. package/dist/translations/sq.umd.js +11 -0
  124. package/dist/translations/sr-latn.d.ts +8 -0
  125. package/dist/translations/sr-latn.js +5 -0
  126. package/dist/translations/sr-latn.umd.js +11 -0
  127. package/dist/translations/sr.d.ts +8 -0
  128. package/dist/translations/sr.js +5 -0
  129. package/dist/translations/sr.umd.js +11 -0
  130. package/dist/translations/sv.d.ts +8 -0
  131. package/dist/translations/sv.js +5 -0
  132. package/dist/translations/sv.umd.js +11 -0
  133. package/dist/translations/th.d.ts +8 -0
  134. package/dist/translations/th.js +5 -0
  135. package/dist/translations/th.umd.js +11 -0
  136. package/dist/translations/tk.d.ts +8 -0
  137. package/dist/translations/tk.js +5 -0
  138. package/dist/translations/tk.umd.js +11 -0
  139. package/dist/translations/tr.d.ts +8 -0
  140. package/dist/translations/tr.js +5 -0
  141. package/dist/translations/tr.umd.js +11 -0
  142. package/dist/translations/uk.d.ts +8 -0
  143. package/dist/translations/uk.js +5 -0
  144. package/dist/translations/uk.umd.js +11 -0
  145. package/dist/translations/ur.d.ts +8 -0
  146. package/dist/translations/ur.js +5 -0
  147. package/dist/translations/ur.umd.js +11 -0
  148. package/dist/translations/uz.d.ts +8 -0
  149. package/dist/translations/uz.js +5 -0
  150. package/dist/translations/uz.umd.js +11 -0
  151. package/dist/translations/vi.d.ts +8 -0
  152. package/dist/translations/vi.js +5 -0
  153. package/dist/translations/vi.umd.js +11 -0
  154. package/dist/translations/zh-cn.d.ts +8 -0
  155. package/dist/translations/zh-cn.js +5 -0
  156. package/dist/translations/zh-cn.umd.js +11 -0
  157. package/dist/translations/zh.d.ts +8 -0
  158. package/dist/translations/zh.js +5 -0
  159. package/dist/translations/zh.umd.js +11 -0
  160. package/dist/types/augmentation.d.ts +17 -0
  161. package/dist/types/highlightstack.d.ts +78 -0
  162. package/dist/types/index.d.ts +17 -0
  163. package/dist/types/utils.d.ts +219 -0
  164. package/dist/types/verticalnavigation.d.ts +19 -0
  165. package/dist/types/widget.d.ts +107 -0
  166. package/dist/types/widgetresize/resizer.d.ts +181 -0
  167. package/dist/types/widgetresize/resizerstate.d.ts +129 -0
  168. package/dist/types/widgetresize/sizeview.d.ts +59 -0
  169. package/dist/types/widgetresize.d.ts +129 -0
  170. package/dist/types/widgettoolbarrepository.d.ts +98 -0
  171. package/dist/types/widgettypearound/utils.d.ts +42 -0
  172. package/dist/types/widgettypearound/widgettypearound.d.ts +233 -0
  173. package/package.json +8 -7
  174. package/src/utils.d.ts +18 -1
  175. package/src/utils.js +49 -1
  176. package/src/widgetresize/resizerstate.js +2 -23
@@ -0,0 +1,129 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ import type { ResizerOptions } from '../widgetresize.js';
10
+ declare const ResizeState_base: {
11
+ new (): import("@ckeditor/ckeditor5-utils").Observable;
12
+ prototype: import("@ckeditor/ckeditor5-utils").Observable;
13
+ };
14
+ /**
15
+ * Stores the internal state of a single resizable object.
16
+ */
17
+ export default class ResizeState extends ResizeState_base {
18
+ /**
19
+ * The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
20
+ * if unknown.
21
+ *
22
+ * @readonly
23
+ * @observable
24
+ */
25
+ activeHandlePosition: string | null;
26
+ /**
27
+ * The width (percents) proposed, but not committed yet, in the current resize process.
28
+ *
29
+ * @readonly
30
+ * @observable
31
+ */
32
+ proposedWidthPercents: number | null;
33
+ /**
34
+ * The width (pixels) proposed, but not committed yet, in the current resize process.
35
+ *
36
+ * @readonly
37
+ * @observable
38
+ */
39
+ proposedWidth: number | null;
40
+ /**
41
+ * The height (pixels) proposed, but not committed yet, in the current resize process.
42
+ *
43
+ * @readonly
44
+ * @observable
45
+ */
46
+ proposedHeight: number | null;
47
+ /**
48
+ * @readonly
49
+ * @observable
50
+ */
51
+ proposedHandleHostWidth: number | null;
52
+ /**
53
+ * @readonly
54
+ * @observable
55
+ */
56
+ proposedHandleHostHeight: number | null;
57
+ /**
58
+ * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
59
+ * traveled, so how much the image should be enlarged.
60
+ * This information is only known after the DOM was rendered, so it will be updated later.
61
+ *
62
+ * @internal
63
+ */
64
+ _referenceCoordinates: {
65
+ x: number;
66
+ y: number;
67
+ } | null;
68
+ /**
69
+ * Resizer options.
70
+ */
71
+ private readonly _options;
72
+ /**
73
+ * The original width (pixels) of the resized object when the resize process was started.
74
+ *
75
+ * @readonly
76
+ */
77
+ private _originalWidth?;
78
+ /**
79
+ * The original height (pixels) of the resized object when the resize process was started.
80
+ *
81
+ * @readonly
82
+ */
83
+ private _originalHeight?;
84
+ /**
85
+ * The original width (percents) of the resized object when the resize process was started.
86
+ *
87
+ * @readonly
88
+ */
89
+ private _originalWidthPercents?;
90
+ /**
91
+ * A width to height ratio of the resized image.
92
+ *
93
+ * @readonly
94
+ */
95
+ private _aspectRatio?;
96
+ /**
97
+ * @param options Resizer options.
98
+ */
99
+ constructor(options: ResizerOptions);
100
+ /**
101
+ * The original width (pixels) of the resized object when the resize process was started.
102
+ */
103
+ get originalWidth(): number | undefined;
104
+ /**
105
+ * The original height (pixels) of the resized object when the resize process was started.
106
+ */
107
+ get originalHeight(): number | undefined;
108
+ /**
109
+ * The original width (percents) of the resized object when the resize process was started.
110
+ */
111
+ get originalWidthPercents(): number | undefined;
112
+ /**
113
+ * A width to height ratio of the resized image.
114
+ */
115
+ get aspectRatio(): number | undefined;
116
+ /**
117
+ *
118
+ * @param domResizeHandle The handle used to calculate the reference point.
119
+ */
120
+ begin(domResizeHandle: HTMLElement, domHandleHost: HTMLElement, domResizeHost: HTMLElement): void;
121
+ update(newSize: {
122
+ width: number;
123
+ height: number;
124
+ widthPercents: number;
125
+ handleHostWidth: number;
126
+ handleHostHeight: number;
127
+ }): void;
128
+ }
129
+ export {};
@@ -0,0 +1,59 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module widget/widgetresize/sizeview
11
+ */
12
+ import { View } from '@ckeditor/ckeditor5-ui';
13
+ import type { ResizerOptions } from '../widgetresize.js';
14
+ import type ResizeState from './resizerstate.js';
15
+ /**
16
+ * A view displaying the proposed new element size during the resizing.
17
+ */
18
+ export default class SizeView extends View {
19
+ /**
20
+ * The visibility of the view defined based on the existence of the host proposed dimensions.
21
+ *
22
+ * @internal
23
+ * @observable
24
+ * @readonly
25
+ */
26
+ _isVisible: boolean;
27
+ /**
28
+ * The text that will be displayed in the `SizeView` child.
29
+ * It can be formatted as the pixel values (e.g. 10x20) or the percentage value (e.g. 10%).
30
+ *
31
+ * @internal
32
+ * @observable
33
+ * @readonly
34
+ */
35
+ _label: string;
36
+ /**
37
+ * The position of the view defined based on the host size and active handle position.
38
+ *
39
+ * @internal
40
+ * @observable
41
+ * @readonly
42
+ */
43
+ _viewPosition: string;
44
+ constructor();
45
+ /**
46
+ * A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.
47
+ *
48
+ * @internal
49
+ * @param options An object defining the resizer options, used for setting the proper size label.
50
+ * @param resizeState The `ResizeState` class instance, used for keeping the `SizeView` state up to date.
51
+ */
52
+ _bindToState(options: ResizerOptions, resizeState: ResizeState): void;
53
+ /**
54
+ * A method used for cleaning up. It removes the bindings and hides the view.
55
+ *
56
+ * @internal
57
+ */
58
+ _dismiss(): void;
59
+ }
@@ -0,0 +1,129 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module widget/widgetresize
11
+ */
12
+ import Resizer from './widgetresize/resizer.js';
13
+ import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
14
+ import { type Element, type ViewContainerElement } from '@ckeditor/ckeditor5-engine';
15
+ import '../theme/widgetresize.css';
16
+ /**
17
+ * The widget resize feature plugin.
18
+ *
19
+ * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
20
+ */
21
+ export default class WidgetResize extends Plugin {
22
+ /**
23
+ * The currently selected resizer.
24
+ *
25
+ * @observable
26
+ */
27
+ selectedResizer: Resizer | null;
28
+ /**
29
+ * References an active resizer.
30
+ *
31
+ * Active resizer means a resizer which handle is actively used by the end user.
32
+ *
33
+ * @internal
34
+ * @observable
35
+ */
36
+ _activeResizer: Resizer | null;
37
+ /**
38
+ * A map of resizers created using this plugin instance.
39
+ */
40
+ private _resizers;
41
+ private _observer;
42
+ private _redrawSelectedResizerThrottled;
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ static get pluginName(): "WidgetResize";
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ init(): void;
51
+ /**
52
+ * Redraws the selected resizer if there is any selected resizer and if it is visible.
53
+ */
54
+ redrawSelectedResizer(): void;
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ destroy(): void;
59
+ /**
60
+ * Marks resizer as selected.
61
+ */
62
+ select(resizer: Resizer): void;
63
+ /**
64
+ * Deselects currently set resizer.
65
+ */
66
+ deselect(): void;
67
+ /**
68
+ * @param options Resizer options.
69
+ */
70
+ attachTo(options: ResizerOptions): Resizer;
71
+ /**
72
+ * Returns a resizer created for a given view element (widget element).
73
+ *
74
+ * @param viewElement View element associated with the resizer.
75
+ */
76
+ getResizerByViewElement(viewElement: ViewContainerElement): Resizer | undefined;
77
+ /**
78
+ * Returns a resizer that contains a given resize handle.
79
+ */
80
+ private _getResizerByHandle;
81
+ /**
82
+ * @param domEventData Native DOM event.
83
+ */
84
+ private _mouseDownListener;
85
+ /**
86
+ * @param domEventData Native DOM event.
87
+ */
88
+ private _mouseMoveListener;
89
+ private _mouseUpListener;
90
+ }
91
+ /**
92
+ * Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
93
+ */
94
+ export interface ResizerOptions {
95
+ /**
96
+ * Editor instance associated with the resizer.
97
+ */
98
+ editor: Editor;
99
+ modelElement: Element;
100
+ /**
101
+ * A view of an element to be resized. Typically it's the main widget's view instance.
102
+ */
103
+ viewElement: ViewContainerElement;
104
+ unit?: 'px' | '%';
105
+ /**
106
+ * A callback to be executed once the resizing process is done.
107
+ *
108
+ * It receives a `Number` (`newValue`) as a parameter.
109
+ *
110
+ * For example, {@link module:image/imageresize~ImageResize} uses it to execute the resize image command
111
+ * which puts the new value into the model.
112
+ *
113
+ * ```ts
114
+ * {
115
+ * editor,
116
+ * modelElement: data.item,
117
+ * viewElement: widget,
118
+ *
119
+ * onCommit( newValue ) {
120
+ * editor.execute( 'resizeImage', { width: newValue } );
121
+ * }
122
+ * };
123
+ * ```
124
+ */
125
+ onCommit: (newValue: string) => void;
126
+ getResizeHost: (widgetWrapper: HTMLElement) => HTMLElement;
127
+ getHandleHost: (widgetWrapper: HTMLElement) => HTMLElement;
128
+ isCentered?: (resizer: Resizer) => boolean;
129
+ }
@@ -0,0 +1,98 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module widget/widgettoolbarrepository
11
+ */
12
+ import { Plugin, type ToolbarConfigItem } from '@ckeditor/ckeditor5-core';
13
+ import type { ViewDocumentSelection, ViewElement } from '@ckeditor/ckeditor5-engine';
14
+ import { ContextualBalloon } from '@ckeditor/ckeditor5-ui';
15
+ /**
16
+ * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
17
+ * toolbar rendering process and exposes a concise API.
18
+ *
19
+ * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
20
+ *
21
+ * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
22
+ *
23
+ * ```ts
24
+ * class ImageToolbar extends Plugin {
25
+ * static get requires() {
26
+ * return [ WidgetToolbarRepository ];
27
+ * }
28
+ *
29
+ * afterInit() {
30
+ * const editor = this.editor;
31
+ * const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
32
+ *
33
+ * widgetToolbarRepository.register( 'image', {
34
+ * items: editor.config.get( 'image.toolbar' ),
35
+ * getRelatedElement: getClosestSelectedImageWidget
36
+ * } );
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ export default class WidgetToolbarRepository extends Plugin {
42
+ /**
43
+ * A map of toolbar definitions.
44
+ */
45
+ private _toolbarDefinitions;
46
+ private _balloon;
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ static get requires(): readonly [typeof ContextualBalloon];
51
+ /**
52
+ * @inheritDoc
53
+ */
54
+ static get pluginName(): "WidgetToolbarRepository";
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ init(): void;
59
+ destroy(): void;
60
+ /**
61
+ * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
62
+ * `getRelatedElement` function. Toolbar items are gathered from `items` array.
63
+ * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
64
+ *
65
+ * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
66
+ * callback (or later) to make sure that the given toolbar items were already registered by other plugins.
67
+ *
68
+ * @param toolbarId An id for the toolbar. Used to
69
+ * @param options.ariaLabel Label used by assistive technologies to describe this toolbar element.
70
+ * @param options.items Array of toolbar items.
71
+ * @param options.getRelatedElement Callback which returns an element the toolbar should be attached to.
72
+ * @param options.balloonClassName CSS class for the widget balloon.
73
+ */
74
+ register(toolbarId: string, { ariaLabel, items, getRelatedElement, balloonClassName }: {
75
+ ariaLabel?: string;
76
+ items: Array<ToolbarConfigItem>;
77
+ getRelatedElement: (selection: ViewDocumentSelection) => (ViewElement | null);
78
+ balloonClassName?: string;
79
+ }): void;
80
+ /**
81
+ * Iterates over stored toolbars and makes them visible or hidden.
82
+ */
83
+ private _updateToolbarsVisibility;
84
+ /**
85
+ * Hides the given toolbar.
86
+ */
87
+ private _hideToolbar;
88
+ /**
89
+ * Shows up the toolbar if the toolbar is not visible.
90
+ * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
91
+ *
92
+ * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
93
+ * should be still visible after the {@link module:ui/editorui/editorui~EditorUI#event:update}.
94
+ */
95
+ private _showToolbar;
96
+ private _isToolbarVisible;
97
+ private _isToolbarInBalloon;
98
+ }
@@ -0,0 +1,42 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ import type { DocumentSelection, DomConverter, Element, Schema, Selection, ViewElement } from '@ckeditor/ckeditor5-engine';
10
+ /**
11
+ * The name of the type around model selection attribute responsible for
12
+ * displaying a fake caret next to a selected widget.
13
+ */
14
+ export declare const TYPE_AROUND_SELECTION_ATTRIBUTE = "widget-type-around";
15
+ /**
16
+ * Checks if an element is a widget that qualifies to get the widget type around UI.
17
+ */
18
+ export declare function isTypeAroundWidget(viewElement: ViewElement | undefined, modelElement: Element, schema: Schema): boolean;
19
+ /**
20
+ * For the passed HTML element, this helper finds the closest widget type around button ancestor.
21
+ */
22
+ export declare function getClosestTypeAroundDomButton(domElement: HTMLElement): HTMLElement | null;
23
+ /**
24
+ * For the passed widget type around button element, this helper determines at which position
25
+ * the paragraph would be inserted into the content if, for instance, the button was
26
+ * clicked by the user.
27
+ *
28
+ * @returns The position of the button.
29
+ */
30
+ export declare function getTypeAroundButtonPosition(domElement: HTMLElement): 'before' | 'after';
31
+ /**
32
+ * For the passed HTML element, this helper returns the closest view widget ancestor.
33
+ */
34
+ export declare function getClosestWidgetViewElement(domElement: HTMLElement, domConverter: DomConverter): ViewElement;
35
+ /**
36
+ * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
37
+ *
38
+ * **Note**: If the fake caret is not currently displayed, `null` is returned.
39
+ *
40
+ * @returns The position of the fake caret or `null` when none is present.
41
+ */
42
+ export declare function getTypeAroundFakeCaretPosition(selection: Selection | DocumentSelection): 'before' | 'after' | null;