@alicloud/appflow-chat 0.0.4-beta.4 → 0.0.4-beta.6

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 (36) hide show
  1. package/dist/appflow-chat.cjs.js +2028 -1
  2. package/dist/appflow-chat.esm.js +38352 -23
  3. package/dist/types/index.d.ts +169 -0
  4. package/package.json +3 -15
  5. package/src/components/HumanVerify/CustomParamsRenderer/ArrayField.tsx +6 -4
  6. package/src/components/HumanVerify/CustomParamsRenderer/EnumField.tsx +5 -3
  7. package/src/components/HumanVerify/CustomParamsRenderer/FieldRenderer.tsx +6 -4
  8. package/src/components/HumanVerify/CustomParamsRenderer/FileField.tsx +38 -30
  9. package/src/components/HumanVerify/CustomParamsRenderer/ObjectField.tsx +4 -2
  10. package/src/components/HumanVerify/CustomParamsRenderer/TimeField.tsx +38 -101
  11. package/src/components/HumanVerify/HistoryCard.tsx +6 -4
  12. package/src/components/HumanVerify/HumanVerify.tsx +5 -3
  13. package/src/components/MessageBubble.tsx +4 -2
  14. package/src/components/RichMessageBubble.tsx +4 -2
  15. package/src/core/RichBubbleContent.tsx +4 -2
  16. package/src/core/SourceContent.tsx +5 -3
  17. package/src/core/WebSearchContent.tsx +3 -1
  18. package/src/i18n/LocaleContext.tsx +70 -0
  19. package/src/i18n/index.ts +16 -0
  20. package/src/i18n/translate.ts +42 -0
  21. package/src/i18n/useTranslation.ts +39 -0
  22. package/src/i18n/utils.ts +67 -0
  23. package/src/index.ts +25 -0
  24. package/src/locales/en-US.ts +77 -0
  25. package/src/locales/index.ts +7 -0
  26. package/src/locales/types.ts +35 -0
  27. package/src/locales/zh-CN.ts +78 -0
  28. package/src/markdown/components/Chart.tsx +3 -1
  29. package/src/markdown/components/Mermaid.tsx +8 -6
  30. package/src/markdown/index.tsx +11 -8
  31. package/dist/dayjs.min-L7v6Rjvs.cjs +0 -1
  32. package/dist/dayjs.min-MIkW36mC.js +0 -301
  33. package/dist/index-CsdPG_CH.cjs +0 -2032
  34. package/dist/index-DuGIPL7L.js +0 -37902
  35. package/dist/moment-BOHN1eRP.js +0 -2578
  36. package/dist/moment-BdH06dpW.cjs +0 -10
