mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
rewrite clipboard handling (#689)
This commit is contained in:
parent
dab35c9033
commit
954d805cb3
6 changed files with 259 additions and 99 deletions
|
@ -15,11 +15,7 @@ import { t } from "../i18n";
|
|||
|
||||
import { KEYS } from "../keys";
|
||||
|
||||
const probablySupportsClipboard =
|
||||
"toBlob" in HTMLCanvasElement.prototype &&
|
||||
"clipboard" in navigator &&
|
||||
"write" in navigator.clipboard &&
|
||||
"ClipboardItem" in window;
|
||||
import { probablySupportsClipboardBlob } from "../clipboard";
|
||||
|
||||
const scales = [1, 2, 3];
|
||||
const defaultScale = scales.includes(devicePixelRatio) ? devicePixelRatio : 1;
|
||||
|
@ -145,7 +141,7 @@ function ExportModal({
|
|||
aria-label={t("buttons.exportToSvg")}
|
||||
onClick={() => onExportToSvg(exportedElements, scale)}
|
||||
/>
|
||||
{probablySupportsClipboard && (
|
||||
{probablySupportsClipboardBlob && (
|
||||
<ToolButton
|
||||
type="button"
|
||||
icon={clipboard}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue