react-smart-copy 1.17.2 → 1.19.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 (154) hide show
  1. package/README.md +86 -5
  2. package/dist/capture.cjs +30 -153
  3. package/dist/capture.cjs.map +1 -1
  4. package/dist/capture.d.cts +2 -25
  5. package/dist/capture.d.ts +2 -25
  6. package/dist/capture.js +5 -128
  7. package/dist/capture.js.map +1 -1
  8. package/dist/chunks/clipboard-adapter-Cfz-rzw3.cjs +102 -0
  9. package/dist/chunks/clipboard-adapter-Cfz-rzw3.cjs.map +1 -0
  10. package/dist/chunks/clipboard-adapter-CtH4VELE.d.cts +43 -0
  11. package/dist/chunks/clipboard-adapter-DEXkXxwV.js +97 -0
  12. package/dist/chunks/clipboard-adapter-DEXkXxwV.js.map +1 -0
  13. package/dist/chunks/clipboard-adapter-Ds0irroN.d.ts +43 -0
  14. package/dist/chunks/contrast-C6CVklEI.cjs +842 -0
  15. package/dist/chunks/contrast-C6CVklEI.cjs.map +1 -0
  16. package/dist/chunks/contrast-DpK2JIVu.js +789 -0
  17. package/dist/chunks/contrast-DpK2JIVu.js.map +1 -0
  18. package/dist/chunks/copy-interceptor-C6NABy1l.d.ts +141 -0
  19. package/dist/chunks/copy-interceptor-CZWzGOkL.d.cts +141 -0
  20. package/dist/chunks/core-Cp2HSpaz.js +1035 -0
  21. package/dist/chunks/core-Cp2HSpaz.js.map +1 -0
  22. package/dist/chunks/core-DYf_Lhbe.cjs +1142 -0
  23. package/dist/chunks/core-DYf_Lhbe.cjs.map +1 -0
  24. package/dist/chunks/deadline-C29AlS_Q.js +46 -0
  25. package/dist/chunks/deadline-C29AlS_Q.js.map +1 -0
  26. package/dist/chunks/deadline-DkiB8ZHE.cjs +51 -0
  27. package/dist/chunks/deadline-DkiB8ZHE.cjs.map +1 -0
  28. package/dist/chunks/errors-9h8sdFFX.js +120 -0
  29. package/dist/chunks/errors-9h8sdFFX.js.map +1 -0
  30. package/dist/chunks/errors-BwOF6T_M.cjs +167 -0
  31. package/dist/chunks/errors-BwOF6T_M.cjs.map +1 -0
  32. package/dist/chunks/index-mr7sSAgP.d.ts +426 -0
  33. package/dist/chunks/index-vz0iW5V2.d.cts +426 -0
  34. package/dist/chunks/inert-html-D75NyVvT.js +34 -0
  35. package/dist/chunks/inert-html-D75NyVvT.js.map +1 -0
  36. package/dist/chunks/inert-html-DyxjWDok.cjs +39 -0
  37. package/dist/chunks/inert-html-DyxjWDok.cjs.map +1 -0
  38. package/dist/chunks/mime--LB7kdqG.cjs +153 -0
  39. package/dist/chunks/mime--LB7kdqG.cjs.map +1 -0
  40. package/dist/chunks/mime-aa-HA2dm.js +100 -0
  41. package/dist/chunks/mime-aa-HA2dm.js.map +1 -0
  42. package/dist/chunks/paste-adapter--SPL4PRE.d.cts +35 -0
  43. package/dist/chunks/paste-adapter-uahXnTYk.d.ts +35 -0
  44. package/dist/chunks/paste-reader-Bo01IMC_.cjs +289 -0
  45. package/dist/chunks/paste-reader-Bo01IMC_.cjs.map +1 -0
  46. package/dist/chunks/paste-reader-D9i7yMXF.js +224 -0
  47. package/dist/chunks/paste-reader-D9i7yMXF.js.map +1 -0
  48. package/dist/chunks/paste-reader-DcXnRWQr.d.cts +96 -0
  49. package/dist/chunks/paste-reader-DcXnRWQr.d.ts +96 -0
  50. package/dist/chunks/payload-CUymxwim.cjs +100 -0
  51. package/dist/chunks/payload-CUymxwim.cjs.map +1 -0
  52. package/dist/chunks/payload-CcwKJ_bU.d.cts +162 -0
  53. package/dist/chunks/payload-Cl_8hCI5.d.ts +162 -0
  54. package/dist/chunks/payload-DGw-JOo7.js +71 -0
  55. package/dist/chunks/payload-DGw-JOo7.js.map +1 -0
  56. package/dist/chunks/payload-DI5AorDz.js +103 -0
  57. package/dist/chunks/payload-DI5AorDz.js.map +1 -0
  58. package/dist/chunks/payload-J6GjHuh3.cjs +132 -0
  59. package/dist/chunks/payload-J6GjHuh3.cjs.map +1 -0
  60. package/dist/chunks/share-Bop47Znn.js +208 -0
  61. package/dist/chunks/share-Bop47Znn.js.map +1 -0
  62. package/dist/chunks/share-C0esXvRK.d.cts +115 -0
  63. package/dist/chunks/share-ayDz974N.cjs +231 -0
  64. package/dist/chunks/share-ayDz974N.cjs.map +1 -0
  65. package/dist/chunks/share-e7FenIr2.d.ts +115 -0
  66. package/dist/chunks/text-field-Ba8W3v4R.cjs +77 -0
  67. package/dist/chunks/text-field-Ba8W3v4R.cjs.map +1 -0
  68. package/dist/chunks/text-field-C0SGmvvR.d.cts +18 -0
  69. package/dist/chunks/text-field-C0SGmvvR.d.ts +18 -0
  70. package/dist/chunks/text-field-DUvrMMaK.js +66 -0
  71. package/dist/chunks/text-field-DUvrMMaK.js.map +1 -0
  72. package/dist/chunks/url-B9jdFGQy.cjs +86 -0
  73. package/dist/chunks/url-B9jdFGQy.cjs.map +1 -0
  74. package/dist/chunks/url-BcMYVCXQ.js +135 -0
  75. package/dist/chunks/url-BcMYVCXQ.js.map +1 -0
  76. package/dist/chunks/url-D4PGsRm8.cjs +164 -0
  77. package/dist/chunks/url-D4PGsRm8.cjs.map +1 -0
  78. package/dist/chunks/url-DWdElCT3.d.cts +43 -0
  79. package/dist/chunks/url-DWdElCT3.d.ts +43 -0
  80. package/dist/chunks/url-vJaFPbNL.js +57 -0
  81. package/dist/chunks/url-vJaFPbNL.js.map +1 -0
  82. package/dist/code.cjs +22 -113
  83. package/dist/code.cjs.map +1 -1
  84. package/dist/code.d.cts +4 -28
  85. package/dist/code.d.ts +4 -28
  86. package/dist/code.js +5 -96
  87. package/dist/code.js.map +1 -1
  88. package/dist/color.cjs +21 -893
  89. package/dist/color.cjs.map +1 -1
  90. package/dist/color.d.cts +4 -28
  91. package/dist/color.d.ts +4 -28
  92. package/dist/color.js +4 -876
  93. package/dist/color.js.map +1 -1
  94. package/dist/core.cjs +52 -1659
  95. package/dist/core.d.cts +8 -878
  96. package/dist/core.d.ts +8 -878
  97. package/dist/core.js +7 -1614
  98. package/dist/image.cjs +23 -94
  99. package/dist/image.cjs.map +1 -1
  100. package/dist/image.d.cts +1 -0
  101. package/dist/image.d.ts +1 -0
  102. package/dist/image.js +3 -74
  103. package/dist/image.js.map +1 -1
  104. package/dist/index.cjs +74 -2072
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts +8 -978
  107. package/dist/index.d.ts +8 -978
  108. package/dist/index.js +7 -2005
  109. package/dist/index.js.map +1 -1
  110. package/dist/link.cjs +26 -339
  111. package/dist/link.cjs.map +1 -1
  112. package/dist/link.d.cts +5 -83
  113. package/dist/link.d.ts +5 -83
  114. package/dist/link.js +7 -320
  115. package/dist/link.js.map +1 -1
  116. package/dist/markdown.cjs +19 -159
  117. package/dist/markdown.cjs.map +1 -1
  118. package/dist/markdown.d.cts +3 -16
  119. package/dist/markdown.d.ts +3 -16
  120. package/dist/markdown.js +6 -146
  121. package/dist/markdown.js.map +1 -1
  122. package/dist/rich.cjs +1123 -940
  123. package/dist/rich.cjs.map +1 -1
  124. package/dist/rich.d.cts +101 -91
  125. package/dist/rich.d.ts +101 -91
  126. package/dist/rich.js +1099 -919
  127. package/dist/rich.js.map +1 -1
  128. package/dist/share.cjs +5 -640
  129. package/dist/share.d.cts +3 -248
  130. package/dist/share.d.ts +3 -248
  131. package/dist/share.js +1 -637
  132. package/dist/structured.cjs +13 -95
  133. package/dist/structured.cjs.map +1 -1
  134. package/dist/structured.d.cts +2 -11
  135. package/dist/structured.d.ts +2 -11
  136. package/dist/structured.js +4 -86
  137. package/dist/structured.js.map +1 -1
  138. package/dist/table.cjs +13 -40
  139. package/dist/table.cjs.map +1 -1
  140. package/dist/table.d.cts +2 -12
  141. package/dist/table.d.ts +2 -12
  142. package/dist/table.js +4 -31
  143. package/dist/table.js.map +1 -1
  144. package/dist/testing.cjs +10 -43
  145. package/dist/testing.cjs.map +1 -1
  146. package/dist/testing.d.cts +6 -181
  147. package/dist/testing.d.ts +6 -181
  148. package/dist/testing.js +3 -36
  149. package/dist/testing.js.map +1 -1
  150. package/package.json +37 -5
  151. package/dist/core.cjs.map +0 -1
  152. package/dist/core.js.map +0 -1
  153. package/dist/share.cjs.map +0 -1
  154. package/dist/share.js.map +0 -1
