@blocklet/ui-react 3.0.9 → 3.0.10

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 (51) hide show
  1. package/lib/BlockletStudio/index.js +70 -71
  2. package/lib/ComponentInstaller/index.js +85 -88
  3. package/lib/ComponentInstaller/installer-item.js +47 -53
  4. package/lib/ComponentInstaller/use-component-installed.js +32 -38
  5. package/lib/ComponentManager/components/add-component.js +47 -50
  6. package/lib/ComponentManager/components/publish-component.js +30 -31
  7. package/lib/ComponentManager/components/resource-dialog.js +28 -30
  8. package/lib/Dashboard/index.d.ts +1 -1
  9. package/lib/Dashboard/index.js +59 -61
  10. package/lib/Footer/index.js +51 -52
  11. package/lib/Footer/internal-footer.js +43 -47
  12. package/lib/Footer/layout/standard.js +11 -12
  13. package/lib/Footer/links.js +25 -28
  14. package/lib/Footer/social-media.js +17 -17
  15. package/lib/Header/index.js +81 -83
  16. package/lib/Notifications/Snackbar.js +76 -77
  17. package/lib/Notifications/hooks/use-title.js +34 -34
  18. package/lib/Notifications/utils.js +56 -60
  19. package/lib/UserCenter/components/config-inviter.js +17 -18
  20. package/lib/UserCenter/components/danger-zone.js +49 -52
  21. package/lib/UserCenter/components/nft.js +44 -45
  22. package/lib/UserCenter/components/notification.js +92 -99
  23. package/lib/UserCenter/components/passport.js +22 -22
  24. package/lib/UserCenter/components/privacy.js +6 -6
  25. package/lib/UserCenter/components/settings.js +40 -43
  26. package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
  27. package/lib/UserCenter/components/status-dialog/index.js +112 -114
  28. package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
  29. package/lib/UserCenter/components/status-selector/index.js +13 -13
  30. package/lib/UserCenter/components/storage/action.js +21 -22
  31. package/lib/UserCenter/components/storage/delete.js +24 -24
  32. package/lib/UserCenter/components/third-party-login/index.js +53 -53
  33. package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
  34. package/lib/UserCenter/components/user-center.js +198 -207
  35. package/lib/UserCenter/components/user-info/metadata.js +343 -353
  36. package/lib/UserCenter/components/user-info/switch-role.js +17 -20
  37. package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
  38. package/lib/UserCenter/components/user-info/user-info.js +40 -40
  39. package/lib/UserCenter/components/user-info/user-status.js +97 -99
  40. package/lib/UserCenter/components/user-info/utils.js +34 -35
  41. package/lib/UserSessions/components/user-session-info.js +25 -28
  42. package/lib/UserSessions/components/user-sessions.js +169 -181
  43. package/lib/blocklets.js +62 -72
  44. package/lib/common/domain-warning.js +31 -31
  45. package/lib/common/header-addons.d.ts +1 -1
  46. package/lib/common/header-addons.js +49 -53
  47. package/lib/common/notification-addon.js +29 -32
  48. package/lib/common/ws.js +17 -18
  49. package/lib/contexts/config-user-space.js +16 -19
  50. package/lib/utils.js +44 -48
  51. package/package.json +6 -6
package/lib/utils.js CHANGED
@@ -1,65 +1,61 @@
1
- import R from "semver";
2
- const d = (n, e, r = "children") => n.map((t) => Array.isArray(t[r]) ? e({
1
+ import H from "semver";
2
+ const d = (n, r, e = "children") => n.map((t) => Array.isArray(t[e]) ? r({
3
3
  ...t,
4
- [r]: d(t[r], e, r)
5
- }) : e(t)), S = (n, e = "children") => {
6
- const r = [];
7
- return d(n, (t) => r.push(t), e), r;
8
- }, x = (n, e = "children") => {
9
- let r = 0;
10
- return d(n, () => r++, e), r;
11
- }, V = (n, e, r = "children") => n.map((t) => ({ ...t })).filter((t) => {
12
- const s = t[r];
4
+ [e]: d(t[e], r, e)
5
+ }) : r(t)), C = (n, r = "children") => {
6
+ const e = [];
7
+ return d(n, (t) => e.push(t), r), e;
8
+ }, S = (n, r = "children") => {
9
+ let e = 0;
10
+ return d(n, () => e++, r), e;
11
+ }, R = (n, r, e = "children") => n.map((t) => ({ ...t })).filter((t) => {
12
+ const s = t[e];
13
13
  if (Array.isArray(s)) {
14
- const o = V(s, e, r);
15
- t[r] = o != null && o.length ? o : void 0;
14
+ const o = R(s, r, e);
15
+ t[e] = o?.length ? o : void 0;
16
16
  }
17
- const c = { filteredChildren: t[r], isLeaf: !(s != null && s.length) };
18
- return e(t, c);
19
- }), P = (n) => /^https?:\/\//.test(n), W = (n) => /^[\w-]+:[\w-]+$/.test(n), A = (n) => {
20
- if (!n || !(n != null && n.startsWith("/")))
17
+ const c = { filteredChildren: t[e], isLeaf: !s?.length };
18
+ return r(t, c);
19
+ }), x = (n) => /^https?:\/\//.test(n), P = (n) => /^[\w-]+:[\w-]+$/.test(n), V = (n) => {
20
+ if (!n || !n?.startsWith("/"))
21
21
  return !1;
