ant-design-x-vue 1.2.6 → 1.2.7

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 (68) hide show
  1. package/dist/index.esm.js +38731 -0
  2. package/dist/index.umd.js +244 -13
  3. package/es/_util/motion.mjs +11 -13
  4. package/es/attachments/Attachments2.mjs +14 -14
  5. package/es/attachments/FileList/FileList2.mjs +10 -12
  6. package/es/attachments/FileList/FileListCard.mjs +21 -21
  7. package/es/attachments/index.mjs +7 -4
  8. package/es/bubble/Bubble.mjs +11 -11
  9. package/es/bubble/BubbleList.mjs +28 -29
  10. package/es/bubble/index.mjs +10 -7
  11. package/es/components.mjs +31 -0
  12. package/es/components.ts2.mjs +35 -0
  13. package/es/conversations/Conversations.mjs +14 -15
  14. package/es/conversations/index.mjs +6 -3
  15. package/es/hooks.mjs +13 -0
  16. package/es/index.mjs +47 -36
  17. package/es/prompts/Prompts.mjs +16 -13
  18. package/es/prompts/index.mjs +6 -3
  19. package/es/sender/Sender.mjs +125 -109
  20. package/es/sender/index.mjs +9 -6
  21. package/es/suggestion/Suggestion.mjs +10 -10
  22. package/es/suggestion/index.mjs +6 -3
  23. package/es/theme/genStyleUtils.mjs +7 -8
  24. package/es/thought-chain/ThoughtChain.mjs +17 -18
  25. package/es/thought-chain/index.mjs +6 -3
  26. package/es/welcome/Welcome.mjs +5 -5
  27. package/es/welcome/index.mjs +6 -3
  28. package/es/x-provider/index.mjs +9 -6
  29. package/es/x-provider/index2.mjs +5 -5
  30. package/lib/_util/motion.js +1 -1
  31. package/lib/attachments/Attachments2.js +2 -2
  32. package/lib/attachments/FileList/FileList2.js +1 -1
  33. package/lib/attachments/FileList/FileListCard.js +1 -1
  34. package/lib/attachments/index.js +1 -1
  35. package/lib/bubble/Bubble.js +1 -1
  36. package/lib/bubble/BubbleList.js +1 -1
  37. package/lib/bubble/index.js +1 -1
  38. package/lib/components.js +1 -0
  39. package/lib/components.ts2.js +1 -0
  40. package/lib/conversations/Conversations.js +1 -1
  41. package/lib/conversations/index.js +1 -1
  42. package/lib/hooks.js +1 -0
  43. package/lib/index.js +1 -1
  44. package/lib/prompts/Prompts.js +1 -1
  45. package/lib/prompts/index.js +1 -1
  46. package/lib/sender/Sender.js +1 -1
  47. package/lib/sender/index.js +1 -1
  48. package/lib/suggestion/Suggestion.js +1 -1
  49. package/lib/suggestion/index.js +1 -1
  50. package/lib/theme/genStyleUtils.js +1 -1
  51. package/lib/thought-chain/ThoughtChain.js +1 -1
  52. package/lib/thought-chain/index.js +1 -1
  53. package/lib/welcome/Welcome.js +1 -1
  54. package/lib/welcome/index.js +1 -1
  55. package/lib/x-provider/index.js +1 -1
  56. package/lib/x-provider/index2.js +1 -1
  57. package/package.json +5 -4
  58. package/typings/attachments/index.d.ts +1 -1
  59. package/typings/bubble/Bubble.vue.d.ts +6 -6
  60. package/typings/bubble/index.d.ts +12 -12
  61. package/typings/components.d.ts +9 -0
  62. package/typings/hooks.d.ts +4 -0
  63. package/typings/index.d.ts +8 -13
  64. package/typings/prompts/interface.d.ts +1 -1
  65. package/typings/sender/Sender.vue.d.ts +4 -4
  66. package/typings/sender/SenderHeader.vue.d.ts +12 -10
  67. package/typings/sender/index.d.ts +19 -32
  68. package/typings/sender/interface.d.ts +13 -3
