2020-03-01 14:39:03 -05:00
|
|
|
import { AppState } from "../types";
|
2020-04-08 09:49:52 -07:00
|
|
|
import { NonDeletedExcalidrawElement } from "./types";
|
2020-03-01 14:39:03 -05:00
|
|
|
import { getSelectedElements } from "../scene";
|
|
|
|
|
|
|
|
export const showSelectedShapeActions = (
|
|
|
|
appState: AppState,
|
2020-04-08 09:49:52 -07:00
|
|
|
elements: readonly NonDeletedExcalidrawElement[],
|
2020-03-01 14:39:03 -05:00
|
|
|
) =>
|
|
|
|
Boolean(
|
2022-05-11 14:42:52 +02:00
|
|
|
(!appState.viewModeEnabled &&
|
|
|
|
appState.activeTool.type !== "custom" &&
|
2021-02-02 02:26:42 +05:30
|
|
|
(appState.editingElement ||
|
2022-03-25 20:46:01 +05:30
|
|
|
(appState.activeTool.type !== "selection" &&
|
2023-01-23 16:12:28 +01:00
|
|
|
appState.activeTool.type !== "eraser" &&
|
|
|
|
appState.activeTool.type !== "hand"))) ||
|
2022-05-11 14:42:52 +02:00
|
|
|
getSelectedElements(elements, appState).length,
|
2020-03-01 14:39:03 -05:00
|
|
|
);
|