next-sanity 5.5.4 → 5.5.6

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.
Files changed (82) hide show
  1. package/README.md +5 -6
  2. package/dist/client.cjs +1 -0
  3. package/dist/client.cjs.map +1 -1
  4. package/dist/client.js +1 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.cjs +1 -0
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +1 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/preview/index.cjs +1 -0
  11. package/dist/preview/index.cjs.map +1 -1
  12. package/dist/preview/index.js +1 -0
  13. package/dist/preview/index.js.map +1 -1
  14. package/dist/preview/live-query.cjs +1 -0
  15. package/dist/preview/live-query.cjs.map +1 -1
  16. package/dist/preview/live-query.js +1 -0
  17. package/dist/preview/live-query.js.map +1 -1
  18. package/dist/studio/NextStudio.cjs +1 -0
  19. package/dist/studio/NextStudio.cjs.map +1 -1
  20. package/dist/studio/NextStudio.js +1 -0
  21. package/dist/studio/NextStudio.js.map +1 -1
  22. package/dist/studio/NextStudioClientOnly.cjs +1 -0
  23. package/dist/studio/NextStudioClientOnly.cjs.map +1 -1
  24. package/dist/studio/NextStudioClientOnly.js +1 -0
  25. package/dist/studio/NextStudioClientOnly.js.map +1 -1
  26. package/dist/studio/NextStudioLayout.cjs +1 -0
  27. package/dist/studio/NextStudioLayout.cjs.map +1 -1
  28. package/dist/studio/NextStudioLayout.js +1 -0
  29. package/dist/studio/NextStudioLayout.js.map +1 -1
  30. package/dist/studio/NextStudioLoading.cjs +1 -0
  31. package/dist/studio/NextStudioLoading.cjs.map +1 -1
  32. package/dist/studio/NextStudioLoading.js +1 -0
  33. package/dist/studio/NextStudioLoading.js.map +1 -1
  34. package/dist/studio/NextStudioNoScript.cjs +1 -0
  35. package/dist/studio/NextStudioNoScript.cjs.map +1 -1
  36. package/dist/studio/NextStudioNoScript.js +1 -0
  37. package/dist/studio/NextStudioNoScript.js.map +1 -1
  38. package/dist/studio/head/NextStudioHead.cjs +1 -0
  39. package/dist/studio/head/NextStudioHead.cjs.map +1 -1
  40. package/dist/studio/head/NextStudioHead.js +1 -0
  41. package/dist/studio/head/NextStudioHead.js.map +1 -1
  42. package/dist/studio/head.cjs +1 -0
  43. package/dist/studio/head.cjs.map +1 -1
  44. package/dist/studio/head.js +1 -0
  45. package/dist/studio/head.js.map +1 -1
  46. package/dist/studio/index.cjs +1 -0
  47. package/dist/studio/index.cjs.map +1 -1
  48. package/dist/studio/index.js +1 -0
  49. package/dist/studio/index.js.map +1 -1
  50. package/dist/studio/loading.cjs +1 -0
  51. package/dist/studio/loading.cjs.map +1 -1
  52. package/dist/studio/loading.js +1 -0
  53. package/dist/studio/loading.js.map +1 -1
  54. package/dist/studio/metadata.cjs +1 -0
  55. package/dist/studio/metadata.cjs.map +1 -1
  56. package/dist/studio/metadata.js +1 -0
  57. package/dist/studio/metadata.js.map +1 -1
  58. package/dist/studio/usePrefersColorScheme.cjs +1 -0
  59. package/dist/studio/usePrefersColorScheme.cjs.map +1 -1
  60. package/dist/studio/usePrefersColorScheme.js +1 -0
  61. package/dist/studio/usePrefersColorScheme.js.map +1 -1
  62. package/dist/studio/useTheme.cjs +1 -0
  63. package/dist/studio/useTheme.cjs.map +1 -1
  64. package/dist/studio/useTheme.js +1 -0
  65. package/dist/studio/useTheme.js.map +1 -1
  66. package/dist/webhook/config.cjs +1 -0
  67. package/dist/webhook/config.cjs.map +1 -1
  68. package/dist/webhook/config.js +1 -0
  69. package/dist/webhook/config.js.map +1 -1
  70. package/dist/webhook/parseBody.cjs +1 -0
  71. package/dist/webhook/parseBody.cjs.map +1 -1
  72. package/dist/webhook/parseBody.js +1 -0
  73. package/dist/webhook/parseBody.js.map +1 -1
  74. package/dist/webhook/readBody.cjs +1 -0
  75. package/dist/webhook/readBody.cjs.map +1 -1
  76. package/dist/webhook/readBody.js +1 -0
  77. package/dist/webhook/readBody.js.map +1 -1
  78. package/dist/webhook.cjs +1 -0
  79. package/dist/webhook.cjs.map +1 -1
  80. package/dist/webhook.js +1 -0
  81. package/dist/webhook.js.map +1 -1
  82. package/package.json +28 -29
package/README.md CHANGED
@@ -106,7 +106,7 @@ const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID // "pv8y60vp"
106
106
  const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET // "production"
107
107
  const apiVersion = process.env.NEXT_PUBLIC_SANITY_API_VERSION || '2023-05-03'
108
108
 
