Partialy fixing element package

This commit is contained in:
Marcel Mraz 2025-03-17 17:01:19 +01:00
parent 5e68895709
commit e2c2218f62
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
45 changed files with 383 additions and 206 deletions

View file

@ -0,0 +1,21 @@
import { getSelectedElements } from "@excalidraw/excalidraw/scene";
import type { UIAppState } from "@excalidraw/excalidraw/types";
import type { NonDeletedExcalidrawElement } from "./types";
export const showSelectedShapeActions = (
appState: UIAppState,
elements: readonly NonDeletedExcalidrawElement[],
) =>
Boolean(
!appState.viewModeEnabled &&
appState.openDialog?.name !== "elementLinkSelector" &&
((appState.activeTool.type !== "custom" &&
(appState.editingTextElement ||
(appState.activeTool.type !== "selection" &&
appState.activeTool.type !== "eraser" &&
appState.activeTool.type !== "hand" &&
appState.activeTool.type !== "laser"))) ||
getSelectedElements(elements, appState).length),
);