@fv-ui/ai-chat 1.5.1 → 1.6.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 +22 -18
- package/dist/index.d.ts +46 -12
- package/dist/style.css +1 -1
- package/es/index.mjs +355 -227
- package/lib/index.js +353 -225
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { shallowRef, inject, computed, provide, defineComponent, ref, onBeforeUnmount, openBlock, createElementBlock, Fragment, createElementVNode, createCommentVNode, createBlock, Teleport, watch, normalizeClass, createTextVNode, toDisplayString, normalizeStyle, renderSlot, unref, renderList, createVNode, isRef, nextTick, onMounted, mergeProps, createSlots, withCtx, Transition, getCurrentInstance, useSlots, normalizeProps, guardReactiveProps, reactive, resolveDynamicComponent, markRaw,
|
|
1
|
+
import { shallowRef, inject, computed, provide, defineComponent, ref, onBeforeUnmount, openBlock, createElementBlock, Fragment, createElementVNode, createCommentVNode, createBlock, Teleport, watch, normalizeClass, createTextVNode, toDisplayString, normalizeStyle, renderSlot, unref, renderList, createVNode, isRef, nextTick, onMounted, mergeProps, createSlots, withCtx, Transition, getCurrentInstance, useSlots, normalizeProps, guardReactiveProps, reactive, resolveDynamicComponent, markRaw, h, withModifiers, onActivated } from 'vue';
|
|
2
2
|
import { ElMessage, ElAvatar, ElButton, ElIcon, ElPopover, ElDialog, ElScrollbar, ElDropdown, ElDropdownMenu, ElDropdownItem, ElMessageBox, ElImageViewer, ElTooltip, ElInput, ElSelect, ElOption } from 'element-plus';
|
|
3
3
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
|
4
|
-
import { ArrowDown, Close, Check, Delete, Microphone, Promotion, VideoPause, Loading, SuccessFilled, CircleCloseFilled, ArrowUp,
|
|
4
|
+
import { ArrowDown, Close, Check, Delete, Microphone, Promotion, VideoPause, Loading, SuccessFilled, CircleCloseFilled, ArrowUp, Picture, Paperclip, RefreshRight, MoreFilled, Search, User, DocumentCopy, Bottom, CopyDocument, Download, FullScreen } from '@element-plus/icons-vue';
|
|
5
5
|
|
|
6
6
|
/* eslint-disable no-bitwise */
|
|
7
7
|
|
|
@@ -33280,15 +33280,17 @@ const zhCN = {
|
|
|
33280
33280
|
generateFailed: "\u751F\u6210\u5931\u8D25",
|
|
33281
33281
|
/** 追问建议 chips 区 aria 标签 */
|
|
33282
33282
|
followups: "\u8FFD\u95EE\u5EFA\u8BAE",
|
|
33283
|
+
/** 追问建议区标题(list 样式:分隔线下方灰色标题) */
|
|
33284
|
+
followupsTitle: "\u8FFD\u95EE",
|
|
33283
33285
|
loadingPhrases: ["\u6B63\u5728\u601D\u8003\u2026", "\u6B63\u5728\u6574\u7406\u601D\u8DEF\u2026", "\u6B63\u5728\u751F\u6210\u56DE\u7B54\u2026"],
|
|
33284
33286
|
/** 消息评价(点赞/点踩) */
|
|
33285
33287
|
feedback: {
|
|
33286
33288
|
like: "\u70B9\u8D5E",
|
|
33287
33289
|
dislike: "\u70B9\u8E29",
|
|
33288
|
-
/**
|
|
33289
|
-
dislikeTitle: "\u544A\u8BC9
|
|
33290
|
+
/** 点踩弹窗标题({name} = AI 名称,渲染时替换为 assistantName,空串回落 defaultAssistantName) */
|
|
33291
|
+
dislikeTitle: "\u62B1\u6B49\uFF0C\u8BF7\u544A\u8BC9 {name} \u54EA\u91CC\u4E0D\u597D",
|
|
33290
33292
|
/** 点踩附言输入占位(选填 ≤500 字) */
|
|
33291
|
-
dislikePlaceholder: "\
|
|
33293
|
+
dislikePlaceholder: "\u6B22\u8FCE\u8BF4\u8BF4\u4F60\u7684\u60F3\u6CD5",
|
|
33292
33294
|
/** 附言提交按钮(不带原因直接点踩) */
|
|
33293
33295
|
submit: "\u63D0\u4EA4",
|
|
33294
33296
|
/** 附言跳过按钮 */
|
|
@@ -33318,7 +33320,9 @@ const zhCN = {
|
|
|
33318
33320
|
noBody: "\u54CD\u5E94\u65E0 body",
|
|
33319
33321
|
generateFailed: "\u751F\u6210\u5931\u8D25",
|
|
33320
33322
|
recordUnsupported: "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u97F3\u9891\u5F55\u5236",
|
|
33321
|
-
speechError: "\u8BED\u97F3\u8BC6\u522B\u9519\u8BEF: {error}"
|
|
33323
|
+
speechError: "\u8BED\u97F3\u8BC6\u522B\u9519\u8BEF: {error}",
|
|
33324
|
+
/** 附件类型拦截提示({name} = 文件名;accept 白名单外文件入列前 toast) */
|
|
33325
|
+
attachmentRejected: "\u4E0D\u652F\u6301\u8BE5\u7C7B\u578B\u6587\u4EF6\uFF0C\u7981\u6B62\u4E0A\u4F20\uFF1A{name}"
|
|
33322
33326
|
}
|
|
33323
33327
|
};
|
|
33324
33328
|
|
|
@@ -33415,12 +33419,13 @@ const enUS = {
|
|
|
33415
33419
|
queried: "Queried",
|
|
33416
33420
|
generateFailed: "Generation failed",
|
|
33417
33421
|
followups: "Follow-up suggestions",
|
|
33422
|
+
followupsTitle: "Follow-ups",
|
|
33418
33423
|
loadingPhrases: ["Thinking...", "Organizing thoughts...", "Generating your answer..."],
|
|
33419
33424
|
feedback: {
|
|
33420
33425
|
like: "Like",
|
|
33421
33426
|
dislike: "Dislike",
|
|
33422
|
-
dislikeTitle: "
|
|
33423
|
-
dislikePlaceholder: "
|
|
33427
|
+
dislikeTitle: "Sorry \u2014 tell {name} what went wrong",
|
|
33428
|
+
dislikePlaceholder: "Feel free to share your thoughts",
|
|
33424
33429
|
submit: "Submit",
|
|
33425
33430
|
skip: "Skip",
|
|
33426
33431
|
failed: "Failed to submit feedback",
|
|
@@ -33446,7 +33451,9 @@ const enUS = {
|
|
|
33446
33451
|
noBody: "Response has no body",
|
|
33447
33452
|
generateFailed: "Generation failed",
|
|
33448
33453
|
recordUnsupported: "Audio recording is not supported in this environment",
|
|
33449
|
-
speechError: "Speech recognition error: {error}"
|
|
33454
|
+
speechError: "Speech recognition error: {error}",
|
|
33455
|
+
/** 附件类型拦截提示({name} = 文件名;accept 白名单外文件入列前 toast) */
|
|
33456
|
+
attachmentRejected: "This file type is not supported: {name}"
|
|
33450
33457
|
}
|
|
33451
33458
|
};
|
|
33452
33459
|
|
|
@@ -33549,7 +33556,9 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
33549
33556
|
const url = URL.createObjectURL(blob);
|
|
33550
33557
|
const a = document.createElement("a");
|
|
33551
33558
|
a.href = url;
|
|
33552
|
-
|
|
33559
|
+
const d = /* @__PURE__ */ new Date();
|
|
33560
|
+
const p = (n) => String(n).padStart(2, "0");
|
|
33561
|
+
a.download = `table_${d.getFullYear()}${p(d.getMonth() + 1)}${p(d.getDate())}-${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}.csv`;
|
|
33553
33562
|
a.click();
|
|
33554
33563
|
URL.revokeObjectURL(url);
|
|
33555
33564
|
}
|
|
@@ -37487,6 +37496,45 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
37487
37496
|
}
|
|
37488
37497
|
});
|
|
37489
37498
|
|
|
37499
|
+
const PATHS$1 = {
|
|
37500
|
+
excel: [
|
|
37501
|
+
"M895.969 336.015l0 575.953c0 26.497-21.498 47.995-47.998 47.995L176.028 959.963c-26.498 0-47.996-21.498-47.996-47.995L128.032 112.033c0-26.498 21.499-47.996 47.996-47.996L623.99 64.037c26.498 0 63.494 15.499 81.994 33.997l155.986 155.987C880.469 272.52 895.969 309.517 895.969 336.015zM831.973 384.011 623.99 384.011c-26.498 0-47.996-21.499-47.996-47.996L575.994 128.032 192.026 128.032l0 767.936 639.946 0L831.972 384.011zM639.99 320.016l187.984 0c-3-8.5-7.5-16.999-11-20.499L660.488 143.03c-3.5-3.5-12-7.999-20.498-10.999L639.99 320.016z",
|
|
37502
|
+
"M569.09 800l-56.717-88.062L455.656 800 319.833 800l125.375-192.54L319.833 415.667 454.91 415.667l57.463 88.061 56.717-88.061 135.076 0L580.285 607.46 704.166 800 569.09 800z"
|
|
37503
|
+
],
|
|
37504
|
+
pdf: [
|
|
37505
|
+
"M895.969 336.015l0 575.953c0 26.497-21.498 47.995-47.998 47.995L176.028 959.963c-26.498 0-47.996-21.498-47.996-47.995L128.032 112.033c0-26.498 21.499-47.996 47.996-47.996L623.99 64.037c26.498 0 63.494 15.499 81.994 33.997l155.986 155.987C880.469 272.52 895.969 309.517 895.969 336.015zM831.973 384.011 623.99 384.011c-26.498 0-47.996-21.499-47.996-47.996L575.994 128.032 192.026 128.032l0 767.936 639.946 0L831.972 384.011zM639.99 320.016l187.984 0c-3-8.5-7.5-16.999-11-20.499L660.488 143.03c-3.5-3.5-12-7.999-20.498-10.999L639.99 320.016z",
|
|
37506
|
+
"M796.394 580.111c-13.039-15.483-39.777-23.011-81.741-23.011-24.393 0-53.857 2.575-87.626 7.658-92.235-67.438-117.988-141.834-117.988-141.834s15.753-40.104 16.753-105.604c0.632-41.405-5.78-69.335-22.346-85.562-6.439-6.308-17.241-10.383-27.519-10.383-8.021 0-15.532 2.356-21.687 6.86-47.949 35.085 4.401 200.485 5.802 204.892-22.627 55.688-51.132 114.686-80.47 166.526-9.532 16.844-8.603 15.526-16.64 29.223 0 0-81.141 38.112-120.498 84.923-22.238 26.449-25.049 44.306-23.868 57.914l0.03 0.297c1.874 16.023 22.387 30.616 43.039 30.616 0.856 0 1.719-0.026 2.563-0.078 20.989-1.295 43.989-16.209 70.314-45.594 17.376-19.398 39.958-53.526 67.147-101.475 78.009-22.19 146.661-37.995 204.195-47.01 42.19 22.706 104.963 48.419 147.693 48.419 14.334 0 25.864-2.922 34.271-8.685 10.059-6.893 14.33-15.481 16.985-31.383S803.762 588.859 796.394 580.111zM705.261 599.473c37.504 0 57.811 5.453 68.241 10.027 3.218 1.411 5.558 2.771 7.218 3.909-2.939 1.879-8.721 4.25-19.171 4.25-17.327 0-40.069-6.051-67.808-18.022C697.687 599.527 701.528 599.473 705.261 599.473zM482.992 254.571c0.026-0.049 0.055-0.101 0.088-0.154 8.045 4.236 11.799 33.986 11.045 51.236-1.012 23.149-1.252 32.094-5.316 46.316C477.791 322.32 477.01 269.024 482.992 254.571zM485.935 489.25c18.918 30.724 46.975 63.999 74.007 87.758-52.76 11.15-103.416 25.127-134.937 36.006C458.791 555.32 483.716 494.969 485.935 489.25zM268.785 754.176c4.578-7.625 17.084-22.398 48.8-50.966-21.74 32.696-37.708 50.501-53.91 61.605C265.017 761.314 266.705 757.642 268.785 754.176z"
|
|
37507
|
+
],
|
|
37508
|
+
ppt: [
|
|
37509
|
+
"M895.969 336.015l0 575.953c0 26.497-21.498 47.995-47.998 47.995L176.028 959.963c-26.498 0-47.996-21.498-47.996-47.995L128.032 112.033c0-26.498 21.499-47.996 47.996-47.996L623.99 64.037c26.498 0 63.494 15.499 81.994 33.997l155.986 155.987C880.469 272.52 895.969 309.517 895.969 336.015zM831.973 384.011 623.99 384.011c-26.498 0-47.996-21.499-47.996-47.996L575.994 128.032 192.026 128.032l0 767.936 639.946 0L831.972 384.011zM639.99 320.016l187.984 0c-3-8.5-7.5-16.999-11-20.499L660.488 143.03c-3.5-3.5-12-7.999-20.498-10.999L639.99 320.016z",
|
|
37510
|
+
"M458.56 832l-92.027 0L366.533 361.855l116.89 0c29.708 0 53.118 1.615 70.231 4.843 17.114 3.229 30.944 8.396 41.493 15.5 19.374 13.133 34.601 30.464 45.69 51.987 11.085 21.529 16.629 44.561 16.629 69.102 0 44.994-14.854 80.942-44.56 107.849-29.708 26.912-69.747 40.362-120.12 40.362L458.56 651.498 458.56 832zM458.56 572.064l24.217 0c25.616 0 45.257-5.54 58.93-16.63 13.668-11.085 20.505-26.962 20.505-47.628 0-21.312-6.62-37.184-19.859-47.628-13.237-10.439-33.313-15.661-60.221-15.661L458.56 444.517 458.56 572.064z"
|
|
37511
|
+
],
|
|
37512
|
+
word: [
|
|
37513
|
+
"M895.969 336.015l0 575.953c0 26.497-21.498 47.995-47.998 47.995L176.028 959.963c-26.498 0-47.996-21.498-47.996-47.995L128.032 112.033c0-26.498 21.499-47.996 47.996-47.996L623.99 64.037c26.498 0 63.494 15.499 81.994 33.997l155.986 155.987C880.469 272.52 895.969 309.517 895.969 336.015zM831.973 384.011 623.99 384.011c-26.498 0-47.996-21.499-47.996-47.996L575.994 128.032 192.026 128.032l0 767.936 639.946 0L831.972 384.011zM639.99 320.016l187.984 0c-3-8.5-7.5-16.999-11-20.499L660.488 143.03c-3.5-3.5-12-7.999-20.498-10.999L639.99 320.016z",
|
|
37514
|
+
"M783.309 439.426 612.254 800l-102.52 0-18.691-214.441-1.133 0L390.223 800 286.287 800l-45.596-360.574 103.652 0 11.045 227.695 1.133 0 103.936-227.695 104.219 0 16.992 224.977 1.133 0 82.412-224.977L783.309 439.426z"
|
|
37515
|
+
],
|
|
37516
|
+
txt: [
|
|
37517
|
+
"M650.666667 42.666667a32.277333 32.277333 0 0 1 14.592 3.52l1.408 0.768a36.224 36.224 0 0 1 4.202666 2.88l0.533334 0.448 1.472 1.344 214.186666 214.186666 0.661334 0.704 0.170666 0.192-1.28-1.344 1.770667 1.92 0.704 0.853334a33.642667 33.642667 0 0 1 1.877333 2.602666l0.746667 1.258667 0.768 1.386667c2.261333 4.394667 3.52 9.344 3.52 14.613333V938.666667a42.666667 42.666667 0 0 1-42.666667 42.666666H170.666667a42.666667 42.666667 0 0 1-42.666667-42.666666V85.333333a42.666667 42.666667 0 0 1 42.666667-42.666666h480zM576 106.666667H192v810.666666h640V362.666667H618.666667a42.666667 42.666667 0 0 1-42.666667-42.666667V106.666667z m-32 554.666666a32 32 0 0 1 0 64h-170.666667a32 32 0 0 1 0-64h170.666667z m110.229333-192c15.701333 0 28.437333 14.336 28.437334 32s-12.736 32-28.437334 32H369.770667C354.069333 533.333333 341.333333 518.997333 341.333333 501.333333s12.736-32 28.437334-32h284.458666zM640 109.248V298.666667h189.418667L640 109.248z"
|
|
37518
|
+
],
|
|
37519
|
+
file: [
|
|
37520
|
+
"M896.211 336.149l0 576.316c0 26.515-21.512 48.026-48.026 48.026L175.815 960.491c-26.515 0-48.026-21.512-48.026-48.026L127.789 112.026c0-26.515 21.512-48.026 48.026-48.026l448.246 0c26.515 0 63.535 15.509 82.045 34.019l156.086 156.086C880.702 272.614 896.211 309.635 896.211 336.149zM832.176 384.176 624.062 384.176c-26.515 0-48.026-21.512-48.026-48.026L576.036 128.035 191.824 128.035l0 768.422 640.352 0L832.176 384.176zM640.07 320.141l188.104 0c-3.002-8.505-7.505-17.009-11.006-20.511L660.581 143.043c-3.501-3.502-12.006-8.004-20.511-11.006L640.07 320.141z"
|
|
37521
|
+
]
|
|
37522
|
+
};
|
|
37523
|
+
const FileIcon = defineComponent({
|
|
37524
|
+
name: "FvFileIcon",
|
|
37525
|
+
props: {
|
|
37526
|
+
/** 图标类型:excel/pdf/ppt/word/txt/file */
|
|
37527
|
+
kind: { type: String, default: "file" }
|
|
37528
|
+
},
|
|
37529
|
+
setup(props) {
|
|
37530
|
+
return () => h("svg", {
|
|
37531
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37532
|
+
viewBox: "0 0 1024 1024",
|
|
37533
|
+
"aria-hidden": "true"
|
|
37534
|
+
}, PATHS$1[props.kind].map((d) => h("path", { d, fill: "currentColor" })));
|
|
37535
|
+
}
|
|
37536
|
+
});
|
|
37537
|
+
|
|
37490
37538
|
const _hoisted_1$6 = ["src", "alt"];
|
|
37491
37539
|
const _hoisted_2$6 = { class: "fv-files-card-info" };
|
|
37492
37540
|
const _hoisted_3$6 = ["title"];
|
|
@@ -37497,7 +37545,7 @@ const _hoisted_5$3 = {
|
|
|
37497
37545
|
};
|
|
37498
37546
|
const _hoisted_6$2 = {
|
|
37499
37547
|
key: 2,
|
|
37500
|
-
class: "fv-files-card-
|
|
37548
|
+
class: "fv-files-card-size"
|
|
37501
37549
|
};
|
|
37502
37550
|
const _hoisted_7$1 = ["aria-label"];
|
|
37503
37551
|
const KB = 1024;
|
|
@@ -37518,40 +37566,39 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
37518
37566
|
},
|
|
37519
37567
|
setup(__props) {
|
|
37520
37568
|
const EXT_ICON = {
|
|
37521
|
-
|
|
37522
|
-
|
|
37523
|
-
|
|
37524
|
-
|
|
37525
|
-
|
|
37526
|
-
|
|
37527
|
-
|
|
37528
|
-
|
|
37529
|
-
|
|
37530
|
-
ppt:
|
|
37531
|
-
pptx:
|
|
37532
|
-
|
|
37533
|
-
|
|
37534
|
-
|
|
37535
|
-
|
|
37536
|
-
|
|
37537
|
-
|
|
37538
|
-
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
|
|
37542
|
-
|
|
37543
|
-
|
|
37544
|
-
"
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
|
|
37548
|
-
|
|
37549
|
-
|
|
37550
|
-
|
|
37551
|
-
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
dll: Cpu
|
|
37569
|
+
// excel / 表格
|
|
37570
|
+
xls: "excel",
|
|
37571
|
+
xlsx: "excel",
|
|
37572
|
+
xlsm: "excel",
|
|
37573
|
+
csv: "excel",
|
|
37574
|
+
et: "excel",
|
|
37575
|
+
// pdf
|
|
37576
|
+
pdf: "pdf",
|
|
37577
|
+
// ppt / 幻灯片
|
|
37578
|
+
ppt: "ppt",
|
|
37579
|
+
pptx: "ppt",
|
|
37580
|
+
pptm: "ppt",
|
|
37581
|
+
dps: "ppt",
|
|
37582
|
+
// word / wps 文字
|
|
37583
|
+
doc: "word",
|
|
37584
|
+
docx: "word",
|
|
37585
|
+
docm: "word",
|
|
37586
|
+
rtf: "word",
|
|
37587
|
+
wps: "word",
|
|
37588
|
+
// 文本类(md/txt 及常见纯文本格式)
|
|
37589
|
+
txt: "txt",
|
|
37590
|
+
md: "txt",
|
|
37591
|
+
markdown: "txt",
|
|
37592
|
+
log: "txt",
|
|
37593
|
+
json: "txt",
|
|
37594
|
+
xml: "txt",
|
|
37595
|
+
html: "txt",
|
|
37596
|
+
htm: "txt",
|
|
37597
|
+
yml: "txt",
|
|
37598
|
+
yaml: "txt",
|
|
37599
|
+
ini: "txt",
|
|
37600
|
+
conf: "txt",
|
|
37601
|
+
sql: "txt"
|
|
37555
37602
|
};
|
|
37556
37603
|
const props = __props;
|
|
37557
37604
|
const dict = useLocaleDict(() => props.locale);
|
|
@@ -37568,9 +37615,9 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
37568
37615
|
return `${Number.isInteger(mb) ? mb : mb.toFixed(1)}MB`;
|
|
37569
37616
|
});
|
|
37570
37617
|
const isImage = computed(() => props.fileType === "image");
|
|
37571
|
-
const
|
|
37618
|
+
const docIconKind = computed(() => {
|
|
37572
37619
|
const ext = props.name.includes(".") ? props.name.split(".").pop().toLowerCase() : "";
|
|
37573
|
-
return EXT_ICON[ext] ??
|
|
37620
|
+
return EXT_ICON[ext] ?? "file";
|
|
37574
37621
|
});
|
|
37575
37622
|
const thumbStyle = computed(() => {
|
|
37576
37623
|
const s = props.imageSize || "";
|
|
@@ -37620,10 +37667,10 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
37620
37667
|
Fragment,
|
|
37621
37668
|
{ key: 1 },
|
|
37622
37669
|
[
|
|
37623
|
-
createCommentVNode(" \u6587\u6863\u6A21\u5F0F:\u6309\u6269\u5C55\u540D\u6620\u5C04\u7C7B\u578B\u56FE\u6807 + \u540D\u79F0/\u5927\u5C0F "),
|
|
37670
|
+
createCommentVNode(" \u6587\u6863\u6A21\u5F0F:\u6309\u6269\u5C55\u540D\u6620\u5C04\u8BBE\u8BA1\u7A3F\u7C7B\u578B\u56FE\u6807 + \u540D\u79F0/\u5927\u5C0F "),
|
|
37624
37671
|
createVNode(unref(ElIcon), { class: "fv-files-card-icon" }, {
|
|
37625
37672
|
default: withCtx(() => [
|
|
37626
|
-
(
|
|
37673
|
+
createVNode(unref(FileIcon), { kind: docIconKind.value }, null, 8, ["kind"])
|
|
37627
37674
|
]),
|
|
37628
37675
|
_: 1
|
|
37629
37676
|
/* STABLE */
|
|
@@ -37637,29 +37684,36 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
37637
37684
|
class: "fv-files-card-name",
|
|
37638
37685
|
title: __props.name
|
|
37639
37686
|
}, toDisplayString(__props.name), 9, _hoisted_3$6),
|
|
37640
|
-
createCommentVNode(" error \u5E26\u6587\u6848\u65F6\u66FF\u4EE3\u5927\u5C0F\u884C(\u4E0A\u4F20\u5931\u8D25\u539F\u56E0);\u5426\u5219\u56DE\u843D\u5927\u5C0F "),
|
|
37687
|
+
createCommentVNode(" error \u5E26\u6587\u6848\u65F6\u66FF\u4EE3\u5927\u5C0F\u884C(\u4E0A\u4F20\u5931\u8D25\u539F\u56E0);loading \u663E\u793A\u300C\u4E0A\u4F20\u4E2D\u2026\u300D;\u5426\u5219\u56DE\u843D\u5927\u5C0F "),
|
|
37641
37688
|
__props.status === "error" && __props.errorText ? (openBlock(), createElementBlock("div", {
|
|
37642
37689
|
key: 0,
|
|
37643
37690
|
class: "fv-files-card-error",
|
|
37644
37691
|
title: __props.errorText
|
|
37645
|
-
}, toDisplayString(__props.errorText), 9, _hoisted_4$4)) :
|
|
37692
|
+
}, toDisplayString(__props.errorText), 9, _hoisted_4$4)) : __props.status === "loading" ? (openBlock(), createElementBlock(
|
|
37646
37693
|
"div",
|
|
37647
37694
|
_hoisted_5$3,
|
|
37695
|
+
toDisplayString(unref(dict).attachments.uploading),
|
|
37696
|
+
1
|
|
37697
|
+
/* TEXT */
|
|
37698
|
+
)) : sizeText.value ? (openBlock(), createElementBlock(
|
|
37699
|
+
"div",
|
|
37700
|
+
_hoisted_6$2,
|
|
37648
37701
|
toDisplayString(sizeText.value),
|
|
37649
37702
|
1
|
|
37650
37703
|
/* TEXT */
|
|
37651
37704
|
)) : createCommentVNode("v-if", true)
|
|
37652
37705
|
]),
|
|
37653
|
-
createCommentVNode(" \u72B6\u6001
|
|
37654
|
-
__props.status === "loading" ? (openBlock(),
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
|
|
37706
|
+
createCommentVNode(" \u72B6\u6001:loading \u65F6\u56FE\u6807\u4F4D\u6362 spinner(\u540D\u79F0\u884C\u65C1\u300C\u4E0A\u4F20\u4E2D\u2026\u300D\u6587\u6848\u8F85\u52A9) "),
|
|
37707
|
+
__props.status === "loading" ? (openBlock(), createBlock(unref(ElIcon), {
|
|
37708
|
+
key: 2,
|
|
37709
|
+
class: "fv-files-card-loading"
|
|
37710
|
+
}, {
|
|
37711
|
+
default: withCtx(() => [
|
|
37712
|
+
createVNode(unref(Loading))
|
|
37713
|
+
]),
|
|
37714
|
+
_: 1
|
|
37715
|
+
/* STABLE */
|
|
37716
|
+
})) : createCommentVNode("v-if", true),
|
|
37663
37717
|
createCommentVNode(" \u53F3\u4E0A\u5220\u9664\u6309\u94AE "),
|
|
37664
37718
|
createElementVNode("button", {
|
|
37665
37719
|
type: "button",
|
|
@@ -37722,9 +37776,19 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
37722
37776
|
function isFull() {
|
|
37723
37777
|
return props.count > 0 && innerList.value.length >= props.count;
|
|
37724
37778
|
}
|
|
37779
|
+
const IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "ico", "heic", "heif", "avif", "tiff"]);
|
|
37780
|
+
function tokenIsImage(t) {
|
|
37781
|
+
const s = t.trim().toLowerCase();
|
|
37782
|
+
if (s.startsWith("image/")) return true;
|
|
37783
|
+
return s.startsWith(".") && IMAGE_EXTS.has(s.slice(1));
|
|
37784
|
+
}
|
|
37785
|
+
function acceptIsImageOnly(accept) {
|
|
37786
|
+
const tokens = accept.split(",").filter((t) => t.trim());
|
|
37787
|
+
return tokens.length > 0 && tokens.every(tokenIsImage);
|
|
37788
|
+
}
|
|
37725
37789
|
function isImageFile(file) {
|
|
37726
|
-
if (file.type
|
|
37727
|
-
return
|
|
37790
|
+
if (file.type) return file.type.startsWith("image/");
|
|
37791
|
+
return acceptIsImageOnly(props.accept);
|
|
37728
37792
|
}
|
|
37729
37793
|
function createUrl(file) {
|
|
37730
37794
|
try {
|
|
@@ -38864,32 +38928,30 @@ const _hoisted_13 = {
|
|
|
38864
38928
|
"aria-live": "polite"
|
|
38865
38929
|
};
|
|
38866
38930
|
const _hoisted_14 = { class: "fv-msg-pending-text" };
|
|
38867
|
-
const _hoisted_15 = {
|
|
38868
|
-
|
|
38869
|
-
|
|
38870
|
-
};
|
|
38871
|
-
const _hoisted_16 = ["aria-label"];
|
|
38872
|
-
const _hoisted_17 = ["disabled", "onClick"];
|
|
38873
|
-
const _hoisted_18 = {
|
|
38874
|
-
key: 7,
|
|
38931
|
+
const _hoisted_15 = { class: "fv-msg-content fv-msg-content-user" };
|
|
38932
|
+
const _hoisted_16 = {
|
|
38933
|
+
key: 6,
|
|
38875
38934
|
class: "fv-msg-actions"
|
|
38876
38935
|
};
|
|
38877
|
-
const
|
|
38936
|
+
const _hoisted_17 = {
|
|
38878
38937
|
key: 3,
|
|
38879
38938
|
class: "fv-msg-feedback"
|
|
38880
38939
|
};
|
|
38881
|
-
const
|
|
38882
|
-
const _hoisted_21 = { class: "fv-msg-feedback-pop-title" };
|
|
38883
|
-
const _hoisted_22 = { class: "fv-msg-feedback-pop-actions" };
|
|
38884
|
-
const _hoisted_23 = {
|
|
38940
|
+
const _hoisted_18 = {
|
|
38885
38941
|
key: 0,
|
|
38886
38942
|
class: "fv-msg-branch"
|
|
38887
38943
|
};
|
|
38888
|
-
const
|
|
38889
|
-
const
|
|
38944
|
+
const _hoisted_19 = { class: "fv-msg-branch-label" };
|
|
38945
|
+
const _hoisted_20 = {
|
|
38890
38946
|
key: 1,
|
|
38891
38947
|
class: "fv-msg-time"
|
|
38892
38948
|
};
|
|
38949
|
+
const _hoisted_21 = ["aria-label"];
|
|
38950
|
+
const _hoisted_22 = {
|
|
38951
|
+
key: 0,
|
|
38952
|
+
class: "fv-msg-followups-title"
|
|
38953
|
+
};
|
|
38954
|
+
const _hoisted_23 = ["disabled", "onClick"];
|
|
38893
38955
|
const LOADING_PHRASE_INTERVAL = 3e3;
|
|
38894
38956
|
var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
38895
38957
|
...{ name: "FvAiMessage" },
|
|
@@ -38898,6 +38960,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
38898
38960
|
message: { type: Object, required: true },
|
|
38899
38961
|
branch: { type: Object, required: false, default: void 0 },
|
|
38900
38962
|
isLast: { type: Boolean, required: false, default: false },
|
|
38963
|
+
followupStyle: { type: String, required: false, default: "list" },
|
|
38901
38964
|
showActions: { type: Boolean, required: false, default: true },
|
|
38902
38965
|
showBranchSwitch: { type: Boolean, required: false, default: true },
|
|
38903
38966
|
showUserAvatar: { type: Boolean, required: false, default: false },
|
|
@@ -39114,11 +39177,12 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39114
39177
|
if (phraseTimer !== null) clearInterval(phraseTimer);
|
|
39115
39178
|
});
|
|
39116
39179
|
const followups = computed(() => {
|
|
39117
|
-
if (
|
|
39180
|
+
if (isUser.value) return [];
|
|
39118
39181
|
const s = props.message.suggestions;
|
|
39119
39182
|
return s && s.length ? s : [];
|
|
39120
39183
|
});
|
|
39121
39184
|
const followupsEnabled = computed(() => props.message.status === "done");
|
|
39185
|
+
const followupTitle = computed(() => dict.value.aiMessage.followupsTitle);
|
|
39122
39186
|
function onFollowup(item) {
|
|
39123
39187
|
if (!followupsEnabled.value) return;
|
|
39124
39188
|
emit("followup-select", item, props.message);
|
|
@@ -39126,29 +39190,26 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39126
39190
|
const feedbackVisible = computed(
|
|
39127
39191
|
() => !isUser.value && props.message.status === "done" && !!props.feedbackHandler
|
|
39128
39192
|
);
|
|
39193
|
+
const actionsVisible = computed(
|
|
39194
|
+
() => props.showActions && (isUser.value || props.message.status === "done")
|
|
39195
|
+
);
|
|
39129
39196
|
const feedbackAction = computed(
|
|
39130
39197
|
() => props.message.feedback?.action ?? null
|
|
39131
39198
|
);
|
|
39199
|
+
const feedbackDialogTitle = computed(
|
|
39200
|
+
() => dict.value.aiMessage.feedback.dislikeTitle.split("{name}").join(props.assistantName || dict.value.aiMessage.defaultAssistantName)
|
|
39201
|
+
);
|
|
39202
|
+
const feedbackCommentPlaceholder = computed(() => dict.value.aiMessage.feedback.dislikePlaceholder);
|
|
39132
39203
|
const isToolOnlyRow = computed(
|
|
39133
39204
|
() => !isUser.value && !props.message.content && hasToolSteps.value
|
|
39134
39205
|
);
|
|
39135
39206
|
const dislikePopVisible = ref(false);
|
|
39136
39207
|
const dislikeComment = ref("");
|
|
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
39208
|
watch(dislikePopVisible, (on) => {
|
|
39148
|
-
if (on)
|
|
39149
|
-
else document.removeEventListener("mousedown", onDocMousedown, true);
|
|
39209
|
+
if (on) nextTick(() => commentTextareaRef.value?.focus());
|
|
39150
39210
|
});
|
|
39151
|
-
|
|
39211
|
+
const feedbackPending = ref(false);
|
|
39212
|
+
const commentTextareaRef = ref(null);
|
|
39152
39213
|
async function submitFeedback(next, comment) {
|
|
39153
39214
|
const handler = props.feedbackHandler;
|
|
39154
39215
|
if (!handler || feedbackPending.value) return;
|
|
@@ -39206,7 +39267,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39206
39267
|
const previewList = computed(() => (props.message.files ?? []).filter((f) => f.type === "image"));
|
|
39207
39268
|
const previewVisible = ref(false);
|
|
39208
39269
|
const previewIndex = ref(0);
|
|
39209
|
-
function onFileClick(f,
|
|
39270
|
+
function onFileClick(f, _index) {
|
|
39210
39271
|
emit("file-click", f, props.message);
|
|
39211
39272
|
if (f.type === "image" && displayUrl(f)) {
|
|
39212
39273
|
previewIndex.value = Math.max(0, previewList.value.findIndex((x) => x.id === f.id));
|
|
@@ -39294,7 +39355,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39294
39355
|
/* TEXT */
|
|
39295
39356
|
)) : createCommentVNode("v-if", true)
|
|
39296
39357
|
])) : createCommentVNode("v-if", true),
|
|
39297
|
-
createCommentVNode(" \u9644\u4EF6:user \u6D88\u606F files \u5E73\u94FA;\u56FE\u7247\u7F29\u7565\u53EF\u70B9(\u5185\u7F6E\u653E\u5927\u9884\u89C8),\u6587\u6863\u540D\
|
|
39358
|
+
createCommentVNode(" \u9644\u4EF6:user \u6D88\u606F files \u5E73\u94FA;\u56FE\u7247\u7F29\u7565\u53EF\u70B9(\u5185\u7F6E\u653E\u5927\u9884\u89C8),\u6587\u6863\u590D\u7528\r\n sender \u7684 FilesCard \u5361\u7247(\u7C7B\u578B\u56FE\u6807 + \u540D\u79F0/\u5927\u5C0F,\u70B9\u51FB\u5BBF\u4E3B\u4E0B\u8F7D) "),
|
|
39298
39359
|
__props.message.files?.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
39299
39360
|
renderSlot(_ctx.$slots, "message-files", {
|
|
39300
39361
|
message: __props.message,
|
|
@@ -39304,26 +39365,43 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39304
39365
|
Fragment,
|
|
39305
39366
|
null,
|
|
39306
39367
|
renderList(__props.message.files, (f, i) => {
|
|
39307
|
-
return openBlock(), createElementBlock(
|
|
39308
|
-
|
|
39309
|
-
|
|
39310
|
-
|
|
39311
|
-
|
|
39312
|
-
|
|
39313
|
-
|
|
39314
|
-
|
|
39315
|
-
|
|
39316
|
-
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39326
|
-
|
|
39368
|
+
return openBlock(), createElementBlock(
|
|
39369
|
+
Fragment,
|
|
39370
|
+
{
|
|
39371
|
+
key: f.id
|
|
39372
|
+
},
|
|
39373
|
+
[
|
|
39374
|
+
f.type === "image" ? (openBlock(), createElementBlock("button", {
|
|
39375
|
+
key: 0,
|
|
39376
|
+
type: "button",
|
|
39377
|
+
class: "fv-msg-file is-image",
|
|
39378
|
+
title: f.name,
|
|
39379
|
+
onClick: ($event) => onFileClick(f)
|
|
39380
|
+
}, [
|
|
39381
|
+
displayUrl(f) ? (openBlock(), createElementBlock("img", {
|
|
39382
|
+
key: 0,
|
|
39383
|
+
class: "fv-msg-file-img",
|
|
39384
|
+
src: displayUrl(f),
|
|
39385
|
+
alt: f.name
|
|
39386
|
+
}, null, 8, _hoisted_9)) : (openBlock(), createElementBlock(
|
|
39387
|
+
"span",
|
|
39388
|
+
_hoisted_10,
|
|
39389
|
+
toDisplayString(f.name),
|
|
39390
|
+
1
|
|
39391
|
+
/* TEXT */
|
|
39392
|
+
))
|
|
39393
|
+
], 8, _hoisted_8)) : (openBlock(), createBlock(_sfc_main$6, {
|
|
39394
|
+
key: 1,
|
|
39395
|
+
class: "fv-msg-file-card",
|
|
39396
|
+
name: f.name,
|
|
39397
|
+
size: f.size,
|
|
39398
|
+
"file-type": "file",
|
|
39399
|
+
onClick: ($event) => onFileClick(f)
|
|
39400
|
+
}, null, 8, ["name", "size", "onClick"]))
|
|
39401
|
+
],
|
|
39402
|
+
64
|
|
39403
|
+
/* STABLE_FRAGMENT */
|
|
39404
|
+
);
|
|
39327
39405
|
}),
|
|
39328
39406
|
128
|
|
39329
39407
|
/* KEYED_FRAGMENT */
|
|
@@ -39389,7 +39467,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39389
39467
|
key: "0"
|
|
39390
39468
|
} : void 0
|
|
39391
39469
|
]), 1032, ["modelValue", "status", "hide-header", "class"])) : createCommentVNode("v-if", true),
|
|
39392
|
-
createCommentVNode(" \u6B63\u6587:user \u7EAF\u6587\u672C\u6C14\u6CE1;assistant Markdown;pending \u7A7A\u5185\u5BB9\u7ED9\u52A0\u8F7D\u5360\u4F4D "),
|
|
39470
|
+
createCommentVNode(" \u6B63\u6587:user \u7EAF\u6587\u672C\u6C14\u6CE1(\u4EC5\u6709\u9644\u4EF6\u65E0\u6587\u5B57\u65F6\u4E0D\u6E32\u67D3\u7A7A\u6C14\u6CE1);assistant Markdown;pending \u7A7A\u5185\u5BB9\u7ED9\u52A0\u8F7D\u5360\u4F4D "),
|
|
39393
39471
|
!isUser.value ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
39394
39472
|
__props.message.status === "error" ? (openBlock(), createElementBlock(
|
|
39395
39473
|
"span",
|
|
@@ -39417,7 +39495,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39417
39495
|
[
|
|
39418
39496
|
createCommentVNode(" \u751F\u6210\u4E2D\u5360\u4F4D:\u4E3B\u9898\u8272\u5708\u5708 spinner + \u8F6E\u6362\u6587\u6848(loadingPhrases,3s \u8F6E\u6362);\r\n \u6709\u5DE5\u5177\u8F68\u8FF9\u65F6\u4E0D\u91CD\u590D\u5360\u4F4D(Thinking \u5934\u5DF2\u662F\u300C\u601D\u8003\u4E2D...\u300D) "),
|
|
39419
39497
|
createElementVNode("span", _hoisted_13, [
|
|
39420
|
-
_cache[
|
|
39498
|
+
_cache[11] || (_cache[11] = createElementVNode(
|
|
39421
39499
|
"span",
|
|
39422
39500
|
{
|
|
39423
39501
|
class: "fv-msg-spinner",
|
|
@@ -39439,42 +39517,26 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39439
39517
|
2112
|
|
39440
39518
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
39441
39519
|
)) : createCommentVNode("v-if", true)
|
|
39442
|
-
])) : (openBlock(), createElementBlock(
|
|
39443
|
-
|
|
39444
|
-
|
|
39445
|
-
|
|
39446
|
-
|
|
39447
|
-
|
|
39448
|
-
|
|
39449
|
-
|
|
39450
|
-
|
|
39451
|
-
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
|
|
39455
|
-
|
|
39456
|
-
|
|
39457
|
-
|
|
39458
|
-
|
|
39459
|
-
|
|
39460
|
-
return openBlock(), createElementBlock("button", {
|
|
39461
|
-
key: `${i}-${item}`,
|
|
39462
|
-
type: "button",
|
|
39463
|
-
class: normalizeClass(["fv-msg-followup", { "is-disabled": !followupsEnabled.value }]),
|
|
39464
|
-
disabled: !followupsEnabled.value,
|
|
39465
|
-
role: "option",
|
|
39466
|
-
"aria-selected": false,
|
|
39467
|
-
onClick: ($event) => onFollowup(item)
|
|
39468
|
-
}, toDisplayString(item), 11, _hoisted_17);
|
|
39469
|
-
}),
|
|
39470
|
-
128
|
|
39471
|
-
/* KEYED_FRAGMENT */
|
|
39472
|
-
))
|
|
39473
|
-
], 8, _hoisted_16)) : createCommentVNode("v-if", true),
|
|
39474
|
-
createCommentVNode(" \u64CD\u4F5C\u533A:assistant \u590D\u5236/\u91CD\u751F\u6210 + \u6D88\u606F\u8BC4\u4EF7 + \u5206\u652F\u5207\u6362;user \u4EC5\u590D\u5236(hover \u6D88\u606F\u65F6\u6D6E\u73B0,\u89C1 scss)\u3002\r\n feedbackVisible \u72EC\u7ACB\u4E8E showActions:\u5173\u95ED\u64CD\u4F5C\u6309\u94AE\u4E0D\u541E\u8BC4\u4EF7\u5165\u53E3 "),
|
|
39475
|
-
feedbackVisible.value || __props.showActions || __props.showBranchSwitch && __props.branch && __props.branch.count > 1 ? (openBlock(), createElementBlock("div", _hoisted_18, [
|
|
39520
|
+
])) : __props.message.content ? (openBlock(), createElementBlock(
|
|
39521
|
+
Fragment,
|
|
39522
|
+
{ key: 5 },
|
|
39523
|
+
[
|
|
39524
|
+
createCommentVNode(" user \u6B63\u6587:\u53EA\u4F20\u9644\u4EF6\u65E0\u6587\u5B57\u65F6\u4E0D\u6E32\u67D3\u8BE5 div(\u7A7A\u5185\u5BB9\u6C14\u6CE1\u65E0\u4FE1\u606F\u91CF) "),
|
|
39525
|
+
createElementVNode(
|
|
39526
|
+
"div",
|
|
39527
|
+
_hoisted_15,
|
|
39528
|
+
toDisplayString(__props.message.content),
|
|
39529
|
+
1
|
|
39530
|
+
/* TEXT */
|
|
39531
|
+
)
|
|
39532
|
+
],
|
|
39533
|
+
2112
|
|
39534
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
39535
|
+
)) : createCommentVNode("v-if", true),
|
|
39536
|
+
createCommentVNode(" \u64CD\u4F5C\u533A:assistant \u590D\u5236/\u91CD\u751F\u6210 + \u6D88\u606F\u8BC4\u4EF7 + \u5206\u652F\u5207\u6362;user \u4EC5\u590D\u5236(hover \u6D88\u606F\u65F6\u6D6E\u73B0,\u89C1 scss)\u3002\r\n \u590D\u5236/\u91CD\u751F\u6210\u6309\u94AE\u5F85\u56DE\u7B54\u843D\u5B9A(status=done)\u624D\u6E32\u67D3\u2014\u2014\u751F\u6210\u4E2D(pending/streaming)\u4E0D\u51FA\u5DE5\u5177\u6309\u94AE;\r\n error \u65E0\u53EF\u590D\u5236/\u91CD\u751F\u6210\u6B63\u6587\u4E5F\u4E0D\u51FA;\u5206\u652F\u5207\u6362\u5668\u4E0E\u65F6\u95F4\u4E0D\u53D7\u6B64\u95E8\u63A7,\u751F\u6210\u4E2D\u4ECD\u53EF\u5207\u5206\u652F/\u663E\u65F6\u95F4\u3002\r\n feedbackVisible \u72EC\u7ACB\u4E8E showActions:\u5173\u95ED\u64CD\u4F5C\u6309\u94AE\u4E0D\u541E\u8BC4\u4EF7\u5165\u53E3\u3002\r\n \u5BB9\u5668\u663E\u9690 = \u4EFB\u4E00\u5185\u4EF6\u5728\u573A(\u64CD\u4F5C\u6309\u94AE/\u8BC4\u4EF7/\u5206\u652F/\u65F6\u95F4),\u5168\u90E8\u7F3A\u5E2D\u624D\u4E0D\u6E32\u67D3,\u907F\u514D\u7A7A\u64CD\u4F5C\u533A\u5360\u4F4D "),
|
|
39537
|
+
actionsVisible.value || feedbackVisible.value && !isToolOnlyRow.value || __props.showBranchSwitch && __props.branch && __props.branch.count > 1 || messageTimeText.value && timeVisible.value ? (openBlock(), createElementBlock("div", _hoisted_16, [
|
|
39476
39538
|
renderSlot(_ctx.$slots, "message-actions", { message: __props.message }, () => [
|
|
39477
|
-
|
|
39539
|
+
actionsVisible.value && isUser.value ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
39478
39540
|
key: 0,
|
|
39479
39541
|
content: unref(dict).aiMessage.copy,
|
|
39480
39542
|
placement: "top"
|
|
@@ -39503,7 +39565,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39503
39565
|
_: 1
|
|
39504
39566
|
/* STABLE */
|
|
39505
39567
|
}, 8, ["content"])) : createCommentVNode("v-if", true),
|
|
39506
|
-
|
|
39568
|
+
actionsVisible.value && !isUser.value ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
39507
39569
|
key: 1,
|
|
39508
39570
|
content: unref(dict).aiMessage.copy,
|
|
39509
39571
|
placement: "top"
|
|
@@ -39532,7 +39594,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39532
39594
|
_: 1
|
|
39533
39595
|
/* STABLE */
|
|
39534
39596
|
}, 8, ["content"])) : createCommentVNode("v-if", true),
|
|
39535
|
-
|
|
39597
|
+
actionsVisible.value && !isUser.value ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
39536
39598
|
key: 2,
|
|
39537
39599
|
content: unref(dict).aiMessage.regenerate,
|
|
39538
39600
|
placement: "top"
|
|
@@ -39561,8 +39623,8 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39561
39623
|
_: 1
|
|
39562
39624
|
/* STABLE */
|
|
39563
39625
|
}, 8, ["content"])) : createCommentVNode("v-if", true),
|
|
39564
|
-
createCommentVNode(" \u6D88\u606F\u8BC4\u4EF7 \u{1F44D}/\u{1F44E}(assistant \u6700\u7EC8\u56DE\u7B54\u884C;\u518D\u6B21\u70B9\u51FB\u5F53\u524D\u6001\u53D6\u6D88):\r\n \u70B9\u8E29\u5E26\u9644\u8A00\u5F39\
|
|
39565
|
-
feedbackVisible.value && !isToolOnlyRow.value ? (openBlock(), createElementBlock("span",
|
|
39626
|
+
createCommentVNode(" \u6D88\u606F\u8BC4\u4EF7 \u{1F44D}/\u{1F44E}(assistant \u6700\u7EC8\u56DE\u7B54\u884C;\u518D\u6B21\u70B9\u51FB\u5F53\u524D\u6001\u53D6\u6D88):\r\n \u70B9\u8E29\u5E26\u9644\u8A00\u5F39\u7A97(\u5C45\u4E2D ElDialog,textarea \u2264500 \u53EF\u8DF3\u8FC7),\u4E50\u89C2\u66F4\u65B0\u5931\u8D25\u56DE\u6EDA "),
|
|
39627
|
+
feedbackVisible.value && !isToolOnlyRow.value ? (openBlock(), createElementBlock("span", _hoisted_17, [
|
|
39566
39628
|
createVNode(unref(ElTooltip), {
|
|
39567
39629
|
content: unref(dict).aiMessage.feedback.like,
|
|
39568
39630
|
placement: "top"
|
|
@@ -39628,77 +39690,18 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39628
39690
|
]),
|
|
39629
39691
|
_: 1
|
|
39630
39692
|
/* STABLE */
|
|
39631
|
-
}, 8, ["content"])
|
|
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 "),
|
|
39633
|
-
dislikePopVisible.value ? (openBlock(), createElementBlock("div", {
|
|
39634
|
-
key: 0,
|
|
39635
|
-
ref_key: "feedbackPopRef",
|
|
39636
|
-
ref: feedbackPopRef,
|
|
39637
|
-
class: "fv-msg-feedback-pop",
|
|
39638
|
-
role: "dialog",
|
|
39639
|
-
"aria-label": unref(dict).aiMessage.feedback.dislikeTitle
|
|
39640
|
-
}, [
|
|
39641
|
-
createElementVNode(
|
|
39642
|
-
"div",
|
|
39643
|
-
_hoisted_21,
|
|
39644
|
-
toDisplayString(unref(dict).aiMessage.feedback.dislikeTitle),
|
|
39645
|
-
1
|
|
39646
|
-
/* TEXT */
|
|
39647
|
-
),
|
|
39648
|
-
createVNode(unref(ElInput), {
|
|
39649
|
-
modelValue: dislikeComment.value,
|
|
39650
|
-
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => dislikeComment.value = $event),
|
|
39651
|
-
type: "textarea",
|
|
39652
|
-
rows: 3,
|
|
39653
|
-
maxlength: "500",
|
|
39654
|
-
"show-word-limit": "",
|
|
39655
|
-
placeholder: unref(dict).aiMessage.feedback.dislikePlaceholder
|
|
39656
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
39657
|
-
createElementVNode("div", _hoisted_22, [
|
|
39658
|
-
createVNode(unref(ElButton), {
|
|
39659
|
-
size: "small",
|
|
39660
|
-
text: "",
|
|
39661
|
-
onClick: onDislikeSkip
|
|
39662
|
-
}, {
|
|
39663
|
-
default: withCtx(() => [
|
|
39664
|
-
createTextVNode(
|
|
39665
|
-
toDisplayString(unref(dict).aiMessage.feedback.skip),
|
|
39666
|
-
1
|
|
39667
|
-
/* TEXT */
|
|
39668
|
-
)
|
|
39669
|
-
]),
|
|
39670
|
-
_: 1
|
|
39671
|
-
/* STABLE */
|
|
39672
|
-
}),
|
|
39673
|
-
createVNode(unref(ElButton), {
|
|
39674
|
-
size: "small",
|
|
39675
|
-
type: "primary",
|
|
39676
|
-
loading: feedbackPending.value,
|
|
39677
|
-
onClick: onDislikeSubmit
|
|
39678
|
-
}, {
|
|
39679
|
-
default: withCtx(() => [
|
|
39680
|
-
createTextVNode(
|
|
39681
|
-
toDisplayString(unref(dict).aiMessage.feedback.submit),
|
|
39682
|
-
1
|
|
39683
|
-
/* TEXT */
|
|
39684
|
-
)
|
|
39685
|
-
]),
|
|
39686
|
-
_: 1
|
|
39687
|
-
/* STABLE */
|
|
39688
|
-
}, 8, ["loading"])
|
|
39689
|
-
])
|
|
39690
|
-
], 8, _hoisted_20)) : createCommentVNode("v-if", true)
|
|
39693
|
+
}, 8, ["content"])
|
|
39691
39694
|
])) : createCommentVNode("v-if", true)
|
|
39692
39695
|
]),
|
|
39693
39696
|
createCommentVNode(" \u5206\u652F\u5207\u6362:\u5144\u5F1F\u5206\u652F > 1 \u65F6 "),
|
|
39694
|
-
__props.showBranchSwitch && __props.branch && __props.branch.count > 1 ? (openBlock(), createElementBlock("span",
|
|
39697
|
+
__props.showBranchSwitch && __props.branch && __props.branch.count > 1 ? (openBlock(), createElementBlock("span", _hoisted_18, [
|
|
39695
39698
|
createVNode(unref(ElButton), {
|
|
39696
39699
|
text: "",
|
|
39697
39700
|
size: "small",
|
|
39698
39701
|
class: "fv-msg-action",
|
|
39699
39702
|
disabled: __props.branch.index <= 1,
|
|
39700
39703
|
"aria-label": unref(dict).aiMessage.prevBranch,
|
|
39701
|
-
onClick: _cache[
|
|
39704
|
+
onClick: _cache[7] || (_cache[7] = ($event) => onBranch("prev"))
|
|
39702
39705
|
}, {
|
|
39703
39706
|
default: withCtx(() => [
|
|
39704
39707
|
createVNode(unref(ElIcon), null, {
|
|
@@ -39714,7 +39717,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39714
39717
|
}, 8, ["disabled", "aria-label"]),
|
|
39715
39718
|
createElementVNode(
|
|
39716
39719
|
"span",
|
|
39717
|
-
|
|
39720
|
+
_hoisted_19,
|
|
39718
39721
|
toDisplayString(__props.branch.index) + " / " + toDisplayString(__props.branch.count),
|
|
39719
39722
|
1
|
|
39720
39723
|
/* TEXT */
|
|
@@ -39725,7 +39728,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39725
39728
|
class: "fv-msg-action",
|
|
39726
39729
|
disabled: __props.branch.index >= __props.branch.count,
|
|
39727
39730
|
"aria-label": unref(dict).aiMessage.nextBranch,
|
|
39728
|
-
onClick: _cache[
|
|
39731
|
+
onClick: _cache[8] || (_cache[8] = ($event) => onBranch("next"))
|
|
39729
39732
|
}, {
|
|
39730
39733
|
default: withCtx(() => [
|
|
39731
39734
|
createVNode(unref(ElIcon), null, {
|
|
@@ -39743,13 +39746,102 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
39743
39746
|
createCommentVNode(" \u6D88\u606F\u65F6\u95F4:\u8DDF\u5728\u64CD\u4F5C\u6309\u94AE\u4E0E\u5206\u652F\u5207\u6362\u4E4B\u540E;user \u6D88\u606F hover \u9690\u85CF\u6309\u94AE\u4E0D\u5F71\u54CD\u65F6\u95F4\u5E38\u9A7B;\r\n assistant \u751F\u6210\u4E2D\u4E0D\u663E,\u6B63\u6587\u6253\u5B8C\u5B57(\u6216 error)\u540E\u624D\u6D6E\u73B0 "),
|
|
39744
39747
|
messageTimeText.value && timeVisible.value ? (openBlock(), createElementBlock(
|
|
39745
39748
|
"span",
|
|
39746
|
-
|
|
39749
|
+
_hoisted_20,
|
|
39747
39750
|
toDisplayString(messageTimeText.value),
|
|
39748
39751
|
1
|
|
39749
39752
|
/* TEXT */
|
|
39750
39753
|
)) : createCommentVNode("v-if", true)
|
|
39751
|
-
])) : createCommentVNode("v-if", true)
|
|
39752
|
-
|
|
39754
|
+
])) : createCommentVNode("v-if", true),
|
|
39755
|
+
createCommentVNode(" \u8FFD\u95EE\u5EFA\u8BAE:\u64CD\u4F5C\u533A(\u5DE5\u5177\u680F)\u4E0B\u65B9,\u5206\u9694\u7EBF + \u7070\u8272\u300C\u8FFD\u95EE\u300D\u6807\u9898\u5F15\u51FA;\u7EB5\u5411\u5217\u8868\u4E00\u884C\u4E00\u6761\r\n (followupStyle='chips' \u5207\u56DE\u65E7\u6A2A\u5411\u6C14\u6CE1\u5F62\u6001,\u65E0\u6807\u9898)\u3002\u5386\u53F2\u6D88\u606F\u540C\u6837\u6E32\u67D3;\r\n \u6D41\u5F0F(message_end \u524D)\u7981\u7528\u9632\u8BEF\u70B9,\u843D\u5B9A\u540E\u53EF\u70B9\u51FB,\u70B9\u51FB\u7ECF followup-select \u4E0A\u629B "),
|
|
39756
|
+
followups.value.length ? (openBlock(), createElementBlock("div", {
|
|
39757
|
+
key: 7,
|
|
39758
|
+
class: normalizeClass(["fv-msg-followups", `is-${__props.followupStyle}`]),
|
|
39759
|
+
role: "listbox",
|
|
39760
|
+
"aria-label": unref(dict).aiMessage.followups
|
|
39761
|
+
}, [
|
|
39762
|
+
__props.followupStyle === "list" ? (openBlock(), createElementBlock(
|
|
39763
|
+
"span",
|
|
39764
|
+
_hoisted_22,
|
|
39765
|
+
toDisplayString(followupTitle.value),
|
|
39766
|
+
1
|
|
39767
|
+
/* TEXT */
|
|
39768
|
+
)) : createCommentVNode("v-if", true),
|
|
39769
|
+
(openBlock(true), createElementBlock(
|
|
39770
|
+
Fragment,
|
|
39771
|
+
null,
|
|
39772
|
+
renderList(followups.value, (item, i) => {
|
|
39773
|
+
return openBlock(), createElementBlock("button", {
|
|
39774
|
+
key: `${i}-${item}`,
|
|
39775
|
+
type: "button",
|
|
39776
|
+
class: normalizeClass(["fv-msg-followup", { "is-disabled": !followupsEnabled.value }]),
|
|
39777
|
+
disabled: !followupsEnabled.value,
|
|
39778
|
+
role: "option",
|
|
39779
|
+
"aria-selected": false,
|
|
39780
|
+
onClick: ($event) => onFollowup(item)
|
|
39781
|
+
}, toDisplayString(item), 11, _hoisted_23);
|
|
39782
|
+
}),
|
|
39783
|
+
128
|
|
39784
|
+
/* KEYED_FRAGMENT */
|
|
39785
|
+
))
|
|
39786
|
+
], 10, _hoisted_21)) : createCommentVNode("v-if", true)
|
|
39787
|
+
]),
|
|
39788
|
+
createCommentVNode(" \u70B9\u8E29\u9644\u8A00\u5F39\u7A97:\u5C45\u4E2D\u5F39\u7A97(ElDialog,teleported + align-center),\u4E0D\u518D\u968F\u64CD\u4F5C\u533A\u5B9A\u4F4D\u2014\u2014\r\n \u6700\u5E95\u4E00\u6761\u6D88\u606F\u7684\u9644\u8A00\u5C42\u5F80\u4E0B\u5F39\u4F1A\u88AB\u6EDA\u52A8\u533A\u88C1\u526A,\u4E0D\u6613\u6EDA\u5230\u5E95\u770B\u5230;\u5F39\u7A97\u5C45\u4E2D\u4E00\u5C4F\u5185\u53EF\u89C1\u3002\r\n \u70B9\u906E\u7F69/ESC \u5173\u95ED(\u8349\u7A3F\u4FDD\u7559\u5728\u672C\u5730,\u518D\u70B9 \u{1F44E} \u590D\u586B);submit/skip \u8BED\u4E49\u540C\u64CD\u4F5C\u533A\u6309\u94AE "),
|
|
39789
|
+
feedbackVisible.value && !isToolOnlyRow.value ? (openBlock(), createBlock(unref(ElDialog), {
|
|
39790
|
+
key: 1,
|
|
39791
|
+
modelValue: dislikePopVisible.value,
|
|
39792
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => dislikePopVisible.value = $event),
|
|
39793
|
+
class: "fv-msg-feedback-dialog",
|
|
39794
|
+
title: feedbackDialogTitle.value,
|
|
39795
|
+
width: "480px",
|
|
39796
|
+
"align-center": ""
|
|
39797
|
+
}, {
|
|
39798
|
+
footer: withCtx(() => [
|
|
39799
|
+
createVNode(unref(ElButton), {
|
|
39800
|
+
text: "",
|
|
39801
|
+
onClick: onDislikeSkip
|
|
39802
|
+
}, {
|
|
39803
|
+
default: withCtx(() => [
|
|
39804
|
+
createTextVNode(
|
|
39805
|
+
toDisplayString(unref(dict).aiMessage.feedback.skip),
|
|
39806
|
+
1
|
|
39807
|
+
/* TEXT */
|
|
39808
|
+
)
|
|
39809
|
+
]),
|
|
39810
|
+
_: 1
|
|
39811
|
+
/* STABLE */
|
|
39812
|
+
}),
|
|
39813
|
+
createVNode(unref(ElButton), {
|
|
39814
|
+
type: "primary",
|
|
39815
|
+
loading: feedbackPending.value,
|
|
39816
|
+
onClick: onDislikeSubmit
|
|
39817
|
+
}, {
|
|
39818
|
+
default: withCtx(() => [
|
|
39819
|
+
createTextVNode(
|
|
39820
|
+
toDisplayString(unref(dict).aiMessage.feedback.submit),
|
|
39821
|
+
1
|
|
39822
|
+
/* TEXT */
|
|
39823
|
+
)
|
|
39824
|
+
]),
|
|
39825
|
+
_: 1
|
|
39826
|
+
/* STABLE */
|
|
39827
|
+
}, 8, ["loading"])
|
|
39828
|
+
]),
|
|
39829
|
+
default: withCtx(() => [
|
|
39830
|
+
createVNode(unref(ElInput), {
|
|
39831
|
+
ref_key: "commentTextareaRef",
|
|
39832
|
+
ref: commentTextareaRef,
|
|
39833
|
+
modelValue: dislikeComment.value,
|
|
39834
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => dislikeComment.value = $event),
|
|
39835
|
+
type: "textarea",
|
|
39836
|
+
rows: 4,
|
|
39837
|
+
maxlength: "500",
|
|
39838
|
+
"show-word-limit": "",
|
|
39839
|
+
placeholder: feedbackCommentPlaceholder.value
|
|
39840
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
39841
|
+
]),
|
|
39842
|
+
_: 1
|
|
39843
|
+
/* STABLE */
|
|
39844
|
+
}, 8, ["modelValue", "title"])) : createCommentVNode("v-if", true)
|
|
39753
39845
|
], 10, _hoisted_1$3);
|
|
39754
39846
|
};
|
|
39755
39847
|
}
|
|
@@ -39795,6 +39887,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
39795
39887
|
codeTriggerLangs: { type: Array, required: false },
|
|
39796
39888
|
showTime: { type: Boolean, required: false, default: true },
|
|
39797
39889
|
timeFormat: { type: Function, required: false, default: void 0 },
|
|
39890
|
+
followupStyle: { type: String, required: false, default: "list" },
|
|
39798
39891
|
resolveFileUrl: { type: Function, required: false, default: void 0 },
|
|
39799
39892
|
feedbackHandler: { type: Function, required: false, default: void 0 },
|
|
39800
39893
|
locale: { type: null, required: false }
|
|
@@ -40057,6 +40150,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
40057
40150
|
"show-duration": __props.showDuration,
|
|
40058
40151
|
"show-time": __props.showTime,
|
|
40059
40152
|
"time-format": __props.timeFormat,
|
|
40153
|
+
"followup-style": __props.followupStyle,
|
|
40060
40154
|
"code-trigger-langs": __props.codeTriggerLangs,
|
|
40061
40155
|
"resolve-file-url": __props.resolveFileUrl,
|
|
40062
40156
|
"feedback-handler": __props.feedbackHandler,
|
|
@@ -40114,7 +40208,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
40114
40208
|
]),
|
|
40115
40209
|
key: "5"
|
|
40116
40210
|
} : void 0
|
|
40117
|
-
]), 1032, ["message", "branch", "is-last", "show-actions", "show-branch-switch", "show-user-avatar", "show-user-name", "show-assistant-avatar", "show-assistant-name", "user-avatar", "assistant-avatar", "assistant-avatar-scale", "avatar-circle", "user-name", "assistant-name", "typing", "auto-collapse", "collapsible", "show-duration", "show-time", "time-format", "code-trigger-langs", "resolve-file-url", "feedback-handler"]);
|
|
40211
|
+
]), 1032, ["message", "branch", "is-last", "show-actions", "show-branch-switch", "show-user-avatar", "show-user-name", "show-assistant-avatar", "show-assistant-name", "user-avatar", "assistant-avatar", "assistant-avatar-scale", "avatar-circle", "user-name", "assistant-name", "typing", "auto-collapse", "collapsible", "show-duration", "show-time", "time-format", "followup-style", "code-trigger-langs", "resolve-file-url", "feedback-handler"]);
|
|
40118
40212
|
}),
|
|
40119
40213
|
128
|
|
40120
40214
|
/* KEYED_FRAGMENT */
|
|
@@ -40480,6 +40574,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40480
40574
|
senderShadow: { type: Boolean, required: false, default: true },
|
|
40481
40575
|
suggestions: { type: Array, required: false, default: () => [] },
|
|
40482
40576
|
suggestionsWrap: { type: Boolean, required: false, default: true },
|
|
40577
|
+
followupStyle: { type: String, required: false, default: "list" },
|
|
40483
40578
|
features: { type: Object, required: false, default: () => ({}) },
|
|
40484
40579
|
allowAttachments: { type: Boolean, required: false, default: false },
|
|
40485
40580
|
accept: { type: String, required: false, default: "" },
|
|
@@ -40490,7 +40585,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40490
40585
|
theme: { type: String, required: false, default: "light" },
|
|
40491
40586
|
locale: { type: null, required: false }
|
|
40492
40587
|
},
|
|
40493
|
-
emits: ["update:messages", "send", "suggestion-select", "followup-select", "message-complete", "error", "branch-change", "attachment-exceed", "attachment-uploaded", "message-file-click", "feedback-change", "feedback-error", "scroll", "tool-event"],
|
|
40588
|
+
emits: ["update:messages", "send", "suggestion-select", "followup-select", "message-complete", "error", "branch-change", "attachment-exceed", "attachment-reject", "attachment-uploaded", "message-file-click", "feedback-change", "feedback-error", "scroll", "tool-event"],
|
|
40494
40589
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
40495
40590
|
const props = __props;
|
|
40496
40591
|
const dict = useLocaleDict(() => props.locale);
|
|
@@ -40593,6 +40688,36 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40593
40688
|
function onAttachmentExceed(file) {
|
|
40594
40689
|
emit("attachment-exceed", file);
|
|
40595
40690
|
}
|
|
40691
|
+
const acceptExts = computed(() => {
|
|
40692
|
+
const exts = /* @__PURE__ */ new Set();
|
|
40693
|
+
for (const token of props.accept.split(",")) {
|
|
40694
|
+
const t = token.trim().toLowerCase();
|
|
40695
|
+
if (t.startsWith(".") && t.length > 1) exts.add(t.slice(1));
|
|
40696
|
+
}
|
|
40697
|
+
return exts;
|
|
40698
|
+
});
|
|
40699
|
+
const acceptMimePrefixes = computed(() => {
|
|
40700
|
+
const prefixes = [];
|
|
40701
|
+
for (const token of props.accept.split(",")) {
|
|
40702
|
+
const t = token.trim().toLowerCase();
|
|
40703
|
+
if (t.endsWith("/*")) prefixes.push(t.slice(0, -1));
|
|
40704
|
+
}
|
|
40705
|
+
return prefixes;
|
|
40706
|
+
});
|
|
40707
|
+
const attachmentBeforeUpload = computed(() => {
|
|
40708
|
+
if (!acceptExts.value.size && !acceptMimePrefixes.value.length) return void 0;
|
|
40709
|
+
const exts = acceptExts.value;
|
|
40710
|
+
const prefixes = acceptMimePrefixes.value;
|
|
40711
|
+
return (file) => {
|
|
40712
|
+
const name = file.name.toLowerCase();
|
|
40713
|
+
const ext = name.includes(".") ? name.split(".").pop() : "";
|
|
40714
|
+
if (ext && exts.has(ext)) return true;
|
|
40715
|
+
if (file.type && prefixes.some((p) => file.type.toLowerCase().startsWith(p))) return true;
|
|
40716
|
+
ElMessage.warning(dict.value.errors.attachmentRejected.replace("{name}", file.name));
|
|
40717
|
+
emit("attachment-reject", file);
|
|
40718
|
+
return false;
|
|
40719
|
+
};
|
|
40720
|
+
});
|
|
40596
40721
|
function onAttachmentUploaded(item, _result) {
|
|
40597
40722
|
const err = item.errMessage;
|
|
40598
40723
|
emit("attachment-uploaded", item, { ok: item.status === "success", message: item.status === "success" ? void 0 : err });
|
|
@@ -40848,6 +40973,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40848
40973
|
name: __props.title,
|
|
40849
40974
|
suggestions: __props.suggestions,
|
|
40850
40975
|
"suggestions-wrap": __props.suggestionsWrap,
|
|
40976
|
+
"followup-style": __props.followupStyle,
|
|
40851
40977
|
"show-scroll-button": __props.showScrollButton,
|
|
40852
40978
|
"scroll-button-threshold": __props.scrollButtonThreshold,
|
|
40853
40979
|
"scroll-threshold": __props.scrollThreshold,
|
|
@@ -40974,7 +41100,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40974
41100
|
]),
|
|
40975
41101
|
key: "12"
|
|
40976
41102
|
} : void 0
|
|
40977
|
-
]), 1032, ["messages", "nodes", "name", "suggestions", "suggestions-wrap", "show-scroll-button", "scroll-button-threshold", "scroll-threshold", "show-user-avatar", "show-user-name", "show-assistant-avatar", "show-assistant-name", "user-avatar", "assistant-avatar", "assistant-avatar-scale", "avatar-circle", "user-name", "assistant-name", "typing", "auto-collapse", "collapsible", "show-duration", "show-time", "time-format", "code-trigger-langs", "resolve-file-url", "feedback-handler"]),
|
|
41103
|
+
]), 1032, ["messages", "nodes", "name", "suggestions", "suggestions-wrap", "followup-style", "show-scroll-button", "scroll-button-threshold", "scroll-threshold", "show-user-avatar", "show-user-name", "show-assistant-avatar", "show-assistant-name", "user-avatar", "assistant-avatar", "assistant-avatar-scale", "avatar-circle", "user-name", "assistant-name", "typing", "auto-collapse", "collapsible", "show-duration", "show-time", "time-format", "code-trigger-langs", "resolve-file-url", "feedback-handler"]),
|
|
40978
41104
|
artifactsOn.value && artifacts.value.length ? (openBlock(), createBlock(_sfc_main$1, {
|
|
40979
41105
|
key: 0,
|
|
40980
41106
|
artifacts: artifacts.value,
|
|
@@ -41012,10 +41138,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41012
41138
|
accept: __props.accept,
|
|
41013
41139
|
count: __props.attachmentLimit,
|
|
41014
41140
|
upload: attachmentsUploadHook.value,
|
|
41141
|
+
"before-upload": attachmentBeforeUpload.value,
|
|
41015
41142
|
disabled: unref(isLoading),
|
|
41016
41143
|
onExceed: onAttachmentExceed,
|
|
41017
41144
|
onUploaded: onAttachmentUploaded
|
|
41018
|
-
}, null, 8, ["modelValue", "accept", "count", "upload", "disabled"])
|
|
41145
|
+
}, null, 8, ["modelValue", "accept", "count", "upload", "before-upload", "disabled"])
|
|
41019
41146
|
]),
|
|
41020
41147
|
key: "0"
|
|
41021
41148
|
} : void 0,
|
|
@@ -41029,10 +41156,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41029
41156
|
accept: __props.accept,
|
|
41030
41157
|
count: __props.attachmentLimit,
|
|
41031
41158
|
upload: attachmentsUploadHook.value,
|
|
41159
|
+
"before-upload": attachmentBeforeUpload.value,
|
|
41032
41160
|
disabled: unref(isLoading),
|
|
41033
41161
|
onExceed: onAttachmentExceed,
|
|
41034
41162
|
onUploaded: onAttachmentUploaded
|
|
41035
|
-
}, null, 8, ["modelValue", "accept", "count", "upload", "disabled"])
|
|
41163
|
+
}, null, 8, ["modelValue", "accept", "count", "upload", "before-upload", "disabled"])
|
|
41036
41164
|
]),
|
|
41037
41165
|
key: "1"
|
|
41038
41166
|
} : void 0,
|