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:
Aakansha Doshi 2022-09-27 16:54:50 +05:30 committed by GitHub
parent b477c2ad6b
commit 6c1246ef77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 103 additions and 2 deletions

View file

@ -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,