one-design-next 0.0.66 → 0.0.68

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.
@@ -6,6 +6,8 @@ export interface ApprovalSummaryItem {
6
6
  label: string;
7
7
  value: string;
8
8
  }
9
+ /** 有 summary 时底栏左侧提示的默认文案。 */
10
+ export declare const APPROVAL_DEFAULT_ACTIONS_HINT = "\u5982\u53C2\u6570\u6709\u8BEF\uFF0C\u53EF\u5728\u5BF9\u8BDD\u6846\u4E2D\u8865\u5145\u6216\u4FEE\u6539";
9
11
  export interface ApprovalSpec {
10
12
  /** 待授权动作说明(标题);14px / regular / black-12;原样展示,Host 自行决定是否带问号 */
11
13
  description: string;
@@ -24,6 +26,13 @@ export interface ApprovalSpec {
24
26
  * 未决:默认展开;锁态:默认折叠,右侧可展开回看。
25
27
  */
26
28
  summary?: ApprovalSummaryItem[];
29
+ /**
30
+ * 未决底栏左侧提示。
31
+ * - 省略:有 `summary` 时用 {@link APPROVAL_DEFAULT_ACTIONS_HINT},否则不展示
32
+ * - 空串:强制不展示
33
+ * - 其它字符串:原样展示
34
+ */
35
+ actionsHint?: string;
27
36
  }
28
37
  export interface ApprovalResolvePayload {
29
38
  decision: ApprovalDecision;
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import * as React from 'react';
3
2
  import clsx from 'clsx';
3
+ import * as React from 'react';
4
4
  import Button from "../button";
5
5
  import Icon from "../icon";
6
6
  import "./style";
@@ -11,6 +11,8 @@ import "./style";
11
11
 
12
12
  /** 参数摘要一行:Host 已格式化的 label → 展示文案(可含换行) */
13
13
 
14
+ /** 有 summary 时底栏左侧提示的默认文案。 */
15
+ export var APPROVAL_DEFAULT_ACTIONS_HINT = '如参数有误,可在对话框中补充或修改';
14
16
  function lockedTitle(description, decision, explicit) {
15
17
  if (explicit) return explicit;
16
18
  var base = description.trim().replace(/[\?\uFF1F]+$/, '');
@@ -87,6 +89,7 @@ export function Approval(_ref2) {
87
89
  var locked = !!resolved;
88
90
  var summary = (_spec$summary = spec.summary) !== null && _spec$summary !== void 0 ? _spec$summary : [];
89
91
  var hasSummary = summary.length > 0;
92
+ var actionsHint = spec.actionsHint !== undefined ? spec.actionsHint : hasSummary ? APPROVAL_DEFAULT_ACTIONS_HINT : '';
90
93
 
91
94
  /* 未决默认展开;锁态 / 挂载即已决议 → 默认折叠 */
92
95
  var _React$useState3 = React.useState(function () {
@@ -198,6 +201,10 @@ export function Approval(_ref2) {
198
201
  summary: summary
199
202
  }))))) : null), !resolved ? /*#__PURE__*/React.createElement("div", {
200
203
  "data-odn-approval-actions": true
204
+ }, actionsHint ? /*#__PURE__*/React.createElement("span", {
205
+ "data-odn-approval-actions-hint": true
206
+ }, actionsHint) : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("div", {
207
+ "data-odn-approval-actions-right": true
201
208
  }, spec.rejectLabel ? /*#__PURE__*/React.createElement(Button, {
202
209
  size: "small",
203
210
  intent: "normal",
@@ -210,7 +217,7 @@ export function Approval(_ref2) {
210
217
  onClick: function onClick() {
211
218
  return handleResolve('approve');
212
219
  }
213
- }, spec.actionLabel)) : null);
220
+ }, spec.actionLabel))) : null);
214
221
  }
215
222
  Approval.displayName = 'Approval';
216
223
  export default Approval;
@@ -227,11 +227,30 @@
227
227
  }
228
228
 
229
229
  [data-odn-approval-actions] {
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: space-between;
233
+ gap: 8px;
234
+ flex-shrink: 0;
235
+ }
236
+
237
+ [data-odn-approval-actions-hint] {
238
+ min-width: 0;
239
+ flex: 1;
240
+ margin: 0;
241
+ font-size: 12px;
242
+ font-weight: 400;
243
+ line-height: 1.5;
244
+ color: var(--odn-color-black-9);
245
+ }
246
+
247
+ [data-odn-approval-actions-right] {
230
248
  display: flex;
231
249
  align-items: center;
232
250
  justify-content: flex-end;
233
251
  gap: 8px;
234
252
  flex-shrink: 0;
253
+ margin-left: auto;
235
254
  }
236
255
 
