@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,3 +1,4 @@
1
- declare function g(t: any): string;
2
- declare function l(t: any): any;
3
- export { g as createPassportSvg, l as formatAxiosError };
1
+ import { AxiosError } from 'axios';
2
+ import { CreatePassportProps } from '../../@types';
3
+ export declare const formatAxiosError: (err: AxiosError) => string;
4
+ export declare const createPassportSvg: (props: CreatePassportProps) => string;
@@ -1,5 +1,5 @@
1
- export { w as default };
2
- declare function w({ user: t, sessionUser: l }: {
3
- user: any;
4
- sessionUser: any;
5
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
1
+ import { User } from '../../@types';
2
+ export default function UserSessionInfo({ user, sessionUser }: {
3
+ readonly user: User;
4
+ readonly sessionUser: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,20 @@
1
- export { Pe as default };
2
- declare function Pe({ user: m, showAction: y, showUser: d, getUserSessions: x, showOffline: A }: {
3
- user: any;
4
- showAction?: boolean | undefined;
5
- showUser?: boolean | undefined;
6
- getUserSessions: any;
7
- showOffline?: boolean | undefined;
8
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
1
+ import { UserSession } from '@blocklet/js-sdk';
2
+ import { User } from '../../@types';
3
+ export default function UserSessions({ user, showAction, showUser, getUserSessions, showOffline, }: {
4
+ readonly user: User & {
5
+ userSessions?: any[];
6
+ };
7
+ readonly showAction?: boolean;
8
+ readonly showUser?: boolean;
9
+ readonly showOffline?: boolean;
10
+ readonly getUserSessions: (params: {
11
+ page: number;
12
+ pageSize: number;
13
+ status?: 'online' | 'expired' | 'offline';
14
+ }) => Promise<{
15
+ paging: {
16
+ total: number;
17
+ };
18
+ list: UserSession[];
19
+ }>;
20
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
- import { default as o } from './components/user-sessions.js';
2
- export { o as UserSessions };
1
+ export { default as UserSessions } from './components/user-sessions';
@@ -1,88 +1,60 @@
1
- export { o as translations };
2
- declare namespace o {
3
- namespace zh {
4
- let confirm: string;
5
- let cancel: string;
6
- let visitorId: string;
7
- let deviceType: string;
8
- let platform: string;
9
- let walletOS: string;
10
- let role: string;
11
- let fullname: string;
12
- let email: string;
13
- let avatar: string;
14
- let user: string;
15
- let createdAt: string;
16
- let updatedAt: string;
17
- let lastLoginIp: string;
18
- let actions: string;
19
- let logoutAll: string;
20
- let logoutAllTips: string;
21
- let logout: string;
22
- let currentSession: string;
23
- let unknown: string;
24
- let expired: string;
25
- let remove: string;
26
- let logoutThisSession: string;
27
- let logoutThisSessionConfirm: string;
28
- let logoutAllSession: string;
29
- let logoutAllSessionConfirm: string;
30
- let online: string;
31
- }
32
- namespace en {
33
- let confirm_1: string;
34
- export { confirm_1 as confirm };
35
- let cancel_1: string;
36
- export { cancel_1 as cancel };
37
- let visitorId_1: string;
38
- export { visitorId_1 as visitorId };
39
- let deviceType_1: string;
40
- export { deviceType_1 as deviceType };
41
- let platform_1: string;
42
- export { platform_1 as platform };
43
- let walletOS_1: string;
44
- export { walletOS_1 as walletOS };
45
- let role_1: string;
46
- export { role_1 as role };
47
- let fullname_1: string;
48
- export { fullname_1 as fullname };
49
- let email_1: string;
50
- export { email_1 as email };
51
- let avatar_1: string;
52
- export { avatar_1 as avatar };
53
- let user_1: string;
54
- export { user_1 as user };
55
- let createdAt_1: string;
56
- export { createdAt_1 as createdAt };
57
- let updatedAt_1: string;
58
- export { updatedAt_1 as updatedAt };
59
- let actions_1: string;
60
- export { actions_1 as actions };
61
- let lastLoginIp_1: string;
62
- export { lastLoginIp_1 as lastLoginIp };
63
- let logoutAll_1: string;
64
- export { logoutAll_1 as logoutAll };
65
- let logoutAllTips_1: string;
66
- export { logoutAllTips_1 as logoutAllTips };
67
- let logout_1: string;
68
- export { logout_1 as logout };
69
- let currentSession_1: string;
70
- export { currentSession_1 as currentSession };
71
- let unknown_1: string;
72
- export { unknown_1 as unknown };
73
- let expired_1: string;
74
- export { expired_1 as expired };
75
- let remove_1: string;
76
- export { remove_1 as remove };
77
- let logoutThisSession_1: string;
78
- export { logoutThisSession_1 as logoutThisSession };
79
- let logoutThisSessionConfirm_1: string;
80
- export { logoutThisSessionConfirm_1 as logoutThisSessionConfirm };
81
- let logoutAllSession_1: string;
82
- export { logoutAllSession_1 as logoutAllSession };
83
- let logoutAllSessionConfirm_1: string;
84
- export { logoutAllSessionConfirm_1 as logoutAllSessionConfirm };
85
- let online_1: string;
86
- export { online_1 as online };
87
- }
88
- }
1
+ export declare const translations: {
2
+ zh: {
3
+ confirm: string;
4
+ cancel: string;
5
+ visitorId: string;
6
+ deviceType: string;
7
+ platform: string;
8
+ walletOS: string;
9
+ role: string;
10
+ fullname: string;
11
+ email: string;
12
+ avatar: string;
13
+ user: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ lastLoginIp: string;
17
+ actions: string;
18
+ logoutAll: string;
19
+ logoutAllTips: string;
20
+ logout: string;
21
+ currentSession: string;
22
+ unknown: string;
23
+ expired: string;
24
+ remove: string;
25
+ logoutThisSession: string;
26
+ logoutThisSessionConfirm: string;
27
+ logoutAllSession: string;
28
+ logoutAllSessionConfirm: string;
29
+ online: string;
30
+ };
31
+ en: {
32
+ confirm: string;
33
+ cancel: string;
34
+ visitorId: string;
35
+ deviceType: string;
36
+ platform: string;
37
+ walletOS: string;
38
+ role: string;
39
+ fullname: string;
40
+ email: string;
41
+ avatar: string;
42
+ user: string;
43
+ createdAt: string;
44
+ updatedAt: string;
45
+ actions: string;
46
+ lastLoginIp: string;
47
+ logoutAll: string;
48
+ logoutAllTips: string;
49
+ logout: string;
50
+ currentSession: string;
51
+ unknown: string;
52
+ expired: string;
53
+ remove: string;
54
+ logoutThisSession: string;
55
+ logoutThisSessionConfirm: string;
56
+ logoutAllSession: string;
57
+ logoutAllSessionConfirm: string;
58
+ online: string;
59
+ };
60
+ };
@@ -1,3 +1,2 @@
1
- declare function g(t: any): Promise<any[]>;
2
- declare function l(t: any): Promise<string>;
3
- export { g as batchIp2Region, l as ip2Region };
1
+ export declare function ip2Region(ip: string): Promise<string>;
2
+ export declare function batchIp2Region(ips: string[]): Promise<string[]>;
@@ -1,11 +1,9 @@
1
- declare function R(r: any, o: any): any;
2
- declare function b(r?: any[]): any;
3
- declare function N(r: any): any;
4
- declare function p(r: any): any;
5
- declare function h(r: any): any;
6
- declare function i(r: any, o?: string): any;
7
- declare function L(r: any, o?: string): any;
8
- declare function g(r: any): {
1
+ export const publicPath: any;
2
+ export function formatTheme(theme: any): any;
3
+ export function getLink(link: any, locale?: string): any;
4
+ export function getLocalizedNavigation(navigation: any, locale?: string): any;
5
+ export function formatNavigation(navigation: any): any;
6
+ export function parseNavigation(navigation: any): {
9
7
  header: never[];
10
8
  footer: never[];
11
9
  social: never[];
@@ -14,5 +12,6 @@ declare function g(r: any): {
14
12
  sessionManager: never[];
15
13
  userCenter: never[];
16
14
  } | null;
17
- declare const w: any;
18
- export { R as filterNavByRole, b as filterValidNavItems, N as formatBlockletInfo, p as formatNavigation, h as formatTheme, i as getLink, L as getLocalizedNavigation, g as parseNavigation, w as publicPath };
15
+ export function formatBlockletInfo(blockletInfo: any): any;
16
+ export function filterValidNavItems(navigation?: any[]): any;
17
+ export function filterNavByRole(nav: object[], userRole: string): any;
@@ -1,12 +1,12 @@
1
- import { default as f } from 'prop-types';
2
- export { P as default };
3
- declare function P({ locale: i, session: s }: {
1
+ import { default as PropTypes } from 'prop-types';
2
+ declare function DomainWarning({ locale, session }: {
4
3
  locale?: string | undefined;
5
4
  session?: {} | undefined;
6
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
7
- declare namespace P {
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ declare namespace DomainWarning {
8
7
  namespace propTypes {
9
- let locale: f.Requireable<string>;
10
- let session: f.Requireable<object>;
8
+ let locale: PropTypes.Requireable<string>;
9
+ let session: PropTypes.Requireable<object>;
11
10
  }
12
11
  }
12
+ export default DomainWarning;
@@ -1,7 +1,6 @@
1
- import { default as a } from 'prop-types';
2
- import { SessionManagerProps as z } from '../types.js';
3
- export { O as default };
4
- declare function O({ formattedBlocklet: s, addons: e, showDomainWarningDialog: c, sessionManagerProps: d }: {
1
+ import { default as PropTypes } from 'prop-types';
2
+ import { SessionManagerProps } from '../types';
3
+ declare function HeaderAddons({ formattedBlocklet, addons, showDomainWarningDialog, sessionManagerProps, }: {
5
4
  formattedBlocklet: any;
6
5
  addons?: null | undefined;
7
6
  showDomainWarningDialog?: boolean | undefined;
@@ -9,11 +8,12 @@ declare function O({ formattedBlocklet: s, addons: e, showDomainWarningDialog: c
9
8
  showRole: boolean;
10
9
  } | undefined;
11
10
  }): import('react').FunctionComponentElement<import('react').FragmentProps>;
12
- declare namespace O {
11
+ declare namespace HeaderAddons {
13
12
  namespace propTypes {
14
- export let formattedBlocklet: a.Validator<object>;
15
- export let addons: a.Requireable<NonNullable<((...args: any[]) => any) | a.ReactNodeLike>>;
16
- export { z as sessionManagerProps };
17
- export let showDomainWarningDialog: a.Requireable<boolean>;
13
+ export let formattedBlocklet: PropTypes.Validator<object>;
14
+ export let addons: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
15
+ export { SessionManagerProps as sessionManagerProps };
16
+ export let showDomainWarningDialog: PropTypes.Requireable<boolean>;
18
17
  }
19
18
  }
19
+ export default HeaderAddons;
@@ -1,4 +1,7 @@
1
- export { s as default };
2
- declare function s({ ...n }: {
1
+ export default LinkBlocker;
2
+ /**
3
+ * 适用于 header/footer/dashboard "preview mode", 阻止内部组件中所有 link 的默认点击行为
4
+ */
5
+ declare function LinkBlocker({ ...rest }: {
3
6
  [x: string]: any;
4
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
- import { default as R } from 'prop-types';
2
- export { P as default };
3
- declare function P({ session: r }: {
1
+ import { default as PropTypes } from 'prop-types';
2
+ declare function NotificationAddon({ session }: {
4
3
  session?: {} | undefined;
5
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
6
- declare namespace P {
4
+ }): import("react/jsx-runtime").JSX.Element | null;
5
+ declare namespace NotificationAddon {
7
6
  namespace propTypes {
8
- let session: R.Requireable<object>;
7
+ let session: PropTypes.Requireable<object>;
9
8
  }
10
9
  }
10
+ export default NotificationAddon;
@@ -1,12 +1,15 @@
1
- import { default as r } from 'prop-types';
2
- export { h as default };
3
- declare function h({ theme: e, children: t }: {
1
+ import { default as PropTypes } from 'prop-types';
2
+ /**
3
+ * 允许 theme 被覆盖的 ThemeProvider 组件, 默认使用 ux default theme, 可以传入 theme 进行覆盖
4
+ */
5
+ declare function OverridableThemeProvider({ theme: themeOverrides, children }: {
4
6
  theme?: null | undefined;
5
7
  children: any;
6
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
7
- declare namespace h {
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace OverridableThemeProvider {
8
10
  namespace propTypes {
9
- let children: r.Validator<any>;
10
- let theme: r.Requireable<object>;
11
+ let children: PropTypes.Validator<any>;
12
+ let theme: PropTypes.Requireable<object>;
11
13
  }
12
14
  }
15
+ export default OverridableThemeProvider;
@@ -1,2 +1 @@
1
- export { s as useWalletHiddenTopbar };
2
- declare function s(): void;
1
+ export function useWalletHiddenTopbar(): void;
@@ -1,4 +1,3 @@
1
- declare function c(t?: string): any;
2
- declare function l(t?: string): any;
3
- declare function E(t?: string): any;
4
- export { c as create, l as default, E as useListenWsClient };
1
+ export function create(endpoint?: string): any;
2
+ export default function getWsClient(endpoint?: string): any;
3
+ export function useListenWsClient(endpoint?: string): any;
@@ -1,7 +1,27 @@
1
- declare const U: import('react').Consumer<{}>;
2
- declare const d: import('react').Context<{}>;
3
- declare function h({ children: n }: {
4
- children: any;
5
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
6
- declare function P(): {};
7
- export { U as ConfigUserSpaceConsumer, d as ConfigUserSpaceContext, h as ConfigUserSpaceProvider, P as useConfigUserSpaceContext };
1
+ import { Session } from '../@types';
2
+ export interface SpaceGateway {
3
+ did: string;
4
+ name: string;
5
+ url: string;
6
+ endpoint: string;
7
+ }
8
+ export interface SettingStorageEndpoint {
9
+ (endpoint: string | undefined): void | Promise<void>;
10
+ }
11
+ interface ConfigUserSpaceContextType {
12
+ loading: boolean;
13
+ spaceGateway: SpaceGateway | undefined;
14
+ session: Session;
15
+ deleteSpaceGateway: (spaceGateway: SpaceGateway) => Promise<void>;
16
+ updateSpaceGateway: (updateSpaceGateway: SpaceGateway) => Promise<void>;
17
+ storageEndpoint: string;
18
+ settingStorageEndpoint: SettingStorageEndpoint;
19
+ hasStorageEndpoint: boolean;
20
+ }
21
+ declare const ConfigUserSpaceContext: import('react').Context<ConfigUserSpaceContextType>;
22
+ declare const Consumer: import('react').Consumer<ConfigUserSpaceContextType>;
23
+ declare function ConfigUserSpaceProvider({ children }: {
24
+ children: React.ReactNode;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ declare function useConfigUserSpaceContext(): ConfigUserSpaceContextType;
27
+ export { ConfigUserSpaceContext, ConfigUserSpaceProvider, Consumer as ConfigUserSpaceConsumer, useConfigUserSpaceContext, };
@@ -1,4 +1,4 @@
1
- export { u as default };
2
- declare function u({ key: e }?: {
3
- key?: string | undefined;
1
+ import { Breakpoint } from '@mui/material';
2
+ export default function useMobile({ key }?: {
3
+ key?: number | Breakpoint;
4
4
  }): boolean;
package/lib/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { default as A } from './ComponentManager/components/add-component.js';
2
- import { default as x } from './BlockletStudio/index.js';
3
- import { default as p, default as n } from './ComponentInstaller/index.js';
4
- import { default as s } from './Dashboard/index.js';
5
- import { default as a } from './Footer/index.js';
6
- import { default as t } from './Header/index.js';
7
- import { default as d } from './Icon/index.js';
8
- import { default as S } from './ComponentManager/components/publish-component.js';
9
- import { default as i } from './UserCenter/components/user-center.js';
10
- import { default as b } from './UserSessions/components/user-sessions.js';
11
- import { default as c } from './ComponentInstaller/use-component-installed.js';
12
- export { A as AddComponent, x as BlockletStudio, p as CheckComponent, n as ComponentInstaller, s as Dashboard, a as Footer, t as Header, d as Icon, S as PublishComponent, i as UserCenter, b as UserSessions, c as useComponentInstaller };
1
+ export { default as Header } from './Header';
2
+ export { default as Footer } from './Footer';
3
+ export { default as Dashboard } from './Dashboard';
4
+ export { default as Icon } from './Icon';
5
+ export { default as ComponentInstaller } from './ComponentInstaller';
6
+ export { default as BlockletStudio } from './BlockletStudio';
7
+ export { default as useComponentInstaller } from './ComponentInstaller/use-component-installed';
8
+ export * from './UserCenter';
9
+ export * from './UserSessions';
10
+ export * from './ComponentManager';
@@ -1,3 +1,2 @@
1
- import { BlockletSDK as o } from '@blocklet/js-sdk';
2
- export { e as client };
3
- declare const e: o;
1
+ import { BlockletSDK } from '@blocklet/js-sdk';
2
+ export declare const client: BlockletSDK;
@@ -1,2 +1 @@
1
- export { e as EMBED_MODE_KEY };
2
- declare const e: "blocklet-ui-react-embed-mode";
1
+ export declare const EMBED_MODE_KEY = "blocklet-ui-react-embed-mode";
@@ -1,3 +1,2 @@
1
- declare function i(r: any): string;
2
- declare function c(r: any): string;
3
- export { i as getSpaceHomeUrl, c as getSpaceNftDisplayUrlFromEndpoint };
1
+ export declare function getSpaceNftDisplayUrlFromEndpoint(endpoint: string): string;
2
+ export declare function getSpaceHomeUrl(endpoint: string): string;
@@ -1,5 +1,4 @@
1
- export { p as default };
2
- declare function p(e: any): {
3
- (n: any): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
1
+ export default function withHideWhenEmbed<T extends object>(Component: React.ComponentType<T>): {
2
+ (props: T): import("react/jsx-runtime").JSX.Element | null;
4
3
  displayName: string;
5
4
  };
package/lib/types.d.ts CHANGED
@@ -1,37 +1,36 @@
1
- import { default as o } from 'prop-types';
2
- declare const n: o.Requireable<o.InferProps<{
3
- appLogo: o.Requireable<o.ReactNodeLike>;
4
- appName: o.Requireable<string>;
5
- theme: o.Requireable<o.InferProps<{
6
- background: o.Requireable<string>;
1
+ import { default as PropTypes } from 'prop-types';
2
+ export const BlockletMetaProps: PropTypes.Requireable<PropTypes.InferProps<{
3
+ appLogo: PropTypes.Requireable<PropTypes.ReactNodeLike>;
4
+ appName: PropTypes.Requireable<string>;
5
+ theme: PropTypes.Requireable<PropTypes.InferProps<{
6
+ background: PropTypes.Requireable<string>;
7
7
  }>>;
8
- enableConnect: o.Requireable<boolean>;
9
- enableLocale: o.Requireable<boolean>;
10
- navigation: o.Requireable<(o.InferProps<{
11
- title: o.Requireable<NonNullable<string | object | null | undefined>>;
12
- link: o.Requireable<NonNullable<string | object | null | undefined>>;
13
- icon: o.Requireable<string>;
14
- items: o.Requireable<(o.InferProps<{
15
- title: o.Requireable<NonNullable<string | object | null | undefined>>;
16
- link: o.Requireable<NonNullable<string | object | null | undefined>>;
8
+ enableConnect: PropTypes.Requireable<boolean>;
9
+ enableLocale: PropTypes.Requireable<boolean>;
10
+ navigation: PropTypes.Requireable<(PropTypes.InferProps<{
11
+ title: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
12
+ link: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
13
+ icon: PropTypes.Requireable<string>;
14
+ items: PropTypes.Requireable<(PropTypes.InferProps<{
15
+ title: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
16
+ link: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
17
17
  }> | null | undefined)[]>;
18
18
  }> | null | undefined)[]>;
19
19
  }>>;
20
- declare const t: o.Requireable<o.InferProps<{
21
- showText: o.Requireable<boolean>;
22
- showRole: o.Requireable<boolean>;
23
- switchDid: o.Requireable<boolean>;
24
- switchProfile: o.Requireable<boolean>;
25
- switchPassport: o.Requireable<boolean>;
26
- disableLogout: o.Requireable<boolean>;
27
- onLogin: o.Requireable<(...args: any[]) => any>;
28
- onLogout: o.Requireable<(...args: any[]) => any>;
29
- onSwitchDid: o.Requireable<(...args: any[]) => any>;
30
- onSwitchProfile: o.Requireable<(...args: any[]) => any>;
31
- onSwitchPassport: o.Requireable<(...args: any[]) => any>;
32
- menu: o.Requireable<any[]>;
33
- menuRender: o.Requireable<(...args: any[]) => any>;
34
- dark: o.Requireable<boolean>;
35
- size: o.Requireable<number>;
20
+ export const SessionManagerProps: PropTypes.Requireable<PropTypes.InferProps<{
21
+ showText: PropTypes.Requireable<boolean>;
22
+ showRole: PropTypes.Requireable<boolean>;
23
+ switchDid: PropTypes.Requireable<boolean>;
24
+ switchProfile: PropTypes.Requireable<boolean>;
25
+ switchPassport: PropTypes.Requireable<boolean>;
26
+ disableLogout: PropTypes.Requireable<boolean>;
27
+ onLogin: PropTypes.Requireable<(...args: any[]) => any>;
28
+ onLogout: PropTypes.Requireable<(...args: any[]) => any>;
29
+ onSwitchDid: PropTypes.Requireable<(...args: any[]) => any>;
30
+ onSwitchProfile: PropTypes.Requireable<(...args: any[]) => any>;
31
+ onSwitchPassport: PropTypes.Requireable<(...args: any[]) => any>;
32
+ menu: PropTypes.Requireable<any[]>;
33
+ menuRender: PropTypes.Requireable<(...args: any[]) => any>;
34
+ dark: PropTypes.Requireable<boolean>;
35
+ size: PropTypes.Requireable<number>;
36
36
  }>>;
37
- export { n as BlockletMetaProps, t as SessionManagerProps };
package/lib/utils.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- declare function E(n: any, e: any): any;
2
- declare function x(n: any, e?: string): number;
3
- declare function V(n: any, e: any, r?: string): any;
4
- declare function S(n: any, e?: string): any[];
5
- declare function W(n: any): boolean;
6
- declare function P(n: any): boolean;
7
- declare function d(n: any, e: any, r?: string): any;
8
- declare function A(n: any): any;
9
- declare function k(n?: any[]): number;
10
- declare function v(n: any, e?: {}): never[][];
11
- export { E as compareVersions, x as countRecursive, V as filterRecursive, S as flatRecursive, W as isIconifyString, P as isUrl, d as mapRecursive, A as matchPath, k as matchPaths, v as splitNavColumns };
1
+ export function mapRecursive(array: any, fn: any, childrenKey?: string): any;
2
+ export function flatRecursive(array: any, childrenKey?: string): any[];
3
+ export function countRecursive(array: any, childrenKey?: string): number;
4
+ export function filterRecursive(array: any, predicate: any, childrenKey?: string): any;
5
+ export function isUrl(str: any): boolean;
6
+ export function isIconifyString(str: any): boolean;
7
+ export function matchPath(path: any): any;
8
+ export function matchPaths(paths?: any[]): number;
9
+ export function splitNavColumns(items: any, options?: {}): never[][];
10
+ export function compareVersions(version1: any, version2: any): any;
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.8",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -20,7 +20,8 @@
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
- "build": "vite build",
23
+ "clean": "rm -rf lib",
24
+ "build": "npm run clean &&vite build",
24
25
  "watch": "vite build --watch",
25
26
  "precommit": "CI=1 npm run lint",
26
27
  "prepush": "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.8",
39
+ "@arcblock/icons": "3.0.8",
40
+ "@arcblock/react-hooks": "3.0.8",
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": "30b21395b2f3ef6824df728aeafd10e9dea173d9"
92
94
  }