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