@sanity/vision 6.23.0-next.19 → 6.23.0-next.32

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.
@@ -6,10 +6,10 @@ import { c } from "react/compiler-runtime";
6
6
  import { SplitPane } from "@rexxars/react-split-pane";
7
7
  import { ChevronLeftIcon } from "@sanity/icons/ChevronLeft";
8
8
  import { ChevronRightIcon } from "@sanity/icons/ChevronRight";
9
- import { Badge, Button, Card, Dialog, Heading, Hotkeys, Inline, Label, Select, Spinner, Tab, TabList, Text, TextInput, rem, useClickOutsideEvent, useTheme, useTheme_v2 } from "@sanity/ui";
9
+ import { Badge, Button, Card, Dialog, Heading, Hotkeys, Inline, Label, Select, Spinner, Tab, TabList, TextInput, rem, useClickOutsideEvent, useTheme, useTheme_v2 } from "@sanity/ui";
10
10
  import { useToast } from "@sanity/ui/toast";
11
11
  import { isHotkey } from "is-hotkey-esm";
12
- import { Box, Container, Flex, Grid, VStack } from "ui5";
12
+ import { Box, Container, Flex, Grid, Icon, Text, VStack } from "ui5";
13
13
  import { useEffectEvent } from "use-effect-event";
14
14
  import { closeBrackets } from "@codemirror/autocomplete";
15
15
  import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
@@ -545,7 +545,7 @@ function tryParseParams(val, t) {
545
545
  return err.message = `${t("params.error.params-invalid-json")}:\n\n${err.message.replace("JSON5:", "")}`, err;
546
546
  }
547
547
  }
548
- const _key3 = "lBV0cq_inputBackgroundContainer", _key10 = "lBV0cq_resultContainer";
548
+ const _key3 = "JLqkdW_inputBackgroundContainer", _key10 = "JLqkdW_resultContainer";
549
549
  function Root(t0) {
550
550
  let $ = c(6), props, ref;
551
551
  $[0] === t0 ? (props = $[1], ref = $[2]) : ({ref, ...props} = t0, $[0] = t0, $[1] = props, $[2] = ref);
@@ -553,28 +553,28 @@ function Root(t0) {
553
553
  return $[3] !== props || $[4] !== ref ? (t1 = /* @__PURE__ */ jsx(Flex, {
554
554
  ...props,
555
555
  ref,
556
- className: "lBV0cq_root"
556
+ className: "JLqkdW_root"
557
557
  }), $[3] = props, $[4] = ref, $[5] = t1) : t1 = $[5], t1;
558
558
  }
559
559
  function Header(props) {
560
560
  let $ = c(2), t0;
561
561
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
562
562
  ...props,
563
- className: "lBV0cq_header"
563
+ className: "JLqkdW_header"
564
564
  }), $[0] = props, $[1] = t0), t0;
565
565
  }
566
566
  function StyledLabel(props) {
567
567
  let $ = c(2), t0;
568
568
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Label, {
569
569
  ...props,
570
- className: "lBV0cq_styledLabel"
570
+ className: "JLqkdW_styledLabel"
571
571
  }), $[0] = props, $[1] = t0), t0;
572
572
  }
573
573
  function SplitpaneContainer(props) {
574
574
  let $ = c(2), t0;
575
575
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
576
576
  ...props,
577
- className: "lBV0cq_splitpaneContainer"
577
+ className: "JLqkdW_splitpaneContainer"
578
578
  }), $[0] = props, $[1] = t0), t0;
579
579
  }
580
580
  function QueryRecallPaneContainer(props) {
@@ -582,7 +582,7 @@ function QueryRecallPaneContainer(props) {
582
582
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
583
583
  ...props,
584
584
  flexDirection: "column",
585
- className: "lBV0cq_queryRecallPaneContainer"
585
+ className: "JLqkdW_queryRecallPaneContainer"
586
586
  }), $[0] = props, $[1] = t0), t0;
587
587
  }
588
588
  function QueryRecallPaneWrapper(props) {
@@ -593,14 +593,14 @@ function QueryRecallPaneWrapper(props) {
593
593
  flexBasis: "0%",
594
594
  flexGrow: 1,
595
595
  overflow: "hidden",
596
- className: "lBV0cq_queryRecallPaneWrapper"
596
+ className: "JLqkdW_queryRecallPaneWrapper"
597
597
  }), $[0] = props, $[1] = t0), t0;
598
598
  }
599
599
  function QueryCopyLink(props) {
600
600
  let $ = c(2), t0;
601
601
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx("a", {
602
602
  ...props,
603
- className: "lBV0cq_queryCopyLink"
603
+ className: "JLqkdW_queryCopyLink"
604
604
  }), $[0] = props, $[1] = t0), t0;
605
605
  }
606
606
  function InputBackgroundContainer(props) {
@@ -614,34 +614,34 @@ function InputBackgroundContainerLeft(props) {
614
614
  let $ = c(2), t0;
615
615
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
616
616
  ...props,
617
- className: `${_key3} lBV0cq_inputBackgroundContainerLeft`
617
+ className: `${_key3} JLqkdW_inputBackgroundContainerLeft`
618
618
  }), $[0] = props, $[1] = t0), t0;
619
619
  }
620
620
  function InputContainer(props) {
621
621
  let $ = c(2), t0;
622
622
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
623
623
  ...props,
624
- className: "lBV0cq_inputContainer"
624
+ className: "JLqkdW_inputContainer"
625
625
  }), $[0] = props, $[1] = t0), t0;
626
626
  }
627
627
  function ResultOuterContainer(props) {
628
628
  let $ = c(2), t0;
629
629
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
630
630
  ...props,
631
- className: "lBV0cq_resultOuterContainer"
631
+ className: "JLqkdW_resultOuterContainer"
632
632
  }), $[0] = props, $[1] = t0), t0;
633
633
  }
634
634
  function ResultInnerContainer(props) {
635
635
  let $ = c(2), t0;
636
636
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
637
637
  ...props,
638
- className: "lBV0cq_resultInnerContainer"
638
+ className: "JLqkdW_resultInnerContainer"
639
639
  }), $[0] = props, $[1] = t0), t0;
640
640
  }
641
641
  function ResultContainer(t0) {
642
642
  let $ = c(6), isInvalid, props;
643
643
  $[0] === t0 ? (isInvalid = $[1], props = $[2]) : ({isInvalid, ...props} = t0, $[0] = t0, $[1] = isInvalid, $[2] = props);
644
- let t1 = isInvalid ? `${_key10} lBV0cq_resultContainerInvalid` : _key10, t2;
644
+ let t1 = isInvalid ? `${_key10} JLqkdW_resultContainerInvalid` : _key10, t2;
645
645
  return $[3] !== props || $[4] !== t1 ? (t2 = /* @__PURE__ */ jsx(Card, {
646
646
  ...props,
647
647
  className: t1
@@ -651,21 +651,21 @@ function Result(props) {
651
651
  let $ = c(2), t0;
652
652
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
653
653
  ...props,
654
- className: "lBV0cq_result"
654
+ className: "JLqkdW_result"
655
655
  }), $[0] = props, $[1] = t0), t0;
656
656
  }
657
657
  function ResultFooter(props) {
658
658
  let $ = c(2), t0;
659
659
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Flex, {
660
660
  ...props,
661
- className: "lBV0cq_resultFooter"
661
+ className: "JLqkdW_resultFooter"
662
662
  }), $[0] = props, $[1] = t0), t0;
663
663
  }
664
664
  function TimingsCard(props) {
665
665
  let $ = c(2), t0;
666
666
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
667
667
  ...props,
668
- className: "lBV0cq_timingsCard"
668
+ className: "JLqkdW_timingsCard"
669
669
  }), $[0] = props, $[1] = t0), t0;
670
670
  }
671
671
  function TimingsTextContainer(props) {
@@ -676,7 +676,7 @@ function TimingsTextContainer(props) {
676
676
  let style = t3, t4;
677
677
  return $[4] !== props || $[5] !== style ? (t4 = /* @__PURE__ */ jsx(Flex, {
678
678
  ...props,
679
- className: "lBV0cq_timingsTextContainer",
679
+ className: "JLqkdW_timingsTextContainer",
680
680
  style
681
681
  }), $[4] = props, $[5] = style, $[6] = t4) : t4 = $[6], t4;
682
682
  }
@@ -684,7 +684,7 @@ function DownloadsCard(props) {
684
684
  let $ = c(2), t0;
685
685
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Card, {
686
686
  ...props,
687
- className: "lBV0cq_downloadsCard"
687
+ className: "JLqkdW_downloadsCard"
688
688
  }), $[0] = props, $[1] = t0), t0;
689
689
  }
690
690
  function SaveResultLabel(props) {
@@ -695,19 +695,21 @@ function SaveResultLabel(props) {
695
695
  let style = t2, t3;
696
696
  return $[4] !== props || $[5] !== style ? (t3 = /* @__PURE__ */ jsx(Text, {
697
697
  ...props,
698
- className: "lBV0cq_saveResultLabel",
699
- style
698
+ className: "JLqkdW_saveResultLabel",
699
+ style,
700
+ as: "div",
701
+ trim: !0
700
702
  }), $[4] = props, $[5] = style, $[6] = t3) : t3 = $[6], t3;
701
703
  }
702
704
  function ControlsContainer(props) {
703
705
  let $ = c(2), t0;
704
706
  return $[0] === props ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx(Box, {
705
707
  ...props,
706
- className: "lBV0cq_controlsContainer"
708
+ className: "JLqkdW_controlsContainer"
707
709
  }), $[0] = props, $[1] = t0), t0;
708
710
  }
709
711
  function ParamsEditor(props) {
710
- let $ = c(21), { onChange, paramsError, hasValidParams, editorRef } = props, { t } = useTranslation(visionLocaleNamespace), t0;
712
+ let $ = c(22), { onChange, paramsError, hasValidParams, editorRef } = props, { t } = useTranslation(visionLocaleNamespace), t0;
711
713
  $[0] === onChange ? t0 = $[1] : (t0 = (newValue) => {
712
714
  onChange(newValue);
713
715
  }, $[0] = onChange, $[1] = t0);
@@ -721,36 +723,43 @@ function ParamsEditor(props) {
721
723
  children: t3
722
724
  }), $[6] = t3, $[7] = t4);
723
725
  let t5;
724
- $[8] === paramsError ? t5 = $[9] : (t5 = paramsError && /* @__PURE__ */ jsx(Tooltip, {
726
+ $[8] !== hasValidParams || $[9] !== paramsError ? (t5 = paramsError && /* @__PURE__ */ jsx(Tooltip, {
725
727
  animate: !0,
726
728
  placement: "top",
727
729
  portal: !0,
728
730
  content: /* @__PURE__ */ jsx(Text, {
729
731
  size: 1,
732
+ as: "div",
733
+ trim: !0,
730
734
  children: paramsError
731
735
  }),
732
736
  children: /* @__PURE__ */ jsx(Box, {
733
737
  padding: 1,
734
738
  marginX: 2,
735
- children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(ErrorOutlineIcon, {}) })
739
+ children: /* @__PURE__ */ jsx(Icon, {
740
+ icon: ErrorOutlineIcon,
741
+ muted: !0,
742
+ style: { margin: "-0.4375rem" },
743
+ tone: hasValidParams ? void 0 : "critical"
744
+ })
736
745
  })
737
- }), $[8] = paramsError, $[9] = t5);
746
+ }), $[8] = hasValidParams, $[9] = paramsError, $[10] = t5) : t5 = $[10];
738
747
  let t6;
739
- $[10] !== t4 || $[11] !== t5 ? (t6 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsxs(Flex, { children: [t4, t5] }) }), $[10] = t4, $[11] = t5, $[12] = t6) : t6 = $[12];
748
+ $[11] !== t4 || $[12] !== t5 ? (t6 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsxs(Flex, { children: [t4, t5] }) }), $[11] = t4, $[12] = t5, $[13] = t6) : t6 = $[13];
740
749
  let t7 = props.value || "{\n \n}", t8;
741
- $[13] !== editorRef || $[14] !== handleChange || $[15] !== t7 ? (t8 = /* @__PURE__ */ jsx(VisionCodeMirror, {
750
+ $[14] !== editorRef || $[15] !== handleChange || $[16] !== t7 ? (t8 = /* @__PURE__ */ jsx(VisionCodeMirror, {
742
751
  ref: editorRef,
743
752
  initialValue: t7,
744
753
  onChange: handleChange,
745
754
  extensions: paramsExtensions
746
- }), $[13] = editorRef, $[14] = handleChange, $[15] = t7, $[16] = t8) : t8 = $[16];
755
+ }), $[14] = editorRef, $[15] = handleChange, $[16] = t7, $[17] = t8) : t8 = $[17];
747
756
  let t9;
748
- return $[17] !== t2 || $[18] !== t6 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Card, {
757
+ return $[18] !== t2 || $[19] !== t6 || $[20] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Card, {
749
758
  flex: 1,
750
759
  tone: t2,
751
760
  "data-testid": "params-editor",
752
761
  children: [t6, t8]
753
- }), $[17] = t2, $[18] = t6, $[19] = t8, $[20] = t9) : t9 = $[20], t9;
762
+ }), $[18] = t2, $[19] = t6, $[20] = t8, $[21] = t9) : t9 = $[21], t9;
754
763
  }
755
764
  function parseParams(value, t) {
756
765
  let parsedParams = tryParseParams(value, t), params = parsedParams instanceof Error ? {} : parsedParams, validationError = parsedParams instanceof Error ? parsedParams.message : void 0;
@@ -1416,7 +1425,7 @@ function QueryRecall(t0) {
1416
1425
  }) : /* @__PURE__ */ jsx(Text, {
1417
1426
  weight: "bold",
1418
1427
  size: compactMode ? 2 : 3,
1419
- textOverflow: "ellipsis",
1428
+ truncate: 1,
1420
1429
  style: {
1421
1430
  maxWidth: compactMode ? "180px" : "220px",
1422
1431
  cursor: canMutateQuery ? "pointer" : "default",
@@ -1426,6 +1435,8 @@ function QueryRecall(t0) {
1426
1435
  onClick: canMutateQuery ? () => {
1427
1436
  setEditingKey(q_5._key), setEditingTitle(q_5.title || q_5._key.slice(0, 5));
1428
1437
  } : void 0,
1438
+ as: "div",
1439
+ trim: !0,
1429
1440
  children: optimisticTitles[q_5._key] || q_5.title || q_5._key.slice(q_5._key.length - 5, q_5._key.length)
1430
1441
  }), isEdited && /* @__PURE__ */ jsx(Box, { style: {
1431
1442
  width: "6px",
@@ -1549,6 +1560,8 @@ function QueryRecall(t0) {
1549
1560
  }), /* @__PURE__ */ jsx(Text, {
1550
1561
  size: 1,
1551
1562
  muted: !0,
1563
+ as: "div",
1564
+ trim: !0,
1552
1565
  children: formatDate.format(new Date(q_5.savedAt || ""))
1553
1566
  })]
1554
1567
  }) : /* @__PURE__ */ jsxs(Flex, {
@@ -1594,11 +1607,15 @@ function QueryRecall(t0) {
1594
1607
  /* @__PURE__ */ jsx(Text, {
1595
1608
  size: 1,
1596
1609
  muted: !0,
1610
+ as: "div",
1611
+ trim: !0,
1597
1612
  children: "•"
1598
1613
  }),
1599
1614
  /* @__PURE__ */ jsx(Text, {
1600
1615
  size: 1,
1601
1616
  muted: !0,
1617
+ as: "div",
1618
+ trim: !0,
1602
1619
  children: formatDate.format(new Date(q_5.savedAt || ""))
1603
1620
  })
1604
1621
  ]
@@ -1663,6 +1680,8 @@ function QueryRecall(t0) {
1663
1680
  padding: 4,
1664
1681
  children: /* @__PURE__ */ jsx(Text, {
1665
1682
  size: 2,
1683
+ as: "div",
1684
+ trim: !0,
1666
1685
  children: t("save-query.share-warning")
1667
1686
  })
1668
1687
  })
@@ -1734,6 +1753,8 @@ function VisionGuiControls(t0) {
1734
1753
  children: /* @__PURE__ */ jsx(Text, {
1735
1754
  size: 1,
1736
1755
  muted: !0,
1756
+ as: "div",
1757
+ trim: !0,
1737
1758
  children: t1
1738
1759
  })
1739
1760
  }), $[2] = t1, $[3] = t2);
@@ -1790,6 +1811,8 @@ function VisionGuiControls(t0) {
1790
1811
  animate: !0,
1791
1812
  content: /* @__PURE__ */ jsx(Text, {
1792
1813
  size: 1,
1814
+ as: "div",
1815
+ trim: !0,
1793
1816
  children: t("vista.redesign.try.description")
1794
1817
  }),
1795
1818
  placement: "top",
@@ -1861,6 +1884,8 @@ function PerspectivePopover() {
1861
1884
  gap: 2,
1862
1885
  children: /* @__PURE__ */ jsx(Text, {
1863
1886
  weight: "medium",
1887
+ as: "div",
1888
+ trim: !0,
1864
1889
  children: t3
1865
1890
  })
1866
1891
  }), $[5] = t3, $[6] = t4);
@@ -1869,6 +1894,8 @@ function PerspectivePopover() {
1869
1894
  let t6;
1870
1895
  $[9] === t5 ? t6 = $[10] : (t6 = /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Text, {
1871
1896
  muted: !0,
1897
+ as: "div",
1898
+ trim: !0,
1872
1899
  children: t5
1873
1900
  }) }), $[9] = t5, $[10] = t6);
1874
1901
  let t7;
@@ -1881,6 +1908,8 @@ function PerspectivePopover() {
1881
1908
  let t9;
1882
1909
  $[15] === t ? t9 = $[16] : (t9 = /* @__PURE__ */ jsx(Text, {
1883
1910
  muted: !0,
1911
+ as: "div",
1912
+ trim: !0,
1884
1913
  children: /* @__PURE__ */ jsx(Translate, {
1885
1914
  t,
1886
1915
  i18nKey: "settings.perspective.preview-drafts-renamed-to-drafts.description"
@@ -1896,12 +1925,16 @@ function PerspectivePopover() {
1896
1925
  let t12;
1897
1926
  $[22] === t ? t12 = $[23] : (t12 = t("settings.perspectives.action.docs-link"), $[22] = t, $[23] = t12);
1898
1927
  let t13;
1899
- $[24] === t12 ? t13 = $[25] : (t13 = /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsxs(PerspectivePopoverLink, {
1900
- href: "https://www.sanity.io/docs/perspectives",
1901
- target: "_blank",
1902
- rel: "noopener noreferrer",
1903
- children: [t12, " →"]
1904
- }) }) }), $[24] = t12, $[25] = t13);
1928
+ $[24] === t12 ? t13 = $[25] : (t13 = /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Text, {
1929
+ as: "div",
1930
+ trim: !0,
1931
+ children: /* @__PURE__ */ jsxs(PerspectivePopoverLink, {
1932
+ href: "https://www.sanity.io/docs/perspectives",
1933
+ target: "_blank",
1934
+ rel: "noopener noreferrer",
1935
+ children: [t12, " →"]
1936
+ })
1937
+ }) }), $[24] = t12, $[25] = t13);
1905
1938
  let t14;
1906
1939
  $[26] !== t10 || $[27] !== t11 || $[28] !== t13 || $[29] !== t4 || $[30] !== t6 ? (t14 = /* @__PURE__ */ jsx(PerspectivePopoverContent, { children: /* @__PURE__ */ jsxs(VStack, {
1907
1940
  gap: 4,
@@ -2022,6 +2055,8 @@ function VisionGuiHeader(t0) {
2022
2055
  let t15;
2023
2056
  $[29] === t14 ? t15 = $[30] : (t15 = /* @__PURE__ */ jsx(Text, {
2024
2057
  size: 1,
2058
+ as: "div",
2059
+ trim: !0,
2025
2060
  children: t14
2026
2061
  }), $[29] = t14, $[30] = t15);
2027
2062
  let t16 = !isApiVersionLocked, t17 = customApiVersion === !1 ? apiVersion : "other", t18;
@@ -2346,6 +2381,8 @@ function QueryErrorDialog(props) {
2346
2381
  T0 = Flex, t0 = 5, t1 = 2, t2 = "column", t3 = unsatisfiedCapability ? /* @__PURE__ */ jsx(Text, {
2347
2382
  "data-testid": "query-error-api-version-capability-hint",
2348
2383
  size: 1,
2384
+ as: "div",
2385
+ trim: !0,
2349
2386
  children: t(unsatisfiedCapability.explanationKey, { apiVersion: prefixApiVersion(unsatisfiedCapability.requiredApiVersion) })
2350
2387
  }) : null, $[0] = apiVersion, $[1] = error, $[2] = perspective, $[3] = t, $[4] = variant, $[5] = T0, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3;
2351
2388
  } else T0 = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9];
@@ -2640,6 +2677,8 @@ function VisionGuiResult(t0) {
2640
2677
  $[42] !== t19 || $[43] !== t20 || $[44] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, {
2641
2678
  muted: !0,
2642
2679
  size: t19,
2680
+ as: "div",
2681
+ trim: !0,
2643
2682
  children: [
2644
2683
  t20,
2645
2684
  ":",
@@ -2655,6 +2694,8 @@ function VisionGuiResult(t0) {
2655
2694
  $[51] !== t24 || $[52] !== t25 || $[53] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Text, {
2656
2695
  muted: !0,
2657
2696
  size: t24,
2697
+ as: "div",
2698
+ trim: !0,
2658
2699
  children: [
2659
2700
  t25,
2660
2701
  ":",
@@ -3323,4 +3364,4 @@ function SanityVision(props) {
3323
3364
  }
3324
3365
  export { SanityVision as default };
3325
3366
 
3326
- //# sourceMappingURL=SanityVision-CD-bx0vw.js.map
3367
+ //# sourceMappingURL=SanityVision-e4SHQ7bh.js.map