sanity 5.20.1-next.2 → 5.20.1-next.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.
|
@@ -7572,8 +7572,8 @@ declare function useScheduleAction(props: DocumentActionProps): {
|
|
|
7572
7572
|
icon: react.ForwardRefExoticComponent<Omit<react.SVGProps<SVGSVGElement>, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
7573
7573
|
label: string;
|
|
7574
7574
|
title: react.JSX.Element;
|
|
7575
|
-
onHandle?: undefined;
|
|
7576
7575
|
dialog?: undefined;
|
|
7576
|
+
onHandle?: undefined;
|
|
7577
7577
|
} | {
|
|
7578
7578
|
dialog: false | DocumentActionModalDialogProps;
|
|
7579
7579
|
disabled: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "5.20.1-next.
|
|
1
|
+
var version = "5.20.1-next.3+61cc6a162a";
|
|
2
2
|
let buildVersion;
|
|
3
3
|
try {
|
|
4
4
|
buildVersion = process.env.PKG_BUILD_VERSION;
|
|
@@ -7,7 +7,7 @@ try {
|
|
|
7
7
|
try {
|
|
8
8
|
buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
|
|
9
9
|
// and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
|
|
10
|
-
"5.20.1-next.
|
|
10
|
+
"5.20.1-next.3+61cc6a162a";
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
const SANITY_VERSION = buildVersion || `${version}-dev`;
|
package/lib/index.js
CHANGED
|
@@ -4585,6 +4585,24 @@ function createServerKeyValueStore({
|
|
|
4585
4585
|
function createKeyValueStore(options) {
|
|
4586
4586
|
return withLocalStorageSWR(createServerKeyValueStore(options));
|
|
4587
4587
|
}
|
|
4588
|
+
const hasSanityPackageInImportMap = () => !!getSanityImportMapUrl(), getSanityImportMapUrl = () => {
|
|
4589
|
+
if (typeof document > "u" || !("querySelectorAll" in document))
|
|
4590
|
+
return;
|
|
4591
|
+
const importMapEntries = document.querySelectorAll('script[type="importmap"]');
|
|
4592
|
+
let found;
|
|
4593
|
+
return Array.from(importMapEntries).some((entry) => {
|
|
4594
|
+
if (!entry.textContent) return !1;
|
|
4595
|
+
const imports = JSON.parse(entry.textContent).imports || {};
|
|
4596
|
+
return "sanity" in imports ? (found = imports.sanity, !0) : !1;
|
|
4597
|
+
}), found;
|
|
4598
|
+
};
|
|
4599
|
+
function checkIsStaging() {
|
|
4600
|
+
if (typeof __SANITY_STAGING__ < "u" && __SANITY_STAGING__ === !0 || typeof globalThis < "u" && globalThis.__SANITY_STAGING__ === !0)
|
|
4601
|
+
return !0;
|
|
4602
|
+
const importMapUrl = getSanityImportMapUrl();
|
|
4603
|
+
return !!(importMapUrl && importMapUrl.includes("sanity-cdn.work"));
|
|
4604
|
+
}
|
|
4605
|
+
const isStaging = checkIsStaging();
|
|
4588
4606
|
class CorsOriginError extends Error {
|
|
4589
4607
|
constructor({
|
|
4590
4608
|
projectId,
|
|
@@ -4968,7 +4986,7 @@ function _createAuthStore({
|
|
|
4968
4986
|
broadcast,
|
|
4969
4987
|
messages
|
|
4970
4988
|
} = createBroadcastChannel(`dual_mode_auth_${projectId}`), clientFactory = clientFactoryOption ?? createClient, token$ = messages.pipe(startWith(isCookielessCompatibleLoginMethod(loginMethod) ? getToken(projectId) : null)), hostOptions = {};
|
|
4971
|
-
apiHost ? hostOptions.apiHost = apiHost :
|
|
4989
|
+
apiHost ? hostOptions.apiHost = apiHost : isStaging && (hostOptions.apiHost = "https://api.sanity.work");
|
|
4972
4990
|
const state$ = token$.pipe(
|
|
4973
4991
|
// // see above
|
|
4974
4992
|
// debounce(() => firstMessage),
|
|
@@ -50757,7 +50775,7 @@ async function checkStudioManifestExists(studioHostUrl) {
|
|
|
50757
50775
|
return console.error(`Failed to fetch from ${url}`, e), !1;
|
|
50758
50776
|
}
|
|
50759
50777
|
}
|
|
50760
|
-
const
|
|
50778
|
+
const internalUrlSuffix = isStaging ? "studio.sanity.work" : "sanity.studio";
|
|
50761
50779
|
async function fetchStudiosWithUrl(client, projectId, internalSuffix) {
|
|
50762
50780
|
return (await client.request({
|
|
50763
50781
|
method: "GET",
|
|
@@ -82751,17 +82769,7 @@ function ToolNotFoundScreen(props2) {
|
|
|
82751
82769
|
] }) })
|
|
82752
82770
|
] }) }) }) }) }), $[1] = toolName, $[2] = t1) : t1 = $[2], t1;
|
|
82753
82771
|
}
|
|
82754
|
-
const
|
|
82755
|
-
if (typeof document > "u" || !("querySelectorAll" in document))
|
|
82756
|
-
return;
|
|
82757
|
-
const importMapEntries = document.querySelectorAll('script[type="importmap"]');
|
|
82758
|
-
let found;
|
|
82759
|
-
return Array.from(importMapEntries).some((entry) => {
|
|
82760
|
-
if (!entry.textContent) return !1;
|
|
82761
|
-
const imports = JSON.parse(entry.textContent).imports || {};
|
|
82762
|
-
return "sanity" in imports ? (found = imports.sanity, !0) : !1;
|
|
82763
|
-
}), found;
|
|
82764
|
-
}, STUDIO_DSN = "https://8914c8dde7e1ebce191f15af8bf6b7b9@sentry.sanity.io/4507342122123264", IS_EMBEDDED_STUDIO = !("__sanityErrorChannel" in globalScope), DEBUG_ERROR_REPORTING = supportsLocalStorage && !!localStorage.getItem("SANITY_DEBUG_ERROR_REPORTING"), IS_BROWSER = typeof window < "u", clientOptions = {
|
|
82772
|
+
const STUDIO_DSN = "https://8914c8dde7e1ebce191f15af8bf6b7b9@sentry.sanity.io/4507342122123264", IS_EMBEDDED_STUDIO = !("__sanityErrorChannel" in globalScope), DEBUG_ERROR_REPORTING = supportsLocalStorage && !!localStorage.getItem("SANITY_DEBUG_ERROR_REPORTING"), IS_BROWSER = typeof window < "u", clientOptions = {
|
|
82765
82773
|
dsn: STUDIO_DSN,
|
|
82766
82774
|
tunnel: "https://api.sanity.io/vX/intake/tracing",
|
|
82767
82775
|
release: SANITY_VERSION,
|
|
@@ -88234,7 +88242,7 @@ function LiveUserApplicationProvider(t0) {
|
|
|
88234
88242
|
let t4;
|
|
88235
88243
|
return $[7] !== children || $[8] !== contextValue ? (t4 = /* @__PURE__ */ jsx(LiveUserApplicationContext.Provider, { value: contextValue, children }), $[7] = children, $[8] = contextValue, $[9] = t4) : t4 = $[9], t4;
|
|
88236
88244
|
}
|
|
88237
|
-
const
|
|
88245
|
+
const MODULES_URL_VERSION = "v1", MODULES_HOST = isStaging ? "https://sanity-cdn.work" : "https://sanity-cdn.com", MODULES_URL = `${MODULES_HOST}/${MODULES_URL_VERSION}/modules`;
|
|
88238
88246
|
function currentUnixTimestamp() {
|
|
88239
88247
|
return Math.floor(Date.now() / 1e3);
|
|
88240
88248
|
}
|