yc-agent-ui 1.1.1 → 1.2.0
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-form/index.d.ts +4 -4
- package/es/components/dialog-form/src/index.vue.d.ts +4 -4
- package/es/components/display-item/index.d.ts +15 -15
- package/es/components/display-item/src/index.vue.d.ts +13 -13
- package/es/components/drawer-form/index.d.ts +4 -4
- package/es/components/drawer-form/src/index.vue.d.ts +4 -4
- package/es/components/form/index.d.ts +8 -8
- package/es/components/form/src/form-content.vue.d.ts +8 -8
- package/es/components/form/src/index.vue.d.ts +8 -8
- package/es/components/form-item/index.d.ts +6 -6
- package/es/components/form-item/src/index.vue.d.ts +6 -6
- package/es/components/index.d.ts +1 -0
- package/es/components/page/index.d.ts +172 -172
- package/es/components/page/src/index.vue.d.ts +60 -60
- package/es/components/search/index.d.ts +52 -52
- package/es/components/search/src/index.vue.d.ts +20 -20
- package/es/components/table/src/table-column.vue.d.ts +34 -34
- package/es/components/yc-ai-chat/index.d.ts +14 -0
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +27 -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 +31 -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 +44 -0
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +23 -0
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +46 -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 +19 -0
- package/es/components/yc-plus-page/src/index.vue.d.ts +176 -176
- package/es/hooks/usePlusFormReset.d.ts +48 -48
- 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 +289 -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 +245 -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 +432 -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 +251 -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 +421 -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 +113 -0
- package/es/packages/components/yc-lens/capability.mjs +10 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +12 -2
- package/index.js +18963 -17199
- package/index.min.css +11 -1
- package/index.min.js +50 -27
- package/index.min.mjs +50 -27
- package/index.mjs +18941 -17188
- package/lib/components/dialog-form/index.d.ts +4 -4
- package/lib/components/dialog-form/src/index.vue.d.ts +4 -4
- package/lib/components/display-item/index.d.ts +15 -15
- package/lib/components/display-item/src/index.vue.d.ts +13 -13
- package/lib/components/drawer-form/index.d.ts +4 -4
- package/lib/components/drawer-form/src/index.vue.d.ts +4 -4
- package/lib/components/form/index.d.ts +8 -8
- package/lib/components/form/src/form-content.vue.d.ts +8 -8
- package/lib/components/form/src/index.vue.d.ts +8 -8
- package/lib/components/form-item/index.d.ts +6 -6
- package/lib/components/form-item/src/index.vue.d.ts +6 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/components/page/index.d.ts +172 -172
- package/lib/components/page/src/index.vue.d.ts +60 -60
- package/lib/components/search/index.d.ts +52 -52
- package/lib/components/search/src/index.vue.d.ts +20 -20
- package/lib/components/table/src/table-column.vue.d.ts +34 -34
- package/lib/components/yc-ai-chat/index.d.ts +14 -0
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +27 -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 +31 -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 +44 -0
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +23 -0
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +46 -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 +19 -0
- package/lib/components/yc-plus-page/src/index.vue.d.ts +176 -176
- package/lib/hooks/usePlusFormReset.d.ts +48 -48
- package/lib/index.css +10 -10
- 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 +293 -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 +249 -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 +436 -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 +255 -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 +425 -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 +117 -0
- package/lib/packages/components/yc-lens/capability.js +10 -2
- 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 +1691 -0
|
@@ -0,0 +1,255 @@
|
|
|
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 = {
|
|
10
|
+
class: "yc-chat-sidebar conversation-rail",
|
|
11
|
+
"aria-label": "\u4F1A\u8BDD\u5217\u8868"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_2 = { class: "yc-chat-sidebar__header rail-header" };
|
|
14
|
+
const _hoisted_3 = ["disabled"];
|
|
15
|
+
const _hoisted_4 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "yc-chat-sidebar__search"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_5 = { class: "yc-chat-sidebar__body conversation-list" };
|
|
20
|
+
const _hoisted_6 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "yc-chat-sidebar__empty empty-hint"
|
|
23
|
+
};
|
|
24
|
+
const _hoisted_7 = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "yc-chat-sidebar__empty empty-hint"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_8 = {
|
|
29
|
+
key: 2,
|
|
30
|
+
class: "yc-chat-sidebar__empty empty-hint"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_9 = { class: "yc-chat-sidebar__item-main" };
|
|
33
|
+
const _hoisted_10 = { class: "yc-chat-sidebar__item-title conversation-title" };
|
|
34
|
+
const _hoisted_11 = { class: "yc-chat-sidebar__item-time conversation-time" };
|
|
35
|
+
const _hoisted_12 = ["onClick"];
|
|
36
|
+
const _hoisted_13 = { class: "yc-chat-sidebar__more" };
|
|
37
|
+
const _hoisted_14 = ["disabled"];
|
|
38
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
39
|
+
...{
|
|
40
|
+
name: "YcChatSidebar"
|
|
41
|
+
},
|
|
42
|
+
__name: "sidebar",
|
|
43
|
+
props: {
|
|
44
|
+
sessions: { default: () => [] },
|
|
45
|
+
activeId: { default: "" },
|
|
46
|
+
connected: { type: Boolean, default: false },
|
|
47
|
+
loading: { type: Boolean, default: false },
|
|
48
|
+
hasMore: { type: Boolean, default: false },
|
|
49
|
+
title: { default: "\u5386\u53F2\u4F1A\u8BDD" },
|
|
50
|
+
createText: { default: "\u5F00\u542F\u65B0\u5BF9\u8BDD" }
|
|
51
|
+
},
|
|
52
|
+
emits: ["select", "create", "delete", "load-more"],
|
|
53
|
+
setup(__props, { emit: __emit }) {
|
|
54
|
+
const props = __props;
|
|
55
|
+
const emit = __emit;
|
|
56
|
+
const keyword = vue.ref("");
|
|
57
|
+
const filteredSessions = vue.computed(() => {
|
|
58
|
+
const query = keyword.value.trim().toLowerCase();
|
|
59
|
+
if (!query) return props.sessions;
|
|
60
|
+
return props.sessions.filter(
|
|
61
|
+
(item) => (item.title || "\u65B0\u4F1A\u8BDD").toLowerCase().includes(query)
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
const conversationItems = vue.computed(
|
|
65
|
+
() => filteredSessions.value.map((item) => ({
|
|
66
|
+
id: item.id,
|
|
67
|
+
key: item.id,
|
|
68
|
+
label: item.title || "\u65B0\u4F1A\u8BDD",
|
|
69
|
+
group: presets.groupChatSessionByDate(item.updatedAt),
|
|
70
|
+
disabled: item.disabled,
|
|
71
|
+
timeText: presets.formatChatSessionTime(item.updatedAt)
|
|
72
|
+
}))
|
|
73
|
+
);
|
|
74
|
+
function handleChange(item) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const nextId = String((_b = (_a = item == null ? void 0 : item.id) != null ? _a : item == null ? void 0 : item.key) != null ? _b : "");
|
|
77
|
+
if (nextId) {
|
|
78
|
+
emit("select", nextId);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return (_ctx, _cache) => {
|
|
82
|
+
return vue.openBlock(), vue.createElementBlock("aside", _hoisted_1, [
|
|
83
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
84
|
+
vue.createElementVNode("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
class: "yc-chat-sidebar__create-btn",
|
|
87
|
+
disabled: !__props.connected,
|
|
88
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("create"))
|
|
89
|
+
}, [
|
|
90
|
+
_cache[4] || (_cache[4] = vue.createElementVNode(
|
|
91
|
+
"svg",
|
|
92
|
+
{
|
|
93
|
+
viewBox: "0 0 16 16",
|
|
94
|
+
fill: "none",
|
|
95
|
+
"aria-hidden": "true"
|
|
96
|
+
},
|
|
97
|
+
[
|
|
98
|
+
vue.createElementVNode("path", {
|
|
99
|
+
d: "M8 3.25V12.75M3.25 8H12.75",
|
|
100
|
+
stroke: "currentColor",
|
|
101
|
+
"stroke-width": "1.6",
|
|
102
|
+
"stroke-linecap": "round"
|
|
103
|
+
})
|
|
104
|
+
],
|
|
105
|
+
-1
|
|
106
|
+
/* CACHED */
|
|
107
|
+
)),
|
|
108
|
+
vue.createElementVNode(
|
|
109
|
+
"span",
|
|
110
|
+
null,
|
|
111
|
+
vue.toDisplayString(__props.createText),
|
|
112
|
+
1
|
|
113
|
+
/* TEXT */
|
|
114
|
+
)
|
|
115
|
+
], 8, _hoisted_3),
|
|
116
|
+
__props.connected && __props.sessions.length > 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
117
|
+
_cache[5] || (_cache[5] = vue.createElementVNode(
|
|
118
|
+
"svg",
|
|
119
|
+
{
|
|
120
|
+
viewBox: "0 0 16 16",
|
|
121
|
+
fill: "none",
|
|
122
|
+
"aria-hidden": "true"
|
|
123
|
+
},
|
|
124
|
+
[
|
|
125
|
+
vue.createElementVNode("circle", {
|
|
126
|
+
cx: "7",
|
|
127
|
+
cy: "7",
|
|
128
|
+
r: "4.4",
|
|
129
|
+
stroke: "currentColor",
|
|
130
|
+
"stroke-width": "1.35"
|
|
131
|
+
}),
|
|
132
|
+
vue.createElementVNode("path", {
|
|
133
|
+
d: "M10.4 10.4L13.4 13.4",
|
|
134
|
+
stroke: "currentColor",
|
|
135
|
+
"stroke-width": "1.35",
|
|
136
|
+
"stroke-linecap": "round"
|
|
137
|
+
})
|
|
138
|
+
],
|
|
139
|
+
-1
|
|
140
|
+
/* CACHED */
|
|
141
|
+
)),
|
|
142
|
+
vue.withDirectives(vue.createElementVNode(
|
|
143
|
+
"input",
|
|
144
|
+
{
|
|
145
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => keyword.value = $event),
|
|
146
|
+
type: "text",
|
|
147
|
+
placeholder: "\u641C\u7D22\u4F1A\u8BDD\u2026",
|
|
148
|
+
class: "yc-chat-sidebar__search-input"
|
|
149
|
+
},
|
|
150
|
+
null,
|
|
151
|
+
512
|
|
152
|
+
/* NEED_PATCH */
|
|
153
|
+
), [
|
|
154
|
+
[vue.vModelText, keyword.value]
|
|
155
|
+
])
|
|
156
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
157
|
+
]),
|
|
158
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
159
|
+
!__props.connected ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, " \u5728\u9876\u90E8\u680F\u9009\u62E9\u79DF\u6237\u540E\u540C\u6B65\u5386\u53F2\u4F1A\u8BDD ")) : !__props.sessions.length && !__props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, " \u6682\u65E0\u5386\u53F2\u4F1A\u8BDD\uFF0C\u53D1\u9001\u9996\u6761\u6D88\u606F\u5373\u53EF\u521B\u5EFA ")) : !conversationItems.value.length && keyword.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, " \u672A\u627E\u5230\u5339\u914D\u7684\u4F1A\u8BDD ")) : (vue.openBlock(), vue.createBlock(vue.unref(vueElementPlusX.Conversations), {
|
|
160
|
+
key: 3,
|
|
161
|
+
items: conversationItems.value,
|
|
162
|
+
active: __props.activeId,
|
|
163
|
+
"row-key": "id",
|
|
164
|
+
"label-key": "label",
|
|
165
|
+
groupable: true,
|
|
166
|
+
"show-built-in-menu": false,
|
|
167
|
+
style: { width: "100%", backgroundColor: "transparent", padding: "4px 8px" },
|
|
168
|
+
onChange: handleChange
|
|
169
|
+
}, vue.createSlots({
|
|
170
|
+
label: vue.withCtx(({ item }) => [
|
|
171
|
+
vue.createElementVNode(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
class: vue.normalizeClass(["yc-chat-sidebar__item", { active: item.id === __props.activeId }])
|
|
175
|
+
},
|
|
176
|
+
[
|
|
177
|
+
vue.createElementVNode("div", _hoisted_9, [
|
|
178
|
+
vue.createElementVNode(
|
|
179
|
+
"div",
|
|
180
|
+
_hoisted_10,
|
|
181
|
+
vue.toDisplayString(item.label),
|
|
182
|
+
1
|
|
183
|
+
/* TEXT */
|
|
184
|
+
),
|
|
185
|
+
vue.createElementVNode(
|
|
186
|
+
"div",
|
|
187
|
+
_hoisted_11,
|
|
188
|
+
vue.toDisplayString(item.timeText),
|
|
189
|
+
1
|
|
190
|
+
/* TEXT */
|
|
191
|
+
)
|
|
192
|
+
]),
|
|
193
|
+
vue.createElementVNode("div", {
|
|
194
|
+
class: "yc-chat-sidebar__item-actions",
|
|
195
|
+
onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => {
|
|
196
|
+
}, ["stop"]))
|
|
197
|
+
}, [
|
|
198
|
+
vue.createElementVNode("button", {
|
|
199
|
+
type: "button",
|
|
200
|
+
class: "yc-chat-sidebar__delete-btn",
|
|
201
|
+
"aria-label": "\u5220\u9664\u4F1A\u8BDD",
|
|
202
|
+
title: "\u5220\u9664\u4F1A\u8BDD",
|
|
203
|
+
onClick: vue.withModifiers(($event) => emit("delete", item.id), ["stop"])
|
|
204
|
+
}, [..._cache[6] || (_cache[6] = [
|
|
205
|
+
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: "M3.5 4.5H12.5M6.25 4.5V3.25C6.25 2.84 6.59 2.5 7 2.5H9C9.41 2.5 9.75 2.84 9.75 3.25V4.5M5 4.5L5.45 12.4C5.48 13.02 5.99 13.5 6.6 13.5H9.4C10.01 13.5 10.52 13.02 10.55 12.4L11 4.5",
|
|
215
|
+
stroke: "currentColor",
|
|
216
|
+
"stroke-width": "1.3",
|
|
217
|
+
"stroke-linecap": "round",
|
|
218
|
+
"stroke-linejoin": "round"
|
|
219
|
+
})
|
|
220
|
+
],
|
|
221
|
+
-1
|
|
222
|
+
/* CACHED */
|
|
223
|
+
)
|
|
224
|
+
])], 8, _hoisted_12)
|
|
225
|
+
])
|
|
226
|
+
],
|
|
227
|
+
2
|
|
228
|
+
/* CLASS */
|
|
229
|
+
)
|
|
230
|
+
]),
|
|
231
|
+
_: 2
|
|
232
|
+
/* DYNAMIC */
|
|
233
|
+
}, [
|
|
234
|
+
__props.hasMore ? {
|
|
235
|
+
name: "load-more",
|
|
236
|
+
fn: vue.withCtx(() => [
|
|
237
|
+
vue.createElementVNode("div", _hoisted_13, [
|
|
238
|
+
vue.createElementVNode("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
class: "yc-chat-sidebar__more-btn",
|
|
241
|
+
disabled: __props.loading,
|
|
242
|
+
onClick: _cache[3] || (_cache[3] = ($event) => emit("load-more"))
|
|
243
|
+
}, vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u591A\u4F1A\u8BDD"), 9, _hoisted_14)
|
|
244
|
+
])
|
|
245
|
+
]),
|
|
246
|
+
key: "0"
|
|
247
|
+
} : void 0
|
|
248
|
+
]), 1032, ["items", "active"]))
|
|
249
|
+
])
|
|
250
|
+
]);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var mobileFrame_vue_vue_type_script_setup_true_lang = require('./mobile-frame2.vue.js');
|
|
7
|
+
var presets = require('./presets.js');
|
|
8
|
+
|
|
9
|
+
const _hoisted_1 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "yc-chat-studio__notices"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_2 = { class: "yc-chat-studio__topbar conversation-banner" };
|
|
14
|
+
const _hoisted_3 = { class: "yc-chat-studio__left" };
|
|
15
|
+
const _hoisted_4 = ["aria-label", "title"];
|
|
16
|
+
const _hoisted_5 = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "yc-chat-studio__context",
|
|
19
|
+
"data-testid": "studio-context-bar"
|
|
20
|
+
};
|
|
21
|
+
const _hoisted_6 = { class: "yc-chat-studio__status-group" };
|
|
22
|
+
const _hoisted_7 = { class: "status-label" };
|
|
23
|
+
const _hoisted_8 = { class: "banner-subtitle yc-chat-studio__subtitle" };
|
|
24
|
+
const _hoisted_9 = { class: "yc-chat-studio__right" };
|
|
25
|
+
const _hoisted_10 = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "yc-chat-studio__devices",
|
|
28
|
+
"aria-label": "\u79FB\u52A8\u7AEF\u673A\u578B\u9884\u8BBE"
|
|
29
|
+
};
|
|
30
|
+
const _hoisted_11 = ["data-testid", "onClick"];
|
|
31
|
+
const _hoisted_12 = {
|
|
32
|
+
class: "yc-chat-studio__segmented",
|
|
33
|
+
role: "tablist",
|
|
34
|
+
"aria-label": "\u7EC8\u7AEF\u9884\u89C8\u5207\u6362"
|
|
35
|
+
};
|
|
36
|
+
const _hoisted_13 = ["aria-selected"];
|
|
37
|
+
const _hoisted_14 = ["aria-selected"];
|
|
38
|
+
const _hoisted_15 = ["disabled"];
|
|
39
|
+
const _hoisted_16 = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "yc-chat-studio__web-body chat-workspace"
|
|
42
|
+
};
|
|
43
|
+
const _hoisted_17 = { class: "yc-chat-studio__main conversation-panel" };
|
|
44
|
+
const _hoisted_18 = { class: "yc-chat-studio__stream-inner" };
|
|
45
|
+
const _hoisted_19 = { class: "yc-chat-studio__composer-dock" };
|
|
46
|
+
const _hoisted_20 = { class: "yc-chat-studio__composer-inner" };
|
|
47
|
+
const _hoisted_21 = {
|
|
48
|
+
key: 2,
|
|
49
|
+
class: "yc-chat-studio__mobile-stage",
|
|
50
|
+
"data-testid": "mobile-stage"
|
|
51
|
+
};
|
|
52
|
+
const _hoisted_22 = { class: "yc-chat-studio__mobile-canvas" };
|
|
53
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
54
|
+
...{
|
|
55
|
+
name: "YcChatStudio"
|
|
56
|
+
},
|
|
57
|
+
__name: "studio",
|
|
58
|
+
props: {
|
|
59
|
+
viewport: { default: "web" },
|
|
60
|
+
deviceId: { default: "wecom" },
|
|
61
|
+
devices: { default: () => presets.YC_MOBILE_DEVICE_PRESETS },
|
|
62
|
+
agentName: { default: "" },
|
|
63
|
+
bannerSubtitle: { default: "\u4F7F\u7528\u5F53\u524D\u5E94\u7528\u4E0E Agent \u505A\u5B9E\u65F6\u9A8C\u8BC1" },
|
|
64
|
+
status: { default: "idle" },
|
|
65
|
+
statusLabel: { default: "\u672A\u8FDE\u63A5" },
|
|
66
|
+
connected: { type: Boolean, default: false },
|
|
67
|
+
refreshing: { type: Boolean, default: false },
|
|
68
|
+
sessionCount: { default: 0 }
|
|
69
|
+
},
|
|
70
|
+
emits: ["update:viewport", "update:deviceId", "refresh", "create"],
|
|
71
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
72
|
+
const props = __props;
|
|
73
|
+
const emit = __emit;
|
|
74
|
+
const sidebarCollapsed = vue.ref(false);
|
|
75
|
+
const webScrollRef = vue.ref(null);
|
|
76
|
+
const mobileScrollRef = vue.ref(null);
|
|
77
|
+
const mobileFrameRef = vue.ref(null);
|
|
78
|
+
const activeDevice = vue.computed(() => {
|
|
79
|
+
return props.devices.find((item) => item.id === props.deviceId) || props.devices[0] || presets.YC_MOBILE_DEVICE_PRESETS[0];
|
|
80
|
+
});
|
|
81
|
+
function switchViewport(mode) {
|
|
82
|
+
if (mode === props.viewport) return;
|
|
83
|
+
emit("update:viewport", mode);
|
|
84
|
+
void scrollToBottom();
|
|
85
|
+
}
|
|
86
|
+
function selectDevice(id) {
|
|
87
|
+
emit("update:deviceId", id);
|
|
88
|
+
}
|
|
89
|
+
function getScrollContainer() {
|
|
90
|
+
return props.viewport === "mobile" ? mobileScrollRef.value : webScrollRef.value;
|
|
91
|
+
}
|
|
92
|
+
async function scrollToBottom() {
|
|
93
|
+
await vue.nextTick();
|
|
94
|
+
const el = getScrollContainer();
|
|
95
|
+
if (el) {
|
|
96
|
+
el.scrollTop = el.scrollHeight;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function closeMobileDrawer() {
|
|
100
|
+
var _a;
|
|
101
|
+
(_a = mobileFrameRef.value) == null ? void 0 : _a.closeDrawer();
|
|
102
|
+
}
|
|
103
|
+
__expose({
|
|
104
|
+
getScrollContainer,
|
|
105
|
+
scrollToBottom,
|
|
106
|
+
closeMobileDrawer
|
|
107
|
+
});
|
|
108
|
+
return (_ctx, _cache) => {
|
|
109
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
class: vue.normalizeClass(["yc-chat-studio tenant-chat-page", `is-${__props.viewport}`])
|
|
113
|
+
},
|
|
114
|
+
[
|
|
115
|
+
_ctx.$slots.notice ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
116
|
+
vue.renderSlot(_ctx.$slots, "notice")
|
|
117
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
118
|
+
vue.createElementVNode("header", _hoisted_2, [
|
|
119
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
120
|
+
__props.viewport === "web" ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
121
|
+
key: 0,
|
|
122
|
+
type: "button",
|
|
123
|
+
class: "yc-chat-studio__icon-btn",
|
|
124
|
+
"aria-label": sidebarCollapsed.value ? "\u5C55\u5F00\u4F1A\u8BDD\u4FA7\u680F" : "\u6536\u8D77\u4F1A\u8BDD\u4FA7\u680F",
|
|
125
|
+
title: sidebarCollapsed.value ? "\u5C55\u5F00\u4F1A\u8BDD\u4FA7\u680F" : "\u6536\u8D77\u4F1A\u8BDD\u4FA7\u680F",
|
|
126
|
+
onClick: _cache[0] || (_cache[0] = ($event) => sidebarCollapsed.value = !sidebarCollapsed.value)
|
|
127
|
+
}, [..._cache[6] || (_cache[6] = [
|
|
128
|
+
vue.createElementVNode(
|
|
129
|
+
"svg",
|
|
130
|
+
{
|
|
131
|
+
viewBox: "0 0 18 18",
|
|
132
|
+
fill: "none",
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
},
|
|
135
|
+
[
|
|
136
|
+
vue.createElementVNode("rect", {
|
|
137
|
+
x: "2.25",
|
|
138
|
+
y: "3",
|
|
139
|
+
width: "13.5",
|
|
140
|
+
height: "12",
|
|
141
|
+
rx: "2.5",
|
|
142
|
+
stroke: "currentColor",
|
|
143
|
+
"stroke-width": "1.4"
|
|
144
|
+
}),
|
|
145
|
+
vue.createElementVNode("path", {
|
|
146
|
+
d: "M6.75 3V15",
|
|
147
|
+
stroke: "currentColor",
|
|
148
|
+
"stroke-width": "1.4"
|
|
149
|
+
})
|
|
150
|
+
],
|
|
151
|
+
-1
|
|
152
|
+
/* CACHED */
|
|
153
|
+
)
|
|
154
|
+
])], 8, _hoisted_4)) : vue.createCommentVNode("v-if", true),
|
|
155
|
+
_ctx.$slots.toolbar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
156
|
+
vue.renderSlot(_ctx.$slots, "toolbar")
|
|
157
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
158
|
+
vue.createElementVNode("div", _hoisted_6, [
|
|
159
|
+
vue.createElementVNode(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
class: vue.normalizeClass(["yc-chat-studio__status-chip", `is-${__props.status}`])
|
|
163
|
+
},
|
|
164
|
+
[
|
|
165
|
+
vue.createElementVNode(
|
|
166
|
+
"span",
|
|
167
|
+
{
|
|
168
|
+
class: vue.normalizeClass(["status-dot", __props.status])
|
|
169
|
+
},
|
|
170
|
+
null,
|
|
171
|
+
2
|
|
172
|
+
/* CLASS */
|
|
173
|
+
),
|
|
174
|
+
vue.createElementVNode(
|
|
175
|
+
"span",
|
|
176
|
+
_hoisted_7,
|
|
177
|
+
vue.toDisplayString(__props.statusLabel),
|
|
178
|
+
1
|
|
179
|
+
/* TEXT */
|
|
180
|
+
)
|
|
181
|
+
],
|
|
182
|
+
2
|
|
183
|
+
/* CLASS */
|
|
184
|
+
),
|
|
185
|
+
vue.createElementVNode(
|
|
186
|
+
"span",
|
|
187
|
+
_hoisted_8,
|
|
188
|
+
vue.toDisplayString(__props.bannerSubtitle),
|
|
189
|
+
1
|
|
190
|
+
/* TEXT */
|
|
191
|
+
)
|
|
192
|
+
])
|
|
193
|
+
]),
|
|
194
|
+
vue.createElementVNode("div", _hoisted_9, [
|
|
195
|
+
__props.viewport === "mobile" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
196
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
197
|
+
vue.Fragment,
|
|
198
|
+
null,
|
|
199
|
+
vue.renderList(__props.devices, (preset) => {
|
|
200
|
+
return vue.openBlock(), vue.createElementBlock("button", {
|
|
201
|
+
key: preset.id,
|
|
202
|
+
type: "button",
|
|
203
|
+
class: vue.normalizeClass(["yc-chat-studio__device-pill", { "is-active": preset.id === activeDevice.value.id }]),
|
|
204
|
+
"data-testid": `device-preset-${preset.id}`,
|
|
205
|
+
onClick: ($event) => selectDevice(preset.id)
|
|
206
|
+
}, vue.toDisplayString(preset.label), 11, _hoisted_11);
|
|
207
|
+
}),
|
|
208
|
+
128
|
|
209
|
+
/* KEYED_FRAGMENT */
|
|
210
|
+
))
|
|
211
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
212
|
+
vue.createElementVNode("div", _hoisted_12, [
|
|
213
|
+
vue.createElementVNode("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
role: "tab",
|
|
216
|
+
"aria-selected": __props.viewport === "web",
|
|
217
|
+
"data-testid": "viewport-web",
|
|
218
|
+
class: vue.normalizeClass(["yc-chat-studio__segment-btn", { "is-active": __props.viewport === "web" }]),
|
|
219
|
+
onClick: _cache[1] || (_cache[1] = ($event) => switchViewport("web"))
|
|
220
|
+
}, [..._cache[7] || (_cache[7] = [
|
|
221
|
+
vue.createElementVNode(
|
|
222
|
+
"svg",
|
|
223
|
+
{
|
|
224
|
+
viewBox: "0 0 16 16",
|
|
225
|
+
fill: "none",
|
|
226
|
+
"aria-hidden": "true"
|
|
227
|
+
},
|
|
228
|
+
[
|
|
229
|
+
vue.createElementVNode("rect", {
|
|
230
|
+
x: "1.75",
|
|
231
|
+
y: "2.5",
|
|
232
|
+
width: "12.5",
|
|
233
|
+
height: "8.5",
|
|
234
|
+
rx: "1.6",
|
|
235
|
+
stroke: "currentColor",
|
|
236
|
+
"stroke-width": "1.35"
|
|
237
|
+
}),
|
|
238
|
+
vue.createElementVNode("path", {
|
|
239
|
+
d: "M5.5 13.5H10.5M8 11V13.5",
|
|
240
|
+
stroke: "currentColor",
|
|
241
|
+
"stroke-width": "1.35",
|
|
242
|
+
"stroke-linecap": "round"
|
|
243
|
+
})
|
|
244
|
+
],
|
|
245
|
+
-1
|
|
246
|
+
/* CACHED */
|
|
247
|
+
),
|
|
248
|
+
vue.createElementVNode(
|
|
249
|
+
"span",
|
|
250
|
+
null,
|
|
251
|
+
"\u7F51\u9875\u7AEF",
|
|
252
|
+
-1
|
|
253
|
+
/* CACHED */
|
|
254
|
+
)
|
|
255
|
+
])], 10, _hoisted_13),
|
|
256
|
+
vue.createElementVNode("button", {
|
|
257
|
+
type: "button",
|
|
258
|
+
role: "tab",
|
|
259
|
+
"aria-selected": __props.viewport === "mobile",
|
|
260
|
+
"data-testid": "viewport-mobile",
|
|
261
|
+
class: vue.normalizeClass(["yc-chat-studio__segment-btn", { "is-active": __props.viewport === "mobile" }]),
|
|
262
|
+
onClick: _cache[2] || (_cache[2] = ($event) => switchViewport("mobile"))
|
|
263
|
+
}, [..._cache[8] || (_cache[8] = [
|
|
264
|
+
vue.createElementVNode(
|
|
265
|
+
"svg",
|
|
266
|
+
{
|
|
267
|
+
viewBox: "0 0 16 16",
|
|
268
|
+
fill: "none",
|
|
269
|
+
"aria-hidden": "true"
|
|
270
|
+
},
|
|
271
|
+
[
|
|
272
|
+
vue.createElementVNode("rect", {
|
|
273
|
+
x: "4.25",
|
|
274
|
+
y: "1.75",
|
|
275
|
+
width: "7.5",
|
|
276
|
+
height: "12.5",
|
|
277
|
+
rx: "1.8",
|
|
278
|
+
stroke: "currentColor",
|
|
279
|
+
"stroke-width": "1.35"
|
|
280
|
+
}),
|
|
281
|
+
vue.createElementVNode("path", {
|
|
282
|
+
d: "M7 12H9",
|
|
283
|
+
stroke: "currentColor",
|
|
284
|
+
"stroke-width": "1.35",
|
|
285
|
+
"stroke-linecap": "round"
|
|
286
|
+
})
|
|
287
|
+
],
|
|
288
|
+
-1
|
|
289
|
+
/* CACHED */
|
|
290
|
+
),
|
|
291
|
+
vue.createElementVNode(
|
|
292
|
+
"span",
|
|
293
|
+
null,
|
|
294
|
+
"\u624B\u673A\u7AEF",
|
|
295
|
+
-1
|
|
296
|
+
/* CACHED */
|
|
297
|
+
)
|
|
298
|
+
])], 10, _hoisted_14)
|
|
299
|
+
]),
|
|
300
|
+
vue.createElementVNode("button", {
|
|
301
|
+
type: "button",
|
|
302
|
+
class: "yc-chat-studio__ghost-btn",
|
|
303
|
+
disabled: __props.refreshing,
|
|
304
|
+
"aria-label": "\u5237\u65B0\u4F1A\u8BDD\u5217\u8868",
|
|
305
|
+
onClick: _cache[3] || (_cache[3] = ($event) => emit("refresh"))
|
|
306
|
+
}, [
|
|
307
|
+
(vue.openBlock(), vue.createElementBlock(
|
|
308
|
+
"svg",
|
|
309
|
+
{
|
|
310
|
+
viewBox: "0 0 16 16",
|
|
311
|
+
fill: "none",
|
|
312
|
+
class: vue.normalizeClass({ "is-spinning": __props.refreshing }),
|
|
313
|
+
"aria-hidden": "true"
|
|
314
|
+
},
|
|
315
|
+
[..._cache[9] || (_cache[9] = [
|
|
316
|
+
vue.createElementVNode(
|
|
317
|
+
"path",
|
|
318
|
+
{
|
|
319
|
+
d: "M13.25 8A5.25 5.25 0 1 1 11.7 4.28L13.25 5.75M13.25 2.75V5.75H10.25",
|
|
320
|
+
stroke: "currentColor",
|
|
321
|
+
"stroke-width": "1.4",
|
|
322
|
+
"stroke-linecap": "round",
|
|
323
|
+
"stroke-linejoin": "round"
|
|
324
|
+
},
|
|
325
|
+
null,
|
|
326
|
+
-1
|
|
327
|
+
/* CACHED */
|
|
328
|
+
)
|
|
329
|
+
])],
|
|
330
|
+
2
|
|
331
|
+
/* CLASS */
|
|
332
|
+
)),
|
|
333
|
+
_cache[10] || (_cache[10] = vue.createElementVNode(
|
|
334
|
+
"span",
|
|
335
|
+
null,
|
|
336
|
+
"\u5237\u65B0",
|
|
337
|
+
-1
|
|
338
|
+
/* CACHED */
|
|
339
|
+
))
|
|
340
|
+
], 8, _hoisted_15)
|
|
341
|
+
])
|
|
342
|
+
]),
|
|
343
|
+
__props.viewport === "web" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
|
|
344
|
+
vue.createElementVNode(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
class: vue.normalizeClass(["yc-chat-studio__sidebar-wrap", { "is-collapsed": sidebarCollapsed.value }])
|
|
348
|
+
},
|
|
349
|
+
[
|
|
350
|
+
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
351
|
+
],
|
|
352
|
+
2
|
|
353
|
+
/* CLASS */
|
|
354
|
+
),
|
|
355
|
+
vue.createElementVNode("section", _hoisted_17, [
|
|
356
|
+
vue.createElementVNode(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
ref_key: "webScrollRef",
|
|
360
|
+
ref: webScrollRef,
|
|
361
|
+
class: "yc-chat-studio__stream message-viewport"
|
|
362
|
+
},
|
|
363
|
+
[
|
|
364
|
+
vue.createElementVNode("div", _hoisted_18, [
|
|
365
|
+
vue.renderSlot(_ctx.$slots, "messages")
|
|
366
|
+
])
|
|
367
|
+
],
|
|
368
|
+
512
|
|
369
|
+
/* NEED_PATCH */
|
|
370
|
+
),
|
|
371
|
+
vue.createElementVNode("div", _hoisted_19, [
|
|
372
|
+
vue.createElementVNode("div", _hoisted_20, [
|
|
373
|
+
vue.renderSlot(_ctx.$slots, "composer")
|
|
374
|
+
])
|
|
375
|
+
])
|
|
376
|
+
])
|
|
377
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
|
|
378
|
+
vue.createElementVNode("div", _hoisted_22, [
|
|
379
|
+
vue.createVNode(mobileFrame_vue_vue_type_script_setup_true_lang.default, {
|
|
380
|
+
ref_key: "mobileFrameRef",
|
|
381
|
+
ref: mobileFrameRef,
|
|
382
|
+
device: activeDevice.value,
|
|
383
|
+
"agent-name": __props.agentName || "AI \u52A9\u624B",
|
|
384
|
+
status: __props.status,
|
|
385
|
+
"status-label": __props.statusLabel,
|
|
386
|
+
connected: __props.connected,
|
|
387
|
+
"session-count": __props.sessionCount,
|
|
388
|
+
onCreate: _cache[4] || (_cache[4] = ($event) => emit("create")),
|
|
389
|
+
onRefresh: _cache[5] || (_cache[5] = ($event) => emit("refresh"))
|
|
390
|
+
}, {
|
|
391
|
+
drawer: vue.withCtx(() => [
|
|
392
|
+
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
393
|
+
]),
|
|
394
|
+
footer: vue.withCtx(() => [
|
|
395
|
+
vue.renderSlot(_ctx.$slots, "composer")
|
|
396
|
+
]),
|
|
397
|
+
default: vue.withCtx(() => [
|
|
398
|
+
vue.createElementVNode(
|
|
399
|
+
"div",
|
|
400
|
+
{
|
|
401
|
+
ref_key: "mobileScrollRef",
|
|
402
|
+
ref: mobileScrollRef,
|
|
403
|
+
class: "yc-chat-studio__mobile-stream message-viewport"
|
|
404
|
+
},
|
|
405
|
+
[
|
|
406
|
+
vue.renderSlot(_ctx.$slots, "messages")
|
|
407
|
+
],
|
|
408
|
+
512
|
|
409
|
+
/* NEED_PATCH */
|
|
410
|
+
)
|
|
411
|
+
]),
|
|
412
|
+
_: 3
|
|
413
|
+
/* FORWARDED */
|
|
414
|
+
}, 8, ["device", "agent-name", "status", "status-label", "connected", "session-count"])
|
|
415
|
+
])
|
|
416
|
+
]))
|
|
417
|
+
],
|
|
418
|
+
2
|
|
419
|
+
/* CLASS */
|
|
420
|
+
);
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
exports.default = _sfc_main;
|