next-sanity 11.1.1 → 11.1.2

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 (37) hide show
  1. package/dist/{draft-mode.js → draft-mode/index.js} +1 -1
  2. package/dist/draft-mode/index.js.map +1 -0
  3. package/dist/{hooks.js → hooks/index.js} +1 -1
  4. package/dist/hooks/index.js.map +1 -0
  5. package/dist/{image.js → image/index.js} +1 -1
  6. package/dist/image/index.js.map +1 -0
  7. package/dist/studio/{client-component.js → client-component/index.js} +2 -2
  8. package/dist/studio/client-component/index.js.map +1 -0
  9. package/dist/{studio.js → studio/index.js} +2 -2
  10. package/dist/studio/index.js.map +1 -0
  11. package/dist/visual-editing/{client-component.js → client-component/index.js} +2 -2
  12. package/dist/visual-editing/client-component/index.js.map +1 -0
  13. package/dist/{visual-editing.js → visual-editing/index.js} +1 -1
  14. package/dist/visual-editing/index.js.map +1 -0
  15. package/dist/visual-editing/{server-actions.js → server-actions/index.js} +1 -1
  16. package/dist/visual-editing/server-actions/index.js.map +1 -0
  17. package/dist/{webhook.js → webhook/index.js} +1 -1
  18. package/dist/webhook/index.js.map +1 -0
  19. package/package.json +22 -22
  20. package/dist/draft-mode.js.map +0 -1
  21. package/dist/hooks.js.map +0 -1
  22. package/dist/image.js.map +0 -1
  23. package/dist/studio/client-component.js.map +0 -1
  24. package/dist/studio.js.map +0 -1
  25. package/dist/visual-editing/client-component.js.map +0 -1
  26. package/dist/visual-editing/server-actions.js.map +0 -1
  27. package/dist/visual-editing.js.map +0 -1
  28. package/dist/webhook.js.map +0 -1
  29. /package/dist/{draft-mode.d.ts → draft-mode/index.d.ts} +0 -0
  30. /package/dist/{hooks.d.ts → hooks/index.d.ts} +0 -0
  31. /package/dist/{image.d.ts → image/index.d.ts} +0 -0
  32. /package/dist/studio/{client-component.d.ts → client-component/index.d.ts} +0 -0
  33. /package/dist/{studio.d.ts → studio/index.d.ts} +0 -0
  34. /package/dist/visual-editing/{client-component.d.ts → client-component/index.d.ts} +0 -0
  35. /package/dist/{visual-editing.d.ts → visual-editing/index.d.ts} +0 -0
  36. /package/dist/visual-editing/{server-actions.d.ts → server-actions/index.d.ts} +0 -0
  37. /package/dist/{webhook.d.ts → webhook/index.d.ts} +0 -0
