From cc29f14bf93e3ac721a6a37d0688f6cf8d0b4bd4 Mon Sep 17 00:00:00 2001 From: Pedro Bonamin <46196328+pedrobonamin@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:27:04 +0200 Subject: [PATCH] fix(alpha-ui): support for breaking changes inside studio with new sanity/ui (#5015) --- packages/sanity/src/core/studio/Studio.test.tsx | 7 ++++--- packages/sanity/src/core/theme/_legacy/theme.ts | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sanity/src/core/studio/Studio.test.tsx b/packages/sanity/src/core/studio/Studio.test.tsx index 2556efb2df9..f0367b0d30d 100644 --- a/packages/sanity/src/core/studio/Studio.test.tsx +++ b/packages/sanity/src/core/studio/Studio.test.tsx @@ -43,8 +43,9 @@ describe('Studio', () => { const sheet = new ServerStyleSheet() try { const html = renderToStaticMarkup(sheet.collectStyles()) + expect(html).toMatchInlineSnapshot( - `"
Loading…
"`, + `"
Loading…
"`, ) } finally { sheet.seal() @@ -61,7 +62,7 @@ describe('Studio', () => { try { const html = renderToString(sheet.collectStyles()) expect(html).toMatchInlineSnapshot( - `"
Loading…
"`, + `"
Loading…
"`, ) } finally { sheet.seal() @@ -81,7 +82,7 @@ describe('Studio', () => { const html = renderToString(sheet.collectStyles()) node.innerHTML = html expect(html).toMatchInlineSnapshot( - `"
Loading…
"`, + `"
Loading…
"`, ) document.head.innerHTML += sheet.getStyleTags() diff --git a/packages/sanity/src/core/theme/_legacy/theme.ts b/packages/sanity/src/core/theme/_legacy/theme.ts index 18473eac0cd..549c01807b2 100644 --- a/packages/sanity/src/core/theme/_legacy/theme.ts +++ b/packages/sanity/src/core/theme/_legacy/theme.ts @@ -28,10 +28,11 @@ import {LegacyThemeProps} from './types' * ``` * * @param partialLegacyTheme - Properties to override the theme with. See {@link LegacyThemeProps} - * * @public + * @deprecated Use `@sanity/ui studioTheme` instead */ export function buildLegacyTheme(partialLegacyTheme: Partial): StudioTheme { + return defaults const legacyTheme = resolveLegacyTheme(partialLegacyTheme) const legacyPalette = buildLegacyPalette(legacyTheme) const legacyTones = buildLegacyTones(legacyPalette)