@@ -1,23 +1,21 @@
1
- import { defaultPrefixCls as r } from "../x-provider/hooks/use-x-provider-context.mjs";
2
- import "vue";
3
- import "../x-provider/context.mjs";
4
- import "ant-design-vue";
5
- const e = () => ({ height: 0, opacity: 0 }), n = (t) => {
6
- const { scrollHeight: o } = t;
7
- return { height: o, opacity: 1 };
8
- }, a = (t) => ({ height: t ? t.offsetHeight : 0 }), i = (t, o) => (o == null ? void 0 : o.deadline) === !0 || o.propertyName === "height", h = (t = r) => ({
1
+ import "../x-provider/index.mjs";
2
+ import { defaultPrefixCls as a } from "../x-provider/hooks/use-x-provider-context.mjs";
3
+ const o = () => ({ height: 0, opacity: 0 }), n = (t) => {
4
+ const { scrollHeight: e } = t;
5
+ return { height: e, opacity: 1 };
6
+ }, r = (t) => ({ height: t ? t.offsetHeight : 0 }), i = (t, e) => (e == null ? void 0 : e.deadline) === !0 || e.propertyName === "height", c = (t = a) => ({
9
7
  motionName: `${t}-motion-collapse`,
10
- onAppearStart: e,
11
- onEnterStart: e,
8
+ onAppearStart: o,
9
+ onEnterStart: o,
12
10
  onAppearActive: n,
13
11
  onEnterActive: n,
14
- onLeaveStart: a,
15
- onLeaveActive: e,
12
+ onLeaveStart: r,
13
+ onLeaveActive: o,
16
14
  onAppearEnd: i,
17
15
  onEnterEnd: i,
18
16
  onLeaveEnd: i,
19
17
  motionDeadline: 500
20
18
  });
21
19
  export {
22
- h as default
20
+ c as default
23
21
  };
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as $, mergeDefaults as q, toRef as T, useSlots as V, computed as f, useTemplateRef as F, watch as X, createVNode as i, Fragment as B } from "vue";
2
2
  import M from "../_util/hooks/use-x-component-config.mjs";
3
- import k from "../x-provider/hooks/use-x-provider-context.mjs";
4
- import "../x-provider/context.mjs";
5
- import "ant-design-vue";
6
- import z from "./PlaceholderUploader.mjs";
3
+ import "../x-provider/index.mjs";
4
+ import k from "./PlaceholderUploader.mjs";
7
5
  import L from "./DropArea.mjs";
8
- import G from "./SilentUploader.mjs";
9
- import { _ as H } from "./FileList/FileList2.mjs";
10
- import { AttachmentContextProvider as J } from "./context.mjs";
11
- import K from "./style/index.mjs";
12
- import Q from "../_util/hooks/use-state.mjs";
6
+ import z from "./SilentUploader.mjs";
7
+ import { _ as G } from "./FileList/FileList2.mjs";
8
+ import { AttachmentContextProvider as H } from "./context.mjs";
9
+ import J from "./style/index.mjs";
10
+ import K from "../_util/hooks/use-state.mjs";
11
+ import "ant-design-vue";
12
+ import Q from "../x-provider/hooks/use-x-provider-context.mjs";
13
13
  function W(e, m) {
14
14
  const s = /* @__PURE__ */ Object.create(null);
15
15
  for (const r in e)
@@ -137,7 +137,7 @@ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
137
137
  const r = V(), {
138
138
  getPrefixCls: d,
139
139
  direction: l
140
- } = k(), t = d("attachment", e.prefixCls), o = M("attachments"), C = f(() => o.value.classNames), y = f(() => o.value.styles), w = F("attachments-container"), O = F("placeholder-uploader"), [I, A, E] = K(t), p = f(() => c(A.value, E)), [v, R] = Q(e.items);
140
+ } = Q(), t = d("attachment", e.prefixCls), o = M("attachments"), C = f(() => o.value.classNames), y = f(() => o.value.styles), w = F("attachments-container"), O = F("placeholder-uploader"), [I, A, E] = J(t), p = f(() => c(A.value, E)), [v, R] = K(e.items);
141
141
  X(() => e.items, () => {
142
142
  R(e.items);
143
143
  });
@@ -163,7 +163,7 @@ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
163
163
  const u = r.placeholder ? r.placeholder({
164
164
  type: n
165
165
  }) : typeof e.placeholder == "function" ? e.placeholder(n) : e.placeholder;
166
- return i(z, {
166
+ return i(k, {
167
167
  placeholder: u,
168
168
  upload: g.value,
169
169
  prefixCls: t,
@@ -188,12 +188,12 @@ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
188
188
  }));
189
189
  }
190
190
  }
