@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
package/dist/default/index.js
CHANGED
|
@@ -198,7 +198,7 @@ var import_core_sdk = require("@webspatial/core-sdk");
|
|
|
198
198
|
var spatial = null;
|
|
199
199
|
var _currentSession = null;
|
|
200
200
|
function getSession() {
|
|
201
|
-
if (
|
|
201
|
+
if (false) return null;
|
|
202
202
|
if (!spatial) {
|
|
203
203
|
spatial = new import_core_sdk.Spatial();
|
|
204
204
|
}
|
|
@@ -214,7 +214,7 @@ function getSession() {
|
|
|
214
214
|
|
|
215
215
|
// src/utils/debugTool.ts
|
|
216
216
|
async function getStat() {
|
|
217
|
-
if (
|
|
217
|
+
if (false) return;
|
|
218
218
|
const statsInfo = await getSession()._getStats();
|
|
219
219
|
return statsInfo;
|
|
220
220
|
}
|
|
@@ -267,7 +267,7 @@ async function inspectRootWindowContainer(simple) {
|
|
|
267
267
|
return rootWindowContainerInfo;
|
|
268
268
|
}
|
|
269
269
|
function enableDebugTool() {
|
|
270
|
-
if (
|
|
270
|
+
if (false) return;
|
|
271
271
|
const session = getSession();
|
|
272
272
|
Object.assign(window, {
|
|
273
273
|
session,
|
|
@@ -507,7 +507,7 @@ var SpatialWindowManager = class {
|
|
|
507
507
|
this.entity?._setName(debugName);
|
|
508
508
|
}
|
|
509
509
|
async initInternal(url) {
|
|
510
|
-
if (
|
|
510
|
+
if (false) return;
|
|
511
511
|
this.entity = await getSession().createEntity();
|
|
512
512
|
this.webview = await getSession().createWindowComponent();
|
|
513
513
|
await this.webview.loadURL(url);
|
|
@@ -520,7 +520,7 @@ var SpatialWindowManager = class {
|
|
|
520
520
|
await this.entity.setParent(ent);
|
|
521
521
|
}
|
|
522
522
|
async initInternalFromWindow(parentSpatialWindowManager) {
|
|
523
|
-
if (
|
|
523
|
+
if (false) return;
|
|
524
524
|
var w = await getSession().createWindowContext();
|
|
525
525
|
this.window = w;
|
|
526
526
|
this.entity = await getSession().createEntity();
|
|
@@ -1905,7 +1905,7 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
|
|
|
1905
1905
|
}
|
|
1906
1906
|
function CSSSpatialComponentBase(inProps, ref) {
|
|
1907
1907
|
const { [CSSSpatialID]: cssSpatialID, ...props } = inProps;
|
|
1908
|
-
const isWebEnv =
|
|
1908
|
+
const isWebEnv = !getSession();
|
|
1909
1909
|
if (isWebEnv) {
|
|
1910
1910
|
return renderInWebEnv(props, ref);
|
|
1911
1911
|
} else {
|
|
@@ -2019,7 +2019,7 @@ var SpatialViewEl = (0, import_react21.forwardRef)(
|
|
|
2019
2019
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: divRef, ...props, children: "WebSpatial is not supported in this browser" });
|
|
2020
2020
|
}
|
|
2021
2021
|
(0, import_react21.useEffect)(() => {
|
|
2022
|
-
if (
|
|
2022
|
+
if (false) return;
|
|
2023
2023
|
activePromise.current = runAsync(async () => {
|
|
2024
2024
|
if (activePromise.current) {
|
|
2025
2025
|
await activePromise.current;
|
|
@@ -2032,7 +2032,7 @@ var SpatialViewEl = (0, import_react21.forwardRef)(
|
|
|
2032
2032
|
}
|
|
2033
2033
|
});
|
|
2034
2034
|
return () => {
|
|
2035
|
-
if (
|
|
2035
|
+
if (false) return;
|
|
2036
2036
|
runAsync(async () => {
|
|
2037
2037
|
await activePromise.current;
|
|
2038
2038
|
spatialEntity.current?.destroy();
|
|
@@ -2145,7 +2145,7 @@ var Model3DNative = class {
|
|
|
2145
2145
|
return this.initPromise;
|
|
2146
2146
|
}
|
|
2147
2147
|
async initInternal(modelUrl, onSuccess, onFailure) {
|
|
2148
|
-
if (
|
|
2148
|
+
if (false) return;
|
|
2149
2149
|
var session = getSession();
|
|
2150
2150
|
if (!session) {
|
|
2151
2151
|
return;
|