@blocklet/ui-react 3.0.6 → 3.0.7

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 (62) hide show
  1. package/lib/BlockletStudio/index.d.ts +15 -15
  2. package/lib/BlockletStudio/index.js +66 -66
  3. package/lib/ComponentManager/components/add-component.d.ts +6 -6
  4. package/lib/ComponentManager/components/add-component.js +29 -29
  5. package/lib/ComponentManager/components/publish-component.d.ts +3 -3
  6. package/lib/ComponentManager/components/publish-component.js +19 -19
  7. package/lib/ComponentManager/components/resource-dialog.d.ts +1 -1
  8. package/lib/ComponentManager/components/resource-dialog.js +1 -1
  9. package/lib/Footer/internal-footer.d.ts +3 -1
  10. package/lib/Footer/internal-footer.js +1 -1
  11. package/lib/Footer/layout/standard.d.ts +1 -1
  12. package/lib/Footer/layout/standard.js +1 -1
  13. package/lib/Footer/links.d.ts +1 -1
  14. package/lib/Footer/links.js +3 -3
  15. package/lib/Header/index.d.ts +2 -2
  16. package/lib/Header/index.js +17 -17
  17. package/lib/Icon/index.d.ts +2 -2
  18. package/lib/Icon/index.js +6 -6
  19. package/lib/Notifications/Snackbar.d.ts +1 -1
  20. package/lib/Notifications/Snackbar.js +1 -1
  21. package/lib/Notifications/hooks/use-title.d.ts +2 -2
  22. package/lib/Notifications/hooks/use-title.js +9 -9
  23. package/lib/UserCenter/components/editable-field.d.ts +6 -6
  24. package/lib/UserCenter/components/editable-field.js +12 -12
  25. package/lib/UserCenter/components/notification.js +5 -5
  26. package/lib/UserCenter/components/status-dialog/date-picker.d.ts +5 -5
  27. package/lib/UserCenter/components/status-dialog/date-picker.js +17 -10
  28. package/lib/UserCenter/components/status-dialog/index.d.ts +1 -1
  29. package/lib/UserCenter/components/status-dialog/index.js +8 -1
  30. package/lib/UserCenter/components/status-selector/index.d.ts +2 -2
  31. package/lib/UserCenter/components/status-selector/index.js +5 -5
  32. package/lib/UserCenter/components/status-selector/menu-item.d.ts +4 -4
  33. package/lib/UserCenter/components/status-selector/menu-item.js +11 -6
  34. package/lib/UserCenter/components/third-party-login/index.js +23 -29
  35. package/lib/UserCenter/components/user-info/user-info-item.d.ts +1 -1
  36. package/lib/UserCenter/components/user-info/user-info-item.js +1 -1
  37. package/lib/UserCenter/components/user-info/user-status.d.ts +4 -4
  38. package/lib/UserCenter/components/user-info/user-status.js +17 -17
  39. package/package.json +7 -5
  40. package/src/BlockletStudio/index.tsx +13 -13
  41. package/src/ComponentManager/components/add-component.tsx +6 -6
  42. package/src/ComponentManager/components/publish-component.tsx +2 -2
  43. package/src/ComponentManager/components/resource-dialog.tsx +1 -1
  44. package/src/Footer/internal-footer.jsx +1 -1
  45. package/src/Footer/layout/standard.jsx +1 -1
  46. package/src/Footer/links.jsx +1 -1
  47. package/src/Header/index.tsx +2 -2
  48. package/src/Icon/index.tsx +2 -2
  49. package/src/Notifications/Snackbar.tsx +2 -2
  50. package/src/Notifications/hooks/use-title.tsx +1 -1
  51. package/src/UserCenter/components/editable-field.tsx +6 -6
  52. package/src/UserCenter/components/notification.tsx +2 -2
  53. package/src/UserCenter/components/status-dialog/date-picker.tsx +8 -1
  54. package/src/UserCenter/components/status-dialog/index.tsx +8 -1
  55. package/src/UserCenter/components/status-selector/index.tsx +1 -1
  56. package/src/UserCenter/components/status-selector/menu-item.tsx +6 -1
  57. package/src/UserCenter/components/third-party-login/index.tsx +0 -2
  58. package/src/UserCenter/components/user-center.tsx +1 -1
  59. package/src/UserCenter/components/user-info/link-preview-input.tsx +2 -2
  60. package/src/UserCenter/components/user-info/user-info-item.tsx +1 -1
  61. package/src/UserCenter/components/user-info/user-info.tsx +1 -1
  62. package/src/UserCenter/components/user-info/user-status.tsx +2 -2
