yc-agent-ui 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/es/components/dialog-form/index.d.ts +4 -4
  2. package/es/components/dialog-form/src/index.vue.d.ts +4 -4
  3. package/es/components/display-item/index.d.ts +15 -15
  4. package/es/components/display-item/src/index.vue.d.ts +13 -13
  5. package/es/components/drawer-form/index.d.ts +4 -4
  6. package/es/components/drawer-form/src/index.vue.d.ts +4 -4
  7. package/es/components/form/index.d.ts +8 -8
  8. package/es/components/form/src/form-content.vue.d.ts +8 -8
  9. package/es/components/form/src/index.vue.d.ts +8 -8
  10. package/es/components/form-item/index.d.ts +6 -6
  11. package/es/components/form-item/src/index.vue.d.ts +6 -6
  12. package/es/components/index.d.ts +1 -0
  13. package/es/components/page/index.d.ts +172 -172
  14. package/es/components/page/src/index.vue.d.ts +60 -60
  15. package/es/components/search/index.d.ts +52 -52
  16. package/es/components/search/src/index.vue.d.ts +20 -20
  17. package/es/components/table/src/table-column.vue.d.ts +34 -34
  18. package/es/components/yc-ai-chat/index.d.ts +14 -0
  19. package/es/components/yc-ai-chat/src/bubble.vue.d.ts +27 -0
  20. package/es/components/yc-ai-chat/src/file-card.vue.d.ts +18 -0
  21. package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +31 -0
  22. package/es/components/yc-ai-chat/src/presets.d.ts +6 -0
  23. package/es/components/yc-ai-chat/src/select.vue.d.ts +23 -0
  24. package/es/components/yc-ai-chat/src/sender.vue.d.ts +44 -0
  25. package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +23 -0
  26. package/es/components/yc-ai-chat/src/studio.vue.d.ts +46 -0
  27. package/es/components/yc-ai-chat/src/thinking.vue.d.ts +9 -0
  28. package/es/components/yc-ai-chat/src/type.d.ts +34 -0
  29. package/es/components/yc-ai-chat/src/welcome.vue.d.ts +19 -0
  30. package/es/components/yc-plus-page/src/index.vue.d.ts +176 -176
  31. package/es/hooks/usePlusFormReset.d.ts +48 -48
  32. package/es/index.css +10 -10
  33. package/es/index.mjs +10 -0
  34. package/es/packages/components/index.mjs +10 -0
  35. package/es/packages/components/yc-ai-chat/index.mjs +14 -0
  36. package/es/packages/components/yc-ai-chat/src/bubble.vue.mjs +5 -0
  37. package/es/packages/components/yc-ai-chat/src/bubble2.vue.mjs +289 -0
  38. package/es/packages/components/yc-ai-chat/src/file-card.vue.mjs +5 -0
  39. package/es/packages/components/yc-ai-chat/src/file-card2.vue.mjs +127 -0
  40. package/es/packages/components/yc-ai-chat/src/mobile-frame.vue.mjs +5 -0
  41. package/es/packages/components/yc-ai-chat/src/mobile-frame2.vue.mjs +245 -0
  42. package/es/packages/components/yc-ai-chat/src/presets.mjs +55 -0
  43. package/es/packages/components/yc-ai-chat/src/select.vue.mjs +5 -0
  44. package/es/packages/components/yc-ai-chat/src/select2.vue.mjs +337 -0
  45. package/es/packages/components/yc-ai-chat/src/sender.vue.mjs +5 -0
  46. package/es/packages/components/yc-ai-chat/src/sender2.vue.mjs +432 -0
  47. package/es/packages/components/yc-ai-chat/src/sidebar.vue.mjs +5 -0
  48. package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +251 -0
  49. package/es/packages/components/yc-ai-chat/src/studio.vue.mjs +5 -0
  50. package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +421 -0
  51. package/es/packages/components/yc-ai-chat/src/thinking.vue.mjs +5 -0
  52. package/es/packages/components/yc-ai-chat/src/thinking2.vue.mjs +88 -0
  53. package/es/packages/components/yc-ai-chat/src/type.mjs +1 -0
  54. package/es/packages/components/yc-ai-chat/src/welcome.vue.mjs +5 -0
  55. package/es/packages/components/yc-ai-chat/src/welcome2.vue.mjs +113 -0
  56. package/es/packages/components/yc-lens/capability.mjs +10 -2
  57. package/es/version.d.ts +1 -1
  58. package/es/version.mjs +1 -1
  59. package/index.css +12 -2
  60. package/index.js +18963 -17199
  61. package/index.min.css +11 -1
  62. package/index.min.js +50 -27
  63. package/index.min.mjs +50 -27
  64. package/index.mjs +18941 -17188
  65. package/lib/components/dialog-form/index.d.ts +4 -4
  66. package/lib/components/dialog-form/src/index.vue.d.ts +4 -4
  67. package/lib/components/display-item/index.d.ts +15 -15
  68. package/lib/components/display-item/src/index.vue.d.ts +13 -13
  69. package/lib/components/drawer-form/index.d.ts +4 -4
  70. package/lib/components/drawer-form/src/index.vue.d.ts +4 -4
  71. package/lib/components/form/index.d.ts +8 -8
  72. package/lib/components/form/src/form-content.vue.d.ts +8 -8
  73. package/lib/components/form/src/index.vue.d.ts +8 -8
  74. package/lib/components/form-item/index.d.ts +6 -6
  75. package/lib/components/form-item/src/index.vue.d.ts +6 -6
  76. package/lib/components/index.d.ts +1 -0
  77. package/lib/components/page/index.d.ts +172 -172
  78. package/lib/components/page/src/index.vue.d.ts +60 -60
  79. package/lib/components/search/index.d.ts +52 -52
  80. package/lib/components/search/src/index.vue.d.ts +20 -20
  81. package/lib/components/table/src/table-column.vue.d.ts +34 -34
  82. package/lib/components/yc-ai-chat/index.d.ts +14 -0
  83. package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +27 -0
  84. package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +18 -0
  85. package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +31 -0
  86. package/lib/components/yc-ai-chat/src/presets.d.ts +6 -0
  87. package/lib/components/yc-ai-chat/src/select.vue.d.ts +23 -0
  88. package/lib/components/yc-ai-chat/src/sender.vue.d.ts +44 -0
  89. package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +23 -0
  90. package/lib/components/yc-ai-chat/src/studio.vue.d.ts +46 -0
  91. package/lib/components/yc-ai-chat/src/thinking.vue.d.ts +9 -0
  92. package/lib/components/yc-ai-chat/src/type.d.ts +34 -0
  93. package/lib/components/yc-ai-chat/src/welcome.vue.d.ts +19 -0
  94. package/lib/components/yc-plus-page/src/index.vue.d.ts +176 -176
  95. package/lib/hooks/usePlusFormReset.d.ts +48 -48
  96. package/lib/index.css +10 -10
  97. package/lib/index.js +23 -0
  98. package/lib/packages/components/index.js +23 -0
  99. package/lib/packages/components/yc-ai-chat/index.js +31 -0
  100. package/lib/packages/components/yc-ai-chat/src/bubble.vue.js +9 -0
  101. package/lib/packages/components/yc-ai-chat/src/bubble2.vue.js +293 -0
  102. package/lib/packages/components/yc-ai-chat/src/file-card.vue.js +9 -0
  103. package/lib/packages/components/yc-ai-chat/src/file-card2.vue.js +131 -0
  104. package/lib/packages/components/yc-ai-chat/src/mobile-frame.vue.js +9 -0
  105. package/lib/packages/components/yc-ai-chat/src/mobile-frame2.vue.js +249 -0
  106. package/lib/packages/components/yc-ai-chat/src/presets.js +60 -0
  107. package/lib/packages/components/yc-ai-chat/src/select.vue.js +9 -0
  108. package/lib/packages/components/yc-ai-chat/src/select2.vue.js +341 -0
  109. package/lib/packages/components/yc-ai-chat/src/sender.vue.js +9 -0
  110. package/lib/packages/components/yc-ai-chat/src/sender2.vue.js +436 -0
  111. package/lib/packages/components/yc-ai-chat/src/sidebar.vue.js +9 -0
  112. package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +255 -0
  113. package/lib/packages/components/yc-ai-chat/src/studio.vue.js +9 -0
  114. package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +425 -0
  115. package/lib/packages/components/yc-ai-chat/src/thinking.vue.js +9 -0
  116. package/lib/packages/components/yc-ai-chat/src/thinking2.vue.js +92 -0
  117. package/lib/packages/components/yc-ai-chat/src/type.js +2 -0
  118. package/lib/packages/components/yc-ai-chat/src/welcome.vue.js +9 -0
  119. package/lib/packages/components/yc-ai-chat/src/welcome2.vue.js +117 -0
  120. package/lib/packages/components/yc-lens/capability.js +10 -2
  121. package/lib/version.d.ts +1 -1
  122. package/lib/version.js +1 -1
  123. package/locale/en.js +1 -1
  124. package/locale/en.min.js +1 -1
  125. package/locale/en.min.mjs +1 -1
  126. package/locale/en.mjs +1 -1
  127. package/locale/ja.js +1 -1
  128. package/locale/ja.min.js +1 -1
  129. package/locale/ja.min.mjs +1 -1
  130. package/locale/ja.mjs +1 -1
  131. package/locale/ko.js +1 -1
  132. package/locale/ko.min.js +1 -1
  133. package/locale/ko.min.mjs +1 -1
  134. package/locale/ko.mjs +1 -1
  135. package/locale/zh-cn.js +1 -1
  136. package/locale/zh-cn.min.js +1 -1
  137. package/locale/zh-cn.min.mjs +1 -1
  138. package/locale/zh-cn.mjs +1 -1
  139. package/locale/zh-tw.js +1 -1
  140. package/locale/zh-tw.min.js +1 -1
  141. package/locale/zh-tw.min.mjs +1 -1
  142. package/locale/zh-tw.mjs +1 -1
  143. package/package.json +2 -1
  144. package/theme-chalk/index.css +12 -2
  145. package/theme-chalk/plus-yc-ai-chat.css +1 -0
  146. package/theme-chalk/src/index.scss +1 -0
  147. package/theme-chalk/src/yc-ai-chat.scss +1691 -0
