@sanity/ui 2.0.0-beta.15 → 2.0.0-beta.16

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/theme.d.ts CHANGED
@@ -493,6 +493,12 @@ export declare const THEME_COLOR_STATES: readonly [
493
493
  */
494
494
  export declare type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
495
495
  color: ThemeColorCard_v2
496
+ /**
497
+ * Indicates whether the theme is resolved or raw, it's necessary to avoid issues
498
+ * with sanity V2 components accessing a v1 <ThemeProvider>.
499
+ * See https://github.com/sanity-io/ui/pull/1203 for more info.
500
+ */
501
+ _resolved: boolean
496
502
  }
497
503
 
498
504
  /**
package/dist/theme.esm.js CHANGED
@@ -1682,12 +1682,13 @@ function inputStateThemeColor_v0_v2(state) {
1682
1682
  }
1683
1683
  const cache$3 = /* @__PURE__ */new WeakMap();
1684
1684
  function getTheme_v2(theme) {
1685
- var _a;
1686
- if (theme.sanity.v2) return theme.sanity.v2;
1685
+ var _a, _b;
1686
+ if ((_a = theme.sanity.v2) == null ? void 0 : _a._resolved) return theme.sanity.v2;
1687
1687
  const cached_v2 = cache$3.get(theme);
1688
1688
  if (cached_v2) return cached_v2;
1689
1689
  const v2 = {
1690
1690
  _version: 2,
1691
+ _resolved: true,
1691
1692
  avatar: {
1692
1693
  ...defaultThemeConfig.avatar,
1693
1694
  ...theme.sanity.avatar
@@ -1716,7 +1717,7 @@ function getTheme_v2(theme) {
1716
1717
  ...theme.sanity.input.switch
1717
1718
  }
1718
1719
  },
1719
- layer: (_a = theme.sanity.layer) != null ? _a : defaultThemeConfig.layer,
1720
+ layer: (_b = theme.sanity.layer) != null ? _b : defaultThemeConfig.layer,
1720
1721
  media: theme.sanity.media,
1721
1722
  radius: theme.sanity.radius,
1722
1723
  shadow: theme.sanity.shadows,
@@ -4374,6 +4375,7 @@ function getScopedTheme(themeProp, scheme, tone) {
4374
4375
  layer: layer_v0,
4375
4376
  v2: {
4376
4377
  ...v2,
4378
+ _resolved: true,
4377
4379
  color: color_v2,
4378
4380
  layer: layer_v2
4379
4381
  }