@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,18 +1,5 @@
1
- export var DurationEnum = /* @__PURE__ */ ((DurationEnum2) => {
2
- DurationEnum2["NoClear"] = "no_clear";
3
- DurationEnum2["ThirtyMinutes"] = "30_minutes";
4
- DurationEnum2["OneHour"] = "1_hour";
5
- DurationEnum2["FourHours"] = "4_hours";
6
- DurationEnum2["Today"] = "today";
7
- DurationEnum2["ThisWeek"] = "this_week";
8
- DurationEnum2["Custom"] = "custom";
9
- return DurationEnum2;
10
- })(DurationEnum || {});
11
- export var StatusEnum = /* @__PURE__ */ ((StatusEnum2) => {
12
- StatusEnum2["Meeting"] = "meeting";
13
- StatusEnum2["Community"] = "community";
14
- StatusEnum2["Holiday"] = "holiday";
15
- StatusEnum2["OffSick"] = "off_sick";
16
- StatusEnum2["WorkingRemotely"] = "working_remotely";
17
- return StatusEnum2;
18
- })(StatusEnum || {});
1
+ var o = /* @__PURE__ */ ((e) => (e.NoClear = "no_clear", e.ThirtyMinutes = "30_minutes", e.OneHour = "1_hour", e.FourHours = "4_hours", e.Today = "today", e.ThisWeek = "this_week", e.Custom = "custom", e))(o || {}), r = /* @__PURE__ */ ((e) => (e.Meeting = "meeting", e.Community = "community", e.Holiday = "holiday", e.OffSick = "off_sick", e.WorkingRemotely = "working_remotely", e))(r || {});
2
+ export {
3
+ o as DurationEnum,
4
+ r as StatusEnum
5
+ };
@@ -1,97 +1,81 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { BLOCKLET_SERVICE_PATH_PREFIX } from "@arcblock/ux/lib/Util/constant";
3
- import { useEffect, useRef, useState } from "react";
4
- import { joinURL } from "ufo";
5
- function parseUrl(uri, params) {
6
- const url = new URL(uri);
7
- Object.keys(params).forEach((key) => {
8
- const value = params[key];
9
- if (value !== void 0) {
10
- url.searchParams.set(key, typeof value === "string" ? value : JSON.stringify(value));
11
- }
12
- });
13
- return url.pathname + url.search;
1
+ import { jsx as T } from "react/jsx-runtime";
2
+ import { BLOCKLET_SERVICE_PATH_PREFIX as V } from "@arcblock/ux/lib/Util/constant";
3
+ import { useState as A, useRef as p, useEffect as H } from "react";
4
+ import { joinURL as J } from "ufo";
5
+ function K(a, s) {
6
+ const t = new URL(a);
7
+ return Object.keys(s).forEach((i) => {
8
+ const o = s[i];
9
+ o !== void 0 && t.searchParams.set(i, typeof o == "string" ? o : JSON.stringify(o));
10
+ }), t.pathname + t.search;
14
11
  }
15
- function BlockletStudio({
16
- open,
17
- setOpen,
18
- onOpened,
19
- componentDid,
20
- tenantScope,
21
- resourcesParams = {},
22
- mode = "dialog",
23
- title,
24
- logo,
25
- description,
26
- introduction,
27
- note,
28
- componentsTitle,
29
- resourcesTitle,
30
- onUploaded,
31
- onReleased,
32
- onConnected,
33
- components = [],
34
- resources = {},
35
- style = {},
36
- zIndex = 9999,
37
- dependentComponentsMode,
38
- ...rest
12
+ function G({
13
+ open: a,
14
+ setOpen: s,
15
+ onOpened: t,
16
+ componentDid: i,
17
+ tenantScope: o,
18
+ resourcesParams: h = {},
19
+ mode: w = "dialog",
20
+ title: E,
21
+ logo: R,
22
+ description: L,
23
+ introduction: y,
24
+ note: D,
25
+ componentsTitle: S,
26
+ resourcesTitle: b,
27
+ onUploaded: j,
28
+ onReleased: x,
29
+ onConnected: B,
30
+ components: P = [],
31
+ resources: U = {},
32
+ style: _ = {},
33
+ zIndex: k = 9999,
34
+ dependentComponentsMode: C,
35
+ ...F
39
36
  }) {
40
- const [opened, setOpened] = useState(false);
41
- const didRef = useRef("");
42
- didRef.current = componentDid;
43
- const latestFunctionVersionRef = useRef({});
44
- latestFunctionVersionRef.current["resourceDialog.close"] = () => {
45
- setOpened(false);
46
- setOpen(false);
47
- };
48
- latestFunctionVersionRef.current["resourceDialog.loaded"] = () => {
49
- setOpened(true);
50
- onOpened?.();
51
- };
52
- latestFunctionVersionRef.current["studioDialog.uploaded"] = onUploaded;
53
- latestFunctionVersionRef.current["studioDialog.connected"] = onConnected;
54
- latestFunctionVersionRef.current["studioDialog.released"] = onReleased;
55
- useEffect(() => {
56
- const listener = (event) => {
57
- if (event?.data?.componentDid !== didRef.current) {
37
+ const [n, c] = A(!1), u = p("");
38
+ u.current = i;
39
+ const e = p({});
40
+ if (e.current["resourceDialog.close"] = () => {
41
+ c(!1), s(!1);
42
+ }, e.current["resourceDialog.loaded"] = () => {
43
+ c(!0), t == null || t();
44
+ }, e.current["studioDialog.uploaded"] = j, e.current["studioDialog.connected"] = B, e.current["studioDialog.released"] = x, H(() => {
45
+ const l = (r) => {
46
+ var f, m, g;
47
+ if (((f = r == null ? void 0 : r.data) == null ? void 0 : f.componentDid) !== u.current)
58
48
  return;
59
- }
60
- const fn = latestFunctionVersionRef.current[event?.data?.event];
61
- if (typeof fn === "function") {
62
- fn(event?.data?.data);
63
- }
49
+ const d = e.current[(m = r == null ? void 0 : r.data) == null ? void 0 : m.event];
50
+ typeof d == "function" && d((g = r == null ? void 0 : r.data) == null ? void 0 : g.data);
64
51
  };
65
- window.addEventListener("message", listener);
66
- return () => {
67
- window.removeEventListener("message", listener);
52
+ return window.addEventListener("message", l), () => {
53
+ window.removeEventListener("message", l);
68
54
  };
69
- }, []);
70
- if (!open) {
55
+ }, []), !a)
71
56
  return null;
72
- }
73
- const src = parseUrl(
74
- joinURL(window.location.origin, BLOCKLET_SERVICE_PATH_PREFIX, "/embed/resources", componentDid, "/publish"),
57
+ const I = K(
58
+ J(window.location.origin, V, "/embed/resources", i, "/publish"),
75
59
  {
76
- title,
77
- logo,
78
- description,
79
- introduction,
80
- note,
81
- tenantScope,
82
- mode,
83
- resourcesParams,
84
- resources,
85
- components,
86
- resourcesTitle,
87
- componentsTitle,
88
- dependentComponentsMode
60
+ title: E,
61
+ logo: R,
62
+ description: L,
63
+ introduction: y,
64
+ note: D,
65
+ tenantScope: o,
66
+ mode: w,
67
+ resourcesParams: h,
68
+ resources: U,
69
+ components: P,
70
+ resourcesTitle: b,
71
+ componentsTitle: S,
72
+ dependentComponentsMode: C
89
73
  }
90
74
  );
91
- return /* @__PURE__ */ jsx(
75
+ return /* @__PURE__ */ T(
92
76
  "iframe",
93
77
  {
94
- src,
78
+ src: I,
95
79
  title: "Blocklet Studio",
96
80
  style: {
97
81
  position: "fixed",
@@ -99,16 +83,18 @@ function BlockletStudio({
99
83
  left: 0,
100
84
  width: "100vw",
101
85
  height: "100vh",
102
- zIndex,
86
+ zIndex: k,
103
87
  border: 0,
104
88
  padding: 0,
105
89
  margin: 0,
106
- pointerEvents: opened ? "auto" : "none",
107
- opacity: opened ? 1 : 0,
108
- ...style
90
+ pointerEvents: n ? "auto" : "none",
91
+ opacity: n ? 1 : 0,
92
+ ..._
109
93
  },
110
- ...rest
94
+ ...F
111
95
  }
112
96
  );
113
97
  }
114
- export default BlockletStudio;
98
+ export {
99
+ G as default
100
+ };
@@ -1,199 +1,162 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { SessionContext } from "@arcblock/did-connect/lib/Session";
3
- import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
4
- import { translate } from "@arcblock/ux/lib/Locale/util";
5
- import SessionPermission from "@arcblock/ux/lib/SessionPermission";
6
- import { Icon } from "@iconify/react";
7
- import CloseIcon from "@mui/icons-material/Close";
8
- import { Box, ClickAwayListener, Fade, IconButton, Paper } from "@mui/material";
9
- import { useMemoizedFn } from "ahooks";
10
- import PropTypes from "prop-types";
11
- import { useContext } from "react";
12
- import InstallerItem from "./installer-item.js";
13
- import translations from "./locales.js";
14
- import useComponentInstalled from "./use-component-installed.js";
15
- function ComponentInstaller({
16
- warnIcon,
17
- did,
18
- noPermissionMute,
19
- onInstalled,
20
- onError,
21
- children,
22
- closeByOutSize,
23
- onClose,
24
- fallback,
25
- disabled,
26
- roles = ["owner", "admin"]
1
+ import { jsx as e, jsxs as o, Fragment as x } from "react/jsx-runtime";
2
+ import { SessionContext as R } from "@arcblock/did-connect/lib/Session";
3
+ import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
4
+ import { translate as q } from "@arcblock/ux/lib/Locale/util";
5
+ import A from "@arcblock/ux/lib/SessionPermission";
6
+ import { Icon as I } from "@iconify/react";
7
+ import { Close as S } from "@mui/icons-material";
8
+ import { ClickAwayListener as F, Fade as N, Paper as O, Box as n, IconButton as C } from "@mui/material";
9
+ import { useMemoizedFn as Y } from "ahooks";
10
+ import t from "prop-types";
11
+ import { use as P } from "react";
12
+ import $ from "./installer-item.js";
13
+ import E from "./locales.js";
14
+ import H from "./use-component-installed.js";
15
+ function m({
16
+ warnIcon: l = null,
17
+ did: u,
18
+ noPermissionMute: k = !1,
19
+ onInstalled: v = null,
20
+ onError: z = null,
21
+ children: d,
22
+ closeByOutSize: L = !1,
23
+ onClose: s = null,
24
+ fallback: p = null,
25
+ disabled: T = !1,
26
+ roles: D = ["owner", "admin"]
27
27
  }) {
28
- const { locale } = useLocaleContext();
29
- const t = useMemoizedFn((key, data = {}) => {
30
- return translate(translations, key, locale, "en", data);
31
- });
32
- const { installed, optComponents, installStatus, definedInBlockletYML } = useComponentInstalled({
33
- did,
34
- onInstalled,
35
- onError
36
- });
37
- const sessionCtx = useContext(SessionContext);
38
- const handleClose = () => {
39
- onClose?.(false);
28
+ const { locale: B } = W(), a = Y((i, r = {}) => q(E, i, B, "en", r)), { installed: j, optComponents: g, installStatus: h, definedInBlockletYML: M } = H({
29
+ did: u,
30
+ onInstalled: v,
31
+ onError: z
32
+ }), f = P(R), c = () => {
33
+ s == null || s(!1);
40
34
  };
41
- if (disabled) {
42
- return children;
43
- }
44
- return /* @__PURE__ */ jsx(SessionPermission, { session: sessionCtx?.session, roles, children: ({ hasPermission }) => {
45
- if (installed) {
46
- return children;
47
- }
48
- if (noPermissionMute && !hasPermission) {
49
- return fallback || null;
50
- }
51
- if (typeof children === "function") {
52
- return /* @__PURE__ */ jsxs(Fragment, { children: [
53
- fallback,
54
- children({
55
- hasPermission,
56
- optComponents,
57
- installStatus
58
- })
59
- ] });
60
- }
61
- return /* @__PURE__ */ jsxs(Fragment, { children: [
62
- fallback,
63
- /* @__PURE__ */ jsx(
64
- ClickAwayListener,
65
- {
66
- onClickAway: (e) => {
67
- e.preventDefault();
68
- e.stopPropagation();
69
- if (closeByOutSize) {
70
- handleClose();
71
- }
72
- },
73
- children: /* @__PURE__ */ jsx(Fade, { in: true, timeout: 350, children: /* @__PURE__ */ jsx(
74
- Paper,
75
- {
76
- variant: "outlined",
77
- sx: {
78
- position: "fixed",
79
- top: 20,
80
- right: 20,
81
- zIndex: 3e3,
82
- borderRadius: 1.5,
83
- width: 400,
84
- maxWidth: "90vw",
85
- borderColor: "divider",
86
- border: "0 !important",
87
- fontSize: "14px",
88
- textAlign: "left",
89
- boxShadow: ({ palette }) => `0px 8px 16px 0px ${palette.grey[100]}, 0px 0px 0px 1px ${palette.grey[100]}`
90
- },
91
- children: !definedInBlockletYML ? /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
92
- /* @__PURE__ */ jsxs(
93
- Box,
35
+ return T ? d : /* @__PURE__ */ e(A, { session: f == null ? void 0 : f.session, roles: D, children: ({ hasPermission: i }) => j ? d : k && !i ? p || null : typeof d == "function" ? /* @__PURE__ */ o(x, { children: [
36
+ p,
37
+ d({
38
+ hasPermission: i,
39
+ optComponents: g,
40
+ installStatus: h
41
+ })
42
+ ] }) : /* @__PURE__ */ o(x, { children: [
43
+ p,
44
+ /* @__PURE__ */ e(
45
+ F,
46
+ {
47
+ onClickAway: (r) => {
48
+ r.preventDefault(), r.stopPropagation(), L && c();
49
+ },
50
+ children: /* @__PURE__ */ e(N, { in: !0, timeout: 350, children: /* @__PURE__ */ e(
51
+ O,
52
+ {
53
+ variant: "outlined",
54
+ sx: {
55
+ position: "fixed",
56
+ top: 20,
57
+ right: 20,
58
+ zIndex: 3e3,
59
+ borderRadius: 1.5,
60
+ width: 400,
61
+ maxWidth: "90vw",
62
+ borderColor: "divider",
63
+ border: "0 !important",
64
+ fontSize: "14px",
65
+ textAlign: "left",
66
+ boxShadow: ({ palette: r }) => `0px 8px 16px 0px ${r.grey[100]}, 0px 0px 0px 1px ${r.grey[100]}`
67
+ },
68
+ children: M ? /* @__PURE__ */ o(n, { sx: { display: "flex", flexDirection: "column" }, children: [
69
+ /* @__PURE__ */ o(
70
+ n,
71
+ {
72
+ sx: {
73
+ padding: "20px 24px",
74
+ marginLeft: 0,
75
+ display: "flex",
76
+ flexDirection: "row",
77
+ alignItems: "center",
78
+ justifyContent: "flex-start"
79
+ },
80
+ children: [
81
+ l || /* @__PURE__ */ e(I, { icon: "mdi:warning-box", style: { color: "yellowgreen", fontSize: 24 } }),
82
+ /* @__PURE__ */ e(n, { sx: { marginLeft: 1, fontSize: "16px", fontWeight: "bold" }, children: a("componentInstallerTitle") }),
83
+ /* @__PURE__ */ e(n, { sx: { flex: 1 } }),
84
+ s ? /* @__PURE__ */ e(C, { variant: "outlined", className: "button", onClick: c, children: /* @__PURE__ */ e(S, {}) }) : null
85
+ ]
86
+ }
87
+ ),
88
+ /* @__PURE__ */ e(n, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
89
+ /* @__PURE__ */ e(n, { sx: { maxHeight: "70vh", overflowY: "auto" }, children: g.map((r, y) => {
90
+ var w, b;
91
+ return /* @__PURE__ */ e(
92
+ $,
94
93
  {
95
- sx: {
96
- padding: "20px 24px",
97
- marginLeft: 0,
98
- display: "flex",
99
- alignItems: "center",
100
- flexDirection: "row",
101
- justifyContent: "flex-start"
102
- },
103
- children: [
104
- warnIcon || /* @__PURE__ */ jsx(Icon, { icon: "mdi:warning-box", style: { color: "yellowgreen", fontSize: 24 } }),
105
- /* @__PURE__ */ jsx(Box, { sx: { marginLeft: 1, fontSize: "16px", fontWeight: "bold" }, children: t("componentInstallerTitle") }),
106
- /* @__PURE__ */ jsx(Box, { sx: { flex: 1 } }),
107
- onClose ? /* @__PURE__ */ jsx(IconButton, { variant: "outlined", className: "button", onClick: handleClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : null
108
- ]
109
- }
110
- ),
111
- /* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
112
- /* @__PURE__ */ jsxs(Box, { sx: { padding: "20px 24px", marginTop: 0 }, children: [
113
- t("componentInstallerNoDefinedInBlockletYML"),
114
- ": ",
115
- did
116
- ] })
117
- ] }) : /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
118
- /* @__PURE__ */ jsxs(
119
- Box,
120
- {
121
- sx: {
122
- padding: "20px 24px",
123
- marginLeft: 0,
124
- display: "flex",
125
- flexDirection: "row",
126
- alignItems: "center",
127
- justifyContent: "flex-start"
128
- },
129
- children: [
130
- warnIcon || /* @__PURE__ */ jsx(Icon, { icon: "mdi:warning-box", style: { color: "yellowgreen", fontSize: 24 } }),
131
- /* @__PURE__ */ jsx(Box, { sx: { marginLeft: 1, fontSize: "16px", fontWeight: "bold" }, children: t("componentInstallerTitle") }),
132
- /* @__PURE__ */ jsx(Box, { sx: { flex: 1 } }),
133
- onClose ? /* @__PURE__ */ jsx(IconButton, { variant: "outlined", className: "button", onClick: handleClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : null
134
- ]
135
- }
136
- ),
137
- /* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
138
- /* @__PURE__ */ jsx(Box, { sx: { maxHeight: "70vh", overflowY: "auto" }, children: optComponents.map((optionalComponent, index) => {
139
- return /* @__PURE__ */ jsx(
140
- InstallerItem,
141
- {
142
- t,
143
- hasPermission,
144
- index,
145
- optionalComponent,
146
- installStatus: installStatus[optionalComponent.meta?.did]
147
- },
148
- optionalComponent.meta?.did || index
149
- );
150
- }) }),
151
- hasPermission ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
152
- /* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
153
- /* @__PURE__ */ jsx(Box, { sx: { padding: "20px 24px" }, children: /* @__PURE__ */ jsx(Box, { sx: { opacity: 1 }, children: t("componentInstallerSuggestions") }) })
154
- ] })
94
+ t: a,
95
+ hasPermission: i,
96
+ index: y,
97
+ optionalComponent: r,
98
+ installStatus: h[(w = r.meta) == null ? void 0 : w.did]
99
+ },
100
+ ((b = r.meta) == null ? void 0 : b.did) || y
101
+ );
102
+ }) }),
103
+ i ? null : /* @__PURE__ */ o(x, { children: [
104
+ /* @__PURE__ */ e(n, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
105
+ /* @__PURE__ */ e(n, { sx: { padding: "20px 24px" }, children: /* @__PURE__ */ e(n, { sx: { opacity: 1 }, children: a("componentInstallerSuggestions") }) })
106
+ ] })
107
+ ] }) : /* @__PURE__ */ o(n, { sx: { display: "flex", flexDirection: "column" }, children: [
108
+ /* @__PURE__ */ o(
109
+ n,
110
+ {
111
+ sx: {
112
+ padding: "20px 24px",
113
+ marginLeft: 0,
114
+ display: "flex",
115
+ alignItems: "center",
116
+ flexDirection: "row",
117
+ justifyContent: "flex-start"
118
+ },
119
+ children: [
120
+ l || /* @__PURE__ */ e(I, { icon: "mdi:warning-box", style: { color: "yellowgreen", fontSize: 24 } }),
121
+ /* @__PURE__ */ e(n, { sx: { marginLeft: 1, fontSize: "16px", fontWeight: "bold" }, children: a("componentInstallerTitle") }),
122
+ /* @__PURE__ */ e(n, { sx: { flex: 1 } }),
123
+ s ? /* @__PURE__ */ e(C, { variant: "outlined", className: "button", onClick: c, children: /* @__PURE__ */ e(S, {}) }) : null
124
+ ]
125
+ }
126
+ ),
127
+ /* @__PURE__ */ e(n, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
128
+ /* @__PURE__ */ o(n, { sx: { padding: "20px 24px", marginTop: 0 }, children: [
129
+ a("componentInstallerNoDefinedInBlockletYML"),
130
+ ": ",
131
+ u
155
132
  ] })
156
- }
157
- ) })
158
- }
159
- )
160
- ] });
161
- } });
133
+ ] })
134
+ }
135
+ ) })
136
+ }
137
+ )
138
+ ] }) });
162
139
  }
163
- ComponentInstaller.propTypes = {
164
- disabled: PropTypes.bool,
165
- warnIcon: PropTypes.node,
166
- did: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).isRequired,
167
- noPermissionMute: PropTypes.bool,
168
- onInstalled: PropTypes.func,
169
- onError: PropTypes.func,
170
- children: PropTypes.any.isRequired,
171
- closeByOutSize: PropTypes.bool,
172
- onClose: PropTypes.func,
173
- fallback: PropTypes.node,
174
- roles: PropTypes.array
175
- };
176
- ComponentInstaller.defaultProps = {
177
- disabled: false,
178
- warnIcon: null,
179
- noPermissionMute: false,
180
- onInstalled: null,
181
- onError: null,
182
- closeByOutSize: false,
183
- onClose: null,
184
- fallback: null,
185
- roles: ["owner", "admin"]
140
+ m.propTypes = {
141
+ disabled: t.bool,
142
+ warnIcon: t.node,
143
+ did: t.oneOfType([t.string, t.arrayOf(t.string)]).isRequired,
144
+ noPermissionMute: t.bool,
145
+ onInstalled: t.func,
146
+ onError: t.func,
147
+ children: t.any.isRequired,
148
+ closeByOutSize: t.bool,
149
+ onClose: t.func,
150
+ fallback: t.node,
151
+ roles: t.array
186
152
  };
187
- export default function WrapComponentInstaller(props) {
188
- if (window.blocklet) {
189
- return /* @__PURE__ */ jsx(ComponentInstaller, { ...props });
190
- }
191
- return props.children;
153
+ function G(l) {
154
+ return window.blocklet ? /* @__PURE__ */ e(m, { ...l }) : l.children;
192
155
  }
193
- WrapComponentInstaller.propTypes = {
194
- ...ComponentInstaller.propTypes,
195
- children: PropTypes.any.isRequired
156
+ G.propTypes = {
157
+ ...m.propTypes,
158
+ children: t.any.isRequired
196
159
  };
197
- WrapComponentInstaller.defaultProps = {
198
- ...ComponentInstaller.defaultProps
160
+ export {
161
+ G as default
199
162
  };