ant-design-x-vue 1.2.6 → 1.2.8

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 (86) hide show
  1. package/dist/index.esm.js +39148 -0
  2. package/dist/index.umd.js +244 -13
  3. package/es/_util/cssinjs/StyleContext.mjs +48 -42
  4. package/es/_util/motion.mjs +11 -13
  5. package/es/attachments/Attachments2.mjs +14 -14
  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 +81 -36
  17. package/es/prompts/Prompts.mjs +16 -13
  18. package/es/prompts/index.mjs +6 -3
  19. package/es/sender/Sender.mjs +154 -134
  20. package/es/sender/components/ActionButton/index.mjs +15 -12
  21. package/es/sender/components/ClearButton.mjs +15 -12
  22. package/es/sender/components/LoadingButton.mjs +16 -13
  23. package/es/sender/components/SendButton.mjs +17 -14
  24. package/es/sender/components/SpeechButton/RecordingIcon.mjs +21 -18
  25. package/es/sender/components/SpeechButton/index.mjs +31 -25
  26. package/es/sender/index.mjs +9 -6
  27. package/es/suggestion/Suggestion.mjs +155 -50
  28. package/es/suggestion/index.mjs +6 -3
  29. package/es/theme/genStyleUtils.mjs +7 -8
  30. package/es/thought-chain/ThoughtChain.mjs +17 -18
  31. package/es/thought-chain/index.mjs +6 -3
  32. package/es/welcome/Welcome.mjs +45 -37
  33. package/es/welcome/index.mjs +6 -3
  34. package/es/x-provider/index.mjs +9 -6
  35. package/es/x-provider/index2.mjs +5 -5
  36. package/lib/_util/cssinjs/StyleContext.js +1 -1
  37. package/lib/_util/motion.js +1 -1
  38. package/lib/attachments/Attachments2.js +2 -2
  39. package/lib/attachments/FileList/FileListCard.js +1 -1
  40. package/lib/attachments/index.js +1 -1
  41. package/lib/bubble/Bubble.js +1 -1
  42. package/lib/bubble/BubbleList.js +1 -1
  43. package/lib/bubble/index.js +1 -1
  44. package/lib/components.js +1 -0
  45. package/lib/components.ts2.js +1 -0
  46. package/lib/conversations/Conversations.js +1 -1
  47. package/lib/conversations/index.js +1 -1
  48. package/lib/hooks.js +1 -0
  49. package/lib/index.js +1 -1
  50. package/lib/prompts/Prompts.js +1 -1
  51. package/lib/prompts/index.js +1 -1
  52. package/lib/sender/Sender.js +1 -1
  53. package/lib/sender/components/ActionButton/index.js +1 -1
  54. package/lib/sender/components/ClearButton.js +1 -1
  55. package/lib/sender/components/LoadingButton.js +1 -1
  56. package/lib/sender/components/SendButton.js +1 -1
  57. package/lib/sender/components/SpeechButton/RecordingIcon.js +1 -1
  58. package/lib/sender/components/SpeechButton/index.js +1 -1
  59. package/lib/sender/index.js +1 -1
  60. package/lib/suggestion/Suggestion.js +1 -1
  61. package/lib/suggestion/index.js +1 -1
  62. package/lib/theme/genStyleUtils.js +1 -1
  63. package/lib/thought-chain/ThoughtChain.js +1 -1
  64. package/lib/thought-chain/index.js +1 -1
  65. package/lib/welcome/Welcome.js +1 -1
  66. package/lib/welcome/index.js +1 -1
  67. package/lib/x-provider/index.js +1 -1
  68. package/lib/x-provider/index2.js +1 -1
  69. package/package.json +6 -5
  70. package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
  71. package/typings/_util/cssinjs/index.d.ts +3 -3
  72. package/typings/attachments/index.d.ts +1 -1
  73. package/typings/bubble/Bubble.vue.d.ts +6 -6
  74. package/typings/bubble/hooks/useTypingConfig.d.ts +1 -1
  75. package/typings/bubble/index.d.ts +12 -12
  76. package/typings/bubble/interface.d.ts +1 -1
  77. package/typings/components.d.ts +9 -0
  78. package/typings/hooks.d.ts +4 -0
  79. package/typings/index.d.ts +9 -13
  80. package/typings/prompts/interface.d.ts +1 -1
  81. package/typings/sender/Sender.vue.d.ts +4 -4
  82. package/typings/sender/SenderHeader.vue.d.ts +12 -10
  83. package/typings/sender/index.d.ts +19 -32
  84. package/typings/sender/interface.d.ts +19 -3
  85. package/typings/sender/useSpeech.d.ts +5 -1
  86. package/typings/welcome/interface.d.ts +4 -4
