@sanity/vision 6.12.0-next.52 → 6.12.0-next.60

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.
@@ -1,6 +1,6 @@
1
- import { t as visionLocaleNamespace } from "./i18n-B53Bf56u.js";
1
+ import { t as visionLocaleNamespace } from "./i18n-t8J2mRUI.js";
2
2
  import { Component, Fragment, Suspense, use, useEffect, useImperativeHandle, useRef, useState } from "react";
3
- import { ContextMenuButton, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
3
+ import { ContextMenuButton, RELEASES_STUDIO_CLIENT_OPTIONS, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
4
4
  import { IntentLink } from "sanity/router";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { Badge, Button, Card, Container, Dialog, Flex, Grid, Heading, Hotkeys, Inline, Label, Select, Spinner, Stack, Tab, TabList, Text, TextInput, rem, useClickOutsideEvent, useTheme, useTheme_v2 } from "@sanity/ui";
@@ -44,6 +44,7 @@ import { CopyIcon } from "@sanity/icons/Copy";
44
44
  import { HelpCircleIcon } from "@sanity/icons/HelpCircle";
45
45
  import { Popover } from "@sanity/ui/popover";
46
46
  import { json2csv } from "json-2-csv";
47
+ import { isHttpError } from "@sanity/client";
47
48
  import { JsonInspector } from "@rexxars/react-json-inspector";
48
49
  import { LinkIcon } from "@sanity/icons/Link";
49
50
  import LRU from "quick-lru";
@@ -1930,6 +1931,46 @@ function getMemoizedBlobUrlResolver(mimeType, stringEncoder) {
1930
1931
  })();
1931
1932
  }
1932
1933
  const getJsonBlobUrl = getMemoizedBlobUrlResolver("application/json", (input) => JSON.stringify(input, null, 2)), getCsvBlobUrl = getMemoizedBlobUrlResolver("text/csv", (input) => json2csv(Array.isArray(input) ? input : [input]).trim());
1934
+ /**
1935
+ * Returns true when `selected` does not satisfy `required`.
1936
+ *
1937
+ * `X` is the experimental API: it satisfies every requirement, and when it is
1938
+ * the requirement only `X` satisfies it. Dated versions compare
1939
+ * lexicographically. `v1` sits below every dated version and `X`.
1940
+ */
1941
+ function isApiVersionBelow(selected, required) {
1942
+ let parsedSelected = parseApiVersion(selected), parsedRequired = parseApiVersion(required);
1943
+ return parsedSelected.kind === "unknown" || parsedRequired.kind === "unknown" || parsedSelected.kind === "experimental" ? !1 : parsedRequired.kind === "experimental" ? !0 : parsedSelected.kind === "legacy" ? parsedRequired.kind !== "legacy" : parsedRequired.kind !== "legacy" && parsedSelected.value < parsedRequired.value;
1944
+ }
1945
+ function parseApiVersion(version) {
1946
+ let normalized = version.replace(/^v/i, "").trim();
1947
+ return normalized ? normalized.toUpperCase() === "X" ? { kind: "experimental" } : normalized === "1" ? { kind: "legacy" } : /^\d{4}-\d{2}-\d{2}$/.test(normalized) ? {
1948
+ kind: "dated",
1949
+ value: normalized
1950
+ } : { kind: "unknown" } : { kind: "unknown" };
1951
+ }
1952
+ const NAMED_PERSPECTIVES = /* @__PURE__ */ new Set([
1953
+ "raw",
1954
+ "published",
1955
+ "drafts",
1956
+ "previewDrafts"
1957
+ ]), API_VERSION_CAPABILITIES = [{
1958
+ id: "variants",
1959
+ requiredApiVersion: VARIANTS_STUDIO_CLIENT_OPTIONS.apiVersion,
1960
+ explanationKey: "query.error.unsupported-variant",
1961
+ applies: ({ variant }) => !!variant
1962
+ }, {
1963
+ id: "releases",
1964
+ requiredApiVersion: RELEASES_STUDIO_CLIENT_OPTIONS.apiVersion,
1965
+ explanationKey: "query.error.unsupported-release-perspective",
1966
+ applies: ({ perspective }) => hasReleaseInPerspective(perspective)
1967
+ }];
1968
+ function hasReleaseInPerspective(perspective) {
1969
+ return Array.isArray(perspective) ? perspective.some((entry) => !NAMED_PERSPECTIVES.has(entry)) : !1;
1970
+ }
1971
+ function getUnsatisfiedApiVersionCapability(context, capabilities = API_VERSION_CAPABILITIES) {
1972
+ if (context.statusCode === 400) return capabilities.find((capability) => capability.applies(context) && isApiVersionBelow(context.apiVersion, capability.requiredApiVersion));
1973
+ }
1933
1974
  var errorCode = "vgszcp0";
