mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add onLinkOpen
component prop (#4694)
Co-authored-by: ad1992 <aakansha1216@gmail.com>
This commit is contained in:
parent
050bc1ce2b
commit
a066317d3c
11 changed files with 128 additions and 32 deletions
10
src/utils.ts
10
src/utils.ts
|
@ -2,6 +2,7 @@ import colors from "./colors";
|
|||
import {
|
||||
CURSOR_TYPE,
|
||||
DEFAULT_VERSION,
|
||||
EVENT,
|
||||
FONT_FAMILY,
|
||||
WINDOWS_EMOJI_FALLBACK_FONT,
|
||||
} from "./constants";
|
||||
|
@ -523,3 +524,12 @@ export const arrayToMap = <T extends { id: string } | string>(
|
|||
|
||||
export const isTestEnv = () =>
|
||||
typeof process !== "undefined" && process.env?.NODE_ENV === "test";
|
||||
|
||||
export const wrapEvent = <T extends Event>(name: EVENT, nativeEvent: T) => {
|
||||
return new CustomEvent(name, {
|
||||
detail: {
|
||||
nativeEvent,
|
||||
},
|
||||
cancelable: true,
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue