@sia.soul/sia-react-ui 0.1.43 → 0.1.45

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.
@@ -1474,7 +1474,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
1474
1474
  };
1475
1475
  const scanTargets = () => {
1476
1476
  scanFrame = 0;
1477
- const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...document.querySelectorAll("*")]).filter((target) => target instanceof HTMLElement);
1477
+ const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
1478
+ const discovered = [];
1479
+ if (!targetRef) {
1480
+ const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, {
1481
+ acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1482
+ });
1483
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
1484
+ if (node instanceof HTMLElement) discovered.push(node);
1485
+ }
1486
+ }
1487
+ const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
1478
1488
  const nextTargets = /* @__PURE__ */ new Set();
1479
1489
  candidates.forEach((target) => {
1480
1490
  if (canScroll(target, "horizontal") || canScroll(target, "vertical")) {
@@ -1492,9 +1502,12 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
1492
1502
  scanFrame = window.requestAnimationFrame(scanTargets);
1493
1503
  };
1494
1504
  const mutationObserver = new MutationObserver((mutations) => {
1495
- if (mutations.some((mutation) => !layer.contains(mutation.target))) scheduleScan();
1505
+ if (mutations.some((mutation) => {
1506
+ const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
1507
+ return target && !layer.contains(target) && !target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track");
1508
+ })) scheduleScan();
1496
1509
  });
1497
- mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true });
1510
+ mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
1498
1511
  window.addEventListener("resize", scheduleScan);
1499
1512
  window.addEventListener("scroll", scheduleUpdateAll, true);
1500
1513
  scheduleScan();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SelectDateRange
3
- } from "./chunk-LWVZEUGJ.js";
4
- import "./chunk-3Q3S6CDZ.js";
3
+ } from "./chunk-QIXU7N4X.js";
4
+ import "./chunk-NYJSSPIX.js";
5
5
  import "./chunk-XCVAVCIO.js";
6
6
  import "./chunk-IKAMZNCK.js";
7
7
  import "./chunk-H7IAG72O.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",