@blocklet/ui-react 3.0.6 → 3.0.8

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 (133) hide show
  1. package/lib/@types/index.d.ts +204 -3
  2. package/lib/BlockletStudio/index.d.ts +27 -26
  3. package/lib/BlockletStudio/index.js +66 -66
  4. package/lib/ComponentInstaller/index.d.ts +15 -15
  5. package/lib/ComponentInstaller/installer-item.d.ts +10 -10
  6. package/lib/ComponentInstaller/locales.d.ts +2 -2
  7. package/lib/ComponentInstaller/use-component-installed.d.ts +2 -2
  8. package/lib/ComponentManager/components/add-component.d.ts +16 -13
  9. package/lib/ComponentManager/components/add-component.js +29 -29
  10. package/lib/ComponentManager/components/check-component.d.ts +2 -2
  11. package/lib/ComponentManager/components/publish-component.d.ts +10 -7
  12. package/lib/ComponentManager/components/publish-component.js +19 -19
  13. package/lib/ComponentManager/components/resource-dialog.d.ts +13 -11
  14. package/lib/ComponentManager/components/resource-dialog.js +1 -1
  15. package/lib/ComponentManager/index.d.ts +3 -4
  16. package/lib/ComponentManager/libs/locales.d.ts +14 -19
  17. package/lib/Dashboard/index.d.ts +16 -13
  18. package/lib/Footer/brand.d.ts +8 -8
  19. package/lib/Footer/copyright.d.ts +7 -7
  20. package/lib/Footer/index.d.ts +2 -2
  21. package/lib/Footer/internal-footer.d.ts +26 -21
  22. package/lib/Footer/internal-footer.js +1 -1
  23. package/lib/Footer/layout/plain.d.ts +15 -12
  24. package/lib/Footer/layout/row.d.ts +7 -7
  25. package/lib/Footer/layout/standard.d.ts +17 -14
  26. package/lib/Footer/layout/standard.js +1 -1
  27. package/lib/Footer/links.d.ts +15 -12
  28. package/lib/Footer/links.js +3 -3
  29. package/lib/Footer/social-media.d.ts +8 -8
  30. package/lib/Header/index.d.ts +23 -13
  31. package/lib/Header/index.js +17 -17
  32. package/lib/Icon/index.d.ts +9 -7
  33. package/lib/Icon/index.js +6 -6
  34. package/lib/Notifications/Snackbar.d.ts +16 -8
  35. package/lib/Notifications/Snackbar.js +1 -1
  36. package/lib/Notifications/hooks/use-title.d.ts +48 -9
  37. package/lib/Notifications/hooks/use-title.js +9 -9
  38. package/lib/Notifications/hooks/use-width.d.ts +2 -2
  39. package/lib/Notifications/utils.d.ts +69 -9
  40. package/lib/UserCenter/components/config-inviter.d.ts +4 -4
  41. package/lib/UserCenter/components/config-profile.d.ts +5 -5
  42. package/lib/UserCenter/components/danger-zone.d.ts +1 -2
  43. package/lib/UserCenter/components/editable-field.d.ts +34 -30
  44. package/lib/UserCenter/components/editable-field.js +12 -12
  45. package/lib/UserCenter/components/nft.d.ts +4 -4
  46. package/lib/UserCenter/components/notification.d.ts +5 -5
  47. package/lib/UserCenter/components/notification.js +5 -5
  48. package/lib/UserCenter/components/passport.d.ts +5 -5
  49. package/lib/UserCenter/components/privacy.d.ts +11 -5
  50. package/lib/UserCenter/components/settings.d.ts +10 -8
  51. package/lib/UserCenter/components/status-dialog/date-picker.d.ts +10 -9
  52. package/lib/UserCenter/components/status-dialog/date-picker.js +17 -10
  53. package/lib/UserCenter/components/status-dialog/index.d.ts +12 -9
  54. package/lib/UserCenter/components/status-dialog/index.js +8 -1
  55. package/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -7
  56. package/lib/UserCenter/components/status-selector/index.d.ts +9 -8
  57. package/lib/UserCenter/components/status-selector/index.js +5 -5
  58. package/lib/UserCenter/components/status-selector/menu-item.d.ts +24 -9
  59. package/lib/UserCenter/components/status-selector/menu-item.js +11 -6
  60. package/lib/UserCenter/components/storage/action.d.ts +9 -7
  61. package/lib/UserCenter/components/storage/connected.d.ts +5 -4
  62. package/lib/UserCenter/components/storage/delete.d.ts +6 -5
  63. package/lib/UserCenter/components/storage/disconnect.d.ts +2 -2
  64. package/lib/UserCenter/components/storage/index.d.ts +2 -2
  65. package/lib/UserCenter/components/storage/preview-nft.d.ts +5 -5
  66. package/lib/UserCenter/components/third-party-login/index.d.ts +4 -4
  67. package/lib/UserCenter/components/third-party-login/index.js +23 -29
  68. package/lib/UserCenter/components/third-party-login/third-party-item.d.ts +13 -4
  69. package/lib/UserCenter/components/user-center.d.ts +16 -15
  70. package/lib/UserCenter/components/user-info/address.d.ts +16 -7
  71. package/lib/UserCenter/components/user-info/index.d.ts +4 -5
  72. package/lib/UserCenter/components/user-info/link-preview-input.d.ts +5 -6
  73. package/lib/UserCenter/components/user-info/metadata.d.ts +10 -7
  74. package/lib/UserCenter/components/user-info/switch-role.d.ts +7 -6
  75. package/lib/UserCenter/components/user-info/timezone-select.d.ts +8 -7
  76. package/lib/UserCenter/components/user-info/user-basic-info.d.ts +13 -12
  77. package/lib/UserCenter/components/user-info/user-info-item.d.ts +11 -6
  78. package/lib/UserCenter/components/user-info/user-info-item.js +1 -1
  79. package/lib/UserCenter/components/user-info/user-info.d.ts +6 -6
  80. package/lib/UserCenter/components/user-info/user-status.d.ts +9 -9
  81. package/lib/UserCenter/components/user-info/user-status.js +17 -17
  82. package/lib/UserCenter/components/user-info/utils.d.ts +33 -15
  83. package/lib/UserCenter/components/webhook-item.d.ts +2 -10
  84. package/lib/UserCenter/index.d.ts +1 -2
  85. package/lib/UserCenter/libs/locales.d.ts +345 -513
  86. package/lib/UserCenter/libs/utils.d.ts +4 -3
  87. package/lib/UserSessions/components/user-session-info.d.ts +5 -5
  88. package/lib/UserSessions/components/user-sessions.d.ts +20 -8
  89. package/lib/UserSessions/index.d.ts +1 -2
  90. package/lib/UserSessions/libs/locales.d.ts +60 -88
  91. package/lib/UserSessions/libs/utils.d.ts +2 -3
  92. package/lib/blocklets.d.ts +9 -10
  93. package/lib/common/domain-warning.d.ts +7 -7
  94. package/lib/common/header-addons.d.ts +9 -9
  95. package/lib/common/link-blocker.d.ts +6 -3
  96. package/lib/common/notification-addon.d.ts +6 -6
  97. package/lib/common/overridable-theme-provider.d.ts +10 -7
  98. package/lib/common/wallet-hidden-topbar.d.ts +1 -2
  99. package/lib/common/ws.d.ts +3 -4
  100. package/lib/contexts/config-user-space.d.ts +27 -7
  101. package/lib/hooks/use-mobile.d.ts +3 -3
  102. package/lib/index.d.ts +10 -12
  103. package/lib/libs/client.d.ts +2 -3
  104. package/lib/libs/constant.d.ts +1 -2
  105. package/lib/libs/spaces.d.ts +2 -3
  106. package/lib/libs/with-hide-when-embed.d.ts +2 -3
  107. package/lib/types.d.ts +31 -32
  108. package/lib/utils.d.ts +10 -11
  109. package/package.json +8 -6
  110. package/src/BlockletStudio/index.tsx +13 -13
  111. package/src/ComponentManager/components/add-component.tsx +6 -6
  112. package/src/ComponentManager/components/publish-component.tsx +2 -2
  113. package/src/ComponentManager/components/resource-dialog.tsx +1 -1
  114. package/src/Footer/internal-footer.jsx +1 -1
  115. package/src/Footer/layout/standard.jsx +1 -1
  116. package/src/Footer/links.jsx +1 -1
  117. package/src/Header/index.tsx +2 -2
  118. package/src/Icon/index.tsx +2 -2
  119. package/src/Notifications/Snackbar.tsx +2 -2
  120. package/src/Notifications/hooks/use-title.tsx +1 -1
  121. package/src/UserCenter/components/editable-field.tsx +6 -6
  122. package/src/UserCenter/components/notification.tsx +2 -2
  123. package/src/UserCenter/components/status-dialog/date-picker.tsx +8 -1
  124. package/src/UserCenter/components/status-dialog/index.tsx +8 -1
  125. package/src/UserCenter/components/status-selector/index.tsx +1 -1
  126. package/src/UserCenter/components/status-selector/menu-item.tsx +6 -1
  127. package/src/UserCenter/components/third-party-login/index.tsx +0 -2
  128. package/src/UserCenter/components/user-center.tsx +1 -1
  129. package/src/UserCenter/components/user-info/link-preview-input.tsx +2 -2
  130. package/src/UserCenter/components/user-info/user-info-item.tsx +1 -1
  131. package/src/UserCenter/components/user-info/user-info.tsx +1 -1
  132. package/src/UserCenter/components/user-info/user-status.tsx +2 -2
  133. package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +0 -3
