refactor
This commit is contained in:
parent
c7dc728cc0
commit
5a7feb0fe2
|
@ -7,7 +7,7 @@ import { getFontString } from "../utils";
|
|||
import { register } from "./register";
|
||||
|
||||
export const actionUnwrapText = register({
|
||||
name: "unwrapText",
|
||||
name: "autoTextSize",
|
||||
label: "labels.autoTextSize",
|
||||
icon: null,
|
||||
trackEvent: { category: "element" },
|
||||
|
@ -16,7 +16,7 @@ export const actionUnwrapText = register({
|
|||
return (
|
||||
selectedElements.length === 1 &&
|
||||
isTextElement(selectedElements[0]) &&
|
||||
selectedElements[0].autoResize === false
|
||||
!selectedElements[0].autoResize
|
||||
);
|
||||
},
|
||||
perform: (elements, appState, _, app) => {
|
||||
|
|
|
@ -135,7 +135,7 @@ export type ActionName =
|
|||
| "createContainerFromText"
|
||||
| "wrapTextInContainer"
|
||||
| "commandPalette"
|
||||
| "unwrapText";
|
||||
| "autoTextSize";
|
||||
|
||||
export type PanelComponentProps = {
|
||||
elements: readonly ExcalidrawElement[];
|
||||
|
|
|
@ -316,7 +316,7 @@ export const textWysiwyg = ({
|
|||
let whiteSpace = "pre";
|
||||
let wordBreak = "normal";
|
||||
|
||||
if (isBoundToContainer(element) || element.autoResize === false) {
|
||||
if (isBoundToContainer(element) || !element.autoResize) {
|
||||
whiteSpace = "pre-wrap";
|
||||
wordBreak = "break-word";
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
|
|||
{
|
||||
"icon": null,
|
||||
"label": "labels.autoTextSize",
|
||||
"name": "unwrapText",
|
||||
"name": "autoTextSize",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": {
|
||||
|
@ -4428,7 +4428,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
|
|||
{
|
||||
"icon": null,
|
||||
"label": "labels.autoTextSize",
|
||||
"name": "unwrapText",
|
||||
"name": "autoTextSize",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": {
|
||||
|
@ -5539,7 +5539,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
|
|||
{
|
||||
"icon": null,
|
||||
"label": "labels.autoTextSize",
|
||||
"name": "unwrapText",
|
||||
"name": "autoTextSize",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": {
|
||||
|
@ -7357,7 +7357,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
|
|||
{
|
||||
"icon": null,
|
||||
"label": "labels.autoTextSize",
|
||||
"name": "unwrapText",
|
||||
"name": "autoTextSize",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": {
|
||||
|
@ -8235,7 +8235,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
|
|||
{
|
||||
"icon": null,
|
||||
"label": "labels.autoTextSize",
|
||||
"name": "unwrapText",
|
||||
"name": "autoTextSize",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": {
|
||||
|
|
Loading…
Reference in New Issue