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
File diff suppressed because it is too large
Load diff
|
@ -85,7 +85,7 @@ const getHints = ({ appState, isMobile, device, app }: HintViewerProps) => {
|
|||
|
||||
if (activeTool.type === "selection") {
|
||||
if (
|
||||
appState.draggingElement?.type === "selection" &&
|
||||
appState.selectionElement &&
|
||||
!selectedElements.length &&
|
||||
!appState.editingElement &&
|
||||
!appState.editingLinearElement
|
||||
|
@ -93,7 +93,7 @@ const getHints = ({ appState, isMobile, device, app }: HintViewerProps) => {
|
|||
return t("hints.deepBoxSelect");
|
||||
}
|
||||
|
||||
if (appState.gridSize && appState.draggingElement) {
|
||||
if (appState.gridSize && appState.selectedElementsAreBeingDragged) {
|
||||
return t("hints.disableSnapping");
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,8 @@ const getHints = ({ appState, isMobile, device, app }: HintViewerProps) => {
|
|||
return t("hints.lineEditor_info");
|
||||
}
|
||||
if (
|
||||
!appState.draggingElement &&
|
||||
!appState.newElement &&
|
||||
!appState.selectedElementsAreBeingDragged &&
|
||||
isTextBindableContainer(selectedElements[0])
|
||||
) {
|
||||
return t("hints.bindTextToElement");
|
||||
|
|
|
@ -211,7 +211,7 @@ export const Hyperlink = ({
|
|||
const { x, y } = getCoordsForPopover(element, appState, elementsMap);
|
||||
if (
|
||||
appState.contextMenu ||
|
||||
appState.draggingElement ||
|
||||
appState.selectedElementsAreBeingDragged ||
|
||||
appState.resizingElement ||
|
||||
appState.isRotating ||
|
||||
appState.openMenu ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue