mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-24 09:50:56 +02:00
lint
This commit is contained in:
@@ -1529,10 +1529,7 @@ export const actionChangeContainerBehavior = register({
|
|||||||
|
|
||||||
// collect directly selected eligible containers
|
// collect directly selected eligible containers
|
||||||
for (const el of selected) {
|
for (const el of selected) {
|
||||||
if (
|
if (isFlowchartNodeElement(el) && getBoundTextElement(el, elementsMap)) {
|
||||||
isFlowchartNodeElement(el) &&
|
|
||||||
getBoundTextElement(el, elementsMap)
|
|
||||||
) {
|
|
||||||
containerIdsToUpdate.add(el.id);
|
containerIdsToUpdate.add(el.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1603,8 +1600,7 @@ export const actionChangeContainerBehavior = register({
|
|||||||
// case 2: any eligible containers directly selected
|
// case 2: any eligible containers directly selected
|
||||||
targetContainers = selected.filter(
|
targetContainers = selected.filter(
|
||||||
(el) =>
|
(el) =>
|
||||||
isFlowchartNodeElement(el) &&
|
isFlowchartNodeElement(el) && getBoundTextElement(el, elementsMap),
|
||||||
getBoundTextElement(el, elementsMap),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -151,11 +151,13 @@ export const SelectedShapeActions = ({
|
|||||||
isSingleElementBoundContainer = true;
|
isSingleElementBoundContainer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textContainer = targetElements.length === 1 && isTextElement(targetElements[0])
|
const textContainer =
|
||||||
? getContainerElement(targetElements[0], elementsMap)
|
targetElements.length === 1 && isTextElement(targetElements[0])
|
||||||
: null;
|
? getContainerElement(targetElements[0], elementsMap)
|
||||||
|
: null;
|
||||||
|
|
||||||
const isStickyNoteContainer = textContainer && isFlowchartNodeElement(textContainer);
|
const isStickyNoteContainer =
|
||||||
|
textContainer && isFlowchartNodeElement(textContainer);
|
||||||
|
|
||||||
const isEditingTextOrNewElement = Boolean(
|
const isEditingTextOrNewElement = Boolean(
|
||||||
appState.editingTextElement || appState.newElement,
|
appState.editingTextElement || appState.newElement,
|
||||||
@@ -241,7 +243,7 @@ export const SelectedShapeActions = ({
|
|||||||
renderAction("changeTextAlign")}
|
renderAction("changeTextAlign")}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
|
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
|
||||||
renderAction("changeVerticalAlign")}
|
renderAction("changeVerticalAlign")}
|
||||||
{(canHaveArrowheads(appState.activeTool.type) ||
|
{(canHaveArrowheads(appState.activeTool.type) ||
|
||||||
@@ -250,7 +252,7 @@ export const SelectedShapeActions = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{isStickyNoteContainer && <>{renderAction("changeContainerBehavior")}</>}
|
{isStickyNoteContainer && <>{renderAction("changeContainerBehavior")}</>}
|
||||||
|
|
||||||
{renderAction("changeOpacity")}
|
{renderAction("changeOpacity")}
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@@ -344,11 +346,13 @@ export const CompactShapeActions = ({
|
|||||||
appState.editingTextElement || appState.newElement,
|
appState.editingTextElement || appState.newElement,
|
||||||
);
|
);
|
||||||
|
|
||||||
const textContainer = targetElements.length === 1 && isTextElement(targetElements[0])
|
const textContainer =
|
||||||
? getContainerElement(targetElements[0], elementsMap)
|
targetElements.length === 1 && isTextElement(targetElements[0])
|
||||||
: null;
|
? getContainerElement(targetElements[0], elementsMap)
|
||||||
|
: null;
|
||||||
|
|
||||||
const isStickyNoteContainer = textContainer && isFlowchartNodeElement(textContainer);
|
const isStickyNoteContainer =
|
||||||
|
textContainer && isFlowchartNodeElement(textContainer);
|
||||||
|
|
||||||
const showFillIcons =
|
const showFillIcons =
|
||||||
(hasBackground(appState.activeTool.type) &&
|
(hasBackground(appState.activeTool.type) &&
|
||||||
@@ -632,7 +636,9 @@ export const CompactShapeActions = ({
|
|||||||
renderAction("changeTextAlign")}
|
renderAction("changeTextAlign")}
|
||||||
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
|
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
|
||||||
renderAction("changeVerticalAlign")}
|
renderAction("changeVerticalAlign")}
|
||||||
{isStickyNoteContainer && <>{renderAction("changeContainerBehavior")}</>}
|
{isStickyNoteContainer && (
|
||||||
|
<>{renderAction("changeContainerBehavior")}</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</PropertiesPopover>
|
</PropertiesPopover>
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user