next-sanity 9.10.6 → 9.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/studio.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var NextStudioNoScript = require("./_chunks-cjs/NextStudioNoScript.cjs"), clientComponent = require("next-sanity/studio/client-component");
3
+ var NextStudioNoScript = require("./_chunks-cjs/NextStudioNoScript.cjs"), jsxRuntime = require("react/jsx-runtime"), clientComponent = require("next-sanity/studio/client-component"), reactDom = require("react-dom");
4
4
  const viewport = {
5
5
  width: "device-width",
6
6
  initialScale: 1,
@@ -9,15 +9,16 @@ const viewport = {
9
9
  }, metadata = {
10
10
  referrer: "same-origin",
11
11
  robots: "noindex"
12
- };
12
+ }, bridgeScript = "https://core.sanity-cdn.com/bridge.js";
13
+ function NextStudioWithBridge(props) {
14
+ return reactDom.preloadModule(bridgeScript, { as: "script" }), /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx("script", { src: bridgeScript, async: !0, type: "module", "data-sanity-core": !0 }),
16
+ /* @__PURE__ */ jsxRuntime.jsx(clientComponent.NextStudio, { ...props })
17
+ ] });
18
+ }
13
19
  exports.NextStudioLayout = NextStudioNoScript.NextStudioLayout;
14
20
  exports.NextStudioNoScript = NextStudioNoScript.NextStudioNoScript;
15
- Object.defineProperty(exports, "NextStudio", {
16
- enumerable: !0,
17
- get: function() {
18
- return clientComponent.NextStudio;
19
- }
20
- });
21
+ exports.NextStudio = NextStudioWithBridge;
21
22
  exports.metadata = metadata;
22
23
  exports.viewport = viewport;
23
24
  //# sourceMappingURL=studio.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"studio.cjs","sources":["../src/studio/head.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"],"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;;;;;;;;;;;"}
1
+ {"version":3,"file":"studio.cjs","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":["preloadModule","jsxs","Fragment","jsx","NextStudio"],"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,SAAAA,SAAA,cAAc,cAAc,EAAC,IAAI,SAAS,CAAA,GAItCC,2BAAA,KAAAC,qBAAA,EAAA,UAAA;AAAA,IAACC,2BAAAA,IAAA,UAAA,EAAO,KAAK,cAAc,OAAK,IAAC,MAAK,UAAS,oBAAgB,GAAC,CAAA;AAAA,IAChEA,+BAACC,gBAAAA,YAAY,EAAA,GAAG,MAAO,CAAA;AAAA,EAAA,GACzB;AAEJ;;;;;;"}
package/dist/studio.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import {JSX} from 'react'
2
2
  import {MemoExoticComponent} from 'react'
3
- import {NextStudio} from 'next-sanity/studio/client-component'
4
3
  import {NextStudioProps} from 'next-sanity/studio/client-component'
5
4
 
6
5
  /**
@@ -26,7 +25,7 @@ export declare const metadata: {
26
25
  robots: 'noindex'
27
26
  }
28
27
 
29
- export {NextStudio}
28
+ export declare function NextStudio(props: NextStudioProps): React.JSX.Element
30
29
 
31
30
  /** @public */
32
31
  export declare const NextStudioLayout: MemoExoticComponent<
package/dist/studio.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import {JSX} from 'react'
2
2
  import {MemoExoticComponent} from 'react'
3
- import {NextStudio} from 'next-sanity/studio/client-component'
4
3
  import {NextStudioProps} from 'next-sanity/studio/client-component'
5
4
 
6
5
  /**
@@ -26,7 +25,7 @@ export declare const metadata: {
26
25
  robots: 'noindex'
27
26
  }
28
27
 
29
- export {NextStudio}
28
+ export declare function NextStudio(props: NextStudioProps): React.JSX.Element
30
29
 
31
30
  /** @public */
32
31
  export declare const NextStudioLayout: MemoExoticComponent<
package/dist/studio.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { NextStudioLayout, NextStudioNoScript } from "./_chunks-es/NextStudioNoScript.js";
2
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
3
  import { NextStudio } from "next-sanity/studio/client-component";
