yc-agent-ui 1.2.1 → 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 (138) hide show
  1. package/README.md +26 -5
  2. package/es/components/chart/src/chart-card.vue.d.ts +56 -10
  3. package/es/components/chart/src/chart-container.vue.d.ts +11 -1
  4. package/es/components/chart/src/theme.d.ts +1 -1
  5. package/es/components/dialog/index.d.ts +6 -6
  6. package/es/components/dialog/src/index.vue.d.ts +2 -2
  7. package/es/components/dialog-form/index.d.ts +6 -6
  8. package/es/components/dialog-form/src/index.vue.d.ts +6 -6
  9. package/es/components/display-item/index.d.ts +21 -21
  10. package/es/components/display-item/src/index.vue.d.ts +19 -19
  11. package/es/components/drawer-form/index.d.ts +18 -18
  12. package/es/components/drawer-form/src/index.vue.d.ts +10 -10
  13. package/es/components/form/index.d.ts +12 -12
  14. package/es/components/form/src/form-content.vue.d.ts +12 -12
  15. package/es/components/form/src/index.vue.d.ts +12 -12
  16. package/es/components/form-item/index.d.ts +12 -12
  17. package/es/components/form-item/src/index.vue.d.ts +10 -10
  18. package/es/components/page/index.d.ts +258 -258
  19. package/es/components/page/src/index.vue.d.ts +90 -90
  20. package/es/components/render/index.d.ts +1 -1
  21. package/es/components/render/src/index.vue.d.ts +1 -1
  22. package/es/components/search/index.d.ts +78 -78
  23. package/es/components/search/src/index.vue.d.ts +30 -30
  24. package/es/components/table/src/table-column.vue.d.ts +46 -46
  25. package/es/components/yc-ai-chat/index.d.ts +1 -0
  26. package/es/components/yc-ai-chat/src/bubble.vue.d.ts +1 -0
  27. package/es/components/yc-ai-chat/src/select.vue.d.ts +1 -0
  28. package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +29 -2
  29. package/es/components/yc-ai-chat/src/studio.vue.d.ts +9 -0
  30. package/es/components/yc-ai-chat/src/type.d.ts +2 -0
  31. package/es/components/yc-plus-page/src/index.vue.d.ts +264 -264
  32. package/es/components/yc-select-v2/src/index.vue.d.ts +1 -1
  33. package/es/hooks/usePlusFormReset.d.ts +144 -144
  34. package/es/index.css +8 -8
  35. package/es/index.mjs +1 -0
  36. package/es/packages/components/chart/src/chart-card2.vue.mjs +9 -2
  37. package/es/packages/components/chart/src/chart-container2.vue.mjs +13 -1
  38. package/es/packages/components/chart/src/theme.mjs +18 -10
  39. package/es/packages/components/data-table/capability.mjs +1 -1
  40. package/es/packages/components/index.mjs +1 -0
  41. package/es/packages/components/yc-ai-chat/index.mjs +1 -0
  42. package/es/packages/components/yc-ai-chat/src/bubble2.vue.mjs +21 -13
  43. package/es/packages/components/yc-ai-chat/src/select2.vue.mjs +9 -4
  44. package/es/packages/components/yc-ai-chat/src/sender2.vue.mjs +5 -3
  45. package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +735 -150
  46. package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +452 -85
  47. package/es/packages/components/yc-gradient-card/capability.mjs +8 -8
  48. package/es/packages/components/yc-input/src/stepper-input2.vue.mjs +48 -24
  49. package/es/packages/registry/types.mjs +1 -1
  50. package/es/registry/types.d.ts +1 -1
  51. package/es/version.d.ts +1 -1
  52. package/es/version.mjs +1 -1
  53. package/index.css +1 -1
  54. package/index.js +5707 -1690
  55. package/index.min.js +41 -38
  56. package/index.min.mjs +38 -35
  57. package/index.mjs +5772 -1765
  58. package/lib/components/chart/src/chart-card.vue.d.ts +56 -10
  59. package/lib/components/chart/src/chart-container.vue.d.ts +11 -1
  60. package/lib/components/chart/src/theme.d.ts +1 -1
  61. package/lib/components/dialog/index.d.ts +6 -6
  62. package/lib/components/dialog/src/index.vue.d.ts +2 -2
  63. package/lib/components/dialog-form/index.d.ts +6 -6
  64. package/lib/components/dialog-form/src/index.vue.d.ts +6 -6
  65. package/lib/components/display-item/index.d.ts +21 -21
  66. package/lib/components/display-item/src/index.vue.d.ts +19 -19
  67. package/lib/components/drawer-form/index.d.ts +18 -18
  68. package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
  69. package/lib/components/form/index.d.ts +12 -12
  70. package/lib/components/form/src/form-content.vue.d.ts +12 -12
  71. package/lib/components/form/src/index.vue.d.ts +12 -12
  72. package/lib/components/form-item/index.d.ts +12 -12
  73. package/lib/components/form-item/src/index.vue.d.ts +10 -10
  74. package/lib/components/page/index.d.ts +258 -258
  75. package/lib/components/page/src/index.vue.d.ts +90 -90
  76. package/lib/components/render/index.d.ts +1 -1
  77. package/lib/components/render/src/index.vue.d.ts +1 -1
  78. package/lib/components/search/index.d.ts +78 -78
  79. package/lib/components/search/src/index.vue.d.ts +30 -30
  80. package/lib/components/table/src/table-column.vue.d.ts +46 -46
  81. package/lib/components/yc-ai-chat/index.d.ts +1 -0
  82. package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +1 -0
  83. package/lib/components/yc-ai-chat/src/select.vue.d.ts +1 -0
  84. package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +29 -2
  85. package/lib/components/yc-ai-chat/src/studio.vue.d.ts +9 -0
  86. package/lib/components/yc-ai-chat/src/type.d.ts +2 -0
  87. package/lib/components/yc-plus-page/src/index.vue.d.ts +264 -264
  88. package/lib/components/yc-select-v2/src/index.vue.d.ts +1 -1
  89. package/lib/hooks/usePlusFormReset.d.ts +144 -144
  90. package/lib/index.css +12 -12
  91. package/lib/index.js +41 -0
  92. package/lib/packages/components/chart/src/chart-card2.vue.js +9 -2
  93. package/lib/packages/components/chart/src/chart-container2.vue.js +13 -1
  94. package/lib/packages/components/chart/src/theme.js +18 -10
  95. package/lib/packages/components/data-table/capability.js +1 -1
  96. package/lib/packages/components/index.js +41 -0
  97. package/lib/packages/components/yc-ai-chat/index.js +41 -0
  98. package/lib/packages/components/yc-ai-chat/src/bubble2.vue.js +21 -13
  99. package/lib/packages/components/yc-ai-chat/src/select2.vue.js +9 -4
  100. package/lib/packages/components/yc-ai-chat/src/sender2.vue.js +5 -3
  101. package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +734 -149
  102. package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +451 -84
  103. package/lib/packages/components/yc-gradient-card/capability.js +8 -8
  104. package/lib/packages/components/yc-input/src/stepper-input2.vue.js +47 -23
  105. package/lib/packages/registry/types.js +1 -1
  106. package/lib/registry/types.d.ts +1 -1
  107. package/lib/version.d.ts +1 -1
  108. package/lib/version.js +1 -1
  109. package/locale/en.js +1 -1
  110. package/locale/en.min.js +1 -1
  111. package/locale/en.min.mjs +1 -1
  112. package/locale/en.mjs +1 -1
  113. package/locale/ja.js +1 -1
  114. package/locale/ja.min.js +1 -1
  115. package/locale/ja.min.mjs +1 -1
  116. package/locale/ja.mjs +1 -1
  117. package/locale/ko.js +1 -1
  118. package/locale/ko.min.js +1 -1
  119. package/locale/ko.min.mjs +1 -1
  120. package/locale/ko.mjs +1 -1
  121. package/locale/zh-cn.js +1 -1
  122. package/locale/zh-cn.min.js +1 -1
  123. package/locale/zh-cn.min.mjs +1 -1
  124. package/locale/zh-cn.mjs +1 -1
  125. package/locale/zh-tw.js +1 -1
  126. package/locale/zh-tw.min.js +1 -1
  127. package/locale/zh-tw.min.mjs +1 -1
  128. package/locale/zh-tw.mjs +1 -1
  129. package/package.json +1 -1
  130. package/theme-chalk/index.css +1 -1
  131. package/theme-chalk/plus-search.css +1 -1
  132. package/theme-chalk/plus-yc-ai-chat.css +1 -1
  133. package/theme-chalk/plus-yc-data-table.css +1 -1
  134. package/theme-chalk/plus-yc-property-table.css +1 -1
  135. package/theme-chalk/src/search.scss +93 -3
  136. package/theme-chalk/src/yc-ai-chat.scss +1281 -114
  137. package/theme-chalk/src/yc-data-table.scss +57 -42
  138. package/theme-chalk/src/yc-property-table.scss +35 -14
@@ -10,7 +10,10 @@ const _hoisted_1 = {
10
10
  key: 0,
11
11
  class: "yc-chat-studio__notices"
12
12
  };
13
- const _hoisted_2 = { class: "yc-chat-studio__topbar conversation-banner" };
13
+ const _hoisted_2 = {
14
+ key: 1,
15
+ class: "yc-chat-studio__topbar conversation-banner"
16
+ };
14
17
  const _hoisted_3 = { class: "yc-chat-studio__left" };
15
18
  const _hoisted_4 = ["aria-label", "title"];
16
19
  const _hoisted_5 = {
@@ -30,6 +33,7 @@ const _hoisted_8 = {
30
33
  };
31
34
  const _hoisted_9 = ["data-testid", "onClick"];
32
35
  const _hoisted_10 = {
36
+ key: 1,
33
37
  class: "yc-chat-studio__segmented",
34
38
  role: "tablist",
35
39
  "aria-label": "\u7EC8\u7AEF\u9884\u89C8\u5207\u6362"
@@ -37,20 +41,41 @@ const _hoisted_10 = {
37
41
  const _hoisted_11 = ["aria-selected"];
38
42
  const _hoisted_12 = ["aria-selected"];
39
43
  const _hoisted_13 = ["disabled"];
40
- const _hoisted_14 = {
41
- key: 1,
42
- class: "yc-chat-studio__web-body chat-workspace"
43
- };
44
+ const _hoisted_14 = ["aria-valuemin", "aria-valuemax", "aria-valuenow"];
44
45
  const _hoisted_15 = { class: "yc-chat-studio__main conversation-panel" };
45
46
  const _hoisted_16 = { class: "yc-chat-studio__stream-inner" };
46
47
  const _hoisted_17 = { class: "yc-chat-studio__composer-dock" };
47
48
  const _hoisted_18 = { class: "yc-chat-studio__composer-inner" };
48
49
  const _hoisted_19 = {
49
- key: 2,
50
50
  class: "yc-chat-studio__mobile-stage",
51
51
  "data-testid": "mobile-stage"
52
52
  };
53
53
  const _hoisted_20 = { class: "yc-chat-studio__mobile-canvas" };
54
+ const _hoisted_21 = {
55
+ class: "yc-chat-studio__mobile-native",
56
+ "data-testid": "mobile-native"
57
+ };
58
+ const _hoisted_22 = { class: "yc-chat-studio__mobile-header" };
59
+ const _hoisted_23 = {
60
+ key: 0,
61
+ class: "yc-chat-studio__mobile-badge"
62
+ };
63
+ const _hoisted_24 = { class: "yc-chat-studio__mobile-title-wrap" };
64
+ const _hoisted_25 = { class: "yc-chat-studio__mobile-title" };
65
+ const _hoisted_26 = {
66
+ key: 0,
67
+ class: "yc-chat-studio__mobile-sub"
68
+ };
69
+ const _hoisted_27 = { class: "yc-chat-studio__mobile-actions" };
70
+ const _hoisted_28 = ["disabled"];
71
+ const _hoisted_29 = {
72
+ key: 0,
73
+ class: "yc-chat-studio__mobile-toolbar",
74
+ "data-testid": "studio-context-bar"
75
+ };
76
+ const _hoisted_30 = { class: "yc-chat-studio__mobile-composer" };
77
+ const _hoisted_31 = { class: "yc-chat-studio__mobile-drawer" };
78
+ const DEFAULT_SIDEBAR_WIDTH = 280;
54
79
  var _sfc_main = /* @__PURE__ */ vue.defineComponent({
55
80
  ...{
56
81
  name: "YcChatStudio"
@@ -66,19 +91,132 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
66
91
  connected: { type: Boolean, default: false },
67
92
  refreshing: { type: Boolean, default: false },
68
93
  sessionCount: { default: 0 },
69
- caption: { default: "" }
94
+ caption: { default: "" },
95
+ accentColor: { default: "" },
96
+ showViewportSwitch: { type: Boolean, default: false },
97
+ deviceSimulator: { type: Boolean, default: false },
98
+ sidebarWidth: { default: DEFAULT_SIDEBAR_WIDTH },
99
+ sidebarMinWidth: { default: 200 },
100
+ sidebarMaxWidth: { default: 520 },
101
+ sidebarResizable: { type: Boolean, default: true }
70
102
  },
71
- emits: ["update:viewport", "update:deviceId", "refresh", "create"],
103
+ emits: ["update:viewport", "update:deviceId", "update:sidebarWidth", "refresh", "create"],
72
104
  setup(__props, { expose: __expose, emit: __emit }) {
73
105
  const props = __props;
74
106
  const emit = __emit;
75
107
  const sidebarCollapsed = vue.ref(false);
108
+ const mobileDrawerOpen = vue.ref(false);
109
+ const isResizingSidebar = vue.ref(false);
110
+ const webBodyRef = vue.ref(null);
111
+ const sidebarWrapRef = vue.ref(null);
76
112
  const webScrollRef = vue.ref(null);
77
113
  const mobileScrollRef = vue.ref(null);
78
114
  const mobileFrameRef = vue.ref(null);
115
+ function clampSidebarWidth(rawWidth) {
116
+ var _a;
117
+ const min = Math.max(160, props.sidebarMinWidth);
118
+ const bodyWidth = ((_a = webBodyRef.value) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
119
+ const dynamicMax = bodyWidth > 0 ? Math.max(min, Math.min(props.sidebarMaxWidth, Math.floor(bodyWidth * 0.6))) : Math.max(min, props.sidebarMaxWidth);
120
+ return Math.round(Math.min(dynamicMax, Math.max(min, rawWidth)));
121
+ }
122
+ const currentSidebarWidth = vue.ref(clampSidebarWidth(props.sidebarWidth));
123
+ vue.watch(
124
+ () => props.sidebarWidth,
125
+ (value) => {
126
+ if (typeof value === "number" && !Number.isNaN(value)) {
127
+ currentSidebarWidth.value = clampSidebarWidth(value);
128
+ }
129
+ }
130
+ );
131
+ const accentStyle = vue.computed(
132
+ () => props.accentColor ? { "--yc-chat-accent": props.accentColor } : void 0
133
+ );
134
+ const sidebarInlineStyle = vue.computed(
135
+ () => sidebarCollapsed.value ? void 0 : { width: `${currentSidebarWidth.value}px` }
136
+ );
79
137
  const activeDevice = vue.computed(() => {
80
138
  return props.devices.find((item) => item.id === props.deviceId) || props.devices[0] || presets.YC_MOBILE_DEVICE_PRESETS[0];
81
139
  });
140
+ let cleanupResizeListeners = null;
141
+ function updateSidebarWidth(nextWidth) {
142
+ const clamped = clampSidebarWidth(nextWidth);
143
+ currentSidebarWidth.value = clamped;
144
+ emit("update:sidebarWidth", clamped);
145
+ }
146
+ function startSidebarResize(startX) {
147
+ var _a;
148
+ const measuredWidth = (_a = sidebarWrapRef.value) == null ? void 0 : _a.getBoundingClientRect().width;
149
+ const initialWidth = measuredWidth && measuredWidth > 0 ? measuredWidth : currentSidebarWidth.value;
150
+ cleanupResizeListeners == null ? void 0 : cleanupResizeListeners();
151
+ isResizingSidebar.value = true;
152
+ const prevCursor = typeof document !== "undefined" ? document.body.style.cursor : "";
153
+ const prevUserSelect = typeof document !== "undefined" ? document.body.style.userSelect : "";
154
+ if (typeof document !== "undefined") {
155
+ document.body.style.cursor = "col-resize";
156
+ document.body.style.userSelect = "none";
157
+ }
158
+ const handleMouseMove = (event) => {
159
+ updateSidebarWidth(initialWidth + (event.clientX - startX));
160
+ };
161
+ const handleTouchMove = (event) => {
162
+ const touch = event.touches[0];
163
+ if (!touch) return;
164
+ updateSidebarWidth(initialWidth + (touch.clientX - startX));
165
+ };
166
+ const stopResize = () => {
167
+ isResizingSidebar.value = false;
168
+ if (typeof document !== "undefined") {
169
+ document.body.style.cursor = prevCursor;
170
+ document.body.style.userSelect = prevUserSelect;
171
+ }
172
+ window.removeEventListener("mousemove", handleMouseMove);
173
+ window.removeEventListener("mouseup", stopResize);
174
+ window.removeEventListener("touchmove", handleTouchMove);
175
+ window.removeEventListener("touchend", stopResize);
176
+ window.removeEventListener("touchcancel", stopResize);
177
+ cleanupResizeListeners = null;
178
+ };
179
+ window.addEventListener("mousemove", handleMouseMove);
180
+ window.addEventListener("mouseup", stopResize);
181
+ window.addEventListener("touchmove", handleTouchMove, { passive: true });
182
+ window.addEventListener("touchend", stopResize);
183
+ window.addEventListener("touchcancel", stopResize);
184
+ cleanupResizeListeners = stopResize;
185
+ }
186
+ function handleResizerMouseDown(event) {
187
+ if (event.button !== 0 || !props.sidebarResizable || sidebarCollapsed.value) return;
188
+ event.preventDefault();
189
+ startSidebarResize(event.clientX);
190
+ }
191
+ function handleResizerTouchStart(event) {
192
+ if (!props.sidebarResizable || sidebarCollapsed.value) return;
193
+ const touch = event.touches[0];
194
+ if (!touch) return;
195
+ startSidebarResize(touch.clientX);
196
+ }
197
+ function resetSidebarWidth() {
198
+ if (!props.sidebarResizable) return;
199
+ updateSidebarWidth(DEFAULT_SIDEBAR_WIDTH);
200
+ }
201
+ function handleResizerKeydown(event) {
202
+ if (!props.sidebarResizable || sidebarCollapsed.value) return;
203
+ if (event.key === "ArrowLeft") {
204
+ event.preventDefault();
205
+ updateSidebarWidth(currentSidebarWidth.value - 16);
206
+ } else if (event.key === "ArrowRight") {
207
+ event.preventDefault();
208
+ updateSidebarWidth(currentSidebarWidth.value + 16);
209
+ } else if (event.key === "Home") {
210
+ event.preventDefault();
211
+ updateSidebarWidth(props.sidebarMinWidth);
212
+ } else if (event.key === "End") {
213
+ event.preventDefault();
214
+ updateSidebarWidth(props.sidebarMaxWidth);
215
+ }
216
+ }
217
+ vue.onBeforeUnmount(() => {
218
+ cleanupResizeListeners == null ? void 0 : cleanupResizeListeners();
219
+ });
82
220
  function switchViewport(mode) {
83
221
  if (mode === props.viewport) return;
84
222
  emit("update:viewport", mode);
@@ -99,6 +237,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
99
237
  }
100
238
  function closeMobileDrawer() {
101
239
  var _a;
240
+ mobileDrawerOpen.value = false;
102
241
  (_a = mobileFrameRef.value) == null ? void 0 : _a.closeDrawer();
103
242
  }
104
243
  __expose({
@@ -110,13 +249,21 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
110
249
  return vue.openBlock(), vue.createElementBlock(
111
250
  "div",
112
251
  {
113
- class: vue.normalizeClass(["yc-chat-studio tenant-chat-page", `is-${__props.viewport}`])
252
+ class: vue.normalizeClass(["yc-chat-studio tenant-chat-page", [
253
+ `is-${__props.viewport}`,
254
+ {
255
+ "is-simulator": __props.viewport === "mobile" && __props.deviceSimulator,
256
+ "is-resizing-sidebar": isResizingSidebar.value
257
+ }
258
+ ]]),
259
+ style: vue.normalizeStyle(accentStyle.value)
114
260
  },
115
261
  [
116
262
  _ctx.$slots.notice ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
117
263
  vue.renderSlot(_ctx.$slots, "notice")
118
264
  ])) : vue.createCommentVNode("v-if", true),
119
- vue.createElementVNode("header", _hoisted_2, [
265
+ vue.createCommentVNode(" Web \u7AEF\uFF08\u6216\u663E\u5F0F\u5F00\u542F\u5916\u90E8\u6A21\u62DF\u5668\u65F6\uFF09\u9876\u90E8\u680F "),
266
+ __props.viewport === "web" || __props.deviceSimulator ? (vue.openBlock(), vue.createElementBlock("header", _hoisted_2, [
120
267
  vue.createElementVNode("div", _hoisted_3, [
121
268
  __props.viewport === "web" ? (vue.openBlock(), vue.createElementBlock("button", {
122
269
  key: 0,
@@ -125,7 +272,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
125
272
  "aria-label": sidebarCollapsed.value ? "\u5C55\u5F00\u4F1A\u8BDD\u4FA7\u680F" : "\u6536\u8D77\u4F1A\u8BDD\u4FA7\u680F",
126
273
  title: sidebarCollapsed.value ? "\u5C55\u5F00\u4F1A\u8BDD\u4FA7\u680F" : "\u6536\u8D77\u4F1A\u8BDD\u4FA7\u680F",
127
274
  onClick: _cache[0] || (_cache[0] = ($event) => sidebarCollapsed.value = !sidebarCollapsed.value)
128
- }, [..._cache[6] || (_cache[6] = [
275
+ }, [..._cache[8] || (_cache[8] = [
129
276
  vue.createElementVNode(
130
277
  "svg",
131
278
  {
@@ -161,7 +308,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
161
308
  ])) : vue.createCommentVNode("v-if", true)
162
309
  ]),
163
310
  vue.createElementVNode("div", _hoisted_7, [
164
- __props.viewport === "mobile" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
311
+ __props.viewport === "mobile" && __props.deviceSimulator ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
165
312
  (vue.openBlock(true), vue.createElementBlock(
166
313
  vue.Fragment,
167
314
  null,
@@ -178,7 +325,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
178
325
  /* KEYED_FRAGMENT */
179
326
  ))
180
327
  ])) : vue.createCommentVNode("v-if", true),
181
- vue.createElementVNode("div", _hoisted_10, [
328
+ __props.showViewportSwitch ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
182
329
  vue.createElementVNode("button", {
183
330
  type: "button",
184
331
  role: "tab",
@@ -186,7 +333,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
186
333
  "data-testid": "viewport-web",
187
334
  class: vue.normalizeClass(["yc-chat-studio__segment-btn", { "is-active": __props.viewport === "web" }]),
188
335
  onClick: _cache[1] || (_cache[1] = ($event) => switchViewport("web"))
189
- }, [..._cache[7] || (_cache[7] = [
336
+ }, [..._cache[9] || (_cache[9] = [
190
337
  vue.createElementVNode(
191
338
  "svg",
192
339
  {
@@ -229,7 +376,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
229
376
  "data-testid": "viewport-mobile",
230
377
  class: vue.normalizeClass(["yc-chat-studio__segment-btn", { "is-active": __props.viewport === "mobile" }]),
231
378
  onClick: _cache[2] || (_cache[2] = ($event) => switchViewport("mobile"))
232
- }, [..._cache[8] || (_cache[8] = [
379
+ }, [..._cache[10] || (_cache[10] = [
233
380
  vue.createElementVNode(
234
381
  "svg",
235
382
  {
@@ -265,7 +412,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
265
412
  /* CACHED */
266
413
  )
267
414
  ])], 10, _hoisted_12)
268
- ]),
415
+ ])) : vue.createCommentVNode("v-if", true),
269
416
  vue.createElementVNode("button", {
270
417
  type: "button",
271
418
  class: "yc-chat-studio__ghost-btn",
@@ -281,7 +428,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
281
428
  class: vue.normalizeClass({ "is-spinning": __props.refreshing }),
282
429
  "aria-hidden": "true"
283
430
  },
284
- [..._cache[9] || (_cache[9] = [
431
+ [..._cache[11] || (_cache[11] = [
285
432
  vue.createElementVNode(
286
433
  "path",
287
434
  {
@@ -299,7 +446,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
299
446
  2
300
447
  /* CLASS */
301
448
  )),
302
- _cache[10] || (_cache[10] = vue.createElementVNode(
449
+ _cache[12] || (_cache[12] = vue.createElementVNode(
303
450
  "span",
304
451
  null,
305
452
  "\u5237\u65B0",
@@ -308,85 +455,305 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
308
455
  ))
309
456
  ], 8, _hoisted_13)
310
457
  ])
311
- ]),
312
- __props.viewport === "web" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
313
- vue.createElementVNode(
314
- "div",
315
- {
316
- class: vue.normalizeClass(["yc-chat-studio__sidebar-wrap", { "is-collapsed": sidebarCollapsed.value }])
317
- },
318
- [
319
- vue.renderSlot(_ctx.$slots, "sidebar")
320
- ],
321
- 2
322
- /* CLASS */
323
- ),
324
- vue.createElementVNode("section", _hoisted_15, [
458
+ ])) : vue.createCommentVNode("v-if", true),
459
+ vue.createCommentVNode(" Web \u7AEF\uFF1A\u684C\u9762\u53CC\u680F\u5DE5\u4F5C\u53F0\uFF08\u5DE6\u4FA7\u53EF\u6298\u53E0\u4E14\u652F\u6301\u5DE6\u53F3\u62D6\u62FD\u8C03\u5BBD\u7684\u4F1A\u8BDD\u4FA7\u680F + \u53F3\u4FA7\u4E3B\u5BF9\u8BDD\u533A\uFF09 "),
460
+ __props.viewport === "web" ? (vue.openBlock(), vue.createElementBlock(
461
+ "div",
462
+ {
463
+ key: 2,
464
+ ref_key: "webBodyRef",
465
+ ref: webBodyRef,
466
+ class: "yc-chat-studio__web-body chat-workspace"
467
+ },
468
+ [
325
469
  vue.createElementVNode(
326
470
  "div",
327
471
  {
328
- ref_key: "webScrollRef",
329
- ref: webScrollRef,
330
- class: "yc-chat-studio__stream message-viewport"
472
+ ref_key: "sidebarWrapRef",
473
+ ref: sidebarWrapRef,
474
+ class: vue.normalizeClass(["yc-chat-studio__sidebar-wrap", { "is-collapsed": sidebarCollapsed.value, "is-resizing": isResizingSidebar.value }]),
475
+ style: vue.normalizeStyle(sidebarInlineStyle.value)
331
476
  },
332
477
  [
333
- vue.createElementVNode("div", _hoisted_16, [
334
- vue.renderSlot(_ctx.$slots, "messages")
335
- ])
478
+ vue.renderSlot(_ctx.$slots, "sidebar")
336
479
  ],
337
- 512
338
- /* NEED_PATCH */
480
+ 6
481
+ /* CLASS, STYLE */
339
482
  ),
340
- vue.createElementVNode("div", _hoisted_17, [
341
- vue.createElementVNode("div", _hoisted_18, [
342
- vue.renderSlot(_ctx.$slots, "composer")
483
+ __props.sidebarResizable && !sidebarCollapsed.value ? (vue.openBlock(), vue.createElementBlock("div", {
484
+ key: 0,
485
+ class: vue.normalizeClass(["yc-chat-studio__sidebar-resizer", { "is-active": isResizingSidebar.value }]),
486
+ "data-testid": "sidebar-resizer",
487
+ role: "separator",
488
+ tabindex: "0",
489
+ "aria-label": "\u5DE6\u53F3\u62D6\u62FD\u8C03\u6574\u4F1A\u8BDD\u5217\u8868\u5BBD\u5EA6",
490
+ "aria-orientation": "vertical",
491
+ "aria-valuemin": __props.sidebarMinWidth,
492
+ "aria-valuemax": __props.sidebarMaxWidth,
493
+ "aria-valuenow": currentSidebarWidth.value,
494
+ title: "\u5DE6\u53F3\u62D6\u62FD\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",
495
+ onMousedown: handleResizerMouseDown,
496
+ onTouchstart: handleResizerTouchStart,
497
+ onDblclick: resetSidebarWidth,
498
+ onKeydown: handleResizerKeydown
499
+ }, [..._cache[13] || (_cache[13] = [
500
+ vue.createElementVNode(
501
+ "span",
502
+ {
503
+ class: "yc-chat-studio__sidebar-resizer-line",
504
+ "aria-hidden": "true"
505
+ },
506
+ null,
507
+ -1
508
+ /* CACHED */
509
+ )
510
+ ])], 42, _hoisted_14)) : vue.createCommentVNode("v-if", true),
511
+ vue.createElementVNode("section", _hoisted_15, [
512
+ vue.createElementVNode(
513
+ "div",
514
+ {
515
+ ref_key: "webScrollRef",
516
+ ref: webScrollRef,
517
+ class: "yc-chat-studio__stream message-viewport"
518
+ },
519
+ [
520
+ vue.createElementVNode("div", _hoisted_16, [
521
+ vue.renderSlot(_ctx.$slots, "messages")
522
+ ])
523
+ ],
524
+ 512
525
+ /* NEED_PATCH */
526
+ ),
527
+ vue.createElementVNode("div", _hoisted_17, [
528
+ vue.createElementVNode("div", _hoisted_18, [
529
+ vue.renderSlot(_ctx.$slots, "composer")
530
+ ])
343
531
  ])
344
532
  ])
345
- ])
346
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
347
- vue.createElementVNode("div", _hoisted_20, [
348
- vue.createVNode(mobileFrame_vue_vue_type_script_setup_true_lang.default, {
349
- ref_key: "mobileFrameRef",
350
- ref: mobileFrameRef,
351
- device: activeDevice.value,
352
- "agent-name": __props.agentName,
353
- status: __props.status,
354
- "status-label": __props.statusLabel,
355
- connected: __props.connected,
356
- "session-count": __props.sessionCount,
357
- caption: __props.caption,
358
- onCreate: _cache[4] || (_cache[4] = ($event) => emit("create")),
359
- onRefresh: _cache[5] || (_cache[5] = ($event) => emit("refresh"))
360
- }, {
361
- drawer: vue.withCtx(() => [
362
- vue.renderSlot(_ctx.$slots, "sidebar")
533
+ ],
534
+ 512
535
+ /* NEED_PATCH */
536
+ )) : __props.deviceSimulator ? (vue.openBlock(), vue.createElementBlock(
537
+ vue.Fragment,
538
+ { key: 3 },
539
+ [
540
+ vue.createCommentVNode(" Mobile \u7AEF\uFF08\u6A21\u62DF\u5668\u6A21\u5F0F\uFF0C\u517C\u5BB9\u663E\u5F0F\u4F20 deviceSimulator=true\uFF09 "),
541
+ vue.createElementVNode("div", _hoisted_19, [
542
+ vue.createElementVNode("div", _hoisted_20, [
543
+ vue.createVNode(mobileFrame_vue_vue_type_script_setup_true_lang.default, {
544
+ ref_key: "mobileFrameRef",
545
+ ref: mobileFrameRef,
546
+ device: activeDevice.value,
547
+ "agent-name": __props.agentName,
548
+ status: __props.status,
549
+ "status-label": __props.statusLabel,
550
+ connected: __props.connected,
551
+ "session-count": __props.sessionCount,
552
+ caption: __props.caption,
553
+ onCreate: _cache[4] || (_cache[4] = ($event) => emit("create")),
554
+ onRefresh: _cache[5] || (_cache[5] = ($event) => emit("refresh"))
555
+ }, {
556
+ drawer: vue.withCtx(() => [
557
+ vue.renderSlot(_ctx.$slots, "sidebar")
558
+ ]),
559
+ footer: vue.withCtx(() => [
560
+ vue.renderSlot(_ctx.$slots, "composer")
561
+ ]),
562
+ default: vue.withCtx(() => [
563
+ vue.createElementVNode(
564
+ "div",
565
+ {
566
+ ref_key: "mobileScrollRef",
567
+ ref: mobileScrollRef,
568
+ class: "yc-chat-studio__mobile-stream message-viewport"
569
+ },
570
+ [
571
+ vue.renderSlot(_ctx.$slots, "messages")
572
+ ],
573
+ 512
574
+ /* NEED_PATCH */
575
+ )
576
+ ]),
577
+ _: 3
578
+ /* FORWARDED */
579
+ }, 8, ["device", "agent-name", "status", "status-label", "connected", "session-count", "caption"])
580
+ ])
581
+ ])
582
+ ],
583
+ 2112
584
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
585
+ )) : (vue.openBlock(), vue.createElementBlock(
586
+ vue.Fragment,
587
+ { key: 4 },
588
+ [
589
+ vue.createCommentVNode(" Mobile \u7AEF\uFF08\u539F\u751F H5 \u5F62\u6001\uFF1A\u9876\u90E8\u6C49\u5821\u62BD\u5C49\u5BFC\u822A + \u5168\u5BBD\u6D88\u606F\u6D41 + \u8D34\u5E95\u7D27\u51D1\u8F93\u5165\u533A\uFF09 "),
590
+ vue.createElementVNode("div", _hoisted_21, [
591
+ vue.createElementVNode("header", _hoisted_22, [
592
+ vue.createElementVNode("button", {
593
+ type: "button",
594
+ class: "yc-chat-studio__icon-btn",
595
+ "aria-label": "\u6253\u5F00\u4F1A\u8BDD\u62BD\u5C49",
596
+ "data-testid": "mobile-drawer-trigger",
597
+ onClick: _cache[6] || (_cache[6] = ($event) => mobileDrawerOpen.value = true)
598
+ }, [
599
+ _cache[14] || (_cache[14] = vue.createElementVNode(
600
+ "svg",
601
+ {
602
+ viewBox: "0 0 16 16",
603
+ fill: "none",
604
+ "aria-hidden": "true"
605
+ },
606
+ [
607
+ vue.createElementVNode("path", {
608
+ d: "M2.5 4.25H13.5M2.5 8H10.5M2.5 11.75H13.5",
609
+ stroke: "currentColor",
610
+ "stroke-width": "1.45",
611
+ "stroke-linecap": "round"
612
+ })
613
+ ],
614
+ -1
615
+ /* CACHED */
616
+ )),
617
+ __props.sessionCount > 0 ? (vue.openBlock(), vue.createElementBlock(
618
+ "span",
619
+ _hoisted_23,
620
+ vue.toDisplayString(__props.sessionCount > 99 ? "99+" : __props.sessionCount),
621
+ 1
622
+ /* TEXT */
623
+ )) : vue.createCommentVNode("v-if", true)
624
+ ]),
625
+ vue.createElementVNode("div", _hoisted_24, [
626
+ vue.createElementVNode(
627
+ "span",
628
+ _hoisted_25,
629
+ vue.toDisplayString(__props.agentName || "\u5BF9\u8BDD"),
630
+ 1
631
+ /* TEXT */
632
+ ),
633
+ __props.statusLabel ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_26, [
634
+ vue.createElementVNode(
635
+ "span",
636
+ {
637
+ class: vue.normalizeClass(["yc-chat-studio__mobile-dot", `is-${__props.status}`])
638
+ },
639
+ null,
640
+ 2
641
+ /* CLASS */
642
+ ),
643
+ vue.createElementVNode(
644
+ "span",
645
+ null,
646
+ vue.toDisplayString(__props.statusLabel),
647
+ 1
648
+ /* TEXT */
649
+ )
650
+ ])) : vue.createCommentVNode("v-if", true)
651
+ ]),
652
+ vue.createElementVNode("div", _hoisted_27, [
653
+ vue.createElementVNode("button", {
654
+ type: "button",
655
+ class: "yc-chat-studio__icon-btn",
656
+ "aria-label": "\u65B0\u5EFA\u4F1A\u8BDD",
657
+ disabled: !__props.connected,
658
+ onClick: _cache[7] || (_cache[7] = ($event) => emit("create"))
659
+ }, [..._cache[15] || (_cache[15] = [
660
+ vue.createElementVNode(
661
+ "svg",
662
+ {
663
+ viewBox: "0 0 16 16",
664
+ fill: "none",
665
+ "aria-hidden": "true"
666
+ },
667
+ [
668
+ vue.createElementVNode("path", {
669
+ d: "M8 3.25V12.75M3.25 8H12.75",
670
+ stroke: "currentColor",
671
+ "stroke-width": "1.5",
672
+ "stroke-linecap": "round"
673
+ })
674
+ ],
675
+ -1
676
+ /* CACHED */
677
+ )
678
+ ])], 8, _hoisted_28)
679
+ ])
363
680
  ]),
364
- footer: vue.withCtx(() => [
681
+ _ctx.$slots.toolbar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_29, [
682
+ vue.renderSlot(_ctx.$slots, "toolbar")
683
+ ])) : vue.createCommentVNode("v-if", true),
684
+ vue.createElementVNode(
685
+ "div",
686
+ {
687
+ ref_key: "mobileScrollRef",
688
+ ref: mobileScrollRef,
689
+ class: "yc-chat-studio__mobile-stream message-viewport"
690
+ },
691
+ [
692
+ vue.renderSlot(_ctx.$slots, "messages")
693
+ ],
694
+ 512
695
+ /* NEED_PATCH */
696
+ ),
697
+ vue.createElementVNode("div", _hoisted_30, [
365
698
  vue.renderSlot(_ctx.$slots, "composer")
366
699
  ]),
367
- default: vue.withCtx(() => [
368
- vue.createElementVNode(
369
- "div",
370
- {
371
- ref_key: "mobileScrollRef",
372
- ref: mobileScrollRef,
373
- class: "yc-chat-studio__mobile-stream message-viewport"
374
- },
375
- [
376
- vue.renderSlot(_ctx.$slots, "messages")
377
- ],
378
- 512
379
- /* NEED_PATCH */
380
- )
381
- ]),
382
- _: 3
383
- /* FORWARDED */
384
- }, 8, ["device", "agent-name", "status", "status-label", "connected", "session-count", "caption"])
385
- ])
386
- ]))
700
+ mobileDrawerOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
701
+ key: 1,
702
+ class: "yc-chat-studio__mobile-drawer-mask",
703
+ "data-testid": "mobile-drawer",
704
+ onClick: vue.withModifiers(closeMobileDrawer, ["self"])
705
+ }, [
706
+ vue.createElementVNode("aside", _hoisted_31, [
707
+ vue.createElementVNode("div", { class: "yc-chat-studio__mobile-drawer-top" }, [
708
+ _cache[17] || (_cache[17] = vue.createElementVNode(
709
+ "span",
710
+ null,
711
+ "\u5386\u53F2\u4F1A\u8BDD",
712
+ -1
713
+ /* CACHED */
714
+ )),
715
+ vue.createElementVNode("button", {
716
+ type: "button",
717
+ class: "yc-chat-studio__icon-btn",
718
+ "aria-label": "\u5173\u95ED\u4F1A\u8BDD\u62BD\u5C49",
719
+ onClick: closeMobileDrawer
720
+ }, [..._cache[16] || (_cache[16] = [
721
+ vue.createElementVNode(
722
+ "svg",
723
+ {
724
+ viewBox: "0 0 16 16",
725
+ fill: "none",
726
+ "aria-hidden": "true"
727
+ },
728
+ [
729
+ vue.createElementVNode("path", {
730
+ d: "M4 4L12 12M12 4L4 12",
731
+ stroke: "currentColor",
732
+ "stroke-width": "1.5",
733
+ "stroke-linecap": "round"
734
+ })
735
+ ],
736
+ -1
737
+ /* CACHED */
738
+ )
739
+ ])])
740
+ ]),
741
+ vue.createElementVNode("div", {
742
+ class: "yc-chat-studio__mobile-drawer-body",
743
+ onClick: closeMobileDrawer
744
+ }, [
745
+ vue.renderSlot(_ctx.$slots, "sidebar")
746
+ ])
747
+ ])
748
+ ])) : vue.createCommentVNode("v-if", true)
749
+ ])
750
+ ],
751
+ 2112
752
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
753
+ ))
387
754
  ],
388
- 2
389
- /* CLASS */
755
+ 6
756
+ /* CLASS, STYLE */
390
757
  );
391
758
  };
392
759
  }