@webspatial/react-sdk 0.0.5 → 0.0.6
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 +9 -9
- package/dist/default/index.js.map +1 -1
- package/dist/default/index.mjs +9 -9
- package/dist/default/index.mjs.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js +7 -7
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.mjs +7 -7
- package/dist/jsx/jsx-dev-runtime.mjs.map +1 -1
- package/dist/jsx/jsx-runtime.js +7 -7
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.mjs +7 -7
- package/dist/jsx/jsx-runtime.mjs.map +1 -1
- package/dist/web/index.js +9 -9
- package/dist/web/index.js.map +1 -1
- package/dist/web/index.mjs +9 -9
- package/dist/web/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -185,7 +185,7 @@ var import_core_sdk = require("@webspatial/core-sdk");
|
|
|
185
185
|
var spatial = null;
|
|
186
186
|
var _currentSession = null;
|
|
187
187
|
function getSession() {
|
|
188
|
-
if (
|
|
188
|
+
if (false) return null;
|
|
189
189
|
if (!spatial) {
|
|
190
190
|
spatial = new import_core_sdk.Spatial();
|
|
191
191
|
}
|
|
@@ -430,7 +430,7 @@ var SpatialWindowManager = class {
|
|
|
430
430
|
this.entity?._setName(debugName);
|
|
431
431
|
}
|
|
432
432
|
async initInternal(url) {
|
|
433
|
-
if (
|
|
433
|
+
if (false) return;
|
|
434
434
|
this.entity = await getSession().createEntity();
|
|
435
435
|
this.webview = await getSession().createWindowComponent();
|
|
436
436
|
await this.webview.loadURL(url);
|
|
@@ -443,7 +443,7 @@ var SpatialWindowManager = class {
|
|
|
443
443
|
await this.entity.setParent(ent);
|
|
444
444
|
}
|
|
445
445
|
async initInternalFromWindow(parentSpatialWindowManager) {
|
|
446
|
-
if (
|
|
446
|
+
if (false) return;
|
|
447
447
|
var w = await getSession().createWindowContext();
|
|
448
448
|
this.window = w;
|
|
449
449
|
this.entity = await getSession().createEntity();
|
|
@@ -1765,7 +1765,7 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
|
|
|
1765
1765
|
}
|
|
1766
1766
|
function CSSSpatialComponentBase(inProps, ref) {
|
|
1767
1767
|
const { [CSSSpatialID]: cssSpatialID, ...props } = inProps;
|
|
1768
|
-
const isWebEnv =
|
|
1768
|
+
const isWebEnv = !getSession();
|
|
1769
1769
|
if (isWebEnv) {
|
|
1770
1770
|
return renderInWebEnv(props, ref);
|
|
1771
1771
|
} else {
|
|
@@ -1879,7 +1879,7 @@ var SpatialViewEl = (0, import_react21.forwardRef)(
|
|
|
1879
1879
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: divRef, ...props, children: "WebSpatial is not supported in this browser" });
|
|
1880
1880
|
}
|
|
1881
1881
|
(0, import_react21.useEffect)(() => {
|
|
1882
|
-
if (
|
|
1882
|
+
if (false) return;
|
|
1883
1883
|
activePromise.current = runAsync(async () => {
|
|
1884
1884
|
if (activePromise.current) {
|
|
1885
1885
|
await activePromise.current;
|
|
@@ -1892,7 +1892,7 @@ var SpatialViewEl = (0, import_react21.forwardRef)(
|
|
|
1892
1892
|
}
|
|
1893
1893
|
});
|
|
1894
1894
|
return () => {
|
|
1895
|
-
if (
|
|
1895
|
+
if (false) return;
|
|
1896
1896
|
runAsync(async () => {
|
|
1897
1897
|
await activePromise.current;
|
|
1898
1898
|
spatialEntity.current?.destroy();
|
|
@@ -2004,7 +2004,7 @@ var Model3DNative = class {
|
|
|
2004
2004
|
return this.initPromise;
|
|
2005
2005
|
}
|
|
2006
2006
|
async initInternal(modelUrl, onSuccess, onFailure) {
|
|
2007
|
-
if (
|
|
2007
|
+
if (false) return;
|
|
2008
2008
|
var session = getSession();
|
|
2009
2009
|
if (!session) {
|
|
2010
2010
|
return;
|