@sanity/ui 3.0.0-static.32 → 3.0.0-static.33
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/_chunks-cjs/_visual-editing.cjs +6 -3
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +7 -4
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_visual-editing.d.cts +10 -0
- package/dist/_visual-editing.d.ts +10 -0
- package/dist/css/index.cjs +1 -1
- package/dist/css/index.cjs.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.js +1 -1
- package/dist/css/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/core/Root.tsx +2 -2
- package/src/core/primitives/popover/popover.tsx +30 -8
- package/src/css/primitives/root/root.css.ts +1 -1
- package/src/css/primitives/root/root.ts +1 -1
- package/dist/css/layers.css +0 -4
- package/dist/css/primitives/popover/popover.css +0 -4
|
@@ -1089,6 +1089,7 @@ function Popover(props) {
|
|
|
1089
1089
|
overflow = "hidden",
|
|
1090
1090
|
padding,
|
|
1091
1091
|
placement: placementProp = "bottom",
|
|
1092
|
+
placementStrategy = "flip",
|
|
1092
1093
|
portal,
|
|
1093
1094
|
preventOverflow = !0,
|
|
1094
1095
|
radius = 3,
|
|
@@ -1106,12 +1107,14 @@ function Popover(props) {
|
|
|
1106
1107
|
react.useImperativeHandle(forwardedRef, () => ref.current);
|
|
1107
1108
|
const referenceWidthRef = react.useRef(void 0), middleware = react.useMemo(() => {
|
|
1108
1109
|
const ret = [];
|
|
1109
|
-
return (constrainSize || preventOverflow) && ret.push(reactDom$1.
|
|
1110
|
+
return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(reactDom$1.autoPlacement({
|
|
1111
|
+
allowedPlacements: [placementProp].concat(fallbackPlacements)
|
|
1112
|
+
})) : ret.push(reactDom$1.flip({
|
|
1110
1113
|
boundary: floatingBoundary || void 0,
|
|
1111
1114
|
fallbackPlacements,
|
|
1112
1115
|
padding: DEFAULT_POPOVER_PADDING,
|
|
1113
1116
|
rootBoundary
|
|
1114
|
-
})), ret.push(reactDom$1.offset({
|
|
1117
|
+
}))), ret.push(reactDom$1.offset({
|
|
1115
1118
|
mainAxis: DEFAULT_POPOVER_DISTANCE
|
|
1116
1119
|
})), (constrainSize || matchReferenceWidth) && ret.push(size({
|
|
1117
1120
|
apply({
|
|
@@ -1137,7 +1140,7 @@ function Popover(props) {
|
|
|
1137
1140
|
padding: DEFAULT_POPOVER_PADDING,
|
|
1138
1141
|
strategy: "referenceHidden"
|
|
1139
1142
|
})), ret;
|
|
1140
|
-
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
1143
|
+
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, placementProp, placementStrategy, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
1141
1144
|
x,
|
|
1142
1145
|
y,
|
|
1143
1146
|
middlewareData,
|