@ckeditor/ckeditor5-clipboard 48.8.1-alpha.3 → 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.
Files changed (170) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/augmentation.d.ts +14 -14
  3. package/dist/clipboard.d.ts +35 -35
  4. package/dist/clipboardmarkersutils.d.ts +194 -194
  5. package/dist/clipboardobserver.d.ts +274 -269
  6. package/dist/clipboardpipeline.d.ts +252 -248
  7. package/dist/dragdrop.d.ts +100 -101
  8. package/dist/dragdropblocktoolbar.d.ts +46 -46
  9. package/dist/dragdroptarget.d.ts +95 -94
  10. package/dist/index-content.css +3 -0
  11. package/dist/index-content.css.map +1 -0
  12. package/dist/index-editor.css +68 -68
  13. package/dist/index-editor.css.map +1 -0
  14. package/dist/index.css +48 -50
  15. package/dist/index.css.map +1 -1
  16. package/dist/index.d.ts +23 -21
  17. package/dist/index.js +1713 -2184
  18. package/dist/index.js.map +1 -1
  19. package/dist/lineview.d.ts +42 -42
  20. package/dist/pasteplaintext.d.ts +27 -27
  21. package/dist/translations/af.js +1 -1
  22. package/dist/translations/af.umd.js +5 -3
  23. package/dist/translations/ar.js +1 -1
  24. package/dist/translations/ar.umd.js +5 -3
  25. package/dist/translations/ast.js +1 -1
  26. package/dist/translations/ast.umd.js +5 -3
  27. package/dist/translations/az.js +1 -1
  28. package/dist/translations/az.umd.js +5 -3
  29. package/dist/translations/be.js +1 -1
  30. package/dist/translations/be.umd.js +5 -3
  31. package/dist/translations/bg.js +1 -1
  32. package/dist/translations/bg.umd.js +5 -3
  33. package/dist/translations/bn.js +1 -1
  34. package/dist/translations/bn.umd.js +5 -3
  35. package/dist/translations/bs.js +1 -1
  36. package/dist/translations/bs.umd.js +5 -3
  37. package/dist/translations/ca.js +1 -1
  38. package/dist/translations/ca.umd.js +5 -3
  39. package/dist/translations/cs.js +1 -1
  40. package/dist/translations/cs.umd.js +5 -3
  41. package/dist/translations/da.js +1 -1
  42. package/dist/translations/da.umd.js +5 -3
  43. package/dist/translations/de-ch.js +1 -1
  44. package/dist/translations/de-ch.umd.js +5 -3
  45. package/dist/translations/de.js +1 -1
  46. package/dist/translations/de.umd.js +5 -3
  47. package/dist/translations/el.js +1 -1
  48. package/dist/translations/el.umd.js +5 -3
  49. package/dist/translations/en-au.js +1 -1
  50. package/dist/translations/en-au.umd.js +5 -3
  51. package/dist/translations/en-gb.js +1 -1
  52. package/dist/translations/en-gb.umd.js +5 -3
  53. package/dist/translations/en.js +1 -1
  54. package/dist/translations/en.umd.js +5 -3
  55. package/dist/translations/eo.js +1 -1
  56. package/dist/translations/eo.umd.js +5 -3
  57. package/dist/translations/es-co.js +1 -1
  58. package/dist/translations/es-co.umd.js +5 -3
  59. package/dist/translations/es.js +1 -1
  60. package/dist/translations/es.umd.js +5 -3
  61. package/dist/translations/et.js +1 -1
  62. package/dist/translations/et.umd.js +5 -3
  63. package/dist/translations/eu.js +1 -1
  64. package/dist/translations/eu.umd.js +5 -3
  65. package/dist/translations/fa.js +1 -1
  66. package/dist/translations/fa.umd.js +5 -3
  67. package/dist/translations/fi.js +1 -1
  68. package/dist/translations/fi.umd.js +5 -3
  69. package/dist/translations/fr.js +1 -1
  70. package/dist/translations/fr.umd.js +5 -3
  71. package/dist/translations/gl.js +1 -1
  72. package/dist/translations/gl.umd.js +5 -3
  73. package/dist/translations/gu.js +1 -1
  74. package/dist/translations/gu.umd.js +5 -3
  75. package/dist/translations/he.js +1 -1
  76. package/dist/translations/he.umd.js +5 -3
  77. package/dist/translations/hi.js +1 -1
  78. package/dist/translations/hi.umd.js +5 -3
  79. package/dist/translations/hr.js +1 -1
  80. package/dist/translations/hr.umd.js +5 -3
  81. package/dist/translations/hu.js +1 -1
  82. package/dist/translations/hu.umd.js +5 -3
  83. package/dist/translations/hy.js +1 -1
  84. package/dist/translations/hy.umd.js +5 -3
  85. package/dist/translations/id.js +1 -1
  86. package/dist/translations/id.umd.js +5 -3
  87. package/dist/translations/it.js +1 -1
  88. package/dist/translations/it.umd.js +5 -3
  89. package/dist/translations/ja.js +1 -1
  90. package/dist/translations/ja.umd.js +5 -3
  91. package/dist/translations/jv.js +1 -1
  92. package/dist/translations/jv.umd.js +5 -3
  93. package/dist/translations/kk.js +1 -1
  94. package/dist/translations/kk.umd.js +5 -3
  95. package/dist/translations/km.js +1 -1
  96. package/dist/translations/km.umd.js +5 -3
  97. package/dist/translations/kn.js +1 -1
  98. package/dist/translations/kn.umd.js +5 -3
  99. package/dist/translations/ko.js +1 -1
  100. package/dist/translations/ko.umd.js +5 -3
  101. package/dist/translations/ku.js +1 -1
  102. package/dist/translations/ku.umd.js +5 -3
  103. package/dist/translations/lt.js +1 -1
  104. package/dist/translations/lt.umd.js +5 -3
  105. package/dist/translations/lv.js +1 -1
  106. package/dist/translations/lv.umd.js +5 -3
  107. package/dist/translations/ms.js +1 -1
  108. package/dist/translations/ms.umd.js +5 -3
  109. package/dist/translations/nb.js +1 -1
  110. package/dist/translations/nb.umd.js +5 -3
  111. package/dist/translations/ne.js +1 -1
  112. package/dist/translations/ne.umd.js +5 -3
  113. package/dist/translations/nl.js +1 -1
  114. package/dist/translations/nl.umd.js +5 -3
  115. package/dist/translations/no.js +1 -1
  116. package/dist/translations/no.umd.js +5 -3
  117. package/dist/translations/oc.js +1 -1
  118. package/dist/translations/oc.umd.js +5 -3
  119. package/dist/translations/pl.js +1 -1
  120. package/dist/translations/pl.umd.js +5 -3
  121. package/dist/translations/pt-br.js +1 -1
  122. package/dist/translations/pt-br.umd.js +5 -3
  123. package/dist/translations/pt.js +1 -1
  124. package/dist/translations/pt.umd.js +5 -3
  125. package/dist/translations/ro.js +1 -1
  126. package/dist/translations/ro.umd.js +5 -3
  127. package/dist/translations/ru.js +1 -1
  128. package/dist/translations/ru.umd.js +5 -3
  129. package/dist/translations/si.js +1 -1
  130. package/dist/translations/si.umd.js +5 -3
  131. package/dist/translations/sk.js +1 -1
  132. package/dist/translations/sk.umd.js +5 -3
  133. package/dist/translations/sl.js +1 -1
  134. package/dist/translations/sl.umd.js +5 -3
  135. package/dist/translations/sq.js +1 -1
  136. package/dist/translations/sq.umd.js +5 -3
  137. package/dist/translations/sr-latn.js +1 -1
  138. package/dist/translations/sr-latn.umd.js +5 -3
  139. package/dist/translations/sr.js +1 -1
  140. package/dist/translations/sr.umd.js +5 -3
  141. package/dist/translations/sv.js +1 -1
  142. package/dist/translations/sv.umd.js +5 -3
  143. package/dist/translations/th.js +1 -1
  144. package/dist/translations/th.umd.js +5 -3
  145. package/dist/translations/ti.js +1 -1
  146. package/dist/translations/ti.umd.js +5 -3
  147. package/dist/translations/tk.js +1 -1
  148. package/dist/translations/tk.umd.js +5 -3
  149. package/dist/translations/tr.js +1 -1
  150. package/dist/translations/tr.umd.js +5 -3
  151. package/dist/translations/tt.js +1 -1
  152. package/dist/translations/tt.umd.js +5 -3
  153. package/dist/translations/ug.js +1 -1
  154. package/dist/translations/ug.umd.js +5 -3
  155. package/dist/translations/uk.js +1 -1
  156. package/dist/translations/uk.umd.js +5 -3
  157. package/dist/translations/ur.js +1 -1
  158. package/dist/translations/ur.umd.js +5 -3
  159. package/dist/translations/uz.js +1 -1
  160. package/dist/translations/uz.umd.js +5 -3
  161. package/dist/translations/vi.js +1 -1
  162. package/dist/translations/vi.umd.js +5 -3
  163. package/dist/translations/zh-cn.js +1 -1
  164. package/dist/translations/zh-cn.umd.js +5 -3
  165. package/dist/translations/zh.js +1 -1
  166. package/dist/translations/zh.umd.js +5 -3
  167. package/dist/utils/normalizeclipboarddata.d.ts +12 -12
  168. package/dist/utils/plaintexttohtml.d.ts +10 -10
  169. package/dist/utils/viewtoplaintext.d.ts +12 -12
  170. package/package.json +7 -7
