@myun/gimi-chat 0.0.7 → 0.0.9

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 (89) hide show
  1. package/dist/apis/useApi.d.ts +2 -0
  2. package/dist/apis/useApi.js +50 -2
  3. package/dist/components/ai-chat-dialogue/index.js +135 -181
  4. package/dist/components/ai-correction/index.js +25 -38
  5. package/dist/components/ai-loading/index.js +8 -12
  6. package/dist/components/answer-item/index.d.ts +3 -0
  7. package/dist/components/answer-item/index.js +126 -135
  8. package/dist/components/ask-card/index.js +33 -42
  9. package/dist/components/chat-input/extension/index.d.ts +2 -0
  10. package/dist/components/chat-input/extension/index.js +2 -0
  11. package/dist/components/chat-input/extension/keydown/index.d.ts +3 -0
  12. package/dist/components/chat-input/extension/keydown/index.js +37 -0
  13. package/dist/components/chat-input/extension/title-slot/Component.d.ts +4 -0
  14. package/dist/components/chat-input/extension/title-slot/Component.js +18 -0
  15. package/dist/components/chat-input/extension/title-slot/index.d.ts +3 -0
  16. package/dist/components/chat-input/extension/title-slot/index.js +47 -0
  17. package/dist/components/chat-input/extension/title-slot/index.less +22 -0
  18. package/dist/components/chat-input/index.d.ts +4 -0
  19. package/dist/components/chat-input/index.js +144 -145
  20. package/dist/components/chat-input/index.module.css +7 -0
  21. package/dist/components/chat-voice/VoiceCommunication.js +21 -23
  22. package/dist/components/chat-voice/VoiceRecord.js +21 -24
  23. package/dist/components/conversation-delete/index.js +8 -10
  24. package/dist/components/dots-loading/index.js +7 -10
  25. package/dist/components/empty/index.js +7 -12
  26. package/dist/components/excel-components/ExcelCard.js +3 -7
  27. package/dist/components/excel-components/ExcelExcuting.js +43 -60
  28. package/dist/components/excel-components/ExcelFailCard.js +10 -15
  29. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -1
  30. package/dist/components/excel-components/ExcelSuccessCard.js +13 -6
  31. package/dist/components/file-card/fileCardSidebar.js +17 -23
  32. package/dist/components/file-card/index.d.ts +3 -0
  33. package/dist/components/file-card/index.js +59 -69
  34. package/dist/components/file-card/index.module.css +1 -1
  35. package/dist/components/file-preview/index.js +62 -37
  36. package/dist/components/file-preview/index.module.css +33 -0
  37. package/dist/components/file-upload/index.js +7 -10
  38. package/dist/components/file-upload/uploadV1.js +27 -33
  39. package/dist/components/gimi-sidebar/index.js +13 -20
  40. package/dist/components/header/index.js +11 -18
  41. package/dist/components/iconfont-com/index.js +33 -12
  42. package/dist/components/index.d.ts +1 -1
  43. package/dist/components/index.js +1 -1
  44. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +22 -28
  45. package/dist/components/knowledge-trace/classList.js +28 -37
  46. package/dist/components/knowledge-trace/documentList.js +27 -36
  47. package/dist/components/knowledge-trace/index.js +21 -28
  48. package/dist/components/knowledge-trace/videoList.js +36 -46
  49. package/dist/components/lottie-img/index.js +8 -10
  50. package/dist/components/message-actions/CopyButton.d.ts +1 -1
  51. package/dist/components/message-actions/CopyButton.js +22 -25
  52. package/dist/components/message-actions/LikeButton.js +22 -25
  53. package/dist/components/message-actions/RegenerateButton.js +18 -21
  54. package/dist/components/message-actions/UnLikeButton.js +22 -25
  55. package/dist/components/message-actions/VoicePlay.js +22 -25
  56. package/dist/components/message-list/index.js +83 -87
  57. package/dist/components/no-microphone-root/index.js +29 -39
  58. package/dist/components/preset-agent-content/index.d.ts +1 -0
  59. package/dist/components/preset-agent-content/index.js +27 -20
  60. package/dist/components/quoted-content/index.d.ts +3 -0
  61. package/dist/components/quoted-content/index.js +271 -163
  62. package/dist/components/quoted-content/index.module.css +20 -0
  63. package/dist/components/reasoning-content/index.d.ts +3 -2
  64. package/dist/components/reasoning-content/index.js +50 -61
  65. package/dist/components/reference-content/index.js +62 -71
  66. package/dist/components/reference-content/index.module.css +1 -0
  67. package/dist/components/search-result/index.d.ts +7 -0
  68. package/dist/components/search-result/index.js +182 -0
  69. package/dist/components/search-result/index.module.css +235 -0
  70. package/dist/components/templates/CommonChat.js +75 -79
  71. package/dist/components/templates/GimiChatComponent.js +6 -13
  72. package/dist/components/templates/demo/demo.js +109 -103
  73. package/dist/components/upload-list/index.js +41 -56
  74. package/dist/components/voice-bars/index.js +19 -22
  75. package/dist/components/voice-check-dialog/index.js +17 -24
  76. package/dist/components/voice-recording/index.js +42 -57
  77. package/dist/components/work-flow-content/demo.js +1 -2
  78. package/dist/components/work-flow-content/index.js +8 -11
  79. package/dist/hooks/useChatActions.d.ts +1 -1
  80. package/dist/hooks/useChatActions.js +3 -1
  81. package/dist/hooks/useCommonChatAPI.d.ts +2 -1
  82. package/dist/hooks/useCommonChatAPI.js +10 -8
  83. package/dist/hooks/useQuoted.d.ts +12 -0
  84. package/dist/hooks/useQuoted.js +202 -0
  85. package/dist/utils/aes.d.ts +21 -0
  86. package/dist/utils/aes.js +61 -0
  87. package/dist/utils/chatInputUtil.d.ts +1 -1
  88. package/dist/utils/chatInputUtil.js +4 -3
  89. package/package.json +6 -2
@@ -17,9 +17,6 @@ import CopyButton from "../message-actions/CopyButton";
17
17
  import LikeButton from "../message-actions/LikeButton";
18
18
  import UnLikeButton from "../message-actions/UnLikeButton";
19
19
  import RegenerateButton from "../message-actions/RegenerateButton";
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
- import { Fragment as _Fragment } from "react/jsx-runtime";
23
20
  var AnswerItem = function AnswerItem(_ref) {
24
21
  var _agentDetail$voiceCon;
25
22
  var item = _ref.item,
@@ -38,6 +35,7 @@ var AnswerItem = function AnswerItem(_ref) {
38
35
  onLikeCallback = _ref.onLikeCallback,
39
36
  onUnLikeCallback = _ref.onUnLikeCallback,
40
37
  onRegenerateClick = _ref.onRegenerateClick,
38
+ onDownloadCallback = _ref.onDownloadCallback,
41
39
  _ref$enableCopy = _ref.enableCopy,
42
40
  enableCopy = _ref$enableCopy === void 0 ? true : _ref$enableCopy,
43
41
  _ref$enableLike = _ref.enableLike,
@@ -47,7 +45,9 @@ var AnswerItem = function AnswerItem(_ref) {
47
45
  _ref$enableRegenerate = _ref.enableRegenerate,
48
46
  enableRegenerate = _ref$enableRegenerate === void 0 ? true : _ref$enableRegenerate,
49
47
  _ref$enableVoicePlay = _ref.enableVoicePlay,
50
- enableVoicePlay = _ref$enableVoicePlay === void 0 ? true : _ref$enableVoicePlay;
48
+ enableVoicePlay = _ref$enableVoicePlay === void 0 ? true : _ref$enableVoicePlay,
49
+ reasoningTitle = _ref.reasoningTitle,
50
+ model = _ref.model;
51
51
  var isMsgRecieving = useAppSelector(function (state) {
52
52
  return state.gimiMenu.isMsgRecieving;
53
53
  });
@@ -81,136 +81,127 @@ var AnswerItem = function AnswerItem(_ref) {
81
81
  var agentDetail = useAppSelector(function (state) {
82
82
  return state.gimiMenu.agentObj || {};
83
83
  });
84
- return /*#__PURE__*/_jsx("div", {
85
- className: styles.title,
86
- children: /*#__PURE__*/_jsxs("div", {
87
- className: classNames(styles.answer),
88
- children: [item.mcp && /*#__PURE__*/_jsx(WorkFlowContent, {
89
- chatItem: item
90
- }), item.vipLevel === 1 && item.reasoningContent && /*#__PURE__*/_jsx(ReasoningContent, {
91
- item: item
92
- }), showTaskSuccess && /*#__PURE__*/_jsxs("div", {
93
- className: styles.completed,
94
- children: [/*#__PURE__*/_jsx(IconTickCircle, {
95
- className: styles.checkIcon
96
- }), /*#__PURE__*/_jsx("span", {
97
- className: styles.checkText,
98
- children: "\u672C\u6B21\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF01"
99
- })]
100
- }), showContentFlag && /*#__PURE__*/_jsx(MMarkdown, {
101
- content: processString(item.content || ''),
102
- customRender: [{
103
- type: 'excel',
104
- component: ExcelSuccessCard
105
- }, {
106
- type: 'knowledge',
107
- component: function component(value) {
108
- var newVal = {
109
- content: value.value,
110
- messageId: item.id
111
- };
112
- return /*#__PURE__*/_jsx(KnowledgeIconGroup, {
113
- value: newVal
114
- });
115
- }
116
- }, {
117
- type: 'correction',
118
- component: AICorrection
119
- }],
120
- showLoading: item.loading
121
- }), showAskTag && /*#__PURE__*/_jsx(AskCard, {
122
- item: item,
123
- moduleInfo: item.moduleInfo,
124
- handleClickAskList: handleClickAskList
125
- }), showSkillTag && /*#__PURE__*/_jsx(ExcelCard, {
126
- onRetry: onRetry,
127
- item: item,
128
- moduleInfo: item.moduleInfo,
129
- onSucess: onSucess,
130
- onFailure: onFailure
131
- }), item.stop === 1 && /*#__PURE__*/_jsx("div", {
132
- className: styles.stop,
133
- children: item.vipLevel === 1 && item.reasoningStatus === 3 ? '已停止推理' : '已停止内容输出'
134
- }), showOperation && /*#__PURE__*/_jsx("div", {
135
- className: styles.opera,
136
- children: (showOpera === null || showOpera === void 0 ? void 0 : showOpera(item.id)) && !item.loading && /*#__PURE__*/_jsxs("div", {
137
- className: styles.opera_item,
138
- children: [enableCopy && /*#__PURE__*/_jsx(CopyButton, {
139
- item: item,
140
- onCopyCallback: onCopyCallback
141
- }), enableLike && /*#__PURE__*/_jsx(LikeButton, {
142
- item: item,
143
- onLikeCallback: onLikeCallback
144
- }), enableUnLike && /*#__PURE__*/_jsx(UnLikeButton, {
145
- item: item,
146
- onUnLikeCallback: onUnLikeCallback
147
- }), enableVoicePlay && !showAskTag && !showSkillTag && ((_agentDetail$voiceCon = agentDetail.voiceConfigs) === null || _agentDetail$voiceCon === void 0 ? void 0 : _agentDetail$voiceCon.length) > 0 && /*#__PURE__*/_jsx(VoicePlay, {
148
- playTTSByText: playTTSByText,
149
- stopTTSByText: stopTTSByText,
150
- isVoicePlaying: isVoicePlaying,
151
- text: processString(item.content || ''),
152
- messageId: item.id
153
- }), showRegerate && enableRegenerate && /*#__PURE__*/_jsx(RegenerateButton, {
154
- onRegenerateClick: onRegenerateClick
155
- })]
156
- })
157
- }), (item.relatedResourceList || []).length > 0 && (showCommend === null || showCommend === void 0 ? void 0 : showCommend(item.id)) && /*#__PURE__*/_jsx("div", {
158
- className: styles.quickInputList,
159
- children: (item.relatedResourceList || []).map(function (item, index) {
160
- return /*#__PURE__*/_jsx("div", {
161
- className: styles.quickInputItem,
162
- onClick: function onClick() {
163
- return handleClickPromptWord === null || handleClickPromptWord === void 0 ? void 0 : handleClickPromptWord(item.recommendQuestions);
164
- },
165
- children: item.recommendQuestions
166
- }, index);
167
- })
168
- }), (item.relatedCourseRecommendation || []).length > 0 && /*#__PURE__*/_jsx(_Fragment, {
169
- children: /*#__PURE__*/_jsxs("div", {
170
- className: styles.course_recommend,
171
- children: [/*#__PURE__*/_jsxs("div", {
172
- className: styles.course_recommend_header,
173
- children: [/*#__PURE__*/_jsx("div", {
174
- className: styles.course_recommend_header_title,
175
- children: "\u76F8\u5173\u8BFE\u7A0B\u63A8\u8350"
176
- }), (item.relatedCourseRecommendation || []).length > 4 && /*#__PURE__*/_jsx("div", {
177
- className: styles.course_recommend_header_more,
178
- onClick: function onClick() {
179
- handleShowCourse(item);
180
- },
181
- children: /*#__PURE__*/_jsx("span", {
182
- className: styles.all,
183
- children: "\u5168\u90E8\u8BFE\u7A0B"
184
- })
185
- })]
186
- }), /*#__PURE__*/_jsx("div", {
187
- className: styles.course_recommend_list,
188
- children: (item.relatedCourseRecommendation || []).map(function (course, i) {
189
- if (i > 3) return null;
190
- return /*#__PURE__*/_jsxs("div", {
191
- className: styles.courseItem,
192
- onClick: function onClick() {
193
- return window.open(course.productType === 'project' ? "/project-product/".concat(course.productId || course.id) : "/new-product/".concat(course.productId || course.id));
194
- },
195
- children: [/*#__PURE__*/_jsx("div", {
196
- className: styles.cover,
197
- children: /*#__PURE__*/_jsx("img", {
198
- src: course.productUrl,
199
- alt: ""
200
- })
201
- }), /*#__PURE__*/_jsxs("div", {
202
- className: classNames(styles.courseTitle, 'ellipsis-3'),
203
- children: [course !== null && course !== void 0 && course.showStyle ? /*#__PURE__*/_jsx("span", {
204
- className: classNames(styles.newEquityLabel, styles["newEquityLabel-".concat(course.showStyle)]),
205
- children: course === null || course === void 0 ? void 0 : course.equityLabel
206
- }) : null, course.name]
207
- })]
208
- }, course.id);
209
- })
210
- })]
211
- })
212
- })]
213
- })
214
- });
84
+ return /*#__PURE__*/React.createElement("div", {
85
+ className: styles.title
86
+ }, /*#__PURE__*/React.createElement("div", {
87
+ className: classNames(styles.answer)
88
+ }, item.mcp && /*#__PURE__*/React.createElement(WorkFlowContent, {
89
+ chatItem: item
90
+ }), item.vipLevel === 1 && item.reasoningContent && /*#__PURE__*/React.createElement(ReasoningContent, {
91
+ reasoningTitle: reasoningTitle,
92
+ item: item
93
+ }), showTaskSuccess && /*#__PURE__*/React.createElement("div", {
94
+ className: styles.completed
95
+ }, /*#__PURE__*/React.createElement(IconTickCircle, {
96
+ className: styles.checkIcon
97
+ }), /*#__PURE__*/React.createElement("span", {
98
+ className: styles.checkText
99
+ }, "\u672C\u6B21\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF01")), showContentFlag && /*#__PURE__*/React.createElement(MMarkdown, {
100
+ content: processString(item.content || ''),
101
+ customRender: [{
102
+ type: 'excel',
103
+ component: function component(value) {
104
+ var newVal = {
105
+ content: value.value,
106
+ onDownloadCallback: onDownloadCallback,
107
+ model: model
108
+ };
109
+ return /*#__PURE__*/React.createElement(ExcelSuccessCard, {
110
+ value: newVal
111
+ });
112
+ }
113
+ }, {
114
+ type: 'knowledge',
115
+ component: function component(value) {
116
+ var newVal = {
117
+ content: value.value,
118
+ messageId: item.id
119
+ };
120
+ return /*#__PURE__*/React.createElement(KnowledgeIconGroup, {
121
+ value: newVal
122
+ });
123
+ }
124
+ }, {
125
+ type: 'correction',
126
+ component: AICorrection
127
+ }],
128
+ showLoading: item.loading
129
+ }), showAskTag && /*#__PURE__*/React.createElement(AskCard, {
130
+ item: item,
131
+ moduleInfo: item.moduleInfo,
132
+ handleClickAskList: handleClickAskList
133
+ }), showSkillTag && /*#__PURE__*/React.createElement(ExcelCard, {
134
+ onRetry: onRetry,
135
+ item: item,
136
+ moduleInfo: item.moduleInfo,
137
+ onSucess: onSucess,
138
+ onFailure: onFailure
139
+ }), item.stop === 1 && /*#__PURE__*/React.createElement("div", {
140
+ className: styles.stop
141
+ }, item.vipLevel === 1 && item.reasoningStatus === 3 ? '已停止推理' : '已停止内容输出'), showOperation && /*#__PURE__*/React.createElement("div", {
142
+ className: styles.opera
143
+ }, (showOpera === null || showOpera === void 0 ? void 0 : showOpera(item.id)) && !item.loading && /*#__PURE__*/React.createElement("div", {
144
+ className: styles.opera_item
145
+ }, enableCopy && /*#__PURE__*/React.createElement(CopyButton, {
146
+ item: item,
147
+ onCopyCallback: onCopyCallback
148
+ }), enableLike && /*#__PURE__*/React.createElement(LikeButton, {
149
+ item: item,
150
+ onLikeCallback: onLikeCallback
151
+ }), enableUnLike && /*#__PURE__*/React.createElement(UnLikeButton, {
152
+ item: item,
153
+ onUnLikeCallback: onUnLikeCallback
154
+ }), enableVoicePlay && !showAskTag && !showSkillTag && ((_agentDetail$voiceCon = agentDetail.voiceConfigs) === null || _agentDetail$voiceCon === void 0 ? void 0 : _agentDetail$voiceCon.length) > 0 && /*#__PURE__*/React.createElement(VoicePlay, {
155
+ playTTSByText: playTTSByText,
156
+ stopTTSByText: stopTTSByText,
157
+ isVoicePlaying: isVoicePlaying,
158
+ text: processString(item.content || ''),
159
+ messageId: item.id
160
+ }), showRegerate && enableRegenerate && /*#__PURE__*/React.createElement(RegenerateButton, {
161
+ onRegenerateClick: onRegenerateClick
162
+ }))), (item.relatedResourceList || []).length > 0 && (showCommend === null || showCommend === void 0 ? void 0 : showCommend(item.id)) && /*#__PURE__*/React.createElement("div", {
163
+ className: styles.quickInputList
164
+ }, (item.relatedResourceList || []).map(function (item, index) {
165
+ return /*#__PURE__*/React.createElement("div", {
166
+ className: styles.quickInputItem,
167
+ key: index,
168
+ onClick: function onClick() {
169
+ return handleClickPromptWord === null || handleClickPromptWord === void 0 ? void 0 : handleClickPromptWord(item.recommendQuestions);
170
+ }
171
+ }, item.recommendQuestions);
172
+ })), (item.relatedCourseRecommendation || []).length > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
173
+ className: styles.course_recommend
174
+ }, /*#__PURE__*/React.createElement("div", {
175
+ className: styles.course_recommend_header
176
+ }, /*#__PURE__*/React.createElement("div", {
177
+ className: styles.course_recommend_header_title
178
+ }, "\u76F8\u5173\u8BFE\u7A0B\u63A8\u8350"), (item.relatedCourseRecommendation || []).length > 4 && /*#__PURE__*/React.createElement("div", {
179
+ className: styles.course_recommend_header_more,
180
+ onClick: function onClick() {
181
+ handleShowCourse(item);
182
+ }
183
+ }, /*#__PURE__*/React.createElement("span", {
184
+ className: styles.all
185
+ }, "\u5168\u90E8\u8BFE\u7A0B"))), /*#__PURE__*/React.createElement("div", {
186
+ className: styles.course_recommend_list
187
+ }, (item.relatedCourseRecommendation || []).map(function (course, i) {
188
+ if (i > 3) return null;
189
+ return /*#__PURE__*/React.createElement("div", {
190
+ className: styles.courseItem,
191
+ key: course.id,
192
+ onClick: function onClick() {
193
+ return window.open(course.productType === 'project' ? "/project-product/".concat(course.productId || course.id) : "/new-product/".concat(course.productId || course.id));
194
+ }
195
+ }, /*#__PURE__*/React.createElement("div", {
196
+ className: styles.cover
197
+ }, /*#__PURE__*/React.createElement("img", {
198
+ src: course.productUrl,
199
+ alt: ""
200
+ })), /*#__PURE__*/React.createElement("div", {
201
+ className: classNames(styles.courseTitle, 'ellipsis-3')
202
+ }, course !== null && course !== void 0 && course.showStyle ? /*#__PURE__*/React.createElement("span", {
203
+ className: classNames(styles.newEquityLabel, styles["newEquityLabel-".concat(course.showStyle)])
204
+ }, course === null || course === void 0 ? void 0 : course.equityLabel) : null, course.name));
205
+ }))))));
215
206
  };
216
207
  export default AnswerItem;
@@ -9,8 +9,6 @@ import styles from "./index.module.css";
9
9
  import { MMarkdown } from '@myun/gimi-design';
10
10
  import classNames from 'classnames';
11
11
  import FileUpload from "../file-upload";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
12
  var AskCard = function AskCard(_ref) {
15
13
  var item = _ref.item,
16
14
  moduleInfo = _ref.moduleInfo,
@@ -39,47 +37,40 @@ var AskCard = function AskCard(_ref) {
39
37
  optionsList = _React$useMemo.optionsList,
40
38
  questionContent = _React$useMemo.questionContent;
41
39
  var optionRender = function optionRender(v) {
42
- return /*#__PURE__*/_jsx("span", {
43
- children: v.value ? v.value : v.key
44
- });
40
+ return /*#__PURE__*/React.createElement("span", null, v.value ? v.value : v.key);
45
41
  };
46
- return /*#__PURE__*/_jsxs("div", {
47
- className: styles.askList,
48
- children: [/*#__PURE__*/_jsx("div", {
49
- className: styles.askQuestion,
50
- style: detailInfo.answerType === 1 || detailInfo.uploadFile ? {
51
- marginBottom: 12
52
- } : {
53
- marginBottom: 0
54
- },
55
- children: /*#__PURE__*/_jsx(MMarkdown, {
56
- content: questionContent,
57
- id: item.id
58
- })
59
- }), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
60
- return /*#__PURE__*/_jsx("div", {
61
- className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
62
- onClick: function onClick() {
63
- return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
64
- },
65
- children: optionRender(v)
66
- }, v.key);
67
- })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/_jsx("div", {
68
- className: classNames(styles.showUpload, item.disableUploadFile ? styles.disableFile : ''),
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: styles.askList
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: styles.askQuestion,
46
+ style: detailInfo.answerType === 1 || detailInfo.uploadFile ? {
47
+ marginBottom: 12
48
+ } : {
49
+ marginBottom: 0
50
+ }
51
+ }, /*#__PURE__*/React.createElement(MMarkdown, {
52
+ content: questionContent,
53
+ id: item.id
54
+ })), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
55
+ return /*#__PURE__*/React.createElement("div", {
56
+ className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
57
+ key: v.key,
69
58
  onClick: function onClick() {
70
- return onAskCardCallback === null || onAskCardCallback === void 0 ? void 0 : onAskCardCallback();
71
- },
72
- children: /*#__PURE__*/_jsx(FileUpload, {
73
- disabled: item.disableUploadFile,
74
- children: /*#__PURE__*/_jsxs("div", {
75
- className: classNames(styles.uploadIcon),
76
- children: [/*#__PURE__*/_jsx("img", {
77
- src: item.disableUploadFile ? 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/19/b1e04_20250919162201.png' : 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/11/83ad4_20250911153220.png',
78
- alt: ""
79
- }), "\u6587\u4EF6\u4E0A\u4F20"]
80
- })
81
- })
82
- })]
83
- });
59
+ return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
60
+ }
61
+ }, optionRender(v));
62
+ })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/React.createElement("div", {
63
+ className: classNames(styles.showUpload, item.disableUploadFile ? styles.disableFile : ''),
64
+ onClick: function onClick() {
65
+ return onAskCardCallback === null || onAskCardCallback === void 0 ? void 0 : onAskCardCallback();
66
+ }
67
+ }, /*#__PURE__*/React.createElement(FileUpload, {
68
+ disabled: item.disableUploadFile
69
+ }, /*#__PURE__*/React.createElement("div", {
70
+ className: classNames(styles.uploadIcon)
71
+ }, /*#__PURE__*/React.createElement("img", {
72
+ src: item.disableUploadFile ? 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/19/b1e04_20250919162201.png' : 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/11/83ad4_20250911153220.png',
73
+ alt: ""
74
+ }), "\u6587\u4EF6\u4E0A\u4F20"))));
84
75
  };
