@ai-matrx/media 0.10.0 → 0.10.1
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/CHANGELOG.md +4 -0
- package/dist/react.cjs +3 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/dist/share.cjs +3 -8
- package/dist/share.cjs.map +1 -1
- package/dist/share.js +3 -8
- package/dist/share.js.map +1 -1
- package/dist/viewers.cjs +3 -2
- package/dist/viewers.cjs.map +1 -1
- package/dist/viewers.js +3 -2
- package/dist/viewers.js.map +1 -1
- package/package.json +2 -2
package/dist/viewers.js
CHANGED
|
@@ -54,6 +54,7 @@ function cn(...inputs) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/viewers/chrome.tsx
|
|
57
|
+
import { copyText } from "@ai-matrx/kit/clipboard";
|
|
57
58
|
import { formatFileSize } from "@ai-matrx/kit/format";
|
|
58
59
|
import { useCallback, useState } from "react";
|
|
59
60
|
import { ErrorBox } from "@ai-matrx/design-system";
|
|
@@ -301,10 +302,10 @@ function ViewerCopyButton({
|
|
|
301
302
|
const [copied, setCopied] = useState(false);
|
|
302
303
|
const onCopy = useCallback(() => {
|
|
303
304
|
if (text == null) return;
|
|
304
|
-
void
|
|
305
|
+
void copyText(text).then((landed) => {
|
|
306
|
+
if (!landed) return;
|
|
305
307
|
setCopied(true);
|
|
306
308
|
setTimeout(() => setCopied(false), 1600);
|
|
307
|
-
}).catch(() => {
|
|
308
309
|
});
|
|
309
310
|
}, [text]);
|
|
310
311
|
return /* @__PURE__ */ jsxs2(
|