@hkyhy/marsun-components-core 0.1.19 → 0.1.23

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.
Files changed (82) hide show
  1. package/dist/components/AgentHub/Chat/Detail/ChatAgentFab/index.d.ts +24 -0
  2. package/dist/components/AgentHub/Chat/Detail/ChatAgentFab/index.js +95 -0
  3. package/dist/components/AgentHub/Chat/Detail/ChatAgentFab/index.js.map +1 -0
  4. package/dist/components/AgentHub/Chat/Detail/ChatAgentFab/style.module.scss.js +15 -0
  5. package/dist/components/AgentHub/Chat/Detail/ChatAgentFab/style.module.scss.js.map +1 -0
  6. package/dist/components/AgentHub/Chat/Detail/ChatAgentFabLayout/index.d.ts +16 -0
  7. package/dist/components/AgentHub/Chat/Detail/ChatAgentFabLayout/index.js +37 -0
  8. package/dist/components/AgentHub/Chat/Detail/ChatAgentFabLayout/index.js.map +1 -0
  9. package/dist/components/AgentHub/Chat/Detail/ChatAgentFabLayout/style.module.scss.js +9 -0
  10. package/dist/components/AgentHub/Chat/Detail/ChatAgentFabLayout/style.module.scss.js.map +1 -0
  11. package/dist/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/index.d.ts +14 -0
  12. package/dist/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/index.js +79 -0
  13. package/dist/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/index.js.map +1 -0
  14. package/dist/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/style.module.scss.js +18 -0
  15. package/dist/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/style.module.scss.js.map +1 -0
  16. package/dist/components/AgentHub/Chat/Detail/ChatInput/index.d.ts +2 -0
  17. package/dist/components/AgentHub/Chat/Detail/ChatInput/index.js +60 -49
  18. package/dist/components/AgentHub/Chat/Detail/ChatInput/index.js.map +1 -1
  19. package/dist/components/AgentHub/Chat/Detail/ChatInput/style.module.scss.js +7 -6
  20. package/dist/components/AgentHub/Chat/Detail/ChatInput/style.module.scss.js.map +1 -1
  21. package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.d.ts +17 -4
  22. package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.js +104 -68
  23. package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.js.map +1 -1
  24. package/dist/components/AgentHub/Chat/Detail/ChatPanel/style.module.scss.js +13 -8
  25. package/dist/components/AgentHub/Chat/Detail/ChatPanel/style.module.scss.js.map +1 -1
  26. package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/index.js +5 -4
  27. package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/index.js.map +1 -1
  28. package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/style.module.scss.js +2 -2
  29. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/ChatWidgetSparkline.d.ts +7 -0
  30. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/ChatWidgetSparkline.js +55 -0
  31. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/ChatWidgetSparkline.js.map +1 -0
  32. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/index.d.ts +10 -0
  33. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/index.js +120 -0
  34. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/index.js.map +1 -0
  35. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/style.module.scss.js +32 -0
  36. package/dist/components/AgentHub/Chat/Detail/ChatWidgetBlock/style.module.scss.js.map +1 -0
  37. package/dist/components/AgentHub/Chat/Detail/CitationContent/style.module.scss.js +2 -2
  38. package/dist/components/AgentHub/Chat/Detail/MessageItem/index.js +130 -114
  39. package/dist/components/AgentHub/Chat/Detail/MessageItem/index.js.map +1 -1
  40. package/dist/components/AgentHub/Chat/Detail/MessageItem/style.module.scss.js +20 -18
  41. package/dist/components/AgentHub/Chat/Detail/MessageItem/style.module.scss.js.map +1 -1
  42. package/dist/components/AgentHub/Chat/Detail/index.d.ts +8 -0
  43. package/dist/components/AgentHub/Chat/hooks/index.d.ts +2 -0
  44. package/dist/components/AgentHub/Chat/hooks/useCitationPanel.d.ts +11 -0
  45. package/dist/components/AgentHub/Chat/hooks/useCitationPanel.js +22 -0
  46. package/dist/components/AgentHub/Chat/hooks/useCitationPanel.js.map +1 -0
  47. package/dist/components/AgentHub/types.d.ts +21 -0
  48. package/dist/components/Empty/Empty.d.ts +16 -0
  49. package/dist/components/Empty/Empty.js +33 -0
  50. package/dist/components/Empty/Empty.js.map +1 -0
  51. package/dist/components/Empty/index.d.ts +2 -0
  52. package/dist/components/Empty/style.module.scss.js +7 -0
  53. package/dist/components/Empty/style.module.scss.js.map +1 -0
  54. package/dist/components/Filter/FilterDatePicker/index.d.ts +31 -0
  55. package/dist/components/Filter/FilterDatePicker/index.js +128 -0
  56. package/dist/components/Filter/FilterDatePicker/index.js.map +1 -0
  57. package/dist/components/Filter/FilterDatePicker/style.module.scss.js +10 -0
  58. package/dist/components/Filter/FilterDatePicker/style.module.scss.js.map +1 -0
  59. package/dist/components/Filter/FilterDateRange/index.d.ts +11 -1
  60. package/dist/components/Filter/FilterDateRange/index.js +120 -70
  61. package/dist/components/Filter/FilterDateRange/index.js.map +1 -1
  62. package/dist/components/Filter/index.d.ts +3 -0
  63. package/dist/components/Icons/index.d.ts +3 -1
  64. package/dist/components/Icons/index.js +157 -151
  65. package/dist/components/Icons/index.js.map +1 -1
  66. package/dist/components/TooltipInfo/TooltipInfo.js +11 -10
  67. package/dist/components/TooltipInfo/TooltipInfo.js.map +1 -1
  68. package/dist/components/index.d.ts +1 -0
  69. package/dist/index.d.ts +3 -1
  70. package/dist/index.js +379 -355
  71. package/dist/index.js.map +1 -1
  72. package/dist/marsun-components-core.css +1 -1
  73. package/dist/styles/global.css +1 -1
  74. package/dist/theme/theme.js +1 -3
  75. package/dist/theme/theme.js.map +1 -1
  76. package/dist/utils/date.d.ts +12 -0
  77. package/dist/utils/date.js +29 -4
  78. package/dist/utils/date.js.map +1 -1
  79. package/dist/utils/pickerDate.d.ts +9 -0
  80. package/dist/utils/pickerDate.js +33 -0
  81. package/dist/utils/pickerDate.js.map +1 -0
  82. package/package.json +3 -1
