next-sanity 8.1.2 → 8.1.3
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/NextStudioNoScript.cjs +1 -1
- package/dist/studio/NextStudioNoScript.cjs.map +1 -1
- package/dist/studio/NextStudioNoScript.js +1 -1
- package/dist/studio/NextStudioNoScript.js.map +1 -1
- package/dist/studio/registry.cjs +1 -1
- package/dist/studio/registry.cjs.map +1 -1
- package/dist/studio/registry.js +1 -1
- package/dist/studio/registry.js.map +1 -1
- package/package.json +3 -3
- package/src/studio/NextStudioNoScript.tsx +21 -28
- package/src/studio/registry.tsx +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");exports.NextStudioNoScript=()=>e.jsx("noscript",{children:e.jsx("div",{style:{position:"absolute",top:0,right:0,left:0,bottom:0,background:"#fff",zIndex:1},children:e.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",fontFamily:"helvetica, arial, sans-serif"},children:[e.jsx("h1",{children:"JavaScript disabled"}),e.jsxs("p",{children:["Please ",e.jsx("a",{href:"https://www.enable-javascript.com/",children:"enable JavaScript"})," in your browser and reload the page to proceed."]})]})})});//# sourceMappingURL=NextStudioNoScript.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioNoScript.cjs","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NextStudioNoScript.cjs","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/** @internal */\nexport const NextStudioNoScript = (): JSX.Element => (\n <noscript>\n <div\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n background: '#fff',\n zIndex: 1,\n }}\n >\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n textAlign: 'center',\n fontFamily: 'helvetica, arial, sans-serif',\n }}\n >\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n"],"names":["exports","NextStudioNoScript","jsx","children","jsxRuntime","style","position","top","right","left","bottom","background","zIndex","jsxs","transform","textAlign","fontFamily","href"],"mappings":"uGA+BEA,QAAAC,mBA9BgC,IAChCC,EAAAA,IAAC,WACC,CAAAC,SAAAC,EAAAF,IAAC,MAAA,CACCG,MAAO,CACLC,SAAU,WACVC,IAAK,EACLC,MAAO,EACPC,KAAM,EACNC,OAAQ,EACRC,WAAY,OACZC,OAAQ,GAGVT,SAAAC,EAAAS,KAAC,MAAA,CACCR,MAAO,CACLC,SAAU,WACVC,IAAK,MACLE,KAAM,MACNK,UAAW,wBACXC,UAAW,SACXC,WAAY,gCAGdb,SAAA,GAAAD,IAAC,MAAGC,SAAmB,+BACtB,IAAE,CAAAA,SAAA,CAAA,UACOD,EAAAA,IAAA,IAAA,CAAEe,KAAK,qCAAqCd,SAAiB,sBAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";const r=()=>e("noscript",{children:e("div",{style:{position:"absolute",top:0,right:0,left:0,bottom:0,background:"#fff",zIndex:1},children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",fontFamily:"helvetica, arial, sans-serif"},children:[e("h1",{children:"JavaScript disabled"}),t("p",{children:["Please ",e("a",{href:"https://www.enable-javascript.com/",children:"enable JavaScript"})," in your browser and reload the page to proceed."]})]})})});export{r as NextStudioNoScript};//# sourceMappingURL=NextStudioNoScript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioNoScript.js","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NextStudioNoScript.js","sources":["../../src/studio/NextStudioNoScript.tsx"],"sourcesContent":["/** @internal */\nexport const NextStudioNoScript = (): JSX.Element => (\n <noscript>\n <div\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n bottom: 0,\n background: '#fff',\n zIndex: 1,\n }}\n >\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n textAlign: 'center',\n fontFamily: 'helvetica, arial, sans-serif',\n }}\n >\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n"],"names":["NextStudioNoScript","jsx","children","style","position","top","right","left","bottom","background","zIndex","jsxs","transform","textAlign","fontFamily","href"],"mappings":"kDACa,MAAAA,EAAqB,IAC/BC,EAAA,WACC,CAAAC,SAAAD,EAAC,MAAA,CACCE,MAAO,CACLC,SAAU,WACVC,IAAK,EACLC,MAAO,EACPC,KAAM,EACNC,OAAQ,EACRC,WAAY,OACZC,OAAQ,GAGVR,SAAAS,EAAC,MAAA,CACCR,MAAO,CACLC,SAAU,WACVC,IAAK,MACLE,KAAM,MACNK,UAAW,wBACXC,UAAW,SACXC,WAAY,gCAGdZ,SAAA,CAACD,EAAA,MAAGC,SAAmB,0BACtB,IAAE,CAAAA,SAAA,CAAA,YACO,IAAA,CAAEa,KAAK,qCAAqCb,SAAiB,sBAAI"}
|
package/dist/studio/registry.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("next/navigation.js"),r=require("react"),n=require("styled-components");exports.StyledComponentsRegistry=function({children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("next/navigation.js"),r=require("react"),n=require("styled-components");const s=()=>()=>{};exports.StyledComponentsRegistry=function({children:c}){const[i]=r.useState((()=>new n.ServerStyleSheet));return t.useServerInsertedHTML((()=>{const t=i.getStyleElement();return i.instance.clearTag(),e.jsx(e.Fragment,{children:t})})),r.useSyncExternalStore(s,(()=>!0),(()=>!1))?e.jsx(e.Fragment,{children:c}):e.jsx(n.StyleSheetManager,{sheet:i.instance,children:c})};//# sourceMappingURL=registry.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.cjs","sources":["../../src/studio/registry.tsx"],"sourcesContent":["// https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\nimport {useServerInsertedHTML} from 'next/navigation.js'\nimport {useState} from 'react'\nimport {ServerStyleSheet, StyleSheetManager} from 'styled-components'\n\nexport function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet())\n\n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement()\n styledComponentsStyleSheet.instance.clearTag()\n return <>{styles}</>\n })\n\n
|
|
1
|
+
{"version":3,"file":"registry.cjs","sources":["../../src/studio/registry.tsx"],"sourcesContent":["// https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\nimport {useServerInsertedHTML} from 'next/navigation.js'\nimport {useState, useSyncExternalStore} from 'react'\nimport {ServerStyleSheet, StyleSheetManager} from 'styled-components'\n\nexport function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet())\n\n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement()\n styledComponentsStyleSheet.instance.clearTag()\n return <>{styles}</>\n })\n\n const isMounted = useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n if (isMounted) return <>{children}</>\n\n return (\n <StyleSheetManager sheet={styledComponentsStyleSheet.instance}>{children}</StyleSheetManager>\n )\n}\n// eslint-disable-next-line no-empty-function\nconst subscribe = () => () => {}\n"],"names":["Object","defineProperty","exports","value","jsxRuntime","require","navigation_js","react","styledComponents","subscribe","StyledComponentsRegistry","children","styledComponentsStyleSheet","useState","ServerStyleSheet","useServerInsertedHTML","styles","getStyleElement","instance","clearTag","jsx","Fragment","useSyncExternalStore","StyleSheetManager","sheet"],"mappings":"aAKgBA,OAAAC,eAAAC,QAAA,aAAA,CAAAC,OAAA,IAAA,IAAAC,EAAAC,QAAA,qBAAAC,EAAAD,QAAA,sBAAAE,EAAAF,QAAA,SAAAG,EAAAH,QAAA,qBAuBhB,MAAMI,EAAY,IAAM,OAAOP,QAAAQ,yBAvBf,UAAyBC,SAACA,IAGlC,MAACC,GAA8BC,EAAAA,UAAS,IAAM,IAAIC,EAAAA,mBAExDC,OAAAA,yBAAsB,KACd,MAAAC,EAASJ,EAA2BK,kBAC1C,OAAAL,EAA2BM,SAASC,WAC7BC,EAAAA,IAAAC,EAAAA,SAAA,CAAGV,SAAOK,GAAA,IAGDM,EAAAA,qBAChBb,GACA,KAAM,IACN,KAAM,sBAEiBE,mBAGtBY,oBAAkB,CAAAC,MAAOZ,EAA2BM,SAAWP,YAEpE"}
|
package/dist/studio/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useServerInsertedHTML as n}from"next/navigation.js";import{useState as r,useSyncExternalStore as o}from"react";import{ServerStyleSheet as c,StyleSheetManager as i}from"styled-components";function m({children:m}){const[a]=r((()=>new c));return n((()=>{const n=a.getStyleElement();return a.instance.clearTag(),t(e,{children:n})})),o(s,(()=>!0),(()=>!1))?t(e,{children:m}):t(i,{sheet:a.instance,children:m})}const s=()=>()=>{};export{m as StyledComponentsRegistry};//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sources":["../../src/studio/registry.tsx"],"sourcesContent":["// https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\nimport {useServerInsertedHTML} from 'next/navigation.js'\nimport {useState} from 'react'\nimport {ServerStyleSheet, StyleSheetManager} from 'styled-components'\n\nexport function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet())\n\n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement()\n styledComponentsStyleSheet.instance.clearTag()\n return <>{styles}</>\n })\n\n
|
|
1
|
+
{"version":3,"file":"registry.js","sources":["../../src/studio/registry.tsx"],"sourcesContent":["// https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components\nimport {useServerInsertedHTML} from 'next/navigation.js'\nimport {useState, useSyncExternalStore} from 'react'\nimport {ServerStyleSheet, StyleSheetManager} from 'styled-components'\n\nexport function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet())\n\n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement()\n styledComponentsStyleSheet.instance.clearTag()\n return <>{styles}</>\n })\n\n const isMounted = useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n if (isMounted) return <>{children}</>\n\n return (\n <StyleSheetManager sheet={styledComponentsStyleSheet.instance}>{children}</StyleSheetManager>\n )\n}\n// eslint-disable-next-line no-empty-function\nconst subscribe = () => () => {}\n"],"names":["jsx","Fragment","useServerInsertedHTML","useState","useSyncExternalStore","ServerStyleSheet","StyleSheetManager","StyledComponentsRegistry","children","styledComponentsStyleSheet","styles","getStyleElement","instance","clearTag","subscribe","sheet"],"mappings":"cAKgBA,cAAAC,MAAA,oDAAAC,MAAA,wCAAAC,0BAAAC,MAAA,mCAAAC,uBAAAC,MAAA,oBAAA,SAAAC,GAAyBC,SAACA,IAGxC,MAAOC,GAA8BN,GAAS,IAAM,IAAIE,IAaxD,OAXAH,GAAsB,KACd,MAAAQ,EAASD,EAA2BE,kBAC1C,OAAAF,EAA2BG,SAASC,aAC7BZ,EAAA,CAAGO,SAAOE,GAAA,IAGDN,EAChBU,GACA,KAAM,IACN,KAAM,SAEiBN,aAGtBR,EAAAM,EAAkB,CAAAS,MAAON,EAA2BG,SAAWJ,YAEpE,CAEA,MAAMM,EAAY,IAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
],
|
|
138
138
|
"browserslist": "extends @sanity/browserslist-config",
|
|
139
139
|
"dependencies": {
|
|
140
|
-
"@sanity/client": "^6.15.
|
|
140
|
+
"@sanity/client": "^6.15.1",
|
|
141
141
|
"@sanity/preview-kit": "5.0.27",
|
|
142
142
|
"@sanity/visual-editing": "1.5.2",
|
|
143
143
|
"@sanity/webhook": "4.0.2-bc",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"vitest-github-actions-reporter": "^0.11.1"
|
|
167
167
|
},
|
|
168
168
|
"peerDependencies": {
|
|
169
|
-
"@sanity/client": "^6.15.
|
|
169
|
+
"@sanity/client": "^6.15.1",
|
|
170
170
|
"@sanity/icons": "^2.8",
|
|
171
171
|
"@sanity/types": "^3.25",
|
|
172
172
|
"@sanity/ui": "^1.8 || ^2.0.0-beta || ^2.0",
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
/* eslint-disable react/no-danger */
|
|
2
|
-
|
|
3
|
-
const style = {
|
|
4
|
-
__html: `
|
|
5
|
-
.sanity-app-no-js__root {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
right: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
background: #fff;
|
|
12
|
-
z-index: 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sanity-app-no-js__content {
|
|
16
|
-
position: absolute;
|
|
17
|
-
top: 50%;
|
|
18
|
-
left: 50%;
|
|
19
|
-
transform: translate(-50%, -50%);
|
|
20
|
-
text-align: center;
|
|
21
|
-
font-family: helvetica, arial, sans-serif;
|
|
22
|
-
}
|
|
23
|
-
`,
|
|
24
|
-
} as const
|
|
25
|
-
|
|
26
1
|
/** @internal */
|
|
27
2
|
export const NextStudioNoScript = (): JSX.Element => (
|
|
28
3
|
<noscript>
|
|
29
|
-
<div
|
|
30
|
-
|
|
31
|
-
|
|
4
|
+
<div
|
|
5
|
+
style={{
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
top: 0,
|
|
8
|
+
right: 0,
|
|
9
|
+
left: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
background: '#fff',
|
|
12
|
+
zIndex: 1,
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
style={{
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
top: '50%',
|
|
19
|
+
left: '50%',
|
|
20
|
+
transform: 'translate(-50%, -50%)',
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
fontFamily: 'helvetica, arial, sans-serif',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
32
25
|
<h1>JavaScript disabled</h1>
|
|
33
26
|
<p>
|
|
34
27
|
Please <a href="https://www.enable-javascript.com/">enable JavaScript</a> in your
|
package/src/studio/registry.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// https://nextjs.org/docs/app/building-your-application/styling/css-in-js#styled-components
|
|
2
2
|
import {useServerInsertedHTML} from 'next/navigation.js'
|
|
3
|
-
import {useState} from 'react'
|
|
3
|
+
import {useState, useSyncExternalStore} from 'react'
|
|
4
4
|
import {ServerStyleSheet, StyleSheetManager} from 'styled-components'
|
|
5
5
|
|
|
6
6
|
export function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element {
|
|
@@ -14,9 +14,16 @@ export function StyledComponentsRegistry({children}: {children: React.ReactNode}
|
|
|
14
14
|
return <>{styles}</>
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const isMounted = useSyncExternalStore(
|
|
18
|
+
subscribe,
|
|
19
|
+
() => true,
|
|
20
|
+
() => false,
|
|
21
|
+
)
|
|
22
|
+
if (isMounted) return <>{children}</>
|
|
18
23
|
|
|
19
24
|
return (
|
|
20
25
|
<StyleSheetManager sheet={styledComponentsStyleSheet.instance}>{children}</StyleSheetManager>
|
|
21
26
|
)
|
|
22
27
|
}
|
|
28
|
+
// eslint-disable-next-line no-empty-function
|
|
29
|
+
const subscribe = () => () => {}
|