4
+ import { preloadModule } from "react-dom";
3
5
  const viewport = {
4
6
  width: "device-width",
5
7
  initialScale: 1,
@@ -8,9 +10,15 @@ const viewport = {
8
10
  }, metadata = {
9
11
  referrer: "same-origin",
10
12
  robots: "noindex"
11
- };
13
+ }, bridgeScript = "https://core.sanity-cdn.com/bridge.js";
14
+ function NextStudioWithBridge(props) {
15
+ return preloadModule(bridgeScript, { as: "script" }), /* @__PURE__ */ jsxs(Fragment, { children: [
16
+ /* @__PURE__ */ jsx("script", { src: bridgeScript, async: !0, type: "module", "data-sanity-core": !0 }),
17
+ /* @__PURE__ */ jsx(NextStudio, { ...props })
18
+ ] });
19
+ }
12
20
  export {
13
- NextStudio,
21
+ NextStudioWithBridge as NextStudio,
14
22
  NextStudioLayout,
15
23
  NextStudioNoScript,
16
24
  metadata,
@@ -1 +1 @@
1
- {"version":3,"file":"studio.js","sources":["../src/studio/head.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"],"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;"}
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,SAAS,CAAA,GAItC,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAC,oBAAA,UAAA,EAAO,KAAK,cAAc,OAAK,IAAC,MAAK,UAAS,oBAAgB,GAAC,CAAA;AAAA,IAChE,oBAAC,YAAY,EAAA,GAAG,MAAO,CAAA;AAAA,EAAA,GACzB;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-sanity",
3
- "version": "9.10.6",
3
+ "version": "9.11.0",
4
4
  "description": "Sanity.io toolkit for Next.js",
5
5
  "keywords": [
6
6
  "sanity",
@@ -140,10 +140,10 @@
140
140
  "@portabletext/react": "^3.2.1",
141
141
  "@sanity/client": "^7.0.0",
142
142
  "@sanity/next-loader": "^1.5.2",
143
- "@sanity/preview-kit": "^6.0.12",
143
+ "@sanity/preview-kit": "^6.1.0",
144
144
  "@sanity/preview-url-secret": "^2.1.10",
145
145
  "@sanity/visual-editing": "^2.13.20",
146
- "groq": "^3.87.0",
146
+ "groq": "^3.88.0",
147
147
  "history": "^5.3.0"
148
148
  },
149
149
  "devDependencies": {
@@ -174,11 +174,12 @@
174
174
  "peerDependencies": {
175
175
  "@sanity/client": "^7.0.0",
176
176
  "@sanity/icons": "^3.7.0",
177
- "@sanity/types": "^3.87.0",
177
+ "@sanity/types": "^3.88.0",
178
178
  "@sanity/ui": "^2.15.14",
179
179
  "next": "^14.2 || ^15.0.0-0",
180
180
  "react": "^18.3 || ^19.0.0-0",
181
- "sanity": "^3.87.0",
181
+ "react-dom": "^18.3 || ^19.0.0-0",
182
+ "sanity": "^3.88.0",
182
183
  "styled-components": "^6.1"
183
184
  },
184
185
  "engines": {
@@ -0,0 +1,20 @@
1
+ import {NextStudio, type NextStudioProps} from 'next-sanity/studio/client-component'
2
+ import {preloadModule} from 'react-dom'
3
+
4
+ /**
5
+ * Loads the bridge script the same way Sanity Studio does:
6
+ * https://github.com/sanity-io/sanity/blob/bd5b1acb5015baaddd8d96c2abd1eaf579b3c904/packages/sanity/src/_internal/cli/server/renderDocument.tsx#L124-L139
7
+ */
8
+
9
+ const bridgeScript = 'https://core.sanity-cdn.com/bridge.js'
10
+
11
+ export function NextStudioWithBridge(props: NextStudioProps): React.JSX.Element {
12
+ preloadModule(bridgeScript, {as: 'script'})
13
+
14
+ return (
15
+ <>
16
+ <script src={bridgeScript} async type="module" data-sanity-core />
17
+ <NextStudio {...props} />
18
+ </>
19
+ )
20
+ }
@@ -1,4 +1,5 @@
1
1
  export {metadata, viewport} from './head'
2
2
  export * from './NextStudioLayout'
3
3
  export * from './NextStudioNoScript'
4
- export {NextStudio, type NextStudioProps} from 'next-sanity/studio/client-component'
4
+ export {NextStudioWithBridge as NextStudio} from './NextStudioWithBridge'
5
+ export {type NextStudioProps} from 'next-sanity/studio/client-component'