yc-agent-ui 1.1.2 → 1.2.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/es/components/dialog/index.d.ts +6 -6
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +6 -6
- package/es/components/dialog-form/src/index.vue.d.ts +6 -6
- package/es/components/display-item/index.d.ts +21 -21
- package/es/components/display-item/src/index.vue.d.ts +19 -19
- package/es/components/drawer-form/index.d.ts +18 -18
- package/es/components/drawer-form/src/index.vue.d.ts +10 -10
- package/es/components/form/index.d.ts +12 -12
- package/es/components/form/src/form-content.vue.d.ts +12 -12
- package/es/components/form/src/index.vue.d.ts +12 -12
- package/es/components/form-item/index.d.ts +12 -12
- package/es/components/form-item/src/index.vue.d.ts +10 -10
- package/es/components/index.d.ts +1 -0
- package/es/components/page/index.d.ts +258 -258
- package/es/components/page/src/index.vue.d.ts +90 -90
- package/es/components/render/index.d.ts +1 -1
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +78 -78
- package/es/components/search/src/index.vue.d.ts +30 -30
- package/es/components/table/src/table-column.vue.d.ts +46 -46
- package/es/components/yc-ai-chat/index.d.ts +14 -0
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +28 -0
- package/es/components/yc-ai-chat/src/file-card.vue.d.ts +18 -0
- package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +33 -0
- package/es/components/yc-ai-chat/src/presets.d.ts +6 -0
- package/es/components/yc-ai-chat/src/select.vue.d.ts +23 -0
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +45 -0
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +28 -0
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +47 -0
- package/es/components/yc-ai-chat/src/thinking.vue.d.ts +9 -0
- package/es/components/yc-ai-chat/src/type.d.ts +34 -0
- package/es/components/yc-ai-chat/src/welcome.vue.d.ts +29 -0
- package/es/components/yc-plus-page/src/index.vue.d.ts +264 -264
- package/es/components/yc-select-v2/src/index.vue.d.ts +1 -1
- package/es/hooks/usePlusFormReset.d.ts +144 -144
- package/es/index.css +10 -10
- package/es/index.mjs +10 -0
- package/es/packages/components/index.mjs +10 -0
- package/es/packages/components/yc-ai-chat/index.mjs +14 -0
- package/es/packages/components/yc-ai-chat/src/bubble.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/bubble2.vue.mjs +290 -0
- package/es/packages/components/yc-ai-chat/src/file-card.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/file-card2.vue.mjs +127 -0
- package/es/packages/components/yc-ai-chat/src/mobile-frame.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/mobile-frame2.vue.mjs +248 -0
- package/es/packages/components/yc-ai-chat/src/presets.mjs +55 -0
- package/es/packages/components/yc-ai-chat/src/select.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/select2.vue.mjs +337 -0
- package/es/packages/components/yc-ai-chat/src/sender.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/sender2.vue.mjs +433 -0
- package/es/packages/components/yc-ai-chat/src/sidebar.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +279 -0
- package/es/packages/components/yc-ai-chat/src/studio.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +391 -0
- package/es/packages/components/yc-ai-chat/src/thinking.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/thinking2.vue.mjs +88 -0
- package/es/packages/components/yc-ai-chat/src/type.mjs +1 -0
- package/es/packages/components/yc-ai-chat/src/welcome.vue.mjs +5 -0
- package/es/packages/components/yc-ai-chat/src/welcome2.vue.mjs +95 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +12 -2
- package/index.js +15879 -14138
- package/index.min.css +11 -1
- package/index.min.js +44 -28
- package/index.min.mjs +44 -28
- package/index.mjs +15857 -14127
- package/lib/components/dialog/index.d.ts +6 -6
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +6 -6
- package/lib/components/dialog-form/src/index.vue.d.ts +6 -6
- package/lib/components/display-item/index.d.ts +21 -21
- package/lib/components/display-item/src/index.vue.d.ts +19 -19
- package/lib/components/drawer-form/index.d.ts +18 -18
- package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
- package/lib/components/form/index.d.ts +12 -12
- package/lib/components/form/src/form-content.vue.d.ts +12 -12
- package/lib/components/form/src/index.vue.d.ts +12 -12
- package/lib/components/form-item/index.d.ts +12 -12
- package/lib/components/form-item/src/index.vue.d.ts +10 -10
- package/lib/components/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +258 -258
- package/lib/components/page/src/index.vue.d.ts +90 -90
- package/lib/components/render/index.d.ts +1 -1
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +78 -78
- package/lib/components/search/src/index.vue.d.ts +30 -30
- package/lib/components/table/src/table-column.vue.d.ts +46 -46
- package/lib/components/yc-ai-chat/index.d.ts +14 -0
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +28 -0
- package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +18 -0
- package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +33 -0
- package/lib/components/yc-ai-chat/src/presets.d.ts +6 -0
- package/lib/components/yc-ai-chat/src/select.vue.d.ts +23 -0
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +45 -0
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +28 -0
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +47 -0
- package/lib/components/yc-ai-chat/src/thinking.vue.d.ts +9 -0
- package/lib/components/yc-ai-chat/src/type.d.ts +34 -0
- package/lib/components/yc-ai-chat/src/welcome.vue.d.ts +29 -0
- package/lib/components/yc-plus-page/src/index.vue.d.ts +264 -264
- package/lib/components/yc-select-v2/src/index.vue.d.ts +1 -1
- package/lib/hooks/usePlusFormReset.d.ts +144 -144
- package/lib/index.css +8 -8
- package/lib/index.js +23 -0
- package/lib/packages/components/index.js +23 -0
- package/lib/packages/components/yc-ai-chat/index.js +31 -0
- package/lib/packages/components/yc-ai-chat/src/bubble.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/bubble2.vue.js +294 -0
- package/lib/packages/components/yc-ai-chat/src/file-card.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/file-card2.vue.js +131 -0
- package/lib/packages/components/yc-ai-chat/src/mobile-frame.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/mobile-frame2.vue.js +252 -0
- package/lib/packages/components/yc-ai-chat/src/presets.js +60 -0
- package/lib/packages/components/yc-ai-chat/src/select.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/select2.vue.js +341 -0
- package/lib/packages/components/yc-ai-chat/src/sender.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/sender2.vue.js +437 -0
- package/lib/packages/components/yc-ai-chat/src/sidebar.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +283 -0
- package/lib/packages/components/yc-ai-chat/src/studio.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +395 -0
- package/lib/packages/components/yc-ai-chat/src/thinking.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/thinking2.vue.js +92 -0
- package/lib/packages/components/yc-ai-chat/src/type.js +2 -0
- package/lib/packages/components/yc-ai-chat/src/welcome.vue.js +9 -0
- package/lib/packages/components/yc-ai-chat/src/welcome2.vue.js +99 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +2 -1
- package/theme-chalk/index.css +12 -2
- package/theme-chalk/plus-yc-ai-chat.css +1 -0
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/yc-ai-chat.scss +1694 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var vueElementPlusX = require('vue-element-plus-x');
|
|
7
|
+
|
|
8
|
+
const _hoisted_1 = { class: "yc-chat-bubble__header" };
|
|
9
|
+
const _hoisted_2 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "yc-chat-bubble__sender"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_3 = { class: "message-body yc-chat-bubble__body" };
|
|
14
|
+
const _hoisted_4 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "message-error yc-chat-bubble__inline-status"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_5 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "message-metrics yc-chat-bubble__metrics",
|
|
21
|
+
"data-testid": "message-metrics"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_6 = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "message-identifiers yc-chat-bubble__identifiers"
|
|
26
|
+
};
|
|
27
|
+
const _hoisted_7 = { class: "message-identifiers__summary" };
|
|
28
|
+
const _hoisted_8 = {
|
|
29
|
+
class: "message-identifiers__list",
|
|
30
|
+
"aria-label": "\u6D88\u606F\u5B9A\u4F4D\u4FE1\u606F"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_9 = { class: "message-footer__actions yc-chat-bubble__actions" };
|
|
33
|
+
const _hoisted_10 = ["disabled"];
|
|
34
|
+
const _hoisted_11 = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "yc-chat-bubble__action-text"
|
|
37
|
+
};
|
|
38
|
+
const _hoisted_12 = ["disabled"];
|
|
39
|
+
const _hoisted_13 = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "yc-chat-bubble__action-text"
|
|
42
|
+
};
|
|
43
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
44
|
+
...{
|
|
45
|
+
name: "YcChatBubble"
|
|
46
|
+
},
|
|
47
|
+
__name: "bubble",
|
|
48
|
+
props: {
|
|
49
|
+
role: {},
|
|
50
|
+
senderName: { default: "" },
|
|
51
|
+
status: { default: "completed" },
|
|
52
|
+
metrics: { default: () => [] },
|
|
53
|
+
identifiers: { default: () => [] },
|
|
54
|
+
identifiersTitle: { default: "ID" },
|
|
55
|
+
canCopyContent: { type: Boolean, default: true },
|
|
56
|
+
compact: { type: Boolean, default: false }
|
|
57
|
+
},
|
|
58
|
+
emits: ["copy-content", "copy-identifiers"],
|
|
59
|
+
setup(__props, { emit: __emit }) {
|
|
60
|
+
const props = __props;
|
|
61
|
+
const emit = __emit;
|
|
62
|
+
const statusTagText = vue.computed(() => {
|
|
63
|
+
if (props.status === "failed") return "\u751F\u6210\u5931\u8D25";
|
|
64
|
+
if (props.status === "cancelled") return "\u5DF2\u505C\u6B62";
|
|
65
|
+
return "";
|
|
66
|
+
});
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
class: vue.normalizeClass(["yc-chat-bubble message-row", [__props.role, { "is-compact": __props.compact }]])
|
|
72
|
+
},
|
|
73
|
+
[
|
|
74
|
+
vue.createVNode(vue.unref(vueElementPlusX.Bubble), {
|
|
75
|
+
placement: __props.role === "user" ? "end" : "start",
|
|
76
|
+
"no-style": true,
|
|
77
|
+
"max-width": "100%"
|
|
78
|
+
}, vue.createSlots({
|
|
79
|
+
content: vue.withCtx(() => [
|
|
80
|
+
vue.createElementVNode(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
class: vue.normalizeClass(["message-bubble yc-chat-bubble__surface", [__props.role]])
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
87
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
88
|
+
__props.role === "user" && statusTagText.value ? (vue.openBlock(), vue.createElementBlock(
|
|
89
|
+
"div",
|
|
90
|
+
_hoisted_4,
|
|
91
|
+
vue.toDisplayString(statusTagText.value),
|
|
92
|
+
1
|
|
93
|
+
/* TEXT */
|
|
94
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
95
|
+
]),
|
|
96
|
+
__props.role === "assistant" && __props.metrics.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
97
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
98
|
+
vue.Fragment,
|
|
99
|
+
null,
|
|
100
|
+
vue.renderList(__props.metrics, (metric) => {
|
|
101
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
key: metric.key,
|
|
105
|
+
class: "yc-chat-bubble__metric-pill"
|
|
106
|
+
},
|
|
107
|
+
vue.toDisplayString(metric.text),
|
|
108
|
+
1
|
|
109
|
+
/* TEXT */
|
|
110
|
+
);
|
|
111
|
+
}),
|
|
112
|
+
128
|
|
113
|
+
/* KEYED_FRAGMENT */
|
|
114
|
+
))
|
|
115
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
116
|
+
],
|
|
117
|
+
2
|
|
118
|
+
/* CLASS */
|
|
119
|
+
)
|
|
120
|
+
]),
|
|
121
|
+
footer: vue.withCtx(() => [
|
|
122
|
+
vue.createElementVNode(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
class: vue.normalizeClass(["message-footer yc-chat-bubble__footer", `is-${__props.role}`])
|
|
126
|
+
},
|
|
127
|
+
[
|
|
128
|
+
__props.identifiers.length > 0 ? (vue.openBlock(), vue.createElementBlock("details", _hoisted_6, [
|
|
129
|
+
vue.createElementVNode(
|
|
130
|
+
"summary",
|
|
131
|
+
_hoisted_7,
|
|
132
|
+
vue.toDisplayString(__props.identifiersTitle) + " (" + vue.toDisplayString(__props.identifiers.length) + ") ",
|
|
133
|
+
1
|
|
134
|
+
/* TEXT */
|
|
135
|
+
),
|
|
136
|
+
vue.createElementVNode("div", _hoisted_8, [
|
|
137
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
138
|
+
vue.Fragment,
|
|
139
|
+
null,
|
|
140
|
+
vue.renderList(__props.identifiers, (item) => {
|
|
141
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
142
|
+
"span",
|
|
143
|
+
{
|
|
144
|
+
key: `${item.label}:${item.value}`,
|
|
145
|
+
class: "message-identifier"
|
|
146
|
+
},
|
|
147
|
+
vue.toDisplayString(item.label) + ": " + vue.toDisplayString(item.value),
|
|
148
|
+
1
|
|
149
|
+
/* TEXT */
|
|
150
|
+
);
|
|
151
|
+
}),
|
|
152
|
+
128
|
|
153
|
+
/* KEYED_FRAGMENT */
|
|
154
|
+
))
|
|
155
|
+
])
|
|
156
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
157
|
+
vue.createElementVNode("div", _hoisted_9, [
|
|
158
|
+
vue.createElementVNode("button", {
|
|
159
|
+
type: "button",
|
|
160
|
+
class: "message-action-btn",
|
|
161
|
+
"data-testid": "copy-message-content",
|
|
162
|
+
"aria-label": "\u590D\u5236\u6D88\u606F\u5185\u5BB9",
|
|
163
|
+
title: "\u590D\u5236\u6D88\u606F\u5185\u5BB9",
|
|
164
|
+
disabled: !__props.canCopyContent,
|
|
165
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("copy-content"))
|
|
166
|
+
}, [
|
|
167
|
+
_cache[3] || (_cache[3] = vue.createElementVNode(
|
|
168
|
+
"svg",
|
|
169
|
+
{
|
|
170
|
+
viewBox: "0 0 16 16",
|
|
171
|
+
fill: "none",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
},
|
|
174
|
+
[
|
|
175
|
+
vue.createElementVNode("rect", {
|
|
176
|
+
x: "5.5",
|
|
177
|
+
y: "5.5",
|
|
178
|
+
width: "7.5",
|
|
179
|
+
height: "7.5",
|
|
180
|
+
rx: "1.5",
|
|
181
|
+
stroke: "currentColor",
|
|
182
|
+
"stroke-width": "1.3"
|
|
183
|
+
}),
|
|
184
|
+
vue.createElementVNode("path", {
|
|
185
|
+
d: "M3.5 10.5H3A1.5 1.5 0 0 1 1.5 9V3A1.5 1.5 0 0 1 3 1.5H9A1.5 1.5 0 0 1 10.5 3V3.5",
|
|
186
|
+
stroke: "currentColor",
|
|
187
|
+
"stroke-width": "1.3",
|
|
188
|
+
"stroke-linecap": "round"
|
|
189
|
+
})
|
|
190
|
+
],
|
|
191
|
+
-1
|
|
192
|
+
/* CACHED */
|
|
193
|
+
)),
|
|
194
|
+
!__props.compact ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11, "\u590D\u5236")) : vue.createCommentVNode("v-if", true)
|
|
195
|
+
], 8, _hoisted_10),
|
|
196
|
+
vue.createElementVNode("button", {
|
|
197
|
+
type: "button",
|
|
198
|
+
class: "message-action-btn",
|
|
199
|
+
"data-testid": "copy-message-identifiers",
|
|
200
|
+
"aria-label": "\u590D\u5236\u6D88\u606F ID",
|
|
201
|
+
title: "\u590D\u5236\u6D88\u606F ID",
|
|
202
|
+
disabled: !__props.identifiers.length,
|
|
203
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("copy-identifiers"))
|
|
204
|
+
}, [
|
|
205
|
+
_cache[4] || (_cache[4] = vue.createElementVNode(
|
|
206
|
+
"svg",
|
|
207
|
+
{
|
|
208
|
+
viewBox: "0 0 16 16",
|
|
209
|
+
fill: "none",
|
|
210
|
+
"aria-hidden": "true"
|
|
211
|
+
},
|
|
212
|
+
[
|
|
213
|
+
vue.createElementVNode("path", {
|
|
214
|
+
d: "M6.5 9.5L9.5 6.5M5.2 7.3L3.8 8.7A2.5 2.5 0 0 0 7.3 12.2L8.7 10.8M10.8 8.7L12.2 7.3A2.5 2.5 0 0 0 8.7 3.8L7.3 5.2",
|
|
215
|
+
stroke: "currentColor",
|
|
216
|
+
"stroke-width": "1.3",
|
|
217
|
+
"stroke-linecap": "round"
|
|
218
|
+
})
|
|
219
|
+
],
|
|
220
|
+
-1
|
|
221
|
+
/* CACHED */
|
|
222
|
+
)),
|
|
223
|
+
!__props.compact ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_13, "ID")) : vue.createCommentVNode("v-if", true)
|
|
224
|
+
], 8, _hoisted_12)
|
|
225
|
+
])
|
|
226
|
+
],
|
|
227
|
+
2
|
|
228
|
+
/* CLASS */
|
|
229
|
+
)
|
|
230
|
+
]),
|
|
231
|
+
_: 2
|
|
232
|
+
/* DYNAMIC */
|
|
233
|
+
}, [
|
|
234
|
+
__props.role === "assistant" ? {
|
|
235
|
+
name: "avatar",
|
|
236
|
+
fn: vue.withCtx(() => [
|
|
237
|
+
_cache[2] || (_cache[2] = vue.createElementVNode(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
class: "yc-chat-bubble__avatar is-assistant",
|
|
241
|
+
"aria-hidden": "true"
|
|
242
|
+
},
|
|
243
|
+
[
|
|
244
|
+
vue.createElementVNode("svg", {
|
|
245
|
+
viewBox: "0 0 20 20",
|
|
246
|
+
fill: "none"
|
|
247
|
+
}, [
|
|
248
|
+
vue.createElementVNode("path", {
|
|
249
|
+
d: "M10 3L11.6 8.4L17 10L11.6 11.6L10 17L8.4 11.6L3 10L8.4 8.4L10 3Z",
|
|
250
|
+
fill: "currentColor"
|
|
251
|
+
})
|
|
252
|
+
])
|
|
253
|
+
],
|
|
254
|
+
-1
|
|
255
|
+
/* CACHED */
|
|
256
|
+
))
|
|
257
|
+
]),
|
|
258
|
+
key: "0"
|
|
259
|
+
} : void 0,
|
|
260
|
+
__props.role === "assistant" && (__props.senderName || statusTagText.value) ? {
|
|
261
|
+
name: "header",
|
|
262
|
+
fn: vue.withCtx(() => [
|
|
263
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
264
|
+
__props.senderName ? (vue.openBlock(), vue.createElementBlock(
|
|
265
|
+
"span",
|
|
266
|
+
_hoisted_2,
|
|
267
|
+
vue.toDisplayString(__props.senderName),
|
|
268
|
+
1
|
|
269
|
+
/* TEXT */
|
|
270
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
271
|
+
statusTagText.value ? (vue.openBlock(), vue.createElementBlock(
|
|
272
|
+
"span",
|
|
273
|
+
{
|
|
274
|
+
key: 1,
|
|
275
|
+
class: vue.normalizeClass(["yc-chat-bubble__status message-error", `is-${__props.status}`])
|
|
276
|
+
},
|
|
277
|
+
vue.toDisplayString(statusTagText.value),
|
|
278
|
+
3
|
|
279
|
+
/* TEXT, CLASS */
|
|
280
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
281
|
+
])
|
|
282
|
+
]),
|
|
283
|
+
key: "1"
|
|
284
|
+
} : void 0
|
|
285
|
+
]), 1032, ["placement"])
|
|
286
|
+
],
|
|
287
|
+
2
|
|
288
|
+
/* CLASS */
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var vueElementPlusX = require('vue-element-plus-x');
|
|
7
|
+
var presets = require('./presets.js');
|
|
8
|
+
|
|
9
|
+
const _hoisted_1 = ["disabled"];
|
|
10
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
11
|
+
...{
|
|
12
|
+
name: "YcChatFileCard"
|
|
13
|
+
},
|
|
14
|
+
__name: "file-card",
|
|
15
|
+
props: {
|
|
16
|
+
uid: { default: void 0 },
|
|
17
|
+
name: {},
|
|
18
|
+
fileSize: { default: void 0 },
|
|
19
|
+
mimeType: { default: "" },
|
|
20
|
+
url: { default: "" },
|
|
21
|
+
variant: { default: "artifact" },
|
|
22
|
+
removable: { type: Boolean, default: false },
|
|
23
|
+
downloadable: { type: Boolean, default: false },
|
|
24
|
+
downloading: { type: Boolean, default: false }
|
|
25
|
+
},
|
|
26
|
+
emits: ["remove", "download"],
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const emit = __emit;
|
|
30
|
+
const descriptionText = vue.computed(() => {
|
|
31
|
+
const parts = [props.mimeType, presets.formatChatFileSize(props.fileSize)].filter(Boolean);
|
|
32
|
+
return parts.join(" \xB7 ");
|
|
33
|
+
});
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
class: vue.normalizeClass([
|
|
39
|
+
"yc-chat-file-card",
|
|
40
|
+
__props.variant === "composer" ? "yc-chat-file-card--composer composer-attachment" : "yc-chat-file-card--artifact artifact-card"
|
|
41
|
+
])
|
|
42
|
+
},
|
|
43
|
+
[
|
|
44
|
+
vue.createElementVNode(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
class: vue.normalizeClass(["yc-chat-file-card__main", { "artifact-main": __props.variant === "artifact" }])
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
vue.createVNode(vue.unref(vueElementPlusX.FilesCard), {
|
|
51
|
+
uid: __props.uid,
|
|
52
|
+
name: __props.name || "\u672A\u547D\u540D\u6587\u4EF6",
|
|
53
|
+
"file-size": __props.fileSize,
|
|
54
|
+
description: descriptionText.value || void 0,
|
|
55
|
+
url: __props.url || void 0,
|
|
56
|
+
"icon-size": __props.variant === "composer" ? "28px" : "34px",
|
|
57
|
+
"max-width": __props.variant === "composer" ? "220px" : "100%",
|
|
58
|
+
"show-del-icon": false
|
|
59
|
+
}, null, 8, ["uid", "name", "file-size", "description", "url", "icon-size", "max-width"])
|
|
60
|
+
],
|
|
61
|
+
2
|
|
62
|
+
/* CLASS */
|
|
63
|
+
),
|
|
64
|
+
__props.removable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
65
|
+
key: 0,
|
|
66
|
+
type: "button",
|
|
67
|
+
class: "yc-chat-file-card__remove composer-attachment-remove",
|
|
68
|
+
"aria-label": "\u79FB\u9664\u9644\u4EF6",
|
|
69
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => emit("remove"), ["stop"]))
|
|
70
|
+
}, [..._cache[2] || (_cache[2] = [
|
|
71
|
+
vue.createElementVNode(
|
|
72
|
+
"svg",
|
|
73
|
+
{
|
|
74
|
+
viewBox: "0 0 14 14",
|
|
75
|
+
fill: "none",
|
|
76
|
+
"aria-hidden": "true"
|
|
77
|
+
},
|
|
78
|
+
[
|
|
79
|
+
vue.createElementVNode("path", {
|
|
80
|
+
d: "M4 4L10 10M10 4L4 10",
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
"stroke-width": "1.5",
|
|
83
|
+
"stroke-linecap": "round"
|
|
84
|
+
})
|
|
85
|
+
],
|
|
86
|
+
-1
|
|
87
|
+
/* CACHED */
|
|
88
|
+
)
|
|
89
|
+
])])) : __props.downloadable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
90
|
+
key: 1,
|
|
91
|
+
type: "button",
|
|
92
|
+
class: "yc-chat-file-card__download",
|
|
93
|
+
disabled: __props.downloading,
|
|
94
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => emit("download"), ["stop"]))
|
|
95
|
+
}, [
|
|
96
|
+
_cache[3] || (_cache[3] = vue.createElementVNode(
|
|
97
|
+
"svg",
|
|
98
|
+
{
|
|
99
|
+
viewBox: "0 0 16 16",
|
|
100
|
+
fill: "none",
|
|
101
|
+
"aria-hidden": "true"
|
|
102
|
+
},
|
|
103
|
+
[
|
|
104
|
+
vue.createElementVNode("path", {
|
|
105
|
+
d: "M8 2.75V10.25M8 10.25L5.25 7.5M8 10.25L10.75 7.5M3.25 12.75H12.75",
|
|
106
|
+
stroke: "currentColor",
|
|
107
|
+
"stroke-width": "1.4",
|
|
108
|
+
"stroke-linecap": "round",
|
|
109
|
+
"stroke-linejoin": "round"
|
|
110
|
+
})
|
|
111
|
+
],
|
|
112
|
+
-1
|
|
113
|
+
/* CACHED */
|
|
114
|
+
)),
|
|
115
|
+
vue.createElementVNode(
|
|
116
|
+
"span",
|
|
117
|
+
null,
|
|
118
|
+
vue.toDisplayString(__props.downloading ? "\u4E0B\u8F7D\u4E2D\u2026" : "\u4E0B\u8F7D"),
|
|
119
|
+
1
|
|
120
|
+
/* TEXT */
|
|
121
|
+
)
|
|
122
|
+
], 8, _hoisted_1)) : vue.createCommentVNode("v-if", true)
|
|
123
|
+
],
|
|
124
|
+
2
|
|
125
|
+
/* CLASS */
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
exports.default = _sfc_main;
|