@webspatial/react-sdk 0.1.8 → 0.1.9
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 +12 -1
- package/dist/default/index.js.map +1 -1
- package/dist/web/index.js +12 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +2 -2
package/dist/default/index.js
CHANGED
|
@@ -3377,6 +3377,15 @@ CSSModel3D.displayName = "CSSModel3D";
|
|
|
3377
3377
|
|
|
3378
3378
|
// src/spatial-react-components/Model/index.tsx
|
|
3379
3379
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3380
|
+
{
|
|
3381
|
+
const styleElement = document.createElement("style");
|
|
3382
|
+
styleElement.id = "__custom-class-model-webspatial";
|
|
3383
|
+
styleElement.innerHTML = `.__custom-class-model-webspatial { width: 300px; height: 300px; }`;
|
|
3384
|
+
if (document.getElementById("__custom-class-model-webspatial")) {
|
|
3385
|
+
console.warn("__custom-class-model-webspatial already exists");
|
|
3386
|
+
}
|
|
3387
|
+
document.head.prepend(styleElement);
|
|
3388
|
+
}
|
|
3380
3389
|
function renderInModel3D(inProps, ref, modelUrl, placeHolder) {
|
|
3381
3390
|
const { poster, ...props } = inProps;
|
|
3382
3391
|
return /* @__PURE__ */ jsxs6(CSSModel3D, { modelUrl, ...props, ref, children: [
|
|
@@ -3418,6 +3427,8 @@ function parseChildren(child) {
|
|
|
3418
3427
|
}
|
|
3419
3428
|
function ModelBase(inProps, ref) {
|
|
3420
3429
|
const { children, ...props } = inProps;
|
|
3430
|
+
props.className = "__custom-class-model-webspatial " + (props.className ? props.className : "");
|
|
3431
|
+
let className = props.className;
|
|
3421
3432
|
const { placeHolder, gltfSourceURL, usdzSourceURL } = useMemo9(
|
|
3422
3433
|
() => parseChildren(children),
|
|
3423
3434
|
[children]
|
|
@@ -3437,7 +3448,7 @@ function ModelBase(inProps, ref) {
|
|
|
3437
3448
|
}
|
|
3438
3449
|
}, []);
|
|
3439
3450
|
const myModelViewer = useRef12(null);
|
|
3440
|
-
const {
|
|
3451
|
+
const { style = {}, ...props2 } = inProps;
|
|
3441
3452
|
const isDragging = useRef12(false);
|
|
3442
3453
|
let [modelViewerExists, setModelViewerExists] = useState6(false);
|
|
3443
3454
|
useEffect16(() => {
|