@sanity/ui 2.16.19 → 2.16.21

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":"refractor.mjs","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;AAAA,QAAAC,IAAAC,EAAA,EAAA,GAKb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAWA,eAAYE;AAAY,MAAAC;AAAAN,WAAAE,YACzDI,KAAAJ,WAAWK,UAAAC,YAAsBN,QAAe,IAAC,IAAQF,OAAAE,UAAAF,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAA5E,QAAAS,aAAmBH;AAAyD,MAAAI;AAAAV,IAAA,CAAA,MAAAE,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SAIvEM,KAAA,EAAER,YAAYO,6CAAsBL,UAAAA,MAAAA,CAAM,GAAOJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAAA,MAAAW;AAAAX,IAAA,CAAA,MAAAE,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SACjDO,KAAAT,YAAYO,kCAAe,WAAA,EAAU,QAAA,IAAiBP,UAAiB,OAAAU,OAAOR,KAAK,EAAA,CAAC,GAAIJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAW,MAAAA,KAAAX,EAAA,CAAA;AAAA,MAAAa;AAAA,SAAAb,EAAA,EAAA,MAAAU,MAAAV,UAAAW,MAF3FE,sCACGH,UAAAA;AAAAA,IAAAA;AAAAA,IACAC;AAAAA,EAAAA,EAAAA,CAAwF,GACxFX,QAAAU,IAAAV,QAAAW,IAAAX,QAAAa,MAAAA,KAAAb,EAAA,EAAA,GAHHa;AAGG;AAIPf,cAAcgB,cAAc;"}
1
+ {"version":3,"file":"refractor.mjs","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;AAAA,QAAAC,IAAAC,EAAA,EAAA,GAKb;AAAA,IAAAC,UAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE;AAA2D,MAAAC;AAAAN,WAAAE,YACzDI,KAAAJ,WAAWK,UAASC,YAAaN,QAAuB,IAAxD,IAAyDF,OAAAE,UAAAF,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAA5E,QAAAS,aAAmBH;AAAyD,MAAAI;AAAAV,IAAA,CAAA,MAAAE,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SAIvEM,KAAA,EAAER,YAAAO,mCAA2B,QAAA,EAAOL,UAAAA,MAAAA,CAAM,GAAOJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAAA,MAAAW;AAAAX,IAAA,CAAA,MAAAE,YAAAF,SAAAS,cAAAT,EAAA,CAAA,MAAAI,SACjDO,KAAAT,YAAAO,kCAA2B,WAAA,EAAU,QAAA,IAAiBP,UAAiB,OAAAU,OAAOR,KAAK,EAAA,CAAC,GAAIJ,OAAAE,UAAAF,OAAAS,YAAAT,OAAAI,OAAAJ,OAAAW,MAAAA,KAAAX,EAAA,CAAA;AAAA,MAAAa;AAAA,SAAAb,EAAA,EAAA,MAAAU,MAAAV,UAAAW,MAF3FE,sCACGH,UAAAA;AAAAA,IAAAA;AAAAA,IACAC;AAAAA,EAAAA,EAAAA,CAAwF,GACxFX,QAAAU,IAAAV,QAAAW,IAAAX,QAAAa,MAAAA,KAAAb,EAAA,EAAA,GAHHa;AAGG;AAIPf,cAAcgB,cAAc;"}
package/dist/index.js CHANGED
@@ -435,26 +435,63 @@ const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styledComponents.sty
435
435
  displayName: "ExpandButton",
436
436
  componentId: "sc-1es8h8q-1"