85
76
  export default AskCard;
@@ -0,0 +1,2 @@
1
+ export { default as Keydown } from './keydown';
2
+ export { default as TitleSlot } from './title-slot';
@@ -0,0 +1,2 @@
1
+ export { default as Keydown } from "./keydown";
2
+ export { default as TitleSlot } from "./title-slot";
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+ declare const _default: Extension<any, any>;
3
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export default Extension.create(function () {
3
+ function onCreate() {}
4
+ function onUpdate() {}
5
+ var validate = function validate(_ref) {
6
+ var editor = _ref.editor;
7
+ var doc = editor.state.doc;
8
+ var hasTitleSlot = false;
9
+ doc.descendants(function (node) {
10
+ if (node.type.name === 'titleSlot') {
11
+ hasTitleSlot = true;
12
+ return false;
13
+ }
14
+ return true;
15
+ });
16
+ var selectionPos = editor.state.selection.from;
17
+ return hasTitleSlot ? !(selectionPos > 2) : false;
18
+ };
19
+ function addKeyboardShortcuts() {
20
+ return {
21
+ ArrowLeft: validate,
22
+ Backspace: validate,
23
+ Delete: validate
24
+ };
25
+ }
26
+ return {
27
+ name: 'customExtension',
28
+ onCreate: onCreate,
29
+ onUpdate: onUpdate,
30
+ addKeyboardShortcuts: addKeyboardShortcuts,
31
+ addOptions: function addOptions() {
32
+ return {
33
+ hasTitleSlot: false
34
+ };
35
+ }
36
+ };
37
+ });
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const _default: (props: any) => React.JSX.Element;
4
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { NodeViewWrapper } from '@tiptap/react';
2
+ import React from 'react';
3
+ import "./index.less";
4
+ export default (function (props) {
5
+ var node = props.node,
6
+ deleteNode = props.deleteNode;
7
+ var value = node.attrs.value ? node.attrs.value : '';
8
+ return /*#__PURE__*/React.createElement(NodeViewWrapper, {
9
+ className: "ai-chat-title-slot-wrapper"
10
+ }, /*#__PURE__*/React.createElement("span", {
11
+ className: "ai-chat-title-slot",
12
+ contentEditable: false
13
+ }, /*#__PURE__*/React.createElement("span", {
14
+ className: "ai-chat-title-slot-title"
15
+ }, value), /*#__PURE__*/React.createElement("span", {
16
+ className: "ai-chat-title-slot-line"
17
+ }, "|")));
18
+ });
@@ -0,0 +1,3 @@
1
+ import { Node } from '@tiptap/core';
2
+ declare const _default: Node<any, any>;
3
+ export default _default;
@@ -0,0 +1,47 @@
1
+ import { mergeAttributes, Node } from '@tiptap/core';
2
+ import { ReactNodeViewRenderer } from '@tiptap/react';
3
+ import Component from "./Component";
4
+ export default Node.create({
5
+ name: 'titleSlot',
6
+ inline: true,
7
+ group: 'inline',
8
+ atom: true,
9
+ selectable: false,
10
+ draggable: false,
11
+ // 不可拖拽
12
+ isolating: true,
13
+ addAttributes: function addAttributes() {
14
+ return {
15
+ value: {
16
+ default: ''
17
+ }
18
+ };
19
+ },
20
+ addOptions: function addOptions() {
21
+ return {
22
+ value: '',
23
+ HTMLAttributes: {}
24
+ };
25
+ },
26
+ parseHTML: function parseHTML() {
27
+ return [{
28
+ tag: 'title-slot',
29
+ getAttrs: function getAttrs(node) {
30
+ return {
31
+ value: node.textContent
32
+ };
33
+ }
34
+ }];
35
+ },
36
+ renderHTML: function renderHTML(_ref) {
37
+ var node = _ref.node,
38
+ HTMLAttributes = _ref.HTMLAttributes;
39
+ console.log('HTMLAttributes', node, HTMLAttributes);
40
+ return ['title-slot', mergeAttributes(HTMLAttributes)];
41
+ },
42
+ addNodeView: function addNodeView() {
43
+ return ReactNodeViewRenderer(Component, {
44
+ as: 'span'
45
+ });
46
+ }
47
+ });
@@ -0,0 +1,22 @@
1
+ .ai-chat-title-slot-wrapper {
2
+ display: inline-block !important;
3
+ .ai-chat-title-slot {
4
+ .ai-chat-title-slot-title {
5
+ background: #f1f7ff;
6
+ border-radius: 8px;
7
+ -ms-flex-negative: 0;
8
+ flex-shrink: 0;
9
+ gap: 10px;
10
+ padding: 2px 4px;
11
+ font-size: 16px;
12
+ font-weight: 600;
13
+ }
14
+ .ai-chat-title-slot-line {
15
+ color: #d9dce5;
16
+ margin: 0 5px;
17
+ padding: 2px 4px;
18
+ }
19
+ }
20
+
21
+
22
+ }
@@ -9,10 +9,12 @@ interface IAIInputProps {
9
9
  placeholder?: string;
10
10
  defaultPrompt?: string;
11
11
  disabled?: boolean;
12
+ onBeforeSend?: (text: string) => void;
12
13
  onSend?: (text: string) => void;
13
14
  enableVoiceRecord?: boolean;
14
15
  enableVoiceChat?: boolean;
15
16
  enableFileUpload?: boolean;
17
+ enableSourceQuote?: boolean;
16
18
  style?: React.CSSProperties;
17
19
  className?: string;
18
20
  maxLength?: number;
@@ -25,7 +27,9 @@ interface IAIInputProps {
25
27
  disableVoiceCommunication?: boolean;
26
28
  onHistoryReload?: () => void;
27
29
  accept?: string[];
30
+ titleSlot?: string;
28
31
  showDefaultPrompt?: boolean;
32
+ onConversationCreated?: (conversationId: number) => void;
29
33
  }
30
34
  declare const ChatInput: React.ForwardRefExoticComponent<IAIInputProps & React.RefAttributes<ChatInputRef>>;
31
35
  export default ChatInput;