react-smart-copy 0.2.1 → 1.0.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/README.md +7 -5
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -315,7 +315,7 @@ async function writeToClipboard(payload, env, degradeHtmlToText) {
|
|
|
315
315
|
case "multi": {
|
|
316
316
|
const rich = getRichClipboard(env, clipboard);
|
|
317
317
|
if (!rich) throw fail("unsupported-format", "Multi-format copy requires ClipboardItem and navigator.clipboard.write().");
|
|
318
|
-
const record =
|
|
318
|
+
const record = Object.create(null);
|
|
319
319
|
for (const { mimeType, data } of payload.items) {
|
|
320
320
|
if (!isTypeSupported(rich.Item, mimeType)) throw fail("unsupported-format", `This browser cannot write "${mimeType}" to the clipboard.`);
|
|
321
321
|
record[mimeType] = typeof data === "string" ? new Blob([data], { type: mimeType }) : data;
|
|
@@ -1232,12 +1232,12 @@ function useCopyField() {
|
|
|
1232
1232
|
return context;
|
|
1233
1233
|
}
|
|
1234
1234
|
/** Maps non-text payload kinds to a human-readable description for screen readers. */
|
|
1235
|
-
const KIND_LABELS = /* @__PURE__ */ Object.freeze({
|
|
1235
|
+
const KIND_LABELS = /* @__PURE__ */ Object.freeze(Object.assign(Object.create(null), {
|
|
1236
1236
|
html: "Rich text",
|
|
1237
1237
|
image: "Image",
|
|
1238
1238
|
json: "JSON data",
|
|
1239
1239
|
multi: "Mixed content"
|
|
1240
|
-
});
|
|
1240
|
+
}));
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Returns the value's text representation when it is plain text, or a
|
|
1243
1243
|
* descriptive fallback for non-text payloads so screen-reader users understand
|