@sanity/vision 6.21.0-next.53 → 6.21.0-next.64
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-lYX0oOV-.js → SanityVision-BPTjMcT_.js} +129 -122
- package/lib/SanityVision-BPTjMcT_.js.map +1 -0
- package/lib/{VistaGui-ufsccNLQ.js → VistaGui-CFsbMx2g.js} +117 -103
- package/lib/VistaGui-CFsbMx2g.js.map +1 -0
- package/lib/bundle.css +199 -199
- package/lib/{i18n-JS8KzGj8.js → i18n-fzZ8Bvax.js} +2 -2
- package/lib/{i18n-JS8KzGj8.js.map → i18n-fzZ8Bvax.js.map} +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +2 -2
- package/lib/{resources-DFprICyb.js → resources-CFs_-mXU.js} +5 -1
- package/lib/{resources-DFprICyb.js.map → resources-CFs_-mXU.js.map} +1 -1
- package/package.json +5 -5
- package/lib/SanityVision-lYX0oOV-.js.map +0 -1
- package/lib/VistaGui-ufsccNLQ.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as visionLocaleNamespace } from "./i18n-
|
|
1
|
+
import { t as visionLocaleNamespace } from "./i18n-fzZ8Bvax.js";
|
|
2
2
|
import { Component, Fragment, Suspense, createContext, lazy, use, useEffect, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { ContextMenuButton, RELEASES_STUDIO_CLIENT_OPTIONS, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getDefaultVariant, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
|
|
4
4
|
import { IntentLink } from "sanity/router";
|
|
@@ -294,7 +294,7 @@ function getVisibleColumns(view, { lines, scrollbarWidth } = {}) {
|
|
|
294
294
|
let { scrollDOM, contentDOM, defaultCharacterWidth, defaultLineHeight } = view, gutters = scrollDOM.querySelector(".cm-gutters"), line = contentDOM.querySelector(".cm-line"), currentLines = view.state.doc.lines, nextLines = lines ?? currentLines, gutterGrowth = (lineNumberDigits(nextLines) - lineNumberDigits(currentLines)) * defaultCharacterWidth, willOverflowVertically = nextLines * defaultLineHeight + insets(contentDOM, ["Top", "Bottom"]) > scrollDOM.clientHeight, hasVerticalScrollbar = scrollDOM.scrollHeight > scrollDOM.clientHeight, scrollbarReserve = willOverflowVertically && !hasVerticalScrollbar ? scrollbarWidth ?? getScrollbarWidth() : 0, width = scrollDOM.clientWidth - (gutters instanceof HTMLElement ? gutters.offsetWidth : 0) - gutterGrowth - insets(contentDOM, ["Left", "Right"]) - (line ? insets(line, ["Left", "Right"]) : 0) - scrollbarReserve, columns = Math.floor(width / defaultCharacterWidth);
|
|
295
295
|
return Number.isFinite(columns) && columns > 0 ? columns : void 0;
|
|
296
296
|
}
|
|
297
|
-
var contentBorderRightWidthVar = "var(--
|
|
297
|
+
var contentBorderRightWidthVar = "var(--dohny71)", contentPaddingTopVar = "var(--dohny72)", editorRoot = "dohny73", editorRootAutoHeight = "dohny74", linePaddingLeftVar = "var(--dohny70)";
|
|
298
298
|
function EditorRoot(t0) {
|
|
299
299
|
let $ = c(14), { autoHeight, underHeader, children } = t0, { sanity } = useTheme(), t1 = autoHeight ? `${editorRoot} ${editorRootAutoHeight}` : editorRoot, t2;
|
|
300
300
|
$[0] === sanity.space[3] ? t2 = $[1] : (t2 = rem(sanity.space[3]), $[0] = sanity.space[3], $[1] = t2);
|
|
@@ -399,6 +399,14 @@ function VisionCodeMirror(t0) {
|
|
|
399
399
|
children: t14
|
|
400
400
|
}), $[17] = autoHeight, $[18] = t14, $[19] = underHeader, $[20] = t15) : t15 = $[20], t15;
|
|
401
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Whether the workspace has variants switched on (`beta.variants.enabled`). The studio gates its
|
|
404
|
+
* own variant UI on this flag, the navbar's variant selector included, so Vision shows and sends
|
|
405
|
+
* variants only where the navbar does.
|
|
406
|
+
*/
|
|
407
|
+
function useVariantsEnabled() {
|
|
408
|
+
return !!useWorkspace().beta?.variants?.enabled;
|
|
409
|
+
}
|
|
402
410
|
const SUPPORTED_PERSPECTIVES = [
|
|
403
411
|
"pinnedRelease",
|
|
404
412
|
"scheduledDrafts",
|
|
@@ -595,7 +603,7 @@ function tryParseParams(val, t) {
|
|
|
595
603
|
return err.message = `${t("params.error.params-invalid-json")}:\n\n${err.message.replace("JSON5:", "")}`, err;
|
|
596
604
|
}
|
|
597
605
|
}
|
|
598
|
-
var controlsContainer = "
|
|
606
|
+
var controlsContainer = "aqbsvxm", downloadsCard = "aqbsvxj", header = "aqbsvx3", inputBackgroundContainer = "aqbsvx7", inputBackgroundContainerLeft = "aqbsvx8", inputContainer = "aqbsvx9", queryCopyLink = "aqbsvx6", queryRecallPaneContainer = "aqbsvx1", queryRecallPaneWrapper = "aqbsvx2", result = "aqbsvxe", resultContainer = "aqbsvxc", resultContainerInvalid = "aqbsvxd", resultFooter = "aqbsvxf", resultInnerContainer = "aqbsvxb", resultOuterContainer = "aqbsvxa", root = "aqbsvx0", saveResultLabel = "aqbsvxl", saveResultSpanGapVar = "var(--aqbsvxk)", splitpaneContainer = "aqbsvx5", styledLabel = "aqbsvx4", timingsCard = "aqbsvxg", timingsTextContainer = "aqbsvxi", timingsTextMinHeightVar = "var(--aqbsvxh)";
|
|
599
607
|
function Root(t0) {
|
|
600
608
|
let $ = c(6), props, ref;
|
|
601
609
|
$[0] === t0 ? (props = $[1], ref = $[2]) : ({ref, ...props} = t0, $[0] = t0, $[1] = props, $[2] = ref);
|
|
@@ -1109,7 +1117,7 @@ function _temp2$4(a, b) {
|
|
|
1109
1117
|
return new Date(b.savedAt || 0).getTime() - new Date(a.savedAt || 0).getTime();
|
|
1110
1118
|
}
|
|
1111
1119
|
function _temp$6() {}
|
|
1112
|
-
var fixedHeader = "
|
|
1120
|
+
var fixedHeader = "j5r4cy0", queryList = "j5r4cy2", scrollContainer = "j5r4cy1";
|
|
1113
1121
|
function FixedHeader(props) {
|
|
1114
1122
|
let $ = c(2), t0;
|
|
1115
1123
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(VStack, {
|
|
@@ -1879,7 +1887,7 @@ function VisionGuiControls(t0) {
|
|
|
1879
1887
|
})
|
|
1880
1888
|
}) }), $[30] = hasValidParams, $[31] = t15, $[32] = t2, $[33] = t16) : t16 = $[33], t16;
|
|
1881
1889
|
}
|
|
1882
|
-
var dot = "
|
|
1890
|
+
var dot = "gl42tl2", perspectivePopoverContent = "gl42tl0", perspectivePopoverLink = "gl42tl1";
|
|
1883
1891
|
function PerspectivePopoverContent(props) {
|
|
1884
1892
|
let $ = c(2), t0;
|
|
1885
1893
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
@@ -1996,125 +2004,123 @@ function _temp$4(o) {
|
|
|
1996
2004
|
return !o;
|
|
1997
2005
|
}
|
|
1998
2006
|
const PinnedReleasePerspectiveOption = (t0) => {
|
|
1999
|
-
let $ = c(
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
} else t1 = $[2];
|
|
2004
|
-
let variantTitle = t1, t2;
|
|
2005
|
-
$[5] !== pinnedPerspective || $[6] !== t ? (t2 = hasPinnedPerspective(pinnedPerspective) ? `(${t("settings.perspectives.pinned-release-label")})` : t("settings.perspectives.pinned-release-label"), $[5] = pinnedPerspective, $[6] = t, $[7] = t2) : t2 = $[7];
|
|
2006
|
-
let label = t2, t3 = variantTitle ? `· ${variantTitle}` : void 0, t4;
|
|
2007
|
-
$[8] !== label || $[9] !== name || $[10] !== t3 ? (t4 = [
|
|
2007
|
+
let $ = c(12), { pinnedPerspective, variantTitle, t } = t0, name = typeof pinnedPerspective.selectedPerspective == "object" ? pinnedPerspective.selectedPerspective.metadata.title : pinnedPerspective.selectedPerspectiveName, t1;
|
|
2008
|
+
$[0] !== pinnedPerspective || $[1] !== t ? (t1 = hasPinnedPerspective(pinnedPerspective) ? `(${t("settings.perspectives.pinned-release-label")})` : t("settings.perspectives.pinned-release-label"), $[0] = pinnedPerspective, $[1] = t, $[2] = t1) : t1 = $[2];
|
|
2009
|
+
let label = t1, t2 = variantTitle ? `· ${variantTitle}` : void 0, t3;
|
|
2010
|
+
$[3] !== label || $[4] !== name || $[5] !== t2 ? (t3 = [
|
|
2008
2011
|
name,
|
|
2009
|
-
|
|
2012
|
+
t2,
|
|
2010
2013
|
label
|
|
2011
|
-
].filter(_temp$3), $[
|
|
2012
|
-
let text =
|
|
2013
|
-
$[
|
|
2014
|
-
let
|
|
2015
|
-
return $[
|
|
2014
|
+
].filter(_temp$3), $[3] = label, $[4] = name, $[5] = t2, $[6] = t3) : t3 = $[6];
|
|
2015
|
+
let text = t3.join(" "), t4;
|
|
2016
|
+
$[7] === pinnedPerspective ? t4 = $[8] : (t4 = hasPinnedPerspective(pinnedPerspective), $[7] = pinnedPerspective, $[8] = t4);
|
|
2017
|
+
let t5 = !t4, t6;
|
|
2018
|
+
return $[9] !== t5 || $[10] !== text ? (t6 = /* @__PURE__ */ jsx("option", {
|
|
2016
2019
|
value: "pinnedRelease",
|
|
2017
|
-
disabled:
|
|
2020
|
+
disabled: t5,
|
|
2018
2021
|
children: text
|
|
2019
|
-
}), $[
|
|
2022
|
+
}), $[9] = t5, $[10] = text, $[11] = t6) : t6 = $[11], t6;
|
|
2020
2023
|
};
|
|
2021
2024
|
function VisionGuiHeader(t0) {
|
|
2022
|
-
let $ = c(
|
|
2023
|
-
$[0] !==
|
|
2024
|
-
|
|
2025
|
-
|
|
2025
|
+
let $ = c(85), { onChangeDataset, dataset, customApiVersion, apiVersion, onChangeApiVersion, datasets, customApiVersionElementRef, onCustomApiVersionChange, isValidApiVersion, onChangePerspective, url, perspective, isScheduledDraftsEnabled } = t0, pinnedPerspective = usePerspective(), isVariantsEnabled = useVariantsEnabled(), navbarVariantTitle, t1, t2;
|
|
2026
|
+
if ($[0] !== isVariantsEnabled || $[1] !== perspective || $[2] !== pinnedPerspective) {
|
|
2027
|
+
let navbarVariantName = isVariantsEnabled ? getDefaultVariant(pinnedPerspective.selectedVariantNames) : void 0, navbarVariant = isVariantsEnabled ? getDefaultVariant(pinnedPerspective.selectedVariants) : void 0;
|
|
2028
|
+
navbarVariantTitle = navbarVariant ? getVariantTitle(navbarVariant) : navbarVariantName, t1 = Boolean, t2 = getActiveVariant(perspective, navbarVariantName), $[0] = isVariantsEnabled, $[1] = perspective, $[2] = pinnedPerspective, $[3] = navbarVariantTitle, $[4] = t1, $[5] = t2;
|
|
2029
|
+
} else navbarVariantTitle = $[3], t1 = $[4], t2 = $[5];
|
|
2030
|
+
let isApiVersionLocked = t1(t2), { t } = useTranslation(visionLocaleNamespace), operationUrlElement = useRef(null), t3;
|
|
2031
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
|
|
2026
2032
|
let el = operationUrlElement.current;
|
|
2027
2033
|
if (el) try {
|
|
2028
2034
|
el.select(), document.execCommand("copy");
|
|
2029
2035
|
} catch {
|
|
2030
2036
|
console.error("Unable to copy to clipboard :(");
|
|
2031
2037
|
}
|
|
2032
|
-
}, $[
|
|
2033
|
-
let handleCopyUrl =
|
|
2034
|
-
$[
|
|
2038
|
+
}, $[6] = t3) : t3 = $[6];
|
|
2039
|
+
let handleCopyUrl = t3, t4;
|
|
2040
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [
|
|
2035
2041
|
"repeat(1, minmax(0, 1fr))",
|
|
2036
2042
|
"repeat(4, minmax(0, 1fr))",
|
|
2037
2043
|
"repeat(8, minmax(0, 1fr))",
|
|
2038
2044
|
"repeat(12, minmax(0, 1fr))"
|
|
2039
|
-
], $[
|
|
2040
|
-
let t4;
|
|
2041
|
-
$[5] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["span 1 / span 1", "span 2 / span 2"], $[5] = t4) : t4 = $[5];
|
|
2045
|
+
], $[7] = t4) : t4 = $[7];
|
|
2042
2046
|
let t5;
|
|
2043
|
-
$[
|
|
2047
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["span 1 / span 1", "span 2 / span 2"], $[8] = t5) : t5 = $[8];
|
|
2044
2048
|
let t6;
|
|
2045
|
-
$[
|
|
2049
|
+
$[9] === t ? t6 = $[10] : (t6 = t("settings.dataset-label"), $[9] = t, $[10] = t6);
|
|
2050
|
+
let t7;
|
|
2051
|
+
$[11] === t6 ? t7 = $[12] : (t7 = /* @__PURE__ */ jsx(Card, {
|
|
2046
2052
|
paddingTop: 2,
|
|
2047
2053
|
paddingBottom: 3,
|
|
2048
|
-
children: /* @__PURE__ */ jsx(StyledLabel, { children:
|
|
2049
|
-
}), $[
|
|
2050
|
-
let t7;
|
|
2051
|
-
$[10] === datasets ? t7 = $[11] : (t7 = datasets.map(_temp2$2), $[10] = datasets, $[11] = t7);
|
|
2054
|
+
children: /* @__PURE__ */ jsx(StyledLabel, { children: t6 })
|
|
2055
|
+
}), $[11] = t6, $[12] = t7);
|
|
2052
2056
|
let t8;
|
|
2053
|
-
$[
|
|
2057
|
+
$[13] === datasets ? t8 = $[14] : (t8 = datasets.map(_temp2$2), $[13] = datasets, $[14] = t8);
|
|
2058
|
+
let t9;
|
|
2059
|
+
$[15] !== dataset || $[16] !== onChangeDataset || $[17] !== t8 ? (t9 = /* @__PURE__ */ jsx(Select, {
|
|
2054
2060
|
value: dataset,
|
|
2055
2061
|
onChange: onChangeDataset,
|
|
2056
|
-
children:
|
|
2057
|
-
}), $[
|
|
2058
|
-
let t9;
|
|
2059
|
-
$[16] !== t6 || $[17] !== t8 ? (t9 = /* @__PURE__ */ jsx(Box, {
|
|
2060
|
-
padding: 1,
|
|
2061
|
-
gridColumn: t4,
|
|
2062
|
-
children: /* @__PURE__ */ jsxs(VStack, { children: [t6, t8] })
|
|
2063
|
-
}), $[16] = t6, $[17] = t8, $[18] = t9) : t9 = $[18];
|
|
2062
|
+
children: t8
|
|
2063
|
+
}), $[15] = dataset, $[16] = onChangeDataset, $[17] = t8, $[18] = t9) : t9 = $[18];
|
|
2064
2064
|
let t10;
|
|
2065
|
-
$[19]
|
|
2065
|
+
$[19] !== t7 || $[20] !== t9 ? (t10 = /* @__PURE__ */ jsx(Box, {
|
|
2066
|
+
padding: 1,
|
|
2067
|
+
gridColumn: t5,
|
|
2068
|
+
children: /* @__PURE__ */ jsxs(VStack, { children: [t7, t9] })
|
|
2069
|
+
}), $[19] = t7, $[20] = t9, $[21] = t10) : t10 = $[21];
|
|
2066
2070
|
let t11;
|
|
2067
|
-
$[
|
|
2071
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t11 = ["span 1 / span 1", "span 2 / span 2"], $[22] = t11) : t11 = $[22];
|
|
2068
2072
|
let t12;
|
|
2069
|
-
$[
|
|
2073
|
+
$[23] === t ? t12 = $[24] : (t12 = t("settings.api-version-label"), $[23] = t, $[24] = t12);
|
|
2074
|
+
let t13;
|
|
2075
|
+
$[25] === t12 ? t13 = $[26] : (t13 = /* @__PURE__ */ jsx(Card, {
|
|
2070
2076
|
paddingTop: 2,
|
|
2071
2077
|
paddingBottom: 3,
|
|
2072
|
-
children: /* @__PURE__ */ jsx(StyledLabel, { children:
|
|
2073
|
-
}), $[
|
|
2074
|
-
let t13;
|
|
2075
|
-
$[24] === t ? t13 = $[25] : (t13 = t("settings.api-version-locked-for-variant"), $[24] = t, $[25] = t13);
|
|
2078
|
+
children: /* @__PURE__ */ jsx(StyledLabel, { children: t12 })
|
|
2079
|
+
}), $[25] = t12, $[26] = t13);
|
|
2076
2080
|
let t14;
|
|
2077
|
-
$[
|
|
2081
|
+
$[27] === t ? t14 = $[28] : (t14 = t("settings.api-version-locked-for-variant"), $[27] = t, $[28] = t14);
|
|
2082
|
+
let t15;
|
|
2083
|
+
$[29] === t14 ? t15 = $[30] : (t15 = /* @__PURE__ */ jsx(Text, {
|
|
2078
2084
|
size: 1,
|
|
2079
|
-
children:
|
|
2080
|
-
}), $[
|
|
2081
|
-
let
|
|
2082
|
-
$[
|
|
2083
|
-
let t18;
|
|
2084
|
-
$[29] === t ? t18 = $[30] : (t18 = t("settings.other-api-version-label"), $[29] = t, $[30] = t18);
|
|
2085
|
+
children: t14
|
|
2086
|
+
}), $[29] = t14, $[30] = t15);
|
|
2087
|
+
let t16 = !isApiVersionLocked, t17 = customApiVersion === !1 ? apiVersion : "other", t18;
|
|
2088
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t18 = API_VERSIONS.map(_temp3$1), $[31] = t18) : t18 = $[31];
|
|
2085
2089
|
let t19;
|
|
2086
|
-
$[
|
|
2087
|
-
value: "other",
|
|
2088
|
-
children: t18
|
|
2089
|
-
}, "other"), $[31] = t18, $[32] = t19);
|
|
2090
|
+
$[32] === t ? t19 = $[33] : (t19 = t("settings.other-api-version-label"), $[32] = t, $[33] = t19);
|
|
2090
2091
|
let t20;
|
|
2091
|
-
$[
|
|
2092
|
+
$[34] === t19 ? t20 = $[35] : (t20 = /* @__PURE__ */ jsx("option", {
|
|
2093
|
+
value: "other",
|
|
2094
|
+
children: t19
|
|
2095
|
+
}, "other"), $[34] = t19, $[35] = t20);
|
|
2096
|
+
let t21;
|
|
2097
|
+
$[36] !== isApiVersionLocked || $[37] !== onChangeApiVersion || $[38] !== t17 || $[39] !== t20 ? (t21 = /* @__PURE__ */ jsx(Box, {
|
|
2092
2098
|
"data-testid": "api-version-selector-wrap",
|
|
2093
2099
|
children: /* @__PURE__ */ jsxs(Select, {
|
|
2094
2100
|
"data-testid": "api-version-selector",
|
|
2095
|
-
value:
|
|
2101
|
+
value: t17,
|
|
2096
2102
|
onChange: onChangeApiVersion,
|
|
2097
2103
|
disabled: isApiVersionLocked,
|
|
2098
|
-
children: [
|
|
2104
|
+
children: [t18, t20]
|
|
2099
2105
|
})
|
|
2100
|
-
}), $[
|
|
2101
|
-
let
|
|
2102
|
-
$[
|
|
2106
|
+
}), $[36] = isApiVersionLocked, $[37] = onChangeApiVersion, $[38] = t17, $[39] = t20, $[40] = t21) : t21 = $[40];
|
|
2107
|
+
let t22;
|
|
2108
|
+
$[41] !== t15 || $[42] !== t16 || $[43] !== t21 ? (t22 = /* @__PURE__ */ jsx(Tooltip, {
|
|
2103
2109
|
animate: !0,
|
|
2104
|
-
content:
|
|
2105
|
-
disabled:
|
|
2110
|
+
content: t15,
|
|
2111
|
+
disabled: t16,
|
|
2106
2112
|
placement: "bottom",
|
|
2107
2113
|
portal: !0,
|
|
2108
|
-
children:
|
|
2109
|
-
}), $[
|
|
2110
|
-
let t22;
|
|
2111
|
-
$[42] !== t12 || $[43] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, {
|
|
2112
|
-
padding: 1,
|
|
2113
|
-
gridColumn: t10,
|
|
2114
|
-
children: /* @__PURE__ */ jsxs(VStack, { children: [t12, t21] })
|
|
2115
|
-
}), $[42] = t12, $[43] = t21, $[44] = t22) : t22 = $[44];
|
|
2114
|
+
children: t21
|
|
2115
|
+
}), $[41] = t15, $[42] = t16, $[43] = t21, $[44] = t22) : t22 = $[44];
|
|
2116
2116
|
let t23;
|
|
2117
|
-
$[45] !==
|
|
2117
|
+
$[45] !== t13 || $[46] !== t22 ? (t23 = /* @__PURE__ */ jsx(Box, {
|
|
2118
|
+
padding: 1,
|
|
2119
|
+
gridColumn: t11,
|
|
2120
|
+
children: /* @__PURE__ */ jsxs(VStack, { children: [t13, t22] })
|
|
2121
|
+
}), $[45] = t13, $[46] = t22, $[47] = t23) : t23 = $[47];
|
|
2122
|
+
let t24;
|
|
2123
|
+
$[48] !== customApiVersion || $[49] !== customApiVersionElementRef || $[50] !== isApiVersionLocked || $[51] !== isValidApiVersion || $[52] !== onCustomApiVersionChange || $[53] !== t ? (t24 = !isApiVersionLocked && customApiVersion !== !1 && /* @__PURE__ */ jsx(Box, {
|
|
2118
2124
|
padding: 1,
|
|
2119
2125
|
gridColumn: ["span 1 / span 1", "span 2 / span 2"],
|
|
2120
2126
|
children: /* @__PURE__ */ jsxs(VStack, { children: [/* @__PURE__ */ jsx(Card, {
|
|
@@ -2131,28 +2137,29 @@ function VisionGuiHeader(t0) {
|
|
|
2131
2137
|
customValidity: isValidApiVersion ? void 0 : t("settings.error.invalid-api-version"),
|
|
2132
2138
|
maxLength: 11
|
|
2133
2139
|
})] })
|
|
2134
|
-
}), $[
|
|
2135
|
-
let t24;
|
|
2136
|
-
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t24 = ["span 1 / span 1", "span 2 / span 2"], $[52] = t24) : t24 = $[52];
|
|
2140
|
+
}), $[48] = customApiVersion, $[49] = customApiVersionElementRef, $[50] = isApiVersionLocked, $[51] = isValidApiVersion, $[52] = onCustomApiVersionChange, $[53] = t, $[54] = t24) : t24 = $[54];
|
|
2137
2141
|
let t25;
|
|
2138
|
-
$[
|
|
2142
|
+
$[55] === Symbol.for("react.memo_cache_sentinel") ? (t25 = ["span 1 / span 1", "span 2 / span 2"], $[55] = t25) : t25 = $[55];
|
|
2139
2143
|
let t26;
|
|
2140
|
-
$[
|
|
2144
|
+
$[56] === t ? t26 = $[57] : (t26 = t("settings.perspective-label"), $[56] = t, $[57] = t26);
|
|
2141
2145
|
let t27;
|
|
2142
|
-
$[
|
|
2146
|
+
$[58] === t26 ? t27 = $[59] : (t27 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(StyledLabel, { children: t26 }) }), $[58] = t26, $[59] = t27);
|
|
2143
2147
|
let t28;
|
|
2144
|
-
$[
|
|
2148
|
+
$[60] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[60] = t28) : t28 = $[60];
|
|
2149
|
+
let t29;
|
|
2150
|
+
$[61] === t27 ? t29 = $[62] : (t29 = /* @__PURE__ */ jsx(Card, {
|
|
2145
2151
|
paddingBottom: 1,
|
|
2146
2152
|
children: /* @__PURE__ */ jsxs(Inline, {
|
|
2147
2153
|
gap: 1,
|
|
2148
|
-
children: [
|
|
2154
|
+
children: [t27, t28]
|
|
2149
2155
|
})
|
|
2150
|
-
}), $[
|
|
2151
|
-
let
|
|
2152
|
-
$[
|
|
2156
|
+
}), $[61] = t27, $[62] = t29);
|
|
2157
|
+
let t30 = perspective || "default", t31;
|
|
2158
|
+
$[63] !== isScheduledDraftsEnabled || $[64] !== navbarVariantTitle || $[65] !== pinnedPerspective || $[66] !== t ? (t31 = SUPPORTED_PERSPECTIVES.map((perspectiveName) => perspectiveName === "pinnedRelease" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2153
2159
|
/* @__PURE__ */ jsx(PinnedReleasePerspectiveOption, {
|
|
2154
2160
|
pinnedPerspective,
|
|
2155
|
-
t
|
|
2161
|
+
t,
|
|
2162
|
+
variantTitle: navbarVariantTitle
|
|
2156
2163
|
}),
|
|
2157
2164
|
/* @__PURE__ */ jsx("option", {
|
|
2158
2165
|
value: "default",
|
|
@@ -2162,22 +2169,22 @@ function VisionGuiHeader(t0) {
|
|
|
2162
2169
|
] }, "pinnedRelease") : perspectiveName === "scheduledDrafts" ? isScheduledDraftsEnabled ? /* @__PURE__ */ jsx("option", {
|
|
2163
2170
|
value: "scheduledDrafts",
|
|
2164
2171
|
children: t("settings.perspectives.scheduled-drafts")
|
|
2165
|
-
}, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[
|
|
2166
|
-
let
|
|
2167
|
-
$[
|
|
2172
|
+
}, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[63] = isScheduledDraftsEnabled, $[64] = navbarVariantTitle, $[65] = pinnedPerspective, $[66] = t, $[67] = t31) : t31 = $[67];
|
|
2173
|
+
let t32;
|
|
2174
|
+
$[68] !== onChangePerspective || $[69] !== t30 || $[70] !== t31 ? (t32 = /* @__PURE__ */ jsx(Select, {
|
|
2168
2175
|
"data-testid": "perspective-selector",
|
|
2169
|
-
value:
|
|
2176
|
+
value: t30,
|
|
2170
2177
|
onChange: onChangePerspective,
|
|
2171
|
-
children:
|
|
2172
|
-
}), $[
|
|
2173
|
-
let t32;
|
|
2174
|
-
$[68] !== t28 || $[69] !== t31 ? (t32 = /* @__PURE__ */ jsx(Box, {
|
|
2175
|
-
padding: 1,
|
|
2176
|
-
gridColumn: t24,
|
|
2177
|
-
children: /* @__PURE__ */ jsxs(VStack, { children: [t28, t31] })
|
|
2178
|
-
}), $[68] = t28, $[69] = t31, $[70] = t32) : t32 = $[70];
|
|
2178
|
+
children: t31
|
|
2179
|
+
}), $[68] = onChangePerspective, $[69] = t30, $[70] = t31, $[71] = t32) : t32 = $[71];
|
|
2179
2180
|
let t33;
|
|
2180
|
-
$[
|
|
2181
|
+
$[72] !== t29 || $[73] !== t32 ? (t33 = /* @__PURE__ */ jsx(Box, {
|
|
2182
|
+
padding: 1,
|
|
2183
|
+
gridColumn: t25,
|
|
2184
|
+
children: /* @__PURE__ */ jsxs(VStack, { children: [t29, t32] })
|
|
2185
|
+
}), $[72] = t29, $[73] = t32, $[74] = t33) : t33 = $[74];
|
|
2186
|
+
let t34;
|
|
2187
|
+
$[75] !== customApiVersion || $[76] !== t || $[77] !== url ? (t34 = typeof url == "string" ? /* @__PURE__ */ jsx(Box, {
|
|
2181
2188
|
padding: 1,
|
|
2182
2189
|
flexBasis: "0%",
|
|
2183
2190
|
flexGrow: 1,
|
|
@@ -2229,22 +2236,22 @@ function VisionGuiHeader(t0) {
|
|
|
2229
2236
|
}) : /* @__PURE__ */ jsx(Box, {
|
|
2230
2237
|
flexBasis: "0%",
|
|
2231
2238
|
flexGrow: 1
|
|
2232
|
-
}), $[
|
|
2233
|
-
let
|
|
2234
|
-
return $[
|
|
2239
|
+
}), $[75] = customApiVersion, $[76] = t, $[77] = url, $[78] = t34) : t34 = $[78];
|
|
2240
|
+
let t35;
|
|
2241
|
+
return $[79] !== t10 || $[80] !== t23 || $[81] !== t24 || $[82] !== t33 || $[83] !== t34 ? (t35 = /* @__PURE__ */ jsx(Header, {
|
|
2235
2242
|
paddingX: 3,
|
|
2236
2243
|
paddingY: 2,
|
|
2237
2244
|
children: /* @__PURE__ */ jsxs(Grid, {
|
|
2238
|
-
gridTemplateColumns:
|
|
2245
|
+
gridTemplateColumns: t4,
|
|
2239
2246
|
children: [
|
|
2240
|
-
|
|
2241
|
-
t22,
|
|
2247
|
+
t10,
|
|
2242
2248
|
t23,
|
|
2243
|
-
|
|
2244
|
-
t33
|
|
2249
|
+
t24,
|
|
2250
|
+
t33,
|
|
2251
|
+
t34
|
|
2245
2252
|
]
|
|
2246
2253
|
})
|
|
2247
|
-
}), $[
|
|
2254
|
+
}), $[79] = t10, $[80] = t23, $[81] = t24, $[82] = t33, $[83] = t34, $[84] = t35) : t35 = $[84], t35;
|
|
2248
2255
|
}
|
|
2249
2256
|
function _temp3$1(version) {
|
|
2250
2257
|
return /* @__PURE__ */ jsx("option", { children: version }, version);
|
|
@@ -2336,7 +2343,7 @@ function hasReleaseInPerspective(perspective) {
|
|
|
2336
2343
|
function getUnsatisfiedApiVersionCapability(context, capabilities = API_VERSION_CAPABILITIES) {
|
|
2337
2344
|
if (context.statusCode === 400) return capabilities.find((capability) => capability.applies(context) && isApiVersionBelow(context.apiVersion, capability.requiredApiVersion));
|
|
2338
2345
|
}
|
|
2339
|
-
var errorCode = "
|
|
2346
|
+
var errorCode = "hby5q50";
|
|
2340
2347
|
function ErrorCode(props) {
|
|
2341
2348
|
let $ = c(2), t0;
|
|
2342
2349
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Code, {
|
|
@@ -2452,7 +2459,7 @@ function getAtKeypath(data, keypath) {
|
|
|
2452
2459
|
}
|
|
2453
2460
|
return { value: current };
|
|
2454
2461
|
}
|
|
2455
|
-
var codeFamilyVar = "var(--
|
|
2462
|
+
var codeFamilyVar = "var(--_1jg9key0)", codeFontSizeVar = "var(--_1jg9key1)", codeLineHeightVar = "var(--_1jg9key2)", copyNodeButton = "_1jg9keye", copyableResult = "_1jg9keyd", resultViewWrapper = "_1jg9keyc", space0Var = "var(--_1jg9key3)", space2Var = "var(--_1jg9key4)", space4HalfVar = "var(--_1jg9key6)", space4Var = "var(--_1jg9key5)", syntaxBooleanVar = "var(--_1jg9keya)", syntaxConstantVar = "var(--_1jg9key8)", syntaxNumberVar = "var(--_1jg9keyb)", syntaxPropertyVar = "var(--_1jg9key7)", syntaxStringVar = "var(--_1jg9key9)";
|
|
2456
2463
|
const lru = new LRU({ maxSize: 5e4 });
|
|
2457
2464
|
function ResultViewWrapper(t0) {
|
|
2458
2465
|
let $ = c(25), { children, copyable } = t0, { color, font, space } = useTheme_v2(), codeSize = font.code.sizes[2], t1 = copyable ? `${resultViewWrapper} ${copyableResult}` : resultViewWrapper, t2 = font.code.family, t3 = `${codeSize.fontSize}px`, t4 = `${codeSize.lineHeight}px`, t5;
|
|
@@ -2798,7 +2805,7 @@ function nodeContains(node, other) {
|
|
|
2798
2805
|
}
|
|
2799
2806
|
const isRunHotkey = (event) => isHotkey("ctrl+enter", event) || isHotkey("mod+enter", event);
|
|
2800
2807
|
function VisionGui(props) {
|
|
2801
|
-
let $ = c(234), { datasets, config, projectId, defaultDataset, onSwitchToRedesign } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantNames } = usePerspective(), selectedVariantName = getDefaultVariant(selectedVariantNames), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
|
|
2808
|
+
let $ = c(234), { datasets, config, projectId, defaultDataset, onSwitchToRedesign } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantNames } = usePerspective(), selectedVariantName = useVariantsEnabled() ? getDefaultVariant(selectedVariantNames) : void 0, isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
|
|
2802
2809
|
$[0] === t0 ? t1 = $[1] : (t1 = t0 === void 0 ? [] : t0, $[0] = t0, $[1] = t1);
|
|
2803
2810
|
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;
|
|
2804
2811
|
$[2] === projectId ? t2 = $[3] : (t2 = () => getLocalStorage(projectId || "default"), $[2] = projectId, $[3] = t2);
|
|
@@ -3531,7 +3538,7 @@ function _temp() {
|
|
|
3531
3538
|
return DEFAULT_PREFERENCE;
|
|
3532
3539
|
}
|
|
3533
3540
|
var SanityVision_exports = /* @__PURE__ */ __exportAll({ default: () => SanityVision });
|
|
3534
|
-
const vistaGui = createRetryableLazy(() => import("./VistaGui-
|
|
3541
|
+
const vistaGui = createRetryableLazy(() => import("./VistaGui-CFsbMx2g.js").then((module) => ({ default: module.VistaGui }))), VistaGuiLoader = vistaGui.Component;
|
|
3535
3542
|
function SanityVision(props) {
|
|
3536
3543
|
let $ = c(31), t0;
|
|
3537
3544
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "1" }, $[0] = t0) : t0 = $[0];
|
|
@@ -3582,6 +3589,6 @@ function SanityVision(props) {
|
|
|
3582
3589
|
children: [t7, t8]
|
|
3583
3590
|
}), $[28] = t7, $[29] = t8, $[30] = t9) : t9 = $[30], t9;
|
|
3584
3591
|
}
|
|
3585
|
-
export {
|
|
3592
|
+
export { DEFAULT_API_VERSION as A, getActivePerspective as C, paramsExtensions as D, groqExtensions as E, prefixApiVersion as M, resultJsonExtensions as O, encodeQueryString as S, VisionCodeMirror as T, VISION_STORAGE_KEY_PREFIX as _, getAtKeypath as a, isPlainObject as b, DelayedSpinner as c, getJsonBlobUrl as d, SanityVision as default, useSavedQueries as f, validateApiVersion as g, parseQueryUrl as h, describeKeypath as i, VARIANTS_API_VERSION as j, API_VERSIONS as k, canEncodeCsv as l, isApiCdnHost as m, createRetryableLazy as n, QueryErrorDialog as o, parseParams as p, ResultView as r, isApiVersionBelow as s, SanityVision_exports as t, getCsvBlobUrl as u, getStorage as v, useVariantsEnabled as w, isVisionPasteTarget as x, onLocalStorageCleared as y };
|
|
3586
3593
|
|
|
3587
|
-
//# sourceMappingURL=SanityVision-
|
|
3594
|
+
//# sourceMappingURL=SanityVision-BPTjMcT_.js.map
|