1934
1975
  function ErrorCode(props) {
1935
1976
  let $ = c(2), t0;
@@ -1991,19 +2032,37 @@ function dashLine(column, columnEnd) {
1991
2032
  return `${"-".repeat(column)}${"^".repeat(columnEnd ? columnEnd - column : 1)}`;
1992
2033
  }
1993
2034
  function QueryErrorDialog(props) {
1994
- let $ = c(7), t0;
1995
- $[0] === props.error.message ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(ErrorCode, {
2035
+ let $ = c(20), { error, apiVersion, perspective, variant } = props, { t } = useTranslation(visionLocaleNamespace), T0, t0, t1, t2;
2036
+ if ($[0] !== apiVersion || $[1] !== error || $[2] !== perspective || $[3] !== t || $[4] !== variant) {
2037
+ let unsatisfiedCapability = getUnsatisfiedApiVersionCapability({
2038
+ statusCode: isHttpError(error) ? error.statusCode : void 0,
2039
+ apiVersion,
2040
+ perspective,
2041
+ variant
2042
+ });
2043
+ T0 = Stack, t0 = 5, t1 = 2, t2 = unsatisfiedCapability ? /* @__PURE__ */ jsx(Text, {
2044
+ "data-testid": "query-error-api-version-capability-hint",
2045
+ size: 1,
2046
+ children: t(unsatisfiedCapability.explanationKey, { apiVersion: prefixApiVersion(unsatisfiedCapability.requiredApiVersion) })
2047
+ }) : null, $[0] = apiVersion, $[1] = error, $[2] = perspective, $[3] = t, $[4] = variant, $[5] = T0, $[6] = t0, $[7] = t1, $[8] = t2;
2048
+ } else T0 = $[5], t0 = $[6], t1 = $[7], t2 = $[8];
2049
+ let t3;
2050
+ $[9] === error.message ? t3 = $[10] : (t3 = /* @__PURE__ */ jsx(ErrorCode, {
1996
2051
  size: 1,
1997
- children: props.error.message
1998
- }), $[0] = props.error.message, $[1] = t0);
1999
- let t1;
2000
- $[2] === props.error ? t1 = $[3] : (t1 = /* @__PURE__ */ jsx(QueryErrorDetails, { error: props.error }), $[2] = props.error, $[3] = t1);
2001
- let t2;
2002
- return $[4] !== t0 || $[5] !== t1 ? (t2 = /* @__PURE__ */ jsxs(Stack, {
2003
- gap: 5,
2004
- marginTop: 2,
2005
- children: [t0, t1]
2006
- }), $[4] = t0, $[5] = t1, $[6] = t2) : t2 = $[6], t2;
2052
+ children: error.message
2053
+ }), $[9] = error.message, $[10] = t3);
2054
+ let t4;
2055
+ $[11] === error ? t4 = $[12] : (t4 = /* @__PURE__ */ jsx(QueryErrorDetails, { error }), $[11] = error, $[12] = t4);
2056
+ let t5;
2057
+ return $[13] !== T0 || $[14] !== t0 || $[15] !== t1 || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 ? (t5 = /* @__PURE__ */ jsxs(T0, {
2058
+ gap: t0,
2059
+ marginTop: t1,
2060
+ children: [
2061
+ t2,
2062
+ t3,
2063
+ t4
2064
+ ]
2065
+ }), $[13] = T0, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5) : t5 = $[19], t5;
2007
2066
  }
2008
2067
  var codeFamilyVar = "var(--_1rvgeh0)", codeFontSizeVar = "var(--_1rvgeh1)", codeLineHeightVar = "var(--_1rvgeh2)", resultViewWrapper = "_1rvgehc", space0Var = "var(--_1rvgeh3)", space2Var = "var(--_1rvgeh4)", space4HalfVar = "var(--_1rvgeh6)", space4Var = "var(--_1rvgeh5)", syntaxBooleanVar = "var(--_1rvgeha)", syntaxConstantVar = "var(--_1rvgeh8)", syntaxNumberVar = "var(--_1rvgehb)", syntaxPropertyVar = "var(--_1rvgeh7)", syntaxStringVar = "var(--_1rvgeh9)";
2009
2068
  const lru = new LRU({ maxSize: 5e4 });
@@ -2133,7 +2192,7 @@ function SaveJsonButton(t0) {
2133
2192
  }), $[0] = blobUrl, $[1] = t1), t1;
2134
2193
  }