109
- const client = createClient({
109
+ export const client = createClient({
110
110
  projectId,
111
111
  dataset,
112
112
  apiVersion, // https://www.sanity.io/docs/api-versioning
@@ -225,9 +225,9 @@ type HomePageProps = {
225
225
 
226
226
  export async function HomeLayout({children}) {
227
227
  const home = await client.fetch<HomePageProps>(`*[_id == "home"][0]{...,navItems[]->}`,
228
- next: {
228
+ {next: {
229
229
  revalidate: 3600 // look for updates to revalidate cache every hour
230
- }
230
+ }}
231
231
  })
232
232
 
233
233
  return (
@@ -337,7 +337,7 @@ You can use this [template][webhook-template] to quickly configure the webhook f
337
337
  The code example below uses the built-in `parseBody` function to validate that the request comes from your Sanity project (using a shared secret + looking at the request headers). Then it looks at the document type information in the webhook payload and matches that against the revalidation tags in your app:
338
338
 
339
339
  ```ts
340
- // ./src/app/api/revalidate.ts
340
+ // ./src/app/api/revalidate/route.ts
341
341
  import {revalidateTag} from 'next/cache'
342
342
  import {type NextRequest, NextResponse} from 'next/server'
343
343
  import {parseBody} from 'next-sanity/webhook'
@@ -361,7 +361,7 @@ export async function POST(req: NextRequest) {
361
361
 
362
362
  // If the `_type` is `page`, then all `client.fetch` calls with
363
363
  // `{next: {tags: ['page']}}` will be revalidated
364
- await revalidateTag(body._type)
364
+ revalidateTag(body._type)
365
365
 
366
366
  return NextResponse.json({body})
367
367
  } catch (err) {
@@ -472,7 +472,6 @@ import 'server-only'
472
472
  import {draftMode} from 'next/headers'
473
473
  import type {QueryParams} from '@sanity/client'
474
474
  import {createClient, groq} from 'next-sanity'
475
- import {draftMode} from 'next/headers'
476
475
 
477
476
  const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID // "pv8y60vp"
478
477
  const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET // "production"
package/dist/client.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"client.cjs","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["createClient","config","studioUrl","process","env","NEXT_PUBLIC_SANITY_STUDIO_URL","encodeSourceMap","NEXT_PUBLIC_VERCEL_ENV","createPreviewKitClient"],"mappings":";;;;;;AAgCO,SAASA,aAAaC,MAAoC,EAAA;EAC3D,IAAA;IAAA;IAEFC,SAAA,GAAYC,QAAQC,GAAI,CAAAC,6BAAA;IACxBC,eAAA,GAAkBJ,YAAY,MAAS,GAAA;EACrC,CAAA,GAAAD,MAAA;EAEJ,IAAIK,eAAoB,KAAA,MAAA,IAAUH,OAAQ,CAAAC,GAAA,CAAIG,2BAA2B,SAAW,EAAA;IAChED,eAAA,GAAA,IAAA;EACpB;EACA,OAAOE,MAAAA,CAAAA,aAAuB;IAAC,GAAGP,MAAQ;IAAAC,SAAA;IAAWI;EAAgB,CAAA,CAAA;AACvE;"}
1
+ {"version":3,"file":"client.cjs","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["studioUrl","encodeSourceMap"],"mappings":";;;;;;;AAgCO;;AACD;AAEFA;AACAC;AACE;;AAGgBA;AACpB;;AAC+B;;AAAsBA;AAAgB;AACvE;"}
package/dist/client.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { createClient as createClient$1 } from '@sanity/preview-kit/client';
2
3
  function createClient(config) {
3
4
  let {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["createClient","config","studioUrl","process","env","NEXT_PUBLIC_SANITY_STUDIO_URL","encodeSourceMap","NEXT_PUBLIC_VERCEL_ENV","createPreviewKitClient"],"mappings":";AAgCO,SAASA,aAAaC,MAAoC,EAAA;EAC3D,IAAA;IAAA;IAEFC,SAAA,GAAYC,QAAQC,GAAI,CAAAC,6BAAA;IACxBC,eAAA,GAAkBJ,YAAY,MAAS,GAAA;EACrC,CAAA,GAAAD,MAAA;EAEJ,IAAIK,eAAoB,KAAA,MAAA,IAAUH,OAAQ,CAAAC,GAAA,CAAIG,2BAA2B,SAAW,EAAA;IAChED,eAAA,GAAA,IAAA;EACpB;EACA,OAAOE,eAAuB;IAAC,GAAGP,MAAQ;IAAAC,SAAA;IAAWI;EAAgB,CAAA,CAAA;AACvE;"}
1
+ {"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["studioUrl","encodeSourceMap"],"mappings":";;AAgCO;;AACD;AAEFA;AACAC;AACE;;AAGgBA;AACpB;AACA;AAA+B;;AAAsBA;AAAgB;AACvE;"}
package/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  export { createClient } from './client.js';
2
3
  export { default as groq } from 'groq';
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,3 @@
1
+ 'use strict';
1
2
  export { LiveQueryProvider, default, useLiveQuery } from '@sanity/preview-kit';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"live-query.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"live-query.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  export * from '@sanity/preview-kit/live-query';
2
3
  export { default } from '@sanity/preview-kit/live-query';
3
4
  //# sourceMappingURL=live-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"live-query.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"live-query.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudio.cjs","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: 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__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\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"],"names":["NextStudioComponent","_ref","children","config","unstable__noScript","unstable__fastRender","scheme","props","jsxs","Fragment","NextStudioNoScript","jsx","NextStudioLayout","Studio","unstable_globalStyles","NextStudioClientOnly","fallback","NextStudioLoading","NextStudio","memo"],"mappings":";;;;;;;;;;;;AA8BA,MAAMA,sBAAsBC,IAAA,IAOL;EAAA,IAPM;IAC3BC,QAAA;IACAC,MAAA;IACAC,kBAAqB,GAAA,IAAA;IACrBC,oBAAA;IACAC,MAAA;IACA,GAAGC;EACL,CAAuB,GAAAN,IAAA;EACrB,IAAII,oBAAsB,EAAA;IACxB,sBAEKG,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;MAAAP,QAAA,EAAA,CAAAE,kBAAA,kCAAuBM,kBAAmB,CAAAA,kBAAA,EAAA,EAAA,CAAA,EAAA,eAC1CC,UAAA,CAAAA,GAAA,CAAAC,gBAAA,CAAAA,gBAAA,EAAA;QAAiBT,MAAgB;QAAAG,MAAA;QAC/BJ,QACC,EAAAA,QAAA,mBAAAS,UAAA,CAAAA,GAAA,CAACE,MAAO,CAAAA,MAAA,EAAA;UAAAV,MAAA;UAAgBG,MAAgB;UAAAQ,qBAAA,EAAqB,IAAE;UAAA,GAAGP;QAAO,CAAA;OAE7E,CAAA;IACF,CAAA,CAAA;EAEJ;EAEA,sBAEKC,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;IAAAP,QAAA,EAAA,CAAAE,kBAAA,kCAAuBM,kBAAmB,CAAAA,kBAAA,EAAA,EAAA,CAAA,EAAA,eAC3CC,UAAA,CAAAA,GAAA,CAACI,oBAAA,CAAAA,oBAAA,EAAA;MACCC,QACE,iBAAAL,UAAA,CAAAA,GAAA,CAACM,iBAAA,CAAAA,iBAAA,EAAA;QACCb,kBAAA;QACAD,MAAA;QACAG;MAAA,CACF,CAAA;MAGFJ,QAAC,EAAA,eAAAS,UAAA,CAAAA,GAAA,CAAAC,iCAAA,EAAA;QAAiBT,MAAgB;QAAAG,MAAA;QAC/BJ,QACC,EAAAA,QAAA,IAAAS,eAAAA,UAAAA,CAAAA,GAAA,CAACE,MAAAA,CAAAA,MAAO,EAAA;UAAAV,MAAA;UAAgBG,MAAgB;UAAAQ,qBAAA,EAAqB,IAAE;UAAA,GAAGP;QAAO,CAAA;OAE7E;IAAA,CACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;AAiBa,MAAAW,UAAA,GAAaC,WAAKnB,mBAAmB,CAAA;"}
1
+ {"version":3,"file":"NextStudio.cjs","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: 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__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\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"],"names":["unstable__noScript","unstable_globalStyles","scheme"],"mappings":";;;;;;;;;;;;;AA8BA;;;;AAGEA;;;;AAIF;AACE;;;;;;;;AAMkDC;;;;AAG9C;AAEJ;;;;;;AAUUC;AAAA;;;;;;;AAMwCD;;;;AAE5C;AAEJ;AAEJ;AAiBa;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { memo } from 'react';
3
4
  import { Studio } from 'sanity';
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudio.js","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: 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__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\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"],"names":["NextStudioComponent","_ref","children","config","unstable__noScript","unstable__fastRender","scheme","props","jsxs","Fragment","NextStudioNoScript","jsx","NextStudioLayout","Studio","unstable_globalStyles","NextStudioClientOnly","fallback","NextStudioLoading","NextStudio","memo"],"mappings":";;;;;;;AA8BA,MAAMA,sBAAsBC,IAAA,IAOL;EAAA,IAPM;IAC3BC,QAAA;IACAC,MAAA;IACAC,kBAAqB,GAAA,IAAA;IACrBC,oBAAA;IACAC,MAAA;IACA,GAAGC;EACL,CAAuB,GAAAN,IAAA;EACrB,IAAII,oBAAsB,EAAA;IACxB,sBAEKG,IAAA,CAAAC,QAAA,EAAA;MAAAP,QAAA,EAAA,CAAAE,kBAAA,uBAAuBM,kBAAmB,EAAA,EAAA,CAAA,EAAA,eAC1CC,GAAA,CAAAC,gBAAA,EAAA;QAAiBT,MAAgB;QAAAG,MAAA;QAC/BJ,QACC,EAAAA,QAAA,mBAAAS,GAAA,CAACE,MAAO,EAAA;UAAAV,MAAA;UAAgBG,MAAgB;UAAAQ,qBAAA,EAAqB,IAAE;UAAA,GAAGP;QAAO,CAAA;OAE7E,CAAA;IACF,CAAA,CAAA;EAEJ;EAEA,sBAEKC,IAAA,CAAAC,QAAA,EAAA;IAAAP,QAAA,EAAA,CAAAE,kBAAA,uBAAuBM,kBAAmB,EAAA,EAAA,CAAA,EAAA,eAC3CC,GAAA,CAACI,oBAAA,EAAA;MACCC,QACE,iBAAAL,GAAA,CAACM,iBAAA,EAAA;QACCb,kBAAA;QACAD,MAAA;QACAG;MAAA,CACF,CAAA;MAGFJ,QAAC,EAAA,eAAAS,GAAA,CAAAC,gBAAA,EAAA;QAAiBT,MAAgB;QAAAG,MAAA;QAC/BJ,QACC,EAAAA,QAAA,IAAA,eAAAS,GAAA,CAACE,MAAO,EAAA;UAAAV,MAAA;UAAgBG,MAAgB;UAAAQ,qBAAA,EAAqB,IAAE;UAAA,GAAGP;QAAO,CAAA;OAE7E;IAAA,CACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;AAiBa,MAAAW,UAAA,GAAaC,KAAKnB,mBAAmB,CAAA;"}
1
+ {"version":3,"file":"NextStudio.js","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: 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__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\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"],"names":["unstable__noScript","children","unstable_globalStyles","fallback","scheme"],"mappings":";;;;;;;;AA8BA;;;;AAGEA;;;;AAIF;AACE;AACE;AAEKC;;;AAEEA;;;AACyCC;;;;AAG9C;AAEJ;AAEA;AAEKD;AAECE;;;AAIIC;AAAA;AAIJH;;;AACGA;;;AACyCC;;;;AAE5C;AAEJ;AAEJ;AAiBa;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioClientOnly.cjs","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["NextStudioClientOnly","_ref","children","fallback","mounted","setMounted","useState","useEffect","startTransition","jsx","Fragment"],"mappings":";;;;;;;AASO,SAASA,oBAAqBA,CAAAC,IAAA,EAAiD;EAAA,IAAjD;IAACC,QAAU;IAAAC;GAAsC,GAAAF,IAAA;EACpF,MAAM,CAACG,OAAA,EAASC,UAAU,CAAA,GAAIC,eAAS,KAAK,CAAA;EAClCC,KAAA,CAAAA,SAAA,CAAA,MAAMC,KAAAA,CAAAA,gBAAgB,MAAMH,UAAA,CAAW,IAAI,CAAC,CAAA,EAAG,EAAE,CAAA;EAEpD,OAAAI,eAAAA,UAAAA,CAAAA,GAAA,CAAAC,UAAAA,CAAAA,QAAA,EAAA;IAAGR,QAAU,EAAAE,OAAA,GAAAF,QAAA,GAAWC;EAAS,CAAA,CAAA;AAC1C;"}
1
+ {"version":3,"file":"NextStudioClientOnly.cjs","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["fallback","useEffect","children"],"mappings":";;;;;;;;AASO;;;AAAyCA;;;AAEpCC;;AAEAC;AAA8B;AAC1C;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { useState, useEffect, startTransition } from 'react';
3
4
  function NextStudioClientOnly(_ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioClientOnly.js","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["NextStudioClientOnly","_ref","children","fallback","mounted","setMounted","useState","useEffect","startTransition","jsx","Fragment"],"mappings":";;AASO,SAASA,oBAAqBA,CAAAC,IAAA,EAAiD;EAAA,IAAjD;IAACC,QAAU;IAAAC;GAAsC,GAAAF,IAAA;EACpF,MAAM,CAACG,OAAA,EAASC,UAAU,CAAA,GAAIC,SAAS,KAAK,CAAA;EAClCC,SAAA,CAAA,MAAMC,gBAAgB,MAAMH,UAAA,CAAW,IAAI,CAAC,CAAA,EAAG,EAAE,CAAA;EAEpD,OAAA,eAAAI,GAAA,CAAAC,QAAA,EAAA;IAAGR,QAAU,EAAAE,OAAA,GAAAF,QAAA,GAAWC;EAAS,CAAA,CAAA;AAC1C;"}
1
+ {"version":3,"file":"NextStudioClientOnly.js","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["fallback","useEffect","children"],"mappings":";;;AASO;;;AAAyCA;;;AAEpCC;AAEH;AAAGC;AAA8B;AAC1C;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioLayout.cjs","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["NextStudioLayoutComponent","_ref","children","config","scheme","theme","useTheme","jsx","style","fontFamily","fonts","text","family","backgroundColor","color","default","base","bg","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","NextStudioLayout","memo"],"mappings":";;;;;;;;AAWA,MAAMA,4BAA4BC,IAAA,IAIL;EAAA,IAJM;IACjCC,QAAA;IACAC,MAAA;IACAC,MAAS,GAAA;EACX,CAA6B,GAAAH,IAAA;EACrB,MAAAI,KAAA,GAAQC,kBAASH,MAAM,CAAA;EAG3B,sBAAAI,UAAA,CAAAA,GAAA,CAAC,KAAA,EAAA;IACC,SAAQ,EAAA,kBAAA;IACRC,KAAO,EAAA;MACLC,UAAA,EAAYJ,KAAM,CAAAK,KAAA,CAAMC,IAAK,CAAAC,MAAA;MAC7BC,eAAA,EAAiBR,MAAMS,KAAM,CAAAV,MAAA,KAAW,SAAS,MAAS,GAAA,OAAO,CAAE,CAAAW,OAAA,CAAQC,IAAK,CAAAC,EAAA;MAChFC,MAAQ,EAAA,OAAA;MACRC,SAAW,EAAA,QAAA;MACXC,kBAAoB,EAAA,MAAA;MACpBC,mBAAqB,EAAA,aAAA;MACrBC,QAAU,EAAA;IACZ,CAAA;IAECpB;EAAA,CAAA,CACH;AAEJ,CAAA;AAGa,MAAAqB,gBAAA,GAAmBC,WAAKxB,yBAAyB,CAAA;"}
1
+ {"version":3,"file":"NextStudioLayout.cjs","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["scheme","style","fontFamily","backgroundColor","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children"],"mappings":";;;;;;;;;AAWA;;;;AAGEA;AACF;AACQ;AAGJ;AACE;AACAC;AACEC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAGDC;AAAA;AAGP;AAGa;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { memo } from 'react';
3
4
  import { useTheme } from './useTheme.js';
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioLayout.js","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["NextStudioLayoutComponent","_ref","children","config","scheme","theme","useTheme","jsx","style","fontFamily","fonts","text","family","backgroundColor","color","default","base","bg","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","NextStudioLayout","memo"],"mappings":";;;AAWA,MAAMA,4BAA4BC,IAAA,IAIL;EAAA,IAJM;IACjCC,QAAA;IACAC,MAAA;IACAC,MAAS,GAAA;EACX,CAA6B,GAAAH,IAAA;EACrB,MAAAI,KAAA,GAAQC,SAASH,MAAM,CAAA;EAG3B,sBAAAI,GAAA,CAAC,KAAA,EAAA;IACC,SAAQ,EAAA,kBAAA;IACRC,KAAO,EAAA;MACLC,UAAA,EAAYJ,KAAM,CAAAK,KAAA,CAAMC,IAAK,CAAAC,MAAA;MAC7BC,eAAA,EAAiBR,MAAMS,KAAM,CAAAV,MAAA,KAAW,SAAS,MAAS,GAAA,OAAO,CAAE,CAAAW,OAAA,CAAQC,IAAK,CAAAC,EAAA;MAChFC,MAAQ,EAAA,OAAA;MACRC,SAAW,EAAA,QAAA;MACXC,kBAAoB,EAAA,MAAA;MACpBC,mBAAqB,EAAA,aAAA;MACrBC,QAAU,EAAA;IACZ,CAAA;IAECpB;EAAA,CAAA,CACH;AAEJ,CAAA;AAGa,MAAAqB,gBAAA,GAAmBC,KAAKxB,yBAAyB,CAAA;"}
1
+ {"version":3,"file":"NextStudioLayout.js","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["scheme","style","fontFamily","backgroundColor","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children"],"mappings":";;;;AAWA;;;;AAGEA;AACF;AACQ;AAGJ;AACE;AACAC;AACEC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAGDC;AAAA;AAGP;AAGa;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  'use client';
2
3
  'use strict';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioLoading.cjs","sources":["../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["'use client'\n\n/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Whether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {Config, SingleWorkspace, StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'scheme'> {\n /**\n * If your Studio Config has a custom theme you can pass it here to ensure the loading screen matches your theme.\n */\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = 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 display: 'block',\n animation: `${id} 500ms linear infinite`,\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled.muted\n .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 <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].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 // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled\n .muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["scheme","unstable__noScript","media","iconSize","wrapper","display","width","height","svg","margin","style","fontFamily","backgroundColor","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","gap","position","fontWeight","fontSize","lineHeight","transform"],"mappings":";;;;;;;;;;;AA8BA;AAcO;;;AACUA;AAAkBC;AAA6B;;AAExD;;;AACQC;AAAS;AAEvB;;;;;AACsDC;;AAC9C;;AAGJC;AACEC;;;AAKAC;AACAC;;AAEFC;AACEH;AACAC;AACAC;AACAE;AACF;;;;;AAQEC;AACEC;AACAC;AACAL;AACAM;AACAC;AACAC;AACAC;;AAGFC;AACE;AACAP;AACEL;AACAa;AACAC;AACAC;AACAC;AACAC;AACAf;AACAE;AACAc;AAAS;AAETC;;;AAGmBP;;AAEnB;AACAP;AACEe;AAAU;AAEVC;AAAY;AAEZH;AAAS;AAETI;AAAU;AAEVC;AAAY;AAEZC;;;AAMFZ;AAAMA;;;AAEH;;;;;;;AAGP;AAEJ;AAEJ;"}
1
+ {"version":3,"file":"NextStudioLoading.cjs","sources":["../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["'use client'\n\n/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Whether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {Config, SingleWorkspace, StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'scheme'> {\n /**\n * If your Studio Config has a custom theme you can pass it here to ensure the loading screen matches your theme.\n */\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = 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 display: 'block',\n animation: `${id} 500ms linear infinite`,\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled.muted\n .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 <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].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 // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled\n .muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["scheme","unstable__noScript","media","iconSize","wrapper","display","width","height","svg","margin","style","fontFamily","backgroundColor","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","gap","position","fontWeight","fontSize","lineHeight","transform"],"mappings":";;;;;;;;;;;;AA8BA;AAcO;;;AACUA;AAAkBC;AAA6B;;AAExD;;;AACQC;AAAS;AAEvB;;;;;AACsDC;;AAC9C;;AAGJC;AACEC;;;AAKAC;AACAC;;AAEFC;AACEH;AACAC;AACAC;AACAE;AACF;;;;;AAQEC;AACEC;AACAC;AACAL;AACAM;AACAC;AACAC;AACAC;;AAGFC;AACE;AACAP;AACEL;AACAa;AACAC;AACAC;AACAC;AACAC;AACAf;AACAE;AACAc;AAAS;AAETC;;;AAGmBP;;AAEnB;AACAP;AACEe;AAAU;AAEVC;AAAY;AAEZH;AAAS;AAETI;AAAU;AAEVC;AAAY;AAEZC;;;AAMFZ;AAAMA;;;AAEH;;;;;;;AAGP;AAEJ;AAEJ;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  'use client';
2
3
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
4
  import { SpinnerIcon } from '@sanity/icons';
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioLoading.js","sources":["../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["'use client'\n\n/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Whether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {Config, SingleWorkspace, StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'scheme'> {\n /**\n * If your Studio Config has a custom theme you can pass it here to ensure the loading screen matches your theme.\n */\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = 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 display: 'block',\n animation: `${id} 500ms linear infinite`,\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled.muted\n .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 <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].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 // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled\n .muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["scheme","unstable__noScript","media","iconSize","wrapper","display","width","svg","height","margin","children","style","fontFamily","backgroundColor","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","gap","position","fontWeight","fontSize","lineHeight","transform"],"mappings":";;;;;;AA8BA;AAcO;;;AACUA;AAAkBC;AAA6B;;AAExD;;;AACQC;AAAS;;;;;;AAG+BC;;AAC9C;;AAGJC;AACEC;;;AAKAC;;;AAGFC;AACEF;AACAC;AACAE;AACAC;AACF;;;AAIJ;AAEKC;AAECC;AACEC;AACAC;AACAL;AACAM;AACAC;AACAC;AACAC;;AAGFP;AACE;AACAC;AACEN;AACAa;AACAC;AACAC;AACAC;AACAC;AACAd;AACAC;AACAc;AAAS;AAETC;;AAGFd;AAAqBA;;AAEnB;AACAC;AACEc;AAAU;AAEVC;AAAY;AAEZH;AAAS;AAETI;AAAU;AAEVC;AAAY;AAEZC;;;AAMFnB;AAAMA;;AAAQ;AAEX;;AACHA;;;;;AAEJ;AAEJ;AAEJ;"}
1
+ {"version":3,"file":"NextStudioLoading.js","sources":["../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["'use client'\n\n/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Whether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {Config, SingleWorkspace, StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'scheme'> {\n /**\n * If your Studio Config has a custom theme you can pass it here to ensure the loading screen matches your theme.\n */\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\n/**\n * @alpha\n * @deprecated Will be removed in the next major release\n */\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = 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 display: 'block',\n animation: `${id} 500ms linear infinite`,\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled.muted\n .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 <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].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 // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color:\n theme.color[scheme === 'dark' ? 'dark' : 'light'].default.muted.default.enabled\n .muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["scheme","unstable__noScript","media","iconSize","wrapper","display","width","svg","height","margin","children","style","fontFamily","backgroundColor","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","gap","position","fontWeight","fontSize","lineHeight","transform"],"mappings":";;;;;;;AA8BA;AAcO;;;AACUA;AAAkBC;AAA6B;;AAExD;;;AACQC;AAAS;;;;;;AAG+BC;;AAC9C;;AAGJC;AACEC;;;AAKAC;;;AAGFC;AACEF;AACAC;AACAE;AACAC;AACF;;;AAIJ;AAEKC;AAECC;AACEC;AACAC;AACAL;AACAM;AACAC;AACAC;AACAC;;AAGFP;AACE;AACAC;AACEN;AACAa;AACAC;AACAC;AACAC;AACAC;AACAd;AACAC;AACAc;AAAS;AAETC;;AAGFd;AAAqBA;;AAEnB;AACAC;AACEc;AAAU;AAEVC;AAAY;AAEZH;AAAS;AAETI;AAAU;AAEVC;AAAY;AAEZC;;;AAMFnB;AAAMA;;AAAQ;AAEX;;AACHA;;;;;AAEJ;AAEJ;AAEJ;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioNoScript.cjs","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/* 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"],"names":["style","__html","NextStudioNoScript","jsx","children","className","jsxs","type","dangerouslySetInnerHTML","href"],"mappings":";;;;;;AAEA,MAAMA,KAAQ,GAAA;EACZC,MAAQ,EAAA;AAoBV,CAAA;AAGa,MAAAC,kBAAA,GAAqBA,CAAA,KAChCC,eAAAA,UAAAA,CAAAA,GAAA,CAAC,UACC,EAAA;EAAAC,QAAA,EAAA,eAAAD,UAAA,CAAAA,GAAA,CAAC,KAAI,EAAA;IAAAE,SAAA,EAAU,wBACb;IAAAD,QAAA,EAAA,eAAAE,eAAA,CAAC,KAAI,EAAA;MAAAD,SAAA,EAAU,2BACb;MAAAD,QAAA,EAAA,CAAA,eAAAD,UAAA,CAAAA,GAAA,CAAC,OAAM,EAAA;QAAAI,IAAA,EAAK,UAAW;QAAAC,uBAAA,EAAyBR;OAAO,CAAA,EACvDG,eAAAA,UAAAA,CAAAA,GAAA,CAAC;QAAGC,QAAmB,EAAA;MAAA,CAAA,CAAA,EAAA,+BACtB,GAAE,EAAA;QAAAA,QAAA,EAAA,CAAA,SAAA,EAAA,eACOD,UAAA,CAAAA,GAAA,CAAA,GAAA,EAAA;UAAEM,IAAK,EAAA,oCAAA;UAAqCL,QAAiB,EAAA;SAAA,CAAA,EAAI,kDAAA;OAE3E,CAAA;IACF,CAAA;EACF,CAAA;AACF,CAAA,CAAA;"}
1
+ {"version":3,"file":"NextStudioNoScript.cjs","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/* 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"],"names":["__html","children","className","type","dangerouslySetInnerHTML","href"],"mappings":";;;;;;;AAEA;AACEA;AAoBF;AAGa;AAETC;AAAKC;AACHD;AAAKC;;AACIC;AAAgBC;;AACnBH;;;AAEQI;AAA0CJ;;;;;AAK5D;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  const style = {
3
4
  __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"
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioNoScript.js","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/* 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"],"names":["style","__html","NextStudioNoScript","jsx","children","className","jsxs","type","dangerouslySetInnerHTML","href"],"mappings":";AAEA,MAAMA,KAAQ,GAAA;EACZC,MAAQ,EAAA;AAoBV,CAAA;AAGa,MAAAC,kBAAA,GAAqBA,CAAA,KAChC,eAAAC,GAAA,CAAC,UACC,EAAA;EAAAC,QAAA,EAAA,eAAAD,GAAA,CAAC,KAAI,EAAA;IAAAE,SAAA,EAAU,wBACb;IAAAD,QAAA,EAAA,eAAAE,IAAA,CAAC,KAAI,EAAA;MAAAD,SAAA,EAAU,2BACb;MAAAD,QAAA,EAAA,CAAA,eAAAD,GAAA,CAAC,OAAM,EAAA;QAAAI,IAAA,EAAK,UAAW;QAAAC,uBAAA,EAAyBR;OAAO,CAAA,EACvD,eAAAG,GAAA,CAAC;QAAGC,QAAmB,EAAA;MAAA,CAAA,CAAA,EAAA,oBACtB,GAAE,EAAA;QAAAA,QAAA,EAAA,CAAA,SAAA,EAAA,eACOD,GAAA,CAAA,GAAA,EAAA;UAAEM,IAAK,EAAA,oCAAA;UAAqCL,QAAiB,EAAA;SAAA,CAAA,EAAI,kDAAA;OAE3E,CAAA;IACF,CAAA;EACF,CAAA;AACF,CAAA,CAAA;"}
1
+ {"version":3,"file":"NextStudioNoScript.js","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/* 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"],"names":["__html","children","className","type","dangerouslySetInnerHTML","href"],"mappings":";;AAEA;AACEA;AAoBF;AAGa;AAETC;AAAKC;AACHD;AAAKC;AACHD;AAAOE;AAAgBC;;AACnBH;AAAmB;;AAEXI;AAA0CJ;;;;;AAK5D;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioHead.cjs","sources":["../../../src/studio/head/NextStudioHead.tsx"],"sourcesContent":["import _faviconPng from './apple-touch-icon.png'\nimport _faviconIco from './favicon.ico'\nimport _faviconSvg from './favicon.svg'\n\nconst faviconPng = typeof _faviconPng === 'string' ? _faviconPng : _faviconPng.default\nconst faviconIco = typeof _faviconIco === 'string' ? _faviconIco : _faviconIco.default\nconst faviconSvg = typeof _faviconSvg === 'string' ? _faviconSvg : _faviconSvg.default\n\n/** @public */\nexport interface NextStudioHeadProps {\n /**\n * @defaultValue 'utf-8'\n */\n charSet?: false | string\n /**\n * Sets the viewport to `viewport-fit=cover` to integrate with iOS devices with display cutouts (The Notch, Dynamic Island).\n * Also sets `width=device-width, initial-scale=1` to make the studio page responsive.\n * @defaultValue true\n */\n viewport?: boolean\n /**\n * It's common practice to hide the address to your Sanity Studio from search engines by setting `robots` to `noindex`\n * @defaultValue 'noindex'\n */\n robots?: false | string\n /**\n * @defaultValue 'same-origin'\n */\n referrer?: false | string\n /**\n * Adds the same favicons as the `npx sanity dev` pipeline.\n * @defaultValue true\n */\n favicons?: boolean\n /**\n * @defaultValue 'Sanity'\n */\n title?: false | string\n}\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/head.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the head component directly:\n * export {NextStudioHead as default} from 'next-sanity/studio/head'\n *\n * // To customize it, use it as a children component:\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function CustomStudioHead() {\n * return (\n * <>\n * <NextStudioHead favicons={false} />\n * <link\n * rel=\"icon\"\n * type=\"image/png\"\n * sizes=\"32x32\"\n * href=\"https://www.sanity.io/static/images/favicons/favicon-32x32.png\"\n * />\n * </>\n * )\n * }\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio} from 'next-sanity/studio'\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * <NextStudioHead />\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n * @deprecated Use `import {metadata} from 'next-sanity/studio'` instead, this component will be removed in the next major release.\n */\nexport function NextStudioHead(props: NextStudioHeadProps) {\n const {\n charSet = 'utf-8',\n viewport = true,\n robots = 'noindex',\n referrer = 'same-origin',\n favicons = true,\n title = 'Sanity',\n } = props\n\n return (\n <>\n {charSet && <meta key=\"charset\" charSet={charSet} />}\n {viewport && (\n <meta\n key=\"viewport\"\n name=\"viewport\"\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n content=\"width=device-width,initial-scale=1,viewport-fit=cover\"\n />\n )}\n {robots && <meta key=\"robots\" name=\"robots\" content={robots} />}\n {referrer && <meta key=\"referrer\" name=\"referrer\" content={referrer} />}\n {title && <title>{title}</title>}\n {favicons && <link key=\"favicon.ico\" rel=\"icon\" href={faviconIco} sizes=\"any\" />}\n {favicons && <link key=\"apple-touch-icon.png\" rel=\"apple-touch-icon\" href={faviconPng} />}\n {favicons && <link key=\"favicon.svg\" rel=\"icon\" href={faviconSvg} type=\"image/svg+xml\" />}\n </>\n )\n}\n"],"names":["faviconPng","_faviconPng","faviconIco","_faviconIco","faviconSvg","_faviconSvg","NextStudioHead","props","charSet","viewport","robots","referrer","favicons","title","jsxs","Fragment","children","jsx","name","content","rel","href","sizes","type"],"mappings":";;;;;;;;;AAIA,MAAMA,UAAa,GAAkCC;AACrD,MAAMC,UAAa,GAAkCC;AACrD,MAAMC,UAAa,GAAkCC;AA6E9C,SAASC,eAAeC,KAA4B,EAAA;EACnD,MAAA;IACJC,OAAU,GAAA,OAAA;IACVC,QAAW,GAAA,IAAA;IACXC,MAAS,GAAA,SAAA;IACTC,QAAW,GAAA,aAAA;IACXC,QAAW,GAAA,IAAA;IACXC,KAAQ,GAAA;EACN,CAAA,GAAAN,KAAA;EAEJ,sBAEKO,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;IAAAC,QAAA,EAAA,CAAWR,OAAA,IAAAS,eAAAA,UAAAA,CAAAA,GAAA,CAAC,MAAmB,EAAA;MAAAT;IAAA,CAAA,EAAV,SAA4B,CAAA,EACjDC,QACC,mBAAAQ,UAAA,CAAAA,GAAA,CAAC,MAAA,EAAA;MAECC,IAAK,EAAA,UAAA;MAELC,OAAQ,EAAA;IAAA,CAAA,EAHJ,UAIN,CAAA,EAEDT,UAAWO,eAAAA,UAAAA,CAAAA,GAAA,CAAA,MAAA,EAAA;MAAkBC,MAAK,QAAS;MAAAC,OAAA,EAAST;OAAhC,QAAwC,CAAA,EAC5DC,YAAaM,eAAAA,UAAAA,CAAAA,GAAA,CAAA,MAAA,EAAA;MAAoBC,MAAK,UAAW;MAAAC,OAAA,EAASR;OAApC,UAA8C,CAAA,EACpEE,KAAA,IAAUI,eAAAA,UAAAA,CAAAA,GAAA,CAAA,OAAA,EAAA;MAAOD,QAAM,EAAAH;IAAA,CAAA,CAAA,EACvBD,QAAA,kCAAa,MAAuB,EAAA;MAAAQ,GAAA,EAAI;MAAOC,IAAM,EAAAnB,UAAA;MAAYoB,KAAM,EAAA;IAAA,CAAA,EAAjD,aAAuD,CAAA,EAC7EV,YAAaK,eAAAA,UAAAA,CAAAA,GAAA,CAAA,MAAA,EAAA;MAAgCG,KAAI,kBAAmB;MAAAC,IAAA,EAAMrB;OAApD,sBAAgE,CAAA,EACtFY,QAAA,kCAAa,MAAuB,EAAA;MAAAQ,GAAA,EAAI;MAAOC,IAAM,EAAAjB,UAAA;MAAYmB,IAAK,EAAA;IAAA,CAAA,EAAhD,aAAgE,CAAA;EACzF,CAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"NextStudioHead.cjs","sources":["../../../src/studio/head/NextStudioHead.tsx"],"sourcesContent":["import _faviconPng from './apple-touch-icon.png'\nimport _faviconIco from './favicon.ico'\nimport _faviconSvg from './favicon.svg'\n\nconst faviconPng = typeof _faviconPng === 'string' ? _faviconPng : _faviconPng.default\nconst faviconIco = typeof _faviconIco === 'string' ? _faviconIco : _faviconIco.default\nconst faviconSvg = typeof _faviconSvg === 'string' ? _faviconSvg : _faviconSvg.default\n\n/** @public */\nexport interface NextStudioHeadProps {\n /**\n * @defaultValue 'utf-8'\n */\n charSet?: false | string\n /**\n * Sets the viewport to `viewport-fit=cover` to integrate with iOS devices with display cutouts (The Notch, Dynamic Island).\n * Also sets `width=device-width, initial-scale=1` to make the studio page responsive.\n * @defaultValue true\n */\n viewport?: boolean\n /**\n * It's common practice to hide the address to your Sanity Studio from search engines by setting `robots` to `noindex`\n * @defaultValue 'noindex'\n */\n robots?: false | string\n /**\n * @defaultValue 'same-origin'\n */\n referrer?: false | string\n /**\n * Adds the same favicons as the `npx sanity dev` pipeline.\n * @defaultValue true\n */\n favicons?: boolean\n /**\n * @defaultValue 'Sanity'\n */\n title?: false | string\n}\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/head.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the head component directly:\n * export {NextStudioHead as default} from 'next-sanity/studio/head'\n *\n * // To customize it, use it as a children component:\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function CustomStudioHead() {\n * return (\n * <>\n * <NextStudioHead favicons={false} />\n * <link\n * rel=\"icon\"\n * type=\"image/png\"\n * sizes=\"32x32\"\n * href=\"https://www.sanity.io/static/images/favicons/favicon-32x32.png\"\n * />\n * </>\n * )\n * }\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio} from 'next-sanity/studio'\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * <NextStudioHead />\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n * @deprecated Use `import {metadata} from 'next-sanity/studio'` instead, this component will be removed in the next major release.\n */\nexport function NextStudioHead(props: NextStudioHeadProps) {\n const {\n charSet = 'utf-8',\n viewport = true,\n robots = 'noindex',\n referrer = 'same-origin',\n favicons = true,\n title = 'Sanity',\n } = props\n\n return (\n <>\n {charSet && <meta key=\"charset\" charSet={charSet} />}\n {viewport && (\n <meta\n key=\"viewport\"\n name=\"viewport\"\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n content=\"width=device-width,initial-scale=1,viewport-fit=cover\"\n />\n )}\n {robots && <meta key=\"robots\" name=\"robots\" content={robots} />}\n {referrer && <meta key=\"referrer\" name=\"referrer\" content={referrer} />}\n {title && <title>{title}</title>}\n {favicons && <link key=\"favicon.ico\" rel=\"icon\" href={faviconIco} sizes=\"any\" />}\n {favicons && <link key=\"apple-touch-icon.png\" rel=\"apple-touch-icon\" href={faviconPng} />}\n {favicons && <link key=\"favicon.svg\" rel=\"icon\" href={faviconSvg} type=\"image/svg+xml\" />}\n </>\n )\n}\n"],"names":["charSet","viewport","robots","referrer","favicons","title","name","content","children","rel","href","sizes","type"],"mappings":";;;;;;;;;;AAIA;AACA;AACA;AA6EO;;AAEHA;AACAC;AACAC;AACAC;AACAC;AACAC;AACE;;;AAIgCL;AAAA;AAI5BM;AAEAC;AAAQ;AAGkBD;AAAcC;;AACVD;AAAgBC;;AAChCC;;AACmBC;AAAWC;AAAkBC;AAAM;AAC1BF;AAAuBC;;AAChCD;AAAWC;AAAkBE;;AACpE;AAEJ;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import _faviconPng from './apple-touch-icon.png.js';
3
4
  import _faviconIco from './favicon.ico.js';
@@ -1 +1 @@
1
- {"version":3,"file":"NextStudioHead.js","sources":["../../../src/studio/head/NextStudioHead.tsx"],"sourcesContent":["import _faviconPng from './apple-touch-icon.png'\nimport _faviconIco from './favicon.ico'\nimport _faviconSvg from './favicon.svg'\n\nconst faviconPng = typeof _faviconPng === 'string' ? _faviconPng : _faviconPng.default\nconst faviconIco = typeof _faviconIco === 'string' ? _faviconIco : _faviconIco.default\nconst faviconSvg = typeof _faviconSvg === 'string' ? _faviconSvg : _faviconSvg.default\n\n/** @public */\nexport interface NextStudioHeadProps {\n /**\n * @defaultValue 'utf-8'\n */\n charSet?: false | string\n /**\n * Sets the viewport to `viewport-fit=cover` to integrate with iOS devices with display cutouts (The Notch, Dynamic Island).\n * Also sets `width=device-width, initial-scale=1` to make the studio page responsive.\n * @defaultValue true\n */\n viewport?: boolean\n /**\n * It's common practice to hide the address to your Sanity Studio from search engines by setting `robots` to `noindex`\n * @defaultValue 'noindex'\n */\n robots?: false | string\n /**\n * @defaultValue 'same-origin'\n */\n referrer?: false | string\n /**\n * Adds the same favicons as the `npx sanity dev` pipeline.\n * @defaultValue true\n */\n favicons?: boolean\n /**\n * @defaultValue 'Sanity'\n */\n title?: false | string\n}\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/head.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the head component directly:\n * export {NextStudioHead as default} from 'next-sanity/studio/head'\n *\n * // To customize it, use it as a children component:\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function CustomStudioHead() {\n * return (\n * <>\n * <NextStudioHead favicons={false} />\n * <link\n * rel=\"icon\"\n * type=\"image/png\"\n * sizes=\"32x32\"\n * href=\"https://www.sanity.io/static/images/favicons/favicon-32x32.png\"\n * />\n * </>\n * )\n * }\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio} from 'next-sanity/studio'\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * <NextStudioHead />\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n * @deprecated Use `import {metadata} from 'next-sanity/studio'` instead, this component will be removed in the next major release.\n */\nexport function NextStudioHead(props: NextStudioHeadProps) {\n const {\n charSet = 'utf-8',\n viewport = true,\n robots = 'noindex',\n referrer = 'same-origin',\n favicons = true,\n title = 'Sanity',\n } = props\n\n return (\n <>\n {charSet && <meta key=\"charset\" charSet={charSet} />}\n {viewport && (\n <meta\n key=\"viewport\"\n name=\"viewport\"\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n content=\"width=device-width,initial-scale=1,viewport-fit=cover\"\n />\n )}\n {robots && <meta key=\"robots\" name=\"robots\" content={robots} />}\n {referrer && <meta key=\"referrer\" name=\"referrer\" content={referrer} />}\n {title && <title>{title}</title>}\n {favicons && <link key=\"favicon.ico\" rel=\"icon\" href={faviconIco} sizes=\"any\" />}\n {favicons && <link key=\"apple-touch-icon.png\" rel=\"apple-touch-icon\" href={faviconPng} />}\n {favicons && <link key=\"favicon.svg\" rel=\"icon\" href={faviconSvg} type=\"image/svg+xml\" />}\n </>\n )\n}\n"],"names":["faviconPng","_faviconPng","faviconIco","_faviconIco","faviconSvg","_faviconSvg","NextStudioHead","props","charSet","viewport","robots","referrer","favicons","title","jsxs","Fragment","children","jsx","name","content","rel","href","sizes","type"],"mappings":";;;;AAIA,MAAMA,UAAa,GAAkCC;AACrD,MAAMC,UAAa,GAAkCC;AACrD,MAAMC,UAAa,GAAkCC;AA6E9C,SAASC,eAAeC,KAA4B,EAAA;EACnD,MAAA;IACJC,OAAU,GAAA,OAAA;IACVC,QAAW,GAAA,IAAA;IACXC,MAAS,GAAA,SAAA;IACTC,QAAW,GAAA,aAAA;IACXC,QAAW,GAAA,IAAA;IACXC,KAAQ,GAAA;EACN,CAAA,GAAAN,KAAA;EAEJ,sBAEKO,IAAA,CAAAC,QAAA,EAAA;IAAAC,QAAA,EAAA,CAAWR,OAAA,IAAA,eAAAS,GAAA,CAAC,MAAmB,EAAA;MAAAT;IAAA,CAAA,EAAV,SAA4B,CAAA,EACjDC,QACC,mBAAAQ,GAAA,CAAC,MAAA,EAAA;MAECC,IAAK,EAAA,UAAA;MAELC,OAAQ,EAAA;IAAA,CAAA,EAHJ,UAIN,CAAA,EAEDT,UAAW,eAAAO,GAAA,CAAA,MAAA,EAAA;MAAkBC,MAAK,QAAS;MAAAC,OAAA,EAAST;OAAhC,QAAwC,CAAA,EAC5DC,YAAa,eAAAM,GAAA,CAAA,MAAA,EAAA;MAAoBC,MAAK,UAAW;MAAAC,OAAA,EAASR;OAApC,UAA8C,CAAA,EACpEE,KAAA,IAAU,eAAAI,GAAA,CAAA,OAAA,EAAA;MAAOD,QAAM,EAAAH;IAAA,CAAA,CAAA,EACvBD,QAAA,uBAAa,MAAuB,EAAA;MAAAQ,GAAA,EAAI;MAAOC,IAAM,EAAAnB,UAAA;MAAYoB,KAAM,EAAA;IAAA,CAAA,EAAjD,aAAuD,CAAA,EAC7EV,YAAa,eAAAK,GAAA,CAAA,MAAA,EAAA;MAAgCG,KAAI,kBAAmB;MAAAC,IAAA,EAAMrB;OAApD,sBAAgE,CAAA,EACtFY,QAAA,uBAAa,MAAuB,EAAA;MAAAQ,GAAA,EAAI;MAAOC,IAAM,EAAAjB,UAAA;MAAYmB,IAAK,EAAA;IAAA,CAAA,EAAhD,aAAgE,CAAA;EACzF,CAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"NextStudioHead.js","sources":["../../../src/studio/head/NextStudioHead.tsx"],"sourcesContent":["import _faviconPng from './apple-touch-icon.png'\nimport _faviconIco from './favicon.ico'\nimport _faviconSvg from './favicon.svg'\n\nconst faviconPng = typeof _faviconPng === 'string' ? _faviconPng : _faviconPng.default\nconst faviconIco = typeof _faviconIco === 'string' ? _faviconIco : _faviconIco.default\nconst faviconSvg = typeof _faviconSvg === 'string' ? _faviconSvg : _faviconSvg.default\n\n/** @public */\nexport interface NextStudioHeadProps {\n /**\n * @defaultValue 'utf-8'\n */\n charSet?: false | string\n /**\n * Sets the viewport to `viewport-fit=cover` to integrate with iOS devices with display cutouts (The Notch, Dynamic Island).\n * Also sets `width=device-width, initial-scale=1` to make the studio page responsive.\n * @defaultValue true\n */\n viewport?: boolean\n /**\n * It's common practice to hide the address to your Sanity Studio from search engines by setting `robots` to `noindex`\n * @defaultValue 'noindex'\n */\n robots?: false | string\n /**\n * @defaultValue 'same-origin'\n */\n referrer?: false | string\n /**\n * Adds the same favicons as the `npx sanity dev` pipeline.\n * @defaultValue true\n */\n favicons?: boolean\n /**\n * @defaultValue 'Sanity'\n */\n title?: false | string\n}\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/head.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the head component directly:\n * export {NextStudioHead as default} from 'next-sanity/studio/head'\n *\n * // To customize it, use it as a children component:\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function CustomStudioHead() {\n * return (\n * <>\n * <NextStudioHead favicons={false} />\n * <link\n * rel=\"icon\"\n * type=\"image/png\"\n * sizes=\"32x32\"\n * href=\"https://www.sanity.io/static/images/favicons/favicon-32x32.png\"\n * />\n * </>\n * )\n * }\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio} from 'next-sanity/studio'\n * import {NextStudioHead} from 'next-sanity/studio/head'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * <NextStudioHead />\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n * @deprecated Use `import {metadata} from 'next-sanity/studio'` instead, this component will be removed in the next major release.\n */\nexport function NextStudioHead(props: NextStudioHeadProps) {\n const {\n charSet = 'utf-8',\n viewport = true,\n robots = 'noindex',\n referrer = 'same-origin',\n favicons = true,\n title = 'Sanity',\n } = props\n\n return (\n <>\n {charSet && <meta key=\"charset\" charSet={charSet} />}\n {viewport && (\n <meta\n key=\"viewport\"\n name=\"viewport\"\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n content=\"width=device-width,initial-scale=1,viewport-fit=cover\"\n />\n )}\n {robots && <meta key=\"robots\" name=\"robots\" content={robots} />}\n {referrer && <meta key=\"referrer\" name=\"referrer\" content={referrer} />}\n {title && <title>{title}</title>}\n {favicons && <link key=\"favicon.ico\" rel=\"icon\" href={faviconIco} sizes=\"any\" />}\n {favicons && <link key=\"apple-touch-icon.png\" rel=\"apple-touch-icon\" href={faviconPng} />}\n {favicons && <link key=\"favicon.svg\" rel=\"icon\" href={faviconSvg} type=\"image/svg+xml\" />}\n </>\n )\n}\n"],"names":["charSet","viewport","robots","referrer","favicons","title","name","content","children","rel","href","sizes","type"],"mappings":";;;;;AAIA;AACA;AACA;AA6EO;;AAEHA;AACAC;AACAC;AACAC;AACAC;AACAC;AACE;AAEJ;;AAEoCL;;AAI5BM;AAEAC;;AAG0BD;AAAcC;;AACVD;AAAgBC;;AAChCC;;AACmBC;AAAWC;AAAkBC;;AACpBF;AAAuBC;;AAChCD;AAAWC;AAAkBE;;AACpE;AAEJ;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"head.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"head.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,2 +1,3 @@
1
+ 'use strict';
1
2
  export { NextStudioHead } from './head/NextStudioHead.js';
2
3
  //# sourceMappingURL=head.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"head.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"head.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  export { NextStudio } from './NextStudio.js';
2
3
  export { NextStudioClientOnly } from './NextStudioClientOnly.js';
3
4
  export { NextStudioLayout } from './NextStudioLayout.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"loading.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"loading.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,2 +1,3 @@
1
+ 'use strict';
1
2
  export { NextStudioLoading } from './NextStudioLoading.js';
2
3
  //# sourceMappingURL=loading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"loading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.cjs","sources":["../../src/studio/metadata.ts"],"sourcesContent":["import type {Metadata} from 'next'\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the metadata directly:\n * export {metadata} from 'next-sanity/studio'\n *\n * // To customize the metadata, spread it on the export:\n * import {metadata as studioMetadata} from 'next-sanity/studio'\n * import type { Metadata } from 'next'\n *\n * export const metadata: Metadata = {\n * ...studioMetadata,\n * // Overrides the viewport to resize behavior\n * viewport: `${studioMetadata.viewport}, interactive-widget=resizes-content`,\n * })\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio, metadata} from 'next-sanity/studio'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * {Object.entries(metadata).map(([key, value]) => (\n * <meta key={key} name={key} content={value} />\n * ))}\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n */\nexport const metadata = {\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewport: 'width=device-width,initial-scale=1,viewport-fit=cover' as const,\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n"],"names":["metadata","viewport","referrer","robots"],"mappings":";;;;;AAsCO,MAAMA,QAAW,GAAA;EAAA;EAEtBC,QAAU,EAAA,uDAAA;EACVC,QAAU,EAAA,aAAA;EACVC,MAAQ,EAAA;AACV,CAAA;"}
1
+ {"version":3,"file":"metadata.cjs","sources":["../../src/studio/metadata.ts"],"sourcesContent":["import type {Metadata} from 'next'\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the metadata directly:\n * export {metadata} from 'next-sanity/studio'\n *\n * // To customize the metadata, spread it on the export:\n * import {metadata as studioMetadata} from 'next-sanity/studio'\n * import type { Metadata } from 'next'\n *\n * export const metadata: Metadata = {\n * ...studioMetadata,\n * // Overrides the viewport to resize behavior\n * viewport: `${studioMetadata.viewport}, interactive-widget=resizes-content`,\n * })\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio, metadata} from 'next-sanity/studio'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * {Object.entries(metadata).map(([key, value]) => (\n * <meta key={key} name={key} content={value} />\n * ))}\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n */\nexport const metadata = {\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewport: 'width=device-width,initial-scale=1,viewport-fit=cover' as const,\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n"],"names":["viewport","referrer","robots"],"mappings":";;;;;;AAsCO;AAAiB;AAEtBA;AACAC;AACAC;AACF;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  const metadata = {
2
3
  // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly
3
4
  viewport: "width=device-width,initial-scale=1,viewport-fit=cover",
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sources":["../../src/studio/metadata.ts"],"sourcesContent":["import type {Metadata} from 'next'\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the metadata directly:\n * export {metadata} from 'next-sanity/studio'\n *\n * // To customize the metadata, spread it on the export:\n * import {metadata as studioMetadata} from 'next-sanity/studio'\n * import type { Metadata } from 'next'\n *\n * export const metadata: Metadata = {\n * ...studioMetadata,\n * // Overrides the viewport to resize behavior\n * viewport: `${studioMetadata.viewport}, interactive-widget=resizes-content`,\n * })\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio, metadata} from 'next-sanity/studio'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * {Object.entries(metadata).map(([key, value]) => (\n * <meta key={key} name={key} content={value} />\n * ))}\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n */\nexport const metadata = {\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewport: 'width=device-width,initial-scale=1,viewport-fit=cover' as const,\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n"],"names":["metadata","viewport","referrer","robots"],"mappings":"AAsCO,MAAMA,QAAW,GAAA;EAAA;EAEtBC,QAAU,EAAA,uDAAA;EACVC,QAAU,EAAA,aAAA;EACVC,MAAQ,EAAA;AACV,CAAA;"}
1
+ {"version":3,"file":"metadata.js","sources":["../../src/studio/metadata.ts"],"sourcesContent":["import type {Metadata} from 'next'\n\n/**\n * In Next 13 appDir mode (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the metadata directly:\n * export {metadata} from 'next-sanity/studio'\n *\n * // To customize the metadata, spread it on the export:\n * import {metadata as studioMetadata} from 'next-sanity/studio'\n * import type { Metadata } from 'next'\n *\n * export const metadata: Metadata = {\n * ...studioMetadata,\n * // Overrides the viewport to resize behavior\n * viewport: `${studioMetadata.viewport}, interactive-widget=resizes-content`,\n * })\n * ```\n * If you're using Next 12 or the `pages` folder (`/pages/studio/[[...index]].tsx`):\n * ```tsx\n * import Head from 'next/head'\n * import {NextStudio, metadata} from 'next-sanity/studio'\n *\n * export default function StudioPage() {\n * return (\n * <>\n * <Head>\n * {Object.entries(metadata).map(([key, value]) => (\n * <meta key={key} name={key} content={value} />\n * ))}\n * </Head>\n * <NextStudio config={config} />\n * </>\n * )\n * }\n * ```\n * @public\n */\nexport const metadata = {\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewport: 'width=device-width,initial-scale=1,viewport-fit=cover' as const,\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n"],"names":["viewport","referrer","robots"],"mappings":";AAsCO;AAAiB;AAEtBA;AACAC;AACAC;AACF;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefersColorScheme.cjs","sources":["../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["/* 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":["createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;AAIA,SAASA,WAAcA,CAAA,EAAA;EACjB,IAAA,OAAOC,aAAa,WAAa,EAAA;IAC5B,OAAA;MACLC,SAAA,EAAWA,CAAA,KAAM,MAAM,CAAC,CAAA;MACxBC,aAAaA,CAAA,KAAM,OAAA;MACnBC,mBAAmBA,CAAA,KAAM;IAAA,CAC3B;EACF;EAEM,MAAAC,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,EAAAA,CAAA,KAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmBA,CAAA,KAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,CAAA,CAAA;AAGnB,SAASY,qBAA6CA,CAAA,EAAA;EAC3D,OAAOC,KAAAA,CAAAA,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;"}
1
+ {"version":3,"file":"usePrefersColorScheme.cjs","sources":["../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["/* 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":["subscribe","matchMedia"],"mappings":";;;;;;;AAIA;AACM;;AAEAA;;;;AAIJ;AAEM;;;AAISC;;;;;;AAMjB;AACA;AAGO;AACL;AACF;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { useSyncExternalStore } from 'react';
2
3
  function createStore() {
3
4
  if (typeof document === "undefined") {
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefersColorScheme.js","sources":["../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["/* 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":["createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";AAIA,SAASA,WAAcA,CAAA,EAAA;EACjB,IAAA,OAAOC,aAAa,WAAa,EAAA;IAC5B,OAAA;MACLC,SAAA,EAAWA,CAAA,KAAM,MAAM,CAAC,CAAA;MACxBC,aAAaA,CAAA,KAAM,OAAA;MACnBC,mBAAmBA,CAAA,KAAM;IAAA,CAC3B;EACF;EAEM,MAAAC,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,EAAAA,CAAA,KAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmBA,CAAA,KAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,CAAA,CAAA;AAGnB,SAASY,qBAA6CA,CAAA,EAAA;EAC3D,OAAOC,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;"}
1
+ {"version":3,"file":"usePrefersColorScheme.js","sources":["../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["/* 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":["subscribe","matchMedia"],"mappings":";;AAIA;AACM;;AAEAA;;;;AAIJ;AAEM;;;AAISC;;;;;;AAMjB;AACA;AAGO;AACL;AACF;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.cjs","sources":["../../src/studio/useTheme.ts"],"sourcesContent":["import {studioTheme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport type {Config, SingleWorkspace, StudioTheme} from 'sanity'\n\n/** @alpha */\nexport function useTheme(\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>,\n): StudioTheme {\n const workspace = useMemo<\n SingleWorkspace | Required<Pick<SingleWorkspace, 'theme'>> | undefined\n >(() => (Array.isArray(config) ? config[0] : config), [config])\n return useMemo<StudioTheme>(() => workspace?.theme || studioTheme, [workspace])\n}\n"],"names":["useTheme","config","workspace","useMemo","Array","isArray","theme","studioTheme"],"mappings":";;;;;;;AAKO,SAASA,SACdC,MACa,EAAA;EACb,MAAMC,SAAY,GAAAC,KAAA,CAAAA,OAAA,CAEhB,MAAOC,KAAA,CAAMC,OAAQ,CAAAJ,MAAM,CAAI,GAAAA,MAAA,CAAO,CAAC,CAAA,GAAIA,MAAS,EAAA,CAACA,MAAM,CAAC,CAAA;EAC9D,OAAOE,cAAqB,MAAM,CAAAD,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,SAAA,CAAWI,UAASC,EAAAA,CAAAA,WAAa,EAAA,CAACL,SAAS,CAAC,CAAA;AAChF;"}
1
+ {"version":3,"file":"useTheme.cjs","sources":["../../src/studio/useTheme.ts"],"sourcesContent":["import {studioTheme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport type {Config, SingleWorkspace, StudioTheme} from 'sanity'\n\n/** @alpha */\nexport function useTheme(\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>,\n): StudioTheme {\n const workspace = useMemo<\n SingleWorkspace | Required<Pick<SingleWorkspace, 'theme'>> | undefined\n >(() => (Array.isArray(config) ? config[0] : config), [config])\n return useMemo<StudioTheme>(() => workspace?.theme || studioTheme, [workspace])\n}\n"],"names":[],"mappings":";;;;;;;;AAKO;;;AAOP;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { studioTheme } from '@sanity/ui';
2
3
  import { useMemo } from 'react';
3
4
  function useTheme(config) {
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.js","sources":["../../src/studio/useTheme.ts"],"sourcesContent":["import {studioTheme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport type {Config, SingleWorkspace, StudioTheme} from 'sanity'\n\n/** @alpha */\nexport function useTheme(\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>,\n): StudioTheme {\n const workspace = useMemo<\n SingleWorkspace | Required<Pick<SingleWorkspace, 'theme'>> | undefined\n >(() => (Array.isArray(config) ? config[0] : config), [config])\n return useMemo<StudioTheme>(() => workspace?.theme || studioTheme, [workspace])\n}\n"],"names":["useTheme","config","workspace","useMemo","Array","isArray","theme","studioTheme"],"mappings":";;AAKO,SAASA,SACdC,MACa,EAAA;EACb,MAAMC,SAAY,GAAAC,OAAA,CAEhB,MAAOC,KAAA,CAAMC,OAAQ,CAAAJ,MAAM,CAAI,GAAAA,MAAA,CAAO,CAAC,CAAA,GAAIA,MAAS,EAAA,CAACA,MAAM,CAAC,CAAA;EAC9D,OAAOE,QAAqB,MAAM,CAAAD,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,SAAA,CAAWI,UAASC,WAAa,EAAA,CAACL,SAAS,CAAC,CAAA;AAChF;"}
1
+ {"version":3,"file":"useTheme.js","sources":["../../src/studio/useTheme.ts"],"sourcesContent":["import {studioTheme} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport type {Config, SingleWorkspace, StudioTheme} from 'sanity'\n\n/** @alpha */\nexport function useTheme(\n config?: Config | Required<Pick<SingleWorkspace, 'theme'>>,\n): StudioTheme {\n const workspace = useMemo<\n SingleWorkspace | Required<Pick<SingleWorkspace, 'theme'>> | undefined\n >(() => (Array.isArray(config) ? config[0] : config), [config])\n return useMemo<StudioTheme>(() => workspace?.theme || studioTheme, [workspace])\n}\n"],"names":[],"mappings":";;;AAKO;;;AAOP;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","sources":["../../src/webhook/config.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"],"names":["config","api","bodyParser","runtime"],"mappings":";;;;;AAMO,MAAMA,MAAqB,GAAA;EAChCC,GAAK,EAAA;IAAA;AAAA;AAAA;IAIHC,UAAY,EAAA;EACd,CAAA;EAAA;AAAA;AAAA;EAIAC,OAAS,EAAA;AACX,CAAA;"}
1
+ {"version":3,"file":"config.cjs","sources":["../../src/webhook/config.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"],"names":["api","bodyParser","runtime"],"mappings":";;;;;;AAMO;AACLA;AAAK;AAAA;AAAA;AAIHC;;AACF;AAAA;AAAA;AAIAC;AACF;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  const config = {
2
3
  api: {
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/webhook/config.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"],"names":["config","api","bodyParser","runtime"],"mappings":"AAMO,MAAMA,MAAqB,GAAA;EAChCC,GAAK,EAAA;IAAA;AAAA;AAAA;IAIHC,UAAY,EAAA;EACd,CAAA;EAAA;AAAA;AAAA;EAIAC,OAAS,EAAA;AACX,CAAA;"}
1
+ {"version":3,"file":"config.js","sources":["../../src/webhook/config.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"],"names":["api","bodyParser","runtime"],"mappings":";AAMO;AACLA;AAAK;AAAA;AAAA;AAIHC;;AACF;AAAA;AAAA;AAIAC;AACF;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"parseBody.cjs","sources":["../../src/webhook/parseBody.ts"],"sourcesContent":["import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\nimport type {NextRequest} from 'next/server'\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParsedBody<T> = {\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: T | null\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseBody<Body = SanityDocument> = ParsedBody<Body>\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<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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 */\n// eslint-disable-next-line require-await\nexport async function parseBody<Body = SanityDocument>(\n req: NextApiRequest | NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n // @ts-expect-error -- add global typings for EdgeRuntime\n if (typeof EdgeRuntime !== 'undefined') {\n throw new TypeError(\n `The edge runtime isn't supported. You'll have to use the 'nodejs' runtime until the underlying \\`@sanity/webhook\\` package is updated to support it.`,\n )\n }\n return 'text' in req\n ? parseAppBody(req, secret, waitForContentLakeEventualConsistency)\n : parsePageBody(req, secret, waitForContentLakeEventualConsistency)\n}\n\nasync function parsePageBody<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n if (req.readableEnded) {\n throw new Error(\n `Request already ended and the POST body can't be read. Have you setup \\`export {config} from 'next-sanity/webhook' in your webhook API handler?\\``,\n )\n }\n\n const body = await readBody(req)\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseAppBody<Body = SanityDocument> = ParsedBody<Body>\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 * @deprecated Use `parseBody` instead\n * @public\n */\nexport async function parseAppBody<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n const signature = req.headers.get(SIGNATURE_HEADER_NAME)!\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n const body = await req.text()\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":["parseBody","req","secret","waitForContentLakeEventualConsistency","arguments","length","undefined","EdgeRuntime","TypeError","parseAppBody","parsePageBody","signature","headers","SIGNATURE_HEADER_NAME","Array","isArray","console","error","body","isValidSignature","readableEnded","Error","readBody","validSignature","trim","Promise","resolve","setTimeout","JSON","parse","get","text"],"mappings":";;;;;;;AA+CA,eAAsBA,SACpBA,CAAAC,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EAEvB,IAAA,OAAOG,gBAAgB,WAAa,EAAA;IACtC,MAAM,IAAIC,SAAA,CACR,oJAAA,CACF;EACF;EACO,OAAA,MAAA,IAAUP,GACb,GAAAQ,YAAA,CAAaR,GAAK,EAAAC,MAAA,EAAQC,qCAAqC,CAC/D,GAAAO,aAAA,CAAcT,GAAK,EAAAC,MAAA,EAAQC,qCAAqC,CAAA;AACtE;AAEA,eAAeO,aACbA,CAAAT,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EACvB,IAAAO,SAAA,GAAYV,GAAI,CAAAW,OAAA,CAAQC,OAAqB,CAAAA,qBAAA,CAAA;EAC7C,IAAAC,KAAA,CAAMC,OAAQ,CAAAJ,SAAS,CAAG,EAAA;IAC5BA,SAAA,GAAYA,UAAU,CAAC,CAAA;EACzB;EACA,IAAI,CAACA,SAAW,EAAA;IACdK,OAAA,CAAQC,MAAM,0BAA0B,CAAA;IACxC,OAAO;MAACC,IAAA,EAAM,IAAM;MAAAC,gBAAA,EAAkB;IAAI,CAAA;EAC5C;EAEA,IAAIlB,IAAImB,aAAe,EAAA;IACrB,MAAM,IAAIC,KAAA,CACR,iJAAA,CACF;EACF;EAEM,MAAAH,IAAA,GAAO,MAAMI,kBAAA,CAASrB,GAAG,CAAA;EACzB,MAAAsB,cAAA,GAAiBrB,SAASiB,OAAAA,CAAAA,gBAAiB,CAAAD,IAAA,EAAMP,WAAWT,MAAO,CAAAsB,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASpB,qCAAuC,EAAA;IACrE,MAAM,IAAIsB,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLR,MAAMA,IAAK,CAAAM,IAAA,KAASI,IAAK,CAAAC,KAAA,CAAMX,IAAI,CAAI,GAAA,IAAA;IACvCC,gBAAkB,EAAAI;EAAA,CACpB;AACF;AAaA,eAAsBd,YACpBA,CAAAR,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EAC3B,MAAMO,SAAY,GAAAV,GAAA,CAAIW,OAAQ,CAAAkB,GAAA,CAAIjB,OAAqB,CAAAA,qBAAA,CAAA;EACvD,IAAI,CAACF,SAAW,EAAA;IACdK,OAAA,CAAQC,MAAM,0BAA0B,CAAA;IACxC,OAAO;MAACC,IAAA,EAAM,IAAM;MAAAC,gBAAA,EAAkB;IAAI,CAAA;EAC5C;EAEM,MAAAD,IAAA,GAAO,MAAMjB,GAAA,CAAI8B,IAAK,EAAA;EACtB,MAAAR,cAAA,GAAiBrB,SAASiB,OAAAA,CAAAA,gBAAiB,CAAAD,IAAA,EAAMP,WAAWT,MAAO,CAAAsB,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASpB,qCAAuC,EAAA;IACrE,MAAM,IAAIsB,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLR,MAAMA,IAAK,CAAAM,IAAA,KAASI,IAAK,CAAAC,KAAA,CAAMX,IAAI,CAAI,GAAA,IAAA;IACvCC,gBAAkB,EAAAI;EAAA,CACpB;AACF;;"}
1
+ {"version":3,"file":"parseBody.cjs","sources":["../../src/webhook/parseBody.ts"],"sourcesContent":["import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\nimport type {NextRequest} from 'next/server'\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParsedBody<T> = {\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: T | null\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseBody<Body = SanityDocument> = ParsedBody<Body>\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<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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 */\n// eslint-disable-next-line require-await\nexport async function parseBody<Body = SanityDocument>(\n req: NextApiRequest | NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n // @ts-expect-error -- add global typings for EdgeRuntime\n if (typeof EdgeRuntime !== 'undefined') {\n throw new TypeError(\n `The edge runtime isn't supported. You'll have to use the 'nodejs' runtime until the underlying \\`@sanity/webhook\\` package is updated to support it.`,\n )\n }\n return 'text' in req\n ? parseAppBody(req, secret, waitForContentLakeEventualConsistency)\n : parsePageBody(req, secret, waitForContentLakeEventualConsistency)\n}\n\nasync function parsePageBody<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n if (req.readableEnded) {\n throw new Error(\n `Request already ended and the POST body can't be read. Have you setup \\`export {config} from 'next-sanity/webhook' in your webhook API handler?\\``,\n )\n }\n\n const body = await readBody(req)\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseAppBody<Body = SanityDocument> = ParsedBody<Body>\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 * @deprecated Use `parseBody` instead\n * @public\n */\nexport async function parseAppBody<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n const signature = req.headers.get(SIGNATURE_HEADER_NAME)!\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n const body = await req.text()\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":["signature","console","body","isValidSignature"],"mappings":";;;;;;;;AA+CA;AAI6B;AAEvB;AACF;AAGF;;AAIF;AAEA;AAI6B;;AAEvB;AACFA;AACF;;AAEEC;;AACQC;AAAYC;;AACtB;;AAGE;AAGF;;AAGM;AAEF;;AAEJ;;AAGED;AACAC;;AAEJ;AAaA;AAI6B;;;AAGzBF;;AACQC;AAAYC;;AACtB;AAEM;AACA;AAEF;;AAEJ;;AAGED;AACAC;;AAEJ;;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook';
2
3
  import { _readBody } from './readBody.js';
3
4
  async function parseBody(req, secret) {
@@ -1 +1 @@
1
- {"version":3,"file":"parseBody.js","sources":["../../src/webhook/parseBody.ts"],"sourcesContent":["import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\nimport type {NextRequest} from 'next/server'\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParsedBody<T> = {\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: T | null\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseBody<Body = SanityDocument> = ParsedBody<Body>\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<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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 */\n// eslint-disable-next-line require-await\nexport async function parseBody<Body = SanityDocument>(\n req: NextApiRequest | NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n // @ts-expect-error -- add global typings for EdgeRuntime\n if (typeof EdgeRuntime !== 'undefined') {\n throw new TypeError(\n `The edge runtime isn't supported. You'll have to use the 'nodejs' runtime until the underlying \\`@sanity/webhook\\` package is updated to support it.`,\n )\n }\n return 'text' in req\n ? parseAppBody(req, secret, waitForContentLakeEventualConsistency)\n : parsePageBody(req, secret, waitForContentLakeEventualConsistency)\n}\n\nasync function parsePageBody<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n if (req.readableEnded) {\n throw new Error(\n `Request already ended and the POST body can't be read. Have you setup \\`export {config} from 'next-sanity/webhook' in your webhook API handler?\\``,\n )\n }\n\n const body = await readBody(req)\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseAppBody<Body = SanityDocument> = ParsedBody<Body>\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 * @deprecated Use `parseBody` instead\n * @public\n */\nexport async function parseAppBody<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n const signature = req.headers.get(SIGNATURE_HEADER_NAME)!\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n const body = await req.text()\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":["parseBody","req","secret","waitForContentLakeEventualConsistency","arguments","length","undefined","EdgeRuntime","TypeError","parseAppBody","parsePageBody","signature","headers","SIGNATURE_HEADER_NAME","Array","isArray","console","error","body","isValidSignature","readableEnded","Error","readBody","validSignature","trim","Promise","resolve","setTimeout","JSON","parse","get","text"],"mappings":";;AA+CA,eAAsBA,SACpBA,CAAAC,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EAEvB,IAAA,OAAOG,gBAAgB,WAAa,EAAA;IACtC,MAAM,IAAIC,SAAA,CACR,oJAAA,CACF;EACF;EACO,OAAA,MAAA,IAAUP,GACb,GAAAQ,YAAA,CAAaR,GAAK,EAAAC,MAAA,EAAQC,qCAAqC,CAC/D,GAAAO,aAAA,CAAcT,GAAK,EAAAC,MAAA,EAAQC,qCAAqC,CAAA;AACtE;AAEA,eAAeO,aACbA,CAAAT,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EACvB,IAAAO,SAAA,GAAYV,GAAI,CAAAW,OAAA,CAAQC,qBAAqB,CAAA;EAC7C,IAAAC,KAAA,CAAMC,OAAQ,CAAAJ,SAAS,CAAG,EAAA;IAC5BA,SAAA,GAAYA,UAAU,CAAC,CAAA;EACzB;EACA,IAAI,CAACA,SAAW,EAAA;IACdK,OAAA,CAAQC,MAAM,0BAA0B,CAAA;IACxC,OAAO;MAACC,IAAA,EAAM,IAAM;MAAAC,gBAAA,EAAkB;IAAI,CAAA;EAC5C;EAEA,IAAIlB,IAAImB,aAAe,EAAA;IACrB,MAAM,IAAIC,KAAA,CACR,iJAAA,CACF;EACF;EAEM,MAAAH,IAAA,GAAO,MAAMI,SAAA,CAASrB,GAAG,CAAA;EACzB,MAAAsB,cAAA,GAAiBrB,SAASiB,gBAAiB,CAAAD,IAAA,EAAMP,WAAWT,MAAO,CAAAsB,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASpB,qCAAuC,EAAA;IACrE,MAAM,IAAIsB,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLR,MAAMA,IAAK,CAAAM,IAAA,KAASI,IAAK,CAAAC,KAAA,CAAMX,IAAI,CAAI,GAAA,IAAA;IACvCC,gBAAkB,EAAAI;EAAA,CACpB;AACF;AAaA,eAAsBd,YACpBA,CAAAR,GAAA,EACAC,MACA,EAC2B;EAAA,IAD3BC,qCAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAiD,IACtB;EAC3B,MAAMO,SAAY,GAAAV,GAAA,CAAIW,OAAQ,CAAAkB,GAAA,CAAIjB,qBAAqB,CAAA;EACvD,IAAI,CAACF,SAAW,EAAA;IACdK,OAAA,CAAQC,MAAM,0BAA0B,CAAA;IACxC,OAAO;MAACC,IAAA,EAAM,IAAM;MAAAC,gBAAA,EAAkB;IAAI,CAAA;EAC5C;EAEM,MAAAD,IAAA,GAAO,MAAMjB,GAAA,CAAI8B,IAAK,EAAA;EACtB,MAAAR,cAAA,GAAiBrB,SAASiB,gBAAiB,CAAAD,IAAA,EAAMP,WAAWT,MAAO,CAAAsB,IAAA,EAAM,CAAI,GAAA,IAAA;EAE/E,IAAAD,cAAA,KAAmB,SAASpB,qCAAuC,EAAA;IACrE,MAAM,IAAIsB,OAAQ,CAACC,WAAYC,UAAW,CAAAD,OAAA,EAAS,GAAI,CAAC,CAAA;EAC1D;EAEO,OAAA;IACLR,MAAMA,IAAK,CAAAM,IAAA,KAASI,IAAK,CAAAC,KAAA,CAAMX,IAAI,CAAI,GAAA,IAAA;IACvCC,gBAAkB,EAAAI;EAAA,CACpB;AACF;"}
1
+ {"version":3,"file":"parseBody.js","sources":["../../src/webhook/parseBody.ts"],"sourcesContent":["import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextApiRequest} from 'next'\nimport type {NextRequest} from 'next/server'\n\nimport {_readBody as readBody} from './readBody'\n\n/** @public */\nexport type ParsedBody<T> = {\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: T | null\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseBody<Body = SanityDocument> = ParsedBody<Body>\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<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency?: boolean,\n): Promise<ParsedBody<Body>>\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 */\n// eslint-disable-next-line require-await\nexport async function parseBody<Body = SanityDocument>(\n req: NextApiRequest | NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n // @ts-expect-error -- add global typings for EdgeRuntime\n if (typeof EdgeRuntime !== 'undefined') {\n throw new TypeError(\n `The edge runtime isn't supported. You'll have to use the 'nodejs' runtime until the underlying \\`@sanity/webhook\\` package is updated to support it.`,\n )\n }\n return 'text' in req\n ? parseAppBody(req, secret, waitForContentLakeEventualConsistency)\n : parsePageBody(req, secret, waitForContentLakeEventualConsistency)\n}\n\nasync function parsePageBody<Body = SanityDocument>(\n req: NextApiRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n let signature = req.headers[SIGNATURE_HEADER_NAME]\n if (Array.isArray(signature)) {\n signature = signature[0]\n }\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n if (req.readableEnded) {\n throw new Error(\n `Request already ended and the POST body can't be read. Have you setup \\`export {config} from 'next-sanity/webhook' in your webhook API handler?\\``,\n )\n }\n\n const body = await readBody(req)\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n\n/**\n * @deprecated Use `ParsedBody` instead\n * @public\n */\nexport type ParseAppBody<Body = SanityDocument> = ParsedBody<Body>\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 * @deprecated Use `parseBody` instead\n * @public\n */\nexport async function parseAppBody<Body = SanityDocument>(\n req: NextRequest,\n secret?: string,\n waitForContentLakeEventualConsistency: boolean = true,\n): Promise<ParsedBody<Body>> {\n const signature = req.headers.get(SIGNATURE_HEADER_NAME)!\n if (!signature) {\n console.error('Missing signature header')\n return {body: null, isValidSignature: null}\n }\n\n const body = await req.text()\n const validSignature = secret ? isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 1000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":["signature","console","body","isValidSignature"],"mappings":";;;AA+CA;AAI6B;AAEvB;AACF;AAGF;;AAIF;AAEA;AAI6B;AACvB;AACA;AACFA;AACF;;AAEEC;;AACQC;AAAYC;;AACtB;;AAGE;AAGF;AAEM;AACA;AAEF;;AAEJ;;AAGED;AACAC;;AAEJ;AAaA;AAI6B;;;AAGzBF;;AACQC;AAAYC;;AACtB;AAEM;AACA;AAEF;;AAEJ;;AAGED;AACAC;;AAEJ;"}
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"readBody.cjs","sources":["../../src/webhook/readBody.ts"],"sourcesContent":["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"],"names":["_readBody","readable","chunks","chunk","push","Buffer","from","concat","toString"],"mappings":";;;;;AAGA,eAAsBA,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;"}
1
+ {"version":3,"file":"readBody.cjs","sources":["../../src/webhook/readBody.ts"],"sourcesContent":["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"],"names":["chunks"],"mappings":";;;;;;AAGA;;AAEE;AACSA;AACT;;AAEF;"}
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  async function _readBody(readable) {
2
3
  const chunks = [];
3
4
  for await (const chunk of readable) {
@@ -1 +1 @@
1
- {"version":3,"file":"readBody.js","sources":["../../src/webhook/readBody.ts"],"sourcesContent":["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"],"names":["_readBody","readable","chunks","chunk","push","Buffer","from","concat","toString"],"mappings":"AAGA,eAAsBA,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;"}
1
+ {"version":3,"file":"readBody.js","sources":["../../src/webhook/readBody.ts"],"sourcesContent":["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"],"names":["chunks"],"mappings":";AAGA;;AAEE;AACSA;AACT;;AAEF;"}
package/dist/webhook.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ 'use strict';
2
3
 
3
4
  Object.defineProperty(exports, '__esModule', {
4
5
  value: true
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"webhook.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
package/dist/webhook.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use strict';
1
2
  export { config } from './webhook/config.js';
2
3
  export { parseAppBody, parseBody } from './webhook/parseBody.js';
3
4
  //# sourceMappingURL=webhook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"webhook.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-sanity",
3
- "version": "5.5.4",
3
+ "version": "5.5.6",
4
4
  "description": "Sanity.io toolkit for Next.js",
5
5
  "keywords": [
6
6
  "sanity",
@@ -158,7 +158,7 @@
158
158
  "lint": "eslint --max-warnings 0 .",
159
159
  "prepublishOnly": "npm run build",
160
160
  "prettier": "npx prettier --ignore-path .gitignore",
161
- "test": "jest",
161
+ "test": "vitest",
162
162
  "test:node-esm-cjs": "node test.mjs && node test.cjs",
163
163
  "type-check": "tsc --noEmit",
164
164
  "update:icons": "cp node_modules/sanity/static/favicons/* src/studio/head"
@@ -174,53 +174,52 @@
174
174
  "singleQuote": true
175
175
  },
176
176
  "dependencies": {
177
+ "@sanity/client": "^6.4.9",
177
178
  "@sanity/preview-kit": "3.1.6",
178
179
  "@sanity/webhook": "3.0.1",
179
- "groq": "^3.0.0",
180
- "@sanity/client": "^6.4.12"
180
+ "groq": "^3.0.0"
181
181
  },
182
182
  "devDependencies": {
183
- "@next/bundle-analyzer": "^13.4.19",
184
- "@next/eslint-plugin-next": "13.4.19",
185
- "@rollup/plugin-url": "^8.0.1",
183
+ "@next/bundle-analyzer": "^13.5.4",
184
+ "@next/eslint-plugin-next": "13.5.4",
185
+ "@rollup/plugin-url": "^8.0.2",
186
186
  "@sanity/eslint-config-studio": "^3.0.1",
187
187
  "@sanity/image-url": "^1.0.2",
188
- "@sanity/pkg-utils": "^2.4.9",
188
+ "@sanity/pkg-utils": "^3.0.0",
189
189
  "@sanity/ui": "^1.8.2",
190
- "@sanity/vision": "3.16.4",
191
- "@types/eventsource": "^1.1.11",
192
- "@types/jest": "^29.5.5",
193
- "@types/react": "^18.2.22",
194
- "@types/react-dom": "^18.2.7",
195
- "@types/styled-components": "^5.1.27",
196
- "@typescript-eslint/eslint-plugin": "^6.7.2",
197
- "autoprefixer": "^10.4.15",
198
- "eslint": "^8.49.0",
190
+ "@sanity/vision": "3.17.0",
191
+ "@types/react": "^18.2.28",
192
+ "@types/react-dom": "^18.2.13",
193
+ "@types/styled-components": "^5.1.28",
194
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
195
+ "@vitest/coverage-v8": "^0.34.6",
196
+ "autoprefixer": "^10.4.16",
197
+ "eslint": "^8.51.0",
199
198
  "eslint-config-prettier": "^9.0.0",
200
- "eslint-config-sanity": "^6.0.0",
199
+ "eslint-config-sanity": "^7.0.1",
201
200
  "eslint-gitignore": "^0.1.0",
202
- "eslint-plugin-prettier": "^5.0.0",
201
+ "eslint-plugin-prettier": "^5.0.1",
203
202
  "eslint-plugin-simple-import-sort": "^10.0.0",
204
203
  "groqd": "^0.15.9",
205
- "jest": "^29.7.0",
206
- "jest-environment-jsdom": "^29.7.0",
207
204
  "ls-engines": "^0.9.0",
208
- "next": "13.4.19",
209
- "postcss": "^8.4.30",
205
+ "next": "13.5.4",
206
+ "postcss": "^8.4.31",
210
207
  "prettier": "^3.0.3",
211
- "prettier-plugin-packagejson": "^2.4.5",
212
- "prettier-plugin-tailwindcss": "^0.5.4",
208
+ "prettier-plugin-packagejson": "^2.4.6",
209
+ "prettier-plugin-tailwindcss": "^0.5.5",
213
210
  "react": "^18.2.0",
214
211
  "react-dom": "^18.2.0",
215
212
  "react-is": "^18.2.0",
216
- "rollup": "^3.29.2",
217
- "sanity": "3.16.4",
213
+ "rollup": "^4.0.2",
214
+ "sanity": "3.17.0",
218
215
  "server-only": "^0.0.1",
219
216
  "styled-components": "^5.3.11",
220
217
  "suspend-react": "^0.1.3",
221
218
  "tailwindcss": "^3.3.3",
222
219
  "typescript": "^5.2.2",
223
- "url-loader": "^4.1.1"
220
+ "url-loader": "^4.1.1",
221
+ "vitest": "^0.34.6",
222
+ "vitest-github-actions-reporter": "^0.10.0"
224
223
  },
225
224
  "peerDependencies": {
226
225
  "@sanity/client": "^6.4.9",
@@ -233,6 +232,6 @@
233
232
  "styled-components": "^5.2.0 || ^6.0.0"
234
233
  },
235
234
  "engines": {
236
- "node": ">=16.14"
235
+ "node": ">=18"
237
236
  }
238
237
  }