22
- const e = (s) => s.endsWith("/") ? s : `${s}/`, r = e(window.location.pathname), t = e(new URL(n, window.location.origin).pathname);
23
- return r.startsWith(t);
24
- }, k = (n = []) => {
25
- const e = n.map((t, s) => ({ path: t, index: s })).filter((t) => A(t.path));
26
- return e != null && e.length ? e.slice(1).reduce((t, s) => t.path.length >= s.path.length ? t : s, e[0]).index : -1;
27
- }, v = (n, e = {}) => {
28
- const { columns: r = 1, breakInside: t = !1, groupHeight: s = 48, itemHeight: c = 24, childrenKey: o = "items" } = e, w = n.reduce((u, m) => {
29
- var h;
30
- return u + s + (((h = m[o]) == null ? void 0 : h.length) || 0) * c;
31
- }, 0), f = Math.ceil(w / r), l = [[]];
22
+ const r = (s) => s.endsWith("/") ? s : `${s}/`, e = r(window.location.pathname), t = r(new URL(n, window.location.origin).pathname);
23
+ return e.startsWith(t);
24
+ }, W = (n = []) => {
25
+ const r = n.map((t, s) => ({ path: t, index: s })).filter((t) => V(t.path));
26
+ return r?.length ? r.slice(1).reduce((t, s) => t.path.length >= s.path.length ? t : s, r[0]).index : -1;
27
+ }, k = (n, r = {}) => {
28
+ const { columns: e = 1, breakInside: t = !1, groupHeight: s = 48, itemHeight: c = 24, childrenKey: o = "items" } = r, p = n.reduce((u, g) => u + s + (g[o]?.length || 0) * c, 0), l = Math.ceil(p / e), h = [[]];
32
29
  let i = 0, a = 0;
33
- const p = f * 0.2, g = (u) => a > f - p && i < r - 1 && a + u > f + p;
30
+ const m = l * 0.2, f = (u) => a > l - m && i < e - 1 && a + u > l + m;
34
31
  return n.forEach((u) => {
35
- var h;
36
- const m = s + (((h = u[o]) == null ? void 0 : h.length) || 0) * c;
37
- t && g(s) && (i++, a = 0, l[i] = []), !t && a > 0 && g(m) && (i++, a = 0, l[i] = []), l[i].push({
32
+ const g = s + (u[o]?.length || 0) * c;
33
+ t && f(s) && (i++, a = 0, h[i] = []), !t && a > 0 && f(g) && (i++, a = 0, h[i] = []), h[i].push({
38
34
  ...u,
39
35
  group: !0
40
- }), a += s, u[o] && u[o].forEach((H) => {
41
- t && g(c) && (i++, a = 0, l[i] = []), l[i].push({
42
- ...H,
36
+ }), a += s, u[o] && u[o].forEach((w) => {
37
+ t && f(c) && (i++, a = 0, h[i] = []), h[i].push({
38
+ ...w,
43
39
  group: !1
44
40
  }), a += c;
45
41
  });
46
- }), l;
47
- }, E = (n, e) => {
48
- const r = (c) => {
42
+ }), h;
43
+ }, v = (n, r) => {
44
+ const e = (c) => {
49
45
  const o = c.match(/^(\d+\.\d+\.\d+(?:-[^-]+?-\d{8}))/);
50
46
  return o ? o[1] : c;
51
- }, t = r(n), s = r(e);
52
- return t === s && n !== e ? !1 : R.gte(t, s);
47
+ }, t = e(n), s = e(r);
48
+ return t === s && n !== r ? !1 : H.gte(t, s);
53
49
  };
54
50
  export {
55
- E as compareVersions,
56
- x as countRecursive,
57
- V as filterRecursive,
58
- S as flatRecursive,
59
- W as isIconifyString,
60
- P as isUrl,
51
+ v as compareVersions,
52
+ S as countRecursive,
53
+ R as filterRecursive,
54
+ C as flatRecursive,
55
+ P as isIconifyString,
56
+ x as isUrl,
61
57
  d as mapRecursive,
62
- A as matchPath,
63
- k as matchPaths,
64
- v as splitNavColumns
58
+ V as matchPath,
59
+ W as matchPaths,
60
+ k as splitNavColumns
65
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -35,12 +35,12 @@
35
35
  "dependencies": {
36
36
  "@abtnode/constant": "^1.16.44",
37
37
  "@abtnode/util": "^1.16.44",
38
- "@arcblock/bridge": "3.0.9",
39
- "@arcblock/icons": "3.0.9",
40
- "@arcblock/react-hooks": "3.0.9",
38
+ "@arcblock/bridge": "3.0.10",
39
+ "@arcblock/icons": "3.0.10",
40
+ "@arcblock/react-hooks": "3.0.10",
41
41
  "@arcblock/ws": "^1.20.15",
42
42
  "@blocklet/constant": "^1.16.44",
43
- "@blocklet/did-space-react": "^1.0.63",
43
+ "@blocklet/did-space-react": "^1.1.0",
44
44
  "@iconify-icons/logos": "^1.2.36",
45
45
  "@iconify-icons/material-symbols": "^1.2.58",
46
46
  "@iconify-icons/tabler": "^1.2.95",
@@ -90,5 +90,5 @@
90
90
  "jest": "^29.7.0",
91
91
  "unbuild": "^2.0.0"
92
92
  },
93
- "gitHead": "e2283285cb6e99f09146cde5e1af002e55091619"
93
+ "gitHead": "8e4b3b4f9cc52c8f1f1d270ab03a3c566073617a"
94
94
  }