@ckeditor/ckeditor5-clipboard 48.2.0 → 48.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,318 +1,318 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { ViewDataTransfer, DomEventObserver, type ViewDocumentDomEventData, type EditingView, type ViewDocumentFragment, type ViewElement, type ViewRange } from '@ckeditor/ckeditor5-engine';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { ViewDataTransfer, DomEventObserver, type ViewDocumentDomEventData, type EditingView, type ViewDocumentFragment, type ViewElement, type ViewRange } from "@ckeditor/ckeditor5-engine";
6
6
  /**
7
- * Clipboard events observer.
8
- *
9
- * Fires the following events:
10
- *
11
- * * {@link module:engine/view/document~ViewDocument#event:clipboardInput},
12
- * * {@link module:engine/view/document~ViewDocument#event:paste},
13
- * * {@link module:engine/view/document~ViewDocument#event:copy},
14
- * * {@link module:engine/view/document~ViewDocument#event:cut},
15
- * * {@link module:engine/view/document~ViewDocument#event:drop},
16
- * * {@link module:engine/view/document~ViewDocument#event:dragover},
17
- * * {@link module:engine/view/document~ViewDocument#event:dragging},
18
- * * {@link module:engine/view/document~ViewDocument#event:dragstart},
19
- * * {@link module:engine/view/document~ViewDocument#event:dragend},
20
- * * {@link module:engine/view/document~ViewDocument#event:dragenter},
21
- * * {@link module:engine/view/document~ViewDocument#event:dragleave}.
22
- *
23
- * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).
24
- * To make it available, it needs to be added to {@link module:engine/view/document~ViewDocument} by using
25
- * the {@link module:engine/view/view~EditingView#addObserver `View#addObserver()`} method. Alternatively, you can load the
26
- * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
27
- */
28
- export declare class ClipboardObserver extends DomEventObserver<'paste' | 'copy' | 'cut' | 'drop' | 'dragover' | 'dragstart' | 'dragend' | 'dragenter' | 'dragleave', ClipboardEventData> {
29
- readonly domEventType: readonly ["paste", "copy", "cut", "drop", "dragover", "dragstart", "dragend", "dragenter", "dragleave"];
30
- constructor(view: EditingView);
31
- onDomEvent(domEvent: ClipboardEvent | DragEvent): void;
7
+ * Clipboard events observer.
8
+ *
9
+ * Fires the following events:
10
+ *
11
+ * * {@link module:engine/view/document~ViewDocument#event:clipboardInput},
12
+ * * {@link module:engine/view/document~ViewDocument#event:paste},
13
+ * * {@link module:engine/view/document~ViewDocument#event:copy},
14
+ * * {@link module:engine/view/document~ViewDocument#event:cut},
15
+ * * {@link module:engine/view/document~ViewDocument#event:drop},
16
+ * * {@link module:engine/view/document~ViewDocument#event:dragover},
17
+ * * {@link module:engine/view/document~ViewDocument#event:dragging},
18
+ * * {@link module:engine/view/document~ViewDocument#event:dragstart},
19
+ * * {@link module:engine/view/document~ViewDocument#event:dragend},
20
+ * * {@link module:engine/view/document~ViewDocument#event:dragenter},
21
+ * * {@link module:engine/view/document~ViewDocument#event:dragleave}.
22
+ *
23
+ * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).
24
+ * To make it available, it needs to be added to {@link module:engine/view/document~ViewDocument} by using
25
+ * the {@link module:engine/view/view~EditingView#addObserver `View#addObserver()`} method. Alternatively, you can load the
26
+ * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
27
+ */
28
+ export declare class ClipboardObserver extends DomEventObserver<"paste" | "copy" | "cut" | "drop" | "dragover" | "dragstart" | "dragend" | "dragenter" | "dragleave", ClipboardEventData> {
29
+ readonly domEventType: readonly ["paste", "copy", "cut", "drop", "dragover", "dragstart", "dragend", "dragenter", "dragleave"];
30
+ constructor(view: EditingView);
31
+ onDomEvent(domEvent: ClipboardEvent | DragEvent): void;
32
32
  }
33
33
  /**
34
- * The data of 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter' and 'dragleave' events.
35
- */
34
+ * The data of 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter' and 'dragleave' events.
35
+ */
36
36
  export interface ClipboardEventData {
37
- /**
38
- * The data transfer instance.
39
- */
40
- dataTransfer: ViewDataTransfer;
41
- /**
42
- * The position into which the content is dropped.
43
- */
44
- dropRange?: ViewRange | null;
37
+ /**
38
+ * The data transfer instance.
39
+ */
40
+ dataTransfer: ViewDataTransfer;
41
+ /**
42
+ * The position into which the content is dropped.
43
+ */
44
+ dropRange?: ViewRange | null;
45
45
  }
46
46
  /**
47
- * Fired as a continuation of the {@link module:engine/view/document~ViewDocument#event:paste} and
48
- * {@link module:engine/view/document~ViewDocument#event:drop} events.
49
- *
50
- * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
51
- *
52
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
53
- * and inserted into the editor.
54
- *
55
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
56
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
57
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
58
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
59
- *
60
- * @see module:clipboard/clipboardobserver~ClipboardObserver
61
- * @see module:clipboard/clipboard~Clipboard
62
- *
63
- * @eventName module:engine/view/document~ViewDocument#clipboardInput
64
- * @param data The event data.
65
- */
47
+ * Fired as a continuation of the {@link module:engine/view/document~ViewDocument#event:paste} and
48
+ * {@link module:engine/view/document~ViewDocument#event:drop} events.
49
+ *
50
+ * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
51
+ *
52
+ * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
53
+ * and inserted into the editor.
54
+ *
55
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
56
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
57
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
58
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
59
+ *
60
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
61
+ * @see module:clipboard/clipboard~Clipboard
62
+ *
63
+ * @eventName module:engine/view/document~ViewDocument#clipboardInput
64
+ * @param data The event data.
65
+ */
66
66
  export type ViewDocumentClipboardInputEvent = {
67
- name: 'clipboardInput';
68
- args: [data: ViewDocumentDomEventData<ClipboardEvent | DragEvent> & ClipboardInputEventData];
67
+ name: "clipboardInput";
68
+ args: [data: ViewDocumentDomEventData<ClipboardEvent | DragEvent> & ClipboardInputEventData];
69
69
  };
70
70
  /**
71
- * The value of the {@link module:engine/view/document~ViewDocument#event:paste},
72
- * {@link module:engine/view/document~ViewDocument#event:copy} and {@link module:engine/view/document~ViewDocument#event:cut} events.
73
- *
74
- * In order to access the clipboard data, use the `dataTransfer` property.
75
- */
71
+ * The value of the {@link module:engine/view/document~ViewDocument#event:paste},
72
+ * {@link module:engine/view/document~ViewDocument#event:copy} and {@link module:engine/view/document~ViewDocument#event:cut} events.
73
+ *
74
+ * In order to access the clipboard data, use the `dataTransfer` property.
75
+ */
76
76
  export interface ClipboardInputEventData {
77
- /**
78
- * Data transfer instance.
79
- */
80
- dataTransfer: ViewDataTransfer;
81
- /**
82
- * Whether the event was triggered by a paste or a drop operation.
83
- */
84
- method: 'paste' | 'drop';
85
- /**
86
- * The tree view element representing the target.
87
- */
88
- target: ViewElement;
89
- /**
90
- * The ranges which are the target of the operation (usually – into which the content should be inserted).
91
- * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
92
- * then it is the drop position (which can be different than the selection at the moment of the drop).
93
- */
94
- targetRanges: Array<ViewRange> | null;
95
- /**
96
- * The content of clipboard input. Defaults to `text/html`. Falls-back to `text/plain`.
97
- */
98
- content: string | ViewDocumentFragment;
99
- /**
100
- * Custom data stored by the `clipboardInput` event handlers. Custom properties of this object can be defined and use to
101
- * pass parameters between listeners. Content of this property is passed to the `inputTransformation` event.
102
- */
103
- extraContent?: unknown;
77
+ /**
78
+ * Data transfer instance.
79
+ */
80
+ dataTransfer: ViewDataTransfer;
81
+ /**
82
+ * Whether the event was triggered by a paste or a drop operation.
83
+ */
84
+ method: "paste" | "drop";
85
+ /**
86
+ * The tree view element representing the target.
87
+ */
88
+ target: ViewElement;
89
+ /**
90
+ * The ranges which are the target of the operation (usually – into which the content should be inserted).
91
+ * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
92
+ * then it is the drop position (which can be different than the selection at the moment of the drop).
93
+ */
94
+ targetRanges: Array<ViewRange> | null;
95
+ /**
96
+ * The content of clipboard input. Defaults to `text/html`. Falls-back to `text/plain`.
97
+ */
98
+ content: string | ViewDocumentFragment;
99
+ /**
100
+ * Custom data stored by the `clipboardInput` event handlers. Custom properties of this object can be defined and use to
101
+ * pass parameters between listeners. Content of this property is passed to the `inputTransformation` event.
102
+ */
103
+ extraContent?: unknown;
104
104
  }
105
105
  /**
106
- * Fired when the user drags the content over one of the editing roots of the editor.
107
- *
108
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
109
- *
110
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
111
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
112
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
113
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
114
- *
115
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
116
- *
117
- * @eventName module:engine/view/document~ViewDocument#dragover
118
- * @param data The event data.
119
- */
106
+ * Fired when the user drags the content over one of the editing roots of the editor.
107
+ *
108
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
109
+ *
110
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
111
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
112
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
113
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
114
+ *
115
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
116
+ *
117
+ * @eventName module:engine/view/document~ViewDocument#dragover
118
+ * @param data The event data.
119
+ */
120
120
  export type ViewDocumentDragOverEvent = {
121
- name: 'dragover';
122
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
121
+ name: "dragover";
122
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
123
123
  };
124
124
  /**
125
- * Fired when the user dropped the content into one of the editing roots of the editor.
126
- *
127
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
128
- *
129
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
130
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
131
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
132
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
133
- *
134
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
135
- *
136
- * @eventName module:engine/view/document~ViewDocument#drop
137
- * @param data The event data.
138
- */
125
+ * Fired when the user dropped the content into one of the editing roots of the editor.
126
+ *
127
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
128
+ *
129
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
130
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
131
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
132
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
133
+ *
134
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
135
+ *
136
+ * @eventName module:engine/view/document~ViewDocument#drop
137
+ * @param data The event data.
138
+ */
139
139
  export type ViewDocumentDropEvent = {
140
- name: 'drop';
141
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
140
+ name: "drop";
141
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
142
142
  };
143
143
  /**
144
- * Fired when the user pasted the content into one of the editing roots of the editor.
145
- *
146
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
147
- *
148
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
149
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
150
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
151
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
152
- *
153
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
154
- *
155
- * @eventName module:engine/view/document~ViewDocument#paste
156
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
157
- */
144
+ * Fired when the user pasted the content into one of the editing roots of the editor.
145
+ *
146
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
147
+ *
148
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
149
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
150
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
151
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
152
+ *
153
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
154
+ *
155
+ * @eventName module:engine/view/document~ViewDocument#paste
156
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
157
+ */
158
158
  export type ViewDocumentPasteEvent = {
159
- name: 'paste';
160
- args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
159
+ name: "paste";
160
+ args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
161
161
  };
162
162
  /**
163
- * Fired when the user copied the content from one of the editing roots of the editor.
164
- *
165
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
166
- *
167
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
168
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
169
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
170
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
171
- *
172
- * @see module:clipboard/clipboardobserver~ClipboardObserver
173
- *
174
- * @eventName module:engine/view/document~ViewDocument#copy
175
- * @param data The event data.
176
- */
163
+ * Fired when the user copied the content from one of the editing roots of the editor.
164
+ *
165
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
166
+ *
167
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
168
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
169
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
170
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
171
+ *
172
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
173
+ *
174
+ * @eventName module:engine/view/document~ViewDocument#copy
175
+ * @param data The event data.
176
+ */
177
177
  export type ViewDocumentCopyEvent = {
178
- name: 'copy';
179
- args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
178
+ name: "copy";
179
+ args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
180
180
  };
181
181
  /**
182
- * Fired when the user cut the content from one of the editing roots of the editor.
183
- *
184
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
185
- *
186
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
187
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
188
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
189
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
190
- *
191
- * @see module:clipboard/clipboardobserver~ClipboardObserver
192
- *
193
- * @eventName module:engine/view/document~ViewDocument#cut
194
- * @param data The event data.
195
- */
182
+ * Fired when the user cut the content from one of the editing roots of the editor.
183
+ *
184
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
185
+ *
186
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
187
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
188
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
189
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
190
+ *
191
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
192
+ *
193
+ * @eventName module:engine/view/document~ViewDocument#cut
194
+ * @param data The event data.
195
+ */
196
196
  export type ViewDocumentCutEvent = {
197
- name: 'cut';
198
- args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
197
+ name: "cut";
198
+ args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
199
199
  };
200
200
  /**
201
- * Fired as a continuation of the {@link module:engine/view/document~ViewDocument#event:dragover} event.
202
- *
203
- * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
204
- *
205
- * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
206
- * and inserted into the editor.
207
- *
208
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
209
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
210
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the
211
- * {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
212
- * the observer must be added manually.
213
- *
214
- * @see module:clipboard/clipboardobserver~ClipboardObserver
215
- * @see module:clipboard/clipboard~Clipboard
216
- *
217
- * @eventName module:engine/view/document~ViewDocument#dragging
218
- * @param data The event data.
219
- */
201
+ * Fired as a continuation of the {@link module:engine/view/document~ViewDocument#event:dragover} event.
202
+ *
203
+ * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
204
+ *
205
+ * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
206
+ * and inserted into the editor.
207
+ *
208
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
209
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
210
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the
211
+ * {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
212
+ * the observer must be added manually.
213
+ *
214
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
215
+ * @see module:clipboard/clipboard~Clipboard
216
+ *
217
+ * @eventName module:engine/view/document~ViewDocument#dragging
218
+ * @param data The event data.
219
+ */
220
220
  export type ViewDocumentDraggingEvent = {
221
- name: 'dragging';
222
- args: [data: ViewDocumentDomEventData<DragEvent> & DraggingEventData];
221
+ name: "dragging";
222
+ args: [data: ViewDocumentDomEventData<DragEvent> & DraggingEventData];
223
223
  };
224
224
  export interface DraggingEventData {
225
- /**
226
- * The data transfer instance.
227
- */
228
- dataTransfer: ViewDataTransfer;
229
- /**
230
- * Whether the event was triggered by a paste or a drop operation.
231
- */
232
- method: 'dragover';
233
- /**
234
- * The tree view element representing the target.
235
- */
236
- target: Element;
237
- /**
238
- * Ranges which are the target of the operation (usually – into which the content should be inserted).
239
- * It is the drop position (which can be different than the selection at the moment of drop).
240
- */
241
- targetRanges: Array<ViewRange> | null;
225
+ /**
226
+ * The data transfer instance.
227
+ */
228
+ dataTransfer: ViewDataTransfer;
229
+ /**
230
+ * Whether the event was triggered by a paste or a drop operation.
231
+ */
232
+ method: "dragover";
233
+ /**
234
+ * The tree view element representing the target.
235
+ */
236
+ target: Element;
237
+ /**
238
+ * Ranges which are the target of the operation (usually – into which the content should be inserted).
239
+ * It is the drop position (which can be different than the selection at the moment of drop).
240
+ */
241
+ targetRanges: Array<ViewRange> | null;
242
242
  }
243
243
  /**
244
- * Fired when the user starts dragging the content in one of the editing roots of the editor.
245
- *
246
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
247
- *
248
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
249
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
250
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
251
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
252
- *
253
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
254
- *
255
- * @eventName module:engine/view/document~ViewDocument#dragstart
256
- * @param data The event data.
257
- */
244
+ * Fired when the user starts dragging the content in one of the editing roots of the editor.
245
+ *
246
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
247
+ *
248
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
249
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
250
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
251
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
252
+ *
253
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
254
+ *
255
+ * @eventName module:engine/view/document~ViewDocument#dragstart
256
+ * @param data The event data.
257
+ */
258
258
  export type ViewDocumentDragStartEvent = {
259
- name: 'dragstart';
260
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
259
+ name: "dragstart";
260
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
261
261
  };
262
262
  /**
263
- * Fired when the user ended dragging the content.
264
- *
265
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
266
- *
267
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
268
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
269
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
270
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
271
- *
272
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
273
- *
274
- * @eventName module:engine/view/document~ViewDocument#dragend
275
- * @param data The event data.
276
- */
263
+ * Fired when the user ended dragging the content.
264
+ *
265
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
266
+ *
267
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
268
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
269
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
270
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
271
+ *
272
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
273
+ *
274
+ * @eventName module:engine/view/document~ViewDocument#dragend
275
+ * @param data The event data.
276
+ */
277
277
  export type ViewDocumentDragEndEvent = {
278
- name: 'dragend';
279
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
278
+ name: "dragend";
279
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
280
280
  };
281
281
  /**
282
- * Fired when the user drags the content into one of the editing roots of the editor.
283
- *
284
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
285
- *
286
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
287
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
288
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
289
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
290
- *
291
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
292
- *
293
- * @eventName module:engine/view/document~ViewDocument#dragenter
294
- * @param data The event data.
295
- */
282
+ * Fired when the user drags the content into one of the editing roots of the editor.
283
+ *
284
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
285
+ *
286
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
287
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
288
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
289
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
290
+ *
291
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
292
+ *
293
+ * @eventName module:engine/view/document~ViewDocument#dragenter
294
+ * @param data The event data.
295
+ */
296
296
  export type ViewDocumentDragEnterEvent = {
297
- name: 'dragenter';
298
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
297
+ name: "dragenter";
298
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
299
299
  };
300
300
  /**
301
- * Fired when the user drags the content out of one of the editing roots of the editor.
302
- *
303
- * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
304
- *
305
- * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
306
- * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
307
- * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
308
- * plugin, but if for some reason it is not loaded, the observer must be added manually.
309
- *
310
- * @see module:engine/view/document~ViewDocument#event:clipboardInput
311
- *
312
- * @eventName module:engine/view/document~ViewDocument#dragleave
313
- * @param data The event data.
314
- */
301
+ * Fired when the user drags the content out of one of the editing roots of the editor.
302
+ *
303
+ * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
304
+ *
305
+ * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
306
+ * needs to be added to the {@link module:engine/view/document~ViewDocument} by using the
307
+ * {@link module:engine/view/view~EditingView#addObserver} method. This is usually done by the {@link module:clipboard/clipboard~Clipboard}
308
+ * plugin, but if for some reason it is not loaded, the observer must be added manually.
309
+ *
310
+ * @see module:engine/view/document~ViewDocument#event:clipboardInput
311
+ *
312
+ * @eventName module:engine/view/document~ViewDocument#dragleave
313
+ * @param data The event data.
314
+ */
315
315
  export type ViewDocumentDragLeaveEvent = {
316
- name: 'dragleave';
317
- args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
316
+ name: "dragleave";
317
+ args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
318
318
  };