ant-design-x-vue 1.2.7 → 1.2.9

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 (42) hide show
  1. package/dist/index.esm.js +8533 -8065
  2. package/dist/index.esm.min.js +6 -0
  3. package/dist/index.umd.js +66 -66
  4. package/es/_util/cssinjs/StyleContext.mjs +48 -42
  5. package/es/bubble/Bubble.mjs +40 -38
  6. package/es/bubble/BubbleList.mjs +123 -87
  7. package/es/bubble/style/list.mjs +18 -5
  8. package/es/index.mjs +79 -45
  9. package/es/sender/Sender.mjs +82 -78
  10. package/es/sender/components/ActionButton/index.mjs +15 -12
  11. package/es/sender/components/ClearButton.mjs +15 -12
  12. package/es/sender/components/LoadingButton.mjs +16 -13
  13. package/es/sender/components/SendButton.mjs +17 -14
  14. package/es/sender/components/SpeechButton/RecordingIcon.mjs +21 -18
  15. package/es/sender/components/SpeechButton/index.mjs +31 -25
  16. package/es/suggestion/Suggestion.mjs +153 -48
  17. package/es/welcome/Welcome.mjs +44 -36
  18. package/lib/_util/cssinjs/StyleContext.js +1 -1
  19. package/lib/bubble/Bubble.js +1 -1
  20. package/lib/bubble/BubbleList.js +1 -1
  21. package/lib/bubble/style/list.js +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/sender/Sender.js +1 -1
  24. package/lib/sender/components/ActionButton/index.js +1 -1
  25. package/lib/sender/components/ClearButton.js +1 -1
  26. package/lib/sender/components/LoadingButton.js +1 -1
  27. package/lib/sender/components/SendButton.js +1 -1
  28. package/lib/sender/components/SpeechButton/RecordingIcon.js +1 -1
  29. package/lib/sender/components/SpeechButton/index.js +1 -1
  30. package/lib/suggestion/Suggestion.js +1 -1
  31. package/lib/welcome/Welcome.js +1 -1
  32. package/package.json +3 -2
  33. package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
  34. package/typings/_util/cssinjs/index.d.ts +3 -3
  35. package/typings/bubble/BubbleList.vue.d.ts +47 -1
  36. package/typings/bubble/hooks/useTypingConfig.d.ts +1 -1
  37. package/typings/bubble/index.d.ts +65 -3
  38. package/typings/bubble/interface.d.ts +2 -2
  39. package/typings/index.d.ts +1 -0
  40. package/typings/sender/interface.d.ts +6 -0
  41. package/typings/sender/useSpeech.d.ts +5 -1
  42. package/typings/welcome/interface.d.ts +4 -4
