@ai-matrx/media 0.9.2 → 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/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 navigator.clipboard.writeText(text).then(() => {
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(