next-sanity
Advanced tools
Comparing version 0.8.4 to 0.8.5
@@ -43,3 +43,2 @@ 'use strict'; | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
@@ -60,9 +59,6 @@ if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
} | ||
var _proto = MockAbortController.prototype; | ||
_proto.abort = function abort() { | ||
this._signal.aborted = true; | ||
}; | ||
_createClass(MockAbortController, [{ | ||
@@ -74,6 +70,4 @@ key: "signal", | ||
}]); | ||
return MockAbortController; | ||
}(); | ||
function getAborter() { | ||
@@ -104,12 +98,9 @@ return typeof AbortController === 'undefined' ? new MockAbortController() : new AbortController(); | ||
} | ||
function useCurrentUser(projectId) { | ||
var _useState = react.useState(), | ||
data = _useState[0], | ||
setUser = _useState[1]; | ||
data = _useState[0], | ||
setUser = _useState[1]; | ||
var _useState2 = react.useState(), | ||
error = _useState2[0], | ||
setError = _useState2[1]; | ||
error = _useState2[0], | ||
setError = _useState2[1]; | ||
react.useEffect(function () { | ||
@@ -131,11 +122,11 @@ var aborter = getAborter(); | ||
var EMPTY_PARAMS = {}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
var EMPTY_PARAMS = {}; | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
function createPreviewSubscriptionHook(_ref) { | ||
var projectId = _ref.projectId, | ||
dataset = _ref.dataset, | ||
token = _ref.token, | ||
EventSource = _ref.EventSource, | ||
_ref$documentLimit = _ref.documentLimit, | ||
documentLimit = _ref$documentLimit === void 0 ? 3000 : _ref$documentLimit; | ||
dataset = _ref.dataset, | ||
token = _ref.token, | ||
EventSource = _ref.EventSource, | ||
_ref$documentLimit = _ref.documentLimit, | ||
documentLimit = _ref$documentLimit === void 0 ? 3000 : _ref$documentLimit; | ||
// Only construct/setup the store when `getStore()` is called | ||
@@ -147,8 +138,7 @@ var store; | ||
} | ||
var _options = options, | ||
_options$params = _options.params, | ||
params = _options$params === void 0 ? EMPTY_PARAMS : _options$params, | ||
initialData = _options.initialData, | ||
enabled = _options.enabled; | ||
_options$params = _options.params, | ||
params = _options$params === void 0 ? EMPTY_PARAMS : _options$params, | ||
initialData = _options.initialData, | ||
enabled = _options.enabled; | ||
return useQuerySubscription({ | ||
@@ -164,3 +154,2 @@ getStore: getStore, | ||
}; | ||
function getStore(abort) { | ||
@@ -170,11 +159,9 @@ if (!store) { | ||
var groqStore = _ref2.groqStore; | ||
// Skip creating the groq store if we've been unmounted to save memory and reduce gc pressure | ||
if (abort.signal.aborted) { | ||
var error = new Error('Cancelling groq store creation'); // This ensures we can skip it in the catch block same way | ||
var error = new Error('Cancelling groq store creation'); | ||
// This ensures we can skip it in the catch block same way | ||
error.name = 'AbortError'; | ||
return Promise.reject(error); | ||
} | ||
return groqStore({ | ||
@@ -192,31 +179,25 @@ projectId: projectId, | ||
} | ||
return store; | ||
} | ||
} | ||
function useQuerySubscription(options) { | ||
var getStore = options.getStore, | ||
projectId = options.projectId, | ||
query = options.query, | ||
initialData = options.initialData, | ||
_options$enabled = options.enabled, | ||
enabled = _options$enabled === void 0 ? false : _options$enabled, | ||
token = options.token; | ||
projectId = options.projectId, | ||
query = options.query, | ||
initialData = options.initialData, | ||
_options$enabled = options.enabled, | ||
enabled = _options$enabled === void 0 ? false : _options$enabled, | ||
token = options.token; | ||
var _useState = react.useState(), | ||
error = _useState[0], | ||
setError = _useState[1]; | ||
error = _useState[0], | ||
setError = _useState[1]; | ||
var _useState2 = react.useState(false), | ||
loading = _useState2[0], | ||
setLoading = _useState2[1]; | ||
loading = _useState2[0], | ||
setLoading = _useState2[1]; | ||
var _useState3 = react.useState(), | ||
data = _useState3[0], | ||
setData = _useState3[1]; | ||
var params = useParams(options.params); // Use "deep" dependency comparison because params are often not _referentially_ equal, | ||
data = _useState3[0], | ||
setData = _useState3[1]; | ||
var params = useParams(options.params); | ||
// Use "deep" dependency comparison because params are often not _referentially_ equal, | ||
// but contains the same shallow properties, eg `{"slug": "some-slug"}` | ||
react.useEffect(function () { | ||
@@ -226,3 +207,2 @@ if (!enabled) { | ||
} | ||
setLoading(true); | ||
@@ -234,5 +214,4 @@ var aborter = getAborter(); | ||
return; | ||
} // eslint-disable-next-line no-console | ||
} | ||
// eslint-disable-next-line no-console | ||
console.warn('Not authenticated - preview not available'); | ||
@@ -254,4 +233,4 @@ throw new Error('Not authenticated - preview not available'); | ||
return setLoading(false); | ||
}); // eslint-disable-next-line consistent-return | ||
}); | ||
// eslint-disable-next-line consistent-return | ||
return function () { | ||
@@ -261,3 +240,2 @@ if (subscription) { | ||
} | ||
aborter.abort(); | ||
@@ -271,5 +249,4 @@ }; | ||
}; | ||
} // Return params that are stable with deep equal as long as the key order is the same | ||
} | ||
// Return params that are stable with deep equal as long as the key order is the same | ||
function useParams(params) { | ||
@@ -276,0 +253,0 @@ var stringifiedParams = react.useMemo(function () { |
@@ -18,3 +18,2 @@ import sanityClient from '@sanity/client'; | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
@@ -35,9 +34,6 @@ if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
} | ||
var _proto = MockAbortController.prototype; | ||
_proto.abort = function abort() { | ||
this._signal.aborted = true; | ||
}; | ||
_createClass(MockAbortController, [{ | ||
@@ -49,6 +45,4 @@ key: "signal", | ||
}]); | ||
return MockAbortController; | ||
}(); | ||
function getAborter() { | ||
@@ -79,12 +73,9 @@ return typeof AbortController === 'undefined' ? new MockAbortController() : new AbortController(); | ||
} | ||
function useCurrentUser(projectId) { | ||
var _useState = useState(), | ||
data = _useState[0], | ||
setUser = _useState[1]; | ||
data = _useState[0], | ||
setUser = _useState[1]; | ||
var _useState2 = useState(), | ||
error = _useState2[0], | ||
setError = _useState2[1]; | ||
error = _useState2[0], | ||
setError = _useState2[1]; | ||
useEffect(function () { | ||
@@ -106,11 +97,11 @@ var aborter = getAborter(); | ||
var EMPTY_PARAMS = {}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
var EMPTY_PARAMS = {}; | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
function createPreviewSubscriptionHook(_ref) { | ||
var projectId = _ref.projectId, | ||
dataset = _ref.dataset, | ||
token = _ref.token, | ||
EventSource = _ref.EventSource, | ||
_ref$documentLimit = _ref.documentLimit, | ||
documentLimit = _ref$documentLimit === void 0 ? 3000 : _ref$documentLimit; | ||
dataset = _ref.dataset, | ||
token = _ref.token, | ||
EventSource = _ref.EventSource, | ||
_ref$documentLimit = _ref.documentLimit, | ||
documentLimit = _ref$documentLimit === void 0 ? 3000 : _ref$documentLimit; | ||
// Only construct/setup the store when `getStore()` is called | ||
@@ -122,8 +113,7 @@ var store; | ||
} | ||
var _options = options, | ||
_options$params = _options.params, | ||
params = _options$params === void 0 ? EMPTY_PARAMS : _options$params, | ||
initialData = _options.initialData, | ||
enabled = _options.enabled; | ||
_options$params = _options.params, | ||
params = _options$params === void 0 ? EMPTY_PARAMS : _options$params, | ||
initialData = _options.initialData, | ||
enabled = _options.enabled; | ||
return useQuerySubscription({ | ||
@@ -139,3 +129,2 @@ getStore: getStore, | ||
}; | ||
function getStore(abort) { | ||
@@ -145,11 +134,9 @@ if (!store) { | ||
var groqStore = _ref2.groqStore; | ||
// Skip creating the groq store if we've been unmounted to save memory and reduce gc pressure | ||
if (abort.signal.aborted) { | ||
var error = new Error('Cancelling groq store creation'); // This ensures we can skip it in the catch block same way | ||
var error = new Error('Cancelling groq store creation'); | ||
// This ensures we can skip it in the catch block same way | ||
error.name = 'AbortError'; | ||
return Promise.reject(error); | ||
} | ||
return groqStore({ | ||
@@ -167,31 +154,25 @@ projectId: projectId, | ||
} | ||
return store; | ||
} | ||
} | ||
function useQuerySubscription(options) { | ||
var getStore = options.getStore, | ||
projectId = options.projectId, | ||
query = options.query, | ||
initialData = options.initialData, | ||
_options$enabled = options.enabled, | ||
enabled = _options$enabled === void 0 ? false : _options$enabled, | ||
token = options.token; | ||
projectId = options.projectId, | ||
query = options.query, | ||
initialData = options.initialData, | ||
_options$enabled = options.enabled, | ||
enabled = _options$enabled === void 0 ? false : _options$enabled, | ||
token = options.token; | ||
var _useState = useState(), | ||
error = _useState[0], | ||
setError = _useState[1]; | ||
error = _useState[0], | ||
setError = _useState[1]; | ||
var _useState2 = useState(false), | ||
loading = _useState2[0], | ||
setLoading = _useState2[1]; | ||
loading = _useState2[0], | ||
setLoading = _useState2[1]; | ||
var _useState3 = useState(), | ||
data = _useState3[0], | ||
setData = _useState3[1]; | ||
var params = useParams(options.params); // Use "deep" dependency comparison because params are often not _referentially_ equal, | ||
data = _useState3[0], | ||
setData = _useState3[1]; | ||
var params = useParams(options.params); | ||
// Use "deep" dependency comparison because params are often not _referentially_ equal, | ||
// but contains the same shallow properties, eg `{"slug": "some-slug"}` | ||
useEffect(function () { | ||
@@ -201,3 +182,2 @@ if (!enabled) { | ||
} | ||
setLoading(true); | ||
@@ -209,5 +189,4 @@ var aborter = getAborter(); | ||
return; | ||
} // eslint-disable-next-line no-console | ||
} | ||
// eslint-disable-next-line no-console | ||
console.warn('Not authenticated - preview not available'); | ||
@@ -229,4 +208,4 @@ throw new Error('Not authenticated - preview not available'); | ||
return setLoading(false); | ||
}); // eslint-disable-next-line consistent-return | ||
}); | ||
// eslint-disable-next-line consistent-return | ||
return function () { | ||
@@ -236,3 +215,2 @@ if (subscription) { | ||
} | ||
aborter.abort(); | ||
@@ -246,5 +224,4 @@ }; | ||
}; | ||
} // Return params that are stable with deep equal as long as the key order is the same | ||
} | ||
// Return params that are stable with deep equal as long as the key order is the same | ||
function useParams(params) { | ||
@@ -251,0 +228,0 @@ var stringifiedParams = useMemo(function () { |
@@ -39,2 +39,6 @@ /// <reference types="react" /> | ||
/** | ||
* Sets the font-family of #__next | ||
*/ | ||
unstable__fontFamily?: NextStudioGlobalStyleProps['fontFamily']; | ||
/** | ||
* Don't load the favicon meta tags | ||
@@ -48,2 +52,2 @@ */ | ||
} | ||
export declare const NextStudio: import("react").MemoExoticComponent<({ children, config, unstable__noGlobalStyle, unstable__noTailwindSvgFix, unstable__head, unstable__document_title, unstable__bg, unstable__noFavicons, unstable__noNoScript, ...props }: NextStudioProps) => JSX.Element>; | ||
export declare const NextStudio: import("react").MemoExoticComponent<({ children, config, unstable__noGlobalStyle, unstable__noTailwindSvgFix, unstable__head, unstable__document_title, unstable__bg, unstable__fontFamily, unstable__noFavicons, unstable__noNoScript, ...props }: NextStudioProps) => JSX.Element>; |
export interface NextStudioGlobalStyleProps { | ||
fontFamily?: string; | ||
bg?: string; | ||
@@ -3,0 +4,0 @@ unstable__tailwindSvgFix?: boolean; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
export declare const NextStudioNoScript: () => JSX.Element; |
@@ -32,3 +32,3 @@ /// <reference types="react" /> | ||
static getInitialProps(ctx: DocumentContext): Promise<{ | ||
styles: ({} | undefined)[]; | ||
styles: (import("react").ReactFragment | JSX.Element | undefined)[]; | ||
html: string; | ||
@@ -35,0 +35,0 @@ head?: (JSX.Element | null)[] | undefined; |
@@ -16,2 +16,3 @@ import { Config, SingleWorkspace, StudioTheme, WorkspaceOptions } from 'sanity'; | ||
export declare const useBackgroundColorsFromTheme: (theme: StudioTheme) => MetaThemeColors; | ||
export declare const useTextFontFamilyFromTheme: (theme: StudioTheme) => string; | ||
/** | ||
@@ -18,0 +19,0 @@ * Parses the next route to determine the what the base path for Sanity Studio should be |
@@ -42,5 +42,6 @@ var $cerUD$reactjsxruntime = require("react/jsx-runtime"); | ||
* It's a drop-in replacement for `import {Studio} from 'sanity'` | ||
*/ const $c8bf9e0a6313dcb9$var$NextStudioComponent = ({ children: children , config: config , unstable__noGlobalStyle: unstable__noGlobalStyle , unstable__noTailwindSvgFix: unstable__noTailwindSvgFix , unstable__head: unstable__head , unstable__document_title: unstable__document_title , unstable__bg: unstable__bg , unstable__noFavicons: unstable__noFavicons , unstable__noNoScript: unstable__noNoScript , ...props })=>{ | ||
*/ const $c8bf9e0a6313dcb9$var$NextStudioComponent = ({ children: children , config: config , unstable__noGlobalStyle: unstable__noGlobalStyle , unstable__noTailwindSvgFix: unstable__noTailwindSvgFix , unstable__head: unstable__head , unstable__document_title: unstable__document_title , unstable__bg: unstable__bg , unstable__fontFamily: unstable__fontFamily , unstable__noFavicons: unstable__noFavicons , unstable__noNoScript: unstable__noNoScript , ...props })=>{ | ||
const theme = (0, $b07d91633f3d677b$export$93d4e7f90805808f)(config); | ||
const { themeColorLight: themeColorLight , themeColorDark: themeColorDark } = (0, $b07d91633f3d677b$export$d3a2146a441ec034)(theme); | ||
const themeFontFamily = (0, $b07d91633f3d677b$export$1e8b2c0d4a692a9b)(theme); | ||
return /*#__PURE__*/ (0, $cerUD$reactjsxruntime.jsxs)((0, $cerUD$reactjsxruntime.Fragment), { | ||
@@ -61,2 +62,3 @@ children: [ | ||
bg: unstable__bg !== null && unstable__bg !== void 0 ? unstable__bg : themeColorLight, | ||
fontFamily: unstable__fontFamily !== null && unstable__fontFamily !== void 0 ? unstable__fontFamily : themeFontFamily, | ||
unstable__tailwindSvgFix: !unstable__noTailwindSvgFix | ||
@@ -75,4 +77,4 @@ }), | ||
let $1ac20522861d7f1e$var$_ = (t)=>t, $1ac20522861d7f1e$var$t, $1ac20522861d7f1e$var$t1, $1ac20522861d7f1e$var$t2; | ||
const $1ac20522861d7f1e$export$c8fda7ee7699d07e = (0, $cerUD$styledcomponents.createGlobalStyle)($1ac20522861d7f1e$var$t2 || ($1ac20522861d7f1e$var$t2 = $1ac20522861d7f1e$var$_` | ||
let $1ac20522861d7f1e$var$_ = (t)=>t, $1ac20522861d7f1e$var$t, $1ac20522861d7f1e$var$t1, $1ac20522861d7f1e$var$t2, $1ac20522861d7f1e$var$t3; | ||
const $1ac20522861d7f1e$export$c8fda7ee7699d07e = (0, $cerUD$styledcomponents.createGlobalStyle)($1ac20522861d7f1e$var$t3 || ($1ac20522861d7f1e$var$t3 = $1ac20522861d7f1e$var$_` | ||
${0} | ||
@@ -89,2 +91,3 @@ html, | ||
} | ||
${0} | ||
${0}`), ({ bg: bg })=>bg ? (0, $cerUD$styledcomponents.css)($1ac20522861d7f1e$var$t || ($1ac20522861d7f1e$var$t = $1ac20522861d7f1e$var$_` | ||
@@ -94,3 +97,7 @@ html { | ||
} | ||
`), bg) : "", ({ unstable__tailwindSvgFix: unstable__tailwindSvgFix })=>unstable__tailwindSvgFix ? (0, $cerUD$styledcomponents.css)($1ac20522861d7f1e$var$t1 || ($1ac20522861d7f1e$var$t1 = $1ac20522861d7f1e$var$_` | ||
`), bg) : "", ({ fontFamily: fontFamily })=>fontFamily ? (0, $cerUD$styledcomponents.css)($1ac20522861d7f1e$var$t1 || ($1ac20522861d7f1e$var$t1 = $1ac20522861d7f1e$var$_` | ||
#__next { | ||
font-family: ${0}; | ||
} | ||
`), fontFamily) : "", ({ unstable__tailwindSvgFix: unstable__tailwindSvgFix })=>unstable__tailwindSvgFix ? (0, $cerUD$styledcomponents.css)($1ac20522861d7f1e$var$t2 || ($1ac20522861d7f1e$var$t2 = $1ac20522861d7f1e$var$_` | ||
/* override tailwind reset */ | ||
@@ -298,2 +305,3 @@ :root svg { | ||
$parcel$export($b07d91633f3d677b$exports, "useBackgroundColorsFromTheme", () => $b07d91633f3d677b$export$d3a2146a441ec034); | ||
$parcel$export($b07d91633f3d677b$exports, "useTextFontFamilyFromTheme", () => $b07d91633f3d677b$export$1e8b2c0d4a692a9b); | ||
$parcel$export($b07d91633f3d677b$exports, "useBasePath", () => $b07d91633f3d677b$export$53bdd69a9f9bd75); | ||
@@ -326,2 +334,7 @@ $parcel$export($b07d91633f3d677b$exports, "useConfigWithBasePath", () => $b07d91633f3d677b$export$297ba38aa0562c6e); | ||
}; | ||
const $b07d91633f3d677b$export$1e8b2c0d4a692a9b = (theme)=>{ | ||
return (0, $cerUD$react.useMemo)(()=>theme.fonts.text.family, [ | ||
theme | ||
]); | ||
}; | ||
function $b07d91633f3d677b$export$53bdd69a9f9bd75() { | ||
@@ -328,0 +341,0 @@ const router = (0, $cerUD$nextrouter.useRouter)(); |
@@ -39,2 +39,6 @@ /// <reference types="react" /> | ||
/** | ||
* Sets the font-family of #__next | ||
*/ | ||
unstable__fontFamily?: NextStudioGlobalStyleProps['fontFamily']; | ||
/** | ||
* Don't load the favicon meta tags | ||
@@ -48,2 +52,2 @@ */ | ||
} | ||
export declare const NextStudio: import("react").MemoExoticComponent<({ children, config, unstable__noGlobalStyle, unstable__noTailwindSvgFix, unstable__head, unstable__document_title, unstable__bg, unstable__noFavicons, unstable__noNoScript, ...props }: NextStudioProps) => JSX.Element>; | ||
export declare const NextStudio: import("react").MemoExoticComponent<({ children, config, unstable__noGlobalStyle, unstable__noTailwindSvgFix, unstable__head, unstable__document_title, unstable__bg, unstable__fontFamily, unstable__noFavicons, unstable__noNoScript, ...props }: NextStudioProps) => JSX.Element>; |
export interface NextStudioGlobalStyleProps { | ||
fontFamily?: string; | ||
bg?: string; | ||
@@ -3,0 +4,0 @@ unstable__tailwindSvgFix?: boolean; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
export declare const NextStudioNoScript: () => JSX.Element; |
@@ -32,3 +32,3 @@ /// <reference types="react" /> | ||
static getInitialProps(ctx: DocumentContext): Promise<{ | ||
styles: ({} | undefined)[]; | ||
styles: (import("react").ReactFragment | JSX.Element | undefined)[]; | ||
html: string; | ||
@@ -35,0 +35,0 @@ head?: (JSX.Element | null)[] | undefined; |
@@ -16,2 +16,3 @@ import { type Config, type SingleWorkspace, type StudioTheme, type WorkspaceOptions } from 'sanity'; | ||
export declare const useBackgroundColorsFromTheme: (theme: StudioTheme) => MetaThemeColors; | ||
export declare const useTextFontFamilyFromTheme: (theme: StudioTheme) => string; | ||
/** | ||
@@ -18,0 +19,0 @@ * Parses the next route to determine the what the base path for Sanity Studio should be |
@@ -42,5 +42,6 @@ import {jsxs as $4289s$jsxs, Fragment as $4289s$Fragment, jsx as $4289s$jsx} from "react/jsx-runtime"; | ||
* It's a drop-in replacement for `import {Studio} from 'sanity'` | ||
*/ const $1512e3a8033a35cc$var$NextStudioComponent = ({ children: children , config: config , unstable__noGlobalStyle: unstable__noGlobalStyle , unstable__noTailwindSvgFix: unstable__noTailwindSvgFix , unstable__head: unstable__head , unstable__document_title: unstable__document_title , unstable__bg: unstable__bg , unstable__noFavicons: unstable__noFavicons , unstable__noNoScript: unstable__noNoScript , ...props })=>{ | ||
*/ const $1512e3a8033a35cc$var$NextStudioComponent = ({ children: children , config: config , unstable__noGlobalStyle: unstable__noGlobalStyle , unstable__noTailwindSvgFix: unstable__noTailwindSvgFix , unstable__head: unstable__head , unstable__document_title: unstable__document_title , unstable__bg: unstable__bg , unstable__fontFamily: unstable__fontFamily , unstable__noFavicons: unstable__noFavicons , unstable__noNoScript: unstable__noNoScript , ...props })=>{ | ||
const theme = (0, $47ea254c66a1f1fc$export$93d4e7f90805808f)(config); | ||
const { themeColorLight: themeColorLight , themeColorDark: themeColorDark } = (0, $47ea254c66a1f1fc$export$d3a2146a441ec034)(theme); | ||
const themeFontFamily = (0, $47ea254c66a1f1fc$export$1e8b2c0d4a692a9b)(theme); | ||
return /*#__PURE__*/ (0, $4289s$jsxs)((0, $4289s$Fragment), { | ||
@@ -61,2 +62,3 @@ children: [ | ||
bg: unstable__bg !== null && unstable__bg !== void 0 ? unstable__bg : themeColorLight, | ||
fontFamily: unstable__fontFamily !== null && unstable__fontFamily !== void 0 ? unstable__fontFamily : themeFontFamily, | ||
unstable__tailwindSvgFix: !unstable__noTailwindSvgFix | ||
@@ -75,4 +77,4 @@ }), | ||
let $96bfa0bd9b2d4d7b$var$_ = (t)=>t, $96bfa0bd9b2d4d7b$var$t, $96bfa0bd9b2d4d7b$var$t1, $96bfa0bd9b2d4d7b$var$t2; | ||
const $96bfa0bd9b2d4d7b$export$c8fda7ee7699d07e = (0, $4289s$createGlobalStyle)($96bfa0bd9b2d4d7b$var$t2 || ($96bfa0bd9b2d4d7b$var$t2 = $96bfa0bd9b2d4d7b$var$_` | ||
let $96bfa0bd9b2d4d7b$var$_ = (t)=>t, $96bfa0bd9b2d4d7b$var$t, $96bfa0bd9b2d4d7b$var$t1, $96bfa0bd9b2d4d7b$var$t2, $96bfa0bd9b2d4d7b$var$t3; | ||
const $96bfa0bd9b2d4d7b$export$c8fda7ee7699d07e = (0, $4289s$createGlobalStyle)($96bfa0bd9b2d4d7b$var$t3 || ($96bfa0bd9b2d4d7b$var$t3 = $96bfa0bd9b2d4d7b$var$_` | ||
${0} | ||
@@ -89,2 +91,3 @@ html, | ||
} | ||
${0} | ||
${0}`), ({ bg: bg })=>bg ? (0, $4289s$css)($96bfa0bd9b2d4d7b$var$t || ($96bfa0bd9b2d4d7b$var$t = $96bfa0bd9b2d4d7b$var$_` | ||
@@ -94,3 +97,7 @@ html { | ||
} | ||
`), bg) : "", ({ unstable__tailwindSvgFix: unstable__tailwindSvgFix })=>unstable__tailwindSvgFix ? (0, $4289s$css)($96bfa0bd9b2d4d7b$var$t1 || ($96bfa0bd9b2d4d7b$var$t1 = $96bfa0bd9b2d4d7b$var$_` | ||
`), bg) : "", ({ fontFamily: fontFamily })=>fontFamily ? (0, $4289s$css)($96bfa0bd9b2d4d7b$var$t1 || ($96bfa0bd9b2d4d7b$var$t1 = $96bfa0bd9b2d4d7b$var$_` | ||
#__next { | ||
font-family: ${0}; | ||
} | ||
`), fontFamily) : "", ({ unstable__tailwindSvgFix: unstable__tailwindSvgFix })=>unstable__tailwindSvgFix ? (0, $4289s$css)($96bfa0bd9b2d4d7b$var$t2 || ($96bfa0bd9b2d4d7b$var$t2 = $96bfa0bd9b2d4d7b$var$_` | ||
/* override tailwind reset */ | ||
@@ -298,2 +305,3 @@ :root svg { | ||
$parcel$export($47ea254c66a1f1fc$exports, "useBackgroundColorsFromTheme", () => $47ea254c66a1f1fc$export$d3a2146a441ec034); | ||
$parcel$export($47ea254c66a1f1fc$exports, "useTextFontFamilyFromTheme", () => $47ea254c66a1f1fc$export$1e8b2c0d4a692a9b); | ||
$parcel$export($47ea254c66a1f1fc$exports, "useBasePath", () => $47ea254c66a1f1fc$export$53bdd69a9f9bd75); | ||
@@ -326,2 +334,7 @@ $parcel$export($47ea254c66a1f1fc$exports, "useConfigWithBasePath", () => $47ea254c66a1f1fc$export$297ba38aa0562c6e); | ||
}; | ||
const $47ea254c66a1f1fc$export$1e8b2c0d4a692a9b = (theme)=>{ | ||
return (0, $4289s$useMemo)(()=>theme.fonts.text.family, [ | ||
theme | ||
]); | ||
}; | ||
function $47ea254c66a1f1fc$export$53bdd69a9f9bd75() { | ||
@@ -364,3 +377,3 @@ const router = (0, $4289s$useRouter)(); | ||
export {$1512e3a8033a35cc$export$eefb95cccd1bb6c5 as NextStudio, $96bfa0bd9b2d4d7b$export$c8fda7ee7699d07e as NextStudioGlobalStyle, $42e0ba93e8ca4228$export$79723eee2c1bf75e as NextStudioHead, $30581564ea022575$export$39af4e536de5c6ed as NextStudioNoScript, $056a6fa2cc4f79d2$export$f64e2f55a1dca172 as ServerStyleSheetDocument, $47ea254c66a1f1fc$export$b7c6924067135ce as isWorkspaces, $47ea254c66a1f1fc$export$31236b9ee07dd150 as isWorkspaceWithTheme, $47ea254c66a1f1fc$export$93d4e7f90805808f as useTheme, $47ea254c66a1f1fc$export$d3a2146a441ec034 as useBackgroundColorsFromTheme, $47ea254c66a1f1fc$export$53bdd69a9f9bd75 as useBasePath, $47ea254c66a1f1fc$export$297ba38aa0562c6e as useConfigWithBasePath}; | ||
export {$1512e3a8033a35cc$export$eefb95cccd1bb6c5 as NextStudio, $96bfa0bd9b2d4d7b$export$c8fda7ee7699d07e as NextStudioGlobalStyle, $42e0ba93e8ca4228$export$79723eee2c1bf75e as NextStudioHead, $30581564ea022575$export$39af4e536de5c6ed as NextStudioNoScript, $056a6fa2cc4f79d2$export$f64e2f55a1dca172 as ServerStyleSheetDocument, $47ea254c66a1f1fc$export$b7c6924067135ce as isWorkspaces, $47ea254c66a1f1fc$export$31236b9ee07dd150 as isWorkspaceWithTheme, $47ea254c66a1f1fc$export$93d4e7f90805808f as useTheme, $47ea254c66a1f1fc$export$d3a2146a441ec034 as useBackgroundColorsFromTheme, $47ea254c66a1f1fc$export$1e8b2c0d4a692a9b as useTextFontFamilyFromTheme, $47ea254c66a1f1fc$export$53bdd69a9f9bd75 as useBasePath, $47ea254c66a1f1fc$export$297ba38aa0562c6e as useConfigWithBasePath}; | ||
//# sourceMappingURL=studio.js.map |
{ | ||
"name": "next-sanity", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"description": "Sanity.io toolkit for Next.js", | ||
@@ -74,5 +74,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@sanity/client": "^3.3.5", | ||
"@sanity/client": "^3.4.1", | ||
"@sanity/groq-store": "^0.4.1", | ||
"groq": "^2.29.3" | ||
"groq": "^2.33.2" | ||
}, | ||
@@ -82,12 +82,12 @@ "devDependencies": { | ||
"@sanity/eslint-config-studio": "^2.0.0", | ||
"@sanity/semantic-release-preset": "^2.0.1", | ||
"@sanity/semantic-release-preset": "^2.0.2", | ||
"@testing-library/react-hooks": "^8.0.1", | ||
"@types/eventsource": "^1.1.9", | ||
"@types/jest": "^28.1.8", | ||
"@types/react": "^17.0.48", | ||
"@types/jest": "^29.1.2", | ||
"@types/react": "^18.0.21", | ||
"@types/react-dom": "^18.0.6", | ||
"@types/styled-components": "^5.1.26", | ||
"@typescript-eslint/eslint-plugin": "^5.35.1", | ||
"eslint": "^8.23.0", | ||
"eslint-config-next": "^12.2.5", | ||
"@typescript-eslint/eslint-plugin": "^5.39.0", | ||
"eslint": "^8.25.0", | ||
"eslint-config-next": "^12.3.1", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -97,16 +97,16 @@ "eslint-config-sanity": "^6.0.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-simple-import-sort": "^7.0.0", | ||
"jest": "^29.0.1", | ||
"jest-environment-jsdom": "^29.0.1", | ||
"next": "^12.2.5", | ||
"eslint-plugin-simple-import-sort": "^8.0.0", | ||
"jest": "^29.1.2", | ||
"jest-environment-jsdom": "^29.1.2", | ||
"next": "^12.3.1", | ||
"parcel": "^2.7.0", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-packagejson": "^2.2.18", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-is": "^17.0.2", | ||
"sanity": "3.0.0-dev-preview.15", | ||
"styled-components": "^5.3.5", | ||
"prettier-plugin-packagejson": "^2.3.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-is": "^18.2.0", | ||
"sanity": "3.0.0-purple-unicorn.6", | ||
"styled-components": "^5.3.6", | ||
"tsdx": "^0.14.1", | ||
"typescript": "^4.8.2", | ||
"typescript": "^4.8.4", | ||
"write-file-atomic": "^4.0.2" | ||
@@ -113,0 +113,0 @@ }, |
import {createGlobalStyle, css} from 'styled-components' | ||
export interface NextStudioGlobalStyleProps { | ||
fontFamily?: string | ||
bg?: string | ||
@@ -26,2 +27,10 @@ unstable__tailwindSvgFix?: boolean | ||
} | ||
${({fontFamily}) => | ||
fontFamily | ||
? css` | ||
#__next { | ||
font-family: ${fontFamily}; | ||
} | ||
` | ||
: ''} | ||
${({unstable__tailwindSvgFix}) => | ||
@@ -28,0 +37,0 @@ unstable__tailwindSvgFix |
@@ -53,2 +53,6 @@ import {useRouter} from 'next/router' | ||
export const useTextFontFamilyFromTheme = (theme: StudioTheme): string => { | ||
return useMemo<string>(() => theme.fonts.text.family, [theme]) | ||
} | ||
/** | ||
@@ -55,0 +59,0 @@ * Parses the next route to determine the what the base path for Sanity Studio should be |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254059
2149
Updated@sanity/client@^3.4.1
Updatedgroq@^2.33.2