graphics-debug 0.0.83 → 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-PPB7D4OE.js → chunk-AKONCUCE.js} +47 -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-HU5LL4ZE.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-MXOATGTD.js → chunk-MYMDOAQN.js} +4 -4
- package/dist/{chunk-GZRUE2GP.js → chunk-OB4CGOL3.js} +6 -1
- package/dist/chunk-OB4CGOL3.js.map +1 -0
- package/dist/{chunk-7NMLOZRC.js → chunk-ZWAXHWX2.js} +56 -4
- 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 +8 -7
- 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 +194 -99
- 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 +18 -1
- package/package.json +1 -1
- package/dist/chunk-7NMLOZRC.js.map +0 -1
- package/dist/chunk-BQ3ZHEQO.js.map +0 -1
- package/dist/chunk-GZRUE2GP.js.map +0 -1
- package/dist/chunk-HU5LL4ZE.js.map +0 -1
- package/dist/chunk-NYENUFOW.js.map +0 -1
- package/dist/chunk-PPB7D4OE.js.map +0 -1
- /package/dist/{chunk-MXOATGTD.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-
|
|
5
|
-
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";
|
|
6
6
|
import {
|
|
7
7
|
defaultColors,
|
|
8
8
|
drawGraphicsToCanvas,
|
|
9
9
|
getBounds
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-AKONCUCE.js";
|
|
11
11
|
import "../chunk-NG6H63SM.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ZWAXHWX2.js";
|
|
13
13
|
import {
|
|
14
14
|
getArrowBoundingBox,
|
|
15
15
|
getArrowGeometry
|
|
16
16
|
} from "../chunk-IOVKI3ZO.js";
|
|
17
17
|
import "../chunk-ZGI74PYD.js";
|
|
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,8 +1122,8 @@ 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,
|
|
@@ -1056,7 +1133,7 @@ var 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);
|
|
@@ -1079,7 +1156,7 @@ var Polygon = ({
|
|
|
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;
|
|
1082
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ jsxs7(
|
|
1083
1160
|
"div",
|
|
1084
1161
|
{
|
|
1085
1162
|
style: {
|
|
@@ -1091,7 +1168,7 @@ var Polygon = ({
|
|
|
1091
1168
|
pointerEvents: "none"
|
|
1092
1169
|
},
|
|
1093
1170
|
children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsx10("svg", { width: svgWidth, height: svgHeight, style: { display: "block" }, children: /* @__PURE__ */ jsx10(
|
|
1095
1172
|
"polygon",
|
|
1096
1173
|
{
|
|
1097
1174
|
points: localPoints.map((p) => `${p.x},${p.y}`).join(" "),
|
|
@@ -1108,7 +1185,7 @@ var Polygon = ({
|
|
|
1108
1185
|
})
|
|
1109
1186
|
}
|
|
1110
1187
|
) }),
|
|
1111
|
-
isHovered && polygon.label && /* @__PURE__ */
|
|
1188
|
+
isHovered && polygon.label && /* @__PURE__ */ jsx10(
|
|
1112
1189
|
"div",
|
|
1113
1190
|
{
|
|
1114
1191
|
style: {
|
|
@@ -1119,7 +1196,7 @@ var Polygon = ({
|
|
|
1119
1196
|
marginBottom: 8,
|
|
1120
1197
|
pointerEvents: "none"
|
|
1121
1198
|
},
|
|
1122
|
-
children: /* @__PURE__ */
|
|
1199
|
+
children: /* @__PURE__ */ jsx10(Tooltip, { text: polygon.label })
|
|
1123
1200
|
}
|
|
1124
1201
|
)
|
|
1125
1202
|
]
|
|
@@ -1128,9 +1205,9 @@ var Polygon = ({
|
|
|
1128
1205
|
};
|
|
1129
1206
|
|
|
1130
1207
|
// site/components/InteractiveGraphics/Rect.tsx
|
|
1131
|
-
import { applyToPoint as
|
|
1208
|
+
import { applyToPoint as applyToPoint9 } from "transformation-matrix";
|
|
1132
1209
|
import { useState as useState7 } from "react";
|
|
1133
|
-
import { jsx as
|
|
1210
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1134
1211
|
var Rect = ({
|
|
1135
1212
|
rect,
|
|
1136
1213
|
interactiveState,
|
|
@@ -1140,7 +1217,7 @@ var Rect = ({
|
|
|
1140
1217
|
let { center, width, height, fill, stroke, layer, step } = rect;
|
|
1141
1218
|
const { activeLayers, activeStep, realToScreen, onObjectClicked } = interactiveState;
|
|
1142
1219
|
const [isHovered, setIsHovered] = useState7(false);
|
|
1143
|
-
const screenCenter =
|
|
1220
|
+
const screenCenter = applyToPoint9(realToScreen, center);
|
|
1144
1221
|
const screenWidth = width * realToScreen.a;
|
|
1145
1222
|
const screenHeight = height * Math.abs(realToScreen.d);
|
|
1146
1223
|
const hasStrokeOrFill = fill !== void 0 || stroke !== void 0;
|
|
@@ -1149,7 +1226,7 @@ var Rect = ({
|
|
|
1149
1226
|
backgroundColor = safeLighten(0.2, backgroundColor);
|
|
1150
1227
|
stroke = safeLighten(0.2, stroke);
|
|
1151
1228
|
}
|
|
1152
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsx11(
|
|
1153
1230
|
"div",
|
|
1154
1231
|
{
|
|
1155
1232
|
style: {
|
|
@@ -1170,7 +1247,7 @@ var Rect = ({
|
|
|
1170
1247
|
index,
|
|
1171
1248
|
object: rect
|
|
1172
1249
|
}),
|
|
1173
|
-
children: isHovered && rect.label && /* @__PURE__ */
|
|
1250
|
+
children: isHovered && rect.label && /* @__PURE__ */ jsx11(
|
|
1174
1251
|
"div",
|
|
1175
1252
|
{
|
|
1176
1253
|
style: {
|
|
@@ -1180,7 +1257,7 @@ var Rect = ({
|
|
|
1180
1257
|
transform: "translateX(-50%)",
|
|
1181
1258
|
marginBottom: 8
|
|
1182
1259
|
},
|
|
1183
|
-
children: /* @__PURE__ */
|
|
1260
|
+
children: /* @__PURE__ */ jsx11(Tooltip, { text: rect.label })
|
|
1184
1261
|
}
|
|
1185
1262
|
)
|
|
1186
1263
|
}
|
|
@@ -1188,8 +1265,8 @@ var Rect = ({
|
|
|
1188
1265
|
};
|
|
1189
1266
|
|
|
1190
1267
|
// site/components/InteractiveGraphics/Text.tsx
|
|
1191
|
-
import { applyToPoint as
|
|
1192
|
-
import { jsx as
|
|
1268
|
+
import { applyToPoint as applyToPoint10 } from "transformation-matrix";
|
|
1269
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1193
1270
|
var Text = ({
|
|
1194
1271
|
textObj,
|
|
1195
1272
|
interactiveState,
|
|
@@ -1197,7 +1274,7 @@ var Text = ({
|
|
|
1197
1274
|
}) => {
|
|
1198
1275
|
const { realToScreen, onObjectClicked } = interactiveState;
|
|
1199
1276
|
const { x, y, text, color, fontSize, anchorSide } = textObj;
|
|
1200
|
-
const screenPos =
|
|
1277
|
+
const screenPos = applyToPoint10(realToScreen, { x, y });
|
|
1201
1278
|
const transformMap = {
|
|
1202
1279
|
top_left: "translate(0%, 0%)",
|
|
1203
1280
|
top_center: "translate(-50%, 0%)",
|
|
@@ -1210,7 +1287,7 @@ var Text = ({
|
|
|
1210
1287
|
bottom_right: "translate(-100%, -100%)"
|
|
1211
1288
|
};
|
|
1212
1289
|
const transform = transformMap[anchorSide ?? "center"];
|
|
1213
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ jsx12(
|
|
1214
1291
|
"div",
|
|
1215
1292
|
{
|
|
1216
1293
|
style: {
|
|
@@ -1230,18 +1307,18 @@ var Text = ({
|
|
|
1230
1307
|
};
|
|
1231
1308
|
|
|
1232
1309
|
// site/components/InteractiveGraphics/hooks/useIsPointOnScreen.ts
|
|
1233
|
-
import { applyToPoint as
|
|
1310
|
+
import { applyToPoint as applyToPoint12 } from "transformation-matrix";
|
|
1234
1311
|
import { useMemo as useMemo4 } from "react";
|
|
1235
1312
|
|
|
1236
1313
|
// site/components/InteractiveGraphics/hooks/useDoesLineIntersectViewport.ts
|
|
1237
|
-
import { applyToPoint as
|
|
1314
|
+
import { applyToPoint as applyToPoint11 } from "transformation-matrix";
|
|
1238
1315
|
import { useMemo as useMemo3 } from "react";
|
|
1239
1316
|
var OFFSCREEN_MARGIN = 5;
|
|
1240
1317
|
var useDoesLineIntersectViewport = (realToScreen, size) => {
|
|
1241
1318
|
return useMemo3(() => {
|
|
1242
1319
|
return (p1, p2) => {
|
|
1243
|
-
const sp1 =
|
|
1244
|
-
const sp2 =
|
|
1320
|
+
const sp1 = applyToPoint11(realToScreen, p1);
|
|
1321
|
+
const sp2 = applyToPoint11(realToScreen, p2);
|
|
1245
1322
|
const left = -OFFSCREEN_MARGIN;
|
|
1246
1323
|
const right = size.width + OFFSCREEN_MARGIN;
|
|
1247
1324
|
const top = -OFFSCREEN_MARGIN;
|
|
@@ -1271,7 +1348,7 @@ var useDoesLineIntersectViewport = (realToScreen, size) => {
|
|
|
1271
1348
|
var useIsPointOnScreen = (realToScreen, size) => {
|
|
1272
1349
|
return useMemo4(() => {
|
|
1273
1350
|
return (point) => {
|
|
1274
|
-
const screenPoint =
|
|
1351
|
+
const screenPoint = applyToPoint12(realToScreen, point);
|
|
1275
1352
|
return screenPoint.x >= -OFFSCREEN_MARGIN && screenPoint.x <= size.width + OFFSCREEN_MARGIN && screenPoint.y >= -OFFSCREEN_MARGIN && screenPoint.y <= size.height + OFFSCREEN_MARGIN;
|
|
1276
1353
|
};
|
|
1277
1354
|
}, [realToScreen, size]);
|
|
@@ -1349,7 +1426,7 @@ var useFilterRects = ({
|
|
|
1349
1426
|
|
|
1350
1427
|
// site/components/InteractiveGraphics/hooks/useFilterCircles.ts
|
|
1351
1428
|
import { useMemo as useMemo8 } from "react";
|
|
1352
|
-
import { applyToPoint as
|
|
1429
|
+
import { applyToPoint as applyToPoint13 } from "transformation-matrix";
|
|
1353
1430
|
var useFilterCircles = ({
|
|
1354
1431
|
isPointOnScreen,
|
|
1355
1432
|
filterLayerAndStep,
|
|
@@ -1363,7 +1440,7 @@ var useFilterCircles = ({
|
|
|
1363
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 })) {
|
|
1364
1441
|
return true;
|
|
1365
1442
|
}
|
|
1366
|
-
const screenCenter =
|
|
1443
|
+
const screenCenter = applyToPoint13(realToScreen, center);
|
|
1367
1444
|
const scale4 = Math.abs(realToScreen.a);
|
|
1368
1445
|
const screenRadius = radius * scale4;
|
|
1369
1446
|
const left = -OFFSCREEN_MARGIN;
|
|
@@ -1459,7 +1536,7 @@ var useFilterPolygons = ({
|
|
|
1459
1536
|
};
|
|
1460
1537
|
|
|
1461
1538
|
// site/components/InteractiveGraphics/InteractiveGraphics.tsx
|
|
1462
|
-
import { jsx as
|
|
1539
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1463
1540
|
var InteractiveGraphics = ({
|
|
1464
1541
|
graphics,
|
|
1465
1542
|
onObjectClicked,
|
|
@@ -1475,6 +1552,7 @@ var InteractiveGraphics = ({
|
|
|
1475
1552
|
const availableLayers = Array.from(
|
|
1476
1553
|
/* @__PURE__ */ new Set([
|
|
1477
1554
|
...graphics.lines?.map((l) => l.layer).filter(Boolean) ?? [],
|
|
1555
|
+
...graphics.infiniteLines?.map((l) => l.layer).filter(Boolean) ?? [],
|
|
1478
1556
|
...graphics.rects?.map((r) => r.layer).filter(Boolean) ?? [],
|
|
1479
1557
|
...graphics.polygons?.map((p) => p.layer).filter(Boolean) ?? [],
|
|
1480
1558
|
...graphics.points?.map((p) => p.layer).filter(Boolean) ?? [],
|
|
@@ -1623,7 +1701,7 @@ var InteractiveGraphics = ({
|
|
|
1623
1701
|
const screenX = screenPoint.x - rect.left;
|
|
1624
1702
|
const screenY = screenPoint.y - rect.top;
|
|
1625
1703
|
const inverseTransform = inverse2(realToScreen);
|
|
1626
|
-
const [realX, realY] =
|
|
1704
|
+
const [realX, realY] = applyToPoint14(inverseTransform, [
|
|
1627
1705
|
screenX,
|
|
1628
1706
|
screenY
|
|
1629
1707
|
]);
|
|
@@ -1708,6 +1786,10 @@ var InteractiveGraphics = ({
|
|
|
1708
1786
|
() => filterAndLimit(graphics.lines, filterLines),
|
|
1709
1787
|
[graphics.lines, filterLines, objectLimit]
|
|
1710
1788
|
);
|
|
1789
|
+
const filteredInfiniteLines = useMemo12(
|
|
1790
|
+
() => filterAndLimit(graphics.infiniteLines, filterLayerAndStep),
|
|
1791
|
+
[graphics.infiniteLines, filterLayerAndStep, objectLimit]
|
|
1792
|
+
);
|
|
1711
1793
|
const filteredRects = useMemo12(
|
|
1712
1794
|
() => sortRectsByArea(filterAndLimit(graphics.rects, filterRects)),
|
|
1713
1795
|
[graphics.rects, filterRects, objectLimit]
|
|
@@ -1732,11 +1814,11 @@ var InteractiveGraphics = ({
|
|
|
1732
1814
|
() => filterAndLimit(graphics.arrows, filterArrows),
|
|
1733
1815
|
[graphics.arrows, filterArrows, objectLimit]
|
|
1734
1816
|
);
|
|
1735
|
-
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;
|
|
1736
1818
|
const isLimitReached = objectLimit && totalFilteredObjects > objectLimit;
|
|
1737
|
-
return /* @__PURE__ */
|
|
1738
|
-
showToolbar && /* @__PURE__ */
|
|
1739
|
-
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(
|
|
1740
1822
|
"select",
|
|
1741
1823
|
{
|
|
1742
1824
|
value: activeLayers ? activeLayers[0] : "",
|
|
@@ -1746,18 +1828,18 @@ var InteractiveGraphics = ({
|
|
|
1746
1828
|
},
|
|
1747
1829
|
style: { marginRight: 8 },
|
|
1748
1830
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
availableLayers.map((layer) => /* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsx13("option", { value: "", children: "All Layers" }),
|
|
1832
|
+
availableLayers.map((layer) => /* @__PURE__ */ jsx13("option", { value: layer, children: layer }, layer))
|
|
1751
1833
|
]
|
|
1752
1834
|
}
|
|
1753
1835
|
),
|
|
1754
|
-
maxStep > 0 && /* @__PURE__ */
|
|
1836
|
+
maxStep > 0 && /* @__PURE__ */ jsxs8(
|
|
1755
1837
|
"div",
|
|
1756
1838
|
{
|
|
1757
1839
|
style: { display: "inline-flex", alignItems: "center", gap: 8 },
|
|
1758
1840
|
children: [
|
|
1759
1841
|
"Step:",
|
|
1760
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx13(
|
|
1761
1843
|
"input",
|
|
1762
1844
|
{
|
|
1763
1845
|
type: "number",
|
|
@@ -1772,8 +1854,8 @@ var InteractiveGraphics = ({
|
|
|
1772
1854
|
disabled: activeStep === null
|
|
1773
1855
|
}
|
|
1774
1856
|
),
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
1858
|
+
/* @__PURE__ */ jsx13(
|
|
1777
1859
|
"input",
|
|
1778
1860
|
{
|
|
1779
1861
|
type: "checkbox",
|
|
@@ -1787,8 +1869,8 @@ var InteractiveGraphics = ({
|
|
|
1787
1869
|
),
|
|
1788
1870
|
"Filter by step"
|
|
1789
1871
|
] }),
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
1873
|
+
/* @__PURE__ */ jsx13(
|
|
1792
1874
|
"input",
|
|
1793
1875
|
{
|
|
1794
1876
|
type: "checkbox",
|
|
@@ -1802,7 +1884,7 @@ var InteractiveGraphics = ({
|
|
|
1802
1884
|
),
|
|
1803
1885
|
"Show last step"
|
|
1804
1886
|
] }),
|
|
1805
|
-
isLimitReached && /* @__PURE__ */
|
|
1887
|
+
isLimitReached && /* @__PURE__ */ jsxs8("span", { style: { color: "red", fontSize: "12px" }, children: [
|
|
1806
1888
|
"Display limited to ",
|
|
1807
1889
|
objectLimit,
|
|
1808
1890
|
" objects. Received:",
|
|
@@ -1814,7 +1896,7 @@ var InteractiveGraphics = ({
|
|
|
1814
1896
|
}
|
|
1815
1897
|
)
|
|
1816
1898
|
] }),
|
|
1817
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsxs8(
|
|
1818
1900
|
"div",
|
|
1819
1901
|
{
|
|
1820
1902
|
ref,
|
|
@@ -1825,8 +1907,8 @@ var InteractiveGraphics = ({
|
|
|
1825
1907
|
},
|
|
1826
1908
|
onContextMenu: handleContextMenu,
|
|
1827
1909
|
children: [
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
filteredArrows.map((arrow) => /* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsxs8(DimensionOverlay, { transform: realToScreen, children: [
|
|
1911
|
+
filteredArrows.map((arrow) => /* @__PURE__ */ jsx13(
|
|
1830
1912
|
Arrow,
|
|
1831
1913
|
{
|
|
1832
1914
|
arrow,
|
|
@@ -1835,7 +1917,17 @@ var InteractiveGraphics = ({
|
|
|
1835
1917
|
},
|
|
1836
1918
|
arrow.originalIndex
|
|
1837
1919
|
)),
|
|
1838
|
-
|
|
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(
|
|
1839
1931
|
Line,
|
|
1840
1932
|
{
|
|
1841
1933
|
line,
|
|
@@ -1844,7 +1936,7 @@ var InteractiveGraphics = ({
|
|
|
1844
1936
|
},
|
|
1845
1937
|
line.originalIndex
|
|
1846
1938
|
)),
|
|
1847
|
-
filteredRects.map((rect) => /* @__PURE__ */
|
|
1939
|
+
filteredRects.map((rect) => /* @__PURE__ */ jsx13(
|
|
1848
1940
|
Rect,
|
|
1849
1941
|
{
|
|
1850
1942
|
rect,
|
|
@@ -1853,7 +1945,7 @@ var InteractiveGraphics = ({
|
|
|
1853
1945
|
},
|
|
1854
1946
|
rect.originalIndex
|
|
1855
1947
|
)),
|
|
1856
|
-
filteredPolygons.map((polygon) => /* @__PURE__ */
|
|
1948
|
+
filteredPolygons.map((polygon) => /* @__PURE__ */ jsx13(
|
|
1857
1949
|
Polygon,
|
|
1858
1950
|
{
|
|
1859
1951
|
polygon,
|
|
@@ -1862,7 +1954,7 @@ var InteractiveGraphics = ({
|
|
|
1862
1954
|
},
|
|
1863
1955
|
polygon.originalIndex
|
|
1864
1956
|
)),
|
|
1865
|
-
filteredPoints.map((point) => /* @__PURE__ */
|
|
1957
|
+
filteredPoints.map((point) => /* @__PURE__ */ jsx13(
|
|
1866
1958
|
Point,
|
|
1867
1959
|
{
|
|
1868
1960
|
point,
|
|
@@ -1871,7 +1963,7 @@ var InteractiveGraphics = ({
|
|
|
1871
1963
|
},
|
|
1872
1964
|
point.originalIndex
|
|
1873
1965
|
)),
|
|
1874
|
-
filteredCircles.map((circle) => /* @__PURE__ */
|
|
1966
|
+
filteredCircles.map((circle) => /* @__PURE__ */ jsx13(
|
|
1875
1967
|
Circle,
|
|
1876
1968
|
{
|
|
1877
1969
|
circle,
|
|
@@ -1880,7 +1972,7 @@ var InteractiveGraphics = ({
|
|
|
1880
1972
|
},
|
|
1881
1973
|
circle.originalIndex
|
|
1882
1974
|
)),
|
|
1883
|
-
filteredTexts.map((txt) => /* @__PURE__ */
|
|
1975
|
+
filteredTexts.map((txt) => /* @__PURE__ */ jsx13(
|
|
1884
1976
|
Text,
|
|
1885
1977
|
{
|
|
1886
1978
|
textObj: txt,
|
|
@@ -1889,7 +1981,7 @@ var InteractiveGraphics = ({
|
|
|
1889
1981
|
},
|
|
1890
1982
|
txt.originalIndex
|
|
1891
1983
|
)),
|
|
1892
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx13(
|
|
1893
1985
|
SuperGrid,
|
|
1894
1986
|
{
|
|
1895
1987
|
stringifyCoord: (x, y) => `${x.toFixed(2)}, ${y.toFixed(2)}`,
|
|
@@ -1899,7 +1991,7 @@ var InteractiveGraphics = ({
|
|
|
1899
1991
|
}
|
|
1900
1992
|
)
|
|
1901
1993
|
] }),
|
|
1902
|
-
markers.map((marker, index) => /* @__PURE__ */
|
|
1994
|
+
markers.map((marker, index) => /* @__PURE__ */ jsx13(
|
|
1903
1995
|
Marker,
|
|
1904
1996
|
{
|
|
1905
1997
|
marker,
|
|
@@ -1908,7 +2000,7 @@ var InteractiveGraphics = ({
|
|
|
1908
2000
|
},
|
|
1909
2001
|
index
|
|
1910
2002
|
)),
|
|
1911
|
-
contextMenu && /* @__PURE__ */
|
|
2003
|
+
contextMenu && /* @__PURE__ */ jsx13(
|
|
1912
2004
|
ContextMenu,
|
|
1913
2005
|
{
|
|
1914
2006
|
x: contextMenu.x,
|
|
@@ -1951,6 +2043,9 @@ function getGraphicsFilteredByStep(graphics, {
|
|
|
1951
2043
|
lines: graphics.lines?.filter(
|
|
1952
2044
|
(l) => l.step === void 0 || l.step === selectedStep
|
|
1953
2045
|
),
|
|
2046
|
+
infiniteLines: graphics.infiniteLines?.filter(
|
|
2047
|
+
(l) => l.step === void 0 || l.step === selectedStep
|
|
2048
|
+
),
|
|
1954
2049
|
rects: graphics.rects?.filter(
|
|
1955
2050
|
(r) => r.step === void 0 || r.step === selectedStep
|
|
1956
2051
|
),
|
|
@@ -1981,7 +2076,7 @@ function getGraphicsBoundsWithPadding(graphics) {
|
|
|
1981
2076
|
}
|
|
1982
2077
|
|
|
1983
2078
|
// site/components/InteractiveGraphicsCanvas.tsx
|
|
1984
|
-
import { jsx as
|
|
2079
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1985
2080
|
function InteractiveGraphicsCanvas({
|
|
1986
2081
|
graphics,
|
|
1987
2082
|
showLabelsByDefault = true,
|
|
@@ -2089,11 +2184,11 @@ function InteractiveGraphicsCanvas({
|
|
|
2089
2184
|
useEffect4(() => {
|
|
2090
2185
|
drawCanvas();
|
|
2091
2186
|
}, [transform, size, filteredGraphics, showGrid, showLabels]);
|
|
2092
|
-
return /* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
/* @__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(
|
|
2097
2192
|
"input",
|
|
2098
2193
|
{
|
|
2099
2194
|
type: "checkbox",
|
|
@@ -2106,7 +2201,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2106
2201
|
),
|
|
2107
2202
|
"Filter by step"
|
|
2108
2203
|
] }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx14(
|
|
2110
2205
|
"input",
|
|
2111
2206
|
{
|
|
2112
2207
|
type: "number",
|
|
@@ -2122,8 +2217,8 @@ function InteractiveGraphicsCanvas({
|
|
|
2122
2217
|
style: { width: "60px" }
|
|
2123
2218
|
}
|
|
2124
2219
|
),
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
2221
|
+
/* @__PURE__ */ jsx14(
|
|
2127
2222
|
"input",
|
|
2128
2223
|
{
|
|
2129
2224
|
type: "checkbox",
|
|
@@ -2138,8 +2233,8 @@ function InteractiveGraphicsCanvas({
|
|
|
2138
2233
|
"Show last step"
|
|
2139
2234
|
] })
|
|
2140
2235
|
] }),
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx14("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsxs9("label", { children: [
|
|
2237
|
+
/* @__PURE__ */ jsx14(
|
|
2143
2238
|
"input",
|
|
2144
2239
|
{
|
|
2145
2240
|
type: "checkbox",
|
|
@@ -2153,7 +2248,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2153
2248
|
"Show labels"
|
|
2154
2249
|
] }) })
|
|
2155
2250
|
] }),
|
|
2156
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsx14(
|
|
2157
2252
|
"div",
|
|
2158
2253
|
{
|
|
2159
2254
|
ref: (node) => {
|
|
@@ -2169,7 +2264,7 @@ function InteractiveGraphicsCanvas({
|
|
|
2169
2264
|
border: "1px solid #ccc",
|
|
2170
2265
|
overflow: "hidden"
|
|
2171
2266
|
},
|
|
2172
|
-
children: /* @__PURE__ */
|
|
2267
|
+
children: /* @__PURE__ */ jsx14(
|
|
2173
2268
|
"canvas",
|
|
2174
2269
|
{
|
|
2175
2270
|
ref: canvasRef,
|
|
@@ -2192,7 +2287,7 @@ import React2, { useRef as useRef5, useEffect as useEffect5, useState as useStat
|
|
|
2192
2287
|
import useMouseMatrixTransform3 from "use-mouse-matrix-transform";
|
|
2193
2288
|
import { compose as compose3, scale as scale3, translate as translate3 } from "transformation-matrix";
|
|
2194
2289
|
import useResizeObserver3 from "@react-hook/resize-observer";
|
|
2195
|
-
import { jsx as
|
|
2290
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2196
2291
|
function TransformContainer({
|
|
2197
2292
|
initialTransform,
|
|
2198
2293
|
children,
|
|
@@ -2204,7 +2299,7 @@ function TransformContainer({
|
|
|
2204
2299
|
useEffect5(() => {
|
|
2205
2300
|
onTransformChange(transform);
|
|
2206
2301
|
}, [transform, onTransformChange]);
|
|
2207
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx15(
|
|
2208
2303
|
"div",
|
|
2209
2304
|
{
|
|
2210
2305
|
ref,
|
|
@@ -2340,7 +2435,7 @@ var CanvasGraphics = ({
|
|
|
2340
2435
|
useEffect5(() => {
|
|
2341
2436
|
setCurrentTransform(computedInitialTransform);
|
|
2342
2437
|
}, [computedInitialTransform]);
|
|
2343
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx15(
|
|
2344
2439
|
"div",
|
|
2345
2440
|
{
|
|
2346
2441
|
ref: containerRef,
|
|
@@ -2351,16 +2446,16 @@ var CanvasGraphics = ({
|
|
|
2351
2446
|
border: "1px solid #eee",
|
|
2352
2447
|
overflow: "hidden"
|
|
2353
2448
|
},
|
|
2354
|
-
children: /* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ jsx15(
|
|
2355
2450
|
TransformContainer,
|
|
2356
2451
|
{
|
|
2357
2452
|
initialTransform: computedInitialTransform,
|
|
2358
2453
|
onTransformChange: handleTransformChange,
|
|
2359
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ jsx15(
|
|
2360
2455
|
DimensionOverlay,
|
|
2361
2456
|
{
|
|
2362
2457
|
transform: currentTransform || computedInitialTransform,
|
|
2363
|
-
children: /* @__PURE__ */
|
|
2458
|
+
children: /* @__PURE__ */ jsx15(
|
|
2364
2459
|
"canvas",
|
|
2365
2460
|
{
|
|
2366
2461
|
ref: canvasRef,
|