package/lib/Icon/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import "iconify-icon";
3
3
  import { useState as c } from "react";
4
- import { useAsyncEffect as m } from "ahooks";
4
+ import { useAsyncEffect as d } from "ahooks";
5
5
  import { Avatar as e } from "@mui/material";
6
- import { loadIcon as d, Icon as h } from "@iconify/react";
6
+ import { loadIcon as m, Icon as h } from "@iconify/react";
7
7
  import { isUrl as g } from "../utils.js";
8
8
  function M({
9
9
  icon: r,
10
- size: t,
11
- sx: i,
10
+ size: t = void 0,
11
+ sx: i = {},
12
12
  ...a
13
13
  }) {
14
14
  const o = [...Array.isArray(i) ? i : [i]];
15
15
  t && o.push({ width: t, height: t });
16
16
  const [p, f] = c(!1), [l, s] = c(!0);
17
- if (m(async () => {
17
+ if (d(async () => {
18
18
  s(!0);
19
19
  try {
20
- await d(r), f(!0);
20
+ await m(r), f(!0);
21
21
  } catch {
22
22
  f(!1);
23
23
  }
@@ -1,6 +1,6 @@
1
1
  export { xe as default };
2
2
  declare function xe({ ref: t, keyId: i, notification: e, viewAllUrl: w, content: f }: {
3
- ref: any;
3
+ ref?: undefined;
4
4
  keyId: any;
5
5
  notification?: {} | undefined;
6
6
  viewAllUrl: any;
@@ -97,7 +97,7 @@ const R = {
97
97
  }
98
98
  `;
99
99
  function xe({
100
- ref: t,
100
+ ref: t = void 0,
101
101
  keyId: i,
102
102
  notification: e = {},
103
103
  viewAllUrl: w,
@@ -1,4 +1,4 @@
1
- import { default as M } from 'react';
1
+ import { default as F } from 'react';
2
2
  export { H as default };
3
3
  declare function H({ activity: r, users: l, actors: d, extra: h, mountPoint: m }: {
4
4
  activity: any;
@@ -6,4 +6,4 @@ declare function H({ activity: r, users: l, actors: d, extra: h, mountPoint: m }
6
6
  actors: any;
7
7
  extra?: {} | undefined;
8
8
  mountPoint?: string | undefined;
9
- }): M.ReactElement<unknown, string | M.JSXElementConstructor<any>> | null;
9
+ }): F.ReactElement<unknown, string | F.JSXElementConstructor<any>> | null;
@@ -1,9 +1,9 @@
1
1
  import { jsx as s, jsxs as o, Fragment as i } from "react/jsx-runtime";
2
- import M from "react";
2
+ import F from "react";
3
3
  import { useCreation as f, useMemoizedFn as U } from "ahooks";
4
4
  import { useTheme as C, Link as E } from "@mui/material";
5
- import { WELLKNOWN_SERVICE_PATH_PREFIX as S } from "@abtnode/constant";
6
- import { joinURL as R, withQuery as v } from "ufo";
5
+ import { WELLKNOWN_SERVICE_PATH_PREFIX as M } from "@abtnode/constant";
6
+ import { joinURL as R, withQuery as S } from "ufo";
7
7
  import D from "lodash/isEmpty";
8
8
  import { getActivityLink as I } from "../utils.js";
9
9
  const P = {
@@ -31,8 +31,8 @@ const P = {
31
31
  ] }),
32
32
  assign: () => /* @__PURE__ */ s(i, { children: "assigned you a task" })
33
33
  };
34
- function a({ user: r, color: l }) {
35
- const { palette: d } = C(), h = v(R(S, "user"), { did: r.did }), m = l || d.text.primary;
34
+ function a({ user: r, color: l = void 0 }) {
35
+ const { palette: d } = C(), h = S(R(M, "user"), { did: r.did }), m = l || d.text.primary;
36
36
  return /* @__PURE__ */ s(
37
37
  E,
38
38
  {
@@ -73,9 +73,9 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
73
73
  ] });
74
74
  const _ = n.length > 3, N = _ ? n.slice(0, 2) : e;
75
75
  return /* @__PURE__ */ o(i, { children: [
76
- N.map((T, F) => /* @__PURE__ */ o(M.Fragment, { children: [
76
+ N.map((T, w) => /* @__PURE__ */ o(F.Fragment, { children: [
77
77
  /* @__PURE__ */ s(a, { user: T, color: c }),
78
- F < N.length - 1 ? ", " : ""
78
+ w < N.length - 1 ? ", " : ""
79
79
  ] }, T.did)),
80
80
  _ ? `, and ${n.length - 2} others` : /* @__PURE__ */ o(i, { children: [
81
81
  ", and ",
@@ -85,7 +85,7 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
85
85
  }), A = U(() => {
86
86
  const e = u ? P[u] : null;
87
87
  return e ? e(y, l.length) : null;
88
- }), w = f(() => {
88
+ }), v = f(() => {
89
89
  const e = L(), t = A();
90
90
  return !e || !t ? null : /* @__PURE__ */ o(i, { children: [
91
91
  e,
@@ -98,7 +98,7 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
98
98
  return e != null && e.targetLink ? R(m, e.targetLink) : null;
99
99
  }, [r, m]);
100
100
  return !u || D(g) ? null : /* @__PURE__ */ o(i, { children: [
101
- w,
101
+ v,
102
102
  " ",
103
103
  x && /* @__PURE__ */ s(
104
104
  E,
@@ -13,7 +13,7 @@ declare const E: {
13
13
  };
14
14
  };
15
15
  };
16
- declare function re({ value: t, onChange: f, onValueValidate: c, errorMsg: i, editable: h, component: x, placeholder: a, rows: g, maxLength: r, icon: w, label: b, children: p, tooltip: I, inline: P, style: X, verified: Y, canEdit: k, renderValue: v, disabled: y, hidePreview: z }: {
16
+ declare function re({ value: t, onChange: f, onValueValidate: c, errorMsg: i, editable: h, component: x, placeholder: a, rows: v, maxLength: r, icon: g, label: w, children: p, tooltip: I, inline: P, style: X, verified: Y, canEdit: k, renderValue: b, disabled: y, hidePreview: z }: {
17
17
  value: any;
18
18
  onChange?: (() => void) | undefined;
19
19
  onValueValidate?: (() => void) | undefined;
@@ -22,16 +22,16 @@ declare function re({ value: t, onChange: f, onValueValidate: c, errorMsg: i, ed
22
22
  component?: string | undefined;
23
23
  placeholder?: string | undefined;
24
24
  rows?: number | undefined;
25
- maxLength: any;
26
- icon: any;
25
+ maxLength?: undefined;
26
+ icon?: undefined;
27
27
  label?: string | undefined;
28
- children: any;
29
- tooltip: any;
28
+ children?: undefined;
29
+ tooltip?: undefined;
30
30
  inline?: boolean | undefined;
31
31
  style?: {} | undefined;
32
32
  verified?: boolean | undefined;
33
33
  canEdit?: boolean | undefined;
34
- renderValue: any;
34
+ renderValue?: undefined;
35
35
  disabled?: boolean | undefined;
36
36
  hidePreview?: boolean | undefined;
37
37
  }): L.ReactElement<unknown, string | L.JSXElementConstructor<any>> | null;
@@ -42,17 +42,17 @@ function re({
42
42
  editable: h = !1,
43
43
  component: x = "input",
44
44
  placeholder: a = "",
45
- rows: g = 2,
46
- maxLength: r,
47
- icon: w,
48
- label: b = "",
49
- children: p,
50
- tooltip: I,
45
+ rows: v = 2,
46
+ maxLength: r = void 0,
47
+ icon: g = void 0,
48
+ label: w = "",
49
+ children: p = void 0,
50
+ tooltip: I = void 0,
51
51
  inline: P = !0,
52
52
  style: X = {},
53
53
  verified: Y = !1,
54
54
  canEdit: k = !0,
55
- renderValue: v,
55
+ renderValue: b = void 0,
56
56
  disabled: y = !1,
57
57
  hidePreview: z = !1
58
58
  }) {
@@ -103,7 +103,7 @@ function re({
103
103
  slotProps: {
104
104
  input: {
105
105
  multiline: !0,
106
- minRows: g,
106
+ minRows: v,
107
107
  placeholder: a
108
108
  }
109
109
  }
@@ -128,9 +128,9 @@ function re({
128
128
  }
129
129
  ) : null
130
130
  ] });
131
- }, [t, m, x, a, g, p]);
131
+ }, [t, m, x, a, v, p]);
132
132
  return !k && h ? null : h ? /* @__PURE__ */ s(d, { sx: { width: "100%" }, style: X, children: [
133
- b && /* @__PURE__ */ n(u, { variant: "subtitle1", gutterBottom: !0, sx: { mb: 0.5, fontSize: "12px", color: "text.primary" }, children: b }),
133
+ w && /* @__PURE__ */ n(u, { variant: "subtitle1", gutterBottom: !0, sx: { mb: 0.5, fontSize: "12px", color: "text.primary" }, children: w }),
134
134
  H
135
135
  ] }) : t && !z ? /* @__PURE__ */ n(
136
136
  J,
@@ -183,7 +183,7 @@ function re({
183
183
  alignItems: "center",
184
184
  gap: 1,
185
185
  children: [
186
- w ? L.cloneElement(w, {
186
+ g ? L.cloneElement(g, {
187
187
  style: {
188
188
  filter: O ? "brightness(0) saturate(100%) invert(1)" : "none"
189
189
  }
@@ -199,7 +199,7 @@ function re({
199
199
  component: "div",
200
200
  onMouseEnter: j,
201
201
  onMouseLeave: D,
202
- children: v ? v(t) : t
202
+ children: b ? b(t) : t
203
203
  }
204
204
  ),
205
205
  Y && /* @__PURE__ */ n(q, { color: "success", style: { fontSize: 16, width: 16, marginLeft: 4, flexShrink: 0 } })
@@ -15,8 +15,8 @@ import D from "./webhook-item.js";
15
15
  import { formatAxiosError as I } from "../libs/utils.js";
16
16
  import { client as y } from "../../libs/client.js";
17
17
  function g({
18
- title: a,
19
- description: s,
18
+ title: a = void 0,
19
+ description: s = void 0,
20
20
  value: m,
21
21
  onChange: i,
22
22
  isMobile: n
@@ -58,7 +58,7 @@ function g({
58
58
  );
59
59
  }
60
60
  function ne({ user: a, isMobile: s }) {
61
- var b, v;
61
+ var v, b;
62
62
  const { locale: m } = _(), i = c((e, o = {}) => U(q, e, m, "en", o)), n = B({
63
63
  showAdd: !1
64
64
  }), t = E(
@@ -76,10 +76,10 @@ function ne({ user: a, isMobile: s }) {
76
76
  push: !0,
77
77
  ...((e = t == null ? void 0 : t.data) == null ? void 0 : e.notifications) || {}
78
78
  };
79
- }, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.notifications]), p = C(() => {
79
+ }, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.notifications]), p = C(() => {
80
80
  var e;
81
81
  return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.webhooks) || [];
82
- }, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.webhooks]), u = c(async (e) => {
82
+ }, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.webhooks]), u = c(async (e) => {
83
83
  try {
84
84
  await y.user.saveUserNotificationConfig(e), f.success(i("saveSuccess")), t.run();
85
85
  } catch (o) {
@@ -1,9 +1,9 @@
1
1
  export { T as default };
2
- declare function T({ value: e, onChange: a, error: o, helperText: i, label: m, timezone: n }: {
2
+ declare function T({ value: o, onChange: a, error: n, helperText: i, label: m, timezone: r }: {
3
3
  value: any;
4
4
  onChange: any;
5
- error: any;
6
- helperText: any;
7
- label: any;
8
- timezone: any;
5
+ error?: undefined;
6
+ helperText?: undefined;
7
+ label?: undefined;
8
+ timezone?: undefined;
9
9
  }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -1,14 +1,21 @@
1
- import { jsxs as p, jsx as u } from "react/jsx-runtime";
2
- import { useRef as d } from "react";
1
+ import { jsxs as d, jsx as u } from "react/jsx-runtime";
2
+ import { useRef as p } from "react";
3
3
  import { FormControl as f, TextField as h, FormHelperText as C } from "@mui/material";
4
- import r from "dayjs";
4
+ import e from "dayjs";
5
5
  import { useCreation as Y } from "ahooks";
6
- function T({ value: e, onChange: a, error: o, helperText: i, label: m, timezone: n }) {
7
- const l = d(null), s = r().format("YYYY-MM-DDTHH:mm"), c = Y(() => {
8
- let t = r();
9
- return e && (t = n ? r(e).tz(n) : r(e)), t.format("YYYY-MM-DD HH:mm");
10
- }, [e, n]);
11
- return /* @__PURE__ */ p(f, { fullWidth: !0, error: o, children: [
6
+ function T({
7
+ value: o,
8
+ onChange: a,
9
+ error: n = void 0,
10
+ helperText: i = void 0,
11
+ label: m = void 0,
12
+ timezone: r = void 0
13
+ }) {
14
+ const l = p(null), s = e().format("YYYY-MM-DDTHH:mm"), c = Y(() => {
15
+ let t = e();
16
+ return o && (t = r ? e(o).tz(r) : e(o)), t.format("YYYY-MM-DD HH:mm");
17
+ }, [o, r]);
18
+ return /* @__PURE__ */ d(f, { fullWidth: !0, error: n, children: [
12
19
  /* @__PURE__ */ u(
13
20
  h,
14
21
  {
@@ -19,7 +26,7 @@ function T({ value: e, onChange: a, error: o, helperText: i, label: m, timezone:
19
26
  a(new Date(t.target.value));
20
27
  },
21
28
  label: m,
22
- error: o,
29
+ error: n,
23
30
  onClick: () => {
24
31
  var t;
25
32
  (t = l.current) == null || t.showPicker();
@@ -5,5 +5,5 @@ declare function go({ open: j, onClose: u, data: m, selected: i, onSelect: h, ti
5
5
  data: any;
6
6
  selected: any;
7
7
  onSelect: any;
8
- timezone: any;
8
+ timezone?: undefined;
9
9
  }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -29,7 +29,14 @@ const O = {
29
29
  alignItems: "center"
30
30
  }
31
31
  };
32
- function go({ open: j, onClose: u, data: m, selected: i, onSelect: h, timezone: F }) {
32
+ function go({
33
+ open: j,
34
+ onClose: u,
35
+ data: m,
36
+ selected: i,
37
+ onSelect: h,
38
+ timezone: F = void 0
39
+ }) {
33
40
  var I, k;
34
41
  const { locale: L } = $(), t = _((o, e = {}) => Z(oo, o, L, "en", e)), [l, S] = s((i == null ? void 0 : i.value) || ""), [a, y] = s((i == null ? void 0 : i.duration) || ""), [d, x] = s(((I = i == null ? void 0 : i.dateRange) == null ? void 0 : I[1]) || ""), [N, c] = s(!1);
35
42
  V(() => {
@@ -1,8 +1,8 @@
1
1
  export { L as default };
2
- declare function L({ data: e, open: a, onSelect: u, anchorEl: i, selected: r }: {
2
+ declare function L({ data: e, open: a, onSelect: i, anchorEl: u, selected: r }: {
3
3
  data: any;
4
4
  open: any;
5
5
  onSelect: any;
6
- anchorEl: any;
6
+ anchorEl?: undefined;
7
7
  selected: any;
8
8
  }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -5,10 +5,10 @@ import { useMemoizedFn as S } from "ahooks";
5
5
  import { useLocaleContext as x } from "@arcblock/ux/lib/Locale/context";
6
6
  import h from "./duration-menu.js";
7
7
  import M, { StyledMenu as y } from "./menu-item.js";
8
- import { translations as C } from "../../libs/locales.js";
9
- function L({ data: e, open: a, onSelect: u, anchorEl: i, selected: r }) {
10
- const { locale: s } = x(), l = S((o, c = {}) => d(C, o, s, "en", c)), n = (o) => {
11
- u(o);
8
+ import { translations as v } from "../../libs/locales.js";
9
+ function L({ data: e, open: a, onSelect: i, anchorEl: u = void 0, selected: r }) {
10
+ const { locale: s } = x(), l = S((o, c = {}) => d(v, o, s, "en", c)), n = (o) => {
11
+ i(o);
12
12
  }, p = () => e.map((o) => o.children ? /* @__PURE__ */ t(h, { data: o, selected: r, onSelect: n }, o.id) : /* @__PURE__ */ t(
13
13
  M,
14
14
  {
@@ -19,7 +19,7 @@ function L({ data: e, open: a, onSelect: u, anchorEl: i, selected: r }) {
19
19
  },
20
20
  o.id
21
21
  ));
22
- return /* @__PURE__ */ m(y, { open: a, onClose: () => n(), anchorEl: i, children: [
22
+ return /* @__PURE__ */ m(y, { open: a, onClose: () => n(), anchorEl: u, children: [
23
23
  /* @__PURE__ */ t(
24
24
  f,
25
25
  {
@@ -1,9 +1,9 @@
1
- import { default as d } from 'react';
1
+ import { default as a } from 'react';
2
2
  declare const h: import('@emotion/styled').StyledComponent<import('@mui/material').MenuProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
3
3
  declare function c({ icon: e, selected: t, onClick: o, children: r }: {
4
- icon: any;
5
- selected: any;
4
+ icon?: undefined;
5
+ selected?: undefined;
6
6
  onClick: any;
7
7
  children: any;
8
- }): d.ReactElement<unknown, string | d.JSXElementConstructor<any>>;
8
+ }): a.ReactElement<unknown, string | a.JSXElementConstructor<any>>;
9
9
  export { h as StyledMenu, c as default };
@@ -1,15 +1,20 @@
1
1
  import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { styled as n, Menu as l, MenuItem as p, ListItemIcon as a } from "@mui/material";
3
- import d from "react";
4
- function c({ icon: e, selected: t, onClick: o, children: r }) {
5
- return /* @__PURE__ */ i(p, { onClick: o, className: t ? "selected" : "", children: [
6
- e && /* @__PURE__ */ s(a, { style: { minWidth: "24px" }, children: d.createElement(e, {
2
+ import { styled as d, Menu as n, MenuItem as l, ListItemIcon as p } from "@mui/material";
3
+ import a from "react";
4
+ function c({
5
+ icon: e = void 0,
6
+ selected: t = void 0,
7
+ onClick: o,
8
+ children: r
9
+ }) {
10
+ return /* @__PURE__ */ i(l, { onClick: o, className: t ? "selected" : "", children: [
11
+ e && /* @__PURE__ */ s(p, { style: { minWidth: "24px" }, children: a.createElement(e, {
7
12
  style: { fontSize: "16px", width: "16px", height: "16px" }
8
13
  }) }),
9
14
  r
10
15
  ] });
11
16
  }
12
- const h = n(l)`
17
+ const h = d(n)`
13
18
  .MuiPaper-root {
14
19
  box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.15);
15
20
  }
@@ -63,43 +63,37 @@ function q({ user: r }) {
63
63
  display: "grid",
64
64
  gridTemplateColumns: "1fr min-content"
65
65
  },
66
- children: !h.length && !g.length && !y.length ? (
67
- // @ts-expect-error 忽略 ref 类型
68
- /* @__PURE__ */ s(
66
+ children: !h.length && !g.length && !y.length ? /* @__PURE__ */ s(
67
+ T,
68
+ {
69
+ behavior: "only-new",
70
+ action: "connect",
71
+ createMode: "connect",
72
+ createButtonText: "Add Passkey",
73
+ onSuccess: a,
74
+ onError: a,
75
+ dense: !0
76
+ }
77
+ ) : /* @__PURE__ */ L(O, { children: [
78
+ h.map((e) => /* @__PURE__ */ s(u, { item: e }, e == null ? void 0 : e.provider)),
79
+ g.map((e) => /* @__PURE__ */ s(u, { item: e }, e.id)),
80
+ y.map((e) => /* @__PURE__ */ s(u, { item: e }, e.id)),
81
+ A.wallet || A.arcSphere ? null : /* @__PURE__ */ s(
69
82
  T,
70
83
  {
71
84
  behavior: "only-new",
72
85
  action: "connect",
73
86
  createMode: "connect",
74
- createButtonText: "Add Passkey",
87
+ createButtonText: "Add New Passkey",
75
88
  onSuccess: a,
76
89
  onError: a,
77
- dense: !0
78
- }
79
- )
80
- ) : /* @__PURE__ */ L(O, { children: [
81
- h.map((e) => /* @__PURE__ */ s(u, { item: e }, e == null ? void 0 : e.provider)),
82
- g.map((e) => /* @__PURE__ */ s(u, { item: e }, e.id)),
83
- y.map((e) => /* @__PURE__ */ s(u, { item: e }, e.id)),
84
- A.wallet || A.arcSphere ? null : (
85
- // @ts-expect-error 忽略 ref 类型
86
- /* @__PURE__ */ s(
87
- T,
88
- {
89
- behavior: "only-new",
90
- action: "connect",
91
- createMode: "connect",
92
- createButtonText: "Add New Passkey",
93
- onSuccess: a,
94
- onError: a,
95
- dense: !0,
96
- sx: {
97
- px: 1.5,
98
- py: 1,
99
- gap: 0.75
100
- }
90
+ dense: !0,
91
+ sx: {
92
+ px: 1.5,
93
+ py: 1,
94
+ gap: 0.75
101
95
  }
102
- )
96
+ }
103
97
  )
104
98
  ] })
105
99
  }
@@ -2,5 +2,5 @@ export { x as default };
2
2
  declare function x({ data: e, verified: s, ...r }: {
3
3
  [x: string]: any;
4
4
  data: any;
5
- verified: any;
5
+ verified?: boolean | undefined;
6
6
  }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as t, jsx as i } from "react/jsx-runtime";
2
2
  import { Box as n, Typography as o } from "@mui/material";
3
3
  import { Verified as l } from "@mui/icons-material";
4
- function x({ data: e, verified: s, ...r }) {
4
+ function x({ data: e, verified: s = !1, ...r }) {
5
5
  return /* @__PURE__ */ t(
6
6
  n,
7
7
  {
@@ -1,9 +1,9 @@
1
- export { ke as default };
2
- declare function ke({ isMobile: o, size: R, isMyself: g, status: e, onChange: s, timezone: W }: {
3
- isMobile: any;
1
+ export { ye as default };
2
+ declare function ye({ isMobile: o, size: R, isMyself: g, status: e, onChange: s, timezone: W }: {
3
+ isMobile?: undefined;
4
4
  size: any;
5
5
  isMyself: any;
6
6
  status: any;
7
7
  onChange: any;
8
- timezone: any;
8
+ timezone?: undefined;
9
9
  }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as E, jsx as l } from "react/jsx-runtime";
2
2
  import { Tooltip as H, Box as z, Badge as B } from "@mui/material";
3
3
  import U from "@emotion/styled";
4
- import { lazy as m, useState as C, useEffect as q, useCallback as A, useMemo as F, Suspense as L } from "react";
4
+ import { lazy as d, useState as C, useEffect as q, useCallback as A, useMemo as F, Suspense as L } from "react";
5
5
  import { useMemoizedFn as T, useInterval as Q, useUnmount as G, useCreation as J } from "ahooks";
6
6
  import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
7
7
  import { translate as P } from "@arcblock/ux/lib/Locale/util";
@@ -10,7 +10,7 @@ import { StatusEnum as t, DurationEnum as c } from "../../../@types/index.js";
10
10
  import X from "../status-dialog/index.js";
11
11
  import { translations as Y } from "../../libs/locales.js";
12
12
  import { isNotClear as $, isWithinTimeRange as Z, getTimeRemaining as _ } from "./utils.js";
13
- const ee = m(() => import("@arcblock/icons/lib/Meeting")), oe = m(() => import("@arcblock/icons/lib/Community")), ne = m(() => import("@arcblock/icons/lib/Holiday")), te = m(() => import("@arcblock/icons/lib/OffSick")), ie = m(() => import("@arcblock/icons/lib/WorkingRemotely")), I = {
13
+ const ee = d(() => import("@arcblock/icons/lib/Meeting")), oe = d(() => import("@arcblock/icons/lib/Community")), ne = d(() => import("@arcblock/icons/lib/Holiday")), te = d(() => import("@arcblock/icons/lib/OffSick")), ie = d(() => import("@arcblock/icons/lib/WorkingRemotely")), I = {
14
14
  [t.Meeting]: ee,
15
15
  [t.Community]: oe,
16
16
  [t.Holiday]: ne,
@@ -38,15 +38,15 @@ const ee = m(() => import("@arcblock/icons/lib/Meeting")), oe = m(() => import("
38
38
  durationName: "userStatus.duration.ThisWeek"
39
39
  }
40
40
  };
41
- function ke({
42
- isMobile: o,
41
+ function ye({
42
+ isMobile: o = void 0,
43
43
  size: R,
44
44
  isMyself: g,
45
45
  status: e,
46
46
  onChange: s,
47
- timezone: W
47
+ timezone: W = void 0
48
48
  }) {
49
- const { locale: d } = K(), u = T((n, i = {}) => P(Y, n, d, "en", i)), [b, p] = C(void 0), f = T(() => {
49
+ const { locale: m } = K(), u = T((n, i = {}) => P(Y, n, m, "en", i)), [b, p] = C(void 0), f = T(() => {
50
50
  p(void 0);
51
51
  });
52
52
  q(() => {
@@ -84,22 +84,22 @@ function ke({
84
84
  children: n
85
85
  };
86
86
  });
87
- }, [u, x, d]), D = (n) => {
87
+ }, [u, x, m]), D = (n) => {
88
88
  g && S(n.currentTarget);
89
- }, y = () => {
89
+ }, v = () => {
90
90
  S(null);
91
91
  }, j = (n) => {
92
- g && (s(n), y());
93
- }, k = I[e == null ? void 0 : e.value], M = F(() => {
92
+ g && (s(n), v());
93
+ }, y = I[e == null ? void 0 : e.value], M = F(() => {
94
94
  var i;
95
95
  const n = h.find((r) => r.id === (e == null ? void 0 : e.value));
96
96
  if (n) {
97
- const r = d === "zh" ? "zh-cn" : "en-us";
97
+ const r = m === "zh" ? "zh-cn" : "en-us";
98
98
  let a;
99
99
  return $(e) || (a = (i = e == null ? void 0 : e.dateRange) == null ? void 0 : i.map((w) => V(w, { locale: r }))), a && a.length > 0 ? `${n.name}: ${a.join("~")}` : n.name;
100
100
  }
101
101
  return null;
102
- }, [e, h, d]), v = !!O;
102
+ }, [e, h, m]), k = !!O;
103
103
  return /* @__PURE__ */ E(ae, { size: R, isMobile: o, children: [
104
104
  /* @__PURE__ */ l(H, { title: M, children: /* @__PURE__ */ l(
105
105
  z,
@@ -111,17 +111,17 @@ function ke({
111
111
  alignItems: "center",
112
112
  justifyContent: "center"
113
113
  },
114
- children: k ? /* @__PURE__ */ l(L, { fallback: null, children: /* @__PURE__ */ l(k, { style: { width: 16, height: 16 } }) }) : /* @__PURE__ */ l(B, { color: "success", variant: "dot" })
114
+ children: y ? /* @__PURE__ */ l(L, { fallback: null, children: /* @__PURE__ */ l(y, { style: { width: 16, height: 16 } }) }) : /* @__PURE__ */ l(B, { color: "success", variant: "dot" })
115
115
  }
116
116
  ) }),
117
- v && /* @__PURE__ */ l(
117
+ k && /* @__PURE__ */ l(
118
118
  X,
119
119
  {
120
120
  selected: e,
121
121
  data: h,
122
- open: v,
122
+ open: k,
123
123
  onSelect: j,
124
- onClose: y,
124
+ onClose: v,
125
125
  timezone: W
126
126
  }
127
127
  )
@@ -151,5 +151,5 @@ const ae = U("div")`
151
151
  }
152
152
  `;
153
153
  export {
154
- ke as default
154
+ ye as default
155
155
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -20,6 +20,7 @@
20
20
  "scripts": {
21
21
  "lint": "eslint src tests --ext js --ext jsx --ext tsx --ext ts",
22
22
  "lint:fix": "npm run lint -- --fix",
23
+ "clean": "rm -rf lib",
23
24
  "build": "vite build",
24
25
  "watch": "vite build --watch",
25
26
  "precommit": "CI=1 npm run lint",
@@ -34,9 +35,9 @@
34
35
  "dependencies": {
35
36
  "@abtnode/constant": "^1.16.44",
36
37
  "@abtnode/util": "^1.16.44",
37
- "@arcblock/bridge": "3.0.6",
38
- "@arcblock/icons": "3.0.6",
39
- "@arcblock/react-hooks": "3.0.6",
38
+ "@arcblock/bridge": "3.0.7",
39
+ "@arcblock/icons": "3.0.7",
40
+ "@arcblock/react-hooks": "3.0.7",
40
41
  "@arcblock/ws": "^1.20.15",
41
42
  "@blocklet/constant": "^1.16.44",
42
43
  "@blocklet/did-space-react": "^1.0.63",
@@ -84,9 +85,10 @@
84
85
  "devDependencies": {
85
86
  "@types/dompurify": "^3.2.0",
86
87
  "@types/ua-parser-js": "^0.7.39",
88
+ "@types/validator": "^13.15.2",
87
89
  "eslint-plugin-react-hooks": "^4.6.2",
88
90
  "jest": "^29.7.0",
89
91
  "unbuild": "^2.0.0"
90
92
  },
91
- "gitHead": "b985886f6650c3df0f48665c71d7a8ce0d9bdb93"
93
+ "gitHead": "05185ed22660a8fea176616b19b6703456f2348c"
92
94
  }