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.
Files changed (52) hide show
  1. package/dist/index.esm.js +7971 -7704
  2. package/dist/index.esm.min.js +2 -2
  3. package/dist/index.umd.js +63 -63
  4. package/es/actions/ActionMenu.mjs +67 -0
  5. package/es/actions/Actions.mjs +100 -0
  6. package/es/actions/index.mjs +8 -0
  7. package/es/actions/interface.mjs +1 -0
  8. package/es/actions/style/index.mjs +76 -0
  9. package/es/attachments/FileList/FileList.mjs +121 -69
  10. package/es/attachments/FileList/FileListCard.mjs +64 -66
  11. package/es/attachments/PlaceholderUploader.mjs +2 -3
  12. package/es/attachments/constants.mjs +12 -0
  13. package/es/attachments/util.mjs +24 -20
  14. package/es/bubble/BubbleList.mjs +36 -35
  15. package/es/components.mjs +22 -19
  16. package/es/components.ts-chunk.mjs +5 -2
  17. package/es/index.mjs +42 -40
  18. package/es/prompts/Prompts.mjs +1 -3
  19. package/es/sender/useSpeech.mjs +25 -24
  20. package/es/x-provider/index-chunk.mjs +1 -0
  21. package/lib/actions/ActionMenu.js +1 -0
  22. package/lib/actions/Actions.js +1 -0
  23. package/lib/actions/index.js +1 -0
  24. package/lib/actions/interface.js +1 -0
  25. package/lib/actions/style/index.js +1 -0
  26. package/lib/attachments/FileList/FileList.js +1 -1
  27. package/lib/attachments/FileList/FileListCard.js +1 -1
  28. package/lib/attachments/PlaceholderUploader.js +1 -1
  29. package/lib/attachments/constants.js +1 -0
  30. package/lib/attachments/util.js +1 -1
  31. package/lib/bubble/BubbleList.js +1 -1
  32. package/lib/components.js +1 -1
  33. package/lib/components.ts-chunk.js +1 -1
  34. package/lib/index.js +1 -1
  35. package/lib/prompts/Prompts.js +1 -1
  36. package/lib/sender/useSpeech.js +1 -1
  37. package/lib/x-provider/index-chunk.js +1 -1
  38. package/package.json +2 -1
  39. package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
  40. package/typings/_util/cssinjs/index.d.ts +3 -3
  41. package/typings/actions/ActionMenu.vue.d.ts +21 -0
  42. package/typings/actions/Actions.vue.d.ts +22 -0
  43. package/typings/actions/index.d.ts +4 -0
  44. package/typings/actions/interface.d.ts +105 -0
  45. package/typings/actions/style/index.d.ts +8 -0
  46. package/typings/attachments/constants.d.ts +9 -0
  47. package/typings/attachments/util.d.ts +1 -0
  48. package/typings/bubble/index.d.ts +26 -26
  49. package/typings/components.d.ts +1 -0
  50. package/typings/prompts/interface.d.ts +2 -1
  51. package/typings/theme/components.d.ts +2 -0
  52. package/typings/x-provider/context.d.ts +2 -0
@@ -1,15 +1,16 @@
1
- import { defineComponent as M, toRef as V, createVNode as e, computed as o, useTemplateRef as U, watch as X, onWatcherCleanup as G, Fragment as h, mergeProps as W } from "vue";
2
- import { F as k, d as D, e as K, f as Y, g as Z, h as q, i as H, j as J, b as Q, C as _ } from "../../chunks/module-chunk.mjs";
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 ae, Progress as ce } from "ant-design-vue";
11
- import re from "../../x-provider/hooks/use-x-provider-context.mjs";
12
- const v = " ", s = "#8c8c8c", Ce = /* @__PURE__ */ M({
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: S
29
+ expose: k
29
30
  }) {
30
- V(l, "prefixCls");
31
- const x = ["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg"], g = [{
31
+ z(l, "prefixCls");
32
+ const x = [{
32
33
  key: "default",
33
- icon: e(k, null, null),
34
- color: s,
35
- ext: []
34
+ icon: e($, null, null),
35
+ color: u,
36
+ ext: /* @__PURE__ */ new Set([])
36
37
  }, {
37
38
  key: "excel",
38
- icon: e(D, null, null),
39
+ icon: e(G, null, null),
39
40
  color: "#22b35e",
40
- ext: ["xlsx", "xls"]
41
+ ext: re
41
42
  }, {
42
43
  key: "image",
43
44
  icon: e(K, null, null),
44
- color: s,
45
- ext: x
45
+ color: u,
46
+ ext: h
46
47
  }, {
47
48
  key: "markdown",
48
- icon: e(Y, null, null),
49
- color: s,
50
- ext: ["md", "mdx"]
49
+ icon: e(Z, null, null),
50
+ color: u,
51
+ ext: ue
51
52
  }, {
52
53
  key: "pdf",
53
- icon: e(Z, null, null),
54
+ icon: e(Y, null, null),
54
55
  color: "#ff4d4f",
55
- ext: ["pdf"]
56
+ ext: se
56
57
  }, {
57
58
  key: "ppt",
58
59
  icon: e(q, null, null),
59
60
  color: "#ff6e31",
60
- ext: ["ppt", "pptx"]
61
+ ext: me
61
62
  }, {
62
63
  key: "word",
63
64
  icon: e(H, null, null),
64
65
  color: "#1677ff",
65
- ext: ["doc", "docx"]
66
+ ext: fe
66
67
  }, {
67
68
  key: "zip",
68
69
  icon: e(J, null, null),
69
70
  color: "#fab714",
70
- ext: ["zip", "rar", "7z", "tar", "gz"]
71
+ ext: de
71
72
  }, {
72
73
  key: "video",
73
74
  icon: e(le, null, null),
74
75
  color: "#ff4d4f",
75
- ext: ["mp4", "avi", "mov", "wmv", "flv", "mkv"]
76
+ ext: ve
76
77
  }, {
77
78
  key: "audio",
78
79
  icon: e(ee, null, null),
79
80
  color: "#8c8c8c",
80
- ext: ["mp3", "wav", "flac", "ape", "aac", "ogg"]
81
+ ext: xe
81
82
  }];
82
- function p(n, t) {
83
- return t.some((c) => n.toLowerCase() === `.${c}`);
84
- }
85
- function P(n) {
83
+ function p(n) {
86
84
  let t = n;
87
- const c = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
85
+ const r = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
88
86
  let d = 0;
89
- for (; t >= 1024 && d < c.length - 1; )
87
+ for (; t >= 1024 && d < r.length - 1; )
90
88
  t /= 1024, d++;
91
- return `${t.toFixed(0)} ${c[d]}`;
89
+ return `${t.toFixed(0)} ${r[d]}`;
92
90
  }
93
- const b = ie(), E = o(() => b.value.disabled), j = o(() => l.item.name), F = o(() => l.item.size), u = o(() => l.item.percent), a = o(() => l.item.status || "done"), y = o(() => l.item.description), {
94
- getPrefixCls: z
95
- } = re(), C = o(() => z("attachment", l.prefixCls)), i = `${C.value}-list-card`, [O, R, B] = te(C), T = U("file-list-card-container"), r = o(() => {
96
- const n = j.value || "", t = n.match(/^(.*)\.[^.]+$/);
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
- }), A = o(() => p(r.value.nameSuffix, x)), $ = o(() => y.value ? y.value : a.value === "uploading" ? `${u.value || 0}%` : a.value === "error" ? l.item.response || v : F.value ? P(F.value) : v), w = o(() => {
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 = g.find((t) => t.key === l.icon);
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: c
119
- } of g)
120
- if (p(r.value.nameSuffix, n))
116
+ color: r
117
+ } of x)
118
+ if (P(a.value.nameSuffix, n))
121
119
  return {
122
120
  icon: t,
123
- iconColor: c
121
+ iconColor: r
124
122
  };
125
123
  return {
126
- icon: e(k, {
124
+ icon: e($, {
127
125
  key: "defaultIcon"
128
126
  }, null),
129
- iconColor: s
127
+ iconColor: u
130
128
  };
131
- }), [L, I] = oe();
132
- X(() => l.item.originFileObj, () => {
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
- }), G(() => {
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 || L.value), f = o(() => l.type === "image" || l.type !== "file" && A.value && (l.item.originFileObj || m.value)), N = o(() => f.value ? e(h, null, [m.value && e(ae, W(l.imageProps, {
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), a.value !== "done" && e("div", {
146
+ }), null), c.value !== "done" && e("div", {
149
147
  class: `${i}-img-mask`
150
- }, [a.value === "uploading" && u.value !== void 0 && e(ce, {
151
- percent: u.value,
148
+ }, [c.value === "uploading" && s.value !== void 0 && e(ae, {
149
+ percent: s.value,
152
150
  prefixCls: i
153
- }, null), a.value === "error" && e("div", {
151
+ }, null), c.value === "error" && e("div", {
154
152
  class: `${i}-desc`
155
153
  }, [e("div", {
156
154
  class: `${i}-ellipsis-prefix`
157
- }, [$.value])])])]) : e(h, null, [e("div", {
155
+ }, [C.value])])])]) : e(E, null, [e("div", {
158
156
  class: `${i}-icon`,
159
157
  style: {
160
- color: w.value.iconColor
158
+ color: S.value.iconColor
161
159
  }
162
- }, [w.value.icon]), e("div", {
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
- }, [r.value.namePrefix ?? v]), e("div", {
166
+ }, [a.value.namePrefix ?? v]), e("div", {
169
167
  class: `${i}-ellipsis-suffix`
170
- }, [r.value.nameSuffix])]), e("div", {
168
+ }, [a.value.nameSuffix])]), e("div", {
171
169
  class: `${i}-desc`
172
170
  }, [e("div", {
173
171
  class: `${i}-ellipsis-prefix`
174
- }, [$.value])])])]));
175
- return S({
176
- nativeElement: T
177
- }), () => O(e("div", {
172
+ }, [C.value])])])]));
173
+ return k({
174
+ nativeElement: B
175
+ }), () => X(e("div", {
178
176
  class: Q(i, {
179
- [`${i}-status-${a.value}`]: a.value,
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, B),
180
+ }, l.className, R.value, A),
183
181
  style: l.style,
184
182
  ref: "file-list-card-container"
185
- }, [N.value, !E.value && l.onRemove && e("button", {
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
- Ce as default
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
+ };
@@ -1,31 +1,35 @@
1
- const E = (e) => e.indexOf("image/") === 0;
2
- function g(e) {
3
- return new Promise((a) => {
4
- if (!e || !e.type || !E(e.type)) {
5
- a("");
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: t, height: c } = n, o = t / c, i = o > 1 ? 200 : 200 * o, r = o > 1 ? 200 / o : 200, s = document.createElement("canvas");
11
- s.width = i, s.height = r, s.style.cssText = `position: fixed; left: 0; top: 0; width: ${i}px; height: ${r}px; z-index: 9999; display: none;`, document.body.appendChild(s), s.getContext("2d").drawImage(n, 0, 0, i, r);
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), a(d);
14
- }, n.crossOrigin = "anonymous", e.type.startsWith("image/svg+xml")) {
15
- const t = new FileReader();
16
- t.onload = () => {
17
- t.result && typeof t.result == "string" && (n.src = t.result);
18
- }, t.readAsDataURL(e);
19
- } else if (e.type.startsWith("image/gif")) {
20
- const t = new FileReader();
21
- t.onload = () => {
22
- t.result && a(t.result);
23
- }, t.readAsDataURL(e);
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(e);
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
- g as previewImage
33
+ R as matchExt,
34
+ m as previewImage
31
35
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as q, mergeDefaults as F, toRef as p, useAttrs as G, useSlots as J, computed as A, mergeProps as v, ref as d, watch as g, watchPostEffect as Q, onWatcherCleanup as Y, unref as o, nextTick as Z, createVNode as x, renderList as k } from "vue";
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 S from "../_util/hooks/use-state.mjs";
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
- p(s, "roles"), p(s, "items"), p(s, "prefixCls");
34
- const w = G(), r = J(), B = A(() => et(v(N, w), {
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
- })), R = d(s.items), P = d(s.roles);
37
+ })), P = d(s.items), I = d(s.roles);
38
38
  g(() => s.items, () => {
39
- R.value = s.items;
39
+ P.value = s.items;
40
40
  }), g(() => s.roles, () => {
41
- P.value = s.roles;
41
+ I.value = s.roles;
42
42
  });
