ant-design-x-vue 1.2.0 → 1.2.2

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 (35) hide show
  1. package/README.en.md +6 -0
  2. package/README.md +11 -0
  3. package/dist/index.umd.js +9 -43
  4. package/es/attachments/Attachments2.mjs +50 -51
  5. package/es/attachments/FileList/FileList2.mjs +712 -932
  6. package/es/attachments/PlaceholderUploader.mjs +30 -27
  7. package/es/attachments/SilentUploader.mjs +12 -9
  8. package/es/bubble/Bubble.mjs +36 -36
  9. package/es/sender/components/LoadingButton.mjs +5 -5
  10. package/es/theme/useToken.mjs +54 -310
  11. package/es/thought-chain/hooks/useCollapsible.mjs +25 -17
  12. package/es/use-x-agent/use-x-agent.mjs +41 -34
  13. package/es/use-x-chat/use-x-chat.mjs +98 -69
  14. package/es/x-provider/hooks/use-x-provider-context.mjs +11 -16
  15. package/es/x-request/x-request.mjs +55 -53
  16. package/lib/attachments/Attachments2.js +2 -2
  17. package/lib/attachments/FileList/FileList2.js +4 -4
  18. package/lib/attachments/PlaceholderUploader.js +1 -1
  19. package/lib/attachments/SilentUploader.js +1 -1
  20. package/lib/bubble/Bubble.js +1 -1
  21. package/lib/sender/components/LoadingButton.js +1 -1
  22. package/lib/theme/useToken.js +1 -35
  23. package/lib/thought-chain/hooks/useCollapsible.js +1 -1
  24. package/lib/use-x-agent/use-x-agent.js +1 -1
  25. package/lib/use-x-chat/use-x-chat.js +1 -1
  26. package/lib/x-provider/hooks/use-x-provider-context.js +1 -1
  27. package/lib/x-request/x-request.js +1 -1
  28. package/package.json +1 -1
  29. package/typings/attachments/PlaceholderUploader.vue.d.ts +1 -446
  30. package/typings/attachments/SilentUploader.vue.d.ts +1 -446
  31. package/typings/bubble/Bubble.vue.d.ts +2 -2
  32. package/typings/bubble/index.d.ts +4 -4
  33. package/typings/use-x-agent/use-x-agent.d.ts +3 -1
  34. package/typings/use-x-chat/use-x-chat.d.ts +15 -1
  35. package/typings/x-request/x-request.d.ts +4 -0
@@ -1,12 +1,12 @@
1
- import { defineComponent as y, mergeDefaults as D, computed as d, useTemplateRef as x, isVNode as c, createVNode as l, mergeProps as C } from "vue";
1
+ import { defineComponent as D, mergeDefaults as x, computed as o, useTemplateRef as $, isVNode as c, createVNode as t, mergeProps as C } from "vue";
2
2
  import { c as T } from "./Attachments2.mjs";
