@sia.soul/sia-react-ui 0.1.117 → 0.1.119
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/dist/{chunk-KIQSPAAQ.js → chunk-6MGFX7B2.js} +21 -0
- package/dist/{chunk-RYNEJ6LD.js → chunk-AOWWHL5Z.js} +2 -2
- package/dist/{chunk-CKP3SNVH.js → chunk-BEVCKS5J.js} +5 -3
- package/dist/{chunk-SB53UBFV.js → chunk-BQIARYZB.js} +48 -18
- package/dist/{chunk-6DFAX43X.js → chunk-GKFFFHHU.js} +4 -2
- package/dist/{chunk-HHPZOBY3.js → chunk-QBBIBJXW.js} +2 -2
- package/dist/{core-De9MXbF6.d.ts → core-CA0gNAug.d.ts} +8 -4
- package/dist/{core-DlngVjmf.d.cts → core-bcMvT7pl.d.cts} +8 -4
- package/dist/core.cjs +166 -117
- package/dist/core.css +8 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +4 -4
- package/dist/game.cjs +6 -0
- package/dist/game.css +5 -1
- package/dist/game.js +1 -1
- package/dist/index.cjs +102 -24
- package/dist/index.css +8 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +41 -14
- package/dist/rich-text-editor.cjs +9 -1
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +62 -15
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
|
@@ -1634,6 +1634,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1634
1634
|
const entries = /* @__PURE__ */ new Map();
|
|
1635
1635
|
let scanFrame = 0;
|
|
1636
1636
|
let updateFrame = 0;
|
|
1637
|
+
const dirtyStyles = /* @__PURE__ */ new Set();
|
|
1638
|
+
let fullScan = true;
|
|
1637
1639
|
const setEntryVisible = (entry, visible) => {
|
|
1638
1640
|
entry.horizontalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
1639
1641
|
entry.verticalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
@@ -1833,13 +1835,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1833
1835
|
const scanTargets = () => {
|
|
1834
1836
|
scanFrame = 0;
|
|
1835
1837
|
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
1836
|
-
const discovered =
|
|
1838
|
+
const discovered = /* @__PURE__ */ new Set();
|
|
1837
1839
|
if (!targetRef) {
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1840
|
+
const roots = fullScan ? [document.body] : [...dirtyStyles].filter((node) => node.isConnected);
|
|
1841
|
+
for (const root of roots) {
|
|
1842
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
1843
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1844
|
+
});
|
|
1845
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
1846
|
+
if (node instanceof HTMLElement) discovered.add(node);
|
|
1847
|
+
}
|
|
1848
|
+
for (let node = root; node; node = node.parentElement) discovered.add(node);
|
|
1843
1849
|
}
|
|
1844
1850
|
}
|
|
1845
1851
|
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
@@ -1851,28 +1857,48 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1851
1857
|
}
|
|
1852
1858
|
});
|
|
1853
1859
|
entries.forEach((_entry, target) => {
|
|
1854
|
-
if (!target.isConnected || !nextTargets.has(target)) removeTarget(target);
|
|
1860
|
+
if (!target.isConnected || (fullScan || candidates.includes(target)) && !nextTargets.has(target)) removeTarget(target);
|
|
1855
1861
|
else updateEntry(_entry);
|
|
1856
1862
|
});
|
|
1863
|
+
dirtyStyles.clear();
|
|
1864
|
+
fullScan = false;
|
|
1857
1865
|
};
|
|
1858
|
-
const scheduleScan = () => {
|
|
1866
|
+
const scheduleScan = (complete = true) => {
|
|
1867
|
+
fullScan ||= complete;
|
|
1859
1868
|
if (scanFrame) return;
|
|
1860
1869
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
1861
1870
|
};
|
|
1871
|
+
const previousStyle = document.createElement("div").style;
|
|
1872
|
+
const positionProperties = /* @__PURE__ */ new Set(["left", "top", "transform"]);
|
|
1862
1873
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
1863
|
-
|
|
1874
|
+
let relevant = false;
|
|
1875
|
+
for (const mutation of mutations) {
|
|
1864
1876
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
1865
|
-
|
|
1866
|
-
|
|
1877
|
+
if (!target || layer.contains(target) || target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track")) continue;
|
|
1878
|
+
relevant = true;
|
|
1879
|
+
let positionOnly = false;
|
|
1880
|
+
if (mutation.type === "attributes" && mutation.attributeName === "style" && target instanceof HTMLElement) {
|
|
1881
|
+
previousStyle.cssText = mutation.oldValue ?? "";
|
|
1882
|
+
const keys = /* @__PURE__ */ new Set([...Array.from(previousStyle), ...Array.from(target.style)]);
|
|
1883
|
+
const changed = [...keys].filter((key) => previousStyle.getPropertyValue(key) !== target.style.getPropertyValue(key) || previousStyle.getPropertyPriority(key) !== target.style.getPropertyPriority(key));
|
|
1884
|
+
if (!changed.length) continue;
|
|
1885
|
+
const fixedSize = target.style.width.endsWith("px") && target.style.height.endsWith("px");
|
|
1886
|
+
positionOnly = fixedSize && changed.every((key) => positionProperties.has(key)) && ["absolute", "fixed"].includes(getComputedStyle(target).position);
|
|
1887
|
+
}
|
|
1888
|
+
if (positionOnly && target instanceof HTMLElement) dirtyStyles.add(target);
|
|
1889
|
+
else fullScan = true;
|
|
1890
|
+
}
|
|
1891
|
+
if (relevant) scheduleScan(false);
|
|
1867
1892
|
});
|
|
1868
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
1869
|
-
|
|
1893
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ["class", "style", "hidden"] });
|
|
1894
|
+
const onResize = () => scheduleScan();
|
|
1895
|
+
window.addEventListener("resize", onResize);
|
|
1870
1896
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
1871
1897
|
scheduleScan();
|
|
1872
1898
|
return () => {
|
|
1873
1899
|
mutationObserver.disconnect();
|
|
1874
1900
|
resizeObserver.disconnect();
|
|
1875
|
-
window.removeEventListener("resize",
|
|
1901
|
+
window.removeEventListener("resize", onResize);
|
|
1876
1902
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
1877
1903
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
1878
1904
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
@@ -2801,6 +2827,21 @@ var import_react_dom2 = require("react-dom");
|
|
|
2801
2827
|
var bodyLockCount = 0;
|
|
2802
2828
|
var previousBodyOverflow = "";
|
|
2803
2829
|
var overlayStack = [];
|
|
2830
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
2831
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
2832
|
+
function subscribeOverlayLayers(listener) {
|
|
2833
|
+
overlayListeners.add(listener);
|
|
2834
|
+
return () => {
|
|
2835
|
+
overlayListeners.delete(listener);
|
|
2836
|
+
};
|
|
2837
|
+
}
|
|
2838
|
+
function isAnchorBehindOverlay(anchor) {
|
|
2839
|
+
const top = overlayStack.at(-1);
|
|
2840
|
+
const panel = top ? overlayPanels.get(top)?.current : void 0;
|
|
2841
|
+
if (!panel) return false;
|
|
2842
|
+
const root = panel.closest(".sia-modal-root, .sia-drawer-root");
|
|
2843
|
+
return root ? anchor.closest(".sia-modal-root, .sia-drawer-root") !== root : !panel.contains(anchor);
|
|
2844
|
+
}
|
|
2804
2845
|
function lockBodyScroll() {
|
|
2805
2846
|
if (bodyLockCount === 0) {
|
|
2806
2847
|
previousBodyOverflow = document.body.style.overflow;
|
|
@@ -2826,6 +2867,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2826
2867
|
const overlayId = overlayIdRef.current;
|
|
2827
2868
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2828
2869
|
overlayStack.push(overlayId);
|
|
2870
|
+
overlayPanels.set(overlayId, panelRef);
|
|
2871
|
+
overlayListeners.forEach((listener) => listener());
|
|
2829
2872
|
const unlockBody = lockBodyScroll();
|
|
2830
2873
|
const focusTimer = window.setTimeout(() => {
|
|
2831
2874
|
const panel = panelRef.current;
|
|
@@ -2863,6 +2906,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2863
2906
|
document.removeEventListener("keydown", handleKeyDown);
|
|
2864
2907
|
const index = overlayStack.lastIndexOf(overlayId);
|
|
2865
2908
|
if (index >= 0) overlayStack.splice(index, 1);
|
|
2909
|
+
overlayPanels.delete(overlayId);
|
|
2910
|
+
overlayListeners.forEach((listener) => listener());
|
|
2866
2911
|
unlockBody();
|
|
2867
2912
|
previouslyFocused?.focus({ preventScroll: true });
|
|
2868
2913
|
};
|
|
@@ -3589,11 +3634,12 @@ function Floating({
|
|
|
3589
3634
|
if (anchor2) {
|
|
3590
3635
|
const rect = anchor2.getBoundingClientRect();
|
|
3591
3636
|
const next = resolveFloatingPosition(rect, overlayRef.current.getBoundingClientRect(), placement, typeof arrow === "object" && !!arrow.pointAtCenter, autoAdjustOverflow);
|
|
3592
|
-
next.hidden = isFloatingAnchorHidden(anchor2, rect);
|
|
3637
|
+
next.hidden = isFloatingAnchorHidden(anchor2, rect) || isAnchorBehindOverlay(anchor2);
|
|
3593
3638
|
setPosition(next);
|
|
3594
3639
|
}
|
|
3595
3640
|
};
|
|
3596
3641
|
update();
|
|
3642
|
+
const unsubscribeLayers = subscribeOverlayLayers(update);
|
|
3597
3643
|
window.addEventListener("resize", update);
|
|
3598
3644
|
window.addEventListener("scroll", update, true);
|
|
3599
3645
|
window.addEventListener("animationend", update, true);
|
|
@@ -3609,6 +3655,7 @@ function Floating({
|
|
|
3609
3655
|
window.removeEventListener("animationend", update, true);
|
|
3610
3656
|
window.removeEventListener("transitionend", update, true);
|
|
3611
3657
|
observer.disconnect();
|
|
3658
|
+
unsubscribeLayers();
|
|
3612
3659
|
};
|
|
3613
3660
|
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
3614
3661
|
(0, import_react15.useEffect)(() => () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AOWWHL5Z.js";
|
|
4
|
+
import "./chunk-BQIARYZB.js";
|
|
5
|
+
import "./chunk-GKFFFHHU.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-6MGFX7B2.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|
|
9
9
|
import "./chunk-KY6A5IJH.js";
|
|
10
10
|
import "./chunk-NZMUW5XI.js";
|