@tscircuit/3d-viewer 0.0.421 → 0.0.422

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -26647,7 +26647,7 @@ import * as THREE14 from "three";
26647
26647
  // package.json
26648
26648
  var package_default = {
26649
26649
  name: "@tscircuit/3d-viewer",
26650
- version: "0.0.420",
26650
+ version: "0.0.421",
26651
26651
  main: "./dist/index.js",
26652
26652
  module: "./dist/index.js",
26653
26653
  type: "module",
@@ -26718,7 +26718,7 @@ var package_default = {
26718
26718
  "react-use-gesture": "^9.1.3",
26719
26719
  semver: "^7.7.0",
26720
26720
  "strip-ansi": "^7.1.0",
26721
- tscircuit: "^0.0.746",
26721
+ tscircuit: "^0.0.834",
26722
26722
  tsup: "^8.3.6",
26723
26723
  typescript: "^5.7.3",
26724
26724
  vite: "^7.1.5",
@@ -37513,6 +37513,7 @@ var ContextMenu = ({
37513
37513
  {
37514
37514
  style: {
37515
37515
  ...itemStyles2,
37516
+ ...itemPaddingStyles2,
37516
37517
  backgroundColor: hoveredItem === "autorotate" ? "#404040" : "transparent"
37517
37518
  },
37518
37519
  onSelect: (e) => e.preventDefault(),
@@ -37623,8 +37624,14 @@ import { jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
37623
37624
  var CadViewerInner = (props) => {
37624
37625
  const [engine, setEngine] = useState33("manifold");
37625
37626
  const containerRef = useRef22(null);
37626
- const [autoRotate, setAutoRotate] = useState33(true);
37627
- const [autoRotateUserToggled, setAutoRotateUserToggled] = useState33(false);
37627
+ const [autoRotate, setAutoRotate] = useState33(() => {
37628
+ const stored = window.localStorage.getItem("cadViewerAutoRotate");
37629
+ return stored === "false" ? false : true;
37630
+ });
37631
+ const [autoRotateUserToggled, setAutoRotateUserToggled] = useState33(() => {
37632
+ const stored = window.localStorage.getItem("cadViewerAutoRotateUserToggled");
37633
+ return stored === "true";
37634
+ });
37628
37635
  const [cameraPreset, setCameraPreset] = useState33("Custom");
37629
37636
  const { visibility, toggleLayer } = useLayerVisibility();
37630
37637
  const cameraControllerRef = useRef22(null);
@@ -37680,6 +37687,15 @@ var CadViewerInner = (props) => {
37680
37687
  useEffect39(() => {
37681
37688
  window.localStorage.setItem("cadViewerEngine", engine);
37682
37689
  }, [engine]);
37690
+ useEffect39(() => {
37691
+ window.localStorage.setItem("cadViewerAutoRotate", String(autoRotate));
37692
+ }, [autoRotate]);
37693
+ useEffect39(() => {
37694
+ window.localStorage.setItem(
37695
+ "cadViewerAutoRotateUserToggled",
37696
+ String(autoRotateUserToggled)
37697
+ );
37698
+ }, [autoRotateUserToggled]);
37683
37699
  const viewerKey = props.circuitJson ? JSON.stringify(props.circuitJson) : void 0;
37684
37700
  return /* @__PURE__ */ jsxs10(
37685
37701
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.421",
3
+ "version": "0.0.422",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",
@@ -71,7 +71,7 @@
71
71
  "react-use-gesture": "^9.1.3",
72
72
  "semver": "^7.7.0",
73
73
  "strip-ansi": "^7.1.0",
74
- "tscircuit": "^0.0.746",
74
+ "tscircuit": "^0.0.834",
75
75
  "tsup": "^8.3.6",
76
76
  "typescript": "^5.7.3",
77
77
  "vite": "^7.1.5",