feat: support contextMenuLabel to be of function type to support dynmaic labels (#4654)

This commit is contained in:
Aakansha Doshi 2022-01-27 17:47:23 +05:30 committed by GitHub
parent cbc6bd1ad8
commit 18c526d877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

View file

@ -123,7 +123,12 @@ export interface Action {
appState: AppState,
elements: readonly ExcalidrawElement[],
) => boolean;
contextItemLabel?: string;
contextItemLabel?:
| string
| ((
elements: readonly ExcalidrawElement[],
appState: Readonly<AppState>,
) => string);
contextItemPredicate?: (
elements: readonly ExcalidrawElement[],
appState: AppState,