@@ -0,0 +1,24 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface ChatAgentFabProps {
3
+ children?: ReactNode;
4
+ open?: boolean;
5
+ onOpenChange?: (open: boolean) => void;
6
+ fabLabel?: ReactNode;
7
+ openAriaLabel?: string;
8
+ closeAriaLabel?: string;
9
+ panelAriaLabel?: string;
10
+ closeOnClickOutside?: boolean;
11
+ className?: string;
12
+ fabClassName?: string;
13
+ panelClassName?: string;
14
+ panelBodyClassName?: string;
15
+ /** 展开引用侧栏等场景下加宽面板 */
16
+ panelExpanded?: boolean;
17
+ /** 全屏高度(宽度仍由 panelExpanded 控制) */
18
+ panelFullscreen?: boolean;
19
+ offsetRight?: number | string;
20
+ offsetBottom?: number | string;
21
+ zIndex?: number;
22
+ }
23
+ declare const ChatAgentFab: React.FC<ChatAgentFabProps>;
24
+ export default ChatAgentFab;
@@ -0,0 +1,95 @@
1
+ import { jsxs as L, jsx as c } from "react/jsx-runtime";
2
+ import r from "classnames";
3
+ import { useRef as R, useEffect as D } from "react";
4
+ import t from "./style.module.scss.js";
5
+ const q = ({
6
+ children: n,
7
+ open: a = !1,
8
+ onOpenChange: e,
9
+ fabLabel: i = "AI+",
10
+ openAriaLabel: d = "打开 AI 助手",
11
+ closeAriaLabel: m = "收起 AI 助手",
12
+ panelAriaLabel: u,
13
+ closeOnClickOutside: l = !0,
14
+ className: h,
15
+ fabClassName: g,
16
+ panelClassName: v,
17
+ panelBodyClassName: y,
18
+ panelExpanded: s = !1,
19
+ panelFullscreen: N = !1,
20
+ offsetRight: x = 24,
21
+ offsetBottom: A = 24,
22
+ zIndex: w = 1100
23
+ }) => {
24
+ const f = R(null);
25
+ D(() => {
26
+ if (!a || !l) return;
27
+ const b = (j) => {
28
+ var o;
29
+ const E = j.target;
30
+ (o = f.current) != null && o.contains(E) || e == null || e(!1);
31
+ };
32
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
33
+ }, [l, e, a]);
34
+ const I = {
35
+ right: x,
36
+ bottom: A,
37
+ zIndex: w
38
+ };
39
+ return /* @__PURE__ */ L(
40
+ "div",
41
+ {
42
+ ref: f,
43
+ className: r("chat-agent-fab", t["chat-agent-fab"], h),
44
+ style: I,
45
+ children: [
46
+ a ? /* @__PURE__ */ c(
47
+ "div",
48
+ {
49
+ className: r(
50
+ "chat-agent-fab-panel",
51
+ t["chat-agent-fab-panel"],
52
+ s && t["chat-agent-fab-panel--expanded"],
53
+ N && t["chat-agent-fab-panel--fullscreen"],
54
+ v
55
+ ),
56
+ role: "dialog",
57
+ "aria-label": u,
58
+ children: /* @__PURE__ */ c(
59
+ "div",
60
+ {
61
+ className: r(
62
+ "chat-agent-fab-panel-body",
63
+ t["chat-agent-fab-panel-body"],
64
+ s && t["chat-agent-fab-panel-body--expanded"],
65
+ y
66
+ ),
67
+ children: n
68
+ }
69
+ )
70
+ }
71
+ ) : null,
72
+ /* @__PURE__ */ c(
73
+ "button",
74
+ {
75
+ type: "button",
76
+ className: r(
77
+ "chat-agent-fab-button",
78
+ t["chat-agent-fab-button"],
79
+ a && t["chat-agent-fab-button--active"],
80
+ g
81
+ ),
82
+ "aria-label": a ? m : d,
83
+ "aria-expanded": a,
84
+ onClick: () => e == null ? void 0 : e(!a),
85
+ children: /* @__PURE__ */ c("span", { className: r("chat-agent-fab-icon", t["chat-agent-fab-icon"]), children: i })
86
+ }
87
+ )
88
+ ]
89
+ }
90
+ );
91
+ };
92
+ export {
93
+ q as default
94
+ };
95
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Chat/Detail/ChatAgentFab/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { useEffect, useRef, type CSSProperties, type ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport interface ChatAgentFabProps {\n children?: ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n fabLabel?: ReactNode;\n openAriaLabel?: string;\n closeAriaLabel?: string;\n panelAriaLabel?: string;\n closeOnClickOutside?: boolean;\n className?: string;\n fabClassName?: string;\n panelClassName?: string;\n panelBodyClassName?: string;\n /** 展开引用侧栏等场景下加宽面板 */\n panelExpanded?: boolean;\n /** 全屏高度(宽度仍由 panelExpanded 控制) */\n panelFullscreen?: boolean;\n offsetRight?: number | string;\n offsetBottom?: number | string;\n zIndex?: number;\n}\n\nconst ChatAgentFab: React.FC<ChatAgentFabProps> = ({\n children,\n open = false,\n onOpenChange,\n fabLabel = 'AI+',\n openAriaLabel = '打开 AI 助手',\n closeAriaLabel = '收起 AI 助手',\n panelAriaLabel,\n closeOnClickOutside = true,\n className,\n fabClassName,\n panelClassName,\n panelBodyClassName,\n panelExpanded = false,\n panelFullscreen = false,\n offsetRight = 24,\n offsetBottom = 24,\n zIndex = 1100,\n}) => {\n const rootRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open || !closeOnClickOutside) return;\n\n const handlePointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (rootRef.current?.contains(target)) return;\n onOpenChange?.(false);\n };\n\n document.addEventListener('mousedown', handlePointerDown);\n return () => document.removeEventListener('mousedown', handlePointerDown);\n }, [closeOnClickOutside, onOpenChange, open]);\n\n const rootStyle: CSSProperties = {\n right: offsetRight,\n bottom: offsetBottom,\n zIndex,\n };\n\n return (\n <div\n ref={rootRef}\n className={classNames('chat-agent-fab', styles['chat-agent-fab'], className)}\n style={rootStyle}\n >\n {open ? (\n <div\n className={classNames(\n 'chat-agent-fab-panel',\n styles['chat-agent-fab-panel'],\n panelExpanded && styles['chat-agent-fab-panel--expanded'],\n panelFullscreen && styles['chat-agent-fab-panel--fullscreen'],\n panelClassName,\n )}\n role=\"dialog\"\n aria-label={panelAriaLabel}\n >\n <div\n className={classNames(\n 'chat-agent-fab-panel-body',\n styles['chat-agent-fab-panel-body'],\n panelExpanded && styles['chat-agent-fab-panel-body--expanded'],\n panelBodyClassName,\n )}\n >\n {children}\n </div>\n </div>\n ) : null}\n\n <button\n type=\"button\"\n className={classNames(\n 'chat-agent-fab-button',\n styles['chat-agent-fab-button'],\n open && styles['chat-agent-fab-button--active'],\n fabClassName,\n )}\n aria-label={open ? closeAriaLabel : openAriaLabel}\n aria-expanded={open}\n onClick={() => onOpenChange?.(!open)}\n >\n <span className={classNames('chat-agent-fab-icon', styles['chat-agent-fab-icon'])}>\n {fabLabel}\n </span>\n </button>\n </div>\n );\n};\n\nexport default ChatAgentFab;\n"],"names":["ChatAgentFab","children","open","onOpenChange","fabLabel","openAriaLabel","closeAriaLabel","panelAriaLabel","closeOnClickOutside","className","fabClassName","panelClassName","panelBodyClassName","panelExpanded","panelFullscreen","offsetRight","offsetBottom","zIndex","rootRef","useRef","useEffect","handlePointerDown","event","target","_a","rootStyle","jsxs","classNames","styles","jsx"],"mappings":";;;;AA0BA,MAAMA,IAA4C,CAAC;AAAA,EACjD,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,eAAAC,IAAgB;AAAA,EAChB,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,iBAAAC,IAAkB;AAAA,EAClB,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AAAA,EACf,QAAAC,IAAS;AACX,MAAM;AACJ,QAAMC,IAAUC,EAAuB,IAAI;AAE3C,EAAAC,EAAU,MAAM;AACd,QAAI,CAAClB,KAAQ,CAACM,EAAqB;AAEnC,UAAMa,IAAoB,CAACC,MAAsB;;AAC/C,YAAMC,IAASD,EAAM;AACrB,OAAIE,IAAAN,EAAQ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AA,EAAe,CAACD;AAAA,YAE/B,UAAA,gBAAA2B,EAAC,UAAK,WAAWF,EAAW,uBAAuBC,EAAO,qBAAqB,CAAC,GAC7E,UAAAxB,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,15 @@
1
+ const a = {
2
+ "chat-agent-fab": "_chat-agent-fab_14yq1_1",
3
+ "chat-agent-fab-button": "_chat-agent-fab-button_14yq1_9",
4
+ "chat-agent-fab-button--active": "_chat-agent-fab-button--active_14yq1_24",
5
+ "chat-agent-fab-icon": "_chat-agent-fab-icon_14yq1_28",
6
+ "chat-agent-fab-panel": "_chat-agent-fab-panel_14yq1_34",
7
+ "chat-agent-fab-panel-body": "_chat-agent-fab-panel-body_14yq1_45",
8
+ "chat-agent-fab-panel--expanded": "_chat-agent-fab-panel--expanded_14yq1_50",
9
+ "chat-agent-fab-panel--fullscreen": "_chat-agent-fab-panel--fullscreen_14yq1_54",
10
+ "chat-agent-fab-panel-body--expanded": "_chat-agent-fab-panel-body--expanded_14yq1_59"
11
+ };
12
+ export {
13
+ a as default
14
+ };
15
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,16 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface ChatAgentFabLayoutProps {
3
+ /** ChatPanel 等主对话区 */
4
+ main: ReactNode;
5
+ /** 引用侧栏(通常为 CitationPanel) */
6
+ citationAside?: ReactNode;
7
+ className?: string;
8
+ mainClassName?: string;
9
+ citationAsideClassName?: string;
10
+ }
11
+ /**
12
+ * ChatAgentFab 内横向布局:主对话区 + 可选引用侧栏。
13
+ * 配合 ChatAgentFab.panelExpanded 在侧栏打开时加宽面板。
14
+ */
15
+ declare const ChatAgentFabLayout: React.FC<ChatAgentFabLayoutProps>;
16
+ export default ChatAgentFabLayout;
@@ -0,0 +1,37 @@
1
+ import { jsxs as i, jsx as l } from "react/jsx-runtime";
2
+ import a from "classnames";
3
+ import t from "./style.module.scss.js";
4
+ const r = ({
5
+ main: s,
6
+ citationAside: e,
7
+ className: o,
8
+ mainClassName: c,
9
+ citationAsideClassName: n
10
+ }) => /* @__PURE__ */ i("div", { className: a("chat-agent-fab-layout", t["chat-agent-fab-layout"], o), children: [
11
+ /* @__PURE__ */ l(
12
+ "div",
13
+ {
14
+ className: a(
15
+ "chat-agent-fab-layout-main",
16
+ t["chat-agent-fab-layout-main"],
17
+ c
18
+ ),
19
+ children: s
20
+ }
21
+ ),
22
+ e ? /* @__PURE__ */ l(
23
+ "div",
24
+ {
25
+ className: a(
26
+ "chat-agent-fab-layout-citation-aside",
27
+ t["chat-agent-fab-layout-citation-aside"],
28
+ n
29
+ ),
30
+ children: e
31
+ }
32
+ ) : null
33
+ ] });
34
+ export {
35
+ r as default
36
+ };
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Chat/Detail/ChatAgentFabLayout/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { type ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport interface ChatAgentFabLayoutProps {\n /** ChatPanel 等主对话区 */\n main: ReactNode;\n /** 引用侧栏(通常为 CitationPanel) */\n citationAside?: ReactNode;\n className?: string;\n mainClassName?: string;\n citationAsideClassName?: string;\n}\n\n/**\n * ChatAgentFab 内横向布局:主对话区 + 可选引用侧栏。\n * 配合 ChatAgentFab.panelExpanded 在侧栏打开时加宽面板。\n */\nconst ChatAgentFabLayout: React.FC<ChatAgentFabLayoutProps> = ({\n main,\n citationAside,\n className,\n mainClassName,\n citationAsideClassName,\n}) => (\n <div className={classNames('chat-agent-fab-layout', styles['chat-agent-fab-layout'], className)}>\n <div\n className={classNames(\n 'chat-agent-fab-layout-main',\n styles['chat-agent-fab-layout-main'],\n mainClassName,\n )}\n >\n {main}\n </div>\n {citationAside ? (\n <div\n className={classNames(\n 'chat-agent-fab-layout-citation-aside',\n styles['chat-agent-fab-layout-citation-aside'],\n citationAsideClassName,\n )}\n >\n {citationAside}\n </div>\n ) : null}\n </div>\n);\n\nexport default ChatAgentFabLayout;\n"],"names":["ChatAgentFabLayout","main","citationAside","className","mainClassName","citationAsideClassName","jsxs","classNames","styles","jsx"],"mappings":";;;AAkBA,MAAMA,IAAwD,CAAC;AAAA,EAC7D,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,wBAAAC;AACF,MACE,gBAAAC,EAAC,SAAI,WAAWC,EAAW,yBAAyBC,EAAO,uBAAuB,GAAGL,CAAS,GAC5F,UAAA;AAAA,EAAA,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACAC,EAAO,4BAA4B;AAAA,QACnCJ;AAAA,MAAA;AAAA,MAGD,UAAAH;AAAA,IAAA;AAAA,EAAA;AAAA,EAEFC,IACC,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACAC,EAAO,sCAAsC;AAAA,QAC7CH;AAAA,MAAA;AAAA,MAGD,UAAAH;AAAA,IAAA;AAAA,EAAA,IAED;AAAA,EAAA,CACN;"}
@@ -0,0 +1,9 @@
1
+ const a = {
2
+ "chat-agent-fab-layout": "_chat-agent-fab-layout_g7a1p_1",
3
+ "chat-agent-fab-layout-main": "_chat-agent-fab-layout-main_g7a1p_9",
4
+ "chat-agent-fab-layout-citation-aside": "_chat-agent-fab-layout-citation-aside_g7a1p_16"
5
+ };
6
+ export {
7
+ a as default
8
+ };
9
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,14 @@
1
+ export interface ChatFollowUpSuggestionsProps {
2
+ items: string[];
3
+ onSelect: (text: string) => void;
4
+ title?: string;
5
+ className?: string;
6
+ /** 列表区最大高度,超出后纵向滚动 */
7
+ maxListHeight?: number;
8
+ /** 是否可折叠,默认 true */
9
+ collapsible?: boolean;
10
+ /** 初始展开状态 */
11
+ defaultExpanded?: boolean;
12
+ }
13
+ declare const ChatFollowUpSuggestions: React.FC<ChatFollowUpSuggestionsProps>;
14
+ export default ChatFollowUpSuggestions;
@@ -0,0 +1,79 @@
1
+ import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
+ import { ChevronUp as w, ChevronDown as g, MessageCircle as N } from "../../../../Icons/index.js";
3
+ import n from "classnames";
4
+ import { useState as C } from "react";
5
+ import l from "./style.module.scss.js";
6
+ import x from "../../../../VirtualScrollbar/VirtualScrollbar/index.js";
7
+ const E = ({
8
+ items: s,
9
+ onSelect: i,
10
+ title: c = "推荐追问",
11
+ className: u,
12
+ maxListHeight: p = 132,
13
+ collapsible: o = !0,
14
+ defaultExpanded: h = !0
15
+ }) => {
16
+ const [r, d] = C(h);
17
+ if (!s.length) return null;
18
+ const m = () => {
19
+ o && d((e) => !e);
20
+ };
21
+ return /* @__PURE__ */ t(
22
+ "div",
23
+ {
24
+ className: n(
25
+ "chat-followup-suggestions",
26
+ l["chat-followup-suggestions"],
27
+ u
28
+ ),
29
+ children: [
30
+ c ? /* @__PURE__ */ t(
31
+ "button",
32
+ {
33
+ type: "button",
34
+ className: n(
35
+ l["chat-followup-header"],
36
+ o && l["chat-followup-header--collapsible"]
37
+ ),
38
+ onClick: m,
39
+ "aria-expanded": r,
40
+ disabled: !o,
41
+ children: [
42
+ /* @__PURE__ */ t("span", { className: l["chat-followup-title"], children: [
43
+ c,
44
+ /* @__PURE__ */ a("span", { className: l["chat-followup-count"], children: s.length })
45
+ ] }),
46
+ o ? r ? /* @__PURE__ */ a(w, { className: l["chat-followup-toggle"], "aria-hidden": !0 }) : /* @__PURE__ */ a(g, { className: l["chat-followup-toggle"], "aria-hidden": !0 }) : null
47
+ ]
48
+ }
49
+ ) : null,
50
+ r ? /* @__PURE__ */ a(
51
+ x,
52
+ {
53
+ wrapperClassName: l["chat-followup-list-scroll-wrapper"],
54
+ style: { maxHeight: p },
55
+ className: l["chat-followup-list-scroll"],
56
+ children: /* @__PURE__ */ a("div", { className: l["chat-followup-list"], children: s.map((e, f) => /* @__PURE__ */ t(
57
+ "button",
58
+ {
59
+ type: "button",
60
+ className: l["chat-followup-item"],
61
+ title: e,
62
+ onClick: () => i(e),
63
+ children: [
64
+ /* @__PURE__ */ a(N, { className: l["chat-followup-icon"], "aria-hidden": !0 }),
65
+ /* @__PURE__ */ a("span", { className: l["chat-followup-text"], children: e })
66
+ ]
67
+ },
68
+ `${f}-${e.slice(0, 24)}`
69
+ )) })
70
+ }
71
+ ) : null
72
+ ]
73
+ }
74
+ );
75
+ };
76
+ export {
77
+ E as default
78
+ };
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Chat/Detail/ChatFollowUpSuggestions/index.tsx"],"sourcesContent":["import { ChevronDown, ChevronUp, MessageCircle } from '@/components/Icons';\nimport { VirtualScrollbar } from '@/components/VirtualScrollbar';\nimport classNames from 'classnames';\nimport { useState } from 'react';\nimport styles from './style.module.scss';\n\nexport interface ChatFollowUpSuggestionsProps {\n items: string[];\n onSelect: (text: string) => void;\n title?: string;\n className?: string;\n /** 列表区最大高度,超出后纵向滚动 */\n maxListHeight?: number;\n /** 是否可折叠,默认 true */\n collapsible?: boolean;\n /** 初始展开状态 */\n defaultExpanded?: boolean;\n}\n\nconst ChatFollowUpSuggestions: React.FC<ChatFollowUpSuggestionsProps> = ({\n items,\n onSelect,\n title = '推荐追问',\n className,\n maxListHeight = 132,\n collapsible = true,\n defaultExpanded = true,\n}) => {\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n if (!items.length) return null;\n\n const toggleExpanded = () => {\n if (!collapsible) return;\n setExpanded((prev) => !prev);\n };\n\n return (\n <div\n className={classNames(\n 'chat-followup-suggestions',\n styles['chat-followup-suggestions'],\n className,\n )}\n >\n {title ? (\n <button\n type=\"button\"\n className={classNames(\n styles['chat-followup-header'],\n collapsible && styles['chat-followup-header--collapsible'],\n )}\n onClick={toggleExpanded}\n aria-expanded={expanded}\n disabled={!collapsible}\n >\n <span className={styles['chat-followup-title']}>\n {title}\n <span className={styles['chat-followup-count']}>{items.length}</span>\n </span>\n {collapsible ? (\n expanded ? (\n <ChevronUp className={styles['chat-followup-toggle']} aria-hidden />\n ) : (\n <ChevronDown className={styles['chat-followup-toggle']} aria-hidden />\n )\n ) : null}\n </button>\n ) : null}\n\n {expanded ? (\n <VirtualScrollbar\n wrapperClassName={styles['chat-followup-list-scroll-wrapper']}\n style={{ maxHeight: maxListHeight }}\n className={styles['chat-followup-list-scroll']}\n >\n <div className={styles['chat-followup-list']}>\n {items.map((text, index) => (\n <button\n key={`${index}-${text.slice(0, 24)}`}\n type=\"button\"\n className={styles['chat-followup-item']}\n title={text}\n onClick={() => onSelect(text)}\n >\n <MessageCircle className={styles['chat-followup-icon']} aria-hidden />\n <span className={styles['chat-followup-text']}>{text}</span>\n </button>\n ))}\n </div>\n </VirtualScrollbar>\n ) : null}\n </div>\n );\n};\n\nexport default ChatFollowUpSuggestions;\n"],"names":["ChatFollowUpSuggestions","items","onSelect","title","className","maxListHeight","collapsible","defaultExpanded","expanded","setExpanded","useState","toggleExpanded","prev","jsxs","classNames","styles","jsx","ChevronUp","ChevronDown","VirtualScrollbar","text","index","MessageCircle"],"mappings":";;;;;;AAmBA,MAAMA,IAAkE,CAAC;AAAA,EACvE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,aAAAC,IAAc;AAAA,EACd,iBAAAC,IAAkB;AACpB,MAAM;AACJ,QAAM,CAACC,GAAUC,CAAW,IAAIC,EA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ACL,WAAWE,EAAO,oBAAoB;AAAA,gBACtC,OAAOK;AAAA,gBACP,SAAS,MAAMlB,EAASkB,CAAI;AAAA,gBAE5B,UAAA;AAAA,kBAAA,gBAAAJ,EAACM,KAAc,WAAWP,EAAO,oBAAoB,GAAG,eAAW,IAAC;AAAA,oCACnE,QAAA,EAAK,WAAWA,EAAO,oBAAoB,GAAI,UAAAK,EAAA,CAAK;AAAA,gBAAA;AAAA,cAAA;AAAA,cAPhD,GAAGC,CAAK,IAAID,EAAK,MAAM,GAAG,EAAE,CAAC;AAAA,YAAA,CASrC,EAAA,CACH;AAAA,UAAA;AAAA,QAAA,IAEA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,18 @@
1
+ const l = {
2
+ "chat-followup-suggestions": "_chat-followup-suggestions_zqxm0_1",
3
+ "chat-followup-header": "_chat-followup-header_zqxm0_9",
4
+ "chat-followup-header--collapsible": "_chat-followup-header--collapsible_zqxm0_21",
5
+ "chat-followup-title": "_chat-followup-title_zqxm0_24",
6
+ "chat-followup-count": "_chat-followup-count_zqxm0_39",
7
+ "chat-followup-toggle": "_chat-followup-toggle_zqxm0_53",
8
+ "chat-followup-list-scroll-wrapper": "_chat-followup-list-scroll-wrapper_zqxm0_60",
9
+ "chat-followup-list-scroll": "_chat-followup-list-scroll_zqxm0_60",
10
+ "chat-followup-list": "_chat-followup-list_zqxm0_60",
11
+ "chat-followup-item": "_chat-followup-item_zqxm0_75",
12
+ "chat-followup-icon": "_chat-followup-icon_zqxm0_96",
13
+ "chat-followup-text": "_chat-followup-text_zqxm0_104"
14
+ };
15
+ export {
16
+ l as default
17
+ };
18
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -6,6 +6,8 @@ export interface ChatInputProps {
6
6
  onSend: () => void;
7
7
  onStop?: () => void;
8
8
  placeholder?: string;
9
+ /** 嵌入 ChatPanel 时去掉外层 border/padding,避免与 chat-panel-input 重复 */
10
+ embedded?: boolean;
9
11
  }
10
12
  declare const ChatInput: React.FC<ChatInputProps>;
11
13
  export default ChatInput;
@@ -1,65 +1,76 @@
1
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import { Pause as u, Send as d } from "../../../../Icons/index.js";
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import { Pause as u, Send as f } from "../../../../Icons/index.js";
3
3
  import { Input as y, Button as p } from "antd";
4
4
  import t from "./style.module.scss.js";
5
- import n from "classnames";
6
- const E = ({
5
+ import a from "classnames";
6
+ const C = ({
7
7
  value: e,
8
8
  loading: c,
9
9
  onChange: o,
10
10
  onSend: s,
11
11
  onStop: h,
12
- placeholder: m = "输入问题… Enter 发送,Shift+Enter 换行"
12
+ placeholder: m = "输入问题… Enter 发送,Shift+Enter 换行",
13
+ embedded: d = !1
13
14
  }) => {
14
15
  const l = (i) => {
15
16
  i.key === "Enter" && !i.shiftKey && (i.preventDefault(), !c && e.trim() && s());
16
17
  };
17
- return /* @__PURE__ */ r("div", { className: n("chat-input-root", t["chat-input-root"]), children: [
18
- /* @__PURE__ */ r("div", { className: n("chat-input-container", t["chat-input-container"]), children: [
19
- /* @__PURE__ */ a(
20
- y.TextArea,
21
- {
22
- value: e,
23
- onChange: (i) => o(i.target.value),
24
- onKeyDown: l,
25
- placeholder: m,
26
- autoSize: { minRows: 1, maxRows: 5 },
27
- disabled: c,
28
- variant: "borderless",
29
- className: n("chat-input-wrapper", t["chat-input-wrapper"])
30
- }
18
+ return /* @__PURE__ */ r(
19
+ "div",
20
+ {
21
+ className: a(
22
+ "chat-input-root",
23
+ t["chat-input-root"],
24
+ d && t["chat-input-root--embedded"]
31
25
  ),
32
- c ? /* @__PURE__ */ a(
33
- p,
34
- {
35
- type: "primary",
36
- danger: !0,
37
- icon: /* @__PURE__ */ a(u, {}),
38
- onClick: h,
39
- "aria-label": "停止生成",
40
- className: n("chat-input-inner", t["chat-input-inner"])
41
- }
42
- ) : /* @__PURE__ */ a(
43
- p,
44
- {
45
- type: "primary",
46
- icon: /* @__PURE__ */ a(d, {}),
47
- onClick: s,
48
- disabled: !e.trim(),
49
- className: n("chat-input-inner", t["chat-input-inner"])
50
- }
51
- )
52
- ] }),
53
- /* @__PURE__ */ r("div", { className: n("chat-input-header", t["chat-input-header"]), children: [
54
- /* @__PURE__ */ a("span", { className: n("chat-input-body", t["chat-input-body"]), children: "Enter 发送 · Shift+Enter 换行" }),
55
- e.length > 0 && /* @__PURE__ */ r("span", { className: n("chat-input-body", t["chat-input-body"]), children: [
56
- e.length,
57
- " 字"
58
- ] })
59
- ] })
60
- ] });
26
+ children: [
27
+ /* @__PURE__ */ r("div", { className: a("chat-input-container", t["chat-input-container"]), children: [
28
+ /* @__PURE__ */ n(
29
+ y.TextArea,
30
+ {
31
+ value: e,
32
+ onChange: (i) => o(i.target.value),
33
+ onKeyDown: l,
34
+ placeholder: m,
35
+ autoSize: { minRows: 1, maxRows: 5 },
36
+ disabled: c,
37
+ variant: "borderless",
38
+ className: a("chat-input-wrapper", t["chat-input-wrapper"])
39
+ }
40
+ ),
41
+ c ? /* @__PURE__ */ n(
42
+ p,
43
+ {
44
+ type: "primary",
45
+ danger: !0,
46
+ icon: /* @__PURE__ */ n(u, {}),
47
+ onClick: h,
48
+ "aria-label": "停止生成",
49
+ className: a("chat-input-inner", t["chat-input-inner"])
50
+ }
51
+ ) : /* @__PURE__ */ n(
52
+ p,
53
+ {
54
+ type: "primary",
55
+ icon: /* @__PURE__ */ n(f, {}),
56
+ onClick: s,
57
+ disabled: !e.trim(),
58
+ className: a("chat-input-inner", t["chat-input-inner"])
59
+ }
60
+ )
61
+ ] }),
62
+ /* @__PURE__ */ r("div", { className: a("chat-input-header", t["chat-input-header"]), children: [
63
+ /* @__PURE__ */ n("span", { className: a("chat-input-body", t["chat-input-body"]), children: "Enter 发送 · Shift+Enter 换行" }),
64
+ e.length > 0 && /* @__PURE__ */ r("span", { className: a("chat-input-body", t["chat-input-body"]), children: [
65
+ e.length,
66
+ " 字"
67
+ ] })
68
+ ] })
69
+ ]
70
+ }
71
+ );
61
72
  };
62
73
  export {
63
- E as default
74
+ C as default
64
75
  };
65
76
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Chat/Detail/ChatInput/index.tsx"],"sourcesContent":["import { Pause, Send } from '@/components/Icons';\nimport { Button, Input } from 'antd';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\nexport interface ChatInputProps {\n value: string;\n loading: boolean;\n onChange: (v: string) => void;\n onSend: () => void;\n onStop?: () => void;\n placeholder?: string;\n}\n\nconst ChatInput: React.FC<ChatInputProps> = ({\n value,\n loading,\n onChange,\n onSend,\n onStop,\n placeholder = '输入问题… Enter 发送,Shift+Enter 换行',\n}) => {\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (!loading && value.trim()) {\n onSend();\n }\n }\n };\n\n return (\n <div className={classNames('chat-input-root', styles['chat-input-root'])}>\n <div className={classNames('chat-input-container', styles['chat-input-container'])}>\n <Input.TextArea\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n autoSize={{ minRows: 1, maxRows: 5 }}\n disabled={loading}\n variant=\"borderless\"\n className={classNames('chat-input-wrapper', styles['chat-input-wrapper'])}\n />\n\n {loading ? (\n <Button\n type=\"primary\"\n danger\n icon={<Pause />}\n onClick={onStop}\n aria-label=\"停止生成\"\n className={classNames('chat-input-inner', styles['chat-input-inner'])}\n />\n ) : (\n <Button\n type=\"primary\"\n icon={<Send />}\n onClick={onSend}\n disabled={!value.trim()}\n className={classNames('chat-input-inner', styles['chat-input-inner'])}\n />\n )}\n </div>\n\n <div className={classNames('chat-input-header', styles['chat-input-header'])}>\n <span className={classNames('chat-input-body', styles['chat-input-body'])}>Enter 发送 · Shift+Enter 换行</span>\n {value.length > 0 && <span className={classNames('chat-input-body', styles['chat-input-body'])}>{value.length} 字</span>}\n </div>\n </div>\n );\n};\n\nexport default ChatInput;\n"],"names":["ChatInput","value","loading","onChange","onSend","onStop","placeholder","handleKeyDown","e","jsxs","classNames","styles","jsx","Input","Button","Pause","Send"],"mappings":";;;;;AAeA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAChB,MAAM;AACJ,QAAMC,IAAgB,CAACC,MAAgD;AACrE,IAAIA,EAAE,QAAQ,WAAW,CAACA,EAAE,aAC1BA,EAAE,eAAA,GACE,CAACN,KAAWD,EAAM,UACpBG,EAAA;AAAA,EAGN;AAEA,SACE,gBAAAK,EAAC,SAAI,WAAWC,EAAW,mBAAmBC,EAAO,iBAAiB,CAAC,GACrE,UAAA;AAAA,IAAA,gBAAAF,EAAC,SAAI,WAAWC,EAAW,wBAAwBC,EAAO,sBAAsB,CAAC,GAC/E,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC,EAAM;AAAA,QAAN;AAAA,UACC,OAAAZ;AAAA,UACA,UAAU,CAACO,MAAML,EAASK,EAAE,OAAO,KAAK;AAAA,UACxC,WAAWD;AAAA,UACX,aAAAD;AAAA,UACA,UAAU,EAAE,SAAS,GAAG,SAAS,EAAA;AAAA,UACjC,UAAUJ;AAAA,UACV,SAAQ;AAAA,UACR,WAAWQ,EAAW,sBAAsBC,EAAO,oBAAoB,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,MAGzET,IACC,gBAAAU;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,QAAM;AAAA,UACN,wBAAOC,GAAA,EAAM;AAAA,UACb,SAASV;AAAA,UACT,cAAW;AAAA,UACX,WAAWK,EAAW,oBAAoBC,EAAO,kBAAkB,CAAC;AAAA,QAAA;AAAA,MAAA,IAGtE,gBAAAC;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,wBAAOE,GAAA,EAAK;AAAA,UACZ,SAASZ;AAAA,UACT,UAAU,CAACH,EAAM,KAAA;AAAA,UACjB,WAAWS,EAAW,oBAAoBC,EAAO,kBAAkB,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IACtE,GAEJ;AAAA,IAEA,gBAAAF,EAAC,SAAI,WAAWC,EAAW,qBAAqBC,EAAO,mBAAmB,CAAC,GACzE,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWF,EAAW,mBAAmBC,EAAO,iBAAiB,CAAC,GAAG,UAAA,4BAAA,CAAyB;AAAA,MACnGV,EAAM,SAAS,KAAK,gBAAAQ,EAAC,QAAA,EAAK,WAAWC,EAAW,mBAAmBC,EAAO,iBAAiB,CAAC,GAAI,UAAA;AAAA,QAAAV,EAAM;AAAA,QAAO;AAAA,MAAA,EAAA,CAAE;AAAA,IAAA,EAAA,CAClH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Chat/Detail/ChatInput/index.tsx"],"sourcesContent":["import { Pause, Send } from '@/components/Icons';\nimport { Button, Input } from 'antd';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\nexport interface ChatInputProps {\n value: string;\n loading: boolean;\n onChange: (v: string) => void;\n onSend: () => void;\n onStop?: () => void;\n placeholder?: string;\n /** 嵌入 ChatPanel 时去掉外层 border/padding,避免与 chat-panel-input 重复 */\n embedded?: boolean;\n}\n\nconst ChatInput: React.FC<ChatInputProps> = ({\n value,\n loading,\n onChange,\n onSend,\n onStop,\n placeholder = '输入问题… Enter 发送,Shift+Enter 换行',\n embedded = false,\n}) => {\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (!loading && value.trim()) {\n onSend();\n }\n }\n };\n\n return (\n <div\n className={classNames(\n 'chat-input-root',\n styles['chat-input-root'],\n embedded && styles['chat-input-root--embedded'],\n )}\n >\n <div className={classNames('chat-input-container', styles['chat-input-container'])}>\n <Input.TextArea\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n autoSize={{ minRows: 1, maxRows: 5 }}\n disabled={loading}\n variant=\"borderless\"\n className={classNames('chat-input-wrapper', styles['chat-input-wrapper'])}\n />\n\n {loading ? (\n <Button\n type=\"primary\"\n danger\n icon={<Pause />}\n onClick={onStop}\n aria-label=\"停止生成\"\n className={classNames('chat-input-inner', styles['chat-input-inner'])}\n />\n ) : (\n <Button\n type=\"primary\"\n icon={<Send />}\n onClick={onSend}\n disabled={!value.trim()}\n className={classNames('chat-input-inner', styles['chat-input-inner'])}\n />\n )}\n </div>\n\n <div className={classNames('chat-input-header', styles['chat-input-header'])}>\n <span className={classNames('chat-input-body', styles['chat-input-body'])}>\n Enter 发送 · Shift+Enter 换行\n </span>\n {value.length > 0 && (\n <span className={classNames('chat-input-body', styles['chat-input-body'])}>\n {value.length} 字\n </span>\n )}\n </div>\n </div>\n );\n};\n\nexport default ChatInput;\n"],"names":["ChatInput","value","loading","onChange","onSend","onStop","placeholder","embedded","handleKeyDown","e","jsxs","classNames","styles","jsx","Input","Button","Pause","Send"],"mappings":";;;;;AAiBA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAgB,CAACC,MAAgD;AACrE,IAAIA,EAAE,QAAQ,WAAW,CAACA,EAAE,aAC1BA,EAAE,eAAA,GACE,CAACP,KAAWD,EAAM,UACpBG,E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,GAAG,UAAA,4BAAA,CAE3E;AAAA,UACCX,EAAM,SAAS,KACd,gBAAAS,EAAC,QAAA,EAAK,WAAWC,EAAW,mBAAmBC,EAAO,iBAAiB,CAAC,GACrE,UAAA;AAAA,YAAAX,EAAM;AAAA,YAAO;AAAA,UAAA,EAAA,CAChB;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,10 +1,11 @@
1
1
  const t = {
2
- "chat-input-root": "_chat-input-root_1iegn_1",
3
- "chat-input-container": "_chat-input-container_1iegn_12",
4
- "chat-input-wrapper": "_chat-input-wrapper_1iegn_28",
5
- "chat-input-inner": "_chat-input-inner_1iegn_34",
6
- "chat-input-header": "_chat-input-header_1iegn_50",
7
- "chat-input-body": "_chat-input-body_1iegn_59"
2
+ "chat-input-root": "_chat-input-root_1wd9x_1",
3
+ "chat-input-root--embedded": "_chat-input-root--embedded_1wd9x_12",
4
+ "chat-input-container": "_chat-input-container_1wd9x_18",
5
+ "chat-input-wrapper": "_chat-input-wrapper_1wd9x_38",
6
+ "chat-input-inner": "_chat-input-inner_1wd9x_54",
7
+ "chat-input-header": "_chat-input-header_1wd9x_70",
8
+ "chat-input-body": "_chat-input-body_1wd9x_79"
8
9
  };
9
10
  export {
10
11
  t as default
@@ -1 +1 @@
1
- {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ChatMessage } from '../../../types';
2
- import { default as React } from 'react';
2
+ import { default as React, ReactNode } from 'react';
3
3
  import { ChatInputProps } from '../ChatInput';
4
4
  import { MessageItemProps } from '../MessageItem';
5
5
  export interface ChatPanelProps {
@@ -8,9 +8,22 @@ export interface ChatPanelProps {
8
8
  showHeader?: boolean;
9
9
  showCloseButton?: boolean;
10
10
  onClose?: () => void;
11
- showSuggestions?: boolean;
12
- suggestions?: string[];
13
- onSuggestionClick?: (text: string) => void;
11
+ headerActions?: ReactNode;
12
+ headerExtra?: ReactNode;
13
+ beforeInput?: ReactNode;
14
+ /** API 返回的推荐问/追问列表 */
15
+ followUpItems?: string[];
16
+ /** 无用户消息且无 followUpItems 时的兜底推荐 */
17
+ starterItems?: string[];
18
+ /** 点击推荐项(完全自定义,优先于 onSendMessage) */
19
+ onFollowUpSelect?: (text: string) => void;
20
+ /** 点击推荐项直接发送(推荐问/追问默认行为) */
21
+ onSendMessage?: (text: string) => void;
22
+ /** true 时隐藏推荐区(如会话加载、发送中) */
23
+ followUpLoading?: boolean;
24
+ followUpDefaultExpanded?: boolean;
25
+ starterTitle?: string;
26
+ followUpTitle?: string;
14
27
  messages: ChatMessage[];
15
28
  showEmptyHint?: boolean;
16
29
  emptyPlaceholder?: string;