stickyflow 0.11.3 → 0.12.0
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 +17 -0
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.d.cts +3 -3
- package/dist/binding/index.d.ts +3 -3
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-WZA3DJJH.cjs → chunk-3OF37CZX.cjs} +15 -15
- package/dist/{chunk-WZA3DJJH.cjs.map → chunk-3OF37CZX.cjs.map} +1 -1
- package/dist/{chunk-V22J7Z4H.cjs → chunk-3XPNGIMV.cjs} +37 -37
- package/dist/chunk-3XPNGIMV.cjs.map +1 -0
- package/dist/{chunk-G6IW2IX3.js → chunk-4SXXMOXR.js} +31 -5
- package/dist/chunk-4SXXMOXR.js.map +1 -0
- package/dist/{chunk-GQRJSA73.cjs → chunk-EG7VZJZX.cjs} +23 -23
- package/dist/{chunk-GQRJSA73.cjs.map → chunk-EG7VZJZX.cjs.map} +1 -1
- package/dist/{chunk-BFQWCOEC.js → chunk-FYSJMUJI.js} +3 -3
- package/dist/{chunk-BFQWCOEC.js.map → chunk-FYSJMUJI.js.map} +1 -1
- package/dist/{chunk-W25SXORW.js → chunk-LDRUTQF7.js} +4 -4
- package/dist/{chunk-W25SXORW.js.map → chunk-LDRUTQF7.js.map} +1 -1
- package/dist/{chunk-IQQ5KBL6.js → chunk-Q4OIDWT6.js} +6 -6
- package/dist/chunk-Q4OIDWT6.js.map +1 -0
- package/dist/{chunk-UHKFJBY5.cjs → chunk-SKGJXCAO.cjs} +31 -5
- package/dist/chunk-SKGJXCAO.cjs.map +1 -0
- package/dist/{chunk-EBHO2FJ5.js → chunk-UCOMSZPC.js} +10 -9
- package/dist/chunk-UCOMSZPC.js.map +1 -0
- package/dist/{chunk-K5PGMZAD.cjs → chunk-ZE2KRWOM.cjs} +663 -662
- package/dist/chunk-ZE2KRWOM.cjs.map +1 -0
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +275 -237
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.js +41 -3
- package/dist/interaction/index.js.map +1 -1
- package/dist/{runtime-C-C5v9po.d.cts → runtime-BJDaqo6f.d.cts} +1 -1
- package/dist/{runtime-lCAfU-1Q.d.ts → runtime-DaconR36.d.ts} +1 -1
- package/dist/{runtimeTypes-BDA_CfWh.d.ts → runtimeTypes-BE_GI1yU.d.ts} +1 -1
- package/dist/{runtimeTypes-B7p6b1Bi.d.cts → runtimeTypes-BE_nllY6.d.cts} +1 -1
- package/dist/stickyflow-diagram.global.js +39 -39
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.d.cts +1 -1
- package/dist/viewer/index.d.ts +1 -1
- 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-EBHO2FJ5.js.map +0 -1
- package/dist/chunk-G6IW2IX3.js.map +0 -1
- package/dist/chunk-IQQ5KBL6.js.map +0 -1
- package/dist/chunk-K5PGMZAD.cjs.map +0 -1
- package/dist/chunk-UHKFJBY5.cjs.map +0 -1
- package/dist/chunk-V22J7Z4H.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk3OF37CZX_cjs = require('../chunk-3OF37CZX.cjs');
|
|
4
|
+
var chunkSKGJXCAO_cjs = require('../chunk-SKGJXCAO.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", chunkSKGJXCAO_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 = `${chunkSKGJXCAO_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, chunkSKGJXCAO_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, chunkSKGJXCAO_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 = chunkSKGJXCAO_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", chunkSKGJXCAO_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 = chunkSKGJXCAO_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 = chunkSKGJXCAO_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 + chunkSKGJXCAO_cjs.BAR_LABEL.gap + size.width / 2 : label.placement === "inside" ? end - chunkSKGJXCAO_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", chunkSKGJXCAO_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 = chunkSKGJXCAO_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(chunk3OF37CZX_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(chunk3OF37CZX_cjs.findOwnerNode(svg, target.owner.id, chunk3OF37CZX_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 && !chunk3OF37CZX_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 = chunk3OF37CZX_cjs.resolveOwner(mark);
|
|
303
303
|
if (owner?.role !== "chart") {
|
|
304
304
|
return null;
|
|
305
305
|
}
|
|
@@ -458,8 +458,8 @@ function bindChartValueDrag(viewer, emitter) {
|
|
|
458
458
|
|
|
459
459
|
// src/runtime/interaction/colorEdit/color.ts
|
|
460
460
|
function normalizeHex(value) {
|
|
461
|
-
const channels =
|
|
462
|
-
return channels &&
|
|
461
|
+
const channels = chunkSKGJXCAO_cjs.parseHexRgb(value);
|
|
462
|
+
return channels && chunkSKGJXCAO_cjs.rgbToHex(...channels);
|
|
463
463
|
}
|
|
464
464
|
var COLOR_FUNCTION = /^rgba?\(\s*(\d{1,3})\s*[, ]\s*(\d{1,3})\s*[, ]\s*(\d{1,3})\s*(?:[,/]\s*(\d*\.?\d+)(%?)\s*)?\)$/i;
|
|
465
465
|
var HEX_WITH_ALPHA = /^#([0-9a-f]{6})([0-9a-f]{2})$/i;
|
|
@@ -498,14 +498,14 @@ function clampChannel(value) {
|
|
|
498
498
|
return Math.max(0, Math.min(255, Math.round(value)));
|
|
499
499
|
}
|
|
500
500
|
function hexToRgb(hex) {
|
|
501
|
-
const [r, g, b] =
|
|
501
|
+
const [r, g, b] = chunkSKGJXCAO_cjs.parseHexRgb(hex) ?? [0, 0, 0];
|
|
502
502
|
return { r, g, b };
|
|
503
503
|
}
|
|
504
504
|
function rgbToHex2(rgb) {
|
|
505
|
-
return
|
|
505
|
+
return chunkSKGJXCAO_cjs.rgbToHex(clampChannel(rgb.r), clampChannel(rgb.g), clampChannel(rgb.b));
|
|
506
506
|
}
|
|
507
507
|
function hsvToRgb2(hsv) {
|
|
508
|
-
const { r, g, b } =
|
|
508
|
+
const { r, g, b } = chunkSKGJXCAO_cjs.hsvToRgb(
|
|
509
509
|
(hsv.h % 360 + 360) % 360,
|
|
510
510
|
Math.max(0, Math.min(1, hsv.s)),
|
|
511
511
|
Math.max(0, Math.min(1, hsv.v))
|
|
@@ -513,7 +513,7 @@ function hsvToRgb2(hsv) {
|
|
|
513
513
|
return { r, g, b };
|
|
514
514
|
}
|
|
515
515
|
function rgbToHsv2(rgb) {
|
|
516
|
-
return
|
|
516
|
+
return chunkSKGJXCAO_cjs.rgbToHsv(clampChannel(rgb.r), clampChannel(rgb.g), clampChannel(rgb.b));
|
|
517
517
|
}
|
|
518
518
|
function hexToHsv(hex) {
|
|
519
519
|
return rgbToHsv2(hexToRgb(hex));
|
|
@@ -1753,7 +1753,7 @@ var ColorEditSession = class {
|
|
|
1753
1753
|
const hasOverride = target.node.getAttribute("data-sf-color-override") === "true";
|
|
1754
1754
|
this.#open = openColorPopover({
|
|
1755
1755
|
seed: seedFrom(fill, readGradientValue(this.#svg, fill)),
|
|
1756
|
-
anchor:
|
|
1756
|
+
anchor: chunk3OF37CZX_cjs.screenRectOf(target.node),
|
|
1757
1757
|
theme: resolveTheme(this.#theme),
|
|
1758
1758
|
allowGradient: !target.solidOnly,
|
|
1759
1759
|
onCommit: (color) => {
|
|
@@ -1835,7 +1835,7 @@ function resolveTarget(event, selector, pathOf, rules) {
|
|
|
1835
1835
|
return null;
|
|
1836
1836
|
}
|
|
1837
1837
|
const path = pathOf(node);
|
|
1838
|
-
const owner =
|
|
1838
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(node);
|
|
1839
1839
|
if (!path || !owner || !isEditablePath(path, rules) || requiresPriorSelection(node, owner)) {
|
|
1840
1840
|
return null;
|
|
1841
1841
|
}
|
|
@@ -1857,7 +1857,7 @@ function resolveZoneGradientTarget(event) {
|
|
|
1857
1857
|
if (!node) {
|
|
1858
1858
|
return null;
|
|
1859
1859
|
}
|
|
1860
|
-
const owner =
|
|
1860
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(node);
|
|
1861
1861
|
if (!owner) {
|
|
1862
1862
|
return null;
|
|
1863
1863
|
}
|
|
@@ -1893,7 +1893,7 @@ var ZoneGradientSession = class {
|
|
|
1893
1893
|
const beforeStops = sortStops(gradient.stops);
|
|
1894
1894
|
this.#open = openColorPopover({
|
|
1895
1895
|
seed: seedFrom(fill, gradient),
|
|
1896
|
-
anchor:
|
|
1896
|
+
anchor: chunk3OF37CZX_cjs.screenRectOf(target.node),
|
|
1897
1897
|
theme: resolveTheme(this.#theme),
|
|
1898
1898
|
allowGradient: true,
|
|
1899
1899
|
lockStops: true,
|
|
@@ -1966,15 +1966,15 @@ function bindDeleteSelection(viewer, emitter) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
|
|
1968
1968
|
// src/runtime/interaction/events.ts
|
|
1969
|
-
var Emitter2 = class extends
|
|
1969
|
+
var Emitter2 = class extends chunk3OF37CZX_cjs.Emitter {
|
|
1970
1970
|
};
|
|
1971
1971
|
|
|
1972
1972
|
// src/runtime/interaction/linkPreview/geometry.ts
|
|
1973
1973
|
function anchorPoint(bounds, side, other) {
|
|
1974
1974
|
if (side) {
|
|
1975
|
-
return
|
|
1975
|
+
return chunkSKGJXCAO_cjs.pointAtPort(bounds, { side, offset: 0.5 });
|
|
1976
1976
|
}
|
|
1977
|
-
return
|
|
1977
|
+
return chunkSKGJXCAO_cjs.edgePointToward(bounds, other);
|
|
1978
1978
|
}
|
|
1979
1979
|
function polylinePathData(points) {
|
|
1980
1980
|
if (points.length < 4) {
|
|
@@ -1991,7 +1991,7 @@ function previewPathData(points, segments, pathType, strokeWidth) {
|
|
|
1991
1991
|
return `M ${points[0]} ${points[1]} C ${points[2]} ${points[3]} ${points[4]} ${points[5]} ${points[6]} ${points[7]}`;
|
|
1992
1992
|
}
|
|
1993
1993
|
if (pathType === "orthogonal" && segments.length > 0) {
|
|
1994
|
-
return
|
|
1994
|
+
return chunkSKGJXCAO_cjs.roundedOrthogonalPathData(segments, Math.max(16, strokeWidth * 4));
|
|
1995
1995
|
}
|
|
1996
1996
|
return polylinePathData(points);
|
|
1997
1997
|
}
|
|
@@ -2011,8 +2011,8 @@ function previewLink(fromSide, toSide) {
|
|
|
2011
2011
|
function routePreviewLink(fromBounds, toBounds, fromSide, toSide, pathType) {
|
|
2012
2012
|
const from = anchorPoint(fromBounds, fromSide, toBounds);
|
|
2013
2013
|
const to = anchorPoint(toBounds, toSide, fromBounds);
|
|
2014
|
-
const { points, segments } =
|
|
2015
|
-
return { points, segments, midpoint:
|
|
2014
|
+
const { points, segments } = chunkSKGJXCAO_cjs.calculateLinkRoute(previewLink(fromSide, toSide), from, to, pathType);
|
|
2015
|
+
return { points, segments, midpoint: chunkSKGJXCAO_cjs.getLineMidpoint(points, pathType, from, to) };
|
|
2016
2016
|
}
|
|
2017
2017
|
|
|
2018
2018
|
// src/runtime/interaction/linkPreview/discovery.ts
|
|
@@ -2044,7 +2044,7 @@ function resolveOppositeEndpoint(svg, path, canvasObjectId) {
|
|
|
2044
2044
|
if (!otherId) {
|
|
2045
2045
|
return null;
|
|
2046
2046
|
}
|
|
2047
|
-
const otherPrimary =
|
|
2047
|
+
const otherPrimary = chunk3OF37CZX_cjs.findOwnerNode(svg, otherId, chunk3OF37CZX_cjs.isPrimary);
|
|
2048
2048
|
return otherPrimary ? { draggedIsFrom, bounds: otherPrimary.getBBox() } : null;
|
|
2049
2049
|
}
|
|
2050
2050
|
function captureLiveLinkLabel(svg, draft, draggedBounds) {
|
|
@@ -2091,8 +2091,8 @@ function resolveOtherFacePoint(svg, path, canvasObjectId) {
|
|
|
2091
2091
|
if (!otherId || !face || !otherFace) {
|
|
2092
2092
|
return null;
|
|
2093
2093
|
}
|
|
2094
|
-
const otherPrimary =
|
|
2095
|
-
const otherGeometry = otherPrimary &&
|
|
2094
|
+
const otherPrimary = chunk3OF37CZX_cjs.findOwnerNode(svg, otherId, chunk3OF37CZX_cjs.isPrimary);
|
|
2095
|
+
const otherGeometry = otherPrimary && chunk3OF37CZX_cjs.isometricGeometryOf(otherPrimary);
|
|
2096
2096
|
if (!otherGeometry?.bounds) {
|
|
2097
2097
|
return null;
|
|
2098
2098
|
}
|
|
@@ -2103,7 +2103,7 @@ function resolveOtherFacePoint(svg, path, canvasObjectId) {
|
|
|
2103
2103
|
height: otherGeometry.height,
|
|
2104
2104
|
depth: otherGeometry.depth
|
|
2105
2105
|
};
|
|
2106
|
-
return { otherPoint:
|
|
2106
|
+
return { otherPoint: chunkSKGJXCAO_cjs.isometricFaceCenter(otherObject, otherFace), draggedIsFrom, face };
|
|
2107
2107
|
}
|
|
2108
2108
|
function findLiveFaceLinks(svg, canvasObjectId) {
|
|
2109
2109
|
const escapedId = CSS.escape(canvasObjectId);
|
|
@@ -2122,7 +2122,7 @@ function findLiveFaceLinks(svg, canvasObjectId) {
|
|
|
2122
2122
|
|
|
2123
2123
|
// src/runtime/interaction/linkPreview/faceUpdate.ts
|
|
2124
2124
|
function updateLiveFaceLink(link, liveObject) {
|
|
2125
|
-
const draggedPoint =
|
|
2125
|
+
const draggedPoint = chunkSKGJXCAO_cjs.isometricFaceCenter(liveObject, link.face);
|
|
2126
2126
|
const from = link.draggedIsFrom ? draggedPoint : link.otherPoint;
|
|
2127
2127
|
const to = link.draggedIsFrom ? link.otherPoint : draggedPoint;
|
|
2128
2128
|
link.path.setAttribute("d", `M ${from.x} ${from.y} L ${to.x} ${to.y}`);
|
|
@@ -2146,7 +2146,7 @@ function updateLabelGap(link, points) {
|
|
|
2146
2146
|
if (!link.labelGapSize) {
|
|
2147
2147
|
return;
|
|
2148
2148
|
}
|
|
2149
|
-
const gap =
|
|
2149
|
+
const gap = chunkSKGJXCAO_cjs.labelGapDash(points, link.pathType, link.labelGapSize.width, link.labelGapSize.height);
|
|
2150
2150
|
if (gap) {
|
|
2151
2151
|
link.path.setAttribute("stroke-dasharray", `${gap.dashBefore} ${gap.gapLength} 1000000`);
|
|
2152
2152
|
} else {
|
|
@@ -2192,11 +2192,11 @@ function readIsometricSnapStep(svg) {
|
|
|
2192
2192
|
return step > 0 ? step : null;
|
|
2193
2193
|
}
|
|
2194
2194
|
function nearestIsometricLatticePoint(point, step) {
|
|
2195
|
-
const u = point.x / (
|
|
2196
|
-
const v = point.y / (
|
|
2195
|
+
const u = point.x / (chunkSKGJXCAO_cjs.AXIS_COS * step);
|
|
2196
|
+
const v = point.y / (chunkSKGJXCAO_cjs.AXIS_SIN * step);
|
|
2197
2197
|
const i = Math.round((u + v) / 2);
|
|
2198
2198
|
const j = Math.round((u - v) / 2);
|
|
2199
|
-
return { x: (i + j) *
|
|
2199
|
+
return { x: (i + j) * chunkSKGJXCAO_cjs.AXIS_COS * step, y: (i - j) * chunkSKGJXCAO_cjs.AXIS_SIN * step };
|
|
2200
2200
|
}
|
|
2201
2201
|
function snapToStep(value, step, min) {
|
|
2202
2202
|
return Math.max(min, Math.round(value / step) * step);
|
|
@@ -2209,21 +2209,21 @@ var LABEL_FONT_SIZE = 12;
|
|
|
2209
2209
|
var LABEL_LINE_HEIGHT = 1.2;
|
|
2210
2210
|
var LABEL_BASELINE_OFFSET = -LABEL_GAP - LABEL_HEIGHT + (LABEL_HEIGHT - LABEL_FONT_SIZE * LABEL_LINE_HEIGHT) / 2 + LABEL_FONT_SIZE;
|
|
2211
2211
|
function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
2212
|
-
const faces =
|
|
2213
|
-
nodes.top?.setAttribute("d",
|
|
2214
|
-
nodes.front?.setAttribute("d",
|
|
2215
|
-
nodes.side?.setAttribute("d",
|
|
2212
|
+
const faces = chunkSKGJXCAO_cjs.isometricFaces(object);
|
|
2213
|
+
nodes.top?.setAttribute("d", chunkSKGJXCAO_cjs.roundedPolygonPath(faces.top, 0));
|
|
2214
|
+
nodes.front?.setAttribute("d", chunkSKGJXCAO_cjs.roundedPolygonPath(faces.front, 0));
|
|
2215
|
+
nodes.side?.setAttribute("d", chunkSKGJXCAO_cjs.roundedPolygonPath(faces.right, 0));
|
|
2216
2216
|
const silhouette = [faces.top[0], faces.top[1], faces.right[2], faces.front[2], faces.front[3], faces.top[3]];
|
|
2217
|
-
const hullPath =
|
|
2217
|
+
const hullPath = chunkSKGJXCAO_cjs.roundedPolygonPath(silhouette, cornerRadius);
|
|
2218
2218
|
nodes.hull?.setAttribute("d", hullPath);
|
|
2219
2219
|
if (overlay.halo) {
|
|
2220
|
-
|
|
2220
|
+
chunk3OF37CZX_cjs.updateHalo(overlay.halo, hullPath);
|
|
2221
2221
|
}
|
|
2222
|
-
const placements =
|
|
2222
|
+
const placements = chunk3OF37CZX_cjs.axisArrowPlacements(object);
|
|
2223
2223
|
Object.keys(placements).forEach((axis) => {
|
|
2224
2224
|
const group = overlay.arrows[axis];
|
|
2225
2225
|
if (group) {
|
|
2226
|
-
|
|
2226
|
+
chunk3OF37CZX_cjs.updateAxisArrowGroup(group, placements[axis].origin, placements[axis].direction, svg);
|
|
2227
2227
|
}
|
|
2228
2228
|
});
|
|
2229
2229
|
nodes.seams?.setAttribute(
|
|
@@ -2241,9 +2241,9 @@ function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
|
2241
2241
|
x: footprintCenter.x + (point.x - footprintCenter.x) * shadowSpread,
|
|
2242
2242
|
y: footprintCenter.y + (point.y - footprintCenter.y) * shadowSpread
|
|
2243
2243
|
}));
|
|
2244
|
-
nodes.groundShadow.setAttribute("d",
|
|
2244
|
+
nodes.groundShadow.setAttribute("d", chunkSKGJXCAO_cjs.roundedPolygonPath(footprint, 0));
|
|
2245
2245
|
}
|
|
2246
|
-
const anchor =
|
|
2246
|
+
const anchor = chunkSKGJXCAO_cjs.isometricTopFaceCenter(object);
|
|
2247
2247
|
if (nodes.labelGuide) {
|
|
2248
2248
|
nodes.labelGuide.setAttribute("d", `M ${anchor.x} ${anchor.y - LABEL_GAP} L ${anchor.x} ${anchor.y}`);
|
|
2249
2249
|
}
|
|
@@ -2259,7 +2259,7 @@ function applyIsometricAxisPreview(nodes, object, cornerRadius, overlay, svg) {
|
|
|
2259
2259
|
// src/runtime/interaction/isometricAxisResize/state.ts
|
|
2260
2260
|
var AXES = ["width", "height", "depth"];
|
|
2261
2261
|
function collectNodes(svg, ownerId) {
|
|
2262
|
-
const all =
|
|
2262
|
+
const all = chunk3OF37CZX_cjs.findAllOwnerNodes(svg, ownerId);
|
|
2263
2263
|
const bySuffix = (suffix) => all.find((el2) => el2.id.endsWith(suffix)) ?? null;
|
|
2264
2264
|
return {
|
|
2265
2265
|
top: bySuffix("-top"),
|
|
@@ -2287,14 +2287,14 @@ function findResizeHandle(event) {
|
|
|
2287
2287
|
return { captureTarget, axis: handleAttr.slice(4), overlay, ownerId };
|
|
2288
2288
|
}
|
|
2289
2289
|
function overlayPartsOf(overlay) {
|
|
2290
|
-
const overlayHalo = overlay.querySelector(`[${
|
|
2290
|
+
const overlayHalo = overlay.querySelector(`[${chunk3OF37CZX_cjs.ISO_HALO_ATTR}]`) ?? null;
|
|
2291
2291
|
const overlayArrows = Object.fromEntries(
|
|
2292
2292
|
AXES.map((axis) => [
|
|
2293
2293
|
axis,
|
|
2294
2294
|
overlay.querySelector(`[data-sf-resize-handle="iso-${axis}"]`) ?? null
|
|
2295
2295
|
])
|
|
2296
2296
|
);
|
|
2297
|
-
const overlayDuplicateBubbles = overlay.querySelector(`[${
|
|
2297
|
+
const overlayDuplicateBubbles = overlay.querySelector(`[${chunk3OF37CZX_cjs.ISO_DUPLICATE_BUBBLES_ATTR}]`) ?? null;
|
|
2298
2298
|
if (overlayDuplicateBubbles) {
|
|
2299
2299
|
overlayDuplicateBubbles.style.display = "none";
|
|
2300
2300
|
}
|
|
@@ -2306,16 +2306,16 @@ function createIsometricAxisDragState(svg, event) {
|
|
|
2306
2306
|
return null;
|
|
2307
2307
|
}
|
|
2308
2308
|
const { captureTarget, axis, overlay, ownerId } = handle;
|
|
2309
|
-
const primary =
|
|
2310
|
-
const owner = primary &&
|
|
2309
|
+
const primary = chunk3OF37CZX_cjs.findOwnerNode(svg, ownerId, chunk3OF37CZX_cjs.isPrimary);
|
|
2310
|
+
const owner = primary && chunk3OF37CZX_cjs.resolveOwner(primary);
|
|
2311
2311
|
if (!primary || owner?.role !== "isometric") {
|
|
2312
2312
|
return null;
|
|
2313
2313
|
}
|
|
2314
|
-
const startUser =
|
|
2314
|
+
const startUser = chunk3OF37CZX_cjs.pointerUserPoint(svg, event);
|
|
2315
2315
|
if (!startUser) {
|
|
2316
2316
|
return null;
|
|
2317
2317
|
}
|
|
2318
|
-
const geometry =
|
|
2318
|
+
const geometry = chunk3OF37CZX_cjs.isometricGeometryOf(primary);
|
|
2319
2319
|
const bounds = geometry?.bounds ?? primary.getBBox();
|
|
2320
2320
|
const nodes = collectNodes(svg, ownerId);
|
|
2321
2321
|
[nodes.top, nodes.front, nodes.side].forEach((node) => {
|
|
@@ -2335,7 +2335,7 @@ function createIsometricAxisDragState(svg, event) {
|
|
|
2335
2335
|
pointerId: event.pointerId,
|
|
2336
2336
|
startUser,
|
|
2337
2337
|
start,
|
|
2338
|
-
cornerRadius: geometry?.cornerRadius ?? Number(primary.getAttribute(
|
|
2338
|
+
cornerRadius: geometry?.cornerRadius ?? Number(primary.getAttribute(chunkSKGJXCAO_cjs.CORNER_RADIUS_ATTR)) ?? 0,
|
|
2339
2339
|
nodes,
|
|
2340
2340
|
...overlayPartsOf(overlay),
|
|
2341
2341
|
liveFaceLinks: findLiveFaceLinks(svg, ownerId),
|
|
@@ -2352,15 +2352,15 @@ function nextGeometry(drag, point, step) {
|
|
|
2352
2352
|
const dx = point.x - drag.startUser.x;
|
|
2353
2353
|
const dy = point.y - drag.startUser.y;
|
|
2354
2354
|
if (axis === "width") {
|
|
2355
|
-
const delta2 = dx *
|
|
2355
|
+
const delta2 = dx * chunkSKGJXCAO_cjs.AXIS_COS + dy * chunkSKGJXCAO_cjs.AXIS_SIN;
|
|
2356
2356
|
return { ...start, width: length(start.width + delta2, MIN_SIZE) };
|
|
2357
2357
|
}
|
|
2358
2358
|
if (axis === "height") {
|
|
2359
2359
|
return { ...start, height: length(start.height + dy, MIN_SIZE) };
|
|
2360
2360
|
}
|
|
2361
|
-
const delta = -dx *
|
|
2361
|
+
const delta = -dx * chunkSKGJXCAO_cjs.AXIS_COS + dy * chunkSKGJXCAO_cjs.AXIS_SIN;
|
|
2362
2362
|
const depth = length(start.depth + delta, 0);
|
|
2363
|
-
const x = start.x + (start.depth - depth) *
|
|
2363
|
+
const x = start.x + (start.depth - depth) * chunkSKGJXCAO_cjs.AXIS_COS;
|
|
2364
2364
|
return { ...start, x, depth };
|
|
2365
2365
|
}
|
|
2366
2366
|
var IsometricAxisResizeSession = class {
|
|
@@ -2372,7 +2372,7 @@ var IsometricAxisResizeSession = class {
|
|
|
2372
2372
|
this.#emitter = emitter;
|
|
2373
2373
|
}
|
|
2374
2374
|
pointerDown = (event) => {
|
|
2375
|
-
if (event.button !== 0 || this.#drag ||
|
|
2375
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
2376
2376
|
return;
|
|
2377
2377
|
}
|
|
2378
2378
|
this.#drag = createIsometricAxisDragState(this.#svg, event);
|
|
@@ -2382,7 +2382,7 @@ var IsometricAxisResizeSession = class {
|
|
|
2382
2382
|
if (!drag || event.pointerId !== drag.pointerId) {
|
|
2383
2383
|
return;
|
|
2384
2384
|
}
|
|
2385
|
-
const point =
|
|
2385
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
2386
2386
|
if (!point) {
|
|
2387
2387
|
return;
|
|
2388
2388
|
}
|
|
@@ -2480,7 +2480,7 @@ function findLabelMark(event) {
|
|
|
2480
2480
|
);
|
|
2481
2481
|
}
|
|
2482
2482
|
function isLabelPointer(event) {
|
|
2483
|
-
return event.button === 0 && !
|
|
2483
|
+
return event.button === 0 && !chunk3OF37CZX_cjs.isCameraGesture(event);
|
|
2484
2484
|
}
|
|
2485
2485
|
function findHull(svg, ownerId) {
|
|
2486
2486
|
return svg.querySelector(`[data-sf-id="${CSS.escape(ownerId)}"][data-sf-primary="true"]`);
|
|
@@ -2496,21 +2496,21 @@ function resolveIsometricLabelDrag(svg, event) {
|
|
|
2496
2496
|
if (!clicked) {
|
|
2497
2497
|
return null;
|
|
2498
2498
|
}
|
|
2499
|
-
const owner =
|
|
2499
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(clicked);
|
|
2500
2500
|
if (owner?.role !== "isometric") {
|
|
2501
2501
|
return null;
|
|
2502
2502
|
}
|
|
2503
2503
|
const hull = findHull(svg, owner.id);
|
|
2504
|
-
const geometry = hull ?
|
|
2504
|
+
const geometry = hull ? chunk3OF37CZX_cjs.isometricGeometryOf(hull) : null;
|
|
2505
2505
|
if (!geometry?.bounds) {
|
|
2506
2506
|
return null;
|
|
2507
2507
|
}
|
|
2508
|
-
const start =
|
|
2508
|
+
const start = chunk3OF37CZX_cjs.pointerUserPoint(svg, event);
|
|
2509
2509
|
if (!start) {
|
|
2510
2510
|
return null;
|
|
2511
2511
|
}
|
|
2512
2512
|
const anchorX = geometry.bounds.x + geometry.bounds.width / 2;
|
|
2513
|
-
const anchorY = geometry.bounds.y + geometry.bounds.width * (
|
|
2513
|
+
const anchorY = geometry.bounds.y + geometry.bounds.width * (chunkSKGJXCAO_cjs.AXIS_SIN / chunkSKGJXCAO_cjs.AXIS_COS) / 2;
|
|
2514
2514
|
const text = findBySuffix(svg, `-${owner.id}-label`);
|
|
2515
2515
|
if (!text) {
|
|
2516
2516
|
return null;
|
|
@@ -2562,7 +2562,7 @@ var IsometricLabelDragSession = class {
|
|
|
2562
2562
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
2563
2563
|
return;
|
|
2564
2564
|
}
|
|
2565
|
-
const point =
|
|
2565
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
2566
2566
|
if (!point) {
|
|
2567
2567
|
return;
|
|
2568
2568
|
}
|
|
@@ -2637,7 +2637,7 @@ function isIsometricDirection(value) {
|
|
|
2637
2637
|
function bindIsometricQuickDuplicate(viewer, emitter) {
|
|
2638
2638
|
const svg = viewer.svg;
|
|
2639
2639
|
const onPointerDown = (event) => {
|
|
2640
|
-
if (event.button !== 0 ||
|
|
2640
|
+
if (event.button !== 0 || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
2641
2641
|
return;
|
|
2642
2642
|
}
|
|
2643
2643
|
const bubble = event.target?.closest("[data-sf-quick-duplicate]");
|
|
@@ -2648,7 +2648,7 @@ function bindIsometricQuickDuplicate(viewer, emitter) {
|
|
|
2648
2648
|
const overlay = bubble.closest("[data-sf-selection-overlay]");
|
|
2649
2649
|
const sourceId = overlay?.getAttribute("data-sf-selection-overlay");
|
|
2650
2650
|
const primary = sourceId ? svg.querySelector(`[data-sf-id="${CSS.escape(sourceId)}"][data-sf-primary="true"]`) : null;
|
|
2651
|
-
const owner = primary &&
|
|
2651
|
+
const owner = primary && chunk3OF37CZX_cjs.resolveOwner(primary);
|
|
2652
2652
|
if (!owner) {
|
|
2653
2653
|
return;
|
|
2654
2654
|
}
|
|
@@ -2703,7 +2703,7 @@ function updateEndpointPreview(drag, draggedPoint, draggedSide) {
|
|
|
2703
2703
|
const toPoint = drag.end === "to" ? draggedPoint : drag.fixedPoint;
|
|
2704
2704
|
const fromSide = drag.end === "from" ? draggedSide : drag.fixedSide;
|
|
2705
2705
|
const toSide = drag.end === "to" ? draggedSide : drag.fixedSide;
|
|
2706
|
-
const { points, segments } =
|
|
2706
|
+
const { points, segments } = chunkSKGJXCAO_cjs.calculateLinkRoute(previewLink(fromSide, toSide), fromPoint, toPoint, drag.pathType);
|
|
2707
2707
|
drag.path.setAttribute("d", previewPathData(points, segments, drag.pathType, drag.strokeWidth));
|
|
2708
2708
|
}
|
|
2709
2709
|
|
|
@@ -2725,7 +2725,7 @@ var LinkGhost = class {
|
|
|
2725
2725
|
constructor(svg, path) {
|
|
2726
2726
|
this.#svg = svg;
|
|
2727
2727
|
this.#path = path;
|
|
2728
|
-
this.#anchors = svg.ownerDocument.createElementNS(
|
|
2728
|
+
this.#anchors = svg.ownerDocument.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "g");
|
|
2729
2729
|
this.#anchors.setAttribute("data-sf-link-target", "");
|
|
2730
2730
|
this.#anchors.setAttribute("pointer-events", "none");
|
|
2731
2731
|
}
|
|
@@ -2735,7 +2735,7 @@ var LinkGhost = class {
|
|
|
2735
2735
|
for (const name of RESTORED_ATTRIBUTES) {
|
|
2736
2736
|
this.#saved.set(name, this.#path.getAttribute(name));
|
|
2737
2737
|
}
|
|
2738
|
-
const dash = GHOST_DASH_PX /
|
|
2738
|
+
const dash = GHOST_DASH_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
2739
2739
|
this.#path.setAttribute("stroke-dasharray", `${dash} ${dash}`);
|
|
2740
2740
|
this.#path.setAttribute("stroke-linecap", "round");
|
|
2741
2741
|
this.#path.setAttribute("opacity", GHOST_OPACITY);
|
|
@@ -2764,7 +2764,7 @@ var LinkGhost = class {
|
|
|
2764
2764
|
if (!bounds) {
|
|
2765
2765
|
return;
|
|
2766
2766
|
}
|
|
2767
|
-
const unit = 1 /
|
|
2767
|
+
const unit = 1 / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
2768
2768
|
const centers = [
|
|
2769
2769
|
[bounds.x + bounds.width / 2, bounds.y],
|
|
2770
2770
|
[bounds.x + bounds.width, bounds.y + bounds.height / 2],
|
|
@@ -2772,7 +2772,7 @@ var LinkGhost = class {
|
|
|
2772
2772
|
[bounds.x, bounds.y + bounds.height / 2]
|
|
2773
2773
|
];
|
|
2774
2774
|
for (const [cx, cy] of centers) {
|
|
2775
|
-
const dot = this.#svg.ownerDocument.createElementNS(
|
|
2775
|
+
const dot = this.#svg.ownerDocument.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "circle");
|
|
2776
2776
|
dot.setAttribute("cx", String(cx));
|
|
2777
2777
|
dot.setAttribute("cy", String(cy));
|
|
2778
2778
|
dot.setAttribute("r", String(ANCHOR_RADIUS_PX * unit));
|
|
@@ -2792,7 +2792,7 @@ function collectEndpointCandidates(svg) {
|
|
|
2792
2792
|
if (element2.getAttribute("data-sf-role") === "link") {
|
|
2793
2793
|
continue;
|
|
2794
2794
|
}
|
|
2795
|
-
const owner =
|
|
2795
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(element2);
|
|
2796
2796
|
if (owner) {
|
|
2797
2797
|
candidates.push({ owner, bounds: element2.getBBox() });
|
|
2798
2798
|
}
|
|
@@ -2869,7 +2869,7 @@ function inferFixedSide(svg, reference, fixedPrimary) {
|
|
|
2869
2869
|
if (reference.declaredSide) {
|
|
2870
2870
|
return reference.declaredSide;
|
|
2871
2871
|
}
|
|
2872
|
-
const draggedPrimary = reference.draggedId ?
|
|
2872
|
+
const draggedPrimary = reference.draggedId ? chunk3OF37CZX_cjs.findOwnerNode(svg, reference.draggedId, chunk3OF37CZX_cjs.isPrimary) : null;
|
|
2873
2873
|
if (!draggedPrimary) {
|
|
2874
2874
|
return "right";
|
|
2875
2875
|
}
|
|
@@ -2877,7 +2877,7 @@ function inferFixedSide(svg, reference, fixedPrimary) {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
function resolveFixedEndpoint(svg, path, draggedEnd) {
|
|
2879
2879
|
const reference = fixedEndpointReference(path, draggedEnd);
|
|
2880
|
-
const fixedPrimary = reference.fixedId ?
|
|
2880
|
+
const fixedPrimary = reference.fixedId ? chunk3OF37CZX_cjs.findOwnerNode(svg, reference.fixedId, chunk3OF37CZX_cjs.isPrimary) : null;
|
|
2881
2881
|
if (!fixedPrimary) {
|
|
2882
2882
|
return null;
|
|
2883
2883
|
}
|
|
@@ -2896,8 +2896,8 @@ function selectLinkEndpoint(svg, event) {
|
|
|
2896
2896
|
if (!target || !end || !linkId) {
|
|
2897
2897
|
return null;
|
|
2898
2898
|
}
|
|
2899
|
-
const path =
|
|
2900
|
-
const linkOwner = path &&
|
|
2899
|
+
const path = chunk3OF37CZX_cjs.findOwnerNode(svg, linkId, chunk3OF37CZX_cjs.isPrimary);
|
|
2900
|
+
const linkOwner = path && chunk3OF37CZX_cjs.resolveOwner(path);
|
|
2901
2901
|
if (!path || !linkOwner) {
|
|
2902
2902
|
return null;
|
|
2903
2903
|
}
|
|
@@ -2939,8 +2939,8 @@ function nearestPort(bounds, point) {
|
|
|
2939
2939
|
let nearest = { side: "right", offset: 0.5 };
|
|
2940
2940
|
let nearestDistance = Infinity;
|
|
2941
2941
|
for (const side of SIDES2) {
|
|
2942
|
-
const offset = Math.max(0, Math.min(1,
|
|
2943
|
-
const candidate =
|
|
2942
|
+
const offset = Math.max(0, Math.min(1, chunkSKGJXCAO_cjs.relativeOffsetOnRectangleSide(bounds, side, point)));
|
|
2943
|
+
const candidate = chunkSKGJXCAO_cjs.pointAtPort(bounds, { side, offset });
|
|
2944
2944
|
const distance = Math.hypot(candidate.x - point.x, candidate.y - point.y);
|
|
2945
2945
|
if (distance < nearestDistance) {
|
|
2946
2946
|
nearestDistance = distance;
|
|
@@ -2999,7 +2999,7 @@ function resolveLinkTarget(candidates, fixedPoint, point, unitsPerPx) {
|
|
|
2999
2999
|
}
|
|
3000
3000
|
const port = snapPort(candidate.bounds, point, unitsPerPx);
|
|
3001
3001
|
return {
|
|
3002
|
-
point:
|
|
3002
|
+
point: chunkSKGJXCAO_cjs.pointAtPort(candidate.bounds, port),
|
|
3003
3003
|
side: port.side,
|
|
3004
3004
|
hit: { owner: candidate.owner, side: port.side, offset: port.offset },
|
|
3005
3005
|
bounds: candidate.bounds
|
|
@@ -3023,7 +3023,7 @@ var LinkEndpointSession = class {
|
|
|
3023
3023
|
this.#emitter = emitter;
|
|
3024
3024
|
}
|
|
3025
3025
|
pointerDown = (event) => {
|
|
3026
|
-
if (event.button !== 0 || this.#drag ||
|
|
3026
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
3027
3027
|
return;
|
|
3028
3028
|
}
|
|
3029
3029
|
this.#drag = createLinkEndpointDragState(this.#svg, event);
|
|
@@ -3037,7 +3037,7 @@ var LinkEndpointSession = class {
|
|
|
3037
3037
|
return;
|
|
3038
3038
|
}
|
|
3039
3039
|
drag.moved = true;
|
|
3040
|
-
const target = resolveEndpointTarget(drag, endpointPointerPosition(this.#svg, event), 1 /
|
|
3040
|
+
const target = resolveEndpointTarget(drag, endpointPointerPosition(this.#svg, event), 1 / chunk3OF37CZX_cjs.pxPerUnit(this.#svg));
|
|
3041
3041
|
updateEndpointPreview(drag, target.point, target.side);
|
|
3042
3042
|
drag.ghost.show(target.hit !== null, target.bounds);
|
|
3043
3043
|
};
|
|
@@ -3151,7 +3151,7 @@ var LinkSegmentSession = class {
|
|
|
3151
3151
|
this.#emitter = emitter;
|
|
3152
3152
|
}
|
|
3153
3153
|
pointerDown = (event) => {
|
|
3154
|
-
if (event.button !== 0 || this.#drag ||
|
|
3154
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
3155
3155
|
return;
|
|
3156
3156
|
}
|
|
3157
3157
|
const target = event.target;
|
|
@@ -3161,12 +3161,12 @@ var LinkSegmentSession = class {
|
|
|
3161
3161
|
if (!handle || !overlay || !linkId) {
|
|
3162
3162
|
return;
|
|
3163
3163
|
}
|
|
3164
|
-
const path =
|
|
3165
|
-
const owner = path &&
|
|
3164
|
+
const path = chunk3OF37CZX_cjs.findOwnerNode(this.#svg, linkId, chunk3OF37CZX_cjs.isPrimary);
|
|
3165
|
+
const owner = path && chunk3OF37CZX_cjs.resolveOwner(path);
|
|
3166
3166
|
const index = Number(handle.getAttribute("data-sf-link-segment"));
|
|
3167
3167
|
const segments = path ? parseSegments(path) : [];
|
|
3168
3168
|
const segment2 = segments[index];
|
|
3169
|
-
const point =
|
|
3169
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
3170
3170
|
if (!path || !owner || !segment2 || !point) {
|
|
3171
3171
|
return;
|
|
3172
3172
|
}
|
|
@@ -3174,7 +3174,7 @@ var LinkSegmentSession = class {
|
|
|
3174
3174
|
const guide = document.createElementNS(SVG_NAMESPACE2, "line");
|
|
3175
3175
|
guide.setAttribute("stroke", GUIDE_COLOR);
|
|
3176
3176
|
guide.setAttribute("stroke-dasharray", "4 4");
|
|
3177
|
-
guide.setAttribute("stroke-width", String(1 /
|
|
3177
|
+
guide.setAttribute("stroke-width", String(1 / chunk3OF37CZX_cjs.pxPerUnit(this.#svg)));
|
|
3178
3178
|
guide.setAttribute("visibility", "hidden");
|
|
3179
3179
|
overlay.appendChild(guide);
|
|
3180
3180
|
handle.setPointerCapture?.(event.pointerId);
|
|
@@ -3209,7 +3209,7 @@ var LinkSegmentSession = class {
|
|
|
3209
3209
|
return;
|
|
3210
3210
|
}
|
|
3211
3211
|
drag.moved = true;
|
|
3212
|
-
const point =
|
|
3212
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
3213
3213
|
if (!point) {
|
|
3214
3214
|
return;
|
|
3215
3215
|
}
|
|
@@ -3235,8 +3235,8 @@ var LinkSegmentSession = class {
|
|
|
3235
3235
|
doubleClick = (event) => {
|
|
3236
3236
|
const handle = event.target?.closest("[data-sf-link-segment]");
|
|
3237
3237
|
const linkId = handle?.closest("[data-sf-selection-overlay]")?.getAttribute("data-sf-selection-overlay");
|
|
3238
|
-
const path = linkId ?
|
|
3239
|
-
const owner = path &&
|
|
3238
|
+
const path = linkId ? chunk3OF37CZX_cjs.findOwnerNode(this.#svg, linkId, chunk3OF37CZX_cjs.isPrimary) : null;
|
|
3239
|
+
const owner = path && chunk3OF37CZX_cjs.resolveOwner(path);
|
|
3240
3240
|
if (!handle || !owner) {
|
|
3241
3241
|
return;
|
|
3242
3242
|
}
|
|
@@ -3259,7 +3259,7 @@ var LinkSegmentSession = class {
|
|
|
3259
3259
|
if (isSnapDisabled(this.#svg)) {
|
|
3260
3260
|
return { value: raw, snapped: null };
|
|
3261
3261
|
}
|
|
3262
|
-
const threshold = SNAP_PX /
|
|
3262
|
+
const threshold = SNAP_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
3263
3263
|
let best = null;
|
|
3264
3264
|
for (const candidate of [drag.base, ...drag.candidates]) {
|
|
3265
3265
|
const closer = best === null || Math.abs(candidate - raw) < Math.abs(best - raw);
|
|
@@ -3272,7 +3272,7 @@ var LinkSegmentSession = class {
|
|
|
3272
3272
|
#preview(drag, snapped) {
|
|
3273
3273
|
const next = movedSegments(drag, drag.value);
|
|
3274
3274
|
const strokeWidth = Number(drag.path.getAttribute("stroke-width")) || 2;
|
|
3275
|
-
const data =
|
|
3275
|
+
const data = chunkSKGJXCAO_cjs.roundedOrthogonalPathData(pathSegments(next), Math.max(16, strokeWidth * 4));
|
|
3276
3276
|
drag.path.setAttribute("d", data);
|
|
3277
3277
|
drag.overlay.querySelector("path")?.setAttribute("d", data);
|
|
3278
3278
|
const segment2 = next[drag.index];
|
|
@@ -3506,8 +3506,8 @@ function computeGapSnap(bounds, candidates, threshold) {
|
|
|
3506
3506
|
|
|
3507
3507
|
// src/runtime/interaction/snapping/isometricDiagonal.ts
|
|
3508
3508
|
var AXES2 = [
|
|
3509
|
-
{ x:
|
|
3510
|
-
{ x: -
|
|
3509
|
+
{ x: chunkSKGJXCAO_cjs.AXIS_COS, y: chunkSKGJXCAO_cjs.AXIS_SIN },
|
|
3510
|
+
{ x: -chunkSKGJXCAO_cjs.AXIS_COS, y: chunkSKGJXCAO_cjs.AXIS_SIN }
|
|
3511
3511
|
];
|
|
3512
3512
|
var GUIDE_OVERHANG = 40;
|
|
3513
3513
|
function snapIsometricDiagonal(apex, rawDx, rawDy, candidates, threshold) {
|
|
@@ -3575,13 +3575,13 @@ function isometricApexOf(svg, drag, declared = false) {
|
|
|
3575
3575
|
if (lead.owner.role !== "isometric") {
|
|
3576
3576
|
return null;
|
|
3577
3577
|
}
|
|
3578
|
-
const primary =
|
|
3579
|
-
const geometry = primary &&
|
|
3578
|
+
const primary = chunk3OF37CZX_cjs.findOwnerNode(svg, lead.owner.id, chunk3OF37CZX_cjs.isPrimary);
|
|
3579
|
+
const geometry = primary && chunk3OF37CZX_cjs.isometricGeometryOf(primary);
|
|
3580
3580
|
if (!geometry) {
|
|
3581
3581
|
return null;
|
|
3582
3582
|
}
|
|
3583
3583
|
const frame = declared && geometry.bounds ? geometry.bounds : lead.draggedBounds;
|
|
3584
|
-
return { x: frame.x + geometry.depth *
|
|
3584
|
+
return { x: frame.x + geometry.depth * chunkSKGJXCAO_cjs.AXIS_COS, y: frame.y };
|
|
3585
3585
|
}
|
|
3586
3586
|
function snapIsometricGrid(svg, drag, rawDx, rawDy) {
|
|
3587
3587
|
const step = readIsometricSnapStep(svg);
|
|
@@ -3598,8 +3598,8 @@ function snapIsometricMove(svg, drag, rawDx, rawDy) {
|
|
|
3598
3598
|
return null;
|
|
3599
3599
|
}
|
|
3600
3600
|
const excludedIds = new Set(drag.canvasObjects.map((canvasObject) => canvasObject.owner.id));
|
|
3601
|
-
const candidates =
|
|
3602
|
-
const snap = snapIsometricDiagonal(apex, rawDx, rawDy, candidates, snapDistancePx(svg) /
|
|
3601
|
+
const candidates = chunk3OF37CZX_cjs.findIsometricApexCandidates(svg, excludedIds);
|
|
3602
|
+
const snap = snapIsometricDiagonal(apex, rawDx, rawDy, candidates, snapDistancePx(svg) / chunk3OF37CZX_cjs.pxPerUnit(svg));
|
|
3603
3603
|
return snap ? { dx: snap.dx, dy: snap.dy, guides: [snap.guide] } : null;
|
|
3604
3604
|
}
|
|
3605
3605
|
function snapMove(svg, drag, rawDx, rawDy) {
|
|
@@ -3616,8 +3616,8 @@ function snapMove(svg, drag, rawDx, rawDy) {
|
|
|
3616
3616
|
}
|
|
3617
3617
|
const leadBounds = offsetBounds(drag.canvasObjects[0].draggedBounds, rawDx, rawDy);
|
|
3618
3618
|
const excludedIds = new Set(drag.canvasObjects.map((canvasObject) => canvasObject.owner.id));
|
|
3619
|
-
const candidates = nearestCandidates(leadBounds,
|
|
3620
|
-
const threshold = snapDistancePx(svg) /
|
|
3619
|
+
const candidates = nearestCandidates(leadBounds, chunk3OF37CZX_cjs.findSnapCandidateBounds(svg, excludedIds));
|
|
3620
|
+
const threshold = snapDistancePx(svg) / chunk3OF37CZX_cjs.pxPerUnit(svg);
|
|
3621
3621
|
const snap = computeSnap(leadBounds, candidates, {
|
|
3622
3622
|
threshold,
|
|
3623
3623
|
activeX: MOVE_ACTIVE_POINTS,
|
|
@@ -3685,7 +3685,7 @@ function isCompositeOwner(owner) {
|
|
|
3685
3685
|
return owner !== null && owner !== void 0 && COMPOSITE_ROLES.has(owner.role);
|
|
3686
3686
|
}
|
|
3687
3687
|
function hasDerivedHeight(owner) {
|
|
3688
|
-
return owner !== null && owner !== void 0 &&
|
|
3688
|
+
return owner !== null && owner !== void 0 && chunk3OF37CZX_cjs.DERIVED_HEIGHT_ROLES.has(owner.role);
|
|
3689
3689
|
}
|
|
3690
3690
|
|
|
3691
3691
|
// src/runtime/interaction/move/canvasObjectCapture.ts
|
|
@@ -3706,7 +3706,7 @@ function parentContainerBounds(svg, primary, groupIds) {
|
|
|
3706
3706
|
if (!parentId || groupIds.has(parentId)) {
|
|
3707
3707
|
return void 0;
|
|
3708
3708
|
}
|
|
3709
|
-
const container =
|
|
3709
|
+
const container = chunk3OF37CZX_cjs.findOwnerNode(svg, parentId, chunk3OF37CZX_cjs.isPrimary);
|
|
3710
3710
|
if (!container) {
|
|
3711
3711
|
return void 0;
|
|
3712
3712
|
}
|
|
@@ -3714,14 +3714,14 @@ function parentContainerBounds(svg, primary, groupIds) {
|
|
|
3714
3714
|
return { x: bbox.x, y: bbox.y, width: bbox.width, height: bbox.height };
|
|
3715
3715
|
}
|
|
3716
3716
|
function captureCanvasObject(svg, owner, groupIds) {
|
|
3717
|
-
const nodes =
|
|
3718
|
-
const primary =
|
|
3717
|
+
const nodes = chunk3OF37CZX_cjs.findAllOwnerNodes(svg, owner.id);
|
|
3718
|
+
const primary = chunk3OF37CZX_cjs.findOwnerNode(svg, owner.id, chunk3OF37CZX_cjs.isPrimary);
|
|
3719
3719
|
if (!nodes.length || !primary) {
|
|
3720
3720
|
return null;
|
|
3721
3721
|
}
|
|
3722
3722
|
const overlays = [...svg.querySelectorAll(`[data-sf-selection-overlay="${CSS.escape(owner.id)}"]`)];
|
|
3723
3723
|
const draggedBounds = primary.getBBox();
|
|
3724
|
-
const isometricGeometry = owner.role === "isometric" ?
|
|
3724
|
+
const isometricGeometry = owner.role === "isometric" ? chunk3OF37CZX_cjs.isometricGeometryOf(primary) : null;
|
|
3725
3725
|
const isometricSize = isometricGeometry ? { width: isometricGeometry.width, height: isometricGeometry.height, depth: isometricGeometry.depth } : void 0;
|
|
3726
3726
|
return {
|
|
3727
3727
|
owner,
|
|
@@ -3763,7 +3763,7 @@ function captureInternalLinks(svg, groupIds) {
|
|
|
3763
3763
|
if (!linkId || !belongsToMoveGroup(path, groupIds)) {
|
|
3764
3764
|
continue;
|
|
3765
3765
|
}
|
|
3766
|
-
const nodes =
|
|
3766
|
+
const nodes = chunk3OF37CZX_cjs.findAllOwnerNodes(svg, linkId);
|
|
3767
3767
|
if (nodes.length) {
|
|
3768
3768
|
links.push({ nodes, baseTransforms: nodes.map((node) => node.getAttribute("transform")) });
|
|
3769
3769
|
}
|
|
@@ -3797,7 +3797,7 @@ function containedChildren(viewer, owner) {
|
|
|
3797
3797
|
return [];
|
|
3798
3798
|
}
|
|
3799
3799
|
const nodes = viewer.svg.querySelectorAll(`[data-sf-parent-frame="${CSS.escape(owner.id)}"]`);
|
|
3800
|
-
return [...nodes].map((node) =>
|
|
3800
|
+
return [...nodes].map((node) => chunk3OF37CZX_cjs.resolveOwner(node)).filter((ref) => ref !== null);
|
|
3801
3801
|
}
|
|
3802
3802
|
function selectedMoveGroup(viewer, owner) {
|
|
3803
3803
|
const selection = viewer.getSelection();
|
|
@@ -3814,7 +3814,7 @@ function isChartInteractiveMark(target) {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
function createMoveDragState(viewer, event, startUser) {
|
|
3816
3816
|
const target = event.target;
|
|
3817
|
-
const owner =
|
|
3817
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(target);
|
|
3818
3818
|
if (!hasMovableGeometry(owner) || isChartInteractiveMark(target)) {
|
|
3819
3819
|
return null;
|
|
3820
3820
|
}
|
|
@@ -3848,7 +3848,7 @@ var MoveSession = class {
|
|
|
3848
3848
|
this.#emitter = emitter;
|
|
3849
3849
|
}
|
|
3850
3850
|
pointerDown = (event) => {
|
|
3851
|
-
if (event.button !== 0 || this.#drag ||
|
|
3851
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
3852
3852
|
return;
|
|
3853
3853
|
}
|
|
3854
3854
|
this.#drag = createMoveDragState(this.#viewer, event, movePointerPosition(this.#svg, event));
|
|
@@ -3866,7 +3866,7 @@ var MoveSession = class {
|
|
|
3866
3866
|
const delta = snapMove(this.#svg, drag, rawDelta.dx, rawDelta.dy);
|
|
3867
3867
|
const clamped = clampMoveDelta(drag.canvasObjects, delta.dx, delta.dy);
|
|
3868
3868
|
applyMovePreview(drag, clamped.dx, clamped.dy);
|
|
3869
|
-
|
|
3869
|
+
chunk3OF37CZX_cjs.updateAlignmentGuides(this.#svg, delta.guides, MOVE_GUIDE_COLOR);
|
|
3870
3870
|
};
|
|
3871
3871
|
pointerUp = (event) => {
|
|
3872
3872
|
const drag = this.#drag;
|
|
@@ -3875,7 +3875,7 @@ var MoveSession = class {
|
|
|
3875
3875
|
}
|
|
3876
3876
|
this.#drag = null;
|
|
3877
3877
|
event.target.releasePointerCapture?.(drag.pointerId);
|
|
3878
|
-
|
|
3878
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
3879
3879
|
emitMoveCompletion(this.#svg, this.#emitter, drag, event);
|
|
3880
3880
|
};
|
|
3881
3881
|
cancel() {
|
|
@@ -4021,9 +4021,9 @@ var START_POINT_RADIUS_PX = 6;
|
|
|
4021
4021
|
var POINT_STROKE_WIDTH_PX = 1.5;
|
|
4022
4022
|
function createPathDrawPreview(svg) {
|
|
4023
4023
|
const document2 = svg.ownerDocument;
|
|
4024
|
-
const group = document2.createElementNS(
|
|
4024
|
+
const group = document2.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "g");
|
|
4025
4025
|
group.setAttribute("pointer-events", "none");
|
|
4026
|
-
const line = document2.createElementNS(
|
|
4026
|
+
const line = document2.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "path");
|
|
4027
4027
|
line.setAttribute("fill", "none");
|
|
4028
4028
|
line.setAttribute("stroke", PREVIEW_COLOR);
|
|
4029
4029
|
line.setAttribute("stroke-linecap", "round");
|
|
@@ -4033,8 +4033,8 @@ function createPathDrawPreview(svg) {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
function pointMarker(svg, point, highlighted) {
|
|
4035
4035
|
const document2 = svg.ownerDocument;
|
|
4036
|
-
const unit = 1 /
|
|
4037
|
-
const circle = document2.createElementNS(
|
|
4036
|
+
const unit = 1 / chunk3OF37CZX_cjs.pxPerUnit(svg);
|
|
4037
|
+
const circle = document2.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "circle");
|
|
4038
4038
|
circle.setAttribute("cx", String(point.x));
|
|
4039
4039
|
circle.setAttribute("cy", String(point.y));
|
|
4040
4040
|
circle.setAttribute("r", String((highlighted ? START_POINT_RADIUS_PX : POINT_RADIUS_PX) * unit));
|
|
@@ -4048,11 +4048,11 @@ function updatePathDrawPreview(svg, state) {
|
|
|
4048
4048
|
if (!previewLine || !previewGroup) {
|
|
4049
4049
|
return;
|
|
4050
4050
|
}
|
|
4051
|
-
const unit = 1 /
|
|
4051
|
+
const unit = 1 / chunk3OF37CZX_cjs.pxPerUnit(svg);
|
|
4052
4052
|
previewLine.setAttribute("stroke-width", String(LINE_WIDTH_PX * unit));
|
|
4053
4053
|
previewLine.setAttribute("stroke-dasharray", `${DASH_PX * unit} ${GAP_PX * unit}`);
|
|
4054
4054
|
const live = state.cursor ? [...state.points, state.cursor] : state.points;
|
|
4055
|
-
previewLine.setAttribute("d",
|
|
4055
|
+
previewLine.setAttribute("d", chunkSKGJXCAO_cjs.freeformPathData({ points: live, tension: state.tension, closed: false }));
|
|
4056
4056
|
while (previewGroup.childNodes.length > 1) {
|
|
4057
4057
|
previewGroup.lastChild?.remove();
|
|
4058
4058
|
}
|
|
@@ -4112,12 +4112,12 @@ var PathDrawSession = class {
|
|
|
4112
4112
|
}
|
|
4113
4113
|
}
|
|
4114
4114
|
pointerDown = (event) => {
|
|
4115
|
-
if (!this.#state.active || event.button !== 0 ||
|
|
4115
|
+
if (!this.#state.active || event.button !== 0 || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
4116
4116
|
return;
|
|
4117
4117
|
}
|
|
4118
4118
|
event.stopPropagation();
|
|
4119
4119
|
event.preventDefault();
|
|
4120
|
-
const point =
|
|
4120
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
4121
4121
|
if (!point) {
|
|
4122
4122
|
return;
|
|
4123
4123
|
}
|
|
@@ -4136,14 +4136,14 @@ var PathDrawSession = class {
|
|
|
4136
4136
|
this.#state.cursor = resolved.point;
|
|
4137
4137
|
this.#state.willClose = false;
|
|
4138
4138
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4139
|
-
|
|
4139
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
4140
4140
|
};
|
|
4141
4141
|
pointerMove = (event) => {
|
|
4142
4142
|
if (!this.#state.active) {
|
|
4143
4143
|
return;
|
|
4144
4144
|
}
|
|
4145
4145
|
event.stopPropagation();
|
|
4146
|
-
const point =
|
|
4146
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
4147
4147
|
if (!point) {
|
|
4148
4148
|
return;
|
|
4149
4149
|
}
|
|
@@ -4152,9 +4152,9 @@ var PathDrawSession = class {
|
|
|
4152
4152
|
this.#state.willClose = resolved.willClose;
|
|
4153
4153
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4154
4154
|
if (resolved.guide) {
|
|
4155
|
-
|
|
4155
|
+
chunk3OF37CZX_cjs.updateAlignmentGuides(this.#svg, [resolved.guide], GUIDE_COLOR2);
|
|
4156
4156
|
} else {
|
|
4157
|
-
|
|
4157
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
4158
4158
|
}
|
|
4159
4159
|
};
|
|
4160
4160
|
pointerUp = (event) => {
|
|
@@ -4189,10 +4189,10 @@ var PathDrawSession = class {
|
|
|
4189
4189
|
} else if (event.key === "Backspace" && this.#state.points.length > 0) {
|
|
4190
4190
|
event.preventDefault();
|
|
4191
4191
|
this.#state.points = this.#state.points.slice(0, -1);
|
|
4192
|
-
const closeSnapUnits = CLOSE_SNAP_PX /
|
|
4192
|
+
const closeSnapUnits = CLOSE_SNAP_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
4193
4193
|
this.#state.willClose = this.#state.cursor ? isCloseToStart(this.#state.points, this.#state.cursor, closeSnapUnits) : false;
|
|
4194
4194
|
updatePathDrawPreview(this.#svg, this.#state);
|
|
4195
|
-
|
|
4195
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
4196
4196
|
}
|
|
4197
4197
|
};
|
|
4198
4198
|
keyUp = (event) => {
|
|
@@ -4201,7 +4201,7 @@ var PathDrawSession = class {
|
|
|
4201
4201
|
}
|
|
4202
4202
|
};
|
|
4203
4203
|
#resolvePoint(raw) {
|
|
4204
|
-
const closeSnapUnits = CLOSE_SNAP_PX /
|
|
4204
|
+
const closeSnapUnits = CLOSE_SNAP_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
4205
4205
|
if (isCloseToStart(this.#state.points, raw, closeSnapUnits)) {
|
|
4206
4206
|
return { point: this.#state.points[0], willClose: true, guide: null };
|
|
4207
4207
|
}
|
|
@@ -4211,7 +4211,7 @@ var PathDrawSession = class {
|
|
|
4211
4211
|
return { point: raw, willClose: false, guide: null };
|
|
4212
4212
|
}
|
|
4213
4213
|
const angleSnapped = snapTo45Degrees(last, raw);
|
|
4214
|
-
const guideSnapUnits = GUIDE_SNAP_PX /
|
|
4214
|
+
const guideSnapUnits = GUIDE_SNAP_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg);
|
|
4215
4215
|
const { point, guide } = snapToSessionGuides(last, angleSnapped, points.slice(0, -1), raw, guideSnapUnits);
|
|
4216
4216
|
return { point, willClose: false, guide };
|
|
4217
4217
|
}
|
|
@@ -4225,7 +4225,7 @@ var PathDrawSession = class {
|
|
|
4225
4225
|
}
|
|
4226
4226
|
#reset(callExit) {
|
|
4227
4227
|
this.#state.previewGroup?.remove();
|
|
4228
|
-
|
|
4228
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
4229
4229
|
const exit = this.#state.onExit;
|
|
4230
4230
|
this.#state = createIdlePathDrawState();
|
|
4231
4231
|
this.#shiftHeld = false;
|
|
@@ -4268,7 +4268,7 @@ function applyPathReshapePreview(drag, point) {
|
|
|
4268
4268
|
const points = drag.points.map(
|
|
4269
4269
|
(existing, index) => index === drag.pointIndex ? [point.x, point.y] : existing
|
|
4270
4270
|
);
|
|
4271
|
-
const d =
|
|
4271
|
+
const d = chunkSKGJXCAO_cjs.freeformPathData({
|
|
4272
4272
|
points: points.map(([x, y]) => ({ x, y })),
|
|
4273
4273
|
tension: drag.tension,
|
|
4274
4274
|
closed: drag.closed
|
|
@@ -4276,22 +4276,22 @@ function applyPathReshapePreview(drag, point) {
|
|
|
4276
4276
|
drag.pathNode.setAttribute("d", d);
|
|
4277
4277
|
drag.handle.setAttribute("cx", String(point.x));
|
|
4278
4278
|
drag.handle.setAttribute("cy", String(point.y));
|
|
4279
|
-
drag.overlay?.querySelector(`[${
|
|
4279
|
+
drag.overlay?.querySelector(`[${chunk3OF37CZX_cjs.PATH_HALO_ATTR}]`)?.setAttribute("d", d);
|
|
4280
4280
|
return points;
|
|
4281
4281
|
}
|
|
4282
4282
|
|
|
4283
4283
|
// src/runtime/interaction/pathReshape/target.ts
|
|
4284
4284
|
function resolvePathReshapeTarget(svg, event) {
|
|
4285
|
-
const handle = event.target?.closest?.(`[${
|
|
4286
|
-
const indexAttr = handle?.getAttribute(
|
|
4285
|
+
const handle = event.target?.closest?.(`[${chunkSKGJXCAO_cjs.PATH_POINT_INDEX_ATTR}]`) ?? null;
|
|
4286
|
+
const indexAttr = handle?.getAttribute(chunkSKGJXCAO_cjs.PATH_POINT_INDEX_ATTR) ?? null;
|
|
4287
4287
|
const pointIndex = indexAttr !== null ? Number(indexAttr) : Number.NaN;
|
|
4288
4288
|
const ownerId = handle?.closest("[data-sf-selection-overlay]")?.getAttribute("data-sf-selection-overlay");
|
|
4289
4289
|
if (!handle || !Number.isInteger(pointIndex) || !ownerId) {
|
|
4290
4290
|
return null;
|
|
4291
4291
|
}
|
|
4292
|
-
const pathNode =
|
|
4293
|
-
const owner = pathNode &&
|
|
4294
|
-
const geometry = pathNode &&
|
|
4292
|
+
const pathNode = chunk3OF37CZX_cjs.findOwnerNode(svg, ownerId, chunk3OF37CZX_cjs.isPrimary);
|
|
4293
|
+
const owner = pathNode && chunk3OF37CZX_cjs.resolveOwner(pathNode);
|
|
4294
|
+
const geometry = pathNode && chunk3OF37CZX_cjs.pathGeometryOf(pathNode);
|
|
4295
4295
|
if (!pathNode || !owner || !geometry || pointIndex < 0 || pointIndex >= geometry.points.length) {
|
|
4296
4296
|
return null;
|
|
4297
4297
|
}
|
|
@@ -4334,7 +4334,7 @@ var PathReshapeSession = class {
|
|
|
4334
4334
|
this.#emitter = emitter;
|
|
4335
4335
|
}
|
|
4336
4336
|
pointerDown = (event) => {
|
|
4337
|
-
if (event.button !== 0 || this.#drag ||
|
|
4337
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
4338
4338
|
return;
|
|
4339
4339
|
}
|
|
4340
4340
|
this.#drag = createPathReshapeDragState(this.#svg, event);
|
|
@@ -4345,7 +4345,7 @@ var PathReshapeSession = class {
|
|
|
4345
4345
|
return;
|
|
4346
4346
|
}
|
|
4347
4347
|
drag.moved = true;
|
|
4348
|
-
const point =
|
|
4348
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
4349
4349
|
if (point) {
|
|
4350
4350
|
applyPathReshapePreview(drag, point);
|
|
4351
4351
|
}
|
|
@@ -4360,7 +4360,7 @@ var PathReshapeSession = class {
|
|
|
4360
4360
|
if (!drag.moved) {
|
|
4361
4361
|
return;
|
|
4362
4362
|
}
|
|
4363
|
-
const point =
|
|
4363
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event) ?? {
|
|
4364
4364
|
x: drag.points[drag.pointIndex][0],
|
|
4365
4365
|
y: drag.points[drag.pointIndex][1]
|
|
4366
4366
|
};
|
|
@@ -4401,7 +4401,7 @@ function updatePieLabelDragPreview(drag, dx, dy) {
|
|
|
4401
4401
|
}
|
|
4402
4402
|
const from = { x: drag.tickStartX, y: drag.tickStartY };
|
|
4403
4403
|
const to = { x: drag.restX + dx, y: drag.restY + dy };
|
|
4404
|
-
const clipped =
|
|
4404
|
+
const clipped = chunkSKGJXCAO_cjs.clipSegmentToRect(from, to, drag.halfWidth, drag.halfHeight);
|
|
4405
4405
|
drag.tickElement.setAttribute("d", `M ${from.x} ${from.y} L ${clipped.x} ${clipped.y}`);
|
|
4406
4406
|
drag.tickElement.setAttribute("stroke", PREVIEW_TICK_COLOR);
|
|
4407
4407
|
drag.tickElement.setAttribute("stroke-width", PREVIEW_TICK_STROKE_WIDTH);
|
|
@@ -4427,7 +4427,7 @@ function restoreAttribute(element2, name, value) {
|
|
|
4427
4427
|
|
|
4428
4428
|
// src/runtime/interaction/pieGeometry.ts
|
|
4429
4429
|
function readPieGeometry(svg, ownerId) {
|
|
4430
|
-
const raw =
|
|
4430
|
+
const raw = chunk3OF37CZX_cjs.findOwnerNode(svg, ownerId, chunk3OF37CZX_cjs.isPrimary)?.getAttribute("data-sf-pie-geometry");
|
|
4431
4431
|
if (!raw) {
|
|
4432
4432
|
return null;
|
|
4433
4433
|
}
|
|
@@ -4446,7 +4446,7 @@ function findLabelMark2(event) {
|
|
|
4446
4446
|
return event.target?.closest?.(selector);
|
|
4447
4447
|
}
|
|
4448
4448
|
function isLabelPointer2(event) {
|
|
4449
|
-
return event.button === 0 && !
|
|
4449
|
+
return event.button === 0 && !chunk3OF37CZX_cjs.isCameraGesture(event);
|
|
4450
4450
|
}
|
|
4451
4451
|
function findLabelSiblings(svg, ownerId, seriesId, mark) {
|
|
4452
4452
|
const selector = `[data-sf-id="${CSS.escape(ownerId)}"][data-sf-series="${CSS.escape(seriesId)}"][data-sf-mark="${mark}"]`;
|
|
@@ -4478,7 +4478,7 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4478
4478
|
if (!clicked) {
|
|
4479
4479
|
return null;
|
|
4480
4480
|
}
|
|
4481
|
-
const owner =
|
|
4481
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(clicked);
|
|
4482
4482
|
if (owner?.role !== "chart") {
|
|
4483
4483
|
return null;
|
|
4484
4484
|
}
|
|
@@ -4497,7 +4497,7 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4497
4497
|
const wedgeRadius = clicked.getAttribute("data-sf-pie-wedge-radius");
|
|
4498
4498
|
const explicitRadius = wedgeRadius === null ? Number.NaN : Number(wedgeRadius);
|
|
4499
4499
|
const outerRadius = Number.isFinite(explicitRadius) ? explicitRadius : geometry.outerRadius;
|
|
4500
|
-
const start =
|
|
4500
|
+
const start = chunk3OF37CZX_cjs.pointerUserPoint(svg, event);
|
|
4501
4501
|
if (!start) {
|
|
4502
4502
|
return null;
|
|
4503
4503
|
}
|
|
@@ -4519,13 +4519,13 @@ function resolvePieLabelDrag(svg, event) {
|
|
|
4519
4519
|
outerRadius,
|
|
4520
4520
|
anchorX: geometry.centerX + outerRadius * Math.cos(midAngle),
|
|
4521
4521
|
anchorY: geometry.centerY + outerRadius * Math.sin(midAngle),
|
|
4522
|
-
tickStartX: geometry.centerX + (outerRadius +
|
|
4523
|
-
tickStartY: geometry.centerY + (outerRadius +
|
|
4522
|
+
tickStartX: geometry.centerX + (outerRadius + chunkSKGJXCAO_cjs.LEADER_INSET) * Math.cos(midAngle),
|
|
4523
|
+
tickStartY: geometry.centerY + (outerRadius + chunkSKGJXCAO_cjs.LEADER_INSET) * Math.sin(midAngle),
|
|
4524
4524
|
restX,
|
|
4525
4525
|
restY,
|
|
4526
4526
|
startX: start.x,
|
|
4527
4527
|
startY: start.y,
|
|
4528
|
-
halfWidth:
|
|
4528
|
+
halfWidth: chunkSKGJXCAO_cjs.LABEL_WIDTH / 2,
|
|
4529
4529
|
halfHeight: fontSize * 1.2,
|
|
4530
4530
|
moved: false,
|
|
4531
4531
|
lastDx: 0,
|
|
@@ -4561,7 +4561,7 @@ var PieLabelDragSession = class {
|
|
|
4561
4561
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
4562
4562
|
return;
|
|
4563
4563
|
}
|
|
4564
|
-
const point =
|
|
4564
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
4565
4565
|
if (!point) {
|
|
4566
4566
|
return;
|
|
4567
4567
|
}
|
|
@@ -4593,8 +4593,8 @@ var PieLabelDragSession = class {
|
|
|
4593
4593
|
if (!drag.moved) {
|
|
4594
4594
|
return;
|
|
4595
4595
|
}
|
|
4596
|
-
const pathX =
|
|
4597
|
-
const pathY =
|
|
4596
|
+
const pathX = chunkSKGJXCAO_cjs.seriesLabelOffsetXProp(drag.seriesId);
|
|
4597
|
+
const pathY = chunkSKGJXCAO_cjs.seriesLabelOffsetYProp(drag.seriesId);
|
|
4598
4598
|
if (!pathX || !pathY) {
|
|
4599
4599
|
return;
|
|
4600
4600
|
}
|
|
@@ -4656,7 +4656,7 @@ function siblingNodes(svg, owner, path) {
|
|
|
4656
4656
|
});
|
|
4657
4657
|
}
|
|
4658
4658
|
function resolvePropertyDrag(svg, event, rules) {
|
|
4659
|
-
if (event.button !== 0 ||
|
|
4659
|
+
if (event.button !== 0 || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
4660
4660
|
return null;
|
|
4661
4661
|
}
|
|
4662
4662
|
const node = event.target?.closest?.('[data-sf-prop-kind="value"]');
|
|
@@ -4664,11 +4664,11 @@ function resolvePropertyDrag(svg, event, rules) {
|
|
|
4664
4664
|
return null;
|
|
4665
4665
|
}
|
|
4666
4666
|
const path = node.getAttribute("data-sf-prop");
|
|
4667
|
-
const owner =
|
|
4667
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(node);
|
|
4668
4668
|
if (!path || owner?.role !== "chart" || !isEditablePath(path, rules)) {
|
|
4669
4669
|
return null;
|
|
4670
4670
|
}
|
|
4671
|
-
const scale = parseValueScale(
|
|
4671
|
+
const scale = parseValueScale(chunk3OF37CZX_cjs.findOwnerNode(svg, owner.id, chunk3OF37CZX_cjs.isPrimary));
|
|
4672
4672
|
if (!scale) {
|
|
4673
4673
|
return null;
|
|
4674
4674
|
}
|
|
@@ -4937,7 +4937,7 @@ function resolvePropertyTarget(event, rules) {
|
|
|
4937
4937
|
return null;
|
|
4938
4938
|
}
|
|
4939
4939
|
const path = hit.getAttribute("data-sf-prop");
|
|
4940
|
-
const owner =
|
|
4940
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(hit);
|
|
4941
4941
|
if (!path || !owner || !isEditablePath(path, rules)) {
|
|
4942
4942
|
return null;
|
|
4943
4943
|
}
|
|
@@ -4976,7 +4976,7 @@ var PropertyEditingSession = class {
|
|
|
4976
4976
|
begin(target) {
|
|
4977
4977
|
this.cancel();
|
|
4978
4978
|
const { node } = target;
|
|
4979
|
-
const rect =
|
|
4979
|
+
const rect = chunk3OF37CZX_cjs.screenRectOf(node);
|
|
4980
4980
|
const fontSize = Number.parseFloat(node.getAttribute("font-size") || "12");
|
|
4981
4981
|
const originalText = node.textContent ?? "";
|
|
4982
4982
|
const anchor = node.getAttribute("text-anchor");
|
|
@@ -5066,15 +5066,15 @@ function crossedDuplicateDragThreshold(drag, event) {
|
|
|
5066
5066
|
var PREVIEW_STROKE_PX = 2;
|
|
5067
5067
|
var NEW_LINK_PATH_TYPE = "orthogonal";
|
|
5068
5068
|
function createDuplicatePreviewPath(svg) {
|
|
5069
|
-
const path = svg.ownerDocument.createElementNS(
|
|
5069
|
+
const path = svg.ownerDocument.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "path");
|
|
5070
5070
|
path.setAttribute("fill", "none");
|
|
5071
|
-
path.setAttribute("stroke-width", String(PREVIEW_STROKE_PX /
|
|
5071
|
+
path.setAttribute("stroke-width", String(PREVIEW_STROKE_PX / chunk3OF37CZX_cjs.pxPerUnit(svg)));
|
|
5072
5072
|
path.style.pointerEvents = "none";
|
|
5073
5073
|
return path;
|
|
5074
5074
|
}
|
|
5075
5075
|
function updateDuplicatePreview(drag, toPoint, toSide) {
|
|
5076
5076
|
const link = previewLink(drag.direction, toSide);
|
|
5077
|
-
const { points, segments } =
|
|
5077
|
+
const { points, segments } = chunkSKGJXCAO_cjs.calculateLinkRoute(link, drag.fixedPoint, toPoint, NEW_LINK_PATH_TYPE);
|
|
5078
5078
|
drag.previewPath.setAttribute("d", previewPathData(points, segments, NEW_LINK_PATH_TYPE, 2));
|
|
5079
5079
|
}
|
|
5080
5080
|
|
|
@@ -5085,7 +5085,7 @@ function duplicateCandidates(svg, sourceId) {
|
|
|
5085
5085
|
if (element2.getAttribute("data-sf-role") === "link") {
|
|
5086
5086
|
continue;
|
|
5087
5087
|
}
|
|
5088
|
-
const owner =
|
|
5088
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(element2);
|
|
5089
5089
|
if (owner && owner.id !== sourceId) {
|
|
5090
5090
|
candidates.push({ owner, bounds: element2.getBBox() });
|
|
5091
5091
|
}
|
|
@@ -5099,8 +5099,8 @@ function createQuickDuplicateDragState(svg, event, previewPath) {
|
|
|
5099
5099
|
if (!bubble || !direction || direction.startsWith("iso-") || !sourceId) {
|
|
5100
5100
|
return null;
|
|
5101
5101
|
}
|
|
5102
|
-
const primary =
|
|
5103
|
-
const sourceOwner = primary &&
|
|
5102
|
+
const primary = chunk3OF37CZX_cjs.findOwnerNode(svg, sourceId, chunk3OF37CZX_cjs.isPrimary);
|
|
5103
|
+
const sourceOwner = primary && chunk3OF37CZX_cjs.resolveOwner(primary);
|
|
5104
5104
|
if (!primary || !sourceOwner) {
|
|
5105
5105
|
return null;
|
|
5106
5106
|
}
|
|
@@ -5108,7 +5108,7 @@ function createQuickDuplicateDragState(svg, event, previewPath) {
|
|
|
5108
5108
|
return {
|
|
5109
5109
|
sourceOwner,
|
|
5110
5110
|
direction,
|
|
5111
|
-
fixedPoint:
|
|
5111
|
+
fixedPoint: chunkSKGJXCAO_cjs.pointAtPort(primary.getBBox(), { side: direction, offset: 0.5 }),
|
|
5112
5112
|
previewPath,
|
|
5113
5113
|
ghost: new LinkGhost(svg, previewPath),
|
|
5114
5114
|
candidates: duplicateCandidates(svg, sourceId),
|
|
@@ -5136,7 +5136,7 @@ var QuickDuplicateSession = class {
|
|
|
5136
5136
|
this.#emitter = emitter;
|
|
5137
5137
|
}
|
|
5138
5138
|
pointerDown = (event) => {
|
|
5139
|
-
if (event.button !== 0 || this.#drag ||
|
|
5139
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
5140
5140
|
return;
|
|
5141
5141
|
}
|
|
5142
5142
|
this.#drag = createQuickDuplicateDragState(this.#svg, event, createDuplicatePreviewPath(this.#svg));
|
|
@@ -5150,7 +5150,7 @@ var QuickDuplicateSession = class {
|
|
|
5150
5150
|
return;
|
|
5151
5151
|
}
|
|
5152
5152
|
this.beginPreview(drag);
|
|
5153
|
-
const target = resolveDuplicateTarget(drag, duplicatePointerPosition(this.#svg, event), 1 /
|
|
5153
|
+
const target = resolveDuplicateTarget(drag, duplicatePointerPosition(this.#svg, event), 1 / chunk3OF37CZX_cjs.pxPerUnit(this.#svg));
|
|
5154
5154
|
updateDuplicatePreview(drag, target.point, target.side);
|
|
5155
5155
|
drag.ghost.show(target.hit !== null, target.bounds);
|
|
5156
5156
|
};
|
|
@@ -5208,14 +5208,14 @@ function seriesShapes(svg, ownerId, series) {
|
|
|
5208
5208
|
return [...svg.querySelectorAll(selector)];
|
|
5209
5209
|
}
|
|
5210
5210
|
function updateRadarVertexDragPreview(svg, drag, value) {
|
|
5211
|
-
const point =
|
|
5211
|
+
const point = chunkSKGJXCAO_cjs.radarVertexPoint(drag.frame, drag.index, value);
|
|
5212
5212
|
drag.element.setAttribute("cx", String(point.x));
|
|
5213
5213
|
drag.element.setAttribute("cy", String(point.y));
|
|
5214
5214
|
const points = seriesVertices(svg, drag.owner.id, drag.series).map((vertex) => ({
|
|
5215
5215
|
x: Number(vertex.getAttribute("cx")),
|
|
5216
5216
|
y: Number(vertex.getAttribute("cy"))
|
|
5217
5217
|
}));
|
|
5218
|
-
const path =
|
|
5218
|
+
const path = chunkSKGJXCAO_cjs.radarSeriesPath(points, drag.frame.curved, drag.frame.tension);
|
|
5219
5219
|
for (const shape of seriesShapes(svg, drag.owner.id, drag.series)) {
|
|
5220
5220
|
shape.setAttribute("d", path);
|
|
5221
5221
|
}
|
|
@@ -5270,7 +5270,7 @@ function findVertex(event) {
|
|
|
5270
5270
|
return event.target?.closest?.('[data-sf-mark="radar-vertex"]');
|
|
5271
5271
|
}
|
|
5272
5272
|
function isVertexPointer(event) {
|
|
5273
|
-
return event.button === 0 && !
|
|
5273
|
+
return event.button === 0 && !chunk3OF37CZX_cjs.isCameraGesture(event);
|
|
5274
5274
|
}
|
|
5275
5275
|
function resolveRadarVertexDrag(svg, event) {
|
|
5276
5276
|
if (!isVertexPointer(event)) {
|
|
@@ -5280,7 +5280,7 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5280
5280
|
if (!element2) {
|
|
5281
5281
|
return null;
|
|
5282
5282
|
}
|
|
5283
|
-
const owner =
|
|
5283
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(element2);
|
|
5284
5284
|
if (owner?.role !== "chart") {
|
|
5285
5285
|
return null;
|
|
5286
5286
|
}
|
|
@@ -5289,7 +5289,7 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5289
5289
|
if (!series || !Number.isInteger(index) || index < 0) {
|
|
5290
5290
|
return null;
|
|
5291
5291
|
}
|
|
5292
|
-
const frame = parseRadarFrame(
|
|
5292
|
+
const frame = parseRadarFrame(chunk3OF37CZX_cjs.findOwnerNode(svg, owner.id, chunk3OF37CZX_cjs.isPrimary));
|
|
5293
5293
|
if (!frame || index >= frame.count) {
|
|
5294
5294
|
return null;
|
|
5295
5295
|
}
|
|
@@ -5299,11 +5299,11 @@ function resolveRadarVertexDrag(svg, event) {
|
|
|
5299
5299
|
|
|
5300
5300
|
// src/runtime/interaction/radarVertexDrag/session.ts
|
|
5301
5301
|
function valueFrom(svg, event, drag) {
|
|
5302
|
-
const point =
|
|
5302
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(svg, event);
|
|
5303
5303
|
if (!point) {
|
|
5304
5304
|
return null;
|
|
5305
5305
|
}
|
|
5306
|
-
return
|
|
5306
|
+
return chunkSKGJXCAO_cjs.radarValueAtPoint(drag.frame, drag.index, point.x, point.y);
|
|
5307
5307
|
}
|
|
5308
5308
|
var RadarVertexDragSession = class {
|
|
5309
5309
|
#svg;
|
|
@@ -5335,7 +5335,7 @@ var RadarVertexDragSession = class {
|
|
|
5335
5335
|
if (!this.#readout) {
|
|
5336
5336
|
this.#readout = createValueReadout(this.#svg);
|
|
5337
5337
|
}
|
|
5338
|
-
const vertex =
|
|
5338
|
+
const vertex = chunkSKGJXCAO_cjs.radarVertexPoint(this.#drag.frame, this.#drag.index, value);
|
|
5339
5339
|
positionRadarReadout(this.#readout, vertex, this.#drag.frame.centerY, value);
|
|
5340
5340
|
}
|
|
5341
5341
|
cancel() {
|
|
@@ -5426,7 +5426,7 @@ function captureTextFit(text) {
|
|
|
5426
5426
|
fontSize,
|
|
5427
5427
|
lineHeight,
|
|
5428
5428
|
padding: Math.max(8, text.strokeWidth * 2),
|
|
5429
|
-
longestWord: Math.max(0, ...words.map((word) =>
|
|
5429
|
+
longestWord: Math.max(0, ...words.map((word) => chunkSKGJXCAO_cjs.estimateTextWidth(word, fontSize, bold)))
|
|
5430
5430
|
};
|
|
5431
5431
|
}
|
|
5432
5432
|
var COMMIT_PRECISION = 10;
|
|
@@ -5437,7 +5437,7 @@ function minWidthForText(fit) {
|
|
|
5437
5437
|
return roundUpForCommit(fit.longestWord + fit.padding * 2);
|
|
5438
5438
|
}
|
|
5439
5439
|
function minHeightForText(fit, width) {
|
|
5440
|
-
const lines =
|
|
5440
|
+
const lines = chunkSKGJXCAO_cjs.wrapText(fit.rawText, Math.max(0, width - fit.padding * 2), fit.fontSize);
|
|
5441
5441
|
return roundUpForCommit(lines.length * fit.fontSize * fit.lineHeight + fit.padding * 2);
|
|
5442
5442
|
}
|
|
5443
5443
|
|
|
@@ -5571,7 +5571,7 @@ function applyRectBounds(rect, kind, bounds) {
|
|
|
5571
5571
|
rect.setAttribute("width", String(bounds.width));
|
|
5572
5572
|
rect.setAttribute("height", String(bounds.height));
|
|
5573
5573
|
if (kind === "pill") {
|
|
5574
|
-
rect.setAttribute("rx", String(
|
|
5574
|
+
rect.setAttribute("rx", String(chunkSKGJXCAO_cjs.pillCornerRadius(bounds.width, bounds.height)));
|
|
5575
5575
|
}
|
|
5576
5576
|
}
|
|
5577
5577
|
function applyEllipseBounds(ellipse, bounds) {
|
|
@@ -5581,7 +5581,7 @@ function applyEllipseBounds(ellipse, bounds) {
|
|
|
5581
5581
|
ellipse.setAttribute("ry", String(bounds.height / 2));
|
|
5582
5582
|
}
|
|
5583
5583
|
function applySymbolBounds(path, bounds) {
|
|
5584
|
-
const raw = path.getAttribute(
|
|
5584
|
+
const raw = path.getAttribute(chunkSKGJXCAO_cjs.SYMBOL_POINTS_ATTR);
|
|
5585
5585
|
if (!raw) {
|
|
5586
5586
|
return false;
|
|
5587
5587
|
}
|
|
@@ -5589,22 +5589,22 @@ function applySymbolBounds(path, bounds) {
|
|
|
5589
5589
|
x: bounds.x + x * bounds.width,
|
|
5590
5590
|
y: bounds.y + y * bounds.height
|
|
5591
5591
|
}));
|
|
5592
|
-
const tension = Number(path.getAttribute(
|
|
5593
|
-
path.setAttribute("d",
|
|
5592
|
+
const tension = Number(path.getAttribute(chunkSKGJXCAO_cjs.SYMBOL_TENSION_ATTR)) || 0;
|
|
5593
|
+
path.setAttribute("d", chunkSKGJXCAO_cjs.freeformPathData({ points, tension, closed: true }));
|
|
5594
5594
|
return true;
|
|
5595
5595
|
}
|
|
5596
5596
|
function applyPathBounds(path, kind, bounds) {
|
|
5597
5597
|
if (kind === "symbol" && applySymbolBounds(path, bounds)) {
|
|
5598
5598
|
return;
|
|
5599
5599
|
}
|
|
5600
|
-
const pathData =
|
|
5600
|
+
const pathData = chunkSKGJXCAO_cjs.localShapePath(kind, bounds.x, bounds.y, bounds.width, bounds.height);
|
|
5601
5601
|
if (pathData) {
|
|
5602
5602
|
path.setAttribute("d", pathData);
|
|
5603
5603
|
}
|
|
5604
5604
|
}
|
|
5605
5605
|
function applyFrameBoundaryBounds(path, bounds) {
|
|
5606
|
-
const cornerRadius = Number(path.getAttribute(
|
|
5607
|
-
const squareCorner = path.getAttribute(
|
|
5606
|
+
const cornerRadius = Number(path.getAttribute(chunkSKGJXCAO_cjs.CORNER_RADIUS_ATTR) ?? 0);
|
|
5607
|
+
const squareCorner = path.getAttribute(chunkSKGJXCAO_cjs.SQUARE_CORNER_ATTR);
|
|
5608
5608
|
const radii = {
|
|
5609
5609
|
topLeft: cornerRadius,
|
|
5610
5610
|
topRight: cornerRadius,
|
|
@@ -5614,7 +5614,7 @@ function applyFrameBoundaryBounds(path, bounds) {
|
|
|
5614
5614
|
if (squareCorner) {
|
|
5615
5615
|
radii[squareCorner] = 0;
|
|
5616
5616
|
}
|
|
5617
|
-
path.setAttribute("d",
|
|
5617
|
+
path.setAttribute("d", chunkSKGJXCAO_cjs.cornersRoundedRectPath(bounds.x, bounds.y, bounds.width, bounds.height, radii));
|
|
5618
5618
|
}
|
|
5619
5619
|
function applySingleNodeBounds(primary, kind, bounds) {
|
|
5620
5620
|
const tag = primary.tagName.toLowerCase();
|
|
@@ -5624,7 +5624,7 @@ function applySingleNodeBounds(primary, kind, bounds) {
|
|
|
5624
5624
|
applyEllipseBounds(primary, bounds);
|
|
5625
5625
|
} else if (tag === "foreignobject") {
|
|
5626
5626
|
applyRectBounds(primary, null, bounds);
|
|
5627
|
-
} else if (tag === "path" && primary.hasAttribute(
|
|
5627
|
+
} else if (tag === "path" && primary.hasAttribute(chunkSKGJXCAO_cjs.CORNER_RADIUS_ATTR)) {
|
|
5628
5628
|
applyFrameBoundaryBounds(primary, bounds);
|
|
5629
5629
|
} else if (tag === "path" && kind) {
|
|
5630
5630
|
applyPathBounds(primary, kind, bounds);
|
|
@@ -5663,7 +5663,7 @@ function updateSelectionRing(overlay, bounds) {
|
|
|
5663
5663
|
}
|
|
5664
5664
|
function updateSelectionOverlay(overlay, bounds) {
|
|
5665
5665
|
updateSelectionRing(overlay, bounds);
|
|
5666
|
-
for (const [centerX, centerY, name] of
|
|
5666
|
+
for (const [centerX, centerY, name] of chunk3OF37CZX_cjs.resizeHandlePositions(bounds)) {
|
|
5667
5667
|
const handle = overlay.querySelector(`[data-sf-resize-handle="${name}"]`);
|
|
5668
5668
|
if (!handle) {
|
|
5669
5669
|
continue;
|
|
@@ -5680,7 +5680,7 @@ function replaceTextLines(textElement, lines, x, lineHeight) {
|
|
|
5680
5680
|
textElement.removeChild(textElement.firstChild);
|
|
5681
5681
|
}
|
|
5682
5682
|
lines.forEach((line, index) => {
|
|
5683
|
-
const tspan = document.createElementNS(
|
|
5683
|
+
const tspan = document.createElementNS(chunk3OF37CZX_cjs.SVG_NAMESPACE, "tspan");
|
|
5684
5684
|
tspan.setAttribute("x", String(x));
|
|
5685
5685
|
if (index > 0) {
|
|
5686
5686
|
tspan.setAttribute("dy", `${lineHeight}px`);
|
|
@@ -5700,7 +5700,7 @@ function applyLiveText(textElement, rawText, bounds, strokeWidth) {
|
|
|
5700
5700
|
const height = Math.max(0, bounds.height - padding * 2);
|
|
5701
5701
|
const boxX = bounds.x + padding;
|
|
5702
5702
|
const boxY = bounds.y + padding;
|
|
5703
|
-
const lines =
|
|
5703
|
+
const lines = chunkSKGJXCAO_cjs.wrapText(rawText, width, fontSize);
|
|
5704
5704
|
const linePixels = fontSize * lineHeight;
|
|
5705
5705
|
const contentHeight = lines.length * linePixels;
|
|
5706
5706
|
const firstY = verticalAlign === "top" ? boxY + fontSize : verticalAlign === "bottom" ? boxY + height - contentHeight + fontSize : boxY + (height - contentHeight) / 2 + fontSize;
|
|
@@ -5713,7 +5713,7 @@ function applyLiveText(textElement, rawText, bounds, strokeWidth) {
|
|
|
5713
5713
|
|
|
5714
5714
|
// src/runtime/interaction/resize/preview.ts
|
|
5715
5715
|
function textBoundsFor(kind, bounds) {
|
|
5716
|
-
return kind === "person" ?
|
|
5716
|
+
return kind === "person" ? chunkSKGJXCAO_cjs.personLabelArea(bounds.x, bounds.y, bounds.width, bounds.height) : bounds;
|
|
5717
5717
|
}
|
|
5718
5718
|
function applyGeometryPreview(drag, bounds) {
|
|
5719
5719
|
if (drag.isComposite) {
|
|
@@ -5737,7 +5737,7 @@ function applyResizePreview(drag, bounds) {
|
|
|
5737
5737
|
applyLiveText(drag.text.el, drag.text.rawText, textBoundsFor(drag.kind, bounds), drag.text.strokeWidth);
|
|
5738
5738
|
}
|
|
5739
5739
|
if (drag.bubbles) {
|
|
5740
|
-
|
|
5740
|
+
chunk3OF37CZX_cjs.updateQuickDuplicateBubbles(drag.bubbles, bounds);
|
|
5741
5741
|
}
|
|
5742
5742
|
updateLiveLinks(drag.liveLinks, bounds);
|
|
5743
5743
|
}
|
|
@@ -5758,9 +5758,9 @@ function snapResize(svg, drag, pointer) {
|
|
|
5758
5758
|
};
|
|
5759
5759
|
}
|
|
5760
5760
|
const axes = HANDLE_AXES[drag.handle];
|
|
5761
|
-
const candidates = nearestCandidates(proposed,
|
|
5761
|
+
const candidates = nearestCandidates(proposed, chunk3OF37CZX_cjs.findSnapCandidateBounds(svg, /* @__PURE__ */ new Set([drag.owner.id])));
|
|
5762
5762
|
const snap = computeSnap(proposed, candidates, {
|
|
5763
|
-
threshold: snapDistancePx(svg) /
|
|
5763
|
+
threshold: snapDistancePx(svg) / chunk3OF37CZX_cjs.pxPerUnit(svg),
|
|
5764
5764
|
activeX: resizeActivePoints(axes.x),
|
|
5765
5765
|
activeY: resizeActivePoints(axes.y),
|
|
5766
5766
|
guideOverhang: GUIDE_OVERHANG3
|
|
@@ -5801,13 +5801,13 @@ function selectResizeTarget(svg, event) {
|
|
|
5801
5801
|
if (!ownerId) {
|
|
5802
5802
|
return null;
|
|
5803
5803
|
}
|
|
5804
|
-
const primary =
|
|
5805
|
-
const owner = primary &&
|
|
5804
|
+
const primary = chunk3OF37CZX_cjs.findOwnerNode(svg, ownerId, chunk3OF37CZX_cjs.isPrimary);
|
|
5805
|
+
const owner = primary && chunk3OF37CZX_cjs.resolveOwner(primary);
|
|
5806
5806
|
if (!primary || !hasEditableGeometry(owner)) {
|
|
5807
5807
|
return null;
|
|
5808
5808
|
}
|
|
5809
|
-
const nodes =
|
|
5810
|
-
const geometryNodes = isCompositeOwner(owner) ? nodes : nodes.filter((node) => !
|
|
5809
|
+
const nodes = chunk3OF37CZX_cjs.findAllOwnerNodes(svg, ownerId);
|
|
5810
|
+
const geometryNodes = isCompositeOwner(owner) ? nodes : nodes.filter((node) => !chunk3OF37CZX_cjs.isTextLabel(node));
|
|
5811
5811
|
if (!geometryNodes.length) {
|
|
5812
5812
|
return null;
|
|
5813
5813
|
}
|
|
@@ -5825,7 +5825,7 @@ function selectResizeTarget(svg, event) {
|
|
|
5825
5825
|
|
|
5826
5826
|
// src/runtime/interaction/resize/textCapture.ts
|
|
5827
5827
|
function captureResizeText(nodes, primary) {
|
|
5828
|
-
const textElement = nodes.find(
|
|
5828
|
+
const textElement = nodes.find(chunk3OF37CZX_cjs.isTextLabel);
|
|
5829
5829
|
const rawText = primary.getAttribute("aria-label");
|
|
5830
5830
|
if (!textElement || !rawText) {
|
|
5831
5831
|
return null;
|
|
@@ -5843,7 +5843,7 @@ function createResizeDragState(svg, event) {
|
|
|
5843
5843
|
if (!selection) {
|
|
5844
5844
|
return null;
|
|
5845
5845
|
}
|
|
5846
|
-
const startBounds =
|
|
5846
|
+
const startBounds = chunk3OF37CZX_cjs.symbolDeclaredBounds(selection.primary) ?? selection.primary.getBBox();
|
|
5847
5847
|
const composite = isCompositeOwner(selection.owner);
|
|
5848
5848
|
const isContainer = CONTAINER_ROLES.has(selection.owner.role);
|
|
5849
5849
|
selection.captureTarget.setPointerCapture?.(event.pointerId);
|
|
@@ -5856,7 +5856,7 @@ function createResizeDragState(svg, event) {
|
|
|
5856
5856
|
isComposite: composite,
|
|
5857
5857
|
geometryNodes: selection.geometryNodes,
|
|
5858
5858
|
insets: selection.geometryNodes.map(
|
|
5859
|
-
(node) => node === selection.primary ? NO_INSET : insetWithin(startBounds,
|
|
5859
|
+
(node) => node === selection.primary ? NO_INSET : insetWithin(startBounds, chunk3OF37CZX_cjs.symbolDeclaredBounds(node) ?? node.getBBox())
|
|
5860
5860
|
),
|
|
5861
5861
|
baseTransforms: selection.geometryNodes.map((node) => node.getAttribute("transform")),
|
|
5862
5862
|
overlay: selection.overlay,
|
|
@@ -5882,7 +5882,7 @@ var ResizeSession = class {
|
|
|
5882
5882
|
this.#emitter = emitter;
|
|
5883
5883
|
}
|
|
5884
5884
|
pointerDown = (event) => {
|
|
5885
|
-
if (event.button !== 0 || this.#drag ||
|
|
5885
|
+
if (event.button !== 0 || this.#drag || chunk3OF37CZX_cjs.isCameraGesture(event)) {
|
|
5886
5886
|
return;
|
|
5887
5887
|
}
|
|
5888
5888
|
this.#drag = createResizeDragState(this.#svg, event);
|
|
@@ -5897,7 +5897,7 @@ var ResizeSession = class {
|
|
|
5897
5897
|
const bounds = keepsProportions(drag, event.shiftKey) ? lockAspect(snapped.bounds, drag.startBounds, drag.handle) : snapped.bounds;
|
|
5898
5898
|
const { guides } = snapped;
|
|
5899
5899
|
applyResizePreview(drag, clampResizeToChildren(bounds, drag.childrenBounds));
|
|
5900
|
-
|
|
5900
|
+
chunk3OF37CZX_cjs.updateAlignmentGuides(this.#svg, guides, RESIZE_GUIDE_COLOR);
|
|
5901
5901
|
};
|
|
5902
5902
|
pointerUp = (event) => {
|
|
5903
5903
|
const drag = this.#drag;
|
|
@@ -5906,7 +5906,7 @@ var ResizeSession = class {
|
|
|
5906
5906
|
}
|
|
5907
5907
|
this.#drag = null;
|
|
5908
5908
|
event.target?.releasePointerCapture?.(drag.pointerId);
|
|
5909
|
-
|
|
5909
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
5910
5910
|
if (!drag.moved) {
|
|
5911
5911
|
return;
|
|
5912
5912
|
}
|
|
@@ -5945,7 +5945,7 @@ function resolveSankeyNodeLabelTarget(event) {
|
|
|
5945
5945
|
if (!labelElement) {
|
|
5946
5946
|
return null;
|
|
5947
5947
|
}
|
|
5948
|
-
const owner =
|
|
5948
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(labelElement);
|
|
5949
5949
|
if (owner?.role !== "chart") {
|
|
5950
5950
|
return null;
|
|
5951
5951
|
}
|
|
@@ -5956,7 +5956,7 @@ function resolveSankeyNodeLabelTarget(event) {
|
|
|
5956
5956
|
return { owner, nodeId, labelElement };
|
|
5957
5957
|
}
|
|
5958
5958
|
function createSankeyNodeLabelEditor(target, emitter, onClose) {
|
|
5959
|
-
const rect =
|
|
5959
|
+
const rect = chunk3OF37CZX_cjs.screenRectOf(target.labelElement);
|
|
5960
5960
|
if (rect.width <= 0 && rect.height <= 0) {
|
|
5961
5961
|
return null;
|
|
5962
5962
|
}
|
|
@@ -6013,7 +6013,7 @@ function clearSankeyNodeDragPreview(drag) {
|
|
|
6013
6013
|
// src/runtime/interaction/sankeyNode/target.ts
|
|
6014
6014
|
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$/;
|
|
6015
6015
|
function isNodePointer(event) {
|
|
6016
|
-
return event.button === 0 && !
|
|
6016
|
+
return event.button === 0 && !chunk3OF37CZX_cjs.isCameraGesture(event);
|
|
6017
6017
|
}
|
|
6018
6018
|
function findNodeRect(event) {
|
|
6019
6019
|
return event.target?.closest?.('[data-sf-mark="sankey-node"]');
|
|
@@ -6071,7 +6071,7 @@ function resolveSankeyNodeDrag(svg, event) {
|
|
|
6071
6071
|
if (!rect) {
|
|
6072
6072
|
return null;
|
|
6073
6073
|
}
|
|
6074
|
-
const owner =
|
|
6074
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(rect);
|
|
6075
6075
|
if (owner?.role !== "chart") {
|
|
6076
6076
|
return null;
|
|
6077
6077
|
}
|
|
@@ -6079,7 +6079,7 @@ function resolveSankeyNodeDrag(svg, event) {
|
|
|
6079
6079
|
if (!nodeId) {
|
|
6080
6080
|
return null;
|
|
6081
6081
|
}
|
|
6082
|
-
const start =
|
|
6082
|
+
const start = chunk3OF37CZX_cjs.pointerUserPoint(svg, event);
|
|
6083
6083
|
if (!start) {
|
|
6084
6084
|
return null;
|
|
6085
6085
|
}
|
|
@@ -6125,7 +6125,7 @@ var SankeyNodeDragSession = class {
|
|
|
6125
6125
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
6126
6126
|
return;
|
|
6127
6127
|
}
|
|
6128
|
-
const point =
|
|
6128
|
+
const point = chunk3OF37CZX_cjs.pointerUserPoint(this.#svg, event);
|
|
6129
6129
|
if (!point) {
|
|
6130
6130
|
return;
|
|
6131
6131
|
}
|
|
@@ -6139,7 +6139,7 @@ var SankeyNodeDragSession = class {
|
|
|
6139
6139
|
const leadBounds = offsetBounds(drag.originalBounds, rawDx, rawDy);
|
|
6140
6140
|
const candidates = nearestCandidates(leadBounds, drag.siblingBounds);
|
|
6141
6141
|
const snap = computeSnap(leadBounds, candidates, {
|
|
6142
|
-
threshold: SNAP_THRESHOLD_PX /
|
|
6142
|
+
threshold: SNAP_THRESHOLD_PX / chunk3OF37CZX_cjs.pxPerUnit(this.#svg),
|
|
6143
6143
|
activeX: MOVE_ACTIVE_POINTS,
|
|
6144
6144
|
activeY: MOVE_ACTIVE_POINTS,
|
|
6145
6145
|
guideOverhang: GUIDE_OVERHANG4
|
|
@@ -6149,7 +6149,7 @@ var SankeyNodeDragSession = class {
|
|
|
6149
6149
|
drag.lastDx = dx;
|
|
6150
6150
|
drag.lastDy = dy;
|
|
6151
6151
|
updateSankeyNodeDragPreview(drag, dx, dy);
|
|
6152
|
-
|
|
6152
|
+
chunk3OF37CZX_cjs.updateAlignmentGuides(
|
|
6153
6153
|
this.#svg,
|
|
6154
6154
|
[snap.x.guide, snap.y.guide].filter((guide) => guide !== null),
|
|
6155
6155
|
GUIDE_COLOR3
|
|
@@ -6160,7 +6160,7 @@ var SankeyNodeDragSession = class {
|
|
|
6160
6160
|
clearSankeyNodeDragPreview(this.#drag);
|
|
6161
6161
|
}
|
|
6162
6162
|
this.#drag = null;
|
|
6163
|
-
|
|
6163
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
6164
6164
|
}
|
|
6165
6165
|
finish(event) {
|
|
6166
6166
|
if (!this.#drag || event.pointerId !== this.#drag.pointerId) {
|
|
@@ -6170,7 +6170,7 @@ var SankeyNodeDragSession = class {
|
|
|
6170
6170
|
this.#drag = null;
|
|
6171
6171
|
event.target?.releasePointerCapture?.(drag.pointerId);
|
|
6172
6172
|
clearSankeyNodeDragPreview(drag);
|
|
6173
|
-
|
|
6173
|
+
chunk3OF37CZX_cjs.clearAlignmentGuides(this.#svg);
|
|
6174
6174
|
if (!drag.moved) {
|
|
6175
6175
|
return;
|
|
6176
6176
|
}
|
|
@@ -6226,7 +6226,7 @@ function bindSankeyNode(viewer, emitter) {
|
|
|
6226
6226
|
var FALLBACK_WIDTH = 120;
|
|
6227
6227
|
var FALLBACK_HEIGHT = 28;
|
|
6228
6228
|
function centeredLabelRect(primaryNode) {
|
|
6229
|
-
const primaryRect =
|
|
6229
|
+
const primaryRect = chunk3OF37CZX_cjs.screenRectOf(primaryNode);
|
|
6230
6230
|
return {
|
|
6231
6231
|
left: primaryRect.left + (primaryRect.width - FALLBACK_WIDTH) / 2,
|
|
6232
6232
|
top: primaryRect.top + (primaryRect.height - FALLBACK_HEIGHT) / 2,
|
|
@@ -6236,10 +6236,10 @@ function centeredLabelRect(primaryNode) {
|
|
|
6236
6236
|
}
|
|
6237
6237
|
function resolveTextEditRect(owner, textNode, primaryNode) {
|
|
6238
6238
|
if (owner.role === "shape") {
|
|
6239
|
-
return primaryNode ?
|
|
6239
|
+
return primaryNode ? chunk3OF37CZX_cjs.screenRectOf(primaryNode) : null;
|
|
6240
6240
|
}
|
|
6241
6241
|
if (textNode) {
|
|
6242
|
-
return
|
|
6242
|
+
return chunk3OF37CZX_cjs.screenRectOf(textNode);
|
|
6243
6243
|
}
|
|
6244
6244
|
return primaryNode ? centeredLabelRect(primaryNode) : null;
|
|
6245
6245
|
}
|
|
@@ -6259,8 +6259,8 @@ function textAlign(owner, textNode) {
|
|
|
6259
6259
|
return anchor === "end" ? "right" : "left";
|
|
6260
6260
|
}
|
|
6261
6261
|
function createActiveTextEditor(svg, owner, emitter, onClose) {
|
|
6262
|
-
const textNode =
|
|
6263
|
-
const primaryNode =
|
|
6262
|
+
const textNode = chunk3OF37CZX_cjs.findOwnerNode(svg, owner.id, chunk3OF37CZX_cjs.isTextLabel);
|
|
6263
|
+
const primaryNode = chunk3OF37CZX_cjs.findOwnerNode(svg, owner.id, chunk3OF37CZX_cjs.isPrimary);
|
|
6264
6264
|
const rect = resolveTextEditRect(owner, textNode, primaryNode);
|
|
6265
6265
|
if (!rect) {
|
|
6266
6266
|
return null;
|
|
@@ -6306,7 +6306,7 @@ function isFrameTitle(target) {
|
|
|
6306
6306
|
}
|
|
6307
6307
|
function resolveEditableTextOwner(event) {
|
|
6308
6308
|
const target = event.target;
|
|
6309
|
-
const owner =
|
|
6309
|
+
const owner = chunk3OF37CZX_cjs.resolveOwner(target);
|
|
6310
6310
|
if (!owner) {
|
|
6311
6311
|
return null;
|
|
6312
6312
|
}
|
|
@@ -6447,7 +6447,7 @@ function applyToken(target, lines, token) {
|
|
|
6447
6447
|
function maskSource(lines) {
|
|
6448
6448
|
let tokens;
|
|
6449
6449
|
try {
|
|
6450
|
-
tokens =
|
|
6450
|
+
tokens = chunkSKGJXCAO_cjs.tokenizeSource(lines.join("\n"));
|
|
6451
6451
|
} catch {
|
|
6452
6452
|
return null;
|
|
6453
6453
|
}
|
|
@@ -6479,7 +6479,7 @@ function braceDelta(masked) {
|
|
|
6479
6479
|
}
|
|
6480
6480
|
|
|
6481
6481
|
// src/runtime/interaction/sflPatch/scan/blocks.ts
|
|
6482
|
-
var OWNER_HEADER = /^\s*(Entity|Shape|Text|Image|Container|Chart|Path|Link|Isometric|Widget|Component|Connection|Shader)\s+([A-Za-z_][A-Za-z0-9_]*)\b/;
|
|
6482
|
+
var OWNER_HEADER = /^\s*(Entity|Shape|Text|Image|Container|Screen|Chart|Path|Link|Isometric|Widget|Component|Connection|Shader)\s+([A-Za-z_][A-Za-z0-9_]*)\b/;
|
|
6483
6483
|
var VALID_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
6484
6484
|
function blockEndIn(masked, startLine) {
|
|
6485
6485
|
let depth = 0;
|
|
@@ -6783,7 +6783,7 @@ function resolveCanvasObjectInsertionTarget(sfl, lines, parentId) {
|
|
|
6783
6783
|
const modelRange = findFirstBlockOfKind(lines, "Model");
|
|
6784
6784
|
return modelRange ? { range: modelRange, origin: { x: 0, y: 0 } } : null;
|
|
6785
6785
|
}
|
|
6786
|
-
const parent =
|
|
6786
|
+
const parent = chunkSKGJXCAO_cjs.sflToCanvasState(sfl).canvasObjects.find((canvasObject) => canvasObject.id === parentId);
|
|
6787
6787
|
if (!parent) {
|
|
6788
6788
|
return null;
|
|
6789
6789
|
}
|
|
@@ -6951,6 +6951,42 @@ function outermostRemovalRanges(ranges) {
|
|
|
6951
6951
|
}
|
|
6952
6952
|
|
|
6953
6953
|
// src/runtime/interaction/sflPatch/canvasObjectPatch/remove.ts
|
|
6954
|
+
var GROUP_HEADER = /^\s*Group\s+([A-Za-z_][A-Za-z0-9_]*)\b/;
|
|
6955
|
+
var CHILD_BLOCK = /^\s*[A-Z][A-Za-z]*\s+[A-Za-z_]/;
|
|
6956
|
+
function enclosingGroups(lines, line) {
|
|
6957
|
+
const masked = maskLines(lines);
|
|
6958
|
+
if (masked === null) {
|
|
6959
|
+
return [];
|
|
6960
|
+
}
|
|
6961
|
+
const open = [];
|
|
6962
|
+
for (let i = 0; i < line; i++) {
|
|
6963
|
+
const delta = braceDelta(masked[i]);
|
|
6964
|
+
if (delta > 0) {
|
|
6965
|
+
const group = masked[i].match(GROUP_HEADER);
|
|
6966
|
+
open.push(group ? group[1] : null);
|
|
6967
|
+
for (let extra = 1; extra < delta; extra++) {
|
|
6968
|
+
open.push(null);
|
|
6969
|
+
}
|
|
6970
|
+
} else {
|
|
6971
|
+
open.splice(open.length + delta, -delta);
|
|
6972
|
+
}
|
|
6973
|
+
}
|
|
6974
|
+
return open.filter((name) => name !== null).reverse();
|
|
6975
|
+
}
|
|
6976
|
+
function removeEmptiedGroups(lines, groups) {
|
|
6977
|
+
for (const name of groups) {
|
|
6978
|
+
const masked = maskLines(lines);
|
|
6979
|
+
const start = masked?.findIndex((line) => line.match(GROUP_HEADER)?.[1] === name) ?? -1;
|
|
6980
|
+
if (!masked || start < 0) {
|
|
6981
|
+
return;
|
|
6982
|
+
}
|
|
6983
|
+
const end = blockEndLine(lines, start);
|
|
6984
|
+
if (masked.slice(start + 1, end).some((line) => CHILD_BLOCK.test(line))) {
|
|
6985
|
+
return;
|
|
6986
|
+
}
|
|
6987
|
+
lines.splice(start, end - start + 1);
|
|
6988
|
+
}
|
|
6989
|
+
}
|
|
6954
6990
|
function removeCanvasObject(sfl, id, options = {}) {
|
|
6955
6991
|
const lines = sfl.split("\n");
|
|
6956
6992
|
const canvasObjectRange = findOwnerBlock(lines, id);
|
|
@@ -6966,6 +7002,7 @@ function removeCanvasObject(sfl, id, options = {}) {
|
|
|
6966
7002
|
}
|
|
6967
7003
|
return sfl;
|
|
6968
7004
|
}
|
|
7005
|
+
const groups = enclosingGroups(lines, canvasObjectRange.start);
|
|
6969
7006
|
const ranges = [canvasObjectRange];
|
|
6970
7007
|
if (options.alsoRemoveLinks ?? true) {
|
|
6971
7008
|
ranges.push(...findReferencingLinkRanges(lines, id));
|
|
@@ -6974,6 +7011,7 @@ function removeCanvasObject(sfl, id, options = {}) {
|
|
|
6974
7011
|
for (const range of removalRanges) {
|
|
6975
7012
|
lines.splice(range.start, range.end - range.start + 1);
|
|
6976
7013
|
}
|
|
7014
|
+
removeEmptiedGroups(lines, groups);
|
|
6977
7015
|
return lines.join("\n");
|
|
6978
7016
|
}
|
|
6979
7017
|
|
|
@@ -7310,7 +7348,7 @@ function movePathPoints(lines, range, dx, dy) {
|
|
|
7310
7348
|
replacePropertyValue(lines, span, shifted);
|
|
7311
7349
|
}
|
|
7312
7350
|
function applyMoveChanges(sfl, events) {
|
|
7313
|
-
const state =
|
|
7351
|
+
const state = chunkSKGJXCAO_cjs.sflToCanvasState(sfl);
|
|
7314
7352
|
const lines = sfl.split("\n");
|
|
7315
7353
|
const parents = new Map(state.canvasObjects.map((candidate) => [candidate.id, candidate.parentFrameId]));
|
|
7316
7354
|
const moving = new Set(events.map((event) => event.owner.id));
|
|
@@ -7350,7 +7388,7 @@ function applyMoveChange(sfl, event) {
|
|
|
7350
7388
|
|
|
7351
7389
|
// src/runtime/interaction/sflPatch/changes/pathPointChange.ts
|
|
7352
7390
|
function applyPathPointChange(sfl, event) {
|
|
7353
|
-
const canvasObjects =
|
|
7391
|
+
const canvasObjects = chunkSKGJXCAO_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7354
7392
|
const canvasObject = canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7355
7393
|
if (!canvasObject) {
|
|
7356
7394
|
return sfl;
|
|
@@ -7504,7 +7542,7 @@ function resolveConnectionInsertionTarget(sfl, lines, options) {
|
|
|
7504
7542
|
if (!VALID_IDENT.test(options.id) || nameExists(lines, options.id)) {
|
|
7505
7543
|
return null;
|
|
7506
7544
|
}
|
|
7507
|
-
const canvasObjects =
|
|
7545
|
+
const canvasObjects = chunkSKGJXCAO_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7508
7546
|
const hasSource = canvasObjects.some((canvasObject) => canvasObject.id === options.fromId);
|
|
7509
7547
|
const hasTarget = canvasObjects.some((canvasObject) => canvasObject.id === options.toId);
|
|
7510
7548
|
if (!hasSource || !hasTarget) {
|
|
@@ -7568,13 +7606,13 @@ function isometricOffset(direction, object, gap) {
|
|
|
7568
7606
|
const { depth } = object.isometric;
|
|
7569
7607
|
switch (direction) {
|
|
7570
7608
|
case "iso-width-pos":
|
|
7571
|
-
return { dx: (width + gap) *
|
|
7609
|
+
return { dx: (width + gap) * chunkSKGJXCAO_cjs.AXIS_COS, dy: (width + gap) * chunkSKGJXCAO_cjs.AXIS_SIN };
|
|
7572
7610
|
case "iso-width-neg":
|
|
7573
|
-
return { dx: -(width + gap) *
|
|
7611
|
+
return { dx: -(width + gap) * chunkSKGJXCAO_cjs.AXIS_COS, dy: -(width + gap) * chunkSKGJXCAO_cjs.AXIS_SIN };
|
|
7574
7612
|
case "iso-depth-pos":
|
|
7575
|
-
return { dx: -(depth + gap) *
|
|
7613
|
+
return { dx: -(depth + gap) * chunkSKGJXCAO_cjs.AXIS_COS, dy: (depth + gap) * chunkSKGJXCAO_cjs.AXIS_SIN };
|
|
7576
7614
|
case "iso-depth-neg":
|
|
7577
|
-
return { dx: (depth + gap) *
|
|
7615
|
+
return { dx: (depth + gap) * chunkSKGJXCAO_cjs.AXIS_COS, dy: -(depth + gap) * chunkSKGJXCAO_cjs.AXIS_SIN };
|
|
7578
7616
|
case "iso-height-pos":
|
|
7579
7617
|
return { dx: 0, dy: height + gap };
|
|
7580
7618
|
case "iso-height-neg":
|
|
@@ -7637,7 +7675,7 @@ function resolveLinkInsertionTarget(sfl, lines, options) {
|
|
|
7637
7675
|
if (!VALID_IDENT.test(options.id) || nameExists(lines, options.id)) {
|
|
7638
7676
|
return null;
|
|
7639
7677
|
}
|
|
7640
|
-
const canvasObjects =
|
|
7678
|
+
const canvasObjects = chunkSKGJXCAO_cjs.sflToCanvasState(sfl).canvasObjects;
|
|
7641
7679
|
const hasSource = canvasObjects.some((canvasObject) => canvasObject.id === options.fromId);
|
|
7642
7680
|
const hasTarget = canvasObjects.some((canvasObject) => canvasObject.id === options.toId);
|
|
7643
7681
|
if (!hasSource || !hasTarget) {
|
|
@@ -7723,21 +7761,21 @@ function duplicateShape(sfl, input) {
|
|
|
7723
7761
|
|
|
7724
7762
|
// src/runtime/interaction/sflPatch/changes/quickDuplicateChange.ts
|
|
7725
7763
|
function applyQuickDuplicateChange(sfl, event, options) {
|
|
7726
|
-
const state =
|
|
7764
|
+
const state = chunkSKGJXCAO_cjs.sflToCanvasState(sfl);
|
|
7727
7765
|
const object = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7728
7766
|
if (!object) {
|
|
7729
7767
|
return sfl;
|
|
7730
7768
|
}
|
|
7731
7769
|
const { direction } = event;
|
|
7732
7770
|
if (isIsometricDirection2(direction)) {
|
|
7733
|
-
return
|
|
7771
|
+
return chunkSKGJXCAO_cjs.isIsometricObject(object) ? duplicateIsometricObject(sfl, object, direction, options) : sfl;
|
|
7734
7772
|
}
|
|
7735
|
-
return
|
|
7773
|
+
return chunkSKGJXCAO_cjs.isIsometricObject(object) ? sfl : duplicateShape(sfl, { object, links: state.links, side: direction, options });
|
|
7736
7774
|
}
|
|
7737
7775
|
|
|
7738
7776
|
// src/runtime/interaction/sflPatch/changes/resizeChange.ts
|
|
7739
7777
|
function applyResizeChange(sfl, event) {
|
|
7740
|
-
const state =
|
|
7778
|
+
const state = chunkSKGJXCAO_cjs.sflToCanvasState(sfl);
|
|
7741
7779
|
const canvasObject = state.canvasObjects.find((candidate) => candidate.id === event.owner.id);
|
|
7742
7780
|
const parent = canvasObject?.parentFrameId ? state.canvasObjects.find((candidate) => candidate.id === canvasObject.parentFrameId) : void 0;
|
|
7743
7781
|
const originX = parent?.x ?? 0;
|