@webspatial/react-sdk 0.1.5 → 0.1.7
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/default/index.js +11 -9
- package/dist/default/index.js.map +1 -1
- package/dist/web/index.js +11 -9
- package/dist/web/index.js.map +1 -1
- package/package.json +2 -2
package/dist/default/index.js
CHANGED
|
@@ -865,7 +865,8 @@ function renderJSXPortalInstance(inProps, inheritedPortalStyle, className) {
|
|
|
865
865
|
marginTop: "0px",
|
|
866
866
|
marginBottom: "0px",
|
|
867
867
|
borderRadius: "0px",
|
|
868
|
-
overflow: ""
|
|
868
|
+
overflow: "",
|
|
869
|
+
display: "block"
|
|
869
870
|
};
|
|
870
871
|
const style = {
|
|
871
872
|
...inStyle,
|
|
@@ -1222,9 +1223,10 @@ function PortalInstance(inProps) {
|
|
|
1222
1223
|
className
|
|
1223
1224
|
);
|
|
1224
1225
|
const needRenderPlaceHolder = isSubPortal && inheritedPortalStyle.position !== "absolute" && inheritedPortalStyle.position !== "fixed";
|
|
1226
|
+
const El = props.El;
|
|
1225
1227
|
return /* @__PURE__ */ jsxs(SpatialWindowManagerContext.Provider, { value: spatialWindowManager, children: [
|
|
1226
1228
|
needRenderPlaceHolder && /* @__PURE__ */ jsx2(
|
|
1227
|
-
|
|
1229
|
+
El,
|
|
1228
1230
|
{
|
|
1229
1231
|
className,
|
|
1230
1232
|
"data-subportal-spatialid": spatialId,
|
|
@@ -3413,7 +3415,7 @@ function ModelBase(inProps, ref) {
|
|
|
3413
3415
|
);
|
|
3414
3416
|
const isWebEnv = !getSession();
|
|
3415
3417
|
if (isWebEnv) {
|
|
3416
|
-
const loadFailed =
|
|
3418
|
+
const [loadFailed, setLoadFailed] = useState6(false);
|
|
3417
3419
|
useEffect16(() => {
|
|
3418
3420
|
if (gltfSourceURL == "") {
|
|
3419
3421
|
console.warn("Unable to display model, no gltf/glb source provided");
|
|
@@ -3422,7 +3424,7 @@ function ModelBase(inProps, ref) {
|
|
|
3422
3424
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3423
3425
|
});
|
|
3424
3426
|
}
|
|
3425
|
-
|
|
3427
|
+
setLoadFailed(true);
|
|
3426
3428
|
}
|
|
3427
3429
|
}, []);
|
|
3428
3430
|
const myModelViewer = useRef12(null);
|
|
@@ -3445,7 +3447,7 @@ function ModelBase(inProps, ref) {
|
|
|
3445
3447
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3446
3448
|
});
|
|
3447
3449
|
}
|
|
3448
|
-
|
|
3450
|
+
setLoadFailed(true);
|
|
3449
3451
|
}
|
|
3450
3452
|
}, 500);
|
|
3451
3453
|
}, []);
|
|
@@ -3460,7 +3462,7 @@ function ModelBase(inProps, ref) {
|
|
|
3460
3462
|
target: { ready: false, currentSrc: gltfSourceURL }
|
|
3461
3463
|
});
|
|
3462
3464
|
}
|
|
3463
|
-
|
|
3465
|
+
setLoadFailed(true);
|
|
3464
3466
|
}
|
|
3465
3467
|
});
|
|
3466
3468
|
myModelViewer.current.addEventListener("load", (event) => {
|
|
@@ -3469,7 +3471,7 @@ function ModelBase(inProps, ref) {
|
|
|
3469
3471
|
target: { ready: true, currentSrc: gltfSourceURL }
|
|
3470
3472
|
});
|
|
3471
3473
|
}
|
|
3472
|
-
|
|
3474
|
+
setLoadFailed(false);
|
|
3473
3475
|
});
|
|
3474
3476
|
myModelViewer.current.addEventListener("pointerdown", (event) => {
|
|
3475
3477
|
isDragging.current = true;
|
|
@@ -3533,7 +3535,7 @@ function ModelBase(inProps, ref) {
|
|
|
3533
3535
|
{
|
|
3534
3536
|
ref: myModelViewer,
|
|
3535
3537
|
style: {
|
|
3536
|
-
display: loadFailed
|
|
3538
|
+
display: loadFailed ? "none" : "",
|
|
3537
3539
|
width: "100%",
|
|
3538
3540
|
height: "100%"
|
|
3539
3541
|
},
|
|
@@ -3543,7 +3545,7 @@ function ModelBase(inProps, ref) {
|
|
|
3543
3545
|
poster: props2.poster
|
|
3544
3546
|
}
|
|
3545
3547
|
),
|
|
3546
|
-
loadFailed
|
|
3548
|
+
loadFailed ? /* @__PURE__ */ jsx16(Fragment5, { children: placeHolder }) : /* @__PURE__ */ jsx16(Fragment5, { children: " " })
|
|
3547
3549
|
] }) : /* @__PURE__ */ jsx16(Fragment5, { children: props2.poster ? /* @__PURE__ */ jsx16(
|
|
3548
3550
|
"img",
|
|
3549
3551
|
{
|