@blocklet/ui-react 2.13.70 → 3.0.1

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 (381) hide show
  1. package/lib/@types/index.js +5 -18
  2. package/lib/BlockletStudio/index.js +75 -89
  3. package/lib/ComponentInstaller/index.js +153 -190
  4. package/lib/ComponentInstaller/installer-item.js +56 -55
  5. package/lib/ComponentInstaller/locales.js +19 -18
  6. package/lib/ComponentInstaller/use-component-installed.js +49 -80
  7. package/lib/ComponentManager/components/add-component.js +68 -89
  8. package/lib/ComponentManager/components/check-component.js +4 -2
  9. package/lib/ComponentManager/components/publish-component.js +48 -57
  10. package/lib/ComponentManager/components/resource-dialog.js +41 -55
  11. package/lib/ComponentManager/index.js +8 -3
  12. package/lib/ComponentManager/libs/locales.js +8 -5
  13. package/lib/Dashboard/index.js +88 -124
  14. package/lib/Footer/brand.js +25 -28
  15. package/lib/Footer/copyright.js +15 -16
  16. package/lib/Footer/index.js +55 -65
  17. package/lib/Footer/internal-footer.js +93 -95
  18. package/lib/Footer/layout/plain.js +26 -24
  19. package/lib/Footer/layout/row.js +16 -20
  20. package/lib/Footer/layout/standard.js +73 -59
  21. package/lib/Footer/links.js +100 -120
  22. package/lib/Footer/social-media.js +28 -33
  23. package/lib/Header/index.js +108 -130
  24. package/lib/Icon/index.js +43 -59
  25. package/lib/Notifications/Snackbar.js +114 -151
  26. package/lib/Notifications/hooks/use-title.js +85 -126
  27. package/lib/Notifications/hooks/use-width.js +10 -9
  28. package/lib/Notifications/utils.js +74 -114
  29. package/lib/UserCenter/components/config-inviter.js +21 -31
  30. package/lib/UserCenter/components/config-profile.js +41 -47
  31. package/lib/UserCenter/components/danger-zone.js +88 -93
  32. package/lib/UserCenter/components/editable-field.js +149 -167
  33. package/lib/UserCenter/components/nft.js +91 -81
  34. package/lib/UserCenter/components/notification.js +206 -195
  35. package/lib/UserCenter/components/passport.js +37 -53
  36. package/lib/UserCenter/components/privacy.js +53 -64
  37. package/lib/UserCenter/components/settings.js +117 -128
  38. package/lib/UserCenter/components/status-dialog/date-picker.js +35 -36
  39. package/lib/UserCenter/components/status-dialog/index.js +132 -144
  40. package/lib/UserCenter/components/status-selector/duration-menu.js +53 -48
  41. package/lib/UserCenter/components/status-selector/index.js +37 -36
  42. package/lib/UserCenter/components/status-selector/menu-item.js +13 -9
  43. package/lib/UserCenter/components/storage/action.js +27 -25
  44. package/lib/UserCenter/components/storage/connected.js +59 -30
  45. package/lib/UserCenter/components/storage/delete.js +32 -39
  46. package/lib/UserCenter/components/storage/disconnect.js +43 -25
  47. package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.js +7 -0
  48. package/lib/UserCenter/components/storage/index.js +24 -18
  49. package/lib/UserCenter/components/storage/preview-nft.js +35 -36
  50. package/lib/UserCenter/components/third-party-login/index.js +73 -143
  51. package/lib/UserCenter/components/third-party-login/third-party-item.js +132 -153
  52. package/lib/UserCenter/components/user-center.js +345 -461
  53. package/lib/UserCenter/components/user-info/address.js +120 -100
  54. package/lib/UserCenter/components/user-info/index.js +10 -4
  55. package/lib/UserCenter/components/user-info/link-preview-input.js +148 -159
  56. package/lib/UserCenter/components/user-info/metadata.js +290 -385
  57. package/lib/UserCenter/components/user-info/switch-role.js +24 -18
  58. package/lib/UserCenter/components/user-info/timezone-select.js +37 -45
  59. package/lib/UserCenter/components/user-info/user-basic-info.js +213 -207
  60. package/lib/UserCenter/components/user-info/user-info-item.js +39 -26
  61. package/lib/UserCenter/components/user-info/user-info.js +52 -67
  62. package/lib/UserCenter/components/user-info/user-status.js +111 -154
  63. package/lib/UserCenter/components/user-info/utils.js +96 -93
  64. package/lib/UserCenter/components/webhook-item.js +95 -143
  65. package/lib/UserCenter/index.js +4 -1
  66. package/lib/UserCenter/libs/locales.js +132 -129
  67. package/lib/UserCenter/libs/utils.js +17 -22
  68. package/lib/UserSessions/components/user-session-info.js +30 -26
  69. package/lib/UserSessions/components/user-sessions.js +222 -268
  70. package/lib/UserSessions/index.js +4 -1
  71. package/lib/UserSessions/libs/locales.js +31 -28
  72. package/lib/UserSessions/libs/utils.js +30 -56
  73. package/lib/blocklets.js +75 -156
  74. package/lib/common/domain-warning.js +64 -104
  75. package/lib/common/header-addons.js +59 -80
  76. package/lib/common/link-blocker.js +10 -16
  77. package/lib/common/notification-addon.js +56 -89
  78. package/lib/common/overridable-theme-provider.js +12 -12
  79. package/lib/common/wallet-hidden-topbar.js +11 -13
  80. package/lib/common/ws.js +23 -34
  81. package/lib/contexts/config-user-space.js +34 -43
  82. package/lib/hooks/use-mobile.js +7 -4
  83. package/lib/index.js +25 -10
  84. package/lib/libs/client.js +5 -2
  85. package/lib/libs/constant.js +4 -1
  86. package/lib/libs/spaces.js +11 -11
  87. package/lib/libs/with-hide-when-embed.js +13 -15
  88. package/lib/packages/blocklet-ui-react/build.config.d.ts +2 -0
  89. package/lib/packages/blocklet-ui-react/jest.config.d.ts +8 -0
  90. package/lib/packages/blocklet-ui-react/lib/@types/index.d.ts +3 -0
  91. package/lib/packages/blocklet-ui-react/lib/BlockletStudio/index.d.ts +26 -0
  92. package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/index.d.ts +18 -0
  93. package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/installer-item.d.ts +18 -0
  94. package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/locales.d.ts +28 -0
  95. package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/use-component-installed.d.ts +12 -0
  96. package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/add-component.d.ts +13 -0
  97. package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/check-component.d.ts +2 -0
  98. package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/publish-component.d.ts +7 -0
  99. package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/resource-dialog.d.ts +11 -0
  100. package/lib/packages/blocklet-ui-react/lib/ComponentManager/index.d.ts +4 -0
  101. package/lib/packages/blocklet-ui-react/lib/ComponentManager/libs/locales.d.ts +19 -0
  102. package/lib/packages/blocklet-ui-react/lib/Dashboard/index.d.ts +27 -0
  103. package/lib/packages/blocklet-ui-react/lib/Footer/brand.d.ts +15 -0
  104. package/lib/packages/blocklet-ui-react/lib/Footer/copyright.d.ts +13 -0
  105. package/lib/packages/blocklet-ui-react/lib/Footer/index.d.ts +2 -0
  106. package/lib/packages/blocklet-ui-react/lib/Footer/internal-footer.d.ts +29 -0
  107. package/lib/packages/blocklet-ui-react/lib/Footer/layout/plain.d.ts +19 -0
  108. package/lib/packages/blocklet-ui-react/lib/Footer/layout/row.d.ts +13 -0
  109. package/lib/packages/blocklet-ui-react/lib/Footer/layout/standard.d.ts +21 -0
  110. package/lib/packages/blocklet-ui-react/lib/Footer/links.d.ts +20 -0
  111. package/lib/packages/blocklet-ui-react/lib/Footer/social-media.d.ts +14 -0
  112. package/lib/packages/blocklet-ui-react/lib/Header/index.d.ts +2 -0
  113. package/lib/packages/blocklet-ui-react/lib/Icon/index.d.ts +7 -0
  114. package/lib/packages/blocklet-ui-react/lib/Notifications/Snackbar.d.ts +8 -0
  115. package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-title.d.ts +9 -0
  116. package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-width.d.ts +2 -0
  117. package/lib/packages/blocklet-ui-react/lib/Notifications/utils.d.ts +10 -0
  118. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-inviter.d.ts +4 -0
  119. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-profile.d.ts +5 -0
  120. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/danger-zone.d.ts +2 -0
  121. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/editable-field.d.ts +50 -0
  122. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/nft.d.ts +4 -0
  123. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/notification.d.ts +5 -0
  124. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/passport.d.ts +5 -0
  125. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/privacy.d.ts +5 -0
  126. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/settings.d.ts +8 -0
  127. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/date-picker.d.ts +9 -0
  128. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/index.d.ts +9 -0
  129. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
  130. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/index.d.ts +8 -0
  131. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/menu-item.d.ts +9 -0
  132. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/action.d.ts +7 -0
  133. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/connected.d.ts +4 -0
  134. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/delete.d.ts +5 -0
  135. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/disconnect.d.ts +2 -0
  136. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +3 -0
  137. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/index.d.ts +2 -0
  138. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/preview-nft.d.ts +5 -0
  139. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/index.d.ts +4 -0
  140. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/third-party-item.d.ts +4 -0
  141. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-center.d.ts +15 -0
  142. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/address.d.ts +7 -0
  143. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/index.d.ts +5 -0
  144. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/link-preview-input.d.ts +6 -0
  145. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/metadata.d.ts +7 -0
  146. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/switch-role.d.ts +6 -0
  147. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/timezone-select.d.ts +7 -0
  148. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-basic-info.d.ts +12 -0
  149. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info-item.d.ts +6 -0
  150. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info.d.ts +6 -0
  151. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-status.d.ts +9 -0
  152. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/utils.d.ts +33 -0
  153. package/lib/packages/blocklet-ui-react/lib/UserCenter/components/webhook-item.d.ts +10 -0
  154. package/lib/packages/blocklet-ui-react/lib/UserCenter/index.d.ts +2 -0
  155. package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/locales.d.ts +513 -0
  156. package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/utils.d.ts +3 -0
  157. package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-session-info.d.ts +5 -0
  158. package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-sessions.d.ts +8 -0
  159. package/lib/packages/blocklet-ui-react/lib/UserSessions/index.d.ts +2 -0
  160. package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/locales.d.ts +88 -0
  161. package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/utils.d.ts +3 -0
  162. package/lib/packages/blocklet-ui-react/lib/blocklets.d.ts +18 -0
  163. package/lib/packages/blocklet-ui-react/lib/common/domain-warning.d.ts +12 -0
  164. package/lib/packages/blocklet-ui-react/lib/common/header-addons.d.ts +19 -0
  165. package/lib/packages/blocklet-ui-react/lib/common/link-blocker.d.ts +4 -0
  166. package/lib/packages/blocklet-ui-react/lib/common/notification-addon.d.ts +10 -0
  167. package/lib/packages/blocklet-ui-react/lib/common/overridable-theme-provider.d.ts +12 -0
  168. package/lib/packages/blocklet-ui-react/lib/common/wallet-hidden-topbar.d.ts +2 -0
  169. package/lib/packages/blocklet-ui-react/lib/common/ws.d.ts +4 -0
  170. package/lib/packages/blocklet-ui-react/lib/contexts/config-user-space.d.ts +7 -0
  171. package/lib/packages/blocklet-ui-react/lib/hooks/use-mobile.d.ts +4 -0
  172. package/lib/packages/blocklet-ui-react/lib/index.d.ts +12 -0
  173. package/lib/packages/blocklet-ui-react/lib/libs/client.d.ts +3 -0
  174. package/lib/packages/blocklet-ui-react/lib/libs/constant.d.ts +2 -0
  175. package/lib/packages/blocklet-ui-react/lib/libs/spaces.d.ts +3 -0
  176. package/lib/packages/blocklet-ui-react/lib/libs/with-hide-when-embed.d.ts +5 -0
  177. package/lib/packages/blocklet-ui-react/lib/types.d.ts +37 -0
  178. package/lib/packages/blocklet-ui-react/lib/utils.d.ts +11 -0
  179. package/lib/{@types → packages/blocklet-ui-react/src/@types}/index.d.ts +3 -3
  180. package/lib/{BlockletStudio → packages/blocklet-ui-react/src/BlockletStudio}/index.d.ts +1 -1
  181. package/lib/packages/blocklet-ui-react/src/ComponentInstaller/ComponentInstaller.stories.d.ts +9 -0
  182. package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/basic.d.ts +29 -0
  183. package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/mock-optional-components.d.ts +2 -0
  184. package/lib/packages/blocklet-ui-react/src/ComponentInstaller/index.d.ts +18 -0
  185. package/lib/packages/blocklet-ui-react/src/ComponentInstaller/installer-item.d.ts +18 -0
  186. package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/use-component-installed.d.ts +1 -1
  187. package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/add-component.d.ts +2 -2
  188. package/lib/packages/blocklet-ui-react/src/ComponentManager/components/check-component.d.ts +2 -0
  189. package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/publish-component.d.ts +2 -2
  190. package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/resource-dialog.d.ts +2 -2
  191. package/lib/packages/blocklet-ui-react/src/Dashboard/Dashboard.stories.d.ts +13 -0
  192. package/lib/packages/blocklet-ui-react/src/Dashboard/demo/basic.d.ts +29 -0
  193. package/lib/packages/blocklet-ui-react/src/Dashboard/index.d.ts +30 -0
  194. package/lib/packages/blocklet-ui-react/src/Footer/Footer.stories.d.ts +19 -0
  195. package/lib/packages/blocklet-ui-react/src/Footer/brand.d.ts +15 -0
  196. package/lib/packages/blocklet-ui-react/src/Footer/copyright.d.ts +13 -0
  197. package/lib/packages/blocklet-ui-react/src/Footer/demo/arcblock-site.d.ts +31 -0
  198. package/lib/packages/blocklet-ui-react/src/Footer/demo/brand.d.ts +1 -0
  199. package/lib/packages/blocklet-ui-react/src/Footer/demo/copyright.d.ts +1 -0
  200. package/lib/packages/blocklet-ui-react/src/Footer/demo/footer.d.ts +10 -0
  201. package/lib/packages/blocklet-ui-react/src/Footer/demo/links.d.ts +1 -0
  202. package/lib/packages/blocklet-ui-react/src/Footer/demo/social-media-icons.d.ts +1 -0
  203. package/lib/packages/blocklet-ui-react/src/Footer/index.d.ts +6 -0
  204. package/lib/packages/blocklet-ui-react/src/Footer/internal-footer.d.ts +32 -0
  205. package/lib/packages/blocklet-ui-react/src/Footer/layout/plain.d.ts +22 -0
  206. package/lib/packages/blocklet-ui-react/src/Footer/layout/row.d.ts +13 -0
  207. package/lib/packages/blocklet-ui-react/src/Footer/layout/standard.d.ts +24 -0
  208. package/lib/packages/blocklet-ui-react/src/Footer/links.d.ts +23 -0
  209. package/lib/packages/blocklet-ui-react/src/Footer/social-media.d.ts +14 -0
  210. package/lib/packages/blocklet-ui-react/src/Header/Header.stories.d.ts +26 -0
  211. package/lib/packages/blocklet-ui-react/src/Header/demo/addons-customization.d.ts +11 -0
  212. package/lib/packages/blocklet-ui-react/src/Header/demo/basic.d.ts +1 -0
  213. package/lib/packages/blocklet-ui-react/src/Header/demo/fixtures/index.d.ts +49 -0
  214. package/lib/packages/blocklet-ui-react/src/Header/demo/with-enable-connect-enable-locale.d.ts +1 -0
  215. package/lib/{Header → packages/blocklet-ui-react/src/Header}/index.d.ts +3 -2
  216. package/lib/packages/blocklet-ui-react/src/Icon/Icon.stories.d.ts +12 -0
  217. package/lib/packages/blocklet-ui-react/src/Icon/demo/basic.d.ts +1 -0
  218. package/lib/{Icon → packages/blocklet-ui-react/src/Icon}/index.d.ts +2 -3
  219. package/lib/packages/blocklet-ui-react/src/Notifications/Snackbar.d.ts +16 -0
  220. package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-title.d.ts +1 -1
  221. package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/utils.d.ts +2 -2
  222. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-inviter.d.ts +1 -1
  223. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-profile.d.ts +1 -1
  224. package/lib/packages/blocklet-ui-react/src/UserCenter/components/danger-zone.d.ts +1 -0
  225. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/editable-field.d.ts +3 -3
  226. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/nft.d.ts +1 -1
  227. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/notification.d.ts +1 -1
  228. package/lib/packages/blocklet-ui-react/src/UserCenter/components/passport.d.ts +5 -0
  229. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/privacy.d.ts +1 -1
  230. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/settings.d.ts +2 -2
  231. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/date-picker.d.ts +1 -1
  232. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/index.d.ts +1 -1
  233. package/lib/packages/blocklet-ui-react/src/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
  234. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/index.d.ts +1 -1
  235. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/menu-item.d.ts +4 -4
  236. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/action.d.ts +1 -1
  237. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/connected.d.ts +1 -1
  238. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/delete.d.ts +1 -1
  239. package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/disconnect.d.ts +2 -0
  240. package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/index.d.ts +2 -0
  241. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/preview-nft.d.ts +1 -1
  242. package/lib/packages/blocklet-ui-react/src/UserCenter/components/third-party-login/index.d.ts +4 -0
  243. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/third-party-login/third-party-item.d.ts +2 -2
  244. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-center.d.ts +2 -2
  245. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/address.d.ts +2 -2
  246. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/link-preview-input.d.ts +1 -1
  247. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/metadata.d.ts +2 -2
  248. package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/switch-role.d.ts +7 -0
  249. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/timezone-select.d.ts +1 -1
  250. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-basic-info.d.ts +3 -3
  251. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-info-item.d.ts +1 -1
  252. package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/user-info.d.ts +6 -0
  253. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-status.d.ts +2 -2
  254. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/utils.d.ts +8 -5
  255. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/webhook-item.d.ts +1 -1
  256. package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/utils.d.ts +1 -1
  257. package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-session-info.d.ts +1 -1
  258. package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-sessions.d.ts +1 -1
  259. package/lib/packages/blocklet-ui-react/src/common/domain-warning.d.ts +12 -0
  260. package/lib/packages/blocklet-ui-react/src/common/header-addons.d.ts +19 -0
  261. package/lib/{common → packages/blocklet-ui-react/src/common}/link-blocker.d.ts +1 -1
  262. package/lib/{common → packages/blocklet-ui-react/src/common}/notification-addon.d.ts +3 -6
  263. package/lib/{common → packages/blocklet-ui-react/src/common}/overridable-theme-provider.d.ts +5 -8
  264. package/lib/{contexts → packages/blocklet-ui-react/src/contexts}/config-user-space.d.ts +3 -3
  265. package/lib/{libs → packages/blocklet-ui-react/src/libs}/with-hide-when-embed.d.ts +1 -1
  266. package/lib/packages/blocklet-ui-react/src/types.d.ts +36 -0
  267. package/lib/packages/blocklet-ui-react/tools/auto-exports.d.ts +1 -0
  268. package/lib/packages/blocklet-ui-react/tools/jest.d.ts +1 -0
  269. package/lib/packages/blocklet-ui-react/vite.config.d.mts +2 -0
  270. package/lib/types.js +39 -39
  271. package/lib/utils.js +61 -175
  272. package/package.json +28 -34
  273. package/src/ComponentInstaller/ComponentInstaller.stories.jsx +16 -0
  274. package/src/ComponentInstaller/index.jsx +11 -27
  275. package/src/ComponentInstaller/installer-item.jsx +1 -5
  276. package/src/ComponentManager/components/add-component.tsx +3 -3
  277. package/src/ComponentManager/components/publish-component.tsx +3 -3
  278. package/src/Dashboard/Dashboard.stories.jsx +20 -0
  279. package/src/Dashboard/index.jsx +16 -27
  280. package/src/Footer/Footer.stories.jsx +32 -0
  281. package/src/Footer/brand.jsx +1 -7
  282. package/src/Footer/copyright.jsx +1 -6
  283. package/src/Footer/index.jsx +1 -6
  284. package/src/Footer/internal-footer.jsx +26 -16
  285. package/src/Footer/layout/row.jsx +2 -7
  286. package/src/Footer/layout/standard.jsx +12 -2
  287. package/src/Footer/links.jsx +2 -7
  288. package/src/Footer/social-media.jsx +1 -5
  289. package/src/Header/Header.stories.jsx +30 -0
  290. package/src/Header/index.tsx +1 -1
  291. package/src/Icon/Icon.stories.jsx +12 -0
  292. package/src/Notifications/Snackbar.tsx +119 -126
  293. package/src/Notifications/hooks/use-title.tsx +5 -2
  294. package/src/Notifications/hooks/use-width.tsx +1 -1
  295. package/src/UserCenter/components/config-profile.tsx +0 -1
  296. package/src/UserCenter/components/danger-zone.tsx +7 -3
  297. package/src/UserCenter/components/editable-field.tsx +45 -44
  298. package/src/UserCenter/components/nft.tsx +21 -9
  299. package/src/UserCenter/components/notification.tsx +22 -6
  300. package/src/UserCenter/components/privacy.tsx +1 -1
  301. package/src/UserCenter/components/settings.tsx +6 -1
  302. package/src/UserCenter/components/status-dialog/date-picker.tsx +10 -7
  303. package/src/UserCenter/components/status-dialog/index.tsx +11 -4
  304. package/src/UserCenter/components/status-selector/duration-menu.tsx +7 -2
  305. package/src/UserCenter/components/status-selector/index.tsx +7 -1
  306. package/src/UserCenter/components/status-selector/menu-item.tsx +1 -2
  307. package/src/UserCenter/components/storage/action.tsx +1 -2
  308. package/src/UserCenter/components/storage/connected.tsx +18 -5
  309. package/src/UserCenter/components/storage/delete.tsx +1 -1
  310. package/src/UserCenter/components/storage/disconnect.tsx +10 -2
  311. package/src/UserCenter/components/storage/index.tsx +6 -1
  312. package/src/UserCenter/components/storage/preview-nft.tsx +1 -1
  313. package/src/UserCenter/components/third-party-login/index.tsx +2 -2
  314. package/src/UserCenter/components/third-party-login/third-party-item.tsx +11 -7
  315. package/src/UserCenter/components/user-center.tsx +10 -5
  316. package/src/UserCenter/components/user-info/address.tsx +12 -6
  317. package/src/UserCenter/components/user-info/link-preview-input.tsx +36 -51
  318. package/src/UserCenter/components/user-info/metadata.tsx +45 -39
  319. package/src/UserCenter/components/user-info/timezone-select.tsx +2 -5
  320. package/src/UserCenter/components/user-info/user-basic-info.tsx +24 -8
  321. package/src/UserCenter/components/user-info/user-info-item.tsx +7 -2
  322. package/src/UserCenter/components/user-info/user-status.tsx +7 -9
  323. package/src/UserCenter/components/user-info/utils.ts +77 -11
  324. package/src/UserCenter/components/webhook-item.tsx +4 -2
  325. package/src/UserSessions/components/user-sessions.tsx +1 -1
  326. package/src/common/domain-warning.jsx +2 -14
  327. package/src/common/header-addons.jsx +8 -11
  328. package/src/common/notification-addon.jsx +1 -7
  329. package/src/common/overridable-theme-provider.jsx +1 -5
  330. package/src/common/ws.js +2 -2
  331. package/src/contexts/config-user-space.tsx +3 -3
  332. package/vite.config.mjs +31 -0
  333. package/lib/@types/shims.d.ts +0 -18
  334. package/lib/ComponentInstaller/index.d.ts +0 -37
  335. package/lib/ComponentInstaller/installer-item.d.ts +0 -21
  336. package/lib/ComponentManager/components/check-component.d.ts +0 -2
  337. package/lib/Dashboard/index.d.ts +0 -44
  338. package/lib/Footer/brand.d.ts +0 -22
  339. package/lib/Footer/copyright.d.ts +0 -18
  340. package/lib/Footer/index.d.ts +0 -6
  341. package/lib/Footer/internal-footer.d.ts +0 -29
  342. package/lib/Footer/layout/plain.d.ts +0 -15
  343. package/lib/Footer/layout/row.d.ts +0 -18
  344. package/lib/Footer/layout/standard.d.ts +0 -17
  345. package/lib/Footer/links.d.ts +0 -23
  346. package/lib/Footer/social-media.d.ts +0 -14
  347. package/lib/Notifications/Snackbar.d.ts +0 -14
  348. package/lib/UserCenter/components/danger-zone.d.ts +0 -1
  349. package/lib/UserCenter/components/passport.d.ts +0 -5
  350. package/lib/UserCenter/components/status-selector/duration-menu.d.ts +0 -7
  351. package/lib/UserCenter/components/storage/disconnect.d.ts +0 -2
  352. package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
  353. package/lib/UserCenter/components/storage/icons/long-arrow.svg +0 -5
  354. package/lib/UserCenter/components/storage/icons/space-connected.svg +0 -3
  355. package/lib/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
  356. package/lib/UserCenter/components/storage/index.d.ts +0 -2
  357. package/lib/UserCenter/components/third-party-login/index.d.ts +0 -4
  358. package/lib/UserCenter/components/user-info/switch-role.d.ts +0 -7
  359. package/lib/UserCenter/components/user-info/user-info.d.ts +0 -6
  360. package/lib/common/domain-warning.d.ts +0 -17
  361. package/lib/common/header-addons.d.ts +0 -27
  362. package/lib/types.d.ts +0 -2
  363. /package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/locales.d.ts +0 -0
  364. /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/index.d.ts +0 -0
  365. /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/libs/locales.d.ts +0 -0
  366. /package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-width.d.ts +0 -0
  367. /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/index.d.ts +0 -0
  368. /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/index.d.ts +0 -0
  369. /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/locales.d.ts +0 -0
  370. /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/index.d.ts +0 -0
  371. /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/locales.d.ts +0 -0
  372. /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/utils.d.ts +0 -0
  373. /package/lib/{blocklets.d.ts → packages/blocklet-ui-react/src/blocklets.d.ts} +0 -0
  374. /package/lib/{common → packages/blocklet-ui-react/src/common}/wallet-hidden-topbar.d.ts +0 -0
  375. /package/lib/{common → packages/blocklet-ui-react/src/common}/ws.d.ts +0 -0
  376. /package/lib/{hooks → packages/blocklet-ui-react/src/hooks}/use-mobile.d.ts +0 -0
  377. /package/lib/{index.d.ts → packages/blocklet-ui-react/src/index.d.ts} +0 -0
  378. /package/lib/{libs → packages/blocklet-ui-react/src/libs}/client.d.ts +0 -0
  379. /package/lib/{libs → packages/blocklet-ui-react/src/libs}/constant.d.ts +0 -0
  380. /package/lib/{libs → packages/blocklet-ui-react/src/libs}/spaces.d.ts +0 -0
  381. /package/lib/{utils.d.ts → packages/blocklet-ui-react/src/utils.d.ts} +0 -0