2135
2194
  function VisionGuiResult(t0) {
2136
- let $ = c(77), { error, queryInProgress, queryResult, listenInProgress, listenMutations, dataset, queryTime, e2eTime, compactFooter: t1 } = t0, compactFooter = t1 !== void 0 && t1, { t } = useTranslation(visionLocaleNamespace), hasResult = !error && !queryInProgress && queryResult !== void 0, t2 = error ? "critical" : "default", t3 = !!error, t4;
2195
+ let $ = c(80), { error, apiVersion, perspective, variant, queryInProgress, queryResult, listenInProgress, listenMutations, dataset, queryTime, e2eTime, compactFooter: t1 } = t0, compactFooter = t1 !== void 0 && t1, { t } = useTranslation(visionLocaleNamespace), hasResult = !error && !queryInProgress && queryResult !== void 0, t2 = error ? "critical" : "default", t3 = !!error, t4;
2137
2196
  $[0] === t ? t4 = $[1] : (t4 = t("result.label"), $[0] = t, $[1] = t4);
2138
2197
  let t5;
2139
2198
  $[2] === t4 ? t5 = $[3] : (t5 = /* @__PURE__ */ jsx(InputBackgroundContainer, { children: /* @__PURE__ */ jsx(Box, {
@@ -2149,19 +2208,24 @@ function VisionGuiResult(t0) {
2149
2208
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
2150
2209
  }), $[4] = listenInProgress, $[5] = listenMutations, $[6] = queryInProgress, $[7] = t6) : t6 = $[7];
2151
2210
  let t7;
2152
- $[8] === error ? t7 = $[9] : (t7 = error && /* @__PURE__ */ jsx(QueryErrorDialog, { error }), $[8] = error, $[9] = t7);
2211
+ $[8] !== apiVersion || $[9] !== error || $[10] !== perspective || $[11] !== variant ? (t7 = error && /* @__PURE__ */ jsx(QueryErrorDialog, {
2212
+ apiVersion,
2213
+ error,
2214
+ perspective,
2215
+ variant
2216
+ }), $[8] = apiVersion, $[9] = error, $[10] = perspective, $[11] = variant, $[12] = t7) : t7 = $[12];
2153
2217
  let t8;
2154
- $[10] !== dataset || $[11] !== hasResult || $[12] !== queryResult ? (t8 = hasResult && /* @__PURE__ */ jsx(ResultView, {
2218
+ $[13] !== dataset || $[14] !== hasResult || $[15] !== queryResult ? (t8 = hasResult && /* @__PURE__ */ jsx(ResultView, {
2155
2219
  data: queryResult,
2156
2220
  datasetName: dataset
2157
- }), $[10] = dataset, $[11] = hasResult, $[12] = queryResult, $[13] = t8) : t8 = $[13];
2221
+ }), $[13] = dataset, $[14] = hasResult, $[15] = queryResult, $[16] = t8) : t8 = $[16];
2158
2222
  let t9;
2159
- $[14] !== dataset || $[15] !== listenInProgress || $[16] !== listenMutations ? (t9 = listenInProgress && listenMutations.length > 0 && /* @__PURE__ */ jsx(ResultView, {
2223
+ $[17] !== dataset || $[18] !== listenInProgress || $[19] !== listenMutations ? (t9 = listenInProgress && listenMutations.length > 0 && /* @__PURE__ */ jsx(ResultView, {
2160
2224
  data: listenMutations,
2161
2225
  datasetName: dataset
2162
- }), $[14] = dataset, $[15] = listenInProgress, $[16] = listenMutations, $[17] = t9) : t9 = $[17];
2226
+ }), $[17] = dataset, $[18] = listenInProgress, $[19] = listenMutations, $[20] = t9) : t9 = $[20];
2163
2227
  let t10;
2164
- $[18] !== t6 || $[19] !== t7 || $[20] !== t8 || $[21] !== t9 ? (t10 = /* @__PURE__ */ jsxs(Box, {
2228
+ $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 ? (t10 = /* @__PURE__ */ jsxs(Box, {
2165
2229
  padding: 3,
2166
2230
  paddingTop: 5,
2167
2231
  children: [
@@ -2170,14 +2234,14 @@ function VisionGuiResult(t0) {
2170
2234
  t8,
2171
2235
  t9
2172
2236
  ]
2173
- }), $[18] = t6, $[19] = t7, $[20] = t8, $[21] = t9, $[22] = t10) : t10 = $[22];
2237
+ }), $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t10) : t10 = $[25];
2174
2238
  let t11;
2175
- $[23] !== t10 || $[24] !== t5 ? (t11 = /* @__PURE__ */ jsxs(Result, {
2239
+ $[26] !== t10 || $[27] !== t5 ? (t11 = /* @__PURE__ */ jsxs(Result, {
2176
2240
  overflow: "auto",
2177
2241
  children: [t5, t10]
2178
- }), $[23] = t10, $[24] = t5, $[25] = t11) : t11 = $[25];
2242
+ }), $[26] = t10, $[27] = t5, $[28] = t11) : t11 = $[28];
2179
2243
  let t12;
2180
- $[26] !== t11 || $[27] !== t2 || $[28] !== t3 ? (t12 = /* @__PURE__ */ jsx(ResultInnerContainer, {
2244
+ $[29] !== t11 || $[30] !== t2 || $[31] !== t3 ? (t12 = /* @__PURE__ */ jsx(ResultInnerContainer, {
2181
2245
  flexBasis: "0%",
2182
2246
  flexGrow: 1,
2183
2247
  children: /* @__PURE__ */ jsx(ResultContainer, {
@@ -2187,21 +2251,21 @@ function VisionGuiResult(t0) {
2187
2251
  isInvalid: t3,
2188
2252
  children: t11
2189
2253
  })
2190
- }), $[26] = t11, $[27] = t2, $[28] = t3, $[29] = t12) : t12 = $[29];
2254
+ }), $[29] = t11, $[30] = t2, $[31] = t3, $[32] = t12) : t12 = $[32];
2191
2255
  let t13 = compactFooter ? "flex-start" : "space-between", t14 = compactFooter ? "stretch" : void 0, t15;
2192
- $[30] === compactFooter ? t15 = $[31] : (t15 = compactFooter ? "column" : [
2256
+ $[33] === compactFooter ? t15 = $[34] : (t15 = compactFooter ? "column" : [
2193
2257
  "column",
2194
2258
  "column",
2195
2259
  "row"
2196
- ], $[30] = compactFooter, $[31] = t15);
2260
+ ], $[33] = compactFooter, $[34] = t15);
2197
2261
  let t16 = compactFooter ? 3 : 4, t17 = compactFooter ? 2 : 3, t18;
2198
- $[32] === compactFooter ? t18 = $[33] : (t18 = compactFooter ? { width: "100%" } : { minWidth: 0 }, $[32] = compactFooter, $[33] = t18);
2262
+ $[35] === compactFooter ? t18 = $[36] : (t18 = compactFooter ? { width: "100%" } : { minWidth: 0 }, $[35] = compactFooter, $[36] = t18);
2199
2263
  let t19 = compactFooter ? 1 : 2, t20;
2200
- $[34] === t ? t20 = $[35] : (t20 = t("result.execution-time-label"), $[34] = t, $[35] = t20);
2264
+ $[37] === t ? t20 = $[38] : (t20 = t("result.execution-time-label"), $[37] = t, $[38] = t20);
2201
2265
  let t21;
2202
- $[36] !== queryTime || $[37] !== t ? (t21 = typeof queryTime == "number" ? `${queryTime}ms` : t("result.timing-not-applicable"), $[36] = queryTime, $[37] = t, $[38] = t21) : t21 = $[38];
2266
+ $[39] !== queryTime || $[40] !== t ? (t21 = typeof queryTime == "number" ? `${queryTime}ms` : t("result.timing-not-applicable"), $[39] = queryTime, $[40] = t, $[41] = t21) : t21 = $[41];
2203
2267
  let t22;
2204
- $[39] !== t19 || $[40] !== t20 || $[41] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
2268
+ $[42] !== t19 || $[43] !== t20 || $[44] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
2205
2269
  muted: !0,
2206
2270
  size: t19,
2207
2271
  children: [
@@ -2210,13 +2274,13 @@ function VisionGuiResult(t0) {
2210
2274
  " ",
2211
2275
  t21
2212
2276
  ]
2213
- }) }), $[39] = t19, $[40] = t20, $[41] = t21, $[42] = t22) : t22 = $[42];
2277
+ }) }), $[42] = t19, $[43] = t20, $[44] = t21, $[45] = t22) : t22 = $[45];
2214
2278
  let t23 = compactFooter ? 3 : 4, t24 = compactFooter ? 1 : 2, t25;
2215
- $[43] === t ? t25 = $[44] : (t25 = t("result.end-to-end-time-label"), $[43] = t, $[44] = t25);
2279
+ $[46] === t ? t25 = $[47] : (t25 = t("result.end-to-end-time-label"), $[46] = t, $[47] = t25);
2216
2280
  let t26;
2217
- $[45] !== e2eTime || $[46] !== t ? (t26 = typeof e2eTime == "number" ? `${e2eTime}ms` : t("result.timing-not-applicable"), $[45] = e2eTime, $[46] = t, $[47] = t26) : t26 = $[47];
2281
+ $[48] !== e2eTime || $[49] !== t ? (t26 = typeof e2eTime == "number" ? `${e2eTime}ms` : t("result.timing-not-applicable"), $[48] = e2eTime, $[49] = t, $[50] = t26) : t26 = $[50];
2218
2282
  let t27;
2219
- $[48] !== t24 || $[49] !== t25 || $[50] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Text, {
2283
+ $[51] !== t24 || $[52] !== t25 || $[53] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Text, {
2220
2284
  muted: !0,
2221
2285
  size: t24,
2222
2286
  children: [
@@ -2225,27 +2289,27 @@ function VisionGuiResult(t0) {
2225
2289
  " ",
2226
2290
  t26
2227
2291
  ]
2228
- }), $[48] = t24, $[49] = t25, $[50] = t26, $[51] = t27) : t27 = $[51];
2292
+ }), $[51] = t24, $[52] = t25, $[53] = t26, $[54] = t27) : t27 = $[54];
2229
2293
  let t28;
2230
- $[52] !== t23 || $[53] !== t27 ? (t28 = /* @__PURE__ */ jsx(Box, {
2294
+ $[55] !== t23 || $[56] !== t27 ? (t28 = /* @__PURE__ */ jsx(Box, {
2231
2295
  marginLeft: t23,
2232
2296
  children: t27
2233
- }), $[52] = t23, $[53] = t27, $[54] = t28) : t28 = $[54];
2297
+ }), $[55] = t23, $[56] = t27, $[57] = t28) : t28 = $[57];
2234
2298
  let t29;
2235
- $[55] !== t22 || $[56] !== t28 ? (t29 = /* @__PURE__ */ jsxs(TimingsTextContainer, {
2299
+ $[58] !== t22 || $[59] !== t28 ? (t29 = /* @__PURE__ */ jsxs(TimingsTextContainer, {
2236
2300
  align: "center",
2237
2301
  children: [t22, t28]
2238
- }), $[55] = t22, $[56] = t28, $[57] = t29) : t29 = $[57];
2302
+ }), $[58] = t22, $[59] = t28, $[60] = t29) : t29 = $[60];
2239
2303
  let t30;
2240
- $[58] !== t16 || $[59] !== t17 || $[60] !== t18 || $[61] !== t29 ? (t30 = /* @__PURE__ */ jsx(TimingsCard, {
2304
+ $[61] !== t16 || $[62] !== t17 || $[63] !== t18 || $[64] !== t29 ? (t30 = /* @__PURE__ */ jsx(TimingsCard, {
2241
2305
  paddingX: t16,
2242
2306
  paddingY: t17,
2243
2307
  sizing: "border",
2244
2308
  style: t18,
2245
2309
  children: t29
2246
- }), $[58] = t16, $[59] = t17, $[60] = t18, $[61] = t29, $[62] = t30) : t30 = $[62];
2310
+ }), $[61] = t16, $[62] = t17, $[63] = t18, $[64] = t29, $[65] = t30) : t30 = $[65];
2247
2311
  let t31;
2248
- $[63] !== compactFooter || $[64] !== hasResult || $[65] !== queryResult || $[66] !== t ? (t31 = hasResult && /* @__PURE__ */ jsx(DownloadsCard, {
2312
+ $[66] !== compactFooter || $[67] !== hasResult || $[68] !== queryResult || $[69] !== t ? (t31 = hasResult && /* @__PURE__ */ jsx(DownloadsCard, {
2249
2313
  paddingX: compactFooter ? 3 : 4,
2250
2314
  paddingY: compactFooter ? 2 : 3,
2251
2315
  sizing: "border",
@@ -2263,20 +2327,20 @@ function VisionGuiResult(t0) {
2263
2327
  t
2264
2328
  })
2265
2329
  })
2266
- }), $[63] = compactFooter, $[64] = hasResult, $[65] = queryResult, $[66] = t, $[67] = t31) : t31 = $[67];
2330
+ }), $[66] = compactFooter, $[67] = hasResult, $[68] = queryResult, $[69] = t, $[70] = t31) : t31 = $[70];
2267
2331
  let t32;
2268
- $[68] !== t13 || $[69] !== t14 || $[70] !== t15 || $[71] !== t30 || $[72] !== t31 ? (t32 = /* @__PURE__ */ jsxs(ResultFooter, {
2332
+ $[71] !== t13 || $[72] !== t14 || $[73] !== t15 || $[74] !== t30 || $[75] !== t31 ? (t32 = /* @__PURE__ */ jsxs(ResultFooter, {
2269
2333
  justify: t13,
2270
2334
  align: t14,
2271
2335
  direction: t15,
2272
2336
  children: [t30, t31]
2273
- }), $[68] = t13, $[69] = t14, $[70] = t15, $[71] = t30, $[72] = t31, $[73] = t32) : t32 = $[73];
2337
+ }), $[71] = t13, $[72] = t14, $[73] = t15, $[74] = t30, $[75] = t31, $[76] = t32) : t32 = $[76];
2274
2338
  let t33;
2275
- return $[74] !== t12 || $[75] !== t32 ? (t33 = /* @__PURE__ */ jsxs(ResultOuterContainer, {
2339
+ return $[77] !== t12 || $[78] !== t32 ? (t33 = /* @__PURE__ */ jsxs(ResultOuterContainer, {
2276
2340
  direction: "column",
2277
2341
  "data-testid": "vision-result",
2278
2342
  children: [t12, t32]
2279
- }), $[74] = t12, $[75] = t32, $[76] = t33) : t33 = $[76], t33;
2343
+ }), $[77] = t12, $[78] = t32, $[79] = t33) : t33 = $[79], t33;
2280
2344
  }
2281
2345
  function SaveResultButtons(t0) {
2282
2346
  let $ = c(11), { queryResult } = t0, t1;
@@ -2295,7 +2359,7 @@ function nodeContains(node, other) {
2295
2359
  }
2296
2360
  const sanityUrl = /\/(vX|v1|v\d{4}-\d\d-\d\d)\/.*?(?:query|listen)\/(.*?)\?(.*)/, VARIANTS_API_VERSION = prefixApiVersion(VARIANTS_STUDIO_CLIENT_OPTIONS.apiVersion), isRunHotkey = (event) => isHotkey("ctrl+enter", event) || isHotkey("mod+enter", event);
2297
2361
  function VisionGui(props) {
2298
- let $ = c(225), { datasets, config, projectId, defaultDataset } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantName } = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
2362
+ let $ = c(232), { datasets, config, projectId, defaultDataset } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantName } = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
2299
2363
  $[0] === t0 ? t1 = $[1] : (t1 = t0 === void 0 ? [] : t0, $[0] = t0, $[1] = t1);
2300
2364
  let releases = t1, isDraftModelEnabled = useWorkspace().document.drafts.enabled, editorQueryRef = useRef(null), editorParamsRef = useRef(null), visionRootRef = useRef(null), customApiVersionElementRef = useRef(null), querySubscriptionRef = useRef(void 0), listenSubscriptionRef = useRef(void 0), t2;
2301
2365
  $[2] === projectId ? t2 = $[3] : (t2 = () => getLocalStorage(projectId || "default"), $[2] = projectId, $[3] = t2);
@@ -2634,8 +2698,17 @@ function VisionGui(props) {
2634
2698
  })
2635
2699
  }), $[176] = paneSizeOptions.allowResize, $[177] = paneSizeOptions.maxSize, $[178] = paneSizeOptions.size, $[179] = t52, $[180] = t55, $[181] = t60, $[182] = t63, $[183] = t64) : t64 = $[183];
2636
2700
  let t65;
