@arcblock/ux 3.1.28 → 3.1.30

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.
package/lib/Util/index.js CHANGED
@@ -1,70 +1,72 @@
1
- import { lazy as x } from "react";
2
- import l from "lodash/padStart";
3
- import { colors as g, getDIDMotifInfo as E } from "@arcblock/did-motif";
4
- import { mergeAllThemeOptions as vt } from "@blocklet/theme";
5
- import y from "lodash/isNil";
6
- import j from "lodash/omitBy";
7
- import k from "p-retry";
8
- import u from "js-cookie";
9
- import O from "color-convert";
1
+ import { lazy as j } from "react";
2
+ import u from "lodash/padStart";
3
+ import { colors as w, getDIDMotifInfo as x } from "@arcblock/did-motif";
4
+ import { mergeAllThemeOptions as Ke } from "@blocklet/theme";
5
+ import I from "lodash/isNil";
6
+ import E from "lodash/omitBy";
7
+ import U from "p-retry";
8
+ import m from "js-cookie";
9
+ import v from "color-convert";
10
10
  import a from "dayjs";
11
11
  import "dayjs/locale/zh-cn";
12
- import U from "dayjs/plugin/utc";
13
- import A from "dayjs/plugin/timezone";
14
- import F from "dayjs/plugin/relativeTime";
15
- import R from "dayjs/plugin/updateLocale";
16
- import W from "dayjs/plugin/localizedFormat";
17
- import { DID_PREFIX as L, BLOCKLET_SERVICE_PATH_PREFIX as P } from "./constant.js";
18
- import { getFederatedEnabled as v } from "./federated.js";
19
- let f = null;
20
- const C = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, M = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]), V = /* @__PURE__ */ new Set(["uk", "au", "cn", "nz", "za", "in", "br", "mx", "fr", "it", "ca"]);
21
- function _(t) {
22
- if (!t)
12
+ import F from "dayjs/plugin/utc";
13
+ import O from "dayjs/plugin/timezone";
14
+ import A from "dayjs/plugin/relativeTime";
15
+ import P from "dayjs/plugin/updateLocale";
16
+ import R from "dayjs/plugin/localizedFormat";
17
+ import W from "semver";
18
+ import { DID_PREFIX as L, BLOCKLET_SERVICE_PATH_PREFIX as C } from "./constant.js";
19
+ import b from "../package.json.js";
20
+ import { getFederatedEnabled as M } from "./federated.js";
21
+ let l = null;
22
+ const _ = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, z = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]), B = /* @__PURE__ */ new Set(["uk", "au", "cn", "nz", "za", "in", "br", "mx", "fr", "it", "ca"]);
23
+ function N(e) {
24
+ if (!e)
23
25
  return !1;
24
- const e = t.split(".");
25
- if (e.length < 2) return !1;
26
- const o = e[e.length - 2], n = e[e.length - 1];
27
- return M.has(o) && V.has(n);
26
+ const t = e.split(".");
27
+ if (t.length < 2) return !1;
28
+ const o = t[t.length - 2], n = t[t.length - 1];
29
+ return z.has(o) && B.has(n);
28
30
  }