@@ -0,0 +1,249 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const _hoisted_1 = ["data-device"];
8
+ const _hoisted_2 = { class: "yc-mobile-device__shell" };
9
+ const _hoisted_3 = { class: "yc-mobile-device__navbar" };
10
+ const _hoisted_4 = {
11
+ key: 0,
12
+ class: "yc-mobile-device__badge"
13
+ };
14
+ const _hoisted_5 = { class: "yc-mobile-device__nav-center" };
15
+ const _hoisted_6 = { class: "yc-mobile-device__nav-title" };
16
+ const _hoisted_7 = { class: "yc-mobile-device__nav-sub" };
17
+ const _hoisted_8 = { class: "yc-mobile-device__nav-actions" };
18
+ const _hoisted_9 = ["disabled"];
19
+ const _hoisted_10 = { class: "yc-mobile-device__viewport" };
20
+ const _hoisted_11 = { class: "yc-mobile-device__body" };
21
+ const _hoisted_12 = { class: "yc-mobile-device__footer" };
22
+ const _hoisted_13 = { class: "yc-mobile-device__drawer" };
23
+ const _hoisted_14 = { class: "yc-mobile-device__caption" };
24
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
+ ...{
26
+ name: "YcMobileDeviceFrame"
27
+ },
28
+ __name: "mobile-frame",
29
+ props: {
30
+ device: {},
31
+ agentName: { default: "AI \u52A9\u624B" },
32
+ status: { default: "idle" },
33
+ statusLabel: { default: "\u672A\u8FDE\u63A5" },
34
+ connected: { type: Boolean, default: false },
35
+ sessionCount: { default: 0 }
36
+ },
37
+ emits: ["create", "refresh"],
38
+ setup(__props, { expose: __expose, emit: __emit }) {
39
+ const props = __props;
40
+ const emit = __emit;
41
+ const drawerOpen = vue.ref(false);
42
+ const frameStyle = vue.computed(() => ({
43
+ "--yc-device-width": `${props.device.width}px`,
44
+ "--yc-device-height": `${props.device.height}px`
45
+ }));
46
+ function closeDrawer() {
47
+ drawerOpen.value = false;
48
+ }
49
+ __expose({
50
+ closeDrawer
51
+ });
52
+ return (_ctx, _cache) => {
53
+ return vue.openBlock(), vue.createElementBlock("div", {
54
+ class: "yc-mobile-device",
55
+ style: vue.normalizeStyle(frameStyle.value),
56
+ "data-testid": "mobile-device-frame",
57
+ "data-device": __props.device.id
58
+ }, [
59
+ vue.createElementVNode("div", _hoisted_2, [
60
+ _cache[6] || (_cache[6] = 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
+ vue.createElementVNode("header", _hoisted_3, [
62
+ vue.createElementVNode("button", {
63
+ type: "button",
64
+ class: "yc-mobile-device__nav-btn",
65
+ "aria-label": "\u6253\u5F00\u4F1A\u8BDD\u62BD\u5C49",
66
+ title: "\u5386\u53F2\u4F1A\u8BDD",
67
+ onClick: _cache[0] || (_cache[0] = ($event) => drawerOpen.value = !drawerOpen.value)
68
+ }, [
69
+ _cache[2] || (_cache[2] = vue.createElementVNode(
70
+ "svg",
71
+ {
72
+ viewBox: "0 0 16 16",
73
+ fill: "none",
74
+ "aria-hidden": "true"
75
+ },
76
+ [
77
+ vue.createElementVNode("path", {
78
+ d: "M2.5 4.25H13.5M2.5 8H10.5M2.5 11.75H13.5",
79
+ stroke: "currentColor",
80
+ "stroke-width": "1.45",
81
+ "stroke-linecap": "round"
82
+ })
83
+ ],
84
+ -1
85
+ /* CACHED */
86
+ )),
87
+ __props.sessionCount > 0 ? (vue.openBlock(), vue.createElementBlock(
88
+ "span",
89
+ _hoisted_4,
90
+ vue.toDisplayString(__props.sessionCount > 99 ? "99+" : __props.sessionCount),
91
+ 1
92
+ /* TEXT */
93
+ )) : vue.createCommentVNode("v-if", true)
94
+ ]),
95
+ vue.createElementVNode("div", _hoisted_5, [
96
+ vue.createElementVNode(
97
+ "div",
98
+ _hoisted_6,
99
+ vue.toDisplayString(__props.agentName || "AI \u52A9\u624B"),
100
+ 1
101
+ /* TEXT */
102
+ ),
103
+ vue.createElementVNode("div", _hoisted_7, [
104
+ vue.createElementVNode(
105
+ "span",
106
+ {
107
+ class: vue.normalizeClass(["yc-mobile-device__dot", `is-${__props.status}`])
108
+ },
109
+ null,
110
+ 2
111
+ /* CLASS */
112
+ ),
113
+ vue.createElementVNode(
114
+ "span",
115
+ null,
116
+ vue.toDisplayString(__props.statusLabel),
117
+ 1
118
+ /* TEXT */
119
+ )
120
+ ])
121
+ ]),
122
+ vue.createElementVNode("div", _hoisted_8, [
123
+ vue.createElementVNode("button", {
124
+ type: "button",
125
+ class: "yc-mobile-device__nav-btn",
126
+ "aria-label": "\u65B0\u5EFA\u79FB\u52A8\u7AEF\u5BF9\u8BDD",
127
+ title: "\u65B0\u5EFA\u5BF9\u8BDD",
128
+ disabled: !__props.connected,
129
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("create"))
130
+ }, [..._cache[3] || (_cache[3] = [
131
+ vue.createElementVNode(
132
+ "svg",
133
+ {
134
+ viewBox: "0 0 16 16",
135
+ fill: "none",
136
+ "aria-hidden": "true"
137
+ },
138
+ [
139
+ vue.createElementVNode("path", {
140
+ d: "M8 3.25V12.75M3.25 8H12.75",
141
+ stroke: "currentColor",
142
+ "stroke-width": "1.5",
143
+ "stroke-linecap": "round"
144
+ })
145
+ ],
146
+ -1
147
+ /* CACHED */
148
+ )
149
+ ])], 8, _hoisted_9)
150
+ ])
151
+ ]),
152
+ vue.createElementVNode("div", _hoisted_10, [
153
+ vue.createElementVNode("div", _hoisted_11, [
154
+ vue.renderSlot(_ctx.$slots, "default")
155
+ ]),
156
+ vue.createElementVNode("footer", _hoisted_12, [
157
+ vue.renderSlot(_ctx.$slots, "footer")
158
+ ]),
159
+ drawerOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
160
+ key: 0,
161
+ class: "yc-mobile-device__drawer-mask",
162
+ onClick: vue.withModifiers(closeDrawer, ["self"])
163
+ }, [
164
+ vue.createElementVNode("div", _hoisted_13, [
165
+ vue.createElementVNode("div", { class: "yc-mobile-device__drawer-top" }, [
166
+ _cache[5] || (_cache[5] = vue.createElementVNode(
167
+ "span",
168
+ null,
169
+ "\u5386\u53F2\u4F1A\u8BDD",
170
+ -1
171
+ /* CACHED */
172
+ )),
173
+ vue.createElementVNode("button", {
174
+ type: "button",
175
+ class: "yc-mobile-device__nav-btn",
176
+ "aria-label": "\u5173\u95ED\u4F1A\u8BDD\u62BD\u5C49",
177
+ onClick: closeDrawer
178
+ }, [..._cache[4] || (_cache[4] = [
179
+ vue.createElementVNode(
180
+ "svg",
181
+ {
182
+ viewBox: "0 0 16 16",
183
+ fill: "none",
184
+ "aria-hidden": "true"
185
+ },
186
+ [
187
+ vue.createElementVNode("path", {
188
+ d: "M4 4L12 12M12 4L4 12",
189
+ stroke: "currentColor",
190
+ "stroke-width": "1.5",
191
+ "stroke-linecap": "round"
192
+ })
193
+ ],
194
+ -1
195
+ /* CACHED */
196
+ )
197
+ ])])
198
+ ]),
199
+ vue.createElementVNode("div", {
200
+ class: "yc-mobile-device__drawer-content",
201
+ onClick: closeDrawer
202
+ }, [
203
+ vue.renderSlot(_ctx.$slots, "drawer")
204
+ ])
205
+ ])
206
+ ])) : vue.createCommentVNode("v-if", true)
207
+ ]),
208
+ _cache[7] || (_cache[7] = vue.createElementVNode(
209
+ "div",
210
+ {
211
+ class: "yc-mobile-device__home-bar",
212
+ "aria-hidden": "true"
213
+ },
214
+ [
215
+ vue.createElementVNode("span")
216
+ ],
217
+ -1
218
+ /* CACHED */
219
+ ))
220
+ ]),
221
+ vue.createElementVNode("div", _hoisted_14, [
222
+ vue.createElementVNode(
223
+ "span",
224
+ null,
225
+ vue.toDisplayString(__props.device.badge),
226
+ 1
227
+ /* TEXT */
228
+ ),
229
+ _cache[8] || (_cache[8] = vue.createElementVNode(
230
+ "span",
231
+ null,
232
+ "\xB7",
233
+ -1
234
+ /* CACHED */
235
+ )),
236
+ _cache[9] || (_cache[9] = vue.createElementVNode(
237
+ "span",
238
+ null,
239
+ "\u79FB\u52A8\u7AEF\u771F\u5B9E\u89C6\u53E3\u8C03\u8BD5",
240
+ -1
241
+ /* CACHED */
242
+ ))
243
+ ])
244
+ ], 12, _hoisted_1);
245
+ };
246
+ }
247
+ });
248
+
249
+ exports.default = _sfc_main;
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ const YC_MOBILE_DEVICE_PRESETS = [
4
+ {
5
+ id: "wecom",
6
+ label: "\u4F01\u5FAE / \u5C0F\u7A0B\u5E8F",
7
+ badge: "WeCom H5 \xB7 375\xD7760",
8
+ width: 375,
9
+ height: 760
10
+ },
11
+ {
12
+ id: "iphone16",
13
+ label: "iPhone 16 Pro",
14
+ badge: "iOS \xB7 393\xD7800",
15
+ width: 393,
16
+ height: 800
17
+ },
18
+ {
19
+ id: "android",
20
+ label: "Android \u5927\u5C4F",
21
+ badge: "Android \xB7 412\xD7820",
22
+ width: 412,
23
+ height: 820
24
+ }
25
+ ];
26
+ function groupChatSessionByDate(updatedAt) {
27
+ if (!updatedAt) return "\u4F1A\u8BDD\u5217\u8868";
28
+ const date = new Date(updatedAt);
29
+ if (Number.isNaN(date.getTime())) return "\u4F1A\u8BDD\u5217\u8868";
30
+ const now = /* @__PURE__ */ new Date();
31
+ const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
32
+ const targetTime = date.getTime();
33
+ const oneDayMs = 24 * 60 * 60 * 1e3;
34
+ if (targetTime >= startOfToday) return "\u4ECA\u5929";
35
+ if (targetTime >= startOfToday - oneDayMs) return "\u6628\u5929";
36
+ if (targetTime >= startOfToday - 7 * oneDayMs) return "\u8FD1 7 \u5929";
37
+ return "\u66F4\u65E9";
38
+ }
39
+ function formatChatSessionTime(updatedAt) {
40
+ if (!updatedAt) return "\u521A\u521A";
41
+ const date = new Date(updatedAt);
42
+ if (Number.isNaN(date.getTime())) return updatedAt;
43
+ const pad = (num) => String(num).padStart(2, "0");
44
+ const now = /* @__PURE__ */ new Date();
45
+ if (date.getFullYear() === now.getFullYear() && date.getMonth() === now.getMonth() && date.getDate() === now.getDate()) {
46
+ return `${pad(date.getHours())}:${pad(date.getMinutes())}`;
47
+ }
48
+ return `${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
49
+ }
50
+ function formatChatFileSize(sizeBytes) {
51
+ if (sizeBytes === void 0 || Number.isNaN(sizeBytes)) return "";
52
+ if (sizeBytes < 1024) return `${sizeBytes} B`;
53
+ if (sizeBytes < 1024 * 1024) return `${(sizeBytes / 1024).toFixed(1)} KB`;
54
+ return `${(sizeBytes / (1024 * 1024)).toFixed(1)} MB`;
55
+ }
56
+
57
+ exports.YC_MOBILE_DEVICE_PRESETS = YC_MOBILE_DEVICE_PRESETS;
58
+ exports.formatChatFileSize = formatChatFileSize;
59
+ exports.formatChatSessionTime = formatChatSessionTime;
60
+ exports.groupChatSessionByDate = groupChatSessionByDate;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var select_vue_vue_type_script_setup_true_lang = require('./select2.vue.js');
6
+
7
+
8
+
9
+ exports.default = select_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,341 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const _hoisted_1 = ["disabled", "aria-expanded", "aria-label"];
8
+ const _hoisted_2 = {
9
+ key: 0,
10
+ class: "yc-chat-select__prefix"
11
+ };
12
+ const _hoisted_3 = { class: "yc-chat-select__value" };
13
+ const _hoisted_4 = {
14
+ key: 2,
15
+ viewBox: "0 0 16 16",
16
+ fill: "none",
17
+ class: "yc-chat-select__chevron",
18
+ "aria-hidden": "true"
19
+ };
20
+ const _hoisted_5 = {
21
+ key: 0,
22
+ class: "yc-chat-select__search"
23
+ };
24
+ const _hoisted_6 = ["placeholder"];
25
+ const _hoisted_7 = {
26
+ class: "yc-chat-select__list",
27
+ role: "listbox"
28
+ };
29
+ const _hoisted_8 = {
30
+ key: 0,
31
+ class: "yc-chat-select__empty"
32
+ };
33
+ const _hoisted_9 = ["aria-selected", "onClick"];
34
+ const _hoisted_10 = { class: "yc-chat-select__option-body" };
35
+ const _hoisted_11 = { class: "yc-chat-select__option-label" };
36
+ const _hoisted_12 = {
37
+ key: 0,
38
+ class: "yc-chat-select__option-desc"
39
+ };
40
+ const _hoisted_13 = {
41
+ key: 0,
42
+ viewBox: "0 0 16 16",
43
+ fill: "none",
44
+ class: "yc-chat-select__check"
45
+ };
46
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
47
+ ...{
48
+ name: "YcChatSelect"
49
+ },
50
+ __name: "select",
51
+ props: {
52
+ modelValue: { default: "" },
53
+ options: { default: () => [] },
54
+ prefix: { default: "" },
55
+ placeholder: { default: "\u8BF7\u9009\u62E9" },
56
+ searchPlaceholder: { default: "\u641C\u7D22\u9009\u9879\u2026" },
57
+ emptyText: { default: "\u6682\u65E0\u53EF\u9009\u9879" },
58
+ disabled: { type: Boolean, default: false },
59
+ loading: { type: Boolean, default: false },
60
+ clearable: { type: Boolean, default: false },
61
+ searchable: { type: Boolean, default: true },
62
+ ariaLabel: { default: "" }
63
+ },
64
+ emits: ["update:modelValue", "change"],
65
+ setup(__props, { emit: __emit }) {
66
+ const props = __props;
67
+ const emit = __emit;
68
+ const open = vue.ref(false);
69
+ const query = vue.ref("");
70
+ const triggerRef = vue.ref(null);
71
+ const popoverRef = vue.ref(null);
72
+ const searchInputRef = vue.ref(null);
73
+ const popoverStyle = vue.ref({});
74
+ const selectedOption = vue.computed(
75
+ () => props.options.find((item) => item.value === props.modelValue)
76
+ );
77
+ const filteredOptions = vue.computed(() => {
78
+ const q = query.value.trim().toLowerCase();
79
+ if (!q) return props.options;
80
+ return props.options.filter(
81
+ (item) => item.label.toLowerCase().includes(q) || item.description && item.description.toLowerCase().includes(q)
82
+ );
83
+ });
84
+ function updatePosition() {
85
+ const el = triggerRef.value;
86
+ if (!el || typeof window === "undefined") return;
87
+ const rect = el.getBoundingClientRect();
88
+ const maxLeft = Math.max(12, window.innerWidth - 280);
89
+ popoverStyle.value = {
90
+ position: "fixed",
91
+ top: `${rect.bottom + 6}px`,
92
+ left: `${Math.min(rect.left, maxLeft)}px`,
93
+ minWidth: `${Math.max(rect.width, 220)}px`
94
+ };
95
+ }
96
+ function handleOutsidePointer(event) {
97
+ var _a, _b;
98
+ const target = event.target;
99
+ if (!target) return;
100
+ if (((_a = triggerRef.value) == null ? void 0 : _a.contains(target)) || ((_b = popoverRef.value) == null ? void 0 : _b.contains(target))) return;
101
+ open.value = false;
102
+ }
103
+ function handleEscape(event) {
104
+ if (event.key === "Escape") {
105
+ open.value = false;
106
+ }
107
+ }
108
+ vue.watch(open, async (isOpen) => {
109
+ var _a;
110
+ if (typeof window === "undefined") return;
111
+ if (!isOpen) {
112
+ query.value = "";
113
+ window.removeEventListener("pointerdown", handleOutsidePointer, true);
114
+ window.removeEventListener("keydown", handleEscape);
115
+ window.removeEventListener("resize", updatePosition);
116
+ return;
117
+ }
118
+ updatePosition();
119
+ window.addEventListener("pointerdown", handleOutsidePointer, true);
120
+ window.addEventListener("keydown", handleEscape);
121
+ window.addEventListener("resize", updatePosition);
122
+ if (props.searchable && props.options.length > 4) {
123
+ await vue.nextTick();
124
+ (_a = searchInputRef.value) == null ? void 0 : _a.focus();
125
+ }
126
+ });
127
+ vue.onBeforeUnmount(() => {
128
+ if (typeof window === "undefined") return;
129
+ window.removeEventListener("pointerdown", handleOutsidePointer, true);
130
+ window.removeEventListener("keydown", handleEscape);
131
+ window.removeEventListener("resize", updatePosition);
132
+ });
133
+ function toggleOpen() {
134
+ if (props.disabled) return;
135
+ open.value = !open.value;
136
+ }
137
+ function selectItem(value) {
138
+ open.value = false;
139
+ if (value === props.modelValue) return;
140
+ emit("update:modelValue", value);
141
+ emit("change", value);
142
+ }
143
+ function clearSelection(event) {
144
+ event.stopPropagation();
145
+ if (props.disabled) return;
146
+ emit("update:modelValue", "");
147
+ emit("change", "");
148
+ }
149
+ return (_ctx, _cache) => {
150
+ return vue.openBlock(), vue.createElementBlock(
151
+ vue.Fragment,
152
+ null,
153
+ [
154
+ vue.createElementVNode("button", {
155
+ ref_key: "triggerRef",
156
+ ref: triggerRef,
157
+ type: "button",
158
+ class: vue.normalizeClass(["yc-chat-select", {
159
+ "is-open": open.value,
160
+ "is-disabled": __props.disabled,
161
+ "has-value": Boolean(selectedOption.value)
162
+ }]),
163
+ disabled: __props.disabled,
164
+ "aria-expanded": open.value,
165
+ "aria-label": __props.ariaLabel || __props.prefix || __props.placeholder,
166
+ onClick: toggleOpen
167
+ }, [
168
+ __props.prefix ? (vue.openBlock(), vue.createElementBlock(
169
+ "span",
170
+ _hoisted_2,
171
+ vue.toDisplayString(__props.prefix),
172
+ 1
173
+ /* TEXT */
174
+ )) : vue.createCommentVNode("v-if", true),
175
+ vue.createElementVNode(
176
+ "span",
177
+ _hoisted_3,
178
+ vue.toDisplayString(__props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : selectedOption.value ? selectedOption.value.label : __props.placeholder),
179
+ 1
180
+ /* TEXT */
181
+ ),
182
+ __props.clearable && __props.modelValue && !__props.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
183
+ key: 1,
184
+ role: "button",
185
+ tabindex: "-1",
186
+ class: "yc-chat-select__clear",
187
+ "aria-label": "\u6E05\u7A7A\u9009\u62E9",
188
+ onClick: clearSelection
189
+ }, [..._cache[1] || (_cache[1] = [
190
+ vue.createElementVNode(
191
+ "svg",
192
+ {
193
+ viewBox: "0 0 14 14",
194
+ fill: "none"
195
+ },
196
+ [
197
+ vue.createElementVNode("path", {
198
+ d: "M4 4L10 10M10 4L4 10",
199
+ stroke: "currentColor",
200
+ "stroke-width": "1.5",
201
+ "stroke-linecap": "round"
202
+ })
203
+ ],
204
+ -1
205
+ /* CACHED */
206
+ )
207
+ ])])) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4, [..._cache[2] || (_cache[2] = [
208
+ vue.createElementVNode(
209
+ "path",
210
+ {
211
+ d: "M5.25 6.25L8 3.5L10.75 6.25M5.25 9.75L8 12.5L10.75 9.75",
212
+ stroke: "currentColor",
213
+ "stroke-width": "1.4",
214
+ "stroke-linecap": "round",
215
+ "stroke-linejoin": "round"
216
+ },
217
+ null,
218
+ -1
219
+ /* CACHED */
220
+ )
221
+ ])]))
222
+ ], 10, _hoisted_1),
223
+ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
224
+ open.value ? (vue.openBlock(), vue.createElementBlock(
225
+ "div",
226
+ {
227
+ key: 0,
228
+ ref_key: "popoverRef",
229
+ ref: popoverRef,
230
+ class: "yc-chat-select__popover",
231
+ style: vue.normalizeStyle(popoverStyle.value)
232
+ },
233
+ [
234
+ __props.searchable && __props.options.length > 4 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
235
+ _cache[3] || (_cache[3] = vue.createElementVNode(
236
+ "svg",
237
+ {
238
+ viewBox: "0 0 16 16",
239
+ fill: "none",
240
+ class: "yc-chat-select__search-icon"
241
+ },
242
+ [
243
+ vue.createElementVNode("circle", {
244
+ cx: "7",
245
+ cy: "7",
246
+ r: "4.5",
247
+ stroke: "currentColor",
248
+ "stroke-width": "1.4"
249
+ }),
250
+ vue.createElementVNode("path", {
251
+ d: "M10.5 10.5L13.5 13.5",
252
+ stroke: "currentColor",
253
+ "stroke-width": "1.4",
254
+ "stroke-linecap": "round"
255
+ })
256
+ ],
257
+ -1
258
+ /* CACHED */
259
+ )),
260
+ vue.withDirectives(vue.createElementVNode("input", {
261
+ ref_key: "searchInputRef",
262
+ ref: searchInputRef,
263
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
264
+ type: "text",
265
+ class: "yc-chat-select__search-input",
266
+ placeholder: __props.searchPlaceholder
267
+ }, null, 8, _hoisted_6), [
268
+ [vue.vModelText, query.value]
269
+ ])
270
+ ])) : vue.createCommentVNode("v-if", true),
271
+ vue.createElementVNode("div", _hoisted_7, [
272
+ !filteredOptions.value.length ? (vue.openBlock(), vue.createElementBlock(
273
+ "div",
274
+ _hoisted_8,
275
+ vue.toDisplayString(__props.emptyText),
276
+ 1
277
+ /* TEXT */
278
+ )) : vue.createCommentVNode("v-if", true),
279
+ (vue.openBlock(true), vue.createElementBlock(
280
+ vue.Fragment,
281
+ null,
282
+ vue.renderList(filteredOptions.value, (item) => {
283
+ return vue.openBlock(), vue.createElementBlock("button", {
284
+ key: item.value,
285
+ type: "button",
286
+ role: "option",
287
+ "aria-selected": item.value === __props.modelValue,
288
+ class: vue.normalizeClass(["yc-chat-select__option", { "is-selected": item.value === __props.modelValue }]),
289
+ onClick: ($event) => selectItem(item.value)
290
+ }, [
291
+ vue.createElementVNode("div", _hoisted_10, [
292
+ vue.createElementVNode(
293
+ "span",
294
+ _hoisted_11,
295
+ vue.toDisplayString(item.label),
296
+ 1
297
+ /* TEXT */
298
+ ),
299
+ item.description ? (vue.openBlock(), vue.createElementBlock(
300
+ "span",
301
+ _hoisted_12,
302
+ vue.toDisplayString(item.description),
303
+ 1
304
+ /* TEXT */
305
+ )) : vue.createCommentVNode("v-if", true)
306
+ ]),
307
+ item.value === __props.modelValue ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_13, [..._cache[4] || (_cache[4] = [
308
+ vue.createElementVNode(
309
+ "path",
310
+ {
311
+ d: "M3.5 8.5L6.5 11.5L12.5 4.5",
312
+ stroke: "currentColor",
313
+ "stroke-width": "1.7",
314
+ "stroke-linecap": "round",
315
+ "stroke-linejoin": "round"
316
+ },
317
+ null,
318
+ -1
319
+ /* CACHED */
320
+ )
321
+ ])])) : vue.createCommentVNode("v-if", true)
322
+ ], 10, _hoisted_9);
323
+ }),
324
+ 128
325
+ /* KEYED_FRAGMENT */
326
+ ))
327
+ ])
328
+ ],
329
+ 4
330
+ /* STYLE */
331
+ )) : vue.createCommentVNode("v-if", true)
332
+ ]))
333
+ ],
334
+ 64
335
+ /* STABLE_FRAGMENT */
336
+ );
337
+ };
338
+ }
339
+ });
340
+
341
+ exports.default = _sfc_main;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var sender_vue_vue_type_script_setup_true_lang = require('./sender2.vue.js');
6
+
7
+
8
+
9
+ exports.default = sender_vue_vue_type_script_setup_true_lang.default;