yc-agent-ui 1.2.0 → 1.2.2
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 +26 -5
- package/es/components/chart/src/chart-card.vue.d.ts +56 -10
- package/es/components/chart/src/chart-container.vue.d.ts +11 -1
- package/es/components/chart/src/theme.d.ts +1 -1
- 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/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 +1 -0
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +2 -0
- package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +2 -0
- package/es/components/yc-ai-chat/src/select.vue.d.ts +1 -0
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +1 -0
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +15 -1
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +5 -1
- package/es/components/yc-ai-chat/src/welcome.vue.d.ts +11 -1
- 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 +9 -9
- package/es/index.mjs +1 -0
- package/es/packages/components/chart/src/chart-card2.vue.mjs +9 -2
- package/es/packages/components/chart/src/chart-container2.vue.mjs +13 -1
- package/es/packages/components/chart/src/theme.mjs +18 -10
- package/es/packages/components/data-table/capability.mjs +1 -1
- package/es/packages/components/index.mjs +1 -0
- package/es/packages/components/yc-ai-chat/index.mjs +1 -0
- package/es/packages/components/yc-ai-chat/src/bubble2.vue.mjs +24 -15
- package/es/packages/components/yc-ai-chat/src/mobile-frame2.vue.mjs +34 -31
- package/es/packages/components/yc-ai-chat/src/presets.mjs +1 -1
- package/es/packages/components/yc-ai-chat/src/select2.vue.mjs +9 -4
- package/es/packages/components/yc-ai-chat/src/sender2.vue.mjs +20 -17
- package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +89 -56
- package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +304 -119
- package/es/packages/components/yc-ai-chat/src/welcome2.vue.mjs +22 -40
- package/es/packages/components/yc-gradient-card/capability.mjs +8 -8
- package/es/packages/components/yc-input/src/stepper-input2.vue.mjs +48 -24
- package/es/packages/registry/types.mjs +1 -1
- package/es/registry/types.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +4093 -824
- package/index.min.js +42 -39
- package/index.min.mjs +39 -36
- package/index.mjs +4169 -910
- package/lib/components/chart/src/chart-card.vue.d.ts +56 -10
- package/lib/components/chart/src/chart-container.vue.d.ts +11 -1
- package/lib/components/chart/src/theme.d.ts +1 -1
- 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/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 +1 -0
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +2 -0
- package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +2 -0
- package/lib/components/yc-ai-chat/src/select.vue.d.ts +1 -0
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +1 -0
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +15 -1
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +5 -1
- package/lib/components/yc-ai-chat/src/welcome.vue.d.ts +11 -1
- 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 +11 -11
- package/lib/index.js +41 -0
- package/lib/packages/components/chart/src/chart-card2.vue.js +9 -2
- package/lib/packages/components/chart/src/chart-container2.vue.js +13 -1
- package/lib/packages/components/chart/src/theme.js +18 -10
- package/lib/packages/components/data-table/capability.js +1 -1
- package/lib/packages/components/index.js +41 -0
- package/lib/packages/components/yc-ai-chat/index.js +41 -0
- package/lib/packages/components/yc-ai-chat/src/bubble2.vue.js +24 -15
- package/lib/packages/components/yc-ai-chat/src/mobile-frame2.vue.js +34 -31
- package/lib/packages/components/yc-ai-chat/src/presets.js +1 -1
- package/lib/packages/components/yc-ai-chat/src/select2.vue.js +9 -4
- package/lib/packages/components/yc-ai-chat/src/sender2.vue.js +20 -17
- package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +88 -55
- package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +303 -118
- package/lib/packages/components/yc-ai-chat/src/welcome2.vue.js +21 -39
- package/lib/packages/components/yc-gradient-card/capability.js +8 -8
- package/lib/packages/components/yc-input/src/stepper-input2.vue.js +47 -23
- package/lib/packages/registry/types.js +1 -1
- package/lib/registry/types.d.ts +1 -1
- 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 +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/plus-search.css +1 -1
- package/theme-chalk/plus-yc-ai-chat.css +1 -1
- package/theme-chalk/plus-yc-data-table.css +1 -1
- package/theme-chalk/plus-yc-property-table.css +1 -1
- package/theme-chalk/src/search.scss +93 -3
- package/theme-chalk/src/yc-ai-chat.scss +785 -18
- package/theme-chalk/src/yc-data-table.scss +57 -42
- package/theme-chalk/src/yc-property-table.scss +35 -14
|
@@ -12,6 +12,7 @@ var sender_vue_vue_type_script_setup_true_lang = require('./src/sender2.vue.js')
|
|
|
12
12
|
var select_vue_vue_type_script_setup_true_lang = require('./src/select2.vue.js');
|
|
13
13
|
var mobileFrame_vue_vue_type_script_setup_true_lang = require('./src/mobile-frame2.vue.js');
|
|
14
14
|
var presets = require('./src/presets.js');
|
|
15
|
+
var vueElementPlusX = require('vue-element-plus-x');
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
@@ -29,3 +30,43 @@ exports.YC_MOBILE_DEVICE_PRESETS = presets.YC_MOBILE_DEVICE_PRESETS;
|
|
|
29
30
|
exports.formatChatFileSize = presets.formatChatFileSize;
|
|
30
31
|
exports.formatChatSessionTime = presets.formatChatSessionTime;
|
|
31
32
|
exports.groupChatSessionByDate = presets.groupChatSessionByDate;
|
|
33
|
+
Object.defineProperty(exports, "Attachments", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return vueElementPlusX.Attachments; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "Bubble", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return vueElementPlusX.Bubble; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "BubbleList", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return vueElementPlusX.BubbleList; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "Conversations", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return vueElementPlusX.Conversations; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "FilesCard", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return vueElementPlusX.FilesCard; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "Prompts", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return vueElementPlusX.Prompts; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "Thinking", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return vueElementPlusX.Thinking; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "ThoughtChain", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return vueElementPlusX.ThoughtChain; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "Welcome", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return vueElementPlusX.Welcome; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "XSender", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return vueElementPlusX.XSender; }
|
|
72
|
+
});
|
|
@@ -51,6 +51,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
51
|
status: { default: "completed" },
|
|
52
52
|
metrics: { default: () => [] },
|
|
53
53
|
identifiers: { default: () => [] },
|
|
54
|
+
identifiersTitle: { default: "ID" },
|
|
54
55
|
canCopyContent: { type: Boolean, default: true },
|
|
55
56
|
compact: { type: Boolean, default: false }
|
|
56
57
|
},
|
|
@@ -128,7 +129,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
128
129
|
vue.createElementVNode(
|
|
129
130
|
"summary",
|
|
130
131
|
_hoisted_7,
|
|
131
|
-
|
|
132
|
+
vue.toDisplayString(__props.identifiersTitle) + " (" + vue.toDisplayString(__props.identifiers.length) + ") ",
|
|
132
133
|
1
|
|
133
134
|
/* TEXT */
|
|
134
135
|
),
|
|
@@ -219,7 +220,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
219
220
|
-1
|
|
220
221
|
/* CACHED */
|
|
221
222
|
)),
|
|
222
|
-
!__props.compact ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_13, "
|
|
223
|
+
!__props.compact ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_13, "ID")) : vue.createCommentVNode("v-if", true)
|
|
223
224
|
], 8, _hoisted_12)
|
|
224
225
|
])
|
|
225
226
|
],
|
|
@@ -233,26 +234,34 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
233
234
|
__props.role === "assistant" ? {
|
|
234
235
|
name: "avatar",
|
|
235
236
|
fn: vue.withCtx(() => [
|
|
236
|
-
|
|
237
|
+
vue.createElementVNode(
|
|
237
238
|
"div",
|
|
238
239
|
{
|
|
239
|
-
class: "yc-chat-bubble__avatar is-assistant",
|
|
240
|
+
class: vue.normalizeClass(["yc-chat-bubble__avatar is-assistant", { "is-custom": Boolean(_ctx.$slots.avatar) }]),
|
|
240
241
|
"aria-hidden": "true"
|
|
241
242
|
},
|
|
242
243
|
[
|
|
243
|
-
vue.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
vue.renderSlot(_ctx.$slots, "avatar", {}, () => [
|
|
245
|
+
_cache[2] || (_cache[2] = vue.createElementVNode(
|
|
246
|
+
"svg",
|
|
247
|
+
{
|
|
248
|
+
viewBox: "0 0 20 20",
|
|
249
|
+
fill: "none"
|
|
250
|
+
},
|
|
251
|
+
[
|
|
252
|
+
vue.createElementVNode("path", {
|
|
253
|
+
d: "M10 3L11.6 8.4L17 10L11.6 11.6L10 17L8.4 11.6L3 10L8.4 8.4L10 3Z",
|
|
254
|
+
fill: "currentColor"
|
|
255
|
+
})
|
|
256
|
+
],
|
|
257
|
+
-1
|
|
258
|
+
/* CACHED */
|
|
259
|
+
))
|
|
251
260
|
])
|
|
252
261
|
],
|
|
253
|
-
|
|
254
|
-
/*
|
|
255
|
-
)
|
|
262
|
+
2
|
|
263
|
+
/* CLASS */
|
|
264
|
+
)
|
|
256
265
|
]),
|
|
257
266
|
key: "0"
|
|
258
267
|
} : void 0,
|
|
@@ -20,7 +20,14 @@ const _hoisted_10 = { class: "yc-mobile-device__viewport" };
|
|
|
20
20
|
const _hoisted_11 = { class: "yc-mobile-device__body" };
|
|
21
21
|
const _hoisted_12 = { class: "yc-mobile-device__footer" };
|
|
22
22
|
const _hoisted_13 = { class: "yc-mobile-device__drawer" };
|
|
23
|
-
const _hoisted_14 = { class: "yc-mobile-
|
|
23
|
+
const _hoisted_14 = { class: "yc-mobile-device__drawer-top" };
|
|
24
|
+
const _hoisted_15 = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "yc-mobile-device__caption"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_16 = { key: 0 };
|
|
29
|
+
const _hoisted_17 = { key: 1 };
|
|
30
|
+
const _hoisted_18 = { key: 2 };
|
|
24
31
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
25
32
|
...{
|
|
26
33
|
name: "YcMobileDeviceFrame"
|
|
@@ -28,11 +35,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
28
35
|
__name: "mobile-frame",
|
|
29
36
|
props: {
|
|
30
37
|
device: {},
|
|
31
|
-
agentName: { default: "
|
|
38
|
+
agentName: { default: "" },
|
|
32
39
|
status: { default: "idle" },
|
|
33
|
-
statusLabel: { default: "
|
|
40
|
+
statusLabel: { default: "" },
|
|
34
41
|
connected: { type: Boolean, default: false },
|
|
35
|
-
sessionCount: { default: 0 }
|
|
42
|
+
sessionCount: { default: 0 },
|
|
43
|
+
caption: { default: "" },
|
|
44
|
+
drawerTitle: { default: "\u4F1A\u8BDD" }
|
|
36
45
|
},
|
|
37
46
|
emits: ["create", "refresh"],
|
|
38
47
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -57,7 +66,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
57
66
|
"data-device": __props.device.id
|
|
58
67
|
}, [
|
|
59
68
|
vue.createElementVNode("div", _hoisted_2, [
|
|
60
|
-
_cache[
|
|
69
|
+
_cache[5] || (_cache[5] = vue.createStaticVNode('<div class="yc-mobile-device__statusbar" aria-hidden="true"><span class="yc-mobile-device__clock">09:41</span><div class="yc-mobile-device__island"></div><div class="yc-mobile-device__signals"><svg viewBox="0 0 18 12" class="yc-mobile-device__signal-svg"><rect x="1" y="8" width="2.5" height="3.5" rx="0.8" fill="currentColor"></rect><rect x="5" y="6" width="2.5" height="5.5" rx="0.8" fill="currentColor"></rect><rect x="9" y="3.5" width="2.5" height="8" rx="0.8" fill="currentColor"></rect><rect x="13" y="1" width="2.5" height="10.5" rx="0.8" fill="currentColor"></rect></svg><svg viewBox="0 0 24 12" class="yc-mobile-device__battery-svg"><rect x="1" y="1.5" width="19" height="9" rx="2.5" stroke="currentColor" stroke-width="1.3" fill="none"></rect><rect x="3" y="3.3" width="14.5" height="5.4" rx="1.2" fill="currentColor"></rect><path d="M21.5 4.2V7.8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></div></div>', 1)),
|
|
61
70
|
vue.createElementVNode("header", _hoisted_3, [
|
|
62
71
|
vue.createElementVNode("button", {
|
|
63
72
|
type: "button",
|
|
@@ -96,7 +105,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
96
105
|
vue.createElementVNode(
|
|
97
106
|
"div",
|
|
98
107
|
_hoisted_6,
|
|
99
|
-
vue.toDisplayString(__props.agentName
|
|
108
|
+
vue.toDisplayString(__props.agentName),
|
|
100
109
|
1
|
|
101
110
|
/* TEXT */
|
|
102
111
|
),
|
|
@@ -162,14 +171,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
162
171
|
onClick: vue.withModifiers(closeDrawer, ["self"])
|
|
163
172
|
}, [
|
|
164
173
|
vue.createElementVNode("div", _hoisted_13, [
|
|
165
|
-
vue.createElementVNode("div",
|
|
166
|
-
|
|
174
|
+
vue.createElementVNode("div", _hoisted_14, [
|
|
175
|
+
vue.createElementVNode(
|
|
167
176
|
"span",
|
|
168
177
|
null,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/*
|
|
172
|
-
)
|
|
178
|
+
vue.toDisplayString(__props.drawerTitle),
|
|
179
|
+
1
|
|
180
|
+
/* TEXT */
|
|
181
|
+
),
|
|
173
182
|
vue.createElementVNode("button", {
|
|
174
183
|
type: "button",
|
|
175
184
|
class: "yc-mobile-device__nav-btn",
|
|
@@ -205,7 +214,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
205
214
|
])
|
|
206
215
|
])) : vue.createCommentVNode("v-if", true)
|
|
207
216
|
]),
|
|
208
|
-
_cache[
|
|
217
|
+
_cache[6] || (_cache[6] = vue.createElementVNode(
|
|
209
218
|
"div",
|
|
210
219
|
{
|
|
211
220
|
class: "yc-mobile-device__home-bar",
|
|
@@ -218,29 +227,23 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
218
227
|
/* CACHED */
|
|
219
228
|
))
|
|
220
229
|
]),
|
|
221
|
-
vue.
|
|
222
|
-
vue.
|
|
230
|
+
__props.device.badge || __props.caption ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15, [
|
|
231
|
+
__props.device.badge ? (vue.openBlock(), vue.createElementBlock(
|
|
223
232
|
"span",
|
|
224
|
-
|
|
233
|
+
_hoisted_16,
|
|
225
234
|
vue.toDisplayString(__props.device.badge),
|
|
226
235
|
1
|
|
227
236
|
/* TEXT */
|
|
228
|
-
),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
null,
|
|
232
|
-
"\xB7",
|
|
233
|
-
-1
|
|
234
|
-
/* CACHED */
|
|
235
|
-
)),
|
|
236
|
-
_cache[9] || (_cache[9] = vue.createElementVNode(
|
|
237
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
238
|
+
__props.device.badge && __props.caption ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_17, "\xB7")) : vue.createCommentVNode("v-if", true),
|
|
239
|
+
__props.caption ? (vue.openBlock(), vue.createElementBlock(
|
|
237
240
|
"span",
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
/*
|
|
242
|
-
))
|
|
243
|
-
])
|
|
241
|
+
_hoisted_18,
|
|
242
|
+
vue.toDisplayString(__props.caption),
|
|
243
|
+
1
|
|
244
|
+
/* TEXT */
|
|
245
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
246
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
244
247
|
], 12, _hoisted_1);
|
|
245
248
|
};
|
|
246
249
|
}
|
|
@@ -59,7 +59,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
59
59
|
loading: { type: Boolean, default: false },
|
|
60
60
|
clearable: { type: Boolean, default: false },
|
|
61
61
|
searchable: { type: Boolean, default: true },
|
|
62
|
-
ariaLabel: { default: "" }
|
|
62
|
+
ariaLabel: { default: "" },
|
|
63
|
+
variant: { default: "field" }
|
|
63
64
|
},
|
|
64
65
|
emits: ["update:modelValue", "change"],
|
|
65
66
|
setup(__props, { emit: __emit }) {
|
|
@@ -86,12 +87,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
86
87
|
if (!el || typeof window === "undefined") return;
|
|
87
88
|
const rect = el.getBoundingClientRect();
|
|
88
89
|
const maxLeft = Math.max(12, window.innerWidth - 280);
|
|
89
|
-
|
|
90
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
91
|
+
const spaceAbove = rect.top;
|
|
92
|
+
const openUp = spaceBelow < 240 && spaceAbove > spaceBelow;
|
|
93
|
+
const shared = {
|
|
90
94
|
position: "fixed",
|
|
91
|
-
top: `${rect.bottom + 6}px`,
|
|
92
95
|
left: `${Math.min(rect.left, maxLeft)}px`,
|
|
93
96
|
minWidth: `${Math.max(rect.width, 220)}px`
|
|
94
97
|
};
|
|
98
|
+
popoverStyle.value = openUp ? { ...shared, bottom: `${window.innerHeight - rect.top + 6}px` } : { ...shared, top: `${rect.bottom + 6}px` };
|
|
95
99
|
}
|
|
96
100
|
function handleOutsidePointer(event) {
|
|
97
101
|
var _a, _b;
|
|
@@ -158,7 +162,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
158
162
|
class: vue.normalizeClass(["yc-chat-select", {
|
|
159
163
|
"is-open": open.value,
|
|
160
164
|
"is-disabled": __props.disabled,
|
|
161
|
-
"has-value": Boolean(selectedOption.value)
|
|
165
|
+
"has-value": Boolean(selectedOption.value),
|
|
166
|
+
"is-chip": __props.variant === "chip"
|
|
162
167
|
}]),
|
|
163
168
|
disabled: __props.disabled,
|
|
164
169
|
"aria-expanded": open.value,
|
|
@@ -31,7 +31,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
31
31
|
__name: "sender",
|
|
32
32
|
props: {
|
|
33
33
|
modelValue: { default: "" },
|
|
34
|
-
placeholder: { default: "\
|
|
34
|
+
placeholder: { default: "\u8F93\u5165\u6D88\u606F\u2026" },
|
|
35
35
|
disabled: { type: Boolean, default: false },
|
|
36
36
|
sending: { type: Boolean, default: false },
|
|
37
37
|
uploading: { type: Boolean, default: false },
|
|
@@ -39,6 +39,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
thinking: { type: Boolean, default: false },
|
|
40
40
|
showThinking: { type: Boolean, default: true },
|
|
41
41
|
thinkingDisabled: { type: Boolean, default: false },
|
|
42
|
+
thinkingLabel: { default: "\u601D\u8003" },
|
|
42
43
|
viewport: { default: "web" },
|
|
43
44
|
enterToSend: { type: Function, default: void 0 }
|
|
44
45
|
},
|
|
@@ -152,8 +153,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
152
153
|
vue.Fragment,
|
|
153
154
|
{ key: 1 },
|
|
154
155
|
[
|
|
155
|
-
__props.showThinking ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
156
|
-
vue.
|
|
156
|
+
__props.showThinking || _ctx.$slots.controls ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
157
|
+
vue.renderSlot(_ctx.$slots, "controls"),
|
|
158
|
+
__props.showThinking ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
159
|
+
key: 0,
|
|
157
160
|
type: "button",
|
|
158
161
|
role: "switch",
|
|
159
162
|
"aria-checked": __props.thinking,
|
|
@@ -161,8 +164,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
161
164
|
class: vue.normalizeClass(["yc-chat-sender__chip", { "is-active": __props.thinking }]),
|
|
162
165
|
disabled: __props.disabled || __props.thinkingDisabled,
|
|
163
166
|
onClick: toggleThinking
|
|
164
|
-
}, [
|
|
165
|
-
vue.createElementVNode(
|
|
167
|
+
}, [
|
|
168
|
+
_cache[6] || (_cache[6] = vue.createElementVNode(
|
|
166
169
|
"svg",
|
|
167
170
|
{
|
|
168
171
|
viewBox: "0 0 16 16",
|
|
@@ -179,15 +182,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
179
182
|
],
|
|
180
183
|
-1
|
|
181
184
|
/* CACHED */
|
|
182
|
-
),
|
|
185
|
+
)),
|
|
183
186
|
vue.createElementVNode(
|
|
184
187
|
"span",
|
|
185
188
|
null,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
/*
|
|
189
|
+
vue.toDisplayString(__props.thinkingLabel),
|
|
190
|
+
1
|
|
191
|
+
/* TEXT */
|
|
189
192
|
)
|
|
190
|
-
]
|
|
193
|
+
], 10, _hoisted_3)) : vue.createCommentVNode("v-if", true)
|
|
191
194
|
])) : vue.createCommentVNode("v-if", true),
|
|
192
195
|
vue.createElementVNode("div", _hoisted_4, [
|
|
193
196
|
vue.createElementVNode("button", {
|
|
@@ -342,8 +345,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
342
345
|
class: vue.normalizeClass(["yc-chat-sender__chip", { "is-active": __props.thinking }]),
|
|
343
346
|
disabled: __props.disabled || __props.thinkingDisabled,
|
|
344
347
|
onClick: toggleThinking
|
|
345
|
-
}, [
|
|
346
|
-
vue.createElementVNode(
|
|
348
|
+
}, [
|
|
349
|
+
_cache[11] || (_cache[11] = vue.createElementVNode(
|
|
347
350
|
"svg",
|
|
348
351
|
{
|
|
349
352
|
viewBox: "0 0 16 16",
|
|
@@ -360,15 +363,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
360
363
|
],
|
|
361
364
|
-1
|
|
362
365
|
/* CACHED */
|
|
363
|
-
),
|
|
366
|
+
)),
|
|
364
367
|
vue.createElementVNode(
|
|
365
368
|
"span",
|
|
366
369
|
null,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/*
|
|
370
|
+
vue.toDisplayString(__props.thinkingLabel),
|
|
371
|
+
1
|
|
372
|
+
/* TEXT */
|
|
370
373
|
)
|
|
371
|
-
]
|
|
374
|
+
], 10, _hoisted_12)) : vue.createCommentVNode("v-if", true),
|
|
372
375
|
vue.renderSlot(_ctx.$slots, "controls")
|
|
373
376
|
]),
|
|
374
377
|
vue.createElementVNode("div", _hoisted_13, [
|
|
@@ -12,29 +12,35 @@ const _hoisted_1 = {
|
|
|
12
12
|
};
|
|
13
13
|
const _hoisted_2 = { class: "yc-chat-sidebar__header rail-header" };
|
|
14
14
|
const _hoisted_3 = ["disabled"];
|
|
15
|
-
const _hoisted_4 = {
|
|
15
|
+
const _hoisted_4 = { class: "yc-chat-sidebar__create-icon" };
|
|
16
|
+
const _hoisted_5 = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "yc-chat-sidebar__search"
|
|
18
19
|
};
|
|
19
|
-
const
|
|
20
|
-
const
|
|
20
|
+
const _hoisted_6 = ["placeholder"];
|
|
21
|
+
const _hoisted_7 = { class: "yc-chat-sidebar__body conversation-list" };
|
|
22
|
+
const _hoisted_8 = {
|
|
21
23
|
key: 0,
|
|
22
24
|
class: "yc-chat-sidebar__empty empty-hint"
|
|
23
25
|
};
|
|
24
|
-
const
|
|
26
|
+
const _hoisted_9 = {
|
|
25
27
|
key: 1,
|
|
26
28
|
class: "yc-chat-sidebar__empty empty-hint"
|
|
27
29
|
};
|
|
28
|
-
const
|
|
30
|
+
const _hoisted_10 = {
|
|
29
31
|
key: 2,
|
|
30
32
|
class: "yc-chat-sidebar__empty empty-hint"
|
|
31
33
|
};
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
34
|
+
const _hoisted_11 = {
|
|
35
|
+
key: 3,
|
|
36
|
+
class: "yc-chat-sidebar__empty empty-hint"
|
|
37
|
+
};
|
|
38
|
+
const _hoisted_12 = { class: "yc-chat-sidebar__item-main" };
|
|
39
|
+
const _hoisted_13 = { class: "yc-chat-sidebar__item-title conversation-title" };
|
|
40
|
+
const _hoisted_14 = { class: "yc-chat-sidebar__item-time conversation-time" };
|
|
41
|
+
const _hoisted_15 = ["onClick"];
|
|
42
|
+
const _hoisted_16 = { class: "yc-chat-sidebar__more" };
|
|
43
|
+
const _hoisted_17 = ["disabled"];
|
|
38
44
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
39
45
|
...{
|
|
40
46
|
name: "YcChatSidebar"
|
|
@@ -46,8 +52,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
46
52
|
connected: { type: Boolean, default: false },
|
|
47
53
|
loading: { type: Boolean, default: false },
|
|
48
54
|
hasMore: { type: Boolean, default: false },
|
|
49
|
-
title: { default: "
|
|
50
|
-
createText: { default: "\
|
|
55
|
+
title: { default: "" },
|
|
56
|
+
createText: { default: "\u65B0\u5BF9\u8BDD" },
|
|
57
|
+
disconnectedText: { default: "" },
|
|
58
|
+
emptyText: { default: "\u6682\u65E0\u4F1A\u8BDD" },
|
|
59
|
+
noResultText: { default: "\u6CA1\u6709\u5339\u914D\u7ED3\u679C" },
|
|
60
|
+
searchPlaceholder: { default: "\u641C\u7D22" },
|
|
61
|
+
untitledText: { default: "\u65B0\u4F1A\u8BDD" }
|
|
51
62
|
},
|
|
52
63
|
emits: ["select", "create", "delete", "load-more"],
|
|
53
64
|
setup(__props, { emit: __emit }) {
|
|
@@ -58,14 +69,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
58
69
|
const query = keyword.value.trim().toLowerCase();
|
|
59
70
|
if (!query) return props.sessions;
|
|
60
71
|
return props.sessions.filter(
|
|
61
|
-
(item) => (item.title ||
|
|
72
|
+
(item) => (item.title || props.untitledText).toLowerCase().includes(query)
|
|
62
73
|
);
|
|
63
74
|
});
|
|
64
75
|
const conversationItems = vue.computed(
|
|
65
76
|
() => filteredSessions.value.map((item) => ({
|
|
66
77
|
id: item.id,
|
|
67
78
|
key: item.id,
|
|
68
|
-
label: item.title ||
|
|
79
|
+
label: item.title || props.untitledText,
|
|
69
80
|
group: presets.groupChatSessionByDate(item.updatedAt),
|
|
70
81
|
disabled: item.disabled,
|
|
71
82
|
timeText: presets.formatChatSessionTime(item.updatedAt)
|
|
@@ -87,24 +98,28 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
87
98
|
disabled: !__props.connected,
|
|
88
99
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("create"))
|
|
89
100
|
}, [
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
vue.createElementVNode("span", _hoisted_4, [
|
|
102
|
+
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
103
|
+
_cache[4] || (_cache[4] = vue.createElementVNode(
|
|
104
|
+
"svg",
|
|
105
|
+
{
|
|
106
|
+
viewBox: "0 0 16 16",
|
|
107
|
+
fill: "none",
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
},
|
|
110
|
+
[
|
|
111
|
+
vue.createElementVNode("path", {
|
|
112
|
+
d: "M8 3.25V12.75M3.25 8H12.75",
|
|
113
|
+
stroke: "currentColor",
|
|
114
|
+
"stroke-width": "1.6",
|
|
115
|
+
"stroke-linecap": "round"
|
|
116
|
+
})
|
|
117
|
+
],
|
|
118
|
+
-1
|
|
119
|
+
/* CACHED */
|
|
120
|
+
))
|
|
121
|
+
])
|
|
122
|
+
]),
|
|
108
123
|
vue.createElementVNode(
|
|
109
124
|
"span",
|
|
110
125
|
null,
|
|
@@ -113,7 +128,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
113
128
|
/* TEXT */
|
|
114
129
|
)
|
|
115
130
|
], 8, _hoisted_3),
|
|
116
|
-
__props.connected && __props.sessions.length > 3 ? (vue.openBlock(), vue.createElementBlock("div",
|
|
131
|
+
__props.connected && __props.sessions.length > 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
117
132
|
_cache[5] || (_cache[5] = vue.createElementVNode(
|
|
118
133
|
"svg",
|
|
119
134
|
{
|
|
@@ -139,25 +154,43 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
139
154
|
-1
|
|
140
155
|
/* CACHED */
|
|
141
156
|
)),
|
|
142
|
-
vue.withDirectives(vue.createElementVNode(
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
class: "yc-chat-sidebar__search-input"
|
|
149
|
-
},
|
|
150
|
-
null,
|
|
151
|
-
512
|
|
152
|
-
/* NEED_PATCH */
|
|
153
|
-
), [
|
|
157
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
158
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => keyword.value = $event),
|
|
159
|
+
type: "text",
|
|
160
|
+
placeholder: __props.searchPlaceholder,
|
|
161
|
+
class: "yc-chat-sidebar__search-input"
|
|
162
|
+
}, null, 8, _hoisted_6), [
|
|
154
163
|
[vue.vModelText, keyword.value]
|
|
155
164
|
])
|
|
156
165
|
])) : vue.createCommentVNode("v-if", true)
|
|
157
166
|
]),
|
|
158
|
-
vue.createElementVNode("div",
|
|
159
|
-
!__props.connected
|
|
160
|
-
|
|
167
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
168
|
+
!__props.connected && __props.disconnectedText ? (vue.openBlock(), vue.createElementBlock(
|
|
169
|
+
"div",
|
|
170
|
+
_hoisted_8,
|
|
171
|
+
vue.toDisplayString(__props.disconnectedText),
|
|
172
|
+
1
|
|
173
|
+
/* TEXT */
|
|
174
|
+
)) : !__props.connected ? (vue.openBlock(), vue.createElementBlock(
|
|
175
|
+
"div",
|
|
176
|
+
_hoisted_9,
|
|
177
|
+
vue.toDisplayString(__props.emptyText),
|
|
178
|
+
1
|
|
179
|
+
/* TEXT */
|
|
180
|
+
)) : !__props.sessions.length && !__props.loading ? (vue.openBlock(), vue.createElementBlock(
|
|
181
|
+
"div",
|
|
182
|
+
_hoisted_10,
|
|
183
|
+
vue.toDisplayString(__props.emptyText),
|
|
184
|
+
1
|
|
185
|
+
/* TEXT */
|
|
186
|
+
)) : !conversationItems.value.length && keyword.value ? (vue.openBlock(), vue.createElementBlock(
|
|
187
|
+
"div",
|
|
188
|
+
_hoisted_11,
|
|
189
|
+
vue.toDisplayString(__props.noResultText),
|
|
190
|
+
1
|
|
191
|
+
/* TEXT */
|
|
192
|
+
)) : (vue.openBlock(), vue.createBlock(vue.unref(vueElementPlusX.Conversations), {
|
|
193
|
+
key: 4,
|
|
161
194
|
items: conversationItems.value,
|
|
162
195
|
active: __props.activeId,
|
|
163
196
|
"row-key": "id",
|
|
@@ -174,17 +207,17 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
174
207
|
class: vue.normalizeClass(["yc-chat-sidebar__item", { active: item.id === __props.activeId }])
|
|
175
208
|
},
|
|
176
209
|
[
|
|
177
|
-
vue.createElementVNode("div",
|
|
210
|
+
vue.createElementVNode("div", _hoisted_12, [
|
|
178
211
|
vue.createElementVNode(
|
|
179
212
|
"div",
|
|
180
|
-
|
|
213
|
+
_hoisted_13,
|
|
181
214
|
vue.toDisplayString(item.label),
|
|
182
215
|
1
|
|
183
216
|
/* TEXT */
|
|
184
217
|
),
|
|
185
218
|
vue.createElementVNode(
|
|
186
219
|
"div",
|
|
187
|
-
|
|
220
|
+
_hoisted_14,
|
|
188
221
|
vue.toDisplayString(item.timeText),
|
|
189
222
|
1
|
|
190
223
|
/* TEXT */
|
|
@@ -221,7 +254,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
221
254
|
-1
|
|
222
255
|
/* CACHED */
|
|
223
256
|
)
|
|
224
|
-
])], 8,
|
|
257
|
+
])], 8, _hoisted_15)
|
|
225
258
|
])
|
|
226
259
|
],
|
|
227
260
|
2
|
|
@@ -234,13 +267,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
234
267
|
__props.hasMore ? {
|
|
235
268
|
name: "load-more",
|
|
236
269
|
fn: vue.withCtx(() => [
|
|
237
|
-
vue.createElementVNode("div",
|
|
270
|
+
vue.createElementVNode("div", _hoisted_16, [
|
|
238
271
|
vue.createElementVNode("button", {
|
|
239
272
|
type: "button",
|
|
240
273
|
class: "yc-chat-sidebar__more-btn",
|
|
241
274
|
disabled: __props.loading,
|
|
242
275
|
onClick: _cache[3] || (_cache[3] = ($event) => emit("load-more"))
|
|
243
|
-
}, vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u591A
|
|
276
|
+
}, vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u591A"), 9, _hoisted_17)
|
|
244
277
|
])
|
|
245
278
|
]),
|
|
246
279
|
key: "0"
|