mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Add onPaste prop to customise clipboard paste event (#3420)
* Add Awaited type util * Expose onPasteFromClipboard props * Add `event` as second param for advanced usages * Add support for async flows * Extract ClipboardData type * Rename `onPasteFromClipboard` to `onPaste` * Remove unused type helper * Add `onPaste` documentation * tweak docs * fix Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
89472c14ed
commit
d91950bd03
6 changed files with 39 additions and 8 deletions
|
@ -20,6 +20,7 @@ import { ExcalidrawImperativeAPI } from "./components/App";
|
|||
import type { ResolvablePromise } from "./utils";
|
||||
import { Spreadsheet } from "./charts";
|
||||
import { Language } from "./i18n";
|
||||
import { ClipboardData } from "./clipboard";
|
||||
|
||||
export type Point = Readonly<RoughPoint>;
|
||||
|
||||
|
@ -177,6 +178,10 @@ export interface ExcalidrawProps {
|
|||
appState: AppState,
|
||||
canvas: HTMLCanvasElement | null,
|
||||
) => void;
|
||||
onPaste?: (
|
||||
data: ClipboardData,
|
||||
event: ClipboardEvent | null,
|
||||
) => Promise<boolean> | boolean;
|
||||
renderFooter?: (isMobile: boolean) => JSX.Element;
|
||||
langCode?: Language["code"];
|
||||
viewModeEnabled?: boolean;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue