feat(editor): ERD arrowheads and diagrams (#10940)

This commit is contained in:
David Luzar
2026-03-11 22:00:31 +01:00
committed by GitHub
parent 92d25446d6
commit 816c81c12e
21 changed files with 834 additions and 367 deletions
+8 -2
View File
@@ -22,6 +22,7 @@ import {
import {
calculateFixedPointForNonElbowArrowBinding,
getNonDeletedElements,
normalizeArrowhead,
isPointInElement,
isValidPolygon,
projectFixedPointOntoDiagonal,
@@ -426,7 +427,8 @@ export const restoreElement = (
// @ts-ignore LEGACY type
// eslint-disable-next-line no-fallthrough
case "draw":
const { startArrowhead = null, endArrowhead = null } = element;
const startArrowhead = normalizeArrowhead(element.startArrowhead);
const endArrowhead = normalizeArrowhead(element.endArrowhead);
let x = element.x;
let y = element.y;
let points = // migrate old arrow model to new one
@@ -458,7 +460,11 @@ export const restoreElement = (
...getSizeFromPoints(points),
});
case "arrow": {
const { startArrowhead = null, endArrowhead = "arrow" } = element;
const startArrowhead = normalizeArrowhead(element.startArrowhead);
const endArrowhead =
element.endArrowhead === undefined
? "arrow"
: normalizeArrowhead(element.endArrowhead);
const x: number | undefined = element.x;
const y: number | undefined = element.y;
const points: readonly LocalPoint[] | undefined = // migrate old arrow model to new one