@sanity/vision 6.11.0 → 6.12.0-next.112
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/{SanityVision-ChQxkYFr.js → SanityVision-II_F9zA2.js} +227 -145
- package/lib/SanityVision-II_F9zA2.js.map +1 -0
- package/lib/{i18n-B53Bf56u.js → i18n-t8J2mRUI.js} +2 -2
- package/lib/{i18n-B53Bf56u.js.map → i18n-t8J2mRUI.js.map} +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +2 -2
- package/lib/{resources-BCJQL2Cm.js → resources-CIlR0qy4.js} +5 -1
- package/lib/resources-CIlR0qy4.js.map +1 -0
- package/package.json +18 -18
- package/lib/SanityVision-ChQxkYFr.js.map +0 -1
- package/lib/resources-BCJQL2Cm.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as visionLocaleNamespace } from "./i18n-
|
|
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(
|
|
1995
|
-
$[0]
|
|
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:
|
|
1998
|
-
}), $[
|
|
1999
|
-
let
|
|
2000
|
-
$[
|
|
2001
|
-
let
|
|
2002
|
-
return $[
|
|
2003
|
-
gap:
|
|
2004
|
-
marginTop:
|
|
2005
|
-
children: [
|
|
2006
|
-
|
|
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,123 +2192,124 @@ function SaveJsonButton(t0) {
|
|
|
2133
2192
|
}), $[0] = blobUrl, $[1] = t1), t1;
|
|
2134
2193
|
}
|
|
2135
2194
|
function VisionGuiResult(t0) {
|
|
2136
|
-
let $ = c(
|
|
2137
|
-
$[0]
|
|
2138
|
-
let
|
|
2139
|
-
$[
|
|
2140
|
-
let csvUrl = t3, t4 = error ? "critical" : "default", t5 = !!error, t6;
|
|
2141
|
-
$[6] === t ? t6 = $[7] : (t6 = t("result.label"), $[6] = t, $[7] = t6);
|
|
2142
|
-
let t7;
|
|
2143
|
-
$[8] === t6 ? t7 = $[9] : (t7 = /* @__PURE__ */ jsx(InputBackgroundContainer, { children: /* @__PURE__ */ jsx(Box, {
|
|
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;
|
|
2196
|
+
$[0] === t ? t4 = $[1] : (t4 = t("result.label"), $[0] = t, $[1] = t4);
|
|
2197
|
+
let t5;
|
|
2198
|
+
$[2] === t4 ? t5 = $[3] : (t5 = /* @__PURE__ */ jsx(InputBackgroundContainer, { children: /* @__PURE__ */ jsx(Box, {
|
|
2144
2199
|
marginLeft: 3,
|
|
2145
2200
|
children: /* @__PURE__ */ jsx(StyledLabel, {
|
|
2146
2201
|
muted: !0,
|
|
2147
|
-
children:
|
|
2202
|
+
children: t4
|
|
2148
2203
|
})
|
|
2149
|
-
}) }), $[
|
|
2150
|
-
let
|
|
2151
|
-
$[
|
|
2204
|
+
}) }), $[2] = t4, $[3] = t5);
|
|
2205
|
+
let t6;
|
|
2206
|
+
$[4] !== listenInProgress || $[5] !== listenMutations || $[6] !== queryInProgress ? (t6 = (queryInProgress || listenInProgress && listenMutations.length === 0) && /* @__PURE__ */ jsx(Box, {
|
|
2152
2207
|
marginTop: 3,
|
|
2153
2208
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
2154
|
-
}), $[
|
|
2155
|
-
let
|
|
2156
|
-
$[
|
|
2157
|
-
|
|
2158
|
-
|
|
2209
|
+
}), $[4] = listenInProgress, $[5] = listenMutations, $[6] = queryInProgress, $[7] = t6) : t6 = $[7];
|
|
2210
|
+
let 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];
|
|
2217
|
+
let t8;
|
|
2218
|
+
$[13] !== dataset || $[14] !== hasResult || $[15] !== queryResult ? (t8 = hasResult && /* @__PURE__ */ jsx(ResultView, {
|
|
2159
2219
|
data: queryResult,
|
|
2160
2220
|
datasetName: dataset
|
|
2161
|
-
}), $[
|
|
2162
|
-
let
|
|
2163
|
-
$[
|
|
2221
|
+
}), $[13] = dataset, $[14] = hasResult, $[15] = queryResult, $[16] = t8) : t8 = $[16];
|
|
2222
|
+
let t9;
|
|
2223
|
+
$[17] !== dataset || $[18] !== listenInProgress || $[19] !== listenMutations ? (t9 = listenInProgress && listenMutations.length > 0 && /* @__PURE__ */ jsx(ResultView, {
|
|
2164
2224
|
data: listenMutations,
|
|
2165
2225
|
datasetName: dataset
|
|
2166
|
-
}), $[
|
|
2167
|
-
let
|
|
2168
|
-
$[
|
|
2226
|
+
}), $[17] = dataset, $[18] = listenInProgress, $[19] = listenMutations, $[20] = t9) : t9 = $[20];
|
|
2227
|
+
let t10;
|
|
2228
|
+
$[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 ? (t10 = /* @__PURE__ */ jsxs(Box, {
|
|
2169
2229
|
padding: 3,
|
|
2170
2230
|
paddingTop: 5,
|
|
2171
2231
|
children: [
|
|
2232
|
+
t6,
|
|
2233
|
+
t7,
|
|
2172
2234
|
t8,
|
|
2173
|
-
t9
|
|
2174
|
-
t10,
|
|
2175
|
-
t11
|
|
2235
|
+
t9
|
|
2176
2236
|
]
|
|
2177
|
-
}), $[
|
|
2178
|
-
let
|
|
2179
|
-
$[
|
|
2237
|
+
}), $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t10) : t10 = $[25];
|
|
2238
|
+
let t11;
|
|
2239
|
+
$[26] !== t10 || $[27] !== t5 ? (t11 = /* @__PURE__ */ jsxs(Result, {
|
|
2180
2240
|
overflow: "auto",
|
|
2181
|
-
children: [
|
|
2182
|
-
}), $[
|
|
2183
|
-
let
|
|
2184
|
-
$[
|
|
2241
|
+
children: [t5, t10]
|
|
2242
|
+
}), $[26] = t10, $[27] = t5, $[28] = t11) : t11 = $[28];
|
|
2243
|
+
let t12;
|
|
2244
|
+
$[29] !== t11 || $[30] !== t2 || $[31] !== t3 ? (t12 = /* @__PURE__ */ jsx(ResultInnerContainer, {
|
|
2185
2245
|
flexBasis: "0%",
|
|
2186
2246
|
flexGrow: 1,
|
|
2187
2247
|
children: /* @__PURE__ */ jsx(ResultContainer, {
|
|
2188
2248
|
flex: 1,
|
|
2189
2249
|
overflow: "hidden",
|
|
2190
|
-
tone:
|
|
2191
|
-
isInvalid:
|
|
2192
|
-
children:
|
|
2250
|
+
tone: t2,
|
|
2251
|
+
isInvalid: t3,
|
|
2252
|
+
children: t11
|
|
2193
2253
|
})
|
|
2194
|
-
}), $[
|
|
2195
|
-
let
|
|
2196
|
-
$[
|
|
2254
|
+
}), $[29] = t11, $[30] = t2, $[31] = t3, $[32] = t12) : t12 = $[32];
|
|
2255
|
+
let t13 = compactFooter ? "flex-start" : "space-between", t14 = compactFooter ? "stretch" : void 0, t15;
|
|
2256
|
+
$[33] === compactFooter ? t15 = $[34] : (t15 = compactFooter ? "column" : [
|
|
2197
2257
|
"column",
|
|
2198
2258
|
"column",
|
|
2199
2259
|
"row"
|
|
2200
|
-
], $[
|
|
2201
|
-
let
|
|
2202
|
-
$[
|
|
2203
|
-
let
|
|
2204
|
-
$[
|
|
2205
|
-
let
|
|
2206
|
-
$[
|
|
2207
|
-
let
|
|
2208
|
-
$[
|
|
2260
|
+
], $[33] = compactFooter, $[34] = t15);
|
|
2261
|
+
let t16 = compactFooter ? 3 : 4, t17 = compactFooter ? 2 : 3, t18;
|
|
2262
|
+
$[35] === compactFooter ? t18 = $[36] : (t18 = compactFooter ? { width: "100%" } : { minWidth: 0 }, $[35] = compactFooter, $[36] = t18);
|
|
2263
|
+
let t19 = compactFooter ? 1 : 2, t20;
|
|
2264
|
+
$[37] === t ? t20 = $[38] : (t20 = t("result.execution-time-label"), $[37] = t, $[38] = t20);
|
|
2265
|
+
let t21;
|
|
2266
|
+
$[39] !== queryTime || $[40] !== t ? (t21 = typeof queryTime == "number" ? `${queryTime}ms` : t("result.timing-not-applicable"), $[39] = queryTime, $[40] = t, $[41] = t21) : t21 = $[41];
|
|
2267
|
+
let t22;
|
|
2268
|
+
$[42] !== t19 || $[43] !== t20 || $[44] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
|
|
2209
2269
|
muted: !0,
|
|
2210
|
-
size:
|
|
2270
|
+
size: t19,
|
|
2211
2271
|
children: [
|
|
2212
|
-
|
|
2272
|
+
t20,
|
|
2213
2273
|
":",
|
|
2214
2274
|
" ",
|
|
2215
|
-
|
|
2275
|
+
t21
|
|
2216
2276
|
]
|
|
2217
|
-
}) }), $[
|
|
2218
|
-
let
|
|
2219
|
-
$[
|
|
2220
|
-
let
|
|
2221
|
-
$[
|
|
2222
|
-
let
|
|
2223
|
-
$[
|
|
2277
|
+
}) }), $[42] = t19, $[43] = t20, $[44] = t21, $[45] = t22) : t22 = $[45];
|
|
2278
|
+
let t23 = compactFooter ? 3 : 4, t24 = compactFooter ? 1 : 2, t25;
|
|
2279
|
+
$[46] === t ? t25 = $[47] : (t25 = t("result.end-to-end-time-label"), $[46] = t, $[47] = t25);
|
|
2280
|
+
let t26;
|
|
2281
|
+
$[48] !== e2eTime || $[49] !== t ? (t26 = typeof e2eTime == "number" ? `${e2eTime}ms` : t("result.timing-not-applicable"), $[48] = e2eTime, $[49] = t, $[50] = t26) : t26 = $[50];
|
|
2282
|
+
let t27;
|
|
2283
|
+
$[51] !== t24 || $[52] !== t25 || $[53] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Text, {
|
|
2224
2284
|
muted: !0,
|
|
2225
|
-
size:
|
|
2285
|
+
size: t24,
|
|
2226
2286
|
children: [
|
|
2227
|
-
|
|
2287
|
+
t25,
|
|
2228
2288
|
":",
|
|
2229
2289
|
" ",
|
|
2230
|
-
|
|
2290
|
+
t26
|
|
2231
2291
|
]
|
|
2232
|
-
}), $[
|
|
2292
|
+
}), $[51] = t24, $[52] = t25, $[53] = t26, $[54] = t27) : t27 = $[54];
|
|
2293
|
+
let t28;
|
|
2294
|
+
$[55] !== t23 || $[56] !== t27 ? (t28 = /* @__PURE__ */ jsx(Box, {
|
|
2295
|
+
marginLeft: t23,
|
|
2296
|
+
children: t27
|
|
2297
|
+
}), $[55] = t23, $[56] = t27, $[57] = t28) : t28 = $[57];
|
|
2298
|
+
let t29;
|
|
2299
|
+
$[58] !== t22 || $[59] !== t28 ? (t29 = /* @__PURE__ */ jsxs(TimingsTextContainer, {
|
|
2300
|
+
align: "center",
|
|
2301
|
+
children: [t22, t28]
|
|
2302
|
+
}), $[58] = t22, $[59] = t28, $[60] = t29) : t29 = $[60];
|
|
2233
2303
|
let t30;
|
|
2234
|
-
$[
|
|
2235
|
-
|
|
2304
|
+
$[61] !== t16 || $[62] !== t17 || $[63] !== t18 || $[64] !== t29 ? (t30 = /* @__PURE__ */ jsx(TimingsCard, {
|
|
2305
|
+
paddingX: t16,
|
|
2306
|
+
paddingY: t17,
|
|
2307
|
+
sizing: "border",
|
|
2308
|
+
style: t18,
|
|
2236
2309
|
children: t29
|
|
2237
|
-
}), $[
|
|
2310
|
+
}), $[61] = t16, $[62] = t17, $[63] = t18, $[64] = t29, $[65] = t30) : t30 = $[65];
|
|
2238
2311
|
let t31;
|
|
2239
|
-
$[
|
|
2240
|
-
align: "center",
|
|
2241
|
-
children: [t24, t30]
|
|
2242
|
-
}), $[61] = t24, $[62] = t30, $[63] = t31) : t31 = $[63];
|
|
2243
|
-
let t32;
|
|
2244
|
-
$[64] !== t18 || $[65] !== t19 || $[66] !== t20 || $[67] !== t31 ? (t32 = /* @__PURE__ */ jsx(TimingsCard, {
|
|
2245
|
-
paddingX: t18,
|
|
2246
|
-
paddingY: t19,
|
|
2247
|
-
sizing: "border",
|
|
2248
|
-
style: t20,
|
|
2249
|
-
children: t31
|
|
2250
|
-
}), $[64] = t18, $[65] = t19, $[66] = t20, $[67] = t31, $[68] = t32) : t32 = $[68];
|
|
2251
|
-
let t33;
|
|
2252
|
-
$[69] !== compactFooter || $[70] !== csvUrl || $[71] !== hasResult || $[72] !== jsonUrl || $[73] !== t ? (t33 = hasResult && /* @__PURE__ */ jsx(DownloadsCard, {
|
|
2312
|
+
$[66] !== compactFooter || $[67] !== hasResult || $[68] !== queryResult || $[69] !== t ? (t31 = hasResult && /* @__PURE__ */ jsx(DownloadsCard, {
|
|
2253
2313
|
paddingX: compactFooter ? 3 : 4,
|
|
2254
2314
|
paddingY: compactFooter ? 2 : 3,
|
|
2255
2315
|
sizing: "border",
|
|
@@ -2261,32 +2321,45 @@ function VisionGuiResult(t0) {
|
|
|
2261
2321
|
muted: !0,
|
|
2262
2322
|
size: compactFooter ? 1 : 2,
|
|
2263
2323
|
children: /* @__PURE__ */ jsx(Translate, {
|
|
2264
|
-
components: { SaveResultButtons
|
|
2324
|
+
components: { SaveResultButtons },
|
|
2325
|
+
componentProps: { queryResult },
|
|
2265
2326
|
i18nKey: "result.save-result-as-format",
|
|
2266
2327
|
t
|
|
2267
2328
|
})
|
|
2268
2329
|
})
|
|
2269
|
-
}), $[
|
|
2270
|
-
let
|
|
2271
|
-
$[
|
|
2272
|
-
justify:
|
|
2273
|
-
align:
|
|
2274
|
-
direction:
|
|
2275
|
-
children: [
|
|
2276
|
-
}), $[
|
|
2277
|
-
let
|
|
2278
|
-
return $[
|
|
2330
|
+
}), $[66] = compactFooter, $[67] = hasResult, $[68] = queryResult, $[69] = t, $[70] = t31) : t31 = $[70];
|
|
2331
|
+
let t32;
|
|
2332
|
+
$[71] !== t13 || $[72] !== t14 || $[73] !== t15 || $[74] !== t30 || $[75] !== t31 ? (t32 = /* @__PURE__ */ jsxs(ResultFooter, {
|
|
2333
|
+
justify: t13,
|
|
2334
|
+
align: t14,
|
|
2335
|
+
direction: t15,
|
|
2336
|
+
children: [t30, t31]
|
|
2337
|
+
}), $[71] = t13, $[72] = t14, $[73] = t15, $[74] = t30, $[75] = t31, $[76] = t32) : t32 = $[76];
|
|
2338
|
+
let t33;
|
|
2339
|
+
return $[77] !== t12 || $[78] !== t32 ? (t33 = /* @__PURE__ */ jsxs(ResultOuterContainer, {
|
|
2279
2340
|
direction: "column",
|
|
2280
2341
|
"data-testid": "vision-result",
|
|
2281
|
-
children: [
|
|
2282
|
-
}), $[
|
|
2342
|
+
children: [t12, t32]
|
|
2343
|
+
}), $[77] = t12, $[78] = t32, $[79] = t33) : t33 = $[79], t33;
|
|
2344
|
+
}
|
|
2345
|
+
function SaveResultButtons(t0) {
|
|
2346
|
+
let $ = c(11), { queryResult } = t0, t1;
|
|
2347
|
+
$[0] === queryResult ? t1 = $[1] : (t1 = getJsonBlobUrl(queryResult), $[0] = queryResult, $[1] = t1);
|
|
2348
|
+
let jsonUrl = t1, t2;
|
|
2349
|
+
$[2] === queryResult ? t2 = $[3] : (t2 = getCsvBlobUrl(queryResult), $[2] = queryResult, $[3] = t2);
|
|
2350
|
+
let csvUrl = t2, t3;
|
|
2351
|
+
$[4] === jsonUrl ? t3 = $[5] : (t3 = /* @__PURE__ */ jsx(SaveJsonButton, { blobUrl: jsonUrl }), $[4] = jsonUrl, $[5] = t3);
|
|
2352
|
+
let t4;
|
|
2353
|
+
$[6] === csvUrl ? t4 = $[7] : (t4 = /* @__PURE__ */ jsx(SaveCsvButton, { blobUrl: csvUrl }), $[6] = csvUrl, $[7] = t4);
|
|
2354
|
+
let t5;
|
|
2355
|
+
return $[8] !== t3 || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t3, t4] }), $[8] = t3, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
|
|
2283
2356
|
}
|
|
2284
2357
|
function nodeContains(node, other) {
|
|
2285
2358
|
return !node || !other ? !1 : node === other || !!(node.compareDocumentPosition(other) & 16);
|
|
2286
2359
|
}
|
|
2287
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);
|
|
2288
2361
|
function VisionGui(props) {
|
|
2289
|
-
let $ = c(
|
|
2362
|
+
let $ = c(232), { datasets, config, projectId, defaultDataset } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantName } = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
|
|
2290
2363
|
$[0] === t0 ? t1 = $[1] : (t1 = t0 === void 0 ? [] : t0, $[0] = t0, $[1] = t1);
|
|
2291
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;
|
|
2292
2365
|
$[2] === projectId ? t2 = $[3] : (t2 = () => getLocalStorage(projectId || "default"), $[2] = projectId, $[3] = t2);
|
|
@@ -2625,8 +2698,17 @@ function VisionGui(props) {
|
|
|
2625
2698
|
})
|
|
2626
2699
|
}), $[176] = paneSizeOptions.allowResize, $[177] = paneSizeOptions.maxSize, $[178] = paneSizeOptions.size, $[179] = t52, $[180] = t55, $[181] = t60, $[182] = t63, $[183] = t64) : t64 = $[183];
|
|
2627
2700
|
let t65;
|
|
2628
|
-
$[184] !==
|
|
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, {
|
|
2629
2708
|
error,
|
|
2709
|
+
apiVersion: userApiVersion,
|
|
2710
|
+
perspective: t65,
|
|
2711
|
+
variant: activeVariant,
|
|
2630
2712
|
queryInProgress,
|
|
2631
2713
|
queryResult,
|
|
2632
2714
|
listenInProgress,
|
|
@@ -2634,9 +2716,9 @@ function VisionGui(props) {
|
|
|
2634
2716
|
dataset,
|
|
2635
2717
|
queryTime,
|
|
2636
2718
|
e2eTime
|
|
2637
|
-
}), $[
|
|
2638
|
-
let
|
|
2639
|
-
$[
|
|
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, {
|
|
2640
2722
|
height: "stretch",
|
|
2641
2723
|
flexBasis: "0%",
|
|
2642
2724
|
flexGrow: 1,
|
|
@@ -2644,54 +2726,54 @@ function VisionGui(props) {
|
|
|
2644
2726
|
className: "sidebarPanes",
|
|
2645
2727
|
split: t51,
|
|
2646
2728
|
minSize: 300,
|
|
2647
|
-
children: [t64,
|
|
2729
|
+
children: [t64, t66]
|
|
2648
2730
|
})
|
|
2649
|
-
}), $[
|
|
2650
|
-
let
|
|
2651
|
-
$[
|
|
2731
|
+
}), $[200] = t51, $[201] = t64, $[202] = t66, $[203] = t67) : t67 = $[203];
|
|
2732
|
+
let t68;
|
|
2733
|
+
$[204] === Symbol.for("react.memo_cache_sentinel") ? (t68 = {
|
|
2652
2734
|
position: "absolute",
|
|
2653
2735
|
left: -32,
|
|
2654
2736
|
top: "50%",
|
|
2655
2737
|
transform: "translateY(-50%)",
|
|
2656
2738
|
zIndex: 100,
|
|
2657
2739
|
pointerEvents: "auto"
|
|
2658
|
-
}, $[
|
|
2659
|
-
let t68;
|
|
2660
|
-
$[198] === isQueryRecallCollapsed ? t68 = $[199] : (t68 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[198] = isQueryRecallCollapsed, $[199] = t68);
|
|
2740
|
+
}, $[204] = t68) : t68 = $[204];
|
|
2661
2741
|
let t69;
|
|
2662
|
-
$[
|
|
2742
|
+
$[205] === isQueryRecallCollapsed ? t69 = $[206] : (t69 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[205] = isQueryRecallCollapsed, $[206] = t69);
|
|
2743
|
+
let t70;
|
|
2744
|
+
$[207] === Symbol.for("react.memo_cache_sentinel") ? (t70 = {
|
|
2663
2745
|
display: "flex",
|
|
2664
2746
|
alignItems: "center",
|
|
2665
2747
|
height: "100%"
|
|
2666
|
-
}, $[
|
|
2667
|
-
let t70;
|
|
2668
|
-
$[201] === isQueryRecallCollapsed ? t70 = $[202] : (t70 = /* @__PURE__ */ jsx("div", {
|
|
2669
|
-
style: t69,
|
|
2670
|
-
children: jsx(isQueryRecallCollapsed ? ChevronLeftIcon : ChevronRightIcon, {})
|
|
2671
|
-
}), $[201] = isQueryRecallCollapsed, $[202] = t70);
|
|
2748
|
+
}, $[207] = t70) : t70 = $[207];
|
|
2672
2749
|
let t71;
|
|
2673
|
-
$[
|
|
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, {
|
|
2674
2756
|
mode: "ghost",
|
|
2675
2757
|
padding: 2,
|
|
2676
|
-
style:
|
|
2677
|
-
onClick:
|
|
2678
|
-
children:
|
|
2679
|
-
}), $[
|
|
2680
|
-
let t72;
|
|
2681
|
-
$[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];
|
|
2682
2762
|
let t73;
|
|
2683
|
-
$[
|
|
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, {
|
|
2684
2766
|
url,
|
|
2685
2767
|
getStateFromUrl,
|
|
2686
2768
|
setStateFromParsedUrl,
|
|
2687
2769
|
currentQuery: query,
|
|
2688
|
-
currentParams:
|
|
2770
|
+
currentParams: t73,
|
|
2689
2771
|
generateUrl
|
|
2690
|
-
}) }), $[
|
|
2691
|
-
let t74;
|
|
2692
|
-
$[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];
|
|
2693
2773
|
let t75;
|
|
2694
|
-
$[
|
|
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, {
|
|
2695
2777
|
flexBasis: "auto",
|
|
2696
2778
|
flexGrow: 1,
|
|
2697
2779
|
flexShrink: 1,
|
|
@@ -2701,19 +2783,19 @@ function VisionGui(props) {
|
|
|
2701
2783
|
size: t50,
|
|
2702
2784
|
maxSize: -225,
|
|
2703
2785
|
primary: "first",
|
|
2704
|
-
children: [
|
|
2786
|
+
children: [t67, t75]
|
|
2705
2787
|
})
|
|
2706
|
-
}), $[
|
|
2707
|
-
let
|
|
2708
|
-
return $[
|
|
2788
|
+
}), $[225] = t50, $[226] = t67, $[227] = t75, $[228] = t76) : t76 = $[228];
|
|
2789
|
+
let t77;
|
|
2790
|
+
return $[229] !== t49 || $[230] !== t76 ? (t77 = /* @__PURE__ */ jsxs(Root, {
|
|
2709
2791
|
direction: "column",
|
|
2710
2792
|
height: "fill",
|
|
2711
2793
|
ref: visionRootRef,
|
|
2712
2794
|
sizing: "border",
|
|
2713
2795
|
overflow: "hidden",
|
|
2714
2796
|
"data-testid": "vision-root",
|
|
2715
|
-
children: [t49,
|
|
2716
|
-
}), $[
|
|
2797
|
+
children: [t49, t76]
|
|
2798
|
+
}), $[229] = t49, $[230] = t76, $[231] = t77) : t77 = $[231], t77;
|
|
2717
2799
|
}
|
|
2718
2800
|
function _temp2$1(release_0) {
|
|
2719
2801
|
return getReleaseIdFromReleaseDocumentId(release_0._id);
|
|
@@ -2870,4 +2952,4 @@ function SanityVision(props) {
|
|
|
2870
2952
|
}
|
|
2871
2953
|
export { SanityVision as default };
|
|
2872
2954
|
|
|
2873
|
-
//# sourceMappingURL=SanityVision-
|
|
2955
|
+
//# sourceMappingURL=SanityVision-II_F9zA2.js.map
|