@sanity/ui 3.5.1 → 3.5.3

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.cjs","names":["hasLanguage","Refractor","LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","registered","t1","t2","String","t3"],"sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, 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 // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";AAEA,SAAeE,cAAAC,OAAA;CAAA,IAAAC,KAAAA,GAAAA,uBAAAA,EAAAA,CAAA,EAAA,GAKb,EAAAE,UAAAC,cAAAC,UAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE,KAAAA,GAA2DC;CAAA,AAAAN,EAAA,OAAAE,WAEVI,KAAAN,EAAA,MAA/CM,KAAAJ,YAAAA,GAAAA,gBAAAA,YAAAA,CAAuBA,QAAuB,IAA9C,IAA+CF,EAAA,KAAAE,UAAAF,EAAA,KAAAM;CAAlE,IAAAC,aAAmBD,IAA+CE;CAAA,AAAAR,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAI7DI,KAAA,EAAEN,YAAAK,eAA2B,iBAAA,GAAA,kBAAA,IAAA,CAAA,QAAA,EAAA,UAAOH,MAAa,CAAA,GAAAJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAQ,MAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,AAAAT,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAEjDK,KAAAP,YAAAK,cAA0B,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAA,WAAD;EAAW,QAAA;EAAiBL;EAAiB,OAAAQ,OAAON,KAAK;CAAC,CAAA,GAAIJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAS,MAAAA,KAAAT,EAAA;CAAA,IAAAW;CACxF,OADwFX,EAAA,QAAAQ,MAAAR,EAAA,QAAAS,MAH3FE,KAAA,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACGH,IAEAC,EAAwF,EAAA,CAAA,GACxFT,EAAA,MAAAQ,IAAAR,EAAA,MAAAS,IAAAT,EAAA,MAAAW,MAAAA,KAAAX,EAAA,KAJHW;AAIG"}
1
+ {"version":3,"file":"refractor.cjs","names":["hasLanguage","Refractor","LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","registered","t1","t2","String","t3"],"sources":["../../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, 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 // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";AAEA,SAAeE,cAAAC,OAAA;CAAA,IAAAC,KAAAA,GAAAC,uBAAAA,EAAAA,CAAA,EAAA,GAKb,EAAAC,UAAA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1024
1024
  return !v;
1025
1025
  }
1026
- const animation = styled_components.css`background-image:linear-gradient( to right,var(--card-skeleton-color-from),var(--card-skeleton-color-to),var(--card-skeleton-color-from),var(--card-skeleton-color-from),var(--card-skeleton-color-from) );background-position:100%;background-size:200% 100%;background-attachment:fixed;animation-name:${styled_components.keyframes`0%{background-position:100%;}100%{background-position:-100%;}`};animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-duration:2000ms;`, skeletonStyle = styled_components.css`opacity:${({ $visible }) => +!!$visible};transition:opacity 200ms ease-in;@media screen and (prefers-reduced-motion:no-preference){${({ $animated }) => $animated ? animation : styled_components.css`background-color:var(--card-skeleton-color-from);`}}@media screen and (prefers-reduced-motion:reduce){background-color:var(--card-skeleton-color-from);}`, StyledSkeleton$1 = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
1026
+ const keyframe = styled_components.keyframes`0%{background-position:100%;}100%{background-position:-100%;}`, animation = styled_components.css`background-image:linear-gradient( to right,var(--card-skeleton-color-from),var(--card-skeleton-color-to),var(--card-skeleton-color-from),var(--card-skeleton-color-from),var(--card-skeleton-color-from) );background-position:100%;background-size:200% 100%;background-attachment:fixed;animation-name:${keyframe};animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-duration:2000ms;`, skeletonStyle = styled_components.css`opacity:${({ $visible }) => +!!$visible};transition:opacity 200ms ease-in;@media screen and (prefers-reduced-motion:no-preference){${({ $animated }) => $animated ? animation : styled_components.css`background-color:var(--card-skeleton-color-from);`}}@media screen and (prefers-reduced-motion:reduce){background-color:var(--card-skeleton-color-from);}`, StyledSkeleton$1 = /* @__PURE__ */ (0, styled_components.styled)(require_portalProvider.lt).withConfig({
1027
1027
  displayName: "StyledSkeleton",
1028
1028
  componentId: "sc-6p2gkd-0"
1029
1029
  })(require_portalProvider.ct, skeletonStyle), Skeleton = (0, react.forwardRef)(function Skeleton(props, ref) {
@@ -2865,7 +2865,11 @@ var ErrorBoundary = class extends react.Component {
2865
2865
  }
2866
2866
  render() {
2867
2867
  let { error } = this.state;
2868
- return error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Code, { children: typeof error?.message == "string" ? error.message : "Error" }) : this.props.children;
2868
+ if (error) {
2869
+ let message = typeof error?.message == "string" ? error.message : "Error";
2870
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Code, { children: message });
2871
+ }
2872
+ return this.props.children;
2869
2873
  }
2870
2874
  };
2871
2875
  const StyledSrOnly = styled_components.styled.div.withConfig({
@@ -2882,10 +2886,10 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
2882
2886
  }), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
2883
2887
  }), StyledVirtualList = styled_components.styled.div.withConfig({
2884
2888
  displayName: "StyledVirtualList",
2885
- componentId: "sc-lfoa81-0"
2889
+ componentId: "sc-xt8qd-0"
2886
2890
  })`position:relative;`, ItemWrapper = styled_components.styled.div.withConfig({
2887
2891
  displayName: "ItemWrapper",
2888
- componentId: "sc-lfoa81-1"
2892
+ componentId: "sc-xt8qd-1"
2889
2893
  })`position:absolute;left:0;right:0;`, VirtualList = (0, react.forwardRef)(function VirtualList(props, forwardedRef) {
2890
2894
  let $ = (0, react_compiler_runtime.c)(44), getItemKey, onChange, renderItem, restProps, t0, t1, t2;
2891
2895
  $[0] === props ? (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]) : ({as: t0, gap: t1, getItemKey, items: t2, onChange, renderItem, ...restProps} = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2);
@@ -2958,22 +2962,22 @@ const StyledSrOnly = styled_components.styled.div.withConfig({
2958
2962
  items,
2959
2963
  renderItem
2960
2964
  }, $[26] = fromIndex, $[27] = gap, $[28] = getItemKey, $[29] = itemHeight, $[30] = items, $[31] = renderItem, $[32] = space, $[33] = toIndex, $[34] = t11) : t11 = $[34];
2961
- let children = useChildren(t11), t12;
2962
- $[35] === height ? t12 = $[36] : (t12 = { height }, $[35] = height, $[36] = t12);
2963
- let t13;
2964
- $[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2965
+ let children = useChildren(t11), t12 = as, t13;
2966
+ $[35] === height ? t13 = $[36] : (t13 = { height }, $[35] = height, $[36] = t13);
2967
+ let t14;
2968
+ $[37] !== children || $[38] !== t13 ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2965
2969
  ref: wrapperRef,
2966
- style: t12,
2970
+ style: t13,
2967
2971
  children
2968
- }), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
2969
- let t14;
2970
- return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledVirtualList, {
2971
- as,
2972
+ }), $[37] = children, $[38] = t13, $[39] = t14) : t14 = $[39];
2973
+ let t15;
2974
+ return $[40] !== restProps || $[41] !== t12 || $[42] !== t14 ? (t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledVirtualList, {
2975
+ as: t12,
2972
2976
  "data-ui": "VirtualList",
2973
2977
  ...restProps,
2974
2978
  ref,
2975
- children: t13
2976
- }), $[40] = as, $[41] = restProps, $[42] = t13, $[43] = t14) : t14 = $[43], t14;
2979
+ children: t14
2980
+ }), $[40] = restProps, $[41] = t12, $[42] = t14, $[43] = t15) : t15 = $[43], t15;
2977
2981
  });
2978
2982
  function useChildren(t0) {
2979
2983
  let $ = (0, react_compiler_runtime.c)(21), { fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex } = t0;