237
256
  [data-odn-approval][data-has-summary] [data-odn-approval-actions] {
@@ -1,10 +1,10 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import { useState, useRef, useEffect, useLayoutEffect, useMemo } from 'react';
4
- import HoverFill from "../hover-fill";
5
- import Icon from "../icon";
3
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6
4
  import Dialog from "../dialog";
7
5
  import Dropdown from "../dropdown";
6
+ import HoverFill from "../hover-fill";
7
+ import Icon from "../icon";
8
8
  import { formatRelativeTime } from "./relative-time";
9
9
  import "./style";
10
10
  var STATUS_ARIA_LABEL = {
@@ -15,9 +15,15 @@ var STATUS_ARIA_LABEL = {
15
15
  };
16
16
  var ELLIPSIS = '…';
17
17
 
18
+ /** 可用宽度变化小于该值时跳过重算(与二分容差同量级) */
19
+ var FIT_WIDTH_EPS = 0.5;
20
+
18
21
  /**
19
22
  * 有 trailing(客服 icon / status / 时间)时,用 DOM 实测把标题裁到可用宽度。
20
23
  * 解决 CSS text-overflow 按字符边界截断后,省略号右侧留白把 trailing 顶开的问题。
24
+ *
25
+ * 性能:只监听整行(btn)宽度;RO 回调经 rAF 合并(每行每帧最多 fit 一次);
26
+ * 缓存 maxWidth / trailingWidth / 裁切结果,宽度几乎不变或结果不变则跳过更新。
21
27
  */
22
28
  function useFittedTitle(title, enabled, labelRef, titleRef, /** 右对齐区(状态 / 时间),量宽预留 */
23
29
  trailingRef, /** 紧跟标题的类型 icon,量宽预留 */
@@ -27,7 +33,7 @@ typeIconRef) {
27
33
  fitted = _useState2[0],
28
34
  setFitted = _useState2[1];
29
35
  useLayoutEffect(function () {
30
- var _document$fonts;
36
+ var _document$fonts, _label$closest;
31
37
  if (!enabled) {
32
38
  setFitted(title);
33
39
  return;
@@ -36,6 +42,10 @@ typeIconRef) {
36
42
  var titleEl = titleRef.current;
37
43
  if (!label || !titleEl) return;
38
44
  var cancelled = false;
45
+ var rafId = 0;
46
+ var lastMaxWidth = Number.NaN;
47
+ var lastTrailingWidth = Number.NaN;
48
+ var lastFitted = '';
39
49
  var probe = document.createElement('span');
40
50
  probe.setAttribute('aria-hidden', 'true');
41
51
  probe.style.cssText = 'position:absolute;visibility:hidden;pointer-events:none;white-space:nowrap;left:-9999px;top:0;';
@@ -67,39 +77,53 @@ typeIconRef) {
67
77
  // 标题两侧可能各有一段 gap:title↔type、type/title↔trailing
68
78
  var gapCount = (typeWidth > 0 ? 1 : 0) + (trailingWidth > 0 ? 1 : 0);
69
79
  var maxWidth = Math.max(0, label.getBoundingClientRect().width - trailingWidth - typeWidth - gap * gapCount);
70
- if (measure(title) <= maxWidth + 0.5) {
71
- setFitted(title);
80
+ if (Number.isFinite(lastMaxWidth) && Math.abs(maxWidth - lastMaxWidth) < FIT_WIDTH_EPS && Math.abs(trailingWidth - lastTrailingWidth) < FIT_WIDTH_EPS) {
72
81
  return;
73
82
  }
74
- var lo = 0;
75
- var hi = title.length;
76
- var best = ELLIPSIS;
77
- while (lo <= hi) {
78
- var mid = lo + hi >> 1;
79
- var candidate = "".concat(title.slice(0, mid)).concat(ELLIPSIS);
80
- if (measure(candidate) <= maxWidth + 0.5) {
81
- best = candidate;
82
- lo = mid + 1;
83
- } else {
84
- hi = mid - 1;
83
+ lastMaxWidth = maxWidth;
84
+ lastTrailingWidth = trailingWidth;
85
+ var next = title;
86
+ if (measure(title) > maxWidth + FIT_WIDTH_EPS) {
87
+ var lo = 0;
88
+ var hi = title.length;
89
+ next = ELLIPSIS;
90
+ while (lo <= hi) {
91
+ var mid = lo + hi >> 1;
92
+ var candidate = "".concat(title.slice(0, mid)).concat(ELLIPSIS);
93
+ if (measure(candidate) <= maxWidth + FIT_WIDTH_EPS) {
94
+ next = candidate;
95
+ lo = mid + 1;
96
+ } else {
97
+ hi = mid - 1;
98
+ }
85
99
  }
86
100
  }
87
- setFitted(best);
101
+ if (next === lastFitted) return;
102
+ lastFitted = next;
103
+ setFitted(next);
104
+ };
105
+ var scheduleFit = function scheduleFit() {
106
+ if (cancelled || rafId) return;
107
+ rafId = window.requestAnimationFrame(function () {
108
+ rafId = 0;
109
+ fit();
110
+ });
88
111
  };
112
+
113
+ // 首屏同步裁切,避免首帧闪全标题;后续宽度变化走 rAF 合并
89
114
  fit();
90
115
  void ((_document$fonts = document.fonts) === null || _document$fonts === void 0 ? void 0 : _document$fonts.ready.then(function () {
91
- if (!cancelled) fit();
116
+ if (cancelled) return;
117
+ // 字体就绪后字形宽度可能变,需绕过 maxWidth 缓存强制重测
118
+ lastMaxWidth = Number.NaN;
119
+ scheduleFit();
92
120
  }));
93
- var ro = new ResizeObserver(fit);
94
- ro.observe(label);
95
- var trailing = trailingRef.current;
96
- if (trailing) ro.observe(trailing);
97
- var typeIcon = typeIconRef.current;
98
- if (typeIcon) ro.observe(typeIcon);
99
- var btn = label.closest('[data-odn-chat-item-btn]');
100
- if (btn) ro.observe(btn);
121
+ var row = (_label$closest = label.closest('[data-odn-chat-item-btn]')) !== null && _label$closest !== void 0 ? _label$closest : label;
122
+ var ro = new ResizeObserver(scheduleFit);
123
+ ro.observe(row);
101
124
  return function () {
102
125
  cancelled = true;
126
+ if (rafId) window.cancelAnimationFrame(rafId);
103
127
  ro.disconnect();
104
128
  probe.remove();
105
129
  };
@@ -219,7 +243,7 @@ export function ChatItem(_ref2) {
219
243
  var showStatus = Boolean(status && (!active || status === 'generating' || status === 'waiting'));
220
244
  var showTypeIcon = type === 'human';
221
245
  var timeLabel = useMemo(function () {
222
- return time == null ? '' : formatRelativeTime(time, now);
246
+ return time === null || time === undefined ? '' : formatRelativeTime(time, now);
223
247
  }, [time, now]);
224
248
  var showTime = Boolean(timeLabel);
225
249
  var showTrailing = showStatus || showTime;
@@ -240,7 +264,7 @@ export function ChatItem(_ref2) {
240
264
 
241
265
  // 相对时间每分钟刷新一次(有 time 时)
242
266
  useEffect(function () {
243
- if (time == null) return;
267
+ if (time === null || time === undefined) return;
244
268
  var id = window.setInterval(function () {
245
269
  return setNow(Date.now());
246
270
  }, 60000);
@@ -13,5 +13,9 @@ export interface AutoHeightProps extends React.HTMLAttributes<HTMLDivElement> {
13
13
  }
14
14
  /**
15
15
  * 只动画「题面内容」的高度与透明度;卡面描边应由外层稳定承载,勿把整卡塞进来做 opacity。
16
+ *
17
+ * Drawer / keepMounted 注意:关闭时父级可能暂时量到 0 高。若此时把
18
+ * `readyRef` 钉死或把 outer 压成 0,重开后不再测量就会「只剩底栏」。
19
+ * 因此:未就绪时忽略 0 高;已就绪时忽略「从正高塌到 0」;重现正高时再同步。
16
20
  */
17
21
  export declare function AutoHeight({ children, anchor, contentKey, style, ...props }: AutoHeightProps): React.JSX.Element;
@@ -20,6 +20,10 @@ var HEIGHT_EPS = 0.5;
20
20
  var EASING = 'ease-in-out';
21
21
  /**
22
22
  * 只动画「题面内容」的高度与透明度;卡面描边应由外层稳定承载,勿把整卡塞进来做 opacity。
23
+ *
24
+ * Drawer / keepMounted 注意:关闭时父级可能暂时量到 0 高。若此时把
25
+ * `readyRef` 钉死或把 outer 压成 0,重开后不再测量就会「只剩底栏」。
26
+ * 因此:未就绪时忽略 0 高;已就绪时忽略「从正高塌到 0」;重现正高时再同步。
23
27
  */
24
28
  export function AutoHeight(_ref) {
25
29
  var children = _ref.children,
@@ -58,6 +62,11 @@ export function AutoHeight(_ref) {
58
62
  outer.style.transition = "height ".concat(HEIGHT_MS, "ms ").concat(EASING);
59
63
  outer.style.height = "".concat(target, "px");
60
64
  };
65
+
66
+ /** 父级隐藏 / 尚未布局时常见 0 高,不能当作有效题面高度。 */
67
+ var isCollapsedMeasure = function isCollapsedMeasure(h) {
68
+ return h < HEIGHT_EPS;
69
+ };
61
70
  useLayoutEffect(function () {
62
71
  var outer = outerRef.current;
63
72
  var current = currentRef.current;
@@ -67,16 +76,20 @@ export function AutoHeight(_ref) {
67
76
  };
68
77
  var onTransitionEnd = function onTransitionEnd(e) {
69
78
  if (e.target !== outer || e.propertyName !== 'height') return;
70
- if (outgoing != null) return;
79
+ if (outgoing !== null && outgoing !== undefined) return;
71
80
  animatingRef.current = false;
72
- finishHeight(outer, measure());
81
+ var h = measure();
82
+ if (!isCollapsedMeasure(h)) finishHeight(outer, h);
73
83
  };
74
84
  outer.addEventListener('transitionend', onTransitionEnd);
75
85
  if (!readyRef.current) {
76
86
  var h = measure();
77
- outer.style.height = "".concat(h, "px");
78
- heightRef.current = h;
79
- readyRef.current = true;
87
+ /* 抽屉刚挂载时常量到 0:先不 ready,等 ResizeObserver 拿到正高 */
88
+ if (!isCollapsedMeasure(h)) {
89
+ outer.style.height = "".concat(h, "px");
90
+ heightRef.current = h;
91
+ readyRef.current = true;
92
+ }
80
93
  prevKeyRef.current = contentKey;
81
94
  prevChildrenRef.current = children;
82
95
  return function () {
@@ -95,12 +108,20 @@ export function AutoHeight(_ref) {
95
108
  };
96
109
  }
97
110
  prevChildrenRef.current = children;
98
- if (outgoing != null || animatingRef.current) {
111
+ if (outgoing !== null && outgoing !== undefined || animatingRef.current) {
112
+ return function () {
113
+ return outer.removeEventListener('transitionend', onTransitionEnd);
114
+ };
115
+ }
116
+ var target = measure();
117
+ if (isCollapsedMeasure(target) && heightRef.current >= HEIGHT_EPS) {
99
118
  return function () {
100
119
  return outer.removeEventListener('transitionend', onTransitionEnd);
101
120
  };
102
121
  }
103
- runHeightOnly(outer, heightRef.current, measure());
122
+ if (!isCollapsedMeasure(target)) {
123
+ runHeightOnly(outer, heightRef.current, target);
124
+ }
104
125
  return function () {
105
126
  return outer.removeEventListener('transitionend', onTransitionEnd);
106
127
  };
@@ -111,7 +132,7 @@ export function AutoHeight(_ref) {
111
132
  * 有高度差时高度整段同步;等高只做显隐。旧层用不透明底盖住下层。
112
133
  */
113
134
  useLayoutEffect(function () {
114
- if (outgoing == null) return;
135
+ if (outgoing === null || outgoing === undefined) return;
115
136
  var outer = outerRef.current;
116
137
  var current = currentRef.current;
117
138
  var outEl = outgoingRef.current;
@@ -129,7 +150,7 @@ export function AutoHeight(_ref) {
129
150
  outEl.style.opacity = '1';
130
151
  }
131
152
  void outer.offsetHeight;
132
- if (heightChanged) {
153
+ if (heightChanged && !isCollapsedMeasure(target)) {
133
154
  outer.style.transition = "height ".concat(HEIGHT_MS, "ms ").concat(EASING);
134
155
  outer.style.height = "".concat(target, "px");
135
156
  }
@@ -147,7 +168,8 @@ export function AutoHeight(_ref) {
147
168
  var doneTimer = window.setTimeout(function () {
148
169
  setOutgoing(null);
149
170
  animatingRef.current = false;
150
- finishHeight(outer, current.getBoundingClientRect().height);
171
+ var h = current.getBoundingClientRect().height;
172
+ if (!isCollapsedMeasure(h)) finishHeight(outer, h);
151
173
  current.style.transition = '';
152
174
  current.style.opacity = '1';
153
175
  if (outEl) {
@@ -167,15 +189,27 @@ export function AutoHeight(_ref) {
167
189
  if (!current || !outer || typeof ResizeObserver === 'undefined') return;
168
190
  var onTransitionEnd = function onTransitionEnd(e) {
169
191
  if (e.target !== outer || e.propertyName !== 'height') return;
170
- if (outgoing != null) return;
192
+ if (outgoing !== null && outgoing !== undefined) return;
171
193
  animatingRef.current = false;
172
- finishHeight(outer, current.getBoundingClientRect().height);
194
+ var h = current.getBoundingClientRect().height;
195
+ if (!isCollapsedMeasure(h)) finishHeight(outer, h);
173
196
  };
174
197
  outer.addEventListener('transitionend', onTransitionEnd);
175
198
  var ro = new ResizeObserver(function () {
176
- if (animatingRef.current || outgoing != null) return;
177
- if (!readyRef.current) return;
199
+ if (animatingRef.current || outgoing !== null && outgoing !== undefined) return;
178
200
  var target = current.getBoundingClientRect().height;
201
+ if (!readyRef.current) {
202
+ if (isCollapsedMeasure(target)) return;
203
+ finishHeight(outer, target);
204
+ readyRef.current = true;
205
+ return;
206
+ }
207
+
208
+ /* 父级隐藏时勿把已测好的正高塌成 0 */
209
+ if (isCollapsedMeasure(target) && heightRef.current >= HEIGHT_EPS) {
210
+ return;
211
+ }
212
+ if (isCollapsedMeasure(target)) return;
179
213
  var start = heightRef.current;
180
214
  if (Math.abs(start - target) < HEIGHT_EPS) return;
181
215
  runHeightOnly(outer, start, target);
@@ -199,7 +233,7 @@ export function AutoHeight(_ref) {
199
233
  justifyContent: anchor === 'bottom' ? 'flex-end' : 'flex-start',
200
234
  background: 'transparent'
201
235
  }, style)
202
- }, props), outgoing != null ? /*#__PURE__*/React.createElement("div", {
236
+ }, props), outgoing !== null && outgoing !== undefined ? /*#__PURE__*/React.createElement("div", {
203
237
  ref: outgoingRef,
204
238
  "data-odn-clarify-auto-height-outgoing": true,
205
239
  "aria-hidden": true,
@@ -12,7 +12,7 @@ export interface ClarifyDockQuestion {
12
12
  input: ClarifyInput;
13
13
  /**
14
14
  * 是否允许跳过;默认 true。
15
- * 跳过后由 AI 按默认继续,UI 不展示具体默认值。
15
+ * 跳过后由 Agent 推断执行,UI 不展示具体推断值。
16
16
  */
17
17
  skippable?: boolean;
18
18
  }
@@ -40,7 +40,7 @@ export interface ClarifyDockResolvePayload {
40
40
  items: ClarifyDockAnswerItem[];
41
41
  }
42
42
  /** 锁态 / 回看提示:跳过题统一文案(不展示 AI 默认选项)。 */
43
- export declare const CLARIFY_DOCK_SKIPPED_LABEL = "\u5DF2\u8DF3\u8FC7\uFF0C\u6309\u9ED8\u8BA4\u9009\u9879\u7EE7\u7EED";
43
+ export declare const CLARIFY_DOCK_SKIPPED_LABEL = "\u5DF2\u8DF3\u8FC7\uFF0C\u6309 Agent \u63A8\u65AD\u6267\u884C";
44
44
  /** data[key] 哨兵:表示本题跳过,默认由模型侧决定。 */
45
45
  export declare const CLARIFY_DOCK_SKIPPED_VALUE = "__skipped__";
46
46
  /** Host 消息最小形状——hook 只认 assistant + clarify-dock instance。 */
@@ -46,7 +46,7 @@ export { parseClarifyBoundDate, toISODate } from "./types";
46
46
  /** 整卷提交:自然语言摘要 + 结构化 data + 锁态小票行。 */
47
47
 
48
48
  /** 锁态 / 回看提示:跳过题统一文案(不展示 AI 默认选项)。 */
49
- export var CLARIFY_DOCK_SKIPPED_LABEL = '已跳过,按默认选项继续';
49
+ export var CLARIFY_DOCK_SKIPPED_LABEL = '已跳过,按 Agent 推断执行';
50
50
 
51
51
  /** data[key] 哨兵:表示本题跳过,默认由模型侧决定。 */
52
52
  export var CLARIFY_DOCK_SKIPPED_VALUE = '__skipped__';
@@ -525,11 +525,9 @@ export function ClarifyDockPanel(_ref2) {
525
525
  "data-odn-clarify-dock-q-row": true
526
526
  }, /*#__PURE__*/React.createElement("div", {
527
527
  "data-odn-clarify-dock-q": true
528
- }, question.label), input.kind === 'options' ? /*#__PURE__*/React.createElement("span", {
528
+ }, question.label, input.kind === 'options-multi' ? /*#__PURE__*/React.createElement("span", {
529
529
  "data-odn-clarify-dock-q-hint": true
530
- }, "\u5355\u9009") : input.kind === 'options-multi' ? /*#__PURE__*/React.createElement("span", {
531
- "data-odn-clarify-dock-q-hint": true
532
- }, "\u53EF\u591A\u9009") : null), /*#__PURE__*/React.createElement("div", {
530
+ }, "\uFF08\u53EF\u591A\u9009\uFF09") : null)), /*#__PURE__*/React.createElement("div", {
533
531
  "data-odn-clarify-dock-input-shell": true,
534
532
  "data-skipped": isSkipped ? '' : undefined
535
533
  }, /*#__PURE__*/React.createElement("div", {
@@ -85,13 +85,10 @@ div[data-odn-clarify-dock] [data-odn-clarify-dock-body] {
85
85
  [data-odn-clarify-dock-q-row] {
86
86
  display: flex;
87
87
  align-items: baseline;
88
- justify-content: space-between;
89
- gap: 12px;
90
88
  min-width: 0;
91
89
  }
92
90
 
93
91
  [data-odn-clarify-dock] [data-odn-clarify-dock-q] {
94
- flex: 1;
95
92
  min-width: 0;
96
93
  font-size: 14px;
97
94
  font-weight: 400;
@@ -100,11 +97,13 @@ div[data-odn-clarify-dock] [data-odn-clarify-dock-body] {
100
97
  margin: 0;
101
98
  }
102
99
 
100
+ /* 多选题干后缀(与题干同字号、同色);负 margin 收紧与问号间的全角留白 */
103
101
  [data-odn-clarify-dock-q-hint] {
104
- flex-shrink: 0;
105
- font-size: 12px;
106
- line-height: 1.5;
107
- color: var(--odn-color-black-8);
102
+ font-size: inherit;
103
+ line-height: inherit;
104
+ font-weight: inherit;
105
+ color: var(--odn-color-black-12);
106
+ margin-left: -0.6em;
108
107
  }
109
108
 
110
109
  /* ---------- 底栏 · 对齐 approval-actions(含顶部分割线) ---------- */
@@ -543,6 +542,21 @@ div[data-odn-clarify-dock] [data-odn-clarify-dock-body] {
543
542
  flex: 0 0 auto;
544
543
  }
545
544
 
545
+ /*
546
+ * 日期触发器收到与选项同级(13px / 高 32px)。
547
+ * 只改 container 内 input,弹层在 portal 外不受影响。
548
+ */
549
+ div[data-odn-clarify-dock] [data-odn-date-picker-container] {
550
+ width: 100%;
551
+ }
552
+
553
+ div[data-odn-clarify-dock] [data-odn-date-picker-input] {
554
+ height: 32px;
555
+ padding: 4px 32px 4px 10px;
556
+ font-size: 13px;
557
+ line-height: 1.5;
558
+ }
559
+
546
560
  /* ---------- 跳过态:任意录入形态共用蒙层 +「重新回答」 ---------- */
547
561
  [data-odn-clarify-dock-input-shell] {
548
562
  position: relative;
package/dist/index.d.ts CHANGED
@@ -1,85 +1,83 @@
1
1
  import './style';
2
- export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapse';
2
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './collapse';
3
3
  export { iconNames } from './icon';
4
4
  export type { IconName } from './icon';
5
- export { MessageReact16, Message, type MessageProps, type MessageIntent, type odnMessageState } from './message';
5
+ export { Message, MessageReact16, type MessageIntent, type MessageProps, type odnMessageState, } from './message';
6
6
  export { ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, } from './modal-base';
7
- export { type PopoverProps } from "./pop-base";
8
- export { MONTHS, convertDateToString, convertDateRangeToString, convertQuarterToString, convertMonthToString, convertYearToString, isDayAfter, isDayBefore, isSameDay, isSameMonth, isLegalDateString, isLegalDateRangeString, isLegalWeekString, isLegalQuarterString, isLegalMonthString, isLegalYearString, parseWeekStringToRange, parseQuarterStringToRange, parseMonthStringToRange, parseYearStringToRange, getDefaultMaxDate, getDefaultMinDate, getStartOfWeek, getEndOfWeek, getStartOfQuarter, getEndOfQuarter } from './_util/date';
9
- export { isLegalTimeString, isTimeAfter, isTimeBefore, isTimeEqual, timeToSeconds, secondsToTime } from './_util/time';
7
+ export { type PopoverProps } from './pop-base';
8
+ export { MONTHS, convertDateRangeToString, convertDateToString, convertMonthToString, convertQuarterToString, convertYearToString, getDefaultMaxDate, getDefaultMinDate, getEndOfQuarter, getEndOfWeek, getStartOfQuarter, getStartOfWeek, isDayAfter, isDayBefore, isLegalDateRangeString, isLegalDateString, isLegalMonthString, isLegalQuarterString, isLegalWeekString, isLegalYearString, isSameDay, isSameMonth, parseMonthStringToRange, parseQuarterStringToRange, parseWeekStringToRange, parseYearStringToRange, } from './_util/date';
9
+ export { isLegalTimeString, isTimeAfter, isTimeBefore, isTimeEqual, secondsToTime, timeToSeconds, } from './_util/time';
10
10
  export { default as Alert, type AlertProps, type AlertRef } from './alert';
11
- export { default as AutoComplete, type AutoCompleteProps } from './auto-complete';
11
+ export { default as AutoComplete, type AutoCompleteProps, } from './auto-complete';
12
12
  export { default as Avatar, type AvatarProps } from './avatar';
13
13
  export { default as Button, type ButtonProps } from './button';
14
14
  export { default as Calendar, type CalendarProps } from './calendar';
15
+ export { default as Card, type CardElevation, type CardHeaderProps, type CardHeaderSize, type CardProps, } from './card';
15
16
  export { default as Cascader, type CascaderProps } from './cascader';
16
- export { default as Card, type CardProps, type CardElevation, type CardHeaderProps, type CardHeaderSize } from './card';
17
17
  export { default as Chart, type ChartProps } from './chart';
18
- export { default as Checkbox, type CheckboxGroupProps, type CheckboxProps } from './checkbox';
19
- export { default as Collapse, type CollapseProps, type CollapseItem } from './collapse';
18
+ export { default as Checkbox, type CheckboxGroupProps, type CheckboxProps, } from './checkbox';
19
+ export { default as Collapse, type CollapseItem, type CollapseProps, } from './collapse';
20
20
  export { default as ColorPicker, type ColorPickerProps } from './color-picker';
21
- export { default as ConfigProvider, type ConfigConsumerProps, type ConfigProviderProps } from './config-provider';
21
+ export { default as ConfigProvider, type ConfigConsumerProps, type ConfigProviderProps, } from './config-provider';
22
22
  export { default as DatePicker, type DatePickerProps } from './date-picker';
23
- export { default as DateRangePicker, type DatePickerRangeProps } from './date-range-picker';
23
+ export { default as DateRangePicker, type DatePickerRangeProps, } from './date-range-picker';
24
24
  export { default as Dialog, type DialogProps } from './dialog';
25
25
  export { default as Drawer, type DrawerProps } from './drawer';
26
26
  export { default as Dropdown, type DropdownNormalProps, type DropdownProps, } from './dropdown';
27
- export { default as EllipsisText, type EllipsisTextProps } from './ellipsis-text';
28
- export { default as Empty, type EmptyProps, type EmptyType, type EmptySize } from './empty';
29
- export { default as Form, type FormProps, type FormItemProps } from './form';
30
- export { default as HoverFill, type HoverFillProps, type HoverFillState } from './hover-fill';
27
+ export { default as EllipsisText, type EllipsisTextProps, } from './ellipsis-text';
28
+ export { default as Empty, type EmptyProps, type EmptySize, type EmptyType, } from './empty';
29
+ export { default as Form, type FormItemProps, type FormProps } from './form';
30
+ export { default as HoverFill, type HoverFillProps, type HoverFillState, } from './hover-fill';
31
31
  export { default as Icon, type IconProps } from './icon';
32
32
  export { default as Image, type ImageProps } from './image';
33
33
  export { default as Input, type InputProps, type InputRef } from './input';
34
34
  export { default as InputNumber } from './input-number';
35
- export { default as InputOtp, type InputOtpProps, type InputOtpRef } from './input-otp';
35
+ export { default as InputOtp, type InputOtpProps, type InputOtpRef, } from './input-otp';
36
+ export { HuxuanLayout, MpLayout, RuyiLayout, type HuxuanActionItem, type HuxuanLayoutProps, type HuxuanNavChild, type HuxuanNavItem, type MpLayoutProps, type MpMenuItem, type MpSubTab, type MpTabItem, type RuyiLayoutProps, type RuyiMenuItem, } from './layout';
36
37
  export { default as Link, type LinkProps } from './link';
37
38
  export { default as Loading, type LoadingProps } from './loading';
38
- export { default as NumberFlow, type NumberFlowProps, type Format } from './number-flow';
39
+ export { default as NumberFlow, type Format, type NumberFlowProps, } from './number-flow';
39
40
  export { default as Pagination, type PaginationProps } from './pagination';
40
41
  export { default as Popover } from './popover';
41
- export { default as Radio, type RadioProps, type RadioGroupProps } from './radio';
42
- export { RuyiLayout, type RuyiLayoutProps, type RuyiMenuItem } from './layout';
43
- export { MpLayout, type MpLayoutProps, type MpMenuItem, type MpTabItem, type MpSubTab } from './layout';
44
- export { HuxuanLayout, type HuxuanLayoutProps, type HuxuanNavItem, type HuxuanNavChild, type HuxuanActionItem } from './layout';
45
- export { default as ScrollArea, type ScrollAreaProps, type ScrollAreaRef } from './scroll-area';
42
+ export { default as Radio, type RadioGroupProps, type RadioProps, } from './radio';
43
+ export { default as ScrollArea, type ScrollAreaProps, type ScrollAreaRef, } from './scroll-area';
46
44
  export { default as Select, type SelectProps, type TokenPasteResult, type TokenValidationItem, } from './select';
47
45
  export { default as Slider, type SliderProps } from './slider';
48
46
  export { default as Switch, type SwitchProps } from './switch';
47
+ export { default as Table, type ColumnType, type RowSelectionType, type TableProps, type TableRowExpansion, type TableRowSelection, type TableSortOrder, } from './table';
49
48
  export { default as Tabs } from './tabs';
49
+ export { default as TextSwap, type TextSwapFlipProps, type TextSwapProps, } from './text-swap';
50
50
  export { default as TimePicker, type TimePickerProps } from './time-picker';
51
- export { default as Table, type TableProps, type ColumnType, type TableSortOrder, type RowSelectionType, type TableRowSelection, type TableRowExpansion } from './table';
52
- export { default as TextSwap, type TextSwapProps, type TextSwapFlipProps } from './text-swap';
53
51
  export { default as Tooltip } from './tooltip';
54
- export { default as TreeSelect, type TreeSelectProps, type TreeNodeData } from './tree-select';
52
+ export { default as TreeSelect, type TreeNodeData, type TreeSelectProps, } from './tree-select';
55
53
  export { default as VirtualList, type VirtualListProps } from './virtual-list';
56
54
  export { default as ActionBar, type ActionBarProps } from './action-bar';
57
- export { default as AgentStep, type AgentStepProps, type AgentStepGroupProps } from './agent-step';
55
+ export { default as AgentStep, type AgentStepGroupProps, type AgentStepProps, } from './agent-step';
58
56
  export { default as AgentThink, type AgentThinkProps } from './agent-think';
59
- export { default as Approval, type ApprovalProps, type ApprovalSpec, type ApprovalDecision, type ApprovalResolvePayload, type ApprovalSummaryItem, } from './approval';
60
- export { ClarifyDockPanel, ClarifyDockTrigger, useClarifyDockState, clarifyDockLayoutId, CLARIFY_DOCK_MAX_OPTIONS, CLARIFY_DOCK_SKIPPED_LABEL, CLARIFY_DOCK_SKIPPED_VALUE, parseClarifyBoundDate, toISODate, type ClarifyDockPanelProps, type ClarifyDockTriggerProps, type ClarifyDockSpec, type ClarifyDockQuestion, type ClarifyDockAnswerItem, type ClarifyDockResolvePayload, type ClarifyDockMessageState, type ClarifyDockState, type ClarifyDockHostMessage, type ClarifyInput, type ClarifyOption, } from './clarify-dock';
57
+ export { APPROVAL_DEFAULT_ACTIONS_HINT, default as Approval, type ApprovalDecision, type ApprovalProps, type ApprovalResolvePayload, type ApprovalSpec, type ApprovalSummaryItem, } from './approval';
61
58
  export { default as Artifact, type ArtifactProps } from './artifact';
62
59
  export { default as Attachments, type AttachmentsProps } from './attachments';
60
+ export { default as ChatItem, formatRelativeTime, type ChatItemProps, } from './chat-item';
61
+ export { default as ChatList, matchChatListFilterTime, matchChatListFilterType, type ChatListFilterTime, type ChatListFilterType, type ChatListItem, type ChatListProps, } from './chat-list';
62
+ export { CLARIFY_DOCK_MAX_OPTIONS, CLARIFY_DOCK_SKIPPED_LABEL, CLARIFY_DOCK_SKIPPED_VALUE, ClarifyDockPanel, ClarifyDockTrigger, clarifyDockLayoutId, parseClarifyBoundDate, toISODate, useClarifyDockState, type ClarifyDockAnswerItem, type ClarifyDockHostMessage, type ClarifyDockMessageState, type ClarifyDockPanelProps, type ClarifyDockQuestion, type ClarifyDockResolvePayload, type ClarifyDockSpec, type ClarifyDockState, type ClarifyDockTriggerProps, type ClarifyInput, type ClarifyOption, } from './clarify-dock';
63
63
  export { default as CodeBlock, type CodeBlockProps } from './code-block';
64
- export { default as Composer, type ComposerProps, type ComposerRef, type ComposerToolConfig, type ComposerTool } from './composer';
65
- export { default as Invocation, InvocationParamPopover, type InvocationProps, type InvocationParamPopoverProps, } from './invocation';
64
+ export { default as Composer, type ComposerProps, type ComposerRef, type ComposerTool, type ComposerToolConfig, } from './composer';
66
65
  export { type ComposerParamPanelContext } from './composer/param-panel';
67
- export { default as Mention, type MentionProps } from './mention';
68
- export { default as ChatItem, formatRelativeTime, type ChatItemProps, } from './chat-item';
69
- export { default as ChatList, matchChatListFilterTime, matchChatListFilterType, type ChatListProps, type ChatListItem, type ChatListFilterTime, type ChatListFilterType, } from './chat-list';
70
- export { default as SkillSlot, type SkillSlotHandle, type SkillSlotProps } from './skill-slot';
71
66
  export { default as ErrorBlock, type ErrorBlockProps } from './error-block';
72
67
  export { default as Fab, type FabProps } from './fab';
73
- export { default as MessageImage, type MessageImageProps, type MessageImageItem } from './message-image';
74
- export { default as PreviewPanel, type PreviewPanelProps, type PreviewPanelActionTooltips } from './preview-panel';
68
+ export { default as Invocation, InvocationParamPopover, type InvocationParamPopoverProps, type InvocationProps, } from './invocation';
69
+ export { default as Mention, type MentionProps } from './mention';
70
+ export { default as MessageImage, type MessageImageItem, type MessageImageProps, } from './message-image';
71
+ export { default as PreviewPanel, type PreviewPanelActionTooltips, type PreviewPanelProps, } from './preview-panel';
72
+ export { default as Provenance, type ProvenanceProps, type ProvenanceType, } from './provenance';
73
+ export { default as SkillSlot, type SkillSlotHandle, type SkillSlotProps, } from './skill-slot';
75
74
  export { default as Sources, type SourcesProps } from './sources';
76
- export { default as Provenance, type ProvenanceProps, type ProvenanceType } from './provenance';
77
- export { default as StreamText, type StreamTextProps, type TypographyOverrides } from './stream-text';
78
75
  export { default as StreamPulse, type StreamPulseProps } from './stream-pulse';
76
+ export { default as StreamText, type StreamTextProps, type TypographyOverrides, } from './stream-text';
79
77
  export { default as Suggestions, type SuggestionsProps } from './suggestions';
80
78
  export { default as UserBubble, type UserBubbleProps } from './user-bubble';
81
79
  export { default as Welcome, type WelcomeProps } from './welcome';
82
- export type { ToolCall, ToolStatus, Source, Attachment, PreviewTarget, PreviewTab, SendMeta, ComposerSegment, ComposerTextSegment, ComposerInvocationSegment, ComposerMentionSegment, TextData, InvocationData, MentionData, InlineRefState, SkillItem, SkillGroup, AgentEvent, Conversation, MessageSnapshot, ChatMessage } from './_genui-types';
83
80
  export { ComposerSegmentType } from './_genui-types';
84
- export type { InterruptIntent, InterruptStatus, InterruptBase, } from './_interrupt-types';
85
- export { rawValueToSegments, segmentsToReadableText, segmentsHasContent, isTextSegment, isInvocationSegment, isMentionSegment, type SegmentsToReadableTextOptions, } from './composer/segments';
81
+ export type { AgentEvent, Attachment, ChatMessage, ComposerInvocationSegment, ComposerMentionSegment, ComposerSegment, ComposerTextSegment, Conversation, InlineRefState, InvocationData, MentionData, MessageSnapshot, PreviewTab, PreviewTarget, SendMeta, SkillGroup, SkillItem, Source, TextData, ToolCall, ToolStatus, } from './_genui-types';
82
+ export type { InterruptBase, InterruptIntent, InterruptStatus, } from './_interrupt-types';
83
+ export { isInvocationSegment, isMentionSegment, isTextSegment, rawValueToSegments, segmentsHasContent, segmentsToReadableText, type SegmentsToReadableTextOptions, } from './composer/segments';
package/dist/index.js CHANGED
@@ -7,17 +7,17 @@ if (!React.useInsertionEffect) {
7
7
  import "./style";
8
8
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapse";
9
9
  export { iconNames } from "./icon";
10
- export { MessageReact16, Message } from "./message";
10
+ export { Message, MessageReact16 } from "./message";
11
11
  export { ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalRoot, ModalTitle, ModalTrigger } from "./modal-base";
12
- export { MONTHS, convertDateToString, convertDateRangeToString, convertQuarterToString, convertMonthToString, convertYearToString, isDayAfter, isDayBefore, isSameDay, isSameMonth, isLegalDateString, isLegalDateRangeString, isLegalWeekString, isLegalQuarterString, isLegalMonthString, isLegalYearString, parseWeekStringToRange, parseQuarterStringToRange, parseMonthStringToRange, parseYearStringToRange, getDefaultMaxDate, getDefaultMinDate, getStartOfWeek, getEndOfWeek, getStartOfQuarter, getEndOfQuarter } from "./_util/date";
13
- export { isLegalTimeString, isTimeAfter, isTimeBefore, isTimeEqual, timeToSeconds, secondsToTime } from "./_util/time";
12
+ export { MONTHS, convertDateRangeToString, convertDateToString, convertMonthToString, convertQuarterToString, convertYearToString, getDefaultMaxDate, getDefaultMinDate, getEndOfQuarter, getEndOfWeek, getStartOfQuarter, getStartOfWeek, isDayAfter, isDayBefore, isLegalDateRangeString, isLegalDateString, isLegalMonthString, isLegalQuarterString, isLegalWeekString, isLegalYearString, isSameDay, isSameMonth, parseMonthStringToRange, parseQuarterStringToRange, parseWeekStringToRange, parseYearStringToRange } from "./_util/date";
13
+ export { isLegalTimeString, isTimeAfter, isTimeBefore, isTimeEqual, secondsToTime, timeToSeconds } from "./_util/time";
14
14
  export { default as Alert } from "./alert";
15
15
  export { default as AutoComplete } from "./auto-complete";
16
16
  export { default as Avatar } from "./avatar";
17
17
  export { default as Button } from "./button";
18
18
  export { default as Calendar } from "./calendar";
19
- export { default as Cascader } from "./cascader";
20
19
  export { default as Card } from "./card";
20
+ export { default as Cascader } from "./cascader";
21
21
  export { default as Chart } from "./chart";
22
22
  export { default as Checkbox } from "./checkbox";
23
23
  export { default as Collapse } from "./collapse";
@@ -37,23 +37,21 @@ export { default as Image } from "./image";
37
37
  export { default as Input } from "./input";
38
38
  export { default as InputNumber } from "./input-number";
39
39
  export { default as InputOtp } from "./input-otp";
40
+ export { HuxuanLayout, MpLayout, RuyiLayout } from "./layout";
40
41
  export { default as Link } from "./link";
41
42
  export { default as Loading } from "./loading";
42
43
  export { default as NumberFlow } from "./number-flow";
43
44
  export { default as Pagination } from "./pagination";
44
45
  export { default as Popover } from "./popover";
45
46
  export { default as Radio } from "./radio";
46
- export { RuyiLayout } from "./layout";
47
- export { MpLayout } from "./layout";
48
- export { HuxuanLayout } from "./layout";
49
47
  export { default as ScrollArea } from "./scroll-area";
50
48
  export { default as Select } from "./select";
51
49
  export { default as Slider } from "./slider";
52
50
  export { default as Switch } from "./switch";
53
- export { default as Tabs } from "./tabs";
54
- export { default as TimePicker } from "./time-picker";
55
51
  export { default as Table } from "./table";
52
+ export { default as Tabs } from "./tabs";
56
53
  export { default as TextSwap } from "./text-swap";
54
+ export { default as TimePicker } from "./time-picker";
57
55
  export { default as Tooltip } from "./tooltip";
58
56
  export { default as TreeSelect } from "./tree-select";
59
57
  export { default as VirtualList } from "./virtual-list";
@@ -62,30 +60,29 @@ export { default as VirtualList } from "./virtual-list";
62
60
  export { default as ActionBar } from "./action-bar";
63
61
  export { default as AgentStep } from "./agent-step";
64
62
  export { default as AgentThink } from "./agent-think";
65
- export { default as Approval } from "./approval";
66
- export { ClarifyDockPanel, ClarifyDockTrigger, useClarifyDockState, clarifyDockLayoutId, CLARIFY_DOCK_MAX_OPTIONS, CLARIFY_DOCK_SKIPPED_LABEL, CLARIFY_DOCK_SKIPPED_VALUE, parseClarifyBoundDate, toISODate } from "./clarify-dock";
63
+ export { APPROVAL_DEFAULT_ACTIONS_HINT, default as Approval } from "./approval";
67
64
  export { default as Artifact } from "./artifact";
68
65
  export { default as Attachments } from "./attachments";
69
- export { default as CodeBlock } from "./code-block";
70
- export { default as Composer } from "./composer";
71
- export { default as Invocation, InvocationParamPopover } from "./invocation";
72
- export { default as Mention } from "./mention";
73
66
  export { default as ChatItem, formatRelativeTime } from "./chat-item";
74
67
  export { default as ChatList, matchChatListFilterTime, matchChatListFilterType } from "./chat-list";
75
- export { default as SkillSlot } from "./skill-slot";
68
+ export { CLARIFY_DOCK_MAX_OPTIONS, CLARIFY_DOCK_SKIPPED_LABEL, CLARIFY_DOCK_SKIPPED_VALUE, ClarifyDockPanel, ClarifyDockTrigger, clarifyDockLayoutId, parseClarifyBoundDate, toISODate, useClarifyDockState } from "./clarify-dock";
69
+ export { default as CodeBlock } from "./code-block";
70
+ export { default as Composer } from "./composer";
76
71
  export { default as ErrorBlock } from "./error-block";
77
72
  export { default as Fab } from "./fab";
73
+ export { default as Invocation, InvocationParamPopover } from "./invocation";
74
+ export { default as Mention } from "./mention";
78
75
  export { default as MessageImage } from "./message-image";
79
76
  export { default as PreviewPanel } from "./preview-panel";
80
- export { default as Sources } from "./sources";
81
77
  export { default as Provenance } from "./provenance";
82
- export { default as StreamText } from "./stream-text";
78
+ export { default as SkillSlot } from "./skill-slot";
79
+ export { default as Sources } from "./sources";
83
80
  export { default as StreamPulse } from "./stream-pulse";
81
+ export { default as StreamText } from "./stream-text";
84
82
  export { default as Suggestions } from "./suggestions";
85
83
  export { default as UserBubble } from "./user-bubble";
86
84
  export { default as Welcome } from "./welcome";
87
85
 
88
86
  // GenUI shared modules
89
-
90
87
  export { ComposerSegmentType } from "./_genui-types";
91
- export { rawValueToSegments, segmentsToReadableText, segmentsHasContent, isTextSegment, isInvocationSegment, isMentionSegment } from "./composer/segments";
88
+ export { isInvocationSegment, isMentionSegment, isTextSegment, rawValueToSegments, segmentsHasContent, segmentsToReadableText } from "./composer/segments";
@@ -40,6 +40,7 @@ var TooltipGroup = function TooltipGroup(props) {
40
40
  children: child.props.children
41
41
  };
42
42
  }
43
+ return undefined;
43
44
  }).filter(Boolean);
44
45
  var _useState = useState(false),
45
46
  _useState2 = _slicedToArray(_useState, 2),
@@ -52,6 +53,14 @@ var TooltipGroup = function TooltipGroup(props) {
52
53
  var lastHoverIndex = useRef(hoverIndex);
53
54
  var hoverTimer = useRef(0);
54
55
  var tagRef = useRef(null);
56
+ var _useState5 = useState(0),
57
+ _useState6 = _slicedToArray(_useState5, 2),
58
+ offsetX = _useState6[0],
59
+ setOffsetX = _useState6[1];
60
+ var _useState7 = useState(0),
61
+ _useState8 = _slicedToArray(_useState7, 2),
62
+ offsetY = _useState8[0],
63
+ setOffsetY = _useState8[1];
55
64
  var handleMouseEnter = function handleMouseEnter(e, index) {
56
65
  clearTimeout(hoverTimer.current);
57
66
  var currentTarget = e.currentTarget;
@@ -95,20 +104,12 @@ var TooltipGroup = function TooltipGroup(props) {
95
104
  setOffsetY(offsetY);
96
105
  }, visible ? 0 : mouseEnterDelay * 1000);
97
106
  };
98
- var handleMouseLeave = function handleMouseLeave(e, index) {
107
+ var handleMouseLeave = function handleMouseLeave() {
99
108
  clearTimeout(hoverTimer.current);
100
109
  hoverTimer.current = window.setTimeout(function () {
101
110
  setVisible(false);
102
111
  }, 200);
103
112
  };
104
- var _useState5 = useState(0),
105
- _useState6 = _slicedToArray(_useState5, 2),
106
- offsetX = _useState6[0],
107
- setOffsetX = _useState6[1];
108
- var _useState7 = useState(0),
109
- _useState8 = _slicedToArray(_useState7, 2),
110
- offsetY = _useState8[0],
111
- setOffsetY = _useState8[1];
112
113
  useEffect(function () {
113
114
  if (lastHoverIndex.current !== hoverIndex) {
114
115
  lastHoverIndex.current = hoverIndex;
@@ -138,29 +139,29 @@ var TooltipGroup = function TooltipGroup(props) {
138
139
  popupStyle: _objectSpread(_objectSpread({}, popupStyle), {}, {
139
140
  transform: "translate(".concat(offsetX, "px, ").concat(offsetY, "px) scale(").concat(visible ? 1 : 0.8, ")")
140
141
  })
141
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, _objectSpread({
142
- ref: tagRef,
143
- children: tooltipInfos.map(function (info, index) {
144
- if ( /*#__PURE__*/React.isValidElement(info.children)) {
145
- var _ref2 = info.children.props,
146
- _onMouseEnter = _ref2.onMouseEnter,
147
- _onMouseLeave = _ref2.onMouseLeave,
148
- rest = _objectWithoutProperties(_ref2, _excluded2);
149
- return /*#__PURE__*/React.cloneElement(info.children, _objectSpread(_objectSpread({
150
- key: index
151
- }, rest), {}, {
152
- onMouseEnter: function onMouseEnter(e) {
153
- handleMouseEnter(e, index);
154
- _onMouseEnter === null || _onMouseEnter === void 0 || _onMouseEnter(e);
155
- },
156
- onMouseLeave: function onMouseLeave(e) {
157
- handleMouseLeave(e, index);
158
- _onMouseLeave === null || _onMouseLeave === void 0 || _onMouseLeave(e);
159
- }
160
- }));
161
- }
162
- })
163
- }, otherProps))));
142
+ }, /*#__PURE__*/React.createElement(Tag, _objectSpread({
143
+ ref: tagRef
144
+ }, otherProps), tooltipInfos.map(function (info, index) {
145
+ if ( /*#__PURE__*/React.isValidElement(info.children)) {
146
+ var _ref2 = info.children.props,
147
+ _onMouseEnter = _ref2.onMouseEnter,
148
+ _onMouseLeave = _ref2.onMouseLeave,
149
+ rest = _objectWithoutProperties(_ref2, _excluded2);
150
+ return /*#__PURE__*/React.cloneElement(info.children, _objectSpread(_objectSpread({
151
+ key: index
152
+ }, rest), {}, {
153
+ onMouseEnter: function onMouseEnter(e) {
154
+ handleMouseEnter(e, index);
155
+ _onMouseEnter === null || _onMouseEnter === void 0 || _onMouseEnter(e);
156
+ },
157
+ onMouseLeave: function onMouseLeave(e) {
158
+ handleMouseLeave();
159
+ _onMouseLeave === null || _onMouseLeave === void 0 || _onMouseLeave(e);
160
+ }
161
+ }));
162
+ }
163
+ return null;
164
+ })));
164
165
  };
165
166
  Tooltip.Group = TooltipGroup;
166
167
  Tooltip.displayName = 'Tooltip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one-design-next",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "description": "One Design Next from TAD@tencent.com",
5
5
  "license": "MIT",
6
6
  "type": "module",