graphics-debug 0.0.82 → 0.0.84
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/dist/{chunk-NYENUFOW.js → chunk-7236NVI2.js} +5 -1
- package/dist/chunk-7236NVI2.js.map +1 -0
- package/dist/{chunk-QMPH5ZUA.js → chunk-AKONCUCE.js} +50 -8
- package/dist/chunk-AKONCUCE.js.map +1 -0
- package/dist/chunk-FLFF6QXL.js +89 -0
- package/dist/chunk-FLFF6QXL.js.map +1 -0
- package/dist/{chunk-FYUIQOZG.js → chunk-HPNVGPHJ.js} +2 -2
- package/dist/chunk-HPNVGPHJ.js.map +1 -0
- package/dist/{chunk-BQ3ZHEQO.js → chunk-K37Y2KHE.js} +5 -1
- package/dist/chunk-K37Y2KHE.js.map +1 -0
- package/dist/{chunk-5TY5HWUP.js → chunk-MYMDOAQN.js} +6 -6
- package/dist/{chunk-GZRUE2GP.js → chunk-OB4CGOL3.js} +6 -1
- package/dist/chunk-OB4CGOL3.js.map +1 -0
- package/dist/{chunk-3L7TJ2LD.js → chunk-ZWAXHWX2.js} +58 -5
- package/dist/chunk-ZWAXHWX2.js.map +1 -0
- package/dist/cli/cli.js +8 -7
- package/dist/cli/cli.js.map +1 -1
- package/dist/lib/drawGraphicsToCanvas.js +2 -1
- package/dist/lib/getSvgFromGraphicsObject.d.ts +1 -1
- package/dist/lib/getSvgFromGraphicsObject.js +2 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +10 -9
- package/dist/lib/infiniteLineHelpers.d.ts +7 -0
- package/dist/lib/infiniteLineHelpers.js +9 -0
- package/dist/lib/infiniteLineHelpers.js.map +1 -0
- package/dist/lib/matcher.js +2 -1
- package/dist/lib/matcher.js.map +1 -1
- package/dist/lib/mergeGraphics.js +1 -1
- package/dist/lib/react.d.ts +1 -1
- package/dist/lib/react.js +197 -100
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/setStepOfAllObjects.js +1 -1
- package/dist/lib/stackGraphics.js +5 -4
- package/dist/lib/translateGraphics.js +1 -1
- package/dist/lib/types.d.ts +19 -1
- package/package.json +1 -1
- package/dist/chunk-3L7TJ2LD.js.map +0 -1
- package/dist/chunk-BQ3ZHEQO.js.map +0 -1
- package/dist/chunk-FYUIQOZG.js.map +0 -1
- package/dist/chunk-GZRUE2GP.js.map +0 -1
- package/dist/chunk-NYENUFOW.js.map +0 -1
- package/dist/chunk-QMPH5ZUA.js.map +0 -1
- /package/dist/{chunk-5TY5HWUP.js.map → chunk-MYMDOAQN.js.map} +0 -0
package/dist/lib/react.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import "../chunk-
|
|
3
|
-
import "../chunk-
|
|
4
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-HPNVGPHJ.js";
|
|
2
|
+
import "../chunk-OB4CGOL3.js";
|
|
3
|
+
import "../chunk-MYMDOAQN.js";
|
|
4
|
+
import "../chunk-K37Y2KHE.js";
|
|
5
|
+
import "../chunk-7236NVI2.js";
|
|
5
6
|
import {
|
|
6
7
|
defaultColors,
|
|
7
8
|
drawGraphicsToCanvas,
|
|
8
9
|
getBounds
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-AKONCUCE.js";
|
|
10
11
|
import "../chunk-NG6H63SM.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ZWAXHWX2.js";
|
|
12
13
|
import {
|
|
13
14
|
getArrowBoundingBox,
|
|
14
15
|
getArrowGeometry
|
|
15
16
|
} from "../chunk-IOVKI3ZO.js";
|
|
16
17
|
import "../chunk-ZGI74PYD.js";
|
|
17
|
-
import
|
|
18
|
+
import {
|
|
19
|
+
clipInfiniteLineToBounds,
|
|
20
|
+
getViewportBoundsFromMatrix
|
|
21
|
+
} from "../chunk-FLFF6QXL.js";
|
|
18
22
|
|
|
19
23
|
// site/components/InteractiveGraphics/InteractiveGraphics.tsx
|
|
20
24
|
import useResizeObserver from "@react-hook/resize-observer";
|
|
@@ -93,6 +97,7 @@ function getMaxStep(graphics) {
|
|
|
93
97
|
};
|
|
94
98
|
const maxPointStep = getMaxStepFromArray(graphics.points);
|
|
95
99
|
const maxLineStep = getMaxStepFromArray(graphics.lines);
|
|
100
|
+
const maxInfiniteLineStep = getMaxStepFromArray(graphics.infiniteLines);
|
|
96
101
|
const maxRectStep = getMaxStepFromArray(graphics.rects);
|
|
97
102
|
const maxPolygonStep = getMaxStepFromArray(graphics.polygons);
|
|
98
103
|
const maxCircleStep = getMaxStepFromArray(graphics.circles);
|
|
@@ -101,6 +106,7 @@ function getMaxStep(graphics) {
|
|
|
101
106
|
return Math.max(
|
|
102
107
|
maxPointStep,
|
|
103
108
|
maxLineStep,
|
|
109
|
+
maxInfiniteLineStep,
|
|
104
110
|
maxRectStep,
|
|
105
111
|
maxPolygonStep,
|
|
106
112
|
maxCircleStep,
|
|
@@ -114,7 +120,7 @@ var sortRectsByArea = (rects) => rects.slice().sort((a, b) => b.width * b.height
|
|
|
114
120
|
|
|
115
121
|
// site/components/InteractiveGraphics/InteractiveGraphics.tsx
|
|
116
122
|
import {
|
|
117
|
-
applyToPoint as
|
|
123
|
+
applyToPoint as applyToPoint14,
|
|
118
124
|
compose,
|
|
119
125
|
inverse as inverse2,
|
|
120
126
|
scale,
|
|
@@ -828,10 +834,81 @@ var ContextMenu = ({
|
|
|
828
834
|
] });
|
|
829
835
|
};
|
|
830
836
|
|
|
831
|
-
// site/components/InteractiveGraphics/
|
|
837
|
+
// site/components/InteractiveGraphics/InfiniteLine.tsx
|
|
832
838
|
import { applyToPoint as applyToPoint4 } from "transformation-matrix";
|
|
833
|
-
import { useRef as useRef3, useState as useState4 } from "react";
|
|
834
839
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
840
|
+
var InfiniteLine = ({
|
|
841
|
+
infiniteLine,
|
|
842
|
+
index,
|
|
843
|
+
interactiveState,
|
|
844
|
+
size
|
|
845
|
+
}) => {
|
|
846
|
+
const { realToScreen, onObjectClicked } = interactiveState;
|
|
847
|
+
const viewportBounds = getViewportBoundsFromMatrix(
|
|
848
|
+
realToScreen,
|
|
849
|
+
size.width,
|
|
850
|
+
size.height
|
|
851
|
+
);
|
|
852
|
+
const segment = clipInfiniteLineToBounds(infiniteLine, viewportBounds);
|
|
853
|
+
if (!segment) {
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
const [start, end] = segment;
|
|
857
|
+
const screenStart = applyToPoint4(realToScreen, start);
|
|
858
|
+
const screenEnd = applyToPoint4(realToScreen, end);
|
|
859
|
+
const baseColor = infiniteLine.strokeColor ?? defaultColors[index % defaultColors.length];
|
|
860
|
+
const strokeWidth = (infiniteLine.strokeWidth ?? 1 / Math.abs(realToScreen.a)) * Math.abs(realToScreen.a);
|
|
861
|
+
return /* @__PURE__ */ jsxs4(
|
|
862
|
+
"svg",
|
|
863
|
+
{
|
|
864
|
+
style: {
|
|
865
|
+
position: "absolute",
|
|
866
|
+
top: 0,
|
|
867
|
+
left: 0,
|
|
868
|
+
width: size.width,
|
|
869
|
+
height: size.height,
|
|
870
|
+
pointerEvents: "none"
|
|
871
|
+
},
|
|
872
|
+
children: [
|
|
873
|
+
/* @__PURE__ */ jsx6(
|
|
874
|
+
"line",
|
|
875
|
+
{
|
|
876
|
+
x1: screenStart.x,
|
|
877
|
+
y1: screenStart.y,
|
|
878
|
+
x2: screenEnd.x,
|
|
879
|
+
y2: screenEnd.y,
|
|
880
|
+
stroke: "transparent",
|
|
881
|
+
strokeWidth: strokeWidth + 10,
|
|
882
|
+
pointerEvents: "stroke",
|
|
883
|
+
onClick: () => onObjectClicked?.({
|
|
884
|
+
type: "infinite-line",
|
|
885
|
+
index,
|
|
886
|
+
object: infiniteLine
|
|
887
|
+
})
|
|
888
|
+
}
|
|
889
|
+
),
|
|
890
|
+
/* @__PURE__ */ jsx6(
|
|
891
|
+
"line",
|
|
892
|
+
{
|
|
893
|
+
x1: screenStart.x,
|
|
894
|
+
y1: screenStart.y,
|
|
895
|
+
x2: screenEnd.x,
|
|
896
|
+
y2: screenEnd.y,
|
|
897
|
+
stroke: baseColor,
|
|
898
|
+
strokeWidth,
|
|
899
|
+
strokeDasharray: !infiniteLine.strokeDash ? void 0 : typeof infiniteLine.strokeDash === "string" ? infiniteLine.strokeDash : infiniteLine.strokeDash.map((dash) => dash * Math.abs(realToScreen.a)).join(","),
|
|
900
|
+
pointerEvents: "none"
|
|
901
|
+
}
|
|
902
|
+
)
|
|
903
|
+
]
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
// site/components/InteractiveGraphics/Line.tsx
|
|
909
|
+
import { applyToPoint as applyToPoint5 } from "transformation-matrix";
|
|
910
|
+
import { useRef as useRef3, useState as useState4 } from "react";
|
|
911
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
835
912
|
var Line = ({
|
|
836
913
|
line,
|
|
837
914
|
index,
|
|
@@ -849,7 +926,7 @@ var Line = ({
|
|
|
849
926
|
const [isHovered, setIsHovered] = useState4(false);
|
|
850
927
|
const [mousePos, setMousePos] = useState4({ x: 0, y: 0 });
|
|
851
928
|
const svgRef = useRef3(null);
|
|
852
|
-
const screenPoints = points.map((p) =>
|
|
929
|
+
const screenPoints = points.map((p) => applyToPoint5(realToScreen, p));
|
|
853
930
|
const xs = screenPoints.map((p) => p.x);
|
|
854
931
|
const ys = screenPoints.map((p) => p.y);
|
|
855
932
|
const minX = Math.min(...xs);
|
|
@@ -893,7 +970,7 @@ var Line = ({
|
|
|
893
970
|
setIsHovered(isNearLine);
|
|
894
971
|
};
|
|
895
972
|
const baseColor = strokeColor ?? defaultColors[index % defaultColors.length];
|
|
896
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsxs5(
|
|
897
974
|
"svg",
|
|
898
975
|
{
|
|
899
976
|
ref: svgRef,
|
|
@@ -906,7 +983,7 @@ var Line = ({
|
|
|
906
983
|
pointerEvents: "none"
|
|
907
984
|
},
|
|
908
985
|
children: [
|
|
909
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsx7(
|
|
910
987
|
"polyline",
|
|
911
988
|
{
|
|
912
989
|
points: localPoints.map((p) => `${p.x},${p.y}`).join(" "),
|
|
@@ -924,7 +1001,7 @@ var Line = ({
|
|
|
924
1001
|
}) : void 0
|
|
925
1002
|
}
|
|
926
1003
|
),
|
|
927
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ jsx7(
|
|
928
1005
|
"polyline",
|
|
929
1006
|
{
|
|
930
1007
|
points: localPoints.map((p) => `${p.x},${p.y}`).join(" "),
|
|
@@ -936,14 +1013,14 @@ var Line = ({
|
|
|
936
1013
|
pointerEvents: "none"
|
|
937
1014
|
}
|
|
938
1015
|
),
|
|
939
|
-
isHovered && line.label && /* @__PURE__ */
|
|
1016
|
+
isHovered && line.label && /* @__PURE__ */ jsx7(
|
|
940
1017
|
"foreignObject",
|
|
941
1018
|
{
|
|
942
1019
|
x: mousePos.x,
|
|
943
1020
|
y: mousePos.y - 40,
|
|
944
1021
|
width: 300,
|
|
945
1022
|
height: 40,
|
|
946
|
-
children: /* @__PURE__ */
|
|
1023
|
+
children: /* @__PURE__ */ jsx7(Tooltip, { text: line.label })
|
|
947
1024
|
}
|
|
948
1025
|
)
|
|
949
1026
|
]
|
|
@@ -952,11 +1029,11 @@ var Line = ({
|
|
|
952
1029
|
};
|
|
953
1030
|
|
|
954
1031
|
// site/components/InteractiveGraphics/Marker.tsx
|
|
955
|
-
import { applyToPoint as
|
|
956
|
-
import { jsx as
|
|
1032
|
+
import { applyToPoint as applyToPoint6 } from "transformation-matrix";
|
|
1033
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
957
1034
|
var Marker = ({ marker, transform }) => {
|
|
958
|
-
const [screenX, screenY] =
|
|
959
|
-
return /* @__PURE__ */
|
|
1035
|
+
const [screenX, screenY] = applyToPoint6(transform, [marker.x, marker.y]);
|
|
1036
|
+
return /* @__PURE__ */ jsx8(
|
|
960
1037
|
"svg",
|
|
961
1038
|
{
|
|
962
1039
|
style: {
|
|
@@ -966,8 +1043,8 @@ var Marker = ({ marker, transform }) => {
|
|
|
966
1043
|
pointerEvents: "none",
|
|
967
1044
|
zIndex: 900
|
|
968
1045
|
},
|
|
969
|
-
children: /* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
1046
|
+
children: /* @__PURE__ */ jsxs6("g", { transform: `translate(${screenX}, ${screenY})`, children: [
|
|
1047
|
+
/* @__PURE__ */ jsx8(
|
|
971
1048
|
"circle",
|
|
972
1049
|
{
|
|
973
1050
|
r: 7,
|
|
@@ -976,16 +1053,16 @@ var Marker = ({ marker, transform }) => {
|
|
|
976
1053
|
strokeWidth: 2
|
|
977
1054
|
}
|
|
978
1055
|
),
|
|
979
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsx8("circle", { r: 2, fill: "rgba(255, 0, 0, 0.9)" })
|
|
980
1057
|
] })
|
|
981
1058
|
}
|
|
982
1059
|
);
|
|
983
1060
|
};
|
|
984
1061
|
|
|
985
1062
|
// site/components/InteractiveGraphics/Point.tsx
|
|
986
|
-
import { applyToPoint as
|
|
1063
|
+
import { applyToPoint as applyToPoint7 } from "transformation-matrix";
|
|
987
1064
|
import { useState as useState5 } from "react";
|
|
988
|
-
import { jsx as
|
|
1065
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
989
1066
|
var Point = ({
|
|
990
1067
|
point,
|
|
991
1068
|
interactiveState,
|
|
@@ -994,9 +1071,9 @@ var Point = ({
|
|
|
994
1071
|
const { color, label, layer, step } = point;
|
|
995
1072
|
const { activeLayers, activeStep, realToScreen, onObjectClicked } = interactiveState;
|
|
996
1073
|
const [isHovered, setIsHovered] = useState5(false);
|
|
997
|
-
const screenPoint =
|
|
1074
|
+
const screenPoint = applyToPoint7(realToScreen, point);
|
|
998
1075
|
const size = 10;
|
|
999
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsx9(
|
|
1000
1077
|
"div",
|
|
1001
1078
|
{
|
|
1002
1079
|
style: {
|
|
@@ -1020,7 +1097,7 @@ var Point = ({
|
|
|
1020
1097
|
index,
|
|
1021
1098
|
object: point
|
|
1022
1099
|
}),
|
|
1023
|
-
children: isHovered && /* @__PURE__ */
|
|
1100
|
+
children: isHovered && /* @__PURE__ */ jsx9(
|
|
1024
1101
|
"div",
|
|
1025
1102
|
{
|
|
1026
1103
|
style: {
|
|
@@ -1030,7 +1107,7 @@ var Point = ({
|
|
|
1030
1107
|
transform: "translateX(-50%)",
|
|
1031
1108
|
marginBottom: 8
|
|
1032
1109
|
},
|
|
1033
|
-
children: /* @__PURE__ */
|
|
1110
|
+
children: /* @__PURE__ */ jsx9(
|
|
1034
1111
|
Tooltip,
|
|
1035
1112
|
{
|
|
1036
1113
|
text: `${label ? `${label}
|
|
@@ -1045,18 +1122,18 @@ var Point = ({
|
|
|
1045
1122
|
|
|
1046
1123
|
// site/components/InteractiveGraphics/Polygon.tsx
|
|
1047
1124
|
import { useState as useState6 } from "react";
|
|
1048
|
-
import { applyToPoint as
|
|
1049
|
-
import { jsx as
|
|
1125
|
+
import { applyToPoint as applyToPoint8 } from "transformation-matrix";
|
|
1126
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1050
1127
|
var Polygon = ({
|
|
1051
1128
|
polygon,
|
|
1052
1129
|
interactiveState,
|
|
1053
1130
|
index
|
|
1054
1131
|
}) => {
|
|
1055
|
-
const { points, fill, stroke } = polygon;
|
|
1132
|
+
const { points, fill, stroke, strokeWidth } = polygon;
|
|
1056
1133
|
const { realToScreen, onObjectClicked } = interactiveState;
|
|
1057
1134
|
const [isHovered, setIsHovered] = useState6(false);
|
|
1058
1135
|
if (!points || points.length === 0) return null;
|
|
1059
|
-
const screenPoints = points.map((p) =>
|
|
1136
|
+
const screenPoints = points.map((p) => applyToPoint8(realToScreen, p));
|
|
1060
1137
|
const xs = screenPoints.map((p) => p.x);
|
|
1061
1138
|
const ys = screenPoints.map((p) => p.y);
|
|
1062
1139
|
const minX = Math.min(...xs);
|
|
@@ -1078,7 +1155,8 @@ var Polygon = ({
|
|
|
1078
1155
|
const baseStroke = stroke;
|
|
1079
1156
|
const displayFill = isHovered ? safeLighten(0.2, baseFill) : baseFill;
|
|
1080
1157
|
const displayStroke = baseStroke ? isHovered ? safeLighten(0.2, baseStroke) : baseStroke : void 0;
|
|
1081
|
-
|
|
1158
|
+
const screenStrokeWidth = strokeWidth === void 0 ? void 0 : strokeWidth * realToScreen.a;
|
|
1159
|
+
return /* @__PURE__ */ jsxs7(
|
|
1082
1160
|
"div",
|
|
1083
1161
|
{
|
|
1084
1162
|
style: {
|
|
@@ -1090,12 +1168,13 @@ var Polygon = ({
|
|
|
1090
1168
|
pointerEvents: "none"
|
|
1091
1169
|
},
|
|
1092
1170
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsx10("svg", { width: svgWidth, height: svgHeight, style: { display: "block" }, children: /* @__PURE__ */ jsx10(
|
|
1094
1172
|
"polygon",
|
|
1095
1173
|
{
|
|
1096
1174
|
points: localPoints.map((p) => `${p.x},${p.y}`).join(" "),
|
|
1097
1175
|
fill: displayFill,
|
|
1098
1176
|
stroke: displayStroke ?? "none",
|
|
1177
|
+
strokeWidth: screenStrokeWidth,
|
|
1099
1178
|
pointerEvents: "all",
|
|
1100
1179
|
onMouseEnter: () => setIsHovered(true),
|
|
1101
1180
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -1106,7 +1185,7 @@ var Polygon = ({
|
|
|
1106
1185
|
})
|
|
1107
1186
|
}
|
|
1108
1187
|
) }),
|
|
1109
|
-
isHovered && polygon.label && /* @__PURE__ */
|
|
1188
|
+
isHovered && polygon.label && /* @__PURE__ */ jsx10(
|
|
1110
1189
|
"div",
|
|
1111
1190
|
{
|
|
1112
1191
|
style: {
|
|
@@ -1117,7 +1196,7 @@ var Polygon = ({
|
|
|
1117
1196
|
marginBottom: 8,
|
|
1118
1197
|
pointerEvents: "none"
|
|
1119
1198
|
},
|
|
1120
|
-
children: /* @__PURE__ */
|
|
1199
|
+
children: /* @__PURE__ */ jsx10(Tooltip, { text: polygon.label })
|
|
1121
1200
|
}
|
|
1122
1201
|
)
|
|
1123
1202
|
]
|
|
@@ -1126,9 +1205,9 @@ var Polygon = ({
|
|
|
1126
1205
|
};
|
|
1127
1206
|
|
|
1128
1207
|
// site/components/InteractiveGraphics/Rect.tsx
|
|
1129
|
-
import { applyToPoint as
|
|
1208
|
+
import { applyToPoint as applyToPoint9 } from "transformation-matrix";
|
|
1130
1209
|
import { useState as useState7 } from "react";
|
|
1131
|
-
import { jsx as
|
|
1210
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1132
1211
|
var Rect = ({
|
|
1133
1212
|
rect,
|
|
1134
1213
|
interactiveState,
|
|
@@ -1138,7 +1217,7 @@ var Rect = ({
|
|
|
1138
1217
|
let { center, width, height, fill, stroke, layer, step } = rect;
|
|
1139
1218
|
const { activeLayers, activeStep, realToScreen, onObjectClicked } = interactiveState;
|
|
1140
1219
|
const [isHovered, setIsHovered] = useState7(false);
|
|
1141
|
-
const screenCenter =
|
|
1220
|
+
const screenCenter = applyToPoint9(realToScreen, center);
|
|
1142
1221
|
const screenWidth = width * realToScreen.a;
|
|
1143
1222
|
const screenHeight = height * Math.abs(realToScreen.d);
|
|
1144
1223
|
const hasStrokeOrFill = fill !== void 0 || stroke !== void 0;
|
|
@@ -1147,7 +1226,7 @@ var Rect = ({
|
|
|
1147
1226
|
backgroundColor = safeLighten(0.2, backgroundColor);
|
|
1148
1227
|
stroke = safeLighten(0.2, stroke);
|
|
1149
1228
|
}
|
|
1150
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsx11(
|
|
1151
1230
|
"div",
|
|
1152
1231
|
{
|
|
1153
1232
|
style: {
|
|
@@ -1168,7 +1247,7 @@ var Rect = ({
|
|
|
1168
1247
|
index,
|
|
1169
1248
|
object: rect
|
|
1170
1249
|
}),
|
|
1171
|
-
children: isHovered && rect.label && /* @__PURE__ */
|
|
1250
|
+
children: isHovered && rect.label && /* @__PURE__ */ jsx11(
|
|
1172
1251
|
"div",
|
|
1173
1252
|
{
|
|
1174
1253
|
style: {
|
|
@@ -1178,7 +1257,7 @@ var Rect = ({
|
|
|
1178
1257
|
transform: "translateX(-50%)",
|
|
1179
1258
|
marginBottom: 8
|
|
1180
1259
|
},
|
|
1181
|
-
children: /* @__PURE__ */
|
|
1260
|
+
children: /* @__PURE__ */ jsx11(Tooltip, { text: rect.label })
|
|
1182
1261
|
}
|
|
1183
1262
|
)
|
|
1184
1263
|
}
|
|
@@ -1186,8 +1265,8 @@ var Rect = ({
|
|
|
1186
1265
|
};
|
|
1187
1266
|
|
|
1188
1267
|
// site/components/InteractiveGraphics/Text.tsx
|
|
1189
|
-
import { applyToPoint as
|
|
1190
|
-
import { jsx as
|
|
1268
|
+
import { applyToPoint as applyToPoint10 } from "transformation-matrix";
|
|
1269
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1191
1270
|
var Text = ({
|
|
1192
1271
|
textObj,
|
|
1193
1272
|
interactiveState,
|
|
@@ -1195,7 +1274,7 @@ var Text = ({
|
|
|
1195
1274
|
}) => {
|
|
1196
1275
|
const { realToScreen, onObjectClicked } = interactiveState;
|
|
1197
1276
|
const { x, y, text, color, fontSize, anchorSide } = textObj;
|
|
1198
|
-
const screenPos =
|
|
1277
|
+
const screenPos = applyToPoint10(realToScreen, { x, y });
|
|
1199
1278
|
const transformMap = {
|
|
1200
1279
|
top_left: "translate(0%, 0%)",
|
|
1201
1280
|
top_center: "translate(-50%, 0%)",
|
|
@@ -1208,7 +1287,7 @@ var Text = ({
|
|
|
1208
1287
|
bottom_right: "translate(-100%, -100%)"
|
|
1209
1288
|
};
|
|
1210
1289
|
const transform = transformMap[anchorSide ?? "center"];
|
|
1211
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ jsx12(
|
|
1212
1291
|
"div",
|
|
1213
1292
|
{
|
|
1214
1293
|
style: {
|
|
@@ -1228,18 +1307,18 @@ var Text = ({
|
|
|
1228
1307
|
};
|
|
1229
1308
|
|
|
1230
1309
|
// site/components/InteractiveGraphics/hooks/useIsPointOnScreen.ts
|
|
1231
|
-
import { applyToPoint as
|
|
1310
|
+
import { applyToPoint as applyToPoint12 } from "transformation-matrix";
|
|
1232
1311
|
import { useMemo as useMemo4 } from "react";
|
|
1233
1312
|
|
|
1234
1313
|
// site/components/InteractiveGraphics/hooks/useDoesLineIntersectViewport.ts
|
|
1235
|
-
import { applyToPoint as
|
|
1314
|
+
import { applyToPoint as applyToPoint11 } from "transformation-matrix";
|
|
1236
1315
|
import { useMemo as useMemo3 } from "react";
|
|
1237
1316
|
var OFFSCREEN_MARGIN = 5;
|
|
1238
1317
|
var useDoesLineIntersectViewport = (realToScreen, size) => {
|
|
1239
1318
|
return useMemo3(() => {
|
|
1240
1319
|
return (p1, p2) => {
|
|
1241
|
-
const sp1 =
|
|
1242
|
-
const sp2 =
|
|
1320
|
+
const sp1 = applyToPoint11(realToScreen, p1);
|
|
1321
|
+
const sp2 = applyToPoint11(realToScreen, p2);
|
|
1243
1322
|
const left = -OFFSCREEN_MARGIN;
|
|
1244
1323
|
const right = size.width + OFFSCREEN_MARGIN;
|
|
1245
1324
|
const top = -OFFSCREEN_MARGIN;
|
|
@@ -1269,7 +1348,7 @@ var useDoesLineIntersectViewport = (realToScreen, size) => {
|
|
|
1269
1348
|
var useIsPointOnScreen = (realToScreen, size) => {
|
|
1270
1349
|
return useMemo4(() => {
|
|
1271
1350
|
return (point) => {
|
|
1272
|
-
const screenPoint =
|
|
1351
|
+
const screenPoint = applyToPoint12(realToScreen, point);
|
|
1273
1352
|
return screenPoint.x >= -OFFSCREEN_MARGIN && screenPoint.x <= size.width + OFFSCREEN_MARGIN && screenPoint.y >= -OFFSCREEN_MARGIN && screenPoint.y <= size.height + OFFSCREEN_MARGIN;
|
|
1274
1353
|
};
|
|
1275
1354
|
}, [realToScreen, size]);
|
|
@@ -1347,7 +1426,7 @@ var useFilterRects = ({
|
|
|
1347
1426
|
|
|
1348
1427
|
// site/components/InteractiveGraphics/hooks/useFilterCircles.ts
|
|
1349
1428
|
import { useMemo as useMemo8 } from "react";
|
|
1350
|
-
import { applyToPoint as
|
|
1429
|
+
import { applyToPoint as applyToPoint13 } from "transformation-matrix";
|
|
1351
1430
|
var useFilterCircles = ({
|
|
1352
1431
|
isPointOnScreen,
|
|
1353
1432
|
filterLayerAndStep,
|
|
@@ -1361,7 +1440,7 @@ var useFilterCircles = ({
|
|
|
1361
1440
|
if (isPointOnScreen(center) || isPointOnScreen({ x: center.x + radius, y: center.y }) || isPointOnScreen({ x: center.x - radius, y: center.y }) || isPointOnScreen({ x: center.x, y: center.y + radius }) || isPointOnScreen({ x: center.x, y: center.y - radius })) {
|
|
1362
1441
|
return true;
|
|
1363
1442
|
}
|
|
1364
|
-
const screenCenter =
|
|
1443
|
+
const screenCenter = applyToPoint13(realToScreen, center);
|
|
1365
1444
|
const scale4 = Math.abs(realToScreen.a);
|
|
1366
1445
|
const screenRadius = radius * scale4;
|
|
1367
1446
|
const left = -OFFSCREEN_MARGIN;
|
|
@@ -1457,7 +1536,7 @@ var useFilterPolygons = ({
|
|
|
1457
1536
|
};
|
|
1458
1537
|
|
|
1459
1538
|
// site/components/InteractiveGraphics/InteractiveGraphics.tsx
|
|
1460
|
-
import { jsx as
|
|
1539
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1461
1540
|
var InteractiveGraphics = ({
|
|
1462
1541
|
graphics,
|
|
1463
1542
|
onObjectClicked,
|
|
@@ -1473,6 +1552,7 @@ var InteractiveGraphics = ({
|
|
|
1473
1552
|
const availableLayers = Array.from(
|
|
1474
1553
|
/* @__PURE__ */ new Set([
|
|
1475
1554
|
...graphics.lines?.map((l) => l.layer).filter(Boolean) ?? [],
|
|
1555
|
+
...graphics.infiniteLines?.map((l) => l.layer).filter(Boolean) ?? [],
|
|
1476
1556
|
...graphics.rects?.map((r) => r.layer).filter(Boolean) ?? [],
|
|
1477
1557
|
...graphics.polygons?.map((p) => p.layer).filter(Boolean) ?? [],
|
|
1478
1558
|
...graphics.points?.map((p) => p.layer).filter(Boolean) ?? [],
|
|
@@ -1621,7 +1701,7 @@ var InteractiveGraphics = ({
|
|
|
1621
1701
|
const screenX = screenPoint.x - rect.left;
|
|
1622
1702
|
const screenY = screenPoint.y - rect.top;
|
|
1623
1703
|
const inverseTransform = inverse2(realToScreen);
|
|
1624
|
-
const [realX, realY] =
|
|
1704
|
+
const [realX, realY] = applyToPoint14(inverseTransform, [
|
|
1625
1705
|
screenX,
|
|
1626
1706
|
screenY
|
|
1627
1707
|
]);
|
|
@@ -1706,6 +1786,10 @@ var InteractiveGraphics = ({
|
|
|
1706
1786
|
() => filterAndLimit(graphics.lines, filterLines),
|
|
1707
1787
|
[graphics.lines, filterLines, objectLimit]
|
|
1708
1788
|
);
|
|
1789
|
+
const filteredInfiniteLines = useMemo12(
|
|
1790
|
+
() => filterAndLimit(graphics.infiniteLines, filterLayerAndStep),
|
|
1791
|
+
[graphics.infiniteLines, filterLayerAndStep, objectLimit]
|
|
1792
|
+
);
|
|
1709
1793
|
const filteredRects = useMemo12(
|
|
1710
1794
|
() => sortRectsByArea(filterAndLimit(graphics.rects, filterRects)),
|
|
1711
1795
|
[graphics.rects, filterRects, objectLimit]
|
|
@@ -1730,11 +1814,11 @@ var InteractiveGraphics = ({
|
|
|
1730
1814
|
() => filterAndLimit(graphics.arrows, filterArrows),
|
|
1731
1815
|
[graphics.arrows, filterArrows, objectLimit]
|
|
1732
1816
|
);
|
|
1733
|
-
const totalFilteredObjects = filteredLines.length + filteredRects.length + filteredPolygons.length + filteredPoints.length + filteredCircles.length + filteredTexts.length + filteredArrows.length;
|
|
1817
|
+
const totalFilteredObjects = filteredInfiniteLines.length + filteredLines.length + filteredRects.length + filteredPolygons.length + filteredPoints.length + filteredCircles.length + filteredTexts.length + filteredArrows.length;
|
|
1734
1818
|
const isLimitReached = objectLimit && totalFilteredObjects > objectLimit;
|
|
1735
|
-
return /* @__PURE__ */
|
|
1736
|
-
showToolbar && /* @__PURE__ */
|
|
1737
|
-
availableLayers.length > 1 && /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1820
|
+
showToolbar && /* @__PURE__ */ jsxs8("div", { style: { margin: 8 }, children: [
|
|
1821
|
+
availableLayers.length > 1 && /* @__PURE__ */ jsxs8(
|
|
1738
1822
|
"select",
|
|
1739
1823
|
{
|
|
1740
1824
|
value: activeLayers ? activeLayers[0] : "",
|
|
@@ -1744,18 +1828,18 @@ var InteractiveGraphics = ({
|
|
|
1744
1828
|
},
|
|
1745
1829
|
style: { marginRight: 8 },
|
|
1746
1830
|
children: [
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
availableLayers.map((layer) => /* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsx13("option", { value: "", children: "All Layers" }),
|
|
1832
|
+
availableLayers.map((layer) => /* @__PURE__ */ jsx13("option", { value: layer, children: layer }, layer))
|
|
1749
1833
|
]
|
|
1750
1834
|
}
|
|
1751
1835
|
),
|
|
1752
|
-
maxStep > 0 && /* @__PURE__ */
|
|
1836
|
+
maxStep > 0 && /* @__PURE__ */ jsxs8(
|
|
1753
1837
|
"div",
|
|
1754
1838
|
{
|
|
1755
1839
|
style: { display: "inline-flex", alignItems: "center", gap: 8 },
|
|
1756
1840
|
children: [
|
|
1757
1841
|
"Step:",
|
|
1758
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx13(
|
|
1759
1843
|
"input",
|
|
1760
1844
|
{
|
|
1761
1845
|
type: "number",
|
|
@@ -1770,8 +1854,8 @@ var InteractiveGraphics = ({
|
|
|
1770
1854
|
disabled: activeStep === null
|
|
1771
1855
|
}
|
|
1772
1856
|
),
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
1858
|
+
/* @__PURE__ */ jsx13(
|
|
1775
1859
|
"input",
|
|
1776
1860
|
{
|
|
1777
1861
|
type: "checkbox",
|
|
@@ -1785,8 +1869,8 @@ var InteractiveGraphics = ({
|
|
|
1785
1869
|
),
|
|
1786
1870
|
"Filter by step"
|
|
1787
1871
|
] }),
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
1873
|
+
/* @__PURE__ */ jsx13(
|
|
1790
1874
|
"input",
|
|
1791
1875
|
{
|
|
1792
1876
|
type: "checkbox",
|
|
@@ -1800,7 +1884,7 @@ var InteractiveGraphics = ({
|
|
|
1800
1884
|
),
|
|
1801
1885
|
"Show last step"
|
|
1802
1886
|
] }),
|
|
1803
|
-
isLimitReached && /* @__PURE__ */
|
|
1887
|
+
isLimitReached && /* @__PURE__ */ jsxs8("span", { style: { color: "red", fontSize: "12px" }, children: [
|
|
1804
1888
|
"Display limited to ",
|
|
1805
1889
|
objectLimit,
|
|
1806
1890
|
" objects. Received:",
|
|
@@ -1812,7 +1896,7 @@ var InteractiveGraphics = ({
|
|
|
1812
1896
|
}
|
|
1813
1897
|
)
|
|
1814
1898
|
] }),
|
|
1815
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsxs8(
|
|
1816
1900
|
"div",
|
|
1817
1901
|
{
|
|
1818
1902
|
ref,
|
|
@@ -1823,8 +1907,8 @@ var InteractiveGraphics = ({
|
|
|
1823
1907
|
},
|
|
1824
1908
|
onContextMenu: handleContextMenu,
|
|
1825
1909
|
children: [
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
filteredArrows.map((arrow) => /* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsxs8(DimensionOverlay, { transform: realToScreen, children: [
|
|
1911
|
+
filteredArrows.map((arrow) => /* @__PURE__ */ jsx13(
|
|
1828
1912
|
Arrow,
|
|
1829
1913
|
{
|
|
1830
1914
|
arrow,
|
|
@@ -1833,7 +1917,17 @@ var InteractiveGraphics = ({
|
|
|
1833
1917
|
},
|
|
1834
1918
|
arrow.originalIndex
|
|
1835
1919
|
)),
|
|
1836
|
-
|
|
1920
|
+
filteredInfiniteLines.map((infiniteLine) => /* @__PURE__ */ jsx13(
|
|
1921
|
+
InfiniteLine,
|
|
1922
|
+
{
|
|
1923
|
+
infiniteLine,
|
|
1924
|
+
index: infiniteLine.originalIndex,
|
|
1925
|
+
interactiveState,
|
|
1926
|
+
size
|
|
1927
|
+
},
|
|
1928
|
+
infiniteLine.originalIndex
|
|
1929
|
+
)),
|
|
1930
|
+
filteredLines.map((line) => /* @__PURE__ */ jsx13(
|
|
1837
1931
|
Line,
|
|
1838
1932
|
{
|
|
1839
1933
|
line,
|
|
@@ -1842,7 +1936,7 @@ var InteractiveGraphics = ({
|
|
|
1842
1936
|
},
|
|
1843
1937
|
line.originalIndex
|
|
1844
1938
|
)),
|
|
1845
|
-
filteredRects.map((rect) => /* @__PURE__ */
|
|
1939
|
+
filteredRects.map((rect) => /* @__PURE__ */ jsx13(
|
|
1846
1940
|
Rect,
|
|
1847
1941
|
{
|
|
1848
1942
|
rect,
|
|
@@ -1851,7 +1945,7 @@ var InteractiveGraphics = ({
|
|
|
1851
1945
|
},
|
|
1852
1946
|
rect.originalIndex
|
|
1853
1947
|
)),
|
|
1854
|
-
filteredPolygons.map((polygon) => /* @__PURE__ */
|
|
1948
|
+
filteredPolygons.map((polygon) => /* @__PURE__ */ jsx13(
|
|
1855
1949
|
Polygon,
|
|
1856
1950
|
{
|
|
1857
1951
|
polygon,
|
|
@@ -1860,7 +1954,7 @@ var InteractiveGraphics = ({
|
|
|
1860
1954
|
},
|
|
1861
1955
|
polygon.originalIndex
|
|
1862
1956
|
)),
|
|
1863
|
-
filteredPoints.map((point) => /* @__PURE__ */
|
|
1957
|
+
filteredPoints.map((point) => /* @__PURE__ */ jsx13(
|
|
1864
1958
|
Point,
|
|
1865
1959
|
{
|
|
1866
1960
|
point,
|
|
@@ -1869,7 +1963,7 @@ var InteractiveGraphics = ({
|
|
|
1869
1963
|
},
|
|
1870
1964
|
point.originalIndex
|
|
1871
1965
|
)),
|
|
1872
|
-
filteredCircles.map((circle) => /* @__PURE__ */
|
|
1966
|
+
filteredCircles.map((circle) => /* @__PURE__ */ jsx13(
|
|
1873
1967
|
Circle,
|
|
1874
1968
|
{
|
|
1875
1969
|
circle,
|
|
@@ -1878,7 +1972,7 @@ var InteractiveGraphics = ({
|
|
|
1878
1972
|
},
|
|
1879
1973
|
circle.originalIndex
|
|
1880
1974
|
)),
|
|
1881
|
-
filteredTexts.map((txt) => /* @__PURE__ */
|
|
1975
|
+
filteredTexts.map((txt) => /* @__PURE__ */ jsx13(
|
|
1882
1976
|
Text,
|
|
1883
1977
|
{
|
|
1884
1978
|
textObj: txt,
|
|
@@ -1887,7 +1981,7 @@ var InteractiveGraphics = ({
|
|
|
1887
1981
|
},
|
|
1888
1982
|
txt.originalIndex
|
|
1889
1983
|
)),
|
|
1890
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx13(
|
|
1891
1985
|
SuperGrid,
|
|
1892
1986
|
{
|
|
1893
1987
|
stringifyCoord: (x, y) => `${x.toFixed(2)}, ${y.toFixed(2)}`,
|
|
@@ -1897,7 +1991,7 @@ var InteractiveGraphics = ({
|
|
|
1897
1991
|
}
|
|
1898
1992
|
)
|
|
1899
1993
|
] }),
|
|
1900
|
-
markers.map((marker, index) => /* @__PURE__ */
|
|
1994
|
+
markers.map((marker, index) => /* @__PURE__ */ jsx13(
|
|
1901
1995
|
Marker,
|
|
1902
1996
|
{
|
|
1903
1997
|
marker,
|
|
@@ -1906,7 +2000,7 @@ var InteractiveGraphics = ({
|
|
|
1906
2000
|
},
|
|
1907
2001
|
index
|
|
1908
2002
|
)),
|
|
1909
|
-
contextMenu && /* @__PURE__ */
|
|
2003
|
+
contextMenu && /* @__PURE__ */ jsx13(
|
|
1910
2004
|
ContextMenu,
|
|
1911
2005
|
{
|
|
1912
2006
|
x: contextMenu.x,
|
|
@@ -1949,6 +2043,9 @@ function getGraphicsFilteredByStep(graphics, {
|
|
|
1949
2043
|
lines: graphics.lines?.filter(
|
|
1950
2044
|
(l) => l.step === void 0 || l.step === selectedStep
|
|
1951
2045
|
),
|
|
2046
|
+
infiniteLines: graphics.infiniteLines?.filter(
|
|
2047
|
+
(l) => l.step === void 0 || l.step === selectedStep
|
|
2048
|
+
),
|
|
1952
2049
|
rects: graphics.rects?.filter(
|
|
1953
2050
|
(r) => r.step === void 0 || r.step === selectedStep
|
|
1954
2051
|
),
|
|
@@ -1979,7 +2076,7 @@ function getGraphicsBoundsWithPadding(graphics) {
|
|
|
1979
2076
|
}
|
|
1980
2077
|
|
|
1981
2078
|
// site/components/InteractiveGraphicsCanvas.tsx
|
|
1982
|
-
import { jsx as
|
|
2079
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1983
2080
|
function InteractiveGraphicsCanvas({
|
|
1984
2081
|
graphics,
|
|
1985
2082
|
showLabelsByDefault = true,
|
|
@@ -2087,11 +2184,11 @@ function InteractiveGraphicsCanvas({
|
|
|
2087
2184
|
useEffect4(() => {
|
|
2088
2185
|
drawCanvas();
|
|
2089
2186
|
}, [transform, size, filteredGraphics, showGrid, showLabels]);
|
|
2090
|
-
return /* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
|
|
2188
|
+
/* @__PURE__ */ jsxs9("div", { style: { display: "flex", gap: "12px", alignItems: "center" }, children: [
|
|
2189
|
+
/* @__PURE__ */ jsxs9("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2190
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
2191
|
+
/* @__PURE__ */ jsx14(
|
|
2095
2192
|
"input",
|
|
2096
2193
|
{
|
|
2097
2194
|
type: "checkbox",
|
|
@@ -2104,7 +2201,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2104
2201
|
),
|
|
2105
2202
|
"Filter by step"
|
|
2106
2203
|
] }),
|
|
2107
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx14(
|
|
2108
2205
|
"input",
|
|
2109
2206
|
{
|
|
2110
2207
|
type: "number",
|
|
@@ -2120,8 +2217,8 @@ function InteractiveGraphicsCanvas({
|
|
|
2120
2217
|
style: { width: "60px" }
|
|
2121
2218
|
}
|
|
2122
2219
|
),
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
2221
|
+
/* @__PURE__ */ jsx14(
|
|
2125
2222
|
"input",
|
|
2126
2223
|
{
|
|
2127
2224
|
type: "checkbox",
|
|
@@ -2136,8 +2233,8 @@ function InteractiveGraphicsCanvas({
|
|
|
2136
2233
|
"Show last step"
|
|
2137
2234
|
] })
|
|
2138
2235
|
] }),
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx14("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsxs9("label", { children: [
|
|
2237
|
+
/* @__PURE__ */ jsx14(
|
|
2141
2238
|
"input",
|
|
2142
2239
|
{
|
|
2143
2240
|
type: "checkbox",
|
|
@@ -2151,7 +2248,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2151
2248
|
"Show labels"
|
|
2152
2249
|
] }) })
|
|
2153
2250
|
] }),
|
|
2154
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsx14(
|
|
2155
2252
|
"div",
|
|
2156
2253
|
{
|
|
2157
2254
|
ref: (node) => {
|
|
@@ -2167,7 +2264,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2167
2264
|
border: "1px solid #ccc",
|
|
2168
2265
|
overflow: "hidden"
|
|
2169
2266
|
},
|
|
2170
|
-
children: /* @__PURE__ */
|
|
2267
|
+
children: /* @__PURE__ */ jsx14(
|
|
2171
2268
|
"canvas",
|
|
2172
2269
|
{
|
|
2173
2270
|
ref: canvasRef,
|
|
@@ -2190,7 +2287,7 @@ import React2, { useRef as useRef5, useEffect as useEffect5, useState as useStat
|
|
|
2190
2287
|
import useMouseMatrixTransform3 from "use-mouse-matrix-transform";
|
|
2191
2288
|
import { compose as compose3, scale as scale3, translate as translate3 } from "transformation-matrix";
|
|
2192
2289
|
import useResizeObserver3 from "@react-hook/resize-observer";
|
|
2193
|
-
import { jsx as
|
|
2290
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2194
2291
|
function TransformContainer({
|
|
2195
2292
|
initialTransform,
|
|
2196
2293
|
children,
|
|
@@ -2202,7 +2299,7 @@ function TransformContainer({
|
|
|
2202
2299
|
useEffect5(() => {
|
|
2203
2300
|
onTransformChange(transform);
|
|
2204
2301
|
}, [transform, onTransformChange]);
|
|
2205
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx15(
|
|
2206
2303
|
"div",
|
|
2207
2304
|
{
|
|
2208
2305
|
ref,
|
|
@@ -2338,7 +2435,7 @@ var CanvasGraphics = ({
|
|
|
2338
2435
|
useEffect5(() => {
|
|
2339
2436
|
setCurrentTransform(computedInitialTransform);
|
|
2340
2437
|
}, [computedInitialTransform]);
|
|
2341
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx15(
|
|
2342
2439
|
"div",
|
|
2343
2440
|
{
|
|
2344
2441
|
ref: containerRef,
|
|
@@ -2349,16 +2446,16 @@ var CanvasGraphics = ({
|
|
|
2349
2446
|
border: "1px solid #eee",
|
|
2350
2447
|
overflow: "hidden"
|
|
2351
2448
|
},
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ jsx15(
|
|
2353
2450
|
TransformContainer,
|
|
2354
2451
|
{
|
|
2355
2452
|
initialTransform: computedInitialTransform,
|
|
2356
2453
|
onTransformChange: handleTransformChange,
|
|
2357
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ jsx15(
|
|
2358
2455
|
DimensionOverlay,
|
|
2359
2456
|
{
|
|
2360
2457
|
transform: currentTransform || computedInitialTransform,
|
|
2361
|
-
children: /* @__PURE__ */
|
|
2458
|
+
children: /* @__PURE__ */ jsx15(
|
|
2362
2459
|
"canvas",
|
|
2363
2460
|
{
|
|
2364
2461
|
ref: canvasRef,
|