3
- import { useAttachmentContextInject as $ } from "./context.mjs";
4
- import A from "../_util/hooks/use-state.mjs";
5
- import { Flex as b, Typography as o, Upload as N } from "ant-design-vue";
6
- const E = /* @__PURE__ */ y({
3
+ import { useAttachmentContextInject as A } from "./context.mjs";
4
+ import b from "../_util/hooks/use-state.mjs";
5
+ import { Flex as N, Typography as s, Upload as U } from "ant-design-vue";
6
+ const L = /* @__PURE__ */ D({
7
7
  name: "AXAttachmentsPlaceholderUploader",
8
8
  __name: "PlaceholderUploader",
9
- props: D({
9
+ props: x({
10
10
  prefixCls: null,
11
11
  placeholder: null,
12
12
  upload: null,
@@ -18,49 +18,52 @@ const E = /* @__PURE__ */ y({
18
18
  setup(e, {
19
19
  expose: i
20
20
  }) {
21
- const a = `${e.prefixCls}-placeholder`, r = d(() => e.placeholder || {}), u = x("upload-dragger"), s = $(), [p, n] = A(!1), f = () => {
21
+ const l = `${e.prefixCls}-placeholder`, r = o(() => e.placeholder || {}), u = $("upload-dragger"), d = A(), [p, n] = b(!1), f = () => {
22
22
  n(!0);
23
- }, m = (t) => {
24
- t.currentTarget.contains(t.relatedTarget) || n(!1);
23
+ }, m = (a) => {
24
+ a.currentTarget.contains(a.relatedTarget) || n(!1);
25
25
  }, g = () => {
26
26
  n(!1);
27
- };
27
+ }, h = o(() => {
28
+ var a;
29
+ return (a = u.value) == null ? void 0 : a.$el;
30
+ });
28
31
  i({
29
- nativeElement: u
32
+ nativeElement: h
30
33
  });
31
- const h = (t) => Array.isArray(t) && t.every(c), v = d(() => c(e.placeholder) || h(e.placeholder) ? e.placeholder : l(b, {
34
+ const v = (a) => Array.isArray(a) && a.every(c), y = o(() => c(e.placeholder) || v(e.placeholder) ? e.placeholder : t(N, {
32
35
  align: "center",
33
36
  justify: "center",
34
37
  vertical: !0,
35
- class: `${a}-inner`
38
+ class: `${l}-inner`
36
39
  }, {
37
- default: () => [l(o.Text, {
38
- class: `${a}-icon`
40
+ default: () => [t(s.Text, {
41
+ class: `${l}-icon`
39
42
  }, {
40
43
  default: () => [r.value.icon]
41
- }), l(o.Title, {
42
- class: `${a}-title`,
44
+ }), t(s.Title, {
45
+ class: `${l}-title`,
43
46
  level: 5
44
47
  }, {
45
48
  default: () => [r.value.title]
46
- }), l(o.Text, {
47
- class: `${a}-description`,
49
+ }), t(s.Text, {
50
+ class: `${l}-description`,
48
51
  type: "secondary"
49
52
  }, {
50
53
  default: () => [r.value.description]
51
54
  })]
52
55
  }));
53
- return () => l("div", {
54
- class: T(a, {
55
- [`${a}-drag-in`]: p.value,
56
- [`${a}-disabled`]: s.value.disabled
56
+ return () => t("div", {
57
+ class: T(l, {
58
+ [`${l}-drag-in`]: p.value,
59
+ [`${l}-disabled`]: d.value.disabled
57
60
  }, e.className),
58
61
  onDragenter: f,
59
62
  onDragleave: m,
60
63
  onDrop: g,
61
- "aria-hidden": s.value.disabled,
64
+ "aria-hidden": d.value.disabled,
62
65
  style: e.style
63
- }, [l(N.Dragger, C({
66
+ }, [t(U.Dragger, C({
64
67
  showUploadList: !1
65
68
  }, e.upload, {
66
69
  ref: "upload-dragger",
@@ -70,10 +73,10 @@ const E = /* @__PURE__ */ y({
70
73
  background: "transparent"
71
74
  }
72
75
  }), {
73
- default: () => [v.value]
76
+ default: () => [y.value]
74
77
  })]);
75
78
  }
76
79
  });
77
80
  export {
78
- E as default
81
+ L as default
79
82
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as a, useTemplateRef as t, createVNode as n, mergeProps as r } from "vue";
2
- import { Upload as p } from "ant-design-vue";
3
- const u = /* @__PURE__ */ a({
1
+ import { defineComponent as n, useTemplateRef as p, computed as r, createVNode as d, mergeProps as u } from "vue";
2
+ import { Upload as s } from "ant-design-vue";
3
+ const i = /* @__PURE__ */ n({
4
4
  name: "AXAttachmentsSilentUploader",
5
5
  __name: "SilentUploader",
6
6
  props: {
@@ -9,12 +9,15 @@ const u = /* @__PURE__ */ a({
9
9
  rootClassName: null
10
10
  },
11
11
  setup(e, {
12
- expose: l
12
+ expose: o
13
13
  }) {
14
- const o = t("upload");
15
- return l({
16
- nativeElement: o
17
- }), () => n(p, r(e.upload, {
14
+ const t = p("upload"), a = r(() => {
15
+ var l;
16
+ return (l = t.value) == null ? void 0 : l.$el;
17
+ });
18
+ return o({
19
+ nativeElement: a
20
+ }), () => d(s, u(e.upload, {
18
21
  showUploadList: !1,
19
22
  ref: "upload"
20
23
  }), {
@@ -23,5 +26,5 @@ const u = /* @__PURE__ */ a({
23
26
  }
24
27
  });
25
28
  export {
26
- u as default
29
+ i as default
27
30
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, mergeDefaults as D, toRef as N, useSlots as H, ref as g, watch as x, unref as k, watchEffect as q, computed as o, createVNode as l, isVNode as z, Fragment as G, toValue as r, mergeProps as J } from "vue";
1
+ import { defineComponent as j, mergeDefaults as D, toRef as h, useSlots as H, ref as d, watch as N, unref as k, watchEffect as q, computed as r, createVNode as l, isVNode as z, Fragment as G, toValue as i, mergeProps as J } from "vue";
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";
@@ -46,36 +46,36 @@ const ce = /* @__PURE__ */ j({
46
46
  variant: "filled"
47
47
  }),
48
48
  setup(e, {
49
- expose: $
49
+ expose: x
50
50
  }) {
51
- const b = K(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
52
- N(e, "content"), N(e, "prefixCls");
53
- const a = H(), y = g(e.content);
54
- x(() => e.content, () => {
55
- y.value = e.content;
51
+ const $ = K(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
52
+ h(e, "content"), h(e, "prefixCls");
53
+ const a = H(), g = d(e.content);
54
+ N(() => e.content, () => {
55
+ g.value = e.content;
56
56
  });
57
57
  const {
58
58
  onUpdate: c
59
- } = k(U()), C = g(null), {
60
- direction: R,
61
- getPrefixCls: T
62
- } = O(), t = T("bubble", e.prefixCls), n = M("bubble"), [P, S, V, h] = W(() => e.typing), [i, u] = Q(y, P, S, V), m = g(!1);
63
- x(i, () => {
59
+ } = k(U()), y = d(null), {
60
+ direction: b,
61
+ getPrefixCls: R
62
+ } = O(), t = R("bubble", e.prefixCls), n = M("bubble"), [T, P, S, C] = W(() => e.typing), [s, u] = Q(g, T, P, S), m = d(!1);
63
+ N(s, () => {
64
64
  c == null || c();
65
65
  }), q(() => {
66
- var s;
67
- !u.value && !e.loading ? m.value || (m.value = !0, (s = e.onTypingComplete) == null || s.call(e)) : m.value = !1;
66
+ var o;
67
+ !u.value && !e.loading ? m.value || (m.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : m.value = !1;
68
68
  });
69
- const [w, B, E] = Z(() => t), F = o(() => [t, e.rootClassName, n.value.className, B.value, E, `${t}-${e.placement}`, {
70
- [`${t}-rtl`]: R.value === "rtl"
69
+ const [V, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
70
+ [`${t}-rtl`]: b.value === "rtl"
71
71
  }, {
72
- [`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !h.value
73
- }]), I = o(() => a.avatar ? a.avatar() : z(e.avatar) ? e.avatar : l(L, e.avatar, null)), f = o(() => a.message ? a.message({
74
- content: i.value
75
- }) : e.messageRender ? e.messageRender(i.value) : i.value), X = o(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
72
+ [`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !C.value
73
+ }]), F = r(() => a.avatar ? a.avatar() : z(e.avatar) ? e.avatar : l(L, e.avatar, null)), I = r(() => a.message ? a.message({
74
+ content: s.value
75
+ }) : e.messageRender ? e.messageRender(s.value) : s.value), X = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
76
76
  prefixCls: t
77
- }, null) : l(G, null, [f.value, u.value && r(h)])), A = o(() => {
78
- const s = l("div", {
77
+ }, null) : l(G, null, [I.value, u.value && i(C)])), A = r(() => {
78
+ const o = l("div", {
79
79
  style: {
80
80
  ...n.value.styles.content,
81
81
  ...e.styles.content
@@ -83,42 +83,42 @@ const ce = /* @__PURE__ */ j({
83
83
  class: [`${t}-content`, `${t}-content-${e.variant}`, {
84
84
  [`${t}-content-${e.shape}`]: e.shape
85
85
  }, n.value.classNames.content, e.classNames.content]
86
- }, [r(X)]), v = a.header ? a.header() : e.header, d = a.footer ? a.footer({
87
- content: f.value
88
- }) : typeof e.footer == "function" ? e.footer(f.value) : e.footer;
89
- return v || d ? l("div", {
86
+ }, [i(X)]), f = a.header ? a.header() : e.header, v = a.footer ? a.footer({
87
+ content: s.value
88
+ }) : typeof e.footer == "function" ? e.footer(s.value) : e.footer;
89
+ return f || v ? l("div", {
90
90
  class: `${t}-content-wrapper`
91
- }, [v && l("div", {
91
+ }, [f && l("div", {
92
92
  class: [`${t}-header`, n.value.classNames.header, e.classNames.header],
93
93
  style: {
94
94
  ...n.value.styles.header,
95
95
  ...e.styles.header
96
96
  }
97
- }, [v]), s, d && l("div", {
97
+ }, [f]), o, v && l("div", {
98
98
  class: [`${t}-footer`, n.value.classNames.footer, e.classNames.footer],
99
99
  style: {
100
100
  ...n.value.styles.footer,
101
101
  ...e.styles.footer
102
102
  }
103
- }, [d])]) : s;
103
+ }, [v])]) : o;
104
104
  });
105
- return $({
106
- nativeElement: C
107
- }), () => w(l("div", J({
105
+ return x({
106
+ nativeElement: y
107
+ }), () => V(l("div", J({
108
108
  style: {
109
109
  ...n.value.style
110
110
  // ...(style as object),
111
111
  },
112
- class: r(F)
113
- }, b, {
114
- ref: C
112
+ class: i(E)
113
+ }, $, {
114
+ ref: y
115
115
  }), [(a.avatar || e.avatar) && l("div", {
116
116
  style: {
117
117
  ...n.value.styles.avatar,
118
118
  ...e.styles.avatar
119
119
  },
120
120
  class: [`${t}-avatar`, n.value.classNames.avatar, e.classNames.avatar]
121
- }, [r(I)]), r(A)]));
121
+ }, [i(F)]), i(A)]));
122
122
  }
123
123
  });
124
124
  export {
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as a, mergeDefaults as r, createVNode as l, mergeProps as s } from "vue";
2
2
  import { a as i, c as u } from "../../attachments/Attachments2.mjs";
3
3
  import c from "./ActionButton/index.mjs";
4
- import m from "../StopLoading.mjs";
5
- import { useActionButtonContextInject as d } from "./ActionButton/context.mjs";
4
+ import d from "../StopLoading.mjs";
5
+ import { useActionButtonContextInject as m } from "./ActionButton/context.mjs";
6
6
  import { theme as p } from "ant-design-vue";
7
7
  const x = /* @__PURE__ */ a({
8
8
  name: "AXSenderLoadingButton",
@@ -27,11 +27,11 @@ const x = /* @__PURE__ */ a({
27
27
  }, {
28
28
  type: "primary",
29
29
  shape: "circle",
30
- icon: null,
30
+ icon: void 0,
31
31
  disabled: void 0
32
32
  }),
33
33
  setup(e) {
34
- const o = i(e, ["type", "shape", "icon", "disabled"]), n = d(), {
34
+ const o = i(e, ["type", "shape", "icon", "disabled"]), n = m(), {
35
35
  token: t
36
36
  } = p.useToken();
37
37
  return () => l(c, s({
@@ -47,7 +47,7 @@ const x = /* @__PURE__ */ a({
47
47
  class: u(`${n.value.prefixCls}-loading-button`),
48
48
  action: "onCancel"
49
49
  }), {
50
- default: () => [l(m, {
50
+ default: () => [l(d, {
51
51
  className: `${n.value.prefixCls}-loading-icon`
52
52
  }, null)]
53
53
  });