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
@@ -1641,10 +1641,14 @@ const MotionFlex = framerMotion.motion.create(ui.Flex), Preview = React.memo(Rea
|
|
1641
1641
|
perspective,
|
1642
1642
|
viewport,
|
1643
1643
|
vercelProtectionBypass
|
1644
|
-
} = props, previewUrl = React.useMemo(() => {
|
1644
|
+
} = props, [stablePerspective, setStablePerspective] = React.useState(null), urlPerspective = stablePerspective === null ? perspective : stablePerspective, previewUrl = React.useMemo(() => {
|
1645
1645
|
const url = new URL(initialUrl);
|
1646
|
-
return url.searchParams.get(constants.urlSearchParamPreviewPerspective) || url.searchParams.set(constants.urlSearchParamPreviewPerspective,
|
1647
|
-
}, [initialUrl,
|
1646
|
+
return url.searchParams.get(constants.urlSearchParamPreviewPerspective) || url.searchParams.set(constants.urlSearchParamPreviewPerspective, urlPerspective), (vercelProtectionBypass || url.searchParams.get(constants.urlSearchParamVercelProtectionBypass)) && url.searchParams.set(constants.urlSearchParamVercelSetBypassCookie, "samesitenone"), vercelProtectionBypass && !url.searchParams.get(constants.urlSearchParamVercelProtectionBypass) && url.searchParams.set(constants.urlSearchParamVercelProtectionBypass, vercelProtectionBypass), url;
|
1647
|
+
}, [initialUrl, urlPerspective, vercelProtectionBypass]);
|
1648
|
+
React.useEffect(() => {
|
1649
|
+
loadersConnection === "connected" && setStablePerspective((prev) => prev === null ? perspective : prev);
|
1650
|
+
}, [loadersConnection, perspective]);
|
1651
|
+
const {
|
1648
1652
|
t
|
1649
1653
|
} = sanity.useTranslation(presentation.presentationLocaleNamespace), {
|
1650
1654
|
devMode
|