mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
support making transform handles optional
This commit is contained in:
parent
61699ff3c2
commit
3d0a1106ff
9 changed files with 133 additions and 48 deletions
12
src/utils.ts
12
src/utils.ts
|
@ -11,7 +11,7 @@ import {
|
|||
WINDOWS_EMOJI_FALLBACK_FONT,
|
||||
} from "./constants";
|
||||
import { FontFamilyValues, FontString } from "./element/types";
|
||||
import { AppState, DataURL, Zoom } from "./types";
|
||||
import { AppState, DataURL, ExcalidrawProps, Zoom } from "./types";
|
||||
import { unstable_batchedUpdates } from "react-dom";
|
||||
import { isDarwin } from "./keys";
|
||||
|
||||
|
@ -612,3 +612,13 @@ export const updateObject = <T extends Record<string, any>>(
|
|||
...updates,
|
||||
};
|
||||
};
|
||||
|
||||
export const getCustomElementConfig = (
|
||||
customElementConfig: ExcalidrawProps["customElementsConfig"],
|
||||
name: string,
|
||||
) => {
|
||||
if (!customElementConfig) {
|
||||
return null;
|
||||
}
|
||||
return customElementConfig.find((config) => config.name === name);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue