@sanity/ui 2.12.0-canary.1 → 2.12.0

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,9 +1,9 @@
1
1
  "use strict";
2
- var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), theme = require("@sanity/ui/theme"), ReactIs = require("react-is"), icons = require("@sanity/icons"), Refractor = require("react-refractor"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
2
+ var jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), theme = require("@sanity/ui/theme"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
6
- var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs), Refractor__default = /* @__PURE__ */ _interopDefaultCompat(Refractor);
6
+ var ReactIs__default = /* @__PURE__ */ _interopDefaultCompat(ReactIs);
7
7
  const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen, studioTheme = theme.buildTheme(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_CONTENT_OPACITY_PROPERTY = "--motion-content-opacity", POPOVER_MOTION_PROPS = {
8
8
  initial: {
9
9
  opacity: 0.5,
@@ -2455,32 +2455,31 @@ function codeBaseStyle() {
2455
2455
  }
2456
2456
  `;
2457
2457
  }
2458
- const StyledCode = /* @__PURE__ */ styledComponents.styled.pre.withConfig({
2458
+ const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
2459
+ return require("./refractor.js");
2460
+ })), StyledCode = /* @__PURE__ */ styledComponents.styled.pre.withConfig({
2459
2461
  displayName: "StyledCode",
2460
2462
  componentId: "sc-4dymyn-0"
2461
2463
  })(codeBaseStyle, responsiveCodeFontStyle), Code = react.forwardRef(function(props, ref) {
2462
- const $ = reactCompilerRuntime.c(23);
2463
- let children, languageProp, restProps, t0, weight;
2464
+ const $ = reactCompilerRuntime.c(20);
2465
+ let children, language, restProps, t0, weight;
2464
2466
  $[0] !== props ? ({
2465
2467
  children,
2466
- language: languageProp,
2468
+ language,
2467
2469
  size: t0,
2468
2470
  weight,
2469
2471
  ...restProps
2470
- } = props, $[0] = props, $[1] = children, $[2] = languageProp, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], languageProp = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
2471
- const size2 = t0 === void 0 ? 2 : t0, language = typeof languageProp == "string" ? languageProp : void 0;
2472
- let t1;
2473
- $[6] !== language ? (t1 = language ? Refractor__default.default.hasLanguage(language) : !1, $[6] = language, $[7] = t1) : t1 = $[7];
2474
- const registered = t1, t2 = useArrayProp(size2);
2475
- let t3;
2476
- $[8] !== children || $[9] !== language || $[10] !== registered ? (t3 = !(language && registered) && /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[8] = children, $[9] = language, $[10] = registered, $[11] = t3) : t3 = $[11];
2472
+ } = props, $[0] = props, $[1] = children, $[2] = language, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], language = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
2473
+ const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2474
+ let t2;
2475
+ $[6] !== children ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[6] = children, $[7] = t2) : t2 = $[7];
2476
+ const t3 = String(children);
2477
2477
  let t4;
2478
- $[12] !== children || $[13] !== language || $[14] !== registered ? (t4 = language && registered && /* @__PURE__ */ jsxRuntime.jsx(Refractor__default.default, { inline: !0, language, value: String(children) }), $[12] = children, $[13] = language, $[14] = registered, $[15] = t4) : t4 = $[15];
2478
+ $[8] !== language || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: t3 }), $[8] = language, $[9] = t3, $[10] = t4) : t4 = $[10];
2479
2479
  let t5;
2480
- return $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== weight ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(StyledCode, { "data-ui": "Code", ...restProps, $size: t2, $weight: weight, ref, children: [
2481
- t3,
2482
- t4
2483
- ] }), $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = weight, $[22] = t5) : t5 = $[22], t5;
2480
+ $[11] !== t2 || $[12] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t2, children: t4 }), $[11] = t2, $[12] = t4, $[13] = t5) : t5 = $[13];
2481
+ let t6;
2482
+ 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;
2484
2483
  });
2485
2484
  Code.displayName = "ForwardRef(Code)";
2486
2485
  const BASE_STYLE$1 = {