mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: rename draggingElement
-> newElement
(#8294)
* add newElement to appState * freedraw should not be an editing element * do not set editing element for freedraw and generic * remove ununsed `appState.draggingElement` * remove setting dragged for new linear element * decouple selection element from new element * fix hint for text bindables * update snapshot * fixes * fix frame regressions * add comments to types * document `editingElement` --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
8d530cf102
commit
3cf14c73a3
17 changed files with 554 additions and 684 deletions
|
@ -73,8 +73,8 @@ export const actionFinalize = register({
|
|||
|
||||
const multiPointElement = appState.multiElement
|
||||
? appState.multiElement
|
||||
: appState.editingElement?.type === "freedraw"
|
||||
? appState.editingElement
|
||||
: appState.newElement?.type === "freedraw"
|
||||
? appState.newElement
|
||||
: null;
|
||||
|
||||
if (multiPointElement) {
|
||||
|
@ -176,7 +176,8 @@ export const actionFinalize = register({
|
|||
? appState.activeTool
|
||||
: activeTool,
|
||||
activeEmbeddable: null,
|
||||
draggingElement: null,
|
||||
newElement: null,
|
||||
selectionElement: null,
|
||||
multiElement: null,
|
||||
editingElement: null,
|
||||
startBoundElement: null,
|
||||
|
@ -204,7 +205,7 @@ export const actionFinalize = register({
|
|||
keyTest: (event, appState) =>
|
||||
(event.key === KEYS.ESCAPE &&
|
||||
(appState.editingLinearElement !== null ||
|
||||
(!appState.draggingElement && appState.multiElement === null))) ||
|
||||
(!appState.newElement && appState.multiElement === null))) ||
|
||||
((event.key === KEYS.ESCAPE || event.key === KEYS.ENTER) &&
|
||||
appState.multiElement !== null),
|
||||
PanelComponent: ({ appState, updateData, data }) => (
|
||||
|
|
|
@ -21,7 +21,9 @@ const writeData = (
|
|||
!appState.multiElement &&
|
||||
!appState.resizingElement &&
|
||||
!appState.editingElement &&
|
||||
!appState.draggingElement
|
||||
!appState.newElement &&
|
||||
!appState.selectedElementsAreBeingDragged &&
|
||||
!appState.selectionElement
|
||||
) {
|
||||
const result = updater();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue