@webspatial/react-sdk 0.0.2 → 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.
- package/dist/cjs/default/index.js +13 -8
- package/dist/cjs/default/index.js.map +2 -2
- package/dist/cjs/default/spatial-react-components/CSSSpatialDiv/CSSSpatialComponent.d.ts.map +1 -1
- package/dist/cjs/default/spatial-react-components/CSSSpatialDiv/useSpatialStyle.d.ts.map +1 -1
- package/dist/cjs/default/spatial-react-components/Model3D/CSSModel3DNotInSpatialDiv.d.ts.map +1 -1
- package/dist/cjs/default/spatial-react-components/Model3D/CSSModel3DPortalInstance.d.ts.map +1 -1
- package/dist/cjs/default/spatial-react-components/SpatialReactComponent/PortalInstance.d.ts.map +1 -1
- package/dist/cjs/web/index.js +13 -8
- package/dist/cjs/web/index.js.map +2 -2
- package/dist/cjs/web/spatial-react-components/CSSSpatialDiv/CSSSpatialComponent.d.ts.map +1 -1
- package/dist/cjs/web/spatial-react-components/CSSSpatialDiv/useSpatialStyle.d.ts.map +1 -1
- package/dist/cjs/web/spatial-react-components/Model3D/CSSModel3DNotInSpatialDiv.d.ts.map +1 -1
- package/dist/cjs/web/spatial-react-components/Model3D/CSSModel3DPortalInstance.d.ts.map +1 -1
- package/dist/cjs/web/spatial-react-components/SpatialReactComponent/PortalInstance.d.ts.map +1 -1
- package/dist/jsx/injectSceneHook.d.ts.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js +70 -52
- package/dist/jsx/jsx-dev-runtime.js.map +4 -4
- package/dist/jsx/jsx-runtime.js +70 -52
- package/dist/jsx/jsx-runtime.js.map +4 -4
- package/npm/index.js +3 -3
- package/npm/plugin/shared.js +2 -2
- package/npm/plugin/vite.js +7 -7
- package/package.json +3 -3
|
@@ -876,7 +876,7 @@ function syncDefaultSpatialStyle(openedWindow, debugName) {
|
|
|
876
876
|
openedWindow.document.head.appendChild(styleElement);
|
|
877
877
|
}
|
|
878
878
|
__name(syncDefaultSpatialStyle, "syncDefaultSpatialStyle");
|
|
879
|
-
function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, cornerRadiusFromStyle, opacity) {
|
|
879
|
+
function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, cornerRadiusFromStyle, opacity, stylePosition) {
|
|
880
880
|
let { allowScroll, scrollWithParent, style, spatialStyle = {} } = props;
|
|
881
881
|
let {
|
|
882
882
|
position = { x: 0, y: 0, z: 1 },
|
|
@@ -886,7 +886,6 @@ function useSyncSpatialProps(spatialWindowManager, props, domRect, anchor, corne
|
|
|
886
886
|
cornerRadius = cornerRadiusFromStyle,
|
|
887
887
|
zIndex = 0
|
|
888
888
|
} = spatialStyle;
|
|
889
|
-
let stylePosition = style?.position;
|
|
890
889
|
let styleOverflow = style?.overflow;
|
|
891
890
|
const visible = (0, import_react8.useMemo)(() => {
|
|
892
891
|
return spatialStyle.visible !== false && domRect.width > 0 && domRect.height > 0;
|
|
@@ -1117,7 +1116,8 @@ function PortalInstance(inProps) {
|
|
|
1117
1116
|
domRect,
|
|
1118
1117
|
anchor,
|
|
1119
1118
|
cornerRadius,
|
|
1120
|
-
opacity
|
|
1119
|
+
opacity,
|
|
1120
|
+
inheritedPortalStyle.position
|
|
1121
1121
|
);
|
|
1122
1122
|
const JSXPortalInstance = renderJSXPortalInstance(
|
|
1123
1123
|
props,
|
|
@@ -1126,7 +1126,7 @@ function PortalInstance(inProps) {
|
|
|
1126
1126
|
inheritedPortalStyle,
|
|
1127
1127
|
className
|
|
1128
1128
|
);
|
|
1129
|
-
const needRenderPlaceHolder = isSubPortal && inheritedPortalStyle.position !== "absolute";
|
|
1129
|
+
const needRenderPlaceHolder = isSubPortal && inheritedPortalStyle.position !== "absolute" && inheritedPortalStyle.position !== "fixed";
|
|
1130
1130
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(SpatialWindowManagerContext.Provider, { value: spatialWindowManager, children: [
|
|
1131
1131
|
needRenderPlaceHolder && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1132
1132
|
"div",
|
|
@@ -1427,7 +1427,7 @@ function parseTransform(computedStyle) {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
__name(parseTransform, "parseTransform");
|
|
1429
1429
|
function parseBack(computedStyle) {
|
|
1430
|
-
let useBackProperty = computedStyle.position === "absolute" || computedStyle.position === "relative";
|
|
1430
|
+
let useBackProperty = computedStyle.position === "absolute" || computedStyle.position === "relative" || computedStyle.position === "fixed";
|
|
1431
1431
|
if (!useBackProperty) return new import_Matrix4.Matrix4();
|
|
1432
1432
|
let backProperty = computedStyle.getPropertyValue(SpatialCustomVars.back);
|
|
1433
1433
|
let back = void 0;
|
|
@@ -1854,6 +1854,7 @@ function renderRootCSSSpatialComponent(inProps, refIn) {
|
|
|
1854
1854
|
...style,
|
|
1855
1855
|
width: 0,
|
|
1856
1856
|
height: 0,
|
|
1857
|
+
padding: 0,
|
|
1857
1858
|
transition: "none"
|
|
1858
1859
|
};
|
|
1859
1860
|
const spatialDivStyle = {
|
|
@@ -1883,7 +1884,8 @@ function renderRootCSSSpatialComponent(inProps, refIn) {
|
|
|
1883
1884
|
style: divRefStyle,
|
|
1884
1885
|
className: divRefClassName,
|
|
1885
1886
|
...props,
|
|
1886
|
-
ref
|
|
1887
|
+
ref,
|
|
1888
|
+
"data-cssparser": true
|
|
1887
1889
|
}
|
|
1888
1890
|
)
|
|
1889
1891
|
] });
|
|
@@ -1928,6 +1930,7 @@ function renderInPortalInstance(cssSpatialRootContextObject, cssSpatialID, inPro
|
|
|
1928
1930
|
...style,
|
|
1929
1931
|
width: 0,
|
|
1930
1932
|
height: 0,
|
|
1933
|
+
padding: 0,
|
|
1931
1934
|
transition: "none"
|
|
1932
1935
|
};
|
|
1933
1936
|
const spatialDivStyle = {
|
|
@@ -3038,7 +3041,8 @@ function renderCSSModel3DNotInSpatialDiv(inProps, refIn) {
|
|
|
3038
3041
|
const cssParserDomStyle = {
|
|
3039
3042
|
...style,
|
|
3040
3043
|
width: 0,
|
|
3041
|
-
height: 0
|
|
3044
|
+
height: 0,
|
|
3045
|
+
padding: 0
|
|
3042
3046
|
};
|
|
3043
3047
|
const { ref: cssParserDomRef, spatialStyle, ready } = useSpatialStyle();
|
|
3044
3048
|
const ref = useHijackSpatialDivRef(
|
|
@@ -3127,7 +3131,8 @@ function renderCSSModel3DPortalInstance(spatialId, inProps) {
|
|
|
3127
3131
|
const cssParserDomStyle = {
|
|
3128
3132
|
...style,
|
|
3129
3133
|
width: 0,
|
|
3130
|
-
height: 0
|
|
3134
|
+
height: 0,
|
|
3135
|
+
padding: 0
|
|
3131
3136
|
};
|
|
3132
3137
|
const model3DStyle = {
|
|
3133
3138
|
...style,
|