sanity 3.71.1 → 3.71.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.
- package/lib/_chunks-cjs/PresentationToolGrantsCheck.js +7 -3
- package/lib/_chunks-cjs/PresentationToolGrantsCheck.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/PresentationToolGrantsCheck.mjs +7 -3
- package/lib/_chunks-es/PresentationToolGrantsCheck.mjs.map +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/PresentationToolGrantsCheck.esm.js +7 -3
- package/lib/_legacy/PresentationToolGrantsCheck.esm.js.map +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +13 -13
- package/src/presentation/preview/Preview.tsx +16 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "sanity",
|
3
|
-
"version": "3.71.
|
3
|
+
"version": "3.71.2",
|
4
4
|
"description": "Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches",
|
5
5
|
"keywords": [
|
6
6
|
"sanity",
|
@@ -159,11 +159,11 @@
|
|
159
159
|
"@rexxars/react-json-inspector": "^9.0.1",
|
160
160
|
"@sanity/asset-utils": "^2.0.6",
|
161
161
|
"@sanity/bifur-client": "^0.4.1",
|
162
|
-
"@sanity/cli": "3.71.
|
162
|
+
"@sanity/cli": "3.71.2",
|
163
163
|
"@sanity/client": "^6.25.0",
|
164
164
|
"@sanity/color": "^3.0.0",
|
165
165
|
"@sanity/comlink": "^3.0.1",
|
166
|
-
"@sanity/diff": "3.71.
|
166
|
+
"@sanity/diff": "3.71.2",
|
167
167
|
"@sanity/diff-match-patch": "^3.1.1",
|
168
168
|
"@sanity/eventsource": "^5.0.0",
|
169
169
|
"@sanity/export": "^3.42.2",
|
@@ -172,15 +172,15 @@
|
|
172
172
|
"@sanity/import": "^3.37.9",
|
173
173
|
"@sanity/insert-menu": "1.0.19",
|
174
174
|
"@sanity/logos": "^2.1.13",
|
175
|
-
"@sanity/migrate": "3.71.
|
176
|
-
"@sanity/mutator": "3.71.
|
175
|
+
"@sanity/migrate": "3.71.2",
|
176
|
+
"@sanity/mutator": "3.71.2",
|
177
177
|
"@sanity/presentation-comlink": "^1.0.0",
|
178
178
|
"@sanity/preview-url-secret": "^2.1.0",
|
179
|
-
"@sanity/schema": "3.71.
|
179
|
+
"@sanity/schema": "3.71.2",
|
180
180
|
"@sanity/telemetry": "^0.7.7",
|
181
|
-
"@sanity/types": "3.71.
|
181
|
+
"@sanity/types": "3.71.2",
|
182
182
|
"@sanity/ui": "^2.11.3",
|
183
|
-
"@sanity/util": "3.71.
|
183
|
+
"@sanity/util": "3.71.2",
|
184
184
|
"@sanity/uuid": "^3.0.2",
|
185
185
|
"@sentry/react": "^8.33.0",
|
186
186
|
"@tanstack/react-table": "^8.16.0",
|
@@ -277,10 +277,10 @@
|
|
277
277
|
"devDependencies": {
|
278
278
|
"@playwright/experimental-ct-react": "1.49.1",
|
279
279
|
"@playwright/test": "1.49.1",
|
280
|
-
"@repo/dev-aliases": "3.71.
|
281
|
-
"@repo/package.config": "3.71.
|
282
|
-
"@repo/test-config": "3.71.
|
283
|
-
"@sanity/codegen": "3.71.
|
280
|
+
"@repo/dev-aliases": "3.71.2",
|
281
|
+
"@repo/package.config": "3.71.2",
|
282
|
+
"@repo/test-config": "3.71.2",
|
283
|
+
"@sanity/codegen": "3.71.2",
|
284
284
|
"@sanity/generate-help-url": "^3.0.0",
|
285
285
|
"@sanity/pkg-utils": "6.13.4",
|
286
286
|
"@sanity/tsdoc": "1.0.169",
|
@@ -324,5 +324,5 @@
|
|
324
324
|
"engines": {
|
325
325
|
"node": ">=18"
|
326
326
|
},
|
327
|
-
"gitHead": "
|
327
|
+
"gitHead": "9c03455253947339a05da4e1e106b67991023e4c"
|
328
328
|
}
|
@@ -82,11 +82,13 @@ export const Preview = memo(
|
|
82
82
|
vercelProtectionBypass,
|
83
83
|
} = props
|
84
84
|
|
85
|
+
const [stablePerspective, setStablePerspective] = useState<typeof perspective | null>(null)
|
86
|
+
const urlPerspective = stablePerspective === null ? perspective : stablePerspective
|
85
87
|
const previewUrl = useMemo(() => {
|
86
88
|
const url = new URL(initialUrl)
|
87
89
|
// Always set the perspective that's being used, even if preview mode isn't configured
|
88
90
|
if (!url.searchParams.get(urlSearchParamPreviewPerspective)) {
|
89
|
-
url.searchParams.set(urlSearchParamPreviewPerspective,
|
91
|
+
url.searchParams.set(urlSearchParamPreviewPerspective, urlPerspective)
|
90
92
|
}
|
91
93
|
|
92
94
|
if (vercelProtectionBypass || url.searchParams.get(urlSearchParamVercelProtectionBypass)) {
|
@@ -102,7 +104,19 @@ export const Preview = memo(
|
|
102
104
|
}
|
103
105
|
|
104
106
|
return url
|
105
|
-
}, [initialUrl,
|
107
|
+
}, [initialUrl, urlPerspective, vercelProtectionBypass])
|
108
|
+
|
109
|
+
useEffect(() => {
|
110
|
+
/**
|
111
|
+
* If the preview iframe is connected to the loader, we know that switching the perspective can be done without reloading the iframe.
|
112
|
+
*/
|
113
|
+
if (loadersConnection === 'connected') {
|
114
|
+
/**
|
115
|
+
* Only set the stable perspective if it hasn't been set yet.
|
116
|
+
*/
|
117
|
+
setStablePerspective((prev) => (prev === null ? perspective : prev))
|
118
|
+
}
|
119
|
+
}, [loadersConnection, perspective])
|
106
120
|
|
107
121
|
const {t} = useTranslation(presentationLocaleNamespace)
|
108
122
|
const {devMode} = usePresentationTool()
|