yc-agent-ui 1.2.2 → 1.2.3

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.
Files changed (45) hide show
  1. package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +19 -1
  2. package/es/components/yc-ai-chat/src/studio.vue.d.ts +6 -0
  3. package/es/components/yc-ai-chat/src/type.d.ts +2 -0
  4. package/es/index.css +8 -8
  5. package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +709 -129
  6. package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +194 -42
  7. package/es/version.d.ts +1 -1
  8. package/es/version.mjs +1 -1
  9. package/index.css +1 -1
  10. package/index.js +1655 -922
  11. package/index.min.js +22 -22
  12. package/index.min.mjs +24 -24
  13. package/index.mjs +1645 -912
  14. package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +19 -1
  15. package/lib/components/yc-ai-chat/src/studio.vue.d.ts +6 -0
  16. package/lib/components/yc-ai-chat/src/type.d.ts +2 -0
  17. package/lib/index.css +10 -10
  18. package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +708 -128
  19. package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +193 -41
  20. package/lib/version.d.ts +1 -1
  21. package/lib/version.js +1 -1
  22. package/locale/en.js +1 -1
  23. package/locale/en.min.js +1 -1
  24. package/locale/en.min.mjs +1 -1
  25. package/locale/en.mjs +1 -1
  26. package/locale/ja.js +1 -1
  27. package/locale/ja.min.js +1 -1
  28. package/locale/ja.min.mjs +1 -1
  29. package/locale/ja.mjs +1 -1
  30. package/locale/ko.js +1 -1
  31. package/locale/ko.min.js +1 -1
  32. package/locale/ko.min.mjs +1 -1
  33. package/locale/ko.mjs +1 -1
  34. package/locale/zh-cn.js +1 -1
  35. package/locale/zh-cn.min.js +1 -1
  36. package/locale/zh-cn.min.mjs +1 -1
  37. package/locale/zh-cn.mjs +1 -1
  38. package/locale/zh-tw.js +1 -1
  39. package/locale/zh-tw.min.js +1 -1
  40. package/locale/zh-tw.min.mjs +1 -1
  41. package/locale/zh-tw.mjs +1 -1
  42. package/package.json +1 -1
  43. package/theme-chalk/index.css +1 -1
  44. package/theme-chalk/plus-yc-ai-chat.css +1 -1
  45. package/theme-chalk/src/yc-ai-chat.scss +478 -75
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var vueElementPlusX = require('vue-element-plus-x');
7
6
  var presets = require('./presets.js');
8
7
 
9
8
  const _hoisted_1 = {
@@ -13,12 +12,12 @@ const _hoisted_1 = {
13
12
  const _hoisted_2 = { class: "yc-chat-sidebar__header rail-header" };
14
13
  const _hoisted_3 = ["disabled"];
15
14
  const _hoisted_4 = { class: "yc-chat-sidebar__create-icon" };
16
- const _hoisted_5 = {
15
+ const _hoisted_5 = { class: "yc-chat-sidebar__create-label" };
16
+ const _hoisted_6 = {
17
17
  key: 0,
18
18
  class: "yc-chat-sidebar__search"
19
19
  };
20
- const _hoisted_6 = ["placeholder"];
21
- const _hoisted_7 = { class: "yc-chat-sidebar__body conversation-list" };
20
+ const _hoisted_7 = ["placeholder"];
22
21
  const _hoisted_8 = {
23
22
  key: 0,
24
23
  class: "yc-chat-sidebar__empty empty-hint"
@@ -35,12 +34,57 @@ const _hoisted_11 = {
35
34
  key: 3,
36
35
  class: "yc-chat-sidebar__empty empty-hint"
37
36
  };
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"];
37
+ const _hoisted_12 = {
38
+ key: 4,
39
+ class: "yc-chat-sidebar__groups"
40
+ };
41
+ const _hoisted_13 = {
42
+ key: 0,
43
+ class: "yc-chat-sidebar__archived-only-hint"
44
+ };
45
+ const _hoisted_14 = { class: "yc-chat-sidebar__group-label" };
46
+ const _hoisted_15 = { class: "yc-chat-sidebar__group-items" };
47
+ const _hoisted_16 = ["data-session-id", "title", "onClick"];
48
+ const _hoisted_17 = { class: "yc-chat-sidebar__item-title conversation-title" };
49
+ const _hoisted_18 = ["data-menu-trigger", "aria-expanded", "onClick"];
50
+ const _hoisted_19 = {
51
+ key: 1,
52
+ class: "yc-chat-sidebar__group yc-chat-sidebar__group--archived",
53
+ "data-testid": "archived-sessions-section"
54
+ };
55
+ const _hoisted_20 = ["aria-expanded"];
56
+ const _hoisted_21 = { class: "yc-chat-sidebar__archive-toggle-left" };
57
+ const _hoisted_22 = { class: "yc-chat-sidebar__archive-count" };
58
+ const _hoisted_23 = {
59
+ key: 0,
60
+ class: "yc-chat-sidebar__group-items"
61
+ };
62
+ const _hoisted_24 = ["data-session-id", "title", "onClick"];
63
+ const _hoisted_25 = { class: "yc-chat-sidebar__item-title conversation-title" };
64
+ const _hoisted_26 = ["data-menu-trigger", "aria-expanded", "onClick"];
65
+ const _hoisted_27 = {
66
+ key: 2,
67
+ class: "yc-chat-sidebar__more"
68
+ };
69
+ const _hoisted_28 = ["disabled"];
70
+ const _hoisted_29 = {
71
+ key: 0,
72
+ viewBox: "0 0 16 16",
73
+ fill: "none",
74
+ "aria-hidden": "true"
75
+ };
76
+ const _hoisted_30 = {
77
+ key: 1,
78
+ viewBox: "0 0 16 16",
79
+ fill: "none",
80
+ "aria-hidden": "true"
81
+ };
82
+ const _hoisted_31 = {
83
+ key: 2,
84
+ class: "yc-chat-sidebar__menu-divider",
85
+ role: "separator"
86
+ };
87
+ const _hoisted_32 = ["disabled"];
44
88
  var _sfc_main = /* @__PURE__ */ vue.defineComponent({
45
89
  ...{
46
90
  name: "YcChatSidebar"
@@ -58,36 +102,162 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
58
102
  emptyText: { default: "\u6682\u65E0\u4F1A\u8BDD" },
59
103
  noResultText: { default: "\u6CA1\u6709\u5339\u914D\u7ED3\u679C" },
60
104
  searchPlaceholder: { default: "\u641C\u7D22" },
61
- untitledText: { default: "\u65B0\u4F1A\u8BDD" }
105
+ untitledText: { default: "\u65B0\u4F1A\u8BDD" },
106
+ archivedGroupTitle: { default: "\u5DF2\u5F52\u6863" },
107
+ showShare: { type: Boolean, default: true },
108
+ showArchive: { type: Boolean, default: true },
109
+ showDelete: { type: Boolean, default: true }
62
110
  },
63
- emits: ["select", "create", "delete", "load-more"],
111
+ emits: ["select", "create", "share", "archive", "unarchive", "delete", "action", "load-more"],
64
112
  setup(__props, { emit: __emit }) {
65
113
  const props = __props;
66
114
  const emit = __emit;
67
115
  const keyword = vue.ref("");
68
- const filteredSessions = vue.computed(() => {
69
- const query = keyword.value.trim().toLowerCase();
70
- if (!query) return props.sessions;
71
- return props.sessions.filter(
72
- (item) => (item.title || props.untitledText).toLowerCase().includes(query)
73
- );
74
- });
75
- const conversationItems = vue.computed(
76
- () => filteredSessions.value.map((item) => ({
116
+ const archivedExpanded = vue.ref(false);
117
+ const openMenuId = vue.ref("");
118
+ const menuRef = vue.ref(null);
119
+ const menuPosition = vue.ref({ top: 0, left: 0 });
120
+ const normalizedSessions = vue.computed(
121
+ () => props.sessions.map((item) => ({
77
122
  id: item.id,
78
- key: item.id,
79
123
  label: item.title || props.untitledText,
80
124
  group: presets.groupChatSessionByDate(item.updatedAt),
81
- disabled: item.disabled,
82
- timeText: presets.formatChatSessionTime(item.updatedAt)
125
+ disabled: Boolean(item.disabled),
126
+ archived: Boolean(item.archived),
127
+ timeText: item.updatedAt ? presets.formatChatSessionTime(item.updatedAt) : ""
83
128
  }))
84
129
  );
85
- function handleChange(item) {
130
+ const filteredSessions = vue.computed(() => {
131
+ const query = keyword.value.trim().toLowerCase();
132
+ if (!query) return normalizedSessions.value;
133
+ return normalizedSessions.value.filter(
134
+ (item) => item.label.toLowerCase().includes(query)
135
+ );
136
+ });
137
+ const activeSessions = vue.computed(
138
+ () => filteredSessions.value.filter((item) => !item.archived)
139
+ );
140
+ const archivedSessions = vue.computed(
141
+ () => filteredSessions.value.filter((item) => item.archived)
142
+ );
143
+ const activeGroups = vue.computed(() => {
144
+ const groups = /* @__PURE__ */ new Map();
145
+ for (const item of activeSessions.value) {
146
+ const bucket = groups.get(item.group);
147
+ if (bucket) {
148
+ bucket.push(item);
149
+ } else {
150
+ groups.set(item.group, [item]);
151
+ }
152
+ }
153
+ return Array.from(groups.entries()).map(([name, items]) => ({ name, items }));
154
+ });
155
+ const showArchivedList = vue.computed(
156
+ () => archivedExpanded.value || Boolean(keyword.value.trim()) || archivedSessions.value.some((item) => item.id === props.activeId)
157
+ );
158
+ const hasMenuActions = vue.computed(
159
+ () => props.showShare || props.showArchive || props.showDelete
160
+ );
161
+ const activeMenuSession = vue.computed(
162
+ () => {
163
+ var _a;
164
+ return (_a = normalizedSessions.value.find((item) => item.id === openMenuId.value)) != null ? _a : null;
165
+ }
166
+ );
167
+ const menuPositionStyle = vue.computed(() => ({
168
+ top: `${menuPosition.value.top}px`,
169
+ left: `${menuPosition.value.left}px`
170
+ }));
171
+ function closeMenu() {
172
+ if (!openMenuId.value) return;
173
+ openMenuId.value = "";
174
+ }
175
+ function positionMenuNearTrigger(triggerEl) {
86
176
  var _a, _b;
87
- const nextId = String((_b = (_a = item == null ? void 0 : item.id) != null ? _a : item == null ? void 0 : item.key) != null ? _b : "");
177
+ const rect = triggerEl.getBoundingClientRect();
178
+ const menuWidth = ((_a = menuRef.value) == null ? void 0 : _a.offsetWidth) || 160;
179
+ const menuHeight = ((_b = menuRef.value) == null ? void 0 : _b.offsetHeight) || 148;
180
+ const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1280;
181
+ const viewportHeight = typeof window !== "undefined" ? window.innerHeight : 800;
182
+ let left = rect.right - menuWidth;
183
+ if (left + menuWidth > viewportWidth - 8) {
184
+ left = viewportWidth - menuWidth - 8;
185
+ }
186
+ if (left < 8) {
187
+ left = Math.min(rect.left, Math.max(8, viewportWidth - menuWidth - 8));
188
+ }
189
+ let top = rect.bottom + 4;
190
+ if (top + menuHeight > viewportHeight - 8 && rect.top - menuHeight - 4 >= 8) {
191
+ top = rect.top - menuHeight - 4;
192
+ }
193
+ menuPosition.value = { top: Math.round(top), left: Math.round(left) };
194
+ }
195
+ async function toggleMenu(item, event) {
196
+ if (!hasMenuActions.value) return;
197
+ if (openMenuId.value === item.id) {
198
+ closeMenu();
199
+ return;
200
+ }
201
+ const triggerEl = event.currentTarget;
202
+ openMenuId.value = item.id;
203
+ if (triggerEl) {
204
+ positionMenuNearTrigger(triggerEl);
205
+ await vue.nextTick();
206
+ if (openMenuId.value === item.id) {
207
+ positionMenuNearTrigger(triggerEl);
208
+ }
209
+ }
210
+ }
211
+ function handleGlobalPointerDown(event) {
212
+ var _a;
213
+ if (!openMenuId.value) return;
214
+ const target = event.target;
215
+ if (target && ((_a = menuRef.value) == null ? void 0 : _a.contains(target))) return;
216
+ if (target instanceof Element && target.closest(`[data-menu-trigger="${openMenuId.value}"]`)) {
217
+ return;
218
+ }
219
+ closeMenu();
220
+ }
221
+ function handleGlobalKeydown(event) {
222
+ if (event.key === "Escape" && openMenuId.value) {
223
+ closeMenu();
224
+ }
225
+ }
226
+ vue.watch(openMenuId, (nextId) => {
227
+ if (typeof window === "undefined") return;
88
228
  if (nextId) {
89
- emit("select", nextId);
229
+ window.addEventListener("mousedown", handleGlobalPointerDown, true);
230
+ window.addEventListener("keydown", handleGlobalKeydown);
231
+ window.addEventListener("resize", closeMenu);
232
+ } else {
233
+ window.removeEventListener("mousedown", handleGlobalPointerDown, true);
234
+ window.removeEventListener("keydown", handleGlobalKeydown);
235
+ window.removeEventListener("resize", closeMenu);
90
236
  }
237
+ });
238
+ vue.onBeforeUnmount(() => {
239
+ if (typeof window === "undefined") return;
240
+ window.removeEventListener("mousedown", handleGlobalPointerDown, true);
241
+ window.removeEventListener("keydown", handleGlobalKeydown);
242
+ window.removeEventListener("resize", closeMenu);
243
+ });
244
+ function handleSelect(item) {
245
+ if (item.disabled) return;
246
+ closeMenu();
247
+ emit("select", item.id);
248
+ }
249
+ function triggerAction(action, item) {
250
+ if (!item) return;
251
+ if (action === "delete" && item.disabled) return;
252
+ closeMenu();
253
+ if (action === "share") emit("share", item.id);
254
+ else if (action === "archive") emit("archive", item.id);
255
+ else if (action === "unarchive") emit("unarchive", item.id);
256
+ else if (action === "delete") emit("delete", item.id);
257
+ emit("action", { action, id: item.id });
258
+ }
259
+ function itemTooltip(item) {
260
+ return item.timeText ? `${item.label} \xB7 ${item.timeText}` : item.label;
91
261
  }
92
262
  return (_ctx, _cache) => {
93
263
  return vue.openBlock(), vue.createElementBlock("aside", _hoisted_1, [
@@ -100,7 +270,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
100
270
  }, [
101
271
  vue.createElementVNode("span", _hoisted_4, [
102
272
  vue.renderSlot(_ctx.$slots, "icon", {}, () => [
103
- _cache[4] || (_cache[4] = vue.createElementVNode(
273
+ _cache[11] || (_cache[11] = vue.createElementVNode(
104
274
  "svg",
105
275
  {
106
276
  viewBox: "0 0 16 16",
@@ -122,14 +292,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
122
292
  ]),
123
293
  vue.createElementVNode(
124
294
  "span",
125
- null,
295
+ _hoisted_5,
126
296
  vue.toDisplayString(__props.createText),
127
297
  1
128
298
  /* TEXT */
129
299
  )
130
300
  ], 8, _hoisted_3),
131
- __props.connected && __props.sessions.length > 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
132
- _cache[5] || (_cache[5] = vue.createElementVNode(
301
+ __props.connected && (__props.sessions.length > 2 || keyword.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
302
+ _cache[13] || (_cache[13] = vue.createElementVNode(
133
303
  "svg",
134
304
  {
135
305
  viewBox: "0 0 16 16",
@@ -159,127 +329,537 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
159
329
  type: "text",
160
330
  placeholder: __props.searchPlaceholder,
161
331
  class: "yc-chat-sidebar__search-input"
162
- }, null, 8, _hoisted_6), [
332
+ }, null, 8, _hoisted_7), [
163
333
  [vue.vModelText, keyword.value]
164
- ])
165
- ])) : vue.createCommentVNode("v-if", true)
166
- ]),
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,
194
- items: conversationItems.value,
195
- active: __props.activeId,
196
- "row-key": "id",
197
- "label-key": "label",
198
- groupable: true,
199
- "show-built-in-menu": false,
200
- style: { width: "100%", backgroundColor: "transparent", padding: "4px 8px" },
201
- onChange: handleChange
202
- }, vue.createSlots({
203
- label: vue.withCtx(({ item }) => [
334
+ ]),
335
+ keyword.value ? (vue.openBlock(), vue.createElementBlock("button", {
336
+ key: 0,
337
+ type: "button",
338
+ class: "yc-chat-sidebar__search-clear",
339
+ "aria-label": "\u6E05\u7A7A\u641C\u7D22",
340
+ onClick: _cache[2] || (_cache[2] = ($event) => keyword.value = "")
341
+ }, [..._cache[12] || (_cache[12] = [
204
342
  vue.createElementVNode(
205
- "div",
343
+ "svg",
206
344
  {
207
- class: vue.normalizeClass(["yc-chat-sidebar__item", { active: item.id === __props.activeId }])
345
+ viewBox: "0 0 14 14",
346
+ fill: "none",
347
+ "aria-hidden": "true"
208
348
  },
209
349
  [
210
- vue.createElementVNode("div", _hoisted_12, [
350
+ vue.createElementVNode("path", {
351
+ d: "M3.75 3.75L10.25 10.25M10.25 3.75L3.75 10.25",
352
+ stroke: "currentColor",
353
+ "stroke-width": "1.4",
354
+ "stroke-linecap": "round"
355
+ })
356
+ ],
357
+ -1
358
+ /* CACHED */
359
+ )
360
+ ])])) : vue.createCommentVNode("v-if", true)
361
+ ])) : vue.createCommentVNode("v-if", true)
362
+ ]),
363
+ vue.createElementVNode(
364
+ "div",
365
+ {
366
+ class: "yc-chat-sidebar__body conversation-list",
367
+ onScrollPassive: closeMenu
368
+ },
369
+ [
370
+ !__props.connected && __props.disconnectedText ? (vue.openBlock(), vue.createElementBlock(
371
+ "div",
372
+ _hoisted_8,
373
+ vue.toDisplayString(__props.disconnectedText),
374
+ 1
375
+ /* TEXT */
376
+ )) : !__props.connected ? (vue.openBlock(), vue.createElementBlock(
377
+ "div",
378
+ _hoisted_9,
379
+ vue.toDisplayString(__props.emptyText),
380
+ 1
381
+ /* TEXT */
382
+ )) : !__props.sessions.length && !__props.loading ? (vue.openBlock(), vue.createElementBlock(
383
+ "div",
384
+ _hoisted_10,
385
+ vue.toDisplayString(__props.emptyText),
386
+ 1
387
+ /* TEXT */
388
+ )) : !filteredSessions.value.length && keyword.value ? (vue.openBlock(), vue.createElementBlock(
389
+ "div",
390
+ _hoisted_11,
391
+ vue.toDisplayString(__props.noResultText),
392
+ 1
393
+ /* TEXT */
394
+ )) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
395
+ !activeGroups.value.length && archivedSessions.value.length && !keyword.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, " \u8FD1\u671F\u4F1A\u8BDD\u5DF2\u5168\u90E8\u5F52\u6863 ")) : vue.createCommentVNode("v-if", true),
396
+ (vue.openBlock(true), vue.createElementBlock(
397
+ vue.Fragment,
398
+ null,
399
+ vue.renderList(activeGroups.value, (group) => {
400
+ return vue.openBlock(), vue.createElementBlock("section", {
401
+ key: group.name,
402
+ class: "yc-chat-sidebar__group"
403
+ }, [
211
404
  vue.createElementVNode(
212
405
  "div",
213
- _hoisted_13,
214
- vue.toDisplayString(item.label),
406
+ _hoisted_14,
407
+ vue.toDisplayString(group.name),
215
408
  1
216
409
  /* TEXT */
217
410
  ),
411
+ vue.createElementVNode("div", _hoisted_15, [
412
+ (vue.openBlock(true), vue.createElementBlock(
413
+ vue.Fragment,
414
+ null,
415
+ vue.renderList(group.items, (item) => {
416
+ return vue.openBlock(), vue.createElementBlock("div", {
417
+ key: item.id,
418
+ class: vue.normalizeClass(["yc-chat-sidebar__row el-conversations-item", {
419
+ active: item.id === __props.activeId,
420
+ "is-active": item.id === __props.activeId,
421
+ "is-menu-open": openMenuId.value === item.id,
422
+ "is-disabled": item.disabled
423
+ }]),
424
+ "data-session-id": item.id,
425
+ title: itemTooltip(item),
426
+ onClick: ($event) => handleSelect(item)
427
+ }, [
428
+ vue.createElementVNode(
429
+ "span",
430
+ _hoisted_17,
431
+ vue.toDisplayString(item.label),
432
+ 1
433
+ /* TEXT */
434
+ ),
435
+ hasMenuActions.value ? (vue.openBlock(), vue.createElementBlock("div", {
436
+ key: 0,
437
+ class: "yc-chat-sidebar__item-actions",
438
+ onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
439
+ }, ["stop"]))
440
+ }, [
441
+ vue.createElementVNode("button", {
442
+ type: "button",
443
+ class: vue.normalizeClass(["yc-chat-sidebar__more-trigger", { "is-open": openMenuId.value === item.id }]),
444
+ "data-menu-trigger": item.id,
445
+ "data-testid": "session-more-btn",
446
+ "aria-label": "\u66F4\u591A\u4F1A\u8BDD\u64CD\u4F5C",
447
+ "aria-haspopup": "menu",
448
+ "aria-expanded": openMenuId.value === item.id,
449
+ title: "\u66F4\u591A\u64CD\u4F5C",
450
+ onClick: vue.withModifiers(($event) => toggleMenu(item, $event), ["stop"])
451
+ }, [..._cache[14] || (_cache[14] = [
452
+ vue.createElementVNode(
453
+ "svg",
454
+ {
455
+ viewBox: "0 0 16 16",
456
+ fill: "none",
457
+ "aria-hidden": "true"
458
+ },
459
+ [
460
+ vue.createElementVNode("circle", {
461
+ cx: "3.25",
462
+ cy: "8",
463
+ r: "1.25",
464
+ fill: "currentColor"
465
+ }),
466
+ vue.createElementVNode("circle", {
467
+ cx: "8",
468
+ cy: "8",
469
+ r: "1.25",
470
+ fill: "currentColor"
471
+ }),
472
+ vue.createElementVNode("circle", {
473
+ cx: "12.75",
474
+ cy: "8",
475
+ r: "1.25",
476
+ fill: "currentColor"
477
+ })
478
+ ],
479
+ -1
480
+ /* CACHED */
481
+ )
482
+ ])], 10, _hoisted_18)
483
+ ])) : vue.createCommentVNode("v-if", true)
484
+ ], 10, _hoisted_16);
485
+ }),
486
+ 128
487
+ /* KEYED_FRAGMENT */
488
+ ))
489
+ ])
490
+ ]);
491
+ }),
492
+ 128
493
+ /* KEYED_FRAGMENT */
494
+ )),
495
+ archivedSessions.value.length ? (vue.openBlock(), vue.createElementBlock("section", _hoisted_19, [
496
+ vue.createElementVNode("button", {
497
+ type: "button",
498
+ class: "yc-chat-sidebar__archive-toggle",
499
+ "data-testid": "archived-sessions-toggle",
500
+ "aria-expanded": showArchivedList.value,
501
+ onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => archivedExpanded.value = !archivedExpanded.value, ["stop"]))
502
+ }, [
503
+ vue.createElementVNode("span", _hoisted_21, [
504
+ _cache[15] || (_cache[15] = vue.createElementVNode(
505
+ "svg",
506
+ {
507
+ viewBox: "0 0 16 16",
508
+ fill: "none",
509
+ "aria-hidden": "true"
510
+ },
511
+ [
512
+ vue.createElementVNode("rect", {
513
+ x: "2",
514
+ y: "2.75",
515
+ width: "12",
516
+ height: "3.25",
517
+ rx: "1",
518
+ stroke: "currentColor",
519
+ "stroke-width": "1.3"
520
+ }),
521
+ vue.createElementVNode("path", {
522
+ d: "M3.25 6V12.25C3.25 12.8 3.7 13.25 4.25 13.25H11.75C12.3 13.25 12.75 12.8 12.75 12.25V6M6.5 8.75H9.5",
523
+ stroke: "currentColor",
524
+ "stroke-width": "1.3",
525
+ "stroke-linecap": "round"
526
+ })
527
+ ],
528
+ -1
529
+ /* CACHED */
530
+ )),
218
531
  vue.createElementVNode(
219
- "div",
220
- _hoisted_14,
221
- vue.toDisplayString(item.timeText),
532
+ "span",
533
+ null,
534
+ vue.toDisplayString(__props.archivedGroupTitle),
535
+ 1
536
+ /* TEXT */
537
+ ),
538
+ vue.createElementVNode(
539
+ "span",
540
+ _hoisted_22,
541
+ vue.toDisplayString(archivedSessions.value.length),
222
542
  1
223
543
  /* TEXT */
224
544
  )
225
545
  ]),
226
- vue.createElementVNode("div", {
227
- class: "yc-chat-sidebar__item-actions",
228
- onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => {
229
- }, ["stop"]))
546
+ (vue.openBlock(), vue.createElementBlock(
547
+ "svg",
548
+ {
549
+ class: vue.normalizeClass(["yc-chat-sidebar__archive-chevron", { "is-expanded": showArchivedList.value }]),
550
+ viewBox: "0 0 16 16",
551
+ fill: "none",
552
+ "aria-hidden": "true"
553
+ },
554
+ [..._cache[16] || (_cache[16] = [
555
+ vue.createElementVNode(
556
+ "path",
557
+ {
558
+ d: "M5.5 6.5L8 9L10.5 6.5",
559
+ stroke: "currentColor",
560
+ "stroke-width": "1.4",
561
+ "stroke-linecap": "round",
562
+ "stroke-linejoin": "round"
563
+ },
564
+ null,
565
+ -1
566
+ /* CACHED */
567
+ )
568
+ ])],
569
+ 2
570
+ /* CLASS */
571
+ ))
572
+ ], 8, _hoisted_20),
573
+ showArchivedList.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
574
+ (vue.openBlock(true), vue.createElementBlock(
575
+ vue.Fragment,
576
+ null,
577
+ vue.renderList(archivedSessions.value, (item) => {
578
+ return vue.openBlock(), vue.createElementBlock("div", {
579
+ key: item.id,
580
+ class: vue.normalizeClass(["yc-chat-sidebar__row yc-chat-sidebar__row--archived el-conversations-item", {
581
+ active: item.id === __props.activeId,
582
+ "is-active": item.id === __props.activeId,
583
+ "is-menu-open": openMenuId.value === item.id,
584
+ "is-disabled": item.disabled
585
+ }]),
586
+ "data-session-id": item.id,
587
+ title: itemTooltip(item),
588
+ onClick: ($event) => handleSelect(item)
589
+ }, [
590
+ vue.createElementVNode(
591
+ "span",
592
+ _hoisted_25,
593
+ vue.toDisplayString(item.label),
594
+ 1
595
+ /* TEXT */
596
+ ),
597
+ hasMenuActions.value ? (vue.openBlock(), vue.createElementBlock("div", {
598
+ key: 0,
599
+ class: "yc-chat-sidebar__item-actions",
600
+ onClick: _cache[5] || (_cache[5] = vue.withModifiers(() => {
601
+ }, ["stop"]))
602
+ }, [
603
+ vue.createElementVNode("button", {
604
+ type: "button",
605
+ class: vue.normalizeClass(["yc-chat-sidebar__more-trigger", { "is-open": openMenuId.value === item.id }]),
606
+ "data-menu-trigger": item.id,
607
+ "data-testid": "session-more-btn",
608
+ "aria-label": "\u66F4\u591A\u4F1A\u8BDD\u64CD\u4F5C",
609
+ "aria-haspopup": "menu",
610
+ "aria-expanded": openMenuId.value === item.id,
611
+ title: "\u66F4\u591A\u64CD\u4F5C",
612
+ onClick: vue.withModifiers(($event) => toggleMenu(item, $event), ["stop"])
613
+ }, [..._cache[17] || (_cache[17] = [
614
+ vue.createElementVNode(
615
+ "svg",
616
+ {
617
+ viewBox: "0 0 16 16",
618
+ fill: "none",
619
+ "aria-hidden": "true"
620
+ },
621
+ [
622
+ vue.createElementVNode("circle", {
623
+ cx: "3.25",
624
+ cy: "8",
625
+ r: "1.25",
626
+ fill: "currentColor"
627
+ }),
628
+ vue.createElementVNode("circle", {
629
+ cx: "8",
630
+ cy: "8",
631
+ r: "1.25",
632
+ fill: "currentColor"
633
+ }),
634
+ vue.createElementVNode("circle", {
635
+ cx: "12.75",
636
+ cy: "8",
637
+ r: "1.25",
638
+ fill: "currentColor"
639
+ })
640
+ ],
641
+ -1
642
+ /* CACHED */
643
+ )
644
+ ])], 10, _hoisted_26)
645
+ ])) : vue.createCommentVNode("v-if", true)
646
+ ], 10, _hoisted_24);
647
+ }),
648
+ 128
649
+ /* KEYED_FRAGMENT */
650
+ ))
651
+ ])) : vue.createCommentVNode("v-if", true)
652
+ ])) : vue.createCommentVNode("v-if", true),
653
+ __props.hasMore ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_27, [
654
+ vue.createElementVNode("button", {
655
+ type: "button",
656
+ class: "yc-chat-sidebar__more-btn",
657
+ disabled: __props.loading,
658
+ onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => emit("load-more"), ["stop"]))
659
+ }, vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u591A"), 9, _hoisted_28)
660
+ ])) : vue.createCommentVNode("v-if", true)
661
+ ]))
662
+ ],
663
+ 32
664
+ /* NEED_HYDRATION */
665
+ ),
666
+ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
667
+ vue.createVNode(vue.Transition, { name: "yc-gemini-menu-pop" }, {
668
+ default: vue.withCtx(() => [
669
+ activeMenuSession.value ? (vue.openBlock(), vue.createElementBlock(
670
+ "div",
671
+ {
672
+ key: 0,
673
+ ref_key: "menuRef",
674
+ ref: menuRef,
675
+ class: "yc-chat-sidebar__dropdown",
676
+ style: vue.normalizeStyle(menuPositionStyle.value),
677
+ role: "menu",
678
+ "aria-label": "\u4F1A\u8BDD\u64CD\u4F5C\u83DC\u5355",
679
+ "data-testid": "session-action-menu",
680
+ onClick: _cache[10] || (_cache[10] = vue.withModifiers(() => {
681
+ }, ["stop"]))
682
+ },
683
+ [
684
+ __props.showShare ? (vue.openBlock(), vue.createElementBlock("button", {
685
+ key: 0,
686
+ type: "button",
687
+ role: "menuitem",
688
+ class: "yc-chat-sidebar__menu-item",
689
+ "data-testid": "session-action-share",
690
+ onClick: _cache[7] || (_cache[7] = ($event) => triggerAction("share", activeMenuSession.value))
691
+ }, [..._cache[18] || (_cache[18] = [
692
+ vue.createElementVNode(
693
+ "svg",
694
+ {
695
+ viewBox: "0 0 16 16",
696
+ fill: "none",
697
+ "aria-hidden": "true"
698
+ },
699
+ [
700
+ vue.createElementVNode("circle", {
701
+ cx: "11.75",
702
+ cy: "3.5",
703
+ r: "1.75",
704
+ stroke: "currentColor",
705
+ "stroke-width": "1.35"
706
+ }),
707
+ vue.createElementVNode("circle", {
708
+ cx: "4.25",
709
+ cy: "8",
710
+ r: "1.75",
711
+ stroke: "currentColor",
712
+ "stroke-width": "1.35"
713
+ }),
714
+ vue.createElementVNode("circle", {
715
+ cx: "11.75",
716
+ cy: "12.5",
717
+ r: "1.75",
718
+ stroke: "currentColor",
719
+ "stroke-width": "1.35"
720
+ }),
721
+ vue.createElementVNode("path", {
722
+ d: "M5.8 7.1L10.2 4.4M5.8 8.9L10.2 11.6",
723
+ stroke: "currentColor",
724
+ "stroke-width": "1.35",
725
+ "stroke-linecap": "round"
726
+ })
727
+ ],
728
+ -1
729
+ /* CACHED */
730
+ ),
731
+ vue.createElementVNode(
732
+ "span",
733
+ null,
734
+ "\u5206\u4EAB",
735
+ -1
736
+ /* CACHED */
737
+ )
738
+ ])])) : vue.createCommentVNode("v-if", true),
739
+ __props.showArchive ? (vue.openBlock(), vue.createElementBlock("button", {
740
+ key: 1,
741
+ type: "button",
742
+ role: "menuitem",
743
+ class: "yc-chat-sidebar__menu-item",
744
+ "data-testid": "session-action-archive",
745
+ onClick: _cache[8] || (_cache[8] = ($event) => triggerAction(
746
+ activeMenuSession.value.archived ? "unarchive" : "archive",
747
+ activeMenuSession.value
748
+ ))
230
749
  }, [
231
- vue.createElementVNode("button", {
232
- type: "button",
233
- class: "yc-chat-sidebar__delete-btn",
234
- "aria-label": "\u5220\u9664\u4F1A\u8BDD",
235
- title: "\u5220\u9664\u4F1A\u8BDD",
236
- onClick: vue.withModifiers(($event) => emit("delete", item.id), ["stop"])
237
- }, [..._cache[6] || (_cache[6] = [
750
+ !activeMenuSession.value.archived ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_29, [..._cache[19] || (_cache[19] = [
751
+ vue.createElementVNode(
752
+ "rect",
753
+ {
754
+ x: "2",
755
+ y: "2.75",
756
+ width: "12",
757
+ height: "3.25",
758
+ rx: "1",
759
+ stroke: "currentColor",
760
+ "stroke-width": "1.35"
761
+ },
762
+ null,
763
+ -1
764
+ /* CACHED */
765
+ ),
238
766
  vue.createElementVNode(
239
- "svg",
767
+ "path",
240
768
  {
241
- viewBox: "0 0 16 16",
242
- fill: "none",
243
- "aria-hidden": "true"
769
+ d: "M3.25 6V12.25C3.25 12.8 3.7 13.25 4.25 13.25H11.75C12.3 13.25 12.75 12.8 12.75 12.25V6M8 7.75V11.25M6.5 9.85L8 11.35L9.5 9.85",
770
+ stroke: "currentColor",
771
+ "stroke-width": "1.35",
772
+ "stroke-linecap": "round",
773
+ "stroke-linejoin": "round"
244
774
  },
245
- [
246
- vue.createElementVNode("path", {
247
- 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",
248
- stroke: "currentColor",
249
- "stroke-width": "1.3",
250
- "stroke-linecap": "round",
251
- "stroke-linejoin": "round"
252
- })
253
- ],
775
+ null,
254
776
  -1
255
777
  /* CACHED */
256
778
  )
257
- ])], 8, _hoisted_15)
258
- ])
779
+ ])])) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_30, [..._cache[20] || (_cache[20] = [
780
+ vue.createElementVNode(
781
+ "rect",
782
+ {
783
+ x: "2",
784
+ y: "2.75",
785
+ width: "12",
786
+ height: "3.25",
787
+ rx: "1",
788
+ stroke: "currentColor",
789
+ "stroke-width": "1.35"
790
+ },
791
+ null,
792
+ -1
793
+ /* CACHED */
794
+ ),
795
+ vue.createElementVNode(
796
+ "path",
797
+ {
798
+ d: "M3.25 6V12.25C3.25 12.8 3.7 13.25 4.25 13.25H11.75C12.3 13.25 12.75 12.8 12.75 12.25V6M8 11.25V7.75M6.5 9.15L8 7.65L9.5 9.15",
799
+ stroke: "currentColor",
800
+ "stroke-width": "1.35",
801
+ "stroke-linecap": "round",
802
+ "stroke-linejoin": "round"
803
+ },
804
+ null,
805
+ -1
806
+ /* CACHED */
807
+ )
808
+ ])])),
809
+ vue.createElementVNode(
810
+ "span",
811
+ null,
812
+ vue.toDisplayString(activeMenuSession.value.archived ? "\u53D6\u6D88\u5F52\u6863" : "\u5F52\u6863"),
813
+ 1
814
+ /* TEXT */
815
+ )
816
+ ])) : vue.createCommentVNode("v-if", true),
817
+ __props.showDelete && (__props.showShare || __props.showArchive) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_31)) : vue.createCommentVNode("v-if", true),
818
+ __props.showDelete ? (vue.openBlock(), vue.createElementBlock("button", {
819
+ key: 3,
820
+ type: "button",
821
+ role: "menuitem",
822
+ class: "yc-chat-sidebar__menu-item is-danger",
823
+ "data-testid": "session-action-delete",
824
+ disabled: activeMenuSession.value.disabled,
825
+ onClick: _cache[9] || (_cache[9] = ($event) => triggerAction("delete", activeMenuSession.value))
826
+ }, [..._cache[21] || (_cache[21] = [
827
+ vue.createElementVNode(
828
+ "svg",
829
+ {
830
+ viewBox: "0 0 16 16",
831
+ fill: "none",
832
+ "aria-hidden": "true"
833
+ },
834
+ [
835
+ vue.createElementVNode("path", {
836
+ d: "M3.25 4.5H12.75M6.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.5M4.85 4.5L5.3 12.35C5.34 13 5.88 13.5 6.53 13.5H9.47C10.12 13.5 10.66 13 10.7 12.35L11.15 4.5M6.75 7.25V10.75M9.25 7.25V10.75",
837
+ stroke: "currentColor",
838
+ "stroke-width": "1.35",
839
+ "stroke-linecap": "round",
840
+ "stroke-linejoin": "round"
841
+ })
842
+ ],
843
+ -1
844
+ /* CACHED */
845
+ ),
846
+ vue.createElementVNode(
847
+ "span",
848
+ null,
849
+ "\u5220\u9664",
850
+ -1
851
+ /* CACHED */
852
+ )
853
+ ])], 8, _hoisted_32)) : vue.createCommentVNode("v-if", true)
259
854
  ],
260
- 2
261
- /* CLASS */
262
- )
855
+ 4
856
+ /* STYLE */
857
+ )) : vue.createCommentVNode("v-if", true)
263
858
  ]),
264
- _: 2
265
- /* DYNAMIC */
266
- }, [
267
- __props.hasMore ? {
268
- name: "load-more",
269
- fn: vue.withCtx(() => [
270
- vue.createElementVNode("div", _hoisted_16, [
271
- vue.createElementVNode("button", {
272
- type: "button",
273
- class: "yc-chat-sidebar__more-btn",
274
- disabled: __props.loading,
275
- onClick: _cache[3] || (_cache[3] = ($event) => emit("load-more"))
276
- }, vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u591A"), 9, _hoisted_17)
277
- ])
278
- ]),
279
- key: "0"
280
- } : void 0
281
- ]), 1032, ["items", "active"]))
282
- ])
859
+ _: 1
860
+ /* STABLE */
861
+ })
862
+ ]))
283
863
  ]);
284
864
  };
285
865
  }