437
437
  })`appearance:none;margin:-4px;`, Breadcrumbs = react.forwardRef(function(props, ref) {
438
- const {
438
+ const $ = reactCompilerRuntime.c(44);
439
+ let children, maxLength, restProps, separator, t0;
440
+ $[0] !== props ? ({
439
441
  children,
440
442
  maxLength,
441
443
  separator,
442
- space: spaceRaw = 2,
444
+ space: t0,
443
445
  ...restProps
444
- } = props, space = _visualEditing.useArrayProp(spaceRaw), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
445
- _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
446
- const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
446
+ } = props, $[0] = props, $[1] = children, $[2] = maxLength, $[3] = restProps, $[4] = separator, $[5] = t0) : (children = $[1], maxLength = $[2], restProps = $[3], separator = $[4], t0 = $[5]);
447
+ const space = _visualEditing.useArrayProp(t0 === void 0 ? 2 : t0), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null);
448
+ let t1;
449
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), $[6] = t1) : t1 = $[6];
450
+ const collapse = t1;
451
+ let t2;
452
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!0), $[7] = t2) : t2 = $[7];
453
+ const expand = t2;
454
+ let t3;
455
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => [expandElementRef.current, popoverElementRef.current], $[8] = t3) : t3 = $[8], _visualEditing.useClickOutsideEvent(collapse, t3);
456
+ let t4;
457
+ $[9] !== children ? (t4 = react.Children.toArray(children).filter(react.isValidElement), $[9] = children, $[10] = t4) : t4 = $[10];
458
+ const rawItems = t4;
459
+ let t5;
460
+ bb0: {
447
461
  const len = rawItems.length;
448
462
  if (maxLength && len > maxLength) {
449
463
  const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
450
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
464
+ let t62;
465
+ if ($[11] !== afterLength || $[12] !== beforeLength || $[13] !== len || $[14] !== open || $[15] !== rawItems || $[16] !== space) {
466
+ const t72 = rawItems.slice(0, beforeLength - 1);
467
+ let t8;
468
+ $[18] !== afterLength || $[19] !== beforeLength || $[20] !== len || $[21] !== rawItems ? (t8 = rawItems.slice(beforeLength - 1, len - afterLength), $[18] = afterLength, $[19] = beforeLength, $[20] = len, $[21] = rawItems, $[22] = t8) : t8 = $[22];
469
+ let t9;
470
+ $[23] !== space || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: t8 }), $[23] = space, $[24] = t8, $[25] = t9) : t9 = $[25];
471
+ const t10 = open ? collapse : expand;
472
+ let t11;
473
+ $[26] !== open || $[27] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: t10, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }), $[26] = open, $[27] = t10, $[28] = t11) : t11 = $[28];
474
+ let t12;
475
+ $[29] !== open || $[30] !== t11 || $[31] !== t9 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: t9, open, placement: "top", portal: !0, ref: popoverElementRef, children: t11 }, "button"), $[29] = open, $[30] = t11, $[31] = t9, $[32] = t12) : t12 = $[32], t62 = [...t72, t12, ...rawItems.slice(len - afterLength)], $[11] = afterLength, $[12] = beforeLength, $[13] = len, $[14] = open, $[15] = rawItems, $[16] = space, $[17] = t62;
476
+ } else
477
+ t62 = $[17];
478
+ t5 = t62;
479
+ break bb0;
451
480
  }
452
- return rawItems;
453
- }, [collapse, expand, maxLength, open, rawItems, space]);
454
- return /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
455
- itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
456
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
457
- ] }, itemIndex)) });
481
+ t5 = rawItems;
482
+ }
483
+ const items = t5;
484
+ let t6;
485
+ if ($[33] !== items || $[34] !== separator || $[35] !== space) {
486
+ let t72;
487
+ $[37] !== separator || $[38] !== space ? (t72 = (item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
488
+ itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
489
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
490
+ ] }, itemIndex), $[37] = separator, $[38] = space, $[39] = t72) : t72 = $[39], t6 = items.map(t72), $[33] = items, $[34] = separator, $[35] = space, $[36] = t6;
491
+ } else
492
+ t6 = $[36];
493
+ let t7;
494
+ return $[40] !== ref || $[41] !== restProps || $[42] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t6 }), $[40] = ref, $[41] = restProps, $[42] = t6, $[43] = t7) : t7 = $[43], t7;
458
495
  });
459
496
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
460
497
  function dialogStyle({