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"),r=require("next/headers.js");exports.revalidateRootLayout=async function(){try{if(!r.draftMode().isEnabled)return void console.debug("Skipped revalidatePath request because draft mode is not enabled")}catch(e){if(console.error("Error while checking if Draft Mode is enabled",e),null==e||!e.message.includes("requestAsyncStorage"))return void console.warn("Ignoring")}await e.revalidatePath("/","layout")};//# sourceMappingURL=actions.cjs.map
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 try {\n if (!draftMode().isEnabled) {\n // eslint-disable-next-line no-console\n console.debug('Skipped revalidatePath request because draft mode is not enabled')\n return\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Error while checking if Draft Mode is enabled', err)\n if (!(err as Error)?.message.includes('requestAsyncStorage')) {\n console.warn('Ignoring')\n return\n }\n }\n await revalidatePath('/', 'layout')\n}\n"],"names":["Object","defineProperty","exports","value","cache_js","require","headers_js","revalidateRootLayout","async","draftMode","isEnabled","console","debug","err","error","message","includes","warn","revalidatePath"],"mappings":"0BAOAA,OAAAC,eAAAC,QAAA,aAAA,CAAAC,OAAA,IAAA,IAAAC,EAAAC,QAAA,iBAAAC,EAAAD,QAAA,mBAgBAH,QAAAK,qBAhBAC,iBACM,IACE,IAACC,EAAAA,YAAYC,UAGf,YADAC,QAAQC,MAAM,0EAGTC,GAEP,GAAAF,QAAQG,MAAM,gDAAiDD,GACzD,MAAAA,IAAAA,EAAeE,QAAQC,SAAS,uBAEpC,YADAL,QAAQM,KAAK,WAGjB,OACMC,EAAAA,eAAe,IAAK,SAC5B"}
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 r}from"next/headers.js";async function o(){try{if(!r().isEnabled)return void console.debug("Skipped revalidatePath request because draft mode is not enabled")}catch(e){if(console.error("Error while checking if Draft Mode is enabled",e),null==e||!e.message.includes("requestAsyncStorage"))return void console.warn("Ignoring")}await e("/","layout")}export{o as revalidateRootLayout};//# sourceMappingURL=actions.js.map
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 try {\n if (!draftMode().isEnabled) {\n // eslint-disable-next-line no-console\n console.debug('Skipped revalidatePath request because draft mode is not enabled')\n return\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Error while checking if Draft Mode is enabled', err)\n if (!(err as Error)?.message.includes('requestAsyncStorage')) {\n console.warn('Ignoring')\n return\n }\n }\n await revalidatePath('/', 'layout')\n}\n"],"names":["revalidatePath","draftMode","async","revalidateRootLayout","isEnabled","console","debug","err","error","message","includes","warn"],"mappings":"sCAOAA,MAAA,oCAAAC,MAAA,kBAAAC,eAAsBC,IAChB,IACE,IAACF,IAAYG,UAGf,YADAC,QAAQC,MAAM,0EAGTC,GAEP,GAAAF,QAAQG,MAAM,gDAAiDD,GACzD,MAAAA,IAAAA,EAAeE,QAAQC,SAAS,uBAEpC,YADAL,QAAQM,KAAK,WAGjB,OACMX,EAAe,IAAK,SAC5B"}
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.0",
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.31",
126
- "@sanity/visual-editing": "1.7.0",
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
- try {
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.error('Error while checking if Draft Mode is enabled', err)
18
- if (!(err as Error)?.message.includes('requestAsyncStorage')) {
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
  }