lint
This commit is contained in:
@@ -258,8 +258,8 @@ export const handleFocusPointDrag = (
|
|||||||
switchToInsideBinding && arrow[bindingField]?.mode === "orbit"
|
switchToInsideBinding && arrow[bindingField]?.mode === "orbit"
|
||||||
? "inside"
|
? "inside"
|
||||||
: !switchToInsideBinding && arrow[bindingField]?.mode === "inside"
|
: !switchToInsideBinding && arrow[bindingField]?.mode === "inside"
|
||||||
? "orbit"
|
? "orbit"
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
// If no existing binding, create it
|
// If no existing binding, create it
|
||||||
if (!arrow[bindingField] || newMode) {
|
if (!arrow[bindingField] || newMode) {
|
||||||
@@ -473,7 +473,7 @@ export const handleFocusPointPointerUp = (
|
|||||||
if (boundElement) {
|
if (boundElement) {
|
||||||
scene.mutateElement(boundElement, {
|
scene.mutateElement(boundElement, {
|
||||||
boundElements: [
|
boundElements: [
|
||||||
...(boundElement.boundElements || [])?.filter(
|
...(boundElement.boundElements || []).filter(
|
||||||
({ id }) => id !== arrow.id,
|
({ id }) => id !== arrow.id,
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -825,20 +825,20 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
|
|||||||
focusPoint: appState.selectedLinearElement.initialState.altFocusPoint,
|
focusPoint: appState.selectedLinearElement.initialState.altFocusPoint,
|
||||||
}
|
}
|
||||||
: opts?.angleLocked && otherBindableElement
|
: opts?.angleLocked && otherBindableElement
|
||||||
? {
|
? {
|
||||||
mode: "orbit",
|
mode: "orbit",
|
||||||
element: otherBindableElement,
|
element: otherBindableElement,
|
||||||
focusPoint:
|
focusPoint:
|
||||||
projectFixedPointOntoDiagonal(
|
projectFixedPointOntoDiagonal(
|
||||||
arrow,
|
arrow,
|
||||||
otherEndpoint,
|
otherEndpoint,
|
||||||
otherBindableElement,
|
otherBindableElement,
|
||||||
startDragged ? "end" : "start",
|
startDragged ? "end" : "start",
|
||||||
elementsMap,
|
elementsMap,
|
||||||
appState.zoom,
|
appState.zoom,
|
||||||
) || otherEndpoint,
|
) || otherEndpoint,
|
||||||
}
|
}
|
||||||
: { mode: undefined }
|
: { mode: undefined }
|
||||||
: { mode: undefined };
|
: { mode: undefined };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -1849,8 +1849,8 @@ export const updateBoundPoint = (
|
|||||||
return LinearElementEditor.createPointAt(
|
return LinearElementEditor.createPointAt(
|
||||||
arrow,
|
arrow,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
arrowTooShort ? focusPoint[0] : outlinePoint?.[0] ?? focusPoint[0],
|
arrowTooShort ? focusPoint[0] : (outlinePoint?.[0] ?? focusPoint[0]),
|
||||||
arrowTooShort ? focusPoint[1] : outlinePoint?.[1] ?? focusPoint[1],
|
arrowTooShort ? focusPoint[1] : (outlinePoint?.[1] ?? focusPoint[1]),
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ const parseGoogleDriveVideoLink = (
|
|||||||
// normalize to seconds for a stable preview URL.
|
// normalize to seconds for a stable preview URL.
|
||||||
timestamp: timestamp > 0 ? timestamp : undefined,
|
timestamp: timestamp > 0 ? timestamp : undefined,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -615,10 +615,10 @@ export class LinearElementEditor {
|
|||||||
updates?.suggestedBinding?.element.id !== startBindingElement.id // The end point is not hovering the start bindable + it's binding gap
|
updates?.suggestedBinding?.element.id !== startBindingElement.id // The end point is not hovering the start bindable + it's binding gap
|
||||||
? startBindingElement
|
? startBindingElement
|
||||||
: startIsSelected && // The "other" end (i.e. "start") is dragged
|
: startIsSelected && // The "other" end (i.e. "start") is dragged
|
||||||
endBindingElement &&
|
endBindingElement &&
|
||||||
updates?.suggestedBinding?.element.id !== endBindingElement.id // The start point is not hovering the end bindable + it's binding gap
|
updates?.suggestedBinding?.element.id !== endBindingElement.id // The start point is not hovering the end bindable + it's binding gap
|
||||||
? endBindingElement
|
? endBindingElement
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const newLinearElementEditor: LinearElementEditor = {
|
const newLinearElementEditor: LinearElementEditor = {
|
||||||
...linearElementEditor,
|
...linearElementEditor,
|
||||||
@@ -2137,8 +2137,8 @@ const pointDraggingUpdates = (
|
|||||||
const suggestedBindingElement = startIsDragged
|
const suggestedBindingElement = startIsDragged
|
||||||
? start.element
|
? start.element
|
||||||
: endIsDragged
|
: endIsDragged
|
||||||
? end.element
|
? end.element
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
positions: naiveDraggingPoints,
|
positions: naiveDraggingPoints,
|
||||||
@@ -2364,19 +2364,19 @@ const pointDraggingUpdates = (
|
|||||||
const endLocalPoint = startIsDraggingOverEndElement
|
const endLocalPoint = startIsDraggingOverEndElement
|
||||||
? nextArrow.points[nextArrow.points.length - 1]
|
? nextArrow.points[nextArrow.points.length - 1]
|
||||||
: endIsDraggingOverStartElement &&
|
: endIsDraggingOverStartElement &&
|
||||||
app.state.bindMode !== "inside" &&
|
app.state.bindMode !== "inside" &&
|
||||||
getFeatureFlag("COMPLEX_BINDINGS")
|
getFeatureFlag("COMPLEX_BINDINGS")
|
||||||
? nextArrow.points[0]
|
? nextArrow.points[0]
|
||||||
: endBindable
|
: endBindable
|
||||||
? updateBoundPoint(
|
? updateBoundPoint(
|
||||||
element,
|
element,
|
||||||
"endBinding",
|
"endBinding",
|
||||||
nextArrow.endBinding,
|
nextArrow.endBinding,
|
||||||
endBindable,
|
endBindable,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
endIsDragged,
|
endIsDragged,
|
||||||
) || nextArrow.points[nextArrow.points.length - 1]
|
) || nextArrow.points[nextArrow.points.length - 1]
|
||||||
: nextArrow.points[nextArrow.points.length - 1];
|
: nextArrow.points[nextArrow.points.length - 1];
|
||||||
|
|
||||||
// We need to keep the simulated next arrow up-to-date, because
|
// We need to keep the simulated next arrow up-to-date, because
|
||||||
// updateBoundPoint looks at the opposite point
|
// updateBoundPoint looks at the opposite point
|
||||||
@@ -2395,19 +2395,19 @@ const pointDraggingUpdates = (
|
|||||||
endIsDraggingOverStartElement && getFeatureFlag("COMPLEX_BINDINGS")
|
endIsDraggingOverStartElement && getFeatureFlag("COMPLEX_BINDINGS")
|
||||||
? nextArrow.points[0]
|
? nextArrow.points[0]
|
||||||
: startIsDraggingOverEndElement &&
|
: startIsDraggingOverEndElement &&
|
||||||
app.state.bindMode !== "inside" &&
|
app.state.bindMode !== "inside" &&
|
||||||
getFeatureFlag("COMPLEX_BINDINGS")
|
getFeatureFlag("COMPLEX_BINDINGS")
|
||||||
? endLocalPoint
|
? endLocalPoint
|
||||||
: startBindable
|
: startBindable
|
||||||
? updateBoundPoint(
|
? updateBoundPoint(
|
||||||
element,
|
element,
|
||||||
"startBinding",
|
"startBinding",
|
||||||
nextArrow.startBinding,
|
nextArrow.startBinding,
|
||||||
startBindable,
|
startBindable,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
startIsDragged,
|
startIsDragged,
|
||||||
) || nextArrow.points[0]
|
) || nextArrow.points[0]
|
||||||
: nextArrow.points[0];
|
: nextArrow.points[0];
|
||||||
|
|
||||||
const endChanged =
|
const endChanged =
|
||||||
!startIsDraggingOverEndElement &&
|
!startIsDraggingOverEndElement &&
|
||||||
|
|||||||
@@ -343,7 +343,6 @@ export function deconstructRectanguloidElement(
|
|||||||
|
|
||||||
export function getDiamondBaseCorners(
|
export function getDiamondBaseCorners(
|
||||||
element: ExcalidrawDiamondElement,
|
element: ExcalidrawDiamondElement,
|
||||||
offset: number = 0,
|
|
||||||
): Curve<GlobalPoint>[] {
|
): Curve<GlobalPoint>[] {
|
||||||
const [topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY] =
|
const [topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY] =
|
||||||
getDiamondPoints(element);
|
getDiamondPoints(element);
|
||||||
|
|||||||
@@ -4906,8 +4906,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
prevState.currentItemArrowType === ARROW_TYPE.sharp
|
prevState.currentItemArrowType === ARROW_TYPE.sharp
|
||||||
? ARROW_TYPE.round
|
? ARROW_TYPE.round
|
||||||
: prevState.currentItemArrowType === ARROW_TYPE.round
|
: prevState.currentItemArrowType === ARROW_TYPE.round
|
||||||
? ARROW_TYPE.elbow
|
? ARROW_TYPE.elbow
|
||||||
: ARROW_TYPE.sharp,
|
: ARROW_TYPE.sharp,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,8 @@
|
|||||||
max-height: calc(100svh - var(--editor-container-padding) * 2 - 2.25rem);
|
max-height: calc(100svh - var(--editor-container-padding) * 2 - 2.25rem);
|
||||||
|
|
||||||
@at-root .excalidraw.theme--dark#{&} {
|
@at-root .excalidraw.theme--dark#{&} {
|
||||||
box-shadow: var(--box-shadow, var(--shadow-island)),
|
box-shadow:
|
||||||
|
var(--box-shadow, var(--shadow-island)),
|
||||||
0 0 0 1px rgba(0, 0, 0, 0.15);
|
0 0 0 1px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ const DropdownMenuItemLink = ({
|
|||||||
<a
|
<a
|
||||||
{...rest}
|
{...rest}
|
||||||
href={href}
|
href={href}
|
||||||
// oxlint-disable-next-line react/jsx-no-target-blank
|
// oxlint-disable-next-line react/jsx-no-target-blank
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel={`noopener ${rel || ""}`}
|
rel={`noopener ${rel || ""}`}
|
||||||
className={getDropdownMenuItemClassName(className, selected)}
|
className={getDropdownMenuItemClassName(className, selected)}
|
||||||
title={rest.title ?? rest["aria-label"]}
|
title={rest.title ?? rest["aria-label"]}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
"@excalidraw/math": "0.18.0",
|
"@excalidraw/math": "0.18.0",
|
||||||
"@excalidraw/mermaid-to-excalidraw": "2.0.0-rfc3",
|
"@excalidraw/mermaid-to-excalidraw": "2.0.0-rfc3",
|
||||||
"@excalidraw/random-username": "1.1.0",
|
"@excalidraw/random-username": "1.1.0",
|
||||||
"radix-ui": "1.4.3",
|
|
||||||
"browser-fs-access": "0.29.1",
|
"browser-fs-access": "0.29.1",
|
||||||
"canvas-roundrect-polyfill": "0.0.1",
|
"canvas-roundrect-polyfill": "0.0.1",
|
||||||
"clsx": "1.1.1",
|
"clsx": "1.1.1",
|
||||||
@@ -84,6 +83,7 @@
|
|||||||
"png-chunks-extract": "1.0.0",
|
"png-chunks-extract": "1.0.0",
|
||||||
"points-on-curve": "1.0.1",
|
"points-on-curve": "1.0.1",
|
||||||
"pwacompat": "2.0.17",
|
"pwacompat": "2.0.17",
|
||||||
|
"radix-ui": "1.4.3",
|
||||||
"roughjs": "4.6.4",
|
"roughjs": "4.6.4",
|
||||||
"sass": "1.51.0",
|
"sass": "1.51.0",
|
||||||
"tunnel-rat": "0.1.2"
|
"tunnel-rat": "0.1.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user