Merge remote-tracking branch 'origin/master' into aakansha-custom-elements

This commit is contained in:
ad1992 2022-03-29 15:34:48 +05:30
commit 5b78f50fe3
43 changed files with 287 additions and 110 deletions

View file

@ -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,