@fv-ui/ai-chat 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/es/index.mjs +36 -18
- package/lib/index.js +36 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -405,6 +405,7 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
405
405
|
| size | number \| string | 0 | 文件大小(字节自动格式化为 B/KB/MB;字符串原样展示;0 不显示) |
|
|
406
406
|
| url | string | '' | 图片地址(image 模式缩略图) |
|
|
407
407
|
| status | 'loading' \| 'success' \| 'error' | 'success' | loading spinner / error 红边 |
|
|
408
|
+
| errorText | string | '' | 失败原因红字(error 态展示于卡片下方,超宽截断 title 全文) |
|
|
408
409
|
| imageSize | string | '' | 缩略图尺寸(width/height 同值) |
|
|
409
410
|
| onDelete | () => void | — | 删除按钮回调 |
|
|
410
411
|
| locale | LocaleInput(string \| 对象) | undefined | 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) |
|
|
@@ -424,6 +425,8 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
424
425
|
| tip | string | '' | 内联提示文案 |
|
|
425
426
|
| count | number | 0 | 最大附件数(超出走 @exceed;0 不限) |
|
|
426
427
|
| beforeUpload | (file) => boolean \| Promise<boolean> | — | 上传前校验,返回 false 拦截 |
|
|
428
|
+
| upload | (file, item) => Promise\<Partial\<AttachmentItem\> \| undefined \| void\> \| ... | — | 上传钩子(先传后发):选文件即调——入列即 loading,成功返回附件描述(含服务端附件 id)回填列表项置 success,失败(抛错/resolve 错误文案串)置 error 带失败原因(可重传再走钩子);缺省不调(纯本地待发列表,入列直接 success) |
|
|
429
|
+
| disabled | boolean | false | 整体禁用(触发按钮不可点;生成中锁定输入场景,单飞行闸语义) |
|
|
427
430
|
| layout | 'inline' \| 'triggerOnly' \| 'listOnly' | 'inline' | 布局:inline 回形针+列表+提示一行;triggerOnly 只渲染回形针按钮;listOnly 只渲染文件列表(拆分布局供整框组合:按钮进操作栏、列表进输入区上方) |
|
|
428
431
|
| locale | LocaleInput(string \| 对象) | undefined | 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) |
|
|
429
432
|
|
|
@@ -432,6 +435,7 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
432
435
|
| update:modelValue / change | 列表变化(全量数组) |
|
|
433
436
|
| exceed | (file) 超出 count |
|
|
434
437
|
| delete | (item) 删除某项 |
|
|
438
|
+
| uploaded | (item, result?) 上传钩子落定(单项):成功回填后的列表项 + 上传结果;失败时 result 为 undefined(失败原因在 item.errMessage,FilesCard 红字展示) |
|
|
435
439
|
|
|
436
440
|
| Slot | 说明 |
|
|
437
441
|
| --- | --- |
|
|
@@ -518,6 +522,9 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
518
522
|
| allowAttachments | boolean | false | 开启输入区附件上传(回形针在操作栏左侧与提交按钮同行,已选列表在输入框上方;只传附件不输文字也可提交) |
|
|
519
523
|
| accept | string | '' | 附件 input accept 属性(透传 Attachments),如 'image/*' |
|
|
520
524
|
| attachmentLimit | number | 0 | 附件数量上限(0 不限,超限走 @attachment-exceed) |
|
|
525
|
+
| uploadAttachment | (file, item) => Promise\<Partial\<AttachmentItem\> \| string \| undefined \| void\> \| ... | undefined | 附件上传钩子(先传后发):选文件即调,成功返回附件描述(id/name/type 等回填列表项,id 随发送进入 adapter 的 user 消息 files);返回错误文案串/抛错置 error 可重传。缺省不调(附件仅本地待发展示,不落服务端);上传中(loading 项)提交按钮禁用拒发,error 残留项不随发送 |
|
|
526
|
+
| resolveFileUrl | (file: ChatFile) => Promise\<string\> \| string | undefined | 附件地址解析钩子(鉴权取流):消息气泡渲染附件 url 前调用,返回可直渲地址(如 JWT fetch 换 blob objectURL);缺省原样使用 url(blob/dataURL/公开地址)。远端 url 解析结果组件内按 url 缓存 + 在途去重;解析失败回落原 url 不阻塞渲染 |
|
|
527
|
+
| feedbackHandler | (message, action: 'LIKE' \| 'DISLIKE' \| 'CLEAR', comment?) => Promise\<unknown\> \| unknown | undefined | 消息评价提交钩子(透传 AiMessages→AiMessage;仅 assistant 最终回答行渲染 👍/👎,缺省不渲染按钮)。消费方在此接后端评价端点(如 Fv 系 POST /message/feedback):resolved 即成功;返回错误文案串/抛错触发 feedback-error(乐观更新已回滚);action=CLEAR 取消评价(comment 忽略)。交互语义:点击 👍 直接提交(不弹附言),点击 👎 弹附言层(textarea ≤500 字 + 提交/跳过),再次点击当前态按钮发 CLEAR 取消评价(附言一并清空);👍↔👎 任意切换,后一次整体覆盖前一次(含附言);提交中按钮禁用防连点 |
|
|
521
528
|
| theme | 'light' \| 'dark' \| 'auto' | 'light' | 主题(向 html 注入/移除 dark class) |
|
|
522
529
|
| locale | LocaleInput(string \| 对象) | undefined | 语言包:'zh-CN'/'en-US' 整包或部分文案对象(解析后注入整框后代) |
|
|
523
530
|
|
|
@@ -533,6 +540,10 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
533
540
|
| error | (err, message?) 生成出错 |
|
|
534
541
|
| branch-change | (dir, message) 分支切换 |
|
|
535
542
|
| attachment-exceed | (file) 附件超过 attachmentLimit 上限 |
|
|
543
|
+
| attachment-uploaded | (item, { ok, message? }) 附件上传钩子落定(allowAttachments + uploadAttachment 场景):ok=false 时 message 为失败原因,宿主可 toast/埋点 |
|
|
544
|
+
| message-file-click | (file, message) 点击消息气泡附件 chips:默认行为——图片类经 resolveFileUrl 解析后打开内置 ElImageViewer 放大(同消息多图轮播),文档类无内置行为,宿主接此事件自行下载 |
|
|
545
|
+
| feedback-change | (message, action: 'LIKE' \| 'DISLIKE' \| 'CLEAR') 评价提交成功(乐观落定后触发;message.feedback 已更新),宿主可埋点/联动 |
|
|
546
|
+
| feedback-error | (message: string) 评价提交失败(钩子 reject/返回错误文案;乐观更新已回滚,message 为错误文案) |
|
|
536
547
|
| scroll | (event) 消息区滚动(原生 scroll 事件透传;空态无滚动容器不触发) |
|
|
537
548
|
|
|
538
549
|
| Slot | 说明 |
|
|
@@ -597,11 +608,16 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
597
608
|
| showTime | boolean | true | 显示消息时间(透传 AiMessage;时间源 createdTime 优先,缺省回落 createdAt。助手消息生成中不显示,打完字后才显示) |
|
|
598
609
|
| timeFormat | (message, timestamp) => string | undefined | 消息时间自定义格式化(透传 AiMessage) |
|
|
599
610
|
| autoCollapse | boolean | true | 正文出完自动收起思考链(透传 AiMessage;status 落 done 且正文打完才收;error 不收) |
|
|
611
|
+
| resolveFileUrl | (file: ChatFile) => Promise\<string\> \| string | undefined | 附件地址解析钩子(透传 AiMessage;鉴权取流换可直渲地址,见 AiChat) |
|
|
612
|
+
| feedbackHandler | (message, action, comment?) => Promise\<unknown\> \| unknown | undefined | 消息评价提交钩子(透传 AiMessage;语义见 AiChat,缺省不渲染 👍/👎) |
|
|
600
613
|
| locale | LocaleInput(string \| 对象) | undefined | 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) |
|
|
601
614
|
|
|
602
615
|
| Event | 说明 |
|
|
603
616
|
| --- | --- |
|
|
604
617
|
| select / copy / regenerate / branch-change | 建议选中 / 复制 / 重生成 / 分支切换,载荷同 AiChat |
|
|
618
|
+
| followup-select | (item, message) 点击追问建议 chip(透传 AiMessage,载荷同 AiChat) |
|
|
619
|
+
| message-file-click | (file, message) 点击消息附件 chips(透传 AiMessage;图片类默认打开内置放大预览,文档类宿主自行下载) |
|
|
620
|
+
| feedback-change / feedback-error | 评价提交成功(message, action)/ 失败(错误文案;透传 AiMessage,语义见 AiChat) |
|
|
605
621
|
| scroll | (event) 滚动容器滚动(原生 scroll 事件透传;空态无滚动容器不触发) |
|
|
606
622
|
|
|
607
623
|
| Slot | 说明 |
|
|
@@ -653,6 +669,8 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
653
669
|
| showTime | boolean | true | 显示消息时间(操作区按钮之后;时间源:message.createdTime(秒级/毫秒级时间戳或 ISO 字符串自动识别)优先,缺省回落 message.createdAt;两者皆无则不渲染。助手消息 SSE 生成中不显示,正文打完字(未启用打字机则落定)后才显示;error 即显;user 消息恒显示) |
|
|
654
670
|
| timeFormat | (message, timestamp) => string | undefined | 消息时间自定义格式化(透传消息与已归一为 ms 的时间戳;缺省 'YYYY-MM-DD HH:mm',本机时区) |
|
|
655
671
|
| codeTriggerLangs | string[] | — | 代码块「预览」触发语言(透传 Markdown/Typewriter;命中语言的代码块右上角注入按钮,点击行为由消费方事件委托实现) |
|
|
672
|
+
| resolveFileUrl | (file: ChatFile) => Promise\<string\> \| string | undefined | 附件地址解析钩子:渲染附件 url 前调用,返回可直渲地址(如 JWT fetch 换 blob objectURL);缺省原样使用 url(blob/dataURL/公开地址),远端地址解析结果按 url 缓存 + 在途去重,失败回落原 url |
|
|
673
|
+
| feedbackHandler | (message, action: 'LIKE' \| 'DISLIKE' \| 'CLEAR', comment?) => Promise\<unknown\> \| unknown | undefined | 消息评价提交钩子:仅 assistant 最终回答行(role=assistant 且 status=done,error/中断/生成中不渲染)渲染 👍/👎,缺省不渲染按钮。点击 👍 直接提交,点击 👎 弹附言层(≤500 字可跳过),再次点击当前态按钮发 CLEAR;乐观更新——先翻转 message.feedback 再调钩子,失败回滚并经 feedback-error 上抛,成功经 feedback-change 上抛;返回 resolved 即成功,返回错误文案串/抛错均视为失败 |
|
|
656
674
|
| locale | LocaleInput(string \| 对象) | undefined | 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) |
|
|
657
675
|
|
|
658
676
|
> 用户消息操作区:恒渲染复制按钮,默认透明,鼠标移上消息(或键盘聚焦)时浮现(open-webui 交互)。
|
|
@@ -661,6 +679,10 @@ Markdown 渲染(Sanitized by DOMPurify),内置 Prism 代码高亮与 KaTeX。
|
|
|
661
679
|
| --- | --- |
|
|
662
680
|
| copy / regenerate / branch-change | (message) / (message) / (dir, message) |
|
|
663
681
|
| followup-select | (item, message) 点击追问建议 chip(item 为建议文本;仅链尾 assistant 消息渲染 chips,status 落 done 后可点;AiChat 内部已接住转 send,直接用 AiMessage 时的消费方需自行接管发送) |
|
|
682
|
+
| file-click | (file, message) 点击附件 chips:图片类默认打开内置 ElImageViewer 放大(同消息多图轮播,url 经 resolveFileUrl 解析);文档类无内置行为,宿主接此事件自行下载 |
|
|
683
|
+
| feedback-change | (message, action: 'LIKE' \| 'DISLIKE' \| 'CLEAR') 评价提交成功(乐观落定后触发;message.feedback 已更新,宿主可埋点/联动) |
|
|
684
|
+
| feedback-error | (message: string) 评价提交失败(钩子 reject/返回错误文案;乐观更新已回滚,message 为错误文案) |
|
|
685
|
+
| typing | 打字机输出中(流式期间节奏性触发) |
|
|
664
686
|
|
|
665
687
|
| Slot | 说明 |
|
|
666
688
|
| --- | --- |
|
|
@@ -744,6 +766,8 @@ const adapter = FvCommonAdapter({
|
|
|
744
766
|
- `message_end` 的 `messageId`(最终文本行 id)经 `onBackendMessageId` 回填到 `MessageNode.backendId`——多轮工具循环下与 `message_start` 的首轮 id 不同,UI 落库/对账以它为准
|
|
745
767
|
- `tool` 事件经 `onTool` → `useChat.onToolEvent` → `AiChat @tool-event` 上抛,消费方展示「正在查询库存…」等中间态
|
|
746
768
|
- 追问建议(V58+):`suggestions` 事件(流式收尾 0..1 次,最后一个 delta 后、message_end 前,载荷 `{items: string[]}`)经可选 `onSuggestions` 上抛,`useChat` 回写 `MessageNode.suggestions`,AiMessage 在链尾消息渲染追问 chips;开关关闭/模型未产出/中断/失败无此事件;历史恢复用导出的 `parseSuggestions(raw)` 安全解析 `FvCommonMessage.suggestions`(JSON 数组原文透传,脏数据按无建议)
|
|
769
|
+
- 消息评价(V58+):`FvCommonMessage.feedback`(LIKE/DISLIKE,未评价/旧数据恒 null)、`feedbackComment`(附言 ≤500 字)、`feedbackTime`(评价落库时间)三字段同款容错;历史恢复由消费方映射为 `MessageNode.feedback` 灌入展示;评价提交走独立端点(POST /message/feedback),不经本适配器——接 `AiChat` 的 `feedbackHandler` 钩子即可
|
|
770
|
+
- 附件快照(1.4.1+):user 行 `FvCommonMessage.attachments`(id/originalName/type/suffix/sizeBytes/downloadUrl,旧数据/无附件恒 null),历史回放映射 `MessageNode.files` 渲染 chips(downloadUrl 需鉴权取流时配 `resolveFileUrl` 钩子)
|
|
747
771
|
- 配套 DTO 类型:`FvCommonSessionItem` / `FvCommonMessage` / `FvCommonSessionDetail` / `FvCommonMessagePage`(消费方直接调会话管理端点时用)
|
|
748
772
|
|
|
749
773
|
### useMessages(initial?)
|
|
@@ -879,12 +903,12 @@ configureLocale(jaJP)
|
|
|
879
903
|
| welcome | greetingPrefix / greetingName / description | 你好,我是 ␣ / Gizmo / 我可以帮你查询数据、分析问题、生成报表、以及执行系统操作,让生产管理更高效。 | Hello, I am ␣ / Gizmo / I can help you query data, analyze problems, generate reports, and perform system operations... |
|
|
880
904
|
| sender | clear / stop / send / speech / recordCancel / recordConfirm / micUnavailable / inputPlaceholder | 清空 / 停止 / 发送 / 语音输入 / 取消录音 / 确认录音 / 无法访问麦克风 / 输入你的问题,查询数据、分析问题或生成报表… | Clear / Stop / Send / Voice input / Cancel recording / Confirm recording / Microphone unavailable / Ask a question — query data, analyze problems, or generate reports… |
|
|
881
905
|
| editorSender | clear / stop / send / inputPlaceholder / selectTagTitle / loading / tagTip | 清空 / 停止 / 发送 / 请输入 / 选择标签 / 加载中… / 填写内容后回车确认 | Clear / Stop / Send / Type something... / Select a tag / Loading... / Type and press Enter to confirm |
|
|
882
|
-
| attachments | add / retry | 添加附件 / 重传 | Add attachment / Retry |
|
|
906
|
+
| attachments | add / retry / uploading | 添加附件 / 重传 / 上传中… | Add attachment / Retry / Uploading… |
|
|
883
907
|
| filesCard | remove | 删除 | Remove |
|
|
884
908
|
| conversations | menuLabel / rename / delete / renameTitle / renamePrompt / renamePlaceholder / deleteTitle / deleteConfirm | 会话操作 / 重命名 / 删除 / 重命名会话 / 请输入新的会话名称 / 请输入名称 / 删除会话 / 确定删除会话「{label}」吗?... | Conversation actions / Rename / Delete / Rename conversation / Enter a new conversation name / Enter a name / Delete conversation / Delete "{label}"? ... |
|
|
885
909
|
| scroll | toBottom | 滚动到底部 | Scroll to bottom |
|
|
886
910
|
| aiChat | modelPlaceholder / adapterMissing / generateFailed / exportUser / exportAssistant | 模型 / 未配置 adapter 或 baseURL / 生成失败 / 你 / 助手 | Model / Neither adapter nor baseURL is configured / Generation failed / You / Assistant |
|
|
887
|
-
| aiMessage | copy / regenerate / prevBranch / nextBranch / defaultUserName / defaultAssistantName / querying / queried / generateFailed / loadingPhrases | 复制 / 重新生成 / 上一分支 / 下一分支 / 你 / Gizmo / 正在查询 / 已查询 / 生成失败 / [正在思考…, 正在整理思路…, 正在生成回答…] | Copy / Regenerate / Previous branch / Next branch / You / Gizmo / Querying / Queried / Generation failed / [Thinking..., Organizing thoughts..., Generating your answer...] |
|
|
911
|
+
| aiMessage | copy / regenerate / prevBranch / nextBranch / defaultUserName / defaultAssistantName / querying / queried / generateFailed / followups / loadingPhrases / feedback.{like, dislike, dislikeTitle, dislikePlaceholder, submit, skip, failed, cleared} | 复制 / 重新生成 / 上一分支 / 下一分支 / 你 / Gizmo / 正在查询 / 已查询 / 生成失败 / 追问建议 / [正在思考…, 正在整理思路…, 正在生成回答…] / 点赞 / 点踩 / 告诉 AI 哪里不好 / 补充具体原因,帮助 AI 改进(选填) / 提交 / 跳过 / 评价提交失败 / 已取消评价 | Copy / Regenerate / Previous branch / Next branch / You / Gizmo / Querying / Queried / Generation failed / Follow-up suggestions / [Thinking..., Organizing thoughts..., Generating your answer...] / Like / Dislike / Tell the AI what went wrong / Add details to help the AI improve (optional) / Submit / Skip / Failed to submit feedback / Feedback removed |
|
|
888
912
|
| aiArtifacts | copy / download / fullscreen / close | 复制 / 下载 / 全屏 / 关闭 | Copy / Download / Fullscreen / Close |
|
|
889
913
|
| chat | fileTag / fileImageTag / filesSystemPrompt / toolDuration / continuePrompt | [附件] {name} / (图片) / 用户随消息提供了以下文件:\n{files} / 用时 {s} / 请基于以上内容继续完成回答... | [File] {name} / ␣(image) / The user provided... / Took {s} / Continue completing... |
|
|
890
914
|
| errors | requestFailed / sessionIdMissing / noBody / generateFailed / recordUnsupported / speechError | 请求失败 / 缺少 sessionId(...) / 响应无 body / 生成失败 / 当前环境不支持音频录制 / 语音识别错误: {error} | Request failed / sessionId is missing... / Response has no body / Generation failed / Audio recording... / Speech recognition error: {error} |
|
|
@@ -973,7 +997,7 @@ A:FvMarkdown 依赖浏览器 `window`(DOMPurify 消毒),不支持服务端首渲
|
|
|
973
997
|
|
|
974
998
|
## 类型与导出
|
|
975
999
|
|
|
976
|
-
包入口导出全部组件、`useChat`/`useMessages`/`useXStream`/`useSend`/`XRequest`/`useRecord`、`OpenAIAdapter`、`FvCommonAdapter`(+ `FvCommonError` 及配套 DTO 类型)、`createMessageTree`、`createLocalStorageAdapter`/`createMemoryAdapter`、`createSSEParser`、`configureLocale`/`zhCN`/`enUS`(国际化)及全部公共类型(`MessageNode`、`ChatAdapter`、`ChatFile`、`MessageUsage`、`SSEEvent`、`LocaleMessages`、`LocaleInput`、`DeepPartialLocale` 等),消费方:
|
|
1000
|
+
包入口导出全部组件、`useChat`/`useMessages`/`useXStream`/`useSend`/`XRequest`/`useRecord`、`OpenAIAdapter`、`FvCommonAdapter`(+ `FvCommonError` 及配套 DTO 类型)、`parseSuggestions`(追问建议 JSON 安全解析)、`createMessageTree`、`createLocalStorageAdapter`/`createMemoryAdapter`、`createSSEParser`、`configureLocale`/`zhCN`/`enUS`(国际化)及全部公共类型(`MessageNode`、`ChatAdapter`、`ChatFile`、`MessageFeedback`、`FeedbackHandler`、`MessageUsage`、`SSEEvent`、`LocaleMessages`、`LocaleInput`、`DeepPartialLocale` 等),消费方:
|
|
977
1001
|
|
|
978
1002
|
```ts
|
|
979
1003
|
import { FvAiChat, OpenAIAdapter, useChat } from '@fv-ui/ai-chat'
|
package/es/index.mjs
CHANGED
|
@@ -38794,12 +38794,19 @@ const BulbIcon = defineComponent({
|
|
|
38794
38794
|
}
|
|
38795
38795
|
});
|
|
38796
38796
|
|
|
38797
|
-
const
|
|
38797
|
+
const LIKE_PATH = "M507.94496 118.70208L512 118.784c41.7792 0 88.92416 30.76096 114.36032 80.81408 25.23136 44.2368 25.64096 100.352 12.6976 159.04768h123.78112c95.4368 0 177.43872 82.98496 148.02944 178.33984l-76.96384 249.6512c-19.37408 62.79168-81.75616 102.1952-148.02944 102.1952h-298.1888a116.57216 116.57216 0 0 1-116.5312-116.57216V422.2976c0-35.2256 23.38816-61.27616 47.75936-73.85088a115.9168 115.9168 0 0 0 56.19712-62.464c7.5776-20.0704 10.60864-37.76512 13.80352-56.40192l1.35168-7.61856c3.44064-19.6608 8.35584-45.99808 26.624-67.74784 16.71168-19.94752 35.84-29.73696 55.17312-33.5872 13.27104-2.62144 27.97568-2.21184 35.88096-1.96608z m-21.54496 74.30144c-3.44064 0.69632-7.49568 2.048-13.06624 8.64256-4.01408 4.79232-6.79936 12.288-10.48576 33.1776l-1.2288 6.9632c-3.11296 18.51392-7.33184 43.13088-17.53088 70.20544a189.6448 189.6448 0 0 1-91.38176 102.03136 18.6368 18.6368 0 0 0-6.63552 5.44768c-1.14688 1.6384-1.2288 2.58048-1.2288 2.8672v349.92128c0 23.67488 19.2512 42.84416 42.88512 42.84416h298.14784c39.15776 0 69.2224-23.01952 77.57824-50.21696l76.96384-249.61024c11.18208-36.20864-18.80064-82.90304-77.57824-82.90304h-172.07296a36.864 36.864 0 0 1-35.06176-48.29184c23.3472-71.68 22.44608-120.832 6.3488-148.48a38.0928 38.0928 0 0 1-1.10592-2.048C545.30048 202.30144 520.31488 192.512 512 192.512c-2.90816 0-5.81632-0.08192-8.27392-0.12288h-0.45056a264.6016 264.6016 0 0 0-7.12704-0.12288c-4.34176 0-7.3728 0.24576-9.74848 0.73728zM184.32 385.024a36.864 36.864 0 0 1 36.864 36.864v409.6a36.864 36.864 0 1 1-73.728 0v-409.6a36.864 36.864 0 0 1 36.864-36.864z";
|
|
38798
|
+
const LIKE_FILLED_PATH = "M614.4 183.62368c26.2144 46.94016 22.40512 116.85888-3.39968 199.31136h184.89344c82.86208 0 142.99136 72.45824 121.2416 145.94048l-82.7392 278.9376c-14.90944 50.25792-64.55296 85.11488-121.20064 85.11488H386.90816A79.70816 79.70816 0 0 1 307.2 813.21984V409.10848c0-17.6128 11.79648-32.768 27.4432-40.79616a168.46848 168.46848 0 0 0 81.7152-93.184c21.66784-59.76064 14.21312-105.55392 38.13376-135.24992 23.9616-29.65504 49.88928-24.90368 71.8848-24.90368 27.0336 0 66.02752 22.89664 88.02304 68.64896zM204.8 380.928A61.44 61.44 0 0 1 266.24 442.368v389.12a61.44 61.44 0 1 1-122.88 0v-389.12a61.44 61.44 0 0 1 61.44-61.44z";
|
|
38799
|
+
const DISLIKE_PATH = "M516.096 905.216l4.05504 0.08192c7.90528 0.24576 22.60992 0.65536 35.88096-1.96608 19.33312-3.85024 38.5024-13.63968 55.21408-33.5872 18.2272-21.74976 23.1424-48.08704 26.624-67.74784l1.31072-7.61856c3.19488-18.6368 6.22592-36.29056 13.80352-56.40192a115.9168 115.9168 0 0 1 56.19712-62.464c24.3712-12.57472 47.75936-38.58432 47.75936-73.85088V251.74016A116.57216 116.57216 0 0 0 640.36864 135.168h-298.1888c-66.23232 0-128.6144 39.40352-147.98848 102.1952l-77.0048 249.6512c-29.36832 95.35488 52.67456 178.33984 148.0704 178.33984h123.74016c-12.9024 58.65472-12.4928 114.85184 12.6976 159.08864 25.47712 49.9712 72.66304 80.77312 114.40128 80.77312z m38.66624-82.86208c-5.57056 6.59456-9.6256 7.94624-13.06624 8.64256-2.41664 0.49152-5.40672 0.73728-9.74848 0.73728-2.17088 0-4.42368 0-7.12704-0.12288h-0.45056c-2.4576-0.04096-5.36576-0.12288-8.27392-0.12288-8.31488 0-33.30048-9.74848-48.9472-41.04192a37.6832 37.6832 0 0 0-1.10592-2.048c-16.09728-27.68896-16.9984-76.8 6.3488-148.48a36.864 36.864 0 0 0-35.0208-48.29184H265.25696c-58.7776 0-88.76032-46.6944-77.57824-82.90304l77.0048-249.61024c8.35584-27.19744 38.37952-50.21696 77.53728-50.21696h298.1888c23.63392 0 42.8032 19.16928 42.8032 42.84416v349.92128c0 0.28672-0.04096 1.2288-1.2288 2.8672a18.59584 18.59584 0 0 1-6.5536 5.44768 189.6448 189.6448 0 0 0-91.42272 101.9904c-10.24 27.11552-14.41792 51.73248-17.57184 70.20544l-1.2288 7.04512c-3.6864 20.8896-6.43072 28.34432-10.4448 33.1776zM806.912 602.112a36.864 36.864 0 0 0 73.728 0v-409.6a36.864 36.864 0 1 0-73.728 0v409.6z";
|
|
38800
|
+
const DISLIKE_FILLED_PATH = "M778.24 585.728a61.44 61.44 0 1 0 122.88 0V196.608a61.44 61.44 0 0 0-122.88 0v389.12z m-344.76032 59.392c-25.8048 82.49344-29.65504 152.41216-3.39968 199.35232 21.99552 45.79328 60.98944 68.64896 88.02304 68.64896 2.62144 0 5.3248 0.08192 8.02816 0.16384 20.15232 0.49152 42.76224 1.06496 63.85664-25.06752 13.39392-16.62976 16.95744-38.25664 21.2992-64.59392 3.39968-20.72576 7.29088-44.31872 16.83456-70.656a168.50944 168.50944 0 0 1 81.7152-93.184c15.64672-8.06912 27.4432-23.18336 27.4432-40.79616V214.87616A79.70816 79.70816 0 0 0 657.57184 135.168H331.28448c-56.64768 0-106.2912 34.85696-121.2416 85.15584L127.3856 499.22048c-21.79072 73.48224 38.33856 145.94048 121.20064 145.94048h184.89344z";
|
|
38801
|
+
const PATHS = {
|
|
38802
|
+
like: { outline: LIKE_PATH, filled: LIKE_FILLED_PATH },
|
|
38803
|
+
dislike: { outline: DISLIKE_PATH, filled: DISLIKE_FILLED_PATH }
|
|
38804
|
+
};
|
|
38798
38805
|
const FeedbackThumbIcon = defineComponent({
|
|
38799
38806
|
name: "FvFeedbackThumbIcon",
|
|
38800
38807
|
props: {
|
|
38801
|
-
/** 朝向:
|
|
38802
|
-
|
|
38808
|
+
/** 朝向:like 点赞 / dislike 点踩(设计稿独立 path,非翻转) */
|
|
38809
|
+
kind: { type: String, default: "like" },
|
|
38803
38810
|
/** 实底态(当前评价高亮);缺省线性 */
|
|
38804
38811
|
filled: { type: Boolean, default: false }
|
|
38805
38812
|
},
|
|
@@ -38807,18 +38814,11 @@ const FeedbackThumbIcon = defineComponent({
|
|
|
38807
38814
|
return () => h("svg", {
|
|
38808
38815
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38809
38816
|
viewBox: "0 0 1024 1024",
|
|
38810
|
-
"aria-hidden": "true"
|
|
38811
|
-
...props.flip ? { style: "transform: scaleY(-1)" } : {}
|
|
38817
|
+
"aria-hidden": "true"
|
|
38812
38818
|
}, [
|
|
38813
38819
|
h("path", {
|
|
38814
|
-
d:
|
|
38815
|
-
|
|
38816
|
-
fill: "none",
|
|
38817
|
-
stroke: "currentColor",
|
|
38818
|
-
"stroke-width": 64,
|
|
38819
|
-
"stroke-linejoin": "round",
|
|
38820
|
-
"stroke-linecap": "round"
|
|
38821
|
-
}
|
|
38820
|
+
d: props.filled ? PATHS[props.kind].filled : PATHS[props.kind].outline,
|
|
38821
|
+
fill: "currentColor"
|
|
38822
38822
|
})
|
|
38823
38823
|
]);
|
|
38824
38824
|
}
|
|
@@ -39135,6 +39135,20 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39135
39135
|
const dislikePopVisible = ref(false);
|
|
39136
39136
|
const dislikeComment = ref("");
|
|
39137
39137
|
const feedbackPending = ref(false);
|
|
39138
|
+
const feedbackPopRef = ref(null);
|
|
39139
|
+
function onDocMousedown(e) {
|
|
39140
|
+
if (!dislikePopVisible.value) return;
|
|
39141
|
+
const target = e.target;
|
|
39142
|
+
if (!target) return;
|
|
39143
|
+
if (feedbackPopRef.value?.contains(target)) return;
|
|
39144
|
+
if (target instanceof Element && target.closest(".fv-msg-feedback-btn")) return;
|
|
39145
|
+
dislikePopVisible.value = false;
|
|
39146
|
+
}
|
|
39147
|
+
watch(dislikePopVisible, (on) => {
|
|
39148
|
+
if (on) document.addEventListener("mousedown", onDocMousedown, true);
|
|
39149
|
+
else document.removeEventListener("mousedown", onDocMousedown, true);
|
|
39150
|
+
});
|
|
39151
|
+
onBeforeUnmount(() => document.removeEventListener("mousedown", onDocMousedown, true));
|
|
39138
39152
|
async function submitFeedback(next, comment) {
|
|
39139
39153
|
const handler = props.feedbackHandler;
|
|
39140
39154
|
if (!handler || feedbackPending.value) return;
|
|
@@ -39142,7 +39156,8 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39142
39156
|
feedbackPending.value = true;
|
|
39143
39157
|
try {
|
|
39144
39158
|
props.message.feedback = next === "CLEAR" ? { action: null } : { action: next, ...comment ? { comment } : {} };
|
|
39145
|
-
await handler(props.message, next, comment);
|
|
39159
|
+
const r = await handler(props.message, next, comment);
|
|
39160
|
+
if (typeof r === "string" && r) throw new Error(r);
|
|
39146
39161
|
emit("feedback-change", props.message, next);
|
|
39147
39162
|
} catch (e) {
|
|
39148
39163
|
props.message.feedback = prev;
|
|
@@ -39194,7 +39209,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39194
39209
|
function onFileClick(f, index) {
|
|
39195
39210
|
emit("file-click", f, props.message);
|
|
39196
39211
|
if (f.type === "image" && displayUrl(f)) {
|
|
39197
|
-
previewIndex.value = Math.max(0,
|
|
39212
|
+
previewIndex.value = Math.max(0, previewList.value.findIndex((x) => x.id === f.id));
|
|
39198
39213
|
previewVisible.value = true;
|
|
39199
39214
|
}
|
|
39200
39215
|
}
|
|
@@ -39294,7 +39309,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39294
39309
|
type: "button",
|
|
39295
39310
|
class: normalizeClass(["fv-msg-file", `is-${f.type ?? "file"}`]),
|
|
39296
39311
|
title: f.name,
|
|
39297
|
-
onClick: ($event) => onFileClick(f
|
|
39312
|
+
onClick: ($event) => onFileClick(f)
|
|
39298
39313
|
}, [
|
|
39299
39314
|
f.type === "image" && displayUrl(f) ? (openBlock(), createElementBlock("img", {
|
|
39300
39315
|
key: 0,
|
|
@@ -39566,6 +39581,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39566
39581
|
createVNode(unref(ElIcon), null, {
|
|
39567
39582
|
default: withCtx(() => [
|
|
39568
39583
|
createVNode(unref(FeedbackThumbIcon), {
|
|
39584
|
+
kind: "like",
|
|
39569
39585
|
filled: feedbackAction.value === "LIKE"
|
|
39570
39586
|
}, null, 8, ["filled"])
|
|
39571
39587
|
]),
|
|
@@ -39598,7 +39614,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39598
39614
|
createVNode(unref(ElIcon), null, {
|
|
39599
39615
|
default: withCtx(() => [
|
|
39600
39616
|
createVNode(unref(FeedbackThumbIcon), {
|
|
39601
|
-
|
|
39617
|
+
kind: "dislike",
|
|
39602
39618
|
filled: feedbackAction.value === "DISLIKE"
|
|
39603
39619
|
}, null, 8, ["filled"])
|
|
39604
39620
|
]),
|
|
@@ -39613,9 +39629,11 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39613
39629
|
_: 1
|
|
39614
39630
|
/* STABLE */
|
|
39615
39631
|
}, 8, ["content"]),
|
|
39616
|
-
createCommentVNode(" \u70B9\u8E29\u9644\u8A00\u5F39\u5C42:\u70B9\u51FB \u{1F44E} \u5C55\u5F00\u5728\u6309\u94AE\u4E0B\u65B9(\u975E teleported,\u968F\u64CD\u4F5C\u533A\u5B9A\u4F4D);\r\n textarea \u2264500 \u9009\u586B,\u63D0\u4EA4\u5E26\u539F\u56E0/\u8DF3\u8FC7\u4E0D\u5E26 "),
|
|
39632
|
+
createCommentVNode(" \u70B9\u8E29\u9644\u8A00\u5F39\u5C42:\u70B9\u51FB \u{1F44E} \u5C55\u5F00\u5728\u6309\u94AE\u4E0B\u65B9(\u975E teleported,\u968F\u64CD\u4F5C\u533A\u5B9A\u4F4D);\r\n \u70B9\u5916\u6536\u5C42(\u8349\u7A3F\u4FDD\u7559);textarea \u2264500 \u9009\u586B,\u63D0\u4EA4\u5E26\u539F\u56E0/\u8DF3\u8FC7\u4E0D\u5E26 "),
|
|
39617
39633
|
dislikePopVisible.value ? (openBlock(), createElementBlock("div", {
|
|
39618
39634
|
key: 0,
|
|
39635
|
+
ref_key: "feedbackPopRef",
|
|
39636
|
+
ref: feedbackPopRef,
|
|
39619
39637
|
class: "fv-msg-feedback-pop",
|
|
39620
39638
|
role: "dialog",
|
|
39621
39639
|
"aria-label": unref(dict).aiMessage.feedback.dislikeTitle
|
package/lib/index.js
CHANGED
|
@@ -38814,12 +38814,19 @@
|
|
|
38814
38814
|
}
|
|
38815
38815
|
});
|
|
38816
38816
|
|
|
38817
|
-
const
|
|
38817
|
+
const LIKE_PATH = "M507.94496 118.70208L512 118.784c41.7792 0 88.92416 30.76096 114.36032 80.81408 25.23136 44.2368 25.64096 100.352 12.6976 159.04768h123.78112c95.4368 0 177.43872 82.98496 148.02944 178.33984l-76.96384 249.6512c-19.37408 62.79168-81.75616 102.1952-148.02944 102.1952h-298.1888a116.57216 116.57216 0 0 1-116.5312-116.57216V422.2976c0-35.2256 23.38816-61.27616 47.75936-73.85088a115.9168 115.9168 0 0 0 56.19712-62.464c7.5776-20.0704 10.60864-37.76512 13.80352-56.40192l1.35168-7.61856c3.44064-19.6608 8.35584-45.99808 26.624-67.74784 16.71168-19.94752 35.84-29.73696 55.17312-33.5872 13.27104-2.62144 27.97568-2.21184 35.88096-1.96608z m-21.54496 74.30144c-3.44064 0.69632-7.49568 2.048-13.06624 8.64256-4.01408 4.79232-6.79936 12.288-10.48576 33.1776l-1.2288 6.9632c-3.11296 18.51392-7.33184 43.13088-17.53088 70.20544a189.6448 189.6448 0 0 1-91.38176 102.03136 18.6368 18.6368 0 0 0-6.63552 5.44768c-1.14688 1.6384-1.2288 2.58048-1.2288 2.8672v349.92128c0 23.67488 19.2512 42.84416 42.88512 42.84416h298.14784c39.15776 0 69.2224-23.01952 77.57824-50.21696l76.96384-249.61024c11.18208-36.20864-18.80064-82.90304-77.57824-82.90304h-172.07296a36.864 36.864 0 0 1-35.06176-48.29184c23.3472-71.68 22.44608-120.832 6.3488-148.48a38.0928 38.0928 0 0 1-1.10592-2.048C545.30048 202.30144 520.31488 192.512 512 192.512c-2.90816 0-5.81632-0.08192-8.27392-0.12288h-0.45056a264.6016 264.6016 0 0 0-7.12704-0.12288c-4.34176 0-7.3728 0.24576-9.74848 0.73728zM184.32 385.024a36.864 36.864 0 0 1 36.864 36.864v409.6a36.864 36.864 0 1 1-73.728 0v-409.6a36.864 36.864 0 0 1 36.864-36.864z";
|
|
38818
|
+
const LIKE_FILLED_PATH = "M614.4 183.62368c26.2144 46.94016 22.40512 116.85888-3.39968 199.31136h184.89344c82.86208 0 142.99136 72.45824 121.2416 145.94048l-82.7392 278.9376c-14.90944 50.25792-64.55296 85.11488-121.20064 85.11488H386.90816A79.70816 79.70816 0 0 1 307.2 813.21984V409.10848c0-17.6128 11.79648-32.768 27.4432-40.79616a168.46848 168.46848 0 0 0 81.7152-93.184c21.66784-59.76064 14.21312-105.55392 38.13376-135.24992 23.9616-29.65504 49.88928-24.90368 71.8848-24.90368 27.0336 0 66.02752 22.89664 88.02304 68.64896zM204.8 380.928A61.44 61.44 0 0 1 266.24 442.368v389.12a61.44 61.44 0 1 1-122.88 0v-389.12a61.44 61.44 0 0 1 61.44-61.44z";
|
|
38819
|
+
const DISLIKE_PATH = "M516.096 905.216l4.05504 0.08192c7.90528 0.24576 22.60992 0.65536 35.88096-1.96608 19.33312-3.85024 38.5024-13.63968 55.21408-33.5872 18.2272-21.74976 23.1424-48.08704 26.624-67.74784l1.31072-7.61856c3.19488-18.6368 6.22592-36.29056 13.80352-56.40192a115.9168 115.9168 0 0 1 56.19712-62.464c24.3712-12.57472 47.75936-38.58432 47.75936-73.85088V251.74016A116.57216 116.57216 0 0 0 640.36864 135.168h-298.1888c-66.23232 0-128.6144 39.40352-147.98848 102.1952l-77.0048 249.6512c-29.36832 95.35488 52.67456 178.33984 148.0704 178.33984h123.74016c-12.9024 58.65472-12.4928 114.85184 12.6976 159.08864 25.47712 49.9712 72.66304 80.77312 114.40128 80.77312z m38.66624-82.86208c-5.57056 6.59456-9.6256 7.94624-13.06624 8.64256-2.41664 0.49152-5.40672 0.73728-9.74848 0.73728-2.17088 0-4.42368 0-7.12704-0.12288h-0.45056c-2.4576-0.04096-5.36576-0.12288-8.27392-0.12288-8.31488 0-33.30048-9.74848-48.9472-41.04192a37.6832 37.6832 0 0 0-1.10592-2.048c-16.09728-27.68896-16.9984-76.8 6.3488-148.48a36.864 36.864 0 0 0-35.0208-48.29184H265.25696c-58.7776 0-88.76032-46.6944-77.57824-82.90304l77.0048-249.61024c8.35584-27.19744 38.37952-50.21696 77.53728-50.21696h298.1888c23.63392 0 42.8032 19.16928 42.8032 42.84416v349.92128c0 0.28672-0.04096 1.2288-1.2288 2.8672a18.59584 18.59584 0 0 1-6.5536 5.44768 189.6448 189.6448 0 0 0-91.42272 101.9904c-10.24 27.11552-14.41792 51.73248-17.57184 70.20544l-1.2288 7.04512c-3.6864 20.8896-6.43072 28.34432-10.4448 33.1776zM806.912 602.112a36.864 36.864 0 0 0 73.728 0v-409.6a36.864 36.864 0 1 0-73.728 0v409.6z";
|
|
38820
|
+
const DISLIKE_FILLED_PATH = "M778.24 585.728a61.44 61.44 0 1 0 122.88 0V196.608a61.44 61.44 0 0 0-122.88 0v389.12z m-344.76032 59.392c-25.8048 82.49344-29.65504 152.41216-3.39968 199.35232 21.99552 45.79328 60.98944 68.64896 88.02304 68.64896 2.62144 0 5.3248 0.08192 8.02816 0.16384 20.15232 0.49152 42.76224 1.06496 63.85664-25.06752 13.39392-16.62976 16.95744-38.25664 21.2992-64.59392 3.39968-20.72576 7.29088-44.31872 16.83456-70.656a168.50944 168.50944 0 0 1 81.7152-93.184c15.64672-8.06912 27.4432-23.18336 27.4432-40.79616V214.87616A79.70816 79.70816 0 0 0 657.57184 135.168H331.28448c-56.64768 0-106.2912 34.85696-121.2416 85.15584L127.3856 499.22048c-21.79072 73.48224 38.33856 145.94048 121.20064 145.94048h184.89344z";
|
|
38821
|
+
const PATHS = {
|
|
38822
|
+
like: { outline: LIKE_PATH, filled: LIKE_FILLED_PATH },
|
|
38823
|
+
dislike: { outline: DISLIKE_PATH, filled: DISLIKE_FILLED_PATH }
|
|
38824
|
+
};
|
|
38818
38825
|
const FeedbackThumbIcon = vue.defineComponent({
|
|
38819
38826
|
name: "FvFeedbackThumbIcon",
|
|
38820
38827
|
props: {
|
|
38821
|
-
/** 朝向:
|
|
38822
|
-
|
|
38828
|
+
/** 朝向:like 点赞 / dislike 点踩(设计稿独立 path,非翻转) */
|
|
38829
|
+
kind: { type: String, default: "like" },
|
|
38823
38830
|
/** 实底态(当前评价高亮);缺省线性 */
|
|
38824
38831
|
filled: { type: Boolean, default: false }
|
|
38825
38832
|
},
|
|
@@ -38827,18 +38834,11 @@
|
|
|
38827
38834
|
return () => vue.h("svg", {
|
|
38828
38835
|
xmlns: "http://www.w3.org/2000/svg",
|
|
38829
38836
|
viewBox: "0 0 1024 1024",
|
|
38830
|
-
"aria-hidden": "true"
|
|
38831
|
-
...props.flip ? { style: "transform: scaleY(-1)" } : {}
|
|
38837
|
+
"aria-hidden": "true"
|
|
38832
38838
|
}, [
|
|
38833
38839
|
vue.h("path", {
|
|
38834
|
-
d:
|
|
38835
|
-
|
|
38836
|
-
fill: "none",
|
|
38837
|
-
stroke: "currentColor",
|
|
38838
|
-
"stroke-width": 64,
|
|
38839
|
-
"stroke-linejoin": "round",
|
|
38840
|
-
"stroke-linecap": "round"
|
|
38841
|
-
}
|
|
38840
|
+
d: props.filled ? PATHS[props.kind].filled : PATHS[props.kind].outline,
|
|
38841
|
+
fill: "currentColor"
|
|
38842
38842
|
})
|
|
38843
38843
|
]);
|
|
38844
38844
|
}
|
|
@@ -39155,6 +39155,20 @@
|
|
|
39155
39155
|
const dislikePopVisible = vue.ref(false);
|
|
39156
39156
|
const dislikeComment = vue.ref("");
|
|
39157
39157
|
const feedbackPending = vue.ref(false);
|
|
39158
|
+
const feedbackPopRef = vue.ref(null);
|
|
39159
|
+
function onDocMousedown(e) {
|
|
39160
|
+
if (!dislikePopVisible.value) return;
|
|
39161
|
+
const target = e.target;
|
|
39162
|
+
if (!target) return;
|
|
39163
|
+
if (feedbackPopRef.value?.contains(target)) return;
|
|
39164
|
+
if (target instanceof Element && target.closest(".fv-msg-feedback-btn")) return;
|
|
39165
|
+
dislikePopVisible.value = false;
|
|
39166
|
+
}
|
|
39167
|
+
vue.watch(dislikePopVisible, (on) => {
|
|
39168
|
+
if (on) document.addEventListener("mousedown", onDocMousedown, true);
|
|
39169
|
+
else document.removeEventListener("mousedown", onDocMousedown, true);
|
|
39170
|
+
});
|
|
39171
|
+
vue.onBeforeUnmount(() => document.removeEventListener("mousedown", onDocMousedown, true));
|
|
39158
39172
|
async function submitFeedback(next, comment) {
|
|
39159
39173
|
const handler = props.feedbackHandler;
|
|
39160
39174
|
if (!handler || feedbackPending.value) return;
|
|
@@ -39162,7 +39176,8 @@
|
|
|
39162
39176
|
feedbackPending.value = true;
|
|
39163
39177
|
try {
|
|
39164
39178
|
props.message.feedback = next === "CLEAR" ? { action: null } : { action: next, ...comment ? { comment } : {} };
|
|
39165
|
-
await handler(props.message, next, comment);
|
|
39179
|
+
const r = await handler(props.message, next, comment);
|
|
39180
|
+
if (typeof r === "string" && r) throw new Error(r);
|
|
39166
39181
|
emit("feedback-change", props.message, next);
|
|
39167
39182
|
} catch (e) {
|
|
39168
39183
|
props.message.feedback = prev;
|
|
@@ -39214,7 +39229,7 @@
|
|
|
39214
39229
|
function onFileClick(f, index) {
|
|
39215
39230
|
emit("file-click", f, props.message);
|
|
39216
39231
|
if (f.type === "image" && displayUrl(f)) {
|
|
39217
|
-
previewIndex.value = Math.max(0,
|
|
39232
|
+
previewIndex.value = Math.max(0, previewList.value.findIndex((x) => x.id === f.id));
|
|
39218
39233
|
previewVisible.value = true;
|
|
39219
39234
|
}
|
|
39220
39235
|
}
|
|
@@ -39314,7 +39329,7 @@
|
|
|
39314
39329
|
type: "button",
|
|
39315
39330
|
class: vue.normalizeClass(["fv-msg-file", `is-${f.type ?? "file"}`]),
|
|
39316
39331
|
title: f.name,
|
|
39317
|
-
onClick: ($event) => onFileClick(f
|
|
39332
|
+
onClick: ($event) => onFileClick(f)
|
|
39318
39333
|
}, [
|
|
39319
39334
|
f.type === "image" && displayUrl(f) ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
39320
39335
|
key: 0,
|
|
@@ -39586,6 +39601,7 @@
|
|
|
39586
39601
|
vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
|
|
39587
39602
|
default: vue.withCtx(() => [
|
|
39588
39603
|
vue.createVNode(vue.unref(FeedbackThumbIcon), {
|
|
39604
|
+
kind: "like",
|
|
39589
39605
|
filled: feedbackAction.value === "LIKE"
|
|
39590
39606
|
}, null, 8, ["filled"])
|
|
39591
39607
|
]),
|
|
@@ -39618,7 +39634,7 @@
|
|
|
39618
39634
|
vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
|
|
39619
39635
|
default: vue.withCtx(() => [
|
|
39620
39636
|
vue.createVNode(vue.unref(FeedbackThumbIcon), {
|
|
39621
|
-
|
|
39637
|
+
kind: "dislike",
|
|
39622
39638
|
filled: feedbackAction.value === "DISLIKE"
|
|
39623
39639
|
}, null, 8, ["filled"])
|
|
39624
39640
|
]),
|
|
@@ -39633,9 +39649,11 @@
|
|
|
39633
39649
|
_: 1
|
|
39634
39650
|
/* STABLE */
|
|
39635
39651
|
}, 8, ["content"]),
|
|
39636
|
-
vue.createCommentVNode(" \u70B9\u8E29\u9644\u8A00\u5F39\u5C42:\u70B9\u51FB \u{1F44E} \u5C55\u5F00\u5728\u6309\u94AE\u4E0B\u65B9(\u975E teleported,\u968F\u64CD\u4F5C\u533A\u5B9A\u4F4D);\r\n textarea \u2264500 \u9009\u586B,\u63D0\u4EA4\u5E26\u539F\u56E0/\u8DF3\u8FC7\u4E0D\u5E26 "),
|
|
39652
|
+
vue.createCommentVNode(" \u70B9\u8E29\u9644\u8A00\u5F39\u5C42:\u70B9\u51FB \u{1F44E} \u5C55\u5F00\u5728\u6309\u94AE\u4E0B\u65B9(\u975E teleported,\u968F\u64CD\u4F5C\u533A\u5B9A\u4F4D);\r\n \u70B9\u5916\u6536\u5C42(\u8349\u7A3F\u4FDD\u7559);textarea \u2264500 \u9009\u586B,\u63D0\u4EA4\u5E26\u539F\u56E0/\u8DF3\u8FC7\u4E0D\u5E26 "),
|
|
39637
39653
|
dislikePopVisible.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
39638
39654
|
key: 0,
|
|
39655
|
+
ref_key: "feedbackPopRef",
|
|
39656
|
+
ref: feedbackPopRef,
|
|
39639
39657
|
class: "fv-msg-feedback-pop",
|
|
39640
39658
|
role: "dialog",
|
|
39641
39659
|
"aria-label": vue.unref(dict).aiMessage.feedback.dislikeTitle
|