@webspatial/react-sdk 0.0.9 → 0.0.10
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 +6 -3
- package/dist/default/index.js.map +1 -1
- package/dist/default/index.mjs +6 -3
- package/dist/default/index.mjs.map +1 -1
- package/dist/web/index.js +6 -3
- package/dist/web/index.js.map +1 -1
- package/dist/web/index.mjs +6 -3
- package/dist/web/index.mjs.map +1 -1
- package/package.json +7 -4
package/dist/web/index.js
CHANGED
|
@@ -3251,15 +3251,18 @@ function parseChildren(child) {
|
|
|
3251
3251
|
}
|
|
3252
3252
|
const gltfSources = sourceElements.filter((node) => {
|
|
3253
3253
|
const type = node.props?.type.trim();
|
|
3254
|
-
|
|
3254
|
+
const source = node.props?.src.trim().toLowerCase();
|
|
3255
|
+
const isGLFT = source.endsWith(".gltf");
|
|
3256
|
+
const isGLB = source.endsWith(".glb");
|
|
3257
|
+
return type.startsWith("model/gltf-binary") && isGLB || type.startsWith("model/gltf+json") && isGLFT;
|
|
3255
3258
|
});
|
|
3256
3259
|
const usdzSources = sourceElements.filter(
|
|
3257
3260
|
(node) => node.props?.type.trim().startsWith("model/vnd.usdz+zip")
|
|
3258
3261
|
);
|
|
3259
3262
|
let lastChild = children[children.length - 1];
|
|
3260
3263
|
const placeHolder = sourceElements.indexOf(lastChild) < 0 ? lastChild : void 0;
|
|
3261
|
-
const gltfSourceURL = gltfSources.length > 0
|
|
3262
|
-
const usdzSourceURL = usdzSources.length > 0
|
|
3264
|
+
const gltfSourceURL = gltfSources.length > 0 ? gltfSources[0].props?.src : "";
|
|
3265
|
+
const usdzSourceURL = usdzSources.length > 0 ? usdzSources[0].props?.src : "";
|
|
3263
3266
|
return {
|
|
3264
3267
|
placeHolder,
|
|
3265
3268
|
gltfSourceURL: getAbsoluteURL(gltfSourceURL),
|