next-sanity 3.0.3 → 3.0.5
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/README.md +2 -5
- package/dist/studio/index.cjs +2 -5
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.d.ts +1 -1
- package/dist/studio/index.js +2 -3
- package/dist/studio/index.js.map +1 -1
- package/dist/webhook.cjs +2 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.ts +3 -6
- package/dist/webhook.js +2 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +5 -5
- package/src/studio/NextStudio.tsx +5 -3
- package/src/webhook/config.ts +15 -2
- package/dist/_chunks/LazyStudio-72ba8fe2.js +0 -2
- package/dist/_chunks/LazyStudio-72ba8fe2.js.map +0 -1
- package/dist/_chunks/LazyStudio-bf7e0fc9.cjs +0 -10
- package/dist/_chunks/LazyStudio-bf7e0fc9.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -224,14 +224,12 @@ export {PreviewSuspense as default} from 'next-sanity/preview'
|
|
|
224
224
|
`app/page.js`:
|
|
225
225
|
|
|
226
226
|
```jsx
|
|
227
|
-
import {lazy} from 'react'
|
|
228
227
|
import {previewData} from 'next/headers'
|
|
229
228
|
import PreviewSuspense from 'components/PreviewSuspense'
|
|
230
229
|
import {DocumentsCount, query} from 'components/DocumentsCount'
|
|
230
|
+
import PreviewDocumentsCount from 'components/PreviewDocumentsCount'
|
|
231
231
|
import {client} from 'lib/sanity.client'
|
|
232
232
|
|
|
233
|
-
const PreviewDocumentsCount = lazy(() => import('components/PreviewDocumentsCount'))
|
|
234
|
-
|
|
235
233
|
export default async function IndexPage() {
|
|
236
234
|
if (previewData()) {
|
|
237
235
|
return (
|
|
@@ -400,10 +398,9 @@ import {lazy} from 'react'
|
|
|
400
398
|
import {previewData} from 'next/headers'
|
|
401
399
|
import PreviewSuspense from 'components/PreviewSuspense'
|
|
402
400
|
import {DocumentsCount, query} from 'components/DocumentsCount'
|
|
401
|
+
import PreviewDocumentsCount from 'components/PreviewDocumentsCount'
|
|
403
402
|
import {client} from 'lib/sanity.client'
|
|
404
403
|
|
|
405
|
-
const PreviewDocumentsCount = lazy(() => import('components/PreviewDocumentsCount'))
|
|
406
|
-
|
|
407
404
|
export default async function IndexPage() {
|
|
408
405
|
if (previewData()?.token) {
|
|
409
406
|
return (
|
package/dist/studio/index.cjs
CHANGED
|
@@ -13,9 +13,9 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
13
13
|
});
|
|
14
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
15
15
|
var react = require('react');
|
|
16
|
+
var sanity = require('sanity');
|
|
16
17
|
var icons = require('@sanity/icons');
|
|
17
18
|
var ui = require('@sanity/ui');
|
|
18
|
-
var sanity = require('sanity');
|
|
19
19
|
var styled = require('styled-components');
|
|
20
20
|
function _interopDefaultLegacy(e) {
|
|
21
21
|
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
@@ -171,9 +171,6 @@ function NextStudioSuspense(_ref5) {
|
|
|
171
171
|
children: mounted ? children : fallback
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
const Studio = react.memo(react.lazy(() => Promise.resolve().then(function () {
|
|
175
|
-
return require('../_chunks/LazyStudio-bf7e0fc9.cjs');
|
|
176
|
-
})));
|
|
177
174
|
const NextStudioComponent = _ref6 => {
|
|
178
175
|
let {
|
|
179
176
|
children,
|
|
@@ -193,7 +190,7 @@ const NextStudioComponent = _ref6 => {
|
|
|
193
190
|
config,
|
|
194
191
|
scheme,
|
|
195
192
|
unstable__tailwindSvgFix,
|
|
196
|
-
children: children || /* @__PURE__ */jsxRuntime.jsx(Studio, _objectSpread({
|
|
193
|
+
children: children || /* @__PURE__ */jsxRuntime.jsx(sanity.Studio, _objectSpread({
|
|
197
194
|
config,
|
|
198
195
|
scheme,
|
|
199
196
|
unstable_globalStyles: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioFallback.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioSuspense.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport type NextStudioFallbackProps = Pick<StudioProps, 'config' | 'scheme'>\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nfunction NextStudioFallbackComponent(props: NextStudioFallbackProps) {\n const {config, scheme = 'light'} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioFallback = memo(NextStudioFallbackComponent)\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","import {type ReactNode, Suspense, useEffect, useReducer} from 'react'\n\n/** @alpha */\nexport type NextStudioSuspenseProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioSuspense({children, fallback}: NextStudioSuspenseProps) {\n const [mounted, mount] = useReducer(() => true, false)\n useEffect(mount, [mount])\n\n return <Suspense fallback={fallback}>{mounted ? children : fallback}</Suspense>\n}\n","import {lazy, memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {NextStudioFallback} from './NextStudioFallback'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {NextStudioSuspense} from './NextStudioSuspense'\n\nconst Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript = true,\n scheme,\n ...props\n}: NextStudioProps) => {\n return (\n <>\n {!unstable__noScript && <NextStudioNoScript />}\n <NextStudioSuspense fallback={<NextStudioFallback config={config} scheme={scheme} />}>\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioSuspense>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","keyframes","NextStudioFallbackComponent","props","scheme","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","animation","color","default","muted","enabled","fg","width","rem","height","svg","display","margin","jsx","style","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","jsxs","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","SpinnerIcon","NextStudioFallback","memo","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","unstable__tailwindSvgFix","NextStudioLayout","__html","NextStudioNoScript","className","type","dangerouslySetInnerHTML","href","NextStudioSuspense","fallback","mounted","mount","useReducer","useEffect","Suspense","Studio","lazy","Promise","resolve","then","require","NextStudioComponent","unstable__noScript","Fragment","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAe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AAa,CAAA;IACrE,CAAA;IACAJ,WAAa,EAAA,MAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmB,MAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,EAAA;AAGnB,SAASY,qBAA6C,GAAA;EAC3D,OAAOC,KAAAA,CAAAA,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioFallback.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioSuspense.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport type NextStudioFallbackProps = Pick<StudioProps, 'config' | 'scheme'>\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nfunction NextStudioFallbackComponent(props: NextStudioFallbackProps) {\n const {config, scheme = 'light'} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioFallback = memo(NextStudioFallbackComponent)\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","import {type ReactNode, Suspense, useEffect, useReducer} from 'react'\n\n/** @alpha */\nexport type NextStudioSuspenseProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioSuspense({children, fallback}: NextStudioSuspenseProps) {\n const [mounted, mount] = useReducer(() => true, false)\n useEffect(mount, [mount])\n\n return <Suspense fallback={fallback}>{mounted ? children : fallback}</Suspense>\n}\n","import {memo} from 'react'\nimport {type StudioProps, Studio} from 'sanity'\n\nimport {NextStudioFallback} from './NextStudioFallback'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {NextStudioSuspense} from './NextStudioSuspense'\n\n// eslint-disable-next-line no-warning-comments\n// FIXME: https://github.com/vercel/next.js/issues/43147\n// const Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript = true,\n scheme,\n ...props\n}: NextStudioProps) => {\n return (\n <>\n {!unstable__noScript && <NextStudioNoScript />}\n <NextStudioSuspense fallback={<NextStudioFallback config={config} scheme={scheme} />}>\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioSuspense>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","keyframes","NextStudioFallbackComponent","props","scheme","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","animation","color","default","muted","enabled","fg","width","rem","height","svg","display","margin","jsx","style","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","jsxs","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","SpinnerIcon","NextStudioFallback","memo","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","unstable__tailwindSvgFix","NextStudioLayout","__html","NextStudioNoScript","className","type","dangerouslySetInnerHTML","href","NextStudioSuspense","fallback","mounted","mount","useReducer","useEffect","Suspense","NextStudioComponent","unstable__noScript","Fragment","Studio","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAASA,aAAaC,MAA8C,EAAA;EAC3D,OAAAC,KAAA,CAAMC,QAAQF,MAAM,CAAA;AAC7B;AAEA,SAASG,qBACPC,SACmE,EAAA;EAC5D,OAAAC,OAAA,CAAQD,UAAUE,KAAK,CAAA;AAChC;AAGO,SAASC,SAASP,MAA6B,EAAA;EACpD,MAAMI,SAAY,GAAAI,KAAA,CAAAA,OAAA,CAChB,MAAOT,YAAA,CAAaC,MAAM,CAAA,GAAIA,OAAO,CAAK,CAAA,GAAAA,MAAA,EAC1C,CAACA,MAAM,CAAA,CACT;EACO,OAAAQ,KAAA,CAAAA,OAAA,CACL,MAAOL,oBAAA,CAAqBC,SAAS,CAAA,GAAIA,UAAUE,KAAQ,GAAAG,MAAA,CAAAA,YAAA,EAC3D,CAACL,SAAS,CAAA,CACZ;AACF;ACtBA,MAAMM,SAAY,uFAAA;AAUlB,SAASC,4BAA4BC,KAAgC,EAAA;EACnE,MAAM;IAACZ,MAAA;IAAQa,MAAS,GAAA;EAAA,CAAW,GAAAD,KAAA;EACnC,MAAME,EAAK,GAAA,qBAAA;EACL,MAAAR,KAAA,GAAQC,SAASP,MAAM,CAAA;EACvB,MAAA;IAACe,KAAO;IAAAC;EAAS,CAAA,GAAAV,KAAA;EAEvB,MAAMW,SAAcC,EAAAA,CAAAA,WAAY,CAAAF,KAAA,EAAO,CAAC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C,UAAA,GAAaC,MAAO,CAAAD,UAAA,CAAW,8BAA8B,CAAA;EAE5D,OAAA;IACLH,SAAA,EAAYK,aAA8B,IAAA;MAC7BF,UAAA,CAAAG,gBAAA,CAAiB,UAAUD,aAAa,CAAA;MACnD,OAAO,MAAMF,UAAA,CAAWI,mBAAoB,CAAA,QAAA,EAAUF,aAAa,CAAA;IACrE,CAAA;IACAJ,WAAa,EAAA,MAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmB,MAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,EAAA;AAGnB,SAASY,qBAA6C,GAAA;EAC3D,OAAOC,KAAAA,CAAAA,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;;;;;;;"}
|
package/dist/studio/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {Config} from 'sanity'
|
|
4
4
|
import {MemoExoticComponent} from 'react'
|
|
5
5
|
import {ReactNode} from 'react'
|
|
6
|
-
import
|
|
6
|
+
import {StudioProps} from 'sanity'
|
|
7
7
|
import {StudioTheme} from 'sanity'
|
|
8
8
|
import type {ThemeColorSchemeKey} from '@sanity/ui'
|
|
9
9
|
|
package/dist/studio/index.js
CHANGED
|
@@ -7,10 +7,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
8
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import { useMemo, memo, useReducer, useEffect, Suspense,
|
|
10
|
+
import { useMemo, memo, useReducer, useEffect, Suspense, useSyncExternalStore } from 'react';
|
|
11
|
+
import { defaultTheme, Studio } from 'sanity';
|
|
11
12
|
import { SpinnerIcon } from '@sanity/icons';
|
|
12
13
|
import { _responsive, rem } from '@sanity/ui';
|
|
13
|
-
import { defaultTheme } from 'sanity';
|
|
14
14
|
import styled, { css } from 'styled-components';
|
|
15
15
|
function isWorkspaces(config) {
|
|
16
16
|
return Array.isArray(config);
|
|
@@ -160,7 +160,6 @@ function NextStudioSuspense(_ref5) {
|
|
|
160
160
|
children: mounted ? children : fallback
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
const Studio = memo(lazy(() => import('../_chunks/LazyStudio-72ba8fe2.js')));
|
|
164
163
|
const NextStudioComponent = _ref6 => {
|
|
165
164
|
let {
|
|
166
165
|
children,
|
package/dist/studio/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioFallback.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioSuspense.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport type NextStudioFallbackProps = Pick<StudioProps, 'config' | 'scheme'>\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nfunction NextStudioFallbackComponent(props: NextStudioFallbackProps) {\n const {config, scheme = 'light'} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioFallback = memo(NextStudioFallbackComponent)\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","import {type ReactNode, Suspense, useEffect, useReducer} from 'react'\n\n/** @alpha */\nexport type NextStudioSuspenseProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioSuspense({children, fallback}: NextStudioSuspenseProps) {\n const [mounted, mount] = useReducer(() => true, false)\n useEffect(mount, [mount])\n\n return <Suspense fallback={fallback}>{mounted ? children : fallback}</Suspense>\n}\n","import {lazy, memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {NextStudioFallback} from './NextStudioFallback'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {NextStudioSuspense} from './NextStudioSuspense'\n\nconst Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript = true,\n scheme,\n ...props\n}: NextStudioProps) => {\n return (\n <>\n {!unstable__noScript && <NextStudioNoScript />}\n <NextStudioSuspense fallback={<NextStudioFallback config={config} scheme={scheme} />}>\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioSuspense>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","keyframes","NextStudioFallbackComponent","props","scheme","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","animation","color","default","muted","enabled","fg","width","rem","height","svg","display","margin","jsx","style","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","jsxs","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","SpinnerIcon","NextStudioFallback","memo","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","unstable__tailwindSvgFix","NextStudioLayout","__html","NextStudioNoScript","className","type","dangerouslySetInnerHTML","href","NextStudioSuspense","fallback","mounted","mount","useReducer","useEffect","Suspense","Studio","lazy","NextStudioComponent","unstable__noScript","Fragment","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;AAeA,SAASA,aAAaC,MAA8C,EAAA;EAC3D,OAAAC,KAAA,CAAMC,QAAQF,MAAM,CAAA;AAC7B;AAEA,SAASG,qBACPC,SACmE,EAAA;EAC5D,OAAAC,OAAA,CAAQD,UAAUE,KAAK,CAAA;AAChC;AAGO,SAASC,SAASP,MAA6B,EAAA;EACpD,MAAMI,SAAY,GAAAI,OAAA,CAChB,MAAOT,YAAA,CAAaC,MAAM,CAAA,GAAIA,OAAO,CAAK,CAAA,GAAAA,MAAA,EAC1C,CAACA,MAAM,CAAA,CACT;EACO,OAAAQ,OAAA,CACL,MAAOL,oBAAA,CAAqBC,SAAS,CAAA,GAAIA,UAAUE,KAAQ,GAAAG,YAAA,EAC3D,CAACL,SAAS,CAAA,CACZ;AACF;ACtBA,MAAMM,SAAY,uFAAA;AAUlB,SAASC,4BAA4BC,KAAgC,EAAA;EACnE,MAAM;IAACZ,MAAA;IAAQa,MAAS,GAAA;EAAA,CAAW,GAAAD,KAAA;EACnC,MAAME,EAAK,GA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AAAG,gBAAA,CAAiB,UAAUD,aAAa,CAAA;MACnD,OAAO,MAAMF,UAAA,CAAWI,mBAAoB,CAAA,QAAA,EAAUF,aAAa,CAAA;IACrE,CAAA;IACAJ,WAAa,EAAA,MAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmB,MAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,EAAA;AAGnB,SAASY,qBAA6C,GAAA;EAC3D,OAAOC,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioFallback.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioSuspense.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport type NextStudioFallbackProps = Pick<StudioProps, 'config' | 'scheme'>\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nfunction NextStudioFallbackComponent(props: NextStudioFallbackProps) {\n const {config, scheme = 'light'} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioFallback = memo(NextStudioFallbackComponent)\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","import {type ReactNode, Suspense, useEffect, useReducer} from 'react'\n\n/** @alpha */\nexport type NextStudioSuspenseProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioSuspense({children, fallback}: NextStudioSuspenseProps) {\n const [mounted, mount] = useReducer(() => true, false)\n useEffect(mount, [mount])\n\n return <Suspense fallback={fallback}>{mounted ? children : fallback}</Suspense>\n}\n","import {memo} from 'react'\nimport {type StudioProps, Studio} from 'sanity'\n\nimport {NextStudioFallback} from './NextStudioFallback'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {NextStudioSuspense} from './NextStudioSuspense'\n\n// eslint-disable-next-line no-warning-comments\n// FIXME: https://github.com/vercel/next.js/issues/43147\n// const Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript = true,\n scheme,\n ...props\n}: NextStudioProps) => {\n return (\n <>\n {!unstable__noScript && <NextStudioNoScript />}\n <NextStudioSuspense fallback={<NextStudioFallback config={config} scheme={scheme} />}>\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioSuspense>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","keyframes","NextStudioFallbackComponent","props","scheme","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","animation","color","default","muted","enabled","fg","width","rem","height","svg","display","margin","jsx","style","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","jsxs","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","SpinnerIcon","NextStudioFallback","memo","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","unstable__tailwindSvgFix","NextStudioLayout","__html","NextStudioNoScript","className","type","dangerouslySetInnerHTML","href","NextStudioSuspense","fallback","mounted","mount","useReducer","useEffect","Suspense","NextStudioComponent","unstable__noScript","Fragment","Studio","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;AAeA,SAASA,aAAaC,MAA8C,EAAA;EAC3D,OAAAC,KAAA,CAAMC,QAAQF,MAAM,CAAA;AAC7B;AAEA,SAASG,qBACPC,SACmE,EAAA;EAC5D,OAAAC,OAAA,CAAQD,UAAUE,KAAK,CAAA;AAChC;AAGO,SAASC,SAASP,MAA6B,EAAA;EACpD,MAAMI,SAAY,GAAAI,OAAA,CAChB,MAAOT,YAAA,CAAaC,MAAM,CAAA,GAAIA,OAAO,CAAK,CAAA,GAAAA,MAAA,EAC1C,CAACA,MAAM,CAAA,CACT;EACO,OAAAQ,OAAA,CACL,MAAOL,oBAAA,CAAqBC,SAAS,CAAA,GAAIA,UAAUE,KAAQ,GAAAG,YAAA,EAC3D,CAACL,SAAS,CAAA,CACZ;AACF;ACtBA,MAAMM,SAAY,uFAAA;AAUlB,SAASC,4BAA4BC,KAAgC,EAAA;EACnE,MAAM;IAACZ,MAAA;IAAQa,MAAS,GAAA;EAAA,CAAW,GAAAD,KAAA;EACnC,MAAME,EAAK,GAAA,qBAAA;EACL,MAAAR,KAAA,GAAQC,SAASP,MAAM,CAAA;EACvB,MAAA;IAACe,KAAO;IAAAC;EAAS,CAAA,GAAAV,KAAA;EAEvB,MAAMW,SAAcC,WAAY,CAAAF,KAAA,E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MAAMO,QAAQX,WAAY,EAAA;AAGnB,SAASY,qBAA6C,GAAA;EAC3D,OAAOC,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;"}
|
package/dist/webhook.cjs
CHANGED
package/dist/webhook.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.cjs","sources":["../src/webhook/config.ts","../src/webhook/readBody.ts","../src/webhook/parseBody.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"webhook.cjs","sources":["../src/webhook/config.ts","../src/webhook/readBody.ts","../src/webhook/parseBody.ts"],"sourcesContent":["import type {PageConfig} from 'next/types'\n\n/**\n * Configurates the API function with the right runtime and body parsing to handle Sanity Webhook events.\n * @public\n */\nexport const config: PageConfig = {\n api: {\n /**\n * Next.js will by default parse the body, which can lead to invalid signatures.\n */\n bodyParser: false,\n },\n /**\n * `@sanity/webhook` isn't updated to support the edge runtime yet, and currently requires Node.js APIs such as Buffer.\n */\n runtime: 'nodejs',\n}\n","import type {NextApiRequest} from 'next'\n\n/** @internal */\nexport async function _readBody(readable: NextApiRequest): Promise<string> {\n const chunks = []\n for await (const chunk of readable) {\n chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk)\n }\n return Buffer.concat(chunks).toString('utf8')\n}\n","import type {SanityDocument} from '@sanity/types'\nimport sanityWebhook from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\n\n// As `@sanity/webhook` isn't shipping ESM, extracting from the default export have the best ecosystem support\nconst {isValidSignature, SIGNATURE_HEADER_NAME} = sanityWebhook\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParseBody = {\n /**\n * If a secret is given then it returns a boolean. If no secret is provided then no validation is done on the signature, and it'll return `null`\n */\n isValidSignature: boolean | null\n body: SanityDocument\n}\n/**\n * Handles parsing the body JSON, and validating its signature. Also waits for Content Lake eventual consistency so you can run your queries\n * without worrying about getting stale data.\n * @public\n */\nexport async function parseBody(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean = true\n): Promise<ParseBody> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]!\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n\n // Read the body into a string\n const body = await readBody(req)\n // Then we're able to verify the checksum signature\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n // Wait a second to give Elastic Search time to reach eventual consistency\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() && JSON.parse(body),\n isValidSignature: validSignature,\n }\n}\n"],"names":["config","api","bodyParser","runtime","_readBody","readable","chunks","chunk","push","Buffer","from","concat","toString","isValidSignature","SIGNATURE_HEADER_NAME","sanityWebhook","parseBody","req","secret","waitForContentLakeEventualConsistency","signature","headers","Array","isArray","body","readBody","validSignature","trim","Promise","resolve","setTimeout","JSON","parse"],"mappings":";;;;;;;;;;;;AAMO,MAAMA,MAAqB,GAAA;EAChCC,GAAK,EAAA;IAIHC,UAAY,EAAA;EACd,CAAA;EAIAC,OAAS,EAAA;AACX,CAAA;ACdA,eAAsBC,UAAUC,QAA2C,EAAA;EACzE,MAAMC,SAAS,EAAC;EAChB,WAAA,MAAiBC,SAASF,QAAU,EAAA;IAC3BC,MAAA,CAAAE,IAAA,CAAK,OAAOD,KAAU,KAAA,QAAA,GAAWE,OAAOC,IAAK,CAAAH,KAAK,IAAIA,KAAK,CAAA;EACpE;EACA,OAAOE,MAAO,CAAAE,MAAA,CAAOL,MAAM,CAAA,CAAEM,SAAS,MAAM,CAAA;AAC9C;ACJA,MAAM;EAACC,gBAAkB;EAAAC;AAAyB,CAAA,GAAAC,iCAAA;AAiBlD,eAAsBC,SACpB,CAAAC,GAAA,EACAC,MACA,EACoB;EAAA,IADpBC,qCAAA,uEAAkD,IAC9B;EAChB,IAAAC,SAAA,GAAYH,IAAII,OAAQ,CAAAP,qBAAA,CAAA;EACxB,IAAAQ,KAAA,CAAMC,OAAQ,CAAAH,SAAS,CAAG,EAAA;IAC5BA,SAAA,GAAYA,SAAU,CAAA,CAAA,CAAA;EACxB;EAGM,MAAAI,IAAA,GAAO,MAAMC,SAAA,CAASR,GAAG,CAAA;EAEzB,MAAAS,cAAA,GAAiBR,SAASL,gBAAiB,CAAAW,IAAA,EAAMJ,WAAWF,MAAO,CAAAS,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASP,qCAAuC,EAAA;IAErE,MAAM,IAAIS,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLL,MAAMA,IAAK,CAAAG,IAAA,EAAU,IAAAI,IAAA,CAAKC,MAAMR,IAAI,CAAA;IACpCX,gBAAkB,EAAAa;EAAA,CACpB;AACF;;"}
|
package/dist/webhook.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import type {NextApiRequest} from 'next'
|
|
2
|
+
import type {PageConfig} from 'next/types'
|
|
2
3
|
import type {SanityDocument} from '@sanity/types'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Configurates the API function with the right runtime and body parsing to handle Sanity Webhook events.
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
|
-
export declare const config:
|
|
9
|
-
api: {
|
|
10
|
-
bodyParser: boolean
|
|
11
|
-
}
|
|
12
|
-
}
|
|
9
|
+
export declare const config: PageConfig
|
|
13
10
|
|
|
14
11
|
/** @public */
|
|
15
12
|
export declare type ParseBody = {
|
package/dist/webhook.js
CHANGED
package/dist/webhook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sources":["../src/webhook/config.ts","../src/webhook/readBody.ts","../src/webhook/parseBody.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"webhook.js","sources":["../src/webhook/config.ts","../src/webhook/readBody.ts","../src/webhook/parseBody.ts"],"sourcesContent":["import type {PageConfig} from 'next/types'\n\n/**\n * Configurates the API function with the right runtime and body parsing to handle Sanity Webhook events.\n * @public\n */\nexport const config: PageConfig = {\n api: {\n /**\n * Next.js will by default parse the body, which can lead to invalid signatures.\n */\n bodyParser: false,\n },\n /**\n * `@sanity/webhook` isn't updated to support the edge runtime yet, and currently requires Node.js APIs such as Buffer.\n */\n runtime: 'nodejs',\n}\n","import type {NextApiRequest} from 'next'\n\n/** @internal */\nexport async function _readBody(readable: NextApiRequest): Promise<string> {\n const chunks = []\n for await (const chunk of readable) {\n chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk)\n }\n return Buffer.concat(chunks).toString('utf8')\n}\n","import type {SanityDocument} from '@sanity/types'\nimport sanityWebhook from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\n\n// As `@sanity/webhook` isn't shipping ESM, extracting from the default export have the best ecosystem support\nconst {isValidSignature, SIGNATURE_HEADER_NAME} = sanityWebhook\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParseBody = {\n /**\n * If a secret is given then it returns a boolean. If no secret is provided then no validation is done on the signature, and it'll return `null`\n */\n isValidSignature: boolean | null\n body: SanityDocument\n}\n/**\n * Handles parsing the body JSON, and validating its signature. Also waits for Content Lake eventual consistency so you can run your queries\n * without worrying about getting stale data.\n * @public\n */\nexport async function parseBody(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean = true\n): Promise<ParseBody> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]!\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n\n // Read the body into a string\n const body = await readBody(req)\n // Then we're able to verify the checksum signature\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n // Wait a second to give Elastic Search time to reach eventual consistency\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() && JSON.parse(body),\n isValidSignature: validSignature,\n }\n}\n"],"names":["config","api","bodyParser","runtime","_readBody","readable","chunks","chunk","push","Buffer","from","concat","toString","isValidSignature","SIGNATURE_HEADER_NAME","sanityWebhook","parseBody","req","secret","waitForContentLakeEventualConsistency","signature","headers","Array","isArray","body","readBody","validSignature","trim","Promise","resolve","setTimeout","JSON","parse"],"mappings":";AAMO,MAAMA,MAAqB,GAAA;EAChCC,GAAK,EAAA;IAIHC,UAAY,EAAA;EACd,CAAA;EAIAC,OAAS,EAAA;AACX,CAAA;ACdA,eAAsBC,UAAUC,QAA2C,EAAA;EACzE,MAAMC,SAAS,EAAC;EAChB,WAAA,MAAiBC,SAASF,QAAU,EAAA;IAC3BC,MAAA,CAAAE,IAAA,CAAK,OAAOD,KAAU,KAAA,QAAA,GAAWE,OAAOC,IAAK,CAAAH,KAAK,IAAIA,KAAK,CAAA;EACpE;EACA,OAAOE,MAAO,CAAAE,MAAA,CAAOL,MAAM,CAAA,CAAEM,SAAS,MAAM,CAAA;AAC9C;ACJA,MAAM;EAACC,gBAAkB;EAAAC;AAAyB,CAAA,GAAAC,aAAA;AAiBlD,eAAsBC,SACpB,CAAAC,GAAA,EACAC,MACA,EACoB;EAAA,IADpBC,qCAAA,uEAAkD,IAC9B;EAChB,IAAAC,SAAA,GAAYH,IAAII,OAAQ,CAAAP,qBAAA,CAAA;EACxB,IAAAQ,KAAA,CAAMC,OAAQ,CAAAH,SAAS,CAAG,EAAA;IAC5BA,SAAA,GAAYA,SAAU,CAAA,CAAA,CAAA;EACxB;EAGM,MAAAI,IAAA,GAAO,MAAMC,SAAA,CAASR,GAAG,CAAA;EAEzB,MAAAS,cAAA,GAAiBR,SAASL,gBAAiB,CAAAW,IAAA,EAAMJ,WAAWF,MAAO,CAAAS,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASP,qCAAuC,EAAA;IAErE,MAAM,IAAIS,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLL,MAAMA,IAAK,CAAAG,IAAA,EAAU,IAAAI,IAAA,CAAKC,MAAMR,IAAI,CAAA;IACpCX,gBAAkB,EAAAa;EAAA,CACpB;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"@sanity/client": "^3.4.1",
|
|
123
|
-
"@sanity/preview-kit": "^1.2.
|
|
123
|
+
"@sanity/preview-kit": "^1.2.9",
|
|
124
124
|
"@sanity/webhook": "^2.0.0",
|
|
125
125
|
"groq": "^2.33.2"
|
|
126
126
|
},
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
|
142
142
|
"autoprefixer": "^10.4.13",
|
|
143
143
|
"eslint": "^8.28.0",
|
|
144
|
-
"eslint-config-next": "13.0.
|
|
144
|
+
"eslint-config-next": "13.0.6-canary.0",
|
|
145
145
|
"eslint-config-prettier": "^8.5.0",
|
|
146
146
|
"eslint-config-sanity": "^6.0.0",
|
|
147
147
|
"eslint-gitignore": "^0.1.0",
|
|
@@ -150,9 +150,9 @@
|
|
|
150
150
|
"groqd": "^0.0.4",
|
|
151
151
|
"jest": "^29.3.1",
|
|
152
152
|
"jest-environment-jsdom": "^29.3.1",
|
|
153
|
-
"next": "13.0.
|
|
153
|
+
"next": "13.0.6-canary.0",
|
|
154
154
|
"postcss": "^8.4.19",
|
|
155
|
-
"prettier": "^2.
|
|
155
|
+
"prettier": "^2.8.0",
|
|
156
156
|
"prettier-plugin-packagejson": "^2.3.0",
|
|
157
157
|
"prettier-plugin-tailwindcss": "^0.1.13",
|
|
158
158
|
"react": "^18.2.0",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import {memo} from 'react'
|
|
2
|
+
import {type StudioProps, Studio} from 'sanity'
|
|
3
3
|
|
|
4
4
|
import {NextStudioFallback} from './NextStudioFallback'
|
|
5
5
|
import {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'
|
|
6
6
|
import {NextStudioNoScript} from './NextStudioNoScript'
|
|
7
7
|
import {NextStudioSuspense} from './NextStudioSuspense'
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// eslint-disable-next-line no-warning-comments
|
|
10
|
+
// FIXME: https://github.com/vercel/next.js/issues/43147
|
|
11
|
+
// const Studio = memo(lazy(() => import('./LazyStudio')))
|
|
10
12
|
|
|
11
13
|
/** @beta */
|
|
12
14
|
export interface NextStudioProps extends StudioProps {
|
package/src/webhook/config.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
import type {PageConfig} from 'next/types'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Configurates the API function with the right runtime and body parsing to handle Sanity Webhook events.
|
|
3
5
|
* @public
|
|
4
6
|
*/
|
|
5
|
-
export const config = {
|
|
7
|
+
export const config: PageConfig = {
|
|
8
|
+
api: {
|
|
9
|
+
/**
|
|
10
|
+
* Next.js will by default parse the body, which can lead to invalid signatures.
|
|
11
|
+
*/
|
|
12
|
+
bodyParser: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* `@sanity/webhook` isn't updated to support the edge runtime yet, and currently requires Node.js APIs such as Buffer.
|
|
16
|
+
*/
|
|
17
|
+
runtime: 'nodejs',
|
|
18
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LazyStudio-72ba8fe2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LazyStudio-bf7e0fc9.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|