@webspatial/react-sdk 1.0.1 → 1.0.3

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.
@@ -175,7 +175,7 @@ declare const defaultSceneConfig: WindowContainerOptions;
175
175
  declare class XRApp {
176
176
  private static instance;
177
177
  static getInstance(): XRApp;
178
- handleATag(event: MouseEvent): void;
178
+ handleATag(event: MouseEvent): true | undefined;
179
179
  init(): void;
180
180
  deinit(): void;
181
181
  private configMap;
@@ -2,7 +2,7 @@
2
2
  (function(){
3
3
  if(typeof window === 'undefined') return;
4
4
  if(!window.__webspatialsdk__) window.__webspatialsdk__ = {}
5
- window.__webspatialsdk__['react-sdk-version'] = "1.0.1"
5
+ window.__webspatialsdk__['react-sdk-version'] = "1.0.3"
6
6
  window.__webspatialsdk__['XR_ENV'] = "avp"
7
7
  })()
8
8
 
@@ -760,6 +760,7 @@ var XRApp = class _XRApp {
760
760
  if (target && target !== "_self") {
761
761
  event.preventDefault();
762
762
  window.open(url, target);
763
+ return true;
763
764
  }
764
765
  }
765
766
  }
@@ -884,7 +885,11 @@ function handleOpenWindowDocumentClick(openedWindow) {
884
885
  let found = false;
885
886
  while (!found) {
886
887
  if (element && element.tagName == "A") {
887
- XRApp.getInstance().handleATag(e);
888
+ found = true;
889
+ const isOpenWindow = XRApp.getInstance().handleATag(e);
890
+ if (!isOpenWindow) {
891
+ openedWindow.opener.location.href = element.href;
892
+ }
888
893
  return false;
889
894
  }
890
895
  if (element && element.parentElement) {
@@ -2008,8 +2013,12 @@ function renderRootCSSSpatialComponent(inProps, refIn) {
2008
2013
  const { ref, spatialStyle, ready } = useSpatialStyle();
2009
2014
  const divRefStyle = {
2010
2015
  ...style,
2011
- width: 0,
2012
- height: 0,
2016
+ // width: 0,
2017
+ // height: 0,
2018
+ left: -1e4,
2019
+ top: -1e4,
2020
+ opacity: 0,
2021
+ pointerEvents: "none",
2013
2022
  padding: 0,
2014
2023
  transition: "none",
2015
2024
  position: "absolute"
@@ -2082,8 +2091,12 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
2082
2091
  const { ref, spatialStyle, ready } = useSpatialStyle();
2083
2092
  const divRefStyle = {
2084
2093
  ...style,
2085
- width: 0,
2086
- height: 0,
2094
+ // width: 0,
2095
+ // height: 0,
2096
+ left: -1e4,
2097
+ top: -1e4,
2098
+ opacity: 0,
2099
+ pointerEvents: "none",
2087
2100
  padding: 0,
2088
2101
  transition: "none",
2089
2102
  position: "absolute"
@@ -3237,8 +3250,12 @@ function renderCSSModel3DNotInSpatialDiv(inProps, refIn) {
3237
3250
  const { className, style = {}, ...props } = inProps;
3238
3251
  const cssParserDomStyle = {
3239
3252
  ...style,
3240
- width: 0,
3241
- height: 0,
3253
+ // width: 0,
3254
+ // height: 0,
3255
+ left: -1e4,
3256
+ top: -1e4,
3257
+ opacity: 0,
3258
+ pointerEvents: "none",
3242
3259
  padding: 0,
3243
3260
  position: "absolute"
3244
3261
  };
@@ -3326,8 +3343,12 @@ function renderCSSModel3DPortalInstance(spatialId, inProps) {
3326
3343
  }, [ref.current]);
3327
3344
  const cssParserDomStyle = {
3328
3345
  ...style,
3329
- width: 0,
3330
- height: 0,
3346
+ // width: 0,
3347
+ // height: 0,
3348
+ left: -1e4,
3349
+ top: -1e4,
3350
+ opacity: 0,
3351
+ pointerEvents: "none",
3331
3352
  padding: 0,
3332
3353
  position: "absolute"
3333
3354
  };
@@ -3605,7 +3626,7 @@ async function injectSceneHook() {
3605
3626
  let cfg = defaultSceneConfig;
3606
3627
  if (typeof window.xrCurrentSceneDefaults === "function") {
3607
3628
  try {
3608
- cfg = await window.xrCurrentSceneDefaults?.();
3629
+ cfg = await window.xrCurrentSceneDefaults?.(defaultSceneConfig);
3609
3630
  } catch (error) {
3610
3631
  console.error(error);
3611
3632
  }
@@ -3790,7 +3811,7 @@ function spatialPolyfill() {
3790
3811
  }
3791
3812
 
3792
3813
  // src/index.ts
3793
- var version = "1.0.1";
3814
+ var version = "1.0.3";
3794
3815
  export {
3795
3816
  CSSSpatialDiv,
3796
3817
  CSSSpatialPrimitive,