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