@sia.soul/sia-react-ui 0.1.117 → 0.1.118
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-PlVXb05e.d.ts} +7 -3
- package/dist/{core-DlngVjmf.d.cts → core-mmHC4SGJ.d.cts} +7 -3
- package/dist/core.cjs +166 -117
- package/dist/core.css +7 -0
- 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 +4 -0
- package/dist/game.js +1 -1
- package/dist/index.cjs +102 -24
- package/dist/index.css +7 -0
- 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
package/dist/index.cjs
CHANGED
|
@@ -1719,6 +1719,21 @@ var import_react_dom2 = require("react-dom");
|
|
|
1719
1719
|
var bodyLockCount = 0;
|
|
1720
1720
|
var previousBodyOverflow = "";
|
|
1721
1721
|
var overlayStack = [];
|
|
1722
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
1723
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
1724
|
+
function subscribeOverlayLayers(listener) {
|
|
1725
|
+
overlayListeners.add(listener);
|
|
1726
|
+
return () => {
|
|
1727
|
+
overlayListeners.delete(listener);
|
|
1728
|
+
};
|
|
1729
|
+
}
|
|
1730
|
+
function isAnchorBehindOverlay(anchor) {
|
|
1731
|
+
const top = overlayStack.at(-1);
|
|
1732
|
+
const panel = top ? overlayPanels.get(top)?.current : void 0;
|
|
1733
|
+
if (!panel) return false;
|
|
1734
|
+
const root = panel.closest(".sia-modal-root, .sia-drawer-root");
|
|
1735
|
+
return root ? anchor.closest(".sia-modal-root, .sia-drawer-root") !== root : !panel.contains(anchor);
|
|
1736
|
+
}
|
|
1722
1737
|
function lockBodyScroll() {
|
|
1723
1738
|
if (bodyLockCount === 0) {
|
|
1724
1739
|
previousBodyOverflow = document.body.style.overflow;
|
|
@@ -1744,6 +1759,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
1744
1759
|
const overlayId = overlayIdRef.current;
|
|
1745
1760
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
1746
1761
|
overlayStack.push(overlayId);
|
|
1762
|
+
overlayPanels.set(overlayId, panelRef);
|
|
1763
|
+
overlayListeners.forEach((listener) => listener());
|
|
1747
1764
|
const unlockBody = lockBodyScroll();
|
|
1748
1765
|
const focusTimer = window.setTimeout(() => {
|
|
1749
1766
|
const panel = panelRef.current;
|
|
@@ -1781,6 +1798,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
1781
1798
|
document.removeEventListener("keydown", handleKeyDown);
|
|
1782
1799
|
const index = overlayStack.lastIndexOf(overlayId);
|
|
1783
1800
|
if (index >= 0) overlayStack.splice(index, 1);
|
|
1801
|
+
overlayPanels.delete(overlayId);
|
|
1802
|
+
overlayListeners.forEach((listener) => listener());
|
|
1784
1803
|
unlockBody();
|
|
1785
1804
|
previouslyFocused?.focus({ preventScroll: true });
|
|
1786
1805
|
};
|
|
@@ -2139,10 +2158,20 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
|
|
|
2139
2158
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2140
2159
|
function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, followPointer = true, showHotspot = false, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerEnter, onPointerMove, onPointerLeave, ...props }) {
|
|
2141
2160
|
const rootRef = (0, import_react8.useRef)(null);
|
|
2142
|
-
const [bounds, setBounds] = (0, import_react8.useState)({ width: 0, height: 0 });
|
|
2161
|
+
const [bounds, setBounds] = (0, import_react8.useState)({ width: 0, height: 0, left: 0, top: 0 });
|
|
2143
2162
|
const [hovered, setHovered] = (0, import_react8.useState)(false);
|
|
2144
2163
|
const [index, setIndex] = (0, import_react8.useState)(0);
|
|
2145
2164
|
const [point, setPoint] = (0, import_react8.useState)(null);
|
|
2165
|
+
const moveFrame = (0, import_react8.useRef)(0);
|
|
2166
|
+
const latestPointer = (0, import_react8.useRef)({ x: 0, y: 0 });
|
|
2167
|
+
const cancelMove = () => {
|
|
2168
|
+
if (moveFrame.current) cancelAnimationFrame(moveFrame.current);
|
|
2169
|
+
moveFrame.current = 0;
|
|
2170
|
+
};
|
|
2171
|
+
(0, import_react8.useEffect)(() => {
|
|
2172
|
+
if (!followPointer) setPoint(null);
|
|
2173
|
+
return cancelMove;
|
|
2174
|
+
}, [followPointer]);
|
|
2146
2175
|
const [reduced, setReduced] = (0, import_react8.useState)(false);
|
|
2147
2176
|
const [failed, setFailed] = (0, import_react8.useState)(false);
|
|
2148
2177
|
const [density, setDensity] = (0, import_react8.useState)(() => typeof window === "undefined" ? 1 : window.devicePixelRatio || 1);
|
|
@@ -2169,12 +2198,20 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
2169
2198
|
(0, import_react8.useLayoutEffect)(() => {
|
|
2170
2199
|
const root = rootRef.current;
|
|
2171
2200
|
if (!showHotspot && sizeUnit !== "device" || !root) return;
|
|
2172
|
-
const measure = () =>
|
|
2201
|
+
const measure = () => {
|
|
2202
|
+
const rect = root.getBoundingClientRect();
|
|
2203
|
+
const next = { width: root.clientWidth, height: root.clientHeight, left: rect.left, top: rect.top };
|
|
2204
|
+
setBounds((previous) => Object.keys(next).every((key) => previous[key] === next[key]) ? previous : next);
|
|
2205
|
+
};
|
|
2173
2206
|
measure();
|
|
2174
2207
|
const observer = new ResizeObserver(measure);
|
|
2175
2208
|
observer.observe(root);
|
|
2176
|
-
|
|
2177
|
-
|
|
2209
|
+
window.addEventListener("scroll", measure, true);
|
|
2210
|
+
return () => {
|
|
2211
|
+
observer.disconnect();
|
|
2212
|
+
window.removeEventListener("scroll", measure, true);
|
|
2213
|
+
};
|
|
2214
|
+
}, [showHotspot, sizeUnit, density, hovered]);
|
|
2178
2215
|
(0, import_react8.useEffect)(() => {
|
|
2179
2216
|
setIndex(0);
|
|
2180
2217
|
}, [frames]);
|
|
@@ -2192,14 +2229,22 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
2192
2229
|
return () => window.clearTimeout(timer);
|
|
2193
2230
|
}, [playing, reduced, frames, index, frame]);
|
|
2194
2231
|
function move(event) {
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2232
|
+
if (followPointer && event.pointerType !== "touch") {
|
|
2233
|
+
latestPointer.current = { x: event.clientX, y: event.clientY };
|
|
2234
|
+
if (!moveFrame.current) moveFrame.current = requestAnimationFrame(() => {
|
|
2235
|
+
moveFrame.current = 0;
|
|
2236
|
+
const root = rootRef.current;
|
|
2237
|
+
if (!root) return;
|
|
2238
|
+
const rect = root.getBoundingClientRect();
|
|
2239
|
+
setHovered(true);
|
|
2240
|
+
setPoint({ x: latestPointer.current.x - rect.left, y: latestPointer.current.y - rect.top, left: rect.left, top: rect.top });
|
|
2241
|
+
});
|
|
2242
|
+
} else if (event.pointerType !== "touch" && showHotspot) setHovered(true);
|
|
2198
2243
|
onPointerMove?.(event);
|
|
2199
2244
|
}
|
|
2200
2245
|
const following = !!point && followPointer && !!frame && !failed;
|
|
2201
2246
|
const offset = (value) => Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * safeSize;
|
|
2202
|
-
const origin =
|
|
2247
|
+
const origin = following ? point : bounds;
|
|
2203
2248
|
const snap = (value, base) => sizeUnit === "device" ? Math.round((value + base) * density) / density - base : value;
|
|
2204
2249
|
const bitmapX = snap(following ? point.x - offset(frame.hotspotX) : (bounds.width - safeSize) / 2, origin?.left ?? 0);
|
|
2205
2250
|
const bitmapY = snap(following ? point.y - offset(frame.hotspotY) : (bounds.height - safeSize) / 2, origin?.top ?? 0);
|
|
@@ -2222,6 +2267,7 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
2222
2267
|
},
|
|
2223
2268
|
onPointerMove: move,
|
|
2224
2269
|
onPointerLeave: (event) => {
|
|
2270
|
+
cancelMove();
|
|
2225
2271
|
setHovered(false);
|
|
2226
2272
|
setPoint(null);
|
|
2227
2273
|
onPointerLeave?.(event);
|
|
@@ -2448,6 +2494,7 @@ function MenuEntry({
|
|
|
2448
2494
|
ref: anchorRef,
|
|
2449
2495
|
type: "button",
|
|
2450
2496
|
className: "sia-menu__item",
|
|
2497
|
+
"data-sia-interaction-cursor": props.interactionCursor,
|
|
2451
2498
|
style: { paddingInlineStart: props.mode === "inline" && !props.inlineCollapsed ? 12 + level * props.inlineIndent : void 0 },
|
|
2452
2499
|
...withTitleTooltip({ title: collapsed ? item.title ?? (typeof item.label === "string" ? item.label : void 0) : item.title }),
|
|
2453
2500
|
disabled: item.disabled,
|
|
@@ -2505,6 +2552,7 @@ function Menu({
|
|
|
2505
2552
|
items,
|
|
2506
2553
|
mode = "vertical",
|
|
2507
2554
|
gridColumns = 2,
|
|
2555
|
+
interactionCursor = "pointer",
|
|
2508
2556
|
theme = "light",
|
|
2509
2557
|
selectedKeys,
|
|
2510
2558
|
autoScrollSelected = false,
|
|
@@ -2579,7 +2627,7 @@ function Menu({
|
|
|
2579
2627
|
if (mode !== "inline") setOpen([]);
|
|
2580
2628
|
}
|
|
2581
2629
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
2582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
2630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
2583
2631
|
}
|
|
2584
2632
|
function Steps({ items, current = 0, initial: initial3 = 0, direction = "horizontal", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
2585
2633
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
@@ -3783,6 +3831,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3783
3831
|
const entries = /* @__PURE__ */ new Map();
|
|
3784
3832
|
let scanFrame = 0;
|
|
3785
3833
|
let updateFrame = 0;
|
|
3834
|
+
const dirtyStyles = /* @__PURE__ */ new Set();
|
|
3835
|
+
let fullScan = true;
|
|
3786
3836
|
const setEntryVisible = (entry, visible) => {
|
|
3787
3837
|
entry.horizontalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
3788
3838
|
entry.verticalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
@@ -3982,13 +4032,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3982
4032
|
const scanTargets = () => {
|
|
3983
4033
|
scanFrame = 0;
|
|
3984
4034
|
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
3985
|
-
const discovered =
|
|
4035
|
+
const discovered = /* @__PURE__ */ new Set();
|
|
3986
4036
|
if (!targetRef) {
|
|
3987
|
-
const
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
4037
|
+
const roots = fullScan ? [document.body] : [...dirtyStyles].filter((node) => node.isConnected);
|
|
4038
|
+
for (const root of roots) {
|
|
4039
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
4040
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
4041
|
+
});
|
|
4042
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
4043
|
+
if (node instanceof HTMLElement) discovered.add(node);
|
|
4044
|
+
}
|
|
4045
|
+
for (let node = root; node; node = node.parentElement) discovered.add(node);
|
|
3992
4046
|
}
|
|
3993
4047
|
}
|
|
3994
4048
|
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
@@ -4000,28 +4054,48 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
4000
4054
|
}
|
|
4001
4055
|
});
|
|
4002
4056
|
entries.forEach((_entry, target) => {
|
|
4003
|
-
if (!target.isConnected || !nextTargets.has(target)) removeTarget(target);
|
|
4057
|
+
if (!target.isConnected || (fullScan || candidates.includes(target)) && !nextTargets.has(target)) removeTarget(target);
|
|
4004
4058
|
else updateEntry(_entry);
|
|
4005
4059
|
});
|
|
4060
|
+
dirtyStyles.clear();
|
|
4061
|
+
fullScan = false;
|
|
4006
4062
|
};
|
|
4007
|
-
const scheduleScan = () => {
|
|
4063
|
+
const scheduleScan = (complete = true) => {
|
|
4064
|
+
fullScan ||= complete;
|
|
4008
4065
|
if (scanFrame) return;
|
|
4009
4066
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
4010
4067
|
};
|
|
4068
|
+
const previousStyle = document.createElement("div").style;
|
|
4069
|
+
const positionProperties = /* @__PURE__ */ new Set(["left", "top", "transform"]);
|
|
4011
4070
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
4012
|
-
|
|
4071
|
+
let relevant = false;
|
|
4072
|
+
for (const mutation of mutations) {
|
|
4013
4073
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
4014
|
-
|
|
4015
|
-
|
|
4074
|
+
if (!target || layer.contains(target) || target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track")) continue;
|
|
4075
|
+
relevant = true;
|
|
4076
|
+
let positionOnly = false;
|
|
4077
|
+
if (mutation.type === "attributes" && mutation.attributeName === "style" && target instanceof HTMLElement) {
|
|
4078
|
+
previousStyle.cssText = mutation.oldValue ?? "";
|
|
4079
|
+
const keys = /* @__PURE__ */ new Set([...Array.from(previousStyle), ...Array.from(target.style)]);
|
|
4080
|
+
const changed = [...keys].filter((key) => previousStyle.getPropertyValue(key) !== target.style.getPropertyValue(key) || previousStyle.getPropertyPriority(key) !== target.style.getPropertyPriority(key));
|
|
4081
|
+
if (!changed.length) continue;
|
|
4082
|
+
const fixedSize = target.style.width.endsWith("px") && target.style.height.endsWith("px");
|
|
4083
|
+
positionOnly = fixedSize && changed.every((key) => positionProperties.has(key)) && ["absolute", "fixed"].includes(getComputedStyle(target).position);
|
|
4084
|
+
}
|
|
4085
|
+
if (positionOnly && target instanceof HTMLElement) dirtyStyles.add(target);
|
|
4086
|
+
else fullScan = true;
|
|
4087
|
+
}
|
|
4088
|
+
if (relevant) scheduleScan(false);
|
|
4016
4089
|
});
|
|
4017
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
4018
|
-
|
|
4090
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ["class", "style", "hidden"] });
|
|
4091
|
+
const onResize = () => scheduleScan();
|
|
4092
|
+
window.addEventListener("resize", onResize);
|
|
4019
4093
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
4020
4094
|
scheduleScan();
|
|
4021
4095
|
return () => {
|
|
4022
4096
|
mutationObserver.disconnect();
|
|
4023
4097
|
resizeObserver.disconnect();
|
|
4024
|
-
window.removeEventListener("resize",
|
|
4098
|
+
window.removeEventListener("resize", onResize);
|
|
4025
4099
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
4026
4100
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
4027
4101
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
@@ -4188,11 +4262,12 @@ function Floating({
|
|
|
4188
4262
|
if (anchor2) {
|
|
4189
4263
|
const rect = anchor2.getBoundingClientRect();
|
|
4190
4264
|
const next = resolveFloatingPosition(rect, overlayRef.current.getBoundingClientRect(), placement, typeof arrow === "object" && !!arrow.pointAtCenter, autoAdjustOverflow);
|
|
4191
|
-
next.hidden = isFloatingAnchorHidden(anchor2, rect);
|
|
4265
|
+
next.hidden = isFloatingAnchorHidden(anchor2, rect) || isAnchorBehindOverlay(anchor2);
|
|
4192
4266
|
setPosition(next);
|
|
4193
4267
|
}
|
|
4194
4268
|
};
|
|
4195
4269
|
update();
|
|
4270
|
+
const unsubscribeLayers = subscribeOverlayLayers(update);
|
|
4196
4271
|
window.addEventListener("resize", update);
|
|
4197
4272
|
window.addEventListener("scroll", update, true);
|
|
4198
4273
|
window.addEventListener("animationend", update, true);
|
|
@@ -4208,6 +4283,7 @@ function Floating({
|
|
|
4208
4283
|
window.removeEventListener("animationend", update, true);
|
|
4209
4284
|
window.removeEventListener("transitionend", update, true);
|
|
4210
4285
|
observer.disconnect();
|
|
4286
|
+
unsubscribeLayers();
|
|
4211
4287
|
};
|
|
4212
4288
|
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
4213
4289
|
(0, import_react21.useEffect)(() => () => {
|
|
@@ -6031,6 +6107,7 @@ function Card({
|
|
|
6031
6107
|
description,
|
|
6032
6108
|
extra,
|
|
6033
6109
|
selectable = false,
|
|
6110
|
+
interactionCursor = "pointer",
|
|
6034
6111
|
selected,
|
|
6035
6112
|
showSelectedIndicator = true,
|
|
6036
6113
|
defaultSelected = false,
|
|
@@ -6083,6 +6160,7 @@ function Card({
|
|
|
6083
6160
|
{
|
|
6084
6161
|
className: `sia-card${fill ? " sia-card--fill" : ""}${fill && bodyHeight !== void 0 ? " sia-card--body-height" : ""}${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
6085
6162
|
style: mergedStyle,
|
|
6163
|
+
"data-sia-interaction-cursor": interactionCursor,
|
|
6086
6164
|
role: selectable ? "checkbox" : actionable ? "button" : void 0,
|
|
6087
6165
|
"aria-checked": selectable ? isSelected : void 0,
|
|
6088
6166
|
"aria-disabled": selectable || actionable ? disabled : void 0,
|
package/dist/index.css
CHANGED
|
@@ -2614,6 +2614,10 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2614
2614
|
.sia-card--actionable {
|
|
2615
2615
|
cursor: pointer;
|
|
2616
2616
|
}
|
|
2617
|
+
.sia-card--selectable[data-sia-interaction-cursor=default],
|
|
2618
|
+
.sia-card--actionable[data-sia-interaction-cursor=default] {
|
|
2619
|
+
cursor: default;
|
|
2620
|
+
}
|
|
2617
2621
|
.sia-card--actionable[aria-disabled=true] {
|
|
2618
2622
|
cursor: default;
|
|
2619
2623
|
}
|
|
@@ -8223,6 +8227,9 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8223
8227
|
.sia-menu__item:hover {
|
|
8224
8228
|
background: var(--sia-color-control-hover);
|
|
8225
8229
|
}
|
|
8230
|
+
.sia-menu__item[data-sia-interaction-cursor=default] {
|
|
8231
|
+
cursor: default;
|
|
8232
|
+
}
|
|
8226
8233
|
.sia-menu__entry.is-selected > .sia-menu__item {
|
|
8227
8234
|
color: var(--sia-color-primary-text);
|
|
8228
8235
|
background: var(--sia-color-primary-light);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-mmHC4SGJ.cjs';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-mmHC4SGJ.cjs';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-O_pNB3SQ.cjs';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
@@ -35,7 +35,7 @@ interface CursorPreviewProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
35
35
|
sizeUnit?: 'css' | 'device';
|
|
36
36
|
/** 是否循环播放;false 显示第一帧。系统偏好减少动态效果时也显示第一帧。@defaultValue true */
|
|
37
37
|
playing?: boolean;
|
|
38
|
-
/**
|
|
38
|
+
/** 移入区域后隐藏原生指针,按显示帧跟随最新鼠标热点;移出后回到中央。图片加载失败时保留原生指针;onPointerMove 仍逐事件调用。@defaultValue true */
|
|
39
39
|
followPointer?: boolean;
|
|
40
40
|
/** 鼠标未移入且图片有效时,用折线和“指针点”标出当前帧真实热点;移入后立即隐藏,移出恢复。不依赖 followPointer,业务可仅在正常选择角色启用。@defaultValue false */
|
|
41
41
|
showHotspot?: boolean;
|
|
@@ -3001,7 +3001,7 @@ interface FloatingScrollbarProviderProps {
|
|
|
3001
3001
|
/** 仅接管指定容器;不传时接管页面中的滚动容器。 */
|
|
3002
3002
|
targetRef?: RefObject<HTMLElement | null>;
|
|
3003
3003
|
}
|
|
3004
|
-
/**
|
|
3004
|
+
/** 为页面或指定容器接入浮动滚动条;布局变化重新发现滚动容器,定尺寸脱离文档流元素的定位变化仅复核相关子树与祖先。 */
|
|
3005
3005
|
declare function FloatingScrollbarProvider({ disabled, targetRef }: FloatingScrollbarProviderProps): null;
|
|
3006
3006
|
|
|
3007
3007
|
/** SiaTheme的模式类型。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-PlVXb05e.js';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, an as Spin, ao as SpinProps, ap as StepItem, aq as StepStatus, ar as Steps, as as StepsProps, at as TabItem, au as Tabs, av as TabsContextMenuClickInfo, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, aD as TagVariant, aE as Timeline, aF as TimelineItem, aG as TimelineProps, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aK as Tooltip, aL as TooltipProps, aM as Tour, aN as TourProps, aO as TourStep, aP as Tree, aQ as TreeDropPosition, aR as TreeKey, aS as TreeNode, aT as TreeProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b2 as UploadHttpRequest, b3 as UploadItemActions, b4 as UploadProps, b5 as UploadRef, b6 as UploadRejectInfo, b7 as UploadRequestHandle, b8 as UploadRequestOptions, b9 as Watermark, ba as WatermarkFont, bb as WatermarkProps, bc as message, bd as notification } from './core-PlVXb05e.js';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-BiL3Wjsd.js';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
@@ -35,7 +35,7 @@ interface CursorPreviewProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
35
35
|
sizeUnit?: 'css' | 'device';
|
|
36
36
|
/** 是否循环播放;false 显示第一帧。系统偏好减少动态效果时也显示第一帧。@defaultValue true */
|
|
37
37
|
playing?: boolean;
|
|
38
|
-
/**
|
|
38
|
+
/** 移入区域后隐藏原生指针,按显示帧跟随最新鼠标热点;移出后回到中央。图片加载失败时保留原生指针;onPointerMove 仍逐事件调用。@defaultValue true */
|
|
39
39
|
followPointer?: boolean;
|
|
40
40
|
/** 鼠标未移入且图片有效时,用折线和“指针点”标出当前帧真实热点;移入后立即隐藏,移出恢复。不依赖 followPointer,业务可仅在正常选择角色启用。@defaultValue false */
|
|
41
41
|
showHotspot?: boolean;
|
|
@@ -3001,7 +3001,7 @@ interface FloatingScrollbarProviderProps {
|
|
|
3001
3001
|
/** 仅接管指定容器;不传时接管页面中的滚动容器。 */
|
|
3002
3002
|
targetRef?: RefObject<HTMLElement | null>;
|
|
3003
3003
|
}
|
|
3004
|
-
/**
|
|
3004
|
+
/** 为页面或指定容器接入浮动滚动条;布局变化重新发现滚动容器,定尺寸脱离文档流元素的定位变化仅复核相关子树与祖先。 */
|
|
3005
3005
|
declare function FloatingScrollbarProvider({ disabled, targetRef }: FloatingScrollbarProviderProps): null;
|
|
3006
3006
|
|
|
3007
3007
|
/** SiaTheme的模式类型。 */
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
Watermark,
|
|
82
82
|
message,
|
|
83
83
|
notification
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-BEVCKS5J.js";
|
|
85
85
|
import "./chunk-RX242MUO.js";
|
|
86
86
|
import {
|
|
87
87
|
MarkdownEditor
|
|
@@ -89,12 +89,12 @@ import {
|
|
|
89
89
|
import {
|
|
90
90
|
RichTextContent,
|
|
91
91
|
RichTextEditor
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-QBBIBJXW.js";
|
|
93
93
|
import {
|
|
94
94
|
DatePicker,
|
|
95
95
|
SelectDateRange,
|
|
96
96
|
TimePanel
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-AOWWHL5Z.js";
|
|
98
98
|
import {
|
|
99
99
|
Checkbox,
|
|
100
100
|
FloatingScrollbarProvider,
|
|
@@ -106,14 +106,14 @@ import {
|
|
|
106
106
|
Tooltip,
|
|
107
107
|
Tree,
|
|
108
108
|
useScrollbarProximity
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-BQIARYZB.js";
|
|
110
110
|
import {
|
|
111
111
|
Dropdown,
|
|
112
112
|
Input,
|
|
113
113
|
Menu,
|
|
114
114
|
Segmented,
|
|
115
115
|
Steps
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-GKFFFHHU.js";
|
|
117
117
|
import {
|
|
118
118
|
TextArea
|
|
119
119
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
Modal,
|
|
125
125
|
OverlayPortal,
|
|
126
126
|
useOverlayLifecycle
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-6MGFX7B2.js";
|
|
128
128
|
import {
|
|
129
129
|
Button
|
|
130
130
|
} from "./chunk-CZ2ITBRW.js";
|
|
@@ -146,10 +146,20 @@ import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
|
146
146
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
147
147
|
function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, followPointer = true, showHotspot = false, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerEnter, onPointerMove, onPointerLeave, ...props }) {
|
|
148
148
|
const rootRef = useRef(null);
|
|
149
|
-
const [bounds, setBounds] = useState({ width: 0, height: 0 });
|
|
149
|
+
const [bounds, setBounds] = useState({ width: 0, height: 0, left: 0, top: 0 });
|
|
150
150
|
const [hovered, setHovered] = useState(false);
|
|
151
151
|
const [index, setIndex] = useState(0);
|
|
152
152
|
const [point, setPoint] = useState(null);
|
|
153
|
+
const moveFrame = useRef(0);
|
|
154
|
+
const latestPointer = useRef({ x: 0, y: 0 });
|
|
155
|
+
const cancelMove = () => {
|
|
156
|
+
if (moveFrame.current) cancelAnimationFrame(moveFrame.current);
|
|
157
|
+
moveFrame.current = 0;
|
|
158
|
+
};
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (!followPointer) setPoint(null);
|
|
161
|
+
return cancelMove;
|
|
162
|
+
}, [followPointer]);
|
|
153
163
|
const [reduced, setReduced] = useState(false);
|
|
154
164
|
const [failed, setFailed] = useState(false);
|
|
155
165
|
const [density, setDensity] = useState(() => typeof window === "undefined" ? 1 : window.devicePixelRatio || 1);
|
|
@@ -176,12 +186,20 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
176
186
|
useLayoutEffect(() => {
|
|
177
187
|
const root = rootRef.current;
|
|
178
188
|
if (!showHotspot && sizeUnit !== "device" || !root) return;
|
|
179
|
-
const measure = () =>
|
|
189
|
+
const measure = () => {
|
|
190
|
+
const rect = root.getBoundingClientRect();
|
|
191
|
+
const next = { width: root.clientWidth, height: root.clientHeight, left: rect.left, top: rect.top };
|
|
192
|
+
setBounds((previous) => Object.keys(next).every((key) => previous[key] === next[key]) ? previous : next);
|
|
193
|
+
};
|
|
180
194
|
measure();
|
|
181
195
|
const observer = new ResizeObserver(measure);
|
|
182
196
|
observer.observe(root);
|
|
183
|
-
|
|
184
|
-
|
|
197
|
+
window.addEventListener("scroll", measure, true);
|
|
198
|
+
return () => {
|
|
199
|
+
observer.disconnect();
|
|
200
|
+
window.removeEventListener("scroll", measure, true);
|
|
201
|
+
};
|
|
202
|
+
}, [showHotspot, sizeUnit, density, hovered]);
|
|
185
203
|
useEffect(() => {
|
|
186
204
|
setIndex(0);
|
|
187
205
|
}, [frames]);
|
|
@@ -199,14 +217,22 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
199
217
|
return () => window.clearTimeout(timer);
|
|
200
218
|
}, [playing, reduced, frames, index, frame]);
|
|
201
219
|
function move(event) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
220
|
+
if (followPointer && event.pointerType !== "touch") {
|
|
221
|
+
latestPointer.current = { x: event.clientX, y: event.clientY };
|
|
222
|
+
if (!moveFrame.current) moveFrame.current = requestAnimationFrame(() => {
|
|
223
|
+
moveFrame.current = 0;
|
|
224
|
+
const root = rootRef.current;
|
|
225
|
+
if (!root) return;
|
|
226
|
+
const rect = root.getBoundingClientRect();
|
|
227
|
+
setHovered(true);
|
|
228
|
+
setPoint({ x: latestPointer.current.x - rect.left, y: latestPointer.current.y - rect.top, left: rect.left, top: rect.top });
|
|
229
|
+
});
|
|
230
|
+
} else if (event.pointerType !== "touch" && showHotspot) setHovered(true);
|
|
205
231
|
onPointerMove?.(event);
|
|
206
232
|
}
|
|
207
233
|
const following = !!point && followPointer && !!frame && !failed;
|
|
208
234
|
const offset = (value) => Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * safeSize;
|
|
209
|
-
const origin =
|
|
235
|
+
const origin = following ? point : bounds;
|
|
210
236
|
const snap = (value, base) => sizeUnit === "device" ? Math.round((value + base) * density) / density - base : value;
|
|
211
237
|
const bitmapX = snap(following ? point.x - offset(frame.hotspotX) : (bounds.width - safeSize) / 2, origin?.left ?? 0);
|
|
212
238
|
const bitmapY = snap(following ? point.y - offset(frame.hotspotY) : (bounds.height - safeSize) / 2, origin?.top ?? 0);
|
|
@@ -229,6 +255,7 @@ function CursorPreview({ frames, size = 48, sizeUnit = "css", playing = true, fo
|
|
|
229
255
|
},
|
|
230
256
|
onPointerMove: move,
|
|
231
257
|
onPointerLeave: (event) => {
|
|
258
|
+
cancelMove();
|
|
232
259
|
setHovered(false);
|
|
233
260
|
setPoint(null);
|
|
234
261
|
onPointerLeave?.(event);
|
|
@@ -1672,6 +1672,7 @@ function MenuEntry({
|
|
|
1672
1672
|
ref: anchorRef,
|
|
1673
1673
|
type: "button",
|
|
1674
1674
|
className: "sia-menu__item",
|
|
1675
|
+
"data-sia-interaction-cursor": props.interactionCursor,
|
|
1675
1676
|
style: { paddingInlineStart: props.mode === "inline" && !props.inlineCollapsed ? 12 + level * props.inlineIndent : void 0 },
|
|
1676
1677
|
...withTitleTooltip({ title: collapsed ? item.title ?? (typeof item.label === "string" ? item.label : void 0) : item.title }),
|
|
1677
1678
|
disabled: item.disabled,
|
|
@@ -1729,6 +1730,7 @@ function Menu({
|
|
|
1729
1730
|
items,
|
|
1730
1731
|
mode = "vertical",
|
|
1731
1732
|
gridColumns = 2,
|
|
1733
|
+
interactionCursor = "pointer",
|
|
1732
1734
|
theme = "light",
|
|
1733
1735
|
selectedKeys,
|
|
1734
1736
|
autoScrollSelected = false,
|
|
@@ -1803,7 +1805,7 @@ function Menu({
|
|
|
1803
1805
|
if (mode !== "inline") setOpen([]);
|
|
1804
1806
|
}
|
|
1805
1807
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
1806
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1807
1809
|
}
|
|
1808
1810
|
|
|
1809
1811
|
// src/components/Dropdown.tsx
|
|
@@ -2097,6 +2099,8 @@ var import_react_dom2 = require("react-dom");
|
|
|
2097
2099
|
var bodyLockCount = 0;
|
|
2098
2100
|
var previousBodyOverflow = "";
|
|
2099
2101
|
var overlayStack = [];
|
|
2102
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
2103
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
2100
2104
|
function lockBodyScroll() {
|
|
2101
2105
|
if (bodyLockCount === 0) {
|
|
2102
2106
|
previousBodyOverflow = document.body.style.overflow;
|
|
@@ -2122,6 +2126,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2122
2126
|
const overlayId = overlayIdRef.current;
|
|
2123
2127
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2124
2128
|
overlayStack.push(overlayId);
|
|
2129
|
+
overlayPanels.set(overlayId, panelRef);
|
|
2130
|
+
overlayListeners.forEach((listener) => listener());
|
|
2125
2131
|
const unlockBody = lockBodyScroll();
|
|
2126
2132
|
const focusTimer = window.setTimeout(() => {
|
|
2127
2133
|
const panel = panelRef.current;
|
|
@@ -2159,6 +2165,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2159
2165
|
document.removeEventListener("keydown", handleKeyDown);
|
|
2160
2166
|
const index = overlayStack.lastIndexOf(overlayId);
|
|
2161
2167
|
if (index >= 0) overlayStack.splice(index, 1);
|
|
2168
|
+
overlayPanels.delete(overlayId);
|
|
2169
|
+
overlayListeners.forEach((listener) => listener());
|
|
2162
2170
|
unlockBody();
|
|
2163
2171
|
previouslyFocused?.focus({ preventScroll: true });
|
|
2164
2172
|
};
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-QBBIBJXW.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";
|