@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.mjs
CHANGED
|
@@ -3236,15 +3236,18 @@ function parseChildren(child) {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
const gltfSources = sourceElements.filter((node) => {
|
|
3238
3238
|
const type = node.props?.type.trim();
|
|
3239
|
-
|
|
3239
|
+
const source = node.props?.src.trim().toLowerCase();
|
|
3240
|
+
const isGLFT = source.endsWith(".gltf");
|
|
3241
|
+
const isGLB = source.endsWith(".glb");
|
|
3242
|
+
return type.startsWith("model/gltf-binary") && isGLB || type.startsWith("model/gltf+json") && isGLFT;
|
|
3240
3243
|
});
|
|
3241
3244
|
const usdzSources = sourceElements.filter(
|
|
3242
3245
|
(node) => node.props?.type.trim().startsWith("model/vnd.usdz+zip")
|
|
3243
3246
|
);
|
|
3244
3247
|
let lastChild = children[children.length - 1];
|
|
3245
3248
|
const placeHolder = sourceElements.indexOf(lastChild) < 0 ? lastChild : void 0;
|
|
3246
|
-
const gltfSourceURL = gltfSources.length > 0
|
|
3247
|
-
const usdzSourceURL = usdzSources.length > 0
|
|
3249
|
+
const gltfSourceURL = gltfSources.length > 0 ? gltfSources[0].props?.src : "";
|
|
3250
|
+
const usdzSourceURL = usdzSources.length > 0 ? usdzSources[0].props?.src : "";
|
|
3248
3251
|
return {
|
|
3249
3252
|
placeHolder,
|
|
3250
3253
|
gltfSourceURL: getAbsoluteURL(gltfSourceURL),
|