feat: canvas search (#8438)

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
Ryan Di 2024-09-09 23:12:07 +08:00 committed by GitHub
parent 5a11c70714
commit 6959a363f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1424 additions and 47 deletions

View file

@ -198,6 +198,8 @@ export type InteractiveCanvasAppState = Readonly<
snapLines: AppState["snapLines"];
zenModeEnabled: AppState["zenModeEnabled"];
editingTextElement: AppState["editingTextElement"];
// Search matches
searchMatches: AppState["searchMatches"];
}
>;
@ -384,8 +386,20 @@ export interface AppState {
userToFollow: UserToFollow | null;
/** the socket ids of the users following the current user */
followedBy: Set<SocketId>;
searchMatches: readonly SearchMatch[];
}
type SearchMatch = {
id: string;
focus: boolean;
matchedLines: {
offsetX: number;
offsetY: number;
width: number;
height: number;
}[];
};
export type UIAppState = Omit<
AppState,
| "suggestedBindings"
@ -642,6 +656,9 @@ export type AppClassProperties = {
getEffectiveGridSize: App["getEffectiveGridSize"];
setPlugins: App["setPlugins"];
plugins: App["plugins"];
getEditorUIOffsets: App["getEditorUIOffsets"];
visibleElements: App["visibleElements"];
excalidrawContainerValue: App["excalidrawContainerValue"];
};
export type PointerDownState = Readonly<{