sanity 3.94.3-next.6.275b7a19e6 → 3.94.3-next.7.5c48abba76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_chunks-es/pane.mjs
CHANGED
@@ -5763,20 +5763,34 @@ function useChipScrollPosition(containerRef) {
|
|
5763
5763
|
const container_0 = containerRef.current;
|
5764
5764
|
if (!container_0)
|
5765
5765
|
return {
|
5766
|
-
|
5766
|
+
intersectionObserver: null,
|
5767
|
+
mutationObserver: null
|
5767
5768
|
};
|
5768
|
-
const
|
5769
|
+
const intersectionObserver = new IntersectionObserver((entries) => {
|
5769
5770
|
const entry = entries[0];
|
5770
|
-
entry && setShowGradient(entry.isIntersecting);
|
5771
|
-
}),
|
5772
|
-
|
5773
|
-
|
5771
|
+
entry && setShowGradient(!entry.isIntersecting);
|
5772
|
+
}), updateLastChipObserver = () => {
|
5773
|
+
intersectionObserver.disconnect();
|
5774
|
+
const lastChip = container_0.children[container_0.children.length - 1];
|
5775
|
+
intersectionObserver.observe(lastChip);
|
5776
|
+
};
|
5777
|
+
updateLastChipObserver();
|
5778
|
+
const mutationObserver = new MutationObserver(() => {
|
5779
|
+
updateLastChipObserver(), checkOverflow();
|
5780
|
+
});
|
5781
|
+
return mutationObserver.observe(container_0, {
|
5782
|
+
childList: !0,
|
5783
|
+
subtree: !1
|
5784
|
+
}), {
|
5785
|
+
intersectionObserver,
|
5786
|
+
mutationObserver
|
5774
5787
|
};
|
5775
5788
|
}, {
|
5776
|
-
|
5789
|
+
intersectionObserver: intersectionObserver_0,
|
5790
|
+
mutationObserver: mutationObserver_0
|
5777
5791
|
} = setupObservers();
|
5778
5792
|
return () => {
|
5779
|
-
|
5793
|
+
intersectionObserver_0?.disconnect(), mutationObserver_0?.disconnect();
|
5780
5794
|
};
|
5781
5795
|
}, $[0] = containerRef.current, $[1] = t0) : t0 = $[1];
|
5782
5796
|
let t1;
|