Merge remote-tracking branch 'origin/master' into non-wysiwyg-text
This commit is contained in:
commit
95e796840a
@ -1,4 +1,9 @@
|
|||||||
import { BOUND_TEXT_PADDING, ROUNDNESS, VERTICAL_ALIGN } from "../constants";
|
import {
|
||||||
|
BOUND_TEXT_PADDING,
|
||||||
|
ROUNDNESS,
|
||||||
|
VERTICAL_ALIGN,
|
||||||
|
TEXT_ALIGN,
|
||||||
|
} from "../constants";
|
||||||
import { getNonDeletedElements, isTextElement, newElement } from "../element";
|
import { getNonDeletedElements, isTextElement, newElement } from "../element";
|
||||||
import { mutateElement } from "../element/mutateElement";
|
import { mutateElement } from "../element/mutateElement";
|
||||||
import {
|
import {
|
||||||
@ -132,6 +137,7 @@ export const actionBindText = register({
|
|||||||
mutateElement(textElement, {
|
mutateElement(textElement, {
|
||||||
containerId: container.id,
|
containerId: container.id,
|
||||||
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
verticalAlign: VERTICAL_ALIGN.MIDDLE,
|
||||||
|
textAlign: TEXT_ALIGN.CENTER,
|
||||||
});
|
});
|
||||||
mutateElement(container, {
|
mutateElement(container, {
|
||||||
boundElements: (container.boundElements || []).concat({
|
boundElements: (container.boundElements || []).concat({
|
||||||
|
@ -165,11 +165,12 @@ export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {
|
|||||||
shortcuts={[KEYS.E, KEYS["0"]]}
|
shortcuts={[KEYS.E, KEYS["0"]]}
|
||||||
/>
|
/>
|
||||||
<Shortcut
|
<Shortcut
|
||||||
label={t("helpDialog.editSelectedShape")}
|
label={t("helpDialog.editLineArrowPoints")}
|
||||||
shortcuts={[
|
shortcuts={[getShortcutKey("CtrlOrCmd+Enter")]}
|
||||||
getShortcutKey("CtrlOrCmd+Enter"),
|
/>
|
||||||
getShortcutKey(`CtrlOrCmd + ${t("helpDialog.doubleClick")}`),
|
<Shortcut
|
||||||
]}
|
label={t("helpDialog.editText")}
|
||||||
|
shortcuts={[getShortcutKey("Enter")]}
|
||||||
/>
|
/>
|
||||||
<Shortcut
|
<Shortcut
|
||||||
label={t("helpDialog.textNewLine")}
|
label={t("helpDialog.textNewLine")}
|
||||||
|
@ -777,6 +777,13 @@ describe("textWysiwyg", () => {
|
|||||||
]);
|
]);
|
||||||
expect(text.containerId).toBe(rectangle.id);
|
expect(text.containerId).toBe(rectangle.id);
|
||||||
expect(text.verticalAlign).toBe(VERTICAL_ALIGN.MIDDLE);
|
expect(text.verticalAlign).toBe(VERTICAL_ALIGN.MIDDLE);
|
||||||
|
expect(text.textAlign).toBe(TEXT_ALIGN.CENTER);
|
||||||
|
expect(text.x).toBe(
|
||||||
|
h.elements[0].x + h.elements[0].width / 2 - text.width / 2,
|
||||||
|
);
|
||||||
|
expect(text.y).toBe(
|
||||||
|
h.elements[0].y + h.elements[0].height / 2 - text.height / 2,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update font family correctly on undo/redo by selecting bounded text when font family was updated", async () => {
|
it("should update font family correctly on undo/redo by selecting bounded text when font family was updated", async () => {
|
||||||
|
@ -319,7 +319,8 @@
|
|||||||
"doubleClick": "double-click",
|
"doubleClick": "double-click",
|
||||||
"drag": "drag",
|
"drag": "drag",
|
||||||
"editor": "Editor",
|
"editor": "Editor",
|
||||||
"editSelectedShape": "Edit selected shape (text/arrow/line)",
|
"editLineArrowPoints": "Edit line/arrow points",
|
||||||
|
"editText": "Edit text / add label",
|
||||||
"github": "Found an issue? Submit",
|
"github": "Found an issue? Submit",
|
||||||
"howto": "Follow our guides",
|
"howto": "Follow our guides",
|
||||||
"or": "or",
|
"or": "or",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user