fix: center align text when wrapped in container via context menu (#6480)

* rename action to wrapTextInContainer

* fix: center align text when wrapped in container via context menu

* revert translation key

* fix tests
This commit is contained in:
Aakansha Doshi 2023-04-18 19:44:14 +05:30 committed by GitHub
parent 4d0d844e39
commit 979312f779
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 13 deletions

View file

@ -196,8 +196,8 @@ const pushContainerBelowText = (
return updatedElements;
};
export const actionCreateContainerFromText = register({
name: "createContainerFromText",
export const actionWrapTextInContainer = register({
name: "wrapTextInContainer",
contextItemLabel: "labels.createContainerFromText",
trackEvent: { category: "element" },
predicate: (elements, appState) => {
@ -286,6 +286,7 @@ export const actionCreateContainerFromText = register({
containerId: container.id,
verticalAlign: VERTICAL_ALIGN.MIDDLE,
boundElements: null,
textAlign: TEXT_ALIGN.CENTER,
},
false,
);

View file

@ -115,7 +115,7 @@ export type ActionName =
| "toggleLinearEditor"
| "toggleEraserTool"
| "toggleHandTool"
| "createContainerFromText";
| "wrapTextInContainer";
export type PanelComponentProps = {
elements: readonly ExcalidrawElement[];