@@ -1,277 +1,281 @@
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
- */
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
5
  /**
6
- * @module clipboard/clipboardpipeline
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import type { ViewDataTransfer, ModelDocumentFragment, ModelRange, ViewDocumentFragment, ViewRange, ModelSelection, ModelDocumentSelection } from '@ckeditor/ckeditor5-engine';
10
- import { ClipboardMarkersUtils } from './clipboardmarkersutils.js';
6
+ * @module clipboard/clipboardpipeline
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import type { ViewDataTransfer, ModelDocumentFragment, ModelRange, ViewDocumentFragment, ViewRange, ModelSelection, ModelDocumentSelection } from "@ckeditor/ckeditor5-engine";
10
+ import { ClipboardMarkersUtils } from "./clipboardmarkersutils.js";
11
11
  /**
12
- * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and
13
- * passing the pasted content through a series of events in order to insert it into the editor's content.
14
- * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.
15
- *
16
- * # Input pipeline
17
- *
18
- * The behavior of the default handlers (all at a `low` priority):
19
- *
20
- * ## Event: `paste` or `drop`
21
- *
22
- * 1. Translates the event data.
23
- * 2. Fires the {@link module:engine/view/document~ViewDocument#event:clipboardInput `view.Document#clipboardInput`} event.
24
- *
25
- * ## Event: `view.Document#clipboardInput`
26
- *
27
- * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event
28
- * from the last point.
29
- * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.
30
- * 3. Normalizes the raw data by applying simple filters on string data.
31
- * 4. Processes the raw data to {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`} with the
32
- * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
33
- * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
34
- * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.
35
- *
36
- * ## Event: `ClipboardPipeline#inputTransformation`
37
- *
38
- * 1. Converts {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`} from the `data.content` field to
39
- * {@link module:engine/model/documentfragment~ModelDocumentFragment `model.DocumentFragment`}.
40
- * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}
41
- * event with the model document fragment in the `data.content` event field.
42
- * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers
43
- * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).
44
- *
45
- * ## Event: `ClipboardPipeline#contentInsertion`
46
- *
47
- * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`
48
- * at the current selection position.
49
- *
50
- * # Output pipeline
51
- *
52
- * The behavior of the default handlers (all at a `low` priority):
53
- *
54
- * ## Event: `copy`, `cut` or `dragstart`
55
- *
56
- * 1. Retrieves the selected {@link module:engine/model/documentfragment~ModelDocumentFragment `model.DocumentFragment`} by calling
57
- * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.
58
- * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`}.
59
- * 3. Fires the {@link module:engine/view/document~ViewDocument#event:clipboardOutput `view.Document#clipboardOutput`} event
60
- * with the view document fragment in the `data.content` event field.
61
- *
62
- * ## Event: `view.Document#clipboardOutput`
63
- *
64
- * 1. Processes `data.content` to HTML and plain text with the
65
- * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
66
- * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.
67
- * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
68
- * on the current selection.
69
- *
70
- * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
71
- */
12
+ * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and
13
+ * passing the pasted content through a series of events in order to insert it into the editor's content.
14
+ * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.
15
+ *
16
+ * # Input pipeline
17
+ *
18
+ * The behavior of the default handlers (all at a `low` priority):
19
+ *
20
+ * ## Event: `paste` or `drop`
21
+ *
22
+ * 1. Translates the event data.
23
+ * 2. Fires the {@link module:engine/view/document~ViewDocument#event:clipboardInput `view.Document#clipboardInput`} event.
24
+ *
25
+ * ## Event: `view.Document#clipboardInput`
26
+ *
27
+ * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event
28
+ * from the last point.
29
+ * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.
30
+ * 3. Normalizes the raw data by applying simple filters on string data.
31
+ * 4. Processes the raw data to {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`} with the
32
+ * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
33
+ * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
34
+ * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.
35
+ *
36
+ * ## Event: `ClipboardPipeline#inputTransformation`
37
+ *
38
+ * 1. Converts {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`} from the `data.content` field to
39
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment `model.DocumentFragment`}.
40
+ * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}
41
+ * event with the model document fragment in the `data.content` event field.
42
+ * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers
43
+ * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).
44
+ *
45
+ * ## Event: `ClipboardPipeline#contentInsertion`
46
+ *
47
+ * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`
48
+ * at the current selection position.
49
+ *
50
+ * # Output pipeline
51
+ *
52
+ * The behavior of the default handlers (all at a `low` priority):
53
+ *
54
+ * ## Event: `copy`, `cut` or `dragstart`
55
+ *
56
+ * 1. Retrieves the selected {@link module:engine/model/documentfragment~ModelDocumentFragment `model.DocumentFragment`} by calling
57
+ * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.
58
+ * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~ViewDocumentFragment `view.DocumentFragment`}.
59
+ * 3. Fires the {@link module:engine/view/document~ViewDocument#event:clipboardOutput `view.Document#clipboardOutput`} event
60
+ * with the view document fragment in the `data.content` event field.
61
+ *
62
+ * ## Event: `view.Document#clipboardOutput`
63
+ *
64
+ * 1. Processes `data.content` to HTML and plain text with the
65
+ * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
66
+ * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.
67
+ * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
68
+ * on the current selection.
69
+ *
70
+ * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
71
+ */
72
72
  export declare class ClipboardPipeline extends Plugin {
73
- /**
74
- * @inheritDoc
75
- */
76
- static get pluginName(): "ClipboardPipeline";
77
- /**
78
- * @inheritDoc
79
- */
80
- static get isOfficialPlugin(): true;
81
- /**
82
- * @inheritDoc
83
- */
84
- static get requires(): readonly [typeof ClipboardMarkersUtils];
85
- /**
86
- * @inheritDoc
87
- */
88
- init(): void;
89
- /**
90
- * Fires Clipboard `'outputTransformation'` event for given parameters.
91
- *
92
- * @internal
93
- */
94
- _fireOutputTransformationEvent(dataTransfer: ViewDataTransfer, selection: ModelSelection | ModelDocumentSelection, method: 'copy' | 'cut' | 'dragstart'): void;
95
- /**
96
- * The clipboard paste pipeline.
97
- */
98
- private _setupPasteDrop;
99
- /**
100
- * The clipboard copy/cut pipeline.
101
- */
102
- private _setupCopyCut;
73
+ /**
74
+ * @inheritDoc
75
+ */
76
+ static get pluginName(): "ClipboardPipeline";
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ static override get isOfficialPlugin(): true;
81
+ /**
82
+ * @inheritDoc
83
+ */
84
+ static get requires(): PluginDependenciesOf<[ClipboardMarkersUtils]>;
85
+ /**
86
+ * @inheritDoc
87
+ */
88
+ init(): void;
89
+ /**
90
+ * Fires Clipboard `'outputTransformation'` event for given parameters.
91
+ *
92
+ * @internal
93
+ */
94
+ _fireOutputTransformationEvent(dataTransfer: ViewDataTransfer, selection: ModelSelection | ModelDocumentSelection, method: "copy" | "cut" | "dragstart"): void;
95
+ /**
96
+ * The clipboard paste pipeline.
97
+ */
98
+ private _setupPasteDrop;
99
+ /**
100
+ * The clipboard copy/cut pipeline.
101
+ */
102
+ private _setupCopyCut;
103
103
  }
104
104
  /**
105
- * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
106
- *
107
- * * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor.
108
- * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
109
- * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
110
- * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
111
- *
112
- * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
113
- *
114
- * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
115
- *
116
- * @see module:clipboard/clipboardobserver~ClipboardObserver
117
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
118
- *
119
- * @eventName ~ClipboardPipeline#inputTransformation
120
- * @param data The event data.
121
- */
105
+ * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
106
+ *
107
+ * * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor.
108
+ * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
109
+ * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
110
+ * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
111
+ *
112
+ * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
113
+ *
114
+ * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
115
+ *
116
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
117
+ * @see module:clipboard/clipboardpipeline~ClipboardPipeline
118
+ *
119
+ * @eventName ~ClipboardPipeline#inputTransformation
120
+ * @param data The event data.
121
+ */
122
122
  export type ClipboardInputTransformationEvent = {
123
- name: 'inputTransformation';
124
- args: [data: ClipboardInputTransformationData];
123
+ name: "inputTransformation";
124
+ args: [data: ClipboardInputTransformationData];
125
125
  };
126
126
  /**
127
- * The data of 'inputTransformation' event.
128
- */
127
+ * The data of 'inputTransformation' event.
128
+ */
129
129
  export interface ClipboardInputTransformationData {
130
- /**
131
- * The event data.
132
- * The content to be inserted into the editor. It can be modified by event listeners. Read more about the clipboard pipelines in
133
- * the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
134
- */
135
- content: ViewDocumentFragment;
136
- /**
137
- * The data transfer instance.
138
- */
139
- dataTransfer: ViewDataTransfer;
140
- /**
141
- * The target drop ranges.
142
- */
143
- targetRanges: Array<ViewRange> | null;
144
- /**
145
- * Whether the event was triggered by a paste or a drop operation.
146
- */
147
- method: 'paste' | 'drop';
148
- /**
149
- * ID of the editor instance from which the content was copied.
150
- */
151
- sourceEditorId: string | null;
130
+ /**
131
+ * The event data.
132
+ * The content to be inserted into the editor. It can be modified by event listeners. Read more about the clipboard pipelines in
133
+ * the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
134
+ */
135
+ content: ViewDocumentFragment;
136
+ /**
137
+ * Custom data stored by the `clipboardInput` event handlers. Content of this property is passed from the `clipboardInput` event.
138
+ */
139
+ extraContent?: unknown;
140
+ /**
141
+ * The data transfer instance.
142
+ */
143
+ dataTransfer: ViewDataTransfer;
144
+ /**
145
+ * The target drop ranges.
146
+ */
147
+ targetRanges: Array<ViewRange> | null;
148
+ /**
149
+ * Whether the event was triggered by a paste or a drop operation.
150
+ */
151
+ method: "paste" | "drop";
152
+ /**
153
+ * ID of the editor instance from which the content was copied.
154
+ */
155
+ sourceEditorId: string | null;
152
156
  }
153
157
  /**
154
- * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
155
- *
156
- * * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor.
157
- * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
158
- * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
159
- * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
160
- *
161
- * Event handlers can modify the content according to the final insertion position.
162
- *
163
- * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
164
- *
165
- * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
166
- *
167
- * @see module:clipboard/clipboardobserver~ClipboardObserver
168
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
169
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
170
- *
171
- * @eventName ~ClipboardPipeline#contentInsertion
172
- * @param data The event data.
173
- */
158
+ * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
159
+ *
160
+ * * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor.
161
+ * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
162
+ * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
163
+ * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
164
+ *
165
+ * Event handlers can modify the content according to the final insertion position.
166
+ *
167
+ * It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
168
+ *
169
+ * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
170
+ *
171
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
172
+ * @see module:clipboard/clipboardpipeline~ClipboardPipeline
173
+ * @see module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
174
+ *
175
+ * @eventName ~ClipboardPipeline#contentInsertion
176
+ * @param data The event data.
177
+ */
174
178
  export type ClipboardContentInsertionEvent = {
175
- name: 'contentInsertion';
176
- args: [data: ClipboardContentInsertionData];
179
+ name: "contentInsertion";
180
+ args: [data: ClipboardContentInsertionData];
177
181
  };
178
182
  /**
179
- * The data of 'contentInsertion' event.
180
- */
183
+ * The data of 'contentInsertion' event.
184
+ */
181
185
  export interface ClipboardContentInsertionData {
182
- /**
183
- * The content to be inserted into the editor.
184
- * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
185
- */
186
- content: ModelDocumentFragment;
187
- /**
188
- * Whether the event was triggered by a paste or a drop operation.
189
- */
190
- method: 'paste' | 'drop';
191
- /**
192
- * The ID of the editor instance from which the content was copied.
193
- */
194
- sourceEditorId: string | null;
195
- /**
196
- * The data transfer instance.
197
- */
198
- dataTransfer: ViewDataTransfer;
199
- /**
200
- * The target drop ranges.
201
- */
202
- targetRanges: Array<ViewRange> | null;
203
- /**
204
- * The result of the `model.insertContent()` call
205
- * (inserted by the event handler at a low priority).
206
- */
207
- resultRange?: ModelRange;
186
+ /**
187
+ * The content to be inserted into the editor.
188
+ * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
189
+ */
190
+ content: ModelDocumentFragment;
191
+ /**
192
+ * Whether the event was triggered by a paste or a drop operation.
193
+ */
194
+ method: "paste" | "drop";
195
+ /**
196
+ * The ID of the editor instance from which the content was copied.
197
+ */
198
+ sourceEditorId: string | null;
199
+ /**
200
+ * The data transfer instance.
201
+ */
202
+ dataTransfer: ViewDataTransfer;
203
+ /**
204
+ * The target drop ranges.
205
+ */
206
+ targetRanges: Array<ViewRange> | null;
207
+ /**
208
+ * The result of the `model.insertContent()` call
209
+ * (inserted by the event handler at a low priority).
210
+ */
211
+ resultRange?: ModelRange;
208
212
  }
209
213
  /**
210
- * Fired on {@link module:engine/view/document~ViewDocument#event:copy} and {@link module:engine/view/document~ViewDocument#event:cut}
211
- * with a copy of the selected content. The content can be processed before it ends up in the clipboard.
212
- *
213
- * It is a part of the {@glink framework/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
214
- *
215
- * @see module:clipboard/clipboardobserver~ClipboardObserver
216
- * @see module:clipboard/clipboardpipeline~ClipboardPipeline
217
- *
218
- * @eventName module:engine/view/document~ViewDocument#clipboardOutput
219
- * @param data The event data.
220
- */
214
+ * Fired on {@link module:engine/view/document~ViewDocument#event:copy} and {@link module:engine/view/document~ViewDocument#event:cut}
215
+ * with a copy of the selected content. The content can be processed before it ends up in the clipboard.
216
+ *
217
+ * It is a part of the {@glink framework/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
218
+ *
219
+ * @see module:clipboard/clipboardobserver~ClipboardObserver
220
+ * @see module:clipboard/clipboardpipeline~ClipboardPipeline
221
+ *
222
+ * @eventName module:engine/view/document~ViewDocument#clipboardOutput
223
+ * @param data The event data.
224
+ */
221
225
  export type ViewDocumentClipboardOutputEvent = {
222
- name: 'clipboardOutput';
223
- args: [data: ViewDocumentClipboardOutputEventData];
226
+ name: "clipboardOutput";
227
+ args: [data: ViewDocumentClipboardOutputEventData];
224
228
  };
225
229
  /**
226
- * The value of the 'clipboardOutput' event.
227
- */
230
+ * The value of the 'clipboardOutput' event.
231
+ */
228
232
  export interface ViewDocumentClipboardOutputEventData {
229
- /**
230
- * The data transfer instance.
231
- *
232
- * @readonly
233
- */
234
- dataTransfer: ViewDataTransfer;
235
- /**
236
- * Content to be put into the clipboard. It can be modified by the event listeners.
237
- * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
238
- */
239
- content: ViewDocumentFragment;
240
- /**
241
- * Whether the event was triggered by a copy or cut operation.
242
- */
243
- method: 'copy' | 'cut' | 'dragstart';
233
+ /**
234
+ * The data transfer instance.
235
+ *
236
+ * @readonly
237
+ */
238
+ dataTransfer: ViewDataTransfer;
239
+ /**
240
+ * Content to be put into the clipboard. It can be modified by the event listeners.
241
+ * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
242
+ */
243
+ content: ViewDocumentFragment;
244
+ /**
245
+ * Whether the event was triggered by a copy or cut operation.
246
+ */
247
+ method: "copy" | "cut" | "dragstart";
244
248
  }
245
249
  /**
246
- * Fired on {@link module:engine/view/document~ViewDocument#event:copy}, {@link module:engine/view/document~ViewDocument#event:cut}
247
- * and {@link module:engine/view/document~ViewDocument#event:dragstart}. The content can be processed before it ends up in the clipboard.
248
- *
249
- * It is a part of the {@glink framework/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
250
- *
251
- * @eventName ~ClipboardPipeline#outputTransformation
252
- * @param data The event data.
253
- */
250
+ * Fired on {@link module:engine/view/document~ViewDocument#event:copy}, {@link module:engine/view/document~ViewDocument#event:cut}
251
+ * and {@link module:engine/view/document~ViewDocument#event:dragstart}. The content can be processed before it ends up in the clipboard.
252
+ *
253
+ * It is a part of the {@glink framework/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
254
+ *
255
+ * @eventName ~ClipboardPipeline#outputTransformation
256
+ * @param data The event data.
257
+ */
254
258
  export type ClipboardOutputTransformationEvent = {
255
- name: 'outputTransformation';
256
- args: [data: ClipboardOutputTransformationData];
259
+ name: "outputTransformation";
260
+ args: [data: ClipboardOutputTransformationData];
257
261
  };
258
262
  /**
259
- * The value of the 'outputTransformation' event.
260
- */
263
+ * The value of the 'outputTransformation' event.
264
+ */
261
265
  export interface ClipboardOutputTransformationData {
262
- /**
263
- * The data transfer instance.
264
- *
265
- * @readonly
266
- */
267
- dataTransfer: ViewDataTransfer;
268
- /**
269
- * Content to be put into the clipboard. It can be modified by the event listeners.
270
- * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
271
- */
272
- content: ModelDocumentFragment;
273
- /**
274
- * Whether the event was triggered by a copy or cut operation.
275
- */
276
- method: 'copy' | 'cut' | 'dragstart';
266
+ /**
267
+ * The data transfer instance.
268
+ *
269
+ * @readonly
270
+ */
271
+ dataTransfer: ViewDataTransfer;
272
+ /**
273
+ * Content to be put into the clipboard. It can be modified by the event listeners.
274
+ * Read more about the clipboard pipelines in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
275
+ */
276
+ content: ModelDocumentFragment;
277
+ /**
278
+ * Whether the event was triggered by a copy or cut operation.
279
+ */
280
+ method: "copy" | "cut" | "dragstart";
277
281
  }