@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,101 +1,94 @@
1
- import moment from "moment-timezone";
2
- import dayjs from "dayjs";
3
- import { DurationEnum } from "../../../@types/index.js";
4
- const HOUR = 3600;
5
- const MINUTES_30 = 1800;
6
- const MINUTES_10 = 600;
7
- const MINUTES_5 = 300;
8
- const MINUTES_1 = 60;
9
- const SECOND = 1;
10
- export const currentTimezone = moment.tz.guess();
11
- export const getTimezones = () => {
12
- const timezones = moment.tz.names();
13
- const formattedTimezones = timezones.map((tz) => {
14
- const offset = moment.tz(tz).utcOffset() / 60;
15
- const hours = Math.floor(offset);
16
- const minutes = offset % 1 * 60;
17
- const label = `GMT${hours >= 0 ? "+" : ""}${hours}:${minutes === 30 ? "30" : "00"}`;
18
- return { label, value: tz };
19
- });
20
- return formattedTimezones.sort((a, b) => {
21
- const [hoursA, minutesA] = a.label.replace("GMT", "").split(":").map(Number);
22
- const [hoursB, minutesB] = b.label.replace("GMT", "").split(":").map(Number);
23
- const totalOffsetA = hoursA * 60 + minutesA;
24
- const totalOffsetB = hoursB * 60 + minutesB;
25
- return totalOffsetB - totalOffsetA;
26
- }).map((tz) => ({
27
- label: `(${tz.label}) ${tz.value}`,
28
- value: tz.value
29
- }));
30
- };
31
- export const isValidUrl = (url) => {
32
- const urlPattern = /^(https?:\/\/)?((([a-zA-Z\d]([a-zA-Z\d-]*[a-zA-Z\d])*)\.)+[a-zA-Z]{2,}|((\d{1,3}\.){3}\d{1,3}))(:\d+)?(\/[-a-zA-Z\d%_.~+]*)*(\?[;&a-zA-Z\d%_.~+=-]*)?(#[a-zA-Z\d_]*)?$/;
33
- return urlPattern.test(url);
34
- };
35
- export const getStatusDuration = (status) => {
36
- let dateRange = status?.dateRange?.map((d) => dayjs(d)) ?? [];
37
- const current = dayjs();
38
- switch (status?.duration) {
39
- case DurationEnum.ThirtyMinutes:
40
- dateRange = [current, current.add(30, "minutes")];
41
- break;
42
- case DurationEnum.OneHour:
43
- dateRange = [current, current.add(1, "hour")];
1
+ import a from "dayjs";
2
+ import T from "dayjs/plugin/timezone";
3
+ import g from "dayjs/plugin/utc";
4
+ import { DurationEnum as i } from "../../../@types/index.js";
5
+ a.extend(g);
6
+ a.extend(T);
7
+ const l = 3600, u = 1800, m = 600, d = 300, f = 60, p = 1, M = a.tz.guess(), A = [
8
+ "America/New_York",
9
+ "America/Chicago",
10
+ "America/Denver",
11
+ "America/Los_Angeles",
12
+ "Europe/London",
13
+ "Europe/Paris",
14
+ "Europe/Berlin",
15
+ "Europe/Rome",
16
+ "Asia/Tokyo",
17
+ "Asia/Shanghai",
18
+ "Asia/Hong_Kong",
19
+ "Asia/Singapore",
20
+ "Asia/Seoul",
21
+ "Asia/Kolkata",
22
+ "Australia/Sydney",
23
+ "Australia/Melbourne",
24
+ "Pacific/Auckland",
25
+ "America/Sao_Paulo",
26
+ "America/Mexico_City",
27
+ "Africa/Cairo",
28
+ "UTC"
29
+ ], h = () => {
30
+ if (typeof Intl < "u" && Intl.supportedValuesOf)
31
+ try {
32
+ return Intl.supportedValuesOf("timeZone");
33
+ } catch {
34
+ console.warn("Intl.supportedValuesOf not supported, falling back to common timezones");
35
+ }
36
+ if (typeof Intl < "u" && Intl.DateTimeFormat)
37
+ try {
38
+ if (new Intl.DateTimeFormat("en", { timeZone: "UTC" }).resolvedOptions().timeZone)
39
+ return A;
40
+ } catch {
41
+ console.warn("Intl.DateTimeFormat timezone support limited");
42
+ }
43
+ return A;
44
+ }, I = () => h().map((e) => {
45
+ try {
46
+ const t = a.tz(a(), e).utcOffset() / 60, n = Math.floor(t), s = t % 1 * 60;
47
+ return { label: `GMT${n >= 0 ? "+" : ""}${n}:${s === 30 ? "30" : "00"}`, value: e };
48
+ } catch {
49
+ return console.warn(`Timezone ${e} not supported, skipping`), null;
50
+ }
51
+ }).filter((e) => e !== null).sort((e, t) => {
52
+ const [n, s] = e.label.replace("GMT", "").split(":").map(Number), [c, b] = t.label.replace("GMT", "").split(":").map(Number), y = n * 60 + s;
53
+ return c * 60 + b - y;
54
+ }).map((e) => ({
55
+ label: `(${e.label}) ${e.value}`,
56
+ value: e.value
57
+ })), N = (r) => /^(https?:\/\/)?((([a-zA-Z\d]([a-zA-Z\d-]*[a-zA-Z\d])*)\.)+[a-zA-Z]{2,}|((\d{1,3}\.){3}\d{1,3}))(:\d+)?(\/[-a-zA-Z\d%_.~+]*)*(\?[;&a-zA-Z\d%_.~+=-]*)?(#[a-zA-Z\d_]*)?$/.test(r), _ = (r) => {
58
+ var t;
59
+ let o = ((t = r == null ? void 0 : r.dateRange) == null ? void 0 : t.map((n) => a(n))) ?? [];
60
+ const e = a();
61
+ switch (r == null ? void 0 : r.duration) {
62
+ case i.ThirtyMinutes:
63
+ o = [e, e.add(30, "minutes")];
44
64
  break;
45
- case DurationEnum.FourHours:
46
- dateRange = [current, current.add(4, "hours")];
65
+ case i.OneHour:
66
+ o = [e, e.add(1, "hour")];
47
67
  break;
48
- case DurationEnum.Today:
49
- dateRange = [current, current.endOf("day")];
68
+ case i.FourHours:
69
+ o = [e, e.add(4, "hours")];
50
70
  break;
51
- case DurationEnum.ThisWeek:
52
- dateRange = [current, current.endOf("week")];
71
+ case i.Today:
72
+ o = [e, e.endOf("day")];
53
73
  break;
54
- case DurationEnum.NoClear:
55
- dateRange = [current, current];
74
+ case i.ThisWeek:
75
+ o = [e, e.endOf("week")];
56
76
  break;
57
- default:
77
+ case i.NoClear:
78
+ o = [e, e];
58
79
  break;
59
80
  }
60
- return dateRange.map((d) => d.toDate());
61
- };
62
- export const isWithinTimeRange = (dateRange) => {
63
- const current = dayjs();
64
- return current.isAfter(dayjs(dateRange[0])) && current.isBefore(dayjs(dateRange[1]));
65
- };
66
- export const isNotClear = (status) => {
67
- const { duration, dateRange } = status ?? {};
68
- if (!duration || !dateRange) {
69
- return false;
70
- }
71
- return duration === DurationEnum.NoClear || dayjs(dateRange?.[0]).isSame(dayjs(dateRange?.[1]));
72
- };
73
- export const getTimeRemaining = (date) => {
74
- const now = dayjs();
75
- const end = dayjs(date);
76
- const diffSeconds = end.diff(now, "seconds");
77
- const toMilliseconds = (seconds) => seconds * 1e3;
78
- if (diffSeconds >= HOUR) {
79
- return toMilliseconds(HOUR);
80
- }
81
- if (diffSeconds >= MINUTES_30) {
82
- return toMilliseconds(MINUTES_30);
83
- }
84
- if (diffSeconds >= MINUTES_10) {
85
- return toMilliseconds(MINUTES_10);
86
- }
87
- if (diffSeconds >= MINUTES_5) {
88
- return toMilliseconds(MINUTES_5);
89
- }
90
- if (diffSeconds >= MINUTES_1) {
91
- return toMilliseconds(MINUTES_1);
92
- }
93
- if (diffSeconds >= SECOND) {
94
- return toMilliseconds(SECOND);
95
- }
96
- return 0;
97
- };
98
- export const defaultButtonStyle = {
81
+ return o.map((n) => n.toDate());
82
+ }, E = (r) => {
83
+ const o = a();
84
+ return o.isAfter(a(r[0])) && o.isBefore(a(r[1]));
85
+ }, Z = (r) => {
86
+ const { duration: o, dateRange: e } = r ?? {};
87
+ return !o || !e ? !1 : o === i.NoClear || a(e == null ? void 0 : e[0]).isSame(a(e == null ? void 0 : e[1]));
88
+ }, v = (r) => {
89
+ const o = a(), t = a(r).diff(o, "seconds"), n = (s) => s * 1e3;
90
+ return t >= l ? n(l) : t >= u ? n(u) : t >= m ? n(m) : t >= d ? n(d) : t >= f ? n(f) : t >= p ? n(p) : 0;
91
+ }, w = {
99
92
  color: "text.primary",
100
93
  borderColor: "grey.100",
101
94
  backgroundColor: "background.default",
@@ -105,8 +98,7 @@ export const defaultButtonStyle = {
105
98
  },
106
99
  py: 0.5,
107
100
  borderRadius: 1
108
- };
109
- export const primaryButtonStyle = {
101
+ }, B = {
110
102
  color: "primary.contrastText",
111
103
  borderColor: "primary.main",
112
104
  backgroundColor: "primary.main",
@@ -117,3 +109,14 @@ export const primaryButtonStyle = {
117
109
  py: 0.5,
118
110
  borderRadius: 1
119
111
  };
112
+ export {
113
+ M as currentTimezone,
114
+ w as defaultButtonStyle,
115
+ _ as getStatusDuration,
116
+ v as getTimeRemaining,
117
+ I as getTimezones,
118
+ Z as isNotClear,
119
+ N as isValidUrl,
120
+ E as isWithinTimeRange,
121
+ B as primaryButtonStyle
122
+ };
@@ -1,105 +1,54 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import {
3
- Box,
4
- CircularProgress,
5
- IconButton,
6
- InputAdornment,
7
- MenuItem,
8
- Select,
9
- TextField,
10
- Typography
11
- } from "@mui/material";
12
- import { useCreation, useMemoizedFn, useReactive } from "ahooks";
13
- import noop from "lodash/noop";
14
- import isUrl from "is-url";
15
- import { Icon } from "@iconify/react";
16
- import CloseRoundedIcon from "@iconify-icons/material-symbols/close-rounded";
17
- import CheckIcon from "@iconify-icons/material-symbols/check";
18
- import SendRoundedIcon from "@iconify-icons/material-symbols/send-rounded";
19
- import EditSquareOutlineRoundedIcon from "@iconify-icons/material-symbols/edit-square-outline-rounded";
20
- import DeleteOutlineRoundedIcon from "@iconify-icons/material-symbols/delete-outline-rounded";
21
- import { translate } from "@arcblock/ux/lib/Locale/util";
22
- import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
23
- import { translations } from "../libs/locales.js";
24
- export default function WebhookItem({
25
- onTest = noop,
26
- onDelete = noop,
27
- onSave = noop,
28
- onCancel = noop,
29
- type = "slack",
30
- url = "",
31
- edit = false
1
+ import { jsx as e, jsxs as l, Fragment as f } from "react/jsx-runtime";
2
+ import { Typography as z, CircularProgress as M, IconButton as i, Box as a, Select as S, MenuItem as g, TextField as q, InputAdornment as A } from "@mui/material";
3
+ import { useMemoizedFn as n, useReactive as B, useCreation as F } from "ahooks";
4
+ import s from "lodash/noop";
5
+ import T from "is-url";
6
+ import { Icon as t } from "@iconify/react";
7
+ import j from "@iconify-icons/material-symbols/close-rounded";
8
+ import D from "@iconify-icons/material-symbols/check";
9
+ import O from "@iconify-icons/material-symbols/send-rounded";
10
+ import P from "@iconify-icons/material-symbols/edit-square-outline-rounded";
11
+ import U from "@iconify-icons/material-symbols/delete-outline-rounded";
12
+ import { translate as W } from "@arcblock/ux/lib/Locale/util";
13
+ import { useLocaleContext as E } from "@arcblock/ux/lib/Locale/context";
14
+ import { translations as L } from "../libs/locales.js";
15
+ function or({
16
+ onTest: x = s,
17
+ onDelete: h = s,
18
+ onSave: b = s,
19
+ onCancel: y = s,
20
+ type: c = "slack",
21
+ url: u = "",
22
+ edit: C = !1
32
23
  }) {
33
- const { locale } = useLocaleContext();
34
- const t = useMemoizedFn((key, data = {}) => {
35
- return translate(translations, key, locale, "en", data);
36
- });
37
- const currentState = useReactive({
38
- type: type || "slack",
39
- url: url || "",
40
- edit: edit ?? false,
24
+ const { locale: k } = E(), d = n((o, w = {}) => W(L, o, k, "en", w)), r = B({
25
+ type: c || "slack",
26
+ url: u || "",
27
+ edit: C ?? !1,
41
28
  error: "",
42
- loading: false
43
- });
44
- const checkUrl = useMemoizedFn(() => {
45
- if (!currentState.url) {
46
- currentState.error = t("common.required");
47
- return false;
48
- }
49
- if (!isUrl(currentState.url)) {
50
- currentState.error = t("common.invalid");
51
- return false;
52
- }
53
- currentState.error = "";
54
- return true;
55
- });
56
- const handleClose = useMemoizedFn(() => {
57
- currentState.edit = false;
58
- currentState.url = url || "";
59
- currentState.type = type || "slack";
60
- currentState.error = "";
61
- currentState.loading = false;
62
- onCancel();
63
- });
64
- const _onTest = useMemoizedFn(async (data) => {
65
- currentState.loading = true;
66
- await onTest(data);
67
- currentState.loading = false;
68
- });
69
- const onSubmit = useMemoizedFn((fn) => {
70
- return () => {
71
- if (checkUrl()) {
72
- fn({
73
- type: currentState.type,
74
- url: currentState.url
75
- });
76
- }
77
- };
78
- });
79
- const inputAdornment = useCreation(() => {
80
- if (currentState.error) {
81
- return /* @__PURE__ */ jsx(Typography, { component: "span", color: "error", children: currentState.error });
82
- }
83
- if (currentState.edit) {
84
- if (currentState.loading) {
85
- return /* @__PURE__ */ jsx(CircularProgress, { size: 16 });
86
- }
87
- return /* @__PURE__ */ jsx(
88
- IconButton,
89
- {
90
- size: "small",
91
- onClick: onSubmit(_onTest),
92
- sx: {
93
- mr: -1
94
- },
95
- children: /* @__PURE__ */ jsx(Icon, { icon: SendRoundedIcon })
96
- }
97
- );
29
+ loading: !1
30
+ }), m = n(() => r.url ? T(r.url) ? (r.error = "", !0) : (r.error = d("common.invalid"), !1) : (r.error = d("common.required"), !1)), I = n(() => {
31
+ r.edit = !1, r.url = u || "", r.type = c || "slack", r.error = "", r.loading = !1, y();
32
+ }), R = n(async (o) => {
33
+ r.loading = !0, await x(o), r.loading = !1;
34
+ }), p = n((o) => () => {
35
+ m() && o({
36
+ type: r.type,
37
+ url: r.url
38
+ });
39
+ }), v = F(() => r.error ? /* @__PURE__ */ e(z, { component: "span", color: "error", children: r.error }) : r.edit ? r.loading ? /* @__PURE__ */ e(M, { size: 16 }) : /* @__PURE__ */ e(
40
+ i,
41
+ {
42
+ size: "small",
43
+ onClick: p(R),
44
+ sx: {
45
+ mr: -1
46
+ },
47
+ children: /* @__PURE__ */ e(t, { icon: O })
98
48
  }
99
- return null;
100
- }, [currentState.error, currentState.edit, currentState.loading]);
101
- return /* @__PURE__ */ jsxs(
102
- Box,
49
+ ) : null, [r.error, r.edit, r.loading]);
50
+ return /* @__PURE__ */ l(
51
+ a,
103
52
  {
104
53
  sx: {
105
54
  display: "flex",
@@ -115,8 +64,8 @@ export default function WebhookItem({
115
64
  }
116
65
  },
117
66
  children: [
118
- /* @__PURE__ */ jsxs(
119
- Select,
67
+ /* @__PURE__ */ l(
68
+ S,
120
69
  {
121
70
  sx: {
122
71
  borderRadius: 1,
@@ -124,20 +73,20 @@ export default function WebhookItem({
124
73
  backgroundColor: "grey.50"
125
74
  }
126
75
  },
127
- disabled: !currentState.edit || currentState.loading,
76
+ disabled: !r.edit || r.loading,
128
77
  size: "small",
129
- value: currentState.type,
130
- onChange: (e) => {
131
- currentState.type = e.target.value;
78
+ value: r.type,
79
+ onChange: (o) => {
80
+ r.type = o.target.value;
132
81
  },
133
82
  children: [
134
- /* @__PURE__ */ jsx(MenuItem, { value: "api", children: t("webhook.url") }),
135
- /* @__PURE__ */ jsx(MenuItem, { value: "slack", children: t("webhook.slack") })
83
+ /* @__PURE__ */ e(g, { value: "api", children: d("webhook.url") }),
84
+ /* @__PURE__ */ e(g, { value: "slack", children: d("webhook.slack") })
136
85
  ]
137
86
  }
138
87
  ),
139
- /* @__PURE__ */ jsxs(
140
- Box,
88
+ /* @__PURE__ */ l(
89
+ a,
141
90
  {
142
91
  sx: {
143
92
  display: "flex",
@@ -146,8 +95,8 @@ export default function WebhookItem({
146
95
  width: "100%"
147
96
  },
148
97
  children: [
149
- /* @__PURE__ */ jsx(
150
- TextField,
98
+ /* @__PURE__ */ e(
99
+ q,
151
100
  {
152
101
  sx: {
153
102
  flex: 1,
@@ -158,74 +107,74 @@ export default function WebhookItem({
158
107
  }
159
108
  }
160
109
  },
161
- disabled: !currentState.edit || currentState.loading,
162
- fullWidth: true,
110
+ disabled: !r.edit || r.loading,
111
+ fullWidth: !0,
163
112
  size: "small",
164
- required: true,
165
- value: currentState.url,
166
- onChange: (e) => {
167
- currentState.url = e.target.value;
168
- checkUrl();
113
+ required: !0,
114
+ value: r.url,
115
+ onChange: (o) => {
116
+ r.url = o.target.value, m();
169
117
  },
170
- error: !!currentState.error,
171
- InputProps: {
172
- endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: inputAdornment })
118
+ error: !!r.error,
119
+ slotProps: {
120
+ input: {
121
+ endAdornment: /* @__PURE__ */ e(A, { position: "end", children: v })
122
+ }
173
123
  }
174
124
  }
175
125
  ),
176
- /* @__PURE__ */ jsx(Box, { sx: { display: "flex", gap: 0.5 }, children: currentState.edit ? /* @__PURE__ */ jsxs(Fragment, { children: [
177
- /* @__PURE__ */ jsx(
178
- IconButton,
126
+ /* @__PURE__ */ e(a, { sx: { display: "flex", gap: 0.5 }, children: r.edit ? /* @__PURE__ */ l(f, { children: [
127
+ /* @__PURE__ */ e(
128
+ i,
179
129
  {
180
130
  color: "success",
181
- onClick: onSubmit((...args) => {
182
- onSave(...args);
183
- currentState.edit = false;
131
+ onClick: p((...o) => {
132
+ b(...o), r.edit = !1;
184
133
  }),
185
134
  sx: {
186
135
  borderRadius: 1,
187
136
  border: "1px solid",
188
137
  borderColor: "grey.200"
189
138
  },
190
- children: /* @__PURE__ */ jsx(Icon, { icon: CheckIcon })
139
+ children: /* @__PURE__ */ e(t, { icon: D })
191
140
  }
192
141
  ),
193
- /* @__PURE__ */ jsx(
194
- IconButton,
142
+ /* @__PURE__ */ e(
143
+ i,
195
144
  {
196
145
  color: "error",
197
- onClick: handleClose,
146
+ onClick: I,
198
147
  sx: {
199
148
  borderRadius: 1,
200
149
  border: "1px solid",
201
150
  borderColor: "grey.200"
202
151
  },
203
- children: /* @__PURE__ */ jsx(Icon, { icon: CloseRoundedIcon })
152
+ children: /* @__PURE__ */ e(t, { icon: j })
204
153
  }
205
154
  )
206
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
207
- /* @__PURE__ */ jsx(
208
- IconButton,
155
+ ] }) : /* @__PURE__ */ l(f, { children: [
156
+ /* @__PURE__ */ e(
157
+ i,
209
158
  {
210
159
  onClick: () => {
211
- currentState.edit = true;
160
+ r.edit = !0;
212
161
  },
213
162
  sx: {
214
163
  borderRadius: 1,
215
164
  border: "1px solid",
216
165
  borderColor: "grey.200"
217
166
  },
218
- children: /* @__PURE__ */ jsx(Icon, { icon: EditSquareOutlineRoundedIcon })
167
+ children: /* @__PURE__ */ e(t, { icon: P })
219
168
  }
220
169
  ),
221
- /* @__PURE__ */ jsx(
222
- IconButton,
170
+ /* @__PURE__ */ e(
171
+ i,
223
172
  {
224
173
  color: "error",
225
174
  onClick: () => {
226
- onDelete({
227
- type: currentState.type,
228
- url: currentState.url
175
+ h({
176
+ type: r.type,
177
+ url: r.url
229
178
  });
230
179
  },
231
180
  sx: {
@@ -233,7 +182,7 @@ export default function WebhookItem({
233
182
  border: "1px solid",
234
183
  borderColor: "grey.200"
235
184
  },
236
- children: /* @__PURE__ */ jsx(Icon, { icon: DeleteOutlineRoundedIcon })
185
+ children: /* @__PURE__ */ e(t, { icon: U })
237
186
  }
238
187
  )
239
188
  ] }) })
@@ -244,3 +193,6 @@ export default function WebhookItem({
244
193
  }
245
194
  );
246
195
  }
196
+ export {
197
+ or as default
198
+ };
@@ -1 +1,4 @@
1
- export { default as UserCenter } from "./components/user-center.js";
1
+ import { default as t } from "./components/user-center.js";
2
+ export {
3
+ t as UserCenter
4
+ };