@webspatial/react-sdk 0.0.3 → 0.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CSSSpatialComponent.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/CSSSpatialDiv/CSSSpatialComponent.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,0BAA0B,EAE3B,MAAM,0BAA0B,CAAA;AAkPjC,eAAO,MAAM,mBAAmB,uHAAyC,CAAA"}
1
+ {"version":3,"file":"CSSSpatialComponent.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/CSSSpatialDiv/CSSSpatialComponent.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,0BAA0B,EAE3B,MAAM,0BAA0B,CAAA;AAqPjC,eAAO,MAAM,mBAAmB,uHAAyC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSpatialStyle.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/CSSSpatialDiv/useSpatialStyle.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAsHlE,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;kBAST,sBAAsB;;;;EAoG3C"}
1
+ {"version":3,"file":"useSpatialStyle.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/CSSSpatialDiv/useSpatialStyle.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAuHlE,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;kBAST,sBAAsB;;;;EAoG3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CSSModel3DNotInSpatialDiv.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/Model3D/CSSModel3DNotInSpatialDiv.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE1D,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,eAAe,2CAgDvB"}
1
+ {"version":3,"file":"CSSModel3DNotInSpatialDiv.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/Model3D/CSSModel3DNotInSpatialDiv.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE1D,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,eAAe,2CAiDvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"CSSModel3DPortalInstance.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/Model3D/CSSModel3DPortalInstance.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAMzC,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,2CA4CzB"}
1
+ {"version":3,"file":"CSSModel3DPortalInstance.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/Model3D/CSSModel3DPortalInstance.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAMzC,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,2CA6CzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PortalInstance.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/SpatialReactComponent/PortalInstance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,SAAS,EAMV,MAAM,OAAO,CAAA;AAad,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAInC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAEvC,EAAE,EAAE,KAAK,CAAC,WAAW,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CACpB;AAoYD,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,2CA+F1D;yBA/Fe,cAAc"}
1
+ {"version":3,"file":"PortalInstance.d.ts","sourceRoot":"","sources":["../../../../../src/spatial-react-components/SpatialReactComponent/PortalInstance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EAEb,SAAS,EAMV,MAAM,OAAO,CAAA;AAad,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAInC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAEvC,EAAE,EAAE,KAAK,CAAC,WAAW,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CACpB;AAqYD,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,2CAkG1D;yBAlGe,cAAc"}
@@ -879,7 +879,7 @@ function syncDefaultSpatialStyle(openedWindow, debugName) {
879
879
  openedWindow.document.head.appendChild(styleElement);
880
880
  }
881
881
  __name(syncDefaultSpatialStyle, "syncDefaultSpatialStyle");
882
- function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, cornerRadiusFromStyle, opacity) {
882
+ function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, cornerRadiusFromStyle, opacity, stylePosition) {
883
883
  let { allowScroll, scrollWithParent, style, spatialStyle = {} } = props;
884
884
  let {
885
885
  position = { x: 0, y: 0, z: 1 },
@@ -889,7 +889,6 @@ function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, corne
889
889
  cornerRadius = cornerRadiusFromStyle,
890
890
  zIndex = 0
891
891
  } = spatialStyle;
892
- let stylePosition = style?.position;
893
892
  let styleOverflow = style?.overflow;
894
893
  const visible = (0, import_react8.useMemo)(() => {
895
894
  return spatialStyle.visible !== false && domRect.width > 0 && domRect.height > 0;
@@ -1120,7 +1119,8 @@ function PortalInstance(inProps) {
1120
1119
  domRect,
1121
1120
  anchor,
1122
1121
  cornerRadius,
1123
- opacity
1122
+ opacity,
1123
+ inheritedPortalStyle.position
1124
1124
  );
1125
1125
  const JSXPortalInstance = renderJSXPortalInstance(
1126
1126
  props,
@@ -1129,7 +1129,7 @@ function PortalInstance(inProps) {
1129
1129
  inheritedPortalStyle,
1130
1130
  className
1131
1131
  );
1132
- const needRenderPlaceHolder = isSubPortal && inheritedPortalStyle.position !== "absolute";
1132
+ const needRenderPlaceHolder = isSubPortal && inheritedPortalStyle.position !== "absolute" && inheritedPortalStyle.position !== "fixed";
1133
1133
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(SpatialWindowManagerContext.Provider, { value: spatialWindowManager, children: [
1134
1134
  needRenderPlaceHolder && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1135
1135
  "div",
@@ -1430,7 +1430,7 @@ function parseTransform(computedStyle) {
1430
1430
  }
1431
1431
  __name(parseTransform, "parseTransform");
1432
1432
  function parseBack(computedStyle) {
1433
- let useBackProperty = computedStyle.position === "absolute" || computedStyle.position === "relative";
1433
+ let useBackProperty = computedStyle.position === "absolute" || computedStyle.position === "relative" || computedStyle.position === "fixed";
1434
1434
  if (!useBackProperty) return new import_Matrix4.Matrix4();
1435
1435
  let backProperty = computedStyle.getPropertyValue(SpatialCustomVars.back);
1436
1436
  let back = void 0;
@@ -1857,6 +1857,7 @@ function renderRootCSSSpatialComponent(inProps, refIn) {
1857
1857
  ...style,
1858
1858
  width: 0,
1859
1859
  height: 0,
1860
+ padding: 0,
1860
1861
  transition: "none"
1861
1862
  };
1862
1863
  const spatialDivStyle = {
@@ -1886,7 +1887,8 @@ function renderRootCSSSpatialComponent(inProps, refIn) {
1886
1887
  style: divRefStyle,
1887
1888
  className: divRefClassName,
1888
1889
  ...props,
1889
- ref
1890
+ ref,
1891
+ "data-cssparser": true
1890
1892
  }
1891
1893
  )
1892
1894
  ] });
@@ -1931,6 +1933,7 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
1931
1933
  ...style,
1932
1934
  width: 0,
1933
1935
  height: 0,
1936
+ padding: 0,
1934
1937
  transition: "none"
1935
1938
  };
1936
1939
  const spatialDivStyle = {
@@ -3040,7 +3043,8 @@ function renderCSSModel3DNotInSpatialDiv(inProps, refIn) {
3040
3043
  const cssParserDomStyle = {
3041
3044
  ...style,
3042
3045
  width: 0,
3043
- height: 0
3046
+ height: 0,
3047
+ padding: 0
3044
3048
  };
3045
3049
  const { ref: cssParserDomRef, spatialStyle, ready } = useSpatialStyle();
3046
3050
  const ref = useHijackSpatialDivRef(
@@ -3129,7 +3133,8 @@ function renderCSSModel3DPortalInstance(spatialId, inProps) {
3129
3133
  const cssParserDomStyle = {
3130
3134
  ...style,
3131
3135
  width: 0,
3132
- height: 0
3136
+ height: 0,
3137
+ padding: 0
3133
3138
  };
3134
3139
  const model3DStyle = {
3135
3140
  ...style,