@sanity/vision 6.21.0-next.64 → 6.21.0-next.68
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/{CodeDiff-Bj_o50Qy.js → CodeDiff-MkS3Q87A.js} +14 -13
- package/lib/CodeDiff-MkS3Q87A.js.map +1 -0
- package/lib/{SanityVision-BPTjMcT_.js → SanityVision-DOH_LzRg.js} +88 -93
- package/lib/SanityVision-DOH_LzRg.js.map +1 -0
- package/lib/{VistaGui-CFsbMx2g.js → VistaGui-C6cdsk92.js} +111 -110
- package/lib/VistaGui-C6cdsk92.js.map +1 -0
- package/lib/bundle.css +221 -210
- package/lib/index.js +1 -1
- package/package.json +9 -8
- package/lib/CodeDiff-Bj_o50Qy.js.map +0 -1
- package/lib/SanityVision-BPTjMcT_.js.map +0 -1
- package/lib/VistaGui-CFsbMx2g.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useTheme_v2 } from "@sanity/ui";
|
|
4
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
import { FileDiff } from "@pierre/diffs";
|
|
7
6
|
/**
|
|
@@ -9,7 +8,7 @@ import { FileDiff } from "@pierre/diffs";
|
|
|
9
8
|
* Only loaded through `lazy()` once a history entry's changes are expanded.
|
|
10
9
|
*/
|
|
11
10
|
function CodeDiff(t0) {
|
|
12
|
-
let $ = c(
|
|
11
|
+
let $ = c(17), { previous, next, lang } = t0, { color, font } = useTheme_v2(), codeSize = font.code.sizes[1], wrapperRef = useRef(null), t1 = `diff.${lang}`, t2;
|
|
13
12
|
$[0] !== lang || $[1] !== previous || $[2] !== t1 ? (t2 = {
|
|
14
13
|
name: t1,
|
|
15
14
|
contents: previous,
|
|
@@ -44,17 +43,19 @@ function CodeDiff(t0) {
|
|
|
44
43
|
themeType
|
|
45
44
|
], $[8] = newFile, $[9] = oldFile, $[10] = themeType, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), useEffect(t5, t6);
|
|
46
45
|
let t7 = `${codeSize.fontSize}px`, t8 = `${codeSize.lineHeight}px`, t9;
|
|
47
|
-
$[13] !== font.code.family || $[14] !== t7 || $[15] !== t8
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
if ($[13] !== font.code.family || $[14] !== t7 || $[15] !== t8) {
|
|
47
|
+
let style = {
|
|
48
|
+
"--diffs-font-family": font.code.family,
|
|
49
|
+
"--diffs-font-size": t7,
|
|
50
|
+
"--diffs-line-height": t8
|
|
51
|
+
};
|
|
52
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
53
|
+
ref: wrapperRef,
|
|
54
|
+
style
|
|
55
|
+
}), $[13] = font.code.family, $[14] = t7, $[15] = t8, $[16] = t9;
|
|
56
|
+
} else t9 = $[16];
|
|
57
|
+
return t9;
|
|
57
58
|
}
|
|
58
59
|
export { CodeDiff as default };
|
|
59
60
|
|
|
60
|
-
//# sourceMappingURL=CodeDiff-
|
|
61
|
+
//# sourceMappingURL=CodeDiff-MkS3Q87A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeDiff-MkS3Q87A.js","names":["{previous, next, lang}: CodeDiffProps","{name: `diff.${lang}`, contents: previous, lang}","`diff.${lang}`","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )","{name: `diff.${lang}`, contents: next, lang}","useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )","() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }","[newFile, oldFile, themeType]","<div ref={wrapperRef} style={style} />","family","`${codeSize.fontSize}px`","`${codeSize.lineHeight}px`","_c","useThemeV2"],"sources":["../src/vista/components/response/CodeDiff.tsx"],"sourcesContent":["import {type FileContents, FileDiff} from '@pierre/diffs'\nimport {useTheme_v2 as useThemeV2} from '@sanity/ui'\nimport {type CSSProperties, useEffect, useMemo, useRef} from 'react'\n\n/** The custom properties `@pierre/diffs` styles its markup with */\ninterface DiffsStyle extends CSSProperties {\n '--diffs-font-family': string\n '--diffs-font-size': string\n '--diffs-line-height': string\n}\n\nexport interface CodeDiffProps {\n previous: string\n next: string\n lang: 'json' | 'text'\n}\n\n/**\n * Line diff of two texts, rendered by `@pierre/diffs` (Shiki highlighting in a shadow root).\n * Only loaded through `lazy()` once a history entry's changes are expanded.\n */\nexport default function CodeDiff({previous, next, lang}: CodeDiffProps) {\n const {color, font} = useThemeV2()\n const codeSize = font.code.sizes[1]\n const wrapperRef = useRef<HTMLDivElement>(null)\n const oldFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: previous, lang}),\n [lang, previous],\n )\n const newFile = useMemo<FileContents>(\n () => ({name: `diff.${lang}`, contents: next, lang}),\n [lang, next],\n )\n const themeType = color._dark ? 'dark' : 'light'\n\n // The library's React components keep their container and hydrate whatever markup a previous\n // instance left in it, so after StrictMode detaches and re-attaches their ref they render\n // nothing. An instance per effect run with a container of its own (removed on clean up) has no\n // such markup to find\n useEffect(() => {\n const wrapper = wrapperRef.current\n if (!wrapper) return undefined\n const diff = new FileDiff({\n diffStyle: 'unified',\n // Thrown from `render` in this effect, a failure reaches the History panel's error\n // boundary and its Retry, rather than being drawn as a stack trace inside the diff\n disableErrorHandling: true,\n disableFileHeader: true,\n lineDiffType: 'word',\n overflow: 'wrap',\n themeType,\n })\n diff.render({containerWrapper: wrapper, newFile, oldFile})\n return () => diff.cleanUp()\n }, [newFile, oldFile, themeType])\n\n const style: DiffsStyle = {\n '--diffs-font-family': font.code.family,\n '--diffs-font-size': `${codeSize.fontSize}px`,\n '--diffs-line-height': `${codeSize.lineHeight}px`,\n }\n\n return <div ref={wrapperRef} style={style} />\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAwB,SAAA,IAAgD;C,eAAvC,EAAC,UAAU,MAAM,SAAjBA,IACzB,EAAC,OAAO,SAAQa,YAAW,GAC3B,WAAW,KAAK,KAAK,MAAM,IAC3B,aAAa,OAAuB,IAAI,GAE9B,KAAA,QAAQ,QAAfZ;CAA2C,AAAA,EAAA,OAAA,QAAA,EAAA,OAAV,YAAA,EAAA,OAA1BC,MAAP,KAAA;EAAC,MAAMA;EAAgB,UAAU;EAAU;CAAI,GAAJ,EAAA,KAAA,MAAV,EAAA,KAAA,UAA1BA,EAAAA,KAAAA,I;CADhB,IAAM,UAAUC,IAKA,KAAA,QAAQ,QAAfC;CAAuC,AAAA,EAAA,OAAA,QAAA,EAAA,OAAN,QAAA,EAAA,OAA1BF,MAAP,KAAA;EAAC,MAAMA;EAAgB,UAAU;EAAM;CAAI,GAAJ,EAAA,KAAA,MAAN,EAAA,KAAA,MAA1BA,EAAAA,KAAAA,I;CADhB,IAAM,UAAUG,IAIV,YAAY,MAAM,QAAQ,SAAS,SAM/BC,IAePC;CAfH,AAa0C,EAAA,OAAA,WAAA,EAAA,OAAS,WAAA,EAAA,QAF/C,aAXM,WAAM;EACd,IAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;EACd,IAAM,OAAO,IAAI,SAAS;GACxB,WAAW;GAGX,sBAAsB;GACtB,mBAAmB;GACnB,cAAc;GACd,UAAU;GACV;EACF,CAAC;EAED,OADA,KAAK,OAAO;GAAC,kBAAkB;GAAS;GAAS;EAAO,CAAC,SAC5C,KAAK,QAAQ;CAC5B,GAAG,KAAA;EAAC;EAAS;EAAS;CAAS,GAFW,EAAA,KAAA,SAAS,EAAA,KAAA,SAF/C,EAAA,MAAA,W,oDAXJ,UAAUD,IAePC,EAA6B;CAIT,IAAA,KAAA,GAAG,SAAS,SAAS,KACnB,KAAA,GAAG,SAAS,WAAW,KAGzCC;CAL4BC,IAAAA,EAAAA,QAAAA,KAAL,KAAK,UAAA,EAAA,QACZC,MAAAA,EAAAA,QACEC,IAAAA;EAHzB,IAAM,QAAoB;GACxB,uBAAuB,KAAK,KAAK;GACjC,qBAAqBD;GACrB,uBAAuBC;EACzB;E,AAEO,KAAA,oBAAC,OAAD;GAAK,KAAK;GAAmB;EAAQ,CAAA,GALTF,EAAAA,MAAAA,KAAL,KAAK,QACZC,EAAAA,MAAAA,IACEC,EAAAA,MAAAA,I;;CAGzB,OAAOH;AACT"}
|
|
@@ -20,7 +20,6 @@ import { EditorState } from "@codemirror/state";
|
|
|
20
20
|
import { EditorView, drawSelection, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers } from "@codemirror/view";
|
|
21
21
|
import { groq } from "@sanity/lezer-groq";
|
|
22
22
|
import CodeMirror, { EditorSelection as EditorSelection$1 } from "@uiw/react-codemirror";
|
|
23
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
24
23
|
import { tags } from "@lezer/highlight";
|
|
25
24
|
import { hues } from "@sanity/color";
|
|
26
25
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -294,26 +293,26 @@ function getVisibleColumns(view, { lines, scrollbarWidth } = {}) {
|
|
|
294
293
|
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
294
|
return Number.isFinite(columns) && columns > 0 ? columns : void 0;
|
|
296
295
|
}
|
|
297
|
-
|
|
296
|
+
const _key0$5 = "HSFWEW_editorRoot";
|
|
298
297
|
function EditorRoot(t0) {
|
|
299
|
-
let $ = c(14), { autoHeight, underHeader, children } = t0, { sanity } = useTheme(), t1
|
|
300
|
-
$[0] === sanity.space[3] ?
|
|
301
|
-
let
|
|
302
|
-
$[2] === sanity.space[4] ?
|
|
303
|
-
let
|
|
304
|
-
$[4] ===
|
|
305
|
-
let
|
|
306
|
-
$[6] !==
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
let t10;
|
|
312
|
-
return $[10] !== children || $[11] !==
|
|
313
|
-
className:
|
|
314
|
-
style
|
|
298
|
+
let $ = c(14), { autoHeight, underHeader, children } = t0, { sanity } = useTheme(), t1;
|
|
299
|
+
$[0] === sanity.space[3] ? t1 = $[1] : (t1 = rem(sanity.space[3]), $[0] = sanity.space[3], $[1] = t1);
|
|
300
|
+
let t2 = `${t1}`, t3;
|
|
301
|
+
$[2] === sanity.space[4] ? t3 = $[3] : (t3 = rem(sanity.space[4]), $[2] = sanity.space[4], $[3] = t3);
|
|
302
|
+
let t4 = `${t3}`, t5 = sanity.space[underHeader ? 3 : 5], t6;
|
|
303
|
+
$[4] === t5 ? t6 = $[5] : (t6 = rem(t5), $[4] = t5, $[5] = t6);
|
|
304
|
+
let t7 = `${t6}`, t8;
|
|
305
|
+
$[6] !== t2 || $[7] !== t4 || $[8] !== t7 ? (t8 = {
|
|
306
|
+
"--vision-editor-line-padding-left": t2,
|
|
307
|
+
"--vision-editor-content-border-right-width": t4,
|
|
308
|
+
"--vision-editor-content-padding-top": t7
|
|
309
|
+
}, $[6] = t2, $[7] = t4, $[8] = t7, $[9] = t8) : t8 = $[9];
|
|
310
|
+
let style = t8, t9 = autoHeight ? `${_key0$5} HSFWEW_editorRootAutoHeight` : _key0$5, t10;
|
|
311
|
+
return $[10] !== children || $[11] !== style || $[12] !== t9 ? (t10 = /* @__PURE__ */ jsx("div", {
|
|
312
|
+
className: t9,
|
|
313
|
+
style,
|
|
315
314
|
children
|
|
316
|
-
}), $[10] = children, $[11] =
|
|
315
|
+
}), $[10] = children, $[11] = style, $[12] = t9, $[13] = t10) : t10 = $[13], t10;
|
|
317
316
|
}
|
|
318
317
|
function VisionCodeMirror(t0) {
|
|
319
318
|
let $ = c(21), { ref, onChange, initialValue: initialValueProp, extensions, autoHeight: t1, underHeader: t2 } = t0, autoHeight = t1 !== void 0 && t1, underHeader = t2 === void 0 ? autoHeight : t2, [value, setValue] = useState(initialValueProp), [hasView, setHasView] = useState(!1), [seenInitialValue, setSeenInitialValue] = useState(initialValueProp);
|
|
@@ -603,7 +602,7 @@ function tryParseParams(val, t) {
|
|
|
603
602
|
return err.message = `${t("params.error.params-invalid-json")}:\n\n${err.message.replace("JSON5:", "")}`, err;
|
|
604
603
|
}
|
|
605
604
|
}
|
|
606
|
-
|
|
605
|
+
const _key3 = "lBV0cq_inputBackgroundContainer", _key10 = "lBV0cq_resultContainer";
|
|
607
606
|
function Root(t0) {
|
|
608
607
|
let $ = c(6), props, ref;
|
|
609
608
|
$[0] === t0 ? (props = $[1], ref = $[2]) : ({ref, ...props} = t0, $[0] = t0, $[1] = props, $[2] = ref);
|
|
@@ -611,28 +610,28 @@ function Root(t0) {
|
|
|
611
610
|
return $[3] !== props || $[4] !== ref ? (t1 = /* @__PURE__ */ jsx(Flex, {
|
|
612
611
|
...props,
|
|
613
612
|
ref,
|
|
614
|
-
className:
|
|
613
|
+
className: "lBV0cq_root"
|
|
615
614
|
}), $[3] = props, $[4] = ref, $[5] = t1) : t1 = $[5], t1;
|
|
616
615
|
}
|
|
617
616
|
function Header(props) {
|
|
618
617
|
let $ = c(2), t0;
|
|
619
618
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
|
|
620
619
|
...props,
|
|
621
|
-
className:
|
|
620
|
+
className: "lBV0cq_header"
|
|
622
621
|
}), $[0] = props, $[1] = t0), t0;
|
|
623
622
|
}
|
|
624
623
|
function StyledLabel(props) {
|
|
625
624
|
let $ = c(2), t0;
|
|
626
625
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Label, {
|
|
627
626
|
...props,
|
|
628
|
-
className:
|
|
627
|
+
className: "lBV0cq_styledLabel"
|
|
629
628
|
}), $[0] = props, $[1] = t0), t0;
|
|
630
629
|
}
|
|
631
630
|
function SplitpaneContainer(props) {
|
|
632
631
|
let $ = c(2), t0;
|
|
633
632
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
634
633
|
...props,
|
|
635
|
-
className:
|
|
634
|
+
className: "lBV0cq_splitpaneContainer"
|
|
636
635
|
}), $[0] = props, $[1] = t0), t0;
|
|
637
636
|
}
|
|
638
637
|
function QueryRecallPaneContainer(props) {
|
|
@@ -640,7 +639,7 @@ function QueryRecallPaneContainer(props) {
|
|
|
640
639
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
|
|
641
640
|
...props,
|
|
642
641
|
flexDirection: "column",
|
|
643
|
-
className:
|
|
642
|
+
className: "lBV0cq_queryRecallPaneContainer"
|
|
644
643
|
}), $[0] = props, $[1] = t0), t0;
|
|
645
644
|
}
|
|
646
645
|
function QueryRecallPaneWrapper(props) {
|
|
@@ -651,55 +650,55 @@ function QueryRecallPaneWrapper(props) {
|
|
|
651
650
|
flexBasis: "0%",
|
|
652
651
|
flexGrow: 1,
|
|
653
652
|
overflow: "hidden",
|
|
654
|
-
className:
|
|
653
|
+
className: "lBV0cq_queryRecallPaneWrapper"
|
|
655
654
|
}), $[0] = props, $[1] = t0), t0;
|
|
656
655
|
}
|
|
657
656
|
function QueryCopyLink(props) {
|
|
658
657
|
let $ = c(2), t0;
|
|
659
658
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx("a", {
|
|
660
659
|
...props,
|
|
661
|
-
className:
|
|
660
|
+
className: "lBV0cq_queryCopyLink"
|
|
662
661
|
}), $[0] = props, $[1] = t0), t0;
|
|
663
662
|
}
|
|
664
663
|
function InputBackgroundContainer(props) {
|
|
665
664
|
let $ = c(2), t0;
|
|
666
665
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
667
666
|
...props,
|
|
668
|
-
className:
|
|
667
|
+
className: _key3
|
|
669
668
|
}), $[0] = props, $[1] = t0), t0;
|
|
670
669
|
}
|
|
671
670
|
function InputBackgroundContainerLeft(props) {
|
|
672
671
|
let $ = c(2), t0;
|
|
673
672
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
674
673
|
...props,
|
|
675
|
-
className: `${
|
|
674
|
+
className: `${_key3} lBV0cq_inputBackgroundContainerLeft`
|
|
676
675
|
}), $[0] = props, $[1] = t0), t0;
|
|
677
676
|
}
|
|
678
677
|
function InputContainer(props) {
|
|
679
678
|
let $ = c(2), t0;
|
|
680
679
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
|
|
681
680
|
...props,
|
|
682
|
-
className:
|
|
681
|
+
className: "lBV0cq_inputContainer"
|
|
683
682
|
}), $[0] = props, $[1] = t0), t0;
|
|
684
683
|
}
|
|
685
684
|
function ResultOuterContainer(props) {
|
|
686
685
|
let $ = c(2), t0;
|
|
687
686
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
|
|
688
687
|
...props,
|
|
689
|
-
className:
|
|
688
|
+
className: "lBV0cq_resultOuterContainer"
|
|
690
689
|
}), $[0] = props, $[1] = t0), t0;
|
|
691
690
|
}
|
|
692
691
|
function ResultInnerContainer(props) {
|
|
693
692
|
let $ = c(2), t0;
|
|
694
693
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
695
694
|
...props,
|
|
696
|
-
className:
|
|
695
|
+
className: "lBV0cq_resultInnerContainer"
|
|
697
696
|
}), $[0] = props, $[1] = t0), t0;
|
|
698
697
|
}
|
|
699
698
|
function ResultContainer(t0) {
|
|
700
699
|
let $ = c(6), isInvalid, props;
|
|
701
700
|
$[0] === t0 ? (isInvalid = $[1], props = $[2]) : ({isInvalid, ...props} = t0, $[0] = t0, $[1] = isInvalid, $[2] = props);
|
|
702
|
-
let t1 = isInvalid ? `${
|
|
701
|
+
let t1 = isInvalid ? `${_key10} lBV0cq_resultContainerInvalid` : _key10, t2;
|
|
703
702
|
return $[3] !== props || $[4] !== t1 ? (t2 = /* @__PURE__ */ jsx(Card, {
|
|
704
703
|
...props,
|
|
705
704
|
className: t1
|
|
@@ -709,59 +708,59 @@ function Result(props) {
|
|
|
709
708
|
let $ = c(2), t0;
|
|
710
709
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
711
710
|
...props,
|
|
712
|
-
className:
|
|
711
|
+
className: "lBV0cq_result"
|
|
713
712
|
}), $[0] = props, $[1] = t0), t0;
|
|
714
713
|
}
|
|
715
714
|
function ResultFooter(props) {
|
|
716
715
|
let $ = c(2), t0;
|
|
717
716
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
|
|
718
717
|
...props,
|
|
719
|
-
className:
|
|
718
|
+
className: "lBV0cq_resultFooter"
|
|
720
719
|
}), $[0] = props, $[1] = t0), t0;
|
|
721
720
|
}
|
|
722
721
|
function TimingsCard(props) {
|
|
723
722
|
let $ = c(2), t0;
|
|
724
723
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
|
|
725
724
|
...props,
|
|
726
|
-
className:
|
|
725
|
+
className: "lBV0cq_timingsCard"
|
|
727
726
|
}), $[0] = props, $[1] = t0), t0;
|
|
728
727
|
}
|
|
729
728
|
function TimingsTextContainer(props) {
|
|
730
729
|
let $ = c(7), { space, font } = useTheme_v2(), textSize = font.text.sizes[2], t0 = space[3] * 2 + textSize.lineHeight - textSize.ascenderHeight - textSize.descenderHeight, t1;
|
|
731
730
|
$[0] === t0 ? t1 = $[1] : (t1 = rem(t0), $[0] = t0, $[1] = t1);
|
|
732
731
|
let t2 = `${t1}`, t3;
|
|
733
|
-
$[2] === t2 ? t3 = $[3] : (t3 =
|
|
734
|
-
let t4;
|
|
735
|
-
return $[4] !== props || $[5] !==
|
|
732
|
+
$[2] === t2 ? t3 = $[3] : (t3 = { "--vision-timings-text-min-height": t2 }, $[2] = t2, $[3] = t3);
|
|
733
|
+
let style = t3, t4;
|
|
734
|
+
return $[4] !== props || $[5] !== style ? (t4 = /* @__PURE__ */ jsx(Flex, {
|
|
736
735
|
...props,
|
|
737
|
-
className:
|
|
738
|
-
style
|
|
739
|
-
}), $[4] = props, $[5] =
|
|
736
|
+
className: "lBV0cq_timingsTextContainer",
|
|
737
|
+
style
|
|
738
|
+
}), $[4] = props, $[5] = style, $[6] = t4) : t4 = $[6], t4;
|
|
740
739
|
}
|
|
741
740
|
function DownloadsCard(props) {
|
|
742
741
|
let $ = c(2), t0;
|
|
743
742
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
|
|
744
743
|
...props,
|
|
745
|
-
className:
|
|
744
|
+
className: "lBV0cq_downloadsCard"
|
|
746
745
|
}), $[0] = props, $[1] = t0), t0;
|
|
747
746
|
}
|
|
748
747
|
function SaveResultLabel(props) {
|
|
749
748
|
let $ = c(7), { space } = useTheme_v2(), t0;
|
|
750
749
|
$[0] === space[3] ? t0 = $[1] : (t0 = rem(space[3]), $[0] = space[3], $[1] = t0);
|
|
751
750
|
let t1 = `${t0}`, t2;
|
|
752
|
-
$[2] === t1 ? t2 = $[3] : (t2 =
|
|
753
|
-
let t3;
|
|
754
|
-
return $[4] !== props || $[5] !==
|
|
751
|
+
$[2] === t1 ? t2 = $[3] : (t2 = { "--vision-save-result-gap": t1 }, $[2] = t1, $[3] = t2);
|
|
752
|
+
let style = t2, t3;
|
|
753
|
+
return $[4] !== props || $[5] !== style ? (t3 = /* @__PURE__ */ jsx(Text, {
|
|
755
754
|
...props,
|
|
756
|
-
className:
|
|
757
|
-
style
|
|
758
|
-
}), $[4] = props, $[5] =
|
|
755
|
+
className: "lBV0cq_saveResultLabel",
|
|
756
|
+
style
|
|
757
|
+
}), $[4] = props, $[5] = style, $[6] = t3) : t3 = $[6], t3;
|
|
759
758
|
}
|
|
760
759
|
function ControlsContainer(props) {
|
|
761
760
|
let $ = c(2), t0;
|
|
762
761
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
763
762
|
...props,
|
|
764
|
-
className:
|
|
763
|
+
className: "lBV0cq_controlsContainer"
|
|
765
764
|
}), $[0] = props, $[1] = t0), t0;
|
|
766
765
|
}
|
|
767
766
|
function ParamsEditor(props) {
|
|
@@ -1117,12 +1116,11 @@ function _temp2$4(a, b) {
|
|
|
1117
1116
|
return new Date(b.savedAt || 0).getTime() - new Date(a.savedAt || 0).getTime();
|
|
1118
1117
|
}
|
|
1119
1118
|
function _temp$6() {}
|
|
1120
|
-
var fixedHeader = "j5r4cy0", queryList = "j5r4cy2", scrollContainer = "j5r4cy1";
|
|
1121
1119
|
function FixedHeader(props) {
|
|
1122
1120
|
let $ = c(2), t0;
|
|
1123
1121
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(VStack, {
|
|
1124
1122
|
...props,
|
|
1125
|
-
className:
|
|
1123
|
+
className: "A8N59q_fixedHeader"
|
|
1126
1124
|
}), $[0] = props, $[1] = t0), t0;
|
|
1127
1125
|
}
|
|
1128
1126
|
function ScrollContainer(props) {
|
|
@@ -1133,7 +1131,7 @@ function ScrollContainer(props) {
|
|
|
1133
1131
|
flexBasis: "0%",
|
|
1134
1132
|
flexGrow: 1,
|
|
1135
1133
|
overflow: "hidden",
|
|
1136
|
-
className:
|
|
1134
|
+
className: "A8N59q_scrollContainer"
|
|
1137
1135
|
}), $[0] = props, $[1] = t0), t0;
|
|
1138
1136
|
}
|
|
1139
1137
|
function QueryList(props) {
|
|
@@ -1143,7 +1141,7 @@ function QueryList(props) {
|
|
|
1143
1141
|
flexBasis: "0%",
|
|
1144
1142
|
flexGrow: 1,
|
|
1145
1143
|
overflow: "auto",
|
|
1146
|
-
className:
|
|
1144
|
+
className: "A8N59q_queryList"
|
|
1147
1145
|
}), $[0] = props, $[1] = t0), t0;
|
|
1148
1146
|
}
|
|
1149
1147
|
function QueryRecall(t0) {
|
|
@@ -1887,25 +1885,24 @@ function VisionGuiControls(t0) {
|
|
|
1887
1885
|
})
|
|
1888
1886
|
}) }), $[30] = hasValidParams, $[31] = t15, $[32] = t2, $[33] = t16) : t16 = $[33], t16;
|
|
1889
1887
|
}
|
|
1890
|
-
var dot = "gl42tl2", perspectivePopoverContent = "gl42tl0", perspectivePopoverLink = "gl42tl1";
|
|
1891
1888
|
function PerspectivePopoverContent(props) {
|
|
1892
1889
|
let $ = c(2), t0;
|
|
1893
1890
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
|
|
1894
1891
|
...props,
|
|
1895
|
-
className:
|
|
1892
|
+
className: "BsYI2a_perspectivePopoverContent"
|
|
1896
1893
|
}), $[0] = props, $[1] = t0), t0;
|
|
1897
1894
|
}
|
|
1898
1895
|
function PerspectivePopoverLink(props) {
|
|
1899
1896
|
let $ = c(2), t0;
|
|
1900
1897
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx("a", {
|
|
1901
1898
|
...props,
|
|
1902
|
-
className:
|
|
1899
|
+
className: "BsYI2a_perspectivePopoverLink"
|
|
1903
1900
|
}), $[0] = props, $[1] = t0), t0;
|
|
1904
1901
|
}
|
|
1905
1902
|
function Dot(t0) {
|
|
1906
1903
|
let $ = c(2), { tone } = t0, t1 = `var(--card-badge-${tone}-dot-color)`, t2;
|
|
1907
1904
|
return $[0] === t1 ? t2 = $[1] : (t2 = /* @__PURE__ */ jsx("div", {
|
|
1908
|
-
className:
|
|
1905
|
+
className: "BsYI2a_dot",
|
|
1909
1906
|
style: { backgroundColor: t1 }
|
|
1910
1907
|
}), $[0] = t1, $[1] = t2), t2;
|
|
1911
1908
|
}
|
|
@@ -2343,12 +2340,11 @@ function hasReleaseInPerspective(perspective) {
|
|
|
2343
2340
|
function getUnsatisfiedApiVersionCapability(context, capabilities = API_VERSION_CAPABILITIES) {
|
|
2344
2341
|
if (context.statusCode === 400) return capabilities.find((capability) => capability.applies(context) && isApiVersionBelow(context.apiVersion, capability.requiredApiVersion));
|
|
2345
2342
|
}
|
|
2346
|
-
var errorCode = "hby5q50";
|
|
2347
2343
|
function ErrorCode(props) {
|
|
2348
2344
|
let $ = c(2), t0;
|
|
2349
2345
|
return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Code, {
|
|
2350
2346
|
...props,
|
|
2351
|
-
className:
|
|
2347
|
+
className: "_7y6tDG_errorCode"
|
|
2352
2348
|
}), $[0] = props, $[1] = t0), t0;
|
|
2353
2349
|
}
|
|
2354
2350
|
function QueryErrorDetails(t0) {
|
|
@@ -2459,38 +2455,37 @@ function getAtKeypath(data, keypath) {
|
|
|
2459
2455
|
}
|
|
2460
2456
|
return { value: current };
|
|
2461
2457
|
}
|
|
2462
|
-
|
|
2463
|
-
const lru = new LRU({ maxSize: 5e4 });
|
|
2458
|
+
const _key2 = "VsSQ8q_resultViewWrapper", lru = new LRU({ maxSize: 5e4 });
|
|
2464
2459
|
function ResultViewWrapper(t0) {
|
|
2465
|
-
let $ = c(25), { children, copyable } = t0, { color, font, space } = useTheme_v2(), codeSize = font.code.sizes[2], t1 =
|
|
2466
|
-
$[0] === space[0] ?
|
|
2467
|
-
let
|
|
2468
|
-
$[2] === space[2] ?
|
|
2469
|
-
let
|
|
2470
|
-
$[4] === space[4] ?
|
|
2471
|
-
let
|
|
2472
|
-
$[6] ===
|
|
2473
|
-
let
|
|
2474
|
-
$[8] !== color.syntax.boolean || $[9] !== color.syntax.constant || $[10] !== color.syntax.number || $[11] !== color.syntax.property || $[12] !== color.syntax.string || $[13] !== font.code.family || $[14] !==
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
}
|
|
2488
|
-
let t15;
|
|
2489
|
-
return $[21] !== children || $[22] !==
|
|
2490
|
-
className:
|
|
2491
|
-
style
|
|
2460
|
+
let $ = c(25), { children, copyable } = t0, { color, font, space } = useTheme_v2(), codeSize = font.code.sizes[2], t1 = font.code.family, t2 = `${codeSize.fontSize}px`, t3 = `${codeSize.lineHeight}px`, t4;
|
|
2461
|
+
$[0] === space[0] ? t4 = $[1] : (t4 = rem(space[0]), $[0] = space[0], $[1] = t4);
|
|
2462
|
+
let t5 = `${t4}`, t6;
|
|
2463
|
+
$[2] === space[2] ? t6 = $[3] : (t6 = rem(space[2]), $[2] = space[2], $[3] = t6);
|
|
2464
|
+
let t7 = `${t6}`, t8;
|
|
2465
|
+
$[4] === space[4] ? t8 = $[5] : (t8 = rem(space[4]), $[4] = space[4], $[5] = t8);
|
|
2466
|
+
let t9 = `${t8}`, t10 = space[4] / 2, t11;
|
|
2467
|
+
$[6] === t10 ? t11 = $[7] : (t11 = rem(t10), $[6] = t10, $[7] = t11);
|
|
2468
|
+
let t12 = `${t11}`, t13;
|
|
2469
|
+
$[8] !== color.syntax.boolean || $[9] !== color.syntax.constant || $[10] !== color.syntax.number || $[11] !== color.syntax.property || $[12] !== color.syntax.string || $[13] !== font.code.family || $[14] !== t12 || $[15] !== t2 || $[16] !== t3 || $[17] !== t5 || $[18] !== t7 || $[19] !== t9 ? (t13 = {
|
|
2470
|
+
"--vision-result-code-family": t1,
|
|
2471
|
+
"--vision-result-code-font-size": t2,
|
|
2472
|
+
"--vision-result-code-line-height": t3,
|
|
2473
|
+
"--vision-result-space-0": t5,
|
|
2474
|
+
"--vision-result-space-2": t7,
|
|
2475
|
+
"--vision-result-space-4": t9,
|
|
2476
|
+
"--vision-result-space-4-half": t12,
|
|
2477
|
+
"--vision-result-syntax-property": color.syntax.property,
|
|
2478
|
+
"--vision-result-syntax-constant": color.syntax.constant,
|
|
2479
|
+
"--vision-result-syntax-string": color.syntax.string,
|
|
2480
|
+
"--vision-result-syntax-boolean": color.syntax.boolean,
|
|
2481
|
+
"--vision-result-syntax-number": color.syntax.number
|
|
2482
|
+
}, $[8] = color.syntax.boolean, $[9] = color.syntax.constant, $[10] = color.syntax.number, $[11] = color.syntax.property, $[12] = color.syntax.string, $[13] = font.code.family, $[14] = t12, $[15] = t2, $[16] = t3, $[17] = t5, $[18] = t7, $[19] = t9, $[20] = t13) : t13 = $[20];
|
|
2483
|
+
let style = t13, t14 = copyable ? `${_key2} VsSQ8q_copyableResult` : _key2, t15;
|
|
2484
|
+
return $[21] !== children || $[22] !== style || $[23] !== t14 ? (t15 = /* @__PURE__ */ jsx("div", {
|
|
2485
|
+
className: t14,
|
|
2486
|
+
style,
|
|
2492
2487
|
children
|
|
2493
|
-
}), $[21] = children, $[22] =
|
|
2488
|
+
}), $[21] = children, $[22] = style, $[23] = t14, $[24] = t15) : t15 = $[24], t15;
|
|
2494
2489
|
}
|
|
2495
2490
|
const ResultLabelContext = createContext(null);
|
|
2496
2491
|
function ResultView(props) {
|
|
@@ -2554,7 +2549,7 @@ function CopyNodeButton(props) {
|
|
|
2554
2549
|
let t2;
|
|
2555
2550
|
return $[5] !== copy.label || $[6] !== t0 ? (t2 = /* @__PURE__ */ jsx("button", {
|
|
2556
2551
|
"aria-label": copy.label,
|
|
2557
|
-
className:
|
|
2552
|
+
className: "VsSQ8q_copyNodeButton",
|
|
2558
2553
|
"data-testid": "result-copy-node",
|
|
2559
2554
|
onClick: t0,
|
|
2560
2555
|
title: copy.label,
|
|
@@ -3538,7 +3533,7 @@ function _temp() {
|
|
|
3538
3533
|
return DEFAULT_PREFERENCE;
|
|
3539
3534
|
}
|
|
3540
3535
|
var SanityVision_exports = /* @__PURE__ */ __exportAll({ default: () => SanityVision });
|
|
3541
|
-
const vistaGui = createRetryableLazy(() => import("./VistaGui-
|
|
3536
|
+
const vistaGui = createRetryableLazy(() => import("./VistaGui-C6cdsk92.js").then((module) => ({ default: module.VistaGui }))), VistaGuiLoader = vistaGui.Component;
|
|
3542
3537
|
function SanityVision(props) {
|
|
3543
3538
|
let $ = c(31), t0;
|
|
3544
3539
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "1" }, $[0] = t0) : t0 = $[0];
|
|
@@ -3591,4 +3586,4 @@ function SanityVision(props) {
|
|
|
3591
3586
|
}
|
|
3592
3587
|
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 };
|
|
3593
3588
|
|
|
3594
|
-
//# sourceMappingURL=SanityVision-
|
|
3589
|
+
//# sourceMappingURL=SanityVision-DOH_LzRg.js.map
|