@@ -1,31 +1,17 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState, createElement, Suspense, useMemo } from "react";
3
- import {
4
- Dialog,
5
- DialogTitle,
6
- DialogContent,
7
- DialogActions,
8
- Button,
9
- FormControl,
10
- InputLabel,
11
- Select,
12
- MenuItem,
13
- ListItemIcon,
14
- Box,
15
- Typography,
16
- IconButton
17
- } from "@mui/material";
18
- import dayjs from "dayjs";
19
- import CloseIcon from "@mui/icons-material/Close";
20
- import { translate } from "@arcblock/ux/lib/Locale/util";
21
- import { useMemoizedFn } from "ahooks";
22
- import ArrowDownwardIcon from "@arcblock/icons/lib/ArrowDown";
23
- import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
24
- import { DurationEnum } from "../../../@types/index.js";
25
- import { translations } from "../../libs/locales.js";
26
- import DateTimeInput from "./date-picker.js";
27
- import { defaultButtonStyle, primaryButtonStyle } from "../user-info/utils.js";
28
- const selectStyle = {
1
+ import { jsxs as n, jsx as r, Fragment as Q } from "react/jsx-runtime";
2
+ import { useState as s, useEffect as V, useMemo as G, Suspense as z, createElement as W } from "react";
3
+ import { Dialog as H, DialogTitle as J, Typography as g, IconButton as K, DialogContent as U, FormControl as w, InputLabel as M, Select as R, MenuItem as T, ListItemIcon as B, Box as v, DialogActions as X, Button as b } from "@mui/material";
4
+ import C from "dayjs";
5
+ import { Close as Y } from "@mui/icons-material";
6
+ import { translate as Z } from "@arcblock/ux/lib/Locale/util";
7
+ import { useMemoizedFn as _ } from "ahooks";
8
+ import A from "@arcblock/icons/lib/ArrowDown";
9
+ import { useLocaleContext as $ } from "@arcblock/ux/lib/Locale/context";
10
+ import { DurationEnum as p } from "../../../@types/index.js";
11
+ import { translations as oo } from "../../libs/locales.js";
12
+ import io from "./date-picker.js";
13
+ import { defaultButtonStyle as E, primaryButtonStyle as ro } from "../user-info/utils.js";
14
+ const O = {
29
15
  padding: "8px 16px",
30
16
  borderRadius: "8px",
31
17
  "&:hover": {
@@ -43,104 +29,116 @@ const selectStyle = {
43
29
  alignItems: "center"
44
30
  }
45
31
  };
46
- export default function StatusDialog({ open, onClose, data, selected, onSelect, timezone }) {
47
- const { locale } = useLocaleContext();
48
- const t = useMemoizedFn((key, _data = {}) => {
49
- return translate(translations, key, locale, "en", _data);
50
- });
51
- const [status, setStatus] = useState(selected?.value || "");
52
- const [duration, setDuration] = useState(selected?.duration || "");
53
- const [customDate, setCustomDate] = useState(selected?.dateRange?.[1] || "");
54
- const [changed, setChanged] = useState(false);
55
- useEffect(() => {
56
- setStatus(selected?.value || "");
57
- setDuration(selected?.duration || "");
58
- setCustomDate(selected?.dateRange?.[1] || "");
59
- }, [selected]);
60
- const isValid = useMemo(() => {
61
- return status && duration;
62
- }, [status, duration]);
63
- const selectedStatus = data.find((item) => item.id === status);
64
- const handleQuickSettingClick = (item) => {
65
- onSelect({
66
- value: item.id,
67
- ...item.duration ? { duration: item.duration } : {}
68
- });
69
- onClose();
70
- };
71
- const handleSubmit = (clean = false) => {
72
- if (clean) {
73
- onSelect(void 0);
74
- } else {
75
- const current = dayjs();
76
- onSelect({
77
- value: status,
78
- ...duration ? { duration } : {},
79
- ...duration === DurationEnum.Custom && customDate ? { dateRange: [current.toDate(), dayjs(customDate).toDate()] } : {}
32
+ function go({ open: j, onClose: u, data: m, selected: i, onSelect: h, timezone: F }) {
33
+ var I, k;
34
+ 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
+ V(() => {
36
+ var o;
37
+ S((i == null ? void 0 : i.value) || ""), y((i == null ? void 0 : i.duration) || ""), x(((o = i == null ? void 0 : i.dateRange) == null ? void 0 : o[1]) || "");
38
+ }, [i]);
39
+ const P = G(() => l && a, [l, a]), f = m.find((o) => o.id === l), q = (o) => {
40
+ h({
41
+ value: o.id,
42
+ ...o.duration ? { duration: o.duration } : {}
43
+ }), u();
44
+ }, D = (o = !1) => {
45
+ if (o)
46
+ h(void 0);
47
+ else {
48
+ const e = C();
49
+ h({
50
+ value: l,
51
+ ...a ? { duration: a } : {},
52
+ ...a === p.Custom && d ? { dateRange: [e.toDate(), C(d).toDate()] } : {}
80
53
  });
81
54
  }
82
- onClose();
55
+ u();
83
56
  };
84
- return /* @__PURE__ */ jsxs(
85
- Dialog,
57
+ return /* @__PURE__ */ n(
58
+ H,
86
59
  {
87
- open,
88
- onClose,
60
+ open: j,
61
+ onClose: u,
89
62
  maxWidth: "xs",
90
- fullWidth: true,
63
+ fullWidth: !0,
91
64
  PaperProps: {
92
65
  sx: {
93
66
  borderRadius: "8px"
94
67
  }
95
68
  },
96
69
  children: [
97
- /* @__PURE__ */ jsxs(DialogTitle, { sx: { borderBottom: "1px solid", borderColor: "divider" }, children: [
98
- /* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { fontSize: "16px !important", mb: 0 }, children: t("profile.setStatus") }),
99
- /* @__PURE__ */ jsx(
100
- IconButton,
70
+ /* @__PURE__ */ n(J, { sx: { borderBottom: "1px solid", borderColor: "divider" }, children: [
71
+ /* @__PURE__ */ r(g, { variant: "body1", sx: { fontSize: "16px !important", mb: 0 }, children: t("profile.setStatus") }),
72
+ /* @__PURE__ */ r(
73
+ K,
101
74
  {
102
75
  "aria-label": "close",
103
- onClick: onClose,
76
+ onClick: u,
104
77
  sx: {
105
78
  position: "absolute",
106
79
  right: 8,
107
80
  top: 8,
108
- color: (theme) => theme.palette.grey[500]
81
+ color: (o) => o.palette.grey[500]
109
82
  },
110
- children: /* @__PURE__ */ jsx(CloseIcon, {})
83
+ children: /* @__PURE__ */ r(Y, {})
111
84
  }
112
85
  )
113
86
  ] }),
114
- /* @__PURE__ */ jsxs(DialogContent, { children: [
115
- /* @__PURE__ */ jsxs(FormControl, { fullWidth: true, sx: { mt: 2 }, children: [
116
- /* @__PURE__ */ jsx(InputLabel, { size: "small", sx: { fontSize: "14px" }, children: t("profile.setStatus") }),
117
- /* @__PURE__ */ jsx(
118
- Select,
87
+ /* @__PURE__ */ n(U, { children: [
88
+ /* @__PURE__ */ n(w, { fullWidth: !0, sx: { mt: 2 }, children: [
89
+ /* @__PURE__ */ r(M, { size: "small", sx: { fontSize: "14px" }, children: t("profile.setStatus") }),
90
+ /* @__PURE__ */ r(
91
+ R,
119
92
  {
120
- value: status,
93
+ value: l,
121
94
  label: t("profile.setStatus"),
122
- onChange: (e) => {
123
- setStatus(e.target.value);
124
- setChanged(true);
95
+ onChange: (o) => {
96
+ S(o.target.value), c(!0);
125
97
  },
126
98
  variant: "outlined",
127
- IconComponent: (props) => /* @__PURE__ */ jsx(ArrowDownwardIcon, { ...props, width: 20, height: 20 }),
128
- sx: selectStyle,
129
- children: data.map((item) => /* @__PURE__ */ jsx(MenuItem, { value: item.id, children: /* @__PURE__ */ jsxs(Suspense, { fallback: null, children: [
130
- item.icon && /* @__PURE__ */ jsx(ListItemIcon, { style: { minWidth: "24px" }, children: createElement(item.icon, {
99
+ IconComponent: (o) => /* @__PURE__ */ r(A, { ...o, width: 20, height: 20 }),
100
+ sx: O,
101
+ children: m.map((o) => /* @__PURE__ */ r(T, { value: o.id, children: /* @__PURE__ */ n(z, { fallback: null, children: [
102
+ o.icon && /* @__PURE__ */ r(B, { style: { minWidth: "24px" }, children: W(o.icon, {
131
103
  style: { fontSize: "16px", width: "16px", height: "16px" }
132
104
  }) }),
133
- item.name
134
- ] }) }, item.id))
105
+ o.name
106
+ ] }) }, o.id))
135
107
  }
136
108
  )
137
109
  ] }),
138
- !status ? /* @__PURE__ */ jsxs(Box, { sx: { mt: "24px" }, children: [
139
- /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: t("profile.quickSettings") }),
140
- data.map((item) => /* @__PURE__ */ jsx(
141
- Box,
110
+ l ? /* @__PURE__ */ n(w, { fullWidth: !0, sx: { mt: "24px" }, children: [
111
+ /* @__PURE__ */ r(M, { size: "small", sx: { fontSize: "14px" }, children: t("profile.removeStatusAfter") }),
112
+ /* @__PURE__ */ r(
113
+ R,
114
+ {
115
+ value: a,
116
+ label: t("profile.removeStatusAfter"),
117
+ onChange: (o) => {
118
+ const { value: e } = o.target;
119
+ y(e), e === p.Custom && x(C().toDate()), c(!0);
120
+ },
121
+ variant: "outlined",
122
+ IconComponent: (o) => /* @__PURE__ */ r(A, { ...o, width: 20, height: 20 }),
123
+ sx: O,
124
+ children: (k = f == null ? void 0 : f.children) == null ? void 0 : k.map((o) => /* @__PURE__ */ r(T, { value: o.id, children: o.name }, o.id))
125
+ }
126
+ )
127
+ ] }) : /* @__PURE__ */ n(v, { sx: { mt: "24px" }, children: [
128
+ /* @__PURE__ */ r(
129
+ g,
142
130
  {
143
- onClick: () => handleQuickSettingClick(item),
131
+ variant: "body2",
132
+ sx: {
133
+ color: "text.secondary"
134
+ },
135
+ children: t("profile.quickSettings")
136
+ }
137
+ ),
138
+ m.map((o) => /* @__PURE__ */ r(
139
+ v,
140
+ {
141
+ onClick: () => q(o),
144
142
  sx: {
145
143
  display: "flex",
146
144
  alignItems: "center",
@@ -152,79 +150,66 @@ export default function StatusDialog({ open, onClose, data, selected, onSelect,
152
150
  bgcolor: "action.hover"
153
151
  }
154
152
  },
155
- children: /* @__PURE__ */ jsxs(Suspense, { fallback: null, children: [
156
- item.icon && /* @__PURE__ */ jsx(ListItemIcon, { style: { minWidth: "24px" }, children: createElement(item.icon, {
153
+ children: /* @__PURE__ */ n(z, { fallback: null, children: [
154
+ o.icon && /* @__PURE__ */ r(B, { style: { minWidth: "24px" }, children: W(o.icon, {
157
155
  style: { fontSize: "16px", width: "16px", height: "16px" }
158
156
  }) }),
159
- item.name,
160
- item.durationName && /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "text.secondary", children: [
161
- "- ",
162
- item.durationName
163
- ] })
157
+ o.name,
158
+ o.durationName && /* @__PURE__ */ n(
159
+ g,
160
+ {
161
+ variant: "body2",
162
+ sx: {
163
+ color: "text.secondary"
164
+ },
165
+ children: [
166
+ "- ",
167
+ o.durationName
168
+ ]
169
+ }
170
+ )
164
171
  ] })
165
172
  },
166
- item.id
173
+ o.id
167
174
  ))
168
- ] }) : /* @__PURE__ */ jsxs(FormControl, { fullWidth: true, sx: { mt: "24px" }, children: [
169
- /* @__PURE__ */ jsx(InputLabel, { size: "small", sx: { fontSize: "14px" }, children: t("profile.removeStatusAfter") }),
170
- /* @__PURE__ */ jsx(
171
- Select,
172
- {
173
- value: duration,
174
- label: t("profile.removeStatusAfter"),
175
- onChange: (e) => {
176
- const { value } = e.target;
177
- setDuration(value);
178
- if (value === DurationEnum.Custom) {
179
- setCustomDate(dayjs().toDate());
180
- }
181
- setChanged(true);
182
- },
183
- variant: "outlined",
184
- IconComponent: (props) => /* @__PURE__ */ jsx(ArrowDownwardIcon, { ...props, width: 20, height: 20 }),
185
- sx: selectStyle,
186
- children: selectedStatus?.children?.map((item) => /* @__PURE__ */ jsx(MenuItem, { value: item.id, children: item.name }, item.id))
187
- }
188
- )
189
175
  ] }),
190
- duration === DurationEnum.Custom && /* @__PURE__ */ jsx(Box, { sx: { mt: "24px" }, children: /* @__PURE__ */ jsx(
191
- DateTimeInput,
176
+ a === p.Custom && /* @__PURE__ */ r(v, { sx: { mt: "24px" }, children: /* @__PURE__ */ r(
177
+ io,
192
178
  {
193
- value: customDate,
194
- onChange: (e) => {
195
- setCustomDate(e);
196
- setChanged(true);
179
+ value: d,
180
+ onChange: (o) => {
181
+ x(o), c(!0);
197
182
  },
198
183
  label: t("profile.selectEndTime"),
199
- timezone,
200
- error: duration === DurationEnum.Custom && !customDate,
201
- helperText: duration === DurationEnum.Custom && !customDate ? t("profile.pleaseSelectTime") : void 0
184
+ timezone: F,
185
+ error: a === p.Custom && !d,
186
+ helperText: a === p.Custom && !d ? t("profile.pleaseSelectTime") : void 0
202
187
  }
203
188
  ) })
204
189
  ] }),
205
- /* @__PURE__ */ jsx(DialogActions, { sx: { p: "16px 24px", borderTop: "1px solid", borderColor: "divider" }, children: selected?.value && !changed ? /* @__PURE__ */ jsx(
206
- Button,
190
+ /* @__PURE__ */ r(X, { sx: { p: "16px 24px", borderTop: "1px solid", borderColor: "divider" }, children: i != null && i.value && !N ? /* @__PURE__ */ r(
191
+ b,
207
192
  {
208
- sx: { ...defaultButtonStyle, minWidth: "54px" },
193
+ sx: { ...E, minWidth: "54px" },
209
194
  size: "small",
210
195
  variant: "outlined",
211
- onClick: () => handleSubmit(true),
196
+ onClick: () => D(!0),
212
197
  children: t("profile.cleanStatus")
213
198
  }
214
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
215
- /* @__PURE__ */ jsx(Button, { size: "small", variant: "outlined", sx: { ...defaultButtonStyle, minWidth: "54px" }, onClick: onClose, children: t("common.cancel") }),
216
- /* @__PURE__ */ jsx(
217
- Button,
199
+ ) : /* @__PURE__ */ n(Q, { children: [
200
+ /* @__PURE__ */ r(b, { size: "small", variant: "outlined", sx: { ...E, minWidth: "54px" }, onClick: u, children: t("common.cancel") }),
201
+ /* @__PURE__ */ r(
202
+ b,
218
203
  {
219
204
  sx: {
220
- ...primaryButtonStyle,
205
+ ...ro,
221
206
  minWidth: "54px",
222
207
  "&.Mui-disabled": {
223
208
  backgroundColor: "rgba(0, 0, 0, 0.12)"
224
209
  }
225
210
  },
226
- disabled: !isValid,
227
- onClick: () => handleSubmit(false),
211
+ disabled: !P,
212
+ onClick: () => D(!1),
228
213
  size: "small",
229
214
  variant: "outlined",
230
215
  children: t("common.confirm")
@@ -235,3 +220,6 @@ export default function StatusDialog({ open, onClose, data, selected, onSelect,
235
220
  }
236
221
  );
237
222
  }
223
+ export {
224
+ go as default
225
+ };
@@ -1,39 +1,30 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { Menu, styled, Typography } from "@mui/material";
3
- import { useState } from "react";
4
- import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
5
- import { useMemoizedFn } from "ahooks";
6
- import { translate } from "@arcblock/ux/lib/Locale/util";
7
- import { translations } from "../../libs/locales.js";
8
- import StatusMenuItem, { StyledMenu } from "./menu-item.js";
9
- function DurationMenu({ data, selected, onSelect }) {
10
- const { locale } = useLocaleContext();
11
- const t = useMemoizedFn((key, _data = {}) => {
12
- return translate(translations, key, locale, "en", _data);
13
- });
14
- const [anchorEl, setAnchorEl] = useState(null);
15
- const open = Boolean(anchorEl);
16
- const openSubMenu = (e) => {
17
- setAnchorEl(e.currentTarget);
1
+ import { jsxs as a, Fragment as g, jsx as i } from "react/jsx-runtime";
2
+ import { styled as x, Menu as v, Typography as y } from "@mui/material";
3
+ import { useState as z } from "react";
4
+ import { useLocaleContext as C } from "@arcblock/ux/lib/Locale/context";
5
+ import { useMemoizedFn as b } from "ahooks";
6
+ import { translate as k } from "@arcblock/ux/lib/Locale/util";
7
+ import { translations as D } from "../../libs/locales.js";
8
+ import s, { StyledMenu as j } from "./menu-item.js";
9
+ function I({ data: n, selected: r, onSelect: m }) {
10
+ var c;
11
+ const { locale: p } = C(), f = b((o, t = {}) => k(D, o, p, "en", t)), [e, l] = z(null), h = !!e, S = (o) => {
12
+ l(o.currentTarget);
13
+ }, u = () => {
14
+ l(null);
15
+ }, d = (o) => {
16
+ S(o);
17
+ }, M = (o, t) => {
18
+ m({
19
+ ...r ?? {},
20
+ value: n.id,
21
+ duration: t.id
22
+ }), u();
18
23
  };
19
- const closeSubMenu = () => {
20
- setAnchorEl(null);
21
- };
22
- const onSelectStatus = (e) => {
23
- openSubMenu(e);
24
- };
25
- const onSelectDuration = (e, item) => {
26
- onSelect({
27
- ...selected ?? {},
28
- value: data.id,
29
- duration: item.id
30
- });
31
- closeSubMenu();
32
- };
33
- return /* @__PURE__ */ jsxs(Fragment, { children: [
34
- /* @__PURE__ */ jsx(StatusMenuItem, { icon: data.icon, selected: selected?.value === data.id, onClick: onSelectStatus, children: data.name }),
35
- /* @__PURE__ */ jsxs(
36
- StyledMenu,
24
+ return /* @__PURE__ */ a(g, { children: [
25
+ /* @__PURE__ */ i(s, { icon: n.icon, selected: (r == null ? void 0 : r.value) === n.id, onClick: d, children: n.name }),
26
+ /* @__PURE__ */ a(
27
+ j,
37
28
  {
38
29
  anchorOrigin: {
39
30
  vertical: "top",
@@ -43,31 +34,45 @@ function DurationMenu({ data, selected, onSelect }) {
43
34
  vertical: "top",
44
35
  horizontal: "left"
45
36
  },
46
- open,
47
- onClose: closeSubMenu,
48
- anchorEl,
37
+ open: h,
38
+ onClose: u,
39
+ anchorEl: e,
49
40
  children: [
50
- /* @__PURE__ */ jsx(Typography, { component: "span", color: "text.secondary", pl: 2, fontSize: "14px", children: t("profile.removeStatusAfter") }),
51
- data.children?.map((item) => /* @__PURE__ */ jsx(
52
- StatusMenuItem,
41
+ /* @__PURE__ */ i(
42
+ y,
43
+ {
44
+ component: "span",
45
+ sx: {
46
+ color: "text.secondary",
47
+ pl: 2,
48
+ fontSize: "14px"
49
+ },
50
+ children: f("profile.removeStatusAfter")
51
+ }
52
+ ),
53
+ (c = n.children) == null ? void 0 : c.map((o) => /* @__PURE__ */ i(
54
+ s,
53
55
  {
54
- selected: selected?.duration === item.id,
55
- onClick: (e) => onSelectDuration(e, item),
56
- children: item.name
56
+ selected: (r == null ? void 0 : r.duration) === o.id,
57
+ onClick: (t) => M(t, o),
58
+ children: o.name
57
59
  },
58
- item.id
60
+ o.id
59
61
  ))
60
62
  ]
61
63
  }
62
64
  )
63
65
  ] });
64
66
  }
65
- export default DurationMenu;
66
- export const MenuDiv = styled(Menu)`
67
+ const $ = x(v)`
67
68
  .MuiList-root {
68
69
  min-width: 160px;
69
70
  }
70
71
  .selected {
71
- background-color: ${({ theme }) => theme.palette.grey[50]};
72
+ background-color: ${({ theme: n }) => n.palette.grey[50]};
72
73
  }
73
74
  `;
75
+ export {
76
+ $ as MenuDiv,
77
+ I as default
78
+ };
@@ -1,39 +1,40 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Typography } from "@mui/material";
3
- import { translate } from "@arcblock/ux/lib/Locale/util";
4
- import { useMemoizedFn } from "ahooks";
5
- import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
6
- import StatusDurationMenu from "./duration-menu.js";
7
- import StatusMenuItem, { StyledMenu } from "./menu-item.js";
8
- import { translations } from "../../libs/locales.js";
9
- function StatusSelector({ data, open, onSelect, anchorEl, selected }) {
10
- const { locale } = useLocaleContext();
11
- const t = useMemoizedFn((key, _data = {}) => {
12
- return translate(translations, key, locale, "en", _data);
13
- });
14
- const onSelectStatus = (v) => {
15
- onSelect(v);
16
- };
17
- const renderMenuItems = () => {
18
- return data.map((item) => {
19
- if (item.children) {
20
- return /* @__PURE__ */ jsx(StatusDurationMenu, { data: item, selected, onSelect: onSelectStatus }, item.id);
21
- }
22
- return /* @__PURE__ */ jsx(
23
- StatusMenuItem,
24
- {
25
- icon: item.icon,
26
- selected: selected?.value === item.id,
27
- onClick: () => onSelectStatus({ value: item.id }),
28
- children: item.name
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { Typography as f } from "@mui/material";
3
+ import { translate as d } from "@arcblock/ux/lib/Locale/util";
4
+ import { useMemoizedFn as S } from "ahooks";
5
+ import { useLocaleContext as x } from "@arcblock/ux/lib/Locale/context";
6
+ import h from "./duration-menu.js";
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);
12
+ }, p = () => e.map((o) => o.children ? /* @__PURE__ */ t(h, { data: o, selected: r, onSelect: n }, o.id) : /* @__PURE__ */ t(
13
+ M,
14
+ {
15
+ icon: o.icon,
16
+ selected: (r == null ? void 0 : r.value) === o.id,
17
+ onClick: () => n({ value: o.id }),
18
+ children: o.name
19
+ },
20
+ o.id
21
+ ));
22
+ return /* @__PURE__ */ m(y, { open: a, onClose: () => n(), anchorEl: i, children: [
23
+ /* @__PURE__ */ t(
24
+ f,
25
+ {
26
+ component: "span",
27
+ sx: {
28
+ color: "text.secondary",
29
+ pl: 2,
30
+ fontSize: "14px"
29
31
  },
30
- item.id
31
- );
32
- });
33
- };
34
- return /* @__PURE__ */ jsxs(StyledMenu, { open, onClose: () => onSelectStatus(), anchorEl, children: [
35
- /* @__PURE__ */ jsx(Typography, { component: "span", color: "text.secondary", pl: 2, fontSize: "14px", children: t("profile.setStatus") }),
36
- renderMenuItems()
32
+ children: l("profile.setStatus")
33
+ }
34
+ ),
35
+ p()
37
36
  ] });
38
37
  }
39
- export default StatusSelector;
38
+ export {
39
+ L as default
40
+ };
@@ -1,15 +1,15 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ListItemIcon, MenuItem, Menu, styled } from "@mui/material";
3
- import React from "react";
4
- export default function StatusMenuItem({ icon, selected, onClick, children }) {
5
- return /* @__PURE__ */ jsxs(MenuItem, { onClick, className: selected ? "selected" : "", children: [
6
- icon && /* @__PURE__ */ jsx(ListItemIcon, { style: { minWidth: "24px" }, children: React.createElement(icon, {
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, {
7
7
  style: { fontSize: "16px", width: "16px", height: "16px" }
8
8
  }) }),
9
- children
9
+ r
10
10
  ] });
11
11
  }
12
- export const StyledMenu = styled(Menu)`
12
+ const h = n(l)`
13
13
  .MuiPaper-root {
14
14
  box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.15);
15
15
  }
@@ -17,6 +17,10 @@ export const StyledMenu = styled(Menu)`
17
17
  min-width: 160px;
18
18
  }
19
19
  .selected {
20
- background-color: ${({ theme }) => theme.palette.grey[50]};
20
+ background-color: ${({ theme: e }) => e.palette.grey[50]};
21
21
  }
22
22
  `;
23
+ export {
24
+ h as StyledMenu,
25
+ c as default
26
+ };