@arcblock/ux 3.4.4 → 3.4.5

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.
@@ -123,3 +123,4 @@ export declare const compareVersions: (version1: string, version2: string) => bo
123
123
  */
124
124
  export declare const isSupportFollow: () => boolean;
125
125
  export declare const formatAxiosError: (err: AxiosError) => string;
126
+ export declare const mergeIgnoreEmpty: (...objects: Array<Record<string, any>>) => any;
package/lib/Util/index.js CHANGED
@@ -1,60 +1,61 @@
1
- import { lazy as T } from "react";
1
+ import { lazy as V } from "react";
2
2
  import l from "lodash/padStart";
3
3
  import { colors as w, getDIDMotifInfo as j } from "@arcblock/did-motif";
4
- import { mergeAllThemeOptions as Ke } from "@blocklet/theme";
4
+ import { mergeAllThemeOptions as qe } from "@blocklet/theme";
5
5
  import I from "lodash/isNil";
6
6
  import E from "lodash/omitBy";
7
- import v from "p-retry";
7
+ import v from "lodash/mergeWith";
8
+ import O from "p-retry";
8
9
  import m from "js-cookie";
9
- import O from "color-convert";
10
+ import U from "color-convert";
10
11
  import a from "dayjs";
11
12
  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";
13
+ import A from "dayjs/plugin/utc";
14
+ import F from "dayjs/plugin/timezone";
15
+ import R from "dayjs/plugin/relativeTime";
16
+ import W from "dayjs/plugin/updateLocale";
16
17
  import P from "dayjs/plugin/localizedFormat";
17
- import W from "semver";
18
- import { DID_PREFIX as L, BLOCKLET_SERVICE_PATH_PREFIX as C } from "./constant.js";
18
+ import L from "semver";
19
+ import { DID_PREFIX as C, BLOCKLET_SERVICE_PATH_PREFIX as M } from "./constant.js";
19
20
  import b from "../package.json.js";
20
- import { getFederatedEnabled as M } from "./federated.js";
21
+ import { getFederatedEnabled as _ } from "./federated.js";
21
22
  let u = null;