191
- }), () => I(i(J, {
191
+ }), () => I(i(H, {
192
192
  value: {
193
193
  disabled: e.disabled
194
194
  }
195
195
  }, {
196
- default: () => [e.children ? i(B, null, [i(G, {
196
+ default: () => [e.children ? i(B, null, [i(z, {
197
197
  upload: g.value,
198
198
  rootClassName: e.rootClassName,
199
199
  ref: "attachments-upload",
@@ -213,7 +213,7 @@ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
213
213
  },
214
214
  dir: l.value || "ltr",
215
215
  ref: "attachments-container"
216
- }, [i(H, {
216
+ }, [i(G, {
217
217
  prefixCls: t,
218
218
  items: v.value,
219
219
  onRemove: U,
@@ -1246,18 +1246,16 @@ const Me = 1, on = /* @__PURE__ */ ze({
1246
1246
  name: "AXAttachmentsFileList",
1247
1247
  __name: "FileList",
1248
1248
  props: {
1249
- prefixCls: null,
1250
- items: null,
1251
- onRemove: {
1252
- type: Function
1253
- },
1254
- overflow: null,
1255
- upload: null,
1256
- imageProps: null,
1257
- listClassName: null,
1258
- listStyle: null,
1259
- itemClassName: null,
1260
- itemStyle: null
1249
+ prefixCls: {},
1250
+ items: {},
1251
+ onRemove: {},
1252
+ overflow: {},
1253
+ upload: {},
1254
+ imageProps: {},
1255
+ listClassName: {},
1256
+ listStyle: {},
1257
+ itemClassName: {},
1258
+ itemStyle: {}
1261
1259
  },
1262
1260
  setup(e) {
1263
1261
  const r = dt(() => `${e.prefixCls}-list`), t = mt("file-list-container"), [n, a] = I(!1), i = ht();
@@ -3,13 +3,13 @@ import { c as W } from "../Attachments2.mjs";
3
3
  import { A as D } from "./AudioIcon2.mjs";
4
4
  import K from "./VideoIcon.mjs";
5
5
  import { useAttachmentContextInject as Y } from "../context.mjs";
6
- import Z from "../../x-provider/hooks/use-x-provider-context.mjs";
7
- import "../../x-provider/context.mjs";
8
- import { Image as q, Progress as H } from "ant-design-vue";
9
- import { previewImage as J } from "../util.mjs";
10
- import Q from "../style/index.mjs";
11
- import _ from "../../_util/hooks/use-state.mjs";
12
- import { F as ee, a as le, b as te, c as ie, d as ne, e as oe, f as ae, g as se, C as ce } from "./FileList2.mjs";
6
+ import "../../x-provider/index.mjs";
7
+ import { previewImage as Z } from "../util.mjs";
8
+ import q from "../style/index.mjs";
9
+ import H from "../../_util/hooks/use-state.mjs";
10
+ import { Image as J, Progress as Q } from "ant-design-vue";
11
+ import { F as _, a as ee, b as le, c as te, d as ie, e as ne, f as oe, g as ae, C as se } from "./FileList2.mjs";
12
+ import ce from "../../x-provider/hooks/use-x-provider-context.mjs";
13
13
  const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
14
14
  name: "AXAttachmentsFileListCard",
15
15
  __name: "FileListCard",
@@ -28,31 +28,31 @@ const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
28
28
  }) {
29
29
  M(l, "prefixCls");
30
30
  const x = ["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg"], P = [{
31
- icon: e(ee, null, null),
31
+ icon: e(_, null, null),
32
32
  color: "#22b35e",
33
33
  ext: ["xlsx", "xls"]
34
34
  }, {
35
- icon: e(le, null, null),
35
+ icon: e(ee, null, null),
36
36
  color: d,
37
37
  ext: x
38
38
  }, {
39
- icon: e(te, null, null),
39
+ icon: e(le, null, null),
40
40
  color: d,
41
41
  ext: ["md", "mdx"]
42
42
  }, {
43
- icon: e(ie, null, null),
43
+ icon: e(te, null, null),
44
44
  color: "#ff4d4f",
45
45
  ext: ["pdf"]
46
46
  }, {
47
- icon: e(ne, null, null),
47
+ icon: e(ie, null, null),
48
48
  color: "#ff6e31",
49
49
  ext: ["ppt", "pptx"]
50
50
  }, {
51
- icon: e(oe, null, null),
51
+ icon: e(ne, null, null),
52
52
  color: "#1677ff",
53
53
  ext: ["doc", "docx"]
54
54
  }, {
55
- icon: e(ae, null, null),
55
+ icon: e(oe, null, null),
56
56
  color: "#fab714",
57
57
  ext: ["zip", "rar", "7z", "tar", "gz"]
58
58
  }, {
@@ -77,7 +77,7 @@ const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
77
77
  }
78
78
  const y = Y(), E = n(() => y.value.disabled), O = n(() => l.item.name), p = n(() => l.item.size), r = n(() => l.item.percent), a = n(() => l.item.status || "done"), F = n(() => l.item.description), {
79
79
  getPrefixCls: R
80
- } = Z(), C = n(() => R("attachment", l.prefixCls)), t = `${C.value}-list-card`, [j, z, A] = Q(C), B = V("file-list-card-container"), c = n(() => {
80
+ } = ce(), C = n(() => R("attachment", l.prefixCls)), t = `${C.value}-list-card`, [j, z, A] = q(C), B = V("file-list-card-container"), c = n(() => {
81
81
  const o = O.value || "", i = o.match(/^(.*)\.[^.]+$/);
82
82
  return {
83
83
  namePrefix: i ? i[1] : o,
@@ -95,16 +95,16 @@ const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
95
95
  iconColor: s
96
96
  };
97
97
  return {
98
- icon: e(se, {
98
+ icon: e(ae, {
99
99
  key: "defaultIcon"
100
100
  }, null),
101
101
  iconColor: d
102
102
  };
103
- }), [L, w] = _();
103
+ }), [L, w] = H();
104
104
  U(() => l.item.originFileObj, () => {
105
105
  if (l.item.originFileObj) {
106
106
  let o = !0;
107
- J(l.item.originFileObj).then((i) => {
107
+ Z(l.item.originFileObj).then((i) => {
108
108
  o && w(i);
109
109
  }), X(() => {
110
110
  o = !1;
@@ -114,12 +114,12 @@ const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
114
114
  }, {
115
115
  immediate: !0
116
116
  });
117
- const u = n(() => l.item.thumbUrl || l.item.url || L.value), m = n(() => T.value && (l.item.originFileObj || u.value)), k = n(() => m.value ? e(S, null, [u.value && e(q, G(l.imageProps, {
117
+ const u = n(() => l.item.thumbUrl || l.item.url || L.value), m = n(() => T.value && (l.item.originFileObj || u.value)), k = n(() => m.value ? e(S, null, [u.value && e(J, G(l.imageProps, {
118
118
  alt: "preview",
119
119
  src: u.value
120
120
  }), null), a.value !== "done" && e("div", {
121
121
  class: `${t}-img-mask`
122
- }, [a.value === "uploading" && r.value !== void 0 && e(H, {
122
+ }, [a.value === "uploading" && r.value !== void 0 && e(Q, {
123
123
  percent: r.value,
124
124
  prefixCls: t
125
125
  }, null), a.value === "error" && e("div", {
@@ -160,7 +160,7 @@ const v = " ", d = "#8c8c8c", Ie = /* @__PURE__ */ N({
160
160
  onClick: () => {
161
161
  l.onRemove(l.item);
162
162
  }
163
- }, [e(ce, null, null)])]));
163
+ }, [e(se, null, null)])]));
164
164
  }
165
165
  });
166
166
  export {
@@ -1,12 +1,15 @@
1
- import { _ as t } from "./Attachments2.mjs";
1
+ import { _ as o } from "./Attachments2.mjs";
2
2
  import "vue";
3
3
  import "ant-design-vue";
4
4
  import "./context.mjs";
5
5
  import m from "./FileList/FileListCard.mjs";
6
- const p = Object.assign(t, {
6
+ const n = Object.assign(o, {
7
7
  FileCard: m
8
8
  });
9
+ n.install = function(t) {
10
+ return t.component(n.name, n), t.component(m.name, m), t;
11
+ };
9
12
  export {
10
- p as Attachments,
11
- p as default
13
+ n as Attachments,
14
+ n as default
12
15
  };
@@ -2,13 +2,13 @@ import { defineComponent as j, mergeDefaults as D, toRef as h, useSlots as H, re
2
2
  import { a as K } from "../attachments/Attachments2.mjs";
3
3
  import { Avatar as L } from "ant-design-vue";
4
4
  import M from "../_util/hooks/use-x-component-config.mjs";
5
- import O from "../x-provider/hooks/use-x-provider-context.mjs";
6
- import "../x-provider/context.mjs";
7
- import Q from "./hooks/useTypedEffect.mjs";
8
- import W from "./hooks/useTypingConfig.mjs";
9
- import Y from "./loading.mjs";
10
- import Z from "./style/index.mjs";
11
- import { useBubbleContextInject as U } from "./context.mjs";
5
+ import "../x-provider/index.mjs";
6
+ import O from "./hooks/useTypedEffect.mjs";
7
+ import Q from "./hooks/useTypingConfig.mjs";
8
+ import W from "./loading.mjs";
9
+ import Y from "./style/index.mjs";
10
+ import { useBubbleContextInject as Z } from "./context.mjs";
11
+ import U from "../x-provider/hooks/use-x-provider-context.mjs";
12
12
  const ie = /* @__PURE__ */ j({
13
13
  name: "AXBubble",
14
14
  __name: "Bubble",
@@ -54,23 +54,23 @@ const ie = /* @__PURE__ */ j({
54
54
  });
55
55
  const {
56
56
  onUpdate: i
57
- } = k(U()), y = d(null), {
57
+ } = k(Z()), y = d(null), {
58
58
  direction: b,
59
59
  getPrefixCls: R
60
- } = O(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = W(() => e.typing), [s, u] = Q(g, T, P, S), f = d(!1);
60
+ } = U(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = Q(() => e.typing), [s, u] = O(g, T, P, S), f = d(!1);
61
61
  N(s, () => {
62
62
  i == null || i();
63
63
  }), q(() => {
64
64
  var o;
65
65
  !u.value && !e.loading ? f.value || (f.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : f.value = !1;
66
66
  });
67
- const [V, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
67
+ const [V, w, B] = Y(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
68
68
  [`${t}-rtl`]: b.value === "rtl"
69
69
  }, {
70
70
  [`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !C.value
71
71
  }]), F = r(() => a.avatar ? a.avatar() : z(e.avatar) ? e.avatar : l(L, e.avatar, null)), I = r(() => a.message ? a.message({
72
72
  content: s.value
73
- }) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
73
+ }) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(W, {
74
74
  prefixCls: t
75
75
  }, null) : l(G, null, [I.value, u.value && c(C)])), A = r(() => {
76
76
  const o = l("div", {
@@ -2,16 +2,15 @@ import { defineComponent as M, mergeDefaults as O, toRef as g, useAttrs as W, me
2
2
  import { a as J, c as Q } from "../attachments/Attachments2.mjs";
3
3
  import { useEventCallback as Y } from "../_util/hooks/use-event-callback.mjs";
4
4
  import Z from "../_util/pick-attrs.mjs";
5
- import _ from "../x-provider/hooks/use-x-provider-context.mjs";
6
- import "../x-provider/context.mjs";
7
- import "ant-design-vue";
8
- import tt from "./Bubble.mjs";
9
- import et from "./hooks/useDisplayData.mjs";
10
- import ot from "./hooks/useListData.mjs";
11
- import st from "./style/index.mjs";
5
+ import "../x-provider/index.mjs";
6
+ import _ from "./Bubble.mjs";
7
+ import tt from "./hooks/useDisplayData.mjs";
8
+ import et from "./hooks/useListData.mjs";
9
+ import ot from "./style/index.mjs";
12
10
  import b from "../_util/hooks/use-state.mjs";
13
- import { BubbleContextProvider as lt } from "./context.mjs";
14
- const rt = 1, vt = /* @__PURE__ */ M({
11
+ import { BubbleContextProvider as st } from "./context.mjs";
12
+ import lt from "../x-provider/hooks/use-x-provider-context.mjs";
13
+ const nt = 1, bt = /* @__PURE__ */ M({
15
14
  name: "AXBubbleList",
16
15
  inheritAttrs: !1,
17
16
  __name: "BubbleList",
@@ -40,22 +39,22 @@ const rt = 1, vt = /* @__PURE__ */ M({
40
39
  }), m(() => e.roles, () => {
41
40
  S.value = e.roles;
42
41
  });
43
- const n = u(null), i = u({}), {
42
+ const r = u(null), i = u({}), {
44
43
  getPrefixCls: N
45
- } = _(), P = N("bubble", e.prefixCls), R = `${P}-list`, [w, B, L] = st(P), [H, I] = b(!1);
44
+ } = lt(), P = N("bubble", e.prefixCls), R = `${P}-list`, [w, B, L] = ot(P), [H, I] = b(!1);
46
45
  j(() => {
47
46
  I(!0), q(() => {
48
47
  I(!1);
49
48
  });
50
49
  });
51
- const U = ot(v, S), [a, $] = et(U), [E, f] = b(!0), [d, y] = b(0), z = (o) => {
50
+ const U = et(v, S), [a, $] = tt(U), [E, f] = b(!0), [d, y] = b(0), z = (o) => {
52
51
  const s = o.target;
53
- f(s.scrollHeight - Math.abs(s.scrollTop) - s.clientHeight <= rt);
52
+ f(s.scrollHeight - Math.abs(s.scrollTop) - s.clientHeight <= nt);
54
53
  };
55
54
  m(d, () => {
56
- e.autoScroll && t(n) && t(E) && F(() => {
57
- t(n).scrollTo({
58
- top: t(n).scrollHeight
55
+ e.autoScroll && t(r) && t(E) && F(() => {
56
+ t(r).scrollTo({
57
+ top: t(r).scrollHeight
59
58
  });
60
59
  });
61
60
  }), m(() => t(a).length, () => {
@@ -64,14 +63,14 @@ const rt = 1, vt = /* @__PURE__ */ M({
64
63
  const s = (o = t(a)[t(a).length - 2]) == null ? void 0 : o.key, l = t(i)[s];
65
64
  if (l) {
66
65
  const {
67
- nativeElement: r
66
+ nativeElement: n
68
67
  } = l, {
69
68
  top: c = 0,
70
69
  bottom: C = 0
71
- } = (r == null ? void 0 : r.getBoundingClientRect()) ?? {}, {
70
+ } = (n == null ? void 0 : n.getBoundingClientRect()) ?? {}, {
72
71
  top: p,
73
72
  bottom: K
74
- } = t(n).getBoundingClientRect();
73
+ } = t(r).getBoundingClientRect();
75
74
  c < K && C > p && (y(t(d) + 1), f(!0));
76
75
  }
77
76
  }
@@ -82,15 +81,15 @@ const rt = 1, vt = /* @__PURE__ */ M({
82
81
  onUpdate: X
83
82
  }));
84
83
  return D({
85
- nativeElement: n,
84
+ nativeElement: r,
86
85
  scrollTo: ({
87
86
  key: o,
88
87
  offset: s,
89
88
  behavior: l = "smooth",
90
- block: r
89
+ block: n
91
90
  }) => {
92
91
  if (typeof s == "number")
93
- t(n).scrollTo({
92
+ t(r).scrollTo({
94
93
  top: s,
95
94
  behavior: l
96
95
  });
@@ -100,28 +99,28 @@ const rt = 1, vt = /* @__PURE__ */ M({
100
99
  const C = t(a).findIndex((p) => p.key === o);
101
100
  f(C === t(a).length - 1), c.nativeElement.scrollIntoView({
102
101
  behavior: l,
103
- block: r
102
+ block: n
104
103
  });
105
104
  }
106
105
  }
107
106
  }
108
- }), () => w(x(lt, {
107
+ }), () => w(x(st, {
109
108
  value: k.value
110
109
  }, {
111
110
  default: () => [x("div", h(A, {
112
111
  class: Q(R, e.rootClassName, B.value, L, {
113
112
  [`${R}-reach-end`]: E.value
114
113
  }),
115
- ref: n,
114
+ ref: r,
116
115
  onScroll: z
117
116
  }), [t(a).map(({
118
117
  key: o,
119
118
  onTypingComplete: s,
120
119
  ...l
121
- }) => x(tt, h(l, {
120
+ }) => x(_, h(l, {
122
121
  key: o,
123
- ref: (r) => {
124
- r ? i.value[o] = r : delete i.value[o];
122
+ ref: (n) => {
123
+ n ? i.value[o] = n : delete i.value[o];
125
124
  },
126
125
  typing: H.value ? l.typing : !1,
127
126
  onTypingComplete: () => {
@@ -132,5 +131,5 @@ const rt = 1, vt = /* @__PURE__ */ M({
132
131
  }
133
132
  });
134
133
  export {
135
- vt as default
134
+ bt as default
136
135
  };
@@ -1,10 +1,13 @@
1
- import s from "./Bubble.mjs";
2
- import t from "./BubbleList.mjs";
3
- const m = Object.assign(s, {
4
- List: t
1
+ import e from "./Bubble.mjs";
2
+ import o from "./BubbleList.mjs";
3
+ const t = Object.assign(e, {
4
+ List: o
5
5
  });
6
+ t.install = function(n) {
7
+ return n.component(t.name, t), n.component(o.name, o), n;
8
+ };
6
9
  export {
7
- m as Bubble,
8
- t as BubbleList,
9
- m as default
10
+ t as Bubble,
11
+ o as BubbleList,
12
+ t as default
10
13
  };
@@ -0,0 +1,31 @@
1
+ import "./x-provider/index.mjs";
2
+ import { default as p } from "./bubble/index.mjs";
3
+ import "./conversations/index.mjs";
4
+ import "./welcome/index.mjs";
5
+ import "./prompts/index.mjs";
6
+ import "./suggestion/index.mjs";
7
+ import { default as l } from "./sender/index.mjs";
8
+ import { default as i } from "./attachments/index.mjs";
9
+ import "./thought-chain/index.mjs";
10
+ import { _ as n } from "./x-provider/index2.mjs";
11
+ import { defaultPrefixCls as h, default as C } from "./x-provider/hooks/use-x-provider-context.mjs";
12
+ import { default as g } from "./bubble/BubbleList.mjs";
13
+ import { default as c } from "./conversations/Conversations.mjs";
14
+ 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";
18
+ export {
19
+ i as Attachments,
20
+ p as Bubble,
21
+ g as BubbleList,
22
+ c as Conversations,
23
+ A as Prompts,
24
+ l as Sender,
25
+ T as Suggestion,
26
+ _ as ThoughtChain,
27
+ S as Welcome,
28
+ n as XProvider,
29
+ h as defaultPrefixCls,
30
+ C as useXProviderContext
31
+ };
@@ -0,0 +1,35 @@
1
+ import "./x-provider/index.mjs";
2
+ import o from "./bubble/index.mjs";
3
+ import "./conversations/index.mjs";
4
+ import "./welcome/index.mjs";
5
+ import "./prompts/index.mjs";
6
+ import "./suggestion/index.mjs";
7
+ import r from "./sender/index.mjs";
8
+ import m from "./attachments/index.mjs";
9
+ import "./thought-chain/index.mjs";
10
+ import { _ as t } from "./x-provider/index2.mjs";
11
+ import i, { defaultPrefixCls as e } from "./x-provider/hooks/use-x-provider-context.mjs";
12
+ import f from "./bubble/BubbleList.mjs";
13
+ import p from "./conversations/Conversations.mjs";
14
+ import n from "./welcome/Welcome.mjs";
15
+ import s from "./prompts/Prompts.mjs";
16
+ import _ from "./suggestion/Suggestion.mjs";
17
+ import a from "./thought-chain/ThoughtChain.mjs";
18
+ const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
19
+ __proto__: null,
20
+ Attachments: m,
21
+ Bubble: o,
22
+ BubbleList: f,
23
+ Conversations: p,
24
+ Prompts: s,
25
+ Sender: r,
26
+ Suggestion: _,
27
+ ThoughtChain: a,
28
+ Welcome: n,
29
+ XProvider: t,
30
+ defaultPrefixCls: e,
31
+ useXProviderContext: i
32
+ }, Symbol.toStringTag, { value: "Module" }));
33
+ export {
34
+ T as c
35
+ };
@@ -1,17 +1,16 @@
1
- import { defineComponent as $, mergeDefaults as S, toRef as m, ref as G, computed as n, watch as V, createVNode as s, mergeProps as X } from "vue";
1
+ import { defineComponent as $, mergeDefaults as S, toRef as n, ref as G, computed as m, watch as V, createVNode as s, mergeProps as X } from "vue";
2
2
  import { a as j, c as v } from "../attachments/Attachments2.mjs";
3
3
  import w from "../_util/pick-attrs.mjs";
4
4
  import F from "./ConversationsItem.mjs";
5
5
  import y from "./GroupTitle.mjs";
6
6
  import M from "../_util/hooks/useMergedState.mjs";
7
- import R from "../x-provider/hooks/use-x-provider-context.mjs";
8
- import "../x-provider/context.mjs";
9
- import "ant-design-vue";
10
- import T from "./hooks/useGroupable.mjs";
11
- import D from "../_util/hooks/use-x-component-config.mjs";
12
- import L from "./style/index.mjs";
13
- import { GroupTitleContextProvider as q } from "./context.mjs";
14
- const _ = /* @__PURE__ */ $({
7
+ import "../x-provider/index.mjs";
8
+ import R from "./hooks/useGroupable.mjs";
9
+ import T from "../_util/hooks/use-x-component-config.mjs";
10
+ import D from "./style/index.mjs";
11
+ import { GroupTitleContextProvider as L } from "./context.mjs";
12
+ import q from "../x-provider/hooks/use-x-provider-context.mjs";
13
+ const I = /* @__PURE__ */ $({
15
14
  name: "AXConversations",
16
15
  __name: "Conversations",
17
16
  props: S({
@@ -35,8 +34,8 @@ const _ = /* @__PURE__ */ $({
35
34
  }),
36
35
  setup(e) {
37
36
  const C = j(e, ["prefixCls", "rootClassName", "items", "activeKey", "defaultActiveKey", "onActiveChange", "menu", "styles", "classNames", "groupable", "class", "style"]);
38
- m(e, "class"), m(e, "activeKey"), m(e, "prefixCls");
39
- const c = G(e.activeKey), f = n(() => w(C, {
37
+ n(e, "class"), n(e, "activeKey"), n(e, "prefixCls");
38
+ const c = G(e.activeKey), f = m(() => w(C, {
40
39
  attr: !0,
41
40
  aria: !0,
42
41
  data: !0
@@ -46,10 +45,10 @@ const _ = /* @__PURE__ */ $({
46
45
  V(() => e.activeKey, () => {
47
46
  c.value = e.activeKey;
48
47
  });
49
- const u = T(() => e.groupable, () => e.items), {
48
+ const u = R(() => e.groupable, () => e.items), {
50
49
  getPrefixCls: k,
51
50
  direction: r
52
- } = R(), l = n(() => k("conversations", e.prefixCls)), i = D("conversations"), [K, A, N] = L(l), g = n(() => v(l.value, i.value.className, e.class, e.rootClassName, A.value, N, {
51
+ } = q(), l = m(() => k("conversations", e.prefixCls)), i = T("conversations"), [K, A, N] = D(l), g = m(() => v(l.value, i.value.className, e.class, e.rootClassName, A.value, N, {
53
52
  [`${l.value}-rtl`]: r.value === "rtl"
54
53
  })), P = (t) => {
55
54
  x(t.key), e.onActiveChange && e.onActiveChange(t.key);
@@ -77,7 +76,7 @@ const _ = /* @__PURE__ */ $({
77
76
  }, null));
78
77
  return u.value.enableGroup ? s("li", {
79
78
  key: t.name || `key-${b}`
80
- }, [s(q, {
79
+ }, [s(L, {
81
80
  value: {
82
81
  prefixCls: l.value
83
82
  }
@@ -101,5 +100,5 @@ const _ = /* @__PURE__ */ $({
101
100
  }
102
101
  });
103
102
  export {
104
- _ as default
103
+ I as default
105
104
  };
@@ -1,5 +1,8 @@
1
- import o from "./Conversations.mjs";
1
+ import n from "./Conversations.mjs";
2
+ n.install = function(o) {
3
+ return o.component(n.name, n), o;
4
+ };
2
5
  export {
3
- o as Conversations,
4
- o as default
6
+ n as Conversations,
7
+ n as default
5
8
  };
package/es/hooks.mjs ADDED
@@ -0,0 +1,13 @@
1
+ import { default as a } from "./x-stream/x-stream.mjs";
2
+ import { default as f } from "./x-request/x-fetch.mjs";
3
+ import { default as s } from "./x-request/x-request.mjs";
4
+ import { XAgent as m, default as X } from "./use-x-agent/use-x-agent.mjs";
5
+ import { default as l } from "./use-x-chat/use-x-chat.mjs";
6
+ export {
7
+ m as XAgent,
8
+ f as XFetch,
9
+ s as XRequest,
10
+ a as XStream,
11
+ X as useXAgent,
12
+ l as useXChat
13
+ };