next-sanity 8.3.0 → 8.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/cache.js"),
|
|
1
|
+
"use server";"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/cache.js"),a=require("next/headers.js");exports.revalidateRootLayout=async function(){a.draftMode().isEnabled?await e.revalidatePath("/","layout"):console.warn("Skipped revalidatePath request because draft mode is not enabled")};//# sourceMappingURL=actions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.cjs","sources":["../../src/visual-editing/actions.ts"],"sourcesContent":["'use server'\n/**\n * The code in this file will be ported to `next-sanity`\n */\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n
|
|
1
|
+
{"version":3,"file":"actions.cjs","sources":["../../src/visual-editing/actions.ts"],"sourcesContent":["'use server'\n/**\n * The code in this file will be ported to `next-sanity`\n */\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n if (!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":["Object","defineProperty","exports","value","cache_js","require","headers_js","revalidateRootLayout","async","draftMode","isEnabled","revalidatePath","console","warn"],"mappings":"0BAOAA,OAAAC,eAAAC,QAAA,aAAA,CAAAC,OAAA,IAAA,IAAAC,EAAAC,QAAA,iBAAAC,EAAAD,QAAA,mBAOAH,QAAAK,qBAPAC,iBACOC,EAAAA,YAAYC,gBAKXC,EAAAA,eAAe,IAAK,UAHxBC,QAAQC,KAAK,mEAIjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";import{revalidatePath as e}from"next/cache.js";import{draftMode as
|
|
1
|
+
"use server";import{revalidatePath as e}from"next/cache.js";import{draftMode as a}from"next/headers.js";async function t(){a().isEnabled?await e("/","layout"):console.warn("Skipped revalidatePath request because draft mode is not enabled")}export{t as revalidateRootLayout};//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../src/visual-editing/actions.ts"],"sourcesContent":["'use server'\n/**\n * The code in this file will be ported to `next-sanity`\n */\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../src/visual-editing/actions.ts"],"sourcesContent":["'use server'\n/**\n * The code in this file will be ported to `next-sanity`\n */\nimport {revalidatePath} from 'next/cache.js'\nimport {draftMode} from 'next/headers.js'\n\nexport async function revalidateRootLayout(): Promise<void> {\n if (!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":["revalidatePath","draftMode","async","revalidateRootLayout","isEnabled","console","warn"],"mappings":"sCAOAA,MAAA,oCAAAC,MAAA,kBAAAC,eAAsBC,IACfF,IAAYG,gBAKXJ,EAAe,IAAK,UAHxBK,QAAQC,KAAK,mEAIjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
"@portabletext/react": "^3.0.11",
|
|
123
123
|
"@portabletext/types": "^2.0.8",
|
|
124
124
|
"@sanity/client": "^6.15.3",
|
|
125
|
-
"@sanity/preview-kit": "5.0.
|
|
126
|
-
"@sanity/visual-editing": "1.7.
|
|
125
|
+
"@sanity/preview-kit": "5.0.32",
|
|
126
|
+
"@sanity/visual-editing": "1.7.1",
|
|
127
127
|
"@sanity/webhook": "4.0.2-bc",
|
|
128
128
|
"groq": "^3.19"
|
|
129
129
|
},
|
|
@@ -6,19 +6,10 @@ import {revalidatePath} from 'next/cache.js'
|
|
|
6
6
|
import {draftMode} from 'next/headers.js'
|
|
7
7
|
|
|
8
8
|
export async function revalidateRootLayout(): Promise<void> {
|
|
9
|
-
|
|
10
|
-
if (!draftMode().isEnabled) {
|
|
11
|
-
// eslint-disable-next-line no-console
|
|
12
|
-
console.debug('Skipped revalidatePath request because draft mode is not enabled')
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
} catch (err) {
|
|
9
|
+
if (!draftMode().isEnabled) {
|
|
16
10
|
// eslint-disable-next-line no-console
|
|
17
|
-
console.
|
|
18
|
-
|
|
19
|
-
console.warn('Ignoring')
|
|
20
|
-
return
|
|
21
|
-
}
|
|
11
|
+
console.warn('Skipped revalidatePath request because draft mode is not enabled')
|
|
12
|
+
return
|
|
22
13
|
}
|
|
23
14
|
await revalidatePath('/', 'layout')
|
|
24
15
|
}
|