@@ -1,7 +1,8 @@
1
- import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, watch as x, unref as d, provide as b } from "vue";
2
- import P from "./Cache.mjs";
3
- import { withInstall as v, arrayType as u, booleanType as l, someType as I, stringType as f, objectType as E } from "../type.mjs";
4
- const J = "data-token-hash", h = "data-css-hash", V = "data-cache-path", i = "__cssinjs_instance__";
1
+ import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, h as P, watch as v, unref as d, provide as x } from "vue";
2
+ import b from "./Cache.mjs";
3
+ import { withInstall as I, arrayType as u, booleanType as l, someType as E, stringType as f, objectType as N } from "../type.mjs";
4
+ import { StyleProvider as j } from "ant-design-vue";
5
+ const q = "data-token-hash", h = "data-css-hash", D = "data-cache-path", i = "__cssinjs_instance__";
5
6
  function s() {
6
7
  const e = Math.random().toString(12).slice(2);
7
8
  if (typeof document < "u" && document.head && document.body) {
@@ -11,22 +12,22 @@ function s() {
11
12
  Array.from(o).forEach((t) => {
12
13
  t[i] = t[i] || e, t[i] === e && document.head.insertBefore(t, n);
13
14
  });
14
- const c = {};
15
+ const r = {};
15
16
  Array.from(document.querySelectorAll(`style[${h}]`)).forEach((t) => {
16
- var r;
17
- const a = t.getAttribute(h);
18
- c[a] ? t[i] === e && ((r = t.parentNode) == null || r.removeChild(t)) : c[a] = !0;
17
+ var a;
18
+ const c = t.getAttribute(h);
19
+ r[c] ? t[i] === e && ((a = t.parentNode) == null || a.removeChild(t)) : r[c] = !0;
19
20
  });
20
21
  }
21
- return new P(e);
22
+ return new b(e);
22
23
  }
23
- const p = Symbol("StyleContextKey"), N = () => {
24
- var n, c, t;
24
+ const p = Symbol("StyleContextKey"), w = () => {
25
+ var n, r, t;
25
26
  const e = T();
26
27
  let o;
27
28
  if (e && e.appContext) {
28
- const a = (t = (c = (n = e.appContext) == null ? void 0 : n.config) == null ? void 0 : c.globalProperties) == null ? void 0 : t.__ANTDV_CSSINJS_CACHE__;
29
- a ? o = a : (o = s(), e.appContext.config.globalProperties && (e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
29
+ const c = (t = (r = (n = e.appContext) == null ? void 0 : n.config) == null ? void 0 : r.globalProperties) == null ? void 0 : t.__ANTDV_CSSINJS_CACHE__;
30
+ c ? o = c : (o = s(), e.appContext.config.globalProperties && (e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
30
31
  } else
31
32
  o = s();
32
33
  return o;
@@ -35,32 +36,32 @@ const p = Symbol("StyleContextKey"), N = () => {
35
36
  defaultCache: !0,
36
37
  hashPriority: "low"
37
38
  }, y = () => {
38
- const e = N();
39
+ const e = w();
39
40
  return A(p, C({
40
41
  ...m,
41
42
  cache: e
42
43
  }));
43
- }, _ = (e) => {
44
+ }, S = (e) => {
44
45
  const o = y(), n = C({
45
46
  ...m,
46
47
  cache: s()
47
48
  });
48
- return x([() => d(e), o], () => {
49
- const c = {
49
+ return v([() => d(e), o], () => {
50
+ const r = {
50
51
  ...o.value
51
52
  }, t = d(e);
52
- Object.keys(t).forEach((r) => {
53
- const S = t[r];
54
- t[r] !== void 0 && (c[r] = S);
53
+ Object.keys(t).forEach((a) => {
54
+ const _ = t[a];
55
+ t[a] !== void 0 && (r[a] = _);
55
56
  });
56
57
  const {
57
- cache: a
58
+ cache: c
58
59
  } = t;
59
- c.cache = c.cache || s(), c.defaultCache = !a && o.value.defaultCache, n.value = c;
60
+ r.cache = r.cache || s(), r.defaultCache = !c && o.value.defaultCache, n.value = r;
60
61
  }, {
61
62
  immediate: !0
62
- }), b(p, n), n;
63
- }, j = () => ({
63
+ }), x(p, n), n;
64
+ }, H = () => ({
64
65
  autoClear: l(),
65
66
  /** @private Test only. Not work in production. */
66
67
  mock: f(),
@@ -68,13 +69,13 @@ const p = Symbol("StyleContextKey"), N = () => {
68
69
  * Only set when you need ssr to extract style on you own.
69
70
  * If not provided, it will auto create <style /> on the end of Provider in server side.
70
71
  */
71
- cache: E(),
72
+ cache: N(),
72
73
  /** Tell children that this context is default generated context */
73
74
  defaultCache: l(),
74
75
  /** Use `:where` selector to reduce hashId css selector priority */
75
76
  hashPriority: f(),
76
77
  /** Tell cssinjs where to inject style in */
77
- container: I(),
78
+ container: E(),
78
79
  /** Component wil render inline `<style />` for fallback in SSR. Not recommend. */
79
80
  ssrInline: l(),
80
81
  /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
@@ -85,32 +86,37 @@ const p = Symbol("StyleContextKey"), N = () => {
85
86
  * Please note that `linters` do not support dynamic update.
86
87
  */
87
88
  linters: u()
88
- }), w = v(/* @__PURE__ */ g({
89
- name: "AStyleProvider",
89
+ }), R = I(/* @__PURE__ */ g({
90
+ name: "AXStyleProvider",
90
91
  inheritAttrs: !1,
91
- props: j(),
92
+ props: H(),
92
93
  setup(e, {
93
94
  slots: o
94
95
  }) {
95
- return _(e), () => {
96
- var n;
97
- return (n = o.default) == null ? void 0 : n.call(o);
98
- };
96
+ return S(e), () => P(
97
+ j,
98
+ // @ts-ignore
99
+ e,
100
+ () => {
101
+ var n;
102
+ return (n = o.default) == null ? void 0 : n.call(o);
103
+ }
104
+ );
99
105
  }
100
- })), q = {
106
+ })), M = {
101
107
  useStyleInject: y,
102
- useStyleProvider: _,
103
- StyleProvider: w
108
+ useStyleProvider: S,
109
+ StyleProvider: R
104
110
  };
105
111
  export {
106
- V as ATTR_CACHE_PATH,
112
+ D as ATTR_CACHE_PATH,
107
113
  h as ATTR_MARK,
108
- J as ATTR_TOKEN,
114
+ q as ATTR_TOKEN,
109
115
  i as CSS_IN_JS_INSTANCE,
110
- w as StyleProvider,
116
+ R as StyleProvider,
111
117
  s as createCache,
112
- q as default,
113
- j as styleProviderProps,
118
+ M as default,
119
+ H as styleProviderProps,
114
120
  y as useStyleInject,
115
- _ as useStyleProvider
121
+ S as useStyleProvider
116
122
  };
@@ -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,
@@ -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
+ };