@tscircuit/3d-viewer 0.0.277 → 0.0.279
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 +27 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17282,7 +17282,7 @@ import {
|
|
|
17282
17282
|
// package.json
|
|
17283
17283
|
var package_default = {
|
|
17284
17284
|
name: "@tscircuit/3d-viewer",
|
|
17285
|
-
version: "0.0.
|
|
17285
|
+
version: "0.0.278",
|
|
17286
17286
|
main: "./dist/index.js",
|
|
17287
17287
|
module: "./dist/index.js",
|
|
17288
17288
|
type: "module",
|
|
@@ -17314,7 +17314,7 @@ var package_default = {
|
|
|
17314
17314
|
"@react-three/drei": "^9.121.4",
|
|
17315
17315
|
"@react-three/fiber": "^8.17.14",
|
|
17316
17316
|
"@tscircuit/core": "^0.0.454",
|
|
17317
|
-
"@tscircuit/props": "^0.0.
|
|
17317
|
+
"@tscircuit/props": "^0.0.237",
|
|
17318
17318
|
"@tscircuit/soup-util": "^0.0.41",
|
|
17319
17319
|
"jscad-electronics": "^0.0.29",
|
|
17320
17320
|
"jscad-fiber": "^0.0.79",
|
|
@@ -19988,6 +19988,7 @@ function createTextureMeshes(textures, boardData, pcbThickness) {
|
|
|
19988
19988
|
|
|
19989
19989
|
// src/CadViewerManifold.tsx
|
|
19990
19990
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
19991
|
+
var MANIFOLD_CDN_BASE_URL = "https://cdn.jsdelivr.net/npm/manifold-3d@3.1.1";
|
|
19991
19992
|
var CadViewerManifold = ({
|
|
19992
19993
|
circuitJson,
|
|
19993
19994
|
autoRotateDisabled,
|
|
@@ -19996,17 +19997,30 @@ var CadViewerManifold = ({
|
|
|
19996
19997
|
const [manifoldJSModule, setManifoldJSModule] = useState9(null);
|
|
19997
19998
|
const [manifoldLoadingError, setManifoldLoadingError] = useState9(null);
|
|
19998
19999
|
useEffect6(() => {
|
|
19999
|
-
const
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
|
|
20000
|
+
const loadManifoldWasmFromCDN = async () => {
|
|
20001
|
+
try {
|
|
20002
|
+
const wasmUrl = `${MANIFOLD_CDN_BASE_URL}/manifold.wasm`;
|
|
20003
|
+
const manifoldConfig = {
|
|
20004
|
+
locateFile: (path, scriptDirectory) => {
|
|
20005
|
+
if (path === "manifold.wasm") {
|
|
20006
|
+
return wasmUrl;
|
|
20007
|
+
}
|
|
20008
|
+
return scriptDirectory + path;
|
|
20009
|
+
}
|
|
20010
|
+
};
|
|
20011
|
+
const loadedModule = await ManifoldModule(
|
|
20012
|
+
manifoldConfig
|
|
20013
|
+
);
|
|
20014
|
+
loadedModule.setup();
|
|
20015
|
+
setManifoldJSModule(loadedModule);
|
|
20016
|
+
} catch (error) {
|
|
20017
|
+
console.error("Failed to load Manifold from CDN:", error);
|
|
20018
|
+
setManifoldLoadingError(
|
|
20019
|
+
`Failed to load Manifold module: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
20020
|
+
);
|
|
20021
|
+
}
|
|
20022
|
+
};
|
|
20023
|
+
loadManifoldWasmFromCDN();
|
|
20010
20024
|
}, []);
|
|
20011
20025
|
const {
|
|
20012
20026
|
geoms,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/3d-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.279",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@react-three/drei": "^9.121.4",
|
|
33
33
|
"@react-three/fiber": "^8.17.14",
|
|
34
34
|
"@tscircuit/core": "^0.0.454",
|
|
35
|
-
"@tscircuit/props": "^0.0.
|
|
35
|
+
"@tscircuit/props": "^0.0.237",
|
|
36
36
|
"@tscircuit/soup-util": "^0.0.41",
|
|
37
37
|
"jscad-electronics": "^0.0.29",
|
|
38
38
|
"jscad-fiber": "^0.0.79",
|