@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
|
@@ -15,7 +15,7 @@ function LazyRefractor(props) {
|
|
|
15
15
|
let t1;
|
|
16
16
|
$[2] !== language || $[3] !== registered || $[4] !== value ? (t1 = !(language && registered) && /* @__PURE__ */ jsxRuntime.jsx("code", { children: value }), $[2] = language, $[3] = registered, $[4] = value, $[5] = t1) : t1 = $[5];
|
|
17
17
|
let t2;
|
|
18
|
-
$[6] !== language || $[7] !== registered || $[8] !== value ? (t2 = language && registered && /* @__PURE__ */ jsxRuntime.jsx(Refractor__default.default, { inline: !0, language, value }), $[6] = language, $[7] = registered, $[8] = value, $[9] = t2) : t2 = $[9];
|
|
18
|
+
$[6] !== language || $[7] !== registered || $[8] !== value ? (t2 = language && registered && /* @__PURE__ */ jsxRuntime.jsx(Refractor__default.default, { inline: !0, language, value: String(value) }), $[6] = language, $[7] = registered, $[8] = value, $[9] = t2) : t2 = $[9];
|
|
19
19
|
let t3;
|
|
20
20
|
return $[10] !== t1 || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
21
21
|
t1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refractor.js","sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import Refractor from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>>
|
|
1
|
+
{"version":3,"file":"refractor.js","sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import Refractor from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n const registered = language ? Refractor.hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n\nLazyRefractor.displayName = 'LazyRefractor'\n"],"names":["LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","Refractor","hasLanguage","registered","t1","t2","String","t3","displayName"],"mappings":";;;;;;AAEA,SAAeA,cAAAC,OAAA;AAAAC,QAAAA,IAAAC,uBAAA,EAAA,GAKb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAWA,eAAYE;AAAYC,MAAAA;AAAAN,WAAAE,YACzDI,KAAAJ,WAAWK,mBAAAA,QAAAC,YAAsBN,QAAe,IAAS,IAAAF,OAAAE,UAAAF,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAA5E,QAAAS,aAAmBH;AAAyDI,MAAAA;AAAAV,IAAAE,CAAAA,MAAAA,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SAIvEM,KAAA,EAAER,YAAYO,sDAAsBL,EAAAA,UAAAA,MAAAA,CAAM,GAAOJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAAAW,MAAAA;AAAAX,IAAAE,CAAAA,MAAAA,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SACjDO,KAAAT,YAAYO,6CAAeF,mBAAU,SAAA,EAAA,QAAK,IAAYL,UAAiB,OAAAU,OAAOR,KAAK,EAAA,CAAK,GAAAJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAW,MAAAA,KAAAX,EAAA,CAAA;AAAAa,MAAAA;AAAAb,SAAAA,EAAAU,EAAAA,MAAAA,MAAAV,UAAAW,MAF3FE,KACGH,2BAAAA,KAAAA,WAAAA,UAAAA,EAAAA,UAAAA;AAAAA,IAAAA;AAAAA,IACAC;AAAAA,EAAAA,EAAwF,CAAA,GACxFX,QAAAU,IAAAV,QAAAW,IAAAX,QAAAa,MAAAA,KAAAb,EAAA,EAAA,GAHHa;AAGG;AAIPf,cAAcgB,cAAc;;"}
|
|
@@ -2488,13 +2488,12 @@ const LazyRefractor = lazy(() => import("./refractor.mjs")), StyledCode = /* @__
|
|
|
2488
2488
|
const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
|
|
2489
2489
|
let t2;
|
|
2490
2490
|
$[6] !== children ? (t2 = /* @__PURE__ */ jsx("code", { children }), $[6] = children, $[7] = t2) : t2 = $[7];
|
|
2491
|
-
|
|
2491
|
+
let t3;
|
|
2492
|
+
$[8] !== children || $[9] !== language ? (t3 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[8] = children, $[9] = language, $[10] = t3) : t3 = $[10];
|
|
2492
2493
|
let t4;
|
|
2493
|
-
$[
|
|
2494
|
+
$[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(Suspense, { fallback: t2, children: t3 }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
|
|
2494
2495
|
let t5;
|
|
2495
|
-
$[
|
|
2496
|
-
let t6;
|
|
2497
|
-
return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t5 || $[18] !== weight ? (t6 = /* @__PURE__ */ 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;
|
|
2496
|
+
return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t4 || $[18] !== weight ? (t5 = /* @__PURE__ */ 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;
|
|
2498
2497
|
});
|
|
2499
2498
|
Code.displayName = "ForwardRef(Code)";
|
|
2500
2499
|
const BASE_STYLE$1 = {
|
|
@@ -3496,7 +3495,19 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
|
|
|
3496
3495
|
] }), $[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;
|
|
3497
3496
|
}));
|
|
3498
3497
|
PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
|
|
3499
|
-
const
|
|
3498
|
+
const ViewportOverlay = () => {
|
|
3499
|
+
const $ = c(2), {
|
|
3500
|
+
zIndex
|
|
3501
|
+
} = useLayer();
|
|
3502
|
+
let t0;
|
|
3503
|
+
return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsx("div", { style: {
|
|
3504
|
+
height: "100vh",
|
|
3505
|
+
inset: 0,
|
|
3506
|
+
position: "fixed",
|
|
3507
|
+
width: "100vw",
|
|
3508
|
+
zIndex
|
|
3509
|
+
} }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
|
|
3510
|
+
}, Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
3500
3511
|
const {
|
|
3501
3512
|
container,
|
|
3502
3513
|
layer
|
|
@@ -3512,6 +3523,7 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
|
3512
3523
|
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
3513
3524
|
matchReferenceWidth,
|
|
3514
3525
|
floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3526
|
+
modal,
|
|
3515
3527
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3516
3528
|
onActivate,
|
|
3517
3529
|
open,
|
|
@@ -3619,7 +3631,10 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
|
|
|
3619
3631
|
updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
|
|
3620
3632
|
}, [update, updateRef]), disabled)
|
|
3621
3633
|
return childProp || /* @__PURE__ */ jsx(Fragment, {});
|
|
3622
|
-
const popover = /* @__PURE__ */
|
|
3634
|
+
const popover = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
|
|
3635
|
+
modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
|
|
3636
|
+
/* @__PURE__ */ 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 })
|
|
3637
|
+
] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
|
|
3623
3638
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3624
3639
|
animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
|
|
3625
3640
|
child
|