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:
@ -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;
|
||||
|
Reference in New Issue
Block a user