mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Enter and Exit line editor via context menu (#5719)
* feat: Enter and exit line editor via context menu * Add tests * fix * review fixes * fix
This commit is contained in:
parent
b477c2ad6b
commit
6c1246ef77
6 changed files with 103 additions and 2 deletions
|
@ -34,6 +34,7 @@ import {
|
|||
actionUngroup,
|
||||
actionLink,
|
||||
actionToggleLock,
|
||||
actionToggleLinearEditor,
|
||||
} from "../actions";
|
||||
import { createRedoAction, createUndoAction } from "../actions/actionHistory";
|
||||
import { ActionManager } from "../actions/manager";
|
||||
|
@ -5876,6 +5877,12 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.actionManager.getAppState(),
|
||||
);
|
||||
|
||||
const mayBeAllowToggleLineEditing =
|
||||
actionToggleLinearEditor.contextItemPredicate(
|
||||
this.actionManager.getElementsIncludingDeleted(),
|
||||
this.actionManager.getAppState(),
|
||||
);
|
||||
|
||||
const separator = "separator";
|
||||
|
||||
const elements = this.scene.getNonDeletedElements();
|
||||
|
@ -6017,6 +6024,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
maybeFlipHorizontal && actionFlipHorizontal,
|
||||
maybeFlipVertical && actionFlipVertical,
|
||||
(maybeFlipHorizontal || maybeFlipVertical) && separator,
|
||||
mayBeAllowToggleLineEditing && actionToggleLinearEditor,
|
||||
actionLink.contextItemPredicate(elements, this.state) && actionLink,
|
||||
actionDuplicateSelection,
|
||||
actionToggleLock,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue