stickyflow 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-B3YRZVMR.cjs → chunk-2GKXPZRL.cjs} +23 -23
- package/dist/{chunk-B3YRZVMR.cjs.map → chunk-2GKXPZRL.cjs.map} +1 -1
- package/dist/{chunk-SQBF2BKT.cjs → chunk-3EOG34QN.cjs} +48 -44
- package/dist/chunk-3EOG34QN.cjs.map +1 -0
- package/dist/{chunk-CM35H45Z.js → chunk-AAP24GBG.js} +3 -3
- package/dist/{chunk-CM35H45Z.js.map → chunk-AAP24GBG.js.map} +1 -1
- package/dist/{chunk-QL7MNEMT.cjs → chunk-C25NWWIH.cjs} +48 -3
- package/dist/chunk-C25NWWIH.cjs.map +1 -0
- package/dist/{chunk-ZCGZJBAT.js → chunk-C3LVKPWQ.js} +19 -15
- package/dist/chunk-C3LVKPWQ.js.map +1 -0
- package/dist/{chunk-YSXD5IVZ.cjs → chunk-EURX7QT3.cjs} +672 -657
- package/dist/chunk-EURX7QT3.cjs.map +1 -0
- package/dist/{chunk-FS6L462E.js → chunk-G2N3KJYJ.js} +22 -7
- package/dist/chunk-G2N3KJYJ.js.map +1 -0
- package/dist/{chunk-OUWGWDJ2.cjs → chunk-MR32IJQO.cjs} +15 -15
- package/dist/{chunk-OUWGWDJ2.cjs.map → chunk-MR32IJQO.cjs.map} +1 -1
- package/dist/{chunk-D2266VBZ.js → chunk-Q6FBISNP.js} +48 -3
- package/dist/chunk-Q6FBISNP.js.map +1 -0
- package/dist/{chunk-BUVUJMWT.js → chunk-XNNNIOJU.js} +4 -4
- package/dist/{chunk-BUVUJMWT.js.map → chunk-XNNNIOJU.js.map} +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +230 -230
- package/dist/interaction/index.js +2 -2
- package/dist/stickyflow-diagram.global.js +37 -37
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.js +4 -4
- package/dist/web-component/index.cjs +6 -6
- package/dist/web-component/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-D2266VBZ.js.map +0 -1
- package/dist/chunk-FS6L462E.js.map +0 -1
- package/dist/chunk-QL7MNEMT.cjs.map +0 -1
- package/dist/chunk-SQBF2BKT.cjs.map +0 -1
- package/dist/chunk-YSXD5IVZ.cjs.map +0 -1
- package/dist/chunk-ZCGZJBAT.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkMR32IJQO_cjs = require('../chunk-MR32IJQO.cjs');
|
|
4
|
+
var chunkC25NWWIH_cjs = require('../chunk-C25NWWIH.cjs');
|
|
5
5
|
|
|
6
6
|
// src/runtime/interaction/chartValue/coordinates.ts
|
|
7
7
|
function pointerUserY(svg, event) {
|
|
@@ -70,13 +70,13 @@ function updateConnectedLine(svg, drag) {
|
|
|
70
70
|
}));
|
|
71
71
|
const line = findConnectedLine(svg, drag.owner.id, drag.series);
|
|
72
72
|
if (line) {
|
|
73
|
-
line.setAttribute("d",
|
|
73
|
+
line.setAttribute("d", chunkC25NWWIH_cjs.linePathData(points, drag.lineTension));
|
|
74
74
|
}
|
|
75
75
|
const area = findConnectedLineArea(svg, drag.owner.id, drag.series);
|
|
76
76
|
if (area && points.length > 1) {
|
|
77
77
|
const first = points[0];
|
|
78
78
|
const last = points[points.length - 1];
|
|
79
|
-
const d = `${
|
|
79
|
+
const d = `${chunkC25NWWIH_cjs.linePathData(points, drag.lineTension)} L ${last.x} ${drag.baseY} L ${first.x} ${drag.baseY} Z`;
|
|
80
80
|
area.setAttribute("d", d);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -90,14 +90,14 @@ function setBarPath(svg, drag, d) {
|
|
|
90
90
|
function updateChartValuePreview(svg, drag, value) {
|
|
91
91
|
if (drag.isBar && drag.scale.horizontal) {
|
|
92
92
|
const width = Math.max(0, pixelForValue(value, drag.scale) - drag.barX);
|
|
93
|
-
setBarPath(svg, drag,
|
|
93
|
+
setBarPath(svg, drag, chunkC25NWWIH_cjs.roundedBarPath(drag.barX, drag.barTop, width, drag.barHeight, drag.barRadius));
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
const y = pixelForValue(value, drag.scale);
|
|
97
97
|
if (drag.isBar) {
|
|
98
98
|
const top = Math.min(y, drag.baseY);
|
|
99
99
|
const height = Math.max(0, Math.abs(drag.baseY - y));
|
|
100
|
-
setBarPath(svg, drag,
|
|
100
|
+
setBarPath(svg, drag, chunkC25NWWIH_cjs.barShapePath(drag.barX, top, drag.barWidth, height, drag.barRadius));
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
drag.element.setAttribute("cy", String(y));
|
|
@@ -120,24 +120,24 @@ function labelShift(placement, origin, top, height) {
|
|
|
120
120
|
}
|
|
121
121
|
function resizePill(pill, text, label, dy) {
|
|
122
122
|
const fontSize = parseFloat(text.getAttribute("font-size") ?? "12");
|
|
123
|
-
const size =
|
|
123
|
+
const size = chunkC25NWWIH_cjs.barLabelSize(label, fontSize, true);
|
|
124
124
|
const stored = pill.dataset.sfPillY ?? (pill.getAttribute("d") ?? "").split(/\s+/)[2];
|
|
125
125
|
pill.dataset.sfPillY = stored;
|
|
126
126
|
const centerX = Number(text.getAttribute("x"));
|
|
127
|
-
pill.setAttribute("d",
|
|
127
|
+
pill.setAttribute("d", chunkC25NWWIH_cjs.pillPath(centerX - size.width / 2, Number(stored), size.width, size.height));
|
|
128
128
|
pill.setAttribute("transform", `translate(0 ${dy})`);
|
|
129
129
|
}
|
|
130
130
|
function updateHorizontalBarLabel(label, drag, origin, value) {
|
|
131
|
-
const content =
|
|
131
|
+
const content = chunkC25NWWIH_cjs.formatBarLabel(value, label.template);
|
|
132
132
|
(label.text.querySelector("tspan") ?? label.text).textContent = content;
|
|
133
133
|
if (label.placement === "axis") {
|
|
134
134
|
return true;
|
|
135
135
|
}
|
|
136
136
|
const fontSize = parseFloat(label.text.getAttribute("font-size") ?? "12");
|
|
137
|
-
const size =
|
|
137
|
+
const size = chunkC25NWWIH_cjs.barLabelSize(content, fontSize, label.pill !== null);
|
|
138
138
|
const width = Math.max(0, pixelForValue(value, drag.scale) - origin.left);
|
|
139
139
|
const end = origin.left + width;
|
|
140
|
-
const center = label.placement === "outside" ? end +
|
|
140
|
+
const center = label.placement === "outside" ? end + chunkC25NWWIH_cjs.BAR_LABEL.gap + size.width / 2 : label.placement === "inside" ? end - chunkC25NWWIH_cjs.BAR_LABEL.gap - size.width / 2 : origin.left + width / 2;
|
|
141
141
|
const stored = label.text.dataset.sfLabelX ?? label.text.getAttribute("x") ?? "0";
|
|
142
142
|
label.text.dataset.sfLabelX = stored;
|
|
143
143
|
label.text.setAttribute("transform", `translate(${center - Number(stored)} 0)`);
|
|
@@ -145,7 +145,7 @@ function updateHorizontalBarLabel(label, drag, origin, value) {
|
|
|
145
145
|
const pillY = label.pill.dataset.sfPillY ?? (label.pill.getAttribute("d") ?? "").split(/\s+/)[2];
|
|
146
146
|
label.pill.dataset.sfPillY = pillY;
|
|
147
147
|
label.pill.removeAttribute("transform");
|
|
148
|
-
label.pill.setAttribute("d",
|
|
148
|
+
label.pill.setAttribute("d", chunkC25NWWIH_cjs.pillPath(center - size.width / 2, Number(pillY), size.width, size.height));
|
|
149
149
|
}
|
|
150
150
|
return true;
|
|
151
151
|
}
|
|
@@ -161,7 +161,7 @@ function updateBarLabel(svg, drag, origin, value) {
|
|
|
161
161
|
const top = Math.min(y, drag.baseY);
|
|
162
162
|
const height = Math.abs(drag.baseY - y);
|
|
163
163
|
const dy = labelShift(label.placement, origin, top, height);
|
|
164
|
-
const content =
|
|
164
|
+
const content = chunkC25NWWIH_cjs.formatBarLabel(value, label.template);
|
|
165
165
|
(label.text.querySelector("tspan") ?? label.text).textContent = content;
|
|
166
166
|
label.text.setAttribute("transform", `translate(0 ${dy})`);
|
|
167
167
|
if (label.pill) {
|
|
@@ -177,7 +177,7 @@ var HEIGHT = 18;
|
|
|
177
177
|
var GAP = 8;
|
|
178
178
|
var BACKGROUND = "rgba(15, 23, 42, 0.9)";
|
|
179
179
|
function element(svg, tag) {
|
|
180
|
-
return svg.ownerDocument.createElementNS(
|
|
180
|
+
return svg.ownerDocument.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, tag);
|
|
181
181
|
}
|
|
182
182
|
function createValueReadout(svg) {
|
|
183
183
|
const group = element(svg, "g");
|
|
@@ -273,7 +273,7 @@ function resolveChartValueDrag(svg, event) {
|
|
|
273
273
|
if (!target) {
|
|
274
274
|
return null;
|
|
275
275
|
}
|
|
276
|
-
const scale = parseValueScale(
|
|
276
|
+
const scale = parseValueScale(chunkMR32IJQO_cjs.findOwnerNode(svg, target.owner.id, chunkMR32IJQO_cjs.isPrimary));
|
|
277
277
|
const geometry = scale ? resolveChartValueGeometry(svg, target, scale) : null;
|
|
278
278
|
if (!scale || !geometry) {
|
|
279
279
|
return null;
|
|
@@ -293,13 +293,13 @@ function createChartValueDragState(target, scale, geometry, pointerId) {
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
function isChartValuePointer(event) {
|
|
296
|
-
return event.button === 0 && !
|
|
296
|
+
return event.button === 0 && !chunkMR32IJQO_cjs.isCameraGesture(event);
|
|
297
297
|
}
|
|
298
298
|
function findChartValueMark(event) {
|
|
299
299
|
return event.target?.closest?.("[data-sf-value-index]");
|
|
300
300
|
}
|
|
301
301
|
function readChartValueTarget(mark) {
|
|
302
|
-
const owner =
|
|
302
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(mark);
|
|
303
303
|
if (owner?.role !== "chart") {
|
|
304
304
|
return null;
|
|
305
305
|
}
|
|
@@ -1751,7 +1751,7 @@ var ColorEditSession = class {
|
|
|
1751
1751
|
const hasOverride = target.node.getAttribute("data-sf-color-override") === "true";
|
|
1752
1752
|
this.#open = openColorPopover({
|
|
1753
1753
|
seed: seedFrom(fill, readGradientValue(this.#svg, fill)),
|
|
1754
|
-
anchor:
|
|
1754
|
+
anchor: chunkMR32IJQO_cjs.screenRectOf(target.node),
|
|
1755
1755
|
theme: resolveTheme(this.#theme),
|
|
1756
1756
|
allowGradient: !target.solidOnly,
|
|
1757
1757
|
onCommit: (color) => {
|
|
@@ -1833,7 +1833,7 @@ function resolveTarget(event, selector, pathOf, rules) {
|
|
|
1833
1833
|
return null;
|
|
1834
1834
|
}
|
|
1835
1835
|
const path = pathOf(node);
|
|
1836
|
-
const owner =
|
|
1836
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(node);
|
|
1837
1837
|
if (!path || !owner || !isEditablePath(path, rules) || requiresPriorSelection(node, owner)) {
|
|
1838
1838
|
return null;
|
|
1839
1839
|
}
|
|
@@ -1855,7 +1855,7 @@ function resolveZoneGradientTarget(event) {
|
|
|
1855
1855
|
if (!node) {
|
|
1856
1856
|
return null;
|
|
1857
1857
|
}
|
|
1858
|
-
const owner =
|
|
1858
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(node);
|
|
1859
1859
|
if (!owner) {
|
|
1860
1860
|
return null;
|
|
1861
1861
|
}
|
|
@@ -1891,7 +1891,7 @@ var ZoneGradientSession = class {
|
|
|
1891
1891
|
const beforeStops = sortStops(gradient.stops);
|
|
1892
1892
|
this.#open = openColorPopover({
|
|
1893
1893
|
seed: seedFrom(fill, gradient),
|
|
1894
|
-
anchor:
|
|
1894
|
+
anchor: chunkMR32IJQO_cjs.screenRectOf(target.node),
|
|
1895
1895
|
theme: resolveTheme(this.#theme),
|
|
1896
1896
|
allowGradient: true,
|
|
1897
1897
|
lockStops: true,
|
|
@@ -1964,15 +1964,15 @@ function bindDeleteSelection(viewer, emitter) {
|
|
|
1964
1964
|
}
|
|
1965
1965
|
|
|
1966
1966
|
// src/runtime/interaction/events.ts
|
|
1967
|
-
var Emitter2 = class extends
|
|
1967
|
+
var Emitter2 = class extends chunkMR32IJQO_cjs.Emitter {
|
|
1968
1968
|
};
|
|
1969
1969
|
|
|
1970
1970
|
// src/runtime/interaction/linkPreview/geometry.ts
|
|
1971
1971
|
function anchorPoint(bounds, side, other) {
|
|
1972
1972
|
if (side) {
|
|
1973
|
-
return
|
|
1973
|
+
return chunkC25NWWIH_cjs.pointAtPort(bounds, { side, offset: 0.5 });
|
|
1974
1974
|
}
|
|
1975
|
-
return
|
|
1975
|
+
return chunkC25NWWIH_cjs.edgePointToward(bounds, other);
|
|
1976
1976
|
}
|
|
1977
1977
|
function polylinePathData(points) {
|
|
1978
1978
|
if (points.length < 4) {
|
|
@@ -1989,7 +1989,7 @@ function previewPathData(points, segments, pathType, strokeWidth) {
|
|
|
1989
1989
|
return `M ${points[0]} ${points[1]} C ${points[2]} ${points[3]} ${points[4]} ${points[5]} ${points[6]} ${points[7]}`;
|
|
1990
1990
|
}
|
|
1991
1991
|
if (pathType === "orthogonal" && segments.length > 0) {
|
|
1992
|
-
return
|
|
1992
|
+
return chunkC25NWWIH_cjs.roundedOrthogonalPathData(segments, Math.max(16, strokeWidth * 4));
|
|
1993
1993
|
}
|
|
1994
1994
|
return polylinePathData(points);
|
|
1995
1995
|
}
|
|
@@ -2009,8 +2009,8 @@ function previewLink(fromSide, toSide) {
|
|
|
2009
2009
|
function routePreviewLink(fromBounds, toBounds, fromSide, toSide, pathType) {
|
|
2010
2010
|
const from = anchorPoint(fromBounds, fromSide, toBounds);
|
|
2011
2011
|
const to = anchorPoint(toBounds, toSide, fromBounds);
|
|
2012
|
-
const { points, segments } =
|
|
2013
|
-
return { points, segments, midpoint:
|
|
2012
|
+
const { points, segments } = chunkC25NWWIH_cjs.calculateLinkRoute(previewLink(fromSide, toSide), from, to, pathType);
|
|
2013
|
+
return { points, segments, midpoint: chunkC25NWWIH_cjs.getLineMidpoint(points, pathType, from, to) };
|
|
2014
2014
|
}
|
|
2015
2015
|
|
|
2016
2016
|
// src/runtime/interaction/linkPreview/discovery.ts
|
|
@@ -2042,7 +2042,7 @@ function resolveOppositeEndpoint(svg, path, canvasObjectId) {
|
|
|
2042
2042
|
if (!otherId) {
|
|
2043
2043
|
return null;
|
|
2044
2044
|
}
|
|
2045
|
-
const otherPrimary =
|
|
2045
|
+
const otherPrimary = chunkMR32IJQO_cjs.findOwnerNode(svg, otherId, chunkMR32IJQO_cjs.isPrimary);
|
|
2046
2046
|
return otherPrimary ? { draggedIsFrom, bounds: otherPrimary.getBBox() } : null;
|
|
2047
2047
|
}
|
|
2048
2048
|
function captureLiveLinkLabel(svg, draft, draggedBounds) {
|
|
@@ -2089,8 +2089,8 @@ function resolveOtherFacePoint(svg, path, canvasObjectId) {
|
|
|
2089
2089
|
if (!otherId || !face || !otherFace) {
|
|
2090
2090
|
return null;
|
|
2091
2091
|
}
|
|
2092
|
-
const otherPrimary =
|
|
2093
|
-
const otherGeometry = otherPrimary &&
|
|
2092
|
+
const otherPrimary = chunkMR32IJQO_cjs.findOwnerNode(svg, otherId, chunkMR32IJQO_cjs.isPrimary);
|
|
2093
|
+
const otherGeometry = otherPrimary && chunkMR32IJQO_cjs.isometricGeometryOf(otherPrimary);
|
|
2094
2094
|
if (!otherGeometry?.bounds) {
|
|
2095
2095
|
return null;
|
|
2096
2096
|
}
|
|
@@ -2101,7 +2101,7 @@ function resolveOtherFacePoint(svg, path, canvasObjectId) {
|
|
|
2101
2101
|
height: otherGeometry.height,
|
|
2102
2102
|
depth: otherGeometry.depth
|
|
2103
2103
|
};
|
|
2104
|
-
return { otherPoint:
|
|
2104
|
+
return { otherPoint: chunkC25NWWIH_cjs.isometricFaceCenter(otherObject, otherFace), draggedIsFrom, face };
|
|
2105
2105
|
}
|
|
2106
2106
|
function findLiveFaceLinks(svg, canvasObjectId) {
|
|
2107
2107
|
const escapedId = CSS.escape(canvasObjectId);
|
|
@@ -2120,7 +2120,7 @@ function findLiveFaceLinks(svg, canvasObjectId) {
|
|
|
2120
2120
|
|
|
2121
2121
|
// src/runtime/interaction/linkPreview/faceUpdate.ts
|
|
2122
2122
|
function updateLiveFaceLink(link, liveObject) {
|
|
2123
|
-
const draggedPoint =
|
|
2123
|
+
const draggedPoint = chunkC25NWWIH_cjs.isometricFaceCenter(liveObject, link.face);
|
|
2124
2124
|
const from = link.draggedIsFrom ? draggedPoint : link.otherPoint;
|
|
2125
2125
|
const to = link.draggedIsFrom ? link.otherPoint : draggedPoint;
|
|
2126
2126
|
link.path.setAttribute("d", `M ${from.x} ${from.y} L ${to.x} ${to.y}`);
|
|
@@ -2144,7 +2144,7 @@ function updateLabelGap(link, points) {
|
|
|
2144
2144
|
if (!link.labelGapSize) {
|
|
2145
2145
|
return;
|
|
2146
2146
|
}
|
|
2147
|
-
const gap =
|
|
2147
|
+
const gap = chunkC25NWWIH_cjs.labelGapDash(points, link.pathType, link.labelGapSize.width, link.labelGapSize.height);
|
|
2148
2148
|
if (gap) {
|
|
2149
2149
|
link.path.setAttribute("stroke-dasharray", `${gap.dashBefore} ${gap.gapLength} 1000000`);
|
|
2150
2150
|
} else {
|
|
@@ -2190,11 +2190,11 @@ function readIsometricSnapStep(svg) {
|
|
|
2190
2190
|
return step > 0 ? step : null;
|
|
2191
2191
|
}
|
|
2192
2192
|
function nearestIsometricLatticePoint(point, step) {
|
|
2193
|
-
const u = point.x / (
|
|
2194
|
-
const v = point.y / (
|
|
2193
|
+
const u = point.x / (chunkC25NWWIH_cjs.AXIS_COS * step);
|
|
2194
|
+
const v = point.y / (chunkC25NWWIH_cjs.AXIS_SIN * step);
|
|
2195
2195
|
const i = Math.round((u + v) / 2);
|
|
2196
2196
|
const j = Math.round((u - v) / 2);
|
|
2197
|
-
return { x: (i + j) *
|
|
2197
|
+
return { x: (i + j) * chunkC25NWWIH_cjs.AXIS_COS * step, y: (i - j) * chunkC25NWWIH_cjs.AXIS_SIN * step };
|
|
2198
2198
|
}
|
|
2199
2199
|
function snapToStep(value, step, min) {
|
|
2200
2200
|
return Math.max(min, Math.round(value / step) * step);
|
|
@@ -2207,21 +2207,21 @@ var LABEL_FONT_SIZE = 12;
|
|
|
2207
2207
|
var LABEL_LINE_HEIGHT = 1.2;
|
|
2208
2208
|
var LABEL_BASELINE_OFFSET = -LABEL_GAP - LABEL_HEIGHT + (LABEL_HEIGHT - LABEL_FONT_SIZE * LABEL_LINE_HEIGHT) / 2 + LABEL_FONT_SIZE;
|
|
2209
2209
|
function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
2210
|
-
const faces =
|
|
2211
|
-
nodes.top?.setAttribute("d",
|
|
2212
|
-
nodes.front?.setAttribute("d",
|
|
2213
|
-
nodes.side?.setAttribute("d",
|
|
2210
|
+
const faces = chunkC25NWWIH_cjs.isometricFaces(object);
|
|
2211
|
+
nodes.top?.setAttribute("d", chunkC25NWWIH_cjs.roundedPolygonPath(faces.top, 0));
|
|
2212
|
+
nodes.front?.setAttribute("d", chunkC25NWWIH_cjs.roundedPolygonPath(faces.front, 0));
|
|
2213
|
+
nodes.side?.setAttribute("d", chunkC25NWWIH_cjs.roundedPolygonPath(faces.right, 0));
|
|
2214
2214
|
const silhouette = [faces.top[0], faces.top[1], faces.right[2], faces.front[2], faces.front[3], faces.top[3]];
|
|
2215
|
-
const hullPath =
|
|
2215
|
+
const hullPath = chunkC25NWWIH_cjs.roundedPolygonPath(silhouette, cornerRadius);
|
|
2216
2216
|
nodes.hull?.setAttribute("d", hullPath);
|
|
2217
2217
|
if (overlay.halo) {
|
|
2218
|
-
|
|
2218
|
+
chunkMR32IJQO_cjs.updateHalo(overlay.halo, hullPath);
|
|
2219
2219
|
}
|
|
2220
|
-
const placements =
|
|
2220
|
+
const placements = chunkMR32IJQO_cjs.axisArrowPlacements(object);
|
|
2221
2221
|
Object.keys(placements).forEach((axis) => {
|
|
2222
2222
|
const group = overlay.arrows[axis];
|
|
2223
2223
|
if (group) {
|
|
2224
|
-
|
|
2224
|
+
chunkMR32IJQO_cjs.updateAxisArrowGroup(group, placements[axis].origin, placements[axis].direction, svg);
|
|
2225
2225
|
}
|
|
2226
2226
|
});
|
|
2227
2227
|
nodes.seams?.setAttribute(
|
|
@@ -2239,9 +2239,9 @@ function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
|
2239
2239
|
x: footprintCenter.x + (point.x - footprintCenter.x) * shadowSpread,
|
|
2240
2240
|
y: footprintCenter.y + (point.y - footprintCenter.y) * shadowSpread
|
|
2241
2241
|
}));
|
|
2242
|
-
nodes.groundShadow.setAttribute("d",
|
|
2242
|
+
nodes.groundShadow.setAttribute("d", chunkC25NWWIH_cjs.roundedPolygonPath(footprint, 0));
|
|
2243
2243
|
}
|
|
2244
|
-
const anchor =
|
|
2244
|
+
const anchor = chunkC25NWWIH_cjs.isometricTopFaceCenter(object);
|
|
2245
2245
|
if (nodes.labelGuide) {
|
|
2246
2246
|
nodes.labelGuide.setAttribute("d", `M ${anchor.x} ${anchor.y - LABEL_GAP} L ${anchor.x} ${anchor.y}`);
|
|
2247
2247
|
}
|
|
@@ -2257,7 +2257,7 @@ function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
|
2257
2257
|
// src/runtime/interaction/isometricAxisResize/state.ts
|
|
2258
2258
|
var AXES = ["width", "height", "depth"];
|
|
2259
2259
|
function collectNodes(svg, ownerId) {
|
|
2260
|
-
const all =
|
|
2260
|
+
const all = chunkMR32IJQO_cjs.findAllOwnerNodes(svg, ownerId);
|
|
2261
2261
|
const bySuffix = (suffix) => all.find((el2) => el2.id.endsWith(suffix)) ?? null;
|
|
2262
2262
|
return {
|
|
2263
2263
|
top: bySuffix("-top"),
|
|
@@ -2283,30 +2283,30 @@ function createIsometricAxisDragState(svg, event) {
|
|
|
2283
2283
|
if (!ownerId) {
|
|
2284
2284
|
return null;
|
|
2285
2285
|
}
|
|
2286
|
-
const primary =
|
|
2287
|
-
const owner = primary &&
|
|
2286
|
+
const primary = chunkMR32IJQO_cjs.findOwnerNode(svg, ownerId, chunkMR32IJQO_cjs.isPrimary);
|
|
2287
|
+
const owner = primary && chunkMR32IJQO_cjs.resolveOwner(primary);
|
|
2288
2288
|
if (!primary || owner?.role !== "isometric") {
|
|
2289
2289
|
return null;
|
|
2290
2290
|
}
|
|
2291
|
-
const startUser =
|
|
2291
|
+
const startUser = chunkMR32IJQO_cjs.pointerUserPoint(svg, event);
|
|
2292
2292
|
if (!startUser) {
|
|
2293
2293
|
return null;
|
|
2294
2294
|
}
|
|
2295
|
-
const geometry =
|
|
2295
|
+
const geometry = chunkMR32IJQO_cjs.isometricGeometryOf(primary);
|
|
2296
2296
|
const bounds = geometry?.bounds ?? primary.getBBox();
|
|
2297
2297
|
const nodes = collectNodes(svg, ownerId);
|
|
2298
2298
|
[nodes.top, nodes.front, nodes.side].forEach((node) => {
|
|
2299
2299
|
node?.removeAttribute("clip-path");
|
|
2300
2300
|
});
|
|
2301
2301
|
captureTarget.setPointerCapture?.(event.pointerId);
|
|
2302
|
-
const overlayHalo = overlay?.querySelector(`[${
|
|
2302
|
+
const overlayHalo = overlay?.querySelector(`[${chunkMR32IJQO_cjs.ISO_HALO_ATTR}]`) ?? null;
|
|
2303
2303
|
const overlayArrows = Object.fromEntries(
|
|
2304
2304
|
AXES.map((axis2) => [
|
|
2305
2305
|
axis2,
|
|
2306
2306
|
overlay?.querySelector(`[data-sf-resize-handle="iso-${axis2}"]`) ?? null
|
|
2307
2307
|
])
|
|
2308
2308
|
);
|
|
2309
|
-
const overlayDuplicateBubbles = overlay?.querySelector(`[${
|
|
2309
|
+
const overlayDuplicateBubbles = overlay?.querySelector(`[${chunkMR32IJQO_cjs.ISO_DUPLICATE_BUBBLES_ATTR}]`) ?? null;
|
|
2310
2310
|
if (overlayDuplicateBubbles) {
|
|
2311
2311
|
overlayDuplicateBubbles.style.display = "none";
|
|
2312
2312
|
}
|
|
@@ -2323,7 +2323,7 @@ function createIsometricAxisDragState(svg, event) {
|
|
|
2323
2323
|
pointerId: event.pointerId,
|
|
2324
2324
|
startUser,
|
|
2325
2325
|
start,
|
|
2326
|
-
cornerRadius: geometry?.cornerRadius ?? Number(primary.getAttribute(
|
|
2326
|
+
cornerRadius: geometry?.cornerRadius ?? Number(primary.getAttribute(chunkC25NWWIH_cjs.CORNER_RADIUS_ATTR)) ?? 0,
|
|
2327
2327
|
nodes,
|
|
2328
2328
|
overlayHalo,
|
|
2329
2329
|
overlayArrows,
|
|
@@ -2342,15 +2342,15 @@ function nextGeometry(drag, point, step) {
|
|
|
2342
2342
|
const dx = point.x - drag.startUser.x;
|
|
2343
2343
|
const dy = point.y - drag.startUser.y;
|
|
2344
2344
|
if (axis === "width") {
|
|
2345
|
-
const delta2 = dx *
|
|
2345
|
+
const delta2 = dx * chunkC25NWWIH_cjs.AXIS_COS + dy * chunkC25NWWIH_cjs.AXIS_SIN;
|
|
2346
2346
|
return { ...start, width: length(start.width + delta2, MIN_SIZE) };
|
|
2347
2347
|
}
|
|
2348
2348
|
if (axis === "height") {
|
|
2349
2349
|
return { ...start, height: length(start.height + dy, MIN_SIZE) };
|
|
2350
2350
|
}
|
|
2351
|
-
const delta = -dx *
|
|
2351
|
+
const delta = -dx * chunkC25NWWIH_cjs.AXIS_COS + dy * chunkC25NWWIH_cjs.AXIS_SIN;
|
|
2352
2352
|
const depth = length(start.depth + delta, 0);
|
|
2353
|
-
const x = start.x + (start.depth - depth) *
|
|
2353
|
+
const x = start.x + (start.depth - depth) * chunkC25NWWIH_cjs.AXIS_COS;
|
|
2354
2354
|
return { ...start, x, depth };
|
|
2355
2355
|
}
|
|
2356
2356
|
var IsometricAxisResizeSession = class {
|
|
@@ -2362,7 +2362,7 @@ var IsometricAxisResizeSession = class {
|
|
|
2362
2362
|
this.#emitter = emitter;
|
|
2363
2363
|
}
|
|
2364
2364
|
pointerDown = (event) => {
|
|
2365
|
-
if (event.button !== 0 || this.#drag ||
|
|
2365
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
2366
2366
|
return;
|
|
2367
2367
|
}
|
|
2368
2368
|
this.#drag = createIsometricAxisDragState(this.#svg, event);
|
|
@@ -2372,7 +2372,7 @@ var IsometricAxisResizeSession = class {
|
|
|
2372
2372
|
if (!drag || event.pointerId !== drag.pointerId) {
|
|
2373
2373
|
return;
|
|
2374
2374
|
}
|
|
2375
|
-
const point =
|
|
2375
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
2376
2376
|
if (!point) {
|
|
2377
2377
|
return;
|
|
2378
2378
|
}
|
|
@@ -2470,7 +2470,7 @@ function findLabelMark(event) {
|
|
|
2470
2470
|
);
|
|
2471
2471
|
}
|
|
2472
2472
|
function isLabelPointer(event) {
|
|
2473
|
-
return event.button === 0 && !
|
|
2473
|
+
return event.button === 0 && !chunkMR32IJQO_cjs.isCameraGesture(event);
|
|
2474
2474
|
}
|
|
2475
2475
|
function findHull(svg, ownerId) {
|
|
2476
2476
|
return svg.querySelector(`[data-sf-id="${CSS.escape(ownerId)}"][data-sf-primary="true"]`);
|
|
@@ -2486,21 +2486,21 @@ function resolveIsometricLabelDrag(svg, event) {
|
|
|
2486
2486
|
if (!clicked) {
|
|
2487
2487
|
return null;
|
|
2488
2488
|
}
|
|
2489
|
-
const owner =
|
|
2489
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(clicked);
|
|
2490
2490
|
if (owner?.role !== "isometric") {
|
|
2491
2491
|
return null;
|
|
2492
2492
|
}
|
|
2493
2493
|
const hull = findHull(svg, owner.id);
|
|
2494
|
-
const geometry = hull ?
|
|
2494
|
+
const geometry = hull ? chunkMR32IJQO_cjs.isometricGeometryOf(hull) : null;
|
|
2495
2495
|
if (!geometry?.bounds) {
|
|
2496
2496
|
return null;
|
|
2497
2497
|
}
|
|
2498
|
-
const start =
|
|
2498
|
+
const start = chunkMR32IJQO_cjs.pointerUserPoint(svg, event);
|
|
2499
2499
|
if (!start) {
|
|
2500
2500
|
return null;
|
|
2501
2501
|
}
|
|
2502
2502
|
const anchorX = geometry.bounds.x + geometry.bounds.width / 2;
|
|
2503
|
-
const anchorY = geometry.bounds.y + geometry.bounds.width * (
|
|
2503
|
+
const anchorY = geometry.bounds.y + geometry.bounds.width * (chunkC25NWWIH_cjs.AXIS_SIN / chunkC25NWWIH_cjs.AXIS_COS) / 2;
|
|
2504
2504
|
const text = findBySuffix(svg, `-${owner.id}-label`);
|
|
2505
2505
|
if (!text) {
|
|
2506
2506
|
return null;
|
|
@@ -2552,7 +2552,7 @@ var IsometricLabelDragSession = class {
|
|
|
2552
2552
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
2553
2553
|
return;
|
|
2554
2554
|
}
|
|
2555
|
-
const point =
|
|
2555
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
2556
2556
|
if (!point) {
|
|
2557
2557
|
return;
|
|
2558
2558
|
}
|
|
@@ -2627,7 +2627,7 @@ function isIsometricDirection(value) {
|
|
|
2627
2627
|
function bindIsometricQuickDuplicate(viewer, emitter) {
|
|
2628
2628
|
const svg = viewer.svg;
|
|
2629
2629
|
const onPointerDown = (event) => {
|
|
2630
|
-
if (event.button !== 0 ||
|
|
2630
|
+
if (event.button !== 0 || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
2631
2631
|
return;
|
|
2632
2632
|
}
|
|
2633
2633
|
const bubble = event.target?.closest("[data-sf-quick-duplicate]");
|
|
@@ -2638,7 +2638,7 @@ function bindIsometricQuickDuplicate(viewer, emitter) {
|
|
|
2638
2638
|
const overlay = bubble.closest("[data-sf-selection-overlay]");
|
|
2639
2639
|
const sourceId = overlay?.getAttribute("data-sf-selection-overlay");
|
|
2640
2640
|
const primary = sourceId ? svg.querySelector(`[data-sf-id="${CSS.escape(sourceId)}"][data-sf-primary="true"]`) : null;
|
|
2641
|
-
const owner = primary &&
|
|
2641
|
+
const owner = primary && chunkMR32IJQO_cjs.resolveOwner(primary);
|
|
2642
2642
|
if (!owner) {
|
|
2643
2643
|
return;
|
|
2644
2644
|
}
|
|
@@ -2706,7 +2706,7 @@ function updateEndpointPreview(drag, draggedPoint, draggedSide) {
|
|
|
2706
2706
|
const toPoint = drag.end === "to" ? draggedPoint : drag.fixedPoint;
|
|
2707
2707
|
const fromSide = drag.end === "from" ? draggedSide : drag.fixedSide;
|
|
2708
2708
|
const toSide = drag.end === "to" ? draggedSide : drag.fixedSide;
|
|
2709
|
-
const { points, segments } =
|
|
2709
|
+
const { points, segments } = chunkC25NWWIH_cjs.calculateLinkRoute(previewLink2(fromSide, toSide), fromPoint, toPoint, drag.pathType);
|
|
2710
2710
|
drag.path.setAttribute("d", previewPathData(points, segments, drag.pathType, drag.strokeWidth));
|
|
2711
2711
|
}
|
|
2712
2712
|
|
|
@@ -2728,7 +2728,7 @@ var LinkGhost = class {
|
|
|
2728
2728
|
constructor(svg, path) {
|
|
2729
2729
|
this.#svg = svg;
|
|
2730
2730
|
this.#path = path;
|
|
2731
|
-
this.#anchors = svg.ownerDocument.createElementNS(
|
|
2731
|
+
this.#anchors = svg.ownerDocument.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "g");
|
|
2732
2732
|
this.#anchors.setAttribute("data-sf-link-target", "");
|
|
2733
2733
|
this.#anchors.setAttribute("pointer-events", "none");
|
|
2734
2734
|
}
|
|
@@ -2738,7 +2738,7 @@ var LinkGhost = class {
|
|
|
2738
2738
|
for (const name of RESTORED_ATTRIBUTES) {
|
|
2739
2739
|
this.#saved.set(name, this.#path.getAttribute(name));
|
|
2740
2740
|
}
|
|
2741
|
-
const dash = GHOST_DASH_PX /
|
|
2741
|
+
const dash = GHOST_DASH_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
2742
2742
|
this.#path.setAttribute("stroke-dasharray", `${dash} ${dash}`);
|
|
2743
2743
|
this.#path.setAttribute("stroke-linecap", "round");
|
|
2744
2744
|
this.#path.setAttribute("opacity", GHOST_OPACITY);
|
|
@@ -2767,7 +2767,7 @@ var LinkGhost = class {
|
|
|
2767
2767
|
if (!bounds) {
|
|
2768
2768
|
return;
|
|
2769
2769
|
}
|
|
2770
|
-
const unit = 1 /
|
|
2770
|
+
const unit = 1 / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
2771
2771
|
const centers = [
|
|
2772
2772
|
[bounds.x + bounds.width / 2, bounds.y],
|
|
2773
2773
|
[bounds.x + bounds.width, bounds.y + bounds.height / 2],
|
|
@@ -2775,7 +2775,7 @@ var LinkGhost = class {
|
|
|
2775
2775
|
[bounds.x, bounds.y + bounds.height / 2]
|
|
2776
2776
|
];
|
|
2777
2777
|
for (const [cx, cy] of centers) {
|
|
2778
|
-
const dot = this.#svg.ownerDocument.createElementNS(
|
|
2778
|
+
const dot = this.#svg.ownerDocument.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "circle");
|
|
2779
2779
|
dot.setAttribute("cx", String(cx));
|
|
2780
2780
|
dot.setAttribute("cy", String(cy));
|
|
2781
2781
|
dot.setAttribute("r", String(ANCHOR_RADIUS_PX * unit));
|
|
@@ -2795,7 +2795,7 @@ function collectEndpointCandidates(svg) {
|
|
|
2795
2795
|
if (element2.getAttribute("data-sf-role") === "link") {
|
|
2796
2796
|
continue;
|
|
2797
2797
|
}
|
|
2798
|
-
const owner =
|
|
2798
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(element2);
|
|
2799
2799
|
if (owner) {
|
|
2800
2800
|
candidates.push({ owner, bounds: element2.getBBox() });
|
|
2801
2801
|
}
|
|
@@ -2872,7 +2872,7 @@ function inferFixedSide(svg, reference, fixedPrimary) {
|
|
|
2872
2872
|
if (reference.declaredSide) {
|
|
2873
2873
|
return reference.declaredSide;
|
|
2874
2874
|
}
|
|
2875
|
-
const draggedPrimary = reference.draggedId ?
|
|
2875
|
+
const draggedPrimary = reference.draggedId ? chunkMR32IJQO_cjs.findOwnerNode(svg, reference.draggedId, chunkMR32IJQO_cjs.isPrimary) : null;
|
|
2876
2876
|
if (!draggedPrimary) {
|
|
2877
2877
|
return "right";
|
|
2878
2878
|
}
|
|
@@ -2880,7 +2880,7 @@ function inferFixedSide(svg, reference, fixedPrimary) {
|
|
|
2880
2880
|
}
|
|
2881
2881
|
function resolveFixedEndpoint(svg, path, draggedEnd) {
|
|
2882
2882
|
const reference = fixedEndpointReference(path, draggedEnd);
|
|
2883
|
-
const fixedPrimary = reference.fixedId ?
|
|
2883
|
+
const fixedPrimary = reference.fixedId ? chunkMR32IJQO_cjs.findOwnerNode(svg, reference.fixedId, chunkMR32IJQO_cjs.isPrimary) : null;
|
|
2884
2884
|
if (!fixedPrimary) {
|
|
2885
2885
|
return null;
|
|
2886
2886
|
}
|
|
@@ -2899,8 +2899,8 @@ function selectLinkEndpoint(svg, event) {
|
|
|
2899
2899
|
if (!target || !end || !linkId) {
|
|
2900
2900
|
return null;
|
|
2901
2901
|
}
|
|
2902
|
-
const path =
|
|
2903
|
-
const linkOwner = path &&
|
|
2902
|
+
const path = chunkMR32IJQO_cjs.findOwnerNode(svg, linkId, chunkMR32IJQO_cjs.isPrimary);
|
|
2903
|
+
const linkOwner = path && chunkMR32IJQO_cjs.resolveOwner(path);
|
|
2904
2904
|
if (!path || !linkOwner) {
|
|
2905
2905
|
return null;
|
|
2906
2906
|
}
|
|
@@ -2942,8 +2942,8 @@ function nearestPort(bounds, point) {
|
|
|
2942
2942
|
let nearest = { side: "right", offset: 0.5 };
|
|
2943
2943
|
let nearestDistance = Infinity;
|
|
2944
2944
|
for (const side of SIDES2) {
|
|
2945
|
-
const offset = Math.max(0, Math.min(1,
|
|
2946
|
-
const candidate =
|
|
2945
|
+
const offset = Math.max(0, Math.min(1, chunkC25NWWIH_cjs.relativeOffsetOnRectangleSide(bounds, side, point)));
|
|
2946
|
+
const candidate = chunkC25NWWIH_cjs.pointAtPort(bounds, { side, offset });
|
|
2947
2947
|
const distance = Math.hypot(candidate.x - point.x, candidate.y - point.y);
|
|
2948
2948
|
if (distance < nearestDistance) {
|
|
2949
2949
|
nearestDistance = distance;
|
|
@@ -3002,7 +3002,7 @@ function resolveLinkTarget(candidates, fixedPoint, point, unitsPerPx) {
|
|
|
3002
3002
|
}
|
|
3003
3003
|
const port = snapPort(candidate.bounds, point, unitsPerPx);
|
|
3004
3004
|
return {
|
|
3005
|
-
point:
|
|
3005
|
+
point: chunkC25NWWIH_cjs.pointAtPort(candidate.bounds, port),
|
|
3006
3006
|
side: port.side,
|
|
3007
3007
|
hit: { owner: candidate.owner, side: port.side, offset: port.offset },
|
|
3008
3008
|
bounds: candidate.bounds
|
|
@@ -3026,7 +3026,7 @@ var LinkEndpointSession = class {
|
|
|
3026
3026
|
this.#emitter = emitter;
|
|
3027
3027
|
}
|
|
3028
3028
|
pointerDown = (event) => {
|
|
3029
|
-
if (event.button !== 0 || this.#drag ||
|
|
3029
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
3030
3030
|
return;
|
|
3031
3031
|
}
|
|
3032
3032
|
this.#drag = createLinkEndpointDragState(this.#svg, event);
|
|
@@ -3040,7 +3040,7 @@ var LinkEndpointSession = class {
|
|
|
3040
3040
|
return;
|
|
3041
3041
|
}
|
|
3042
3042
|
drag.moved = true;
|
|
3043
|
-
const target = resolveEndpointTarget(drag, endpointPointerPosition(this.#svg, event), 1 /
|
|
3043
|
+
const target = resolveEndpointTarget(drag, endpointPointerPosition(this.#svg, event), 1 / chunkMR32IJQO_cjs.pxPerUnit(this.#svg));
|
|
3044
3044
|
updateEndpointPreview(drag, target.point, target.side);
|
|
3045
3045
|
drag.ghost.show(target.hit !== null, target.bounds);
|
|
3046
3046
|
};
|
|
@@ -3154,7 +3154,7 @@ var LinkSegmentSession = class {
|
|
|
3154
3154
|
this.#emitter = emitter;
|
|
3155
3155
|
}
|
|
3156
3156
|
pointerDown = (event) => {
|
|
3157
|
-
if (event.button !== 0 || this.#drag ||
|
|
3157
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
3158
3158
|
return;
|
|
3159
3159
|
}
|
|
3160
3160
|
const target = event.target;
|
|
@@ -3164,12 +3164,12 @@ var LinkSegmentSession = class {
|
|
|
3164
3164
|
if (!handle || !overlay || !linkId) {
|
|
3165
3165
|
return;
|
|
3166
3166
|
}
|
|
3167
|
-
const path =
|
|
3168
|
-
const owner = path &&
|
|
3167
|
+
const path = chunkMR32IJQO_cjs.findOwnerNode(this.#svg, linkId, chunkMR32IJQO_cjs.isPrimary);
|
|
3168
|
+
const owner = path && chunkMR32IJQO_cjs.resolveOwner(path);
|
|
3169
3169
|
const index = Number(handle.getAttribute("data-sf-link-segment"));
|
|
3170
3170
|
const segments = path ? parseSegments(path) : [];
|
|
3171
3171
|
const segment = segments[index];
|
|
3172
|
-
const point =
|
|
3172
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
3173
3173
|
if (!path || !owner || !segment || !point) {
|
|
3174
3174
|
return;
|
|
3175
3175
|
}
|
|
@@ -3177,7 +3177,7 @@ var LinkSegmentSession = class {
|
|
|
3177
3177
|
const guide = document.createElementNS(SVG_NAMESPACE2, "line");
|
|
3178
3178
|
guide.setAttribute("stroke", GUIDE_COLOR);
|
|
3179
3179
|
guide.setAttribute("stroke-dasharray", "4 4");
|
|
3180
|
-
guide.setAttribute("stroke-width", String(1 /
|
|
3180
|
+
guide.setAttribute("stroke-width", String(1 / chunkMR32IJQO_cjs.pxPerUnit(this.#svg)));
|
|
3181
3181
|
guide.setAttribute("visibility", "hidden");
|
|
3182
3182
|
overlay.appendChild(guide);
|
|
3183
3183
|
handle.setPointerCapture?.(event.pointerId);
|
|
@@ -3212,7 +3212,7 @@ var LinkSegmentSession = class {
|
|
|
3212
3212
|
return;
|
|
3213
3213
|
}
|
|
3214
3214
|
drag.moved = true;
|
|
3215
|
-
const point =
|
|
3215
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
3216
3216
|
if (!point) {
|
|
3217
3217
|
return;
|
|
3218
3218
|
}
|
|
@@ -3238,8 +3238,8 @@ var LinkSegmentSession = class {
|
|
|
3238
3238
|
doubleClick = (event) => {
|
|
3239
3239
|
const handle = event.target?.closest("[data-sf-link-segment]");
|
|
3240
3240
|
const linkId = handle?.closest("[data-sf-selection-overlay]")?.getAttribute("data-sf-selection-overlay");
|
|
3241
|
-
const path = linkId ?
|
|
3242
|
-
const owner = path &&
|
|
3241
|
+
const path = linkId ? chunkMR32IJQO_cjs.findOwnerNode(this.#svg, linkId, chunkMR32IJQO_cjs.isPrimary) : null;
|
|
3242
|
+
const owner = path && chunkMR32IJQO_cjs.resolveOwner(path);
|
|
3243
3243
|
if (!handle || !owner) {
|
|
3244
3244
|
return;
|
|
3245
3245
|
}
|
|
@@ -3262,7 +3262,7 @@ var LinkSegmentSession = class {
|
|
|
3262
3262
|
if (isSnapDisabled(this.#svg)) {
|
|
3263
3263
|
return { value: raw, snapped: null };
|
|
3264
3264
|
}
|
|
3265
|
-
const threshold = SNAP_PX /
|
|
3265
|
+
const threshold = SNAP_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
3266
3266
|
let best = null;
|
|
3267
3267
|
for (const candidate of [drag.base, ...drag.candidates]) {
|
|
3268
3268
|
const closer = best === null || Math.abs(candidate - raw) < Math.abs(best - raw);
|
|
@@ -3275,7 +3275,7 @@ var LinkSegmentSession = class {
|
|
|
3275
3275
|
#preview(drag, snapped) {
|
|
3276
3276
|
const next = movedSegments(drag, drag.value);
|
|
3277
3277
|
const strokeWidth = Number(drag.path.getAttribute("stroke-width")) || 2;
|
|
3278
|
-
const data =
|
|
3278
|
+
const data = chunkC25NWWIH_cjs.roundedOrthogonalPathData(pathSegments(next), Math.max(16, strokeWidth * 4));
|
|
3279
3279
|
drag.path.setAttribute("d", data);
|
|
3280
3280
|
drag.overlay.querySelector("path")?.setAttribute("d", data);
|
|
3281
3281
|
const segment = next[drag.index];
|
|
@@ -3449,8 +3449,8 @@ function nearestCandidates(bounds, candidates, limit = 50) {
|
|
|
3449
3449
|
|
|
3450
3450
|
// src/runtime/interaction/snapping/isometricDiagonal.ts
|
|
3451
3451
|
var AXES2 = [
|
|
3452
|
-
{ x:
|
|
3453
|
-
{ x: -
|
|
3452
|
+
{ x: chunkC25NWWIH_cjs.AXIS_COS, y: chunkC25NWWIH_cjs.AXIS_SIN },
|
|
3453
|
+
{ x: -chunkC25NWWIH_cjs.AXIS_COS, y: chunkC25NWWIH_cjs.AXIS_SIN }
|
|
3454
3454
|
];
|
|
3455
3455
|
var GUIDE_OVERHANG = 40;
|
|
3456
3456
|
function snapIsometricDiagonal(apex, rawDx, rawDy, candidates, threshold) {
|
|
@@ -3518,13 +3518,13 @@ function isometricApexOf(svg, drag, declared = false) {
|
|
|
3518
3518
|
if (lead.owner.role !== "isometric") {
|
|
3519
3519
|
return null;
|
|
3520
3520
|
}
|
|
3521
|
-
const primary =
|
|
3522
|
-
const geometry = primary &&
|
|
3521
|
+
const primary = chunkMR32IJQO_cjs.findOwnerNode(svg, lead.owner.id, chunkMR32IJQO_cjs.isPrimary);
|
|
3522
|
+
const geometry = primary && chunkMR32IJQO_cjs.isometricGeometryOf(primary);
|
|
3523
3523
|
if (!geometry) {
|
|
3524
3524
|
return null;
|
|
3525
3525
|
}
|
|
3526
3526
|
const frame = declared && geometry.bounds ? geometry.bounds : lead.draggedBounds;
|
|
3527
|
-
return { x: frame.x + geometry.depth *
|
|
3527
|
+
return { x: frame.x + geometry.depth * chunkC25NWWIH_cjs.AXIS_COS, y: frame.y };
|
|
3528
3528
|
}
|
|
3529
3529
|
function snapIsometricGrid(svg, drag, rawDx, rawDy) {
|
|
3530
3530
|
const step = readIsometricSnapStep(svg);
|
|
@@ -3541,8 +3541,8 @@ function snapIsometricMove(svg, drag, rawDx, rawDy) {
|
|
|
3541
3541
|
return null;
|
|
3542
3542
|
}
|
|
3543
3543
|
const excludedIds = new Set(drag.canvasObjects.map((canvasObject) => canvasObject.owner.id));
|
|
3544
|
-
const candidates =
|
|
3545
|
-
const snap = snapIsometricDiagonal(apex, rawDx, rawDy, candidates, snapDistancePx(svg) /
|
|
3544
|
+
const candidates = chunkMR32IJQO_cjs.findIsometricApexCandidates(svg, excludedIds);
|
|
3545
|
+
const snap = snapIsometricDiagonal(apex, rawDx, rawDy, candidates, snapDistancePx(svg) / chunkMR32IJQO_cjs.pxPerUnit(svg));
|
|
3546
3546
|
return snap ? { dx: snap.dx, dy: snap.dy, guides: [snap.guide] } : null;
|
|
3547
3547
|
}
|
|
3548
3548
|
function snapMove(svg, drag, rawDx, rawDy) {
|
|
@@ -3559,9 +3559,9 @@ function snapMove(svg, drag, rawDx, rawDy) {
|
|
|
3559
3559
|
}
|
|
3560
3560
|
const leadBounds = offsetBounds(drag.canvasObjects[0].draggedBounds, rawDx, rawDy);
|
|
3561
3561
|
const excludedIds = new Set(drag.canvasObjects.map((canvasObject) => canvasObject.owner.id));
|
|
3562
|
-
const candidates = nearestCandidates(leadBounds,
|
|
3562
|
+
const candidates = nearestCandidates(leadBounds, chunkMR32IJQO_cjs.findSnapCandidateBounds(svg, excludedIds));
|
|
3563
3563
|
const snap = computeSnap(leadBounds, candidates, {
|
|
3564
|
-
threshold: snapDistancePx(svg) /
|
|
3564
|
+
threshold: snapDistancePx(svg) / chunkMR32IJQO_cjs.pxPerUnit(svg),
|
|
3565
3565
|
activeX: MOVE_ACTIVE_POINTS,
|
|
3566
3566
|
activeY: MOVE_ACTIVE_POINTS,
|
|
3567
3567
|
guideOverhang: GUIDE_OVERHANG2
|
|
@@ -3622,7 +3622,7 @@ function isCompositeOwner(owner) {
|
|
|
3622
3622
|
return owner !== null && owner !== void 0 && COMPOSITE_ROLES.has(owner.role);
|
|
3623
3623
|
}
|
|
3624
3624
|
function hasDerivedHeight(owner) {
|
|
3625
|
-
return owner !== null && owner !== void 0 &&
|
|
3625
|
+
return owner !== null && owner !== void 0 && chunkMR32IJQO_cjs.DERIVED_HEIGHT_ROLES.has(owner.role);
|
|
3626
3626
|
}
|
|
3627
3627
|
|
|
3628
3628
|
// src/runtime/interaction/move/canvasObjectCapture.ts
|
|
@@ -3643,7 +3643,7 @@ function parentContainerBounds(svg, primary, groupIds) {
|
|
|
3643
3643
|
if (!parentId || groupIds.has(parentId)) {
|
|
3644
3644
|
return void 0;
|
|
3645
3645
|
}
|
|
3646
|
-
const container =
|
|
3646
|
+
const container = chunkMR32IJQO_cjs.findOwnerNode(svg, parentId, chunkMR32IJQO_cjs.isPrimary);
|
|
3647
3647
|
if (!container) {
|
|
3648
3648
|
return void 0;
|
|
3649
3649
|
}
|
|
@@ -3651,14 +3651,14 @@ function parentContainerBounds(svg, primary, groupIds) {
|
|
|
3651
3651
|
return { x: bbox.x, y: bbox.y, width: bbox.width, height: bbox.height };
|
|
3652
3652
|
}
|
|
3653
3653
|
function captureCanvasObject(svg, owner, groupIds) {
|
|
3654
|
-
const nodes =
|
|
3655
|
-
const primary =
|
|
3654
|
+
const nodes = chunkMR32IJQO_cjs.findAllOwnerNodes(svg, owner.id);
|
|
3655
|
+
const primary = chunkMR32IJQO_cjs.findOwnerNode(svg, owner.id, chunkMR32IJQO_cjs.isPrimary);
|
|
3656
3656
|
if (!nodes.length || !primary) {
|
|
3657
3657
|
return null;
|
|
3658
3658
|
}
|
|
3659
3659
|
const overlays = [...svg.querySelectorAll(`[data-sf-selection-overlay="${CSS.escape(owner.id)}"]`)];
|
|
3660
3660
|
const draggedBounds = primary.getBBox();
|
|
3661
|
-
const isometricGeometry = owner.role === "isometric" ?
|
|
3661
|
+
const isometricGeometry = owner.role === "isometric" ? chunkMR32IJQO_cjs.isometricGeometryOf(primary) : null;
|
|
3662
3662
|
const isometricSize = isometricGeometry ? { width: isometricGeometry.width, height: isometricGeometry.height, depth: isometricGeometry.depth } : void 0;
|
|
3663
3663
|
return {
|
|
3664
3664
|
owner,
|
|
@@ -3700,7 +3700,7 @@ function captureInternalLinks(svg, groupIds) {
|
|
|
3700
3700
|
if (!linkId || !belongsToMoveGroup(path, groupIds)) {
|
|
3701
3701
|
continue;
|
|
3702
3702
|
}
|
|
3703
|
-
const nodes =
|
|
3703
|
+
const nodes = chunkMR32IJQO_cjs.findAllOwnerNodes(svg, linkId);
|
|
3704
3704
|
if (nodes.length) {
|
|
3705
3705
|
links.push({ nodes, baseTransforms: nodes.map((node) => node.getAttribute("transform")) });
|
|
3706
3706
|
}
|
|
@@ -3734,7 +3734,7 @@ function containedChildren(viewer, owner) {
|
|
|
3734
3734
|
return [];
|
|
3735
3735
|
}
|
|
3736
3736
|
const nodes = viewer.svg.querySelectorAll(`[data-sf-parent-frame="${CSS.escape(owner.id)}"]`);
|
|
3737
|
-
return [...nodes].map((node) =>
|
|
3737
|
+
return [...nodes].map((node) => chunkMR32IJQO_cjs.resolveOwner(node)).filter((ref) => ref !== null);
|
|
3738
3738
|
}
|
|
3739
3739
|
function selectedMoveGroup(viewer, owner) {
|
|
3740
3740
|
const selection = viewer.getSelection();
|
|
@@ -3751,7 +3751,7 @@ function isChartInteractiveMark(target) {
|
|
|
3751
3751
|
}
|
|
3752
3752
|
function createMoveDragState(viewer, event, startUser) {
|
|
3753
3753
|
const target = event.target;
|
|
3754
|
-
const owner =
|
|
3754
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(target);
|
|
3755
3755
|
if (!hasMovableGeometry(owner) || isChartInteractiveMark(target)) {
|
|
3756
3756
|
return null;
|
|
3757
3757
|
}
|
|
@@ -3785,7 +3785,7 @@ var MoveSession = class {
|
|
|
3785
3785
|
this.#emitter = emitter;
|
|
3786
3786
|
}
|
|
3787
3787
|
pointerDown = (event) => {
|
|
3788
|
-
if (event.button !== 0 || this.#drag ||
|
|
3788
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
3789
3789
|
return;
|
|
3790
3790
|
}
|
|
3791
3791
|
this.#drag = createMoveDragState(this.#viewer, event, movePointerPosition(this.#svg, event));
|
|
@@ -3803,7 +3803,7 @@ var MoveSession = class {
|
|
|
3803
3803
|
const delta = snapMove(this.#svg, drag, rawDelta.dx, rawDelta.dy);
|
|
3804
3804
|
const clamped = clampMoveDelta(drag.canvasObjects, delta.dx, delta.dy);
|
|
3805
3805
|
applyMovePreview(drag, clamped.dx, clamped.dy);
|
|
3806
|
-
|
|
3806
|
+
chunkMR32IJQO_cjs.updateAlignmentGuides(this.#svg, delta.guides, MOVE_GUIDE_COLOR);
|
|
3807
3807
|
};
|
|
3808
3808
|
pointerUp = (event) => {
|
|
3809
3809
|
const drag = this.#drag;
|
|
@@ -3812,7 +3812,7 @@ var MoveSession = class {
|
|
|
3812
3812
|
}
|
|
3813
3813
|
this.#drag = null;
|
|
3814
3814
|
event.target.releasePointerCapture?.(drag.pointerId);
|
|
3815
|
-
|
|
3815
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
3816
3816
|
emitMoveCompletion(this.#svg, this.#emitter, drag, event);
|
|
3817
3817
|
};
|
|
3818
3818
|
cancel() {
|
|
@@ -3958,9 +3958,9 @@ var START_POINT_RADIUS_PX = 6;
|
|
|
3958
3958
|
var POINT_STROKE_WIDTH_PX = 1.5;
|
|
3959
3959
|
function createPathDrawPreview(svg) {
|
|
3960
3960
|
const document2 = svg.ownerDocument;
|
|
3961
|
-
const group = document2.createElementNS(
|
|
3961
|
+
const group = document2.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "g");
|
|
3962
3962
|
group.setAttribute("pointer-events", "none");
|
|
3963
|
-
const line = document2.createElementNS(
|
|
3963
|
+
const line = document2.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "path");
|
|
3964
3964
|
line.setAttribute("fill", "none");
|
|
3965
3965
|
line.setAttribute("stroke", PREVIEW_COLOR);
|
|
3966
3966
|
line.setAttribute("stroke-linecap", "round");
|
|
@@ -3970,8 +3970,8 @@ function createPathDrawPreview(svg) {
|
|
|
3970
3970
|
}
|
|
3971
3971
|
function pointMarker(svg, point, highlighted) {
|
|
3972
3972
|
const document2 = svg.ownerDocument;
|
|
3973
|
-
const unit = 1 /
|
|
3974
|
-
const circle = document2.createElementNS(
|
|
3973
|
+
const unit = 1 / chunkMR32IJQO_cjs.pxPerUnit(svg);
|
|
3974
|
+
const circle = document2.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "circle");
|
|
3975
3975
|
circle.setAttribute("cx", String(point.x));
|
|
3976
3976
|
circle.setAttribute("cy", String(point.y));
|
|
3977
3977
|
circle.setAttribute("r", String((highlighted ? START_POINT_RADIUS_PX : POINT_RADIUS_PX) * unit));
|
|
@@ -3985,11 +3985,11 @@ function updatePathDrawPreview(svg, state) {
|
|
|
3985
3985
|
if (!previewLine || !previewGroup) {
|
|
3986
3986
|
return;
|
|
3987
3987
|
}
|
|
3988
|
-
const unit = 1 /
|
|
3988
|
+
const unit = 1 / chunkMR32IJQO_cjs.pxPerUnit(svg);
|
|
3989
3989
|
previewLine.setAttribute("stroke-width", String(LINE_WIDTH_PX * unit));
|
|
3990
3990
|
previewLine.setAttribute("stroke-dasharray", `${DASH_PX * unit} ${GAP_PX * unit}`);
|
|
3991
3991
|
const live = state.cursor ? [...state.points, state.cursor] : state.points;
|
|
3992
|
-
previewLine.setAttribute("d",
|
|
3992
|
+
previewLine.setAttribute("d", chunkC25NWWIH_cjs.freeformPathData({ points: live, tension: state.tension, closed: false }));
|
|
3993
3993
|
while (previewGroup.childNodes.length > 1) {
|
|
3994
3994
|
previewGroup.lastChild?.remove();
|
|
3995
3995
|
}
|
|
@@ -4049,12 +4049,12 @@ var PathDrawSession = class {
|
|
|
4049
4049
|
}
|
|
4050
4050
|
}
|
|
4051
4051
|
pointerDown = (event) => {
|
|
4052
|
-
if (!this.#state.active || event.button !== 0 ||
|
|
4052
|
+
if (!this.#state.active || event.button !== 0 || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
4053
4053
|
return;
|
|
4054
4054
|
}
|
|
4055
4055
|
event.stopPropagation();
|
|
4056
4056
|
event.preventDefault();
|
|
4057
|
-
const point =
|
|
4057
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
4058
4058
|
if (!point) {
|
|
4059
4059
|
return;
|
|
4060
4060
|
}
|
|
@@ -4073,14 +4073,14 @@ var PathDrawSession = class {
|
|
|
4073
4073
|
this.#state.cursor = resolved.point;
|
|
4074
4074
|
this.#state.willClose = false;
|
|
4075
4075
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4076
|
-
|
|
4076
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
4077
4077
|
};
|
|
4078
4078
|
pointerMove = (event) => {
|
|
4079
4079
|
if (!this.#state.active) {
|
|
4080
4080
|
return;
|
|
4081
4081
|
}
|
|
4082
4082
|
event.stopPropagation();
|
|
4083
|
-
const point =
|
|
4083
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
4084
4084
|
if (!point) {
|
|
4085
4085
|
return;
|
|
4086
4086
|
}
|
|
@@ -4089,9 +4089,9 @@ var PathDrawSession = class {
|
|
|
4089
4089
|
this.#state.willClose = resolved.willClose;
|
|
4090
4090
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4091
4091
|
if (resolved.guide) {
|
|
4092
|
-
|
|
4092
|
+
chunkMR32IJQO_cjs.updateAlignmentGuides(this.#svg, [resolved.guide], GUIDE_COLOR2);
|
|
4093
4093
|
} else {
|
|
4094
|
-
|
|
4094
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
4095
4095
|
}
|
|
4096
4096
|
};
|
|
4097
4097
|
pointerUp = (event) => {
|
|
@@ -4126,10 +4126,10 @@ var PathDrawSession = class {
|
|
|
4126
4126
|
} else if (event.key === "Backspace" && this.#state.points.length > 0) {
|
|
4127
4127
|
event.preventDefault();
|
|
4128
4128
|
this.#state.points = this.#state.points.slice(0, -1);
|
|
4129
|
-
const closeSnapUnits = CLOSE_SNAP_PX /
|
|
4129
|
+
const closeSnapUnits = CLOSE_SNAP_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
4130
4130
|
this.#state.willClose = this.#state.cursor ? isCloseToStart(this.#state.points, this.#state.cursor, closeSnapUnits) : false;
|
|
4131
4131
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4132
|
-
|
|
4132
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
4133
4133
|
}
|
|
4134
4134
|
};
|
|
4135
4135
|
keyUp = (event) => {
|
|
@@ -4138,7 +4138,7 @@ var PathDrawSession = class {
|
|
|
4138
4138
|
}
|
|
4139
4139
|
};
|
|
4140
4140
|
#resolvePoint(raw) {
|
|
4141
|
-
const closeSnapUnits = CLOSE_SNAP_PX /
|
|
4141
|
+
const closeSnapUnits = CLOSE_SNAP_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
4142
4142
|
if (isCloseToStart(this.#state.points, raw, closeSnapUnits)) {
|
|
4143
4143
|
return { point: this.#state.points[0], willClose: true, guide: null };
|
|
4144
4144
|
}
|
|
@@ -4148,7 +4148,7 @@ var PathDrawSession = class {
|
|
|
4148
4148
|
return { point: raw, willClose: false, guide: null };
|
|
4149
4149
|
}
|
|
4150
4150
|
const angleSnapped = snapTo45Degrees(last, raw);
|
|
4151
|
-
const guideSnapUnits = GUIDE_SNAP_PX /
|
|
4151
|
+
const guideSnapUnits = GUIDE_SNAP_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg);
|
|
4152
4152
|
const { point, guide } = snapToSessionGuides(last, angleSnapped, points.slice(0, -1), raw, guideSnapUnits);
|
|
4153
4153
|
return { point, willClose: false, guide };
|
|
4154
4154
|
}
|
|
@@ -4162,7 +4162,7 @@ var PathDrawSession = class {
|
|
|
4162
4162
|
}
|
|
4163
4163
|
#reset(callExit) {
|
|
4164
4164
|
this.#state.previewGroup?.remove();
|
|
4165
|
-
|
|
4165
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
4166
4166
|
const exit = this.#state.onExit;
|
|
4167
4167
|
this.#state = createIdlePathDrawState();
|
|
4168
4168
|
this.#shiftHeld = false;
|
|
@@ -4205,7 +4205,7 @@ function applyPathReshapePreview(drag, point) {
|
|
|
4205
4205
|
const points = drag.points.map(
|
|
4206
4206
|
(existing, index) => index === drag.pointIndex ? [point.x, point.y] : existing
|
|
4207
4207
|
);
|
|
4208
|
-
const d =
|
|
4208
|
+
const d = chunkC25NWWIH_cjs.freeformPathData({
|
|
4209
4209
|
points: points.map(([x, y]) => ({ x, y })),
|
|
4210
4210
|
tension: drag.tension,
|
|
4211
4211
|
closed: drag.closed
|
|
@@ -4213,22 +4213,22 @@ function applyPathReshapePreview(drag, point) {
|
|
|
4213
4213
|
drag.pathNode.setAttribute("d", d);
|
|
4214
4214
|
drag.handle.setAttribute("cx", String(point.x));
|
|
4215
4215
|
drag.handle.setAttribute("cy", String(point.y));
|
|
4216
|
-
drag.overlay?.querySelector(`[${
|
|
4216
|
+
drag.overlay?.querySelector(`[${chunkMR32IJQO_cjs.PATH_HALO_ATTR}]`)?.setAttribute("d", d);
|
|
4217
4217
|
return points;
|
|
4218
4218
|
}
|
|
4219
4219
|
|
|
4220
4220
|
// src/runtime/interaction/pathReshape/target.ts
|
|
4221
4221
|
function resolvePathReshapeTarget(svg, event) {
|
|
4222
|
-
const handle = event.target?.closest?.(`[${
|
|
4223
|
-
const indexAttr = handle?.getAttribute(
|
|
4222
|
+
const handle = event.target?.closest?.(`[${chunkC25NWWIH_cjs.PATH_POINT_INDEX_ATTR}]`) ?? null;
|
|
4223
|
+
const indexAttr = handle?.getAttribute(chunkC25NWWIH_cjs.PATH_POINT_INDEX_ATTR) ?? null;
|
|
4224
4224
|
const pointIndex = indexAttr !== null ? Number(indexAttr) : Number.NaN;
|
|
4225
4225
|
const ownerId = handle?.closest("[data-sf-selection-overlay]")?.getAttribute("data-sf-selection-overlay");
|
|
4226
4226
|
if (!handle || !Number.isInteger(pointIndex) || !ownerId) {
|
|
4227
4227
|
return null;
|
|
4228
4228
|
}
|
|
4229
|
-
const pathNode =
|
|
4230
|
-
const owner = pathNode &&
|
|
4231
|
-
const geometry = pathNode &&
|
|
4229
|
+
const pathNode = chunkMR32IJQO_cjs.findOwnerNode(svg, ownerId, chunkMR32IJQO_cjs.isPrimary);
|
|
4230
|
+
const owner = pathNode && chunkMR32IJQO_cjs.resolveOwner(pathNode);
|
|
4231
|
+
const geometry = pathNode && chunkMR32IJQO_cjs.pathGeometryOf(pathNode);
|
|
4232
4232
|
if (!pathNode || !owner || !geometry || pointIndex < 0 || pointIndex >= geometry.points.length) {
|
|
4233
4233
|
return null;
|
|
4234
4234
|
}
|
|
@@ -4271,7 +4271,7 @@ var PathReshapeSession = class {
|
|
|
4271
4271
|
this.#emitter = emitter;
|
|
4272
4272
|
}
|
|
4273
4273
|
pointerDown = (event) => {
|
|
4274
|
-
if (event.button !== 0 || this.#drag ||
|
|
4274
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
4275
4275
|
return;
|
|
4276
4276
|
}
|
|
4277
4277
|
this.#drag = createPathReshapeDragState(this.#svg, event);
|
|
@@ -4282,7 +4282,7 @@ var PathReshapeSession = class {
|
|
|
4282
4282
|
return;
|
|
4283
4283
|
}
|
|
4284
4284
|
drag.moved = true;
|
|
4285
|
-
const point =
|
|
4285
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
4286
4286
|
if (point) {
|
|
4287
4287
|
applyPathReshapePreview(drag, point);
|
|
4288
4288
|
}
|
|
@@ -4297,7 +4297,7 @@ var PathReshapeSession = class {
|
|
|
4297
4297
|
if (!drag.moved) {
|
|
4298
4298
|
return;
|
|
4299
4299
|
}
|
|
4300
|
-
const point =
|
|
4300
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event) ?? {
|
|
4301
4301
|
x: drag.points[drag.pointIndex][0],
|
|
4302
4302
|
y: drag.points[drag.pointIndex][1]
|
|
4303
4303
|
};
|
|
@@ -4338,7 +4338,7 @@ function updatePieLabelDragPreview(drag, dx, dy) {
|
|
|
4338
4338
|
}
|
|
4339
4339
|
const from = { x: drag.tickStartX, y: drag.tickStartY };
|
|
4340
4340
|
const to = { x: drag.restX + dx, y: drag.restY + dy };
|
|
4341
|
-
const clipped =
|
|
4341
|
+
const clipped = chunkC25NWWIH_cjs.clipSegmentToRect(from, to, drag.halfWidth, drag.halfHeight);
|
|
4342
4342
|
drag.tickElement.setAttribute("d", `M ${from.x} ${from.y} L ${clipped.x} ${clipped.y}`);
|
|
4343
4343
|
drag.tickElement.setAttribute("stroke", PREVIEW_TICK_COLOR);
|
|
4344
4344
|
drag.tickElement.setAttribute("stroke-width", PREVIEW_TICK_STROKE_WIDTH);
|
|
@@ -4364,7 +4364,7 @@ function restoreAttribute(element2, name, value) {
|
|
|
4364
4364
|
|
|
4365
4365
|
// src/runtime/interaction/pieGeometry.ts
|
|
4366
4366
|
function readPieGeometry(svg, ownerId) {
|
|
4367
|
-
const raw =
|
|
4367
|
+
const raw = chunkMR32IJQO_cjs.findOwnerNode(svg, ownerId, chunkMR32IJQO_cjs.isPrimary)?.getAttribute("data-sf-pie-geometry");
|
|
4368
4368
|
if (!raw) {
|
|
4369
4369
|
return null;
|
|
4370
4370
|
}
|
|
@@ -4383,7 +4383,7 @@ function findLabelMark2(event) {
|
|
|
4383
4383
|
return event.target?.closest?.(selector);
|
|
4384
4384
|
}
|
|
4385
4385
|
function isLabelPointer2(event) {
|
|
4386
|
-
return event.button === 0 && !
|
|
4386
|
+
return event.button === 0 && !chunkMR32IJQO_cjs.isCameraGesture(event);
|
|
4387
4387
|
}
|
|
4388
4388
|
function findLabelSiblings(svg, ownerId, seriesId, mark) {
|
|
4389
4389
|
const selector = `[data-sf-id="${CSS.escape(ownerId)}"][data-sf-series="${CSS.escape(seriesId)}"][data-sf-mark="${mark}"]`;
|
|
@@ -4415,7 +4415,7 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4415
4415
|
if (!clicked) {
|
|
4416
4416
|
return null;
|
|
4417
4417
|
}
|
|
4418
|
-
const owner =
|
|
4418
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(clicked);
|
|
4419
4419
|
if (owner?.role !== "chart") {
|
|
4420
4420
|
return null;
|
|
4421
4421
|
}
|
|
@@ -4434,7 +4434,7 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4434
4434
|
const wedgeRadius = clicked.getAttribute("data-sf-pie-wedge-radius");
|
|
4435
4435
|
const explicitRadius = wedgeRadius === null ? Number.NaN : Number(wedgeRadius);
|
|
4436
4436
|
const outerRadius = Number.isFinite(explicitRadius) ? explicitRadius : geometry.outerRadius;
|
|
4437
|
-
const start =
|
|
4437
|
+
const start = chunkMR32IJQO_cjs.pointerUserPoint(svg, event);
|
|
4438
4438
|
if (!start) {
|
|
4439
4439
|
return null;
|
|
4440
4440
|
}
|
|
@@ -4456,13 +4456,13 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4456
4456
|
outerRadius,
|
|
4457
4457
|
anchorX: geometry.centerX + outerRadius * Math.cos(midAngle),
|
|
4458
4458
|
anchorY: geometry.centerY + outerRadius * Math.sin(midAngle),
|
|
4459
|
-
tickStartX: geometry.centerX + (outerRadius +
|
|
4460
|
-
tickStartY: geometry.centerY + (outerRadius +
|
|
4459
|
+
tickStartX: geometry.centerX + (outerRadius + chunkC25NWWIH_cjs.LEADER_INSET) * Math.cos(midAngle),
|
|
4460
|
+
tickStartY: geometry.centerY + (outerRadius + chunkC25NWWIH_cjs.LEADER_INSET) * Math.sin(midAngle),
|
|
4461
4461
|
restX,
|
|
4462
4462
|
restY,
|
|
4463
4463
|
startX: start.x,
|
|
4464
4464
|
startY: start.y,
|
|
4465
|
-
halfWidth:
|
|
4465
|
+
halfWidth: chunkC25NWWIH_cjs.LABEL_WIDTH / 2,
|
|
4466
4466
|
halfHeight: fontSize * 1.2,
|
|
4467
4467
|
moved: false,
|
|
4468
4468
|
lastDx: 0,
|
|
@@ -4498,7 +4498,7 @@ var PieLabelDragSession = class {
|
|
|
4498
4498
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
4499
4499
|
return;
|
|
4500
4500
|
}
|
|
4501
|
-
const point =
|
|
4501
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
4502
4502
|
if (!point) {
|
|
4503
4503
|
return;
|
|
4504
4504
|
}
|
|
@@ -4530,8 +4530,8 @@ var PieLabelDragSession = class {
|
|
|
4530
4530
|
if (!drag.moved) {
|
|
4531
4531
|
return;
|
|
4532
4532
|
}
|
|
4533
|
-
const pathX =
|
|
4534
|
-
const pathY =
|
|
4533
|
+
const pathX = chunkC25NWWIH_cjs.seriesLabelOffsetXProp(drag.seriesId);
|
|
4534
|
+
const pathY = chunkC25NWWIH_cjs.seriesLabelOffsetYProp(drag.seriesId);
|
|
4535
4535
|
if (!pathX || !pathY) {
|
|
4536
4536
|
return;
|
|
4537
4537
|
}
|
|
@@ -4593,7 +4593,7 @@ function siblingNodes(svg, owner, path) {
|
|
|
4593
4593
|
});
|
|
4594
4594
|
}
|
|
4595
4595
|
function resolvePropertyDrag(svg, event, rules) {
|
|
4596
|
-
if (event.button !== 0 ||
|
|
4596
|
+
if (event.button !== 0 || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
4597
4597
|
return null;
|
|
4598
4598
|
}
|
|
4599
4599
|
const node = event.target?.closest?.('[data-sf-prop-kind="value"]');
|
|
@@ -4601,11 +4601,11 @@ function resolvePropertyDrag(svg, event, rules) {
|
|
|
4601
4601
|
return null;
|
|
4602
4602
|
}
|
|
4603
4603
|
const path = node.getAttribute("data-sf-prop");
|
|
4604
|
-
const owner =
|
|
4604
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(node);
|
|
4605
4605
|
if (!path || owner?.role !== "chart" || !isEditablePath(path, rules)) {
|
|
4606
4606
|
return null;
|
|
4607
4607
|
}
|
|
4608
|
-
const scale = parseValueScale(
|
|
4608
|
+
const scale = parseValueScale(chunkMR32IJQO_cjs.findOwnerNode(svg, owner.id, chunkMR32IJQO_cjs.isPrimary));
|
|
4609
4609
|
if (!scale) {
|
|
4610
4610
|
return null;
|
|
4611
4611
|
}
|
|
@@ -4874,7 +4874,7 @@ function resolvePropertyTarget(event, rules) {
|
|
|
4874
4874
|
return null;
|
|
4875
4875
|
}
|
|
4876
4876
|
const path = hit.getAttribute("data-sf-prop");
|
|
4877
|
-
const owner =
|
|
4877
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(hit);
|
|
4878
4878
|
if (!path || !owner || !isEditablePath(path, rules)) {
|
|
4879
4879
|
return null;
|
|
4880
4880
|
}
|
|
@@ -4913,7 +4913,7 @@ var PropertyEditingSession = class {
|
|
|
4913
4913
|
begin(target) {
|
|
4914
4914
|
this.cancel();
|
|
4915
4915
|
const { node } = target;
|
|
4916
|
-
const rect =
|
|
4916
|
+
const rect = chunkMR32IJQO_cjs.screenRectOf(node);
|
|
4917
4917
|
const fontSize = Number.parseFloat(node.getAttribute("font-size") || "12");
|
|
4918
4918
|
const originalText = node.textContent ?? "";
|
|
4919
4919
|
const anchor = node.getAttribute("text-anchor");
|
|
@@ -5003,9 +5003,9 @@ function crossedDuplicateDragThreshold(drag, event) {
|
|
|
5003
5003
|
var PREVIEW_STROKE_PX = 2;
|
|
5004
5004
|
var NEW_LINK_PATH_TYPE = "orthogonal";
|
|
5005
5005
|
function createDuplicatePreviewPath(svg) {
|
|
5006
|
-
const path = svg.ownerDocument.createElementNS(
|
|
5006
|
+
const path = svg.ownerDocument.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "path");
|
|
5007
5007
|
path.setAttribute("fill", "none");
|
|
5008
|
-
path.setAttribute("stroke-width", String(PREVIEW_STROKE_PX /
|
|
5008
|
+
path.setAttribute("stroke-width", String(PREVIEW_STROKE_PX / chunkMR32IJQO_cjs.pxPerUnit(svg)));
|
|
5009
5009
|
path.style.pointerEvents = "none";
|
|
5010
5010
|
return path;
|
|
5011
5011
|
}
|
|
@@ -5024,7 +5024,7 @@ function previewLink3(fromSide, toSide) {
|
|
|
5024
5024
|
}
|
|
5025
5025
|
function updateDuplicatePreview(drag, toPoint, toSide) {
|
|
5026
5026
|
const link = previewLink3(drag.direction, toSide);
|
|
5027
|
-
const { points, segments } =
|
|
5027
|
+
const { points, segments } = chunkC25NWWIH_cjs.calculateLinkRoute(link, drag.fixedPoint, toPoint, NEW_LINK_PATH_TYPE);
|
|
5028
5028
|
drag.previewPath.setAttribute("d", previewPathData(points, segments, NEW_LINK_PATH_TYPE, 2));
|
|
5029
5029
|
}
|
|
5030
5030
|
|
|
@@ -5035,7 +5035,7 @@ function duplicateCandidates(svg, sourceId) {
|
|
|
5035
5035
|
if (element2.getAttribute("data-sf-role") === "link") {
|
|
5036
5036
|
continue;
|
|
5037
5037
|
}
|
|
5038
|
-
const owner =
|
|
5038
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(element2);
|
|
5039
5039
|
if (owner && owner.id !== sourceId) {
|
|
5040
5040
|
candidates.push({ owner, bounds: element2.getBBox() });
|
|
5041
5041
|
}
|
|
@@ -5049,8 +5049,8 @@ function createQuickDuplicateDragState(svg, event, previewPath) {
|
|
|
5049
5049
|
if (!bubble || !direction || direction.startsWith("iso-") || !sourceId) {
|
|
5050
5050
|
return null;
|
|
5051
5051
|
}
|
|
5052
|
-
const primary =
|
|
5053
|
-
const sourceOwner = primary &&
|
|
5052
|
+
const primary = chunkMR32IJQO_cjs.findOwnerNode(svg, sourceId, chunkMR32IJQO_cjs.isPrimary);
|
|
5053
|
+
const sourceOwner = primary && chunkMR32IJQO_cjs.resolveOwner(primary);
|
|
5054
5054
|
if (!primary || !sourceOwner) {
|
|
5055
5055
|
return null;
|
|
5056
5056
|
}
|
|
@@ -5058,7 +5058,7 @@ function createQuickDuplicateDragState(svg, event, previewPath) {
|
|
|
5058
5058
|
return {
|
|
5059
5059
|
sourceOwner,
|
|
5060
5060
|
direction,
|
|
5061
|
-
fixedPoint:
|
|
5061
|
+
fixedPoint: chunkC25NWWIH_cjs.pointAtPort(primary.getBBox(), { side: direction, offset: 0.5 }),
|
|
5062
5062
|
previewPath,
|
|
5063
5063
|
ghost: new LinkGhost(svg, previewPath),
|
|
5064
5064
|
candidates: duplicateCandidates(svg, sourceId),
|
|
@@ -5086,7 +5086,7 @@ var QuickDuplicateSession = class {
|
|
|
5086
5086
|
this.#emitter = emitter;
|
|
5087
5087
|
}
|
|
5088
5088
|
pointerDown = (event) => {
|
|
5089
|
-
if (event.button !== 0 || this.#drag ||
|
|
5089
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
5090
5090
|
return;
|
|
5091
5091
|
}
|
|
5092
5092
|
this.#drag = createQuickDuplicateDragState(this.#svg, event, createDuplicatePreviewPath(this.#svg));
|
|
@@ -5100,7 +5100,7 @@ var QuickDuplicateSession = class {
|
|
|
5100
5100
|
return;
|
|
5101
5101
|
}
|
|
5102
5102
|
this.beginPreview(drag);
|
|
5103
|
-
const target = resolveDuplicateTarget(drag, duplicatePointerPosition(this.#svg, event), 1 /
|
|
5103
|
+
const target = resolveDuplicateTarget(drag, duplicatePointerPosition(this.#svg, event), 1 / chunkMR32IJQO_cjs.pxPerUnit(this.#svg));
|
|
5104
5104
|
updateDuplicatePreview(drag, target.point, target.side);
|
|
5105
5105
|
drag.ghost.show(target.hit !== null, target.bounds);
|
|
5106
5106
|
};
|
|
@@ -5158,14 +5158,14 @@ function seriesShapes(svg, ownerId, series) {
|
|
|
5158
5158
|
return [...svg.querySelectorAll(selector)];
|
|
5159
5159
|
}
|
|
5160
5160
|
function updateRadarVertexDragPreview(svg, drag, value) {
|
|
5161
|
-
const point =
|
|
5161
|
+
const point = chunkC25NWWIH_cjs.radarVertexPoint(drag.frame, drag.index, value);
|
|
5162
5162
|
drag.element.setAttribute("cx", String(point.x));
|
|
5163
5163
|
drag.element.setAttribute("cy", String(point.y));
|
|
5164
5164
|
const points = seriesVertices(svg, drag.owner.id, drag.series).map((vertex) => ({
|
|
5165
5165
|
x: Number(vertex.getAttribute("cx")),
|
|
5166
5166
|
y: Number(vertex.getAttribute("cy"))
|
|
5167
5167
|
}));
|
|
5168
|
-
const path =
|
|
5168
|
+
const path = chunkC25NWWIH_cjs.radarSeriesPath(points, drag.frame.curved, drag.frame.tension);
|
|
5169
5169
|
for (const shape of seriesShapes(svg, drag.owner.id, drag.series)) {
|
|
5170
5170
|
shape.setAttribute("d", path);
|
|
5171
5171
|
}
|
|
@@ -5220,7 +5220,7 @@ function findVertex(event) {
|
|
|
5220
5220
|
return event.target?.closest?.('[data-sf-mark="radar-vertex"]');
|
|
5221
5221
|
}
|
|
5222
5222
|
function isVertexPointer(event) {
|
|
5223
|
-
return event.button === 0 && !
|
|
5223
|
+
return event.button === 0 && !chunkMR32IJQO_cjs.isCameraGesture(event);
|
|
5224
5224
|
}
|
|
5225
5225
|
function resolveRadarVertexDrag(svg, event) {
|
|
5226
5226
|
if (!isVertexPointer(event)) {
|
|
@@ -5230,7 +5230,7 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5230
5230
|
if (!element2) {
|
|
5231
5231
|
return null;
|
|
5232
5232
|
}
|
|
5233
|
-
const owner =
|
|
5233
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(element2);
|
|
5234
5234
|
if (owner?.role !== "chart") {
|
|
5235
5235
|
return null;
|
|
5236
5236
|
}
|
|
@@ -5239,7 +5239,7 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5239
5239
|
if (!series || !Number.isInteger(index) || index < 0) {
|
|
5240
5240
|
return null;
|
|
5241
5241
|
}
|
|
5242
|
-
const frame = parseRadarFrame(
|
|
5242
|
+
const frame = parseRadarFrame(chunkMR32IJQO_cjs.findOwnerNode(svg, owner.id, chunkMR32IJQO_cjs.isPrimary));
|
|
5243
5243
|
if (!frame || index >= frame.count) {
|
|
5244
5244
|
return null;
|
|
5245
5245
|
}
|
|
@@ -5249,11 +5249,11 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5249
5249
|
|
|
5250
5250
|
// src/runtime/interaction/radarVertexDrag/session.ts
|
|
5251
5251
|
function valueFrom(svg, event, drag) {
|
|
5252
|
-
const point =
|
|
5252
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(svg, event);
|
|
5253
5253
|
if (!point) {
|
|
5254
5254
|
return null;
|
|
5255
5255
|
}
|
|
5256
|
-
return
|
|
5256
|
+
return chunkC25NWWIH_cjs.radarValueAtPoint(drag.frame, drag.index, point.x, point.y);
|
|
5257
5257
|
}
|
|
5258
5258
|
var RadarVertexDragSession = class {
|
|
5259
5259
|
#svg;
|
|
@@ -5285,7 +5285,7 @@ var RadarVertexDragSession = class {
|
|
|
5285
5285
|
if (!this.#readout) {
|
|
5286
5286
|
this.#readout = createValueReadout(this.#svg);
|
|
5287
5287
|
}
|
|
5288
|
-
const vertex =
|
|
5288
|
+
const vertex = chunkC25NWWIH_cjs.radarVertexPoint(this.#drag.frame, this.#drag.index, value);
|
|
5289
5289
|
positionRadarReadout(this.#readout, vertex, this.#drag.frame.centerY, value);
|
|
5290
5290
|
}
|
|
5291
5291
|
cancel() {
|
|
@@ -5376,7 +5376,7 @@ function captureTextFit(text) {
|
|
|
5376
5376
|
fontSize,
|
|
5377
5377
|
lineHeight,
|
|
5378
5378
|
padding: Math.max(8, text.strokeWidth * 2),
|
|
5379
|
-
longestWord: Math.max(0, ...words.map((word) =>
|
|
5379
|
+
longestWord: Math.max(0, ...words.map((word) => chunkC25NWWIH_cjs.estimateTextWidth(word, fontSize, bold)))
|
|
5380
5380
|
};
|
|
5381
5381
|
}
|
|
5382
5382
|
var COMMIT_PRECISION = 10;
|
|
@@ -5387,7 +5387,7 @@ function minWidthForText(fit) {
|
|
|
5387
5387
|
return roundUpForCommit(fit.longestWord + fit.padding * 2);
|
|
5388
5388
|
}
|
|
5389
5389
|
function minHeightForText(fit, width) {
|
|
5390
|
-
const lines =
|
|
5390
|
+
const lines = chunkC25NWWIH_cjs.wrapText(fit.rawText, Math.max(0, width - fit.padding * 2), fit.fontSize);
|
|
5391
5391
|
return roundUpForCommit(lines.length * fit.fontSize * fit.lineHeight + fit.padding * 2);
|
|
5392
5392
|
}
|
|
5393
5393
|
|
|
@@ -5521,7 +5521,7 @@ function applyRectBounds(rect, kind, bounds) {
|
|
|
5521
5521
|
rect.setAttribute("width", String(bounds.width));
|
|
5522
5522
|
rect.setAttribute("height", String(bounds.height));
|
|
5523
5523
|
if (kind === "pill") {
|
|
5524
|
-
rect.setAttribute("rx", String(
|
|
5524
|
+
rect.setAttribute("rx", String(chunkC25NWWIH_cjs.pillCornerRadius(bounds.width, bounds.height)));
|
|
5525
5525
|
}
|
|
5526
5526
|
}
|
|
5527
5527
|
function applyEllipseBounds(ellipse, bounds) {
|
|
@@ -5531,7 +5531,7 @@ function applyEllipseBounds(ellipse, bounds) {
|
|
|
5531
5531
|
ellipse.setAttribute("ry", String(bounds.height / 2));
|
|
5532
5532
|
}
|
|
5533
5533
|
function applySymbolBounds(path, bounds) {
|
|
5534
|
-
const raw = path.getAttribute(
|
|
5534
|
+
const raw = path.getAttribute(chunkC25NWWIH_cjs.SYMBOL_POINTS_ATTR);
|
|
5535
5535
|
if (!raw) {
|
|
5536
5536
|
return false;
|
|
5537
5537
|
}
|
|
@@ -5539,22 +5539,22 @@ function applySymbolBounds(path, bounds) {
|
|
|
5539
5539
|
x: bounds.x + x * bounds.width,
|
|
5540
5540
|
y: bounds.y + y * bounds.height
|
|
5541
5541
|
}));
|
|
5542
|
-
const tension = Number(path.getAttribute(
|
|
5543
|
-
path.setAttribute("d",
|
|
5542
|
+
const tension = Number(path.getAttribute(chunkC25NWWIH_cjs.SYMBOL_TENSION_ATTR)) || 0;
|
|
5543
|
+
path.setAttribute("d", chunkC25NWWIH_cjs.freeformPathData({ points, tension, closed: true }));
|
|
5544
5544
|
return true;
|
|
5545
5545
|
}
|
|
5546
5546
|
function applyPathBounds(path, kind, bounds) {
|
|
5547
5547
|
if (kind === "symbol" && applySymbolBounds(path, bounds)) {
|
|
5548
5548
|
return;
|
|
5549
5549
|
}
|
|
5550
|
-
const pathData =
|
|
5550
|
+
const pathData = chunkC25NWWIH_cjs.localShapePath(kind, bounds.x, bounds.y, bounds.width, bounds.height);
|
|
5551
5551
|
if (pathData) {
|
|
5552
5552
|
path.setAttribute("d", pathData);
|
|
5553
5553
|
}
|
|
5554
5554
|
}
|
|
5555
5555
|
function applyFrameBoundaryBounds(path, bounds) {
|
|
5556
|
-
const cornerRadius = Number(path.getAttribute(
|
|
5557
|
-
const squareCorner = path.getAttribute(
|
|
5556
|
+
const cornerRadius = Number(path.getAttribute(chunkC25NWWIH_cjs.CORNER_RADIUS_ATTR) ?? 0);
|
|
5557
|
+
const squareCorner = path.getAttribute(chunkC25NWWIH_cjs.SQUARE_CORNER_ATTR);
|
|
5558
5558
|
const radii = {
|
|
5559
5559
|
topLeft: cornerRadius,
|
|
5560
5560
|
topRight: cornerRadius,
|
|
@@ -5564,7 +5564,7 @@ function applyFrameBoundaryBounds(path, bounds) {
|
|
|
5564
5564
|
if (squareCorner) {
|
|
5565
5565
|
radii[squareCorner] = 0;
|
|
5566
5566
|
}
|
|
5567
|
-
path.setAttribute("d",
|
|
5567
|
+
path.setAttribute("d", chunkC25NWWIH_cjs.cornersRoundedRectPath(bounds.x, bounds.y, bounds.width, bounds.height, radii));
|
|
5568
5568
|
}
|
|
5569
5569
|
function applySingleNodeBounds(primary, kind, bounds) {
|
|
5570
5570
|
const tag = primary.tagName.toLowerCase();
|
|
@@ -5574,7 +5574,7 @@ function applySingleNodeBounds(primary, kind, bounds) {
|
|
|
5574
5574
|
applyEllipseBounds(primary, bounds);
|
|
5575
5575
|
} else if (tag === "foreignobject") {
|
|
5576
5576
|
applyRectBounds(primary, null, bounds);
|
|
5577
|
-
} else if (tag === "path" && primary.hasAttribute(
|
|
5577
|
+
} else if (tag === "path" && primary.hasAttribute(chunkC25NWWIH_cjs.CORNER_RADIUS_ATTR)) {
|
|
5578
5578
|
applyFrameBoundaryBounds(primary, bounds);
|
|
5579
5579
|
} else if (tag === "path" && kind) {
|
|
5580
5580
|
applyPathBounds(primary, kind, bounds);
|
|
@@ -5613,7 +5613,7 @@ function updateSelectionRing(overlay, bounds) {
|
|
|
5613
5613
|
}
|
|
5614
5614
|
function updateSelectionOverlay(overlay, bounds) {
|
|
5615
5615
|
updateSelectionRing(overlay, bounds);
|
|
5616
|
-
for (const [centerX, centerY, name] of
|
|
5616
|
+
for (const [centerX, centerY, name] of chunkMR32IJQO_cjs.resizeHandlePositions(bounds)) {
|
|
5617
5617
|
const handle = overlay.querySelector(`[data-sf-resize-handle="${name}"]`);
|
|
5618
5618
|
if (!handle) {
|
|
5619
5619
|
continue;
|
|
@@ -5630,7 +5630,7 @@ function replaceTextLines(textElement, lines, x, lineHeight) {
|
|
|
5630
5630
|
textElement.removeChild(textElement.firstChild);
|
|
5631
5631
|
}
|
|
5632
5632
|
lines.forEach((line, index) => {
|
|
5633
|
-
const tspan = document.createElementNS(
|
|
5633
|
+
const tspan = document.createElementNS(chunkMR32IJQO_cjs.SVG_NAMESPACE, "tspan");
|
|
5634
5634
|
tspan.setAttribute("x", String(x));
|
|
5635
5635
|
if (index > 0) {
|
|
5636
5636
|
tspan.setAttribute("dy", `${lineHeight}px`);
|
|
@@ -5650,7 +5650,7 @@ function applyLiveText(textElement, rawText, bounds, strokeWidth) {
|
|
|
5650
5650
|
const height = Math.max(0, bounds.height - padding * 2);
|
|
5651
5651
|
const boxX = bounds.x + padding;
|
|
5652
5652
|
const boxY = bounds.y + padding;
|
|
5653
|
-
const lines =
|
|
5653
|
+
const lines = chunkC25NWWIH_cjs.wrapText(rawText, width, fontSize);
|
|
5654
5654
|
const linePixels = fontSize * lineHeight;
|
|
5655
5655
|
const contentHeight = lines.length * linePixels;
|
|
5656
5656
|
const firstY = verticalAlign === "top" ? boxY + fontSize : verticalAlign === "bottom" ? boxY + height - contentHeight + fontSize : boxY + (height - contentHeight) / 2 + fontSize;
|
|
@@ -5663,7 +5663,7 @@ function applyLiveText(textElement, rawText, bounds, strokeWidth) {
|
|
|
5663
5663
|
|
|
5664
5664
|
// src/runtime/interaction/resize/preview.ts
|
|
5665
5665
|
function textBoundsFor(kind, bounds) {
|
|
5666
|
-
return kind === "person" ?
|
|
5666
|
+
return kind === "person" ? chunkC25NWWIH_cjs.personLabelArea(bounds.x, bounds.y, bounds.width, bounds.height) : bounds;
|
|
5667
5667
|
}
|
|
5668
5668
|
function applyGeometryPreview(drag, bounds) {
|
|
5669
5669
|
if (drag.isComposite) {
|
|
@@ -5683,7 +5683,7 @@ function applyResizePreview(drag, bounds) {
|
|
|
5683
5683
|
applyLiveText(drag.text.el, drag.text.rawText, textBoundsFor(drag.kind, bounds), drag.text.strokeWidth);
|
|
5684
5684
|
}
|
|
5685
5685
|
if (drag.bubbles) {
|
|
5686
|
-
|
|
5686
|
+
chunkMR32IJQO_cjs.updateQuickDuplicateBubbles(drag.bubbles, bounds);
|
|
5687
5687
|
}
|
|
5688
5688
|
updateLiveLinks(drag.liveLinks, bounds);
|
|
5689
5689
|
}
|
|
@@ -5704,9 +5704,9 @@ function snapResize(svg, drag, pointer) {
|
|
|
5704
5704
|
};
|
|
5705
5705
|
}
|
|
5706
5706
|
const axes = HANDLE_AXES[drag.handle];
|
|
5707
|
-
const candidates = nearestCandidates(proposed,
|
|
5707
|
+
const candidates = nearestCandidates(proposed, chunkMR32IJQO_cjs.findSnapCandidateBounds(svg, /* @__PURE__ */ new Set([drag.owner.id])));
|
|
5708
5708
|
const snap = computeSnap(proposed, candidates, {
|
|
5709
|
-
threshold: snapDistancePx(svg) /
|
|
5709
|
+
threshold: snapDistancePx(svg) / chunkMR32IJQO_cjs.pxPerUnit(svg),
|
|
5710
5710
|
activeX: resizeActivePoints(axes.x),
|
|
5711
5711
|
activeY: resizeActivePoints(axes.y),
|
|
5712
5712
|
guideOverhang: GUIDE_OVERHANG3
|
|
@@ -5747,13 +5747,13 @@ function selectResizeTarget(svg, event) {
|
|
|
5747
5747
|
if (!ownerId) {
|
|
5748
5748
|
return null;
|
|
5749
5749
|
}
|
|
5750
|
-
const primary =
|
|
5751
|
-
const owner = primary &&
|
|
5750
|
+
const primary = chunkMR32IJQO_cjs.findOwnerNode(svg, ownerId, chunkMR32IJQO_cjs.isPrimary);
|
|
5751
|
+
const owner = primary && chunkMR32IJQO_cjs.resolveOwner(primary);
|
|
5752
5752
|
if (!primary || !hasEditableGeometry(owner)) {
|
|
5753
5753
|
return null;
|
|
5754
5754
|
}
|
|
5755
|
-
const nodes =
|
|
5756
|
-
const geometryNodes = isCompositeOwner(owner) ? nodes : nodes.filter((node) => !
|
|
5755
|
+
const nodes = chunkMR32IJQO_cjs.findAllOwnerNodes(svg, ownerId);
|
|
5756
|
+
const geometryNodes = isCompositeOwner(owner) ? nodes : nodes.filter((node) => !chunkMR32IJQO_cjs.isTextLabel(node));
|
|
5757
5757
|
if (!geometryNodes.length) {
|
|
5758
5758
|
return null;
|
|
5759
5759
|
}
|
|
@@ -5771,7 +5771,7 @@ function selectResizeTarget(svg, event) {
|
|
|
5771
5771
|
|
|
5772
5772
|
// src/runtime/interaction/resize/textCapture.ts
|
|
5773
5773
|
function captureResizeText(nodes, primary) {
|
|
5774
|
-
const textElement = nodes.find(
|
|
5774
|
+
const textElement = nodes.find(chunkMR32IJQO_cjs.isTextLabel);
|
|
5775
5775
|
const rawText = primary.getAttribute("aria-label");
|
|
5776
5776
|
if (!textElement || !rawText) {
|
|
5777
5777
|
return null;
|
|
@@ -5789,7 +5789,7 @@ function createResizeDragState(svg, event) {
|
|
|
5789
5789
|
if (!selection) {
|
|
5790
5790
|
return null;
|
|
5791
5791
|
}
|
|
5792
|
-
const startBounds =
|
|
5792
|
+
const startBounds = chunkMR32IJQO_cjs.symbolDeclaredBounds(selection.primary) ?? selection.primary.getBBox();
|
|
5793
5793
|
const composite = isCompositeOwner(selection.owner);
|
|
5794
5794
|
const isContainer = CONTAINER_ROLES.has(selection.owner.role);
|
|
5795
5795
|
selection.captureTarget.setPointerCapture?.(event.pointerId);
|
|
@@ -5802,7 +5802,7 @@ function createResizeDragState(svg, event) {
|
|
|
5802
5802
|
isComposite: composite,
|
|
5803
5803
|
geometryNodes: selection.geometryNodes,
|
|
5804
5804
|
insets: selection.geometryNodes.map(
|
|
5805
|
-
(node) => node === selection.primary ? NO_INSET : insetWithin(startBounds,
|
|
5805
|
+
(node) => node === selection.primary ? NO_INSET : insetWithin(startBounds, chunkMR32IJQO_cjs.symbolDeclaredBounds(node) ?? node.getBBox())
|
|
5806
5806
|
),
|
|
5807
5807
|
baseTransforms: selection.geometryNodes.map((node) => node.getAttribute("transform")),
|
|
5808
5808
|
overlay: selection.overlay,
|
|
@@ -5828,7 +5828,7 @@ var ResizeSession = class {
|
|
|
5828
5828
|
this.#emitter = emitter;
|
|
5829
5829
|
}
|
|
5830
5830
|
pointerDown = (event) => {
|
|
5831
|
-
if (event.button !== 0 || this.#drag ||
|
|
5831
|
+
if (event.button !== 0 || this.#drag || chunkMR32IJQO_cjs.isCameraGesture(event)) {
|
|
5832
5832
|
return;
|
|
5833
5833
|
}
|
|
5834
5834
|
this.#drag = createResizeDragState(this.#svg, event);
|
|
@@ -5843,7 +5843,7 @@ var ResizeSession = class {
|
|
|
5843
5843
|
const bounds = keepsProportions(drag, event.shiftKey) ? lockAspect(snapped.bounds, drag.startBounds, drag.handle) : snapped.bounds;
|
|
5844
5844
|
const { guides } = snapped;
|
|
5845
5845
|
applyResizePreview(drag, clampResizeToChildren(bounds, drag.childrenBounds));
|
|
5846
|
-
|
|
5846
|
+
chunkMR32IJQO_cjs.updateAlignmentGuides(this.#svg, guides, RESIZE_GUIDE_COLOR);
|
|
5847
5847
|
};
|
|
5848
5848
|
pointerUp = (event) => {
|
|
5849
5849
|
const drag = this.#drag;
|
|
@@ -5852,7 +5852,7 @@ var ResizeSession = class {
|
|
|
5852
5852
|
}
|
|
5853
5853
|
this.#drag = null;
|
|
5854
5854
|
event.target?.releasePointerCapture?.(drag.pointerId);
|
|
5855
|
-
|
|
5855
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
5856
5856
|
if (!drag.moved) {
|
|
5857
5857
|
return;
|
|
5858
5858
|
}
|
|
@@ -5891,7 +5891,7 @@ function resolveSankeyNodeLabelTarget(event) {
|
|
|
5891
5891
|
if (!labelElement) {
|
|
5892
5892
|
return null;
|
|
5893
5893
|
}
|
|
5894
|
-
const owner =
|
|
5894
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(labelElement);
|
|
5895
5895
|
if (owner?.role !== "chart") {
|
|
5896
5896
|
return null;
|
|
5897
5897
|
}
|
|
@@ -5902,7 +5902,7 @@ function resolveSankeyNodeLabelTarget(event) {
|
|
|
5902
5902
|
return { owner, nodeId, labelElement };
|
|
5903
5903
|
}
|
|
5904
5904
|
function createSankeyNodeLabelEditor(target, emitter, onClose) {
|
|
5905
|
-
const rect =
|
|
5905
|
+
const rect = chunkMR32IJQO_cjs.screenRectOf(target.labelElement);
|
|
5906
5906
|
if (rect.width <= 0 && rect.height <= 0) {
|
|
5907
5907
|
return null;
|
|
5908
5908
|
}
|
|
@@ -5959,7 +5959,7 @@ function clearSankeyNodeDragPreview(drag) {
|
|
|
5959
5959
|
// src/runtime/interaction/sankeyNode/target.ts
|
|
5960
5960
|
var RIBBON_PATH = /^M\s+(-?[\d.]+)\s+(-?[\d.]+)\s+C\s+-?[\d.]+\s+-?[\d.]+\s+-?[\d.]+\s+(-?[\d.]+)\s+(-?[\d.]+)\s+-?[\d.]+\s+L\s+-?[\d.]+\s+(-?[\d.]+)\s+C\s+-?[\d.]+\s+-?[\d.]+\s+-?[\d.]+\s+(-?[\d.]+)\s+-?[\d.]+\s+-?[\d.]+\s+Z$/;
|
|
5961
5961
|
function isNodePointer(event) {
|
|
5962
|
-
return event.button === 0 && !
|
|
5962
|
+
return event.button === 0 && !chunkMR32IJQO_cjs.isCameraGesture(event);
|
|
5963
5963
|
}
|
|
5964
5964
|
function findNodeRect(event) {
|
|
5965
5965
|
return event.target?.closest?.('[data-sf-mark="sankey-node"]');
|
|
@@ -6017,7 +6017,7 @@ function resolveSankeyNodeDrag(svg, event) {
|
|
|
6017
6017
|
if (!rect) {
|
|
6018
6018
|
return null;
|
|
6019
6019
|
}
|
|
6020
|
-
const owner =
|
|
6020
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(rect);
|
|
6021
6021
|
if (owner?.role !== "chart") {
|
|
6022
6022
|
return null;
|
|
6023
6023
|
}
|
|
@@ -6025,7 +6025,7 @@ function resolveSankeyNodeDrag(svg, event) {
|
|
|
6025
6025
|
if (!nodeId) {
|
|
6026
6026
|
return null;
|
|
6027
6027
|
}
|
|
6028
|
-
const start =
|
|
6028
|
+
const start = chunkMR32IJQO_cjs.pointerUserPoint(svg, event);
|
|
6029
6029
|
if (!start) {
|
|
6030
6030
|
return null;
|
|
6031
6031
|
}
|
|
@@ -6071,7 +6071,7 @@ var SankeyNodeDragSession = class {
|
|
|
6071
6071
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
6072
6072
|
return;
|
|
6073
6073
|
}
|
|
6074
|
-
const point =
|
|
6074
|
+
const point = chunkMR32IJQO_cjs.pointerUserPoint(this.#svg, event);
|
|
6075
6075
|
if (!point) {
|
|
6076
6076
|
return;
|
|
6077
6077
|
}
|
|
@@ -6085,7 +6085,7 @@ var SankeyNodeDragSession = class {
|
|
|
6085
6085
|
const leadBounds = offsetBounds(drag.originalBounds, rawDx, rawDy);
|
|
6086
6086
|
const candidates = nearestCandidates(leadBounds, drag.siblingBounds);
|
|
6087
6087
|
const snap = computeSnap(leadBounds, candidates, {
|
|
6088
|
-
threshold: SNAP_THRESHOLD_PX /
|
|
6088
|
+
threshold: SNAP_THRESHOLD_PX / chunkMR32IJQO_cjs.pxPerUnit(this.#svg),
|
|
6089
6089
|
activeX: MOVE_ACTIVE_POINTS,
|
|
6090
6090
|
activeY: MOVE_ACTIVE_POINTS,
|
|
6091
6091
|
guideOverhang: GUIDE_OVERHANG4
|
|
@@ -6095,7 +6095,7 @@ var SankeyNodeDragSession = class {
|
|
|
6095
6095
|
drag.lastDx = dx;
|
|
6096
6096
|
drag.lastDy = dy;
|
|
6097
6097
|
updateSankeyNodeDragPreview(drag, dx, dy);
|
|
6098
|
-
|
|
6098
|
+
chunkMR32IJQO_cjs.updateAlignmentGuides(
|
|
6099
6099
|
this.#svg,
|
|
6100
6100
|
[snap.x.guide, snap.y.guide].filter((guide) => guide !== null),
|
|
6101
6101
|
GUIDE_COLOR3
|
|
@@ -6106,7 +6106,7 @@ var SankeyNodeDragSession = class {
|
|
|
6106
6106
|
clearSankeyNodeDragPreview(this.#drag);
|
|
6107
6107
|
}
|
|
6108
6108
|
this.#drag = null;
|
|
6109
|
-
|
|
6109
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
6110
6110
|
}
|
|
6111
6111
|
finish(event) {
|
|
6112
6112
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
@@ -6116,7 +6116,7 @@ var SankeyNodeDragSession = class {
|
|
|
6116
6116
|
this.#drag = null;
|
|
6117
6117
|
event.target?.releasePointerCapture?.(drag.pointerId);
|
|
6118
6118
|
clearSankeyNodeDragPreview(drag);
|
|
6119
|
-
|
|
6119
|
+
chunkMR32IJQO_cjs.clearAlignmentGuides(this.#svg);
|
|
6120
6120
|
if (!drag.moved) {
|
|
6121
6121
|
return;
|
|
6122
6122
|
}
|
|
@@ -6172,7 +6172,7 @@ function bindSankeyNode(viewer, emitter) {
|
|
|
6172
6172
|
var FALLBACK_WIDTH = 120;
|
|
6173
6173
|
var FALLBACK_HEIGHT = 28;
|
|
6174
6174
|
function centeredLabelRect(primaryNode) {
|
|
6175
|
-
const primaryRect =
|
|
6175
|
+
const primaryRect = chunkMR32IJQO_cjs.screenRectOf(primaryNode);
|
|
6176
6176
|
return {
|
|
6177
6177
|
left: primaryRect.left + (primaryRect.width - FALLBACK_WIDTH) / 2,
|
|
6178
6178
|
top: primaryRect.top + (primaryRect.height - FALLBACK_HEIGHT) / 2,
|
|
@@ -6182,10 +6182,10 @@ function centeredLabelRect(primaryNode) {
|
|
|
6182
6182
|
}
|
|
6183
6183
|
function resolveTextEditRect(owner, textNode, primaryNode) {
|
|
6184
6184
|
if (owner.role === "shape") {
|
|
6185
|
-
return primaryNode ?
|
|
6185
|
+
return primaryNode ? chunkMR32IJQO_cjs.screenRectOf(primaryNode) : null;
|
|
6186
6186
|
}
|
|
6187
6187
|
if (textNode) {
|
|
6188
|
-
return
|
|
6188
|
+
return chunkMR32IJQO_cjs.screenRectOf(textNode);
|
|
6189
6189
|
}
|
|
6190
6190
|
return primaryNode ? centeredLabelRect(primaryNode) : null;
|
|
6191
6191
|
}
|
|
@@ -6205,8 +6205,8 @@ function textAlign(owner, textNode) {
|
|
|
6205
6205
|
return anchor === "end" ? "right" : "left";
|
|
6206
6206
|
}
|
|
6207
6207
|
function createActiveTextEditor(svg, owner, emitter, onClose) {
|
|
6208
|
-
const textNode =
|
|
6209
|
-
const primaryNode =
|
|
6208
|
+
const textNode = chunkMR32IJQO_cjs.findOwnerNode(svg, owner.id, chunkMR32IJQO_cjs.isTextLabel);
|
|
6209
|
+
const primaryNode = chunkMR32IJQO_cjs.findOwnerNode(svg, owner.id, chunkMR32IJQO_cjs.isPrimary);
|
|
6210
6210
|
const rect = resolveTextEditRect(owner, textNode, primaryNode);
|
|
6211
6211
|
if (!rect) {
|
|
6212
6212
|
return null;
|
|
@@ -6252,7 +6252,7 @@ function isFrameTitle(target) {
|
|
|
6252
6252
|
}
|
|
6253
6253
|
function resolveEditableTextOwner(event) {
|
|
6254
6254
|
const target = event.target;
|
|
6255
|
-
const owner =
|
|
6255
|
+
const owner = chunkMR32IJQO_cjs.resolveOwner(target);
|
|
6256
6256
|
if (!owner) {
|
|
6257
6257
|
return null;
|
|
6258
6258
|
}
|
|
@@ -6393,7 +6393,7 @@ function applyToken(target, lines, token) {
|
|
|
6393
6393
|
function maskSource(lines) {
|
|
6394
6394
|
let tokens;
|
|
6395
6395
|
try {
|
|
6396
|
-
tokens =
|
|
6396
|
+
tokens = chunkC25NWWIH_cjs.tokenizeSource(lines.join("\n"));
|
|
6397
6397
|
} catch {
|
|
6398
6398
|
return null;
|
|
6399
6399
|
}
|
|
@@ -6726,7 +6726,7 @@ function resolveCanvasObjectInsertionTarget(sfl, lines, parentId) {
|
|
|
6726
6726
|
const modelRange = findFirstBlockOfKind(lines, "Model");
|
|
6727
6727
|
return modelRange ? { range: modelRange, origin: { x: 0, y: 0 } } : null;
|
|
6728
6728
|
}
|
|
6729
|
-
const parent =
|
|
6729
|
+
const parent = chunkC25NWWIH_cjs.sflToCanvasState(sfl).canvasObjects.find((canvasObject) => canvasObject.id === parentId);
|
|
6730
6730
|
if (!parent) {
|
|
6731
6731
|
return null;
|
|
6732
6732
|
}
|
|
@@ -7172,7 +7172,7 @@ function movePathPoints(lines, range, dx, dy) {
|
|
|
7172
7172
|
replacePropertyValue(lines, span, shifted);
|
|
7173
7173
|
}
|
|
7174
7174
|
function applyMoveChange(sfl, event) {
|
|
7175
|
-
const state =
|
|
7175
|
+
const state = chunkC25NWWIH_cjs.sflToCanvasState(sfl);
|
|
7176
7176
|
const canvasObject = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7177
7177
|
if (!canvasObject) {
|
|
7178
7178
|
return sfl;
|
|
@@ -7197,7 +7197,7 @@ function applyMoveChange(sfl, event) {
|
|
|
7197
7197
|
|
|
7198
7198
|
// src/runtime/interaction/sflPatch/changes/pathPointChange.ts
|
|
7199
7199
|
function applyPathPointChange(sfl, event) {
|
|
7200
|
-
const canvasObjects =
|
|
7200
|
+
const canvasObjects = chunkC25NWWIH_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7201
7201
|
const canvasObject = canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7202
7202
|
if (!canvasObject) {
|
|
7203
7203
|
return sfl;
|
|
@@ -7351,7 +7351,7 @@ function resolveConnectionInsertionTarget(sfl, lines, options) {
|
|
|
7351
7351
|
if (!VALID_IDENT.test(options.id) || nameExists(lines, options.id)) {
|
|
7352
7352
|
return null;
|
|
7353
7353
|
}
|
|
7354
|
-
const canvasObjects =
|
|
7354
|
+
const canvasObjects = chunkC25NWWIH_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7355
7355
|
const hasSource = canvasObjects.some((canvasObject) => canvasObject.id === options.fromId);
|
|
7356
7356
|
const hasTarget = canvasObjects.some((canvasObject) => canvasObject.id === options.toId);
|
|
7357
7357
|
if (!hasSource || !hasTarget) {
|
|
@@ -7415,13 +7415,13 @@ function isometricOffset(direction, object, gap) {
|
|
|
7415
7415
|
const { depth } = object.isometric;
|
|
7416
7416
|
switch (direction) {
|
|
7417
7417
|
case "iso-width-pos":
|
|
7418
|
-
return { dx: (width + gap) *
|
|
7418
|
+
return { dx: (width + gap) * chunkC25NWWIH_cjs.AXIS_COS, dy: (width + gap) * chunkC25NWWIH_cjs.AXIS_SIN };
|
|
7419
7419
|
case "iso-width-neg":
|
|
7420
|
-
return { dx: -(width + gap) *
|
|
7420
|
+
return { dx: -(width + gap) * chunkC25NWWIH_cjs.AXIS_COS, dy: -(width + gap) * chunkC25NWWIH_cjs.AXIS_SIN };
|
|
7421
7421
|
case "iso-depth-pos":
|
|
7422
|
-
return { dx: -(depth + gap) *
|
|
7422
|
+
return { dx: -(depth + gap) * chunkC25NWWIH_cjs.AXIS_COS, dy: (depth + gap) * chunkC25NWWIH_cjs.AXIS_SIN };
|
|
7423
7423
|
case "iso-depth-neg":
|
|
7424
|
-
return { dx: (depth + gap) *
|
|
7424
|
+
return { dx: (depth + gap) * chunkC25NWWIH_cjs.AXIS_COS, dy: -(depth + gap) * chunkC25NWWIH_cjs.AXIS_SIN };
|
|
7425
7425
|
case "iso-height-pos":
|
|
7426
7426
|
return { dx: 0, dy: height + gap };
|
|
7427
7427
|
case "iso-height-neg":
|
|
@@ -7484,7 +7484,7 @@ function resolveLinkInsertionTarget(sfl, lines, options) {
|
|
|
7484
7484
|
if (!VALID_IDENT.test(options.id) || nameExists(lines, options.id)) {
|
|
7485
7485
|
return null;
|
|
7486
7486
|
}
|
|
7487
|
-
const canvasObjects =
|
|
7487
|
+
const canvasObjects = chunkC25NWWIH_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7488
7488
|
const hasSource = canvasObjects.some((canvasObject) => canvasObject.id === options.fromId);
|
|
7489
7489
|
const hasTarget = canvasObjects.some((canvasObject) => canvasObject.id === options.toId);
|
|
7490
7490
|
if (!hasSource || !hasTarget) {
|
|
@@ -7570,21 +7570,21 @@ function duplicateShape(sfl, input) {
|
|
|
7570
7570
|
|
|
7571
7571
|
// src/runtime/interaction/sflPatch/changes/quickDuplicateChange.ts
|
|
7572
7572
|
function applyQuickDuplicateChange(sfl, event, options) {
|
|
7573
|
-
const state =
|
|
7573
|
+
const state = chunkC25NWWIH_cjs.sflToCanvasState(sfl);
|
|
7574
7574
|
const object = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7575
7575
|
if (!object) {
|
|
7576
7576
|
return sfl;
|
|
7577
7577
|
}
|
|
7578
7578
|
const { direction } = event;
|
|
7579
7579
|
if (isIsometricDirection2(direction)) {
|
|
7580
|
-
return
|
|
7580
|
+
return chunkC25NWWIH_cjs.isIsometricObject(object) ? duplicateIsometricObject(sfl, object, direction, options) : sfl;
|
|
7581
7581
|
}
|
|
7582
|
-
return
|
|
7582
|
+
return chunkC25NWWIH_cjs.isIsometricObject(object) ? sfl : duplicateShape(sfl, { object, links: state.links, side: direction, options });
|
|
7583
7583
|
}
|
|
7584
7584
|
|
|
7585
7585
|
// src/runtime/interaction/sflPatch/changes/resizeChange.ts
|
|
7586
7586
|
function applyResizeChange(sfl, event) {
|
|
7587
|
-
const state =
|
|
7587
|
+
const state = chunkC25NWWIH_cjs.sflToCanvasState(sfl);
|
|
7588
7588
|
const canvasObject = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7589
7589
|
const parent = canvasObject?.parentFrameId ? state.canvasObjects.find((candidate) => candidate.id === canvasObject.parentFrameId) : void 0;
|
|
7590
7590
|
const originX = parent?.x ?? 0;
|