@sia.soul/sia-react-ui 0.1.114 → 0.1.115

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/index.js CHANGED
@@ -81,7 +81,7 @@ import {
81
81
  Watermark,
82
82
  message,
83
83
  notification
84
- } from "./chunk-DUOOIPWH.js";
84
+ } from "./chunk-GNOZYUIH.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-6CII5JCT.js";
92
+ } from "./chunk-MDU5EONC.js";
93
93
  import {
94
94
  DatePicker,
95
95
  SelectDateRange,
96
96
  TimePanel
97
- } from "./chunk-NKENBSLP.js";
97
+ } from "./chunk-6XQ2LDGT.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-7KNHBJZX.js";
109
+ } from "./chunk-KPOK4HIQ.js";
110
110
  import {
111
111
  Dropdown,
112
112
  Input,
113
113
  Menu,
114
114
  Segmented,
115
115
  Steps
116
- } from "./chunk-IOVN3QL7.js";
116
+ } from "./chunk-SPIQSYWQ.js";
117
117
  import {
118
118
  TextArea
119
119
  } from "./chunk-SCEHVGKV.js";
@@ -142,15 +142,27 @@ import {
142
142
  } from "./chunk-NZMUW5XI.js";
143
143
 
144
144
  // src/components/CursorPreview.tsx
145
- import { useEffect, useState } from "react";
145
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
146
146
  import { jsx, jsxs } from "react/jsx-runtime";
147
- function CursorPreview({ frames, size = 48, playing = true, followPointer = true, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerMove, onPointerLeave, ...props }) {
147
+ function CursorPreview({ frames, size = 48, 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
+ const rootRef = useRef(null);
149
+ const [bounds, setBounds] = useState({ width: 0, height: 0 });
150
+ const [hovered, setHovered] = useState(false);
148
151
  const [index, setIndex] = useState(0);
149
152
  const [point, setPoint] = useState(null);
150
153
  const [reduced, setReduced] = useState(false);
151
154
  const [failed, setFailed] = useState(false);
152
155
  const safeSize = Math.max(8, Number.isFinite(size) ? size : 48);
153
156
  const frame = frames[playing && !reduced ? index % Math.max(1, frames.length) : 0];
157
+ useLayoutEffect(() => {
158
+ const root = rootRef.current;
159
+ if (!showHotspot || !root) return;
160
+ const measure = () => setBounds({ width: root.clientWidth, height: root.clientHeight });
161
+ measure();
162
+ const observer = new ResizeObserver(measure);
163
+ observer.observe(root);
164
+ return () => observer.disconnect();
165
+ }, [showHotspot]);
154
166
  useEffect(() => {
155
167
  setIndex(0);
156
168
  }, [frames]);
@@ -169,26 +181,54 @@ function CursorPreview({ frames, size = 48, playing = true, followPointer = true
169
181
  }, [playing, reduced, frames, index, frame]);
170
182
  function move(event) {
171
183
  const rect = event.currentTarget.getBoundingClientRect();
184
+ if (event.pointerType !== "touch") setHovered(true);
172
185
  if (followPointer && event.pointerType !== "touch") setPoint({ x: event.clientX - rect.left, y: event.clientY - rect.top });
173
186
  onPointerMove?.(event);
174
187
  }
175
188
  const following = !!point && followPointer && !!frame && !failed;
176
189
  const offset = (value) => Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * safeSize;
177
- return /* @__PURE__ */ jsxs("div", { ...props, className: `sia-cursor-preview${following ? " is-following" : ""} ${className}`.trim(), style: { height, ...style }, onPointerMove: move, onPointerLeave: (event) => {
178
- setPoint(null);
179
- onPointerLeave?.(event);
180
- }, children: [
181
- frame ? /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__bitmap", style: { width: safeSize, height: safeSize, left: following ? point.x - offset(frame.hotspotX) : "50%", top: following ? point.y - offset(frame.hotspotY) : "50%", transform: following ? void 0 : "translate(-50%, -50%)" }, children: /* @__PURE__ */ jsx(Image, { src: frame.src, width: safeSize, height: safeSize, alt, preview: false, draggable: false, onLoad: () => setFailed(false), onError: () => setFailed(true) }) }) : /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__empty", children: empty }),
182
- children ? /* @__PURE__ */ jsx("div", { className: "sia-cursor-preview__caption", children }) : null
183
- ] });
190
+ const hotspotX = (bounds.width - safeSize) / 2 + offset(frame?.hotspotX);
191
+ const hotspotY = (bounds.height - safeSize) / 2 + offset(frame?.hotspotY);
192
+ const direction = bounds.width - hotspotX >= 130 ? 1 : -1;
193
+ const lineY = Math.max(18, hotspotY - 42);
194
+ const elbowX = hotspotX + direction * 28;
195
+ const endX = direction === 1 ? Math.min(bounds.width - 58, hotspotX + 82) : Math.max(58, hotspotX - 82);
196
+ return /* @__PURE__ */ jsxs(
197
+ "div",
198
+ {
199
+ ...props,
200
+ ref: rootRef,
201
+ className: `sia-cursor-preview${following ? " is-following" : ""} ${className}`.trim(),
202
+ style: { height, ...style },
203
+ onPointerEnter: (event) => {
204
+ if (event.pointerType !== "touch") setHovered(true);
205
+ onPointerEnter?.(event);
206
+ },
207
+ onPointerMove: move,
208
+ onPointerLeave: (event) => {
209
+ setHovered(false);
210
+ setPoint(null);
211
+ onPointerLeave?.(event);
212
+ },
213
+ children: [
214
+ frame ? /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__bitmap", style: { width: safeSize, height: safeSize, left: following ? point.x - offset(frame.hotspotX) : "50%", top: following ? point.y - offset(frame.hotspotY) : "50%", transform: following ? void 0 : "translate(-50%, -50%)" }, children: /* @__PURE__ */ jsx(Image, { src: frame.src, width: safeSize, height: safeSize, alt, preview: false, draggable: false, onLoad: () => setFailed(false), onError: () => setFailed(true) }) }) : /* @__PURE__ */ jsx("span", { className: "sia-cursor-preview__empty", children: empty }),
215
+ showHotspot && !hovered && frame && !failed && bounds.width > 0 ? /* @__PURE__ */ jsxs("svg", { className: "sia-cursor-preview__hotspot", width: "100%", height: "100%", role: "img", "aria-label": "\u6307\u9488\u70B9\uFF1A\u9F20\u6807\u70B9\u51FB\u7684\u5B9E\u9645\u4F4D\u7F6E", children: [
216
+ /* @__PURE__ */ jsx("polyline", { points: `${hotspotX},${hotspotY} ${elbowX},${lineY} ${endX},${lineY}` }),
217
+ /* @__PURE__ */ jsx("circle", { cx: hotspotX, cy: hotspotY, r: 2.5 }),
218
+ /* @__PURE__ */ jsx("text", { x: endX + direction * 8, y: lineY, textAnchor: direction === 1 ? "start" : "end", dominantBaseline: "central", children: "\u6307\u9488\u70B9" })
219
+ ] }) : null,
220
+ children ? /* @__PURE__ */ jsx("div", { className: "sia-cursor-preview__caption", children }) : null
221
+ ]
222
+ }
223
+ );
184
224
  }
