yc-agent-ui 1.2.0 → 1.2.2
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-form/index.d.ts +4 -4
- package/es/components/dialog-form/src/index.vue.d.ts +4 -4
- package/es/components/display-item/index.d.ts +15 -15
- package/es/components/display-item/src/index.vue.d.ts +13 -13
- package/es/components/drawer-form/index.d.ts +4 -4
- package/es/components/drawer-form/src/index.vue.d.ts +4 -4
- package/es/components/form/index.d.ts +8 -8
- package/es/components/form/src/form-content.vue.d.ts +8 -8
- package/es/components/form/src/index.vue.d.ts +8 -8
- package/es/components/form-item/index.d.ts +6 -6
- package/es/components/form-item/src/index.vue.d.ts +6 -6
- package/es/components/page/index.d.ts +172 -172
- package/es/components/page/src/index.vue.d.ts +60 -60
- package/es/components/search/index.d.ts +52 -52
- package/es/components/search/src/index.vue.d.ts +20 -20
- package/es/components/table/src/table-column.vue.d.ts +34 -34
- package/es/components/yc-ai-chat/index.d.ts +1 -0
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +2 -0
- package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +2 -0
- package/es/components/yc-ai-chat/src/select.vue.d.ts +1 -0
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +1 -0
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +15 -1
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +5 -1
- package/es/components/yc-ai-chat/src/welcome.vue.d.ts +11 -1
- package/es/components/yc-plus-page/src/index.vue.d.ts +176 -176
- package/es/hooks/usePlusFormReset.d.ts +48 -48
- package/es/index.css +9 -9
- 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 +24 -15
- package/es/packages/components/yc-ai-chat/src/mobile-frame2.vue.mjs +34 -31
- package/es/packages/components/yc-ai-chat/src/presets.mjs +1 -1
- package/es/packages/components/yc-ai-chat/src/select2.vue.mjs +9 -4
- package/es/packages/components/yc-ai-chat/src/sender2.vue.mjs +20 -17
- package/es/packages/components/yc-ai-chat/src/sidebar2.vue.mjs +89 -56
- package/es/packages/components/yc-ai-chat/src/studio2.vue.mjs +304 -119
- package/es/packages/components/yc-ai-chat/src/welcome2.vue.mjs +22 -40
- 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 +4093 -824
- package/index.min.js +42 -39
- package/index.min.mjs +39 -36
- package/index.mjs +4169 -910
- 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-form/index.d.ts +4 -4
- package/lib/components/dialog-form/src/index.vue.d.ts +4 -4
- package/lib/components/display-item/index.d.ts +15 -15
- package/lib/components/display-item/src/index.vue.d.ts +13 -13
- package/lib/components/drawer-form/index.d.ts +4 -4
- package/lib/components/drawer-form/src/index.vue.d.ts +4 -4
- package/lib/components/form/index.d.ts +8 -8
- package/lib/components/form/src/form-content.vue.d.ts +8 -8
- package/lib/components/form/src/index.vue.d.ts +8 -8
- package/lib/components/form-item/index.d.ts +6 -6
- package/lib/components/form-item/src/index.vue.d.ts +6 -6
- package/lib/components/page/index.d.ts +172 -172
- package/lib/components/page/src/index.vue.d.ts +60 -60
- package/lib/components/search/index.d.ts +52 -52
- package/lib/components/search/src/index.vue.d.ts +20 -20
- package/lib/components/table/src/table-column.vue.d.ts +34 -34
- package/lib/components/yc-ai-chat/index.d.ts +1 -0
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +2 -0
- package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +2 -0
- package/lib/components/yc-ai-chat/src/select.vue.d.ts +1 -0
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +1 -0
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +15 -1
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +5 -1
- package/lib/components/yc-ai-chat/src/welcome.vue.d.ts +11 -1
- package/lib/components/yc-plus-page/src/index.vue.d.ts +176 -176
- package/lib/hooks/usePlusFormReset.d.ts +48 -48
- package/lib/index.css +11 -11
- 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 +24 -15
- package/lib/packages/components/yc-ai-chat/src/mobile-frame2.vue.js +34 -31
- package/lib/packages/components/yc-ai-chat/src/presets.js +1 -1
- package/lib/packages/components/yc-ai-chat/src/select2.vue.js +9 -4
- package/lib/packages/components/yc-ai-chat/src/sender2.vue.js +20 -17
- package/lib/packages/components/yc-ai-chat/src/sidebar2.vue.js +88 -55
- package/lib/packages/components/yc-ai-chat/src/studio2.vue.js +303 -118
- package/lib/packages/components/yc-ai-chat/src/welcome2.vue.js +21 -39
- 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 +785 -18
- package/theme-chalk/src/yc-data-table.scss +57 -42
- package/theme-chalk/src/yc-property-table.scss +35 -14
|
@@ -25,8 +25,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
colors: {},
|
|
26
26
|
options: {}
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
emits: ["resize"],
|
|
29
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
29
30
|
const props = __props;
|
|
31
|
+
const emit = __emit;
|
|
30
32
|
const chartRef = ref(null);
|
|
31
33
|
const chartInstance = shallowRef(null);
|
|
32
34
|
let resizeObserver = null;
|
|
@@ -86,9 +88,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
88
|
if (!chartInstance.value || !options) return;
|
|
87
89
|
chartInstance.value.setOption(options, true);
|
|
88
90
|
};
|
|
91
|
+
const reportSize = () => {
|
|
92
|
+
if (!chartRef.value) return;
|
|
93
|
+
const width = chartRef.value.clientWidth;
|
|
94
|
+
const height = chartRef.value.clientHeight;
|
|
95
|
+
if (width > 0) {
|
|
96
|
+
emit("resize", { width, height });
|
|
97
|
+
}
|
|
98
|
+
};
|
|
89
99
|
const resize = () => {
|
|
90
100
|
var _a;
|
|
91
101
|
(_a = chartInstance.value) == null ? void 0 : _a.resize();
|
|
102
|
+
reportSize();
|
|
92
103
|
};
|
|
93
104
|
watch(
|
|
94
105
|
() => props.options,
|
|
@@ -117,6 +128,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
128
|
);
|
|
118
129
|
onMounted(() => {
|
|
119
130
|
initChart();
|
|
131
|
+
reportSize();
|
|
120
132
|
if (chartRef.value && typeof ResizeObserver !== "undefined") {
|
|
121
133
|
resizeObserver = new ResizeObserver(() => {
|
|
122
134
|
resize();
|
|
@@ -119,8 +119,9 @@ function buildShadcnTooltipFormatter(isDark) {
|
|
|
119
119
|
`;
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function buildEChartsOption(props, isDark) {
|
|
122
|
+
function buildEChartsOption(props, isDark, containerWidth) {
|
|
123
123
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga;
|
|
124
|
+
const isCompact = typeof containerWidth === "number" && containerWidth > 0 && containerWidth < 420;
|
|
124
125
|
const chartType = props.type || "area";
|
|
125
126
|
const data = props.data || [];
|
|
126
127
|
const categoryKey = props.categoryKey || "date";
|
|
@@ -160,11 +161,11 @@ function buildEChartsOption(props, isDark) {
|
|
|
160
161
|
const hasLegend = props.showLegend !== false;
|
|
161
162
|
const hasCenterContent = isDonut && (props.centerValue !== void 0 || Boolean(props.centerLabel));
|
|
162
163
|
const innerRadius = (_a = props.innerRadius) != null ? _a : isDonut ? "52%" : isRose ? "15%" : "0%";
|
|
163
|
-
const defaultOuterRadius = hasLegend ? "70%" : "80%";
|
|
164
|
-
const outerRadius = ((_b = props.pieConfig) == null ? void 0 : _b.radius) ? Array.isArray(props.pieConfig.radius) ? props.pieConfig.radius[1] : props.pieConfig.radius : isPieSimple ? "58%" : defaultOuterRadius;
|
|
165
|
-
const isVerticalLegend = ((_c = props.pieConfig) == null ? void 0 : _c.legendOrient) === "vertical" || props.legendPosition === "left" || ((_d = props.pieConfig) == null ? void 0 : _d.legendAlign) === "left";
|
|
166
|
-
const pieCenterX = ((_e = props.pieConfig) == null ? void 0 : _e.center) ? props.pieConfig.center[0] : isVerticalLegend ? "58%" : "50%";
|
|
167
|
-
const pieCenterY = ((_f = props.pieConfig) == null ? void 0 : _f.center) ? props.pieConfig.center[1] : isVerticalLegend ? "50%" : hasLegend ? "44%" : hasCenterContent ? "48%" : "50%";
|
|
164
|
+
const defaultOuterRadius = isCompact ? isRose ? "56%" : "58%" : hasLegend ? "70%" : "80%";
|
|
165
|
+
const outerRadius = ((_b = props.pieConfig) == null ? void 0 : _b.radius) ? Array.isArray(props.pieConfig.radius) ? props.pieConfig.radius[1] : props.pieConfig.radius : isPieSimple ? isCompact ? "54%" : "58%" : defaultOuterRadius;
|
|
166
|
+
const isVerticalLegend = !isCompact && (((_c = props.pieConfig) == null ? void 0 : _c.legendOrient) === "vertical" || props.legendPosition === "left" || ((_d = props.pieConfig) == null ? void 0 : _d.legendAlign) === "left");
|
|
167
|
+
const pieCenterX = isCompact ? "50%" : ((_e = props.pieConfig) == null ? void 0 : _e.center) ? props.pieConfig.center[0] : isVerticalLegend ? "58%" : "50%";
|
|
168
|
+
const pieCenterY = isCompact ? hasLegend ? "38%" : "50%" : ((_f = props.pieConfig) == null ? void 0 : _f.center) ? props.pieConfig.center[1] : isVerticalLegend ? "50%" : hasLegend ? "44%" : hasCenterContent ? "48%" : "50%";
|
|
168
169
|
const centerValueText = props.centerValue !== void 0 ? formatChartValue(props.centerValue) : "";
|
|
169
170
|
const centerLabelText = props.centerLabel || "";
|
|
170
171
|
const pieSeriesData = data.map((item, idx) => {
|
|
@@ -186,10 +187,12 @@ function buildEChartsOption(props, isDark) {
|
|
|
186
187
|
color: colors,
|
|
187
188
|
tooltip: {
|
|
188
189
|
trigger: "item",
|
|
190
|
+
confine: true,
|
|
189
191
|
backgroundColor: "transparent",
|
|
190
192
|
borderWidth: 0,
|
|
191
193
|
padding: 0,
|
|
192
194
|
shadowBlur: 0,
|
|
195
|
+
extraCssText: "z-index: 99;",
|
|
193
196
|
formatter: buildShadcnTooltipFormatter(isDark)
|
|
194
197
|
},
|
|
195
198
|
legend: hasLegend ? isVerticalLegend ? {
|
|
@@ -221,7 +224,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
221
224
|
name: props.title || "\u6570\u636E\u5206\u5E03",
|
|
222
225
|
type: "pie",
|
|
223
226
|
roseType: isRose ? props.roseType || "radius" : void 0,
|
|
224
|
-
radius: isPieSimple ? ((_h = props.pieConfig) == null ? void 0 : _h.radius) || "58%" : [innerRadius, outerRadius],
|
|
227
|
+
radius: isPieSimple ? isCompact ? "54%" : ((_h = props.pieConfig) == null ? void 0 : _h.radius) || "58%" : [innerRadius, outerRadius],
|
|
225
228
|
center: [pieCenterX, pieCenterY],
|
|
226
229
|
avoidLabelOverlap: !hasCenterContent,
|
|
227
230
|
padAngle: isRose ? 2 : isPieSimple ? 1.5 : 3,
|
|
@@ -237,7 +240,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
237
240
|
{lbl|${centerLabelText}}` : centerValueText ? `{val|${centerValueText}}` : `{lbl|${centerLabelText}}`,
|
|
238
241
|
rich: {
|
|
239
242
|
val: {
|
|
240
|
-
fontSize: 20,
|
|
243
|
+
fontSize: isCompact ? 17 : 20,
|
|
241
244
|
fontWeight: 700,
|
|
242
245
|
lineHeight: 24,
|
|
243
246
|
align: "center",
|
|
@@ -253,14 +256,14 @@ function buildEChartsOption(props, isDark) {
|
|
|
253
256
|
}
|
|
254
257
|
}
|
|
255
258
|
} : {
|
|
256
|
-
show: !isDonut,
|
|
259
|
+
show: !isDonut && !isCompact,
|
|
257
260
|
position: ((_k = props.pieConfig) == null ? void 0 : _k.labelPosition) || "outside",
|
|
258
261
|
formatter: ((_l = props.pieConfig) == null ? void 0 : _l.labelFormatter) || (isPieSimple ? "{b}: {d}%" : void 0),
|
|
259
262
|
color: textMuted,
|
|
260
263
|
fontSize: 12
|
|
261
264
|
},
|
|
262
265
|
labelLine: {
|
|
263
|
-
show: !isDonut && ((_m = props.pieConfig) == null ? void 0 : _m.labelLine) !== false,
|
|
266
|
+
show: !isDonut && !isCompact && ((_m = props.pieConfig) == null ? void 0 : _m.labelLine) !== false,
|
|
264
267
|
length: 10,
|
|
265
268
|
length2: 8
|
|
266
269
|
},
|
|
@@ -319,6 +322,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
319
322
|
color: colors,
|
|
320
323
|
tooltip: {
|
|
321
324
|
trigger: "item",
|
|
325
|
+
confine: true,
|
|
322
326
|
backgroundColor: "transparent",
|
|
323
327
|
borderWidth: 0,
|
|
324
328
|
padding: 0
|
|
@@ -477,6 +481,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
477
481
|
color: colors,
|
|
478
482
|
tooltip: {
|
|
479
483
|
trigger: "item",
|
|
484
|
+
confine: true,
|
|
480
485
|
backgroundColor: "transparent",
|
|
481
486
|
borderWidth: 0,
|
|
482
487
|
padding: 0,
|
|
@@ -716,6 +721,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
716
721
|
] : void 0,
|
|
717
722
|
tooltip: {
|
|
718
723
|
trigger: "axis",
|
|
724
|
+
confine: true,
|
|
719
725
|
backgroundColor: "transparent",
|
|
720
726
|
borderWidth: 0,
|
|
721
727
|
padding: 0,
|
|
@@ -818,6 +824,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
818
824
|
return {
|
|
819
825
|
tooltip: {
|
|
820
826
|
trigger: "axis",
|
|
827
|
+
confine: true,
|
|
821
828
|
backgroundColor: "transparent",
|
|
822
829
|
borderWidth: 0,
|
|
823
830
|
padding: 0,
|
|
@@ -1042,6 +1049,7 @@ function buildEChartsOption(props, isDark) {
|
|
|
1042
1049
|
color: colors,
|
|
1043
1050
|
tooltip: {
|
|
1044
1051
|
trigger: "axis",
|
|
1052
|
+
confine: true,
|
|
1045
1053
|
axisPointer: {
|
|
1046
1054
|
type: chartType === "bar" ? "shadow" : "line",
|
|
1047
1055
|
lineStyle: {
|
|
@@ -51,6 +51,7 @@ export { default as YcChatStudio } from './yc-ai-chat/src/studio2.vue.mjs';
|
|
|
51
51
|
export { default as YcChatThinking } from './yc-ai-chat/src/thinking2.vue.mjs';
|
|
52
52
|
export { default as YcChatWelcome } from './yc-ai-chat/src/welcome2.vue.mjs';
|
|
53
53
|
export { default as YcMobileDeviceFrame } from './yc-ai-chat/src/mobile-frame2.vue.mjs';
|
|
54
|
+
export { Attachments, Bubble, BubbleList, Conversations, FilesCard, Prompts, Thinking, ThoughtChain, Welcome, XSender } from 'vue-element-plus-x';
|
|
54
55
|
export { COSS_TABLE_INJECTION_KEY } from './yc-coss-table/src/type.mjs';
|
|
55
56
|
export { DEFAULT_CDN_CONFIG, DEFAULT_YC_CONFIG, YC_CONFIG_KEY } from './yc-config-provider/src/type.mjs';
|
|
56
57
|
export { DEFAULT_OPERATORS, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS } from './yc-plus-page/src/constants.mjs';
|
|
@@ -8,6 +8,7 @@ export { default as YcChatSender } from './src/sender2.vue.mjs';
|
|
|
8
8
|
export { default as YcChatSelect } from './src/select2.vue.mjs';
|
|
9
9
|
export { default as YcMobileDeviceFrame } from './src/mobile-frame2.vue.mjs';
|
|
10
10
|
export { YC_MOBILE_DEVICE_PRESETS, formatChatFileSize, formatChatSessionTime, groupChatSessionByDate } from './src/presets.mjs';
|
|
11
|
+
export { Attachments, Bubble, BubbleList, Conversations, FilesCard, Prompts, Thinking, ThoughtChain, Welcome, XSender } from 'vue-element-plus-x';
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -47,6 +47,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
47
|
status: { default: "completed" },
|
|
48
48
|
metrics: { default: () => [] },
|
|
49
49
|
identifiers: { default: () => [] },
|
|
50
|
+
identifiersTitle: { default: "ID" },
|
|
50
51
|
canCopyContent: { type: Boolean, default: true },
|
|
51
52
|
compact: { type: Boolean, default: false }
|
|
52
53
|
},
|
|
@@ -124,7 +125,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
124
125
|
createElementVNode(
|
|
125
126
|
"summary",
|
|
126
127
|
_hoisted_7,
|
|
127
|
-
|
|
128
|
+
toDisplayString(__props.identifiersTitle) + " (" + toDisplayString(__props.identifiers.length) + ") ",
|
|
128
129
|
1
|
|
129
130
|
/* TEXT */
|
|
130
131
|
),
|
|
@@ -215,7 +216,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
215
216
|
-1
|
|
216
217
|
/* CACHED */
|
|
217
218
|
)),
|
|
218
|
-
!__props.compact ? (openBlock(), createElementBlock("span", _hoisted_13, "
|
|
219
|
+
!__props.compact ? (openBlock(), createElementBlock("span", _hoisted_13, "ID")) : createCommentVNode("v-if", true)
|
|
219
220
|
], 8, _hoisted_12)
|
|
220
221
|
])
|
|
221
222
|
],
|
|
@@ -229,26 +230,34 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
229
230
|
__props.role === "assistant" ? {
|
|
230
231
|
name: "avatar",
|
|
231
232
|
fn: withCtx(() => [
|
|
232
|
-
|
|
233
|
+
createElementVNode(
|
|
233
234
|
"div",
|
|
234
235
|
{
|
|
235
|
-
class: "yc-chat-bubble__avatar is-assistant",
|
|
236
|
+
class: normalizeClass(["yc-chat-bubble__avatar is-assistant", { "is-custom": Boolean(_ctx.$slots.avatar) }]),
|
|
236
237
|
"aria-hidden": "true"
|
|
237
238
|
},
|
|
238
239
|
[
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
240
|
+
renderSlot(_ctx.$slots, "avatar", {}, () => [
|
|
241
|
+
_cache[2] || (_cache[2] = createElementVNode(
|
|
242
|
+
"svg",
|
|
243
|
+
{
|
|
244
|
+
viewBox: "0 0 20 20",
|
|
245
|
+
fill: "none"
|
|
246
|
+
},
|
|
247
|
+
[
|
|
248
|
+
createElementVNode("path", {
|
|
249
|
+
d: "M10 3L11.6 8.4L17 10L11.6 11.6L10 17L8.4 11.6L3 10L8.4 8.4L10 3Z",
|
|
250
|
+
fill: "currentColor"
|
|
251
|
+
})
|
|
252
|
+
],
|
|
253
|
+
-1
|
|
254
|
+
/* CACHED */
|
|
255
|
+
))
|
|
247
256
|
])
|
|
248
257
|
],
|
|
249
|
-
|
|
250
|
-
/*
|
|
251
|
-
)
|
|
258
|
+
2
|
|
259
|
+
/* CLASS */
|
|
260
|
+
)
|
|
252
261
|
]),
|
|
253
262
|
key: "0"
|
|
254
263
|
} : void 0,
|
|
@@ -16,7 +16,14 @@ const _hoisted_10 = { class: "yc-mobile-device__viewport" };
|
|
|
16
16
|
const _hoisted_11 = { class: "yc-mobile-device__body" };
|
|
17
17
|
const _hoisted_12 = { class: "yc-mobile-device__footer" };
|
|
18
18
|
const _hoisted_13 = { class: "yc-mobile-device__drawer" };
|
|
19
|
-
const _hoisted_14 = { class: "yc-mobile-
|
|
19
|
+
const _hoisted_14 = { class: "yc-mobile-device__drawer-top" };
|
|
20
|
+
const _hoisted_15 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "yc-mobile-device__caption"
|
|
23
|
+
};
|
|
24
|
+
const _hoisted_16 = { key: 0 };
|
|
25
|
+
const _hoisted_17 = { key: 1 };
|
|
26
|
+
const _hoisted_18 = { key: 2 };
|
|
20
27
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
28
|
...{
|
|
22
29
|
name: "YcMobileDeviceFrame"
|
|
@@ -24,11 +31,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
31
|
__name: "mobile-frame",
|
|
25
32
|
props: {
|
|
26
33
|
device: {},
|
|
27
|
-
agentName: { default: "
|
|
34
|
+
agentName: { default: "" },
|
|
28
35
|
status: { default: "idle" },
|
|
29
|
-
statusLabel: { default: "
|
|
36
|
+
statusLabel: { default: "" },
|
|
30
37
|
connected: { type: Boolean, default: false },
|
|
31
|
-
sessionCount: { default: 0 }
|
|
38
|
+
sessionCount: { default: 0 },
|
|
39
|
+
caption: { default: "" },
|
|
40
|
+
drawerTitle: { default: "\u4F1A\u8BDD" }
|
|
32
41
|
},
|
|
33
42
|
emits: ["create", "refresh"],
|
|
34
43
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -53,7 +62,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
62
|
"data-device": __props.device.id
|
|
54
63
|
}, [
|
|
55
64
|
createElementVNode("div", _hoisted_2, [
|
|
56
|
-
_cache[
|
|
65
|
+
_cache[5] || (_cache[5] = 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)),
|
|
57
66
|
createElementVNode("header", _hoisted_3, [
|
|
58
67
|
createElementVNode("button", {
|
|
59
68
|
type: "button",
|
|
@@ -92,7 +101,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
101
|
createElementVNode(
|
|
93
102
|
"div",
|
|
94
103
|
_hoisted_6,
|
|
95
|
-
toDisplayString(__props.agentName
|
|
104
|
+
toDisplayString(__props.agentName),
|
|
96
105
|
1
|
|
97
106
|
/* TEXT */
|
|
98
107
|
),
|
|
@@ -158,14 +167,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
158
167
|
onClick: withModifiers(closeDrawer, ["self"])
|
|
159
168
|
}, [
|
|
160
169
|
createElementVNode("div", _hoisted_13, [
|
|
161
|
-
createElementVNode("div",
|
|
162
|
-
|
|
170
|
+
createElementVNode("div", _hoisted_14, [
|
|
171
|
+
createElementVNode(
|
|
163
172
|
"span",
|
|
164
173
|
null,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/*
|
|
168
|
-
)
|
|
174
|
+
toDisplayString(__props.drawerTitle),
|
|
175
|
+
1
|
|
176
|
+
/* TEXT */
|
|
177
|
+
),
|
|
169
178
|
createElementVNode("button", {
|
|
170
179
|
type: "button",
|
|
171
180
|
class: "yc-mobile-device__nav-btn",
|
|
@@ -201,7 +210,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
201
210
|
])
|
|
202
211
|
])) : createCommentVNode("v-if", true)
|
|
203
212
|
]),
|
|
204
|
-
_cache[
|
|
213
|
+
_cache[6] || (_cache[6] = createElementVNode(
|
|
205
214
|
"div",
|
|
206
215
|
{
|
|
207
216
|
class: "yc-mobile-device__home-bar",
|
|
@@ -214,29 +223,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
214
223
|
/* CACHED */
|
|
215
224
|
))
|
|
216
225
|
]),
|
|
217
|
-
|
|
218
|
-
|
|
226
|
+
__props.device.badge || __props.caption ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
227
|
+
__props.device.badge ? (openBlock(), createElementBlock(
|
|
219
228
|
"span",
|
|
220
|
-
|
|
229
|
+
_hoisted_16,
|
|
221
230
|
toDisplayString(__props.device.badge),
|
|
222
231
|
1
|
|
223
232
|
/* TEXT */
|
|
224
|
-
),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
null,
|
|
228
|
-
"\xB7",
|
|
229
|
-
-1
|
|
230
|
-
/* CACHED */
|
|
231
|
-
)),
|
|
232
|
-
_cache[9] || (_cache[9] = createElementVNode(
|
|
233
|
+
)) : createCommentVNode("v-if", true),
|
|
234
|
+
__props.device.badge && __props.caption ? (openBlock(), createElementBlock("span", _hoisted_17, "\xB7")) : createCommentVNode("v-if", true),
|
|
235
|
+
__props.caption ? (openBlock(), createElementBlock(
|
|
233
236
|
"span",
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
/*
|
|
238
|
-
))
|
|
239
|
-
])
|
|
237
|
+
_hoisted_18,
|
|
238
|
+
toDisplayString(__props.caption),
|
|
239
|
+
1
|
|
240
|
+
/* TEXT */
|
|
241
|
+
)) : createCommentVNode("v-if", true)
|
|
242
|
+
])) : createCommentVNode("v-if", true)
|
|
240
243
|
], 12, _hoisted_1);
|
|
241
244
|
};
|
|
242
245
|
}
|
|
@@ -55,7 +55,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
55
|
loading: { type: Boolean, default: false },
|
|
56
56
|
clearable: { type: Boolean, default: false },
|
|
57
57
|
searchable: { type: Boolean, default: true },
|
|
58
|
-
ariaLabel: { default: "" }
|
|
58
|
+
ariaLabel: { default: "" },
|
|
59
|
+
variant: { default: "field" }
|
|
59
60
|
},
|
|
60
61
|
emits: ["update:modelValue", "change"],
|
|
61
62
|
setup(__props, { emit: __emit }) {
|
|
@@ -82,12 +83,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
83
|
if (!el || typeof window === "undefined") return;
|
|
83
84
|
const rect = el.getBoundingClientRect();
|
|
84
85
|
const maxLeft = Math.max(12, window.innerWidth - 280);
|
|
85
|
-
|
|
86
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
87
|
+
const spaceAbove = rect.top;
|
|
88
|
+
const openUp = spaceBelow < 240 && spaceAbove > spaceBelow;
|
|
89
|
+
const shared = {
|
|
86
90
|
position: "fixed",
|
|
87
|
-
top: `${rect.bottom + 6}px`,
|
|
88
91
|
left: `${Math.min(rect.left, maxLeft)}px`,
|
|
89
92
|
minWidth: `${Math.max(rect.width, 220)}px`
|
|
90
93
|
};
|
|
94
|
+
popoverStyle.value = openUp ? { ...shared, bottom: `${window.innerHeight - rect.top + 6}px` } : { ...shared, top: `${rect.bottom + 6}px` };
|
|
91
95
|
}
|
|
92
96
|
function handleOutsidePointer(event) {
|
|
93
97
|
var _a, _b;
|
|
@@ -154,7 +158,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
154
158
|
class: normalizeClass(["yc-chat-select", {
|
|
155
159
|
"is-open": open.value,
|
|
156
160
|
"is-disabled": __props.disabled,
|
|
157
|
-
"has-value": Boolean(selectedOption.value)
|
|
161
|
+
"has-value": Boolean(selectedOption.value),
|
|
162
|
+
"is-chip": __props.variant === "chip"
|
|
158
163
|
}]),
|
|
159
164
|
disabled: __props.disabled,
|
|
160
165
|
"aria-expanded": open.value,
|
|
@@ -27,7 +27,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
__name: "sender",
|
|
28
28
|
props: {
|
|
29
29
|
modelValue: { default: "" },
|
|
30
|
-
placeholder: { default: "\
|
|
30
|
+
placeholder: { default: "\u8F93\u5165\u6D88\u606F\u2026" },
|
|
31
31
|
disabled: { type: Boolean, default: false },
|
|
32
32
|
sending: { type: Boolean, default: false },
|
|
33
33
|
uploading: { type: Boolean, default: false },
|
|
@@ -35,6 +35,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
thinking: { type: Boolean, default: false },
|
|
36
36
|
showThinking: { type: Boolean, default: true },
|
|
37
37
|
thinkingDisabled: { type: Boolean, default: false },
|
|
38
|
+
thinkingLabel: { default: "\u601D\u8003" },
|
|
38
39
|
viewport: { default: "web" },
|
|
39
40
|
enterToSend: { type: Function, default: void 0 }
|
|
40
41
|
},
|
|
@@ -148,8 +149,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
149
|
Fragment,
|
|
149
150
|
{ key: 1 },
|
|
150
151
|
[
|
|
151
|
-
__props.showThinking ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
152
|
-
|
|
152
|
+
__props.showThinking || _ctx.$slots.controls ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
153
|
+
renderSlot(_ctx.$slots, "controls"),
|
|
154
|
+
__props.showThinking ? (openBlock(), createElementBlock("button", {
|
|
155
|
+
key: 0,
|
|
153
156
|
type: "button",
|
|
154
157
|
role: "switch",
|
|
155
158
|
"aria-checked": __props.thinking,
|
|
@@ -157,8 +160,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
157
160
|
class: normalizeClass(["yc-chat-sender__chip", { "is-active": __props.thinking }]),
|
|
158
161
|
disabled: __props.disabled || __props.thinkingDisabled,
|
|
159
162
|
onClick: toggleThinking
|
|
160
|
-
}, [
|
|
161
|
-
createElementVNode(
|
|
163
|
+
}, [
|
|
164
|
+
_cache[6] || (_cache[6] = createElementVNode(
|
|
162
165
|
"svg",
|
|
163
166
|
{
|
|
164
167
|
viewBox: "0 0 16 16",
|
|
@@ -175,15 +178,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
178
|
],
|
|
176
179
|
-1
|
|
177
180
|
/* CACHED */
|
|
178
|
-
),
|
|
181
|
+
)),
|
|
179
182
|
createElementVNode(
|
|
180
183
|
"span",
|
|
181
184
|
null,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/*
|
|
185
|
+
toDisplayString(__props.thinkingLabel),
|
|
186
|
+
1
|
|
187
|
+
/* TEXT */
|
|
185
188
|
)
|
|
186
|
-
]
|
|
189
|
+
], 10, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
187
190
|
])) : createCommentVNode("v-if", true),
|
|
188
191
|
createElementVNode("div", _hoisted_4, [
|
|
189
192
|
createElementVNode("button", {
|
|
@@ -338,8 +341,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
338
341
|
class: normalizeClass(["yc-chat-sender__chip", { "is-active": __props.thinking }]),
|
|
339
342
|
disabled: __props.disabled || __props.thinkingDisabled,
|
|
340
343
|
onClick: toggleThinking
|
|
341
|
-
}, [
|
|
342
|
-
createElementVNode(
|
|
344
|
+
}, [
|
|
345
|
+
_cache[11] || (_cache[11] = createElementVNode(
|
|
343
346
|
"svg",
|
|
344
347
|
{
|
|
345
348
|
viewBox: "0 0 16 16",
|
|
@@ -356,15 +359,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
356
359
|
],
|
|
357
360
|
-1
|
|
358
361
|
/* CACHED */
|
|
359
|
-
),
|
|
362
|
+
)),
|
|
360
363
|
createElementVNode(
|
|
361
364
|
"span",
|
|
362
365
|
null,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
/*
|
|
366
|
+
toDisplayString(__props.thinkingLabel),
|
|
367
|
+
1
|
|
368
|
+
/* TEXT */
|
|
366
369
|
)
|
|
367
|
-
]
|
|
370
|
+
], 10, _hoisted_12)) : createCommentVNode("v-if", true),
|
|
368
371
|
renderSlot(_ctx.$slots, "controls")
|
|
369
372
|
]),
|
|
370
373
|
createElementVNode("div", _hoisted_13, [
|