next-sanity 6.1.2 → 6.1.4
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/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/package.json +3 -3
- package/src/client.ts +2 -3
package/dist/client.cjs
CHANGED
|
@@ -9,7 +9,7 @@ function createClient(config) {
|
|
|
9
9
|
let {
|
|
10
10
|
// eslint-disable-next-line prefer-const, no-process-env
|
|
11
11
|
studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,
|
|
12
|
-
encodeSourceMap =
|
|
12
|
+
encodeSourceMap = false
|
|
13
13
|
} = config;
|
|
14
14
|
if (encodeSourceMap === "auto" && process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
|
|
15
15
|
encodeSourceMap = true;
|
package/dist/client.cjs.map
CHANGED
|
@@ -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 *
|
|
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 * @defaultValue false\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 = 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":";;;;;;;AA+BO;;AACD;AAEFA;AACAC;AACE;;AAGgBA;AACpB;;AAC+B;;AAAsBA;AAAgB;AACvE;"}
|
package/dist/client.js
CHANGED
|
@@ -4,7 +4,7 @@ function createClient(config) {
|
|
|
4
4
|
let {
|
|
5
5
|
// eslint-disable-next-line prefer-const, no-process-env
|
|
6
6
|
studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,
|
|
7
|
-
encodeSourceMap =
|
|
7
|
+
encodeSourceMap = false
|
|
8
8
|
} = config;
|
|
9
9
|
if (encodeSourceMap === "auto" && process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
|
|
10
10
|
encodeSourceMap = true;
|
package/dist/client.js.map
CHANGED
|
@@ -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 *
|
|
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 * @defaultValue false\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 = 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":";;AA+BO;;AACD;AAEFA;AACAC;AACE;;AAGgBA;AACpB;AACA;AAA+B;;AAAsBA;AAAgB;AACvE;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,8 +14,7 @@ export declare interface ClientConfig
|
|
|
14
14
|
*/
|
|
15
15
|
studioUrl?: PreviewKitClientConfig['studioUrl']
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'
|
|
17
|
+
* @defaultValue false
|
|
19
18
|
* @alpha
|
|
20
19
|
*/
|
|
21
20
|
encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
},
|
|
190
190
|
"dependencies": {
|
|
191
191
|
"@sanity/client": "^6.9.1",
|
|
192
|
-
"@sanity/preview-kit": "4.0.
|
|
192
|
+
"@sanity/preview-kit": "4.0.3",
|
|
193
193
|
"@sanity/webhook": "4.0.0",
|
|
194
194
|
"groq": "^3.19"
|
|
195
195
|
},
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"@rollup/plugin-url": "^8.0.2",
|
|
200
200
|
"@sanity/eslint-config-studio": "^3.0.1",
|
|
201
201
|
"@sanity/image-url": "^1.0.2",
|
|
202
|
-
"@sanity/overlays": "2.0.
|
|
202
|
+
"@sanity/overlays": "2.0.4",
|
|
203
203
|
"@sanity/pkg-utils": "^2.4.10",
|
|
204
204
|
"@sanity/ui": "^1.9.3",
|
|
205
205
|
"@sanity/vision": "3.20.2",
|
package/src/client.ts
CHANGED
|
@@ -17,8 +17,7 @@ export interface ClientConfig
|
|
|
17
17
|
*/
|
|
18
18
|
studioUrl?: PreviewKitClientConfig['studioUrl']
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'
|
|
20
|
+
* @defaultValue false
|
|
22
21
|
* @alpha
|
|
23
22
|
*/
|
|
24
23
|
encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']
|
|
@@ -34,7 +33,7 @@ export function createClient(config: ClientConfig): SanityClient {
|
|
|
34
33
|
let {
|
|
35
34
|
// eslint-disable-next-line prefer-const, no-process-env
|
|
36
35
|
studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],
|
|
37
|
-
encodeSourceMap =
|
|
36
|
+
encodeSourceMap = false,
|
|
38
37
|
} = config
|
|
39
38
|
// eslint-disable-next-line no-process-env
|
|
40
39
|
if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
|