mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: rename elementType to activeTool and make it an object (#4968)
* refactor: rename elementType to activeTool * update docs * fix snap * update activeToll to be an object and review fixes * fix tests * fix
This commit is contained in:
parent
2209e2c1e8
commit
127af9db23
25 changed files with 364 additions and 207 deletions
|
@ -42,7 +42,7 @@ export const getDefaultAppState = (): Omit<
|
|||
editingGroupId: null,
|
||||
editingLinearElement: null,
|
||||
elementLocked: false,
|
||||
elementType: "selection",
|
||||
activeTool: { type: "selection" },
|
||||
penMode: false,
|
||||
penDetected: false,
|
||||
errorMessage: null,
|
||||
|
@ -131,7 +131,7 @@ const APP_STATE_STORAGE_CONF = (<
|
|||
editingGroupId: { browser: true, export: false, server: false },
|
||||
editingLinearElement: { browser: false, export: false, server: false },
|
||||
elementLocked: { browser: true, export: false, server: false },
|
||||
elementType: { browser: true, export: false, server: false },
|
||||
activeTool: { browser: true, export: false, server: false },
|
||||
penMode: { browser: true, export: false, server: false },
|
||||
penDetected: { browser: true, export: false, server: false },
|
||||
errorMessage: { browser: false, export: false, server: false },
|
||||
|
@ -215,7 +215,7 @@ export const clearAppStateForDatabase = (appState: Partial<AppState>) => {
|
|||
};
|
||||
|
||||
export const isEraserActive = ({
|
||||
elementType,
|
||||
activeTool,
|
||||
}: {
|
||||
elementType: AppState["elementType"];
|
||||
}) => elementType === "eraser";
|
||||
activeTool: AppState["activeTool"];
|
||||
}) => activeTool.type === "eraser";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue