excalidraw/src/element/showSelectedShapeActions.ts

16 lines
507 B
TypeScript
Raw Normal View History

import { AppState } from "../types";
import { NonDeletedExcalidrawElement } from "./types";
import { getSelectedElements } from "../scene";
export const showSelectedShapeActions = (
appState: AppState,
elements: readonly NonDeletedExcalidrawElement[],
) =>
Boolean(
!appState.viewModeEnabled &&
(appState.editingElement ||
getSelectedElements(elements, appState).length ||
(appState.activeTool.type !== "selection" &&
appState.activeTool.type !== "eraser")),
);