sanity 3.93.1-next.38.730d143834 → 3.93.1-next.40.6377c06e67

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.
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const SANITY_VERSION = "3.93.1-next.38.730d143834";
2
+ const SANITY_VERSION = "3.93.1-next.40.6377c06e67";
3
3
  exports.SANITY_VERSION = SANITY_VERSION;
4
4
  //# sourceMappingURL=version.js.map
@@ -5679,6 +5679,50 @@ function _temp$c(s) {
5679
5679
  function _temp2$4(action) {
5680
5680
  return !isRestoreAction(action);
5681
5681
  }
5682
+ function useChipScrollPosition(containerRef) {
5683
+ const $ = c(4), [showGradient, setShowGradient] = useState(!1);
5684
+ let t0;
5685
+ $[0] !== containerRef.current ? (t0 = () => {
5686
+ const checkOverflow = () => {
5687
+ const container = containerRef.current;
5688
+ if (!container)
5689
+ return;
5690
+ const {
5691
+ scrollWidth,
5692
+ clientWidth
5693
+ } = container;
5694
+ if (!(scrollWidth > clientWidth)) {
5695
+ setShowGradient(!1);
5696
+ return;
5697
+ }
5698
+ const {
5699
+ scrollLeft
5700
+ } = container, isAtEnd = scrollLeft + clientWidth >= scrollWidth;
5701
+ setShowGradient(!isAtEnd);
5702
+ }, setupObservers = function() {
5703
+ checkOverflow();
5704
+ const container_0 = containerRef.current;
5705
+ if (!container_0)
5706
+ return {
5707
+ observer: null
5708
+ };
5709
+ const observer = new IntersectionObserver((entries) => {
5710
+ const entry = entries[0];
5711
+ entry && setShowGradient(entry.isIntersecting);
5712
+ }), lastChip = container_0.children[container_0.children.length - 1];
5713
+ return observer.observe(lastChip), {
5714
+ observer
5715
+ };
5716
+ }, {
5717
+ observer: observer_0
5718
+ } = setupObservers();
5719
+ return () => {
5720
+ observer_0?.disconnect();
5721
+ };
5722
+ }, $[0] = containerRef.current, $[1] = t0) : t0 = $[1];
5723
+ let t1;
5724
+ return $[2] !== containerRef ? (t1 = [containerRef], $[2] = containerRef, $[3] = t1) : t1 = $[3], useEffect(t0, t1), showGradient;
5725
+ }
5682
5726
  const TooltipContent$1 = (t0) => {
5683
5727
  const $ = c(16), {
5684
5728
  release
@@ -5822,16 +5866,19 @@ const TooltipContent$1 = (t0) => {
5822
5866
  }
5823
5867
  }
5824
5868
 
5825
- &::after {
5826
- content: '';
5827
- display: block;
5828
- position: absolute;
5829
- top: 0;
5830
- right: 0;
5831
- bottom: 0;
5832
- width: ${theme.space[3]}px;
5833
- background: linear-gradient(to right, ${rgba(theme.color.bg, 0)}, var(--card-bg-color));
5834
- }
5869
+ ${props.$showGradient && css`
5870
+ &::after {
5871
+ content: '';
5872
+ display: block;
5873
+ position: absolute;
5874
+ top: 0;
5875
+ right: 0;
5876
+ bottom: 0;
5877
+ width: 150px;
5878
+ background: linear-gradient(to right, ${rgba(theme.color.bg, 0)}, var(--card-bg-color));
5879
+ transition: 'opacity 300ms ease-out';
5880
+ }
5881
+ `}
5835
5882
  `;
5836
5883
  }), DocumentPanelHeader = memo(forwardRef(function(_props, ref) {
5837
5884
  const {
@@ -5856,7 +5903,7 @@ const TooltipContent$1 = (t0) => {
5856
5903
  hasGroupSiblings
5857
5904
  } = usePaneRouter(), {
5858
5905
  actions: fieldActions
5859
- } = useFieldActions(), [referenceElement, setReferenceElement] = useState(null), actions = useMemo(() => (allActions ?? []).filter((action) => !isRestoreAction(action)), [allActions]), menuNodes = useMemo(() => resolveMenuNodes({
5906
+ } = useFieldActions(), [referenceElement, setReferenceElement] = useState(null), scrollContainerRef = useRef(null), showGradient = useChipScrollPosition(scrollContainerRef), actions = useMemo(() => (allActions ?? []).filter((action) => !isRestoreAction(action)), [allActions]), menuNodes = useMemo(() => resolveMenuNodes({
5860
5907
  actionHandler: onMenuAction,
5861
5908
  fieldActions,
5862
5909
  menuItems,
@@ -5896,7 +5943,7 @@ const TooltipContent$1 = (t0) => {
5896
5943
  return /* @__PURE__ */ jsx(TooltipDelayGroupProvider, { children: collapsed ? /* @__PURE__ */ jsx(PaneHeader$1, { border: !0, ref, loading: connectionState === "connecting" && !editState?.draft && !editState?.published, title, tabIndex, backButton }) : /* @__PURE__ */ jsx(Card, { hidden: collapsed, style: {
5897
5944
  lineHeight: 0
5898
5945
  }, borderBottom: !0, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, paddingY: 3, children: [
5899
- /* @__PURE__ */ jsx(HorizontalScroller, { children: /* @__PURE__ */ jsx(Flex, { flex: 1, gap: 1, overflow: "auto", paddingX: 3, "data-testid": "document-perspective-list", children: /* @__PURE__ */ jsx(DocumentPerspectiveList, {}) }) }),
5946
+ /* @__PURE__ */ jsx(HorizontalScroller, { $showGradient: showGradient, children: /* @__PURE__ */ jsx(Flex, { flex: 1, gap: 1, overflow: "auto", paddingX: 3, "data-testid": "document-perspective-list", ref: scrollContainerRef, children: /* @__PURE__ */ jsx(DocumentPerspectiveList, {}) }) }),
5900
5947
  /* @__PURE__ */ jsx(Box, { flex: "none", paddingRight: 3, children: renderedActions })
5901
5948
  ] }) }) });
5902
5949
  })), DocumentPanelHeaderActionDialogDeferred = memo(function(props) {