feat: cache most of element selection (#6747)

This commit is contained in:
David Luzar
2023-07-17 01:09:44 +02:00
committed by GitHub
parent 2e46e27490
commit 9f76f8677b
27 changed files with 452 additions and 3755 deletions

View File

@@ -130,6 +130,7 @@ export type PanelComponentProps = {
updateData: (formData?: any) => void;
appProps: ExcalidrawProps;
data?: Record<string, any>;
app: AppClassProperties;
};
export interface Action {
@@ -141,12 +142,14 @@ export interface Action {
event: React.KeyboardEvent | KeyboardEvent,
appState: AppState,
elements: readonly ExcalidrawElement[],
app: AppClassProperties,
) => boolean;
contextItemLabel?:
| string
| ((
elements: readonly ExcalidrawElement[],
appState: Readonly<AppState>,
app: AppClassProperties,
) => string);
predicate?: (
elements: readonly ExcalidrawElement[],