mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support unbinding bound text (#4686)
* feat: support unbinding text * fix unbound text * move the unbind option next to group action * use boundTextElement.id when unbinding * update original text so it takes same bounding box when unbind * Add spec * recompute measurements when unbinding
This commit is contained in:
parent
719ae7b72f
commit
edfbac9d7d
7 changed files with 100 additions and 4 deletions
|
@ -26,6 +26,7 @@ import {
|
|||
actionToggleGridMode,
|
||||
actionToggleStats,
|
||||
actionToggleZenMode,
|
||||
actionUnbindText,
|
||||
actionUngroup,
|
||||
} from "../actions";
|
||||
import { createRedoAction, createUndoAction } from "../actions/actionHistory";
|
||||
|
@ -5031,6 +5032,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||
});
|
||||
}
|
||||
} else if (type === "element") {
|
||||
const elementsWithUnbindedText = getSelectedElements(
|
||||
elements,
|
||||
this.state,
|
||||
).some((element) => !hasBoundTextElement(element));
|
||||
if (this.state.viewModeEnabled) {
|
||||
ContextMenu.push({
|
||||
options: [navigator.clipboard && actionCopy, ...options],
|
||||
|
@ -5064,6 +5069,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
actionPasteStyles,
|
||||
separator,
|
||||
maybeGroupAction && actionGroup,
|
||||
!elementsWithUnbindedText && actionUnbindText,
|
||||
maybeUngroupAction && actionUngroup,
|
||||
(maybeGroupAction || maybeUngroupAction) && separator,
|
||||
actionAddToLibrary,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue