@blocklet/ui-react 3.0.3 → 3.0.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.
Files changed (195) hide show
  1. package/lib/@types/index.d.ts +3 -0
  2. package/lib/BlockletStudio/index.d.ts +26 -0
  3. package/lib/ComponentInstaller/index.d.ts +18 -0
  4. package/lib/ComponentInstaller/installer-item.d.ts +18 -0
  5. package/lib/{types/ComponentInstaller → ComponentInstaller}/locales.d.ts +2 -2
  6. package/lib/{types/ComponentInstaller → ComponentInstaller}/use-component-installed.d.ts +2 -2
  7. package/lib/ComponentManager/components/add-component.d.ts +13 -0
  8. package/lib/ComponentManager/components/check-component.d.ts +2 -0
  9. package/lib/ComponentManager/components/publish-component.d.ts +7 -0
  10. package/lib/ComponentManager/components/resource-dialog.d.ts +11 -0
  11. package/lib/ComponentManager/index.d.ts +4 -0
  12. package/lib/ComponentManager/libs/locales.d.ts +19 -0
  13. package/lib/Dashboard/index.d.ts +27 -0
  14. package/lib/Footer/brand.d.ts +15 -0
  15. package/lib/Footer/copyright.d.ts +13 -0
  16. package/lib/{types/Footer → Footer}/index.d.ts +2 -2
  17. package/lib/Footer/internal-footer.d.ts +29 -0
  18. package/lib/Footer/layout/plain.d.ts +19 -0
  19. package/lib/Footer/layout/row.d.ts +13 -0
  20. package/lib/Footer/layout/standard.d.ts +21 -0
  21. package/lib/Footer/links.d.ts +20 -0
  22. package/lib/Footer/social-media.d.ts +14 -0
  23. package/lib/Header/index.d.ts +13 -0
  24. package/lib/Icon/index.d.ts +7 -0
  25. package/lib/Notifications/Snackbar.d.ts +8 -0
  26. package/lib/Notifications/hooks/use-title.d.ts +9 -0
  27. package/lib/Notifications/hooks/use-width.d.ts +2 -0
  28. package/lib/Notifications/utils.d.ts +10 -0
  29. package/lib/UserCenter/components/config-inviter.d.ts +4 -0
  30. package/lib/UserCenter/components/config-profile.d.ts +5 -0
  31. package/lib/UserCenter/components/danger-zone.d.ts +2 -0
  32. package/lib/UserCenter/components/editable-field.d.ts +50 -0
  33. package/lib/UserCenter/components/nft.d.ts +4 -0
  34. package/lib/UserCenter/components/notification.d.ts +5 -0
  35. package/lib/UserCenter/components/passport.d.ts +5 -0
  36. package/lib/UserCenter/components/privacy.d.ts +5 -0
  37. package/lib/UserCenter/components/settings.d.ts +8 -0
  38. package/lib/UserCenter/components/status-dialog/date-picker.d.ts +9 -0
  39. package/lib/UserCenter/components/status-dialog/index.d.ts +9 -0
  40. package/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
  41. package/lib/UserCenter/components/status-selector/index.d.ts +8 -0
  42. package/lib/UserCenter/components/status-selector/menu-item.d.ts +9 -0
  43. package/lib/UserCenter/components/storage/action.d.ts +7 -0
  44. package/lib/UserCenter/components/storage/connected.d.ts +4 -0
  45. package/lib/UserCenter/components/storage/delete.d.ts +5 -0
  46. package/lib/UserCenter/components/storage/disconnect.d.ts +2 -0
  47. package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +3 -0
  48. package/lib/UserCenter/components/storage/index.d.ts +2 -0
  49. package/lib/UserCenter/components/storage/preview-nft.d.ts +5 -0
  50. package/lib/UserCenter/components/third-party-login/index.d.ts +4 -0
  51. package/lib/UserCenter/components/third-party-login/third-party-item.d.ts +4 -0
  52. package/lib/UserCenter/components/user-center.d.ts +15 -0
  53. package/lib/UserCenter/components/user-info/address.d.ts +7 -0
  54. package/lib/UserCenter/components/user-info/index.d.ts +5 -0
  55. package/lib/UserCenter/components/user-info/link-preview-input.d.ts +6 -0
  56. package/lib/UserCenter/components/user-info/metadata.d.ts +7 -0
  57. package/lib/UserCenter/components/user-info/switch-role.d.ts +6 -0
  58. package/lib/UserCenter/components/user-info/timezone-select.d.ts +7 -0
  59. package/lib/UserCenter/components/user-info/user-basic-info.d.ts +12 -0
  60. package/lib/UserCenter/components/user-info/user-info-item.d.ts +6 -0
  61. package/lib/UserCenter/components/user-info/user-info.d.ts +6 -0
  62. package/lib/UserCenter/components/user-info/user-status.d.ts +9 -0
  63. package/lib/UserCenter/components/user-info/utils.d.ts +33 -0
  64. package/lib/UserCenter/components/webhook-item.d.ts +10 -0
  65. package/lib/UserCenter/index.d.ts +2 -0
  66. package/lib/UserCenter/libs/locales.d.ts +513 -0
  67. package/lib/UserCenter/libs/utils.d.ts +3 -0
  68. package/lib/UserSessions/components/user-session-info.d.ts +5 -0
  69. package/lib/UserSessions/components/user-sessions.d.ts +8 -0
  70. package/lib/UserSessions/index.d.ts +2 -0
  71. package/lib/UserSessions/libs/locales.d.ts +88 -0
  72. package/lib/UserSessions/libs/utils.d.ts +3 -0
  73. package/lib/blocklets.d.ts +18 -0
  74. package/lib/common/domain-warning.d.ts +12 -0
  75. package/lib/common/header-addons.d.ts +19 -0
  76. package/lib/common/link-blocker.d.ts +4 -0
  77. package/lib/common/notification-addon.d.ts +10 -0
  78. package/lib/common/overridable-theme-provider.d.ts +12 -0
  79. package/lib/common/wallet-hidden-topbar.d.ts +2 -0
  80. package/lib/common/ws.d.ts +4 -0
  81. package/lib/contexts/config-user-space.d.ts +7 -0
  82. package/lib/hooks/use-mobile.d.ts +4 -0
  83. package/lib/index.d.ts +12 -0
  84. package/lib/libs/client.d.ts +3 -0
  85. package/lib/libs/constant.d.ts +2 -0
  86. package/lib/libs/spaces.d.ts +3 -0
  87. package/lib/libs/with-hide-when-embed.d.ts +5 -0
  88. package/lib/types.d.ts +37 -0
  89. package/lib/utils.d.ts +11 -0
  90. package/package.json +7 -7
  91. package/vite.config.mjs +1 -1
  92. package/lib/types/@types/index.d.ts +0 -204
  93. package/lib/types/BlockletStudio/index.d.ts +0 -27
  94. package/lib/types/ComponentInstaller/ComponentInstaller.stories.d.ts +0 -9
  95. package/lib/types/ComponentInstaller/demo/basic.d.ts +0 -29
  96. package/lib/types/ComponentInstaller/demo/mock-optional-components.d.ts +0 -2
  97. package/lib/types/ComponentInstaller/index.d.ts +0 -18
  98. package/lib/types/ComponentInstaller/installer-item.d.ts +0 -18
  99. package/lib/types/ComponentManager/components/add-component.d.ts +0 -16
  100. package/lib/types/ComponentManager/components/check-component.d.ts +0 -2
  101. package/lib/types/ComponentManager/components/publish-component.d.ts +0 -10
  102. package/lib/types/ComponentManager/components/resource-dialog.d.ts +0 -13
  103. package/lib/types/ComponentManager/index.d.ts +0 -3
  104. package/lib/types/ComponentManager/libs/locales.d.ts +0 -14
  105. package/lib/types/Dashboard/Dashboard.stories.d.ts +0 -13
  106. package/lib/types/Dashboard/demo/basic.d.ts +0 -29
  107. package/lib/types/Dashboard/index.d.ts +0 -30
  108. package/lib/types/Footer/Footer.stories.d.ts +0 -19
  109. package/lib/types/Footer/brand.d.ts +0 -15
  110. package/lib/types/Footer/copyright.d.ts +0 -13
  111. package/lib/types/Footer/demo/arcblock-site.d.ts +0 -31
  112. package/lib/types/Footer/demo/brand.d.ts +0 -1
  113. package/lib/types/Footer/demo/copyright.d.ts +0 -1
  114. package/lib/types/Footer/demo/footer.d.ts +0 -10
  115. package/lib/types/Footer/demo/links.d.ts +0 -1
  116. package/lib/types/Footer/demo/social-media-icons.d.ts +0 -1
  117. package/lib/types/Footer/internal-footer.d.ts +0 -32
  118. package/lib/types/Footer/layout/plain.d.ts +0 -22
  119. package/lib/types/Footer/layout/row.d.ts +0 -13
  120. package/lib/types/Footer/layout/standard.d.ts +0 -24
  121. package/lib/types/Footer/links.d.ts +0 -23
  122. package/lib/types/Footer/social-media.d.ts +0 -14
  123. package/lib/types/Header/Header.stories.d.ts +0 -26
  124. package/lib/types/Header/demo/addons-customization.d.ts +0 -11
  125. package/lib/types/Header/demo/basic.d.ts +0 -1
  126. package/lib/types/Header/demo/fixtures/index.d.ts +0 -49
  127. package/lib/types/Header/demo/with-enable-connect-enable-locale.d.ts +0 -1
  128. package/lib/types/Header/index.d.ts +0 -23
  129. package/lib/types/Icon/Icon.stories.d.ts +0 -12
  130. package/lib/types/Icon/demo/basic.d.ts +0 -1
  131. package/lib/types/Icon/index.d.ts +0 -9
  132. package/lib/types/Notifications/Snackbar.d.ts +0 -16
  133. package/lib/types/Notifications/hooks/use-title.d.ts +0 -48
  134. package/lib/types/Notifications/hooks/use-width.d.ts +0 -2
  135. package/lib/types/Notifications/utils.d.ts +0 -70
  136. package/lib/types/UserCenter/components/config-inviter.d.ts +0 -4
  137. package/lib/types/UserCenter/components/config-profile.d.ts +0 -5
  138. package/lib/types/UserCenter/components/danger-zone.d.ts +0 -1
  139. package/lib/types/UserCenter/components/editable-field.d.ts +0 -54
  140. package/lib/types/UserCenter/components/nft.d.ts +0 -4
  141. package/lib/types/UserCenter/components/notification.d.ts +0 -5
  142. package/lib/types/UserCenter/components/passport.d.ts +0 -5
  143. package/lib/types/UserCenter/components/privacy.d.ts +0 -11
  144. package/lib/types/UserCenter/components/settings.d.ts +0 -10
  145. package/lib/types/UserCenter/components/status-dialog/date-picker.d.ts +0 -10
  146. package/lib/types/UserCenter/components/status-dialog/index.d.ts +0 -12
  147. package/lib/types/UserCenter/components/status-selector/duration-menu.d.ts +0 -7
  148. package/lib/types/UserCenter/components/status-selector/index.d.ts +0 -9
  149. package/lib/types/UserCenter/components/status-selector/menu-item.d.ts +0 -24
  150. package/lib/types/UserCenter/components/storage/action.d.ts +0 -9
  151. package/lib/types/UserCenter/components/storage/connected.d.ts +0 -5
  152. package/lib/types/UserCenter/components/storage/delete.d.ts +0 -6
  153. package/lib/types/UserCenter/components/storage/disconnect.d.ts +0 -2
  154. package/lib/types/UserCenter/components/storage/index.d.ts +0 -2
  155. package/lib/types/UserCenter/components/storage/preview-nft.d.ts +0 -5
  156. package/lib/types/UserCenter/components/third-party-login/index.d.ts +0 -4
  157. package/lib/types/UserCenter/components/third-party-login/third-party-item.d.ts +0 -13
  158. package/lib/types/UserCenter/components/user-center.d.ts +0 -16
  159. package/lib/types/UserCenter/components/user-info/address.d.ts +0 -16
  160. package/lib/types/UserCenter/components/user-info/index.d.ts +0 -4
  161. package/lib/types/UserCenter/components/user-info/link-preview-input.d.ts +0 -5
  162. package/lib/types/UserCenter/components/user-info/metadata.d.ts +0 -10
  163. package/lib/types/UserCenter/components/user-info/switch-role.d.ts +0 -7
  164. package/lib/types/UserCenter/components/user-info/timezone-select.d.ts +0 -8
  165. package/lib/types/UserCenter/components/user-info/user-basic-info.d.ts +0 -13
  166. package/lib/types/UserCenter/components/user-info/user-info-item.d.ts +0 -11
  167. package/lib/types/UserCenter/components/user-info/user-info.d.ts +0 -6
  168. package/lib/types/UserCenter/components/user-info/user-status.d.ts +0 -9
  169. package/lib/types/UserCenter/components/user-info/utils.d.ts +0 -51
  170. package/lib/types/UserCenter/components/webhook-item.d.ts +0 -2
  171. package/lib/types/UserCenter/index.d.ts +0 -1
  172. package/lib/types/UserCenter/libs/locales.d.ts +0 -345
  173. package/lib/types/UserCenter/libs/utils.d.ts +0 -4
  174. package/lib/types/UserSessions/components/user-session-info.d.ts +0 -5
  175. package/lib/types/UserSessions/components/user-sessions.d.ts +0 -20
  176. package/lib/types/UserSessions/index.d.ts +0 -1
  177. package/lib/types/UserSessions/libs/locales.d.ts +0 -60
  178. package/lib/types/UserSessions/libs/utils.d.ts +0 -2
  179. package/lib/types/blocklets.d.ts +0 -17
  180. package/lib/types/common/domain-warning.d.ts +0 -12
  181. package/lib/types/common/header-addons.d.ts +0 -19
  182. package/lib/types/common/link-blocker.d.ts +0 -7
  183. package/lib/types/common/notification-addon.d.ts +0 -10
  184. package/lib/types/common/overridable-theme-provider.d.ts +0 -15
  185. package/lib/types/common/wallet-hidden-topbar.d.ts +0 -1
  186. package/lib/types/common/ws.d.ts +0 -3
  187. package/lib/types/contexts/config-user-space.d.ts +0 -27
  188. package/lib/types/hooks/use-mobile.d.ts +0 -4
  189. package/lib/types/index.d.ts +0 -10
  190. package/lib/types/libs/client.d.ts +0 -2
  191. package/lib/types/libs/constant.d.ts +0 -1
  192. package/lib/types/libs/spaces.d.ts +0 -2
  193. package/lib/types/libs/with-hide-when-embed.d.ts +0 -4
  194. package/lib/types/types.d.ts +0 -36
  195. package/lib/types/utils.d.ts +0 -10
@@ -0,0 +1,88 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ declare function g(t: any): Promise<any[]>;
2
+ declare function l(t: any): Promise<string>;
3
+ export { g as batchIp2Region, l as ip2Region };
@@ -0,0 +1,18 @@
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): {
9
+ header: never[];
10
+ footer: never[];
11
+ social: never[];
12
+ bottom: never[];
13
+ dashboard: never[];
14
+ sessionManager: never[];
15
+ userCenter: never[];
16
+ } | 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 };
@@ -0,0 +1,12 @@
1
+ import { default as f } from 'prop-types';
2
+ export { P as default };
3
+ declare function P({ locale: i, session: s }: {
4
+ locale?: string | undefined;
5
+ session?: {} | undefined;
6
+ }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
7
+ declare namespace P {
8
+ namespace propTypes {
9
+ let locale: f.Requireable<string>;
10
+ let session: f.Requireable<object>;
11
+ }
12
+ }
@@ -0,0 +1,19 @@
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 }: {
5
+ formattedBlocklet: any;
6
+ addons?: null | undefined;
7
+ showDomainWarningDialog?: boolean | undefined;
8
+ sessionManagerProps?: {
9
+ showRole: boolean;
10
+ } | undefined;
11
+ }): import('react').FunctionComponentElement<import('react').FragmentProps>;
12
+ declare namespace O {
13
+ 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>;
18
+ }
19
+ }
@@ -0,0 +1,4 @@
1
+ export { s as default };
2
+ declare function s({ ...n }: {
3
+ [x: string]: any;
4
+ }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
@@ -0,0 +1,10 @@
1
+ import { default as R } from 'prop-types';
2
+ export { P as default };
3
+ declare function P({ session: r }: {
4
+ session?: {} | undefined;
5
+ }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
6
+ declare namespace P {
7
+ namespace propTypes {
8
+ let session: R.Requireable<object>;
9
+ }
10
+ }
@@ -0,0 +1,12 @@
1
+ import { default as r } from 'prop-types';
2
+ export { h as default };
3
+ declare function h({ theme: e, children: t }: {
4
+ theme?: null | undefined;
5
+ children: any;
6
+ }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
7
+ declare namespace h {
8
+ namespace propTypes {
9
+ let children: r.Validator<any>;
10
+ let theme: r.Requireable<object>;
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ export { s as useWalletHiddenTopbar };
2
+ declare function s(): void;
@@ -0,0 +1,4 @@
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 };
@@ -0,0 +1,7 @@
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 };
@@ -0,0 +1,4 @@
1
+ export { u as default };
2
+ declare function u({ key: e }?: {
3
+ key?: string | undefined;
4
+ }): boolean;
package/lib/index.d.ts ADDED
@@ -0,0 +1,12 @@
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 };
@@ -0,0 +1,3 @@
1
+ import { BlockletSDK as o } from '@blocklet/js-sdk';
2
+ export { e as client };
3
+ declare const e: o;
@@ -0,0 +1,2 @@
1
+ export { e as EMBED_MODE_KEY };
2
+ declare const e: "blocklet-ui-react-embed-mode";
@@ -0,0 +1,3 @@
1
+ declare function i(r: any): string;
2
+ declare function c(r: any): string;
3
+ export { i as getSpaceHomeUrl, c as getSpaceNftDisplayUrlFromEndpoint };
@@ -0,0 +1,5 @@
1
+ export { p as default };
2
+ declare function p(e: any): {
3
+ (n: any): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
4
+ displayName: string;
5
+ };
package/lib/types.d.ts ADDED
@@ -0,0 +1,37 @@
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>;
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>>;
17
+ }> | null | undefined)[]>;
18
+ }> | null | undefined)[]>;
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>;
36
+ }>>;
37
+ export { n as BlockletMetaProps, t as SessionManagerProps };
package/lib/utils.d.ts ADDED
@@ -0,0 +1,11 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,12 +34,12 @@
34
34
  "dependencies": {
35
35
  "@abtnode/constant": "^1.16.44",
36
36
  "@abtnode/util": "^1.16.44",
37
- "@arcblock/bridge": "3.0.3",
38
- "@arcblock/icons": "3.0.3",
39
- "@arcblock/react-hooks": "3.0.3",
40
- "@arcblock/ws": "^1.20.14",
37
+ "@arcblock/bridge": "3.0.5",
38
+ "@arcblock/icons": "3.0.5",
39
+ "@arcblock/react-hooks": "3.0.5",
40
+ "@arcblock/ws": "^1.20.15",
41
41
  "@blocklet/constant": "^1.16.44",
42
- "@blocklet/did-space-react": "^1.0.62",
42
+ "@blocklet/did-space-react": "^1.0.63",
43
43
  "@iconify-icons/logos": "^1.2.36",
44
44
  "@iconify-icons/material-symbols": "^1.2.58",
45
45
  "@iconify-icons/tabler": "^1.2.95",
@@ -88,5 +88,5 @@
88
88
  "jest": "^29.7.0",
89
89
  "unbuild": "^2.0.0"
90
90
  },
91
- "gitHead": "2eebd00eee1be90587baa3847167f25d92643fa9"
91
+ "gitHead": "1a7bd7691bda12a5d117eb57fe63e8a6486105d6"
92
92
  }
package/vite.config.mjs CHANGED
@@ -12,8 +12,8 @@ export default defineConfig({
12
12
  include: ['**/*.svg', '**/*.svg?react'],
13
13
  }),
14
14
  dts({
15
- outDir: 'lib/types',
16
15
  entryRoot: 'src',
16
+ exclude: ['**/*.stories.*', '**/*.test.*', '**/demo/**'],
17
17
  }),
18
18
  noBundlePlugin({
19
19
  root: 'src',
@@ -1,204 +0,0 @@
1
- import { Axios } from 'axios';
2
- import { UserPublicInfo } from '@blocklet/js-sdk';
3
- import { OAUTH_PROVIDER } from '@arcblock/ux/lib/Util/constant';
4
- import { CloseConnect, OpenConnect } from '@arcblock/did-connect/lib/types';
5
- export type SessionContext = {
6
- session: Session;
7
- api: Axios;
8
- connectApi: {
9
- open: OpenConnect;
10
- close: CloseConnect;
11
- };
12
- };
13
- export type OAuthAccount = {
14
- provider: keyof typeof OAUTH_PROVIDER;
15
- id: string;
16
- did: string;
17
- pk: string;
18
- lastLoginAt: string;
19
- firstLoginAt: string;
20
- order?: number;
21
- userInfo?: {
22
- email: string;
23
- emailVerified: boolean;
24
- name: string;
25
- picture: string;
26
- sub: string;
27
- extraData: Object;
28
- };
29
- };
30
- export type WalletAccount = {
31
- provider: 'wallet';
32
- did: string;
33
- pk: string;
34
- lastLoginAt: string;
35
- firstLoginAt: string;
36
- };
37
- export type NFTAccount = {
38
- provider: 'nft';
39
- did: string;
40
- pk: string;
41
- owner: string;
42
- lastLoginAt: string;
43
- firstLoginAt: string;
44
- };
45
- export type ConnectedAccount = OAuthAccount | WalletAccount | NFTAccount;
46
- export type UserMetadataLink = {
47
- url: string;
48
- favicon?: string;
49
- };
50
- export declare enum DurationEnum {
51
- NoClear = "no_clear",
52
- ThirtyMinutes = "30_minutes",
53
- OneHour = "1_hour",
54
- FourHours = "4_hours",
55
- Today = "today",
56
- ThisWeek = "this_week",
57
- Custom = "custom"
58
- }
59
- export declare enum StatusEnum {
60
- Meeting = "meeting",
61
- Community = "community",
62
- Holiday = "holiday",
63
- OffSick = "off_sick",
64
- WorkingRemotely = "working_remotely"
65
- }
66
- export type UserPhoneProps = {
67
- country: string;
68
- phoneNumber?: string;
69
- };
70
- export type UserMetadata = {
71
- bio?: string;
72
- location?: string;
73
- timezone?: string;
74
- joinedAt?: string;
75
- status?: {
76
- value: string;
77
- duration?: DurationEnum;
78
- dateRange?: Date[];
79
- };
80
- links?: UserMetadataLink[];
81
- cover?: string;
82
- email?: string;
83
- phone?: UserPhoneProps;
84
- };
85
- export type UserAddress = {
86
- country?: string;
87
- province?: string;
88
- city?: string;
89
- line1?: string;
90
- line2?: string;
91
- postalCode?: string;
92
- };
93
- export type User = UserPublicInfo & {
94
- role: string;
95
- email?: string;
96
- phone?: string;
97
- sourceProvider?: string;
98
- sourceAppPid?: string;
99
- lastLoginAt?: string;
100
- lastLoginIp?: string;
101
- createdAt?: string;
102
- passports?: any[];
103
- didSpace?: Record<string, any>;
104
- connectedAccounts?: any[];
105
- locale?: string;
106
- url: string;
107
- inviter?: string;
108
- emailVerified?: boolean;
109
- phoneVerified?: boolean;
110
- metadata?: UserMetadata;
111
- address?: UserAddress;
112
- };
113
- export type UserCenterTab = {
114
- value: string;
115
- label: string;
116
- url: string;
117
- protected: boolean;
118
- icon?: string;
119
- isPrivate?: boolean;
120
- };
121
- export type Session = {
122
- loading: boolean;
123
- initialized: boolean;
124
- user?: User;
125
- login: any;
126
- logout: any;
127
- switch: any;
128
- switchDid: any;
129
- refreshProfile: () => Promise<void>;
130
- switchProfile: any;
131
- switchPassport: any;
132
- refresh: Function;
133
- useOAuth: Function;
134
- usePasskey: Function;
135
- };
136
- export type WebhookType = 'slack' | 'api';
137
- export type WebhookItemData = {
138
- type: WebhookType;
139
- url: string;
140
- };
141
- export type WebhookItemProps = {
142
- onTest: (params: WebhookItemData) => void;
143
- onSave: (params: WebhookItemData) => void;
144
- onDelete?: (params: WebhookItemData) => void;
145
- onCancel?: () => void;
146
- edit: boolean;
147
- type?: WebhookType;
148
- url?: string;
149
- };
150
- export type CreatePassportProps = {
151
- issuer: string;
152
- title: string;
153
- issuerDid: string;
154
- issuerAvatarUrl: string;
155
- ownerDid: string;
156
- ownerName?: string;
157
- ownerAvatarUrl: string;
158
- preferredColor?: string;
159
- revoked?: boolean;
160
- isDataUrl?: boolean;
161
- width?: string;
162
- height?: string;
163
- scope?: string;
164
- role?: string;
165
- display?: {
166
- type: string;
167
- content: string;
168
- };
169
- };
170
- export type BlockletMetaProps = {
171
- appLogo?: React.ReactNode;
172
- appName?: string;
173
- theme?: {
174
- background?: string;
175
- };
176
- enableConnect?: boolean;
177
- enableLocale?: boolean;
178
- navigation?: Array<{
179
- title?: string | object;
180
- link?: string | object;
181
- icon?: string;
182
- items?: Array<{
183
- title?: string | object;
184
- link?: string | object;
185
- }>;
186
- }>;
187
- };
188
- export type SessionManagerProps = {
189
- showText?: boolean;
190
- showRole?: boolean;
191
- switchDid?: boolean;
192
- switchProfile?: boolean;
193
- switchPassport?: boolean;
194
- disableLogout?: boolean;
195
- onLogin?: () => void;
196
- onLogout?: () => void;
197
- onSwitchDid?: () => void;
198
- onSwitchProfile?: () => void;
199
- onSwitchPassport?: () => void;
200
- menu?: any[];
201
- menuRender?: () => void;
202
- dark?: boolean;
203
- size?: number;
204
- };
@@ -1,27 +0,0 @@
1
- interface BlockletStudioProps {
2
- open: boolean;
3
- setOpen: (open: boolean) => void;
4
- onOpened?: () => void;
5
- componentDid: string;
6
- tenantScope?: string;
7
- resourcesParams?: Record<string, any>;
8
- mode?: string;
9
- title?: string;
10
- logo?: string;
11
- description?: string;
12
- introduction?: string;
13
- note?: string;
14
- onUploaded?: (data: unknown) => void;
15
- onReleased?: (data: unknown) => void;
16
- onConnected?: (data: unknown) => void;
17
- components?: Record<string, unknown>[];
18
- resources?: Record<string, unknown>;
19
- componentsTitle?: string;
20
- resourcesTitle?: string;
21
- style?: React.CSSProperties;
22
- zIndex?: number;
23
- dependentComponentsMode?: 'auto' | 'readonly';
24
- [key: string]: any;
25
- }
26
- declare function BlockletStudio({ open, setOpen, onOpened, componentDid, tenantScope, resourcesParams, mode, title, logo, description, introduction, note, componentsTitle, resourcesTitle, onUploaded, onReleased, onConnected, components, resources, style, zIndex, dependentComponentsMode, ...rest }: BlockletStudioProps): import("react/jsx-runtime").JSX.Element | null;
27
- export default BlockletStudio;
@@ -1,9 +0,0 @@
1
- import { default as Basic } from './demo/basic';
2
- declare namespace _default {
3
- let title: string;
4
- namespace parameters {
5
- let layout: string;
6
- }
7
- }
8
- export default _default;
9
- export { Basic };
@@ -1,29 +0,0 @@
1
- import { default as PropTypes } from 'prop-types';
2
- import { default as noop } from 'lodash/noop';
3
- declare function Demo({ userRole }: {
4
- userRole: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- declare namespace Demo {
7
- namespace propTypes {
8
- let userRole: PropTypes.Validator<string>;
9
- }
10
- }
11
- export default Demo;
12
- export namespace mockSession {
13
- export { noop as login };
14
- export { noop as logout };
15
- export { noop as switch };
16
- export { noop as switchDid };
17
- export { noop as switchProfile };
18
- export { noop as switchPassport };
19
- export function useDid(): {
20
- walletDid: string;
21
- };
22
- export function useOAuth(): {
23
- logoutOAuth: (...args: any[]) => void;
24
- bindOAuth: (...args: any[]) => void;
25
- configs: {};
26
- switchOAuthPassport: (...args: any[]) => void;
27
- };
28
- export function getUserSessions(): never[];
29
- }
@@ -1,2 +0,0 @@
1
- export default mockOptionalComponents;
2
- declare function mockOptionalComponents(): void;
@@ -1,18 +0,0 @@
1
- import { default as PropTypes } from 'prop-types';
2
- declare function WrapComponentInstaller(props: any): any;
3
- declare namespace WrapComponentInstaller {
4
- namespace propTypes {
5
- let children: PropTypes.Validator<any>;
6
- let disabled: PropTypes.Requireable<boolean>;
7
- let warnIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
- let did: PropTypes.Validator<NonNullable<NonNullable<string | (string | null | undefined)[] | null | undefined>>>;
9
- let noPermissionMute: PropTypes.Requireable<boolean>;
10
- let onInstalled: PropTypes.Requireable<(...args: any[]) => any>;
11
- let onError: PropTypes.Requireable<(...args: any[]) => any>;
12
- let closeByOutSize: PropTypes.Requireable<boolean>;
13
- let onClose: PropTypes.Requireable<(...args: any[]) => any>;
14
- let fallback: PropTypes.Requireable<PropTypes.ReactNodeLike>;
15
- let roles: PropTypes.Requireable<any[]>;
16
- }
17
- }
18
- export default WrapComponentInstaller;
@@ -1,18 +0,0 @@
1
- import { default as PropTypes } from 'prop-types';
2
- declare function InstallerItem({ optionalComponent, index, installStatus, hasPermission, t }: {
3
- optionalComponent: any;
4
- index: any;
5
- installStatus?: string | undefined;
6
- hasPermission: any;
7
- t: any;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- declare namespace InstallerItem {
10
- namespace propTypes {
11
- let t: PropTypes.Validator<(...args: any[]) => any>;
12
- let optionalComponent: PropTypes.Validator<object>;
13
- let index: PropTypes.Validator<number>;
14
- let installStatus: PropTypes.Requireable<string>;
15
- let hasPermission: PropTypes.Validator<boolean>;
16
- }
17
- }
18
- export default InstallerItem;
@@ -1,16 +0,0 @@
1
- import { ReactElement } from 'react';
2
- export default function AddComponent({ componentDid, resourceType, resourceDid, grantedRoles, autoClose, selectedMeta, storeUrl, onComplete, onClose, render, }: {
3
- componentDid: string;
4
- resourceType?: string;
5
- resourceDid?: string;
6
- autoClose: boolean;
7
- selectedMeta?: any;
8
- storeUrl?: string;
9
- grantedRoles?: string[];
10
- onComplete: () => void;
11
- onClose: () => void;
12
- render?: ({ onClick, loading }: {
13
- onClick: () => void;
14
- loading: boolean;
15
- }) => ReactElement<any>;
16
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as CheckComponent } from '../../ComponentInstaller';
2
- export default CheckComponent;