@@ -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;
4
- size: any;
5
- isMyself: any;
6
- status: any;
7
- onChange: any;
8
- timezone: any;
9
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
1
+ import { UserMetadata } from '../../../@types';
2
+ export default function UserStatus({ isMobile, size, isMyself, status, onChange, timezone, }: {
3
+ isMobile?: boolean;
4
+ size: number;
5
+ isMyself: boolean;
6
+ status: UserMetadata['status'];
7
+ onChange: (v: UserMetadata['status']) => void;
8
+ timezone?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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
  };
@@ -1,33 +1,51 @@
1
- declare const M: string;
2
- declare const w: {
1
+ import { UserMetadata } from '../../../@types';
2
+ export declare const currentTimezone: string;
3
+ export declare const getTimezones: () => {
4
+ label: string;
5
+ value: string;
6
+ }[];
7
+ export declare const isValidUrl: (url: string) => boolean;
8
+ /**
9
+ * 根据 duration 类型,计算出date range
10
+ * @param status
11
+ * @returns
12
+ */
13
+ export declare const getStatusDuration: (status: UserMetadata["status"]) => Date[];
14
+ /**
15
+ * 根据状态的 duration,判断是否在时间范围内
16
+ * @param status
17
+ * @returns
18
+ */
19
+ export declare const isWithinTimeRange: (dateRange: [Date, Date]) => boolean;
20
+ /**
21
+ * 判断状态持续时间是否为不可清除
22
+ * @param status
23
+ * @returns
24
+ */
25
+ export declare const isNotClear: (status: UserMetadata["status"]) => boolean;
26
+ /**
27
+ * 获取当前时间距离结束时间还有多久
28
+ */
29
+ export declare const getTimeRemaining: (date: Date) => number;
30
+ export declare const defaultButtonStyle: {
3
31
  color: string;
4
32
  borderColor: string;
5
33
  backgroundColor: string;
6
- "&:hover": {
34
+ '&:hover': {
7
35
  borderColor: string;
8
36
  backgroundColor: string;
9
37
  };
10
38
  py: number;
11
39
  borderRadius: number;
12
40
  };
13
- declare function _(r: any): any;
14
- declare function v(r: any): number;
15
- declare function I(): {
16
- label: string;
17
- value: string;
18
- }[];
19
- declare function Z(r: any): boolean;
20
- declare function N(r: any): boolean;
21
- declare function E(r: any): boolean;
22
- declare const B: {
41
+ export declare const primaryButtonStyle: {
23
42
  color: string;
24
43
  borderColor: string;
25
44
  backgroundColor: string;
26
- "&:hover": {
45
+ '&:hover': {
27
46
  borderColor: string;
28
47
  backgroundColor: string;
29
48
  };
30
49
  py: number;
31
50
  borderRadius: number;
32
51
  };
33
- export { M as currentTimezone, w as defaultButtonStyle, _ as getStatusDuration, v as getTimeRemaining, I as getTimezones, Z as isNotClear, N as isValidUrl, E as isWithinTimeRange, B as primaryButtonStyle };
@@ -1,10 +1,2 @@
1
- export { or as default };
2
- declare function or({ onTest: x, onDelete: h, onSave: b, onCancel: y, type: c, url: u, edit: C }: {
3
- onTest?: ((...args: any[]) => void) | undefined;
4
- onDelete?: ((...args: any[]) => void) | undefined;
5
- onSave?: ((...args: any[]) => void) | undefined;
6
- onCancel?: ((...args: any[]) => void) | undefined;
7
- type?: string | undefined;
8
- url?: string | undefined;
9
- edit?: boolean | undefined;
10
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
1
+ import { WebhookItemProps } from '../../@types';
2
+ export default function WebhookItem({ onTest, onDelete, onSave, onCancel, type, url, edit, }: WebhookItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
- import { default as t } from './components/user-center.js';
2
- export { t as UserCenter };
1
+ export { default as UserCenter } from './components/user-center';