@@ -0,0 +1,426 @@
1
+
2
+ import { a as CopySource, f as TextPayload, l as JsonPayload, o as HtmlPayload, r as CopyPayload, v as CopyError } from "./payload-CcwKJ_bU.cjs";
3
+ import { d as PasteReadOptions, m as PasteSource, o as DataTransferLike$1, p as PasteResult } from "./paste-reader-DcXnRWQr.cjs";
4
+ import { n as ClipboardAdapter } from "./clipboard-adapter-CtH4VELE.cjs";
5
+ import { n as PasteAdapter } from "./paste-adapter--SPL4PRE.cjs";
6
+ //#region src/core/mime.d.ts
7
+ /**
8
+ * MIME helpers shared by paste and capture. Everything that comes from the
9
+ * clipboard is untrusted input, so types are normalised and validated before
10
+ * they are compared, and image types are confirmed from the bytes themselves.
11
+ */
12
+ /** SVG is XML that can carry scripts; it is never matched by a wildcard. */
13
+ declare const SVG_MIME_TYPE = "image/svg+xml";
14
+ /** Lower-cased `type/subtype` without parameters, or `null` if it is not a valid MIME type. */
15
+ declare function normalizeMimeType(value: string): string | null;
16
+ /** Prefix of the async Clipboard API's web custom formats (`web application/vnd.acme+json`). */
17
+ declare const WEB_CUSTOM_FORMAT_PREFIX = "web ";
18
+ /** Whether a clipboard type is a web custom format (`web type/subtype`). */
19
+ declare function isWebCustomFormat(type: string): boolean;
20
+ /**
21
+ * Like {@link normalizeMimeType}, but also accepts web custom formats
22
+ * (`web type/subtype`), returned as `web ` + the normalised MIME type.
23
+ */
24
+ declare function normalizeClipboardType(value: string): string | null;
25
+ /**
26
+ * Does `mimeType` (already normalised) match `pattern` (`type/subtype`, `type/*` or `*\/*`)?
27
+ * Wildcards never match `image/svg+xml`, web custom formats or `+json` types: those must be listed exactly.
28
+ */
29
+ declare function matchesMimePattern(mimeType: string, pattern: string): boolean;
30
+ /** Types whose clipboard data is text and is therefore surfaced as a `string`. */
31
+ declare function isTextualMimeType(mimeType: string): boolean;
32
+ /** Raster image formats recognised from their leading bytes. */
33
+ type RasterImageMimeType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'image/bmp' | 'image/avif';
34
+ /** Identifies a raster image from its magic bytes, ignoring whatever type the Blob claims. */
35
+ declare function sniffImageBytes(bytes: Uint8Array): RasterImageMimeType | null;
36
+ /** Reads only the first bytes of a Blob, so sniffing a 20 MB screenshot stays cheap. */
37
+ declare function sniffImageType(blob: Blob): Promise<RasterImageMimeType | null>;
38
+ //#endregion
39
+ //#region src/core/copy-coordinator.d.ts
40
+ /**
41
+ * A copy machine as seen by a coordinator. `release()` returns it from
42
+ * `copied` to `idle`; it is a no-op in any other state.
43
+ */
44
+ interface CopyCoordinatorMember {
45
+ readonly release: () => void;
46
+ }
47
+ /**
48
+ * Makes a set of copy machines behave like one clipboard: when a member
49
+ * succeeds, the member that previously showed "Copied" goes back to idle,
50
+ * because the clipboard no longer holds its value.
51
+ *
52
+ * Failed copies never release anyone (the clipboard still holds the previous value).
53
+ */
54
+ interface CopyCoordinator {
55
+ /** A member just reached `copied`. Releases the previous one. */
56
+ readonly activate: (member: CopyCoordinatorMember) => void;
57
+ /** A member left `copied` on its own (auto-reset, reset, unmount). */
58
+ readonly deactivate: (member: CopyCoordinatorMember) => void;
59
+ /** The member currently showing `copied`, if any. */
60
+ readonly getActive: () => CopyCoordinatorMember | null;
61
+ }
62
+ declare function createCopyCoordinator(): CopyCoordinator;
63
+ //#endregion
64
+ //#region src/core/copy-machine.d.ts
65
+ declare const DEFAULT_RESET_AFTER_MS = 2000;
66
+ interface IdleState {
67
+ readonly status: 'idle';
68
+ }
69
+ interface CopyingState {
70
+ readonly status: 'copying';
71
+ readonly payload: CopyPayload;
72
+ readonly retryCount: number;
73
+ }
74
+ interface CopiedState {
75
+ readonly status: 'copied';
76
+ readonly payload: CopyPayload;
77
+ /** Epoch ms when the write resolved. */
78
+ readonly at: number;
79
+ }
80
+ interface ErrorState {
81
+ readonly status: 'error';
82
+ /** `null` when the input itself could not be resolved. */
83
+ readonly payload: CopyPayload | null;
84
+ readonly error: CopyError;
85
+ readonly retryCount: number;
86
+ }
87
+ type CopyState = IdleState | CopyingState | CopiedState | ErrorState;
88
+ type CopyStatus = CopyState['status'];
89
+ /**
90
+ * `cancelled`: the copy was reset or its host unmounted before it finished,
91
+ * so its work was aborted. Nothing to report to the user.
92
+ */
93
+ type CopyIgnoredReason = 'in-flight' | 'nothing-to-retry' | 'not-retryable' | 'cancelled';
94
+ /**
95
+ * Why an in-flight copy was cancelled: `reset` (`reset()` was called) or
96
+ * `disconnect` (its host disconnected, e.g. the React component unmounted).
97
+ */
98
+ type CopyCancelReason = 'reset' | 'disconnect';
99
+ /** What `copy()`/`retry()` resolve to. They never reject. */
100
+ type CopyOutcome = {
101
+ readonly status: 'copied';
102
+ readonly payload: CopyPayload;
103
+ } | {
104
+ readonly status: 'error';
105
+ readonly error: CopyError;
106
+ } | {
107
+ readonly status: 'ignored';
108
+ readonly reason: CopyIgnoredReason;
109
+ };
110
+ interface CopyMachineOptions {
111
+ /** Defaults to the browser Clipboard API adapter. */
112
+ readonly adapter?: ClipboardAdapter;
113
+ /** Time in `copied` before returning to `idle`. `false`/`Infinity` disables. Default 2000. */
114
+ readonly resetAfterMs?: number | false;
115
+ /**
116
+ * Max `retry()` calls after the first failure. Default 3. `0` disables
117
+ * retry; `Infinity` allows unlimited retries.
118
+ */
119
+ readonly maxRetries?: number;
120
+ /**
121
+ * Share "Copied" with other machines: only one member of a coordinator
122
+ * shows `copied` at a time. `null` explicitly opts out (e.g. of a React `<CopyGroup>`).
123
+ */
124
+ readonly coordinator?: CopyCoordinator | null;
125
+ readonly onCopy?: (payload: CopyPayload) => void;
126
+ readonly onError?: (error: CopyError, payload: CopyPayload | null) => void;
127
+ /**
128
+ * `reset()` moved the machine back to `idle` from any other state. Not
129
+ * called for the automatic return after `resetAfterMs`, for a `<CopyGroup>`
130
+ * handing "Copied" to another member, or when already `idle`.
131
+ */
132
+ readonly onReset?: () => void;
133
+ /**
134
+ * A copy in flight was cancelled before it settled: its `signal` aborted
135
+ * and its result will not reach state or `onCopy` / `onError`. Fires
136
+ * before `onReset` when `reset()` cancels a copy.
137
+ */
138
+ readonly onCancel?: (reason: CopyCancelReason) => void;
139
+ /** Clock injection for tests and deterministic environments. */
140
+ readonly now?: () => number;
141
+ }
142
+ /** Options object, or a getter so hosts (like React) can supply the latest options. */
143
+ type CopyMachineOptionsSource = CopyMachineOptions | (() => CopyMachineOptions);
144
+ interface CopyMachine {
145
+ readonly getSnapshot: () => CopyState;
146
+ readonly subscribe: (listener: () => void) => () => void;
147
+ readonly copy: (source: CopySource) => Promise<CopyOutcome>;
148
+ readonly retry: () => Promise<CopyOutcome>;
149
+ /** Back to `idle`. Discards any in-flight result and aborts its `signal`. */
150
+ readonly reset: () => void;
151
+ /**
152
+ * Lifecycle hook for hosts. Re-arms a pending auto-reset; the returned
153
+ * cleanup clears timers, drops in-flight results, aborts in-flight work and
154
+ * unsticks `copying`.
155
+ * Safe to call repeatedly (React StrictMode).
156
+ */
157
+ readonly connect: () => () => void;
158
+ }
159
+ declare const IDLE_STATE: IdleState;
160
+ /** Pure helper: can `retry()` do anything from this state? */
161
+ declare function canRetryState(state: CopyState, maxRetries?: number): boolean;
162
+ /** Framework-agnostic copy state machine. */
163
+ declare function createCopyMachine(options?: CopyMachineOptionsSource): CopyMachine;
164
+ //#endregion
165
+ //#region src/core/drag-copy.d.ts
166
+ /**
167
+ * The `effectAllowed` a drag operation advertises. Controls which cursor the
168
+ * browser shows and which `dropEffect` the drop target may request.
169
+ *
170
+ * - `'copy'` (default): dragging produces a copy of the data.
171
+ * - `'move'`: dragging removes the source after a drop (the app must do this).
172
+ * - `'link'`: dragging creates a link/reference.
173
+ * - `'copyMove'` / `'copyLink'` / `'linkMove'` / `'all'`: combinations.
174
+ * - `'none'`: the drag is not droppable anywhere.
175
+ * - `'uninitialized'`: browser default (same as `'all'` in most cases).
176
+ */
177
+ type DragEffectAllowed = 'copy' | 'move' | 'link' | 'copyMove' | 'copyLink' | 'linkMove' | 'all' | 'none' | 'uninitialized';
178
+ /** What is put into `DataTransfer` when a drag starts. */
179
+ interface DragCopyItem {
180
+ /** Web custom formats (`web …`) are skipped: only the async Clipboard API writes them. */
181
+ readonly mimeType: string;
182
+ readonly data: string;
183
+ /** Accepted for parity with `MultiPayloadItem`; every non-web item can be written to a drag. */
184
+ readonly optional?: boolean;
185
+ }
186
+ /**
187
+ * A multi-format drag payload — strings only (DataTransfer only accepts strings).
188
+ * Mirrors `SyncCopyPayload` from copy-interceptor but scoped to drag.
189
+ */
190
+ type DragCopyPayload = TextPayload | HtmlPayload | JsonPayload | DragMultiPayload;
191
+ interface DragMultiPayload {
192
+ readonly kind: 'multi';
193
+ readonly items: readonly DragCopyItem[];
194
+ }
195
+ /**
196
+ * What the source getter returns:
197
+ * - a string: written as `text/plain`.
198
+ * - a `DragCopyPayload`: written according to its `kind`.
199
+ * - `false`: cancels the drag (`preventDefault()` on `dragstart`).
200
+ * - `null` / `undefined`: leaves the browser's default drag data untouched.
201
+ */
202
+ type DragCopyDecision = string | DragCopyPayload | false | null | undefined;
203
+ /** Called once when the user begins dragging the element. Must be synchronous. */
204
+ type DragCopySource = (event: DragStartEventLike) => DragCopyDecision;
205
+ /** Structural `DragEvent`: DOM and React drag events both satisfy it. */
206
+ interface DragStartEventLike {
207
+ readonly type: string;
208
+ readonly dataTransfer: DataTransferLike | null;
209
+ readonly defaultPrevented: boolean;
210
+ preventDefault(): void;
211
+ }
212
+ /** The writable face of `DataTransfer`. */
213
+ interface DataTransferLike {
214
+ effectAllowed: string;
215
+ setData(format: string, data: string): void;
216
+ clearData?(format?: string): void;
217
+ }
218
+ type DragCopyStatus =
219
+ /** No drag has started yet, or it was cancelled / never had source data. */
220
+ 'idle' |
221
+ /** The element is being dragged and data is on the DataTransfer. */
222
+ 'dragging' |
223
+ /** The drag ended (dropped or abandoned). */
224
+ 'done';
225
+ type DragCopyPassReason =
226
+ /** Source returned `null`/`undefined`. */
227
+ 'declined' |
228
+ /** `DataTransfer` is not present on this event. */
229
+ 'no-transfer' |
230
+ /** Source returned `false`. */
231
+ 'cancelled';
232
+ type DragCopyOutcome = {
233
+ readonly status: 'written';
234
+ readonly payload: DragCopyPayload;
235
+ } | {
236
+ readonly status: 'passed';
237
+ readonly reason: DragCopyPassReason;
238
+ } | {
239
+ readonly status: 'failed';
240
+ readonly error: CopyError;
241
+ };
242
+ interface DragCopyState {
243
+ readonly status: DragCopyStatus;
244
+ /** The last `dragstart` outcome; `null` before the first drag. */
245
+ readonly outcome: DragCopyOutcome | null;
246
+ }
247
+ interface DragCopyOptions {
248
+ /**
249
+ * Returns the data to put in the drag. Called synchronously on `dragstart`.
250
+ * Return a string (shorthand for `{ kind: 'text' }`), a payload object,
251
+ * `false` to cancel the drag, or `null`/`undefined` to pass through.
252
+ */
253
+ readonly source: DragCopySource;
254
+ /**
255
+ * `effectAllowed` advertised on the drag. Default `'copy'`.
256
+ * Setting `'move'` signals to drop targets that the source will be removed.
257
+ */
258
+ readonly effectAllowed?: DragEffectAllowed;
259
+ /**
260
+ * Called each time a drag starts or ends, with the latest outcome and status.
261
+ * Stable across re-renders when written as a class method or via `useRef`.
262
+ */
263
+ readonly onDrag?: (state: DragCopyState) => void;
264
+ /** Called when preparing the drag payload fails. */
265
+ readonly onError?: (error: CopyError) => void;
266
+ }
267
+ /**
268
+ * Populates a `dragstart` event's `DataTransfer` with the given payload.
269
+ * Use this from a raw `dragstart` handler or a React `onDragStart` prop.
270
+ * Returns the outcome so you can inspect what happened.
271
+ */
272
+ declare function applyDragCopy(event: DragStartEventLike, options: DragCopyOptions): DragCopyOutcome;
273
+ interface RegisterDragCopyResult {
274
+ /** Unsubscribes all listeners. Idempotent. */
275
+ readonly unsubscribe: () => void;
276
+ }
277
+ /**
278
+ * Attaches `dragstart` and `dragend` listeners to `element`, calling
279
+ * `applyDragCopy` on every drag start. Returns an object with an
280
+ * `unsubscribe` function.
281
+ *
282
+ * Pass an options getter so the latest options are always used without
283
+ * re-registering — safe to pass an inline object from a React render.
284
+ *
285
+ * ```ts
286
+ * const { unsubscribe } = registerDragCopy(el, () => ({
287
+ * source: () => `${title}\n${url}`,
288
+ * }));
289
+ * ```
290
+ */
291
+ declare function registerDragCopy(element: HTMLElement, options: DragCopyOptions | (() => DragCopyOptions)): RegisterDragCopyResult;
292
+ //#endregion
293
+ //#region src/core/paste-machine.d.ts
294
+ interface PasteIdleState {
295
+ readonly status: 'idle';
296
+ }
297
+ interface PasteReadingState {
298
+ readonly status: 'reading';
299
+ }
300
+ interface PasteReadState {
301
+ readonly status: 'read';
302
+ readonly result: PasteResult;
303
+ /** Epoch ms when the read resolved. */
304
+ readonly at: number;
305
+ }
306
+ interface PasteErrorState {
307
+ readonly status: 'error';
308
+ readonly error: CopyError;
309
+ /** Where the failed read came from. Only `'clipboard'` reads can be retried. */
310
+ readonly source: PasteSource;
311
+ /** `retry()` calls made since the last fresh `paste()`. */
312
+ readonly retryCount: number;
313
+ }
314
+ type PasteState = PasteIdleState | PasteReadingState | PasteReadState | PasteErrorState;
315
+ type PasteStatus = PasteState['status'];
316
+ /**
317
+ * `cancelled`: the read was superseded, reset, or its host unmounted before it
318
+ * finished, so its work was aborted. Nothing to report to the user.
319
+ */
320
+ type PasteIgnoredReason = 'in-flight' | 'no-accepted-content' | 'nothing-to-retry' | 'not-retryable' | 'cancelled';
321
+ /**
322
+ * Why an in-flight read was cancelled: `reset` (`reset()` was called),
323
+ * `disconnect` (its host disconnected, e.g. the React component unmounted) or
324
+ * `superseded` (a paste or drop event arrived while a read was pending).
325
+ */
326
+ type PasteCancelReason = 'reset' | 'disconnect' | 'superseded';
327
+ /** What `paste()` / `pasteEvent()` / `dropEvent()` / `retry()` resolve to. They never reject. */
328
+ type PasteOutcome = {
329
+ readonly status: 'read';
330
+ readonly result: PasteResult;
331
+ } | {
332
+ readonly status: 'error';
333
+ readonly error: CopyError;
334
+ } | {
335
+ readonly status: 'ignored';
336
+ readonly reason: PasteIgnoredReason;
337
+ };
338
+ /** Structural view of a DOM / React `paste` event. */
339
+ interface PasteEventLike {
340
+ readonly clipboardData: DataTransferLike$1 | null | undefined;
341
+ preventDefault(): void;
342
+ }
343
+ /** Structural view of a DOM / React `drop` event. */
344
+ interface PasteDropEventLike {
345
+ readonly dataTransfer: DataTransferLike$1 | null | undefined;
346
+ preventDefault(): void;
347
+ }
348
+ interface PasteMachineOptions extends PasteReadOptions {
349
+ /** Defaults to the browser Clipboard API adapter. */
350
+ readonly adapter?: PasteAdapter;
351
+ /** Return from `read` to `idle` after this many ms. `false` / `Infinity` / omitted = keep the result. */
352
+ readonly resetAfterMs?: number | false;
353
+ /**
354
+ * Paste events: call `event.preventDefault()` when the event carried accepted
355
+ * content, so the browser doesn't also insert it. Drop events: always call it,
356
+ * so the browser doesn't open the dropped file. Default `true`.
357
+ */
358
+ readonly preventDefault?: boolean;
359
+ /**
360
+ * Max `retry()` calls after a failed clipboard read. Default 3. `0`
361
+ * disables retry; `Infinity` allows unlimited retries.
362
+ */
363
+ readonly maxRetries?: number;
364
+ readonly onPaste?: (result: PasteResult) => void;
365
+ readonly onError?: (error: CopyError) => void;
366
+ /**
367
+ * `reset()` moved the machine back to `idle` from any other state. Not
368
+ * called for the automatic return after `resetAfterMs`, or when already `idle`.
369
+ */
370
+ readonly onReset?: () => void;
371
+ /**
372
+ * A read in flight was cancelled before it settled: its `signal` aborted
373
+ * and its result will not reach state or `onPaste` / `onError`. Fires
374
+ * before `onReset` when `reset()` cancels a read.
375
+ */
376
+ readonly onCancel?: (reason: PasteCancelReason) => void;
377
+ /** Clock injection for tests and deterministic environments. */
378
+ readonly now?: () => number;
379
+ }
380
+ /** Options object, or a getter so hosts (like React) can supply the latest options. */
381
+ type PasteMachineOptionsSource = PasteMachineOptions | (() => PasteMachineOptions);
382
+ interface PasteMachine {
383
+ readonly getSnapshot: () => PasteState;
384
+ readonly subscribe: (listener: () => void) => () => void;
385
+ /**
386
+ * Reads the system clipboard via the adapter. Call it from a user gesture
387
+ * (click, keypress). May show a permission prompt. Ignored while `reading`.
388
+ */
389
+ readonly paste: () => Promise<PasteOutcome>;
390
+ /**
391
+ * Handles a `paste` event (Ctrl/⌘+V). No permission prompt: the data is
392
+ * already in the event. Supersedes any read in flight. Events without
393
+ * accepted content are ignored and left untouched for the browser.
394
+ */
395
+ readonly pasteEvent: (event: PasteEventLike) => Promise<PasteOutcome>;
396
+ /**
397
+ * Handles a drag-and-drop `drop` event exactly like a paste event: same
398
+ * `accept`, limits and image checks, `result.source === 'drop'`. Always calls
399
+ * `event.preventDefault()` (unless `preventDefault: false`), so a rejected
400
+ * file is not opened by the browser in place of the page.
401
+ */
402
+ readonly dropEvent: (event: PasteDropEventLike) => Promise<PasteOutcome>;
403
+ /**
404
+ * Re-reads the clipboard after a retryable failure (e.g. permission denied,
405
+ * page not focused), up to `maxRetries`. Call it from a user gesture.
406
+ * Paste-event failures can't be retried: their data is gone after dispatch.
407
+ */
408
+ readonly retry: () => Promise<PasteOutcome>;
409
+ /** Back to `idle`. Discards any in-flight result and aborts its `signal`. */
410
+ readonly reset: () => void;
411
+ /**
412
+ * Lifecycle hook for hosts. Re-arms a pending auto-reset; the returned
413
+ * cleanup clears timers, drops in-flight results, aborts in-flight work and
414
+ * unsticks `reading`.
415
+ * Safe to call repeatedly (React StrictMode).
416
+ */
417
+ readonly connect: () => () => void;
418
+ }
419
+ declare const PASTE_IDLE_STATE: PasteIdleState;
420
+ /** Pure helper: can `retry()` do anything from this state? */
421
+ declare function canRetryPasteState(state: PasteState, maxRetries?: number): boolean;
422
+ /** Framework-agnostic paste state machine. */
423
+ declare function createPasteMachine(options?: PasteMachineOptionsSource): PasteMachine;
424
+ //#endregion
425
+ export { SVG_MIME_TYPE as $, RegisterDragCopyResult as A, CopyState as B, DragCopyPayload as C, DragEffectAllowed as D, DragCopyStatus as E, CopyIgnoredReason as F, IDLE_STATE as G, CopyingState as H, CopyMachine as I, createCopyMachine as J, IdleState as K, CopyMachineOptions as L, registerDragCopy as M, CopiedState as N, DragMultiPayload as O, CopyCancelReason as P, RasterImageMimeType as Q, CopyMachineOptionsSource as R, DragCopyPassReason as S, DragCopyState as T, DEFAULT_RESET_AFTER_MS as U, CopyStatus as V, ErrorState as W, CopyCoordinatorMember as X, CopyCoordinator as Y, createCopyCoordinator as Z, createPasteMachine as _, PasteEventLike as a, normalizeMimeType as at, DragCopyOptions as b, PasteMachine as c, PasteOutcome as d, WEB_CUSTOM_FORMAT_PREFIX as et, PasteReadState as f, canRetryPasteState as g, PasteStatus as h, PasteErrorState as i, normalizeClipboardType as it, applyDragCopy as j, DragStartEventLike as k, PasteMachineOptions as l, PasteState as m, PasteCancelReason as n, isWebCustomFormat as nt, PasteIdleState as o, sniffImageBytes as ot, PasteReadingState as p, canRetryState as q, PasteDropEventLike as r, matchesMimePattern as rt, PasteIgnoredReason as s, sniffImageType as st, PASTE_IDLE_STATE as t, isTextualMimeType as tt, PasteMachineOptionsSource as u, DragCopyDecision as v, DragCopySource as w, DragCopyOutcome as x, DragCopyItem as y, CopyOutcome as z };
426
+ //# sourceMappingURL=index-vz0iW5V2.d.cts.map
@@ -0,0 +1,34 @@
1
+
2
+ //#region src/core/inert-html.ts
3
+ /**
4
+ * Parsing HTML text that came from outside (the clipboard, a drop, a caller): shared by the
5
+ * opt-in entry points. Internal: not part of `react-smart-copy/core`'s public API.
6
+ */
7
+ /** A `NodeFilter.SHOW_ELEMENT`, without needing the global. */
8
+ const SHOW_ELEMENT = 1;
9
+ /**
10
+ * Parses HTML text into an inert document: scripts and event handlers never run, and nothing is
11
+ * fetched. Its nodes are only read, never inserted into a page.
12
+ *
13
+ * Event handler attributes (`onerror`, `onclick`, ...) are also removed at once, so no node of
14
+ * the document carries one, whatever reads it later.
15
+ *
16
+ * With a Content Security Policy that blocks inline handlers, Chromium (since 156) reports a
17
+ * `script-src-attr` violation, targeting the Document, for each handler it parses into an inert
18
+ * document, though the handler never runs (w3c/webappsec-csp#824). No parser can avoid that report.
19
+ *
20
+ * Needs `DOMParser`: callers check for it first.
21
+ */
22
+ function parseInertHtml(html) {
23
+ const doc = new DOMParser().parseFromString(html, "text/html");
24
+ const walker = doc.createTreeWalker(doc, SHOW_ELEMENT);
25
+ for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {
26
+ const element = node;
27
+ for (const attribute of Array.from(element.attributes)) if (attribute.name.length > 2 && attribute.name.slice(0, 2).toLowerCase() === "on") element.removeAttribute(attribute.name);
28
+ }
29
+ return doc;
30
+ }
31
+ //#endregion
32
+ export { parseInertHtml as t };
33
+
34
+ //# sourceMappingURL=inert-html-D75NyVvT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inert-html-D75NyVvT.js","names":[],"sources":["../../src/core/inert-html.ts"],"sourcesContent":["/**\n * Parsing HTML text that came from outside (the clipboard, a drop, a caller): shared by the\n * opt-in entry points. Internal: not part of `react-smart-copy/core`'s public API.\n */\n\n/** A `NodeFilter.SHOW_ELEMENT`, without needing the global. */\nconst SHOW_ELEMENT = 1;\n\n/**\n * Parses HTML text into an inert document: scripts and event handlers never run, and nothing is\n * fetched. Its nodes are only read, never inserted into a page.\n *\n * Event handler attributes (`onerror`, `onclick`, ...) are also removed at once, so no node of\n * the document carries one, whatever reads it later.\n *\n * With a Content Security Policy that blocks inline handlers, Chromium (since 156) reports a\n * `script-src-attr` violation, targeting the Document, for each handler it parses into an inert\n * document, though the handler never runs (w3c/webappsec-csp#824). No parser can avoid that report.\n *\n * Needs `DOMParser`: callers check for it first.\n */\nexport function parseInertHtml(html: string): Document {\n // Inert: CodeQL's js/xss sees DOMParser as a sink, so this file is left out of its analysis (codeql.yml).\n const doc = new DOMParser().parseFromString(html, 'text/html');\n // A tree walker, not a selector: selector engines are slow to start in DOMs like jsdom.\n const walker = doc.createTreeWalker(doc, SHOW_ELEMENT);\n for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {\n const element = node as Element;\n for (const attribute of Array.from(element.attributes)) {\n if (attribute.name.length > 2 && attribute.name.slice(0, 2).toLowerCase() === 'on') element.removeAttribute(attribute.name);\n }\n }\n return doc;\n}\n"],"mappings":";;;;;;;AAMA,MAAM,eAAe;;;;;;;;;;;;;;AAerB,SAAgB,eAAe,MAAwB;CAErD,MAAM,MAAM,IAAI,UAAU,CAAC,CAAC,gBAAgB,MAAM,WAAW;CAE7D,MAAM,SAAS,IAAI,iBAAiB,KAAK,YAAY;CACrD,KAAK,IAAI,OAAO,OAAO,SAAS,GAAG,SAAS,MAAM,OAAO,OAAO,SAAS,GAAG;EAC1E,MAAM,UAAU;EAChB,KAAK,MAAM,aAAa,MAAM,KAAK,QAAQ,UAAU,GACnD,IAAI,UAAU,KAAK,SAAS,KAAK,UAAU,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,MAAM,MAAM,QAAQ,gBAAgB,UAAU,IAAI;CAE9H;CACA,OAAO;AACT"}
@@ -0,0 +1,39 @@
1
+
2
+ //#region src/core/inert-html.ts
3
+ /**
4
+ * Parsing HTML text that came from outside (the clipboard, a drop, a caller): shared by the
5
+ * opt-in entry points. Internal: not part of `react-smart-copy/core`'s public API.
6
+ */
7
+ /** A `NodeFilter.SHOW_ELEMENT`, without needing the global. */
8
+ const SHOW_ELEMENT = 1;
9
+ /**
10
+ * Parses HTML text into an inert document: scripts and event handlers never run, and nothing is
11
+ * fetched. Its nodes are only read, never inserted into a page.
12
+ *
13
+ * Event handler attributes (`onerror`, `onclick`, ...) are also removed at once, so no node of
14
+ * the document carries one, whatever reads it later.
15
+ *
16
+ * With a Content Security Policy that blocks inline handlers, Chromium (since 156) reports a
17
+ * `script-src-attr` violation, targeting the Document, for each handler it parses into an inert
18
+ * document, though the handler never runs (w3c/webappsec-csp#824). No parser can avoid that report.
19
+ *
20
+ * Needs `DOMParser`: callers check for it first.
21
+ */
22
+ function parseInertHtml(html) {
23
+ const doc = new DOMParser().parseFromString(html, "text/html");
24
+ const walker = doc.createTreeWalker(doc, SHOW_ELEMENT);
25
+ for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {
26
+ const element = node;
27
+ for (const attribute of Array.from(element.attributes)) if (attribute.name.length > 2 && attribute.name.slice(0, 2).toLowerCase() === "on") element.removeAttribute(attribute.name);
28
+ }
29
+ return doc;
30
+ }
31
+ //#endregion
32
+ Object.defineProperty(exports, "parseInertHtml", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return parseInertHtml;
36
+ }
37
+ });
38
+
39
+ //# sourceMappingURL=inert-html-DyxjWDok.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inert-html-DyxjWDok.cjs","names":[],"sources":["../../src/core/inert-html.ts"],"sourcesContent":["/**\n * Parsing HTML text that came from outside (the clipboard, a drop, a caller): shared by the\n * opt-in entry points. Internal: not part of `react-smart-copy/core`'s public API.\n */\n\n/** A `NodeFilter.SHOW_ELEMENT`, without needing the global. */\nconst SHOW_ELEMENT = 1;\n\n/**\n * Parses HTML text into an inert document: scripts and event handlers never run, and nothing is\n * fetched. Its nodes are only read, never inserted into a page.\n *\n * Event handler attributes (`onerror`, `onclick`, ...) are also removed at once, so no node of\n * the document carries one, whatever reads it later.\n *\n * With a Content Security Policy that blocks inline handlers, Chromium (since 156) reports a\n * `script-src-attr` violation, targeting the Document, for each handler it parses into an inert\n * document, though the handler never runs (w3c/webappsec-csp#824). No parser can avoid that report.\n *\n * Needs `DOMParser`: callers check for it first.\n */\nexport function parseInertHtml(html: string): Document {\n // Inert: CodeQL's js/xss sees DOMParser as a sink, so this file is left out of its analysis (codeql.yml).\n const doc = new DOMParser().parseFromString(html, 'text/html');\n // A tree walker, not a selector: selector engines are slow to start in DOMs like jsdom.\n const walker = doc.createTreeWalker(doc, SHOW_ELEMENT);\n for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {\n const element = node as Element;\n for (const attribute of Array.from(element.attributes)) {\n if (attribute.name.length > 2 && attribute.name.slice(0, 2).toLowerCase() === 'on') element.removeAttribute(attribute.name);\n }\n }\n return doc;\n}\n"],"mappings":";;;;;;;AAMA,MAAM,eAAe;;;;;;;;;;;;;;AAerB,SAAgB,eAAe,MAAwB;CAErD,MAAM,MAAM,IAAI,UAAU,CAAC,CAAC,gBAAgB,MAAM,WAAW;CAE7D,MAAM,SAAS,IAAI,iBAAiB,KAAK,YAAY;CACrD,KAAK,IAAI,OAAO,OAAO,SAAS,GAAG,SAAS,MAAM,OAAO,OAAO,SAAS,GAAG;EAC1E,MAAM,UAAU;EAChB,KAAK,MAAM,aAAa,MAAM,KAAK,QAAQ,UAAU,GACnD,IAAI,UAAU,KAAK,SAAS,KAAK,UAAU,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,MAAM,MAAM,QAAQ,gBAAgB,UAAU,IAAI;CAE9H;CACA,OAAO;AACT"}
@@ -0,0 +1,153 @@
1
+
2
+ //#region src/core/mime.ts
3
+ /**
4
+ * MIME helpers shared by paste and capture. Everything that comes from the
5
+ * clipboard is untrusted input, so types are normalised and validated before
6
+ * they are compared, and image types are confirmed from the bytes themselves.
7
+ */
8
+ /** RFC 6838 token shape, lower-cased. Parameters (`;charset=…`) are stripped first. */
9
+ const MIME_SHAPE = /^[a-z0-9][a-z0-9!#$&^_.+-]{0,126}\/[a-z0-9][a-z0-9!#$&^_.+-]{0,126}$/;
10
+ /** SVG is XML that can carry scripts; it is never matched by a wildcard. */
11
+ const SVG_MIME_TYPE = "image/svg+xml";
12
+ /** Lower-cased `type/subtype` without parameters, or `null` if it is not a valid MIME type. */
13
+ function normalizeMimeType(value) {
14
+ const separator = value.indexOf(";");
15
+ const base = (separator === -1 ? value : value.slice(0, separator)).trim().toLowerCase();
16
+ return MIME_SHAPE.test(base) ? base : null;
17
+ }
18
+ /** Prefix of the async Clipboard API's web custom formats (`web application/vnd.acme+json`). */
19
+ const WEB_CUSTOM_FORMAT_PREFIX = "web ";
20
+ /** Whether a clipboard type is a web custom format (`web type/subtype`). */
21
+ function isWebCustomFormat(type) {
22
+ return type.slice(0, 4).toLowerCase() === WEB_CUSTOM_FORMAT_PREFIX;
23
+ }
24
+ /**
25
+ * Like {@link normalizeMimeType}, but also accepts web custom formats
26
+ * (`web type/subtype`), returned as `web ` + the normalised MIME type.
27
+ */
28
+ function normalizeClipboardType(value) {
29
+ if (!isWebCustomFormat(value)) return normalizeMimeType(value);
30
+ const inner = normalizeMimeType(value.slice(4));
31
+ return inner === null ? null : WEB_CUSTOM_FORMAT_PREFIX + inner;
32
+ }
33
+ /**
34
+ * Types a wildcard never matches, so accepting them must be explicit:
35
+ * `image/svg+xml` (scriptable XML), web custom formats and structured `+json` types
36
+ * (application-specific data that only the app that defined them should read).
37
+ */
38
+ function requiresExactMatch(mimeType) {
39
+ return mimeType === "image/svg+xml" || isWebCustomFormat(mimeType) || mimeType.endsWith("+json");
40
+ }
41
+ /**
42
+ * Does `mimeType` (already normalised) match `pattern` (`type/subtype`, `type/*` or `*\/*`)?
43
+ * Wildcards never match `image/svg+xml`, web custom formats or `+json` types: those must be listed exactly.
44
+ */
45
+ function matchesMimePattern(mimeType, pattern) {
46
+ if (pattern === mimeType) return true;
47
+ if (requiresExactMatch(mimeType)) return false;
48
+ if (pattern === "*/*") return true;
49
+ return pattern.endsWith("/*") && mimeType.startsWith(pattern.slice(0, -1));
50
+ }
51
+ /** Types whose clipboard data is text and is therefore surfaced as a `string`. */
52
+ function isTextualMimeType(mimeType) {
53
+ const type = isWebCustomFormat(mimeType) ? mimeType.slice(4) : mimeType;
54
+ return type.startsWith("text/") || type === "image/svg+xml" || type === "application/json" || type === "application/xml" || type.endsWith("+json");
55
+ }
56
+ const SNIFF_BYTES = 16;
57
+ function startsWith(bytes, signature, offset = 0) {
58
+ return signature.every((byte, index) => bytes[offset + index] === byte);
59
+ }
60
+ const ascii = (text) => Array.from(text, (char) => char.charCodeAt(0));
61
+ const PNG = [
62
+ 137,
63
+ 80,
64
+ 78,
65
+ 71,
66
+ 13,
67
+ 10,
68
+ 26,
69
+ 10
70
+ ];
71
+ const JPEG = [
72
+ 255,
73
+ 216,
74
+ 255
75
+ ];
76
+ const GIF = ascii("GIF8");
77
+ const RIFF = ascii("RIFF");
78
+ const WEBP = ascii("WEBP");
79
+ const BMP = ascii("BM");
80
+ const FTYP_AVIF = ascii("ftypavif");
81
+ const FTYP_AVIS = ascii("ftypavis");
82
+ /** Identifies a raster image from its magic bytes, ignoring whatever type the Blob claims. */
83
+ function sniffImageBytes(bytes) {
84
+ if (startsWith(bytes, PNG)) return "image/png";
85
+ if (startsWith(bytes, JPEG)) return "image/jpeg";
86
+ if (startsWith(bytes, GIF)) return "image/gif";
87
+ if (startsWith(bytes, RIFF) && startsWith(bytes, WEBP, 8)) return "image/webp";
88
+ if (startsWith(bytes, FTYP_AVIF, 4) || startsWith(bytes, FTYP_AVIS, 4)) return "image/avif";
89
+ if (startsWith(bytes, BMP)) return "image/bmp";
90
+ return null;
91
+ }
92
+ /** Reads only the first bytes of a Blob, so sniffing a 20 MB screenshot stays cheap. */
93
+ async function sniffImageType(blob) {
94
+ const head = await blob.slice(0, SNIFF_BYTES).arrayBuffer();
95
+ return sniffImageBytes(new Uint8Array(head));
96
+ }
97
+ //#endregion
98
+ Object.defineProperty(exports, "SVG_MIME_TYPE", {
99
+ enumerable: true,
100
+ get: function() {
101
+ return SVG_MIME_TYPE;
102
+ }
103
+ });
104
+ Object.defineProperty(exports, "WEB_CUSTOM_FORMAT_PREFIX", {
105
+ enumerable: true,
106
+ get: function() {
107
+ return WEB_CUSTOM_FORMAT_PREFIX;
108
+ }
109
+ });
110
+ Object.defineProperty(exports, "isTextualMimeType", {
111
+ enumerable: true,
112
+ get: function() {
113
+ return isTextualMimeType;
114
+ }
115
+ });
116
+ Object.defineProperty(exports, "isWebCustomFormat", {
117
+ enumerable: true,
118
+ get: function() {
119
+ return isWebCustomFormat;
120
+ }
121
+ });
122
+ Object.defineProperty(exports, "matchesMimePattern", {
123
+ enumerable: true,
124
+ get: function() {
125
+ return matchesMimePattern;
126
+ }
127
+ });
128
+ Object.defineProperty(exports, "normalizeClipboardType", {
129
+ enumerable: true,
130
+ get: function() {
131
+ return normalizeClipboardType;
132
+ }
133
+ });
134
+ Object.defineProperty(exports, "normalizeMimeType", {
135
+ enumerable: true,
136
+ get: function() {
137
+ return normalizeMimeType;
138
+ }
139
+ });
140
+ Object.defineProperty(exports, "sniffImageBytes", {
141
+ enumerable: true,
142
+ get: function() {
143
+ return sniffImageBytes;
144
+ }
145
+ });
146
+ Object.defineProperty(exports, "sniffImageType", {
147
+ enumerable: true,
148
+ get: function() {
149
+ return sniffImageType;
150
+ }
151
+ });
152
+
153
+ //# sourceMappingURL=mime--LB7kdqG.cjs.map