@sanity/ui 3.0.9 → 3.0.10
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/_chunks-cjs/_visual-editing.js +5 -1
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +5 -1
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/package.json +6 -6
- package/src/core/hooks/useClickOutside.test.tsx +1 -1
- package/src/core/lib/createGlobalScopedContext.ts +3 -1
- package/src/core/primitives/avatar/avatar.tsx +1 -0
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/popover/types.ts +2 -1
- package/src/core/styles/font/responsiveFont.ts +2 -0
- package/src/core/theme/__workshop__/canvas.tsx +1 -0
|
@@ -318,7 +318,11 @@ function getGlobalScope() {
|
|
|
318
318
|
const globalScope = getGlobalScope();
|
|
319
319
|
function createGlobalScopedContext(key2, defaultValue) {
|
|
320
320
|
const symbol = Symbol.for(key2);
|
|
321
|
-
|
|
321
|
+
if (typeof document > "u") {
|
|
322
|
+
const context = react.createContext(defaultValue);
|
|
323
|
+
return context.displayName = key2, context;
|
|
324
|
+
}
|
|
325
|
+
return globalScope[symbol] = globalScope[symbol] || react.createContext(defaultValue), globalScope[symbol];
|
|
322
326
|
}
|
|
323
327
|
const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
|
|
324
328
|
function ThemeProvider(props) {
|