@tscircuit/3d-viewer 0.0.294 → 0.0.296

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 +13 -17
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -16967,6 +16967,11 @@ function useGlobalObjLoader(url) {
16967
16967
  async function loadAndParseObj() {
16968
16968
  try {
16969
16969
  const response = await fetch(url);
16970
+ if (!response.ok) {
16971
+ throw new Error(
16972
+ `Failed to fetch "${url}": ${response.status} ${response.statusText}`
16973
+ );
16974
+ }
16970
16975
  const text = await response.text();
16971
16976
  const mtlContent = text.match(/newmtl[\s\S]*?endmtl/g)?.join("\n").replace(/d 0\./g, "d 1.");
16972
16977
  const objContent = text.replace(/newmtl[\s\S]*?endmtl/g, "");
@@ -16994,7 +16999,10 @@ function useGlobalObjLoader(url) {
16994
16999
  if (cacheItem.result) {
16995
17000
  return Promise.resolve(cacheItem.result.clone());
16996
17001
  }
16997
- return cacheItem.promise.then((result) => result.clone());
17002
+ return cacheItem.promise.then((result) => {
17003
+ if (result instanceof Error) return result;
17004
+ return result.clone();
17005
+ });
16998
17006
  }
16999
17007
  const promise = loadAndParseObj().then((result) => {
17000
17008
  if (result instanceof Error) {
@@ -17045,19 +17053,7 @@ function MixedStlModel({
17045
17053
  );
17046
17054
  }
17047
17055
  if (obj instanceof Error) {
17048
- return /* @__PURE__ */ jsx2(
17049
- ContainerWithTooltip_default,
17050
- {
17051
- isHovered,
17052
- onHover,
17053
- onUnhover,
17054
- children: /* @__PURE__ */ jsxs("mesh", { position, children: [
17055
- /* @__PURE__ */ jsx2("boxGeometry", { args: [0.5, 0.5, 0.5] }),
17056
- /* @__PURE__ */ jsx2("meshStandardMaterial", { transparent: true, color: "red", opacity: 0.5 }),
17057
- /* @__PURE__ */ jsx2("meshBasicMaterial", { color: "red" })
17058
- ] })
17059
- }
17060
- );
17056
+ throw obj;
17061
17057
  }
17062
17058
  return /* @__PURE__ */ jsx2(
17063
17059
  ContainerWithTooltip_default,
@@ -17282,7 +17278,7 @@ import {
17282
17278
  // package.json
17283
17279
  var package_default = {
17284
17280
  name: "@tscircuit/3d-viewer",
17285
- version: "0.0.293",
17281
+ version: "0.0.295",
17286
17282
  main: "./dist/index.js",
17287
17283
  module: "./dist/index.js",
17288
17284
  type: "module",
@@ -17314,7 +17310,7 @@ var package_default = {
17314
17310
  "@react-three/drei": "^9.121.4",
17315
17311
  "@react-three/fiber": "^8.17.14",
17316
17312
  "@tscircuit/core": "^0.0.454",
17317
- "@tscircuit/props": "^0.0.247",
17313
+ "@tscircuit/props": "^0.0.248",
17318
17314
  "@tscircuit/soup-util": "^0.0.41",
17319
17315
  "jscad-electronics": "^0.0.29",
17320
17316
  "jscad-fiber": "^0.0.79",
@@ -17346,7 +17342,7 @@ var package_default = {
17346
17342
  "@types/three": "^0.165.0",
17347
17343
  "@vitejs/plugin-react": "^4.3.4",
17348
17344
  "bun-match-svg": "^0.0.9",
17349
- "bun-types": "^1.2.1",
17345
+ "bun-types": "1.2.1",
17350
17346
  "circuit-json": "^0.0.190",
17351
17347
  "circuit-to-svg": "^0.0.130",
17352
17348
  debug: "^4.4.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.294",
3
+ "version": "0.0.296",
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.247",
35
+ "@tscircuit/props": "^0.0.248",
36
36
  "@tscircuit/soup-util": "^0.0.41",
37
37
  "jscad-electronics": "^0.0.29",
38
38
  "jscad-fiber": "^0.0.79",
@@ -64,7 +64,7 @@
64
64
  "@types/three": "^0.165.0",
65
65
  "@vitejs/plugin-react": "^4.3.4",
66
66
  "bun-match-svg": "^0.0.9",
67
- "bun-types": "^1.2.1",
67
+ "bun-types": "1.2.1",
68
68
  "circuit-json": "^0.0.190",
69
69
  "circuit-to-svg": "^0.0.130",
70
70
  "debug": "^4.4.0",