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(
|
2021-02-02 02:26:42 +05:30
|
|
|
!appState.viewModeEnabled &&
|
|
|
|
(appState.editingElement ||
|
|
|
|
getSelectedElements(elements, appState).length ||
|
|
|
|
appState.elementType !== "selection"),
|
2020-03-01 14:39:03 -05:00
|
|
|
);
|