sanity 5.26.0-next.8 → 5.26.0-next.9
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-es/version.js +2 -2
- package/lib/index.js +89 -58
- package/lib/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "5.26.0-next.
|
|
1
|
+
var version = "5.26.0-next.9";
|
|
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.26.0-next.
|
|
10
|
+
"5.26.0-next.9";
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
const SANITY_VERSION = buildVersion || `${version}-dev`;
|
package/lib/index.js
CHANGED
|
@@ -85135,6 +85135,29 @@ function StudioErrorBoundary(props2) {
|
|
|
85135
85135
|
let t3;
|
|
85136
85136
|
return $[16] !== caughtError.error || $[17] !== caughtError.eventId || $[18] !== heading ? (t3 = /* @__PURE__ */ jsx(FallbackErrorScreen, { heading, error: caughtError.error, eventId: caughtError.eventId, onReset: handleResetError }), $[16] = caughtError.error, $[17] = caughtError.eventId, $[18] = heading, $[19] = t3) : t3 = $[19], t3;
|
|
85137
85137
|
}
|
|
85138
|
+
const StudioToolMountTimeMeasured = defineEvent({
|
|
85139
|
+
name: "Studio Tool Mount Time Measured",
|
|
85140
|
+
version: 1,
|
|
85141
|
+
description: "Time from a tool being selected to its component rendering its first effect (i.e. first paint after Suspense resolves the lazy chunk)."
|
|
85142
|
+
}), mountedTools = /* @__PURE__ */ new Set();
|
|
85143
|
+
function ToolMountTimer(t0) {
|
|
85144
|
+
const $ = c(5), {
|
|
85145
|
+
toolName,
|
|
85146
|
+
t0Ref
|
|
85147
|
+
} = t0, telemetry = useTelemetry();
|
|
85148
|
+
let t1, t2;
|
|
85149
|
+
return $[0] !== t0Ref || $[1] !== telemetry || $[2] !== toolName ? (t1 = () => {
|
|
85150
|
+
const t0$0 = t0Ref.current;
|
|
85151
|
+
if (t0$0 === null)
|
|
85152
|
+
return;
|
|
85153
|
+
const isFirstMount = !mountedTools.has(toolName);
|
|
85154
|
+
mountedTools.add(toolName), telemetry.log(StudioToolMountTimeMeasured, {
|
|
85155
|
+
toolName,
|
|
85156
|
+
durationMs: performance.now() - t0$0,
|
|
85157
|
+
isFirstMount
|
|
85158
|
+
});
|
|
85159
|
+
}, t2 = [telemetry, toolName, t0Ref], $[0] = t0Ref, $[1] = telemetry, $[2] = toolName, $[3] = t1, $[4] = t2) : (t1 = $[3], t2 = $[4]), useEffect(t1, t2), null;
|
|
85160
|
+
}
|
|
85138
85161
|
const DetectViteDevServerStopped = lazy(() => import("./_chunks-es/ViteDevServerStopped.js").then((DevServerStopped) => ({
|
|
85139
85162
|
default: DevServerStopped.DetectViteDevServerStopped
|
|
85140
85163
|
}))), detectViteDevServerStopped = import.meta.hot && process.env.NODE_ENV === "development", SearchFullscreenPortalCard = styled(Card).withConfig({
|
|
@@ -85148,7 +85171,7 @@ function StudioLayout() {
|
|
|
85148
85171
|
return $[0] !== Layout2 ? (t0 = /* @__PURE__ */ jsx(Layout2, {}), $[0] = Layout2, $[1] = t0) : t0 = $[1], t0;
|
|
85149
85172
|
}
|
|
85150
85173
|
function StudioLayoutComponent() {
|
|
85151
|
-
const $ = c(
|
|
85174
|
+
const $ = c(72), {
|
|
85152
85175
|
name,
|
|
85153
85176
|
title,
|
|
85154
85177
|
tools
|
|
@@ -85159,98 +85182,106 @@ function StudioLayoutComponent() {
|
|
|
85159
85182
|
const defaultRouteTools = t0, router = useRouter(), activeToolName = useRouterState(_temp$u);
|
|
85160
85183
|
let t1;
|
|
85161
85184
|
if ($[2] !== activeToolName || $[3] !== tools) {
|
|
85162
|
-
let
|
|
85163
|
-
$[5] !== activeToolName ? (
|
|
85185
|
+
let t28;
|
|
85186
|
+
$[5] !== activeToolName ? (t28 = (tool) => tool.name === activeToolName, $[5] = activeToolName, $[6] = t28) : t28 = $[6], t1 = tools.find(t28), $[2] = activeToolName, $[3] = tools, $[4] = t1;
|
|
85164
85187
|
} else
|
|
85165
85188
|
t1 = $[4];
|
|
85166
|
-
const activeTool = t1,
|
|
85167
|
-
let t2;
|
|
85189
|
+
const activeTool = t1, toolMountT0Ref = useRef(null), lastToolNameRef = useRef(void 0);
|
|
85190
|
+
let t2, t3;
|
|
85191
|
+
$[7] !== activeToolName ? (t2 = () => {
|
|
85192
|
+
activeToolName !== lastToolNameRef.current && (lastToolNameRef.current = activeToolName, toolMountT0Ref.current = activeToolName ? performance.now() : null);
|
|
85193
|
+
}, t3 = [activeToolName], $[7] = activeToolName, $[8] = t2, $[9] = t3) : (t2 = $[8], t3 = $[9]), useEffect(t2, t3);
|
|
85194
|
+
const [searchFullscreenOpen, setSearchFullscreenOpen] = useState(!1), [searchFullscreenPortalEl, setSearchFullscreenPortalEl] = useState(null), [searchOpen, setSearchOpen] = useState(!1);
|
|
85195
|
+
let t4;
|
|
85168
85196
|
bb0: {
|
|
85169
|
-
let
|
|
85170
|
-
$[
|
|
85171
|
-
const workspaceTitle =
|
|
85197
|
+
let t52;
|
|
85198
|
+
$[10] !== name || $[11] !== title ? (t52 = title || startCase(name), $[10] = name, $[11] = title, $[12] = t52) : t52 = $[12];
|
|
85199
|
+
const workspaceTitle = t52, toolTitle = activeTool ? activeTool.title || activeTool.name : void 0;
|
|
85172
85200
|
if (toolTitle) {
|
|
85173
|
-
|
|
85201
|
+
t4 = `${toolTitle} | ${workspaceTitle}`;
|
|
85174
85202
|
break bb0;
|
|
85175
85203
|
}
|
|
85176
|
-
|
|
85204
|
+
t4 = workspaceTitle;
|
|
85177
85205
|
}
|
|
85178
|
-
const documentTitle =
|
|
85179
|
-
let t3, t4;
|
|
85180
|
-
$[10] !== documentTitle || $[11] !== toolControlsDocumentTitle ? (t3 = () => {
|
|
85181
|
-
toolControlsDocumentTitle || (document.title = documentTitle);
|
|
85182
|
-
}, t4 = [documentTitle, toolControlsDocumentTitle], $[10] = documentTitle, $[11] = toolControlsDocumentTitle, $[12] = t3, $[13] = t4) : (t3 = $[12], t4 = $[13]), useEffect(t3, t4);
|
|
85206
|
+
const documentTitle = t4, toolControlsDocumentTitle = !!activeTool?.controlsDocumentTitle;
|
|
85183
85207
|
let t5, t6;
|
|
85184
|
-
$[
|
|
85208
|
+
$[13] !== documentTitle || $[14] !== toolControlsDocumentTitle ? (t5 = () => {
|
|
85209
|
+
toolControlsDocumentTitle || (document.title = documentTitle);
|
|
85210
|
+
}, t6 = [documentTitle, toolControlsDocumentTitle], $[13] = documentTitle, $[14] = toolControlsDocumentTitle, $[15] = t5, $[16] = t6) : (t5 = $[15], t6 = $[16]), useEffect(t5, t6);
|
|
85211
|
+
let t7, t8;
|
|
85212
|
+
$[17] !== activeTool || $[18] !== telemetry || $[19] !== tools.length ? (t7 = () => {
|
|
85185
85213
|
studioReadyFired || activeTool && (studioReadyFired = !0, telemetry.log(StudioReadyMeasured, {
|
|
85186
85214
|
durationMs: performance.now(),
|
|
85187
85215
|
toolsCount: tools.length,
|
|
85188
85216
|
activeToolName: activeTool.name
|
|
85189
85217
|
}));
|
|
85190
|
-
},
|
|
85191
|
-
let
|
|
85192
|
-
$[
|
|
85218
|
+
}, t8 = [activeTool, telemetry, tools.length], $[17] = activeTool, $[18] = telemetry, $[19] = tools.length, $[20] = t7, $[21] = t8) : (t7 = $[20], t8 = $[21]), useEffect(t7, t8);
|
|
85219
|
+
let t9;
|
|
85220
|
+
$[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = (open) => {
|
|
85193
85221
|
setSearchFullscreenOpen(open);
|
|
85194
|
-
}, $[
|
|
85195
|
-
const handleSearchFullscreenOpenChange =
|
|
85196
|
-
let
|
|
85197
|
-
$[
|
|
85222
|
+
}, $[22] = t9) : t9 = $[22];
|
|
85223
|
+
const handleSearchFullscreenOpenChange = t9;
|
|
85224
|
+
let t10;
|
|
85225
|
+
$[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t10 = (open_0) => {
|
|
85198
85226
|
setSearchOpen(open_0);
|
|
85199
|
-
}, $[
|
|
85200
|
-
const handleSearchOpenChange =
|
|
85201
|
-
let
|
|
85202
|
-
$[
|
|
85227
|
+
}, $[23] = t10) : t10 = $[23];
|
|
85228
|
+
const handleSearchOpenChange = t10;
|
|
85229
|
+
let t11;
|
|
85230
|
+
$[24] !== searchFullscreenOpen || $[25] !== searchFullscreenPortalEl || $[26] !== searchOpen ? (t11 = {
|
|
85203
85231
|
searchFullscreenOpen,
|
|
85204
85232
|
searchFullscreenPortalEl,
|
|
85205
85233
|
searchOpen,
|
|
85206
85234
|
onSearchFullscreenOpenChange: handleSearchFullscreenOpenChange,
|
|
85207
85235
|
onSearchOpenChange: handleSearchOpenChange
|
|
85208
|
-
}, $[
|
|
85209
|
-
const navbarContextValue =
|
|
85210
|
-
let
|
|
85211
|
-
$[
|
|
85212
|
-
const isLegacyDeskRedirect =
|
|
85213
|
-
let
|
|
85214
|
-
$[
|
|
85236
|
+
}, $[24] = searchFullscreenOpen, $[25] = searchFullscreenPortalEl, $[26] = searchOpen, $[27] = t11) : t11 = $[27];
|
|
85237
|
+
const navbarContextValue = t11, Navbar = useNavbarComponent(), ActiveToolLayout = useActiveToolLayoutComponent();
|
|
85238
|
+
let t12;
|
|
85239
|
+
$[28] !== activeTool || $[29] !== activeToolName || $[30] !== tools ? (t12 = !activeTool && (activeToolName === "desk" || !activeToolName) && typeof window < "u" && /\/desk(\/|$)/.test(window.location.pathname) && tools.some(_temp2$b), $[28] = activeTool, $[29] = activeToolName, $[30] = tools, $[31] = t12) : t12 = $[31];
|
|
85240
|
+
const isLegacyDeskRedirect = t12;
|
|
85241
|
+
let t13, t14;
|
|
85242
|
+
$[32] !== isLegacyDeskRedirect || $[33] !== router ? (t13 = () => {
|
|
85215
85243
|
isLegacyDeskRedirect && router.navigateUrl({
|
|
85216
85244
|
path: window.location.pathname.replace(/\/desk/, "/structure"),
|
|
85217
85245
|
replace: !0
|
|
85218
85246
|
});
|
|
85219
|
-
},
|
|
85247
|
+
}, t14 = [isLegacyDeskRedirect, router], $[32] = isLegacyDeskRedirect, $[33] = router, $[34] = t13, $[35] = t14) : (t13 = $[34], t14 = $[35]), useEffect(t13, t14);
|
|
85220
85248
|
const getErrorScreen = _temp3$5;
|
|
85221
|
-
let t13;
|
|
85222
|
-
$[33] !== Navbar ? (t13 = /* @__PURE__ */ jsx(Navbar, {}), $[33] = Navbar, $[34] = t13) : t13 = $[34];
|
|
85223
|
-
let t14;
|
|
85224
|
-
$[35] !== navbarContextValue || $[36] !== t13 ? (t14 = /* @__PURE__ */ jsx(NavbarContext.Provider, { value: navbarContextValue, children: t13 }), $[35] = navbarContextValue, $[36] = t13, $[37] = t14) : t14 = $[37];
|
|
85225
85249
|
let t15;
|
|
85226
|
-
$[
|
|
85250
|
+
$[36] !== Navbar ? (t15 = /* @__PURE__ */ jsx(Navbar, {}), $[36] = Navbar, $[37] = t15) : t15 = $[37];
|
|
85227
85251
|
let t16;
|
|
85228
|
-
$[
|
|
85252
|
+
$[38] !== navbarContextValue || $[39] !== t15 ? (t16 = /* @__PURE__ */ jsx(NavbarContext.Provider, { value: navbarContextValue, children: t15 }), $[38] = navbarContextValue, $[39] = t15, $[40] = t16) : t16 = $[40];
|
|
85229
85253
|
let t17;
|
|
85230
|
-
$[
|
|
85254
|
+
$[41] !== isLegacyDeskRedirect ? (t17 = isLegacyDeskRedirect && /* @__PURE__ */ jsx(RedirectingScreen, {}), $[41] = isLegacyDeskRedirect, $[42] = t17) : t17 = $[42];
|
|
85231
85255
|
let t18;
|
|
85232
|
-
$[
|
|
85233
|
-
|
|
85234
|
-
|
|
85235
|
-
|
|
85236
|
-
|
|
85237
|
-
|
|
85256
|
+
$[43] !== activeTool || $[44] !== defaultRouteTools ? (t18 = !activeTool && defaultRouteTools.length === 0 && /* @__PURE__ */ jsx(NoToolsScreen, {}), $[43] = activeTool, $[44] = defaultRouteTools, $[45] = t18) : t18 = $[45];
|
|
85257
|
+
let t19;
|
|
85258
|
+
$[46] !== activeTool || $[47] !== activeToolName || $[48] !== isLegacyDeskRedirect || $[49] !== tools.length ? (t19 = tools.length > 0 && !activeTool && activeToolName && !isLegacyDeskRedirect && /* @__PURE__ */ jsx(ToolNotFoundScreen, { toolName: activeToolName }), $[46] = activeTool, $[47] = activeToolName, $[48] = isLegacyDeskRedirect, $[49] = tools.length, $[50] = t19) : t19 = $[50];
|
|
85259
|
+
let t20;
|
|
85260
|
+
$[51] !== searchFullscreenOpen ? (t20 = searchFullscreenOpen && /* @__PURE__ */ jsx(SearchFullscreenPortalCard, { ref: setSearchFullscreenPortalEl, overflow: "auto" }), $[51] = searchFullscreenOpen, $[52] = t20) : t20 = $[52];
|
|
85261
|
+
const t21 = activeTool?.name, t22 = `The ${activeTool?.name} tool crashed`;
|
|
85238
85262
|
let t23;
|
|
85239
|
-
$[
|
|
85263
|
+
$[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t23 = detectViteDevServerStopped && /* @__PURE__ */ jsx(DetectViteDevServerStopped, {}), $[53] = t23) : t23 = $[53];
|
|
85240
85264
|
let t24;
|
|
85241
|
-
$[
|
|
85242
|
-
|
|
85243
|
-
|
|
85244
|
-
] }
|
|
85265
|
+
$[54] !== ActiveToolLayout || $[55] !== activeTool || $[56] !== activeToolName ? (t24 = activeTool && activeToolName && /* @__PURE__ */ jsx(RouteScope, { scope: activeToolName, __unsafe_disableScopedSearchParams: activeTool.router?.__unsafe_disableScopedSearchParams, children: /* @__PURE__ */ jsxs(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingBlock, { showText: !0 }), children: [
|
|
85266
|
+
/* @__PURE__ */ jsx(ActiveToolLayout, { activeTool }),
|
|
85267
|
+
/* @__PURE__ */ jsx(ToolMountTimer, { toolName: activeTool.name, t0Ref: toolMountT0Ref })
|
|
85268
|
+
] }) }), $[54] = ActiveToolLayout, $[55] = activeTool, $[56] = activeToolName, $[57] = t24) : t24 = $[57];
|
|
85245
85269
|
let t25;
|
|
85246
|
-
|
|
85247
|
-
|
|
85248
|
-
|
|
85270
|
+
$[58] !== searchFullscreenOpen || $[59] !== t24 ? (t25 = /* @__PURE__ */ jsx(Card, { flex: 1, hidden: searchFullscreenOpen, children: t24 }), $[58] = searchFullscreenOpen, $[59] = t24, $[60] = t25) : t25 = $[60];
|
|
85271
|
+
let t26;
|
|
85272
|
+
$[61] !== t21 || $[62] !== t22 || $[63] !== t25 ? (t26 = /* @__PURE__ */ jsxs(StudioErrorBoundary, { heading: t22, getErrorScreen, children: [
|
|
85273
|
+
t23,
|
|
85274
|
+
t25
|
|
85275
|
+
] }, t21), $[61] = t21, $[62] = t22, $[63] = t25, $[64] = t26) : t26 = $[64];
|
|
85276
|
+
let t27;
|
|
85277
|
+
return $[65] !== t16 || $[66] !== t17 || $[67] !== t18 || $[68] !== t19 || $[69] !== t20 || $[70] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Flex, { "data-ui": "ToolScreen", direction: "column", height: "fill", "data-testid": "studio-layout", children: [
|
|
85249
85278
|
t16,
|
|
85250
85279
|
t17,
|
|
85251
85280
|
t18,
|
|
85252
|
-
|
|
85253
|
-
|
|
85281
|
+
t19,
|
|
85282
|
+
t20,
|
|
85283
|
+
t26
|
|
85284
|
+
] }), $[65] = t16, $[66] = t17, $[67] = t18, $[68] = t19, $[69] = t20, $[70] = t26, $[71] = t27) : t27 = $[71], t27;
|
|
85254
85285
|
}
|
|
85255
85286
|
function _temp3$5(error) {
|
|
85256
85287
|
return isDocumentLimitError(error) ? /* @__PURE__ */ jsx(DocumentLimitsUpsellPanel, {}) : null;
|