|
|
|
|
@ -1,7 +1,8 @@
@@ -1,7 +1,8 @@
|
|
|
|
|
import React from "react"; |
|
|
|
|
import { AppState } from "../types"; |
|
|
|
|
import { ExcalidrawElement } from "../element/types"; |
|
|
|
|
import { ActionManager } from "../actions/manager"; |
|
|
|
|
import { hasBackground, hasStroke, hasText } from "../scene"; |
|
|
|
|
import { hasBackground, hasStroke, hasText, getTargetElement } from "../scene"; |
|
|
|
|
import { t } from "../i18n"; |
|
|
|
|
import { SHAPES } from "../shapes"; |
|
|
|
|
import { ToolButton } from "./ToolButton"; |
|
|
|
|
@ -11,14 +12,18 @@ import Stack from "./Stack";
@@ -11,14 +12,18 @@ import Stack from "./Stack";
|
|
|
|
|
import useIsMobile from "../is-mobile"; |
|
|
|
|
|
|
|
|
|
export function SelectedShapeActions({ |
|
|
|
|
targetElements, |
|
|
|
|
appState, |
|
|
|
|
elements, |
|
|
|
|
renderAction, |
|
|
|
|
elementType, |
|
|
|
|
}: { |
|
|
|
|
targetElements: readonly ExcalidrawElement[]; |
|
|
|
|
appState: AppState; |
|
|
|
|
elements: readonly ExcalidrawElement[]; |
|
|
|
|
renderAction: ActionManager["renderAction"]; |
|
|
|
|
elementType: ExcalidrawElement["type"]; |
|
|
|
|
}) { |
|
|
|
|
const targetElements = getTargetElement(elements, appState); |
|
|
|
|
const isEditing = Boolean(appState.editingElement); |
|
|
|
|
const isMobile = useIsMobile(); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
@ -62,7 +67,7 @@ export function SelectedShapeActions({
@@ -62,7 +67,7 @@ export function SelectedShapeActions({
|
|
|
|
|
{renderAction("bringForward")} |
|
|
|
|
</div> |
|
|
|
|
</fieldset> |
|
|
|
|
{!isMobile && ( |
|
|
|
|
{!isMobile && !isEditing && targetElements.length > 0 && ( |
|
|
|
|
<fieldset> |
|
|
|
|
<legend>{t("labels.actions")}</legend> |
|
|
|
|
<div className="buttonList"> |
|
|
|
|
|