@@ -1,301 +0,0 @@
1
- import { g as R, c as X } from "./index-DuGIPL7L.js";
2
- function tt(Y, F) {
3
- for (var D = 0; D < F.length; D++) {
4
- const m = F[D];
5
- if (typeof m != "string" && !Array.isArray(m)) {
6
- for (const M in m)
7
- if (M !== "default" && !(M in Y)) {
8
- const S = Object.getOwnPropertyDescriptor(m, M);
9
- S && Object.defineProperty(Y, M, S.get ? S : {
10
- enumerable: !0,
11
- get: () => m[M]
12
- });
13
- }
14
- }
15
- }
16
- return Object.freeze(Object.defineProperty(Y, Symbol.toStringTag, { value: "Module" }));
17
- }
18
- var V = { exports: {} };
19
- (function(Y, F) {
20
- (function(D, m) {
21
- Y.exports = m();
22
- })(X, function() {
23
- var D = 1e3, m = 6e4, M = 36e5, S = "millisecond", b = "second", k = "minute", j = "hour", g = "day", L = "week", y = "month", J = "quarter", v = "year", x = "date", P = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, G = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, Q = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
24
- var r = ["th", "st", "nd", "rd"], t = s % 100;
25
- return "[" + s + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
26
- } }, U = function(s, r, t) {
27
- var n = String(s);
28
- return !n || n.length >= r ? s : "" + Array(r + 1 - n.length).join(t) + s;
29
- }, K = { s: U, z: function(s) {
30
- var r = -s.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60;
31
- return (r <= 0 ? "+" : "-") + U(n, 2, "0") + ":" + U(e, 2, "0");
32
- }, m: function s(r, t) {
33
- if (r.date() < t.date()) return -s(t, r);
34
- var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, y), i = t - e < 0, u = r.clone().add(n + (i ? -1 : 1), y);
35
- return +(-(n + (t - e) / (i ? e - u : u - e)) || 0);
36
- }, a: function(s) {
37
- return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
38
- }, p: function(s) {
39
- return { M: y, y: v, w: L, d: g, D: x, h: j, m: k, s: b, ms: S, Q: J }[s] || String(s || "").toLowerCase().replace(/s$/, "");
40
- }, u: function(s) {
41
- return s === void 0;
42
- } }, H = "en", w = {};
43
- w[H] = Q;
44
- var Z = "$isDayjsObject", z = function(s) {
45
- return s instanceof I || !(!s || !s[Z]);
46
- }, W = function s(r, t, n) {
47
- var e;
48
- if (!r) return H;
49
- if (typeof r == "string") {
50
- var i = r.toLowerCase();
51
- w[i] && (e = i), t && (w[i] = t, e = i);
52
- var u = r.split("-");
53
- if (!e && u.length > 1) return s(u[0]);
54
- } else {
55
- var o = r.name;
56
- w[o] = r, e = o;
57
- }
58
- return !n && e && (H = e), e || !n && H;
59
- }, f = function(s, r) {
60
- if (z(s)) return s.clone();
61
- var t = typeof r == "object" ? r : {};
62
- return t.date = s, t.args = arguments, new I(t);
63
- }, a = K;
64
- a.l = W, a.i = z, a.w = function(s, r) {
65
- return f(s, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
66
- };
67
- var I = function() {
68
- function s(t) {
69
- this.$L = W(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[Z] = !0;
70
- }
71
- var r = s.prototype;
72
- return r.parse = function(t) {
73
- this.$d = function(n) {
74
- var e = n.date, i = n.utc;
75
- if (e === null) return /* @__PURE__ */ new Date(NaN);
76
- if (a.u(e)) return /* @__PURE__ */ new Date();
77
- if (e instanceof Date) return new Date(e);
78
- if (typeof e == "string" && !/Z$/i.test(e)) {
79
- var u = e.match(B);
80
- if (u) {
81
- var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
82
- return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
83
- }
84
- }
85
- return new Date(e);
86
- }(t), this.init();
87
- }, r.init = function() {
88
- var t = this.$d;
89
- this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
90
- }, r.$utils = function() {
91
- return a;
92
- }, r.isValid = function() {
93
- return this.$d.toString() !== P;
94
- }, r.isSame = function(t, n) {
95
- var e = f(t);
96
- return this.startOf(n) <= e && e <= this.endOf(n);
97
- }, r.isAfter = function(t, n) {
98
- return f(t) < this.startOf(n);
99
- }, r.isBefore = function(t, n) {
100
- return this.endOf(n) < f(t);
101
- }, r.$g = function(t, n, e) {
102
- return a.u(t) ? this[n] : this.set(e, t);
103
- }, r.unix = function() {
104
- return Math.floor(this.valueOf() / 1e3);
105
- }, r.valueOf = function() {
106
- return this.$d.getTime();
107
- }, r.startOf = function(t, n) {
108
- var e = this, i = !!a.u(n) || n, u = a.p(t), o = function(O, l) {
109
- var p = a.w(e.$u ? Date.UTC(e.$y, l, O) : new Date(e.$y, l, O), e);
110
- return i ? p : p.endOf(g);
111
- }, c = function(O, l) {
112
- return a.w(e.toDate()[O].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(l)), e);
113
- }, h = this.$W, d = this.$M, $ = this.$D, T = "set" + (this.$u ? "UTC" : "");
114
- switch (u) {
115
- case v:
116
- return i ? o(1, 0) : o(31, 11);
117
- case y:
118
- return i ? o(1, d) : o(0, d + 1);
119
- case L:
120
- var _ = this.$locale().weekStart || 0, A = (h < _ ? h + 7 : h) - _;
121
- return o(i ? $ - A : $ + (6 - A), d);
122
- case g:
123
- case x:
124
- return c(T + "Hours", 0);
125
- case j:
126
- return c(T + "Minutes", 1);
127
- case k:
128
- return c(T + "Seconds", 2);
129
- case b:
130
- return c(T + "Milliseconds", 3);
131
- default:
132
- return this.clone();
133
- }
134
- }, r.endOf = function(t) {
135
- return this.startOf(t, !1);
136
- }, r.$set = function(t, n) {
137
- var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[g] = u + "Date", e[x] = u + "Date", e[y] = u + "Month", e[v] = u + "FullYear", e[j] = u + "Hours", e[k] = u + "Minutes", e[b] = u + "Seconds", e[S] = u + "Milliseconds", e)[i], c = i === g ? this.$D + (n - this.$W) : n;
138
- if (i === y || i === v) {
139
- var h = this.clone().set(x, 1);
140
- h.$d[o](c), h.init(), this.$d = h.set(x, Math.min(this.$D, h.daysInMonth())).$d;
141
- } else o && this.$d[o](c);
142
- return this.init(), this;
143
- }, r.set = function(t, n) {
144
- return this.clone().$set(t, n);
145
- }, r.get = function(t) {
146
- return this[a.p(t)]();
147
- }, r.add = function(t, n) {
148
- var e, i = this;
149
- t = Number(t);
150
- var u = a.p(n), o = function(d) {
151
- var $ = f(i);
152
- return a.w($.date($.date() + Math.round(d * t)), i);
153
- };
154
- if (u === y) return this.set(y, this.$M + t);
155
- if (u === v) return this.set(v, this.$y + t);
156
- if (u === g) return o(1);
157
- if (u === L) return o(7);
158
- var c = (e = {}, e[k] = m, e[j] = M, e[b] = D, e)[u] || 1, h = this.$d.getTime() + t * c;
159
- return a.w(h, this);
160
- }, r.subtract = function(t, n) {
161
- return this.add(-1 * t, n);
162
- }, r.format = function(t) {
163
- var n = this, e = this.$locale();
164
- if (!this.isValid()) return e.invalidDate || P;
165
- var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, $ = e.months, T = e.meridiem, _ = function(l, p, C, N) {
166
- return l && (l[p] || l(n, i)) || C[p].slice(0, N);
167
- }, A = function(l) {
168
- return a.s(o % 12 || 12, l, "0");
169
- }, O = T || function(l, p, C) {
170
- var N = l < 12 ? "AM" : "PM";
171
- return C ? N.toLowerCase() : N;
172
- };
173
- return i.replace(G, function(l, p) {
174
- return p || function(C) {
175
- switch (C) {
176
- case "YY":
177
- return String(n.$y).slice(-2);
178
- case "YYYY":
179
- return a.s(n.$y, 4, "0");
180
- case "M":
181
- return h + 1;
182
- case "MM":
183
- return a.s(h + 1, 2, "0");
184
- case "MMM":
185
- return _(e.monthsShort, h, $, 3);
186
- case "MMMM":
187
- return _($, h);
188
- case "D":
189
- return n.$D;
190
- case "DD":
191
- return a.s(n.$D, 2, "0");
192
- case "d":
193
- return String(n.$W);
194
- case "dd":
195
- return _(e.weekdaysMin, n.$W, d, 2);
196
- case "ddd":
197
- return _(e.weekdaysShort, n.$W, d, 3);
198
- case "dddd":
199
- return d[n.$W];
200
- case "H":
201
- return String(o);
202
- case "HH":
203
- return a.s(o, 2, "0");
204
- case "h":
205
- return A(1);
206
- case "hh":
207
- return A(2);
208
- case "a":
209
- return O(o, c, !0);
210
- case "A":
211
- return O(o, c, !1);
212
- case "m":
213
- return String(c);
214
- case "mm":
215
- return a.s(c, 2, "0");
216
- case "s":
217
- return String(n.$s);
218
- case "ss":
219
- return a.s(n.$s, 2, "0");
220
- case "SSS":
221
- return a.s(n.$ms, 3, "0");
222
- case "Z":
223
- return u;
224
- }
225
- return null;
226
- }(l) || u.replace(":", "");
227
- });
228
- }, r.utcOffset = function() {
229
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
230
- }, r.diff = function(t, n, e) {
231
- var i, u = this, o = a.p(n), c = f(t), h = (c.utcOffset() - this.utcOffset()) * m, d = this - c, $ = function() {
232
- return a.m(u, c);
233
- };
234
- switch (o) {
235
- case v:
236
- i = $() / 12;
237
- break;
238
- case y:
239
- i = $();
240
- break;
241
- case J:
242
- i = $() / 3;
243
- break;
244
- case L:
245
- i = (d - h) / 6048e5;
246
- break;
247
- case g:
248
- i = (d - h) / 864e5;
249
- break;
250
- case j:
251
- i = d / M;
252
- break;
253
- case k:
254
- i = d / m;
255
- break;
256
- case b:
257
- i = d / D;
258
- break;
259
- default:
260
- i = d;
261
- }
262
- return e ? i : a.a(i);
263
- }, r.daysInMonth = function() {
264
- return this.endOf(y).$D;
265
- }, r.$locale = function() {
266
- return w[this.$L];
267
- }, r.locale = function(t, n) {
268
- if (!t) return this.$L;
269
- var e = this.clone(), i = W(t, n, !0);
270
- return i && (e.$L = i), e;
271
- }, r.clone = function() {
272
- return a.w(this.$d, this);
273
- }, r.toDate = function() {
274
- return new Date(this.valueOf());
275
- }, r.toJSON = function() {
276
- return this.isValid() ? this.toISOString() : null;
277
- }, r.toISOString = function() {
278
- return this.$d.toISOString();
279
- }, r.toString = function() {
280
- return this.$d.toUTCString();
281
- }, s;
282
- }(), E = I.prototype;
283
- return f.prototype = E, [["$ms", S], ["$s", b], ["$m", k], ["$H", j], ["$W", g], ["$M", y], ["$y", v], ["$D", x]].forEach(function(s) {
284
- E[s[1]] = function(r) {
285
- return this.$g(r, s[0], s[1]);
286
- };
287
- }), f.extend = function(s, r) {
288
- return s.$i || (s(r, I, f), s.$i = !0), f;
289
- }, f.locale = W, f.isDayjs = z, f.unix = function(s) {
290
- return f(1e3 * s);
291
- }, f.en = w[H], f.Ls = w, f.p = {}, f;
292
- });
293
- })(V);
294
- var q = V.exports;
295
- const et = /* @__PURE__ */ R(q), nt = /* @__PURE__ */ tt({
296
- __proto__: null,
297
- default: et
298
- }, [q]);
299
- export {
300
- nt as d
301
- };