mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge remote-tracking branch 'origin/master' into aakansha-custom-elements
This commit is contained in:
commit
5b78f50fe3
43 changed files with 287 additions and 110 deletions
13
src/utils.ts
13
src/utils.ts
|
@ -613,6 +613,19 @@ export const updateObject = <T extends Record<string, any>>(
|
|||
};
|
||||
};
|
||||
|
||||
export const isPrimitive = (val: any) => {
|
||||
const type = typeof val;
|
||||
return val == null || (type !== "object" && type !== "function");
|
||||
};
|
||||
|
||||
export const getFrame = () => {
|
||||
try {
|
||||
return window.self === window.top ? "top" : "iframe";
|
||||
} catch (error) {
|
||||
return "iframe";
|
||||
}
|
||||
};
|
||||
|
||||
export const getCustomElementConfig = (
|
||||
customElementConfig: ExcalidrawProps["customElementsConfig"],
|
||||
customType: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue