@sanity/vision 5.0.0-next.0-9b570ece82-202507150640 → 5.0.0-next.7
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/LICENSE +1 -1
- package/lib/_chunks-es/{SanityVision.mjs → SanityVision.js} +431 -255
- package/lib/_chunks-es/SanityVision.js.map +1 -0
- package/lib/_chunks-es/{index.mjs → index.js} +3 -3
- package/lib/{_chunks-cjs → _chunks-es}/index.js.map +1 -1
- package/lib/_chunks-es/{resources.mjs → resources.js} +3 -1
- package/lib/{_chunks-cjs → _chunks-es}/resources.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/package.json +36 -41
- package/lib/_chunks-cjs/SanityVision.js +0 -1866
- package/lib/_chunks-cjs/SanityVision.js.map +0 -1
- package/lib/_chunks-cjs/index.js +0 -36
- package/lib/_chunks-cjs/resources.js +0 -111
- package/lib/_chunks-es/SanityVision.mjs.map +0 -1
- package/lib/_chunks-es/index.mjs.map +0 -1
- package/lib/_chunks-es/resources.mjs.map +0 -1
- package/lib/index.d.mts +0 -151
- package/lib/index.mjs +0 -5
- package/lib/index.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
3
|
-
import { useTranslation, useKeyValueStore, useDateTimeFormat, ContextMenuButton, Translate, usePerspective, useDataset, useClient } from "sanity";
|
|
4
|
-
import { Spinner, rem, useTheme, Flex,
|
|
5
|
-
import { useState, useEffect, forwardRef, useRef, useImperativeHandle,
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useTranslation, useKeyValueStore, useDateTimeFormat, ContextMenuButton, Translate, usePerspective, useDataset, useScheduledDraftsEnabled, useActiveReleases, useWorkspace, sortReleases, useClient, isCardinalityOneRelease, getReleaseIdFromReleaseDocumentId } from "sanity";
|
|
4
|
+
import { Spinner, rem, useTheme, Flex, Card, Label, Box, Text, Tooltip, Stack, useToast, TextInput, MenuButton, Menu, MenuItem, Code, Button, Hotkeys, useClickOutsideEvent, Popover, Inline, Badge, Grid, Select, Container, Heading } from "@sanity/ui";
|
|
5
|
+
import { useState, useEffect, forwardRef, useRef, useImperativeHandle, Fragment, Component } from "react";
|
|
6
6
|
import { SplitPane } from "@rexxars/react-split-pane";
|
|
7
7
|
import { ErrorOutlineIcon, TrashIcon, AddIcon, SearchIcon, StopIcon, PlayIcon, HelpCircleIcon, CopyIcon, LinkIcon, DocumentSheetIcon, ChevronLeftIcon, ChevronRightIcon } from "@sanity/icons";
|
|
8
8
|
import { isHotkey } from "is-hotkey-esm";
|
|
@@ -17,7 +17,7 @@ import { lineNumbers, highlightActiveLine, highlightActiveLineGutter, highlightS
|
|
|
17
17
|
import { tags } from "@lezer/highlight";
|
|
18
18
|
import { hues } from "@sanity/color";
|
|
19
19
|
import { styled, css } from "styled-components";
|
|
20
|
-
import { visionLocaleNamespace } from "./index.
|
|
20
|
+
import { visionLocaleNamespace } from "./index.js";
|
|
21
21
|
import debounce from "lodash/debounce.js";
|
|
22
22
|
import JSON5 from "json5";
|
|
23
23
|
import isEqual from "lodash/isEqual.js";
|
|
@@ -54,14 +54,14 @@ const codemirrorExtensions = [[javascriptLanguage], lineNumbers(), highlightActi
|
|
|
54
54
|
].flat().filter(Boolean))];
|
|
55
55
|
function useCodemirrorTheme(theme) {
|
|
56
56
|
const $ = c(7);
|
|
57
|
-
let t0
|
|
58
|
-
$[0] !== theme ? (
|
|
57
|
+
let t0;
|
|
58
|
+
$[0] !== theme ? (t0 = createTheme(theme), $[0] = theme, $[1] = t0) : t0 = $[1];
|
|
59
59
|
const cmTheme = t0;
|
|
60
|
-
let
|
|
61
|
-
$[2] !== theme ? (
|
|
62
|
-
const cmHighlight =
|
|
63
|
-
let
|
|
64
|
-
return $[4] !== cmHighlight || $[5] !== cmTheme ? (
|
|
60
|
+
let t1;
|
|
61
|
+
$[2] !== theme ? (t1 = syntaxHighlighting(createHighlight(theme)), $[2] = theme, $[3] = t1) : t1 = $[3];
|
|
62
|
+
const cmHighlight = t1;
|
|
63
|
+
let t2;
|
|
64
|
+
return $[4] !== cmHighlight || $[5] !== cmTheme ? (t2 = [cmTheme, cmHighlight], $[4] = cmHighlight, $[5] = cmTheme, $[6] = t2) : t2 = $[6], t2;
|
|
65
65
|
}
|
|
66
66
|
function createTheme(theme) {
|
|
67
67
|
const {
|
|
@@ -188,7 +188,7 @@ const EditorRoot = styled.div`
|
|
|
188
188
|
`, VisionCodeMirror = forwardRef((props, ref) => {
|
|
189
189
|
const $ = c(7), [initialValue] = useState(props.initialValue), sanityTheme = useTheme(), theme = useCodemirrorTheme(sanityTheme), codeMirrorRef = useRef(null);
|
|
190
190
|
let t0;
|
|
191
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (newContent) => {
|
|
191
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = (newContent) => {
|
|
192
192
|
const editorView = codeMirrorRef.current?.view;
|
|
193
193
|
if (!editorView)
|
|
194
194
|
return;
|
|
@@ -204,14 +204,14 @@ const EditorRoot = styled.div`
|
|
|
204
204
|
}, $[0] = t0) : t0 = $[0];
|
|
205
205
|
const resetEditorContent = t0;
|
|
206
206
|
let t1, t2;
|
|
207
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ({
|
|
207
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ({
|
|
208
208
|
resetEditorContent
|
|
209
209
|
}), t2 = [resetEditorContent], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useImperativeHandle(ref, t1, t2);
|
|
210
210
|
let t3;
|
|
211
211
|
return $[3] !== initialValue || $[4] !== props.onChange || $[5] !== theme ? (t3 = /* @__PURE__ */ jsx(EditorRoot, { children: /* @__PURE__ */ jsx(CodeMirror, { ref: codeMirrorRef, basicSetup: !1, theme, extensions: codemirrorExtensions, value: initialValue, onChange: props.onChange }) }), $[3] = initialValue, $[4] = props.onChange, $[5] = theme, $[6] = t3) : t3 = $[6], t3;
|
|
212
212
|
});
|
|
213
213
|
VisionCodeMirror.displayName = "VisionCodeMirror";
|
|
214
|
-
const SUPPORTED_PERSPECTIVES = ["pinnedRelease", "raw", "published", "drafts"], VIRTUAL_PERSPECTIVES = ["pinnedRelease"];
|
|
214
|
+
const SUPPORTED_PERSPECTIVES = ["pinnedRelease", "scheduledDrafts", "raw", "published", "drafts"], VIRTUAL_PERSPECTIVES = ["pinnedRelease", "scheduledDrafts"];
|
|
215
215
|
function isSupportedPerspective(p) {
|
|
216
216
|
return SUPPORTED_PERSPECTIVES.includes(p);
|
|
217
217
|
}
|
|
@@ -225,9 +225,10 @@ function hasPinnedPerspective({
|
|
|
225
225
|
}
|
|
226
226
|
function getActivePerspective({
|
|
227
227
|
visionPerspective,
|
|
228
|
-
perspectiveStack
|
|
228
|
+
perspectiveStack,
|
|
229
|
+
scheduledDraftsStack
|
|
229
230
|
}) {
|
|
230
|
-
return visionPerspective
|
|
231
|
+
return visionPerspective === "pinnedRelease" ? perspectiveStack : visionPerspective === "scheduledDrafts" ? scheduledDraftsStack : visionPerspective;
|
|
231
232
|
}
|
|
232
233
|
function encodeQueryString(query, params = {}, options = {}) {
|
|
233
234
|
const searchParams = new URLSearchParams();
|
|
@@ -466,7 +467,7 @@ const TimingsTextContainer = styled(Flex)`
|
|
|
466
467
|
|
|
467
468
|
}`;
|
|
468
469
|
function ParamsEditor(props) {
|
|
469
|
-
const $ = c(
|
|
470
|
+
const $ = c(21), {
|
|
470
471
|
onChange,
|
|
471
472
|
paramsError,
|
|
472
473
|
hasValidParams,
|
|
@@ -475,50 +476,32 @@ function ParamsEditor(props) {
|
|
|
475
476
|
t
|
|
476
477
|
} = useTranslation(visionLocaleNamespace);
|
|
477
478
|
let t0;
|
|
478
|
-
$[0] !==
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
let t1, t2;
|
|
486
|
-
$[3] !== error || $[4] !== init || $[5] !== isValid || $[6] !== onChange || $[7] !== parsed || $[8] !== value ? (t1 = () => {
|
|
487
|
-
init || (onChange({
|
|
488
|
-
parsed,
|
|
489
|
-
raw: value,
|
|
490
|
-
valid: isValid,
|
|
491
|
-
error
|
|
492
|
-
}), setInit(!0));
|
|
493
|
-
}, t2 = [error, init, isValid, onChange, parsed, value], $[3] = error, $[4] = init, $[5] = isValid, $[6] = onChange, $[7] = parsed, $[8] = value, $[9] = t1, $[10] = t2) : (t1 = $[9], t2 = $[10]), useEffect(t1, t2);
|
|
479
|
+
$[0] !== onChange ? (t0 = (newValue) => {
|
|
480
|
+
onChange(newValue);
|
|
481
|
+
}, $[0] = onChange, $[1] = t0) : t0 = $[1];
|
|
482
|
+
const handleChangeRaw = t0;
|
|
483
|
+
let t1;
|
|
484
|
+
$[2] !== handleChangeRaw ? (t1 = debounce(handleChangeRaw, 333), $[2] = handleChangeRaw, $[3] = t1) : t1 = $[3];
|
|
485
|
+
const handleChange = t1, t2 = hasValidParams ? "default" : "critical";
|
|
494
486
|
let t3;
|
|
495
|
-
$[
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
let
|
|
501
|
-
$[
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
487
|
+
$[4] !== t ? (t3 = t("params.label"), $[4] = t, $[5] = t3) : t3 = $[5];
|
|
488
|
+
let t4;
|
|
489
|
+
$[6] !== t3 ? (t4 = /* @__PURE__ */ jsx(StyledLabel, { muted: !0, children: t3 }), $[6] = t3, $[7] = t4) : t4 = $[7];
|
|
490
|
+
let t5;
|
|
491
|
+
$[8] !== paramsError ? (t5 = paramsError && /* @__PURE__ */ jsx(Tooltip, { animate: !0, placement: "top", portal: !0, content: /* @__PURE__ */ jsx(Text, { size: 1, children: paramsError }), children: /* @__PURE__ */ jsx(Box, { padding: 1, marginX: 2, children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(ErrorOutlineIcon, {}) }) }) }), $[8] = paramsError, $[9] = t5) : t5 = $[9];
|
|
492
|
+
let t6;
|
|
493
|
+
$[10] !== t4 || $[11] !== t5 ? (t6 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsxs(Flex, { children: [
|
|
494
|
+
t4,
|
|
495
|
+
t5
|
|
496
|
+
] }) }), $[10] = t4, $[11] = t5, $[12] = t6) : t6 = $[12];
|
|
497
|
+
const t7 = props.value || defaultValue$1;
|
|
505
498
|
let t8;
|
|
506
|
-
$[
|
|
499
|
+
$[13] !== editorRef || $[14] !== handleChange || $[15] !== t7 ? (t8 = /* @__PURE__ */ jsx(VisionCodeMirror, { ref: editorRef, initialValue: t7, onChange: handleChange }), $[13] = editorRef, $[14] = handleChange, $[15] = t7, $[16] = t8) : t8 = $[16];
|
|
507
500
|
let t9;
|
|
508
|
-
$[
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
t9
|
|
513
|
-
] }) }), $[22] = t8, $[23] = t9, $[24] = t10) : t10 = $[24];
|
|
514
|
-
const t11 = props.value || defaultValue$1;
|
|
515
|
-
let t12;
|
|
516
|
-
$[25] !== editorRef || $[26] !== handleChange || $[27] !== t11 ? (t12 = /* @__PURE__ */ jsx(VisionCodeMirror, { ref: editorRef, initialValue: t11, onChange: handleChange }), $[25] = editorRef, $[26] = handleChange, $[27] = t11, $[28] = t12) : t12 = $[28];
|
|
517
|
-
let t13;
|
|
518
|
-
return $[29] !== t10 || $[30] !== t12 || $[31] !== t6 ? (t13 = /* @__PURE__ */ jsxs(Card, { flex: 1, tone: t6, "data-testid": "params-editor", children: [
|
|
519
|
-
t10,
|
|
520
|
-
t12
|
|
521
|
-
] }), $[29] = t10, $[30] = t12, $[31] = t6, $[32] = t13) : t13 = $[32], t13;
|
|
501
|
+
return $[17] !== t2 || $[18] !== t6 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Card, { flex: 1, tone: t2, "data-testid": "params-editor", children: [
|
|
502
|
+
t6,
|
|
503
|
+
t8
|
|
504
|
+
] }), $[17] = t2, $[18] = t6, $[19] = t8, $[20] = t9) : t9 = $[20], t9;
|
|
522
505
|
}
|
|
523
506
|
function parseParams(value, t) {
|
|
524
507
|
const parsedParams = tryParseParams(value, t), params = parsedParams instanceof Error ? {} : parsedParams, validationError = parsedParams instanceof Error ? parsedParams.message : void 0;
|
|
@@ -533,15 +516,25 @@ const STORED_QUERIES_NAMESPACE = "studio.vision-tool.saved-queries", defaultValu
|
|
|
533
516
|
queries: []
|
|
534
517
|
}, keyValueStoreKey = STORED_QUERIES_NAMESPACE;
|
|
535
518
|
function useSavedQueries() {
|
|
536
|
-
const keyValueStore = useKeyValueStore(), [value, setValue] = useState(defaultValue), [saving, setSaving] = useState(!1)
|
|
537
|
-
|
|
538
|
-
|
|
519
|
+
const $ = c(27), keyValueStore = useKeyValueStore(), [value, setValue] = useState(defaultValue), [saving, setSaving] = useState(!1);
|
|
520
|
+
let t0;
|
|
521
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
|
|
522
|
+
const [deleting, setDeleting] = useState(t0), [saveQueryError, setSaveQueryError] = useState(), [deleteQueryError, setDeleteQueryError] = useState(), [error, setError] = useState();
|
|
523
|
+
let t1;
|
|
524
|
+
$[1] !== keyValueStore ? (t1 = keyValueStore.getKey(keyValueStoreKey), $[1] = keyValueStore, $[2] = t1) : t1 = $[2];
|
|
525
|
+
const queries = t1;
|
|
526
|
+
let t2;
|
|
527
|
+
$[3] !== queries ? (t2 = () => {
|
|
528
|
+
const sub = queries.pipe(startWith(defaultValue), map(_temp$5)).subscribe({
|
|
539
529
|
next: setValue,
|
|
540
530
|
error: (err) => setError(err)
|
|
541
531
|
});
|
|
542
532
|
return () => sub?.unsubscribe();
|
|
543
|
-
}, [queries,
|
|
544
|
-
|
|
533
|
+
}, $[3] = queries, $[4] = t2) : t2 = $[4];
|
|
534
|
+
let t3;
|
|
535
|
+
$[5] !== keyValueStore || $[6] !== queries ? (t3 = [queries, keyValueStore], $[5] = keyValueStore, $[6] = queries, $[7] = t3) : t3 = $[7], useEffect(t2, t3);
|
|
536
|
+
let t4;
|
|
537
|
+
$[8] !== keyValueStore || $[9] !== value.queries ? (t4 = async (query) => {
|
|
545
538
|
setSaving(!0), setSaveQueryError(void 0);
|
|
546
539
|
try {
|
|
547
540
|
const newQueries = [{
|
|
@@ -550,15 +543,17 @@ function useSavedQueries() {
|
|
|
550
543
|
}, ...value.queries];
|
|
551
544
|
setValue({
|
|
552
545
|
queries: newQueries
|
|
553
|
-
}), keyValueStore.setKey(keyValueStoreKey, {
|
|
546
|
+
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
554
547
|
queries: newQueries
|
|
555
548
|
});
|
|
556
|
-
} catch (
|
|
557
|
-
setSaveQueryError(
|
|
558
|
-
} finally {
|
|
559
|
-
setSaving(!1);
|
|
549
|
+
} catch (t52) {
|
|
550
|
+
setSaveQueryError(t52);
|
|
560
551
|
}
|
|
561
|
-
|
|
552
|
+
setSaving(!1);
|
|
553
|
+
}, $[8] = keyValueStore, $[9] = value.queries, $[10] = t4) : t4 = $[10];
|
|
554
|
+
const saveQuery = t4;
|
|
555
|
+
let t5;
|
|
556
|
+
$[11] !== keyValueStore || $[12] !== value.queries ? (t5 = async (query_0) => {
|
|
562
557
|
setSaving(!0), setSaveQueryError(void 0);
|
|
563
558
|
try {
|
|
564
559
|
const updatedQueries = value.queries.map((q) => q._key === query_0._key ? {
|
|
@@ -567,30 +562,33 @@ function useSavedQueries() {
|
|
|
567
562
|
} : q);
|
|
568
563
|
setValue({
|
|
569
564
|
queries: updatedQueries
|
|
570
|
-
}), keyValueStore.setKey(keyValueStoreKey, {
|
|
565
|
+
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
571
566
|
queries: updatedQueries
|
|
572
567
|
});
|
|
573
|
-
} catch (
|
|
574
|
-
setSaveQueryError(
|
|
575
|
-
} finally {
|
|
576
|
-
setSaving(!1);
|
|
568
|
+
} catch (t62) {
|
|
569
|
+
setSaveQueryError(t62);
|
|
577
570
|
}
|
|
578
|
-
|
|
571
|
+
setSaving(!1);
|
|
572
|
+
}, $[11] = keyValueStore, $[12] = value.queries, $[13] = t5) : t5 = $[13];
|
|
573
|
+
const updateQuery = t5;
|
|
574
|
+
let t6;
|
|
575
|
+
$[14] !== keyValueStore || $[15] !== value.queries ? (t6 = async (key) => {
|
|
579
576
|
setDeleting((prev) => [...prev, key]), setDeleteQueryError(void 0);
|
|
580
577
|
try {
|
|
581
578
|
const filteredQueries = value.queries.filter((q_0) => q_0._key !== key);
|
|
582
579
|
setValue({
|
|
583
580
|
queries: filteredQueries
|
|
584
|
-
}), keyValueStore.setKey(keyValueStoreKey, {
|
|
581
|
+
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
585
582
|
queries: filteredQueries
|
|
586
583
|
});
|
|
587
|
-
} catch (
|
|
588
|
-
setDeleteQueryError(
|
|
589
|
-
} finally {
|
|
590
|
-
setDeleting((prev) => prev.filter((k) => k !== key));
|
|
584
|
+
} catch (t72) {
|
|
585
|
+
setDeleteQueryError(t72);
|
|
591
586
|
}
|
|
592
|
-
|
|
593
|
-
|
|
587
|
+
setDeleting((prev_0) => prev_0.filter((k) => k !== key));
|
|
588
|
+
}, $[14] = keyValueStore, $[15] = value.queries, $[16] = t6) : t6 = $[16];
|
|
589
|
+
const deleteQuery = t6;
|
|
590
|
+
let t7;
|
|
591
|
+
return $[17] !== deleteQuery || $[18] !== deleteQueryError || $[19] !== deleting || $[20] !== error || $[21] !== saveQuery || $[22] !== saveQueryError || $[23] !== saving || $[24] !== updateQuery || $[25] !== value.queries ? (t7 = {
|
|
594
592
|
queries: value.queries,
|
|
595
593
|
saveQuery,
|
|
596
594
|
updateQuery,
|
|
@@ -600,7 +598,10 @@ function useSavedQueries() {
|
|
|
600
598
|
saveQueryError,
|
|
601
599
|
deleteQueryError,
|
|
602
600
|
error
|
|
603
|
-
};
|
|
601
|
+
}, $[17] = deleteQuery, $[18] = deleteQueryError, $[19] = deleting, $[20] = error, $[21] = saveQuery, $[22] = saveQueryError, $[23] = saving, $[24] = updateQuery, $[25] = value.queries, $[26] = t7) : t7 = $[26], t7;
|
|
602
|
+
}
|
|
603
|
+
function _temp$5(data) {
|
|
604
|
+
return data || defaultValue;
|
|
604
605
|
}
|
|
605
606
|
const FixedHeader = styled(Stack)`
|
|
606
607
|
position: sticky;
|
|
@@ -648,7 +649,7 @@ function QueryRecall(t0) {
|
|
|
648
649
|
t
|
|
649
650
|
} = useTranslation(visionLocaleNamespace);
|
|
650
651
|
let t1;
|
|
651
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = {
|
|
652
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
|
|
652
653
|
month: "short",
|
|
653
654
|
day: "numeric",
|
|
654
655
|
year: "numeric",
|
|
@@ -658,7 +659,7 @@ function QueryRecall(t0) {
|
|
|
658
659
|
}, $[0] = t1) : t1 = $[0];
|
|
659
660
|
const formatDate = useDateTimeFormat(t1), [editingKey, setEditingKey] = useState(null), [editingTitle, setEditingTitle] = useState("");
|
|
660
661
|
let t2;
|
|
661
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
|
|
662
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
|
|
662
663
|
const [optimisticTitles, setOptimisticTitles] = useState(t2), [searchQuery, setSearchQuery] = useState(""), [selectedUrl, setSelectedUrl] = useState(url);
|
|
663
664
|
let t3;
|
|
664
665
|
$[2] !== currentParams || $[3] !== currentQuery || $[4] !== formatDate || $[5] !== generateUrl || $[6] !== getStateFromUrl || $[7] !== queries || $[8] !== saveQuery || $[9] !== saveQueryError || $[10] !== t || $[11] !== toast ? (t3 = async () => {
|
|
@@ -776,7 +777,7 @@ function QueryRecall(t0) {
|
|
|
776
777
|
const filteredQueries = queries?.filter((q_3) => q_3?.title?.toLowerCase().includes(searchQuery.toLowerCase()));
|
|
777
778
|
T1 = ScrollContainer;
|
|
778
779
|
let t92;
|
|
779
|
-
$[49] === Symbol.for("react.memo_cache_sentinel") ? (t92 = {
|
|
780
|
+
$[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t92 = {
|
|
780
781
|
textTransform: "capitalize"
|
|
781
782
|
}, $[49] = t92) : t92 = $[49];
|
|
782
783
|
let t102;
|
|
@@ -795,7 +796,7 @@ function QueryRecall(t0) {
|
|
|
795
796
|
let t15;
|
|
796
797
|
$[63] !== t ? (t15 = t("label.search-queries"), $[63] = t, $[64] = t15) : t15 = $[64];
|
|
797
798
|
let t16;
|
|
798
|
-
$[65] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (event) => setSearchQuery(event.currentTarget.value), $[65] = t16) : t16 = $[65];
|
|
799
|
+
$[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t16 = (event) => setSearchQuery(event.currentTarget.value), $[65] = t16) : t16 = $[65];
|
|
799
800
|
let t17;
|
|
800
801
|
$[66] !== searchQuery || $[67] !== t15 ? (t17 = /* @__PURE__ */ jsx(Box, { padding: 3, paddingTop: 0, children: /* @__PURE__ */ jsx(TextInput, { placeholder: t15, icon: SearchIcon, value: searchQuery, onChange: t16 }) }), $[66] = searchQuery, $[67] = t15, $[68] = t17) : t17 = $[68], $[69] !== t14 || $[70] !== t17 ? (t8 = /* @__PURE__ */ jsxs(FixedHeader, { space: 3, children: [
|
|
801
802
|
t14,
|
|
@@ -875,11 +876,11 @@ function calculatePaneSizeOptions(height) {
|
|
|
875
876
|
};
|
|
876
877
|
}
|
|
877
878
|
function usePaneSize(t0) {
|
|
878
|
-
const $ = c(
|
|
879
|
+
const $ = c(6), {
|
|
879
880
|
visionRootRef
|
|
880
|
-
} = t0, [isNarrowBreakpoint, setIsNarrowBreakpoint] = useState(_temp$
|
|
881
|
-
let t1;
|
|
882
|
-
$[0] !== visionRootRef
|
|
881
|
+
} = t0, [isNarrowBreakpoint, setIsNarrowBreakpoint] = useState(_temp$4), [paneSizeOptions, setPaneSizeOptions] = useState(_temp2$3);
|
|
882
|
+
let t1, t2;
|
|
883
|
+
$[0] !== visionRootRef ? (t1 = () => {
|
|
883
884
|
if (!visionRootRef.current)
|
|
884
885
|
return;
|
|
885
886
|
const handleResize = (entries) => {
|
|
@@ -890,19 +891,17 @@ function usePaneSize(t0) {
|
|
|
890
891
|
return resizeObserver.observe(visionRootRef.current), () => {
|
|
891
892
|
resizeObserver.disconnect();
|
|
892
893
|
};
|
|
893
|
-
}, $[0] = visionRootRef
|
|
894
|
-
let t2;
|
|
895
|
-
$[2] !== visionRootRef ? (t2 = [visionRootRef], $[2] = visionRootRef, $[3] = t2) : t2 = $[3], useEffect(t1, t2);
|
|
894
|
+
}, t2 = [visionRootRef], $[0] = visionRootRef, $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useEffect(t1, t2);
|
|
896
895
|
let t3;
|
|
897
|
-
return $[
|
|
896
|
+
return $[3] !== isNarrowBreakpoint || $[4] !== paneSizeOptions ? (t3 = {
|
|
898
897
|
paneSizeOptions,
|
|
899
898
|
isNarrowBreakpoint
|
|
900
|
-
}, $[
|
|
899
|
+
}, $[3] = isNarrowBreakpoint, $[4] = paneSizeOptions, $[5] = t3) : t3 = $[5], t3;
|
|
901
900
|
}
|
|
902
|
-
function _temp2$
|
|
901
|
+
function _temp2$3() {
|
|
903
902
|
return calculatePaneSizeOptions(void 0);
|
|
904
903
|
}
|
|
905
|
-
function _temp$
|
|
904
|
+
function _temp$4() {
|
|
906
905
|
return narrowBreakpoint();
|
|
907
906
|
}
|
|
908
907
|
function VisionGuiControls(t0) {
|
|
@@ -920,7 +919,7 @@ function VisionGuiControls(t0) {
|
|
|
920
919
|
let t2;
|
|
921
920
|
$[2] !== t1 ? (t2 = /* @__PURE__ */ jsx(Card, { radius: 4, children: /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: t1 }) }), $[2] = t1, $[3] = t2) : t2 = $[3];
|
|
922
921
|
let t3;
|
|
923
|
-
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = /* @__PURE__ */ jsx(Card, { radius: 4, children: /* @__PURE__ */ jsx(Hotkeys, { keys: ["Ctrl", "Enter"] }) }), $[4] = t3) : t3 = $[4];
|
|
922
|
+
$[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = /* @__PURE__ */ jsx(Card, { radius: 4, children: /* @__PURE__ */ jsx(Hotkeys, { keys: ["Ctrl", "Enter"] }) }), $[4] = t3) : t3 = $[4];
|
|
924
923
|
const t4 = queryInProgress ? StopIcon : PlayIcon, t5 = listenInProgress || !hasValidParams, t6 = queryInProgress ? "positive" : "primary";
|
|
925
924
|
let t7;
|
|
926
925
|
$[5] !== queryInProgress || $[6] !== t ? (t7 = t(queryInProgress ? "action.query-cancel" : "action.query-execute"), $[5] = queryInProgress, $[6] = t, $[7] = t7) : t7 = $[7];
|
|
@@ -958,12 +957,12 @@ const PerspectivePopoverContent = styled(Box)`
|
|
|
958
957
|
function PerspectivePopover() {
|
|
959
958
|
const $ = c(39), [open, setOpen] = useState(!1), buttonRef = useRef(null), popoverRef = useRef(null);
|
|
960
959
|
let t0;
|
|
961
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => setOpen(_temp$
|
|
960
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = () => setOpen(_temp$3), $[0] = t0) : t0 = $[0];
|
|
962
961
|
const handleClick = t0, {
|
|
963
962
|
t
|
|
964
963
|
} = useTranslation(visionLocaleNamespace);
|
|
965
964
|
let t1, t2;
|
|
966
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), t2 = () => [buttonRef.current, popoverRef.current], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useClickOutsideEvent(t1, t2);
|
|
965
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setOpen(!1), t2 = () => [buttonRef.current, popoverRef.current], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useClickOutsideEvent(t1, t2);
|
|
967
966
|
let t3;
|
|
968
967
|
$[3] !== t ? (t3 = t("settings.perspectives.title"), $[3] = t, $[4] = t3) : t3 = $[4];
|
|
969
968
|
let t4;
|
|
@@ -988,7 +987,7 @@ function PerspectivePopover() {
|
|
|
988
987
|
let t12;
|
|
989
988
|
$[22] !== t ? (t12 = t("settings.perspectives.action.docs-link"), $[22] = t, $[23] = t12) : t12 = $[23];
|
|
990
989
|
let t13;
|
|
991
|
-
$[24] !== t12 ? (t13 = /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsxs(PerspectivePopoverLink, { href: "https://sanity.io/docs/perspectives", target: "_blank", children: [
|
|
990
|
+
$[24] !== t12 ? (t13 = /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsxs(PerspectivePopoverLink, { href: "https://www.sanity.io/docs/perspectives", target: "_blank", children: [
|
|
992
991
|
t12,
|
|
993
992
|
" \u2192"
|
|
994
993
|
] }) }) }), $[24] = t12, $[25] = t13) : t13 = $[25];
|
|
@@ -1001,31 +1000,34 @@ function PerspectivePopover() {
|
|
|
1001
1000
|
t13
|
|
1002
1001
|
] }) }), $[26] = t10, $[27] = t11, $[28] = t13, $[29] = t4, $[30] = t6, $[31] = t14) : t14 = $[31];
|
|
1003
1002
|
let t15;
|
|
1004
|
-
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx(Dot, { $tone: "primary" }), $[32] = t15) : t15 = $[32];
|
|
1003
|
+
$[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx(Dot, { $tone: "primary" }), $[32] = t15) : t15 = $[32];
|
|
1005
1004
|
let t16;
|
|
1006
1005
|
$[33] !== open ? (t16 = /* @__PURE__ */ jsx(Button, { icon: HelpCircleIcon, mode: "bleed", padding: 2, paddingRight: 1, tone: "primary", fontSize: 1, ref: buttonRef, onClick: handleClick, selected: open, children: t15 }), $[33] = open, $[34] = t16) : t16 = $[34];
|
|
1007
1006
|
let t17;
|
|
1008
1007
|
return $[35] !== open || $[36] !== t14 || $[37] !== t16 ? (t17 = /* @__PURE__ */ jsx(Popover, { content: t14, placement: "bottom-start", portal: !0, padding: 3, ref: popoverRef, open, children: t16 }), $[35] = open, $[36] = t14, $[37] = t16, $[38] = t17) : t17 = $[38], t17;
|
|
1009
1008
|
}
|
|
1010
|
-
function _temp$
|
|
1009
|
+
function _temp$3(o) {
|
|
1011
1010
|
return !o;
|
|
1012
1011
|
}
|
|
1013
1012
|
const PinnedReleasePerspectiveOption = (t0) => {
|
|
1014
|
-
const $ = c(
|
|
1013
|
+
const $ = c(11), {
|
|
1015
1014
|
pinnedPerspective,
|
|
1016
1015
|
t
|
|
1017
1016
|
} = t0, name = typeof pinnedPerspective.selectedPerspective == "object" ? pinnedPerspective.selectedPerspective.metadata.title : pinnedPerspective.selectedPerspectiveName;
|
|
1018
1017
|
let t1;
|
|
1019
1018
|
$[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];
|
|
1020
1019
|
const label = t1;
|
|
1021
|
-
let t2
|
|
1022
|
-
$[3] !== label || $[4] !== name ? (
|
|
1023
|
-
const text = t2
|
|
1020
|
+
let t2;
|
|
1021
|
+
$[3] !== label || $[4] !== name ? (t2 = [name, label].filter(_temp$2), $[3] = label, $[4] = name, $[5] = t2) : t2 = $[5];
|
|
1022
|
+
const text = t2.join(" ");
|
|
1023
|
+
let t3;
|
|
1024
|
+
$[6] !== pinnedPerspective ? (t3 = hasPinnedPerspective(pinnedPerspective), $[6] = pinnedPerspective, $[7] = t3) : t3 = $[7];
|
|
1025
|
+
const t4 = !t3;
|
|
1024
1026
|
let t5;
|
|
1025
|
-
return $[
|
|
1027
|
+
return $[8] !== t4 || $[9] !== text ? (t5 = /* @__PURE__ */ jsx("option", { value: "pinnedRelease", disabled: t4, children: text }), $[8] = t4, $[9] = text, $[10] = t5) : t5 = $[10], t5;
|
|
1026
1028
|
};
|
|
1027
1029
|
function VisionGuiHeader(t0) {
|
|
1028
|
-
const $ = c(
|
|
1030
|
+
const $ = c(65), {
|
|
1029
1031
|
onChangeDataset,
|
|
1030
1032
|
dataset,
|
|
1031
1033
|
customApiVersion,
|
|
@@ -1037,12 +1039,13 @@ function VisionGuiHeader(t0) {
|
|
|
1037
1039
|
isValidApiVersion,
|
|
1038
1040
|
onChangePerspective,
|
|
1039
1041
|
url,
|
|
1040
|
-
perspective
|
|
1042
|
+
perspective,
|
|
1043
|
+
isScheduledDraftsEnabled
|
|
1041
1044
|
} = t0, pinnedPerspective = usePerspective(), {
|
|
1042
1045
|
t
|
|
1043
1046
|
} = useTranslation(visionLocaleNamespace), operationUrlElement = useRef(null);
|
|
1044
1047
|
let t1;
|
|
1045
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
|
|
1048
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
|
|
1046
1049
|
const el = operationUrlElement.current;
|
|
1047
1050
|
if (el)
|
|
1048
1051
|
try {
|
|
@@ -1053,13 +1056,13 @@ function VisionGuiHeader(t0) {
|
|
|
1053
1056
|
}, $[0] = t1) : t1 = $[0];
|
|
1054
1057
|
const handleCopyUrl = t1;
|
|
1055
1058
|
let t2;
|
|
1056
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [1, 4, 8, 12], $[1] = t2) : t2 = $[1];
|
|
1059
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = [1, 4, 8, 12], $[1] = t2) : t2 = $[1];
|
|
1057
1060
|
let t3;
|
|
1058
1061
|
$[2] !== t ? (t3 = t("settings.dataset-label"), $[2] = t, $[3] = t3) : t3 = $[3];
|
|
1059
1062
|
let t4;
|
|
1060
1063
|
$[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsx(StyledLabel, { children: t3 }) }), $[4] = t3, $[5] = t4) : t4 = $[5];
|
|
1061
1064
|
let t5;
|
|
1062
|
-
$[6] !== datasets ? (t5 = datasets.map(_temp2$
|
|
1065
|
+
$[6] !== datasets ? (t5 = datasets.map(_temp2$2), $[6] = datasets, $[7] = t5) : t5 = $[7];
|
|
1063
1066
|
let t6;
|
|
1064
1067
|
$[8] !== dataset || $[9] !== onChangeDataset || $[10] !== t5 ? (t6 = /* @__PURE__ */ jsx(Select, { value: dataset, onChange: onChangeDataset, children: t5 }), $[8] = dataset, $[9] = onChangeDataset, $[10] = t5, $[11] = t6) : t6 = $[11];
|
|
1065
1068
|
let t7;
|
|
@@ -1073,7 +1076,7 @@ function VisionGuiHeader(t0) {
|
|
|
1073
1076
|
$[17] !== t8 ? (t9 = /* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsx(StyledLabel, { children: t8 }) }), $[17] = t8, $[18] = t9) : t9 = $[18];
|
|
1074
1077
|
const t10 = customApiVersion === !1 ? apiVersion : "other";
|
|
1075
1078
|
let t11;
|
|
1076
|
-
$[19] === Symbol.for("react.memo_cache_sentinel") ? (t11 = API_VERSIONS.map(_temp3$1), $[19] = t11) : t11 = $[19];
|
|
1079
|
+
$[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = API_VERSIONS.map(_temp3$1), $[19] = t11) : t11 = $[19];
|
|
1077
1080
|
let t12;
|
|
1078
1081
|
$[20] !== t ? (t12 = t("settings.other-api-version-label"), $[20] = t, $[21] = t12) : t12 = $[21];
|
|
1079
1082
|
let t13;
|
|
@@ -1098,7 +1101,7 @@ function VisionGuiHeader(t0) {
|
|
|
1098
1101
|
let t18;
|
|
1099
1102
|
$[39] !== t17 ? (t18 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(StyledLabel, { children: t17 }) }), $[39] = t17, $[40] = t18) : t18 = $[40];
|
|
1100
1103
|
let t19;
|
|
1101
|
-
$[41] === Symbol.for("react.memo_cache_sentinel") ? (t19 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[41] = t19) : t19 = $[41];
|
|
1104
|
+
$[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t19 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[41] = t19) : t19 = $[41];
|
|
1102
1105
|
let t20;
|
|
1103
1106
|
$[42] !== t18 ? (t20 = /* @__PURE__ */ jsx(Card, { paddingBottom: 1, children: /* @__PURE__ */ jsxs(Inline, { space: 1, children: [
|
|
1104
1107
|
t18,
|
|
@@ -1106,20 +1109,20 @@ function VisionGuiHeader(t0) {
|
|
|
1106
1109
|
] }) }), $[42] = t18, $[43] = t20) : t20 = $[43];
|
|
1107
1110
|
const t21 = perspective || "default";
|
|
1108
1111
|
let t22;
|
|
1109
|
-
$[44] !==
|
|
1112
|
+
$[44] !== isScheduledDraftsEnabled || $[45] !== pinnedPerspective || $[46] !== t ? (t22 = SUPPORTED_PERSPECTIVES.map((perspectiveName) => perspectiveName === "pinnedRelease" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1110
1113
|
/* @__PURE__ */ jsx(PinnedReleasePerspectiveOption, { pinnedPerspective, t }),
|
|
1111
1114
|
/* @__PURE__ */ jsx("option", { value: "default", children: t("settings.perspectives.default") }, "default"),
|
|
1112
1115
|
/* @__PURE__ */ jsx("hr", {})
|
|
1113
|
-
] }, "pinnedRelease") : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[44] =
|
|
1116
|
+
] }, "pinnedRelease") : perspectiveName === "scheduledDrafts" ? isScheduledDraftsEnabled ? /* @__PURE__ */ jsx("option", { value: "scheduledDrafts", children: t("settings.perspectives.scheduled-drafts") }, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[44] = isScheduledDraftsEnabled, $[45] = pinnedPerspective, $[46] = t, $[47] = t22) : t22 = $[47];
|
|
1114
1117
|
let t23;
|
|
1115
|
-
$[
|
|
1118
|
+
$[48] !== onChangePerspective || $[49] !== t21 || $[50] !== t22 ? (t23 = /* @__PURE__ */ jsx(Select, { value: t21, onChange: onChangePerspective, children: t22 }), $[48] = onChangePerspective, $[49] = t21, $[50] = t22, $[51] = t23) : t23 = $[51];
|
|
1116
1119
|
let t24;
|
|
1117
|
-
$[
|
|
1120
|
+
$[52] !== t20 || $[53] !== t23 ? (t24 = /* @__PURE__ */ jsx(Box, { padding: 1, column: 2, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1118
1121
|
t20,
|
|
1119
1122
|
t23
|
|
1120
|
-
] }) }), $[
|
|
1123
|
+
] }) }), $[52] = t20, $[53] = t23, $[54] = t24) : t24 = $[54];
|
|
1121
1124
|
let t25;
|
|
1122
|
-
$[
|
|
1125
|
+
$[55] !== customApiVersion || $[56] !== t || $[57] !== url ? (t25 = typeof url == "string" ? /* @__PURE__ */ jsx(Box, { padding: 1, flex: 1, column: customApiVersion === !1 ? 6 : 4, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1123
1126
|
/* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsxs(StyledLabel, { children: [
|
|
1124
1127
|
t("query.url"),
|
|
1125
1128
|
"\xA0",
|
|
@@ -1133,23 +1136,23 @@ function VisionGuiHeader(t0) {
|
|
|
1133
1136
|
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(TextInput, { readOnly: !0, type: "url", ref: operationUrlElement, value: url }) }),
|
|
1134
1137
|
/* @__PURE__ */ jsx(Tooltip, { content: t("action.copy-url-to-clipboard"), children: /* @__PURE__ */ jsx(Button, { "aria-label": t("action.copy-url-to-clipboard"), type: "button", mode: "ghost", icon: CopyIcon, onClick: handleCopyUrl }) })
|
|
1135
1138
|
] })
|
|
1136
|
-
] }) }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[
|
|
1139
|
+
] }) }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[55] = customApiVersion, $[56] = t, $[57] = url, $[58] = t25) : t25 = $[58];
|
|
1137
1140
|
let t26;
|
|
1138
|
-
return $[
|
|
1141
|
+
return $[59] !== t15 || $[60] !== t16 || $[61] !== t24 || $[62] !== t25 || $[63] !== t7 ? (t26 = /* @__PURE__ */ jsx(Header, { paddingX: 3, paddingY: 2, children: /* @__PURE__ */ jsxs(Grid, { columns: t2, children: [
|
|
1139
1142
|
t7,
|
|
1140
1143
|
t15,
|
|
1141
1144
|
t16,
|
|
1142
1145
|
t24,
|
|
1143
1146
|
t25
|
|
1144
|
-
] }) }), $[
|
|
1147
|
+
] }) }), $[59] = t15, $[60] = t16, $[61] = t24, $[62] = t25, $[63] = t7, $[64] = t26) : t26 = $[64], t26;
|
|
1145
1148
|
}
|
|
1146
1149
|
function _temp3$1(version) {
|
|
1147
1150
|
return /* @__PURE__ */ jsx("option", { children: version }, version);
|
|
1148
1151
|
}
|
|
1149
|
-
function _temp2$
|
|
1152
|
+
function _temp2$2(ds) {
|
|
1150
1153
|
return /* @__PURE__ */ jsx("option", { children: ds }, ds);
|
|
1151
1154
|
}
|
|
1152
|
-
function _temp$
|
|
1155
|
+
function _temp$2(value) {
|
|
1153
1156
|
return typeof value < "u";
|
|
1154
1157
|
}
|
|
1155
1158
|
function getBlobUrl(content, mimeType) {
|
|
@@ -1173,32 +1176,50 @@ const getJsonBlobUrl = getMemoizedBlobUrlResolver("application/json", (input) =>
|
|
|
1173
1176
|
}) => theme.sanity.color.muted.critical.enabled.fg};
|
|
1174
1177
|
`;
|
|
1175
1178
|
function QueryErrorDetails(t0) {
|
|
1176
|
-
const $ = c(
|
|
1179
|
+
const $ = c(20), {
|
|
1177
1180
|
error
|
|
1178
1181
|
} = t0, {
|
|
1179
1182
|
t
|
|
1180
1183
|
} = useTranslation(visionLocaleNamespace);
|
|
1181
1184
|
if (!("details" in error))
|
|
1182
1185
|
return null;
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
t2,
|
|
1200
|
-
|
|
1201
|
-
|
|
1186
|
+
const t1 = error.details;
|
|
1187
|
+
let T0, details, t2, t3, t4, t5;
|
|
1188
|
+
if ($[0] !== error.details) {
|
|
1189
|
+
t5 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1190
|
+
bb0: {
|
|
1191
|
+
if (details = {
|
|
1192
|
+
...t1,
|
|
1193
|
+
...mapToLegacyDetails(error.details)
|
|
1194
|
+
}, !details.line) {
|
|
1195
|
+
t5 = null;
|
|
1196
|
+
break bb0;
|
|
1197
|
+
}
|
|
1198
|
+
T0 = ErrorCode, t4 = 1, t2 = details.line, t3 = dashLine(details.column, details.columnEnd);
|
|
1199
|
+
}
|
|
1200
|
+
$[0] = error.details, $[1] = T0, $[2] = details, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5;
|
|
1201
|
+
} else
|
|
1202
|
+
T0 = $[1], details = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6];
|
|
1203
|
+
if (t5 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1204
|
+
return t5;
|
|
1205
|
+
const t6 = `${t2}
|
|
1206
|
+
${t3}`;
|
|
1207
|
+
let t7;
|
|
1208
|
+
$[7] !== T0 || $[8] !== t4 || $[9] !== t6 ? (t7 = /* @__PURE__ */ jsx(T0, { size: t4, children: t6 }), $[7] = T0, $[8] = t4, $[9] = t6, $[10] = t7) : t7 = $[10];
|
|
1209
|
+
let t8;
|
|
1210
|
+
$[11] !== t ? (t8 = t("query.error.line"), $[11] = t, $[12] = t8) : t8 = $[12];
|
|
1211
|
+
const t9 = details.lineNumber;
|
|
1212
|
+
let t10;
|
|
1213
|
+
$[13] !== t ? (t10 = t("query.error.column"), $[13] = t, $[14] = t10) : t10 = $[14];
|
|
1214
|
+
const t11 = `${t8}: ${t9}
|
|
1215
|
+
${t10}: ${details.column}`;
|
|
1216
|
+
let t12;
|
|
1217
|
+
$[15] !== t11 ? (t12 = /* @__PURE__ */ jsx(Box, { marginTop: 4, children: /* @__PURE__ */ jsx(ErrorCode, { size: 1, children: t11 }) }), $[15] = t11, $[16] = t12) : t12 = $[16];
|
|
1218
|
+
let t13;
|
|
1219
|
+
return $[17] !== t12 || $[18] !== t7 ? (t13 = /* @__PURE__ */ jsxs("div", { children: [
|
|
1220
|
+
t7,
|
|
1221
|
+
t12
|
|
1222
|
+
] }), $[17] = t12, $[18] = t7, $[19] = t13) : t13 = $[19], t13;
|
|
1202
1223
|
}
|
|
1203
1224
|
function mapToLegacyDetails(details) {
|
|
1204
1225
|
if (!details || typeof details.query != "string" || typeof details.start != "number")
|
|
@@ -1393,7 +1414,7 @@ function DocumentEditLabel(props) {
|
|
|
1393
1414
|
id: props.value
|
|
1394
1415
|
}, $[0] = props.value, $[1] = t0) : t0 = $[1];
|
|
1395
1416
|
let t1;
|
|
1396
|
-
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsx(LinkIcon, {}), $[2] = t1) : t1 = $[2];
|
|
1417
|
+
$[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsx(LinkIcon, {}), $[2] = t1) : t1 = $[2];
|
|
1397
1418
|
let t2;
|
|
1398
1419
|
return $[3] !== t0 ? (t2 = /* @__PURE__ */ jsx(IntentLink, { intent: "edit", params: t0, children: t1 }), $[3] = t0, $[4] = t2) : t2 = $[4], t2;
|
|
1399
1420
|
}
|
|
@@ -1485,7 +1506,7 @@ function VisionGuiResult(t0) {
|
|
|
1485
1506
|
let t13;
|
|
1486
1507
|
$[32] !== t12 || $[33] !== t3 || $[34] !== t4 ? (t13 = /* @__PURE__ */ jsx(ResultInnerContainer, { flex: 1, children: /* @__PURE__ */ jsx(ResultContainer, { flex: 1, overflow: "hidden", tone: t3, $isInvalid: t4, children: t12 }) }), $[32] = t12, $[33] = t3, $[34] = t4, $[35] = t13) : t13 = $[35];
|
|
1487
1508
|
let t14;
|
|
1488
|
-
$[36] === Symbol.for("react.memo_cache_sentinel") ? (t14 = ["column", "column", "row"], $[36] = t14) : t14 = $[36];
|
|
1509
|
+
$[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t14 = ["column", "column", "row"], $[36] = t14) : t14 = $[36];
|
|
1489
1510
|
let t15;
|
|
1490
1511
|
$[37] !== t ? (t15 = t("result.execution-time-label"), $[37] = t, $[38] = t15) : t15 = $[38];
|
|
1491
1512
|
let t16;
|
|
@@ -1536,7 +1557,7 @@ function nodeContains(node, other) {
|
|
|
1536
1557
|
}
|
|
1537
1558
|
const sanityUrl = /\.(?:api|apicdn)\.sanity\.(?:io|work)\/(vX|v1|v\d{4}-\d\d-\d\d)\/.*?(?:query|listen)\/(.*?)\?(.*)/, isRunHotkey = (event) => isHotkey("ctrl+enter", event) || isHotkey("mod+enter", event);
|
|
1538
1559
|
function VisionGui(props) {
|
|
1539
|
-
const {
|
|
1560
|
+
const $ = c(210), {
|
|
1540
1561
|
datasets,
|
|
1541
1562
|
config,
|
|
1542
1563
|
projectId,
|
|
@@ -1545,40 +1566,108 @@ function VisionGui(props) {
|
|
|
1545
1566
|
t
|
|
1546
1567
|
} = useTranslation(visionLocaleNamespace), {
|
|
1547
1568
|
perspectiveStack
|
|
1548
|
-
} = usePerspective(),
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1569
|
+
} = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), {
|
|
1570
|
+
data: t0
|
|
1571
|
+
} = useActiveReleases();
|
|
1572
|
+
let t1;
|
|
1573
|
+
$[0] !== t0 ? (t1 = t0 === void 0 ? [] : t0, $[0] = t0, $[1] = t1) : t1 = $[1];
|
|
1574
|
+
const 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);
|
|
1575
|
+
let t2;
|
|
1576
|
+
$[2] !== projectId ? (t2 = () => getLocalStorage(projectId || "default"), $[2] = projectId, $[3] = t2) : t2 = $[3];
|
|
1577
|
+
const [localStorage2] = useState(t2);
|
|
1578
|
+
let t3;
|
|
1579
|
+
$[4] !== defaultDataset || $[5] !== localStorage2 ? (t3 = localStorage2.get("dataset", defaultDataset), $[4] = defaultDataset, $[5] = localStorage2, $[6] = t3) : t3 = $[6];
|
|
1580
|
+
const storedDataset = t3;
|
|
1581
|
+
let t4;
|
|
1582
|
+
$[7] !== config.defaultApiVersion || $[8] !== localStorage2 ? (t4 = localStorage2.get("apiVersion", prefixApiVersion(`${config.defaultApiVersion}`)), $[7] = config.defaultApiVersion, $[8] = localStorage2, $[9] = t4) : t4 = $[9];
|
|
1583
|
+
const storedApiVersion = t4;
|
|
1584
|
+
let t5;
|
|
1585
|
+
$[10] !== localStorage2 ? (t5 = localStorage2.get("query", ""), $[10] = localStorage2, $[11] = t5) : t5 = $[11];
|
|
1586
|
+
const storedQuery = t5;
|
|
1587
|
+
let t6;
|
|
1588
|
+
$[12] !== localStorage2 ? (t6 = localStorage2.get("params", `{
|
|
1559
1589
|
|
|
1560
|
-
}`),
|
|
1561
|
-
|
|
1562
|
-
|
|
1590
|
+
}`), $[12] = localStorage2, $[13] = t6) : t6 = $[13];
|
|
1591
|
+
const storedParams = t6;
|
|
1592
|
+
let t7;
|
|
1593
|
+
$[14] !== localStorage2 ? (t7 = localStorage2.get("perspective", void 0), $[14] = localStorage2, $[15] = t7) : t7 = $[15];
|
|
1594
|
+
const storedPerspective = t7;
|
|
1595
|
+
let t8;
|
|
1596
|
+
$[16] !== datasets || $[17] !== defaultDataset || $[18] !== storedDataset ? (t8 = () => datasets.includes(storedDataset) ? storedDataset : datasets.includes(defaultDataset) ? defaultDataset : datasets[0], $[16] = datasets, $[17] = defaultDataset, $[18] = storedDataset, $[19] = t8) : t8 = $[19];
|
|
1597
|
+
const [dataset, setDataset] = useState(t8);
|
|
1598
|
+
let t9;
|
|
1599
|
+
$[20] !== storedApiVersion ? (t9 = () => API_VERSIONS.includes(storedApiVersion) ? storedApiVersion : DEFAULT_API_VERSION, $[20] = storedApiVersion, $[21] = t9) : t9 = $[21];
|
|
1600
|
+
const [apiVersion, setApiVersion] = useState(t9);
|
|
1601
|
+
let t10;
|
|
1602
|
+
$[22] !== storedApiVersion ? (t10 = () => API_VERSIONS.includes(storedApiVersion) ? !1 : storedApiVersion, $[22] = storedApiVersion, $[23] = t10) : t10 = $[23];
|
|
1603
|
+
const [customApiVersion, setCustomApiVersion] = useState(t10), [perspective, setPerspectiveState] = useState(storedPerspective || "raw");
|
|
1604
|
+
let t11;
|
|
1605
|
+
$[24] !== customApiVersion ? (t11 = customApiVersion ? validateApiVersion(customApiVersion) : !0, $[24] = customApiVersion, $[25] = t11) : t11 = $[25];
|
|
1606
|
+
const isValidApiVersion = t11, [url, setUrl] = useState(void 0);
|
|
1607
|
+
let t12;
|
|
1608
|
+
$[26] !== storedQuery ? (t12 = () => typeof storedQuery == "string" ? storedQuery : "", $[26] = storedQuery, $[27] = t12) : t12 = $[27];
|
|
1609
|
+
const [query, setQuery] = useState(t12), [rawParams, setRawParams] = useState(storedParams);
|
|
1610
|
+
let t13;
|
|
1611
|
+
$[28] !== rawParams || $[29] !== t ? (t13 = parseParams(rawParams, t), $[28] = rawParams, $[29] = t, $[30] = t13) : t13 = $[30];
|
|
1612
|
+
const params = t13, [queryResult, setQueryResult] = useState(void 0);
|
|
1613
|
+
let t14;
|
|
1614
|
+
$[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t14 = [], $[31] = t14) : t14 = $[31];
|
|
1615
|
+
const [listenMutations, setListenMutations] = useState(t14), [error, setError] = useState(void 0), [queryTime, setQueryTime] = useState(void 0), [e2eTime, setE2eTime] = useState(void 0), [queryInProgress, setQueryInProgress] = useState(!1), [listenInProgress, setListenInProgress] = useState(!1), [isQueryRecallCollapsed, setIsQueryRecallCollapsed] = useState(!1);
|
|
1616
|
+
let t15;
|
|
1617
|
+
$[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t15 = {
|
|
1618
|
+
visionRootRef
|
|
1619
|
+
}, $[32] = t15) : t15 = $[32];
|
|
1620
|
+
const {
|
|
1563
1621
|
paneSizeOptions,
|
|
1564
1622
|
isNarrowBreakpoint
|
|
1565
|
-
} = usePaneSize(
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1623
|
+
} = usePaneSize(t15);
|
|
1624
|
+
let t16;
|
|
1625
|
+
bb0: {
|
|
1626
|
+
if (!isScheduledDraftsEnabled) {
|
|
1627
|
+
t16 = void 0;
|
|
1628
|
+
break bb0;
|
|
1629
|
+
}
|
|
1630
|
+
let t172;
|
|
1631
|
+
if ($[33] !== isDraftModelEnabled || $[34] !== releases) {
|
|
1632
|
+
const scheduledDraftReleases = releases.filter(_temp$1), releaseIds = sortReleases(scheduledDraftReleases).map(_temp2$1);
|
|
1633
|
+
let t182;
|
|
1634
|
+
$[36] !== isDraftModelEnabled ? (t182 = isDraftModelEnabled ? ["drafts"] : ["published"], $[36] = isDraftModelEnabled, $[37] = t182) : t182 = $[37];
|
|
1635
|
+
const defaultPerspective = t182;
|
|
1636
|
+
t172 = [...releaseIds, ...defaultPerspective], $[33] = isDraftModelEnabled, $[34] = releases, $[35] = t172;
|
|
1637
|
+
} else
|
|
1638
|
+
t172 = $[35];
|
|
1639
|
+
t16 = t172;
|
|
1640
|
+
}
|
|
1641
|
+
const scheduledDraftsStack = t16, t17 = isValidApiVersion && customApiVersion ? customApiVersion : apiVersion;
|
|
1642
|
+
let t18;
|
|
1643
|
+
$[38] !== t17 ? (t18 = {
|
|
1644
|
+
apiVersion: t17
|
|
1645
|
+
}, $[38] = t17, $[39] = t18) : t18 = $[39];
|
|
1646
|
+
const _client = useClient(t18);
|
|
1647
|
+
let t19;
|
|
1648
|
+
$[40] !== _client || $[41] !== apiVersion || $[42] !== customApiVersion || $[43] !== dataset || $[44] !== isValidApiVersion || $[45] !== perspective || $[46] !== perspectiveStack || $[47] !== scheduledDraftsStack ? (t19 = _client.withConfig({
|
|
1570
1649
|
apiVersion: isValidApiVersion && customApiVersion ? customApiVersion : apiVersion,
|
|
1571
1650
|
perspective: getActivePerspective({
|
|
1572
1651
|
visionPerspective: perspective,
|
|
1573
|
-
perspectiveStack
|
|
1652
|
+
perspectiveStack,
|
|
1653
|
+
scheduledDraftsStack
|
|
1574
1654
|
}),
|
|
1575
1655
|
dataset,
|
|
1576
1656
|
allowReconfigure: !0
|
|
1577
|
-
}), [
|
|
1657
|
+
}), $[40] = _client, $[41] = apiVersion, $[42] = customApiVersion, $[43] = dataset, $[44] = isValidApiVersion, $[45] = perspective, $[46] = perspectiveStack, $[47] = scheduledDraftsStack, $[48] = t19) : t19 = $[48];
|
|
1658
|
+
const client = t19;
|
|
1659
|
+
let t20;
|
|
1660
|
+
$[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t20 = () => {
|
|
1578
1661
|
querySubscriptionRef.current && (querySubscriptionRef.current.unsubscribe(), querySubscriptionRef.current = void 0);
|
|
1579
|
-
}, []
|
|
1662
|
+
}, $[49] = t20) : t20 = $[49];
|
|
1663
|
+
const cancelQuerySubscription = t20;
|
|
1664
|
+
let t21;
|
|
1665
|
+
$[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t21 = () => {
|
|
1580
1666
|
listenSubscriptionRef.current && (listenSubscriptionRef.current.unsubscribe(), listenSubscriptionRef.current = void 0);
|
|
1581
|
-
}, []
|
|
1667
|
+
}, $[50] = t21) : t21 = $[50];
|
|
1668
|
+
const cancelListenerSubscription = t21;
|
|
1669
|
+
let t22;
|
|
1670
|
+
$[51] !== apiVersion || $[52] !== client || $[53] !== customApiVersion || $[54] !== dataset || $[55] !== isValidApiVersion || $[56] !== localStorage2 || $[57] !== params.parsed || $[58] !== perspective || $[59] !== perspectiveStack || $[60] !== query || $[61] !== queryInProgress || $[62] !== scheduledDraftsStack || $[63] !== t ? (t22 = (options) => {
|
|
1582
1671
|
if (queryInProgress) {
|
|
1583
1672
|
cancelQuerySubscription(), cancelListenerSubscription(), setQueryInProgress(!1);
|
|
1584
1673
|
return;
|
|
@@ -1588,8 +1677,9 @@ function VisionGui(props) {
|
|
|
1588
1677
|
dataset: options?.dataset || dataset,
|
|
1589
1678
|
params: parseParams(JSON.stringify(options?.params || params.parsed, null, 2), t),
|
|
1590
1679
|
perspective: getActivePerspective({
|
|
1591
|
-
visionPerspective: options
|
|
1592
|
-
perspectiveStack
|
|
1680
|
+
visionPerspective: options && "perspective" in options ? options.perspective : perspective,
|
|
1681
|
+
perspectiveStack,
|
|
1682
|
+
scheduledDraftsStack
|
|
1593
1683
|
}),
|
|
1594
1684
|
apiVersion: options?.apiVersion || (customApiVersion && isValidApiVersion ? customApiVersion : apiVersion)
|
|
1595
1685
|
};
|
|
@@ -1615,16 +1705,25 @@ function VisionGui(props) {
|
|
|
1615
1705
|
setError(err), setQueryInProgress(!1);
|
|
1616
1706
|
}
|
|
1617
1707
|
});
|
|
1618
|
-
}, [
|
|
1708
|
+
}, $[51] = apiVersion, $[52] = client, $[53] = customApiVersion, $[54] = dataset, $[55] = isValidApiVersion, $[56] = localStorage2, $[57] = params.parsed, $[58] = perspective, $[59] = perspectiveStack, $[60] = query, $[61] = queryInProgress, $[62] = scheduledDraftsStack, $[63] = t, $[64] = t22) : t22 = $[64];
|
|
1709
|
+
const handleQueryExecution = t22;
|
|
1710
|
+
let t23;
|
|
1711
|
+
$[65] !== handleQueryExecution || $[66] !== localStorage2 ? (t23 = (newPerspective) => {
|
|
1619
1712
|
newPerspective !== void 0 && !isSupportedPerspective(newPerspective) || (setPerspectiveState(newPerspective), localStorage2.set("perspective", newPerspective), handleQueryExecution({
|
|
1620
1713
|
perspective: newPerspective
|
|
1621
1714
|
}));
|
|
1622
|
-
}, [
|
|
1715
|
+
}, $[65] = handleQueryExecution, $[66] = localStorage2, $[67] = t23) : t23 = $[67];
|
|
1716
|
+
const setPerspective = t23;
|
|
1717
|
+
let t24;
|
|
1718
|
+
$[68] !== handleQueryExecution || $[69] !== localStorage2 ? (t24 = (evt) => {
|
|
1623
1719
|
const newDataset = evt.target.value;
|
|
1624
1720
|
localStorage2.set("dataset", newDataset), setDataset(newDataset), handleQueryExecution({
|
|
1625
1721
|
dataset: newDataset
|
|
1626
1722
|
});
|
|
1627
|
-
}, [
|
|
1723
|
+
}, $[68] = handleQueryExecution, $[69] = localStorage2, $[70] = t24) : t24 = $[70];
|
|
1724
|
+
const handleChangeDataset = t24;
|
|
1725
|
+
let t25;
|
|
1726
|
+
$[71] !== handleQueryExecution || $[72] !== localStorage2 ? (t25 = (evt_0) => {
|
|
1628
1727
|
const newApiVersion = evt_0.target.value;
|
|
1629
1728
|
if (newApiVersion?.toLowerCase() === "other") {
|
|
1630
1729
|
setCustomApiVersion("v"), customApiVersionElementRef.current?.focus();
|
|
@@ -1633,17 +1732,29 @@ function VisionGui(props) {
|
|
|
1633
1732
|
setApiVersion(newApiVersion), setCustomApiVersion(!1), localStorage2.set("apiVersion", newApiVersion), handleQueryExecution({
|
|
1634
1733
|
apiVersion: newApiVersion
|
|
1635
1734
|
});
|
|
1636
|
-
}, [
|
|
1735
|
+
}, $[71] = handleQueryExecution, $[72] = localStorage2, $[73] = t25) : t25 = $[73];
|
|
1736
|
+
const handleChangeApiVersion = t25;
|
|
1737
|
+
let t26;
|
|
1738
|
+
$[74] !== handleQueryExecution || $[75] !== localStorage2 ? (t26 = (evt_1) => {
|
|
1637
1739
|
const newCustomApiVersion = evt_1.target.value || "";
|
|
1638
1740
|
setCustomApiVersion(newCustomApiVersion || "v"), validateApiVersion(newCustomApiVersion) && (setApiVersion(newCustomApiVersion), localStorage2.set("apiVersion", newCustomApiVersion), handleQueryExecution({
|
|
1639
1741
|
apiVersion: newCustomApiVersion
|
|
1640
1742
|
}));
|
|
1641
|
-
}, [
|
|
1743
|
+
}, $[74] = handleQueryExecution, $[75] = localStorage2, $[76] = t26) : t26 = $[76];
|
|
1744
|
+
const handleCustomApiVersionChange = t26;
|
|
1745
|
+
let t27;
|
|
1746
|
+
$[77] !== setPerspective ? (t27 = (evt_2) => {
|
|
1642
1747
|
const newPerspective_0 = evt_2.target.value;
|
|
1643
1748
|
setPerspective(newPerspective_0 === "default" ? void 0 : newPerspective_0);
|
|
1644
|
-
}, [setPerspective
|
|
1749
|
+
}, $[77] = setPerspective, $[78] = t27) : t27 = $[78];
|
|
1750
|
+
const handleChangePerspective = t27;
|
|
1751
|
+
let t28;
|
|
1752
|
+
$[79] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t28 = (evt_3) => {
|
|
1645
1753
|
evt_3.type === "mutation" && setListenMutations((prevMutations) => prevMutations.length === 50 ? [evt_3, ...prevMutations.slice(0, 49)] : [evt_3, ...prevMutations]);
|
|
1646
|
-
}, []
|
|
1754
|
+
}, $[79] = t28) : t28 = $[79];
|
|
1755
|
+
const handleListenerEvent = t28;
|
|
1756
|
+
let t29;
|
|
1757
|
+
$[80] !== client || $[81] !== listenInProgress || $[82] !== localStorage2 || $[83] !== params.error || $[84] !== params.parsed || $[85] !== params.raw || $[86] !== query ? (t29 = () => {
|
|
1647
1758
|
if (listenInProgress) {
|
|
1648
1759
|
cancelListenerSubscription(), setListenInProgress(!1);
|
|
1649
1760
|
return;
|
|
@@ -1658,14 +1769,21 @@ function VisionGui(props) {
|
|
|
1658
1769
|
setError(err_0), setListenInProgress(!1);
|
|
1659
1770
|
}
|
|
1660
1771
|
}));
|
|
1661
|
-
}, [
|
|
1662
|
-
|
|
1663
|
-
|
|
1772
|
+
}, $[80] = client, $[81] = listenInProgress, $[82] = localStorage2, $[83] = params.error, $[84] = params.parsed, $[85] = params.raw, $[86] = query, $[87] = t29) : t29 = $[87];
|
|
1773
|
+
const handleListenExecution = t29;
|
|
1774
|
+
let t30;
|
|
1775
|
+
$[88] !== localStorage2 ? (t30 = (value) => {
|
|
1776
|
+
setRawParams(value), localStorage2.set("params", value);
|
|
1777
|
+
}, $[88] = localStorage2, $[89] = t30) : t30 = $[89];
|
|
1778
|
+
const handleParamsChange = t30;
|
|
1779
|
+
let t31;
|
|
1780
|
+
$[90] !== apiVersion || $[91] !== dataset || $[92] !== datasets || $[93] !== perspective || $[94] !== toast ? (t31 = (data) => {
|
|
1664
1781
|
const match = data.match(sanityUrl);
|
|
1665
1782
|
if (!match)
|
|
1666
1783
|
return null;
|
|
1667
1784
|
const [, usedApiVersion, usedDataset, urlQuery] = match, qs = new URLSearchParams(urlQuery), parts = parseApiQueryString(qs);
|
|
1668
|
-
if (!parts)
|
|
1785
|
+
if (!parts)
|
|
1786
|
+
return null;
|
|
1669
1787
|
let newApiVersion_0, newCustomApiVersion_0;
|
|
1670
1788
|
validateApiVersion(usedApiVersion) && (API_VERSIONS.includes(usedApiVersion) ? (newApiVersion_0 = usedApiVersion, newCustomApiVersion_0 = !1) : newCustomApiVersion_0 = usedApiVersion);
|
|
1671
1789
|
const newPerspective_1 = isSupportedPerspective(parts.options.perspective) && !isVirtualPerspective(parts.options.perspective) ? parts.options.perspective : void 0;
|
|
@@ -1684,20 +1802,21 @@ function VisionGui(props) {
|
|
|
1684
1802
|
perspective: newPerspective_1 || perspective,
|
|
1685
1803
|
url: data
|
|
1686
1804
|
};
|
|
1687
|
-
}, [
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
error: void 0
|
|
1693
|
-
}), setApiVersion(parsedUrlObj.apiVersion), parsedUrlObj.customApiVersion && setCustomApiVersion(parsedUrlObj.customApiVersion), setPerspectiveState(parsedUrlObj.perspective), setUrl(parsedUrlObj.url), editorQueryRef.current?.resetEditorContent(parsedUrlObj.query), editorParamsRef.current?.resetEditorContent(parsedUrlObj.rawParams), localStorage2.merge({
|
|
1805
|
+
}, $[90] = apiVersion, $[91] = dataset, $[92] = datasets, $[93] = perspective, $[94] = toast, $[95] = t31) : t31 = $[95];
|
|
1806
|
+
const getStateFromUrl = t31;
|
|
1807
|
+
let t32;
|
|
1808
|
+
$[96] !== handleQueryExecution || $[97] !== localStorage2 ? (t32 = (parsedUrlObj) => {
|
|
1809
|
+
setDataset(parsedUrlObj.dataset), setQuery(parsedUrlObj.query), setRawParams(parsedUrlObj.rawParams), setApiVersion(parsedUrlObj.apiVersion), parsedUrlObj.customApiVersion && setCustomApiVersion(parsedUrlObj.customApiVersion), setPerspectiveState(parsedUrlObj.perspective), setUrl(parsedUrlObj.url), editorQueryRef.current?.resetEditorContent(parsedUrlObj.query), editorParamsRef.current?.resetEditorContent(parsedUrlObj.rawParams), localStorage2.merge({
|
|
1694
1810
|
query: parsedUrlObj.query,
|
|
1695
1811
|
params: parsedUrlObj.rawParams,
|
|
1696
1812
|
dataset: parsedUrlObj.dataset,
|
|
1697
1813
|
apiVersion: parsedUrlObj.customApiVersion || parsedUrlObj.apiVersion,
|
|
1698
1814
|
perspective: parsedUrlObj.perspective
|
|
1699
1815
|
}), handleQueryExecution(parsedUrlObj);
|
|
1700
|
-
}, [
|
|
1816
|
+
}, $[96] = handleQueryExecution, $[97] = localStorage2, $[98] = t32) : t32 = $[98];
|
|
1817
|
+
const setStateFromParsedUrl = t32;
|
|
1818
|
+
let t33;
|
|
1819
|
+
$[99] !== getStateFromUrl || $[100] !== setStateFromParsedUrl || $[101] !== toast ? (t33 = (evt_4) => {
|
|
1701
1820
|
if (!evt_4.clipboardData)
|
|
1702
1821
|
return;
|
|
1703
1822
|
const data_0 = evt_4.clipboardData.getData("text/plain");
|
|
@@ -1709,74 +1828,131 @@ function VisionGui(props) {
|
|
|
1709
1828
|
status: "info",
|
|
1710
1829
|
title: "Parsed URL to query"
|
|
1711
1830
|
}));
|
|
1712
|
-
}, [getStateFromUrl, setStateFromParsedUrl, toast
|
|
1831
|
+
}, $[99] = getStateFromUrl, $[100] = setStateFromParsedUrl, $[101] = toast, $[102] = t33) : t33 = $[102];
|
|
1832
|
+
const handlePaste = t33;
|
|
1833
|
+
let t34;
|
|
1834
|
+
$[103] !== handleQueryExecution || $[104] !== params.valid ? (t34 = (event) => {
|
|
1713
1835
|
const isWithinRoot = visionRootRef.current && nodeContains(visionRootRef.current, event.target);
|
|
1714
1836
|
isRunHotkey(event) && isWithinRoot && params.valid && (handleQueryExecution(), event.preventDefault(), event.stopPropagation());
|
|
1715
|
-
}, [params.valid,
|
|
1716
|
-
|
|
1837
|
+
}, $[103] = handleQueryExecution, $[104] = params.valid, $[105] = t34) : t34 = $[105];
|
|
1838
|
+
const handleKeyDown = t34;
|
|
1839
|
+
let t35, t36;
|
|
1840
|
+
$[106] !== handleKeyDown || $[107] !== handlePaste ? (t35 = () => (window.document.addEventListener("paste", handlePaste), window.document.addEventListener("keydown", handleKeyDown), () => {
|
|
1717
1841
|
window.document.removeEventListener("paste", handlePaste), window.document.removeEventListener("keydown", handleKeyDown);
|
|
1718
|
-
}), [handleKeyDown, handlePaste]
|
|
1842
|
+
}), t36 = [handleKeyDown, handlePaste], $[106] = handleKeyDown, $[107] = handlePaste, $[108] = t35, $[109] = t36) : (t35 = $[108], t36 = $[109]), useEffect(t35, t36);
|
|
1843
|
+
let t37, t38;
|
|
1844
|
+
$[110] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t37 = () => () => {
|
|
1719
1845
|
cancelQuerySubscription(), cancelListenerSubscription();
|
|
1720
|
-
}, [cancelQuerySubscription, cancelListenerSubscription]);
|
|
1721
|
-
|
|
1846
|
+
}, t38 = [cancelQuerySubscription, cancelListenerSubscription], $[110] = t37, $[111] = t38) : (t37 = $[110], t38 = $[111]), useEffect(t37, t38);
|
|
1847
|
+
let t39;
|
|
1848
|
+
$[112] !== setPerspective ? (t39 = (stack) => {
|
|
1722
1849
|
stack.length > 0 && setPerspective("pinnedRelease");
|
|
1723
|
-
});
|
|
1724
|
-
|
|
1850
|
+
}, $[112] = setPerspective, $[113] = t39) : t39 = $[113];
|
|
1851
|
+
const handleStudioPerspectiveChange = useEffectEvent(t39);
|
|
1852
|
+
let t40;
|
|
1853
|
+
$[114] !== handleStudioPerspectiveChange || $[115] !== perspectiveStack ? (t40 = () => {
|
|
1725
1854
|
handleStudioPerspectiveChange(perspectiveStack);
|
|
1726
|
-
}, [perspectiveStack]);
|
|
1727
|
-
|
|
1855
|
+
}, $[114] = handleStudioPerspectiveChange, $[115] = perspectiveStack, $[116] = t40) : t40 = $[116];
|
|
1856
|
+
let t41;
|
|
1857
|
+
$[117] !== perspectiveStack ? (t41 = [perspectiveStack], $[117] = perspectiveStack, $[118] = t41) : t41 = $[118], useEffect(t40, t41);
|
|
1858
|
+
let t42;
|
|
1859
|
+
$[119] !== client || $[120] !== perspective || $[121] !== perspectiveStack || $[122] !== scheduledDraftsStack ? (t42 = (queryString, queryParams) => {
|
|
1728
1860
|
const urlQueryOpts_0 = {
|
|
1729
1861
|
perspective: getActivePerspective({
|
|
1730
1862
|
visionPerspective: perspective,
|
|
1731
|
-
perspectiveStack
|
|
1863
|
+
perspectiveStack,
|
|
1864
|
+
scheduledDraftsStack
|
|
1732
1865
|
}) ?? []
|
|
1733
1866
|
};
|
|
1734
1867
|
return client.getUrl(client.getDataUrl("query", encodeQueryString(queryString, queryParams, urlQueryOpts_0)));
|
|
1735
|
-
}, [client, perspective, perspectiveStack]);
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1868
|
+
}, $[119] = client, $[120] = perspective, $[121] = perspectiveStack, $[122] = scheduledDraftsStack, $[123] = t42) : t42 = $[123];
|
|
1869
|
+
const generateUrl = t42;
|
|
1870
|
+
let t43;
|
|
1871
|
+
$[124] !== apiVersion || $[125] !== customApiVersion || $[126] !== dataset || $[127] !== datasets || $[128] !== handleChangeApiVersion || $[129] !== handleChangeDataset || $[130] !== handleChangePerspective || $[131] !== handleCustomApiVersionChange || $[132] !== isScheduledDraftsEnabled || $[133] !== isValidApiVersion || $[134] !== perspective || $[135] !== url ? (t43 = /* @__PURE__ */ jsx(VisionGuiHeader, { apiVersion, customApiVersion, dataset, datasets, onChangeDataset: handleChangeDataset, onChangeApiVersion: handleChangeApiVersion, customApiVersionElementRef, onCustomApiVersionChange: handleCustomApiVersionChange, isValidApiVersion, onChangePerspective: handleChangePerspective, url, perspective, isScheduledDraftsEnabled }), $[124] = apiVersion, $[125] = customApiVersion, $[126] = dataset, $[127] = datasets, $[128] = handleChangeApiVersion, $[129] = handleChangeDataset, $[130] = handleChangePerspective, $[131] = handleCustomApiVersionChange, $[132] = isScheduledDraftsEnabled, $[133] = isValidApiVersion, $[134] = perspective, $[135] = url, $[136] = t43) : t43 = $[136];
|
|
1872
|
+
const t44 = isQueryRecallCollapsed ? window.innerWidth : window.innerWidth - 275, t45 = isNarrowBreakpoint ? "vertical" : "horizontal", t46 = isNarrowBreakpoint ? paneSizeOptions.defaultSize : paneSizeOptions.minSize, t47 = paneSizeOptions.size, t48 = paneSizeOptions.allowResize, t49 = isNarrowBreakpoint ? paneSizeOptions.minSize : 100, t50 = paneSizeOptions.maxSize;
|
|
1873
|
+
let t51;
|
|
1874
|
+
$[137] !== t ? (t51 = t("query.label"), $[137] = t, $[138] = t51) : t51 = $[138];
|
|
1875
|
+
let t52;
|
|
1876
|
+
$[139] !== t51 ? (t52 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(StyledLabel, { muted: !0, children: t51 }) }) }), $[139] = t51, $[140] = t52) : t52 = $[140];
|
|
1877
|
+
let t53;
|
|
1878
|
+
$[141] !== query ? (t53 = /* @__PURE__ */ jsx(VisionCodeMirror, { initialValue: query, onChange: setQuery, ref: editorQueryRef }), $[141] = query, $[142] = t53) : t53 = $[142];
|
|
1879
|
+
let t54;
|
|
1880
|
+
$[143] !== t52 || $[144] !== t53 ? (t54 = /* @__PURE__ */ jsx(InputContainer, { display: "flex", "data-testid": "vision-query-editor", children: /* @__PURE__ */ jsxs(Box, { flex: 1, children: [
|
|
1881
|
+
t52,
|
|
1882
|
+
t53
|
|
1883
|
+
] }) }), $[143] = t52, $[144] = t53, $[145] = t54) : t54 = $[145];
|
|
1884
|
+
let t55;
|
|
1885
|
+
$[146] !== handleParamsChange || $[147] !== params.error || $[148] !== params.raw || $[149] !== params.valid ? (t55 = /* @__PURE__ */ jsx(ParamsEditor, { value: params.raw, onChange: handleParamsChange, paramsError: params.error, hasValidParams: params.valid, editorRef: editorParamsRef }), $[146] = handleParamsChange, $[147] = params.error, $[148] = params.raw, $[149] = params.valid, $[150] = t55) : t55 = $[150];
|
|
1886
|
+
let t56;
|
|
1887
|
+
$[151] !== handleListenExecution || $[152] !== handleQueryExecution || $[153] !== listenInProgress || $[154] !== params.valid || $[155] !== queryInProgress ? (t56 = /* @__PURE__ */ jsx(VisionGuiControls, { hasValidParams: params.valid, queryInProgress, listenInProgress, onQueryExecution: handleQueryExecution, onListenExecution: handleListenExecution }), $[151] = handleListenExecution, $[152] = handleQueryExecution, $[153] = listenInProgress, $[154] = params.valid, $[155] = queryInProgress, $[156] = t56) : t56 = $[156];
|
|
1888
|
+
let t57;
|
|
1889
|
+
$[157] !== t55 || $[158] !== t56 ? (t57 = /* @__PURE__ */ jsxs(InputContainer, { display: "flex", children: [
|
|
1890
|
+
t55,
|
|
1891
|
+
t56
|
|
1892
|
+
] }), $[157] = t55, $[158] = t56, $[159] = t57) : t57 = $[159];
|
|
1893
|
+
let t58;
|
|
1894
|
+
$[160] !== paneSizeOptions.allowResize || $[161] !== paneSizeOptions.maxSize || $[162] !== paneSizeOptions.size || $[163] !== t46 || $[164] !== t49 || $[165] !== t54 || $[166] !== t57 ? (t58 = /* @__PURE__ */ jsx(Box, { height: "stretch", flex: 1, children: /* @__PURE__ */ jsxs(SplitPane, { className: "sidebarPanes", split: "horizontal", defaultSize: t46, size: t47, allowResize: t48, minSize: t49, maxSize: t50, primary: "first", children: [
|
|
1895
|
+
t54,
|
|
1896
|
+
t57
|
|
1897
|
+
] }) }), $[160] = paneSizeOptions.allowResize, $[161] = paneSizeOptions.maxSize, $[162] = paneSizeOptions.size, $[163] = t46, $[164] = t49, $[165] = t54, $[166] = t57, $[167] = t58) : t58 = $[167];
|
|
1898
|
+
let t59;
|
|
1899
|
+
$[168] !== dataset || $[169] !== e2eTime || $[170] !== error || $[171] !== listenInProgress || $[172] !== listenMutations || $[173] !== queryInProgress || $[174] !== queryResult || $[175] !== queryTime ? (t59 = /* @__PURE__ */ jsx(VisionGuiResult, { error, queryInProgress, queryResult, listenInProgress, listenMutations, dataset, queryTime, e2eTime }), $[168] = dataset, $[169] = e2eTime, $[170] = error, $[171] = listenInProgress, $[172] = listenMutations, $[173] = queryInProgress, $[174] = queryResult, $[175] = queryTime, $[176] = t59) : t59 = $[176];
|
|
1900
|
+
let t60;
|
|
1901
|
+
$[177] !== t45 || $[178] !== t58 || $[179] !== t59 ? (t60 = /* @__PURE__ */ jsx(Box, { height: "stretch", flex: 1, children: /* @__PURE__ */ jsxs(SplitPane, { className: "sidebarPanes", split: t45, minSize: 300, children: [
|
|
1902
|
+
t58,
|
|
1903
|
+
t59
|
|
1904
|
+
] }) }), $[177] = t45, $[178] = t58, $[179] = t59, $[180] = t60) : t60 = $[180];
|
|
1905
|
+
let t61;
|
|
1906
|
+
$[181] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t61 = {
|
|
1907
|
+
position: "relative",
|
|
1908
|
+
height: "100%"
|
|
1909
|
+
}, $[181] = t61) : t61 = $[181];
|
|
1910
|
+
let t62;
|
|
1911
|
+
$[182] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t62 = {
|
|
1912
|
+
position: "absolute",
|
|
1913
|
+
left: -32,
|
|
1914
|
+
top: "50%",
|
|
1915
|
+
transform: "translateY(-50%)",
|
|
1916
|
+
zIndex: 100,
|
|
1917
|
+
pointerEvents: "auto"
|
|
1918
|
+
}, $[182] = t62) : t62 = $[182];
|
|
1919
|
+
let t63;
|
|
1920
|
+
$[183] !== isQueryRecallCollapsed ? (t63 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[183] = isQueryRecallCollapsed, $[184] = t63) : t63 = $[184];
|
|
1921
|
+
let t64;
|
|
1922
|
+
$[185] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t64 = {
|
|
1923
|
+
display: "flex",
|
|
1924
|
+
alignItems: "center",
|
|
1925
|
+
height: "100%"
|
|
1926
|
+
}, $[185] = t64) : t64 = $[185];
|
|
1927
|
+
let t65;
|
|
1928
|
+
$[186] !== isQueryRecallCollapsed ? (t65 = /* @__PURE__ */ jsx("div", { style: t64, children: isQueryRecallCollapsed ? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx(ChevronRightIcon, {}) }), $[186] = isQueryRecallCollapsed, $[187] = t65) : t65 = $[187];
|
|
1929
|
+
let t66;
|
|
1930
|
+
$[188] !== t63 || $[189] !== t65 ? (t66 = /* @__PURE__ */ jsx(Button, { mode: "ghost", padding: 2, style: t62, onClick: t63, children: t65 }), $[188] = t63, $[189] = t65, $[190] = t66) : t66 = $[190];
|
|
1931
|
+
let t67;
|
|
1932
|
+
$[191] !== params.parsed ? (t67 = params.parsed || {}, $[191] = params.parsed, $[192] = t67) : t67 = $[192];
|
|
1933
|
+
let t68;
|
|
1934
|
+
$[193] !== generateUrl || $[194] !== getStateFromUrl || $[195] !== query || $[196] !== setStateFromParsedUrl || $[197] !== t67 || $[198] !== url ? (t68 = /* @__PURE__ */ jsx(QueryRecall, { url, getStateFromUrl, setStateFromParsedUrl, currentQuery: query, currentParams: t67, generateUrl }), $[193] = generateUrl, $[194] = getStateFromUrl, $[195] = query, $[196] = setStateFromParsedUrl, $[197] = t67, $[198] = url, $[199] = t68) : t68 = $[199];
|
|
1935
|
+
let t69;
|
|
1936
|
+
$[200] !== t66 || $[201] !== t68 ? (t69 = /* @__PURE__ */ jsxs(Box, { style: t61, children: [
|
|
1937
|
+
t66,
|
|
1938
|
+
t68
|
|
1939
|
+
] }), $[200] = t66, $[201] = t68, $[202] = t69) : t69 = $[202];
|
|
1940
|
+
let t70;
|
|
1941
|
+
$[203] !== t44 || $[204] !== t60 || $[205] !== t69 ? (t70 = /* @__PURE__ */ jsx(SplitpaneContainer, { flex: "auto", children: /* @__PURE__ */ jsxs(SplitPane, { minSize: 800, defaultSize: window.innerWidth - 275, size: t44, maxSize: -225, primary: "first", children: [
|
|
1942
|
+
t60,
|
|
1943
|
+
t69
|
|
1944
|
+
] }) }), $[203] = t44, $[204] = t60, $[205] = t69, $[206] = t70) : t70 = $[206];
|
|
1945
|
+
let t71;
|
|
1946
|
+
return $[207] !== t43 || $[208] !== t70 ? (t71 = /* @__PURE__ */ jsxs(Root, { direction: "column", height: "fill", ref: visionRootRef, sizing: "border", overflow: "hidden", "data-testid": "vision-root", children: [
|
|
1947
|
+
t43,
|
|
1948
|
+
t70
|
|
1949
|
+
] }), $[207] = t43, $[208] = t70, $[209] = t71) : t71 = $[209], t71;
|
|
1950
|
+
}
|
|
1951
|
+
function _temp2$1(release_0) {
|
|
1952
|
+
return getReleaseIdFromReleaseDocumentId(release_0._id);
|
|
1953
|
+
}
|
|
1954
|
+
function _temp$1(release) {
|
|
1955
|
+
return isCardinalityOneRelease(release) && release.state === "scheduled";
|
|
1780
1956
|
}
|
|
1781
1957
|
function useDatasets(t0) {
|
|
1782
1958
|
const $ = c(7), {
|
|
@@ -1812,7 +1988,7 @@ function _temp(d) {
|
|
|
1812
1988
|
function VisionContainer(props) {
|
|
1813
1989
|
const $ = c(19);
|
|
1814
1990
|
let t0;
|
|
1815
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = {
|
|
1991
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = {
|
|
1816
1992
|
apiVersion: "v2025-06-27"
|
|
1817
1993
|
}, $[0] = t0) : t0 = $[0];
|
|
1818
1994
|
const datasetsClient = useClient(t0);
|
|
@@ -1824,7 +2000,7 @@ function VisionContainer(props) {
|
|
|
1824
2000
|
const loadedDatasets = useDatasets(t1);
|
|
1825
2001
|
if (!loadedDatasets) {
|
|
1826
2002
|
let t22;
|
|
1827
|
-
return $[4] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx(Flex, { align: "center", height: "fill", justify: "center", children: /* @__PURE__ */ jsx(DelayedSpinner, {}) }), $[4] = t22) : t22 = $[4], t22;
|
|
2003
|
+
return $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx(Flex, { align: "center", height: "fill", justify: "center", children: /* @__PURE__ */ jsx(DelayedSpinner, {}) }), $[4] = t22) : t22 = $[4], t22;
|
|
1828
2004
|
}
|
|
1829
2005
|
let t2;
|
|
1830
2006
|
$[5] !== loadedDatasets || $[6] !== props.client ? (t2 = loadedDatasets instanceof Error ? [props.client.config().dataset || "production"] : loadedDatasets, $[5] = loadedDatasets, $[6] = props.client, $[7] = t2) : t2 = $[7];
|
|
@@ -1874,7 +2050,7 @@ class VisionErrorBoundary extends Component {
|
|
|
1874
2050
|
function SanityVision(props) {
|
|
1875
2051
|
const $ = c(6);
|
|
1876
2052
|
let t0;
|
|
1877
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = {
|
|
2053
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = {
|
|
1878
2054
|
apiVersion: "1"
|
|
1879
2055
|
}, $[0] = t0) : t0 = $[0];
|
|
1880
2056
|
const client = useClient(t0);
|
|
@@ -1890,4 +2066,4 @@ function SanityVision(props) {
|
|
|
1890
2066
|
export {
|
|
1891
2067
|
SanityVision as default
|
|
1892
2068
|
};
|
|
1893
|
-
//# sourceMappingURL=SanityVision.
|
|
2069
|
+
//# sourceMappingURL=SanityVision.js.map
|