@ckeditor/ckeditor5-clipboard 48.8.1-alpha.4 → 49.0.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.
- package/LICENSE.md +1 -1
- package/dist/augmentation.d.ts +14 -14
- package/dist/clipboard.d.ts +35 -35
- package/dist/clipboardmarkersutils.d.ts +194 -194
- package/dist/clipboardobserver.d.ts +274 -269
- package/dist/clipboardpipeline.d.ts +252 -248
- package/dist/dragdrop.d.ts +100 -101
- package/dist/dragdropblocktoolbar.d.ts +46 -46
- package/dist/dragdroptarget.d.ts +95 -94
- package/dist/index-content.css +3 -0
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +68 -68
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +48 -50
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +23 -21
- package/dist/index.js +1713 -2184
- package/dist/index.js.map +1 -1
- package/dist/lineview.d.ts +42 -42
- package/dist/pasteplaintext.d.ts +27 -27
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +5 -3
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +5 -3
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +5 -3
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +5 -3
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +5 -3
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +5 -3
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +5 -3
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +5 -3
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +5 -3
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +5 -3
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +5 -3
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +5 -3
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +5 -3
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +5 -3
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +5 -3
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +5 -3
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +5 -3
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +5 -3
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +5 -3
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +5 -3
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +5 -3
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +5 -3
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +5 -3
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +5 -3
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +5 -3
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +5 -3
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +5 -3
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +5 -3
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +5 -3
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +5 -3
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +5 -3
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +5 -3
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +5 -3
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +5 -3
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +5 -3
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +5 -3
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +5 -3
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +5 -3
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +5 -3
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +5 -3
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +5 -3
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +5 -3
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +5 -3
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +5 -3
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +5 -3
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +5 -3
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +5 -3
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +5 -3
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +5 -3
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +5 -3
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +5 -3
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +5 -3
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +5 -3
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +5 -3
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +5 -3
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +5 -3
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +5 -3
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +5 -3
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +5 -3
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +5 -3
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +5 -3
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +5 -3
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +5 -3
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +5 -3
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +5 -3
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +5 -3
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +5 -3
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +5 -3
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +5 -3
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +5 -3
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +5 -3
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +5 -3
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +5 -3
- package/dist/utils/normalizeclipboarddata.d.ts +12 -12
- package/dist/utils/plaintexttohtml.d.ts +10 -10
- package/dist/utils/viewtoplaintext.d.ts +12 -12
- package/package.json +7 -7
|
@@ -1,313 +1,318 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ViewDataTransfer, DomEventObserver, type ViewDocumentDomEventData, type EditingView, type ViewDocumentFragment, type ViewElement, type ViewRange } from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export declare class ClipboardObserver extends DomEventObserver<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
35
|
-
|
|
34
|
+
* The data of 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter' and 'dragleave' events.
|
|
35
|
+
*/
|
|
36
36
|
export interface ClipboardEventData {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
68
|
-
|
|
67
|
+
name: "clipboardInput";
|
|
68
|
+
args: [data: ViewDocumentDomEventData<ClipboardEvent | DragEvent> & ClipboardInputEventData];
|
|
69
69
|
};
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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;
|
|
99
104
|
}
|
|
100
105
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
*/
|
|
115
120
|
export type ViewDocumentDragOverEvent = {
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
name: "dragover";
|
|
122
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
118
123
|
};
|
|
119
124
|
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
*/
|
|
134
139
|
export type ViewDocumentDropEvent = {
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
name: "drop";
|
|
141
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
137
142
|
};
|
|
138
143
|
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
+
*/
|
|
153
158
|
export type ViewDocumentPasteEvent = {
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
name: "paste";
|
|
160
|
+
args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
|
|
156
161
|
};
|
|
157
162
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
+
*/
|
|
172
177
|
export type ViewDocumentCopyEvent = {
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
name: "copy";
|
|
179
|
+
args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
|
|
175
180
|
};
|
|
176
181
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
+
*/
|
|
191
196
|
export type ViewDocumentCutEvent = {
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
name: "cut";
|
|
198
|
+
args: [data: ViewDocumentDomEventData<ClipboardEvent> & ClipboardEventData];
|
|
194
199
|
};
|
|
195
200
|
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
+
*/
|
|
215
220
|
export type ViewDocumentDraggingEvent = {
|
|
216
|
-
|
|
217
|
-
|
|
221
|
+
name: "dragging";
|
|
222
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & DraggingEventData];
|
|
218
223
|
};
|
|
219
224
|
export interface DraggingEventData {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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;
|
|
237
242
|
}
|
|
238
243
|
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
+
*/
|
|
253
258
|
export type ViewDocumentDragStartEvent = {
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
name: "dragstart";
|
|
260
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
256
261
|
};
|
|
257
262
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
+
*/
|
|
272
277
|
export type ViewDocumentDragEndEvent = {
|
|
273
|
-
|
|
274
|
-
|
|
278
|
+
name: "dragend";
|
|
279
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
275
280
|
};
|
|
276
281
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
+
*/
|
|
291
296
|
export type ViewDocumentDragEnterEvent = {
|
|
292
|
-
|
|
293
|
-
|
|
297
|
+
name: "dragenter";
|
|
298
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
294
299
|
};
|
|
295
300
|
/**
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
+
*/
|
|
310
315
|
export type ViewDocumentDragLeaveEvent = {
|
|
311
|
-
|
|
312
|
-
|
|
316
|
+
name: "dragleave";
|
|
317
|
+
args: [data: ViewDocumentDomEventData<DragEvent> & ClipboardEventData];
|
|
313
318
|
};
|