29
- function lt() {
30
- const { host: t } = window.location;
31
- if (!t || C.test(t))
31
+ function ye() {
32
+ const { host: e } = window.location;
33
+ if (!e || _.test(e))
32
34
  return "";
33
- const o = t.split(":")[0].split(".");
35
+ const o = e.split(":")[0].split(".");
34
36
  if (o.length === 1)
35
37
  return "";
36
38
  if (o.length > 2) {
37
39
  const n = o.slice(-2).join(".");
38
- if (_(n))
40
+ if (N(n))
39
41
  return `.${o.slice(-3).join(".")}`;
40
42
  }
41
43
  return `.${o.slice(-2).join(".")}`;
42
44
  }
43
- function ut(t) {
44
- return t.replace(/^\?/, "").split("&").map((e) => e.split("=")).filter(([e]) => !!e).reduce((e, o) => {
45
+ function Ie(e) {
46
+ return e.replace(/^\?/, "").split("&").map((t) => t.split("=")).filter(([t]) => !!t).reduce((t, o) => {
45
47
  const n = o[0], i = decodeURIComponent(o[1]) || !0;
46
- return e[n] = i, e;
48
+ return t[n] = i, t;
47
49
  }, {});
48
50
  }
49
- function mt(t = {}) {
50
- return new URLSearchParams(t).toString();
51
+ function be(e = {}) {
52
+ return new URLSearchParams(e).toString();
51
53
  }
52
- function dt(t = 1) {
53
- let e = t;
54
- typeof e == "number" && (e = { expireInDays: e }), e.path === void 0 && (e.path = "/"), e.expireInDays || (e.expireInDays = 1);
54
+ function Se(e = 1) {
55
+ let t = e;
56
+ typeof t == "number" && (t = { expireInDays: t }), t.path === void 0 && (t.path = "/"), t.expireInDays || (t.expireInDays = 1);
55
57
  const o = {
56
- expires: e.expireInDays,
57
- path: e.path,
58
- domain: e.domain || "",
59
- sameSite: e.sameSite || "Lax",
58
+ expires: t.expireInDays,
59
+ path: t.path,
60
+ domain: t.domain || "",
61
+ sameSite: t.sameSite || "Lax",
60
62
  // 允许自定义设置为 false,默认是 true
61
- secure: e.secure !== !1
63
+ secure: t.secure !== !1
62
64
  };
63
- return (typeof window > "u" || e.domain || e.returnDomain === !1) && e.returnDomain === !1 && delete o.domain, o;
65
+ return (typeof window > "u" || t.domain || t.returnDomain === !1) && t.returnDomain === !1 && delete o.domain, o;
64
66
  }
65
- const pt = (t) => t.color ? t.color : t.dark ? t.theme.palette.common.white : t.theme.palette.text.primary, ht = (t) => t.background ? t.background : t.dark ? t.theme.palette.common.black : t.theme.palette.common.white;
66
- function gt(t, e, o = []) {
67
- const n = Object.assign({}, t), i = e.defaultProps || {};
67
+ const De = (e) => e.color ? e.color : e.dark ? e.theme.palette.common.white : e.theme.palette.text.primary, ke = (e) => e.background ? e.background : e.dark ? e.theme.palette.common.black : e.theme.palette.common.white;
68
+ function Ve(e, t, o = []) {
69
+ const n = Object.assign({}, e), i = t.defaultProps || {};
68
70
  return Object.keys(i).forEach((r) => {
69
71
  typeof n[r] == "string" && n[r].indexOf("::prop::") === 0 && (n[r] = i[r]);
70
72
  }), Array.isArray(o) && o.forEach((r) => {
@@ -77,32 +79,32 @@ function gt(t, e, o = []) {
77
79
  typeof n[r] == "string" && n[r].indexOf("::prop::") === 0 && (n[r] = "");
78
80
  }), n;
79
81
  }
80
- function wt(t = 2017) {
81
- const e = (/* @__PURE__ */ new Date()).getFullYear();
82
- return `${e}` == `${t}` ? `© ArcBlock ${e}` : `© ArcBlock ${t} - ${e}`;
82
+ function $e(e = 2017) {
83
+ const t = (/* @__PURE__ */ new Date()).getFullYear();
84
+ return `${t}` == `${e}` ? `© ArcBlock ${t}` : `© ArcBlock ${e} - ${t}`;
83
85
  }
84
- const yt = () => typeof Intl == "object" && typeof Intl.DateTimeFormat == "function" && typeof Intl.DateTimeFormat().resolvedOptions == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone : "", It = (t) => {
85
- let e = 0;
86
- for (let n = 0; n < t.length; n++)
87
- e = t.charCodeAt(n) + ((e << 5) - e);
86
+ const Te = () => typeof Intl == "object" && typeof Intl.DateTimeFormat == "function" && typeof Intl.DateTimeFormat().resolvedOptions == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone : "", je = (e) => {
87
+ let t = 0;
88
+ for (let n = 0; n < e.length; n++)
89
+ t = e.charCodeAt(n) + ((t << 5) - t);
88
90
  let o = "#";
89
91
  for (let n = 0; n < 3; n++) {
90
- const i = e >> n * 8 & 255;
92
+ const i = t >> n * 8 & 255;
91
93
  o += `00${i.toString(16)}`.substr(-2);
92
94
  }
93
95
  return o;
94
- }, bt = (t) => {
95
- const e = Math.round(t / 1e3), o = Math.floor(e / 3600), n = Math.floor((e - o * 3600) / 60), i = e % 60;
96
- return `${l(o, 2, "0")}:${l(n, 2, "0")}:${l(i, 2, "0")}`;
96
+ }, xe = (e) => {
97
+ const t = Math.round(e / 1e3), o = Math.floor(t / 3600), n = Math.floor((t - o * 3600) / 60), i = t % 60;
98
+ return `${u(o, 2, "0")}:${u(n, 2, "0")}:${u(i, 2, "0")}`;
97
99
  };
98
- function z(t) {
99
- f = t;
100
+ function X(e) {
101
+ l = e;
100
102
  }
101
- function Dt() {
102
- return f;
103
+ function Ee() {
104
+ return l;
103
105
  }
104
- const I = (t) => (e, { locale: o, tz: n, isUtc: i } = {}) => {
105
- if (f === null && (a.extend(W), a.extend(U), a.extend(A), a.extend(R), a.extend(F), a.updateLocale("zh-cn", {
106
+ const S = (e) => (t, { locale: o, tz: n, isUtc: i } = {}) => {
107
+ if (l === null && (a.extend(R), a.extend(F), a.extend(O), a.extend(P), a.extend(A), a.updateLocale("zh-cn", {
106
108
  // copy with https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js
107
109
  relativeTime: {
108
110
  future: "%s后",
@@ -119,49 +121,49 @@ const I = (t) => (e, { locale: o, tz: n, isUtc: i } = {}) => {
119
121
  y: "1 年",
120
122
  yy: "%d 年"
121
123
  }
122
- }), z(a)), y(e) || e === "")
124
+ }), X(a)), I(t) || t === "")
123
125
  return "-";
124
- let r = f(e);
125
- return n && (r = r.tz(n)), i && (r = r.utc()), typeof o < "u" && (r = r.locale(o)), r.format(t);
126
+ let r = l(t);
127
+ return n && (r = r.tz(n)), i && (r = r.utc()), typeof o < "u" && (r = r.locale(o)), r.format(e);
126
128
  };
127
- function $t(t, { locale: e = "en", tz: o } = {}) {
128
- return I("ll")(t, { locale: e, tz: o });
129
+ function Ue(e, { locale: t = "en", tz: o } = {}) {
130
+ return S("ll")(e, { locale: t, tz: o });
129
131
  }
130
- function Tt(t, {
131
- locale: e = "en",
132
+ function ve(e, {
133
+ locale: t = "en",
132
134
  tz: o,
133
135
  isUtc: n = !1,
134
136
  format: i = "lll"
135
137
  } = {}) {
136
- return I(i)(t, { locale: e, tz: o, isUtc: n });
138
+ return S(i)(e, { locale: t, tz: o, isUtc: n });
137
139
  }
138
- function B() {
139
- const t = window?.ABT_DEV || window.ABT;
140
- return t && typeof t.open == "function" ? t : null;
140
+ function K() {
141
+ const e = window?.ABT_DEV || window.ABT;
142
+ return e && typeof e.open == "function" ? e : null;
141
143
  }
142
- function St({
143
- webWalletUrl: t,
144
- action: e = "login",
144
+ function Fe({
145
+ webWalletUrl: e,
146
+ action: t = "login",
145
147
  locale: o = "en",
146
148
  url: n,
147
149
  windowFeatures: i,
148
150
  appInfo: r,
149
- memberAppInfo: p
151
+ memberAppInfo: f
150
152
  }) {
151
- const h = B();
153
+ const h = K();
152
154
  if (h)
153
155
  return h.open({
154
- action: e,
156
+ action: t,
155
157
  locale: o,
156
158
  url: encodeURIComponent(n),
157
159
  appInfo: {
158
160
  ...r
159
161
  },
160
162
  memberAppInfo: {
161
- ...p
163
+ ...f
162
164
  }
163
165
  }), { type: "extension" };
164
- const b = {
166
+ const D = {
165
167
  toolbar: "no",
166
168
  location: "no",
167
169
  status: "no",
@@ -171,65 +173,65 @@ function St({
171
173
  // iphone 8plus size
172
174
  width: 414,
173
175
  height: 736
174
- }, D = `${t}?action=${e}&locale=${o}&url=${encodeURIComponent(n)}`, c = Object.assign({}, b, i), $ = (s) => s.innerWidth || s.document.documentElement.clientWidth || s.document.body.clientWidth;
176
+ }, k = `${e}?action=${t}&locale=${o}&url=${encodeURIComponent(n)}`, c = Object.assign({}, D, i), V = (s) => s.innerWidth || s.document.documentElement.clientWidth || s.document.body.clientWidth;
175
177
  if (!("left" in c)) {
176
- const s = $(window.top || window), S = window.screenLeft || window.screenX;
177
- c.left = s + S - c.width;
178
+ const s = V(window.top || window), T = window.screenLeft || window.screenX;
179
+ c.left = s + T - c.width;
178
180
  }
179
181
  if (!("top" in c)) {
180
182
  const s = window.screenTop || window.screenY;
181
183
  c.top = s;
182
184
  }
183
- const T = Object.keys(c).map((s) => `${s}=${c[s]}`).join(",");
184
- return window.open(D, "targetWindow", T), { type: "web" };
185
+ const $ = Object.keys(c).map((s) => `${s}=${c[s]}`).join(",");
186
+ return window.open(k, "targetWindow", $), { type: "web" };
185
187
  }
186
- const xt = (t) => t && Number(t) >= 12 ? `${Number(t)}px` : "inherit", N = (t) => {
187
- const e = t.replace(L, "");
188
- return !!/^(0x)?[0-9a-f]{40}$/i.test(e);
189
- }, X = (t, e) => {
190
- if (!e)
191
- return t;
188
+ const Oe = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", J = (e) => {
189
+ const t = e.replace(L, "");
190
+ return !!/^(0x)?[0-9a-f]{40}$/i.test(t);
191
+ }, Q = (e, t) => {
192
+ if (!t)
193
+ return e;
192
194
  try {
193
- const o = new URL(t, window.location.origin);
194
- return Object.keys(e).forEach((n) => {
195
- o.searchParams.set(n, String(e[n]));
195
+ const o = new URL(e, window.location.origin);
196
+ return Object.keys(t).forEach((n) => {
197
+ o.searchParams.set(n, String(t[n]));
196
198
  }), o.origin === window.location.origin ? o.pathname + o.search : o.href;
197
199
  } catch {
198
- return t;
200
+ return e;
199
201
  }
200
- }, Et = (t, e = 48) => t && (t.indexOf(P) >= 0 ? X(t, {
202
+ }, Ae = (e, t = 48) => e && (e.indexOf(C) >= 0 ? Q(e, {
201
203
  imageFilter: "resize",
202
- w: e,
203
- h: e
204
- }) : t), jt = (t = 0) => new Promise((e) => {
204
+ w: t,
205
+ h: t
206
+ }) : e), Pe = (e = 0) => new Promise((t) => {
205
207
  setTimeout(() => {
206
- e();
207
- }, t);
208
- }), kt = (t) => /^https?:\/\//.test(t), m = "vid", d = "__visitor_id", K = () => u.get(m) || localStorage.getItem(d), w = (t) => {
209
- t === null ? u.remove(m, {
208
+ t();
209
+ }, e);
210
+ }), Re = (e) => /^https?:\/\//.test(e), p = "vid", g = "__visitor_id", Y = () => m.get(p) || localStorage.getItem(g), y = (e) => {
211
+ e === null ? m.remove(p, {
210
212
  sameSite: "None",
211
213
  secure: !0
212
- }) : u.set(m, t, {
214
+ }) : m.set(p, e, {
213
215
  sameSite: "None",
214
216
  secure: !0,
215
217
  expires: 365
216
218
  });
217
- }, Ot = () => {
218
- let t = localStorage.getItem(d);
219
- if (t && (localStorage.removeItem(d), w(t)), !K()) {
220
- if (!v())
219
+ }, We = () => {
220
+ let e = localStorage.getItem(g);
221
+ if (e && (localStorage.removeItem(g), y(e)), !Y()) {
222
+ if (!M())
221
223
  try {
222
224
  if (window.crypto && typeof window.crypto.randomUUID == "function")
223
- t = window.crypto.randomUUID();
225
+ e = window.crypto.randomUUID();
224
226
  else {
225
- const e = new Uint8Array(16);
227
+ const t = new Uint8Array(16);
226
228
  if (window.crypto && typeof window.crypto.getRandomValues == "function")
227
- window.crypto.getRandomValues(e);
229
+ window.crypto.getRandomValues(t);
228
230
  else
229
231
  for (let n = 0; n < 16; n++)
230
- e[n] = Math.floor(Math.random() * 256);
231
- const o = Array.from(e).map((n) => n.toString(16).padStart(2, "0"));
232
- t = [
232
+ t[n] = Math.floor(Math.random() * 256);
233
+ const o = Array.from(t).map((n) => n.toString(16).padStart(2, "0"));
234
+ e = [
233
235
  o.slice(0, 4).join(""),
234
236
  o.slice(4, 6).join(""),
235
237
  o.slice(6, 8).join(""),
@@ -238,77 +240,95 @@ const xt = (t) => t && Number(t) >= 12 ? `${Number(t)}px` : "inherit", N = (t) =
238
240
  ].join("-");
239
241
  }
240
242
  } catch {
241
- t = `${Date.now()}-${Math.random().toString(36).substring(2, 15)}`;
243
+ e = `${Date.now()}-${Math.random().toString(36).substring(2, 15)}`;
242
244
  }
243
- t && w(t);
245
+ e && y(e);
244
246
  }
245
- }, Ut = (t) => {
246
- if (N(t)) {
247
- const e = Uint8Array.from(
248
- t.slice(2).match(/.{1,2}/g).map((o) => parseInt(o, 16))
249
- ).slice(0, 8).reduce((o, n) => o + n, 0) % g.length;
250
- return g[e];
247
+ }, Le = (e) => {
248
+ if (J(e)) {
249
+ const t = Uint8Array.from(
250
+ e.slice(2).match(/.{1,2}/g).map((o) => parseInt(o, 16))
251
+ ).slice(0, 8).reduce((o, n) => o + n, 0) % w.length;
252
+ return w[t];
251
253
  }
252
254
  try {
253
- return E(t)?.color;
255
+ return x(e)?.color;
254
256
  } catch {
255
257
  return null;
256
258
  }
257
- }, At = (t, e, o = {}) => {
259
+ }, Ce = (e, t, o = {}) => {
258
260
  const { fallbackLocale: n = "en", defaultValue: i = "unknown" } = o;
259
- if (typeof t == "string")
260
- return t;
261
+ if (typeof e == "string")
262
+ return e;
261
263
  let r;
262
- return e && (r = t[e]), (!r || typeof r != "string") && (r = t[n]), (!r || typeof r != "string") && (r = i), r;
263
- }, Ft = (t) => x(
264
- () => k(
264
+ return t && (r = e[t]), (!r || typeof r != "string") && (r = e[n]), (!r || typeof r != "string") && (r = i), r;
265
+ }, Me = (e) => j(
266
+ () => U(
265
267
  async () => {
266
268
  try {
267
- return await t();
268
- } catch (e) {
269
- throw e instanceof TypeError && !e.message.includes("Failed to fetch") ? e : e instanceof Error ? new Error(e.message) : new Error("Unknown error");
269
+ return await e();
270
+ } catch (t) {
271
+ throw t instanceof TypeError && !t.message.includes("Failed to fetch") ? t : t instanceof Error ? new Error(t.message) : new Error("Unknown error");
270
272
  }
271
273
  },
272
274
  // 只需要重试两次,加上原本的一次,总共三次
273
275
  { retries: 2 }
274
276
  )
275
- ), Rt = (t) => j(t, y);
276
- function Wt(t, e = 1) {
277
- const [o, n, i] = O.hex.rgb(t);
278
- return `rgba(${o}, ${n}, ${i}, ${e})`;
277
+ ), _e = (e) => E(e, I);
278
+ function ze(e, t = 1) {
279
+ const [o, n, i] = v.hex.rgb(e);
280
+ return `rgba(${o}, ${n}, ${i}, ${t})`;
279
281
  }
282
+ const G = () => window.blocklet?.serverVersion || "", H = () => b.version, Z = () => (b.dependencies?.["@blocklet/js-sdk"]).replace(/^[\^~>=<]+/, ""), d = (e, t) => {
283
+ const o = (r) => {
284
+ const f = r.match(/^(\d+\.\d+\.\d+(?:-[^-]+?-\d{8}))/);
285
+ return f ? f[1] : r;
286
+ }, n = o(e), i = o(t);
287
+ return n === i && e !== t ? !1 : W.gte(n, i);
288
+ }, Be = () => {
289
+ const e = G(), t = H(), o = Z();
290
+ if (!e || !t || !o)
291
+ return !1;
292
+ const n = d(t, "3.1.29"), i = d(e, "1.16.49-beta-20250822-070545-6d3344cc"), r = d(o, "1.16.49-beta-20250822-070545-6d3344cc");
293
+ return n && i && r;
294
+ };
280
295
  export {
281
- X as appendParams,
282
- Rt as cleanedObj,
283
- vt as deepmergeAll,
284
- B as detectWalletExtension,
285
- Ot as ensureVisitorId,
286
- $t as formatToDate,
287
- Tt as formatToDatetime,
288
- bt as formatUptime,
289
- ht as getBackground,
290
- pt as getColor,
291
- dt as getCookieOptions,
292
- wt as getCopyright,
293
- Ut as getDIDColor,
294
- Dt as getDateTool,
295
- xt as getFontSize,
296
- yt as getTimezone,
297
- At as getTranslation,
298
- Et as getUserAvatar,
299
- K as getVisitorId,
300
- Wt as hexToRgba,
301
- N as isEthereumDid,
302
- _ as isTwoSegmentTLD,
303
- kt as isUrl,
304
- Ft as lazyRetry,
305
- gt as mergeProps,
306
- St as openWebWallet,
307
- ut as parseQuery,
308
- lt as resolveRootDomain,
309
- z as setDateTool,
310
- w as setVisitorId,
311
- jt as sleep,
312
- It as str2color,
313
- mt as stringifyQuery
296
+ Q as appendParams,
297
+ _e as cleanedObj,
298
+ d as compareVersions,
299
+ Ke as deepmergeAll,
300
+ K as detectWalletExtension,
301
+ We as ensureVisitorId,
302
+ Ue as formatToDate,
303
+ ve as formatToDatetime,
304
+ xe as formatUptime,
305
+ ke as getBackground,
306
+ De as getColor,
307
+ Se as getCookieOptions,
308
+ $e as getCopyright,
309
+ Le as getDIDColor,
310
+ Ee as getDateTool,
311
+ Oe as getFontSize,
312
+ Z as getJsSdkVersion,
313
+ G as getServerVersion,
314
+ Te as getTimezone,
315
+ Ce as getTranslation,
316
+ Ae as getUserAvatar,
317
+ H as getUxPackageVersion,
318
+ Y as getVisitorId,
319
+ ze as hexToRgba,
320
+ J as isEthereumDid,
321
+ Be as isSupportFollow,
322
+ N as isTwoSegmentTLD,
323
+ Re as isUrl,
324
+ Me as lazyRetry,
325
+ Ve as mergeProps,
326
+ Fe as openWebWallet,
327
+ Ie as parseQuery,
328
+ ye as resolveRootDomain,
329
+ X as setDateTool,
330
+ y as setVisitorId,
331
+ Pe as sleep,
332
+ je as str2color,
333
+ be as stringifyQuery
314
334
  };
@@ -0,0 +1,9 @@
1
+ const e = "3.1.30", s = { "@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473" }, t = {
2
+ version: e,
3
+ dependencies: s
4
+ };
5
+ export {
6
+ t as default,
7
+ s as dependencies,
8
+ e as version
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.1.28",
3
+ "version": "3.1.30",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -45,6 +45,7 @@
45
45
  "@types/pako": "^2.0.3",
46
46
  "@types/react": "^19.1.8",
47
47
  "@types/react-helmet": "^6.1.11",
48
+ "@types/semver": "^7.7.0",
48
49
  "@types/webfontloader": "^1.6.38",
49
50
  "babel-jest": "29",
50
51
  "babel-plugin-inline-react-svg": "^2.0.2",
@@ -67,16 +68,16 @@
67
68
  "react": "^19.0.0",
68
69
  "react-router-dom": "^6.22.3"
69
70
  },
70
- "gitHead": "8a62be8796c0ab9129b24a08ecc051d1ac23e0de",
71
+ "gitHead": "a51fede74e5eca679ff40a8c62d96bae09210f04",
71
72
  "dependencies": {
72
- "@arcblock/bridge": "3.1.28",
73
+ "@arcblock/bridge": "3.1.30",
73
74
  "@arcblock/did": "^1.21.3",
74
75
  "@arcblock/did-motif": "^1.1.14",
75
- "@arcblock/icons": "3.1.28",
76
- "@arcblock/nft-display": "3.1.28",
77
- "@arcblock/react-hooks": "3.1.28",
78
- "@blocklet/js-sdk": "^1.16.48",
79
- "@blocklet/theme": "3.1.28",
76
+ "@arcblock/icons": "3.1.30",
77
+ "@arcblock/nft-display": "3.1.30",
78
+ "@arcblock/react-hooks": "3.1.30",
79
+ "@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473",
80
+ "@blocklet/theme": "3.1.30",
80
81
  "@fontsource/roboto": "~5.1.1",
81
82
  "@fontsource/ubuntu-mono": "^5.2.6",
82
83
  "@iconify-icons/logos": "^1.2.36",
@@ -123,6 +124,7 @@
123
124
  "react-svg": "^16.3.0",
124
125
  "react-use": "^17.6.0",
125
126
  "rebound": "^0.1.0",
127
+ "semver": "^7.7.2",
126
128
  "topojson-client": "^3.1.0",
127
129
  "type-fest": "^4.41.0",
128
130
  "validator": "^13.15.15",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { UserCardProps, InfoType, User } from '../types';
2
+ import { UserCardProps, User } from '../types';
3
3
  import TooltipAvatar from '../Content/tooltip-avatar';
4
4
 
5
5
  interface AvatarOnlyCardProps extends Omit<UserCardProps, 'user'> {
@@ -12,20 +12,6 @@ interface AvatarOnlyCardProps extends Omit<UserCardProps, 'user'> {
12
12
  function AvatarOnlyCard(props: AvatarOnlyCardProps) {
13
13
  const { user, infoType, avatarSize = 48, shouldShowHoverCard = false, renderCardContent, ...rest } = props;
14
14
 
15
- // 对于NameOnly类型使用普通Tooltip
16
- if (infoType === InfoType.NameOnly) {
17
- return (
18
- <TooltipAvatar
19
- user={user}
20
- avatarSize={avatarSize}
21
- shouldShowHoverCard={false}
22
- renderCardContent={renderCardContent}
23
- tooltipTitle={user.fullName || user.email || user.did}
24
- {...rest}
25
- />
26
- );
27
- }
28
-
29
15
  // 其他类型使用自定义Tooltip或无Tooltip
30
16
  return (
31
17
  <TooltipAvatar
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { UserCardProps, InfoType, User } from '../types';
3
- import NameOnlyCard from './name-only';
2
+ import { UserCardProps, User } from '../types';
4
3
  import BasicCard from './basic-info';
5
4
 
6
5
  interface DetailedCardProps extends Omit<UserCardProps, 'user'> {
@@ -11,15 +10,7 @@ interface DetailedCardProps extends Omit<UserCardProps, 'user'> {
11
10
 
12
11
  // DetailedCard组件,根据infoType选择不同的卡片组件进行渲染
13
12
  function DetailedCard({ ...props }: DetailedCardProps) {
14
- const { infoType = InfoType.Minimal } = props;
15
-
16
- // 根据信息类型选择合适的卡片组件
17
- switch (infoType) {
18
- case InfoType.NameOnly:
19
- return <NameOnlyCard {...props} />;
20
- default:
21
- return <BasicCard {...props} />;
22
- }
13
+ return <BasicCard {...props} />;
23
14
  }
24
15
 
25
16
  export default DetailedCard;