@@ -1,49 +1,52 @@
1
- import { defineComponent as T, createVNode as e, createTextVNode as $ } from "vue";
2
- const t = 1e3, n = 4, r = 140, s = 250, l = 500, c = 0.8, w = /* @__PURE__ */ T({
1
+ import { defineComponent as p, createVNode as e, createTextVNode as I } from "vue";
2
+ const n = 1e3, t = 4, r = 140, s = 250, i = 500, c = 0.8, _ = /* @__PURE__ */ p({
3
3
  name: "AXSenderRecordingIcon",
4
4
  __name: "RecordingIcon",
5
5
  props: {
6
- className: null
6
+ className: null,
7
+ audioIcon: null,
8
+ audioDisabledIcon: null,
9
+ audioRecordingIcon: null
7
10
  },
8
11
  setup(u) {
9
- const i = r / 2;
12
+ const a = r / 2;
10
13
  return () => e("svg", {
11
14
  color: "currentColor",
12
- viewBox: `0 0 ${t} ${t}`,
15
+ viewBox: `0 0 ${n} ${n}`,
13
16
  xmlns: "http://www.w3.org/2000/svg",
14
17
  xmlnsXlink: "http://www.w3.org/1999/xlink",
15
18
  class: u.className
16
- }, [e("title", null, [$("Speech Recording")]), Array.from({
17
- length: n
18
- }).map((d, o) => {
19
- const m = (t - r * n) / (n - 1), g = o * (m + r), a = t / 2 - s / 2, p = t / 2 - l / 2;
19
+ }, [e("title", null, [I("Speech Recording")]), Array.from({
20
+ length: t
21
+ }).map((T, o) => {
22
+ const m = (n - r * t) / (t - 1), d = o * (m + r), l = n / 2 - s / 2, g = n / 2 - i / 2;
20
23
  return e("rect", {
21
24
  fill: "currentColor",
22
- rx: i,
23
- ry: i,
25
+ rx: a,
26
+ ry: a,
24
27
  height: s,
25
28
  width: r,
26
- x: g,
27
- y: a,
29
+ x: d,
30
+ y: l,
28
31
  key: o
29
32
  }, [e("animate", {
30
33
  attributeName: "height",
31
- values: `${s}; ${l}; ${s}`,
34
+ values: `${s}; ${i}; ${s}`,
32
35
  keyTimes: "0; 0.5; 1",
33
36
  dur: `${c}s`,
34
- begin: `${c / n * o}s`,
37
+ begin: `${c / t * o}s`,
35
38
  repeatCount: "indefinite"
36
39
  }, null), e("animate", {
37
40
  attributeName: "y",
38
- values: `${a}; ${p}; ${a}`,
41
+ values: `${l}; ${g}; ${l}`,
39
42
  keyTimes: "0; 0.5; 1",
40
43
  dur: `${c}s`,
41
- begin: `${c / n * o}s`,
44
+ begin: `${c / t * o}s`,
42
45
  repeatCount: "indefinite"
43
46
  }, null)]);
44
47
  })]);
45
48
  }
46
49
  });
47
50
  export {
48
- w as default
51
+ _ as default
49
52
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as c, mergeDefaults as d, computed as o, createVNode as l, mergeProps as m } from "vue";
2
- import { a as p } from "../../../attachments/Attachments2.mjs";
3
- import { theme as f } from "ant-design-vue";
4
- import y from "../ActionButton/index.mjs";
1
+ import { defineComponent as r, mergeDefaults as s, computed as i, createVNode as l, mergeProps as m } from "vue";
2
+ import { a as f } from "../../../attachments/Attachments2.mjs";
3
+ import { theme as p } from "ant-design-vue";
4
+ import I from "../ActionButton/index.mjs";
5
5
  import { useActionButtonContextInject as g } from "../ActionButton/context.mjs";
6
- import h from "./RecordingIcon.mjs";
7
- import { j as x, k as b } from "../../../attachments/FileList/FileList2.mjs";
8
- const j = /* @__PURE__ */ c({
6
+ import y from "./RecordingIcon.mjs";
7
+ import { j as b, k as h } from "../../../attachments/FileList/FileList2.mjs";
8
+ const A = /* @__PURE__ */ r({
9
9
  name: "AXSenderSpeechButton",
10
10
  __name: "index",
11
- props: d({
11
+ props: s({
12
12
  prefixCls: null,
13
13
  type: null,
14
14
  htmlType: null,
@@ -24,36 +24,42 @@ const j = /* @__PURE__ */ c({
24
24
  target: null,
25
25
  title: null,
26
26
  onClick: null,
27
- onMousedown: null
27
+ onMousedown: null,
28
+ audioIcon: null,
29
+ audioDisabledIcon: null,
30
+ audioRecordingIcon: null
28
31
  }, {
29
32
  type: "text",
30
- disabled: void 0
33
+ disabled: void 0,
34
+ audioIcon: () => l(h, null, null),
35
+ audioDisabledIcon: () => l(b, null, null),
36
+ audioRecordingIcon: void 0
31
37
  }),
32
- setup(n) {
33
- const u = p(n, ["type", "disabled"]), t = g(), {
34
- token: r
35
- } = f.useToken(), s = o(() => t.value.speechRecording), i = o(() => t.value.prefixCls), a = o(() => {
36
- let e;
37
- return s.value ? e = l(h, {
38
- className: `${i.value}-recording-icon`
39
- }, null) : t.value.onSpeechDisabled ? e = l(x, null, null) : e = l(b, null, null), e;
38
+ setup(e) {
39
+ const t = f(e, ["type", "disabled", "audioIcon", "audioDisabledIcon", "audioRecordingIcon"]), o = g(), {
40
+ token: u
41
+ } = p.useToken(), d = i(() => o.value.speechRecording), a = i(() => o.value.prefixCls), c = i(() => {
42
+ let n;
43
+ return d.value ? n = e.audioRecordingIcon ? e.audioRecordingIcon : l(y, {
44
+ className: `${a.value}-recording-icon`
45
+ }, null) : o.value.onSpeechDisabled ? n = e.audioDisabledIcon : n = e.audioIcon, n;
40
46
  });
41
- return () => l(y, m({
42
- type: n.type,
43
- disabled: n.disabled
44
- }, u, {
47
+ return () => l(I, m({
48
+ type: e.type,
49
+ disabled: e.disabled
50
+ }, t, {
45
51
  style: {
46
52
  display: "flex",
47
53
  justifyContent: "center",
48
54
  alignItems: "center",
49
- color: r.value.colorPrimary
55
+ color: u.value.colorPrimary
50
56
  },
51
57
  action: "onSpeech"
52
58
  }), {
53
- default: () => [a.value]
59
+ default: () => [c.value]
54
60
  });
55
61
  }
56
62
  });
57
63
  export {
58
- j as default
64
+ A as default
59
65
  };
@@ -1,16 +1,113 @@
1
- import { defineComponent as D, mergeDefaults as L, toRef as R, useSlots as X, computed as o, createVNode as h } from "vue";
2
- import { c as y } from "../attachments/Attachments2.mjs";
1
+ import { onMounted as W, nextTick as I, getCurrentScope as L, onScopeDispose as G, getCurrentInstance as V, computed as v, shallowRef as y, watch as $, toValue as D, defineComponent as P, mergeDefaults as X, toRef as E, useSlots as H, ref as K, createVNode as A } from "vue";
2
+ import { c as B } from "../attachments/Attachments2.mjs";
3
3
  import "../x-provider/index.mjs";
4
- import $ from "../_util/hooks/use-x-component-config.mjs";
5
- import A from "./style/index.mjs";
6
- import S from "../_util/hooks/use-state.mjs";
7
- import { Cascader as B } from "ant-design-vue";
8
- import I from "./useActive.mjs";
9
- import P from "../x-provider/hooks/use-x-provider-context.mjs";
10
- const H = /* @__PURE__ */ D({
4
+ import U from "../_util/hooks/use-x-component-config.mjs";
5
+ import j from "./style/index.mjs";
6
+ import k from "../_util/hooks/use-state.mjs";
7
+ import { Cascader as q } from "ant-design-vue";
8
+ import J from "./useActive.mjs";
9
+ import Q from "../x-provider/hooks/use-x-provider-context.mjs";
10
+ function Y(e) {
11
+ return L() ? (G(e), !0) : !1;
12
+ }
13
+ const Z = typeof window < "u" && typeof document < "u";
14
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
15
+ function _(e) {
16
+ return Array.isArray(e) ? e : [e];
17
+ }
18
+ function ee(e) {
19
+ return V();
20
+ }
21
+ function te(e, n = !0, s) {
22
+ ee() ? W(e, s) : n ? e() : I(e);
23
+ }
24
+ const M = Z ? window : void 0;
25
+ function g(e) {
26
+ var n;
27
+ const s = D(e);
28
+ return (n = s == null ? void 0 : s.$el) != null ? n : s;
29
+ }
30
+ function ne() {
31
+ const e = y(!1), n = V();
32
+ return n && W(() => {
33
+ e.value = !0;
34
+ }, n), e;
35
+ }
36
+ function oe(e) {
37
+ const n = ne();
38
+ return v(() => (n.value, !!e()));
39
+ }
40
+ function se(e, n, s = {}) {
41
+ const { window: a = M, ...c } = s;
42
+ let r;
43
+ const i = oe(() => a && "ResizeObserver" in a), l = () => {
44
+ r && (r.disconnect(), r = void 0);
45
+ }, w = v(() => {
46
+ const t = D(e);
47
+ return Array.isArray(t) ? t.map((u) => g(u)) : [g(t)];
48
+ }), h = $(
49
+ w,
50
+ (t) => {
51
+ if (l(), i.value && a) {
52
+ r = new ResizeObserver(n);
53
+ for (const u of t)
54
+ u && r.observe(u, c);
55
+ }
56
+ },
57
+ { immediate: !0, flush: "post" }
58
+ ), m = () => {
59
+ l(), h();
60
+ };
61
+ return Y(m), {
62
+ isSupported: i,
63
+ stop: m
64
+ };
65
+ }
66
+ function ie(e, n = { width: 0, height: 0 }, s = {}) {
67
+ const { window: a = M, box: c = "content-box" } = s, r = v(() => {
68
+ var t, u;
69
+ return (u = (t = g(e)) == null ? void 0 : t.namespaceURI) == null ? void 0 : u.includes("svg");
70
+ }), i = y(n.width), l = y(n.height), { stop: w } = se(
71
+ e,
72
+ ([t]) => {
73
+ const u = c === "border-box" ? t.borderBoxSize : c === "content-box" ? t.contentBoxSize : t.devicePixelContentBoxSize;
74
+ if (a && r.value) {
75
+ const f = g(e);
76
+ if (f) {
77
+ const d = f.getBoundingClientRect();
78
+ i.value = d.width, l.value = d.height;
79
+ }
80
+ } else if (u) {
81
+ const f = _(u);
82
+ i.value = f.reduce((d, { inlineSize: C }) => d + C, 0), l.value = f.reduce((d, { blockSize: C }) => d + C, 0);
83
+ } else
84
+ i.value = t.contentRect.width, l.value = t.contentRect.height;
85
+ },
86
+ s
87
+ );
88
+ te(() => {
89
+ const t = g(e);
90
+ t && (i.value = "offsetWidth" in t ? t.offsetWidth : n.width, l.value = "offsetHeight" in t ? t.offsetHeight : n.height);
91
+ });
92
+ const h = $(
93
+ () => g(e),
94
+ (t) => {
95
+ i.value = t ? n.width : 0, l.value = t ? n.height : 0;
96
+ }
97
+ );
98
+ function m() {
99
+ w(), h();
100
+ }
101
+ return {
102
+ width: i,
103
+ height: l,
104
+ stop: m
105
+ };
106
+ }
107
+ const he = /* @__PURE__ */ P({
11
108
  name: "AXSuggestion",
12
109
  __name: "Suggestion",
13
- props: L({
110
+ props: X({
14
111
  prefixCls: null,
15
112
  className: null,
16
113
  rootClassName: null,
@@ -39,55 +136,63 @@ const H = /* @__PURE__ */ D({
39
136
  open: !1
40
137
  }),
41
138
  setup(e) {
42
- R(e, "prefixCls");
43
- const s = X(), {
44
- direction: N,
45
- getPrefixCls: x
46
- } = P(), n = o(() => x("suggestion", e.prefixCls));
47
- `${n.value}`;
48
- const a = o(() => N.value === "rtl"), i = $("suggestion"), [b, c, u] = A(n), [m, w] = S(e.open), [k, F] = S(), l = (t) => {
49
- var v;
50
- w(t), (v = e.onOpenChange) == null || v.call(e, t);
51
- }, r = (t) => {
52
- t === !1 ? l(!1) : (F(t), l(!0));
53
- }, f = () => {
54
- l(!1);
55
- }, g = o(() => typeof e.items == "function" ? e.items(k.value) : e.items), C = (t) => {
56
- e.onSelect && e.onSelect(t[t.length - 1]), l(!1);
57
- }, [O, d] = I(g, m, a, C, f), V = o(() => {
58
- var t;
59
- return s.default ? s.default({
60
- onTrigger: r,
61
- onKeyDown: d
62
- }) : (t = e.children) == null ? void 0 : t.call(e, {
63
- onTrigger: r,
64
- onKeyDown: d
139
+ E(e, "prefixCls");
140
+ const n = H(), {
141
+ direction: s,
142
+ getPrefixCls: a
143
+ } = Q(), c = v(() => a("suggestion", e.prefixCls));
144
+ `${c.value}`;
145
+ const r = v(() => s.value === "rtl"), i = U("suggestion"), l = K(), [w, h, m] = j(c), {
146
+ width: t
147
+ } = ie(l), u = v(() => {
148
+ if (e.block && t.value)
149
+ return {
150
+ width: `${t.value}px`
151
+ };
152
+ }), [f, d] = k(e.open), [C, T] = k(), p = (o) => {
153
+ var O;
154
+ d(o), (O = e.onOpenChange) == null || O.call(e, o);
155
+ }, b = (o) => {
156
+ o === !1 ? p(!1) : (T(o), p(!0));
157
+ }, S = () => {
158
+ p(!1);
159
+ }, x = v(() => typeof e.items == "function" ? e.items(C.value) : e.items), R = (o) => {
160
+ e.onSelect && e.onSelect(o[o.length - 1]), p(!1);
161
+ }, [z, N] = J(x, f, r, R, S), F = v(() => {
162
+ var o;
163
+ return n.default ? n.default({
164
+ onTrigger: b,
165
+ onKeyDown: N
166
+ }) : (o = e.children) == null ? void 0 : o.call(e, {
167
+ onTrigger: b,
168
+ onKeyDown: N
65
169
  });
66
170
  });
67
- return () => b(h(B, {
68
- options: g.value,
69
- open: m.value,
70
- value: O.value,
71
- placement: a.value ? "topRight" : "topLeft",
72
- onDropdownVisibleChange: (t) => {
73
- t || f();
171
+ return () => w(A(q, {
172
+ options: x.value,
173
+ open: f.value,
174
+ value: z.value,
175
+ placement: r.value ? "topRight" : "topLeft",
176
+ onDropdownVisibleChange: (o) => {
177
+ o || S();
74
178
  },
75
- class: y(e.rootClassName, n.value, c, u, {
76
- [`${n.value}-block`]: e.block
179
+ popupClassName: B(e.rootClassName, c.value, h.value, m, {
180
+ [`${c.value}-block`]: e.block
77
181
  }),
78
- onChange: C,
79
- dropdownMatchSelectWidth: e.block
182
+ onChange: R,
183
+ dropdownStyle: u.value
80
184
  }, {
81
- default: () => h("div", {
82
- class: y(n.value, i.value.className, e.rootClassName, e.className, `${n.value}-wrapper`, c.value, u),
185
+ default: () => A("div", {
186
+ ref: l,
187
+ class: B(c.value, i.value.className, e.rootClassName, e.className, `${c.value}-wrapper`, h.value, m),
83
188
  style: {
84
189
  ...i.value.style,
85
190
  ...e.style
86
191
  }
87
- }, [V.value])
192
+ }, [F.value])
88
193
  }));
89
194
  }
90
195
  });
91
196
  export {
92
- H as default
197
+ he as default
93
198
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as $, mergeDefaults as S, toRef as h, useSlots as w, computed as c, createVNode as a, isVNode as V } from "vue";
1
+ import { defineComponent as $, mergeDefaults as S, toRef as h, useSlots as w, computed as c, createVNode as s, isVNode as F } from "vue";
2
2
  import { c as i } from "../attachments/Attachments2.mjs";
3
3
  import "../x-provider/index.mjs";
4
- import b from "../_util/hooks/use-x-component-config.mjs";
5
- import j from "./style/index.mjs";
6
- import { Typography as f, Flex as r } from "ant-design-vue";
7
- import p from "../x-provider/hooks/use-x-provider-context.mjs";
4
+ import V from "../_util/hooks/use-x-component-config.mjs";
5
+ import b from "./style/index.mjs";
6
+ import { Typography as m, Flex as o } from "ant-design-vue";
7
+ import j from "../x-provider/hooks/use-x-provider-context.mjs";
8
8
  function T(e) {
9
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !V(e);
9
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !F(e);
10
10
  }
11
- const F = /* @__PURE__ */ $({
11
+ const I = /* @__PURE__ */ $({
12
12
  name: "AXWelcome",
13
13
  __name: "Welcome",
14
14
  props: S({
@@ -19,10 +19,18 @@ const F = /* @__PURE__ */ $({
19
19
  variant: null,
20
20
  classNames: null,
21
21
  styles: null,
22
- icon: null,
23
- title: null,
24
- description: null,
25
- extra: null
22
+ icon: {
23
+ type: Function
24
+ },
25
+ title: {
26
+ type: Function
27
+ },
28
+ description: {
29
+ type: Function
30
+ },
31
+ extra: {
32
+ type: Function
33
+ }
26
34
  }, {
27
35
  variant: "filled",
28
36
  classNames: () => ({}),
@@ -30,54 +38,54 @@ const F = /* @__PURE__ */ $({
30
38
  }),
31
39
  setup(e) {
32
40
  h(e, "prefixCls");
33
- const s = w(), {
41
+ const n = w(), {
34
42
  direction: d,
35
- getPrefixCls: x
36
- } = p(), l = x("welcome", e.prefixCls), n = b("welcome"), [v, N, y] = j(l), C = c(() => {
37
- const t = s.icon ? s.icon() : e.icon;
43
+ getPrefixCls: y
44
+ } = j(), l = y("welcome", e.prefixCls), a = V("welcome"), [x, v, N] = b(l), C = c(() => {
45
+ const t = n.icon ? n.icon() : typeof e.icon == "function" ? e.icon() : e.icon;
38
46
  if (!t)
39
47
  return null;
40
- let m = t;
41
- return typeof t == "string" && t.startsWith("http") && (m = a("img", {
48
+ let f = t;
49
+ return typeof t == "string" && t.startsWith("http") && (f = s("img", {
42
50
  src: t,
43
51
  alt: "icon"
44
- }, null)), a("div", {
45
- class: i(`${l}-icon`, n.value.classNames.icon, e.classNames.icon),
52
+ }, null)), s("div", {
53
+ class: i(`${l}-icon`, a.value.classNames.icon, e.classNames.icon),
46
54
  style: e.styles.icon
47
- }, [m]);
48
- }), o = c(() => {
49
- const t = s.title ? s.title() : e.title;
50
- return t ? a(f.Title, {
55
+ }, [f]);
56
+ }), r = c(() => {
57
+ const t = n.title ? n.title() : typeof e.title == "function" ? e.title() : e.title;
58
+ return t ? s(m.Title, {
51
59
  level: 4,
52
- class: i(`${l}-title`, n.value.classNames.title, e.classNames.title),
60
+ class: i(`${l}-title`, a.value.classNames.title, e.classNames.title),
53
61
  style: e.styles.title
54
62
  }, T(t) ? t : {
55
63
  default: () => [t]
56
64
  }) : null;
57
- }), u = c(() => s.description ? s.description() : e.description), g = c(() => {
58
- const t = s.extra ? s.extra() : e.extra;
59
- return t ? a("div", {
60
- class: i(`${l}-extra`, n.value.classNames.extra, e.classNames.extra),
65
+ }), u = c(() => n.description ? n.description() : typeof e.description == "function" ? e.description() : e.description), g = c(() => {
66
+ const t = n.extra ? n.extra() : typeof e.extra == "function" ? e.extra() : e.extra;
67
+ return t ? s("div", {
68
+ class: i(`${l}-extra`, a.value.classNames.extra, e.classNames.extra),
61
69
  style: e.styles.extra
62
70
  }, [t]) : null;
63
71
  });
64
- return () => v(a(r, {
65
- class: i(l, n.value.className, e.className, e.rootClassName, N.value, y, `${l}-${e.variant}`, {
72
+ return () => x(s(o, {
73
+ class: i(l, a.value.className, e.className, e.rootClassName, v.value, N, `${l}-${e.variant}`, {
66
74
  [`${l}-rtl`]: d.value === "rtl"
67
75
  }),
68
76
  style: e.style
69
77
  }, {
70
- default: () => [C.value, a(r, {
78
+ default: () => [C.value, s(o, {
71
79
  vertical: !0,
72
80
  class: `${l}-content-wrapper`
73
81
  }, {
74
- default: () => [s.extra || e.extra ? a(r, {
82
+ default: () => [n.extra || e.extra ? s(o, {
75
83
  align: "flex-start",
76
84
  class: `${l}-title-wrapper`
77
85
  }, {
78
- default: () => [o.value, g.value]
79
- }) : o.value, u.value && a(f.Text, {
80
- class: i(`${l}-description`, n.value.classNames.description, e.classNames.description),
86
+ default: () => [r.value, g.value]
87
+ }) : r.value, u.value && s(m.Text, {
88
+ class: i(`${l}-description`, a.value.classNames.description, e.classNames.description),
81
89
  style: e.styles.description
82
90
  }, {
83
91
  default: () => [u.value]
@@ -87,5 +95,5 @@ const F = /* @__PURE__ */ $({
87
95
  }
88
96
  });
89
97
  export {
90
- F as default
98
+ I as default
91
99
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),T=require("./Cache.js"),c=require("../type.js"),A="data-token-hash",d="data-css-hash",m="data-cache-path",u="__cssinjs_instance__";function i(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const o=document.body.querySelectorAll(`style[${d}]`)||[],{firstChild:n}=document.head;Array.from(o).forEach(t=>{t[u]=t[u]||e,t[u]===e&&document.head.insertBefore(t,n)});const r={};Array.from(document.querySelectorAll(`style[${d}]`)).forEach(t=>{var l;const s=t.getAttribute(d);r[s]?t[u]===e&&((l=t.parentNode)==null||l.removeChild(t)):r[s]=!0})}return new T.default(e)}const f=Symbol("StyleContextKey"),P=()=>{var n,r,t;const e=a.getCurrentInstance();let o;if(e&&e.appContext){const s=(t=(r=(n=e.appContext)==null?void 0:n.config)==null?void 0:r.globalProperties)==null?void 0:t.__ANTDV_CSSINJS_CACHE__;s?o=s:(o=i(),e.appContext.config.globalProperties&&(e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__=o))}else o=i();return o},C={cache:i(),defaultCache:!0,hashPriority:"low"},h=()=>{const e=P();return a.inject(f,a.shallowRef({...C,cache:e}))},_=e=>{const o=h(),n=a.shallowRef({...C,cache:i()});return a.watch([()=>a.unref(e),o],()=>{const r={...o.value},t=a.unref(e);Object.keys(t).forEach(l=>{const S=t[l];t[l]!==void 0&&(r[l]=S)});const{cache:s}=t;r.cache=r.cache||i(),r.defaultCache=!s&&o.value.defaultCache,n.value=r},{immediate:!0}),a.provide(f,n),n},y=()=>({autoClear:c.booleanType(),mock:c.stringType(),cache:c.objectType(),defaultCache:c.booleanType(),hashPriority:c.stringType(),container:c.someType(),ssrInline:c.booleanType(),transformers:c.arrayType(),linters:c.arrayType()}),p=c.withInstall(a.defineComponent({name:"AStyleProvider",inheritAttrs:!1,props:y(),setup(e,{slots:o}){return _(e),()=>{var n;return(n=o.default)==null?void 0:n.call(o)}}})),g={useStyleInject:h,useStyleProvider:_,StyleProvider:p};exports.ATTR_CACHE_PATH=m;exports.ATTR_MARK=d;exports.ATTR_TOKEN=A;exports.CSS_IN_JS_INSTANCE=u;exports.StyleProvider=p;exports.createCache=i;exports.default=g;exports.styleProviderProps=y;exports.useStyleInject=h;exports.useStyleProvider=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),T=require("./Cache.js"),c=require("../type.js"),A=require("ant-design-vue"),m="data-token-hash",d="data-css-hash",P="data-cache-path",u="__cssinjs_instance__";function l(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const n=document.body.querySelectorAll(`style[${d}]`)||[],{firstChild:o}=document.head;Array.from(n).forEach(t=>{t[u]=t[u]||e,t[u]===e&&document.head.insertBefore(t,o)});const r={};Array.from(document.querySelectorAll(`style[${d}]`)).forEach(t=>{var i;const s=t.getAttribute(d);r[s]?t[u]===e&&((i=t.parentNode)==null||i.removeChild(t)):r[s]=!0})}return new T.default(e)}const f=Symbol("StyleContextKey"),g=()=>{var o,r,t;const e=a.getCurrentInstance();let n;if(e&&e.appContext){const s=(t=(r=(o=e.appContext)==null?void 0:o.config)==null?void 0:r.globalProperties)==null?void 0:t.__ANTDV_CSSINJS_CACHE__;s?n=s:(n=l(),e.appContext.config.globalProperties&&(e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__=n))}else n=l();return n},C={cache:l(),defaultCache:!0,hashPriority:"low"},h=()=>{const e=g();return a.inject(f,a.shallowRef({...C,cache:e}))},_=e=>{const n=h(),o=a.shallowRef({...C,cache:l()});return a.watch([()=>a.unref(e),n],()=>{const r={...n.value},t=a.unref(e);Object.keys(t).forEach(i=>{const p=t[i];t[i]!==void 0&&(r[i]=p)});const{cache:s}=t;r.cache=r.cache||l(),r.defaultCache=!s&&n.value.defaultCache,o.value=r},{immediate:!0}),a.provide(f,o),o},y=()=>({autoClear:c.booleanType(),mock:c.stringType(),cache:c.objectType(),defaultCache:c.booleanType(),hashPriority:c.stringType(),container:c.someType(),ssrInline:c.booleanType(),transformers:c.arrayType(),linters:c.arrayType()}),S=c.withInstall(a.defineComponent({name:"AXStyleProvider",inheritAttrs:!1,props:y(),setup(e,{slots:n}){return _(e),()=>a.h(A.StyleProvider,e,()=>{var o;return(o=n.default)==null?void 0:o.call(n)})}})),v={useStyleInject:h,useStyleProvider:_,StyleProvider:S};exports.ATTR_CACHE_PATH=P;exports.ATTR_MARK=d;exports.ATTR_TOKEN=m;exports.CSS_IN_JS_INSTANCE=u;exports.StyleProvider=S;exports.createCache=l;exports.default=v;exports.styleProviderProps=y;exports.useStyleInject=h;exports.useStyleProvider=_;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("../attachments/Attachments2.js"),B=require("ant-design-vue"),E=require("../_util/hooks/use-x-component-config.js");require("../x-provider/index.js");const A=require("./hooks/useTypedEffect.js"),F=require("./hooks/useTypingConfig.js"),I=require("./loading.js"),X=require("./style/index.js"),j=require("./context.js"),D=require("../x-provider/hooks/use-x-provider-context.js"),M=t.defineComponent({name:"AXBubble",__name:"Bubble",props:t.mergeDefaults({prefixCls:null,rootClassName:null,styles:null,classNames:null,avatar:null,placement:null,loading:{type:Boolean},typing:null,content:null,messageRender:{type:Function},loadingRender:{type:Function},variant:null,shape:null,onTypingComplete:null,header:null,footer:null},{classNames:()=>({}),styles:()=>({}),placement:"start",loading:!1,content:"",variant:"filled"}),setup(e,{expose:g}){const y=k.createPropsRestProxy(e,["prefixCls","rootClassName","classNames","styles","avatar","placement","loading","loadingRender","typing","content","messageRender","variant","shape","onTypingComplete","header","footer"]);t.toRef(e,"content"),t.toRef(e,"prefixCls");const n=t.useSlots(),f=t.ref(e.content);t.watch(()=>e.content,()=>{f.value=e.content});const{onUpdate:u}=t.unref(j.useBubbleContextInject()),v=t.ref(null),{direction:b,getPrefixCls:h}=D.default(),a=h("bubble",e.prefixCls),l=E.default("bubble"),[C,N,V,m]=F.default(()=>e.typing),[s,r]=A.default(f,C,N,V),c=t.ref(!1);t.watch(s,()=>{u==null||u()}),t.watchEffect(()=>{var o;!r.value&&!e.loading?c.value||(c.value=!0,(o=e.onTypingComplete)==null||o.call(e)):c.value=!1});const[x,R,$]=X.default(()=>a),q=t.computed(()=>[a,e.rootClassName,l.value.className,R.value,$,`${a}-${e.placement}`,{[`${a}-rtl`]:b.value==="rtl"},{[`${a}-typing`]:r.value&&!e.loading&&!e.messageRender&&!n.message&&!m.value}]),P=t.computed(()=>n.avatar?n.avatar():t.isVNode(e.avatar)?e.avatar:t.createVNode(B.Avatar,e.avatar,null)),T=t.computed(()=>n.message?n.message({content:s.value}):e.messageRender?e.messageRender(s.value):s.value),S=t.computed(()=>e.loading?n.loading?n.loading():e.loadingRender?e.loadingRender():t.createVNode(I.default,{prefixCls:a},null):t.createVNode(t.Fragment,null,[T.value,r.value&&t.toValue(m)])),w=t.computed(()=>{const o=t.createVNode("div",{style:{...l.value.styles.content,...e.styles.content},class:[`${a}-content`,`${a}-content-${e.variant}`,{[`${a}-content-${e.shape}`]:e.shape},l.value.classNames.content,e.classNames.content]},[t.toValue(S)]),i=n.header?n.header({content:s.value}):typeof e.header=="function"?e.header(s.value):e.header,d=n.footer?n.footer({content:s.value}):typeof e.footer=="function"?e.footer(s.value):e.footer;return i||d?t.createVNode("div",{class:`${a}-content-wrapper`},[i&&t.createVNode("div",{class:[`${a}-header`,l.value.classNames.header,e.classNames.header],style:{...l.value.styles.header,...e.styles.header}},[i]),o,d&&t.createVNode("div",{class:[`${a}-footer`,l.value.classNames.footer,e.classNames.footer],style:{...l.value.styles.footer,...e.styles.footer}},[d])]):o});return g({nativeElement:v}),()=>x(t.createVNode("div",t.mergeProps({style:{...l.value.style},class:t.toValue(q)},y,{ref:v}),[(n.avatar||e.avatar)&&t.createVNode("div",{style:{...l.value.styles.avatar,...e.styles.avatar},class:[`${a}-avatar`,l.value.classNames.avatar,e.classNames.avatar]},[t.toValue(P)]),t.toValue(w)]))}});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("../attachments/Attachments2.js"),B=require("ant-design-vue"),E=require("../_util/hooks/use-x-component-config.js");require("../x-provider/index.js");const F=require("./hooks/useTypedEffect.js"),I=require("./hooks/useTypingConfig.js"),X=require("./loading.js"),j=require("./style/index.js"),D=require("./context.js"),M=require("../x-provider/hooks/use-x-provider-context.js"),H=t.defineComponent({name:"AXBubble",__name:"Bubble",props:t.mergeDefaults({prefixCls:null,rootClassName:null,styles:null,classNames:null,avatar:{type:Function},placement:null,loading:{type:Boolean},typing:null,content:null,messageRender:{type:Function},loadingRender:{type:Function},variant:null,shape:null,onTypingComplete:null,header:null,footer:null},{classNames:()=>({}),styles:()=>({}),placement:"start",loading:!1,content:"",variant:"filled"}),setup(e,{expose:g}){const y=k.createPropsRestProxy(e,["prefixCls","rootClassName","classNames","styles","avatar","placement","loading","loadingRender","typing","content","messageRender","variant","shape","onTypingComplete","header","footer"]);t.toRef(e,"content"),t.toRef(e,"prefixCls");const n=t.useSlots(),f=t.ref(e.content);t.watch(()=>e.content,()=>{f.value=e.content});const{onUpdate:r}=t.unref(D.useBubbleContextInject()),v=t.ref(null),{direction:b,getPrefixCls:h}=M.default(),a=h("bubble",e.prefixCls),l=E.default("bubble"),[N,C,V,m]=I.default(()=>e.typing),[s,u]=F.default(f,N,C,V),c=t.ref(!1);t.watch(s,()=>{r==null||r()}),t.watchEffect(()=>{var o;!u.value&&!e.loading?c.value||(c.value=!0,(o=e.onTypingComplete)==null||o.call(e)):c.value=!1});const[x,R,$]=j.default(()=>a),q=t.computed(()=>[a,e.rootClassName,l.value.className,R.value,$,`${a}-${e.placement}`,{[`${a}-rtl`]:b.value==="rtl"},{[`${a}-typing`]:u.value&&!e.loading&&!e.messageRender&&!n.message&&!m.value}]),P=o=>Array.isArray(o)&&o.every(t.isVNode),T=t.computed(()=>n.avatar?n.avatar():typeof e.avatar=="function"?e.avatar():t.isVNode(e.avatar)||P(e.avatar)?e.avatar:t.createVNode(B.Avatar,e.avatar,null)),S=t.computed(()=>n.message?n.message({content:s.value}):e.messageRender?e.messageRender(s.value):s.value),A=t.computed(()=>e.loading?n.loading?n.loading():e.loadingRender?e.loadingRender():t.createVNode(X.default,{prefixCls:a},null):t.createVNode(t.Fragment,null,[S.value,u.value&&t.toValue(m)])),w=t.computed(()=>{const o=t.createVNode("div",{style:{...l.value.styles.content,...e.styles.content},class:[`${a}-content`,`${a}-content-${e.variant}`,{[`${a}-content-${e.shape}`]:e.shape},l.value.classNames.content,e.classNames.content]},[t.toValue(A)]),i=n.header?n.header({content:s.value}):typeof e.header=="function"?e.header(s.value):e.header,d=n.footer?n.footer({content:s.value}):typeof e.footer=="function"?e.footer(s.value):e.footer;return i||d?t.createVNode("div",{class:`${a}-content-wrapper`},[i&&t.createVNode("div",{class:[`${a}-header`,l.value.classNames.header,e.classNames.header],style:{...l.value.styles.header,...e.styles.header}},[i]),o,d&&t.createVNode("div",{class:[`${a}-footer`,l.value.classNames.footer,e.classNames.footer],style:{...l.value.styles.footer,...e.styles.footer}},[d])]):o});return g({nativeElement:v}),()=>x(t.createVNode("div",t.mergeProps({style:{...l.value.style},class:t.toValue(q)},y,{ref:v}),[(n.avatar||e.avatar)&&t.createVNode("div",{style:{...l.value.styles.avatar,...e.styles.avatar},class:[`${a}-avatar`,l.value.classNames.avatar,e.classNames.avatar]},[t.toValue(T)]),t.toValue(w)]))}});exports.default=H;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("../attachments/Attachments2.js"),H=require("../_util/hooks/use-event-callback.js"),M=require("../_util/pick-attrs.js");require("../x-provider/index.js");const U=require("./Bubble.js"),z=require("./hooks/useDisplayData.js"),O=require("./hooks/useListData.js"),X=require("./style/index.js"),m=require("../_util/hooks/use-state.js"),$=require("./context.js"),j=require("../x-provider/hooks/use-x-provider-context.js"),K=1,W=e.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:e.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(t,{expose:R}){const p=q.createPropsRestProxy(t,["prefixCls","rootClassName","items","autoScroll","roles"]);e.toRef(t,"roles"),e.toRef(t,"items"),e.toRef(t,"prefixCls");const E=e.useAttrs(),I=M.default(e.mergeProps(p,E),{attr:!0,aria:!0}),h=e.ref(t.items),C=e.ref(t.roles);e.watch(()=>t.items,()=>{h.value=t.items}),e.watch(()=>t.roles,()=>{C.value=t.roles});const r=e.ref(null),a=e.ref({}),{getPrefixCls:V}=j.default(),g=V("bubble",t.prefixCls),v=`${g}-list`,[k,w,y]=X.default(g),[N,x]=m.default(!1);e.watchEffect(()=>{x(!0),e.onWatcherCleanup(()=>{x(!1)})});const T=O.default(h,C),[u,A]=z.default(T),[S,i]=m.default(!0),[f,P]=m.default(0),D=s=>{const l=s.target;i(l.scrollHeight-Math.abs(l.scrollTop)-l.clientHeight<=K)};e.watch(f,()=>{t.autoScroll&&e.unref(r)&&e.unref(S)&&e.nextTick(()=>{e.unref(r).scrollTo({top:e.unref(r).scrollHeight})})}),e.watch(()=>e.unref(u).length,()=>{var s;if(t.autoScroll){const l=(s=e.unref(u)[e.unref(u).length-2])==null?void 0:s.key,o=e.unref(a)[l];if(o){const{nativeElement:n}=o,{top:c=0,bottom:d=0}=(n==null?void 0:n.getBoundingClientRect())??{},{top:b,bottom:L}=e.unref(r).getBoundingClientRect();c<L&&d>b&&(P(e.unref(f)+1),i(!0))}}});const B=H.useEventCallback(()=>{t.autoScroll&&P(e.unref(f)+1)}),_=e.computed(()=>({onUpdate:B}));return R({nativeElement:r,scrollTo:({key:s,offset:l,behavior:o="smooth",block:n})=>{if(typeof l=="number")e.unref(r).scrollTo({top:l,behavior:o});else if(s!==void 0){const c=e.unref(a)[s];if(c){const d=e.unref(u).findIndex(b=>b.key===s);i(d===e.unref(u).length-1),c.nativeElement.scrollIntoView({behavior:o,block:n})}}}}),()=>k(e.createVNode($.BubbleContextProvider,{value:_.value},{default:()=>[e.createVNode("div",e.mergeProps(I,{class:q.classnames(v,t.rootClassName,w.value,y,{[`${v}-reach-end`]:S.value}),ref:r,onScroll:D}),[e.unref(u).map(({key:s,onTypingComplete:l,...o})=>e.createVNode(U.default,e.mergeProps(o,{key:s,ref:n=>{n?a.value[s]=n:delete a.value[s]},typing:N.value?o.typing:!1,onTypingComplete:()=>{l==null||l(),A(s)}}),null))])]}))}});exports.default=W;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../attachments/Attachments2.js"),k=require("../_util/hooks/use-event-callback.js"),y=require("../_util/pick-attrs.js");require("../x-provider/index.js");const z=require("./Bubble.js"),O=require("./hooks/useDisplayData.js"),X=require("./hooks/useListData.js"),$=require("./style/index.js"),g=require("../_util/hooks/use-state.js"),j=require("./context.js"),K=require("../x-provider/hooks/use-x-provider-context.js"),W=1,F=e.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:e.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(s,{expose:E}){const I=p.createPropsRestProxy(s,["prefixCls","rootClassName","items","autoScroll","roles"]);e.toRef(s,"roles"),e.toRef(s,"items"),e.toRef(s,"prefixCls");const V=e.useAttrs(),n=e.useSlots(),w=e.computed(()=>y.default(e.mergeProps(I,V),{attr:!0,aria:!0})),v=e.ref(s.items),C=e.ref(s.roles);e.watch(()=>s.items,()=>{v.value=s.items}),e.watch(()=>s.roles,()=>{C.value=s.roles});const i=e.ref(null),d=e.ref({}),{getPrefixCls:N}=K.default(),x=N("bubble",s.prefixCls),S=`${x}-list`,[T,A,D]=$.default(x),[b,P]=g.default(!1);e.watchEffect(()=>{P(!0),e.onWatcherCleanup(()=>{P(!1)})});const B=X.default(v,C),[c,_]=O.default(B),[R,m]=g.default(!0),[h,q]=g.default(0),L=t=>{const r=t.target;m(r.scrollHeight-Math.abs(r.scrollTop)-r.clientHeight<=W)};e.watch(h,()=>{s.autoScroll&&e.unref(i)&&e.unref(R)&&e.nextTick(()=>{e.unref(i).scrollTo({top:e.unref(i).scrollHeight})})}),e.watch(()=>e.unref(c).length,()=>{var t;if(s.autoScroll){const r=(t=e.unref(c)[e.unref(c).length-2])==null?void 0:t.key,o=e.unref(d)[r];if(o){const{nativeElement:a}=o,{top:u=0,bottom:f=0}=(a==null?void 0:a.getBoundingClientRect())??{},{top:l,bottom:U}=e.unref(i).getBoundingClientRect();u<U&&f>l&&(q(e.unref(h)+1),m(!0))}}});const H=k.useEventCallback(()=>{s.autoScroll&&q(e.unref(h)+1)}),M=e.computed(()=>({onUpdate:H}));return E({nativeElement:i,scrollTo:({key:t,offset:r,behavior:o="smooth",block:a})=>{if(typeof r=="number")e.unref(i).scrollTo({top:r,behavior:o});else if(t!==void 0){const u=e.unref(d)[t];if(u){const f=e.unref(c).findIndex(l=>l.key===t);m(f===e.unref(c).length-1),u.nativeElement.scrollIntoView({behavior:o,block:a})}}}}),()=>T(e.createVNode(j.BubbleContextProvider,{value:M.value},{default:()=>[e.createVNode("div",e.mergeProps(w.value,{class:p.classnames(S,s.rootClassName,A.value,D,{[`${S}-reach-end`]:R.value}),ref:i,onScroll:L}),[e.unref(c).map(({key:t,onTypingComplete:r,...o})=>{var a,u,f;return e.createVNode(z.default,e.mergeProps(o,{avatar:n.avatar?()=>{var l;return(l=n.avatar)==null?void 0:l.call(n,{item:{key:t,...o}})}:o.avatar,header:((a=n.header)==null?void 0:a.call(n,{item:{key:t,...o}}))??o.header,footer:((u=n.footer)==null?void 0:u.call(n,{item:{key:t,...o}}))??o.footer,loadingRender:n.loading?()=>n.loading({item:{key:t,...o}}):o.loadingRender,content:((f=n.message)==null?void 0:f.call(n,{item:{key:t,...o}}))??o.content,key:t,ref:l=>{l?d.value[t]=l:delete d.value[t]},typing:b.value?o.typing:!1,onTypingComplete:()=>{r==null||r(),_(t)}}),null)})])]}))}});exports.default=F;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=e=>{const{componentCls:t,padding:l}=e;return{[`${t}-list`]:{display:"flex",flexDirection:"column",gap:l,overflowY:"auto"}}};exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=r=>{const{componentCls:e,padding:o}=r;return{[`${e}-list`]:{display:"flex",flexDirection:"column",gap:o,overflowY:"auto","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:r.colorTextTertiary,borderRadius:r.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${r.colorTextTertiary} transparent`}}}};exports.default=l;
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./components.ts2.js"),i=require("./x-stream/x-stream.js"),a=require("./x-request/x-fetch.js"),c=require("./x-request/x-request.js"),r=require("./use-x-agent/use-x-agent.js"),l=require("./use-x-chat/use-x-chat.js"),d=require("ant-design-vue"),_=require("./x-provider/index2.js"),u=require("./x-provider/hooks/use-x-provider-context.js"),f=require("./bubble/BubbleList.js"),q=require("./conversations/Conversations.js"),h=require("./welcome/Welcome.js"),m=require("./prompts/Prompts.js"),g=require("./suggestion/Suggestion.js"),b=require("./thought-chain/ThoughtChain.js"),x=require("./bubble/index.js"),X=require("./sender/index.js"),C=require("./attachments/index.js"),n=function(e){return Object.keys(s.components).forEach(o=>{const t=s.components[o];t.install&&e.use(t)}),e},P={install:n};exports.XStream=i.default;exports.XFetch=a.default;exports.XRequest=c.default;exports.XAgent=r.XAgent;exports.useXAgent=r.default;exports.useXChat=l.default;Object.defineProperty(exports,"theme",{enumerable:!0,get:()=>d.theme});exports.XProvider=_._sfc_main;exports.defaultPrefixCls=u.defaultPrefixCls;exports.useXProviderContext=u.default;exports.BubbleList=f.default;exports.Conversations=q.default;exports.Welcome=h.default;exports.Prompts=m.default;exports.Suggestion=g.default;exports.ThoughtChain=b.default;exports.Bubble=x.default;exports.Sender=X.default;exports.Attachments=C.default;exports.default=P;exports.install=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./components.ts2.js"),i=require("./_util/cssinjs/index.js"),a=require("./x-stream/x-stream.js"),d=require("./x-request/x-fetch.js"),f=require("./x-request/x-request.js"),n=require("./use-x-agent/use-x-agent.js"),m=require("./use-x-chat/use-x-chat.js"),q=require("ant-design-vue"),h=require("./x-provider/index2.js"),u=require("./x-provider/hooks/use-x-provider-context.js"),S=require("./bubble/BubbleList.js"),g=require("./conversations/Conversations.js"),x=require("./welcome/Welcome.js"),y=require("./prompts/Prompts.js"),C=require("./suggestion/Suggestion.js"),P=require("./thought-chain/ThoughtChain.js"),j=require("./_util/cssinjs/theme/Theme.js"),b=require("./_util/cssinjs/theme/createTheme.js"),o=require("./_util/cssinjs/hooks/useStyleRegister/index.tsx2.js"),p=require("./_util/cssinjs/hooks/useCacheToken.tsx2.js"),v=require("./_util/cssinjs/Keyframes.js"),X=require("./_util/cssinjs/transformers/legacyLogicalProperties.js"),T=require("./_util/cssinjs/transformers/px2rem.js"),k=require("./_util/cssinjs/linters/logicalPropertiesLinter.js"),L=require("./_util/cssinjs/linters/legacyNotSelectorLinter.js"),R=require("./_util/cssinjs/linters/parentSelectorLinter.js"),A=require("./_util/cssinjs/hooks/useCSSVarRegister.js"),V=require("./bubble/index.js"),B=require("./sender/index.js"),O=require("./attachments/index.js"),e=require("./_util/cssinjs/StyleContext.js"),_=require("./_util/cssinjs/util.js"),l=function(t){return Object.keys(r.components).forEach(c=>{const s=r.components[c];s.install&&t.use(s)}),t.use(i.default.StyleProvider),t},F={install:l};exports._experimental=i._experimental;exports.XStream=a.default;exports.XFetch=d.default;exports.XRequest=f.default;exports.XAgent=n.XAgent;exports.useXAgent=n.default;exports.useXChat=m.default;Object.defineProperty(exports,"theme",{enumerable:!0,get:()=>q.theme});exports.XProvider=h._sfc_main;exports.defaultPrefixCls=u.defaultPrefixCls;exports.useXProviderContext=u.default;exports.BubbleList=S.default;exports.Conversations=g.default;exports.Welcome=x.default;exports.Prompts=y.default;exports.Suggestion=C.default;exports.ThoughtChain=P.default;exports.Theme=j.default;exports.createTheme=b.default;exports.extractStyle=o.extractStyle;exports.useStyleRegister=o.useStyleRegister;exports.useCacheToken=p.useCacheToken;exports.Keyframes=v.default;exports.legacyLogicalPropertiesTransformer=X.default;exports.px2remTransformer=T.default;exports.logicalPropertiesLinter=k.default;exports.legacyNotSelectorLinter=L.default;exports.parentSelectorLinter=R.default;exports.useCSSVarRegister=A.default;exports.Bubble=V.default;exports.Sender=B.default;exports.Attachments=O.default;exports.StyleProvider=e.StyleProvider;exports.createCache=e.createCache;exports.useStyleInject=e.useStyleInject;exports.useStyleProvider=e.useStyleProvider;exports.token2CSSVar=_.token2CSSVar;exports.unit=_.unit;exports.default=F;exports.install=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),i=require("../attachments/Attachments2.js"),B=require("ant-design-vue"),_=require("../_util/pick-attrs.js"),ee=require("../_util/hooks/use-x-component-config.js");require("../x-provider/index.js");const te=require("./context.js"),ne=require("./components/ActionButton/context.js"),ae=require("./components/ClearButton.js"),q=require("./components/LoadingButton.js"),F=require("./components/SendButton.js"),D=require("./components/SpeechButton/index.js"),le=require("./style/index.js"),oe=require("./useSpeech.js"),se=require("../_util/getValue.js"),ue=require("../x-provider/hooks/use-x-provider-context.js"),ce=n.defineComponent({name:"AXSender",__name:"Sender",props:n.mergeDefaults({onKeyPress:{type:Function},onFocus:null,onBlur:null,prefixCls:null,defaultValue:null,value:null,loading:{type:Boolean},placeholder:null,readOnly:{type:Boolean},submitType:{type:[String,Boolean]},disabled:{type:Boolean},onSubmit:{type:Function},onChange:{type:Function},onCancel:null,onKeyDown:{type:Function},onPaste:{type:Function},onPasteFile:{type:Function},components:null,styles:null,rootClassName:null,classNames:null,style:null,className:null,actions:{type:[Function,Boolean]},allowSpeech:null,prefix:{type:Function},footer:{type:Function},header:{type:Function},autoSize:null},{styles:()=>({}),classNames:()=>({}),submitType:"enter",actions:void 0,disabled:void 0,autoSize:()=>({maxRows:8})}),emits:["update:value"],setup(e,{expose:w,emit:$}){const K=i.createPropsRestProxy(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","footer","header","onPaste","onPasteFile","autoSize"]);n.toRef(e,"prefixCls");function R(t,a,c){return se.default(t,a)||c}const d={SendButton:F.default,ClearButton:ae.default,LoadingButton:q.default,SpeechButton:D.default},I=$,s=n.useSlots(),{direction:A,getPrefixCls:T}=ue.default(),l=n.computed(()=>T("sender",e.prefixCls)),f=n.ref(null),r=n.ref(null),o=ee.default("sender"),C=n.computed(()=>`${l.value}-input`),[k,z,E]=le.default(l.value),O=n.computed(()=>i.classnames(l.value,o.value.className,e.className,e.rootClassName,z.value,E,{[`${l.value}-rtl`]:A.value==="rtl",[`${l.value}-disabled`]:e.disabled})),p=n.computed(()=>`${l.value}-actions-btn`),h=n.computed(()=>`${l.value}-actions-list`),u=n.ref(e.value??e.defaultValue??""),g=t=>{u.value=t};n.watch(()=>e.value,()=>{g(e.value)});const v=(t,a)=>{g(t),I("update:value",t),e.onChange&&e.onChange(t,a)},{speechPermission:M,triggerSpeech:S,recording:L}=oe.default(t=>{v(`${u.value} ${t}`)},()=>e.allowSpeech),X=R(e.components,["input"],B.Input.TextArea),j=n.computed(()=>_.default(K,{attr:!0,aria:!0,data:!0})),H=n.computed(()=>({...j.value,ref:r})),m=()=>{u.value&&e.onSubmit&&!e.loading&&e.onSubmit(u.value)},G=()=>{v("")},y=n.ref(!1),J=()=>{y.value=!0},Q=()=>{y.value=!1},U=t=>{const a=t.key==="Enter"&&!y.value;switch(e.submitType){case"enter":a&&!t.shiftKey&&(t.preventDefault(),m());break;case"shiftEnter":a&&t.shiftKey&&(t.preventDefault(),m());break}e.onKeyPress&&e.onKeyPress(t)},W=t=>{var c,V;const a=(c=t.clipboardData)==null?void 0:c.files;a!=null&&a.length&&e.onPasteFile&&(e.onPasteFile(a[0],a),t.preventDefault()),(V=e.onPaste)==null||V.call(e,t)},Y=t=>{var a,c;t.target!==((a=f.value)==null?void 0:a.querySelector(`.${C.value}`))&&t.preventDefault(),(c=r.value)==null||c.focus()},x=n.computed(()=>{let t=n.createVNode(B.Flex,{class:`${h.value}-presets`},{default:()=>[e.allowSpeech&&n.createVNode(D.default,null,null),e.loading?n.createVNode(q.default,null,null):n.createVNode(F.default,null,null)]});const a={components:d};return s.actions?t=s.actions({ori:t,info:a}):typeof e.actions=="function"?t=e.actions(t,a):(e.actions||e.actions===!1)&&(t=e.actions),t}),Z=n.computed(()=>({prefixCls:p.value,onSend:m,onSendDisabled:!u.value,onClear:G,onClearDisabled:!u.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>S(!1),onSpeechDisabled:!M.value,speechRecording:L.value,disabled:e.disabled})),N=n.computed(()=>{let t=null;const a={components:d};return s.footer?t=s.footer({info:a}):typeof e.footer=="function"?t=e.footer({components:d}):e.footer&&(t=e.footer),t}),b=n.computed(()=>s.header?s.header():typeof e.header=="function"?e.header():e.header),P=n.computed(()=>s.prefix?s.prefix():typeof e.prefix=="function"?e.prefix():e.prefix);return w({nativeElement:f.value,focus:t=>{var a;return(a=r.value)==null?void 0:a.focus(t)},blur:()=>{var t;return(t=r.value)==null?void 0:t.blur()}}),()=>k(n.createVNode("div",{ref:f,class:O.value,style:{...o.value.style,...e.style}},[b.value&&n.createVNode(te.SenderHeaderContextProvider,{value:{prefixCls:l.value}},{default:()=>[b.value]}),n.createVNode(ne.ActionButtonContextProvider,{value:Z.value},{default:()=>[n.createVNode("div",{class:`${l.value}-content`,onMousedown:Y},[P.value&&n.createVNode("div",{class:i.classnames(`${l.value}-prefix`,o.value.classNames.prefix,e.classNames.prefix),style:{...o.value.styles.prefix,...e.styles.prefix}},[P.value]),n.createVNode(X,n.mergeProps(H.value,{disabled:e.disabled,style:{...o.value.styles.input,...e.styles.input},class:i.classnames(C.value,o.value.classNames.input,e.classNames.input),autoSize:e.autoSize,value:u.value,onChange:t=>{v(t.target.value,t),S(!0)},onPressEnter:U,onCompositionstart:J,onCompositionend:Q,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:W,bordered:!1,readOnly:e.readOnly}),null),x.value&&n.createVNode("div",{class:i.classnames(h.value,o.value.classNames.actions,e.classNames.actions),style:{...o.value.styles.actions,...e.styles.actions}},[x.value])]),N.value&&n.createVNode("div",{class:i.classnames(`${l.value}-footer`,o.value.classNames.footer,e.classNames.footer),style:{...o.value.styles.footer,...e.styles.footer}},[N.value])]})]))}});exports.default=ce;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),i=require("../attachments/Attachments2.js"),w=require("ant-design-vue"),_=require("../_util/pick-attrs.js"),ee=require("../_util/hooks/use-x-component-config.js");require("../x-provider/index.js");const te=require("./context.js"),ne=require("./components/ActionButton/context.js"),ae=require("./components/ClearButton.js"),B=require("./components/LoadingButton.js"),q=require("./components/SendButton.js"),D=require("./components/SpeechButton/index.js"),le=require("./style/index.js"),oe=require("./useSpeech.js"),se=require("../_util/getValue.js"),ue=require("../x-provider/hooks/use-x-provider-context.js"),ce=n.defineComponent({name:"AXSender",__name:"Sender",props:n.mergeDefaults({onKeyPress:{type:Function},onFocus:null,onBlur:null,prefixCls:null,defaultValue:null,value:null,loading:{type:Boolean},placeholder:null,readOnly:{type:Boolean},submitType:{type:[String,Boolean]},disabled:{type:Boolean},onSubmit:{type:Function},onChange:{type:Function},onCancel:null,onKeyDown:{type:Function},onPaste:{type:Function},onPasteFile:{type:Function},components:null,styles:null,rootClassName:null,classNames:null,style:null,className:null,actions:{type:[Function,Boolean]},allowSpeech:null,prefix:{type:Function},footer:{type:Function},header:{type:Function},autoSize:null},{styles:()=>({}),classNames:()=>({}),submitType:"enter",actions:void 0,disabled:void 0,autoSize:()=>({maxRows:8})}),emits:["update:value"],setup(e,{expose:F,emit:I}){const $=i.createPropsRestProxy(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","footer","header","onPaste","onPasteFile","autoSize"]);n.toRef(e,"prefixCls");function K(t,a,c){return se.default(t,a)||c}const d={SendButton:q.default,ClearButton:ae.default,LoadingButton:B.default,SpeechButton:D.default},R=I,s=n.useSlots(),{direction:A,getPrefixCls:T}=ue.default(),l=n.computed(()=>T("sender",e.prefixCls)),f=n.ref(null),r=n.ref(null),o=ee.default("sender"),C=n.computed(()=>`${l.value}-input`),[k,z,E]=le.default(l.value),O=n.computed(()=>i.classnames(l.value,o.value.className,e.className,e.rootClassName,z.value,E,{[`${l.value}-rtl`]:A.value==="rtl",[`${l.value}-disabled`]:e.disabled})),M=n.computed(()=>`${l.value}-actions-btn`),h=n.computed(()=>`${l.value}-actions-list`),u=n.ref(e.value??e.defaultValue??""),g=t=>{u.value=t};n.watch(()=>e.value,()=>{g(e.value)});const v=(t,a)=>{g(t),R("update:value",t),e.onChange&&e.onChange(t,a)},{speechPermission:L,triggerSpeech:S,recording:X}=oe.default(t=>{v(`${u.value} ${t}`)},()=>e.allowSpeech),j=K(e.components,["input"],w.Input.TextArea),p=n.computed(()=>_.default($,{attr:!0,aria:!0,data:!0})),H=n.computed(()=>({...p.value,ref:r})),m=()=>{u.value&&e.onSubmit&&!e.loading&&e.onSubmit(u.value)},G=()=>{v("")},y=n.ref(!1),J=()=>{y.value=!0},Q=()=>{y.value=!1},U=t=>{const a=t.key==="Enter"&&!y.value;switch(e.submitType){case"enter":a&&!t.shiftKey&&(t.preventDefault(),m());break;case"shiftEnter":a&&t.shiftKey&&(t.preventDefault(),m());break}e.onKeyPress&&e.onKeyPress(t)},W=t=>{var c,V;const a=(c=t.clipboardData)==null?void 0:c.files;a!=null&&a.length&&e.onPasteFile&&(e.onPasteFile(a[0],a),t.preventDefault()),(V=e.onPaste)==null||V.call(e,t)},Y=t=>{var a,c;t.target!==((a=f.value)==null?void 0:a.querySelector(`.${C.value}`))&&t.preventDefault(),(c=r.value)==null||c.focus()},x=n.computed(()=>{let t=n.createVNode(w.Flex,{class:`${h.value}-presets`},{default:()=>[e.allowSpeech&&n.createVNode(D.default,typeof e.allowSpeech=="object"?{audioIcon:e.allowSpeech.audioIcon,audioDisabledIcon:e.allowSpeech.audioDisabledIcon,audioRecordingIcon:e.allowSpeech.audioRecordingIcon}:{},null),e.loading?n.createVNode(B.default,null,null):n.createVNode(q.default,null,null)]});const a={components:d};return s.actions?t=s.actions({ori:t,info:a}):typeof e.actions=="function"?t=e.actions(t,a):(e.actions||e.actions===!1)&&(t=e.actions),t}),Z=n.computed(()=>({prefixCls:M.value,onSend:m,onSendDisabled:!u.value,onClear:G,onClearDisabled:!u.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>S(!1),onSpeechDisabled:!L.value,speechRecording:X.value,disabled:e.disabled})),b=n.computed(()=>{let t=null;const a={components:d};return s.footer?t=s.footer({info:a}):typeof e.footer=="function"?t=e.footer({components:d}):e.footer&&(t=e.footer),t}),N=n.computed(()=>s.header?s.header():typeof e.header=="function"?e.header():e.header),P=n.computed(()=>s.prefix?s.prefix():typeof e.prefix=="function"?e.prefix():e.prefix);return F({nativeElement:f.value,focus:t=>{var a;return(a=r.value)==null?void 0:a.focus(t)},blur:()=>{var t;return(t=r.value)==null?void 0:t.blur()}}),()=>k(n.createVNode("div",{ref:f,class:O.value,style:{...o.value.style,...e.style}},[N.value&&n.createVNode(te.SenderHeaderContextProvider,{value:{prefixCls:l.value}},{default:()=>[N.value]}),n.createVNode(ne.ActionButtonContextProvider,{value:Z.value},{default:()=>[n.createVNode("div",{class:`${l.value}-content`,onMousedown:Y},[P.value&&n.createVNode("div",{class:i.classnames(`${l.value}-prefix`,o.value.classNames.prefix,e.classNames.prefix),style:{...o.value.styles.prefix,...e.styles.prefix}},[P.value]),n.createVNode(j,n.mergeProps(H.value,{disabled:e.disabled,style:{...o.value.styles.input,...e.styles.input},class:i.classnames(C.value,o.value.classNames.input,e.classNames.input),autoSize:e.autoSize,value:u.value,onChange:t=>{v(t.target.value,t),S(!0)},onPressEnter:U,onCompositionstart:J,onCompositionend:Q,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:W,bordered:!1,readOnly:e.readOnly}),null),x.value&&n.createVNode("div",{class:i.classnames(h.value,o.value.classNames.actions,e.classNames.actions),style:{...o.value.styles.actions,...e.styles.actions}},[x.value])]),b.value&&n.createVNode("div",{class:i.classnames(`${l.value}-footer`,o.value.classNames.footer,e.classNames.footer),style:{...o.value.styles.footer,...e.styles.footer}},[b.value])]})]))}});exports.default=ce;