ant-design-x-vue 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +7971 -7704
- package/dist/index.esm.min.js +2 -2
- package/dist/index.umd.js +63 -63
- package/es/actions/ActionMenu.mjs +67 -0
- package/es/actions/Actions.mjs +100 -0
- package/es/actions/index.mjs +8 -0
- package/es/actions/interface.mjs +1 -0
- package/es/actions/style/index.mjs +76 -0
- package/es/attachments/FileList/FileList.mjs +121 -69
- package/es/attachments/FileList/FileListCard.mjs +64 -66
- package/es/attachments/PlaceholderUploader.mjs +2 -3
- package/es/attachments/constants.mjs +12 -0
- package/es/attachments/util.mjs +24 -20
- package/es/bubble/BubbleList.mjs +36 -35
- package/es/components.mjs +22 -19
- package/es/components.ts-chunk.mjs +5 -2
- package/es/index.mjs +42 -40
- package/es/prompts/Prompts.mjs +1 -3
- package/es/sender/useSpeech.mjs +25 -24
- package/es/x-provider/index-chunk.mjs +1 -0
- package/lib/actions/ActionMenu.js +1 -0
- package/lib/actions/Actions.js +1 -0
- package/lib/actions/index.js +1 -0
- package/lib/actions/interface.js +1 -0
- package/lib/actions/style/index.js +1 -0
- package/lib/attachments/FileList/FileList.js +1 -1
- package/lib/attachments/FileList/FileListCard.js +1 -1
- package/lib/attachments/PlaceholderUploader.js +1 -1
- package/lib/attachments/constants.js +1 -0
- package/lib/attachments/util.js +1 -1
- package/lib/bubble/BubbleList.js +1 -1
- package/lib/components.js +1 -1
- package/lib/components.ts-chunk.js +1 -1
- package/lib/index.js +1 -1
- package/lib/prompts/Prompts.js +1 -1
- package/lib/sender/useSpeech.js +1 -1
- package/lib/x-provider/index-chunk.js +1 -1
- package/package.json +2 -1
- package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
- package/typings/_util/cssinjs/index.d.ts +3 -3
- package/typings/actions/ActionMenu.vue.d.ts +21 -0
- package/typings/actions/Actions.vue.d.ts +22 -0
- package/typings/actions/index.d.ts +4 -0
- package/typings/actions/interface.d.ts +105 -0
- package/typings/actions/style/index.d.ts +8 -0
- package/typings/attachments/constants.d.ts +9 -0
- package/typings/attachments/util.d.ts +1 -0
- package/typings/bubble/index.d.ts +26 -26
- package/typings/components.d.ts +1 -0
- package/typings/prompts/interface.d.ts +2 -1
- package/typings/theme/components.d.ts +2 -0
- package/typings/x-provider/context.d.ts +2 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { F as
|
|
1
|
+
import { defineComponent as N, toRef as z, createVNode as e, computed as o, useTemplateRef as M, watch as V, onWatcherCleanup as U, Fragment as E, mergeProps as W } from "vue";
|
|
2
|
+
import { F as $, d as G, e as K, f as Z, g as Y, h as q, i as H, j as J, b as Q, C as _ } from "../../chunks/module-chunk.mjs";
|
|
3
3
|
import ee from "./AudioIcon.mjs";
|
|
4
4
|
import le from "./VideoIcon.mjs";
|
|
5
5
|
import { useAttachmentContextInject as ie } from "../context.mjs";
|
|
6
6
|
import "../../x-provider/index.mjs";
|
|
7
|
-
import { previewImage as ne } from "../util.mjs";
|
|
7
|
+
import { matchExt as P, previewImage as ne } from "../util.mjs";
|
|
8
8
|
import te from "../style/index.mjs";
|
|
9
9
|
import oe from "../../_util/hooks/use-state.mjs";
|
|
10
|
-
import { Image as
|
|
11
|
-
import re from "
|
|
12
|
-
|
|
10
|
+
import { Image as ce, Progress as ae } from "ant-design-vue";
|
|
11
|
+
import { EXCEL_EXTS as re, IMG_EXTS as h, MARKDOWN_EXTS as ue, PDF_EXTS as se, PPT_EXTS as me, WORD_EXTS as fe, ZIP_EXTS as de, VIDEO_EXTS as ve, AUDIO_EXTS as xe } from "../constants.mjs";
|
|
12
|
+
import Fe from "../../x-provider/hooks/use-x-provider-context.mjs";
|
|
13
|
+
const v = " ", u = "#8c8c8c", Te = /* @__PURE__ */ N({
|
|
13
14
|
name: "AXAttachmentsFileListCard",
|
|
14
15
|
__name: "FileListCard",
|
|
15
16
|
props: {
|
|
@@ -25,83 +26,80 @@ const v = " ", s = "#8c8c8c", Ce = /* @__PURE__ */ M({
|
|
|
25
26
|
type: null
|
|
26
27
|
},
|
|
27
28
|
setup(l, {
|
|
28
|
-
expose:
|
|
29
|
+
expose: k
|
|
29
30
|
}) {
|
|
30
|
-
|
|
31
|
-
const x = [
|
|
31
|
+
z(l, "prefixCls");
|
|
32
|
+
const x = [{
|
|
32
33
|
key: "default",
|
|
33
|
-
icon: e(
|
|
34
|
-
color:
|
|
35
|
-
ext: []
|
|
34
|
+
icon: e($, null, null),
|
|
35
|
+
color: u,
|
|
36
|
+
ext: /* @__PURE__ */ new Set([])
|
|
36
37
|
}, {
|
|
37
38
|
key: "excel",
|
|
38
|
-
icon: e(
|
|
39
|
+
icon: e(G, null, null),
|
|
39
40
|
color: "#22b35e",
|
|
40
|
-
ext:
|
|
41
|
+
ext: re
|
|
41
42
|
}, {
|
|
42
43
|
key: "image",
|
|
43
44
|
icon: e(K, null, null),
|
|
44
|
-
color:
|
|
45
|
-
ext:
|
|
45
|
+
color: u,
|
|
46
|
+
ext: h
|
|
46
47
|
}, {
|
|
47
48
|
key: "markdown",
|
|
48
|
-
icon: e(
|
|
49
|
-
color:
|
|
50
|
-
ext:
|
|
49
|
+
icon: e(Z, null, null),
|
|
50
|
+
color: u,
|
|
51
|
+
ext: ue
|
|
51
52
|
}, {
|
|
52
53
|
key: "pdf",
|
|
53
|
-
icon: e(
|
|
54
|
+
icon: e(Y, null, null),
|
|
54
55
|
color: "#ff4d4f",
|
|
55
|
-
ext:
|
|
56
|
+
ext: se
|
|
56
57
|
}, {
|
|
57
58
|
key: "ppt",
|
|
58
59
|
icon: e(q, null, null),
|
|
59
60
|
color: "#ff6e31",
|
|
60
|
-
ext:
|
|
61
|
+
ext: me
|
|
61
62
|
}, {
|
|
62
63
|
key: "word",
|
|
63
64
|
icon: e(H, null, null),
|
|
64
65
|
color: "#1677ff",
|
|
65
|
-
ext:
|
|
66
|
+
ext: fe
|
|
66
67
|
}, {
|
|
67
68
|
key: "zip",
|
|
68
69
|
icon: e(J, null, null),
|
|
69
70
|
color: "#fab714",
|
|
70
|
-
ext:
|
|
71
|
+
ext: de
|
|
71
72
|
}, {
|
|
72
73
|
key: "video",
|
|
73
74
|
icon: e(le, null, null),
|
|
74
75
|
color: "#ff4d4f",
|
|
75
|
-
ext:
|
|
76
|
+
ext: ve
|
|
76
77
|
}, {
|
|
77
78
|
key: "audio",
|
|
78
79
|
icon: e(ee, null, null),
|
|
79
80
|
color: "#8c8c8c",
|
|
80
|
-
ext:
|
|
81
|
+
ext: xe
|
|
81
82
|
}];
|
|
82
|
-
function p(n
|
|
83
|
-
return t.some((c) => n.toLowerCase() === `.${c}`);
|
|
84
|
-
}
|
|
85
|
-
function P(n) {
|
|
83
|
+
function p(n) {
|
|
86
84
|
let t = n;
|
|
87
|
-
const
|
|
85
|
+
const r = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
|
|
88
86
|
let d = 0;
|
|
89
|
-
for (; t >= 1024 && d <
|
|
87
|
+
for (; t >= 1024 && d < r.length - 1; )
|
|
90
88
|
t /= 1024, d++;
|
|
91
|
-
return `${t.toFixed(0)} ${
|
|
89
|
+
return `${t.toFixed(0)} ${r[d]}`;
|
|
92
90
|
}
|
|
93
|
-
const
|
|
94
|
-
getPrefixCls:
|
|
95
|
-
} =
|
|
96
|
-
const n =
|
|
91
|
+
const w = ie(), T = o(() => w.value.disabled), b = o(() => l.item.name), F = o(() => l.item.size), s = o(() => l.item.percent), c = o(() => l.item.status || "done"), g = o(() => l.item.description), {
|
|
92
|
+
getPrefixCls: O
|
|
93
|
+
} = Fe(), y = o(() => O("attachment", l.prefixCls)), i = `${y.value}-list-card`, [X, R, A] = te(y), B = M("file-list-card-container"), a = o(() => {
|
|
94
|
+
const n = b.value || "", t = n.match(/^(.*)\.[^.]+$/);
|
|
97
95
|
return {
|
|
98
96
|
namePrefix: t ? t[1] : n,
|
|
99
97
|
nameSuffix: t ? n.slice(t[1].length) : ""
|
|
100
98
|
};
|
|
101
|
-
}),
|
|
99
|
+
}), j = o(() => P(a.value.nameSuffix, h)), C = o(() => g.value ? g.value : c.value === "uploading" ? `${s.value || 0}%` : c.value === "error" ? l.item.response || v : F.value ? p(F.value) : v), S = o(() => {
|
|
102
100
|
if (l.icon)
|
|
103
101
|
if (typeof l.icon == "string") {
|
|
104
|
-
const n =
|
|
102
|
+
const n = x.find((t) => t.key === l.icon);
|
|
105
103
|
if (n)
|
|
106
104
|
return {
|
|
107
105
|
icon: n.icon,
|
|
@@ -115,26 +113,26 @@ const v = " ", s = "#8c8c8c", Ce = /* @__PURE__ */ M({
|
|
|
115
113
|
for (const {
|
|
116
114
|
ext: n,
|
|
117
115
|
icon: t,
|
|
118
|
-
color:
|
|
119
|
-
} of
|
|
120
|
-
if (
|
|
116
|
+
color: r
|
|
117
|
+
} of x)
|
|
118
|
+
if (P(a.value.nameSuffix, n))
|
|
121
119
|
return {
|
|
122
120
|
icon: t,
|
|
123
|
-
iconColor:
|
|
121
|
+
iconColor: r
|
|
124
122
|
};
|
|
125
123
|
return {
|
|
126
|
-
icon: e(
|
|
124
|
+
icon: e($, {
|
|
127
125
|
key: "defaultIcon"
|
|
128
126
|
}, null),
|
|
129
|
-
iconColor:
|
|
127
|
+
iconColor: u
|
|
130
128
|
};
|
|
131
|
-
}), [
|
|
132
|
-
|
|
129
|
+
}), [D, I] = oe();
|
|
130
|
+
V(() => l.item.originFileObj, () => {
|
|
133
131
|
if (l.item.originFileObj) {
|
|
134
132
|
let n = !0;
|
|
135
133
|
ne(l.item.originFileObj).then((t) => {
|
|
136
134
|
n && I(t);
|
|
137
|
-
}),
|
|
135
|
+
}), U(() => {
|
|
138
136
|
n = !1;
|
|
139
137
|
});
|
|
140
138
|
}
|
|
@@ -142,47 +140,47 @@ const v = " ", s = "#8c8c8c", Ce = /* @__PURE__ */ M({
|
|
|
142
140
|
}, {
|
|
143
141
|
immediate: !0
|
|
144
142
|
});
|
|
145
|
-
const m = o(() => l.item.thumbUrl || l.item.url ||
|
|
143
|
+
const m = o(() => l.item.thumbUrl || l.item.url || D.value), f = o(() => l.type === "image" || l.type !== "file" && j.value && (l.item.originFileObj || m.value)), L = o(() => f.value ? e(E, null, [m.value && e(ce, W(l.imageProps, {
|
|
146
144
|
alt: "preview",
|
|
147
145
|
src: m.value
|
|
148
|
-
}), null),
|
|
146
|
+
}), null), c.value !== "done" && e("div", {
|
|
149
147
|
class: `${i}-img-mask`
|
|
150
|
-
}, [
|
|
151
|
-
percent:
|
|
148
|
+
}, [c.value === "uploading" && s.value !== void 0 && e(ae, {
|
|
149
|
+
percent: s.value,
|
|
152
150
|
prefixCls: i
|
|
153
|
-
}, null),
|
|
151
|
+
}, null), c.value === "error" && e("div", {
|
|
154
152
|
class: `${i}-desc`
|
|
155
153
|
}, [e("div", {
|
|
156
154
|
class: `${i}-ellipsis-prefix`
|
|
157
|
-
}, [
|
|
155
|
+
}, [C.value])])])]) : e(E, null, [e("div", {
|
|
158
156
|
class: `${i}-icon`,
|
|
159
157
|
style: {
|
|
160
|
-
color:
|
|
158
|
+
color: S.value.iconColor
|
|
161
159
|
}
|
|
162
|
-
}, [
|
|
160
|
+
}, [S.value.icon]), e("div", {
|
|
163
161
|
class: `${i}-content`
|
|
164
162
|
}, [e("div", {
|
|
165
163
|
class: `${i}-name`
|
|
166
164
|
}, [e("div", {
|
|
167
165
|
class: `${i}-ellipsis-prefix`
|
|
168
|
-
}, [
|
|
166
|
+
}, [a.value.namePrefix ?? v]), e("div", {
|
|
169
167
|
class: `${i}-ellipsis-suffix`
|
|
170
|
-
}, [
|
|
168
|
+
}, [a.value.nameSuffix])]), e("div", {
|
|
171
169
|
class: `${i}-desc`
|
|
172
170
|
}, [e("div", {
|
|
173
171
|
class: `${i}-ellipsis-prefix`
|
|
174
|
-
}, [
|
|
175
|
-
return
|
|
176
|
-
nativeElement:
|
|
177
|
-
}), () =>
|
|
172
|
+
}, [C.value])])])]));
|
|
173
|
+
return k({
|
|
174
|
+
nativeElement: B
|
|
175
|
+
}), () => X(e("div", {
|
|
178
176
|
class: Q(i, {
|
|
179
|
-
[`${i}-status-${
|
|
177
|
+
[`${i}-status-${c.value}`]: c.value,
|
|
180
178
|
[`${i}-type-preview`]: f.value,
|
|
181
179
|
[`${i}-type-overview`]: !f.value
|
|
182
|
-
}, l.className, R.value,
|
|
180
|
+
}, l.className, R.value, A),
|
|
183
181
|
style: l.style,
|
|
184
182
|
ref: "file-list-card-container"
|
|
185
|
-
}, [
|
|
183
|
+
}, [L.value, !T.value && l.onRemove && e("button", {
|
|
186
184
|
type: "button",
|
|
187
185
|
class: `${i}-remove`,
|
|
188
186
|
onClick: () => {
|
|
@@ -192,5 +190,5 @@ const v = " ", s = "#8c8c8c", Ce = /* @__PURE__ */ M({
|
|
|
192
190
|
}
|
|
193
191
|
});
|
|
194
192
|
export {
|
|
195
|
-
|
|
193
|
+
Te as default
|
|
196
194
|
};
|
|
@@ -63,9 +63,8 @@ const L = /* @__PURE__ */ D({
|
|
|
63
63
|
onDrop: g,
|
|
64
64
|
"aria-hidden": d.value.disabled,
|
|
65
65
|
style: e.style
|
|
66
|
-
}, [t(U.Dragger, C({
|
|
67
|
-
showUploadList: !1
|
|
68
|
-
}, e.upload, {
|
|
66
|
+
}, [t(U.Dragger, C(e.upload, {
|
|
67
|
+
showUploadList: !1,
|
|
69
68
|
ref: "upload-dragger",
|
|
70
69
|
style: {
|
|
71
70
|
padding: 0,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const e = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg"]), t = /* @__PURE__ */ new Set(["mp3", "wav", "flac", "ape", "aac", "ogg"]), n = /* @__PURE__ */ new Set(["mp4", "avi", "mov", "wmv", "flv", "mkv"]), S = /* @__PURE__ */ new Set(["md", "mdx"]), p = /* @__PURE__ */ new Set(["zip", "rar", "7z", "tar", "gz"]), o = /* @__PURE__ */ new Set(["xlsx", "xls"]), c = /* @__PURE__ */ new Set(["ppt", "pptx"]), s = /* @__PURE__ */ new Set(["doc", "docx"]), w = /* @__PURE__ */ new Set(["pdf"]);
|
|
2
|
+
export {
|
|
3
|
+
t as AUDIO_EXTS,
|
|
4
|
+
o as EXCEL_EXTS,
|
|
5
|
+
e as IMG_EXTS,
|
|
6
|
+
S as MARKDOWN_EXTS,
|
|
7
|
+
w as PDF_EXTS,
|
|
8
|
+
c as PPT_EXTS,
|
|
9
|
+
n as VIDEO_EXTS,
|
|
10
|
+
s as WORD_EXTS,
|
|
11
|
+
p as ZIP_EXTS
|
|
12
|
+
};
|
package/es/attachments/util.mjs
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
const E = (
|
|
2
|
-
function
|
|
3
|
-
return new Promise((
|
|
4
|
-
if (!
|
|
5
|
-
|
|
1
|
+
const E = (t) => t.indexOf("image/") === 0;
|
|
2
|
+
function m(t) {
|
|
3
|
+
return new Promise((o) => {
|
|
4
|
+
if (!t || !t.type || !E(t.type)) {
|
|
5
|
+
o("");
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
const n = new Image();
|
|
9
9
|
if (n.onload = () => {
|
|
10
|
-
const { width:
|
|
11
|
-
s.width =
|
|
10
|
+
const { width: e, height: c } = n, a = e / c, r = a > 1 ? 200 : 200 * a, i = a > 1 ? 200 / a : 200, s = document.createElement("canvas");
|
|
11
|
+
s.width = r, s.height = i, s.style.cssText = `position: fixed; left: 0; top: 0; width: ${r}px; height: ${i}px; z-index: 9999; display: none;`, document.body.appendChild(s), s.getContext("2d").drawImage(n, 0, 0, r, i);
|
|
12
12
|
const d = s.toDataURL();
|
|
13
|
-
document.body.removeChild(s), window.URL.revokeObjectURL(n.src),
|
|
14
|
-
}, n.crossOrigin = "anonymous",
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
} else if (
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
13
|
+
document.body.removeChild(s), window.URL.revokeObjectURL(n.src), o(d);
|
|
14
|
+
}, n.crossOrigin = "anonymous", t.type.startsWith("image/svg+xml")) {
|
|
15
|
+
const e = new FileReader();
|
|
16
|
+
e.onload = () => {
|
|
17
|
+
e.result && typeof e.result == "string" && (n.src = e.result);
|
|
18
|
+
}, e.readAsDataURL(t);
|
|
19
|
+
} else if (t.type.startsWith("image/gif")) {
|
|
20
|
+
const e = new FileReader();
|
|
21
|
+
e.onload = () => {
|
|
22
|
+
e.result && o(e.result);
|
|
23
|
+
}, e.readAsDataURL(t);
|
|
24
24
|
} else
|
|
25
|
-
n.src = window.URL.createObjectURL(
|
|
25
|
+
n.src = window.URL.createObjectURL(t);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
function R(t, o) {
|
|
29
|
+
return o.has(t.substring(1).toLowerCase());
|
|
30
|
+
}
|
|
28
31
|
export {
|
|
29
32
|
E as isImageFileType,
|
|
30
|
-
|
|
33
|
+
R as matchExt,
|
|
34
|
+
m as previewImage
|
|
31
35
|
};
|
package/es/bubble/BubbleList.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, mergeDefaults as F, toRef as
|
|
1
|
+
import { defineComponent as q, mergeDefaults as F, toRef as v, useAttrs as G, useSlots as J, computed as A, mergeProps as x, ref as d, watch as g, watchPostEffect as Q, onWatcherCleanup as Y, unref as o, nextTick as Z, createVNode as S, renderList as k } from "vue";
|
|
2
2
|
import { c as b } from "../chunks/helper-chunk.mjs";
|
|
3
3
|
import { b as _ } from "../chunks/module-chunk.mjs";
|
|
4
4
|
import { useEventCallback as tt } from "../_util/hooks/use-event-callback.mjs";
|
|
@@ -8,7 +8,7 @@ import ot from "./Bubble.mjs";
|
|
|
8
8
|
import st from "./hooks/useDisplayData.mjs";
|
|
9
9
|
import rt from "./hooks/useListData.mjs";
|
|
10
10
|
import at from "./style/index.mjs";
|
|
11
|
-
import
|
|
11
|
+
import R from "../_util/hooks/use-state.mjs";
|
|
12
12
|
import { BubbleContextProvider as lt } from "./context.mjs";
|
|
13
13
|
import nt from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
14
14
|
const it = 1, It = /* @__PURE__ */ q({
|
|
@@ -30,32 +30,32 @@ const it = 1, It = /* @__PURE__ */ q({
|
|
|
30
30
|
expose: L
|
|
31
31
|
}) {
|
|
32
32
|
const N = b(s, ["prefixCls", "rootClassName", "items", "autoScroll", "roles"]);
|
|
33
|
-
|
|
34
|
-
const w = G(), r = J(), B = A(() => et(
|
|
33
|
+
v(s, "roles"), v(s, "items"), v(s, "prefixCls");
|
|
34
|
+
const w = G(), r = J(), B = A(() => et(x(N, w), {
|
|
35
35
|
attr: !0,
|
|
36
36
|
aria: !0
|
|
37
|
-
})),
|
|
37
|
+
})), P = d(s.items), I = d(s.roles);
|
|
38
38
|
g(() => s.items, () => {
|
|
39
|
-
|
|
39
|
+
P.value = s.items;
|
|
40
40
|
}), g(() => s.roles, () => {
|
|
41
|
-
|
|
41
|
+
I.value = s.roles;
|
|
42
42
|
});
|
|
43
|
-
const
|
|
43
|
+
const n = d(null), u = d({}), {
|
|
44
44
|
getPrefixCls: H
|
|
45
|
-
} = nt(),
|
|
45
|
+
} = nt(), E = H("bubble", s.prefixCls), D = `${E}-list`, [U, $, z] = at(E), [X, T] = R(!1);
|
|
46
46
|
Q(() => {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
T(!0), Y(() => {
|
|
48
|
+
T(!1);
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
|
-
const y = rt(
|
|
51
|
+
const y = rt(P, I), [m, K] = st(y), [C, h] = R(!0), [p, V] = R(0), M = (t) => {
|
|
52
52
|
const a = t.target;
|
|
53
|
-
|
|
53
|
+
h(a.scrollHeight - Math.abs(a.scrollTop) - a.clientHeight <= it);
|
|
54
54
|
};
|
|
55
|
-
g(
|
|
56
|
-
s.autoScroll && o(
|
|
57
|
-
o(
|
|
58
|
-
top: o(
|
|
55
|
+
g([p, n, C], () => {
|
|
56
|
+
s.autoScroll && o(n) && o(C) && Z(() => {
|
|
57
|
+
o(n).scrollTo({
|
|
58
|
+
top: o(n).scrollHeight
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
}), g(() => o(m).length, () => {
|
|
@@ -64,33 +64,33 @@ const it = 1, It = /* @__PURE__ */ q({
|
|
|
64
64
|
const a = (t = o(m)[o(m).length - 2]) == null ? void 0 : t.key, e = o(u)[a];
|
|
65
65
|
if (e) {
|
|
66
66
|
const {
|
|
67
|
-
nativeElement:
|
|
67
|
+
nativeElement: i
|
|
68
68
|
} = e, {
|
|
69
69
|
top: c = 0,
|
|
70
70
|
bottom: f = 0
|
|
71
|
-
} = (
|
|
71
|
+
} = (i == null ? void 0 : i.getBoundingClientRect()) ?? {}, {
|
|
72
72
|
top: l,
|
|
73
73
|
bottom: j
|
|
74
|
-
} = o(
|
|
75
|
-
c < j && f > l && (V(o(
|
|
74
|
+
} = o(n).getBoundingClientRect();
|
|
75
|
+
c < j && f > l && (V(o(p) + 1), h(!0));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const O = tt(() => {
|
|
80
|
-
s.autoScroll && V(o(
|
|
80
|
+
s.autoScroll && V(o(p) + 1);
|
|
81
81
|
}), W = A(() => ({
|
|
82
82
|
onUpdate: O
|
|
83
83
|
}));
|
|
84
84
|
return L({
|
|
85
|
-
nativeElement:
|
|
85
|
+
nativeElement: n,
|
|
86
86
|
scrollTo: ({
|
|
87
87
|
key: t,
|
|
88
88
|
offset: a,
|
|
89
89
|
behavior: e = "smooth",
|
|
90
|
-
block:
|
|
90
|
+
block: i
|
|
91
91
|
}) => {
|
|
92
92
|
if (typeof a == "number")
|
|
93
|
-
o(
|
|
93
|
+
o(n).scrollTo({
|
|
94
94
|
top: a,
|
|
95
95
|
behavior: e
|
|
96
96
|
});
|
|
@@ -98,29 +98,29 @@ const it = 1, It = /* @__PURE__ */ q({
|
|
|
98
98
|
const c = o(u)[t];
|
|
99
99
|
if (c) {
|
|
100
100
|
const f = o(m).findIndex((l) => l.key === t);
|
|
101
|
-
|
|
101
|
+
h(f === o(m).length - 1), c.nativeElement.scrollIntoView({
|
|
102
102
|
behavior: e,
|
|
103
|
-
block:
|
|
103
|
+
block: i
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
}), () => U(
|
|
108
|
+
}), () => U(S(lt, {
|
|
109
109
|
value: W.value
|
|
110
110
|
}, {
|
|
111
|
-
default: () => [
|
|
112
|
-
class: _(
|
|
113
|
-
[`${
|
|
111
|
+
default: () => [S("div", x(B.value, {
|
|
112
|
+
class: _(D, s.rootClassName, $.value, z, {
|
|
113
|
+
[`${D}-reach-end`]: C.value
|
|
114
114
|
}),
|
|
115
|
-
ref:
|
|
115
|
+
ref: n,
|
|
116
116
|
onScroll: M
|
|
117
117
|
}), [k(o(m), ({
|
|
118
118
|
key: t,
|
|
119
119
|
onTypingComplete: a,
|
|
120
120
|
...e
|
|
121
121
|
}) => {
|
|
122
|
-
var
|
|
123
|
-
return
|
|
122
|
+
var i, c, f;
|
|
123
|
+
return S(ot, x(e, {
|
|
124
124
|
avatar: r.avatar ? () => {
|
|
125
125
|
var l;
|
|
126
126
|
return (l = r.avatar) == null ? void 0 : l.call(r, {
|
|
@@ -130,7 +130,7 @@ const it = 1, It = /* @__PURE__ */ q({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
} : e.avatar,
|
|
133
|
-
header: ((
|
|
133
|
+
header: ((i = r.header) == null ? void 0 : i.call(r, {
|
|
134
134
|
item: {
|
|
135
135
|
key: t,
|
|
136
136
|
...e
|
|
@@ -155,6 +155,7 @@ const it = 1, It = /* @__PURE__ */ q({
|
|
|
155
155
|
}
|
|
156
156
|
})) ?? e.content,
|
|
157
157
|
key: t,
|
|
158
|
+
_key: t,
|
|
158
159
|
ref: (l) => {
|
|
159
160
|
l ? u.value[t] = l : delete u.value[t];
|
|
160
161
|
},
|
package/es/components.mjs
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import "./x-provider/index.mjs";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as u } from "./bubble/index.mjs";
|
|
3
3
|
import "./conversations/index.mjs";
|
|
4
4
|
import "./welcome/index.mjs";
|
|
5
5
|
import "./prompts/index.mjs";
|
|
6
6
|
import "./suggestion/index.mjs";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
7
|
+
import { default as d } from "./sender/index.mjs";
|
|
8
|
+
import { default as x } from "./attachments/index.mjs";
|
|
9
9
|
import "./thought-chain/index.mjs";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
10
|
+
import "./actions/index.mjs";
|
|
11
|
+
import { _ as b } from "./x-provider/index-chunk.mjs";
|
|
12
|
+
import { defaultPrefixCls as C, default as P } from "./x-provider/hooks/use-x-provider-context.mjs";
|
|
12
13
|
import { default as g } from "./bubble/BubbleList.mjs";
|
|
13
|
-
import { default as
|
|
14
|
+
import { default as A } from "./conversations/Conversations.mjs";
|
|
14
15
|
import { default as S } from "./welcome/Welcome.mjs";
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
16
|
+
import { default as L } from "./prompts/Prompts.mjs";
|
|
17
|
+
import { default as W } from "./suggestion/Suggestion.mjs";
|
|
18
|
+
import { default as j } from "./thought-chain/ThoughtChain.mjs";
|
|
19
|
+
import { default as q } from "./actions/Actions.mjs";
|
|
18
20
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
q as Actions,
|
|
22
|
+
x as Attachments,
|
|
23
|
+
u as Bubble,
|
|
21
24
|
g as BubbleList,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
A as Conversations,
|
|
26
|
+
L as Prompts,
|
|
27
|
+
d as Sender,
|
|
28
|
+
W as Suggestion,
|
|
29
|
+
j as ThoughtChain,
|
|
27
30
|
S as Welcome,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
b as XProvider,
|
|
32
|
+
C as defaultPrefixCls,
|
|
33
|
+
P as useXProviderContext
|
|
31
34
|
};
|
|
@@ -7,6 +7,7 @@ import "./suggestion/index.mjs";
|
|
|
7
7
|
import r from "./sender/index.mjs";
|
|
8
8
|
import m from "./attachments/index.mjs";
|
|
9
9
|
import "./thought-chain/index.mjs";
|
|
10
|
+
import "./actions/index.mjs";
|
|
10
11
|
import { _ as t } from "./x-provider/index-chunk.mjs";
|
|
11
12
|
import i, { defaultPrefixCls as e } from "./x-provider/hooks/use-x-provider-context.mjs";
|
|
12
13
|
import f from "./bubble/BubbleList.mjs";
|
|
@@ -15,8 +16,10 @@ import n from "./welcome/Welcome.mjs";
|
|
|
15
16
|
import s from "./prompts/Prompts.mjs";
|
|
16
17
|
import _ from "./suggestion/Suggestion.mjs";
|
|
17
18
|
import a from "./thought-chain/ThoughtChain.mjs";
|
|
18
|
-
|
|
19
|
+
import c from "./actions/Actions.mjs";
|
|
20
|
+
const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
19
21
|
__proto__: null,
|
|
22
|
+
Actions: c,
|
|
20
23
|
Attachments: m,
|
|
21
24
|
Bubble: o,
|
|
22
25
|
BubbleList: f,
|
|
@@ -31,5 +34,5 @@ const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
31
34
|
useXProviderContext: i
|
|
32
35
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
33
36
|
export {
|
|
34
|
-
|
|
37
|
+
z as c
|
|
35
38
|
};
|