@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.
@@ -147,7 +147,7 @@ import { Spatial } from "@webspatial/core-sdk";
147
147
  var spatial = null;
148
148
  var _currentSession = null;
149
149
  function getSession() {
150
- if ("false") return null;
150
+ if (false) return null;
151
151
  if (!spatial) {
152
152
  spatial = new Spatial();
153
153
  }
@@ -405,7 +405,7 @@ var SpatialWindowManager = class {
405
405
  this.entity?._setName(debugName);
406
406
  }
407
407
  async initInternal(url) {
408
- if ("false") return;
408
+ if (false) return;
409
409
  this.entity = await getSession().createEntity();
410
410
  this.webview = await getSession().createWindowComponent();
411
411
  await this.webview.loadURL(url);
@@ -418,7 +418,7 @@ var SpatialWindowManager = class {
418
418
  await this.entity.setParent(ent);
419
419
  }
420
420
  async initInternalFromWindow(parentSpatialWindowManager) {
421
- if ("false") return;
421
+ if (false) return;
422
422
  var w = await getSession().createWindowContext();
423
423
  this.window = w;
424
424
  this.entity = await getSession().createEntity();
@@ -1746,7 +1746,7 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
1746
1746
  }
1747
1747
  function CSSSpatialComponentBase(inProps, ref) {
1748
1748
  const { [CSSSpatialID]: cssSpatialID, ...props } = inProps;
1749
- const isWebEnv = "false";
1749
+ const isWebEnv = !getSession();
1750
1750
  if (isWebEnv) {
1751
1751
  return renderInWebEnv(props, ref);
1752
1752
  } else {
@@ -1865,7 +1865,7 @@ var SpatialViewEl = forwardRef6(
1865
1865
  return /* @__PURE__ */ jsx7("div", { ref: divRef, ...props, children: "WebSpatial is not supported in this browser" });
1866
1866
  }
1867
1867
  useEffect8(() => {
1868
- if ("false") return;
1868
+ if (false) return;
1869
1869
  activePromise.current = runAsync(async () => {
1870
1870
  if (activePromise.current) {
1871
1871
  await activePromise.current;
@@ -1878,7 +1878,7 @@ var SpatialViewEl = forwardRef6(
1878
1878
  }
1879
1879
  });
1880
1880
  return () => {
1881
- if ("false") return;
1881
+ if (false) return;
1882
1882
  runAsync(async () => {
1883
1883
  await activePromise.current;
1884
1884
  spatialEntity.current?.destroy();
@@ -1996,7 +1996,7 @@ var Model3DNative = class {
1996
1996
  return this.initPromise;
1997
1997
  }
1998
1998
  async initInternal(modelUrl, onSuccess, onFailure) {
1999
- if ("false") return;
1999
+ if (false) return;
2000
2000
  var session = getSession();
2001
2001
  if (!session) {
2002
2002
  return;