2637
- $[184] !== dataset || $[185] !== e2eTime || $[186] !== error || $[187] !== listenInProgress || $[188] !== listenMutations || $[189] !== queryInProgress || $[190] !== queryResult || $[191] !== queryTime ? (t65 = /* @__PURE__ */ jsx(VisionGuiResult, {
2701
+ $[184] !== perspective || $[185] !== perspectiveStack || $[186] !== scheduledDraftsStack ? (t65 = getActivePerspective({
2702
+ visionPerspective: perspective,
2703
+ perspectiveStack,
2704
+ scheduledDraftsStack
2705
+ }), $[184] = perspective, $[185] = perspectiveStack, $[186] = scheduledDraftsStack, $[187] = t65) : t65 = $[187];
2706
+ let t66;
2707
+ $[188] !== activeVariant || $[189] !== dataset || $[190] !== e2eTime || $[191] !== error || $[192] !== listenInProgress || $[193] !== listenMutations || $[194] !== queryInProgress || $[195] !== queryResult || $[196] !== queryTime || $[197] !== t65 || $[198] !== userApiVersion ? (t66 = /* @__PURE__ */ jsx(VisionGuiResult, {
2638
2708
  error,
2709
+ apiVersion: userApiVersion,
2710
+ perspective: t65,
2711
+ variant: activeVariant,
2639
2712
  queryInProgress,
2640
2713
  queryResult,
2641
2714
  listenInProgress,
@@ -2643,9 +2716,9 @@ function VisionGui(props) {
2643
2716
  dataset,
2644
2717
  queryTime,
2645
2718
  e2eTime
2646
- }), $[184] = dataset, $[185] = e2eTime, $[186] = error, $[187] = listenInProgress, $[188] = listenMutations, $[189] = queryInProgress, $[190] = queryResult, $[191] = queryTime, $[192] = t65) : t65 = $[192];
2647
- let t66;
2648
- $[193] !== t51 || $[194] !== t64 || $[195] !== t65 ? (t66 = /* @__PURE__ */ jsx(Box, {
2719
+ }), $[188] = activeVariant, $[189] = dataset, $[190] = e2eTime, $[191] = error, $[192] = listenInProgress, $[193] = listenMutations, $[194] = queryInProgress, $[195] = queryResult, $[196] = queryTime, $[197] = t65, $[198] = userApiVersion, $[199] = t66) : t66 = $[199];
2720
+ let t67;
2721
+ $[200] !== t51 || $[201] !== t64 || $[202] !== t66 ? (t67 = /* @__PURE__ */ jsx(Box, {
2649
2722
  height: "stretch",
2650
2723
  flexBasis: "0%",
2651
2724
  flexGrow: 1,
@@ -2653,54 +2726,54 @@ function VisionGui(props) {
2653
2726
  className: "sidebarPanes",
2654
2727
  split: t51,
2655
2728
  minSize: 300,
2656
- children: [t64, t65]
2729
+ children: [t64, t66]
2657
2730
  })
2658
- }), $[193] = t51, $[194] = t64, $[195] = t65, $[196] = t66) : t66 = $[196];
2659
- let t67;
2660
- $[197] === Symbol.for("react.memo_cache_sentinel") ? (t67 = {
2731
+ }), $[200] = t51, $[201] = t64, $[202] = t66, $[203] = t67) : t67 = $[203];
2732
+ let t68;
2733
+ $[204] === Symbol.for("react.memo_cache_sentinel") ? (t68 = {
2661
2734
  position: "absolute",
2662
2735
  left: -32,
2663
2736
  top: "50%",
2664
2737
  transform: "translateY(-50%)",
2665
2738
  zIndex: 100,
2666
2739
  pointerEvents: "auto"
2667
- }, $[197] = t67) : t67 = $[197];
2668
- let t68;
2669
- $[198] === isQueryRecallCollapsed ? t68 = $[199] : (t68 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[198] = isQueryRecallCollapsed, $[199] = t68);
2740
+ }, $[204] = t68) : t68 = $[204];
2670
2741
  let t69;
2671
- $[200] === Symbol.for("react.memo_cache_sentinel") ? (t69 = {
2742
+ $[205] === isQueryRecallCollapsed ? t69 = $[206] : (t69 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[205] = isQueryRecallCollapsed, $[206] = t69);
2743
+ let t70;
2744
+ $[207] === Symbol.for("react.memo_cache_sentinel") ? (t70 = {
2672
2745
  display: "flex",
2673
2746
  alignItems: "center",
2674
2747
  height: "100%"
2675
- }, $[200] = t69) : t69 = $[200];
2676
- let t70;
2677
- $[201] === isQueryRecallCollapsed ? t70 = $[202] : (t70 = /* @__PURE__ */ jsx("div", {
2678
- style: t69,
2679
- children: jsx(isQueryRecallCollapsed ? ChevronLeftIcon : ChevronRightIcon, {})
2680
- }), $[201] = isQueryRecallCollapsed, $[202] = t70);
2748
+ }, $[207] = t70) : t70 = $[207];
2681
2749
  let t71;
2682
- $[203] !== t68 || $[204] !== t70 ? (t71 = /* @__PURE__ */ jsx(Button, {
2750
+ $[208] === isQueryRecallCollapsed ? t71 = $[209] : (t71 = /* @__PURE__ */ jsx("div", {
2751
+ style: t70,
2752
+ children: jsx(isQueryRecallCollapsed ? ChevronLeftIcon : ChevronRightIcon, {})
2753
+ }), $[208] = isQueryRecallCollapsed, $[209] = t71);
2754
+ let t72;
2755
+ $[210] !== t69 || $[211] !== t71 ? (t72 = /* @__PURE__ */ jsx(Button, {
2683
2756
  mode: "ghost",
2684
2757
  padding: 2,
2685
- style: t67,
2686
- onClick: t68,
2687
- children: t70
2688
- }), $[203] = t68, $[204] = t70, $[205] = t71) : t71 = $[205];
2689
- let t72;
2690
- $[206] === params.parsed ? t72 = $[207] : (t72 = params.parsed || {}, $[206] = params.parsed, $[207] = t72);
2758
+ style: t68,
2759
+ onClick: t69,
2760
+ children: t71
2761
+ }), $[210] = t69, $[211] = t71, $[212] = t72) : t72 = $[212];
2691
2762
  let t73;
2692
- $[208] !== generateUrl || $[209] !== getStateFromUrl || $[210] !== query || $[211] !== setStateFromParsedUrl || $[212] !== t72 || $[213] !== url ? (t73 = /* @__PURE__ */ jsx(QueryRecallPaneWrapper, { children: /* @__PURE__ */ jsx(QueryRecall, {
2763
+ $[213] === params.parsed ? t73 = $[214] : (t73 = params.parsed || {}, $[213] = params.parsed, $[214] = t73);
2764
+ let t74;
2765
+ $[215] !== generateUrl || $[216] !== getStateFromUrl || $[217] !== query || $[218] !== setStateFromParsedUrl || $[219] !== t73 || $[220] !== url ? (t74 = /* @__PURE__ */ jsx(QueryRecallPaneWrapper, { children: /* @__PURE__ */ jsx(QueryRecall, {
2693
2766
  url,
2694
2767
  getStateFromUrl,
2695
2768
  setStateFromParsedUrl,
2696
2769
  currentQuery: query,
2697
- currentParams: t72,
2770
+ currentParams: t73,
2698
2771
  generateUrl
2699
- }) }), $[208] = generateUrl, $[209] = getStateFromUrl, $[210] = query, $[211] = setStateFromParsedUrl, $[212] = t72, $[213] = url, $[214] = t73) : t73 = $[214];
2700
- let t74;
2701
- $[215] !== t71 || $[216] !== t73 ? (t74 = /* @__PURE__ */ jsxs(QueryRecallPaneContainer, { children: [t71, t73] }), $[215] = t71, $[216] = t73, $[217] = t74) : t74 = $[217];
2772
+ }) }), $[215] = generateUrl, $[216] = getStateFromUrl, $[217] = query, $[218] = setStateFromParsedUrl, $[219] = t73, $[220] = url, $[221] = t74) : t74 = $[221];
2702
2773
  let t75;
2703
- $[218] !== t50 || $[219] !== t66 || $[220] !== t74 ? (t75 = /* @__PURE__ */ jsx(SplitpaneContainer, {
2774
+ $[222] !== t72 || $[223] !== t74 ? (t75 = /* @__PURE__ */ jsxs(QueryRecallPaneContainer, { children: [t72, t74] }), $[222] = t72, $[223] = t74, $[224] = t75) : t75 = $[224];
2775
+ let t76;
2776
+ $[225] !== t50 || $[226] !== t67 || $[227] !== t75 ? (t76 = /* @__PURE__ */ jsx(SplitpaneContainer, {
2704
2777
  flexBasis: "auto",
2705
2778
  flexGrow: 1,
2706
2779
  flexShrink: 1,
@@ -2710,19 +2783,19 @@ function VisionGui(props) {
2710
2783
  size: t50,
2711
2784
  maxSize: -225,
2712
2785
  primary: "first",
2713
- children: [t66, t74]
2786
+ children: [t67, t75]
2714
2787
  })
2715
- }), $[218] = t50, $[219] = t66, $[220] = t74, $[221] = t75) : t75 = $[221];
2716
- let t76;
2717
- return $[222] !== t49 || $[223] !== t75 ? (t76 = /* @__PURE__ */ jsxs(Root, {
2788
+ }), $[225] = t50, $[226] = t67, $[227] = t75, $[228] = t76) : t76 = $[228];
2789
+ let t77;
2790
+ return $[229] !== t49 || $[230] !== t76 ? (t77 = /* @__PURE__ */ jsxs(Root, {
2718
2791
  direction: "column",
2719
2792
  height: "fill",
2720
2793
  ref: visionRootRef,
2721
2794
  sizing: "border",
2722
2795
  overflow: "hidden",
2723
2796
  "data-testid": "vision-root",
2724
- children: [t49, t75]
2725
- }), $[222] = t49, $[223] = t75, $[224] = t76) : t76 = $[224], t76;
2797
+ children: [t49, t76]
2798
+ }), $[229] = t49, $[230] = t76, $[231] = t77) : t77 = $[231], t77;
2726
2799
  }
2727
2800
  function _temp2$1(release_0) {
2728
2801
  return getReleaseIdFromReleaseDocumentId(release_0._id);
@@ -2879,4 +2952,4 @@ function SanityVision(props) {
2879
2952
  }
2880
2953
  export { SanityVision as default };
2881
2954
 
2882
- //# sourceMappingURL=SanityVision-DQ63H4kn.js.map
2955
+ //# sourceMappingURL=SanityVision-II_F9zA2.js.map