@@ -37,4 +37,4 @@ function defineEnableDraftMode(options) {
37
37
  export {
38
38
  defineEnableDraftMode
39
39
  };
40
- //# sourceMappingURL=draft-mode.js.map
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/draft-mode/define-enable-draft-mode.ts"],"sourcesContent":["import {validatePreviewUrl} from '@sanity/preview-url-secret'\nimport {perspectiveCookieName} from '@sanity/preview-url-secret/constants'\nimport {cookies, draftMode} from 'next/headers'\nimport {redirect} from 'next/navigation'\n\nimport type {SanityClient} from '../client'\n\n/**\n * @public\n */\nexport interface DefineEnableDraftModeOptions {\n client: SanityClient\n /**\n * Force secure cookies in development mode.\n * Enable this when using Next.js --experimental-https flag.\n * This option has no effect in production (cookies are always secure).\n * @defaultValue false\n */\n secureDevMode?: boolean\n}\n\n/**\n * @public\n */\nexport interface EnableDraftMode {\n GET: (request: Request) => Promise<Response>\n}\n\n/**\n * Sets up an API route for enabling draft mode, can be paired with the `previewUrl.previewMode.enable` in `sanity/presentation`.\n * Can also be used with `sanity-plugin-iframe-pane`.\n * @example\n * ```ts\n * // src/app/api/draft-mode/enable/route.ts\n *\n * import { defineEnableDraftMode } from \"next-sanity/draft-mode\";\n * import { client } from \"@/sanity/lib/client\";\n *\n * export const { GET } = defineEnableDraftMode({\n * client: client.withConfig({ token: process.env.SANITY_API_READ_TOKEN }),\n * });\n * ```\n *\n * @public\n */\nexport function defineEnableDraftMode(options: DefineEnableDraftModeOptions): EnableDraftMode {\n const {client} = options\n return {\n GET: async (request: Request) => {\n // eslint-disable-next-line no-warning-comments\n // @TODO check if already in draft mode at a much earlier stage, and skip validation\n\n const {\n isValid,\n redirectTo = '/',\n studioPreviewPerspective,\n } = await validatePreviewUrl(client, request.url)\n if (!isValid) {\n return new Response('Invalid secret', {status: 401})\n }\n\n const draftModeStore = await draftMode()\n\n // Let's enable draft mode if it's not already enabled\n if (!draftModeStore.isEnabled) {\n draftModeStore.enable()\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n // We can't auto-detect HTTPS in dev due to Next.js limitations,\n // so we need an explicit option\n const isSecure = isProduction || (options.secureDevMode ?? false)\n\n // Override cookie header for draft mode for usage in live-preview\n // https://github.com/vercel/next.js/issues/49927\n const cookieStore = await cookies()\n const cookie = cookieStore.get('__prerender_bypass')!\n cookieStore.set({\n name: '__prerender_bypass',\n value: cookie?.value,\n httpOnly: true,\n path: '/',\n secure: isSecure,\n sameSite: isSecure ? 'none' : 'lax',\n })\n\n if (studioPreviewPerspective) {\n cookieStore.set({\n name: perspectiveCookieName,\n value: studioPreviewPerspective,\n httpOnly: true,\n path: '/',\n secure: isSecure,\n sameSite: isSecure ? 'none' : 'lax',\n })\n }\n\n // the `redirect` function throws, and eventually returns a Promise<Response>. TSC doesn't \"see\" that so we have to tell it\n return redirect(redirectTo) as Promise<Response>\n },\n }\n}\n"],"names":[],"mappings":";;;;AA6CO,SAAS,sBAAsB,SAAwD;AAC5F,QAAM,EAAC,WAAU;AACjB,SAAO;AAAA,IACL,KAAK,OAAO,YAAqB;AAI/B,YAAM;AAAA,QACJ;AAAA,QACA,aAAa;AAAA,QACb;AAAA,MAAA,IACE,MAAM,mBAAmB,QAAQ,QAAQ,GAAG;AAChD,UAAI,CAAC;AACH,eAAO,IAAI,SAAS,kBAAkB,EAAC,QAAQ,KAAI;AAGrD,YAAM,iBAAiB,MAAM,UAAA;AAGxB,qBAAe,aAClB,eAAe,OAAA;AAOjB,YAAM,WAJe,QAAQ,IAAI,aAAa,iBAIZ,QAAQ,iBAAiB,KAIrD,cAAc,MAAM,QAAA,GACpB,SAAS,YAAY,IAAI,oBAAoB;AACnD,aAAA,YAAY,IAAI;AAAA,QACd,MAAM;AAAA,QACN,OAAO,QAAQ;AAAA,QACf,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,UAAU,WAAW,SAAS;AAAA,MAAA,CAC/B,GAEG,4BACF,YAAY,IAAI;AAAA,QACd,MAAM;AAAA,QACN,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,UAAU,WAAW,SAAS;AAAA,MAAA,CAC/B,GAII,SAAS,UAAU;AAAA,IAC5B;AAAA,EAAA;AAEJ;"}
@@ -3,4 +3,4 @@ import { useOptimistic } from "@sanity/visual-editing/react";
3
3
  export {
4
4
  useOptimistic
5
5
  };
6
- //# sourceMappingURL=hooks.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -29,4 +29,4 @@ export {
29
29
  Image,
30
30
  imageLoader
31
31
  };
32
- //# sourceMappingURL=image.js.map
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/image/imageLoader.ts","../../src/image/Image.tsx"],"sourcesContent":["import type {ImageLoader} from 'next/image'\n\n/**\n * @alpha\n */\nexport const imageLoader = (({src, width, quality}) => {\n const url = new URL(src)\n url.searchParams.set('auto', 'format')\n if (!url.searchParams.has('fit')) {\n url.searchParams.set('fit', url.searchParams.has('h') ? 'min' : 'max')\n }\n if (url.searchParams.has('h') && url.searchParams.has('w')) {\n const originalHeight = parseInt(url.searchParams.get('h')!, 10)\n const originalWidth = parseInt(url.searchParams.get('w')!, 10)\n url.searchParams.set('h', Math.round((originalHeight / originalWidth) * width).toString())\n }\n url.searchParams.set('w', width.toString())\n if (quality) {\n url.searchParams.set('q', quality.toString())\n }\n return url.href\n}) satisfies ImageLoader\n","import NextImage, {type ImageProps as NextImageProps} from 'next/image'\n\nimport {imageLoader} from './imageLoader'\n\n/**\n * @alpha\n */\nexport interface ImageProps extends Omit<NextImageProps, 'loader' | 'src'> {\n /**\n * The `loader` prop is not supported on `Image` components. Use `next/image` directly to use a custom loader.\n */\n loader?: never\n /**\n * Must be a string that is a valid URL to an image on the Sanity Image CDN.\n */\n src: string\n}\n\n/**\n * @alpha\n */\nexport function Image(props: ImageProps): React.JSX.Element {\n const {loader, src, ...rest} = props\n if (loader) {\n throw new TypeError(\n 'The `loader` prop is not supported on `Image` components. Use `next/image` directly to use a custom loader.',\n )\n }\n let srcUrl: URL\n try {\n srcUrl = new URL(src)\n if (props.height) {\n srcUrl.searchParams.set('h', `${props.height}`)\n }\n if (props.width) {\n srcUrl.searchParams.set('w', `${props.width}`)\n }\n } catch (err) {\n throw new TypeError('The `src` prop must be a valid URL to an image on the Sanity Image CDN.', {\n cause: err,\n })\n }\n return <NextImage {...rest} src={srcUrl.toString()} loader={imageLoader} />\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,eAAe,CAAC,EAAC,KAAK,OAAO,cAAa;AACrD,QAAM,MAAM,IAAI,IAAI,GAAG;AAKvB,MAJA,IAAI,aAAa,IAAI,QAAQ,QAAQ,GAChC,IAAI,aAAa,IAAI,KAAK,KAC7B,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,GAAG,IAAI,QAAQ,KAAK,GAEnE,IAAI,aAAa,IAAI,GAAG,KAAK,IAAI,aAAa,IAAI,GAAG,GAAG;AAC1D,UAAM,iBAAiB,SAAS,IAAI,aAAa,IAAI,GAAG,GAAI,EAAE,GACxD,gBAAgB,SAAS,IAAI,aAAa,IAAI,GAAG,GAAI,EAAE;AAC7D,QAAI,aAAa,IAAI,KAAK,KAAK,MAAO,iBAAiB,gBAAiB,KAAK,EAAE,SAAA,CAAU;AAAA,EAC3F;AACA,SAAA,IAAI,aAAa,IAAI,KAAK,MAAM,SAAA,CAAU,GACtC,WACF,IAAI,aAAa,IAAI,KAAK,QAAQ,SAAA,CAAU,GAEvC,IAAI;AACb;ACAO,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAC,QAAQ,KAAK,GAAG,SAAQ;AAC/B,MAAI;AACF,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,MAAI;AACJ,MAAI;AACF,aAAS,IAAI,IAAI,GAAG,GAChB,MAAM,UACR,OAAO,aAAa,IAAI,KAAK,GAAG,MAAM,MAAM,EAAE,GAE5C,MAAM,SACR,OAAO,aAAa,IAAI,KAAK,GAAG,MAAM,KAAK,EAAE;AAAA,EAEjD,SAAS,KAAK;AACZ,UAAM,IAAI,UAAU,2EAA2E;AAAA,MAC7F,OAAO;AAAA,IAAA,CACR;AAAA,EACH;AACA,SAAO,oBAAC,aAAW,GAAG,MAAM,KAAK,OAAO,SAAA,GAAY,QAAQ,aAAa;AAC3E;"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { lazy, Suspense } from "react";
4
- const NextStudioClientComponent = lazy(() => import("../_chunks-es/NextStudio.js"));
4
+ const NextStudioClientComponent = lazy(() => import("../../_chunks-es/NextStudio.js"));
5
5
  function NextStudioLazyClientComponent(props) {
6
6
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(NextStudioClientComponent, { ...props }) });
7
7
  }
8
8
  export {
9
9
  NextStudioLazyClientComponent as NextStudio
10
10
  };
11
- //# sourceMappingURL=client-component.js.map
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/studio/client-component/NextStudioLazy.tsx"],"sourcesContent":["/**\n *\n * If pages router supported `next/dynamic` imports (it wants `next/dynamic.js`),\n * or if turbopack in app router allowed `next/dynamic.js` (it doesn't yet)\n * we could use `dynamic(() => import('...), {ssr: false})` here.\n * Since we can't, we need to use a lazy import and Suspense ourself.\n */\n\nimport {lazy, Suspense} from 'react'\n\nimport type {NextStudioProps} from './NextStudio'\n\nconst NextStudioClientComponent = lazy(() => import('./NextStudio'))\n\nexport function NextStudioLazyClientComponent(props: NextStudioProps): React.ReactNode {\n return (\n <Suspense fallback={null}>\n <NextStudioClientComponent {...props} />\n </Suspense>\n )\n}\n"],"names":[],"mappings":";;;AAYA,MAAM,4BAA4B,KAAK,MAAM,OAAO,gCAAc,CAAC;AAE5D,SAAS,8BAA8B,OAAyC;AACrF,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,2BAAA,EAA2B,GAAG,OAAO,EAAA,CACxC;AAEJ;"}
@@ -1,4 +1,4 @@
1
- import { NextStudioLayout, NextStudioNoScript } from "./_chunks-es/NextStudioNoScript.js";
1
+ import { NextStudioLayout, NextStudioNoScript } from "../_chunks-es/NextStudioNoScript.js";
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { NextStudio } from "next-sanity/studio/client-component";
4
4
  import { preloadModule } from "react-dom";
@@ -24,4 +24,4 @@ export {
24
24
  metadata,
25
25
  viewport
26
26
  };
27
- //# sourceMappingURL=studio.js.map
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/studio/head.tsx","../../src/studio/NextStudioWithBridge.tsx"],"sourcesContent":["import type {Metadata, Viewport} from 'next'\n\n/**\n * In router segments (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the viewport config directly:\n * export {viewport} from 'next-sanity/studio'\n *\n * // To customize the viewport config, spread it on the export:\n * import {viewport as studioViewport} from 'next-sanity/studio'\n * import type { Viewport } from 'next'\n *\n * export const viewport: Viewport = {\n * ...studioViewport,\n * // Overrides the viewport to resize behavior\n * interactiveWidget: 'resizes-content'\n * })\n * ```\n * @public\n */\nexport const viewport = {\n width: 'device-width' as const,\n initialScale: 1 as const,\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewportFit: 'cover',\n} satisfies Viewport\n\n/**\n * In router segments (`/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 * // Set another title\n * title: 'My Studio',\n * })\n * ```\n * @public\n */\nexport const metadata = {\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n","import {NextStudio, type NextStudioProps} from 'next-sanity/studio/client-component'\nimport {preloadModule} from 'react-dom'\n\n/**\n * Loads the bridge script the same way Sanity Studio does:\n * https://github.com/sanity-io/sanity/blob/bd5b1acb5015baaddd8d96c2abd1eaf579b3c904/packages/sanity/src/_internal/cli/server/renderDocument.tsx#L124-L139\n */\n\nconst bridgeScript = 'https://core.sanity-cdn.com/bridge.js'\n\nexport function NextStudioWithBridge(props: NextStudioProps): React.JSX.Element {\n preloadModule(bridgeScript, {as: 'script'})\n\n return (\n <>\n <script src={bridgeScript} async type=\"module\" data-sanity-core />\n <NextStudio {...props} />\n </>\n )\n}\n"],"names":[],"mappings":";;;;AAoBO,MAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,cAAc;AAAA;AAAA,EAEd,aAAa;AACf,GAoBa,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,QAAQ;AACV,GCxCM,eAAe;AAEd,SAAS,qBAAqB,OAA2C;AAC9E,SAAA,cAAc,cAAc,EAAC,IAAI,SAAA,CAAS,GAGxC,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA,oBAAC,UAAA,EAAO,KAAK,cAAc,OAAK,IAAC,MAAK,UAAS,oBAAgB,GAAA,CAAC;AAAA,IAChE,oBAAC,YAAA,EAAY,GAAG,MAAA,CAAO;AAAA,EAAA,GACzB;AAEJ;"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { lazy, Suspense } from "react";
4
- const VisualEditingClientComponent = lazy(() => import("../_chunks-es/VisualEditing.js"));
4
+ const VisualEditingClientComponent = lazy(() => import("../../_chunks-es/VisualEditing.js"));
5
5
  function VisualEditingLazyClientComponent(props) {
6
6
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(VisualEditingClientComponent, { ...props }) });
7
7
  }
8
8
  export {
9
9
  VisualEditingLazyClientComponent as default
10
10
  };
11
- //# sourceMappingURL=client-component.js.map
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/visual-editing/client-component/VisualEditingLazy.tsx"],"sourcesContent":["/**\n *\n * If pages router supported `next/dynamic` imports (it wants `next/dynamic.js`),\n * or if turbopack in app router allowed `next/dynamic.js` (it doesn't yet)\n * we could use `dynamic(() => import('...), {ssr: false})` here.\n * Since we can't, we need to use a lazy import and Suspense ourself.\n */\n\nimport {lazy, Suspense} from 'react'\n\nimport type {VisualEditingProps} from './VisualEditing'\n\nconst VisualEditingClientComponent = lazy(() => import('./VisualEditing'))\n\nexport function VisualEditingLazyClientComponent(props: VisualEditingProps): React.ReactNode {\n return (\n <Suspense fallback={null}>\n <VisualEditingClientComponent {...props} />\n </Suspense>\n )\n}\n"],"names":[],"mappings":";;;AAYA,MAAM,+BAA+B,KAAK,MAAM,OAAO,mCAAiB,CAAC;AAElE,SAAS,iCAAiC,OAA4C;AAC3F,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,8BAAA,EAA8B,GAAG,OAAO,EAAA,CAC3C;AAEJ;"}
@@ -31,4 +31,4 @@ function VisualEditing(props) {
31
31
  export {
32
32
  VisualEditing
33
33
  };
34
- //# sourceMappingURL=visual-editing.js.map
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/visual-editing/VisualEditing.tsx"],"sourcesContent":["import type {VisualEditingProps} from 'next-sanity/visual-editing/client-component'\nimport VisualEditingComponent from 'next-sanity/visual-editing/client-component'\n\n/**\n * @public\n */\nexport function VisualEditing(props: VisualEditingProps): React.ReactElement {\n let autoBasePath: string | undefined\n if (typeof props.basePath !== 'string') {\n try {\n autoBasePath = process.env['__NEXT_ROUTER_BASEPATH']\n if (autoBasePath) {\n // eslint-disable-next-line no-console\n console.log(\n `Detected next basePath as ${JSON.stringify(autoBasePath)} by reading \"process.env.__NEXT_ROUTER_BASEPATH\". If this is incorrect then you can set it manually with the basePath prop on the <VisualEditing /> component.`,\n )\n }\n } catch (err) {\n console.error('Failed detecting basePath', err)\n }\n }\n let autoTrailingSlash: boolean | undefined\n if (typeof props.trailingSlash !== 'boolean') {\n try {\n autoTrailingSlash = Boolean(process.env['__NEXT_TRAILING_SLASH'])\n if (autoTrailingSlash) {\n // eslint-disable-next-line no-console\n console.log(\n `Detected next trailingSlash as ${JSON.stringify(autoTrailingSlash)} by reading \"process.env.__NEXT_TRAILING_SLASH\". If this is incorrect then you can set it manually with the trailingSlash prop on the <VisualEditing /> component.`,\n )\n }\n } catch (err) {\n console.error('Failed detecting trailingSlash', err)\n }\n }\n return (\n <VisualEditingComponent\n {...props}\n basePath={props.basePath ?? autoBasePath}\n trailingSlash={props.trailingSlash ?? autoTrailingSlash}\n />\n )\n}\n\nexport type {VisualEditingProps} from 'next-sanity/visual-editing/client-component'\n"],"names":[],"mappings":";;AAMO,SAAS,cAAc,OAA+C;AAC3E,MAAI;AACJ,MAAI,OAAO,MAAM,YAAa;AAC5B,QAAI;AACF,qBAAe,QAAQ,IAAI,wBACvB,gBAEF,QAAQ;AAAA,QACN,6BAA6B,KAAK,UAAU,YAAY,CAAC;AAAA,MAAA;AAAA,IAG/D,SAAS,KAAK;AACZ,cAAQ,MAAM,6BAA6B,GAAG;AAAA,IAChD;AAEF,MAAI;AACJ,MAAI,OAAO,MAAM,iBAAkB;AACjC,QAAI;AACF,0BAAoB,CAAA,CAAQ,QAAQ,IAAI,uBACpC,qBAEF,QAAQ;AAAA,QACN,kCAAkC,KAAK,UAAU,iBAAiB,CAAC;AAAA,MAAA;AAAA,IAGzE,SAAS,KAAK;AACZ,cAAQ,MAAM,kCAAkC,GAAG;AAAA,IACrD;AAEF,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,MAAM,YAAY;AAAA,MAC5B,eAAe,MAAM,iBAAiB;AAAA,IAAA;AAAA,EAAA;AAG5C;"}
@@ -11,4 +11,4 @@ async function revalidateRootLayout() {
11
11
  export {
12
12
  revalidateRootLayout
13
13
  };
14
- //# sourceMappingURL=server-actions.js.map
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/visual-editing/server-actions/index.ts"],"sourcesContent":["'use server'\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n if (!(await draftMode()).isEnabled) {\n // eslint-disable-next-line no-console\n console.warn('Skipped revalidatePath request because draft mode is not enabled')\n return\n }\n await revalidatePath('/', 'layout')\n}\n"],"names":[],"mappings":";;;AAIA,eAAsB,uBAAsC;AAC1D,MAAI,EAAE,MAAM,UAAA,GAAa,WAAW;AAElC,YAAQ,KAAK,kEAAkE;AAC/E;AAAA,EACF;AACA,QAAM,eAAe,KAAK,QAAQ;AACpC;"}
@@ -78,4 +78,4 @@ async function parseBody(req, secret, waitForContentLakeEventualConsistency = !0
78
78
  export {
79
79
  parseBody
80
80
  };
81
- //# sourceMappingURL=webhook.js.map
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../node_modules/.pnpm/@sanity+webhook@4.0.4/node_modules/@sanity/webhook/dist/index.mjs","../../src/webhook/index.ts"],"sourcesContent":["class WebhookSignatureValueError extends Error {\n type = \"WebhookSignatureValueError\";\n statusCode = 401;\n}\nclass WebhookSignatureFormatError extends Error {\n type = \"WebhookSignatureFormatError\";\n statusCode = 400;\n}\nfunction isSignatureError(error) {\n return typeof error == \"object\" && error !== null && \"type\" in error && [\"WebhookSignatureValueError\", \"WebhookSignatureFormatError\"].includes(\n error.type\n );\n}\nconst MINIMUM_TIMESTAMP = 16094592e5, SIGNATURE_HEADER_REGEX = /^t=(\\d+)[, ]+v1=([^, ]+)$/, SIGNATURE_HEADER_NAME = \"sanity-webhook-signature\";\nasync function assertValidSignature(stringifiedPayload, signature, secret) {\n const { timestamp } = decodeSignatureHeader(signature), encoded = await encodeSignatureHeader(stringifiedPayload, timestamp, secret);\n if (signature !== encoded)\n throw new WebhookSignatureValueError(\"Signature is invalid\");\n}\nasync function isValidSignature(stringifiedPayload, signature, secret) {\n try {\n return await assertValidSignature(stringifiedPayload, signature, secret), !0;\n } catch (err) {\n if (isSignatureError(err))\n return !1;\n throw err;\n }\n}\nasync function assertValidRequest(request, secret) {\n const signature = request.headers[SIGNATURE_HEADER_NAME];\n if (Array.isArray(signature))\n throw new WebhookSignatureFormatError(\"Multiple signature headers received\");\n if (typeof signature != \"string\")\n throw new WebhookSignatureValueError(\"Request contained no signature header\");\n if (typeof request.body > \"u\")\n throw new WebhookSignatureFormatError(\"Request contained no parsed request body\");\n if (typeof request.body == \"string\" || Buffer.isBuffer(request.body))\n await assertValidSignature(request.body.toString(\"utf8\"), signature, secret);\n else\n throw new Error(\n \"[@sanity/webhook] `request.body` was not a string/buffer - this can lead to invalid signatures. See the [migration docs](https://github.com/sanity-io/webhook-toolkit#from-parsed-to-unparsed-body) for details on how to fix this.\"\n );\n}\nasync function isValidRequest(request, secret) {\n try {\n return await assertValidRequest(request, secret), !0;\n } catch (err) {\n if (isSignatureError(err))\n return !1;\n throw err;\n }\n}\nasync function encodeSignatureHeader(stringifiedPayload, timestamp, secret) {\n const signature = await createHS256Signature(stringifiedPayload, timestamp, secret);\n return `t=${timestamp},v1=${signature}`;\n}\nfunction decodeSignatureHeader(signaturePayload) {\n if (!signaturePayload)\n throw new WebhookSignatureFormatError(\"Missing or empty signature header\");\n const [, timestamp, hashedPayload] = signaturePayload.trim().match(SIGNATURE_HEADER_REGEX) || [];\n if (!timestamp || !hashedPayload)\n throw new WebhookSignatureFormatError(\"Invalid signature payload format\");\n return {\n timestamp: parseInt(timestamp, 10),\n hashedPayload\n };\n}\nasync function createHS256Signature(stringifiedPayload, timestamp, secret) {\n if (typeof crypto > \"u\")\n throw new TypeError(\n \"The Web Crypto API is not available in this environment, either polyfill `globalThis.crypto` or downgrade to `@sanity/webhook@3` which uses the Node.js `crypto` module.\"\n );\n if (!secret || typeof secret != \"string\")\n throw new WebhookSignatureFormatError(\"Invalid secret provided\");\n if (!stringifiedPayload)\n throw new WebhookSignatureFormatError(\"Can not create signature for empty payload\");\n if (typeof stringifiedPayload != \"string\")\n throw new WebhookSignatureFormatError(\"Payload must be a JSON-encoded string\");\n if (typeof timestamp != \"number\" || isNaN(timestamp) || timestamp < MINIMUM_TIMESTAMP)\n throw new WebhookSignatureFormatError(\n \"Invalid signature timestamp, must be a unix timestamp with millisecond precision\"\n );\n const enc = new TextEncoder(), key = await crypto.subtle.importKey(\n \"raw\",\n enc.encode(secret),\n { name: \"HMAC\", hash: \"SHA-256\" },\n !1,\n [\"sign\"]\n ), signaturePayload = `${timestamp}.${stringifiedPayload}`, signature = await crypto.subtle.sign(\"HMAC\", key, enc.encode(signaturePayload)), signatureArray = Array.from(new Uint8Array(signature));\n return btoa(String.fromCharCode.apply(null, signatureArray)).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\nfunction requireSignedRequest(options) {\n const parseBody = typeof options.parseBody > \"u\" ? !0 : options.parseBody, respondOnError = typeof options.respondOnError > \"u\" ? !0 : options.respondOnError;\n return async function(request, response, next) {\n try {\n await assertValidRequest(request, options.secret), parseBody && typeof request.body == \"string\" && (request.body = JSON.parse(request.body)), next();\n } catch (err) {\n if (!respondOnError || !isSignatureError(err)) {\n next(err);\n return;\n }\n response.status(err.statusCode).json({ message: err.message });\n }\n };\n}\nexport {\n SIGNATURE_HEADER_NAME,\n WebhookSignatureFormatError,\n WebhookSignatureValueError,\n assertValidRequest,\n assertValidSignature,\n decodeSignatureHeader,\n encodeSignatureHeader,\n isSignatureError,\n isValidRequest,\n isValidSignature,\n requireSignedRequest\n};\n//# sourceMappingURL=index.mjs.map\n","import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextRequest} from 'next/server'\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 * 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 = 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 ? await isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 3000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,mCAAmC,MAAM;AAAA,EAC7C,OAAO;AAAA,EACP,aAAa;AACf;AACA,MAAM,oCAAoC,MAAM;AAAA,EAC9C,OAAO;AAAA,EACP,aAAa;AACf;AACA,SAAS,iBAAiB,OAAO;AAC/B,SAAO,OAAO,SAAS,YAAY,UAAU,QAAQ,UAAU,SAAS,CAAC,8BAA8B,6BAA6B,EAAE;AAAA,IACpI,MAAM;AAAA,EACV;AACA;AACA,MAAM,oBAAoB,YAAY,yBAAyB,6BAA6B,wBAAwB;AACpH,eAAe,qBAAqB,oBAAoB,WAAW,QAAQ;AACzE,QAAM,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IACvD;AAAA,IACA,IAAI,OAAO,MAAM;AAAA,IACjB,EAAE,MAAM,QAAQ,MAAM,UAAS;AAAA,IAC/B;AAAA,IACA,CAAC,MAAM;AAAA,EACX,GAAK,mBAAmB,GAAG,SAAS,IAAI,kBAAkB,IAAI,YAAY,MAAM,OAAO,OAAO,KAAK,QAAQ,KAAK,IAAI,OAAO,gBAAgB,CAAC,GAAG,iBAAiB,MAAM,KAAK,IAAI,WAAW,SAAS,CAAC;AAClM,SAAO,KAAK,OAAO,aAAa,MAAM,MAAM,cAAc,CAAC,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,EAAE;AACxH;ACxEA,eAAsB,UACpB,KACA,QACA,wCAAwC,IACb;AAC3B,QAAM,YAAY,IAAI,QAAQ,IAAI,qBAAqB;AACvD,MAAI,CAAC;AACH,WAAA,QAAQ,MAAM,0BAA0B,GACjC,EAAC,MAAM,MAAM,kBAAkB,KAAA;AAGxC,QAAM,OAAO,MAAM,IAAI,KAAA,GACjB,iBAAiB,SAAS,MAAM,iBAAiB,MAAM,WAAW,OAAO,KAAA,CAAM,IAAI;AAEzF,SAAI,mBAAmB,MAAS,yCAC9B,MAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAI,CAAC,GAGnD;AAAA,IACL,MAAM,KAAK,KAAA,IAAS,KAAK,MAAM,IAAI,IAAI;AAAA,IACvC,kBAAkB;AAAA,EAAA;AAEtB;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-sanity",
3
- "version": "11.1.1",
3
+ "version": "11.1.2",
4
4
  "description": "Sanity.io toolkit for Next.js",
5
5
  "keywords": [
6
6
  "sanity",
@@ -31,15 +31,15 @@
31
31
  },
32
32
  "./draft-mode": {
33
33
  "source": "./src/draft-mode/index.ts",
34
- "default": "./dist/draft-mode.js"
34
+ "default": "./dist/draft-mode/index.js"
35
35
  },
36
36
  "./hooks": {
37
37
  "source": "./src/hooks/index.ts",
38
- "default": "./dist/hooks.js"
38
+ "default": "./dist/hooks/index.js"
39
39
  },
40
40
  "./image": {
41
41
  "source": "./src/image/index.ts",
42
- "default": "./dist/image.js"
42
+ "default": "./dist/image/index.js"
43
43
  },
44
44
  "./live": {
45
45
  "source": "./src/live.ts",
@@ -47,27 +47,27 @@
47
47
  },
48
48
  "./studio": {
49
49
  "source": "./src/studio/index.ts",
50
- "default": "./dist/studio.js"
50
+ "default": "./dist/studio/index.js"
51
51
  },
52
52
  "./studio/client-component": {
53
53
  "source": "./src/studio/client-component/index.ts",
54
- "default": "./dist/studio/client-component.js"
54
+ "default": "./dist/studio/client-component/index.js"
55
55
  },
56
56
  "./visual-editing": {
57
57
  "source": "./src/visual-editing/index.ts",
58
- "default": "./dist/visual-editing.js"
58
+ "default": "./dist/visual-editing/index.js"
59
59
  },
60
60
  "./visual-editing/client-component": {
61
61
  "source": "./src/visual-editing/client-component/index.ts",
62
- "default": "./dist/visual-editing/client-component.js"
62
+ "default": "./dist/visual-editing/client-component/index.js"
63
63
  },
64
64
  "./visual-editing/server-actions": {
65
65
  "source": "./src/visual-editing/server-actions/index.ts",
66
- "default": "./dist/visual-editing/server-actions.js"
66
+ "default": "./dist/visual-editing/server-actions/index.js"
67
67
  },
68
68
  "./webhook": {
69
69
  "source": "./src/webhook/index.ts",
70
- "default": "./dist/webhook.js"
70
+ "default": "./dist/webhook/index.js"
71
71
  },
72
72
  "./package.json": "./package.json"
73
73
  },
@@ -76,34 +76,34 @@
76
76
  "typesVersions": {
77
77
  "*": {
78
78
  "draft-mode": [
79
- "./dist/draft-mode.d.ts"
79
+ "./dist/draft-mode/index.d.ts"
80
80
  ],
81
81
  "hooks": [
82
- "./dist/hooks.d.ts"
82
+ "./dist/hooks/index.d.ts"
83
83
  ],
84
84
  "live": [
85
85
  "./dist/live.d.ts"
86
86
  ],
87
87
  "image": [
88
- "./dist/image.d.ts"
88
+ "./dist/image/index.d.ts"
89
89
  ],
90
90
  "studio": [
91
- "./dist/studio.d.ts"
91
+ "./dist/studio/index.d.ts"
92
92
  ],
93
93
  "studio/client-component": [
94
- "./dist/studio/client-component.d.ts"
94
+ "./dist/studio/client-component/index.d.ts"
95
95
  ],
96
96
  "visual-editing": [
97
- "./dist/visual-editing.d.ts"
97
+ "./dist/visual-editing/index.d.ts"
98
98
  ],
99
99
  "visual-editing/client-component": [
100
- "./dist/visual-editing/client-component.d.ts"
100
+ "./dist/visual-editing/client-component/index.d.ts"
101
101
  ],
102
102
  "visual-editing/server-actions": [
103
- "./dist/visual-editing/server-actions.d.ts"
103
+ "./dist/visual-editing/server-actions/index.d.ts"
104
104
  ],
105
105
  "webhook": [
106
- "./dist/webhook.d.ts"
106
+ "./dist/webhook/index.d.ts"
107
107
  ]
108
108
  }
109
109
  },
@@ -114,7 +114,7 @@
114
114
  "browserslist": "extends @sanity/browserslist-config",
115
115
  "dependencies": {
116
116
  "@portabletext/react": "^4.0.3",
117
- "@sanity/client": "^7.11.1",
117
+ "@sanity/client": "^7.11.2",
118
118
  "@sanity/next-loader": "^3.0.0",
119
119
  "@sanity/preview-url-secret": "^2.1.15",
120
120
  "@sanity/visual-editing": "^3.0.5",
@@ -123,7 +123,7 @@
123
123
  },
124
124
  "devDependencies": {
125
125
  "@sanity/browserslist-config": "^1.0.5",
126
- "@sanity/pkg-utils": "^8.1.12",
126
+ "@sanity/pkg-utils": "^8.1.14",
127
127
  "@sanity/types": "^4.9.0",
128
128
  "@sanity/webhook": "4.0.4",
129
129
  "@types/react": "^19.1.8",
@@ -138,7 +138,7 @@
138
138
  "vitest": "^3.2.4"
139
139
  },
140
140
  "peerDependencies": {
141
- "@sanity/client": "^7.11.1",
141
+ "@sanity/client": "^7.11.2",
142
142
  "next": "^15.1",
143
143
  "react": "^18.3 || ^19",
144
144
  "react-dom": "^18.3 || ^19",
@@ -1 +0,0 @@
1
- {"version":3,"file":"draft-mode.js","sources":["../src/draft-mode/define-enable-draft-mode.ts"],"sourcesContent":["import {validatePreviewUrl} from '@sanity/preview-url-secret'\nimport {perspectiveCookieName} from '@sanity/preview-url-secret/constants'\nimport {cookies, draftMode} from 'next/headers'\nimport {redirect} from 'next/navigation'\n\nimport type {SanityClient} from '../client'\n\n/**\n * @public\n */\nexport interface DefineEnableDraftModeOptions {\n client: SanityClient\n /**\n * Force secure cookies in development mode.\n * Enable this when using Next.js --experimental-https flag.\n * This option has no effect in production (cookies are always secure).\n * @defaultValue false\n */\n secureDevMode?: boolean\n}\n\n/**\n * @public\n */\nexport interface EnableDraftMode {\n GET: (request: Request) => Promise<Response>\n}\n\n/**\n * Sets up an API route for enabling draft mode, can be paired with the `previewUrl.previewMode.enable` in `sanity/presentation`.\n * Can also be used with `sanity-plugin-iframe-pane`.\n * @example\n * ```ts\n * // src/app/api/draft-mode/enable/route.ts\n *\n * import { defineEnableDraftMode } from \"next-sanity/draft-mode\";\n * import { client } from \"@/sanity/lib/client\";\n *\n * export const { GET } = defineEnableDraftMode({\n * client: client.withConfig({ token: process.env.SANITY_API_READ_TOKEN }),\n * });\n * ```\n *\n * @public\n */\nexport function defineEnableDraftMode(options: DefineEnableDraftModeOptions): EnableDraftMode {\n const {client} = options\n return {\n GET: async (request: Request) => {\n // eslint-disable-next-line no-warning-comments\n // @TODO check if already in draft mode at a much earlier stage, and skip validation\n\n const {\n isValid,\n redirectTo = '/',\n studioPreviewPerspective,\n } = await validatePreviewUrl(client, request.url)\n if (!isValid) {\n return new Response('Invalid secret', {status: 401})\n }\n\n const draftModeStore = await draftMode()\n\n // Let's enable draft mode if it's not already enabled\n if (!draftModeStore.isEnabled) {\n draftModeStore.enable()\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n // We can't auto-detect HTTPS in dev due to Next.js limitations,\n // so we need an explicit option\n const isSecure = isProduction || (options.secureDevMode ?? false)\n\n // Override cookie header for draft mode for usage in live-preview\n // https://github.com/vercel/next.js/issues/49927\n const cookieStore = await cookies()\n const cookie = cookieStore.get('__prerender_bypass')!\n cookieStore.set({\n name: '__prerender_bypass',\n value: cookie?.value,\n httpOnly: true,\n path: '/',\n secure: isSecure,\n sameSite: isSecure ? 'none' : 'lax',\n })\n\n if (studioPreviewPerspective) {\n cookieStore.set({\n name: perspectiveCookieName,\n value: studioPreviewPerspective,\n httpOnly: true,\n path: '/',\n secure: isSecure,\n sameSite: isSecure ? 'none' : 'lax',\n })\n }\n\n // the `redirect` function throws, and eventually returns a Promise<Response>. TSC doesn't \"see\" that so we have to tell it\n return redirect(redirectTo) as Promise<Response>\n },\n }\n}\n"],"names":[],"mappings":";;;;AA6CO,SAAS,sBAAsB,SAAwD;AAC5F,QAAM,EAAC,WAAU;AACjB,SAAO;AAAA,IACL,KAAK,OAAO,YAAqB;AAI/B,YAAM;AAAA,QACJ;AAAA,QACA,aAAa;AAAA,QACb;AAAA,MAAA,IACE,MAAM,mBAAmB,QAAQ,QAAQ,GAAG;AAChD,UAAI,CAAC;AACH,eAAO,IAAI,SAAS,kBAAkB,EAAC,QAAQ,KAAI;AAGrD,YAAM,iBAAiB,MAAM,UAAA;AAGxB,qBAAe,aAClB,eAAe,OAAA;AAOjB,YAAM,WAJe,QAAQ,IAAI,aAAa,iBAIZ,QAAQ,iBAAiB,KAIrD,cAAc,MAAM,QAAA,GACpB,SAAS,YAAY,IAAI,oBAAoB;AACnD,aAAA,YAAY,IAAI;AAAA,QACd,MAAM;AAAA,QACN,OAAO,QAAQ;AAAA,QACf,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,UAAU,WAAW,SAAS;AAAA,MAAA,CAC/B,GAEG,4BACF,YAAY,IAAI;AAAA,QACd,MAAM;AAAA,QACN,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,UAAU,WAAW,SAAS;AAAA,MAAA,CAC/B,GAII,SAAS,UAAU;AAAA,IAC5B;AAAA,EAAA;AAEJ;"}
package/dist/hooks.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/image.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.js","sources":["../src/image/imageLoader.ts","../src/image/Image.tsx"],"sourcesContent":["import type {ImageLoader} from 'next/image'\n\n/**\n * @alpha\n */\nexport const imageLoader = (({src, width, quality}) => {\n const url = new URL(src)\n url.searchParams.set('auto', 'format')\n if (!url.searchParams.has('fit')) {\n url.searchParams.set('fit', url.searchParams.has('h') ? 'min' : 'max')\n }\n if (url.searchParams.has('h') && url.searchParams.has('w')) {\n const originalHeight = parseInt(url.searchParams.get('h')!, 10)\n const originalWidth = parseInt(url.searchParams.get('w')!, 10)\n url.searchParams.set('h', Math.round((originalHeight / originalWidth) * width).toString())\n }\n url.searchParams.set('w', width.toString())\n if (quality) {\n url.searchParams.set('q', quality.toString())\n }\n return url.href\n}) satisfies ImageLoader\n","import NextImage, {type ImageProps as NextImageProps} from 'next/image'\n\nimport {imageLoader} from './imageLoader'\n\n/**\n * @alpha\n */\nexport interface ImageProps extends Omit<NextImageProps, 'loader' | 'src'> {\n /**\n * The `loader` prop is not supported on `Image` components. Use `next/image` directly to use a custom loader.\n */\n loader?: never\n /**\n * Must be a string that is a valid URL to an image on the Sanity Image CDN.\n */\n src: string\n}\n\n/**\n * @alpha\n */\nexport function Image(props: ImageProps): React.JSX.Element {\n const {loader, src, ...rest} = props\n if (loader) {\n throw new TypeError(\n 'The `loader` prop is not supported on `Image` components. Use `next/image` directly to use a custom loader.',\n )\n }\n let srcUrl: URL\n try {\n srcUrl = new URL(src)\n if (props.height) {\n srcUrl.searchParams.set('h', `${props.height}`)\n }\n if (props.width) {\n srcUrl.searchParams.set('w', `${props.width}`)\n }\n } catch (err) {\n throw new TypeError('The `src` prop must be a valid URL to an image on the Sanity Image CDN.', {\n cause: err,\n })\n }\n return <NextImage {...rest} src={srcUrl.toString()} loader={imageLoader} />\n}\n"],"names":[],"mappings":";;;AAKO,MAA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router supported `next/dynamic` imports (it wants `next/dynamic.js`),\n * or if turbopack in app router allowed `next/dynamic.js` (it doesn't yet)\n * we could use `dynamic(() => import('...), {ssr: false})` here.\n * Since we can't, we need to use a lazy import and Suspense ourself.\n */\n\nimport {lazy, Suspense} from 'react'\n\nimport type {NextStudioProps} from './NextStudio'\n\nconst NextStudioClientComponent = lazy(() => import('./NextStudio'))\n\nexport function NextStudioLazyClientComponent(props: NextStudioProps): React.ReactNode {\n return (\n <Suspense fallback={null}>\n <NextStudioClientComponent {...props} />\n </Suspense>\n )\n}\n"],"names":[],"mappings":";;;AAYA,MAAM,4BAA4B,KAAK,MAAM,OAAO,6BAAc,CAAC;AAE5D,SAAS,8BAA8B,OAAyC;AACrF,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,2BAAA,EAA2B,GAAG,OAAO,EAAA,CACxC;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"studio.js","sources":["../src/studio/head.tsx","../src/studio/NextStudioWithBridge.tsx"],"sourcesContent":["import type {Metadata, Viewport} from 'next'\n\n/**\n * In router segments (`/app/studio/[[...index]]/page.tsx`):\n * ```tsx\n * // If you don't want to change any defaults you can just re-export the viewport config directly:\n * export {viewport} from 'next-sanity/studio'\n *\n * // To customize the viewport config, spread it on the export:\n * import {viewport as studioViewport} from 'next-sanity/studio'\n * import type { Viewport } from 'next'\n *\n * export const viewport: Viewport = {\n * ...studioViewport,\n * // Overrides the viewport to resize behavior\n * interactiveWidget: 'resizes-content'\n * })\n * ```\n * @public\n */\nexport const viewport = {\n width: 'device-width' as const,\n initialScale: 1 as const,\n // Studio implements display cutouts CSS (The iPhone Notch ™ ) and needs `viewport-fit=covered` for it to work correctly\n viewportFit: 'cover',\n} satisfies Viewport\n\n/**\n * In router segments (`/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 * // Set another title\n * title: 'My Studio',\n * })\n * ```\n * @public\n */\nexport const metadata = {\n referrer: 'same-origin' as const,\n robots: 'noindex' as const,\n} satisfies Metadata\n","import {NextStudio, type NextStudioProps} from 'next-sanity/studio/client-component'\nimport {preloadModule} from 'react-dom'\n\n/**\n * Loads the bridge script the same way Sanity Studio does:\n * https://github.com/sanity-io/sanity/blob/bd5b1acb5015baaddd8d96c2abd1eaf579b3c904/packages/sanity/src/_internal/cli/server/renderDocument.tsx#L124-L139\n */\n\nconst bridgeScript = 'https://core.sanity-cdn.com/bridge.js'\n\nexport function NextStudioWithBridge(props: NextStudioProps): React.JSX.Element {\n preloadModule(bridgeScript, {as: 'script'})\n\n return (\n <>\n <script src={bridgeScript} async type=\"module\" data-sanity-core />\n <NextStudio {...props} />\n </>\n )\n}\n"],"names":[],"mappings":";;;;AAoBO,MAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,cAAc;AAAA;AAAA,EAEd,aAAa;AACf,GAoBa,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,QAAQ;AACV,GCxCM,eAAe;AAEd,SAAS,qBAAqB,OAA2C;AAC9E,SAAA,cAAc,cAAc,EAAC,IAAI,SAAA,CAAS,GAGxC,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA,oBAAC,UAAA,EAAO,KAAK,cAAc,OAAK,IAAC,MAAK,UAAS,oBAAgB,GAAA,CAAC;AAAA,IAChE,oBAAC,YAAA,EAAY,GAAG,MAAA,CAAO;AAAA,EAAA,GACzB;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-component.js","sources":["../../src/visual-editing/client-component/VisualEditingLazy.tsx"],"sourcesContent":["/**\n *\n * If pages router supported `next/dynamic` imports (it wants `next/dynamic.js`),\n * or if turbopack in app router allowed `next/dynamic.js` (it doesn't yet)\n * we could use `dynamic(() => import('...), {ssr: false})` here.\n * Since we can't, we need to use a lazy import and Suspense ourself.\n */\n\nimport {lazy, Suspense} from 'react'\n\nimport type {VisualEditingProps} from './VisualEditing'\n\nconst VisualEditingClientComponent = lazy(() => import('./VisualEditing'))\n\nexport function VisualEditingLazyClientComponent(props: VisualEditingProps): React.ReactNode {\n return (\n <Suspense fallback={null}>\n <VisualEditingClientComponent {...props} />\n </Suspense>\n )\n}\n"],"names":[],"mappings":";;;AAYA,MAAM,+BAA+B,KAAK,MAAM,OAAO,gCAAiB,CAAC;AAElE,SAAS,iCAAiC,OAA4C;AAC3F,SACE,oBAAC,YAAS,UAAU,MAClB,8BAAC,8BAAA,EAA8B,GAAG,OAAO,EAAA,CAC3C;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-actions.js","sources":["../../src/visual-editing/server-actions/index.ts"],"sourcesContent":["'use server'\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n if (!(await draftMode()).isEnabled) {\n // eslint-disable-next-line no-console\n console.warn('Skipped revalidatePath request because draft mode is not enabled')\n return\n }\n await revalidatePath('/', 'layout')\n}\n"],"names":[],"mappings":";;;AAIA,eAAsB,uBAAsC;AAC1D,MAAI,EAAE,MAAM,UAAA,GAAa,WAAW;AAElC,YAAQ,KAAK,kEAAkE;AAC/E;AAAA,EACF;AACA,QAAM,eAAe,KAAK,QAAQ;AACpC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"visual-editing.js","sources":["../src/visual-editing/VisualEditing.tsx"],"sourcesContent":["import type {VisualEditingProps} from 'next-sanity/visual-editing/client-component'\nimport VisualEditingComponent from 'next-sanity/visual-editing/client-component'\n\n/**\n * @public\n */\nexport function VisualEditing(props: VisualEditingProps): React.ReactElement {\n let autoBasePath: string | undefined\n if (typeof props.basePath !== 'string') {\n try {\n autoBasePath = process.env['__NEXT_ROUTER_BASEPATH']\n if (autoBasePath) {\n // eslint-disable-next-line no-console\n console.log(\n `Detected next basePath as ${JSON.stringify(autoBasePath)} by reading \"process.env.__NEXT_ROUTER_BASEPATH\". If this is incorrect then you can set it manually with the basePath prop on the <VisualEditing /> component.`,\n )\n }\n } catch (err) {\n console.error('Failed detecting basePath', err)\n }\n }\n let autoTrailingSlash: boolean | undefined\n if (typeof props.trailingSlash !== 'boolean') {\n try {\n autoTrailingSlash = Boolean(process.env['__NEXT_TRAILING_SLASH'])\n if (autoTrailingSlash) {\n // eslint-disable-next-line no-console\n console.log(\n `Detected next trailingSlash as ${JSON.stringify(autoTrailingSlash)} by reading \"process.env.__NEXT_TRAILING_SLASH\". If this is incorrect then you can set it manually with the trailingSlash prop on the <VisualEditing /> component.`,\n )\n }\n } catch (err) {\n console.error('Failed detecting trailingSlash', err)\n }\n }\n return (\n <VisualEditingComponent\n {...props}\n basePath={props.basePath ?? autoBasePath}\n trailingSlash={props.trailingSlash ?? autoTrailingSlash}\n />\n )\n}\n\nexport type {VisualEditingProps} from 'next-sanity/visual-editing/client-component'\n"],"names":[],"mappings":";;AAMO,SAAS,cAAc,OAA+C;AAC3E,MAAI;AACJ,MAAI,OAAO,MAAM,YAAa;AAC5B,QAAI;AACF,qBAAe,QAAQ,IAAI,wBACvB,gBAEF,QAAQ;AAAA,QACN,6BAA6B,KAAK,UAAU,YAAY,CAAC;AAAA,MAAA;AAAA,IAG/D,SAAS,KAAK;AACZ,cAAQ,MAAM,6BAA6B,GAAG;AAAA,IAChD;AAEF,MAAI;AACJ,MAAI,OAAO,MAAM,iBAAkB;AACjC,QAAI;AACF,0BAAoB,CAAA,CAAQ,QAAQ,IAAI,uBACpC,qBAEF,QAAQ;AAAA,QACN,kCAAkC,KAAK,UAAU,iBAAiB,CAAC;AAAA,MAAA;AAAA,IAGzE,SAAS,KAAK;AACZ,cAAQ,MAAM,kCAAkC,GAAG;AAAA,IACrD;AAEF,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU,MAAM,YAAY;AAAA,MAC5B,eAAe,MAAM,iBAAiB;AAAA,IAAA;AAAA,EAAA;AAG5C;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhook.js","sources":["../../../node_modules/.pnpm/@sanity+webhook@4.0.4/node_modules/@sanity/webhook/dist/index.mjs","../src/webhook/index.ts"],"sourcesContent":["class WebhookSignatureValueError extends Error {\n type = \"WebhookSignatureValueError\";\n statusCode = 401;\n}\nclass WebhookSignatureFormatError extends Error {\n type = \"WebhookSignatureFormatError\";\n statusCode = 400;\n}\nfunction isSignatureError(error) {\n return typeof error == \"object\" && error !== null && \"type\" in error && [\"WebhookSignatureValueError\", \"WebhookSignatureFormatError\"].includes(\n error.type\n );\n}\nconst MINIMUM_TIMESTAMP = 16094592e5, SIGNATURE_HEADER_REGEX = /^t=(\\d+)[, ]+v1=([^, ]+)$/, SIGNATURE_HEADER_NAME = \"sanity-webhook-signature\";\nasync function assertValidSignature(stringifiedPayload, signature, secret) {\n const { timestamp } = decodeSignatureHeader(signature), encoded = await encodeSignatureHeader(stringifiedPayload, timestamp, secret);\n if (signature !== encoded)\n throw new WebhookSignatureValueError(\"Signature is invalid\");\n}\nasync function isValidSignature(stringifiedPayload, signature, secret) {\n try {\n return await assertValidSignature(stringifiedPayload, signature, secret), !0;\n } catch (err) {\n if (isSignatureError(err))\n return !1;\n throw err;\n }\n}\nasync function assertValidRequest(request, secret) {\n const signature = request.headers[SIGNATURE_HEADER_NAME];\n if (Array.isArray(signature))\n throw new WebhookSignatureFormatError(\"Multiple signature headers received\");\n if (typeof signature != \"string\")\n throw new WebhookSignatureValueError(\"Request contained no signature header\");\n if (typeof request.body > \"u\")\n throw new WebhookSignatureFormatError(\"Request contained no parsed request body\");\n if (typeof request.body == \"string\" || Buffer.isBuffer(request.body))\n await assertValidSignature(request.body.toString(\"utf8\"), signature, secret);\n else\n throw new Error(\n \"[@sanity/webhook] `request.body` was not a string/buffer - this can lead to invalid signatures. See the [migration docs](https://github.com/sanity-io/webhook-toolkit#from-parsed-to-unparsed-body) for details on how to fix this.\"\n );\n}\nasync function isValidRequest(request, secret) {\n try {\n return await assertValidRequest(request, secret), !0;\n } catch (err) {\n if (isSignatureError(err))\n return !1;\n throw err;\n }\n}\nasync function encodeSignatureHeader(stringifiedPayload, timestamp, secret) {\n const signature = await createHS256Signature(stringifiedPayload, timestamp, secret);\n return `t=${timestamp},v1=${signature}`;\n}\nfunction decodeSignatureHeader(signaturePayload) {\n if (!signaturePayload)\n throw new WebhookSignatureFormatError(\"Missing or empty signature header\");\n const [, timestamp, hashedPayload] = signaturePayload.trim().match(SIGNATURE_HEADER_REGEX) || [];\n if (!timestamp || !hashedPayload)\n throw new WebhookSignatureFormatError(\"Invalid signature payload format\");\n return {\n timestamp: parseInt(timestamp, 10),\n hashedPayload\n };\n}\nasync function createHS256Signature(stringifiedPayload, timestamp, secret) {\n if (typeof crypto > \"u\")\n throw new TypeError(\n \"The Web Crypto API is not available in this environment, either polyfill `globalThis.crypto` or downgrade to `@sanity/webhook@3` which uses the Node.js `crypto` module.\"\n );\n if (!secret || typeof secret != \"string\")\n throw new WebhookSignatureFormatError(\"Invalid secret provided\");\n if (!stringifiedPayload)\n throw new WebhookSignatureFormatError(\"Can not create signature for empty payload\");\n if (typeof stringifiedPayload != \"string\")\n throw new WebhookSignatureFormatError(\"Payload must be a JSON-encoded string\");\n if (typeof timestamp != \"number\" || isNaN(timestamp) || timestamp < MINIMUM_TIMESTAMP)\n throw new WebhookSignatureFormatError(\n \"Invalid signature timestamp, must be a unix timestamp with millisecond precision\"\n );\n const enc = new TextEncoder(), key = await crypto.subtle.importKey(\n \"raw\",\n enc.encode(secret),\n { name: \"HMAC\", hash: \"SHA-256\" },\n !1,\n [\"sign\"]\n ), signaturePayload = `${timestamp}.${stringifiedPayload}`, signature = await crypto.subtle.sign(\"HMAC\", key, enc.encode(signaturePayload)), signatureArray = Array.from(new Uint8Array(signature));\n return btoa(String.fromCharCode.apply(null, signatureArray)).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\nfunction requireSignedRequest(options) {\n const parseBody = typeof options.parseBody > \"u\" ? !0 : options.parseBody, respondOnError = typeof options.respondOnError > \"u\" ? !0 : options.respondOnError;\n return async function(request, response, next) {\n try {\n await assertValidRequest(request, options.secret), parseBody && typeof request.body == \"string\" && (request.body = JSON.parse(request.body)), next();\n } catch (err) {\n if (!respondOnError || !isSignatureError(err)) {\n next(err);\n return;\n }\n response.status(err.statusCode).json({ message: err.message });\n }\n };\n}\nexport {\n SIGNATURE_HEADER_NAME,\n WebhookSignatureFormatError,\n WebhookSignatureValueError,\n assertValidRequest,\n assertValidSignature,\n decodeSignatureHeader,\n encodeSignatureHeader,\n isSignatureError,\n isValidRequest,\n isValidSignature,\n requireSignedRequest\n};\n//# sourceMappingURL=index.mjs.map\n","import type {SanityDocument} from '@sanity/types'\nimport {isValidSignature, SIGNATURE_HEADER_NAME} from '@sanity/webhook'\nimport type {NextRequest} from 'next/server'\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 * 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 = 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 ? await isValidSignature(body, signature, secret.trim()) : null\n\n if (validSignature !== false && waitForContentLakeEventualConsistency) {\n await new Promise((resolve) => setTimeout(resolve, 3000))\n }\n\n return {\n body: body.trim() ? JSON.parse(body) : null,\n isValidSignature: validSignature,\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,mCAAmC,MAAM;AAAA,EAC7C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AAkB;AAAA,EAAA;AAEtB;","x_google_ignoreList":[0]}
File without changes
File without changes
File without changes
File without changes
File without changes