22
- const _ = /^(\d{1,3}\.){3}\d{1,3}(:\d+)?$/, N = /* @__PURE__ */ new Set(["co", "com", "net", "org", "gov", "edu", "ac"]), z = /* @__PURE__ */ new Set(["uk", "au", "cn", "nz", "za", "in", "br", "mx", "fr", "it", "ca"]);
23
- function B(e) {
23
+ const N = /^(\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"]);
24
+ function X(e) {
24
25
  if (!e)
25
26
  return !1;
26
27
  const t = e.split(".");
27
28
  if (t.length < 2) return !1;
28
- const o = t[t.length - 2], r = t[t.length - 1];
29
- return N.has(o) && z.has(r);
29
+ const r = t[t.length - 2], o = t[t.length - 1];
30
+ return z.has(r) && B.has(o);
30
31
  }
31
- function ye() {
32
+ function be() {
32
33
  const { host: e } = window.location;
33
- if (!e || _.test(e))
34
+ if (!e || N.test(e))
34
35
  return "";
35
- const o = e.split(":")[0].split(".");
36
- if (o.length === 1)
36
+ const r = e.split(":")[0].split(".");
37
+ if (r.length === 1)
37
38
  return "";
38
- if (o.length > 2) {
39
- const r = o.slice(-2).join(".");
40
- if (B(r))
41
- return `.${o.slice(-3).join(".")}`;
39
+ if (r.length > 2) {
40
+ const o = r.slice(-2).join(".");
41
+ if (X(o))
42
+ return `.${r.slice(-3).join(".")}`;
42
43
  }
43
- return `.${o.slice(-2).join(".")}`;
44
+ return `.${r.slice(-2).join(".")}`;
44
45
  }
45
- function Ie(e) {
46
- return e.replace(/^\?/, "").split("&").map((t) => t.split("=")).filter(([t]) => !!t).reduce((t, o) => {
47
- const r = o[0], i = decodeURIComponent(o[1]) || !0;
48
- return t[r] = i, t;
46
+ function Se(e) {
47
+ return e.replace(/^\?/, "").split("&").map((t) => t.split("=")).filter(([t]) => !!t).reduce((t, r) => {
48
+ const o = r[0], i = decodeURIComponent(r[1]) || !0;
49
+ return t[o] = i, t;
49
50
  }, {});
50
51
  }
51
- function be(e = {}) {
52
+ function De(e = {}) {
52
53
  return new URLSearchParams(e).toString();
53
54
  }
54
- function Se(e = 1) {
55
+ function $e(e = 1) {
55
56
  let t = e;
56
57
  typeof t == "number" && (t = { expireInDays: t }), t.path === void 0 && (t.path = "/"), t.expireInDays || (t.expireInDays = 1);
57
- const o = {
58
+ const r = {
58
59
  expires: t.expireInDays,
59
60
  path: t.path,
60
61
  domain: t.domain || "",
@@ -62,49 +63,49 @@ function Se(e = 1) {
62
63
  // 允许自定义设置为 false,默认是 true
63
64
  secure: t.secure !== !1
64
65
  };
65
- return (typeof window > "u" || t.domain || t.returnDomain === !1) && t.returnDomain === !1 && delete o.domain, o;
66
+ return (typeof window > "u" || t.domain || t.returnDomain === !1) && t.returnDomain === !1 && delete r.domain, r;
66
67
  }
67
- const De = (e) => e.color ? e.color : e.dark ? e.theme.palette.common.white : e.theme.palette.text.primary, $e = (e) => e.background ? e.background : e.dark ? e.theme.palette.common.black : e.theme.palette.common.white;
68
- function ke(e, t, o = []) {
69
- const r = Object.assign({}, e), i = t.defaultProps || {};
68
+ const ke = (e) => e.color ? e.color : e.dark ? e.theme.palette.common.white : e.theme.palette.text.primary, xe = (e) => e.background ? e.background : e.dark ? e.theme.palette.common.black : e.theme.palette.common.white;
69
+ function Te(e, t, r = []) {
70
+ const o = Object.assign({}, e), i = t.defaultProps || {};
70
71
  return Object.keys(i).forEach((n) => {
71
- typeof r[n] == "string" && r[n].indexOf("::prop::") === 0 && (r[n] = i[n]);
72
- }), Array.isArray(o) && o.forEach((n) => {
73
- if (typeof r[n] == "string")
72
+ typeof o[n] == "string" && o[n].indexOf("::prop::") === 0 && (o[n] = i[n]);
73
+ }), Array.isArray(r) && r.forEach((n) => {
74
+ if (typeof o[n] == "string")
74
75
  try {
75
- r[n] = JSON.parse(r[n]);
76
+ o[n] = JSON.parse(o[n]);
76
77
  } catch {
77
78
  }
78
- }), Object.keys(r).forEach((n) => {
79
- typeof r[n] == "string" && r[n].indexOf("::prop::") === 0 && (r[n] = "");
80
- }), r;
79
+ }), Object.keys(o).forEach((n) => {
80
+ typeof o[n] == "string" && o[n].indexOf("::prop::") === 0 && (o[n] = "");
81
+ }), o;
81
82
  }
82
83
  function Ve(e = 2017) {
83
84
  const t = (/* @__PURE__ */ new Date()).getFullYear();
84
85
  return `${t}` == `${e}` ? `© ArcBlock ${t}` : `© ArcBlock ${e} - ${t}`;
85
86
  }
86
- const xe = () => typeof Intl == "object" && typeof Intl.DateTimeFormat == "function" && typeof Intl.DateTimeFormat().resolvedOptions == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone : "", Te = (e) => {
87
+ const je = () => typeof Intl == "object" && typeof Intl.DateTimeFormat == "function" && typeof Intl.DateTimeFormat().resolvedOptions == "function" ? Intl.DateTimeFormat().resolvedOptions().timeZone : "", Ee = (e) => {
87
88
  let t = 0;
88
- for (let r = 0; r < e.length; r++)
89
- t = e.charCodeAt(r) + ((t << 5) - t);
90
- let o = "#";
91
- for (let r = 0; r < 3; r++) {
92
- const i = t >> r * 8 & 255;
93
- o += `00${i.toString(16)}`.substr(-2);
89
+ for (let o = 0; o < e.length; o++)
90
+ t = e.charCodeAt(o) + ((t << 5) - t);
91
+ let r = "#";
92
+ for (let o = 0; o < 3; o++) {
93
+ const i = t >> o * 8 & 255;
94
+ r += `00${i.toString(16)}`.substr(-2);
94
95
  }
95
- return o;
96
- }, je = (e) => {
97
- const t = Math.round(e / 1e3), o = Math.floor(t / 3600), r = Math.floor((t - o * 3600) / 60), i = t % 60;
98
- return `${l(o, 2, "0")}:${l(r, 2, "0")}:${l(i, 2, "0")}`;
96
+ return r;
97
+ }, ve = (e) => {
98
+ const t = Math.round(e / 1e3), r = Math.floor(t / 3600), o = Math.floor((t - r * 3600) / 60), i = t % 60;
99
+ return `${l(r, 2, "0")}:${l(o, 2, "0")}:${l(i, 2, "0")}`;
99
100
  };
100
- function X(e) {
101
+ function J(e) {
101
102
  u = e;
102
103
  }
103
- function Ee() {
104
+ function Oe() {
104
105
  return u;
105
106
  }
106
- const S = (e) => (t, { locale: o, tz: r, isUtc: i } = {}) => {
107
- if (u === null && (a.extend(P), a.extend(U), a.extend(A), a.extend(R), a.extend(F), a.updateLocale("zh-cn", {
107
+ const S = (e) => (t, { locale: r, tz: o, isUtc: i } = {}) => {
108
+ if (u === null && (a.extend(P), a.extend(A), a.extend(F), a.extend(W), a.extend(R), a.updateLocale("zh-cn", {
108
109
  // copy with https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js
109
110
  relativeTime: {
110
111
  future: "%s后",
@@ -121,41 +122,41 @@ const S = (e) => (t, { locale: o, tz: r, isUtc: i } = {}) => {
121
122
  y: "1 年",
122
123
  yy: "%d 年"
123
124
  }
124
- }), X(a)), I(t) || t === "")
125
+ }), J(a)), I(t) || t === "")
125
126
  return "-";
126
127
  let n = u(t);
127
- return r && (n = n.tz(r)), i && (n = n.utc()), typeof o < "u" && (n = n.locale(o)), n.format(e);
128
+ return o && (n = n.tz(o)), i && (n = n.utc()), typeof r < "u" && (n = n.locale(r)), n.format(e);
128
129
  };
129
- function ve(e, { locale: t = "en", tz: o } = {}) {
130
- return S("ll")(e, { locale: t, tz: o });
130
+ function Ue(e, { locale: t = "en", tz: r } = {}) {
131
+ return S("ll")(e, { locale: t, tz: r });
131
132
  }
132
- function Oe(e, {
133
+ function Ae(e, {
133
134
  locale: t = "en",
134
- tz: o,
135
- isUtc: r = !1,
135
+ tz: r,
136
+ isUtc: o = !1,
136
137
  format: i = "lll"
137
138
  } = {}) {
138
- return S(i)(e, { locale: t, tz: o, isUtc: r });
139
+ return S(i)(e, { locale: t, tz: r, isUtc: o });
139
140
  }
140
- function J() {
141
+ function K() {
141
142
  const e = window?.ABT_DEV || window.ABT;
142
143
  return e && typeof e.open == "function" ? e : null;
143
144
  }
144
- function Ue({
145
+ function Fe({
145
146
  webWalletUrl: e,
146
147
  action: t = "login",
147
- locale: o = "en",
148
- url: r,
148
+ locale: r = "en",
149
+ url: o,
149
150
  windowFeatures: i,
150
151
  appInfo: n,
151
152
  memberAppInfo: f
152
153
  }) {
153
- const h = J();
154
+ const h = K();
154
155
  if (h)
155
156
  return h.open({
156
157
  action: t,
157
- locale: o,
158
- url: encodeURIComponent(r),
158
+ locale: r,
159
+ url: encodeURIComponent(o),
159
160
  appInfo: {
160
161
  ...n
161
162
  },
@@ -173,41 +174,41 @@ function Ue({
173
174
  // iphone 8plus size
174
175
  width: 414,
175
176
  height: 736
176
- }, $ = `${e}?action=${t}&locale=${o}&url=${encodeURIComponent(r)}`, c = Object.assign({}, D, i), k = (s) => s.innerWidth || s.document.documentElement.clientWidth || s.document.body.clientWidth;
177
+ }, $ = `${e}?action=${t}&locale=${r}&url=${encodeURIComponent(o)}`, c = Object.assign({}, D, i), k = (s) => s.innerWidth || s.document.documentElement.clientWidth || s.document.body.clientWidth;
177
178
  if (!("left" in c)) {
178
- const s = k(window.top || window), x = window.screenLeft || window.screenX;
179
- c.left = s + x - c.width;
179
+ const s = k(window.top || window), T = window.screenLeft || window.screenX;
180
+ c.left = s + T - c.width;
180
181
  }
181
182
  if (!("top" in c)) {
182
183
  const s = window.screenTop || window.screenY;
183
184
  c.top = s;
184
185
  }
185
- const V = Object.keys(c).map((s) => `${s}=${c[s]}`).join(",");
186
- return window.open($, "targetWindow", V), { type: "web" };
186
+ const x = Object.keys(c).map((s) => `${s}=${c[s]}`).join(",");
187
+ return window.open($, "targetWindow", x), { type: "web" };
187
188
  }
188
- const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) => {
189
- const t = e.replace(L, "");
189
+ const Re = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", Q = (e) => {
190
+ const t = e.replace(C, "");
190
191
  return !!/^(0x)?[0-9a-f]{40}$/i.test(t);
191
- }, Q = (e, t) => {
192
+ }, Y = (e, t) => {
192
193
  if (!t)
193
194
  return e;
194
195
  try {
195
- const o = new URL(e, window.location.origin);
196
- return Object.keys(t).forEach((r) => {
197
- o.searchParams.set(r, String(t[r]));
198
- }), o.origin === window.location.origin ? o.pathname + o.search : o.href;
196
+ const r = new URL(e, window.location.origin);
197
+ return Object.keys(t).forEach((o) => {
198
+ r.searchParams.set(o, String(t[o]));
199
+ }), r.origin === window.location.origin ? r.pathname + r.search : r.href;
199
200
  } catch {
200
201
  return e;
201
202
  }
202
- }, Fe = (e, t = 48) => e && (e.indexOf(C) >= 0 ? Q(e, {
203
+ }, We = (e, t = 48) => e && (e.indexOf(M) >= 0 ? Y(e, {
203
204
  imageFilter: "resize",
204
205
  w: t,
205
206
  h: t
206
- }) : e), Re = (e = 0) => new Promise((t) => {
207
+ }) : e), Pe = (e = 0) => new Promise((t) => {
207
208
  setTimeout(() => {
208
209
  t();
209
210
  }, e);
210
- }), Pe = (e) => /^https?:\/\//.test(e), p = "vid", g = "__visitor_id", Y = () => m.get(p) || localStorage.getItem(g), y = (e) => {
211
+ }), Le = (e) => /^https?:\/\//.test(e), p = "vid", g = "__visitor_id", q = () => m.get(p) || localStorage.getItem(g), y = (e) => {
211
212
  e === null ? m.remove(p, {
212
213
  sameSite: "None",
213
214
  secure: !0
@@ -216,10 +217,10 @@ const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) =
216
217
  secure: !0,
217
218
  expires: 365
218
219
  });
219
- }, We = () => {
220
+ }, Ce = () => {
220
221
  let e = localStorage.getItem(g);
221
- if (e && (localStorage.removeItem(g), y(e)), !Y()) {
222
- if (!M())
222
+ if (e && (localStorage.removeItem(g), y(e)), !q()) {
223
+ if (!_())
223
224
  try {
224
225
  if (window.crypto && typeof window.crypto.randomUUID == "function")
225
226
  e = window.crypto.randomUUID();
@@ -228,15 +229,15 @@ const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) =
228
229
  if (window.crypto && typeof window.crypto.getRandomValues == "function")
229
230
  window.crypto.getRandomValues(t);
230
231
  else
231
- for (let r = 0; r < 16; r++)
232
- t[r] = Math.floor(Math.random() * 256);
233
- const o = Array.from(t).map((r) => r.toString(16).padStart(2, "0"));
232
+ for (let o = 0; o < 16; o++)
233
+ t[o] = Math.floor(Math.random() * 256);
234
+ const r = Array.from(t).map((o) => o.toString(16).padStart(2, "0"));
234
235
  e = [
235
- o.slice(0, 4).join(""),
236
- o.slice(4, 6).join(""),
237
- o.slice(6, 8).join(""),
238
- o.slice(8, 10).join(""),
239
- o.slice(10, 16).join("")
236
+ r.slice(0, 4).join(""),
237
+ r.slice(4, 6).join(""),
238
+ r.slice(6, 8).join(""),
239
+ r.slice(8, 10).join(""),
240
+ r.slice(10, 16).join("")
240
241
  ].join("-");
241
242
  }
242
243
  } catch {
@@ -244,11 +245,11 @@ const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) =
244
245
  }
245
246
  e && y(e);
246
247
  }
247
- }, Le = (e) => {
248
- if (K(e)) {
248
+ }, Me = (e) => {
249
+ if (Q(e)) {
249
250
  const t = Uint8Array.from(
250
- e.slice(2).match(/.{1,2}/g).map((o) => parseInt(o, 16))
251
- ).slice(0, 8).reduce((o, r) => o + r, 0) % w.length;
251
+ e.slice(2).match(/.{1,2}/g).map((r) => parseInt(r, 16))
252
+ ).slice(0, 8).reduce((r, o) => r + o, 0) % w.length;
252
253
  return w[t];
253
254
  }
254
255
  try {
@@ -256,14 +257,14 @@ const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) =
256
257
  } catch {
257
258
  return null;
258
259
  }
259
- }, Ce = (e, t, o = {}) => {
260
- const { fallbackLocale: r = "en", defaultValue: i = "unknown" } = o;
260
+ }, _e = (e, t, r = {}) => {
261
+ const { fallbackLocale: o = "en", defaultValue: i = "unknown" } = r;
261
262
  if (typeof e == "string")
262
263
  return e;
263
264
  let n;
264
- return t && (n = e[t]), (!n || typeof n != "string") && (n = e[r]), (!n || typeof n != "string") && (n = i), n;
265
- }, Me = (e) => T(
266
- () => v(
265
+ return t && (n = e[t]), (!n || typeof n != "string") && (n = e[o]), (!n || typeof n != "string") && (n = i), n;
266
+ }, Ne = (e) => V(
267
+ () => O(
267
268
  async () => {
268
269
  try {
269
270
  return await e();
@@ -274,76 +275,77 @@ const Ae = (e) => e && Number(e) >= 12 ? `${Number(e)}px` : "inherit", K = (e) =
274
275
  // 只需要重试两次,加上原本的一次,总共三次
275
276
  { retries: 2 }
276
277
  )
277
- ), _e = (e) => E(e, I);
278
- function Ne(e, t = 1) {
279
- const [o, r, i] = O.hex.rgb(e);
280
- return `rgba(${o}, ${r}, ${i}, ${t})`;
278
+ ), ze = (e) => E(e, I);
279
+ function Be(e, t = 1) {
280
+ const [r, o, i] = U.hex.rgb(e);
281
+ return `rgba(${r}, ${o}, ${i}, ${t})`;
281
282
  }
282
- const q = () => window.blocklet?.serverVersion || window.env?.serverVersion || "", G = () => b.version, H = () => (b.dependencies?.["@blocklet/js-sdk"]).replace(/^[\^~>=<]+/, ""), d = (e, t) => {
283
- const o = (n) => {
283
+ const G = () => window.blocklet?.serverVersion || window.env?.serverVersion || "", H = () => b.version, Z = () => (b.dependencies?.["@blocklet/js-sdk"]).replace(/^[\^~>=<]+/, ""), d = (e, t) => {
284
+ const r = (n) => {
284
285
  const f = n.match(/^(\d+\.\d+\.\d+(?:-[^-]+?-\d{8}))/);
285
286
  return f ? f[1] : n;
286
287
  };
287
288
  if (!e || !t)
288
289
  return !1;
289
- const r = o(e), i = o(t);
290
- if (r === i && e !== t)
290
+ const o = r(e), i = r(t);
291
+ if (o === i && e !== t)
291
292
  return !1;
292
293
  try {
293
- return W.gte(r, i);
294
+ return L.gte(o, i);
294
295
  } catch {
295
296
  return !1;
296
297
  }
297
- }, ze = () => {
298
+ }, Xe = () => {
298
299
  if (process.env.NODE_ENV === "development")
299
300
  return !0;
300
- const e = q(), t = G(), o = H();
301
- if (!e || !t || !o)
301
+ const e = G(), t = H(), r = Z();
302
+ if (!e || !t || !r)
302
303
  return !1;
303
- const r = d(t, "3.1.29"), i = d(e, "1.16.49-beta-20250822-070545-6d3344cc"), n = d(o, "1.16.49-beta-20250822-070545-6d3344cc");
304
- return r && i && n;
305
- }, Be = (e) => {
304
+ const o = d(t, "3.1.29"), i = d(e, "1.16.49-beta-20250822-070545-6d3344cc"), n = d(r, "1.16.49-beta-20250822-070545-6d3344cc");
305
+ return o && i && n;
306
+ }, Je = (e) => {
306
307
  const { response: t } = e;
307
308
  return t ? `Request failed: ${t.status} ${t.statusText}: ${JSON.stringify(t.data)}` : e.message || "Unknown error occurred";
308
- };
309
+ }, Ke = (...e) => v({}, ...e, (t, r) => r === "" || r === null || r === void 0 ? t : r);
309
310
  export {
310
- Q as appendParams,
311
- _e as cleanedObj,
311
+ Y as appendParams,
312
+ ze as cleanedObj,
312
313
  d as compareVersions,
313
- Ke as deepmergeAll,
314
- J as detectWalletExtension,
315
- We as ensureVisitorId,
316
- Be as formatAxiosError,
317
- ve as formatToDate,
318
- Oe as formatToDatetime,
319
- je as formatUptime,
320
- $e as getBackground,
321
- De as getColor,
322
- Se as getCookieOptions,
314
+ qe as deepmergeAll,
315
+ K as detectWalletExtension,
316
+ Ce as ensureVisitorId,
317
+ Je as formatAxiosError,
318
+ Ue as formatToDate,
319
+ Ae as formatToDatetime,
320
+ ve as formatUptime,
321
+ xe as getBackground,
322
+ ke as getColor,
323
+ $e as getCookieOptions,
323
324
  Ve as getCopyright,
324
- Le as getDIDColor,
325
- Ee as getDateTool,
326
- Ae as getFontSize,
327
- H as getJsSdkVersion,
328
- q as getServerVersion,
329
- xe as getTimezone,
330
- Ce as getTranslation,
331
- Fe as getUserAvatar,
332
- G as getUxPackageVersion,
333
- Y as getVisitorId,
334
- Ne as hexToRgba,
335
- K as isEthereumDid,
336
- ze as isSupportFollow,
337
- B as isTwoSegmentTLD,
338
- Pe as isUrl,
339
- Me as lazyRetry,
340
- ke as mergeProps,
341
- Ue as openWebWallet,
342
- Ie as parseQuery,
343
- ye as resolveRootDomain,
344
- X as setDateTool,
325
+ Me as getDIDColor,
326
+ Oe as getDateTool,
327
+ Re as getFontSize,
328
+ Z as getJsSdkVersion,
329
+ G as getServerVersion,
330
+ je as getTimezone,
331
+ _e as getTranslation,
332
+ We as getUserAvatar,
333
+ H as getUxPackageVersion,
334
+ q as getVisitorId,
335
+ Be as hexToRgba,
336
+ Q as isEthereumDid,
337
+ Xe as isSupportFollow,
338
+ X as isTwoSegmentTLD,
339
+ Le as isUrl,
340
+ Ne as lazyRetry,
341
+ Ke as mergeIgnoreEmpty,
342
+ Te as mergeProps,
343
+ Fe as openWebWallet,
344
+ Se as parseQuery,
345
+ be as resolveRootDomain,
346
+ J as setDateTool,
345
347
  y as setVisitorId,
346
- Re as sleep,
347
- Te as str2color,
348
- be as stringifyQuery
348
+ Pe as sleep,
349
+ Ee as str2color,
350
+ De as stringifyQuery
349
351
  };
@@ -1,4 +1,4 @@
1
- const e = "3.4.4", s = { "@blocklet/js-sdk": "^1.17.7" }, n = {
1
+ const e = "3.4.5", s = { "@blocklet/js-sdk": "^1.17.7" }, n = {
2
2
  version: e,
3
3
  dependencies: s
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -68,16 +68,16 @@
68
68
  "react": "^19.0.0",
69
69
  "react-router-dom": "^6.22.3"
70
70
  },
71
- "gitHead": "89a650622cb03211e105d8d9ac7793ccf18aac4f",
71
+ "gitHead": "a944f14b25e2fd8cd0e7e32b3c3ce276961e6b64",
72
72
  "dependencies": {
73
- "@arcblock/bridge": "3.4.4",
73
+ "@arcblock/bridge": "3.4.5",
74
74
  "@arcblock/did": "^1.28.2",
75
75
  "@arcblock/did-motif": "^1.1.14",
76
- "@arcblock/icons": "3.4.4",
77
- "@arcblock/nft-display": "3.4.4",
78
- "@arcblock/react-hooks": "3.4.4",
76
+ "@arcblock/icons": "3.4.5",
77
+ "@arcblock/nft-display": "3.4.5",
78
+ "@arcblock/react-hooks": "3.4.5",
79
79
  "@blocklet/js-sdk": "^1.17.7",
80
- "@blocklet/theme": "3.4.4",
80
+ "@blocklet/theme": "3.4.5",
81
81
  "@fontsource/roboto": "~5.1.1",
82
82
  "@fontsource/ubuntu-mono": "^5.2.6",
83
83
  "@iconify-icons/logos": "^1.2.36",
package/src/Util/index.ts CHANGED
@@ -5,6 +5,7 @@ import { getDIDMotifInfo, colors } from '@arcblock/did-motif';
5
5
  import { mergeAllThemeOptions } from '@blocklet/theme';
6
6
  import isNil from 'lodash/isNil';
7
7
  import omitBy from 'lodash/omitBy';
8
+ import mergeWith from 'lodash/mergeWith';
8
9
  import pRetry from 'p-retry';
9
10
  import Cookies from 'js-cookie';
10
11
  import colorConvert from 'color-convert';
@@ -748,3 +749,12 @@ export const formatAxiosError = (err: AxiosError) => {
748
749
 
749
750
  return err.message || 'Unknown error occurred';
750
751
  };
752
+
753
+ export const mergeIgnoreEmpty = (...objects: Array<Record<string, any>>) => {
754
+ return mergeWith({}, ...objects, (objValue: any, srcValue: any) => {
755
+ if (srcValue === '' || srcValue === null || srcValue === undefined) {
756
+ return objValue; // 保留前面的值
757
+ }
758
+ return srcValue; // 使用后面的值
759
+ });
760
+ };