185
225
 
186
226
  // src/components/UtilityLayout.tsx
187
- import { useEffect as useEffect2, useRef, useState as useState2 } from "react";
227
+ import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
188
228
  import { createPortal } from "react-dom";
189
229
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
190
230
  function AutoSizer({ children }) {
191
- const ref = useRef(null);
231
+ const ref = useRef2(null);
192
232
  const [size, setSize] = useState2({ width: 0, height: 0 });
193
233
  useEffect2(() => {
194
234
  const element = ref.current;
@@ -449,7 +489,7 @@ function Pagination({
449
489
  }
450
490
 
451
491
  // src/components/Cascader.tsx
452
- import { useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState5 } from "react";
492
+ import { useEffect as useEffect3, useMemo, useRef as useRef3, useState as useState5 } from "react";
453
493
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
454
494
  function optionValue(option, fields) {
455
495
  return option[fields.value];
@@ -506,8 +546,8 @@ function Cascader({
506
546
  }) {
507
547
  const size = useControlSize(sizeProp);
508
548
  const fields = useMemo(() => ({ label: fieldNames?.label ?? "label", value: fieldNames?.value ?? "value", children: fieldNames?.children ?? "children" }), [fieldNames]);
509
- const rootRef = useRef2(null);
510
- const popupRef = useRef2(null);
549
+ const rootRef = useRef3(null);
550
+ const popupRef = useRef3(null);
511
551
  const [current, setCurrent] = useControllableState({
512
552
  value,
513
553
  defaultValue: defaultValue ?? (multiple ? [] : void 0)
@@ -812,7 +852,7 @@ function Col({
812
852
  }
813
853
 
814
854
  // src/components/Splitter.tsx
815
- import { Children as Children2, cloneElement, isValidElement, useMemo as useMemo2, useRef as useRef3, useState as useState6 } from "react";
855
+ import { Children as Children2, cloneElement, isValidElement, useMemo as useMemo2, useRef as useRef4, useState as useState6 } from "react";
816
856
  import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
817
857
  function SplitterPanel({
818
858
  defaultSize: _defaultSize,
@@ -862,10 +902,10 @@ function SplitterRoot({
862
902
  children,
863
903
  ...props
864
904
  }) {
865
- const rootRef = useRef3(null);
905
+ const rootRef = useRef4(null);
866
906
  const panels = useMemo2(() => Children2.toArray(children).filter(isValidElement), [children]);
867
907
  const [sizes, setSizes] = useState6(() => normalizeSizes(panels));
868
- const expandedSizesRef = useRef3(normalizeExpandedSizes(panels));
908
+ const expandedSizesRef = useRef4(normalizeExpandedSizes(panels));
869
909
  function resizePair(index, deltaPercent, complete = false) {
870
910
  setSizes((current) => {
871
911
  const next = [...current];
@@ -1010,7 +1050,7 @@ var Splitter = Object.assign(SplitterRoot, {
1010
1050
  });
1011
1051
 
1012
1052
  // src/components/ToolPanel.tsx
1013
- import { useId, useLayoutEffect, useRef as useRef4, useState as useState7 } from "react";
1053
+ import { useId, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState7 } from "react";
1014
1054
  import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1015
1055
  function clamp2(value, min, max) {
1016
1056
  return Math.min(max, Math.max(min, value));
@@ -1044,9 +1084,9 @@ function ToolPanel({
1044
1084
  const requestedKey = activeKey ?? internalActiveKey;
1045
1085
  const activePanel = panels.find((item) => item.key === requestedKey && !item.disabled) ?? panels.find((item) => !item.disabled);
1046
1086
  const isOpen = (open ?? internalOpen) && Boolean(activePanel);
1047
- const railRef = useRef4(null);
1048
- const indicatorRef = useRef4(null);
1049
- useLayoutEffect(() => {
1087
+ const railRef = useRef5(null);
1088
+ const indicatorRef = useRef5(null);
1089
+ useLayoutEffect2(() => {
1050
1090
  const rail2 = railRef.current;
1051
1091
  const indicator = indicatorRef.current;
1052
1092
  if (!rail2 || !indicator) return;
@@ -1365,7 +1405,7 @@ function WindowTitleBar({
1365
1405
  }
1366
1406
 
1367
1407
  // src/components/Drawer.tsx
1368
- import { createContext, forwardRef, useCallback, useContext, useEffect as useEffect4, useId as useId2, useMemo as useMemo3, useRef as useRef5, useState as useState8 } from "react";
1408
+ import { createContext, forwardRef, useCallback, useContext, useEffect as useEffect4, useId as useId2, useMemo as useMemo3, useRef as useRef6, useState as useState8 } from "react";
1369
1409
  import { createRoot } from "react-dom/client";
1370
1410
  import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
1371
1411
  var drawerHandles = /* @__PURE__ */ new Set();
@@ -1401,13 +1441,13 @@ var DrawerRoot = forwardRef(function Drawer({
1401
1441
  style,
1402
1442
  ...props
1403
1443
  }, forwardedRef) {
1404
- const localRef = useRef5(null);
1405
- const bodyRef = useRef5(null);
1444
+ const localRef = useRef6(null);
1445
+ const bodyRef = useRef6(null);
1406
1446
  const titleId = useId2();
1407
1447
  const drawerId = useId2();
1408
1448
  const parentStack = useContext(DrawerStackContext);
1409
- const afterOpenRef = useRef5(afterOpen);
1410
- const afterCloseRef = useRef5(afterClose);
1449
+ const afterOpenRef = useRef6(afterOpen);
1450
+ const afterCloseRef = useRef6(afterClose);
1411
1451
  afterOpenRef.current = afterOpen;
1412
1452
  afterCloseRef.current = afterClose;
1413
1453
  const [rendered, setRendered] = useState8(open);
@@ -1570,7 +1610,7 @@ var Drawer2 = Object.assign(DrawerRoot, {
1570
1610
  });
1571
1611
 
1572
1612
  // src/components/Form.tsx
1573
- import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef2, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect5, useId as useId3, useLayoutEffect as useLayoutEffect2, useMemo as useMemo4, useRef as useRef6, useSyncExternalStore } from "react";
1613
+ import { Children as Children3, cloneElement as cloneElement2, createContext as createContext2, forwardRef as forwardRef2, isValidElement as isValidElement2, useContext as useContext2, useEffect as useEffect5, useId as useId3, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef7, useSyncExternalStore } from "react";
1574
1614
  import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1575
1615
  var Switch = forwardRef2(function Switch2({
1576
1616
  label,
@@ -1803,7 +1843,7 @@ var FormStore = class {
1803
1843
  };
1804
1844
  var FormContext = createContext2(null);
1805
1845
  function useForm(form) {
1806
- const ref = useRef6(form ?? new FormStore());
1846
+ const ref = useRef7(form ?? new FormStore());
1807
1847
  return [ref.current];
1808
1848
  }
1809
1849
  function FormRoot({
@@ -1827,8 +1867,8 @@ function FormRoot({
1827
1867
  const instance = internalForm;
1828
1868
  instance.configure(initialValues, { onFinish, onFinishFailed, onValuesChange });
1829
1869
  const context = useMemo4(() => instance, [instance]);
1830
- const formRef = useRef6(null);
1831
- useLayoutEffect2(() => {
1870
+ const formRef = useRef7(null);
1871
+ useLayoutEffect3(() => {
1832
1872
  const root = formRef.current;
1833
1873
  if (!root) return;
1834
1874
  let frame = 0;
@@ -1907,7 +1947,7 @@ function FormItem({
1907
1947
  }) {
1908
1948
  const form = useContext2(FormContext);
1909
1949
  const id = useId3();
1910
- const itemRef = useRef6(null);
1950
+ const itemRef = useRef7(null);
1911
1951
  if (!form) throw new Error("Form.Item \u5FC5\u987B\u5728 Form \u5185\u4F7F\u7528");
1912
1952
  useSyncExternalStore(form.subscribe, form.getSnapshot, form.getSnapshot);
1913
1953
  const path = name === void 0 ? void 0 : pathArray(name);
@@ -2234,7 +2274,7 @@ function Slider({
2234
2274
  }
2235
2275
 
2236
2276
  // src/components/ColorPicker.tsx
2237
- import { useEffect as useEffect6, useRef as useRef7, useState as useState10 } from "react";
2277
+ import { useEffect as useEffect6, useRef as useRef8, useState as useState10 } from "react";
2238
2278
  import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
2239
2279
  var DEFAULT_MODES = ["solid", "gradient"];
2240
2280
  var gradientStopSeed = 0;
@@ -2325,9 +2365,9 @@ function ColorPicker({
2325
2365
  ...props
2326
2366
  }) {
2327
2367
  const size = useControlSize(sizeProp);
2328
- const rootRef = useRef7(null);
2329
- const popupRef = useRef7(null);
2330
- const lastEmittedValue = useRef7();
2368
+ const rootRef = useRef8(null);
2369
+ const popupRef = useRef8(null);
2370
+ const lastEmittedValue = useRef8();
2331
2371
  const initialGradient = parseGradient(value ?? defaultValue);
2332
2372
  const initialSolid = initialGradient?.stops[0]?.color ?? normalizeHex(value || defaultValue);
2333
2373
  const [open, setOpen] = useState10(false);
@@ -2550,7 +2590,7 @@ function ColorPicker({
2550
2590
  }
2551
2591
 
2552
2592
  // src/components/TimePicker.tsx
2553
- import { useEffect as useEffect7, useId as useId5, useRef as useRef8, useState as useState11 } from "react";
2593
+ import { useEffect as useEffect7, useId as useId5, useRef as useRef9, useState as useState11 } from "react";
2554
2594
  import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
2555
2595
  function seconds(value) {
2556
2596
  const [h = 0, m = 0, s = 0] = value.split(":").map(Number);
@@ -2581,10 +2621,10 @@ function TimePicker({
2581
2621
  }) {
2582
2622
  const size = useControlSize(sizeProp);
2583
2623
  const id = useId5();
2584
- const rootRef = useRef8(null);
2585
- const inputRef = useRef8(null);
2586
- const popupRef = useRef8(null);
2587
- const focusPanel = useRef8(false);
2624
+ const rootRef = useRef9(null);
2625
+ const inputRef = useRef9(null);
2626
+ const popupRef = useRef9(null);
2627
+ const focusPanel = useRef9(false);
2588
2628
  const [currentValue, setValue2] = useControllableState({ value, defaultValue, onChange });
2589
2629
  const [open, setOpen] = useState11(false);
2590
2630
  const [draft, setDraft] = useState11("00:00:00");
@@ -2724,7 +2764,7 @@ function TimeRangePicker({ value, defaultValue = ["", ""], placeholder = ["\u5F0
2724
2764
  })(TimePicker || (TimePicker = {}));
2725
2765
 
2726
2766
  // src/components/TreeSelect.tsx
2727
- import { useEffect as useEffect8, useMemo as useMemo6, useRef as useRef9, useState as useState12 } from "react";
2767
+ import { useEffect as useEffect8, useMemo as useMemo6, useRef as useRef10, useState as useState12 } from "react";
2728
2768
  import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
2729
2769
  function flattenTree(nodes, expanded, search, filter, depth = 0, parents = [], ancestorMatched = false) {
2730
2770
  const result = [];
@@ -2787,8 +2827,8 @@ function TreeSelect({
2787
2827
  ...props
2788
2828
  }) {
2789
2829
  const size = useControlSize(sizeProp);
2790
- const rootRef = useRef9(null);
2791
- const popupRef = useRef9(null);
2830
+ const rootRef = useRef10(null);
2831
+ const popupRef = useRef10(null);
2792
2832
  const nodeIndex = useMemo6(() => {
2793
2833
  const index = /* @__PURE__ */ new Map();
2794
2834
  const visit = (nodes) => nodes.forEach((node) => {
@@ -3043,7 +3083,7 @@ function buildFlatTree(items, options = {}) {
3043
3083
  }
3044
3084
 
3045
3085
  // src/components/Editor.tsx
3046
- import { useEffect as useEffect9, useId as useId6, useRef as useRef10, useState as useState13 } from "react";
3086
+ import { useEffect as useEffect9, useId as useId6, useRef as useRef11, useState as useState13 } from "react";
3047
3087
  import EditorWorker from "monaco-editor/editor/editor.worker.js?worker";
3048
3088
 
3049
3089
  // src/components/jsonLanguage.ts
@@ -3719,27 +3759,27 @@ function Editor({
3719
3759
  loadingText = "\u6B63\u5728\u52A0\u8F7D\u7F16\u8F91\u5668\u2026"
3720
3760
  }) {
3721
3761
  const generatedId = useId6();
3722
- const containerRef = useRef10(null);
3723
- const rangeHighlightRef = useRef10(null);
3724
- const editorRef = useRef10(null);
3725
- const modelRef = useRef10(null);
3726
- const apiRef = useRef10(null);
3727
- const applyingControlledValueRef = useRef10(false);
3728
- const updateHighlightRef = useRef10(() => void 0);
3729
- const changeHandlerRef = useRef10(onChange);
3730
- const readyHandlerRef = useRef10(onReady);
3731
- const selectionHandlerRef = useRef10(onSelectionChange);
3732
- const keyDownHandlerRef = useRef10(onKeyDown);
3733
- const highlightRangeRef = useRef10(highlightRange);
3734
- const markersRef = useRef10(markers);
3735
- const contextMenuItemsRef = useRef10(contextMenuItems);
3736
- const completionProviderRef = useRef10(completionProvider);
3737
- const refreshSuggestionOnSpaceRef = useRef10(refreshSuggestionOnSpace);
3738
- const initialValueRef = useRef10(value);
3739
- const initialLanguageRef = useRef10(language);
3740
- const initialPathRef = useRef10(path);
3741
- const initialThemeRef = useRef10(theme);
3742
- const initialOptionsRef = useRef10(options);
3762
+ const containerRef = useRef11(null);
3763
+ const rangeHighlightRef = useRef11(null);
3764
+ const editorRef = useRef11(null);
3765
+ const modelRef = useRef11(null);
3766
+ const apiRef = useRef11(null);
3767
+ const applyingControlledValueRef = useRef11(false);
3768
+ const updateHighlightRef = useRef11(() => void 0);
3769
+ const changeHandlerRef = useRef11(onChange);
3770
+ const readyHandlerRef = useRef11(onReady);
3771
+ const selectionHandlerRef = useRef11(onSelectionChange);
3772
+ const keyDownHandlerRef = useRef11(onKeyDown);
3773
+ const highlightRangeRef = useRef11(highlightRange);
3774
+ const markersRef = useRef11(markers);
3775
+ const contextMenuItemsRef = useRef11(contextMenuItems);
3776
+ const completionProviderRef = useRef11(completionProvider);
3777
+ const refreshSuggestionOnSpaceRef = useRef11(refreshSuggestionOnSpace);
3778
+ const initialValueRef = useRef11(value);
3779
+ const initialLanguageRef = useRef11(language);
3780
+ const initialPathRef = useRef11(path);
3781
+ const initialThemeRef = useRef11(theme);
3782
+ const initialOptionsRef = useRef11(options);
3743
3783
  const [loading, setLoading] = useState13(true);
3744
3784
  const [, setSelectionVersion] = useState13(0);
3745
3785
  initialValueRef.current = value;
@@ -4277,12 +4317,12 @@ function Editor({
4277
4317
  }
4278
4318
 
4279
4319
  // src/components/Markdown.tsx
4280
- import { useEffect as useEffect10, useMemo as useMemo7, useRef as useRef11, useState as useState14 } from "react";
4320
+ import { useEffect as useEffect10, useMemo as useMemo7, useRef as useRef12, useState as useState14 } from "react";
4281
4321
  import DOMPurify from "dompurify";
4282
4322
  import { marked } from "marked";
4283
4323
  import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
4284
4324
  function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", resolveImageSrc, imagePreview = true, className = "", onClick, onKeyDown, ...props }) {
4285
- const rootRef = useRef11(null);
4325
+ const rootRef = useRef12(null);
4286
4326
  const [previewImage, setPreviewImage] = useState14(null);
4287
4327
  const html = useMemo7(() => {
4288
4328
  const rendered = marked.parse(content, { breaks: true, gfm: true });
@@ -4357,7 +4397,7 @@ function Markdown({ content, emptyText = "\u6682\u65E0 Markdown \u5185\u5BB9", r
4357
4397
  }
4358
4398
 
4359
4399
  // src/components/InputNumber.tsx
4360
- import { forwardRef as forwardRef4, useEffect as useEffect11, useId as useId7, useRef as useRef12, useState as useState15 } from "react";
4400
+ import { forwardRef as forwardRef4, useEffect as useEffect11, useId as useId7, useRef as useRef13, useState as useState15 } from "react";
4361
4401
  import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
4362
4402
  function formatValue(value, precision) {
4363
4403
  if (value === null || !Number.isFinite(value)) return "";
@@ -4391,7 +4431,7 @@ var InputNumber = forwardRef4(function InputNumber2({
4391
4431
  const size = useControlSize(sizeProp);
4392
4432
  const fallbackId = useId7();
4393
4433
  const inputId = id ?? fallbackId;
4394
- const localRef = useRef12(null);
4434
+ const localRef = useRef13(null);
4395
4435
  const [currentValue, setCurrentValue] = useControllableState({ value, defaultValue, onChange });
4396
4436
  const displayValue = (next) => {
4397
4437
  const plain = formatValue(next, precision);
@@ -4633,7 +4673,7 @@ function openSelectModal(config) {
4633
4673
  }
4634
4674
 
4635
4675
  // src/components/Treemap.tsx
4636
- import { useEffect as useEffect12, useMemo as useMemo8, useRef as useRef13, useState as useState17 } from "react";
4676
+ import { useEffect as useEffect12, useMemo as useMemo8, useRef as useRef14, useState as useState17 } from "react";
4637
4677
  import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
4638
4678
  import { createElement } from "react";
4639
4679
  function positiveValue(value) {
@@ -5006,7 +5046,7 @@ function Treemap({
5006
5046
  style,
5007
5047
  ...props
5008
5048
  }) {
5009
- const containerRef = useRef13(null);
5049
+ const containerRef = useRef14(null);
5010
5050
  const [size, setSize] = useState17({ width: 0, height: 0 });
5011
5051
  const [internalExpandedKeys, setInternalExpandedKeys] = useState17(() => [...defaultExpandedKeys]);
5012
5052
  const [internalFocusedKey, setInternalFocusedKey] = useState17(defaultFocusedKey);
@@ -5159,7 +5199,7 @@ function Treemap({
5159
5199
  }
5160
5200
 
5161
5201
  // src/components/Table/TableCellContent.tsx
5162
- import { useLayoutEffect as useLayoutEffect3, useRef as useRef14, useState as useState18 } from "react";
5202
+ import { useLayoutEffect as useLayoutEffect4, useRef as useRef15, useState as useState18 } from "react";
5163
5203
  import { jsx as jsx22 } from "react/jsx-runtime";
5164
5204
  var pendingLayouts = /* @__PURE__ */ new Map();
5165
5205
  var layoutFrame;
@@ -5178,10 +5218,10 @@ function scheduleLayout(element, task) {
5178
5218
  });
5179
5219
  }
5180
5220
  function TableCellContent({ children, ellipsis, title }) {
5181
- const ref = useRef14(null);
5221
+ const ref = useRef15(null);
5182
5222
  const [overflowing, setOverflowing] = useState18(false);
5183
5223
  const customContent = typeof children !== "string" && typeof children !== "number" && children != null;
5184
- useLayoutEffect3(() => {
5224
+ useLayoutEffect4(() => {
5185
5225
  const element = ref.current;
5186
5226
  if (!element || !ellipsis || !customContent) return;
5187
5227
  const normalizeLayouts = (parent, layouts) => {
@@ -5217,14 +5257,14 @@ function TableCellContent({ children, ellipsis, title }) {
5217
5257
  }
5218
5258
 
5219
5259
  // src/components/Table/useRemainingHeight.ts
5220
- import { useLayoutEffect as useLayoutEffect4, useState as useState19 } from "react";
5260
+ import { useLayoutEffect as useLayoutEffect5, useState as useState19 } from "react";
5221
5261
  function useRemainingHeight(rootRef, options) {
5222
5262
  const [height, setHeight] = useState19();
5223
5263
  const enabled = !!options;
5224
5264
  const container = typeof options === "object" ? options.container : void 0;
5225
5265
  const bottomOffset = typeof options === "object" ? options.bottomOffset ?? 0 : 0;
5226
5266
  const minHeight = typeof options === "object" ? options.minHeight ?? 0 : 0;
5227
- useLayoutEffect4(() => {
5267
+ useLayoutEffect5(() => {
5228
5268
  const root = rootRef.current;
5229
5269
  if (!enabled || !root) return;
5230
5270
  const win = root.ownerDocument.defaultView;
@@ -5295,7 +5335,7 @@ function useRemainingHeight(rootRef, options) {
5295
5335
  }
5296
5336
 
5297
5337
  // src/components/Table/TableCanvasLayer.tsx
5298
- import { useLayoutEffect as useLayoutEffect5, useRef as useRef15 } from "react";
5338
+ import { useLayoutEffect as useLayoutEffect6, useRef as useRef16 } from "react";
5299
5339
 
5300
5340
  // src/components/Table/utils.ts
5301
5341
  var AUTO_WIDTH_COLUMN_KEYS = /* @__PURE__ */ new Set(["action", "actions", "operation", "operations"]);
@@ -5350,8 +5390,8 @@ function toTablePageParams(current, pageSize) {
5350
5390
  // src/components/Table/TableCanvasLayer.tsx
5351
5391
  import { jsx as jsx23 } from "react/jsx-runtime";
5352
5392
  function TableCanvasLayer({ viewport, rows, columns, widths, rowHeight, headerHeight }) {
5353
- const canvasRef = useRef15(null);
5354
- useLayoutEffect5(() => {
5393
+ const canvasRef = useRef16(null);
5394
+ useLayoutEffect6(() => {
5355
5395
  const canvas = canvasRef.current;
5356
5396
  const scroller = viewport.current;
5357
5397
  if (!canvas || !scroller) return;
@@ -5494,10 +5534,10 @@ function createRowIdentity() {
5494
5534
  }
5495
5535
 
5496
5536
  // src/components/Table/Table.tsx
5497
- import { Fragment as Fragment8, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect14, useImperativeHandle, useMemo as useMemo9, useRef as useRef17, useState as useState21 } from "react";
5537
+ import { Fragment as Fragment8, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect14, useImperativeHandle, useMemo as useMemo9, useRef as useRef18, useState as useState21 } from "react";
5498
5538
 
5499
5539
  // src/components/Table/plugins.tsx
5500
- import { isValidElement as isValidElement3, useEffect as useEffect13, useRef as useRef16, useState as useState20 } from "react";
5540
+ import { isValidElement as isValidElement3, useEffect as useEffect13, useRef as useRef17, useState as useState20 } from "react";
5501
5541
 
5502
5542
  // src/components/Table/columnSettings.ts
5503
5543
  function reconcileColumnSettings(columns, defaults, saved) {
@@ -7059,11 +7099,11 @@ function EditableTableCell({
7059
7099
  const config = typeof editable === "object" ? editable : { type: "input" };
7060
7100
  const [editValue, setEditValue] = useState20(value);
7061
7101
  const [saving, setSaving] = useState20(false);
7062
- const inputRef = useRef16(null);
7063
- const editorRef = useRef16(null);
7064
- const editValueRef = useRef16(value);
7065
- const savingRef = useRef16(false);
7066
- const saveRef = useRef16(
7102
+ const inputRef = useRef17(null);
7103
+ const editorRef = useRef17(null);
7104
+ const editValueRef = useRef17(value);
7105
+ const savingRef = useRef17(false);
7106
+ const saveRef = useRef17(
7067
7107
  async () => {
7068
7108
  }
7069
7109
  );
@@ -7404,8 +7444,8 @@ function ColumnSettingPanel({
7404
7444
  onApply
7405
7445
  }) {
7406
7446
  const [draft, setDraft] = useState20(items);
7407
- const listRef = useRef16(null);
7408
- const cancelDrag = useRef16(null);
7447
+ const listRef = useRef17(null);
7448
+ const cancelDrag = useRef17(null);
7409
7449
  const [preview, setPreview] = useState20(null);
7410
7450
  useEffect13(() => {
7411
7451
  cancelDrag.current?.();
@@ -8234,12 +8274,12 @@ function TableInner(props, ref) {
8234
8274
  style,
8235
8275
  ...htmlProps
8236
8276
  } = props;
8237
- const rootRef = useRef17(null);
8277
+ const rootRef = useRef18(null);
8238
8278
  const remainingHeight = useRemainingHeight(rootRef, height == null && tableHeight == null ? fillRemaining : false);
8239
- const scrollRef = useRef17(null);
8240
- const tableRef = useRef17(null);
8279
+ const scrollRef = useRef18(null);
8280
+ const tableRef = useRef18(null);
8241
8281
  useScrollbarProximity();
8242
- const scrollbarDragRef = useRef17(null);
8282
+ const scrollbarDragRef = useRef18(null);
8243
8283
  const [internalLoading, setInternalLoading] = useState21(false);
8244
8284
  const [scrollTop, setScrollTop] = useState21(0);
8245
8285
  const [scrollLeft, setScrollLeft] = useState21(0);
@@ -8261,14 +8301,14 @@ function TableInner(props, ref) {
8261
8301
  return plugins;
8262
8302
  }, [builtInHighlightPlugin, builtInResizePlugin, builtInCellSelectionPlugin, builtInIndexPlugin, providedPlugins, resizable, cellSelection, showIndex]);
8263
8303
  const sortedPlugins = useMemo9(() => [...activePlugins].sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [activePlugins]);
8264
- const pluginsByIdRef = useRef17(/* @__PURE__ */ new Map());
8304
+ const pluginsByIdRef = useRef18(/* @__PURE__ */ new Map());
8265
8305
  pluginsByIdRef.current = new Map(sortedPlugins.map((plugin) => [plugin.id, plugin]));
8266
8306
  const [pluginStates, setPluginStates] = useState21(() => Object.fromEntries(
8267
8307
  sortedPlugins.map((plugin) => [plugin.id, resolveInitialState(plugin)])
8268
8308
  ));
8269
- const pluginApisRef = useRef17({});
8270
- const contextsRef = useRef17(/* @__PURE__ */ new Map());
8271
- const mountedPluginsRef = useRef17(/* @__PURE__ */ new Map());
8309
+ const pluginApisRef = useRef18({});
8310
+ const contextsRef = useRef18(/* @__PURE__ */ new Map());
8311
+ const mountedPluginsRef = useRef18(/* @__PURE__ */ new Map());
8272
8312
  const pipeline = { columns: baseColumns, rows: createTableRows(dataSource, getRowKey) };
8273
8313
  const nextApis = {};
8274
8314
  const contexts = /* @__PURE__ */ new Map();
@@ -8400,7 +8440,7 @@ function TableInner(props, ref) {
8400
8440
  const orderedColumns = useMemo9(() => sortTableColumnsByFixed(pipeline.columns), [pipeline.columns]);
8401
8441
  const leafColumns = useMemo9(() => flattenTableColumns(orderedColumns), [orderedColumns]);
8402
8442
  const headerRows = useMemo9(() => buildHeaderRows(orderedColumns), [orderedColumns]);
8403
- const measuredCells = useRef17(/* @__PURE__ */ new WeakSet());
8443
+ const measuredCells = useRef18(/* @__PURE__ */ new WeakSet());
8404
8444
  const autoWidthSignature = leafColumns.map((column) => `${column.key}:${column.autoWidth}:${resizedWidths[column.key] ?? ""}`).join("|");
8405
8445
  useEffect14(() => {
8406
8446
  measuredCells.current = /* @__PURE__ */ new WeakSet();
@@ -8943,7 +8983,7 @@ function applySiaTheme(mode, target = document.documentElement) {
8943
8983
  }
8944
8984
 
8945
8985
  // src/components/InputSelect.tsx
8946
- import { forwardRef as forwardRef7, useEffect as useEffect15, useRef as useRef18, useState as useState22 } from "react";
8986
+ import { forwardRef as forwardRef7, useEffect as useEffect15, useRef as useRef19, useState as useState22 } from "react";
8947
8987
  import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
8948
8988
  var InputSelect = forwardRef7(function InputSelect2({
8949
8989
  options,
@@ -8984,9 +9024,9 @@ var InputSelect = forwardRef7(function InputSelect2({
8984
9024
  const [modalOpen, setModalOpen] = useState22(false);
8985
9025
  const [modalValues, setModalValues] = useState22([]);
8986
9026
  const [selectedOnly, setSelectedOnly] = useState22(false);
8987
- const rootRef = useRef18(null);
8988
- const popupRef = useRef18(null);
8989
- const inputRef = useRef18(null);
9027
+ const rootRef = useRef19(null);
9028
+ const popupRef = useRef19(null);
9029
+ const inputRef = useRef19(null);
8990
9030
  const config = typeof enableModal === "object" ? enableModal : {};
8991
9031
  function changeOpen(next) {
8992
9032
  if (next && (disabled || loading)) return;
@@ -9147,13 +9187,13 @@ var InputSelect = forwardRef7(function InputSelect2({
9147
9187
  });
9148
9188
 
9149
9189
  // src/components/QueryForm.tsx
9150
- import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect6, useRef as useRef21, useState as useState25 } from "react";
9190
+ import { Children as Children4, isValidElement as isValidElement5, useLayoutEffect as useLayoutEffect7, useRef as useRef22, useState as useState25 } from "react";
9151
9191
 
9152
9192
  // src/components/QueryFormSettings.tsx
9153
- import { useEffect as useEffect17, useRef as useRef20, useState as useState24 } from "react";
9193
+ import { useEffect as useEffect17, useRef as useRef21, useState as useState24 } from "react";
9154
9194
 
9155
9195
  // src/components/useQueryFieldSort.ts
9156
- import { useEffect as useEffect16, useRef as useRef19, useState as useState23 } from "react";
9196
+ import { useEffect as useEffect16, useRef as useRef20, useState as useState23 } from "react";
9157
9197
  function getQuerySortPreview(keys, rects, from, dy, gap) {
9158
9198
  const center = rects[from].top + rects[from].height / 2 + dy;
9159
9199
  const rest = keys.map((_, index) => index).filter((index) => index !== from);
@@ -9172,9 +9212,9 @@ function getQuerySortPreview(keys, rects, from, dy, gap) {
9172
9212
  return { ordered, offsets };
9173
9213
  }
9174
9214
  function useQueryFieldSort(keys, enabled, onCommit) {
9175
- const listRef = useRef19(null);
9176
- const cancelRef = useRef19();
9177
- const commitRef = useRef19(onCommit);
9215
+ const listRef = useRef20(null);
9216
+ const cancelRef = useRef20();
9217
+ const commitRef = useRef20(onCommit);
9178
9218
  commitRef.current = onCommit;
9179
9219
  const [preview, setPreview] = useState23();
9180
9220
  const signature = JSON.stringify(keys);
@@ -9310,9 +9350,9 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
9310
9350
  const [saving, setSaving] = useState24(false);
9311
9351
  const [error, setError] = useState24("");
9312
9352
  const [loadFailed, setLoadFailed] = useState24(false);
9313
- const token = useRef20(0);
9314
- const saveLock = useRef20(false);
9315
- const latest = useRef20({ config, fields, defaultCollapsed, applyCollapsed });
9353
+ const token = useRef21(0);
9354
+ const saveLock = useRef21(false);
9355
+ const latest = useRef21({ config, fields, defaultCollapsed, applyCollapsed });
9316
9356
  latest.current = { config, fields, defaultCollapsed, applyCollapsed };
9317
9357
  const moduleName = config?.scope.moduleName;
9318
9358
  const businessKey = config?.scope.businessKey;
@@ -9510,11 +9550,11 @@ function QueryForm({
9510
9550
  const [saveError, setSaveError] = useState25("");
9511
9551
  const [error, setError] = useState25("");
9512
9552
  const [activeShortcut, setActiveShortcut] = useState25("");
9513
- const source = useRef21({ source: "submit" });
9514
- const searchLock = useRef21(false);
9515
- const saveLock = useRef21(false);
9516
- const removeLock = useRef21(false);
9517
- const snapshot = useRef21();
9553
+ const source = useRef22({ source: "submit" });
9554
+ const searchLock = useRef22(false);
9555
+ const saveLock = useRef22(false);
9556
+ const removeLock = useRef22(false);
9557
+ const snapshot = useRef22();
9518
9558
  const busy = disabled || loading || searching;
9519
9559
  const shortcutBusy = busy || shortcutsLoading || saving || removing;
9520
9560
  const fieldLabel = (content) => {
@@ -9541,12 +9581,12 @@ function QueryForm({
9541
9581
  const entries = configured.map((item) => ({ ...entriesByKey.get(item.key), visible: item.visible, visibleIndex: item.visible ? visibleIndex++ : -1 }));
9542
9582
  const layoutKey = JSON.stringify(configured);
9543
9583
  const limit = Math.max(1, Math.floor(collapsedCount));
9544
- const rowRef = useRef21(null);
9545
- const actionsRef = useRef21(null);
9546
- const toggleRef = useRef21(null);
9584
+ const rowRef = useRef22(null);
9585
+ const actionsRef = useRef22(null);
9586
+ const toggleRef = useRef22(null);
9547
9587
  const [fittingCount, setFittingCount] = useState25(limit);
9548
9588
  const [settingsRows, setSettingsRows] = useState25(0);
9549
- useLayoutEffect6(() => {
9589
+ useLayoutEffect7(() => {
9550
9590
  const row = rowRef.current;
9551
9591
  const actions = actionsRef.current;
9552
9592
  if (!row || !actions) return;