@sanity/ui 2.13.5 → 2.14.1
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.js +22 -7
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/refractor.js +1 -1
- package/dist/_chunks-cjs/refractor.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +22 -7
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_chunks-es/refractor.mjs +1 -1
- package/dist/_chunks-es/refractor.mjs.map +1 -1
- package/dist/_legacy/_visual-editing.esm.js +22 -7
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/_legacy/refractor.esm.js +1 -1
- package/dist/_legacy/refractor.esm.js.map +1 -1
- package/dist/_visual-editing.d.mts +7 -0
- package/dist/_visual-editing.d.ts +7 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/code/refractor.tsx +4 -3
- package/src/core/primitives/popover/popover.tsx +18 -1
|
@@ -2484,13 +2484,12 @@ const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
|
|
|
2484
2484
|
const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
2485
2485
|
let t2;
|
|
2486
2486
|
$[6] !== children ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[6] = children, $[7] = t2) : t2 = $[7];
|
|
2487
|
-
|
|
2487
|
+
let t3;
|
|
2488
|
+
$[8] !== children || $[9] !== language ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }), $[8] = children, $[9] = language, $[10] = t3) : t3 = $[10];
|
|
2488
2489
|
let t4;
|
|
2489
|
-
$[
|
|
2490
|
+
$[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t2, children: t3 }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
|
|
2490
2491
|
let t5;
|
|
2491
|
-
$[
|
|
2492
|
-
let t6;
|
|
2493
|
-
return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t5 || $[18] !== weight ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: t1, $weight: weight, ref, children: t5 }), $[14] = ref, $[15] = restProps, $[16] = t1, $[17] = t5, $[18] = weight, $[19] = t6) : t6 = $[19], t6;
|
|
2492
|
+
return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t4 || $[18] !== weight ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: t1, $weight: weight, ref, children: t4 }), $[14] = ref, $[15] = restProps, $[16] = t1, $[17] = t4, $[18] = weight, $[19] = t5) : t5 = $[19], t5;
|
|
2494
2493
|
});
|
|
2495
2494
|
Code.displayName = "ForwardRef(Code)";
|
|
2496
2495
|
const BASE_STYLE$1 = {
|
|
@@ -3492,7 +3491,19 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).w
|
|
|
3492
3491
|
] }), $[48] = placement, $[49] = radius, $[50] = ref, $[51] = rootStyle2, $[52] = scheme, $[53] = shadow, $[54] = t11, $[55] = t12, $[56] = t8, $[57] = t9, $[58] = tone, $[59] = t13) : t13 = $[59], t13;
|
|
3493
3492
|
}));
|
|
3494
3493
|
PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
|
|
3495
|
-
const
|
|
3494
|
+
const ViewportOverlay = () => {
|
|
3495
|
+
const $ = reactCompilerRuntime.c(2), {
|
|
3496
|
+
zIndex
|
|
3497
|
+
} = useLayer();
|
|
3498
|
+
let t0;
|
|
3499
|
+
return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3500
|
+
height: "100vh",
|
|
3501
|
+
inset: 0,
|
|
3502
|
+
position: "fixed",
|
|
3503
|
+
width: "100vw",
|
|
3504
|
+
zIndex
|
|
3505
|
+
} }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
|
|
3506
|
+
}, Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
3496
3507
|
const {
|
|
3497
3508
|
container,
|
|
3498
3509
|
layer
|
|
@@ -3508,6 +3519,7 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3508
3519
|
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
3509
3520
|
matchReferenceWidth,
|
|
3510
3521
|
floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3522
|
+
modal,
|
|
3511
3523
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3512
3524
|
onActivate,
|
|
3513
3525
|
open,
|
|
@@ -3615,7 +3627,10 @@ const Popover = react.memo(react.forwardRef(function(props, forwardedRef) {
|
|
|
3615
3627
|
updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
|
|
3616
3628
|
}, [update, updateRef]), disabled)
|
|
3617
3629
|
return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3618
|
-
const popover = /* @__PURE__ */ jsxRuntime.
|
|
3630
|
+
const popover = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
|
|
3631
|
+
modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
|
|
3632
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidthRef.current : width, x, y, children: content })
|
|
3633
|
+
] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
|
|
3619
3634
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3620
3635
|
animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
|
|
3621
3636
|
child
|