@tscircuit/3d-viewer 0.0.432 → 0.0.433
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 +22 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28174,7 +28174,7 @@ import * as THREE14 from "three";
|
|
|
28174
28174
|
// package.json
|
|
28175
28175
|
var package_default = {
|
|
28176
28176
|
name: "@tscircuit/3d-viewer",
|
|
28177
|
-
version: "0.0.
|
|
28177
|
+
version: "0.0.432",
|
|
28178
28178
|
main: "./dist/index.js",
|
|
28179
28179
|
module: "./dist/index.js",
|
|
28180
28180
|
type: "module",
|
|
@@ -33663,9 +33663,16 @@ var useContextMenu = ({ containerRef }) => {
|
|
|
33663
33663
|
}, []);
|
|
33664
33664
|
const handleClickAway = useCallback8((e) => {
|
|
33665
33665
|
const target = e.target;
|
|
33666
|
-
if (menuRef.current &&
|
|
33667
|
-
|
|
33666
|
+
if (menuRef.current && menuRef.current.contains(target)) {
|
|
33667
|
+
return;
|
|
33668
33668
|
}
|
|
33669
|
+
const isInRadixPortal = target.closest?.(
|
|
33670
|
+
"[data-radix-popper-content-wrapper], [data-radix-dropdown-menu-content], [data-radix-dropdown-menu-sub-content]"
|
|
33671
|
+
);
|
|
33672
|
+
if (isInRadixPortal) {
|
|
33673
|
+
return;
|
|
33674
|
+
}
|
|
33675
|
+
setMenuVisible(false);
|
|
33669
33676
|
}, []);
|
|
33670
33677
|
useEffect23(() => {
|
|
33671
33678
|
if (menuVisible) {
|
|
@@ -39245,6 +39252,7 @@ var AppearanceMenu = () => {
|
|
|
39245
39252
|
},
|
|
39246
39253
|
onMouseEnter: () => setHoveredItem("appearance"),
|
|
39247
39254
|
onMouseLeave: () => setHoveredItem(null),
|
|
39255
|
+
onTouchStart: () => setHoveredItem("appearance"),
|
|
39248
39256
|
children: [
|
|
39249
39257
|
/* @__PURE__ */ jsx32("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: "Appearance" }),
|
|
39250
39258
|
/* @__PURE__ */ jsx32(
|
|
@@ -39283,6 +39291,7 @@ var AppearanceMenu = () => {
|
|
|
39283
39291
|
},
|
|
39284
39292
|
onMouseEnter: () => setHoveredItem("boardBody"),
|
|
39285
39293
|
onMouseLeave: () => setHoveredItem(null),
|
|
39294
|
+
onTouchStart: () => setHoveredItem("boardBody"),
|
|
39286
39295
|
children: [
|
|
39287
39296
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.boardBody && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39288
39297
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "Board Body" })
|
|
@@ -39303,6 +39312,7 @@ var AppearanceMenu = () => {
|
|
|
39303
39312
|
},
|
|
39304
39313
|
onMouseEnter: () => setHoveredItem("topCopper"),
|
|
39305
39314
|
onMouseLeave: () => setHoveredItem(null),
|
|
39315
|
+
onTouchStart: () => setHoveredItem("topCopper"),
|
|
39306
39316
|
children: [
|
|
39307
39317
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.topCopper && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39308
39318
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "Top Copper" })
|
|
@@ -39323,6 +39333,7 @@ var AppearanceMenu = () => {
|
|
|
39323
39333
|
},
|
|
39324
39334
|
onMouseEnter: () => setHoveredItem("bottomCopper"),
|
|
39325
39335
|
onMouseLeave: () => setHoveredItem(null),
|
|
39336
|
+
onTouchStart: () => setHoveredItem("bottomCopper"),
|
|
39326
39337
|
children: [
|
|
39327
39338
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.bottomCopper && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39328
39339
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Copper" })
|
|
@@ -39343,6 +39354,7 @@ var AppearanceMenu = () => {
|
|
|
39343
39354
|
},
|
|
39344
39355
|
onMouseEnter: () => setHoveredItem("topSilkscreen"),
|
|
39345
39356
|
onMouseLeave: () => setHoveredItem(null),
|
|
39357
|
+
onTouchStart: () => setHoveredItem("topSilkscreen"),
|
|
39346
39358
|
children: [
|
|
39347
39359
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.topSilkscreen && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39348
39360
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "Top Silkscreen" })
|
|
@@ -39363,6 +39375,7 @@ var AppearanceMenu = () => {
|
|
|
39363
39375
|
},
|
|
39364
39376
|
onMouseEnter: () => setHoveredItem("bottomSilkscreen"),
|
|
39365
39377
|
onMouseLeave: () => setHoveredItem(null),
|
|
39378
|
+
onTouchStart: () => setHoveredItem("bottomSilkscreen"),
|
|
39366
39379
|
children: [
|
|
39367
39380
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.bottomSilkscreen && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39368
39381
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Silkscreen" })
|
|
@@ -39383,6 +39396,7 @@ var AppearanceMenu = () => {
|
|
|
39383
39396
|
},
|
|
39384
39397
|
onMouseEnter: () => setHoveredItem("smtModels"),
|
|
39385
39398
|
onMouseLeave: () => setHoveredItem(null),
|
|
39399
|
+
onTouchStart: () => setHoveredItem("smtModels"),
|
|
39386
39400
|
children: [
|
|
39387
39401
|
/* @__PURE__ */ jsx32("span", { style: iconContainerStyles, children: visibility.smtModels && /* @__PURE__ */ jsx32(CheckIcon, {}) }),
|
|
39388
39402
|
/* @__PURE__ */ jsx32("span", { style: { display: "flex", alignItems: "center" }, children: "CAD Models" })
|
|
@@ -39512,6 +39526,7 @@ var ContextMenu = ({
|
|
|
39512
39526
|
},
|
|
39513
39527
|
onMouseEnter: () => setHoveredItem("camera"),
|
|
39514
39528
|
onMouseLeave: () => setHoveredItem(null),
|
|
39529
|
+
onTouchStart: () => setHoveredItem("camera"),
|
|
39515
39530
|
children: [
|
|
39516
39531
|
/* @__PURE__ */ jsx33(
|
|
39517
39532
|
"span",
|
|
@@ -39558,6 +39573,7 @@ var ContextMenu = ({
|
|
|
39558
39573
|
},
|
|
39559
39574
|
onMouseEnter: () => setHoveredItem(option),
|
|
39560
39575
|
onMouseLeave: () => setHoveredItem(null),
|
|
39576
|
+
onTouchStart: () => setHoveredItem(option),
|
|
39561
39577
|
children: [
|
|
39562
39578
|
/* @__PURE__ */ jsx33("span", { style: iconContainerStyles2, children: cameraPreset === option && /* @__PURE__ */ jsx33(DotIcon, {}) }),
|
|
39563
39579
|
/* @__PURE__ */ jsx33("span", { style: { display: "flex", alignItems: "center" }, children: option })
|
|
@@ -39583,6 +39599,7 @@ var ContextMenu = ({
|
|
|
39583
39599
|
},
|
|
39584
39600
|
onMouseEnter: () => setHoveredItem("autorotate"),
|
|
39585
39601
|
onMouseLeave: () => setHoveredItem(null),
|
|
39602
|
+
onTouchStart: () => setHoveredItem("autorotate"),
|
|
39586
39603
|
children: [
|
|
39587
39604
|
/* @__PURE__ */ jsx33("span", { style: iconContainerStyles2, children: autoRotate && /* @__PURE__ */ jsx33(CheckIcon, {}) }),
|
|
39588
39605
|
/* @__PURE__ */ jsx33("span", { style: { display: "flex", alignItems: "center" }, children: "Auto rotate" })
|
|
@@ -39602,6 +39619,7 @@ var ContextMenu = ({
|
|
|
39602
39619
|
onSelect: onDownloadGltf,
|
|
39603
39620
|
onMouseEnter: () => setHoveredItem("download"),
|
|
39604
39621
|
onMouseLeave: () => setHoveredItem(null),
|
|
39622
|
+
onTouchStart: () => setHoveredItem("download"),
|
|
39605
39623
|
children: /* @__PURE__ */ jsx33("span", { style: { display: "flex", alignItems: "center" }, children: "Download GLTF" })
|
|
39606
39624
|
}
|
|
39607
39625
|
),
|
|
@@ -39621,6 +39639,7 @@ var ContextMenu = ({
|
|
|
39621
39639
|
},
|
|
39622
39640
|
onMouseEnter: () => setHoveredItem("engine"),
|
|
39623
39641
|
onMouseLeave: () => setHoveredItem(null),
|
|
39642
|
+
onTouchStart: () => setHoveredItem("engine"),
|
|
39624
39643
|
children: [
|
|
39625
39644
|
/* @__PURE__ */ jsxs9("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
39626
39645
|
"Switch to ",
|