@tscircuit/3d-viewer 0.0.442 → 0.0.444
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/index.js +549 -275
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1073,13 +1073,13 @@ var require_rotateZ = __commonJS({
|
|
|
1073
1073
|
var require_scale = __commonJS({
|
|
1074
1074
|
"node_modules/@jscad/modeling/src/maths/vec3/scale.js"(exports, module) {
|
|
1075
1075
|
"use strict";
|
|
1076
|
-
var
|
|
1076
|
+
var scale3 = (out, vector, amount) => {
|
|
1077
1077
|
out[0] = vector[0] * amount;
|
|
1078
1078
|
out[1] = vector[1] * amount;
|
|
1079
1079
|
out[2] = vector[2] * amount;
|
|
1080
1080
|
return out;
|
|
1081
1081
|
};
|
|
1082
|
-
module.exports =
|
|
1082
|
+
module.exports = scale3;
|
|
1083
1083
|
}
|
|
1084
1084
|
});
|
|
1085
1085
|
|
|
@@ -1646,7 +1646,7 @@ var require_rotateZ2 = __commonJS({
|
|
|
1646
1646
|
var require_scale2 = __commonJS({
|
|
1647
1647
|
"node_modules/@jscad/modeling/src/maths/mat4/scale.js"(exports, module) {
|
|
1648
1648
|
"use strict";
|
|
1649
|
-
var
|
|
1649
|
+
var scale3 = (out, matrix, dimensions) => {
|
|
1650
1650
|
const x = dimensions[0];
|
|
1651
1651
|
const y = dimensions[1];
|
|
1652
1652
|
const z135 = dimensions[2];
|
|
@@ -1668,7 +1668,7 @@ var require_scale2 = __commonJS({
|
|
|
1668
1668
|
out[15] = matrix[15];
|
|
1669
1669
|
return out;
|
|
1670
1670
|
};
|
|
1671
|
-
module.exports =
|
|
1671
|
+
module.exports = scale3;
|
|
1672
1672
|
}
|
|
1673
1673
|
});
|
|
1674
1674
|
|
|
@@ -2153,12 +2153,12 @@ var require_normalize2 = __commonJS({
|
|
|
2153
2153
|
var require_scale3 = __commonJS({
|
|
2154
2154
|
"node_modules/@jscad/modeling/src/maths/vec2/scale.js"(exports, module) {
|
|
2155
2155
|
"use strict";
|
|
2156
|
-
var
|
|
2156
|
+
var scale3 = (out, vector, amount) => {
|
|
2157
2157
|
out[0] = vector[0] * amount;
|
|
2158
2158
|
out[1] = vector[1] * amount;
|
|
2159
2159
|
return out;
|
|
2160
2160
|
};
|
|
2161
|
-
module.exports =
|
|
2161
|
+
module.exports = scale3;
|
|
2162
2162
|
}
|
|
2163
2163
|
});
|
|
2164
2164
|
|
|
@@ -2914,7 +2914,7 @@ var require_Face = __commonJS({
|
|
|
2914
2914
|
var dot = require_dot();
|
|
2915
2915
|
var length2 = require_length();
|
|
2916
2916
|
var normalize = require_normalize();
|
|
2917
|
-
var
|
|
2917
|
+
var scale3 = require_scale();
|
|
2918
2918
|
var subtract6 = require_subtract();
|
|
2919
2919
|
var HalfEdge = require_HalfEdge();
|
|
2920
2920
|
var VISIBLE = 0;
|
|
@@ -2962,7 +2962,7 @@ var require_Face = __commonJS({
|
|
|
2962
2962
|
this.nVertices += 1;
|
|
2963
2963
|
}
|
|
2964
2964
|
this.area = length2(this.normal);
|
|
2965
|
-
this.normal =
|
|
2965
|
+
this.normal = scale3(this.normal, this.normal, 1 / this.area);
|
|
2966
2966
|
}
|
|
2967
2967
|
computeNormalMinArea(minArea) {
|
|
2968
2968
|
this.computeNormal();
|
|
@@ -2982,9 +2982,9 @@ var require_Face = __commonJS({
|
|
|
2982
2982
|
const p2 = maxEdge.head().point;
|
|
2983
2983
|
const maxVector = subtract6([], p2, p1);
|
|
2984
2984
|
const maxLength = Math.sqrt(maxSquaredLength);
|
|
2985
|
-
|
|
2985
|
+
scale3(maxVector, maxVector, 1 / maxLength);
|
|
2986
2986
|
const maxProjection = dot(this.normal, maxVector);
|
|
2987
|
-
|
|
2987
|
+
scale3(maxVector, maxVector, -maxProjection);
|
|
2988
2988
|
add(this.normal, this.normal, maxVector);
|
|
2989
2989
|
normalize(this.normal, this.normal);
|
|
2990
2990
|
}
|
|
@@ -2996,7 +2996,7 @@ var require_Face = __commonJS({
|
|
|
2996
2996
|
add(this.centroid, this.centroid, edge.head().point);
|
|
2997
2997
|
edge = edge.next;
|
|
2998
2998
|
} while (edge !== this.edge);
|
|
2999
|
-
|
|
2999
|
+
scale3(this.centroid, this.centroid, 1 / this.nVertices);
|
|
3000
3000
|
}
|
|
3001
3001
|
computeNormalAndCentroid(minArea) {
|
|
3002
3002
|
if (typeof minArea !== "undefined") {
|
|
@@ -13656,7 +13656,7 @@ var require_scale4 = __commonJS({
|
|
|
13656
13656
|
var geom2 = require_geom2();
|
|
13657
13657
|
var geom3 = require_geom3();
|
|
13658
13658
|
var path2 = require_path2();
|
|
13659
|
-
var
|
|
13659
|
+
var scale3 = (factors, ...objects) => {
|
|
13660
13660
|
if (!Array.isArray(factors)) throw new Error("factors must be an array");
|
|
13661
13661
|
objects = flatten(objects);
|
|
13662
13662
|
if (objects.length === 0) throw new Error("wrong number of arguments");
|
|
@@ -13672,11 +13672,11 @@ var require_scale4 = __commonJS({
|
|
|
13672
13672
|
});
|
|
13673
13673
|
return results.length === 1 ? results[0] : results;
|
|
13674
13674
|
};
|
|
13675
|
-
var scaleX = (factor, ...objects) =>
|
|
13676
|
-
var scaleY = (factor, ...objects) =>
|
|
13677
|
-
var scaleZ = (factor, ...objects) =>
|
|
13675
|
+
var scaleX = (factor, ...objects) => scale3([factor, 1, 1], objects);
|
|
13676
|
+
var scaleY = (factor, ...objects) => scale3([1, factor, 1], objects);
|
|
13677
|
+
var scaleZ = (factor, ...objects) => scale3([1, 1, factor], objects);
|
|
13678
13678
|
module.exports = {
|
|
13679
|
-
scale:
|
|
13679
|
+
scale: scale3,
|
|
13680
13680
|
scaleX,
|
|
13681
13681
|
scaleY,
|
|
13682
13682
|
scaleZ
|
|
@@ -14530,7 +14530,7 @@ function MixedStlModel({
|
|
|
14530
14530
|
onHover,
|
|
14531
14531
|
onUnhover,
|
|
14532
14532
|
isHovered,
|
|
14533
|
-
scale:
|
|
14533
|
+
scale: scale3
|
|
14534
14534
|
}) {
|
|
14535
14535
|
const obj = useGlobalObjLoader(url);
|
|
14536
14536
|
const { rootObject } = useThree();
|
|
@@ -14570,8 +14570,8 @@ function MixedStlModel({
|
|
|
14570
14570
|
model.rotation.copy(rotation2);
|
|
14571
14571
|
}
|
|
14572
14572
|
}
|
|
14573
|
-
if (
|
|
14574
|
-
model.scale.setScalar(
|
|
14573
|
+
if (scale3 !== void 0) {
|
|
14574
|
+
model.scale.setScalar(scale3);
|
|
14575
14575
|
}
|
|
14576
14576
|
}, [
|
|
14577
14577
|
model,
|
|
@@ -14581,7 +14581,7 @@ function MixedStlModel({
|
|
|
14581
14581
|
Array.isArray(rotation2) ? rotation2[0] : rotation2?.x,
|
|
14582
14582
|
Array.isArray(rotation2) ? rotation2[1] : rotation2?.y,
|
|
14583
14583
|
Array.isArray(rotation2) ? rotation2[2] : rotation2?.z,
|
|
14584
|
-
|
|
14584
|
+
scale3
|
|
14585
14585
|
]);
|
|
14586
14586
|
if (obj instanceof Error) {
|
|
14587
14587
|
throw obj;
|
|
@@ -14639,7 +14639,7 @@ function GltfModel({
|
|
|
14639
14639
|
onHover,
|
|
14640
14640
|
onUnhover,
|
|
14641
14641
|
isHovered,
|
|
14642
|
-
scale:
|
|
14642
|
+
scale: scale3
|
|
14643
14643
|
}) {
|
|
14644
14644
|
const { renderer, rootObject } = useThree();
|
|
14645
14645
|
const [model, setModel] = useState3(null);
|
|
@@ -14666,7 +14666,7 @@ function GltfModel({
|
|
|
14666
14666
|
if (!model) return;
|
|
14667
14667
|
if (position) model.position.fromArray(position);
|
|
14668
14668
|
if (rotation2) model.rotation.fromArray(rotation2);
|
|
14669
|
-
if (
|
|
14669
|
+
if (scale3 !== void 0) model.scale.setScalar(scale3);
|
|
14670
14670
|
}, [
|
|
14671
14671
|
model,
|
|
14672
14672
|
position?.[0],
|
|
@@ -14675,7 +14675,7 @@ function GltfModel({
|
|
|
14675
14675
|
rotation2?.[0],
|
|
14676
14676
|
rotation2?.[1],
|
|
14677
14677
|
rotation2?.[2],
|
|
14678
|
-
|
|
14678
|
+
scale3
|
|
14679
14679
|
]);
|
|
14680
14680
|
useEffect5(() => {
|
|
14681
14681
|
if (!rootObject || !model) return;
|
|
@@ -24828,9 +24828,9 @@ function getExpandedStroke(strokeInput, width10) {
|
|
|
24828
24828
|
addPoint(current2, normalPrev, -1);
|
|
24829
24829
|
addPoint(current2, normalNext, -1);
|
|
24830
24830
|
} else {
|
|
24831
|
-
const
|
|
24832
|
-
addPoint(current2, { x: miterX *
|
|
24833
|
-
addPoint(current2, { x: miterX *
|
|
24831
|
+
const scale3 = 1 / miterLength;
|
|
24832
|
+
addPoint(current2, { x: miterX * scale3, y: miterY * scale3 }, 1);
|
|
24833
|
+
addPoint(current2, { x: miterX * scale3, y: miterY * scale3 }, -1);
|
|
24834
24834
|
}
|
|
24835
24835
|
}
|
|
24836
24836
|
const lastNormal = getNormal(
|
|
@@ -27905,7 +27905,7 @@ var JscadModel = ({
|
|
|
27905
27905
|
onHover,
|
|
27906
27906
|
onUnhover,
|
|
27907
27907
|
isHovered,
|
|
27908
|
-
scale:
|
|
27908
|
+
scale: scale3
|
|
27909
27909
|
}) => {
|
|
27910
27910
|
const { rootObject } = useThree();
|
|
27911
27911
|
const { threeGeom, material } = useMemo4(() => {
|
|
@@ -27936,7 +27936,7 @@ var JscadModel = ({
|
|
|
27936
27936
|
if (!mesh) return;
|
|
27937
27937
|
if (positionOffset) mesh.position.fromArray(positionOffset);
|
|
27938
27938
|
if (rotationOffset) mesh.rotation.fromArray(rotationOffset);
|
|
27939
|
-
if (
|
|
27939
|
+
if (scale3 !== void 0) mesh.scale.setScalar(scale3);
|
|
27940
27940
|
}, [
|
|
27941
27941
|
mesh,
|
|
27942
27942
|
positionOffset?.[0],
|
|
@@ -27945,7 +27945,7 @@ var JscadModel = ({
|
|
|
27945
27945
|
rotationOffset?.[0],
|
|
27946
27946
|
rotationOffset?.[1],
|
|
27947
27947
|
rotationOffset?.[2],
|
|
27948
|
-
|
|
27948
|
+
scale3
|
|
27949
27949
|
]);
|
|
27950
27950
|
useMemo4(() => {
|
|
27951
27951
|
if (!material) return;
|
|
@@ -27982,7 +27982,7 @@ var FootprinterModel = ({
|
|
|
27982
27982
|
onHover,
|
|
27983
27983
|
onUnhover,
|
|
27984
27984
|
isHovered,
|
|
27985
|
-
scale:
|
|
27985
|
+
scale: scale3
|
|
27986
27986
|
}) => {
|
|
27987
27987
|
const { rootObject } = useThree();
|
|
27988
27988
|
const group = useMemo5(() => {
|
|
@@ -28018,7 +28018,7 @@ var FootprinterModel = ({
|
|
|
28018
28018
|
if (!group) return;
|
|
28019
28019
|
if (positionOffset) group.position.fromArray(positionOffset);
|
|
28020
28020
|
if (rotationOffset) group.rotation.fromArray(rotationOffset);
|
|
28021
|
-
if (
|
|
28021
|
+
if (scale3 !== void 0) group.scale.setScalar(scale3);
|
|
28022
28022
|
}, [
|
|
28023
28023
|
group,
|
|
28024
28024
|
positionOffset?.[0],
|
|
@@ -28027,7 +28027,7 @@ var FootprinterModel = ({
|
|
|
28027
28027
|
rotationOffset?.[0],
|
|
28028
28028
|
rotationOffset?.[1],
|
|
28029
28029
|
rotationOffset?.[2],
|
|
28030
|
-
|
|
28030
|
+
scale3
|
|
28031
28031
|
]);
|
|
28032
28032
|
useEffect7(() => {
|
|
28033
28033
|
if (!group) return;
|
|
@@ -28200,6 +28200,12 @@ var AnyCadComponent = ({
|
|
|
28200
28200
|
source_component_id: cad_component2.source_component_id
|
|
28201
28201
|
})?.name;
|
|
28202
28202
|
}, [circuitJson, cad_component2.source_component_id]);
|
|
28203
|
+
const isThroughHole = useMemo7(() => {
|
|
28204
|
+
const platedHoles = circuitJson.filter(
|
|
28205
|
+
(elm) => elm.type === "pcb_plated_hole" && elm.pcb_component_id === cad_component2.pcb_component_id
|
|
28206
|
+
);
|
|
28207
|
+
return platedHoles.length > 0;
|
|
28208
|
+
}, [circuitJson, cad_component2.pcb_component_id]);
|
|
28203
28209
|
const url = cad_component2.model_obj_url ?? cad_component2.model_wrl_url ?? cad_component2.model_stl_url;
|
|
28204
28210
|
const gltfUrl = cad_component2.model_glb_url ?? cad_component2.model_gltf_url;
|
|
28205
28211
|
const rotationOffset = cad_component2.rotation ? tuple(
|
|
@@ -28275,7 +28281,10 @@ var AnyCadComponent = ({
|
|
|
28275
28281
|
}
|
|
28276
28282
|
);
|
|
28277
28283
|
}
|
|
28278
|
-
if (!visibility.
|
|
28284
|
+
if (isThroughHole && !visibility.throughHoleModels) {
|
|
28285
|
+
return null;
|
|
28286
|
+
}
|
|
28287
|
+
if (!isThroughHole && !visibility.smtModels) {
|
|
28279
28288
|
return null;
|
|
28280
28289
|
}
|
|
28281
28290
|
return /* @__PURE__ */ jsxs2(Fragment3, { children: [
|
|
@@ -28309,7 +28318,7 @@ import * as THREE15 from "three";
|
|
|
28309
28318
|
// package.json
|
|
28310
28319
|
var package_default = {
|
|
28311
28320
|
name: "@tscircuit/3d-viewer",
|
|
28312
|
-
version: "0.0.
|
|
28321
|
+
version: "0.0.443",
|
|
28313
28322
|
main: "./dist/index.js",
|
|
28314
28323
|
module: "./dist/index.js",
|
|
28315
28324
|
type: "module",
|
|
@@ -28338,6 +28347,7 @@ var package_default = {
|
|
|
28338
28347
|
dependencies: {
|
|
28339
28348
|
"@jscad/regl-renderer": "^2.6.12",
|
|
28340
28349
|
"@jscad/stl-serializer": "^2.1.20",
|
|
28350
|
+
"react-hot-toast": "^2.6.0",
|
|
28341
28351
|
three: "^0.165.0",
|
|
28342
28352
|
"three-stdlib": "^2.36.0",
|
|
28343
28353
|
"troika-three-text": "^0.52.4"
|
|
@@ -29607,7 +29617,7 @@ var createBoardGeomFromCircuitJson = (circuitJson, opts = {}) => {
|
|
|
29607
29617
|
};
|
|
29608
29618
|
|
|
29609
29619
|
// src/BoardGeomBuilder.ts
|
|
29610
|
-
var
|
|
29620
|
+
var import_transforms9 = __toESM(require_transforms(), 1);
|
|
29611
29621
|
var import_primitives10 = __toESM(require_primitives(), 1);
|
|
29612
29622
|
var import_colors7 = __toESM(require_colors(), 1);
|
|
29613
29623
|
var import_booleans6 = __toESM(require_booleans(), 1);
|
|
@@ -29617,8 +29627,9 @@ import { su as su3 } from "@tscircuit/circuit-json-util";
|
|
|
29617
29627
|
var import_primitives4 = __toESM(require_primitives(), 1);
|
|
29618
29628
|
var import_colors2 = __toESM(require_colors(), 1);
|
|
29619
29629
|
var import_booleans2 = __toESM(require_booleans(), 1);
|
|
29620
|
-
var import_extrusions3 = __toESM(require_extrusions(), 1);
|
|
29621
29630
|
var import_transforms3 = __toESM(require_transforms(), 1);
|
|
29631
|
+
var import_extrusions3 = __toESM(require_extrusions(), 1);
|
|
29632
|
+
var import_transforms4 = __toESM(require_transforms(), 1);
|
|
29622
29633
|
|
|
29623
29634
|
// src/utils/rect-border-radius.ts
|
|
29624
29635
|
function clampRectBorderRadius(width10, height10, rawRadius) {
|
|
@@ -29750,7 +29761,7 @@ var createRectPadGeom = ({
|
|
|
29750
29761
|
});
|
|
29751
29762
|
const extruded = (0, import_extrusions3.extrudeLinear)({ height: thickness }, rect2d);
|
|
29752
29763
|
const offsetZ = center[2] - thickness / 2;
|
|
29753
|
-
return (0,
|
|
29764
|
+
return (0, import_transforms4.translate)([center[0], center[1], offsetZ], extruded);
|
|
29754
29765
|
};
|
|
29755
29766
|
var platedHole = (plated_hole, ctx, options = {}) => {
|
|
29756
29767
|
const { clipGeom } = options;
|
|
@@ -29775,6 +29786,39 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
29775
29786
|
});
|
|
29776
29787
|
return (0, import_colors2.colorize)(colors.copper, (0, import_booleans2.subtract)(copperSolid, drill));
|
|
29777
29788
|
}
|
|
29789
|
+
if (plated_hole.shape === "oval") {
|
|
29790
|
+
const outerWidth = plated_hole.outer_width || plated_hole.hole_width || 0;
|
|
29791
|
+
const outerHeight = plated_hole.outer_height || plated_hole.hole_height || 0;
|
|
29792
|
+
const holeWidth = plated_hole.hole_width || 0;
|
|
29793
|
+
const holeHeight = plated_hole.hole_height || 0;
|
|
29794
|
+
const copperBody = (() => {
|
|
29795
|
+
const circle2 = (0, import_primitives4.cylinder)({
|
|
29796
|
+
center: [0, 0, 0],
|
|
29797
|
+
radius: 1,
|
|
29798
|
+
height: copperSpan + 0.01,
|
|
29799
|
+
segments: 64
|
|
29800
|
+
// High segment count for smooth ellipse
|
|
29801
|
+
});
|
|
29802
|
+
const scaled = (0, import_transforms3.scale)([outerWidth / 2, outerHeight / 2, 1], circle2);
|
|
29803
|
+
return (0, import_transforms4.translate)([plated_hole.x, plated_hole.y, 0], scaled);
|
|
29804
|
+
})();
|
|
29805
|
+
const copperSolid = maybeClip(copperBody, clipGeom);
|
|
29806
|
+
const drill = (() => {
|
|
29807
|
+
const circle2 = (0, import_primitives4.cylinder)({
|
|
29808
|
+
center: [0, 0, 0],
|
|
29809
|
+
radius: 1,
|
|
29810
|
+
height: throughDrillHeight,
|
|
29811
|
+
segments: 64
|
|
29812
|
+
// High segment count for smooth ellipse
|
|
29813
|
+
});
|
|
29814
|
+
const scaled = (0, import_transforms3.scale)(
|
|
29815
|
+
[Math.max(holeWidth / 2, 0.01), Math.max(holeHeight / 2, 0.01), 1],
|
|
29816
|
+
circle2
|
|
29817
|
+
);
|
|
29818
|
+
return (0, import_transforms4.translate)([plated_hole.x, plated_hole.y, 0], scaled);
|
|
29819
|
+
})();
|
|
29820
|
+
return (0, import_colors2.colorize)(colors.copper, (0, import_booleans2.subtract)(copperSolid, drill));
|
|
29821
|
+
}
|
|
29778
29822
|
if (plated_hole.shape === "circular_hole_with_rect_pad") {
|
|
29779
29823
|
const holeOffsetX = plated_hole.hole_offset_x || 0;
|
|
29780
29824
|
const holeOffsetY = plated_hole.hole_offset_y || 0;
|
|
@@ -29813,7 +29857,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
29813
29857
|
segments: RECT_PAD_SEGMENTS
|
|
29814
29858
|
});
|
|
29815
29859
|
const extruded = (0, import_extrusions3.extrudeLinear)({ height: height10 }, rect2d);
|
|
29816
|
-
return (0,
|
|
29860
|
+
return (0, import_transforms4.translate)(
|
|
29817
29861
|
[plated_hole.x, plated_hole.y, centerZ - height10 / 2],
|
|
29818
29862
|
extruded
|
|
29819
29863
|
);
|
|
@@ -29866,9 +29910,9 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
29866
29910
|
const rotationRadians = (plated_hole.ccw_rotation || 0) * Math.PI / 180;
|
|
29867
29911
|
const rotateAroundCenter = (geom) => {
|
|
29868
29912
|
if (!rotationRadians) return geom;
|
|
29869
|
-
const toOrigin = (0,
|
|
29870
|
-
const rotated = (0,
|
|
29871
|
-
return (0,
|
|
29913
|
+
const toOrigin = (0, import_transforms4.translate)([-plated_hole.x, -plated_hole.y, 0], geom);
|
|
29914
|
+
const rotated = (0, import_transforms4.rotate)([0, 0, rotationRadians], toOrigin);
|
|
29915
|
+
return (0, import_transforms4.translate)([plated_hole.x, plated_hole.y, 0], rotated);
|
|
29872
29916
|
};
|
|
29873
29917
|
const shouldRotate = plated_hole.hole_height > plated_hole.hole_width;
|
|
29874
29918
|
const holeWidth = shouldRotate ? plated_hole.hole_height : plated_hole.hole_width;
|
|
@@ -30039,7 +30083,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
30039
30083
|
segments: RECT_PAD_SEGMENTS
|
|
30040
30084
|
});
|
|
30041
30085
|
const extruded = (0, import_extrusions3.extrudeLinear)({ height: height10 }, rect2d);
|
|
30042
|
-
return (0,
|
|
30086
|
+
return (0, import_transforms4.translate)(
|
|
30043
30087
|
[plated_hole.x, plated_hole.y, centerZ - height10 / 2],
|
|
30044
30088
|
extruded
|
|
30045
30089
|
);
|
|
@@ -30101,7 +30145,7 @@ var platedHole = (plated_hole, ctx, options = {}) => {
|
|
|
30101
30145
|
const createPolygonPad = (thickness, zCenter) => {
|
|
30102
30146
|
const safeThickness = Math.max(thickness, M);
|
|
30103
30147
|
const extruded = (0, import_extrusions3.extrudeLinear)({ height: safeThickness }, polygon2d);
|
|
30104
|
-
return (0,
|
|
30148
|
+
return (0, import_transforms4.translate)(
|
|
30105
30149
|
[plated_hole.x, plated_hole.y, zCenter - safeThickness / 2],
|
|
30106
30150
|
extruded
|
|
30107
30151
|
);
|
|
@@ -30439,7 +30483,7 @@ function createSilkscreenTextGeoms(silkscreenText) {
|
|
|
30439
30483
|
var import_primitives5 = __toESM(require_primitives(), 1);
|
|
30440
30484
|
var import_expansions2 = __toESM(require_expansions(), 1);
|
|
30441
30485
|
var import_extrusions4 = __toESM(require_extrusions(), 1);
|
|
30442
|
-
var
|
|
30486
|
+
var import_transforms5 = __toESM(require_transforms(), 1);
|
|
30443
30487
|
var import_colors3 = __toESM(require_colors(), 1);
|
|
30444
30488
|
|
|
30445
30489
|
// src/utils/units.ts
|
|
@@ -30502,7 +30546,7 @@ function createSilkscreenPathGeom(sp, ctx) {
|
|
|
30502
30546
|
);
|
|
30503
30547
|
const layerSign = sp.layer === "bottom" ? -1 : 1;
|
|
30504
30548
|
const zPos = layerSign * ctx.pcbThickness / 2 + layerSign * M * 1.5;
|
|
30505
|
-
let pathGeom = (0,
|
|
30549
|
+
let pathGeom = (0, import_transforms5.translate)(
|
|
30506
30550
|
[0, 0, zPos],
|
|
30507
30551
|
(0, import_extrusions4.extrudeLinear)({ height: 0.012 }, expandedPath)
|
|
30508
30552
|
// Standard silkscreen thickness
|
|
@@ -30515,7 +30559,7 @@ function createSilkscreenPathGeom(sp, ctx) {
|
|
|
30515
30559
|
var import_primitives6 = __toESM(require_primitives(), 1);
|
|
30516
30560
|
var import_expansions3 = __toESM(require_expansions(), 1);
|
|
30517
30561
|
var import_extrusions5 = __toESM(require_extrusions(), 1);
|
|
30518
|
-
var
|
|
30562
|
+
var import_transforms6 = __toESM(require_transforms(), 1);
|
|
30519
30563
|
var import_colors4 = __toESM(require_colors(), 1);
|
|
30520
30564
|
function createSilkscreenLineGeom(sl, ctx) {
|
|
30521
30565
|
const x1 = parseDimensionToMm(sl.x1) ?? 0;
|
|
@@ -30535,7 +30579,7 @@ function createSilkscreenLineGeom(sl, ctx) {
|
|
|
30535
30579
|
);
|
|
30536
30580
|
const layerSign = sl.layer === "bottom" ? -1 : 1;
|
|
30537
30581
|
const zPos = layerSign * ctx.pcbThickness / 2 + layerSign * M * 1.5;
|
|
30538
|
-
let lineGeom = (0,
|
|
30582
|
+
let lineGeom = (0, import_transforms6.translate)(
|
|
30539
30583
|
[0, 0, zPos],
|
|
30540
30584
|
(0, import_extrusions5.extrudeLinear)({ height: 0.012 }, expandedLine)
|
|
30541
30585
|
);
|
|
@@ -30546,7 +30590,7 @@ function createSilkscreenLineGeom(sl, ctx) {
|
|
|
30546
30590
|
// src/geoms/create-geoms-for-silkscreen-rect.ts
|
|
30547
30591
|
var import_primitives7 = __toESM(require_primitives(), 1);
|
|
30548
30592
|
var import_extrusions6 = __toESM(require_extrusions(), 1);
|
|
30549
|
-
var
|
|
30593
|
+
var import_transforms7 = __toESM(require_transforms(), 1);
|
|
30550
30594
|
var import_colors5 = __toESM(require_colors(), 1);
|
|
30551
30595
|
var import_booleans3 = __toESM(require_booleans(), 1);
|
|
30552
30596
|
var RECT_SEGMENTS = 64;
|
|
@@ -30601,14 +30645,14 @@ function createSilkscreenRectGeom(rect, ctx) {
|
|
|
30601
30645
|
if (!rectGeom) return void 0;
|
|
30602
30646
|
const layerSign = rect.layer === "bottom" ? -1 : 1;
|
|
30603
30647
|
const zPos = layerSign * ctx.pcbThickness / 2 + layerSign * M * 1.5;
|
|
30604
|
-
rectGeom = (0,
|
|
30648
|
+
rectGeom = (0, import_transforms7.translate)([centerX, centerY, zPos], rectGeom);
|
|
30605
30649
|
return (0, import_colors5.colorize)([1, 1, 1], rectGeom);
|
|
30606
30650
|
}
|
|
30607
30651
|
|
|
30608
30652
|
// src/geoms/create-geoms-for-silkscreen-circle.ts
|
|
30609
30653
|
var import_primitives8 = __toESM(require_primitives(), 1);
|
|
30610
30654
|
var import_extrusions7 = __toESM(require_extrusions(), 1);
|
|
30611
|
-
var
|
|
30655
|
+
var import_transforms8 = __toESM(require_transforms(), 1);
|
|
30612
30656
|
var import_colors6 = __toESM(require_colors(), 1);
|
|
30613
30657
|
var import_booleans4 = __toESM(require_booleans(), 1);
|
|
30614
30658
|
var CIRCLE_SEGMENTS = 64;
|
|
@@ -30644,7 +30688,7 @@ function createSilkscreenCircleGeom(circleEl, ctx) {
|
|
|
30644
30688
|
const filledCircle2d = (0, import_primitives8.circle)({ radius, segments: CIRCLE_SEGMENTS });
|
|
30645
30689
|
circleGeom = (0, import_extrusions7.extrudeLinear)({ height: baseHeight }, filledCircle2d);
|
|
30646
30690
|
}
|
|
30647
|
-
const translatedGeom = (0,
|
|
30691
|
+
const translatedGeom = (0, import_transforms8.translate)([centerX, centerY, zPos], circleGeom);
|
|
30648
30692
|
return (0, import_colors6.colorize)([1, 1, 1], translatedGeom);
|
|
30649
30693
|
}
|
|
30650
30694
|
|
|
@@ -30748,7 +30792,7 @@ var createCenteredRectPadGeom = (width10, height10, thickness, rectBorderRadius)
|
|
|
30748
30792
|
segments: PAD_ROUNDED_SEGMENTS
|
|
30749
30793
|
});
|
|
30750
30794
|
const extruded = (0, import_extrusions8.extrudeLinear)({ height: thickness }, rect2d);
|
|
30751
|
-
return (0,
|
|
30795
|
+
return (0, import_transforms9.translate)([0, 0, -thickness / 2], extruded);
|
|
30752
30796
|
};
|
|
30753
30797
|
var buildStateOrder = [
|
|
30754
30798
|
"initializing",
|
|
@@ -31027,8 +31071,8 @@ var BoardGeomBuilder = class {
|
|
|
31027
31071
|
segments: PAD_ROUNDED_SEGMENTS
|
|
31028
31072
|
});
|
|
31029
31073
|
cutoutGeom = (0, import_extrusions8.extrudeLinear)({ height: cutoutHeight }, rect2d);
|
|
31030
|
-
cutoutGeom = (0,
|
|
31031
|
-
cutoutGeom = (0,
|
|
31074
|
+
cutoutGeom = (0, import_transforms9.translate)([0, 0, -cutoutHeight / 2], cutoutGeom);
|
|
31075
|
+
cutoutGeom = (0, import_transforms9.translate)(
|
|
31032
31076
|
[cutout.center.x, cutout.center.y, 0],
|
|
31033
31077
|
cutoutGeom
|
|
31034
31078
|
);
|
|
@@ -31037,14 +31081,14 @@ var BoardGeomBuilder = class {
|
|
|
31037
31081
|
center: [0, 0, 0],
|
|
31038
31082
|
size: [cutout.width, cutout.height, cutoutHeight]
|
|
31039
31083
|
});
|
|
31040
|
-
cutoutGeom = (0,
|
|
31084
|
+
cutoutGeom = (0, import_transforms9.translate)(
|
|
31041
31085
|
[cutout.center.x, cutout.center.y, 0],
|
|
31042
31086
|
baseCutoutGeom
|
|
31043
31087
|
);
|
|
31044
31088
|
}
|
|
31045
31089
|
if (cutout.rotation) {
|
|
31046
31090
|
const rotationRadians = cutout.rotation * Math.PI / 180;
|
|
31047
|
-
cutoutGeom = (0,
|
|
31091
|
+
cutoutGeom = (0, import_transforms9.rotateZ)(rotationRadians, cutoutGeom);
|
|
31048
31092
|
}
|
|
31049
31093
|
break;
|
|
31050
31094
|
case "circle":
|
|
@@ -31067,7 +31111,7 @@ var BoardGeomBuilder = class {
|
|
|
31067
31111
|
}
|
|
31068
31112
|
const polygon2d = (0, import_primitives10.polygon)({ points: pointsVec2 });
|
|
31069
31113
|
cutoutGeom = (0, import_extrusions8.extrudeLinear)({ height: cutoutHeight }, polygon2d);
|
|
31070
|
-
cutoutGeom = (0,
|
|
31114
|
+
cutoutGeom = (0, import_transforms9.translate)([0, 0, -cutoutHeight / 2], cutoutGeom);
|
|
31071
31115
|
break;
|
|
31072
31116
|
}
|
|
31073
31117
|
if (cutoutGeom) {
|
|
@@ -31086,15 +31130,15 @@ var BoardGeomBuilder = class {
|
|
|
31086
31130
|
});
|
|
31087
31131
|
if ("rotation" in pour && pour.rotation) {
|
|
31088
31132
|
const rotationRadians = pour.rotation * Math.PI / 180;
|
|
31089
|
-
baseGeom = (0,
|
|
31133
|
+
baseGeom = (0, import_transforms9.rotateZ)(rotationRadians, baseGeom);
|
|
31090
31134
|
}
|
|
31091
|
-
pourGeom = (0,
|
|
31135
|
+
pourGeom = (0, import_transforms9.translate)([pour.center.x, pour.center.y, zPos], baseGeom);
|
|
31092
31136
|
} else if (pour.shape === "brep") {
|
|
31093
31137
|
const brepShape = pour.brep_shape;
|
|
31094
31138
|
if (brepShape && brepShape.outer_ring) {
|
|
31095
31139
|
const pourGeom2 = createGeom2FromBRep(brepShape);
|
|
31096
31140
|
pourGeom = (0, import_extrusions8.extrudeLinear)({ height: M }, pourGeom2);
|
|
31097
|
-
pourGeom = (0,
|
|
31141
|
+
pourGeom = (0, import_transforms9.translate)([0, 0, zPos], pourGeom);
|
|
31098
31142
|
}
|
|
31099
31143
|
} else if (pour.shape === "polygon") {
|
|
31100
31144
|
let pointsVec2 = pour.points.map((p) => [p.x, p.y]);
|
|
@@ -31109,7 +31153,7 @@ var BoardGeomBuilder = class {
|
|
|
31109
31153
|
}
|
|
31110
31154
|
const polygon2d = (0, import_primitives10.polygon)({ points: pointsVec2 });
|
|
31111
31155
|
pourGeom = (0, import_extrusions8.extrudeLinear)({ height: M }, polygon2d);
|
|
31112
|
-
pourGeom = (0,
|
|
31156
|
+
pourGeom = (0, import_transforms9.translate)([0, 0, zPos], pourGeom);
|
|
31113
31157
|
}
|
|
31114
31158
|
if (pourGeom) {
|
|
31115
31159
|
if (this.boardClipGeom) {
|
|
@@ -31181,9 +31225,9 @@ var BoardGeomBuilder = class {
|
|
|
31181
31225
|
);
|
|
31182
31226
|
if (ph.ccw_rotation) {
|
|
31183
31227
|
const rotationRadians = ph.ccw_rotation * Math.PI / 180;
|
|
31184
|
-
pillHole = (0,
|
|
31228
|
+
pillHole = (0, import_transforms9.translate)(
|
|
31185
31229
|
[ph.x, ph.y, 0],
|
|
31186
|
-
(0,
|
|
31230
|
+
(0, import_transforms9.rotateZ)(rotationRadians, (0, import_transforms9.translate)([-ph.x, -ph.y, 0], pillHole))
|
|
31187
31231
|
);
|
|
31188
31232
|
}
|
|
31189
31233
|
if (!opts.dontCutBoard) {
|
|
@@ -31333,7 +31377,7 @@ var BoardGeomBuilder = class {
|
|
|
31333
31377
|
}
|
|
31334
31378
|
if (isRotated) {
|
|
31335
31379
|
const rotationRadians = hole.ccw_rotation * Math.PI / 180;
|
|
31336
|
-
pillHole = (0,
|
|
31380
|
+
pillHole = (0, import_transforms9.rotateZ)(rotationRadians, pillHole);
|
|
31337
31381
|
}
|
|
31338
31382
|
this.boardGeom = (0, import_booleans6.subtract)(this.boardGeom, pillHole);
|
|
31339
31383
|
this.padGeoms = this.padGeoms.map(
|
|
@@ -31356,7 +31400,7 @@ var BoardGeomBuilder = class {
|
|
|
31356
31400
|
M,
|
|
31357
31401
|
rectBorderRadius
|
|
31358
31402
|
);
|
|
31359
|
-
const positionedPadGeom = (0,
|
|
31403
|
+
const positionedPadGeom = (0, import_transforms9.translate)([pad2.x, pad2.y, zPos], basePadGeom);
|
|
31360
31404
|
let finalPadGeom = positionedPadGeom;
|
|
31361
31405
|
if (this.boardClipGeom) {
|
|
31362
31406
|
finalPadGeom = (0, import_booleans6.intersect)(this.boardClipGeom, finalPadGeom);
|
|
@@ -31371,8 +31415,8 @@ var BoardGeomBuilder = class {
|
|
|
31371
31415
|
rectBorderRadius
|
|
31372
31416
|
);
|
|
31373
31417
|
const rotationRadians = pad2.ccw_rotation * Math.PI / 180;
|
|
31374
|
-
basePadGeom = (0,
|
|
31375
|
-
const positionedPadGeom = (0,
|
|
31418
|
+
basePadGeom = (0, import_transforms9.rotateZ)(rotationRadians, basePadGeom);
|
|
31419
|
+
const positionedPadGeom = (0, import_transforms9.translate)([pad2.x, pad2.y, zPos], basePadGeom);
|
|
31376
31420
|
let finalPadGeom = positionedPadGeom;
|
|
31377
31421
|
if (this.boardClipGeom) {
|
|
31378
31422
|
finalPadGeom = (0, import_booleans6.intersect)(this.boardClipGeom, finalPadGeom);
|
|
@@ -31407,7 +31451,7 @@ var BoardGeomBuilder = class {
|
|
|
31407
31451
|
{ delta: currentWidth / 2, corners: "round" },
|
|
31408
31452
|
linePath
|
|
31409
31453
|
);
|
|
31410
|
-
let traceGeom = (0,
|
|
31454
|
+
let traceGeom = (0, import_transforms9.translate)(
|
|
31411
31455
|
[0, 0, zCenter - M / 2],
|
|
31412
31456
|
(0, import_extrusions8.extrudeLinear)({ height: M }, expandedPath)
|
|
31413
31457
|
);
|
|
@@ -31517,13 +31561,13 @@ var BoardGeomBuilder = class {
|
|
|
31517
31561
|
);
|
|
31518
31562
|
let textGeom;
|
|
31519
31563
|
if (st.layer === "bottom") {
|
|
31520
|
-
textGeom = (0,
|
|
31564
|
+
textGeom = (0, import_transforms9.translate)(
|
|
31521
31565
|
[0, 0, -this.ctx.pcbThickness / 2 - M],
|
|
31522
31566
|
// Position above board
|
|
31523
31567
|
(0, import_extrusions8.extrudeLinear)({ height: 0.012 }, expandedPath)
|
|
31524
31568
|
);
|
|
31525
31569
|
} else {
|
|
31526
|
-
textGeom = (0,
|
|
31570
|
+
textGeom = (0, import_transforms9.translate)(
|
|
31527
31571
|
[0, 0, this.ctx.pcbThickness / 2 + M],
|
|
31528
31572
|
// Position above board
|
|
31529
31573
|
(0, import_extrusions8.extrudeLinear)({ height: 0.012 }, expandedPath)
|
|
@@ -31643,7 +31687,7 @@ var Text = ({
|
|
|
31643
31687
|
parent,
|
|
31644
31688
|
position,
|
|
31645
31689
|
rotation: rotation2,
|
|
31646
|
-
scale:
|
|
31690
|
+
scale: scale3,
|
|
31647
31691
|
color,
|
|
31648
31692
|
fontSize,
|
|
31649
31693
|
anchorX,
|
|
@@ -31656,7 +31700,7 @@ var Text = ({
|
|
|
31656
31700
|
textMesh.text = children;
|
|
31657
31701
|
if (position) textMesh.position.fromArray(position);
|
|
31658
31702
|
if (rotation2) textMesh.rotation.fromArray(rotation2);
|
|
31659
|
-
if (
|
|
31703
|
+
if (scale3) textMesh.scale.fromArray(scale3);
|
|
31660
31704
|
textMesh.color = color || "white";
|
|
31661
31705
|
textMesh.fontSize = fontSize || 1;
|
|
31662
31706
|
textMesh.anchorX = anchorX || "center";
|
|
@@ -31669,7 +31713,7 @@ var Text = ({
|
|
|
31669
31713
|
children,
|
|
31670
31714
|
position,
|
|
31671
31715
|
rotation2,
|
|
31672
|
-
|
|
31716
|
+
scale3,
|
|
31673
31717
|
color,
|
|
31674
31718
|
fontSize,
|
|
31675
31719
|
anchorX,
|
|
@@ -33078,6 +33122,105 @@ function processPlatedHolesForManifold(Manifold, CrossSection, circuitJson, pcbT
|
|
|
33078
33122
|
geometry: threeGeom,
|
|
33079
33123
|
color: COPPER_COLOR
|
|
33080
33124
|
});
|
|
33125
|
+
} else if (ph.shape === "oval") {
|
|
33126
|
+
const holeW = ph.hole_width;
|
|
33127
|
+
const holeH = ph.hole_height;
|
|
33128
|
+
const outerW = ph.outer_width ?? holeW + 0.4;
|
|
33129
|
+
const outerH = ph.outer_height ?? holeH + 0.4;
|
|
33130
|
+
const drillW = holeW + 2 * MANIFOLD_Z_OFFSET;
|
|
33131
|
+
const drillH = holeH + 2 * MANIFOLD_Z_OFFSET;
|
|
33132
|
+
const drillDepth = pcbThickness * 1.2;
|
|
33133
|
+
let boardDrillPoints = createEllipsePoints(
|
|
33134
|
+
drillW,
|
|
33135
|
+
drillH,
|
|
33136
|
+
SMOOTH_CIRCLE_SEGMENTS
|
|
33137
|
+
);
|
|
33138
|
+
if (arePointsClockwise3(boardDrillPoints)) {
|
|
33139
|
+
boardDrillPoints = boardDrillPoints.reverse();
|
|
33140
|
+
}
|
|
33141
|
+
const boardDrillCrossSection = CrossSection.ofPolygons([boardDrillPoints]);
|
|
33142
|
+
manifoldInstancesForCleanup.push(boardDrillCrossSection);
|
|
33143
|
+
let boardDrillOp = Manifold.extrude(
|
|
33144
|
+
boardDrillCrossSection,
|
|
33145
|
+
drillDepth,
|
|
33146
|
+
0,
|
|
33147
|
+
0,
|
|
33148
|
+
[1, 1],
|
|
33149
|
+
true
|
|
33150
|
+
);
|
|
33151
|
+
manifoldInstancesForCleanup.push(boardDrillOp);
|
|
33152
|
+
if (ph.ccw_rotation) {
|
|
33153
|
+
const rotatedDrill = boardDrillOp.rotate([0, 0, ph.ccw_rotation]);
|
|
33154
|
+
manifoldInstancesForCleanup.push(rotatedDrill);
|
|
33155
|
+
boardDrillOp = rotatedDrill;
|
|
33156
|
+
}
|
|
33157
|
+
const translatedDrill = boardDrillOp.translate([ph.x, ph.y, 0]);
|
|
33158
|
+
manifoldInstancesForCleanup.push(translatedDrill);
|
|
33159
|
+
platedHoleBoardDrills.push(translatedDrill);
|
|
33160
|
+
const copperPartThickness = pcbThickness + 2 * MANIFOLD_Z_OFFSET;
|
|
33161
|
+
let outerPoints = createEllipsePoints(
|
|
33162
|
+
outerW,
|
|
33163
|
+
outerH,
|
|
33164
|
+
SMOOTH_CIRCLE_SEGMENTS
|
|
33165
|
+
);
|
|
33166
|
+
if (arePointsClockwise3(outerPoints)) {
|
|
33167
|
+
outerPoints = outerPoints.reverse();
|
|
33168
|
+
}
|
|
33169
|
+
const outerCrossSection = CrossSection.ofPolygons([outerPoints]);
|
|
33170
|
+
manifoldInstancesForCleanup.push(outerCrossSection);
|
|
33171
|
+
let outerCopperOp = Manifold.extrude(
|
|
33172
|
+
outerCrossSection,
|
|
33173
|
+
copperPartThickness,
|
|
33174
|
+
0,
|
|
33175
|
+
0,
|
|
33176
|
+
[1, 1],
|
|
33177
|
+
true
|
|
33178
|
+
);
|
|
33179
|
+
manifoldInstancesForCleanup.push(outerCopperOp);
|
|
33180
|
+
let innerPoints = createEllipsePoints(
|
|
33181
|
+
holeW,
|
|
33182
|
+
holeH,
|
|
33183
|
+
SMOOTH_CIRCLE_SEGMENTS
|
|
33184
|
+
);
|
|
33185
|
+
if (arePointsClockwise3(innerPoints)) {
|
|
33186
|
+
innerPoints = innerPoints.reverse();
|
|
33187
|
+
}
|
|
33188
|
+
const innerCrossSection = CrossSection.ofPolygons([innerPoints]);
|
|
33189
|
+
manifoldInstancesForCleanup.push(innerCrossSection);
|
|
33190
|
+
let innerDrillOp = Manifold.extrude(
|
|
33191
|
+
innerCrossSection,
|
|
33192
|
+
copperPartThickness * 1.05,
|
|
33193
|
+
0,
|
|
33194
|
+
0,
|
|
33195
|
+
[1, 1],
|
|
33196
|
+
true
|
|
33197
|
+
);
|
|
33198
|
+
manifoldInstancesForCleanup.push(innerDrillOp);
|
|
33199
|
+
let finalPlatedPartOp = outerCopperOp.subtract(innerDrillOp);
|
|
33200
|
+
manifoldInstancesForCleanup.push(finalPlatedPartOp);
|
|
33201
|
+
if (ph.ccw_rotation) {
|
|
33202
|
+
const rotatedOp = finalPlatedPartOp.rotate([0, 0, ph.ccw_rotation]);
|
|
33203
|
+
manifoldInstancesForCleanup.push(rotatedOp);
|
|
33204
|
+
finalPlatedPartOp = rotatedOp;
|
|
33205
|
+
}
|
|
33206
|
+
const translatedPlatedPart = finalPlatedPartOp.translate([ph.x, ph.y, 0]);
|
|
33207
|
+
manifoldInstancesForCleanup.push(translatedPlatedPart);
|
|
33208
|
+
let finalCopperOp = translatedPlatedPart;
|
|
33209
|
+
if (boardClipVolume) {
|
|
33210
|
+
const clipped = Manifold.intersection([
|
|
33211
|
+
translatedPlatedPart,
|
|
33212
|
+
boardClipVolume
|
|
33213
|
+
]);
|
|
33214
|
+
manifoldInstancesForCleanup.push(clipped);
|
|
33215
|
+
finalCopperOp = clipped;
|
|
33216
|
+
}
|
|
33217
|
+
platedHoleCopperOpsForSubtract.push(finalCopperOp);
|
|
33218
|
+
const threeGeom = manifoldMeshToThreeGeometry(finalCopperOp.getMesh());
|
|
33219
|
+
platedHoleCopperGeoms.push({
|
|
33220
|
+
key: `ph-${ph.pcb_plated_hole_id || index2}`,
|
|
33221
|
+
geometry: threeGeom,
|
|
33222
|
+
color: COPPER_COLOR
|
|
33223
|
+
});
|
|
33081
33224
|
} else if (ph.shape === "circular_hole_with_rect_pad") {
|
|
33082
33225
|
const holeOffsetX = ph.hole_offset_x || 0;
|
|
33083
33226
|
const holeOffsetY = ph.hole_offset_y || 0;
|
|
@@ -34547,6 +34690,11 @@ import { useEffect as useEffect25, useMemo as useMemo21, useRef as useRef11, use
|
|
|
34547
34690
|
var hotkeyRegistry = /* @__PURE__ */ new Map();
|
|
34548
34691
|
var subscribers = /* @__PURE__ */ new Set();
|
|
34549
34692
|
var isListenerAttached = false;
|
|
34693
|
+
var lastMouseX = 0;
|
|
34694
|
+
var lastMouseY = 0;
|
|
34695
|
+
var viewerElement = null;
|
|
34696
|
+
var mouseTrackingAttached = false;
|
|
34697
|
+
var MAX_PARENT_DEPTH = 20;
|
|
34550
34698
|
var parseShortcut = (shortcut) => {
|
|
34551
34699
|
const parts = shortcut.toLowerCase().split("+");
|
|
34552
34700
|
const key = parts[parts.length - 1];
|
|
@@ -34576,10 +34724,53 @@ var isEditableTarget = (target) => {
|
|
|
34576
34724
|
if (editableTags.includes(tagName)) {
|
|
34577
34725
|
return true;
|
|
34578
34726
|
}
|
|
34579
|
-
|
|
34727
|
+
const contentEditable = element.getAttribute?.("contenteditable");
|
|
34728
|
+
if (contentEditable === "true" || contentEditable === "") {
|
|
34729
|
+
return true;
|
|
34730
|
+
}
|
|
34731
|
+
let current2 = element.parentElement;
|
|
34732
|
+
for (let depth = 0; depth < MAX_PARENT_DEPTH && current2; depth++) {
|
|
34733
|
+
const tagName2 = current2.tagName;
|
|
34734
|
+
if (editableTags.includes(tagName2)) {
|
|
34735
|
+
return true;
|
|
34736
|
+
}
|
|
34737
|
+
const contentEditable2 = current2.getAttribute?.("contenteditable");
|
|
34738
|
+
if (contentEditable2 === "true" || contentEditable2 === "") {
|
|
34739
|
+
return true;
|
|
34740
|
+
}
|
|
34741
|
+
current2 = current2.parentElement;
|
|
34742
|
+
}
|
|
34743
|
+
return false;
|
|
34744
|
+
};
|
|
34745
|
+
var isInputFocused = () => {
|
|
34746
|
+
if (typeof document === "undefined") return false;
|
|
34747
|
+
const activeElement = document.activeElement;
|
|
34748
|
+
if (!activeElement) return false;
|
|
34749
|
+
const tagName = activeElement.tagName;
|
|
34750
|
+
if (tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT") {
|
|
34751
|
+
return true;
|
|
34752
|
+
}
|
|
34753
|
+
const contentEditable = activeElement.getAttribute("contenteditable");
|
|
34754
|
+
return contentEditable === "true" || contentEditable === "";
|
|
34755
|
+
};
|
|
34756
|
+
var isMouseOverViewer = () => {
|
|
34757
|
+
if (!viewerElement) return true;
|
|
34758
|
+
const rect = viewerElement.getBoundingClientRect();
|
|
34759
|
+
return lastMouseX >= rect.left && lastMouseX <= rect.right && lastMouseY >= rect.top && lastMouseY <= rect.bottom;
|
|
34760
|
+
};
|
|
34761
|
+
var attachMouseTracking = () => {
|
|
34762
|
+
if (mouseTrackingAttached || typeof window === "undefined") return;
|
|
34763
|
+
window.addEventListener("mousemove", (e) => {
|
|
34764
|
+
lastMouseX = e.clientX;
|
|
34765
|
+
lastMouseY = e.clientY;
|
|
34766
|
+
});
|
|
34767
|
+
mouseTrackingAttached = true;
|
|
34580
34768
|
};
|
|
34581
34769
|
var handleKeydown = (event) => {
|
|
34582
|
-
if (isEditableTarget(event.target)) {
|
|
34770
|
+
if (isEditableTarget(event.target) || isInputFocused()) {
|
|
34771
|
+
return;
|
|
34772
|
+
}
|
|
34773
|
+
if (viewerElement && !isMouseOverViewer()) {
|
|
34583
34774
|
return;
|
|
34584
34775
|
}
|
|
34585
34776
|
hotkeyRegistry.forEach((entry) => {
|
|
@@ -34645,6 +34836,29 @@ var useHotkeyRegistry = () => {
|
|
|
34645
34836
|
useEffect25(() => subscribeToRegistry(setEntries), []);
|
|
34646
34837
|
return entries;
|
|
34647
34838
|
};
|
|
34839
|
+
var registerHotkeyViewer = (element) => {
|
|
34840
|
+
viewerElement = element;
|
|
34841
|
+
attachMouseTracking();
|
|
34842
|
+
};
|
|
34843
|
+
|
|
34844
|
+
// src/contexts/ToastContext.tsx
|
|
34845
|
+
import { Toaster, toast as hotToast } from "react-hot-toast";
|
|
34846
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
34847
|
+
var useToast = () => {
|
|
34848
|
+
return {
|
|
34849
|
+
showToast: (message, duration = 2e3) => {
|
|
34850
|
+
hotToast(message, { duration });
|
|
34851
|
+
}
|
|
34852
|
+
};
|
|
34853
|
+
};
|
|
34854
|
+
var ToastProvider = ({
|
|
34855
|
+
children
|
|
34856
|
+
}) => {
|
|
34857
|
+
return /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
34858
|
+
children,
|
|
34859
|
+
/* @__PURE__ */ jsx18(Toaster, { position: "bottom-right" })
|
|
34860
|
+
] });
|
|
34861
|
+
};
|
|
34648
34862
|
|
|
34649
34863
|
// src/components/ContextMenu.tsx
|
|
34650
34864
|
import { useState as useState34 } from "react";
|
|
@@ -34702,7 +34916,7 @@ function useComposedRefs(...refs) {
|
|
|
34702
34916
|
|
|
34703
34917
|
// node_modules/@radix-ui/react-context/dist/index.mjs
|
|
34704
34918
|
import * as React13 from "react";
|
|
34705
|
-
import { jsx as
|
|
34919
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
34706
34920
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
34707
34921
|
let defaultContexts = [];
|
|
34708
34922
|
function createContext32(rootComponentName, defaultContext) {
|
|
@@ -34713,7 +34927,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
34713
34927
|
const { scope, children, ...context } = props;
|
|
34714
34928
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
34715
34929
|
const value = React13.useMemo(() => context, Object.values(context));
|
|
34716
|
-
return /* @__PURE__ */
|
|
34930
|
+
return /* @__PURE__ */ jsx19(Context.Provider, { value, children });
|
|
34717
34931
|
};
|
|
34718
34932
|
Provider.displayName = rootComponentName + "Provider";
|
|
34719
34933
|
function useContext22(consumerName, scope) {
|
|
@@ -34843,7 +35057,7 @@ import * as ReactDOM2 from "react-dom";
|
|
|
34843
35057
|
|
|
34844
35058
|
// node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
34845
35059
|
import * as React16 from "react";
|
|
34846
|
-
import { Fragment as Fragment23, jsx as
|
|
35060
|
+
import { Fragment as Fragment23, jsx as jsx20 } from "react/jsx-runtime";
|
|
34847
35061
|
// @__NO_SIDE_EFFECTS__
|
|
34848
35062
|
function createSlot(ownerName) {
|
|
34849
35063
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
@@ -34861,9 +35075,9 @@ function createSlot(ownerName) {
|
|
|
34861
35075
|
return child;
|
|
34862
35076
|
}
|
|
34863
35077
|
});
|
|
34864
|
-
return /* @__PURE__ */
|
|
35078
|
+
return /* @__PURE__ */ jsx20(SlotClone, { ...slotProps, ref: forwardedRef, children: React16.isValidElement(newElement) ? React16.cloneElement(newElement, void 0, newChildren) : null });
|
|
34865
35079
|
}
|
|
34866
|
-
return /* @__PURE__ */
|
|
35080
|
+
return /* @__PURE__ */ jsx20(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
34867
35081
|
});
|
|
34868
35082
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
34869
35083
|
return Slot2;
|
|
@@ -34928,7 +35142,7 @@ function getElementRef(element) {
|
|
|
34928
35142
|
}
|
|
34929
35143
|
|
|
34930
35144
|
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
34931
|
-
import { jsx as
|
|
35145
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
34932
35146
|
var NODES = [
|
|
34933
35147
|
"a",
|
|
34934
35148
|
"button",
|
|
@@ -34956,7 +35170,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
34956
35170
|
if (typeof window !== "undefined") {
|
|
34957
35171
|
window[Symbol.for("radix-ui")] = true;
|
|
34958
35172
|
}
|
|
34959
|
-
return /* @__PURE__ */
|
|
35173
|
+
return /* @__PURE__ */ jsx21(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
34960
35174
|
});
|
|
34961
35175
|
Node2.displayName = `Primitive.${node}`;
|
|
34962
35176
|
return { ...primitive, [node]: Node2 };
|
|
@@ -34970,9 +35184,9 @@ import * as React42 from "react";
|
|
|
34970
35184
|
|
|
34971
35185
|
// node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
34972
35186
|
import React18 from "react";
|
|
34973
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
34974
|
-
import React23 from "react";
|
|
34975
35187
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
35188
|
+
import React23 from "react";
|
|
35189
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
34976
35190
|
function createCollection(name) {
|
|
34977
35191
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
34978
35192
|
const [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME);
|
|
@@ -34984,7 +35198,7 @@ function createCollection(name) {
|
|
|
34984
35198
|
const { scope, children } = props;
|
|
34985
35199
|
const ref = React18.useRef(null);
|
|
34986
35200
|
const itemMap = React18.useRef(/* @__PURE__ */ new Map()).current;
|
|
34987
|
-
return /* @__PURE__ */
|
|
35201
|
+
return /* @__PURE__ */ jsx22(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
34988
35202
|
};
|
|
34989
35203
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
34990
35204
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
@@ -34994,7 +35208,7 @@ function createCollection(name) {
|
|
|
34994
35208
|
const { scope, children } = props;
|
|
34995
35209
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
34996
35210
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
34997
|
-
return /* @__PURE__ */
|
|
35211
|
+
return /* @__PURE__ */ jsx22(CollectionSlotImpl, { ref: composedRefs, children });
|
|
34998
35212
|
}
|
|
34999
35213
|
);
|
|
35000
35214
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
@@ -35011,7 +35225,7 @@ function createCollection(name) {
|
|
|
35011
35225
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
35012
35226
|
return () => void context.itemMap.delete(ref);
|
|
35013
35227
|
});
|
|
35014
|
-
return /* @__PURE__ */
|
|
35228
|
+
return /* @__PURE__ */ jsx22(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
35015
35229
|
}
|
|
35016
35230
|
);
|
|
35017
35231
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -35038,7 +35252,7 @@ function createCollection(name) {
|
|
|
35038
35252
|
|
|
35039
35253
|
// node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
35040
35254
|
import * as React19 from "react";
|
|
35041
|
-
import { jsx as
|
|
35255
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
35042
35256
|
var DirectionContext = React19.createContext(void 0);
|
|
35043
35257
|
function useDirection(localDir) {
|
|
35044
35258
|
const globalDir = React19.useContext(DirectionContext);
|
|
@@ -35074,7 +35288,7 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
|
|
|
35074
35288
|
}
|
|
35075
35289
|
|
|
35076
35290
|
// node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
35077
|
-
import { jsx as
|
|
35291
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
35078
35292
|
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
35079
35293
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
35080
35294
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
@@ -35162,7 +35376,7 @@ var DismissableLayer = React24.forwardRef(
|
|
|
35162
35376
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
35163
35377
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
35164
35378
|
}, []);
|
|
35165
|
-
return /* @__PURE__ */
|
|
35379
|
+
return /* @__PURE__ */ jsx25(
|
|
35166
35380
|
Primitive.div,
|
|
35167
35381
|
{
|
|
35168
35382
|
...layerProps,
|
|
@@ -35196,7 +35410,7 @@ var DismissableLayerBranch = React24.forwardRef((props, forwardedRef) => {
|
|
|
35196
35410
|
};
|
|
35197
35411
|
}
|
|
35198
35412
|
}, [context.branches]);
|
|
35199
|
-
return /* @__PURE__ */
|
|
35413
|
+
return /* @__PURE__ */ jsx25(Primitive.div, { ...props, ref: composedRefs });
|
|
35200
35414
|
});
|
|
35201
35415
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
35202
35416
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -35308,7 +35522,7 @@ function createFocusGuard() {
|
|
|
35308
35522
|
|
|
35309
35523
|
// node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
35310
35524
|
import * as React26 from "react";
|
|
35311
|
-
import { jsx as
|
|
35525
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
35312
35526
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
35313
35527
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
35314
35528
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
@@ -35427,7 +35641,7 @@ var FocusScope = React26.forwardRef((props, forwardedRef) => {
|
|
|
35427
35641
|
},
|
|
35428
35642
|
[loop, trapped, focusScope.paused]
|
|
35429
35643
|
);
|
|
35430
|
-
return /* @__PURE__ */
|
|
35644
|
+
return /* @__PURE__ */ jsx26(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
35431
35645
|
});
|
|
35432
35646
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
35433
35647
|
function focusFirst(candidates, { select = false } = {}) {
|
|
@@ -36595,21 +36809,21 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
36595
36809
|
}
|
|
36596
36810
|
const clientRect = element.getBoundingClientRect();
|
|
36597
36811
|
const domElement = unwrapElement(element);
|
|
36598
|
-
let
|
|
36812
|
+
let scale3 = createCoords(1);
|
|
36599
36813
|
if (includeScale) {
|
|
36600
36814
|
if (offsetParent) {
|
|
36601
36815
|
if (isElement(offsetParent)) {
|
|
36602
|
-
|
|
36816
|
+
scale3 = getScale(offsetParent);
|
|
36603
36817
|
}
|
|
36604
36818
|
} else {
|
|
36605
|
-
|
|
36819
|
+
scale3 = getScale(element);
|
|
36606
36820
|
}
|
|
36607
36821
|
}
|
|
36608
36822
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
36609
|
-
let x = (clientRect.left + visualOffsets.x) /
|
|
36610
|
-
let y = (clientRect.top + visualOffsets.y) /
|
|
36611
|
-
let width10 = clientRect.width /
|
|
36612
|
-
let height10 = clientRect.height /
|
|
36823
|
+
let x = (clientRect.left + visualOffsets.x) / scale3.x;
|
|
36824
|
+
let y = (clientRect.top + visualOffsets.y) / scale3.y;
|
|
36825
|
+
let width10 = clientRect.width / scale3.x;
|
|
36826
|
+
let height10 = clientRect.height / scale3.y;
|
|
36613
36827
|
if (domElement) {
|
|
36614
36828
|
const win = getWindow(domElement);
|
|
36615
36829
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
@@ -36671,7 +36885,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
36671
36885
|
scrollLeft: 0,
|
|
36672
36886
|
scrollTop: 0
|
|
36673
36887
|
};
|
|
36674
|
-
let
|
|
36888
|
+
let scale3 = createCoords(1);
|
|
36675
36889
|
const offsets = createCoords(0);
|
|
36676
36890
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
36677
36891
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
@@ -36680,17 +36894,17 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
36680
36894
|
}
|
|
36681
36895
|
if (isHTMLElement(offsetParent)) {
|
|
36682
36896
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
36683
|
-
|
|
36897
|
+
scale3 = getScale(offsetParent);
|
|
36684
36898
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
36685
36899
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
36686
36900
|
}
|
|
36687
36901
|
}
|
|
36688
36902
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
36689
36903
|
return {
|
|
36690
|
-
width: rect.width *
|
|
36691
|
-
height: rect.height *
|
|
36692
|
-
x: rect.x *
|
|
36693
|
-
y: rect.y *
|
|
36904
|
+
width: rect.width * scale3.x,
|
|
36905
|
+
height: rect.height * scale3.y,
|
|
36906
|
+
x: rect.x * scale3.x - scroll.scrollLeft * scale3.x + offsets.x + htmlOffset.x,
|
|
36907
|
+
y: rect.y * scale3.y - scroll.scrollTop * scale3.y + offsets.y + htmlOffset.y
|
|
36694
36908
|
};
|
|
36695
36909
|
}
|
|
36696
36910
|
function getClientRects(element) {
|
|
@@ -36757,11 +36971,11 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
36757
36971
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
36758
36972
|
const top = clientRect.top + element.clientTop;
|
|
36759
36973
|
const left = clientRect.left + element.clientLeft;
|
|
36760
|
-
const
|
|
36761
|
-
const width10 = element.clientWidth *
|
|
36762
|
-
const height10 = element.clientHeight *
|
|
36763
|
-
const x = left *
|
|
36764
|
-
const y = top *
|
|
36974
|
+
const scale3 = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
36975
|
+
const width10 = element.clientWidth * scale3.x;
|
|
36976
|
+
const height10 = element.clientHeight * scale3.y;
|
|
36977
|
+
const x = left * scale3.x;
|
|
36978
|
+
const y = top * scale3.y;
|
|
36765
36979
|
return {
|
|
36766
36980
|
width: width10,
|
|
36767
36981
|
height: height10,
|
|
@@ -37417,11 +37631,11 @@ var arrow3 = (options, deps) => ({
|
|
|
37417
37631
|
|
|
37418
37632
|
// node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
37419
37633
|
import * as React29 from "react";
|
|
37420
|
-
import { jsx as
|
|
37634
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
37421
37635
|
var NAME = "Arrow";
|
|
37422
37636
|
var Arrow = React29.forwardRef((props, forwardedRef) => {
|
|
37423
37637
|
const { children, width: width10 = 10, height: height10 = 5, ...arrowProps } = props;
|
|
37424
|
-
return /* @__PURE__ */
|
|
37638
|
+
return /* @__PURE__ */ jsx27(
|
|
37425
37639
|
Primitive.svg,
|
|
37426
37640
|
{
|
|
37427
37641
|
...arrowProps,
|
|
@@ -37430,7 +37644,7 @@ var Arrow = React29.forwardRef((props, forwardedRef) => {
|
|
|
37430
37644
|
height: height10,
|
|
37431
37645
|
viewBox: "0 0 30 10",
|
|
37432
37646
|
preserveAspectRatio: "none",
|
|
37433
|
-
children: props.asChild ? children : /* @__PURE__ */
|
|
37647
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx27("polygon", { points: "0,0 30,0 15,10" })
|
|
37434
37648
|
}
|
|
37435
37649
|
);
|
|
37436
37650
|
});
|
|
@@ -37475,14 +37689,14 @@ function useSize(element) {
|
|
|
37475
37689
|
}
|
|
37476
37690
|
|
|
37477
37691
|
// node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
37478
|
-
import { jsx as
|
|
37692
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
37479
37693
|
var POPPER_NAME = "Popper";
|
|
37480
37694
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
37481
37695
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
37482
37696
|
var Popper = (props) => {
|
|
37483
37697
|
const { __scopePopper, children } = props;
|
|
37484
37698
|
const [anchor, setAnchor] = React31.useState(null);
|
|
37485
|
-
return /* @__PURE__ */
|
|
37699
|
+
return /* @__PURE__ */ jsx28(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
37486
37700
|
};
|
|
37487
37701
|
Popper.displayName = POPPER_NAME;
|
|
37488
37702
|
var ANCHOR_NAME = "PopperAnchor";
|
|
@@ -37500,7 +37714,7 @@ var PopperAnchor = React31.forwardRef(
|
|
|
37500
37714
|
context.onAnchorChange(anchorRef.current);
|
|
37501
37715
|
}
|
|
37502
37716
|
});
|
|
37503
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
37717
|
+
return virtualRef ? null : /* @__PURE__ */ jsx28(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
37504
37718
|
}
|
|
37505
37719
|
);
|
|
37506
37720
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
@@ -37593,7 +37807,7 @@ var PopperContent = React31.forwardRef(
|
|
|
37593
37807
|
useLayoutEffect2(() => {
|
|
37594
37808
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
37595
37809
|
}, [content]);
|
|
37596
|
-
return /* @__PURE__ */
|
|
37810
|
+
return /* @__PURE__ */ jsx28(
|
|
37597
37811
|
"div",
|
|
37598
37812
|
{
|
|
37599
37813
|
ref: refs.setFloating,
|
|
@@ -37617,7 +37831,7 @@ var PopperContent = React31.forwardRef(
|
|
|
37617
37831
|
}
|
|
37618
37832
|
},
|
|
37619
37833
|
dir: props.dir,
|
|
37620
|
-
children: /* @__PURE__ */
|
|
37834
|
+
children: /* @__PURE__ */ jsx28(
|
|
37621
37835
|
PopperContentProvider,
|
|
37622
37836
|
{
|
|
37623
37837
|
scope: __scopePopper,
|
|
@@ -37626,7 +37840,7 @@ var PopperContent = React31.forwardRef(
|
|
|
37626
37840
|
arrowX,
|
|
37627
37841
|
arrowY,
|
|
37628
37842
|
shouldHideArrow: cannotCenterArrow,
|
|
37629
|
-
children: /* @__PURE__ */
|
|
37843
|
+
children: /* @__PURE__ */ jsx28(
|
|
37630
37844
|
Primitive.div,
|
|
37631
37845
|
{
|
|
37632
37846
|
"data-side": placedSide,
|
|
@@ -37663,7 +37877,7 @@ var PopperArrow = React31.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
37663
37877
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
37664
37878
|
// doesn't report size as we'd expect on SVG elements.
|
|
37665
37879
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
37666
|
-
/* @__PURE__ */
|
|
37880
|
+
/* @__PURE__ */ jsx28(
|
|
37667
37881
|
"span",
|
|
37668
37882
|
{
|
|
37669
37883
|
ref: contentContext.onArrowChange,
|
|
@@ -37686,7 +37900,7 @@ var PopperArrow = React31.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
37686
37900
|
}[contentContext.placedSide],
|
|
37687
37901
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
37688
37902
|
},
|
|
37689
|
-
children: /* @__PURE__ */
|
|
37903
|
+
children: /* @__PURE__ */ jsx28(
|
|
37690
37904
|
Root,
|
|
37691
37905
|
{
|
|
37692
37906
|
...arrowProps,
|
|
@@ -37749,14 +37963,14 @@ var Arrow2 = PopperArrow;
|
|
|
37749
37963
|
// node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
37750
37964
|
import * as React32 from "react";
|
|
37751
37965
|
import ReactDOM4 from "react-dom";
|
|
37752
|
-
import { jsx as
|
|
37966
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
37753
37967
|
var PORTAL_NAME = "Portal";
|
|
37754
37968
|
var Portal = React32.forwardRef((props, forwardedRef) => {
|
|
37755
37969
|
const { container: containerProp, ...portalProps } = props;
|
|
37756
37970
|
const [mounted, setMounted] = React32.useState(false);
|
|
37757
37971
|
useLayoutEffect2(() => setMounted(true), []);
|
|
37758
37972
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
37759
|
-
return container ? ReactDOM4.createPortal(/* @__PURE__ */
|
|
37973
|
+
return container ? ReactDOM4.createPortal(/* @__PURE__ */ jsx29(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
37760
37974
|
});
|
|
37761
37975
|
Portal.displayName = PORTAL_NAME;
|
|
37762
37976
|
|
|
@@ -37888,7 +38102,7 @@ function getElementRef2(element) {
|
|
|
37888
38102
|
|
|
37889
38103
|
// node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
37890
38104
|
import * as React34 from "react";
|
|
37891
|
-
import { jsx as
|
|
38105
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
37892
38106
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
37893
38107
|
var EVENT_OPTIONS2 = { bubbles: false, cancelable: true };
|
|
37894
38108
|
var GROUP_NAME = "RovingFocusGroup";
|
|
@@ -37900,7 +38114,7 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
37900
38114
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
37901
38115
|
var RovingFocusGroup = React34.forwardRef(
|
|
37902
38116
|
(props, forwardedRef) => {
|
|
37903
|
-
return /* @__PURE__ */
|
|
38117
|
+
return /* @__PURE__ */ jsx30(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx30(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx30(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
37904
38118
|
}
|
|
37905
38119
|
);
|
|
37906
38120
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
@@ -37938,7 +38152,7 @@ var RovingFocusGroupImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
37938
38152
|
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
37939
38153
|
}
|
|
37940
38154
|
}, [handleEntryFocus]);
|
|
37941
|
-
return /* @__PURE__ */
|
|
38155
|
+
return /* @__PURE__ */ jsx30(
|
|
37942
38156
|
RovingFocusProvider,
|
|
37943
38157
|
{
|
|
37944
38158
|
scope: __scopeRovingFocusGroup,
|
|
@@ -37959,7 +38173,7 @@ var RovingFocusGroupImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
37959
38173
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
37960
38174
|
[]
|
|
37961
38175
|
),
|
|
37962
|
-
children: /* @__PURE__ */
|
|
38176
|
+
children: /* @__PURE__ */ jsx30(
|
|
37963
38177
|
Primitive.div,
|
|
37964
38178
|
{
|
|
37965
38179
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
@@ -38017,14 +38231,14 @@ var RovingFocusGroupItem = React34.forwardRef(
|
|
|
38017
38231
|
return () => onFocusableItemRemove();
|
|
38018
38232
|
}
|
|
38019
38233
|
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
38020
|
-
return /* @__PURE__ */
|
|
38234
|
+
return /* @__PURE__ */ jsx30(
|
|
38021
38235
|
Collection.ItemSlot,
|
|
38022
38236
|
{
|
|
38023
38237
|
scope: __scopeRovingFocusGroup,
|
|
38024
38238
|
id,
|
|
38025
38239
|
focusable,
|
|
38026
38240
|
active,
|
|
38027
|
-
children: /* @__PURE__ */
|
|
38241
|
+
children: /* @__PURE__ */ jsx30(
|
|
38028
38242
|
Primitive.span,
|
|
38029
38243
|
{
|
|
38030
38244
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
@@ -38935,7 +39149,7 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
|
38935
39149
|
var Combination_default = ReactRemoveScroll;
|
|
38936
39150
|
|
|
38937
39151
|
// node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
38938
|
-
import { jsx as
|
|
39152
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
38939
39153
|
var SELECTION_KEYS = ["Enter", " "];
|
|
38940
39154
|
var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
|
|
38941
39155
|
var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
|
|
@@ -38980,7 +39194,7 @@ var Menu = (props) => {
|
|
|
38980
39194
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
38981
39195
|
};
|
|
38982
39196
|
}, []);
|
|
38983
|
-
return /* @__PURE__ */
|
|
39197
|
+
return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
|
|
38984
39198
|
MenuProvider,
|
|
38985
39199
|
{
|
|
38986
39200
|
scope: __scopeMenu,
|
|
@@ -38988,7 +39202,7 @@ var Menu = (props) => {
|
|
|
38988
39202
|
onOpenChange: handleOpenChange,
|
|
38989
39203
|
content,
|
|
38990
39204
|
onContentChange: setContent,
|
|
38991
|
-
children: /* @__PURE__ */
|
|
39205
|
+
children: /* @__PURE__ */ jsx31(
|
|
38992
39206
|
MenuRootProvider,
|
|
38993
39207
|
{
|
|
38994
39208
|
scope: __scopeMenu,
|
|
@@ -39008,7 +39222,7 @@ var MenuAnchor = React42.forwardRef(
|
|
|
39008
39222
|
(props, forwardedRef) => {
|
|
39009
39223
|
const { __scopeMenu, ...anchorProps } = props;
|
|
39010
39224
|
const popperScope = usePopperScope(__scopeMenu);
|
|
39011
|
-
return /* @__PURE__ */
|
|
39225
|
+
return /* @__PURE__ */ jsx31(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
39012
39226
|
}
|
|
39013
39227
|
);
|
|
39014
39228
|
MenuAnchor.displayName = ANCHOR_NAME2;
|
|
@@ -39019,7 +39233,7 @@ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
|
|
|
39019
39233
|
var MenuPortal = (props) => {
|
|
39020
39234
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
39021
39235
|
const context = useMenuContext(PORTAL_NAME2, __scopeMenu);
|
|
39022
|
-
return /* @__PURE__ */
|
|
39236
|
+
return /* @__PURE__ */ jsx31(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Portal, { asChild: true, container, children }) }) });
|
|
39023
39237
|
};
|
|
39024
39238
|
MenuPortal.displayName = PORTAL_NAME2;
|
|
39025
39239
|
var CONTENT_NAME2 = "MenuContent";
|
|
@@ -39030,7 +39244,7 @@ var MenuContent = React42.forwardRef(
|
|
|
39030
39244
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
39031
39245
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
39032
39246
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
39033
|
-
return /* @__PURE__ */
|
|
39247
|
+
return /* @__PURE__ */ jsx31(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx31(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx31(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
39034
39248
|
}
|
|
39035
39249
|
);
|
|
39036
39250
|
var MenuRootContentModal = React42.forwardRef(
|
|
@@ -39042,7 +39256,7 @@ var MenuRootContentModal = React42.forwardRef(
|
|
|
39042
39256
|
const content = ref.current;
|
|
39043
39257
|
if (content) return hideOthers(content);
|
|
39044
39258
|
}, []);
|
|
39045
|
-
return /* @__PURE__ */
|
|
39259
|
+
return /* @__PURE__ */ jsx31(
|
|
39046
39260
|
MenuContentImpl,
|
|
39047
39261
|
{
|
|
39048
39262
|
...props,
|
|
@@ -39062,7 +39276,7 @@ var MenuRootContentModal = React42.forwardRef(
|
|
|
39062
39276
|
);
|
|
39063
39277
|
var MenuRootContentNonModal = React42.forwardRef((props, forwardedRef) => {
|
|
39064
39278
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
39065
|
-
return /* @__PURE__ */
|
|
39279
|
+
return /* @__PURE__ */ jsx31(
|
|
39066
39280
|
MenuContentImpl,
|
|
39067
39281
|
{
|
|
39068
39282
|
...props,
|
|
@@ -39134,7 +39348,7 @@ var MenuContentImpl = React42.forwardRef(
|
|
|
39134
39348
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
39135
39349
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
39136
39350
|
}, []);
|
|
39137
|
-
return /* @__PURE__ */
|
|
39351
|
+
return /* @__PURE__ */ jsx31(
|
|
39138
39352
|
MenuContentProvider,
|
|
39139
39353
|
{
|
|
39140
39354
|
scope: __scopeMenu,
|
|
@@ -39163,7 +39377,7 @@ var MenuContentImpl = React42.forwardRef(
|
|
|
39163
39377
|
onPointerGraceIntentChange: React42.useCallback((intent) => {
|
|
39164
39378
|
pointerGraceIntentRef.current = intent;
|
|
39165
39379
|
}, []),
|
|
39166
|
-
children: /* @__PURE__ */
|
|
39380
|
+
children: /* @__PURE__ */ jsx31(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx31(
|
|
39167
39381
|
FocusScope,
|
|
39168
39382
|
{
|
|
39169
39383
|
asChild: true,
|
|
@@ -39173,7 +39387,7 @@ var MenuContentImpl = React42.forwardRef(
|
|
|
39173
39387
|
contentRef.current?.focus({ preventScroll: true });
|
|
39174
39388
|
}),
|
|
39175
39389
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
39176
|
-
children: /* @__PURE__ */
|
|
39390
|
+
children: /* @__PURE__ */ jsx31(
|
|
39177
39391
|
DismissableLayer,
|
|
39178
39392
|
{
|
|
39179
39393
|
asChild: true,
|
|
@@ -39183,7 +39397,7 @@ var MenuContentImpl = React42.forwardRef(
|
|
|
39183
39397
|
onFocusOutside,
|
|
39184
39398
|
onInteractOutside,
|
|
39185
39399
|
onDismiss,
|
|
39186
|
-
children: /* @__PURE__ */
|
|
39400
|
+
children: /* @__PURE__ */ jsx31(
|
|
39187
39401
|
Root3,
|
|
39188
39402
|
{
|
|
39189
39403
|
asChild: true,
|
|
@@ -39197,7 +39411,7 @@ var MenuContentImpl = React42.forwardRef(
|
|
|
39197
39411
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
39198
39412
|
}),
|
|
39199
39413
|
preventScrollOnEntryFocus: true,
|
|
39200
|
-
children: /* @__PURE__ */
|
|
39414
|
+
children: /* @__PURE__ */ jsx31(
|
|
39201
39415
|
Content,
|
|
39202
39416
|
{
|
|
39203
39417
|
role: "menu",
|
|
@@ -39262,7 +39476,7 @@ var GROUP_NAME2 = "MenuGroup";
|
|
|
39262
39476
|
var MenuGroup = React42.forwardRef(
|
|
39263
39477
|
(props, forwardedRef) => {
|
|
39264
39478
|
const { __scopeMenu, ...groupProps } = props;
|
|
39265
|
-
return /* @__PURE__ */
|
|
39479
|
+
return /* @__PURE__ */ jsx31(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
39266
39480
|
}
|
|
39267
39481
|
);
|
|
39268
39482
|
MenuGroup.displayName = GROUP_NAME2;
|
|
@@ -39270,7 +39484,7 @@ var LABEL_NAME = "MenuLabel";
|
|
|
39270
39484
|
var MenuLabel = React42.forwardRef(
|
|
39271
39485
|
(props, forwardedRef) => {
|
|
39272
39486
|
const { __scopeMenu, ...labelProps } = props;
|
|
39273
|
-
return /* @__PURE__ */
|
|
39487
|
+
return /* @__PURE__ */ jsx31(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
39274
39488
|
}
|
|
39275
39489
|
);
|
|
39276
39490
|
MenuLabel.displayName = LABEL_NAME;
|
|
@@ -39297,7 +39511,7 @@ var MenuItem = React42.forwardRef(
|
|
|
39297
39511
|
}
|
|
39298
39512
|
}
|
|
39299
39513
|
};
|
|
39300
|
-
return /* @__PURE__ */
|
|
39514
|
+
return /* @__PURE__ */ jsx31(
|
|
39301
39515
|
MenuItemImpl,
|
|
39302
39516
|
{
|
|
39303
39517
|
...itemProps,
|
|
@@ -39339,13 +39553,13 @@ var MenuItemImpl = React42.forwardRef(
|
|
|
39339
39553
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
39340
39554
|
}
|
|
39341
39555
|
}, [itemProps.children]);
|
|
39342
|
-
return /* @__PURE__ */
|
|
39556
|
+
return /* @__PURE__ */ jsx31(
|
|
39343
39557
|
Collection2.ItemSlot,
|
|
39344
39558
|
{
|
|
39345
39559
|
scope: __scopeMenu,
|
|
39346
39560
|
disabled,
|
|
39347
39561
|
textValue: textValue ?? textContent,
|
|
39348
|
-
children: /* @__PURE__ */
|
|
39562
|
+
children: /* @__PURE__ */ jsx31(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx31(
|
|
39349
39563
|
Primitive.div,
|
|
39350
39564
|
{
|
|
39351
39565
|
role: "menuitem",
|
|
@@ -39384,7 +39598,7 @@ var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
|
39384
39598
|
var MenuCheckboxItem = React42.forwardRef(
|
|
39385
39599
|
(props, forwardedRef) => {
|
|
39386
39600
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
39387
|
-
return /* @__PURE__ */
|
|
39601
|
+
return /* @__PURE__ */ jsx31(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx31(
|
|
39388
39602
|
MenuItem,
|
|
39389
39603
|
{
|
|
39390
39604
|
role: "menuitemcheckbox",
|
|
@@ -39412,7 +39626,7 @@ var MenuRadioGroup = React42.forwardRef(
|
|
|
39412
39626
|
(props, forwardedRef) => {
|
|
39413
39627
|
const { value, onValueChange, ...groupProps } = props;
|
|
39414
39628
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
39415
|
-
return /* @__PURE__ */
|
|
39629
|
+
return /* @__PURE__ */ jsx31(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx31(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
39416
39630
|
}
|
|
39417
39631
|
);
|
|
39418
39632
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
@@ -39422,7 +39636,7 @@ var MenuRadioItem = React42.forwardRef(
|
|
|
39422
39636
|
const { value, ...radioItemProps } = props;
|
|
39423
39637
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
39424
39638
|
const checked = value === context.value;
|
|
39425
|
-
return /* @__PURE__ */
|
|
39639
|
+
return /* @__PURE__ */ jsx31(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx31(
|
|
39426
39640
|
MenuItem,
|
|
39427
39641
|
{
|
|
39428
39642
|
role: "menuitemradio",
|
|
@@ -39449,11 +39663,11 @@ var MenuItemIndicator = React42.forwardRef(
|
|
|
39449
39663
|
(props, forwardedRef) => {
|
|
39450
39664
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
39451
39665
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
39452
|
-
return /* @__PURE__ */
|
|
39666
|
+
return /* @__PURE__ */ jsx31(
|
|
39453
39667
|
Presence,
|
|
39454
39668
|
{
|
|
39455
39669
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
39456
|
-
children: /* @__PURE__ */
|
|
39670
|
+
children: /* @__PURE__ */ jsx31(
|
|
39457
39671
|
Primitive.span,
|
|
39458
39672
|
{
|
|
39459
39673
|
...itemIndicatorProps,
|
|
@@ -39470,7 +39684,7 @@ var SEPARATOR_NAME = "MenuSeparator";
|
|
|
39470
39684
|
var MenuSeparator = React42.forwardRef(
|
|
39471
39685
|
(props, forwardedRef) => {
|
|
39472
39686
|
const { __scopeMenu, ...separatorProps } = props;
|
|
39473
|
-
return /* @__PURE__ */
|
|
39687
|
+
return /* @__PURE__ */ jsx31(
|
|
39474
39688
|
Primitive.div,
|
|
39475
39689
|
{
|
|
39476
39690
|
role: "separator",
|
|
@@ -39487,7 +39701,7 @@ var MenuArrow = React42.forwardRef(
|
|
|
39487
39701
|
(props, forwardedRef) => {
|
|
39488
39702
|
const { __scopeMenu, ...arrowProps } = props;
|
|
39489
39703
|
const popperScope = usePopperScope(__scopeMenu);
|
|
39490
|
-
return /* @__PURE__ */
|
|
39704
|
+
return /* @__PURE__ */ jsx31(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
39491
39705
|
}
|
|
39492
39706
|
);
|
|
39493
39707
|
MenuArrow.displayName = ARROW_NAME2;
|
|
@@ -39504,7 +39718,7 @@ var MenuSub = (props) => {
|
|
|
39504
39718
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
39505
39719
|
return () => handleOpenChange(false);
|
|
39506
39720
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
39507
|
-
return /* @__PURE__ */
|
|
39721
|
+
return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
|
|
39508
39722
|
MenuProvider,
|
|
39509
39723
|
{
|
|
39510
39724
|
scope: __scopeMenu,
|
|
@@ -39512,7 +39726,7 @@ var MenuSub = (props) => {
|
|
|
39512
39726
|
onOpenChange: handleOpenChange,
|
|
39513
39727
|
content,
|
|
39514
39728
|
onContentChange: setContent,
|
|
39515
|
-
children: /* @__PURE__ */
|
|
39729
|
+
children: /* @__PURE__ */ jsx31(
|
|
39516
39730
|
MenuSubProvider,
|
|
39517
39731
|
{
|
|
39518
39732
|
scope: __scopeMenu,
|
|
@@ -39549,7 +39763,7 @@ var MenuSubTrigger = React42.forwardRef(
|
|
|
39549
39763
|
onPointerGraceIntentChange(null);
|
|
39550
39764
|
};
|
|
39551
39765
|
}, [pointerGraceTimerRef, onPointerGraceIntentChange]);
|
|
39552
|
-
return /* @__PURE__ */
|
|
39766
|
+
return /* @__PURE__ */ jsx31(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx31(
|
|
39553
39767
|
MenuItemImpl,
|
|
39554
39768
|
{
|
|
39555
39769
|
id: subContext.triggerId,
|
|
@@ -39638,7 +39852,7 @@ var MenuSubContent = React42.forwardRef(
|
|
|
39638
39852
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
39639
39853
|
const ref = React42.useRef(null);
|
|
39640
39854
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
39641
|
-
return /* @__PURE__ */
|
|
39855
|
+
return /* @__PURE__ */ jsx31(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(
|
|
39642
39856
|
MenuContentImpl,
|
|
39643
39857
|
{
|
|
39644
39858
|
id: subContext.contentId,
|
|
@@ -39749,7 +39963,7 @@ var SubTrigger = MenuSubTrigger;
|
|
|
39749
39963
|
var SubContent = MenuSubContent;
|
|
39750
39964
|
|
|
39751
39965
|
// node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
|
|
39752
|
-
import { jsx as
|
|
39966
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
39753
39967
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
39754
39968
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
39755
39969
|
DROPDOWN_MENU_NAME,
|
|
@@ -39775,7 +39989,7 @@ var DropdownMenu = (props) => {
|
|
|
39775
39989
|
onChange: onOpenChange,
|
|
39776
39990
|
caller: DROPDOWN_MENU_NAME
|
|
39777
39991
|
});
|
|
39778
|
-
return /* @__PURE__ */
|
|
39992
|
+
return /* @__PURE__ */ jsx32(
|
|
39779
39993
|
DropdownMenuProvider,
|
|
39780
39994
|
{
|
|
39781
39995
|
scope: __scopeDropdownMenu,
|
|
@@ -39786,7 +40000,7 @@ var DropdownMenu = (props) => {
|
|
|
39786
40000
|
onOpenChange: setOpen,
|
|
39787
40001
|
onOpenToggle: React43.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
39788
40002
|
modal,
|
|
39789
|
-
children: /* @__PURE__ */
|
|
40003
|
+
children: /* @__PURE__ */ jsx32(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
39790
40004
|
}
|
|
39791
40005
|
);
|
|
39792
40006
|
};
|
|
@@ -39797,7 +40011,7 @@ var DropdownMenuTrigger = React43.forwardRef(
|
|
|
39797
40011
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
39798
40012
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
39799
40013
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39800
|
-
return /* @__PURE__ */
|
|
40014
|
+
return /* @__PURE__ */ jsx32(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx32(
|
|
39801
40015
|
Primitive.button,
|
|
39802
40016
|
{
|
|
39803
40017
|
type: "button",
|
|
@@ -39831,7 +40045,7 @@ var PORTAL_NAME3 = "DropdownMenuPortal";
|
|
|
39831
40045
|
var DropdownMenuPortal = (props) => {
|
|
39832
40046
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
39833
40047
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39834
|
-
return /* @__PURE__ */
|
|
40048
|
+
return /* @__PURE__ */ jsx32(Portal2, { ...menuScope, ...portalProps });
|
|
39835
40049
|
};
|
|
39836
40050
|
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
39837
40051
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
@@ -39841,7 +40055,7 @@ var DropdownMenuContent = React43.forwardRef(
|
|
|
39841
40055
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
39842
40056
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39843
40057
|
const hasInteractedOutsideRef = React43.useRef(false);
|
|
39844
|
-
return /* @__PURE__ */
|
|
40058
|
+
return /* @__PURE__ */ jsx32(
|
|
39845
40059
|
Content2,
|
|
39846
40060
|
{
|
|
39847
40061
|
id: context.contentId,
|
|
@@ -39881,7 +40095,7 @@ var DropdownMenuGroup = React43.forwardRef(
|
|
|
39881
40095
|
(props, forwardedRef) => {
|
|
39882
40096
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
39883
40097
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39884
|
-
return /* @__PURE__ */
|
|
40098
|
+
return /* @__PURE__ */ jsx32(Group4, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
39885
40099
|
}
|
|
39886
40100
|
);
|
|
39887
40101
|
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
@@ -39890,7 +40104,7 @@ var DropdownMenuLabel = React43.forwardRef(
|
|
|
39890
40104
|
(props, forwardedRef) => {
|
|
39891
40105
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
39892
40106
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39893
|
-
return /* @__PURE__ */
|
|
40107
|
+
return /* @__PURE__ */ jsx32(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
39894
40108
|
}
|
|
39895
40109
|
);
|
|
39896
40110
|
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
@@ -39899,7 +40113,7 @@ var DropdownMenuItem = React43.forwardRef(
|
|
|
39899
40113
|
(props, forwardedRef) => {
|
|
39900
40114
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
39901
40115
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39902
|
-
return /* @__PURE__ */
|
|
40116
|
+
return /* @__PURE__ */ jsx32(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
39903
40117
|
}
|
|
39904
40118
|
);
|
|
39905
40119
|
DropdownMenuItem.displayName = ITEM_NAME3;
|
|
@@ -39907,35 +40121,35 @@ var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
|
39907
40121
|
var DropdownMenuCheckboxItem = React43.forwardRef((props, forwardedRef) => {
|
|
39908
40122
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
39909
40123
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39910
|
-
return /* @__PURE__ */
|
|
40124
|
+
return /* @__PURE__ */ jsx32(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
39911
40125
|
});
|
|
39912
40126
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
39913
40127
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
39914
40128
|
var DropdownMenuRadioGroup = React43.forwardRef((props, forwardedRef) => {
|
|
39915
40129
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
39916
40130
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39917
|
-
return /* @__PURE__ */
|
|
40131
|
+
return /* @__PURE__ */ jsx32(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
39918
40132
|
});
|
|
39919
40133
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
39920
40134
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
39921
40135
|
var DropdownMenuRadioItem = React43.forwardRef((props, forwardedRef) => {
|
|
39922
40136
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
39923
40137
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39924
|
-
return /* @__PURE__ */
|
|
40138
|
+
return /* @__PURE__ */ jsx32(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
39925
40139
|
});
|
|
39926
40140
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
39927
40141
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
39928
40142
|
var DropdownMenuItemIndicator = React43.forwardRef((props, forwardedRef) => {
|
|
39929
40143
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
39930
40144
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39931
|
-
return /* @__PURE__ */
|
|
40145
|
+
return /* @__PURE__ */ jsx32(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
39932
40146
|
});
|
|
39933
40147
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
39934
40148
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
39935
40149
|
var DropdownMenuSeparator = React43.forwardRef((props, forwardedRef) => {
|
|
39936
40150
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
39937
40151
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39938
|
-
return /* @__PURE__ */
|
|
40152
|
+
return /* @__PURE__ */ jsx32(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
39939
40153
|
});
|
|
39940
40154
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
39941
40155
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
@@ -39943,7 +40157,7 @@ var DropdownMenuArrow = React43.forwardRef(
|
|
|
39943
40157
|
(props, forwardedRef) => {
|
|
39944
40158
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
39945
40159
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39946
|
-
return /* @__PURE__ */
|
|
40160
|
+
return /* @__PURE__ */ jsx32(Arrow22, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
39947
40161
|
}
|
|
39948
40162
|
);
|
|
39949
40163
|
DropdownMenuArrow.displayName = ARROW_NAME3;
|
|
@@ -39956,20 +40170,20 @@ var DropdownMenuSub = (props) => {
|
|
|
39956
40170
|
onChange: onOpenChange,
|
|
39957
40171
|
caller: "DropdownMenuSub"
|
|
39958
40172
|
});
|
|
39959
|
-
return /* @__PURE__ */
|
|
40173
|
+
return /* @__PURE__ */ jsx32(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
39960
40174
|
};
|
|
39961
40175
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
39962
40176
|
var DropdownMenuSubTrigger = React43.forwardRef((props, forwardedRef) => {
|
|
39963
40177
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
39964
40178
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39965
|
-
return /* @__PURE__ */
|
|
40179
|
+
return /* @__PURE__ */ jsx32(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
39966
40180
|
});
|
|
39967
40181
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
39968
40182
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
39969
40183
|
var DropdownMenuSubContent = React43.forwardRef((props, forwardedRef) => {
|
|
39970
40184
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
39971
40185
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
39972
|
-
return /* @__PURE__ */
|
|
40186
|
+
return /* @__PURE__ */ jsx32(
|
|
39973
40187
|
SubContent,
|
|
39974
40188
|
{
|
|
39975
40189
|
...menuScope,
|
|
@@ -40004,8 +40218,8 @@ var SubContent2 = DropdownMenuSubContent;
|
|
|
40004
40218
|
import { useState as useState33 } from "react";
|
|
40005
40219
|
|
|
40006
40220
|
// src/components/Icons.tsx
|
|
40007
|
-
import { jsx as
|
|
40008
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
40221
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
40222
|
+
var CheckIcon = () => /* @__PURE__ */ jsx33(
|
|
40009
40223
|
"svg",
|
|
40010
40224
|
{
|
|
40011
40225
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -40017,10 +40231,10 @@ var CheckIcon = () => /* @__PURE__ */ jsx32(
|
|
|
40017
40231
|
strokeWidth: "2",
|
|
40018
40232
|
strokeLinecap: "round",
|
|
40019
40233
|
strokeLinejoin: "round",
|
|
40020
|
-
children: /* @__PURE__ */
|
|
40234
|
+
children: /* @__PURE__ */ jsx33("path", { d: "M20 6 9 17l-5-5" })
|
|
40021
40235
|
}
|
|
40022
40236
|
);
|
|
40023
|
-
var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */
|
|
40237
|
+
var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */ jsx33(
|
|
40024
40238
|
"svg",
|
|
40025
40239
|
{
|
|
40026
40240
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -40037,10 +40251,10 @@ var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */ jsx32(
|
|
|
40037
40251
|
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
|
|
40038
40252
|
opacity: 0.6
|
|
40039
40253
|
},
|
|
40040
|
-
children: /* @__PURE__ */
|
|
40254
|
+
children: /* @__PURE__ */ jsx33("path", { d: "m9 18 6-6-6-6" })
|
|
40041
40255
|
}
|
|
40042
40256
|
);
|
|
40043
|
-
var DotIcon = () => /* @__PURE__ */
|
|
40257
|
+
var DotIcon = () => /* @__PURE__ */ jsx33(
|
|
40044
40258
|
"svg",
|
|
40045
40259
|
{
|
|
40046
40260
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -40053,12 +40267,12 @@ var DotIcon = () => /* @__PURE__ */ jsx32(
|
|
|
40053
40267
|
strokeLinecap: "round",
|
|
40054
40268
|
strokeLinejoin: "round",
|
|
40055
40269
|
className: "lucide lucide-dot-icon lucide-dot",
|
|
40056
|
-
children: /* @__PURE__ */
|
|
40270
|
+
children: /* @__PURE__ */ jsx33("circle", { cx: "12.1", cy: "12.1", r: "4.5", fill: "white" })
|
|
40057
40271
|
}
|
|
40058
40272
|
);
|
|
40059
40273
|
|
|
40060
40274
|
// src/components/AppearanceMenu.tsx
|
|
40061
|
-
import { Fragment as
|
|
40275
|
+
import { Fragment as Fragment10, jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
40062
40276
|
var itemStyles = {
|
|
40063
40277
|
padding: "6px 8px",
|
|
40064
40278
|
borderRadius: 6,
|
|
@@ -40109,10 +40323,10 @@ var AppearanceMenu = () => {
|
|
|
40109
40323
|
const { visibility, setLayerVisibility } = useLayerVisibility();
|
|
40110
40324
|
const [appearanceSubOpen, setAppearanceSubOpen] = useState33(false);
|
|
40111
40325
|
const [hoveredItem, setHoveredItem] = useState33(null);
|
|
40112
|
-
return /* @__PURE__ */
|
|
40113
|
-
/* @__PURE__ */
|
|
40114
|
-
/* @__PURE__ */
|
|
40115
|
-
/* @__PURE__ */
|
|
40326
|
+
return /* @__PURE__ */ jsxs8(Fragment10, { children: [
|
|
40327
|
+
/* @__PURE__ */ jsx34(Separator2, { style: separatorStyles }),
|
|
40328
|
+
/* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setAppearanceSubOpen, children: [
|
|
40329
|
+
/* @__PURE__ */ jsxs8(
|
|
40116
40330
|
SubTrigger2,
|
|
40117
40331
|
{
|
|
40118
40332
|
style: {
|
|
@@ -40124,8 +40338,8 @@ var AppearanceMenu = () => {
|
|
|
40124
40338
|
onMouseLeave: () => setHoveredItem(null),
|
|
40125
40339
|
onTouchStart: () => setHoveredItem("appearance"),
|
|
40126
40340
|
children: [
|
|
40127
|
-
/* @__PURE__ */
|
|
40128
|
-
/* @__PURE__ */
|
|
40341
|
+
/* @__PURE__ */ jsx34("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: "Appearance" }),
|
|
40342
|
+
/* @__PURE__ */ jsx34(
|
|
40129
40343
|
"div",
|
|
40130
40344
|
{
|
|
40131
40345
|
style: {
|
|
@@ -40134,20 +40348,20 @@ var AppearanceMenu = () => {
|
|
|
40134
40348
|
alignItems: "flex-end",
|
|
40135
40349
|
marginBottom: "-5px"
|
|
40136
40350
|
},
|
|
40137
|
-
children: /* @__PURE__ */
|
|
40351
|
+
children: /* @__PURE__ */ jsx34(ChevronRightIcon, { isOpen: appearanceSubOpen })
|
|
40138
40352
|
}
|
|
40139
40353
|
)
|
|
40140
40354
|
]
|
|
40141
40355
|
}
|
|
40142
40356
|
),
|
|
40143
|
-
/* @__PURE__ */
|
|
40357
|
+
/* @__PURE__ */ jsx34(Portal22, { children: /* @__PURE__ */ jsxs8(
|
|
40144
40358
|
SubContent2,
|
|
40145
40359
|
{
|
|
40146
40360
|
style: { ...contentStyles, marginLeft: -2 },
|
|
40147
40361
|
collisionPadding: 10,
|
|
40148
40362
|
avoidCollisions: true,
|
|
40149
40363
|
children: [
|
|
40150
|
-
/* @__PURE__ */
|
|
40364
|
+
/* @__PURE__ */ jsxs8(
|
|
40151
40365
|
Item22,
|
|
40152
40366
|
{
|
|
40153
40367
|
style: {
|
|
@@ -40163,12 +40377,12 @@ var AppearanceMenu = () => {
|
|
|
40163
40377
|
onMouseLeave: () => setHoveredItem(null),
|
|
40164
40378
|
onTouchStart: () => setHoveredItem("boardBody"),
|
|
40165
40379
|
children: [
|
|
40166
|
-
/* @__PURE__ */
|
|
40167
|
-
/* @__PURE__ */
|
|
40380
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.boardBody && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40381
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Board Body" })
|
|
40168
40382
|
]
|
|
40169
40383
|
}
|
|
40170
40384
|
),
|
|
40171
|
-
/* @__PURE__ */
|
|
40385
|
+
/* @__PURE__ */ jsxs8(
|
|
40172
40386
|
Item22,
|
|
40173
40387
|
{
|
|
40174
40388
|
style: {
|
|
@@ -40184,12 +40398,12 @@ var AppearanceMenu = () => {
|
|
|
40184
40398
|
onMouseLeave: () => setHoveredItem(null),
|
|
40185
40399
|
onTouchStart: () => setHoveredItem("topCopper"),
|
|
40186
40400
|
children: [
|
|
40187
|
-
/* @__PURE__ */
|
|
40188
|
-
/* @__PURE__ */
|
|
40401
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.topCopper && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40402
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Top Copper" })
|
|
40189
40403
|
]
|
|
40190
40404
|
}
|
|
40191
40405
|
),
|
|
40192
|
-
/* @__PURE__ */
|
|
40406
|
+
/* @__PURE__ */ jsxs8(
|
|
40193
40407
|
Item22,
|
|
40194
40408
|
{
|
|
40195
40409
|
style: {
|
|
@@ -40205,12 +40419,12 @@ var AppearanceMenu = () => {
|
|
|
40205
40419
|
onMouseLeave: () => setHoveredItem(null),
|
|
40206
40420
|
onTouchStart: () => setHoveredItem("bottomCopper"),
|
|
40207
40421
|
children: [
|
|
40208
|
-
/* @__PURE__ */
|
|
40209
|
-
/* @__PURE__ */
|
|
40422
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.bottomCopper && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40423
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Copper" })
|
|
40210
40424
|
]
|
|
40211
40425
|
}
|
|
40212
40426
|
),
|
|
40213
|
-
/* @__PURE__ */
|
|
40427
|
+
/* @__PURE__ */ jsxs8(
|
|
40214
40428
|
Item22,
|
|
40215
40429
|
{
|
|
40216
40430
|
style: {
|
|
@@ -40226,12 +40440,12 @@ var AppearanceMenu = () => {
|
|
|
40226
40440
|
onMouseLeave: () => setHoveredItem(null),
|
|
40227
40441
|
onTouchStart: () => setHoveredItem("topSilkscreen"),
|
|
40228
40442
|
children: [
|
|
40229
|
-
/* @__PURE__ */
|
|
40230
|
-
/* @__PURE__ */
|
|
40443
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.topSilkscreen && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40444
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Top Silkscreen" })
|
|
40231
40445
|
]
|
|
40232
40446
|
}
|
|
40233
40447
|
),
|
|
40234
|
-
/* @__PURE__ */
|
|
40448
|
+
/* @__PURE__ */ jsxs8(
|
|
40235
40449
|
Item22,
|
|
40236
40450
|
{
|
|
40237
40451
|
style: {
|
|
@@ -40250,12 +40464,12 @@ var AppearanceMenu = () => {
|
|
|
40250
40464
|
onMouseLeave: () => setHoveredItem(null),
|
|
40251
40465
|
onTouchStart: () => setHoveredItem("bottomSilkscreen"),
|
|
40252
40466
|
children: [
|
|
40253
|
-
/* @__PURE__ */
|
|
40254
|
-
/* @__PURE__ */
|
|
40467
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.bottomSilkscreen && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40468
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Silkscreen" })
|
|
40255
40469
|
]
|
|
40256
40470
|
}
|
|
40257
40471
|
),
|
|
40258
|
-
/* @__PURE__ */
|
|
40472
|
+
/* @__PURE__ */ jsxs8(
|
|
40259
40473
|
Item22,
|
|
40260
40474
|
{
|
|
40261
40475
|
style: {
|
|
@@ -40271,8 +40485,32 @@ var AppearanceMenu = () => {
|
|
|
40271
40485
|
onMouseLeave: () => setHoveredItem(null),
|
|
40272
40486
|
onTouchStart: () => setHoveredItem("smtModels"),
|
|
40273
40487
|
children: [
|
|
40274
|
-
/* @__PURE__ */
|
|
40275
|
-
/* @__PURE__ */
|
|
40488
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.smtModels && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40489
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Surface Mount Components" })
|
|
40490
|
+
]
|
|
40491
|
+
}
|
|
40492
|
+
),
|
|
40493
|
+
/* @__PURE__ */ jsxs8(
|
|
40494
|
+
Item22,
|
|
40495
|
+
{
|
|
40496
|
+
style: {
|
|
40497
|
+
...itemStyles,
|
|
40498
|
+
backgroundColor: hoveredItem === "throughHoleModels" ? "#404040" : "transparent"
|
|
40499
|
+
},
|
|
40500
|
+
onSelect: (e) => e.preventDefault(),
|
|
40501
|
+
onPointerDown: (e) => {
|
|
40502
|
+
e.preventDefault();
|
|
40503
|
+
setLayerVisibility(
|
|
40504
|
+
"throughHoleModels",
|
|
40505
|
+
!visibility.throughHoleModels
|
|
40506
|
+
);
|
|
40507
|
+
},
|
|
40508
|
+
onMouseEnter: () => setHoveredItem("throughHoleModels"),
|
|
40509
|
+
onMouseLeave: () => setHoveredItem(null),
|
|
40510
|
+
onTouchStart: () => setHoveredItem("throughHoleModels"),
|
|
40511
|
+
children: [
|
|
40512
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.throughHoleModels && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
40513
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Through-Hole Components" })
|
|
40276
40514
|
]
|
|
40277
40515
|
}
|
|
40278
40516
|
)
|
|
@@ -40284,7 +40522,7 @@ var AppearanceMenu = () => {
|
|
|
40284
40522
|
};
|
|
40285
40523
|
|
|
40286
40524
|
// src/components/ContextMenu.tsx
|
|
40287
|
-
import { jsx as
|
|
40525
|
+
import { jsx as jsx35, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
40288
40526
|
var cameraOptions = [
|
|
40289
40527
|
"Custom",
|
|
40290
40528
|
"Top Center Angled",
|
|
@@ -40368,7 +40606,7 @@ var ContextMenu = ({
|
|
|
40368
40606
|
const { cameraType, setCameraType } = useCameraController();
|
|
40369
40607
|
const [cameraSubOpen, setCameraSubOpen] = useState34(false);
|
|
40370
40608
|
const [hoveredItem, setHoveredItem] = useState34(null);
|
|
40371
|
-
return /* @__PURE__ */
|
|
40609
|
+
return /* @__PURE__ */ jsx35(
|
|
40372
40610
|
"div",
|
|
40373
40611
|
{
|
|
40374
40612
|
ref: menuRef,
|
|
@@ -40379,9 +40617,9 @@ var ContextMenu = ({
|
|
|
40379
40617
|
width: 0,
|
|
40380
40618
|
height: 0
|
|
40381
40619
|
},
|
|
40382
|
-
children: /* @__PURE__ */
|
|
40383
|
-
/* @__PURE__ */
|
|
40384
|
-
/* @__PURE__ */
|
|
40620
|
+
children: /* @__PURE__ */ jsxs9(Root22, { open: true, modal: false, children: [
|
|
40621
|
+
/* @__PURE__ */ jsx35(Trigger, { asChild: true, children: /* @__PURE__ */ jsx35("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
|
|
40622
|
+
/* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsxs9(
|
|
40385
40623
|
Content22,
|
|
40386
40624
|
{
|
|
40387
40625
|
style: contentStyles2,
|
|
@@ -40390,8 +40628,8 @@ var ContextMenu = ({
|
|
|
40390
40628
|
sideOffset: 0,
|
|
40391
40629
|
align: "start",
|
|
40392
40630
|
children: [
|
|
40393
|
-
/* @__PURE__ */
|
|
40394
|
-
/* @__PURE__ */
|
|
40631
|
+
/* @__PURE__ */ jsxs9(Sub2, { onOpenChange: setCameraSubOpen, children: [
|
|
40632
|
+
/* @__PURE__ */ jsxs9(
|
|
40395
40633
|
SubTrigger2,
|
|
40396
40634
|
{
|
|
40397
40635
|
style: {
|
|
@@ -40403,14 +40641,14 @@ var ContextMenu = ({
|
|
|
40403
40641
|
onMouseLeave: () => setHoveredItem(null),
|
|
40404
40642
|
onTouchStart: () => setHoveredItem("camera"),
|
|
40405
40643
|
children: [
|
|
40406
|
-
/* @__PURE__ */
|
|
40644
|
+
/* @__PURE__ */ jsx35(
|
|
40407
40645
|
"span",
|
|
40408
40646
|
{
|
|
40409
40647
|
style: { flex: 1, display: "flex", alignItems: "center" },
|
|
40410
40648
|
children: "Camera Position"
|
|
40411
40649
|
}
|
|
40412
40650
|
),
|
|
40413
|
-
/* @__PURE__ */
|
|
40651
|
+
/* @__PURE__ */ jsxs9(
|
|
40414
40652
|
"div",
|
|
40415
40653
|
{
|
|
40416
40654
|
style: {
|
|
@@ -40420,21 +40658,21 @@ var ContextMenu = ({
|
|
|
40420
40658
|
marginLeft: "auto"
|
|
40421
40659
|
},
|
|
40422
40660
|
children: [
|
|
40423
|
-
/* @__PURE__ */
|
|
40424
|
-
/* @__PURE__ */
|
|
40661
|
+
/* @__PURE__ */ jsx35("span", { style: { opacity: 0.55, fontSize: 13 }, children: cameraPreset }),
|
|
40662
|
+
/* @__PURE__ */ jsx35(ChevronRightIcon, { isOpen: cameraSubOpen })
|
|
40425
40663
|
]
|
|
40426
40664
|
}
|
|
40427
40665
|
)
|
|
40428
40666
|
]
|
|
40429
40667
|
}
|
|
40430
40668
|
),
|
|
40431
|
-
/* @__PURE__ */
|
|
40669
|
+
/* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsx35(
|
|
40432
40670
|
SubContent2,
|
|
40433
40671
|
{
|
|
40434
40672
|
style: { ...contentStyles2, marginLeft: -2 },
|
|
40435
40673
|
collisionPadding: 10,
|
|
40436
40674
|
avoidCollisions: true,
|
|
40437
|
-
children: cameraOptions.map((option) => /* @__PURE__ */
|
|
40675
|
+
children: cameraOptions.map((option) => /* @__PURE__ */ jsxs9(
|
|
40438
40676
|
Item22,
|
|
40439
40677
|
{
|
|
40440
40678
|
style: {
|
|
@@ -40450,8 +40688,8 @@ var ContextMenu = ({
|
|
|
40450
40688
|
onMouseLeave: () => setHoveredItem(null),
|
|
40451
40689
|
onTouchStart: () => setHoveredItem(option),
|
|
40452
40690
|
children: [
|
|
40453
|
-
/* @__PURE__ */
|
|
40454
|
-
/* @__PURE__ */
|
|
40691
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: cameraPreset === option && /* @__PURE__ */ jsx35(DotIcon, {}) }),
|
|
40692
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: option })
|
|
40455
40693
|
]
|
|
40456
40694
|
},
|
|
40457
40695
|
option
|
|
@@ -40459,7 +40697,7 @@ var ContextMenu = ({
|
|
|
40459
40697
|
}
|
|
40460
40698
|
) })
|
|
40461
40699
|
] }),
|
|
40462
|
-
/* @__PURE__ */
|
|
40700
|
+
/* @__PURE__ */ jsxs9(
|
|
40463
40701
|
Item22,
|
|
40464
40702
|
{
|
|
40465
40703
|
style: {
|
|
@@ -40476,12 +40714,12 @@ var ContextMenu = ({
|
|
|
40476
40714
|
onMouseLeave: () => setHoveredItem(null),
|
|
40477
40715
|
onTouchStart: () => setHoveredItem("autorotate"),
|
|
40478
40716
|
children: [
|
|
40479
|
-
/* @__PURE__ */
|
|
40480
|
-
/* @__PURE__ */
|
|
40717
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: autoRotate && /* @__PURE__ */ jsx35(CheckIcon, {}) }),
|
|
40718
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Auto rotate" })
|
|
40481
40719
|
]
|
|
40482
40720
|
}
|
|
40483
40721
|
),
|
|
40484
|
-
/* @__PURE__ */
|
|
40722
|
+
/* @__PURE__ */ jsxs9(
|
|
40485
40723
|
Item22,
|
|
40486
40724
|
{
|
|
40487
40725
|
style: {
|
|
@@ -40500,14 +40738,14 @@ var ContextMenu = ({
|
|
|
40500
40738
|
onMouseLeave: () => setHoveredItem(null),
|
|
40501
40739
|
onTouchStart: () => setHoveredItem("cameratype"),
|
|
40502
40740
|
children: [
|
|
40503
|
-
/* @__PURE__ */
|
|
40504
|
-
/* @__PURE__ */
|
|
40741
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: cameraType === "orthographic" && /* @__PURE__ */ jsx35(CheckIcon, {}) }),
|
|
40742
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Orthographic Camera" })
|
|
40505
40743
|
]
|
|
40506
40744
|
}
|
|
40507
40745
|
),
|
|
40508
|
-
/* @__PURE__ */
|
|
40509
|
-
/* @__PURE__ */
|
|
40510
|
-
/* @__PURE__ */
|
|
40746
|
+
/* @__PURE__ */ jsx35(AppearanceMenu, {}),
|
|
40747
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
40748
|
+
/* @__PURE__ */ jsx35(
|
|
40511
40749
|
Item22,
|
|
40512
40750
|
{
|
|
40513
40751
|
style: {
|
|
@@ -40519,11 +40757,11 @@ var ContextMenu = ({
|
|
|
40519
40757
|
onMouseEnter: () => setHoveredItem("download"),
|
|
40520
40758
|
onMouseLeave: () => setHoveredItem(null),
|
|
40521
40759
|
onTouchStart: () => setHoveredItem("download"),
|
|
40522
|
-
children: /* @__PURE__ */
|
|
40760
|
+
children: /* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Download GLTF" })
|
|
40523
40761
|
}
|
|
40524
40762
|
),
|
|
40525
|
-
/* @__PURE__ */
|
|
40526
|
-
/* @__PURE__ */
|
|
40763
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
40764
|
+
/* @__PURE__ */ jsxs9(
|
|
40527
40765
|
Item22,
|
|
40528
40766
|
{
|
|
40529
40767
|
style: {
|
|
@@ -40540,12 +40778,12 @@ var ContextMenu = ({
|
|
|
40540
40778
|
onMouseLeave: () => setHoveredItem(null),
|
|
40541
40779
|
onTouchStart: () => setHoveredItem("engine"),
|
|
40542
40780
|
children: [
|
|
40543
|
-
/* @__PURE__ */
|
|
40781
|
+
/* @__PURE__ */ jsxs9("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
40544
40782
|
"Switch to ",
|
|
40545
40783
|
engine === "jscad" ? "Manifold" : "JSCAD",
|
|
40546
40784
|
" Engine"
|
|
40547
40785
|
] }),
|
|
40548
|
-
/* @__PURE__ */
|
|
40786
|
+
/* @__PURE__ */ jsx35(
|
|
40549
40787
|
"div",
|
|
40550
40788
|
{
|
|
40551
40789
|
style: {
|
|
@@ -40559,8 +40797,8 @@ var ContextMenu = ({
|
|
|
40559
40797
|
]
|
|
40560
40798
|
}
|
|
40561
40799
|
),
|
|
40562
|
-
/* @__PURE__ */
|
|
40563
|
-
/* @__PURE__ */
|
|
40800
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
40801
|
+
/* @__PURE__ */ jsxs9(
|
|
40564
40802
|
Item22,
|
|
40565
40803
|
{
|
|
40566
40804
|
style: {
|
|
@@ -40573,8 +40811,8 @@ var ContextMenu = ({
|
|
|
40573
40811
|
onMouseLeave: () => setHoveredItem(null),
|
|
40574
40812
|
onTouchStart: () => setHoveredItem("shortcuts"),
|
|
40575
40813
|
children: [
|
|
40576
|
-
/* @__PURE__ */
|
|
40577
|
-
/* @__PURE__ */
|
|
40814
|
+
/* @__PURE__ */ jsx35("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: "Keyboard Shortcuts" }),
|
|
40815
|
+
/* @__PURE__ */ jsx35(
|
|
40578
40816
|
"div",
|
|
40579
40817
|
{
|
|
40580
40818
|
style: {
|
|
@@ -40588,8 +40826,8 @@ var ContextMenu = ({
|
|
|
40588
40826
|
]
|
|
40589
40827
|
}
|
|
40590
40828
|
),
|
|
40591
|
-
/* @__PURE__ */
|
|
40592
|
-
/* @__PURE__ */
|
|
40829
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
40830
|
+
/* @__PURE__ */ jsx35(
|
|
40593
40831
|
"div",
|
|
40594
40832
|
{
|
|
40595
40833
|
style: {
|
|
@@ -40600,7 +40838,7 @@ var ContextMenu = ({
|
|
|
40600
40838
|
paddingTop: 4,
|
|
40601
40839
|
paddingBottom: 4
|
|
40602
40840
|
},
|
|
40603
|
-
children: /* @__PURE__ */
|
|
40841
|
+
children: /* @__PURE__ */ jsxs9(
|
|
40604
40842
|
"span",
|
|
40605
40843
|
{
|
|
40606
40844
|
style: {
|
|
@@ -40628,7 +40866,7 @@ var ContextMenu = ({
|
|
|
40628
40866
|
|
|
40629
40867
|
// src/components/KeyboardShortcutsDialog.tsx
|
|
40630
40868
|
import { useEffect as useEffect41, useMemo as useMemo27, useRef as useRef25, useState as useState35 } from "react";
|
|
40631
|
-
import { jsx as
|
|
40869
|
+
import { jsx as jsx36, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
40632
40870
|
var KeyboardShortcutsDialog = ({
|
|
40633
40871
|
open,
|
|
40634
40872
|
onClose
|
|
@@ -40667,7 +40905,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40667
40905
|
if (!open) {
|
|
40668
40906
|
return null;
|
|
40669
40907
|
}
|
|
40670
|
-
return /* @__PURE__ */
|
|
40908
|
+
return /* @__PURE__ */ jsx36(
|
|
40671
40909
|
"div",
|
|
40672
40910
|
{
|
|
40673
40911
|
role: "dialog",
|
|
@@ -40682,7 +40920,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40682
40920
|
zIndex: 9999
|
|
40683
40921
|
},
|
|
40684
40922
|
onClick: onClose,
|
|
40685
|
-
children: /* @__PURE__ */
|
|
40923
|
+
children: /* @__PURE__ */ jsxs10(
|
|
40686
40924
|
"div",
|
|
40687
40925
|
{
|
|
40688
40926
|
style: {
|
|
@@ -40698,7 +40936,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40698
40936
|
},
|
|
40699
40937
|
onClick: (event) => event.stopPropagation(),
|
|
40700
40938
|
children: [
|
|
40701
|
-
/* @__PURE__ */
|
|
40939
|
+
/* @__PURE__ */ jsxs10(
|
|
40702
40940
|
"header",
|
|
40703
40941
|
{
|
|
40704
40942
|
style: {
|
|
@@ -40706,8 +40944,8 @@ var KeyboardShortcutsDialog = ({
|
|
|
40706
40944
|
borderBottom: "1px solid rgba(255, 255, 255, 0.08)"
|
|
40707
40945
|
},
|
|
40708
40946
|
children: [
|
|
40709
|
-
/* @__PURE__ */
|
|
40710
|
-
/* @__PURE__ */
|
|
40947
|
+
/* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
40948
|
+
/* @__PURE__ */ jsx36(
|
|
40711
40949
|
"h2",
|
|
40712
40950
|
{
|
|
40713
40951
|
style: {
|
|
@@ -40719,7 +40957,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40719
40957
|
children: "Keyboard Shortcuts"
|
|
40720
40958
|
}
|
|
40721
40959
|
),
|
|
40722
|
-
/* @__PURE__ */
|
|
40960
|
+
/* @__PURE__ */ jsx36(
|
|
40723
40961
|
"button",
|
|
40724
40962
|
{
|
|
40725
40963
|
type: "button",
|
|
@@ -40735,7 +40973,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40735
40973
|
}
|
|
40736
40974
|
)
|
|
40737
40975
|
] }),
|
|
40738
|
-
/* @__PURE__ */
|
|
40976
|
+
/* @__PURE__ */ jsx36(
|
|
40739
40977
|
"input",
|
|
40740
40978
|
{
|
|
40741
40979
|
ref: inputRef,
|
|
@@ -40758,7 +40996,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40758
40996
|
]
|
|
40759
40997
|
}
|
|
40760
40998
|
),
|
|
40761
|
-
/* @__PURE__ */
|
|
40999
|
+
/* @__PURE__ */ jsx36("div", { style: { overflowY: "auto" }, children: /* @__PURE__ */ jsxs10(
|
|
40762
41000
|
"table",
|
|
40763
41001
|
{
|
|
40764
41002
|
style: {
|
|
@@ -40767,23 +41005,23 @@ var KeyboardShortcutsDialog = ({
|
|
|
40767
41005
|
fontSize: "0.95rem"
|
|
40768
41006
|
},
|
|
40769
41007
|
children: [
|
|
40770
|
-
/* @__PURE__ */
|
|
40771
|
-
/* @__PURE__ */
|
|
40772
|
-
/* @__PURE__ */
|
|
41008
|
+
/* @__PURE__ */ jsx36("thead", { children: /* @__PURE__ */ jsxs10("tr", { style: { textAlign: "left", color: "#a1a1b5" }, children: [
|
|
41009
|
+
/* @__PURE__ */ jsx36("th", { style: { padding: "12px 24px", width: "25%" }, children: "Key" }),
|
|
41010
|
+
/* @__PURE__ */ jsx36("th", { style: { padding: "12px 24px" }, children: "Description" })
|
|
40773
41011
|
] }) }),
|
|
40774
|
-
/* @__PURE__ */
|
|
41012
|
+
/* @__PURE__ */ jsx36("tbody", { children: filteredHotkeys.length === 0 ? /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36(
|
|
40775
41013
|
"td",
|
|
40776
41014
|
{
|
|
40777
41015
|
colSpan: 2,
|
|
40778
41016
|
style: { padding: "24px", textAlign: "center" },
|
|
40779
41017
|
children: "No shortcuts found"
|
|
40780
41018
|
}
|
|
40781
|
-
) }) : filteredHotkeys.map((hotkey) => /* @__PURE__ */
|
|
41019
|
+
) }) : filteredHotkeys.map((hotkey) => /* @__PURE__ */ jsxs10(
|
|
40782
41020
|
"tr",
|
|
40783
41021
|
{
|
|
40784
41022
|
style: { borderTop: "1px solid rgba(255, 255, 255, 0.05)" },
|
|
40785
41023
|
children: [
|
|
40786
|
-
/* @__PURE__ */
|
|
41024
|
+
/* @__PURE__ */ jsx36("td", { style: { padding: "12px 24px" }, children: /* @__PURE__ */ jsx36(
|
|
40787
41025
|
"span",
|
|
40788
41026
|
{
|
|
40789
41027
|
style: {
|
|
@@ -40801,7 +41039,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40801
41039
|
children: hotkey.shortcut
|
|
40802
41040
|
}
|
|
40803
41041
|
) }),
|
|
40804
|
-
/* @__PURE__ */
|
|
41042
|
+
/* @__PURE__ */ jsx36("td", { style: { padding: "12px 24px" }, children: hotkey.description })
|
|
40805
41043
|
]
|
|
40806
41044
|
},
|
|
40807
41045
|
hotkey.id
|
|
@@ -40817,7 +41055,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
40817
41055
|
};
|
|
40818
41056
|
|
|
40819
41057
|
// src/CadViewer.tsx
|
|
40820
|
-
import { jsx as
|
|
41058
|
+
import { jsx as jsx37, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
40821
41059
|
var CadViewerInner = (props) => {
|
|
40822
41060
|
const [engine, setEngine] = useState36("manifold");
|
|
40823
41061
|
const containerRef = useRef26(null);
|
|
@@ -40833,6 +41071,7 @@ var CadViewerInner = (props) => {
|
|
|
40833
41071
|
const [cameraPreset, setCameraPreset] = useState36("Custom");
|
|
40834
41072
|
const { cameraType, setCameraType } = useCameraController();
|
|
40835
41073
|
const { visibility, setLayerVisibility } = useLayerVisibility();
|
|
41074
|
+
const { showToast } = useToast();
|
|
40836
41075
|
const cameraControllerRef = useRef26(null);
|
|
40837
41076
|
const externalCameraControllerReady = props.onCameraControllerReady;
|
|
40838
41077
|
const {
|
|
@@ -40895,6 +41134,41 @@ var CadViewerInner = (props) => {
|
|
|
40895
41134
|
description: "Open keyboard shortcuts"
|
|
40896
41135
|
}
|
|
40897
41136
|
);
|
|
41137
|
+
useRegisteredHotkey(
|
|
41138
|
+
"toggle_smt_models",
|
|
41139
|
+
() => {
|
|
41140
|
+
const newVisibility = !visibility.smtModels;
|
|
41141
|
+
setLayerVisibility("smtModels", newVisibility);
|
|
41142
|
+
showToast(
|
|
41143
|
+
newVisibility ? "SMT components visible" : "SMT components hidden",
|
|
41144
|
+
1500
|
|
41145
|
+
);
|
|
41146
|
+
},
|
|
41147
|
+
{
|
|
41148
|
+
shortcut: "shift+s",
|
|
41149
|
+
description: "Toggle surface mount components"
|
|
41150
|
+
}
|
|
41151
|
+
);
|
|
41152
|
+
useRegisteredHotkey(
|
|
41153
|
+
"toggle_through_hole_models",
|
|
41154
|
+
() => {
|
|
41155
|
+
const newVisibility = !visibility.throughHoleModels;
|
|
41156
|
+
setLayerVisibility("throughHoleModels", newVisibility);
|
|
41157
|
+
showToast(
|
|
41158
|
+
newVisibility ? "Through-hole components visible" : "Through-hole components hidden",
|
|
41159
|
+
1500
|
|
41160
|
+
);
|
|
41161
|
+
},
|
|
41162
|
+
{
|
|
41163
|
+
shortcut: "shift+t",
|
|
41164
|
+
description: "Toggle through-hole components"
|
|
41165
|
+
}
|
|
41166
|
+
);
|
|
41167
|
+
useEffect42(() => {
|
|
41168
|
+
if (containerRef.current) {
|
|
41169
|
+
registerHotkeyViewer(containerRef.current);
|
|
41170
|
+
}
|
|
41171
|
+
}, []);
|
|
40898
41172
|
useEffect42(() => {
|
|
40899
41173
|
const stored = window.localStorage.getItem("cadViewerEngine");
|
|
40900
41174
|
if (stored === "jscad" || stored === "manifold") {
|
|
@@ -40923,7 +41197,7 @@ var CadViewerInner = (props) => {
|
|
|
40923
41197
|
window.localStorage.setItem("cadViewerCameraType", cameraType);
|
|
40924
41198
|
}, [cameraType]);
|
|
40925
41199
|
const viewerKey = props.circuitJson ? JSON.stringify(props.circuitJson) : void 0;
|
|
40926
|
-
return /* @__PURE__ */
|
|
41200
|
+
return /* @__PURE__ */ jsxs11(
|
|
40927
41201
|
"div",
|
|
40928
41202
|
{
|
|
40929
41203
|
ref: containerRef,
|
|
@@ -40939,7 +41213,7 @@ var CadViewerInner = (props) => {
|
|
|
40939
41213
|
},
|
|
40940
41214
|
...contextMenuEventHandlers,
|
|
40941
41215
|
children: [
|
|
40942
|
-
engine === "jscad" ? /* @__PURE__ */
|
|
41216
|
+
engine === "jscad" ? /* @__PURE__ */ jsx37(
|
|
40943
41217
|
CadViewerJscad,
|
|
40944
41218
|
{
|
|
40945
41219
|
...props,
|
|
@@ -40948,7 +41222,7 @@ var CadViewerInner = (props) => {
|
|
|
40948
41222
|
onUserInteraction: handleUserInteraction,
|
|
40949
41223
|
onCameraControllerReady: handleCameraControllerReady
|
|
40950
41224
|
}
|
|
40951
|
-
) : /* @__PURE__ */
|
|
41225
|
+
) : /* @__PURE__ */ jsx37(
|
|
40952
41226
|
CadViewerManifold_default,
|
|
40953
41227
|
{
|
|
40954
41228
|
...props,
|
|
@@ -40958,7 +41232,7 @@ var CadViewerInner = (props) => {
|
|
|
40958
41232
|
onCameraControllerReady: handleCameraControllerReady
|
|
40959
41233
|
}
|
|
40960
41234
|
),
|
|
40961
|
-
/* @__PURE__ */
|
|
41235
|
+
/* @__PURE__ */ jsxs11(
|
|
40962
41236
|
"div",
|
|
40963
41237
|
{
|
|
40964
41238
|
style: {
|
|
@@ -40975,11 +41249,11 @@ var CadViewerInner = (props) => {
|
|
|
40975
41249
|
},
|
|
40976
41250
|
children: [
|
|
40977
41251
|
"Engine: ",
|
|
40978
|
-
/* @__PURE__ */
|
|
41252
|
+
/* @__PURE__ */ jsx37("b", { children: engine === "jscad" ? "JSCAD" : "Manifold" })
|
|
40979
41253
|
]
|
|
40980
41254
|
}
|
|
40981
41255
|
),
|
|
40982
|
-
menuVisible && /* @__PURE__ */
|
|
41256
|
+
menuVisible && /* @__PURE__ */ jsx37(
|
|
40983
41257
|
ContextMenu,
|
|
40984
41258
|
{
|
|
40985
41259
|
menuRef,
|
|
@@ -41006,7 +41280,7 @@ var CadViewerInner = (props) => {
|
|
|
41006
41280
|
}
|
|
41007
41281
|
}
|
|
41008
41282
|
),
|
|
41009
|
-
/* @__PURE__ */
|
|
41283
|
+
/* @__PURE__ */ jsx37(
|
|
41010
41284
|
KeyboardShortcutsDialog,
|
|
41011
41285
|
{
|
|
41012
41286
|
open: isKeyboardShortcutsDialogOpen,
|
|
@@ -41024,12 +41298,12 @@ var CadViewer = (props) => {
|
|
|
41024
41298
|
() => [5, -5, 5],
|
|
41025
41299
|
[]
|
|
41026
41300
|
);
|
|
41027
|
-
return /* @__PURE__ */
|
|
41301
|
+
return /* @__PURE__ */ jsx37(
|
|
41028
41302
|
CameraControllerProvider,
|
|
41029
41303
|
{
|
|
41030
41304
|
defaultTarget,
|
|
41031
41305
|
initialCameraPosition,
|
|
41032
|
-
children: /* @__PURE__ */
|
|
41306
|
+
children: /* @__PURE__ */ jsx37(LayerVisibilityProvider, { children: /* @__PURE__ */ jsx37(ToastProvider, { children: /* @__PURE__ */ jsx37(CadViewerInner, { ...props }) }) })
|
|
41033
41307
|
}
|
|
41034
41308
|
);
|
|
41035
41309
|
};
|
|
@@ -41299,8 +41573,8 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
|
|
|
41299
41573
|
scene.position.sub(center);
|
|
41300
41574
|
const maxDim = Math.max(size5.x, size5.y, size5.z);
|
|
41301
41575
|
if (maxDim > 0) {
|
|
41302
|
-
const
|
|
41303
|
-
scene.scale.multiplyScalar(
|
|
41576
|
+
const scale3 = (1 - padding / 100) / maxDim;
|
|
41577
|
+
scene.scale.multiplyScalar(scale3 * 100);
|
|
41304
41578
|
}
|
|
41305
41579
|
camera.updateProjectionMatrix();
|
|
41306
41580
|
renderer.render(scene, camera);
|