43
- const i = d(null), u = d({}), {
43
+ const n = d(null), u = d({}), {
44
44
  getPrefixCls: H
45
- } = nt(), I = H("bubble", s.prefixCls), E = `${I}-list`, [U, $, z] = at(I), [X, D] = S(!1);
45
+ } = nt(), E = H("bubble", s.prefixCls), D = `${E}-list`, [U, $, z] = at(E), [X, T] = R(!1);
46
46
  Q(() => {
47
- D(!0), Y(() => {
48
- D(!1);
47
+ T(!0), Y(() => {
48
+ T(!1);
49
49
  });
50
50
  });
51
- const y = rt(R, P), [m, K] = st(y), [T, C] = S(!0), [h, V] = S(0), M = (t) => {
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
- C(a.scrollHeight - Math.abs(a.scrollTop) - a.clientHeight <= it);
53
+ h(a.scrollHeight - Math.abs(a.scrollTop) - a.clientHeight <= it);
54
54
  };
55
- g(h, () => {
56
- s.autoScroll && o(i) && o(T) && Z(() => {
57
- o(i).scrollTo({
58
- top: o(i).scrollHeight
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: n
67
+ nativeElement: i
68
68
  } = e, {
69
69
  top: c = 0,
70
70
  bottom: f = 0
71
- } = (n == null ? void 0 : n.getBoundingClientRect()) ?? {}, {
71
+ } = (i == null ? void 0 : i.getBoundingClientRect()) ?? {}, {
72
72
  top: l,
73
73
  bottom: j
74
- } = o(i).getBoundingClientRect();
75
- c < j && f > l && (V(o(h) + 1), C(!0));
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(h) + 1);
80
+ s.autoScroll && V(o(p) + 1);
81
81
  }), W = A(() => ({
82
82
  onUpdate: O
83
83
  }));
84
84
  return L({
85
- nativeElement: i,
85
+ nativeElement: n,
86
86
  scrollTo: ({
87
87
  key: t,
88
88
  offset: a,
89
89
  behavior: e = "smooth",
90
- block: n
90
+ block: i
91
91
  }) => {
92
92
  if (typeof a == "number")
93
- o(i).scrollTo({
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
- C(f === o(m).length - 1), c.nativeElement.scrollIntoView({
101
+ h(f === o(m).length - 1), c.nativeElement.scrollIntoView({
102
102
  behavior: e,
103
- block: n
103
+ block: i
104
104
  });
105
105
  }
106
106
  }
107
107
  }
108
- }), () => U(x(lt, {
108
+ }), () => U(S(lt, {
109
109
  value: W.value
110
110
  }, {
111
- default: () => [x("div", v(B.value, {
112
- class: _(E, s.rootClassName, $.value, z, {
113
- [`${E}-reach-end`]: T.value
111
+ default: () => [S("div", x(B.value, {
112
+ class: _(D, s.rootClassName, $.value, z, {
113
+ [`${D}-reach-end`]: C.value
114
114
  }),
115
- ref: i,
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 n, c, f;
123
- return x(ot, v(e, {
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: ((n = r.header) == null ? void 0 : n.call(r, {
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 p } from "./bubble/index.mjs";
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 l } from "./sender/index.mjs";
8
- import { default as i } from "./attachments/index.mjs";
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 { _ as n } from "./x-provider/index-chunk.mjs";
11
- import { defaultPrefixCls as h, default as C } from "./x-provider/hooks/use-x-provider-context.mjs";
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 c } from "./conversations/Conversations.mjs";
14
+ import { default as A } from "./conversations/Conversations.mjs";
14
15
  import { default as S } from "./welcome/Welcome.mjs";
15
- import { default as A } from "./prompts/Prompts.mjs";
16
- import { default as T } from "./suggestion/Suggestion.mjs";
17
- import { default as _ } from "./thought-chain/ThoughtChain.mjs";
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
- i as Attachments,
20
- p as Bubble,
21
+ q as Actions,
22
+ x as Attachments,
23
+ u as Bubble,
21
24
  g as BubbleList,
22
- c as Conversations,
23
- A as Prompts,
24
- l as Sender,
25
- T as Suggestion,
26
- _ as ThoughtChain,
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
- n as XProvider,
29
- h as defaultPrefixCls,
30
- C as useXProviderContext
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
- const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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
- T as c
37
+ z as c
35
38
  };