@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.
- package/lib/@types/index.js +5 -18
- package/lib/BlockletStudio/index.js +75 -89
- package/lib/ComponentInstaller/index.js +153 -190
- package/lib/ComponentInstaller/installer-item.js +56 -55
- package/lib/ComponentInstaller/locales.js +19 -18
- package/lib/ComponentInstaller/use-component-installed.js +49 -80
- package/lib/ComponentManager/components/add-component.js +68 -89
- package/lib/ComponentManager/components/check-component.js +4 -2
- package/lib/ComponentManager/components/publish-component.js +48 -57
- package/lib/ComponentManager/components/resource-dialog.js +41 -55
- package/lib/ComponentManager/index.js +8 -3
- package/lib/ComponentManager/libs/locales.js +8 -5
- package/lib/Dashboard/index.js +88 -124
- package/lib/Footer/brand.js +25 -28
- package/lib/Footer/copyright.js +15 -16
- package/lib/Footer/index.js +55 -65
- package/lib/Footer/internal-footer.js +93 -95
- package/lib/Footer/layout/plain.js +26 -24
- package/lib/Footer/layout/row.js +16 -20
- package/lib/Footer/layout/standard.js +73 -59
- package/lib/Footer/links.js +100 -120
- package/lib/Footer/social-media.js +28 -33
- package/lib/Header/index.js +108 -130
- package/lib/Icon/index.js +43 -59
- package/lib/Notifications/Snackbar.js +114 -151
- package/lib/Notifications/hooks/use-title.js +85 -126
- package/lib/Notifications/hooks/use-width.js +10 -9
- package/lib/Notifications/utils.js +74 -114
- package/lib/UserCenter/components/config-inviter.js +21 -31
- package/lib/UserCenter/components/config-profile.js +41 -47
- package/lib/UserCenter/components/danger-zone.js +88 -93
- package/lib/UserCenter/components/editable-field.js +149 -167
- package/lib/UserCenter/components/nft.js +91 -81
- package/lib/UserCenter/components/notification.js +206 -195
- package/lib/UserCenter/components/passport.js +37 -53
- package/lib/UserCenter/components/privacy.js +53 -64
- package/lib/UserCenter/components/settings.js +117 -128
- package/lib/UserCenter/components/status-dialog/date-picker.js +35 -36
- package/lib/UserCenter/components/status-dialog/index.js +132 -144
- package/lib/UserCenter/components/status-selector/duration-menu.js +53 -48
- package/lib/UserCenter/components/status-selector/index.js +37 -36
- package/lib/UserCenter/components/status-selector/menu-item.js +13 -9
- package/lib/UserCenter/components/storage/action.js +27 -25
- package/lib/UserCenter/components/storage/connected.js +59 -30
- package/lib/UserCenter/components/storage/delete.js +32 -39
- package/lib/UserCenter/components/storage/disconnect.js +43 -25
- package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.js +7 -0
- package/lib/UserCenter/components/storage/index.js +24 -18
- package/lib/UserCenter/components/storage/preview-nft.js +35 -36
- package/lib/UserCenter/components/third-party-login/index.js +73 -143
- package/lib/UserCenter/components/third-party-login/third-party-item.js +132 -153
- package/lib/UserCenter/components/user-center.js +345 -461
- package/lib/UserCenter/components/user-info/address.js +120 -100
- package/lib/UserCenter/components/user-info/index.js +10 -4
- package/lib/UserCenter/components/user-info/link-preview-input.js +148 -159
- package/lib/UserCenter/components/user-info/metadata.js +290 -385
- package/lib/UserCenter/components/user-info/switch-role.js +24 -18
- package/lib/UserCenter/components/user-info/timezone-select.js +37 -45
- package/lib/UserCenter/components/user-info/user-basic-info.js +213 -207
- package/lib/UserCenter/components/user-info/user-info-item.js +39 -26
- package/lib/UserCenter/components/user-info/user-info.js +52 -67
- package/lib/UserCenter/components/user-info/user-status.js +111 -154
- package/lib/UserCenter/components/user-info/utils.js +96 -93
- package/lib/UserCenter/components/webhook-item.js +95 -143
- package/lib/UserCenter/index.js +4 -1
- package/lib/UserCenter/libs/locales.js +132 -129
- package/lib/UserCenter/libs/utils.js +17 -22
- package/lib/UserSessions/components/user-session-info.js +30 -26
- package/lib/UserSessions/components/user-sessions.js +222 -268
- package/lib/UserSessions/index.js +4 -1
- package/lib/UserSessions/libs/locales.js +31 -28
- package/lib/UserSessions/libs/utils.js +30 -56
- package/lib/blocklets.js +75 -156
- package/lib/common/domain-warning.js +64 -104
- package/lib/common/header-addons.js +59 -80
- package/lib/common/link-blocker.js +10 -16
- package/lib/common/notification-addon.js +56 -89
- package/lib/common/overridable-theme-provider.js +12 -12
- package/lib/common/wallet-hidden-topbar.js +11 -13
- package/lib/common/ws.js +23 -34
- package/lib/contexts/config-user-space.js +34 -43
- package/lib/hooks/use-mobile.js +7 -4
- package/lib/index.js +25 -10
- package/lib/libs/client.js +5 -2
- package/lib/libs/constant.js +4 -1
- package/lib/libs/spaces.js +11 -11
- package/lib/libs/with-hide-when-embed.js +13 -15
- package/lib/packages/blocklet-ui-react/build.config.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/jest.config.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/@types/index.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/BlockletStudio/index.d.ts +26 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/index.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/installer-item.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/locales.d.ts +28 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/use-component-installed.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/add-component.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/check-component.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/publish-component.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/resource-dialog.d.ts +11 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/index.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/libs/locales.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/Dashboard/index.d.ts +27 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/brand.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/copyright.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/internal-footer.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/plain.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/row.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/standard.d.ts +21 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/links.d.ts +20 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/social-media.d.ts +14 -0
- package/lib/packages/blocklet-ui-react/lib/Header/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Icon/index.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/Snackbar.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-title.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-width.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/utils.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-inviter.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-profile.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/danger-zone.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/editable-field.d.ts +50 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/nft.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/notification.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/passport.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/privacy.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/settings.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/date-picker.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/index.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/index.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/menu-item.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/action.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/connected.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/delete.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/disconnect.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/preview-nft.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/index.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/third-party-item.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-center.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/address.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/index.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/link-preview-input.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/metadata.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/switch-role.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/timezone-select.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-basic-info.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info-item.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-status.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/utils.d.ts +33 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/webhook-item.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/locales.d.ts +513 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/utils.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-session-info.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-sessions.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/locales.d.ts +88 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/utils.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/blocklets.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/common/domain-warning.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/common/header-addons.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/common/link-blocker.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/common/notification-addon.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/common/overridable-theme-provider.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/common/wallet-hidden-topbar.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/common/ws.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/contexts/config-user-space.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/hooks/use-mobile.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/index.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/libs/client.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/libs/constant.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/libs/spaces.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/libs/with-hide-when-embed.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/types.d.ts +37 -0
- package/lib/packages/blocklet-ui-react/lib/utils.d.ts +11 -0
- package/lib/{@types → packages/blocklet-ui-react/src/@types}/index.d.ts +3 -3
- package/lib/{BlockletStudio → packages/blocklet-ui-react/src/BlockletStudio}/index.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/ComponentInstaller.stories.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/basic.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/mock-optional-components.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/index.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/installer-item.d.ts +18 -0
- package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/use-component-installed.d.ts +1 -1
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/add-component.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/ComponentManager/components/check-component.d.ts +2 -0
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/publish-component.d.ts +2 -2
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/resource-dialog.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/Dashboard/Dashboard.stories.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Dashboard/demo/basic.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/src/Dashboard/index.d.ts +30 -0
- package/lib/packages/blocklet-ui-react/src/Footer/Footer.stories.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/src/Footer/brand.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/src/Footer/copyright.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/arcblock-site.d.ts +31 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/brand.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/copyright.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/footer.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/links.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/social-media-icons.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/index.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/src/Footer/internal-footer.d.ts +32 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/plain.d.ts +22 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/row.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/standard.d.ts +24 -0
- package/lib/packages/blocklet-ui-react/src/Footer/links.d.ts +23 -0
- package/lib/packages/blocklet-ui-react/src/Footer/social-media.d.ts +14 -0
- package/lib/packages/blocklet-ui-react/src/Header/Header.stories.d.ts +26 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/addons-customization.d.ts +11 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/basic.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/fixtures/index.d.ts +49 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/with-enable-connect-enable-locale.d.ts +1 -0
- package/lib/{Header → packages/blocklet-ui-react/src/Header}/index.d.ts +3 -2
- package/lib/packages/blocklet-ui-react/src/Icon/Icon.stories.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/src/Icon/demo/basic.d.ts +1 -0
- package/lib/{Icon → packages/blocklet-ui-react/src/Icon}/index.d.ts +2 -3
- package/lib/packages/blocklet-ui-react/src/Notifications/Snackbar.d.ts +16 -0
- package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-title.d.ts +1 -1
- package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/utils.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-inviter.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-profile.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/danger-zone.d.ts +1 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/editable-field.d.ts +3 -3
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/nft.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/notification.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/passport.d.ts +5 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/privacy.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/settings.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/date-picker.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/index.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/index.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/menu-item.d.ts +4 -4
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/action.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/connected.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/delete.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/disconnect.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/index.d.ts +2 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/preview-nft.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/third-party-login/index.d.ts +4 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/third-party-login/third-party-item.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-center.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/address.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/link-preview-input.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/metadata.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/switch-role.d.ts +7 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/timezone-select.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-basic-info.d.ts +3 -3
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-info-item.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/user-info.d.ts +6 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-status.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/utils.d.ts +8 -5
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/webhook-item.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/utils.d.ts +1 -1
- package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-session-info.d.ts +1 -1
- package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-sessions.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/common/domain-warning.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/src/common/header-addons.d.ts +19 -0
- package/lib/{common → packages/blocklet-ui-react/src/common}/link-blocker.d.ts +1 -1
- package/lib/{common → packages/blocklet-ui-react/src/common}/notification-addon.d.ts +3 -6
- package/lib/{common → packages/blocklet-ui-react/src/common}/overridable-theme-provider.d.ts +5 -8
- package/lib/{contexts → packages/blocklet-ui-react/src/contexts}/config-user-space.d.ts +3 -3
- package/lib/{libs → packages/blocklet-ui-react/src/libs}/with-hide-when-embed.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/types.d.ts +36 -0
- package/lib/packages/blocklet-ui-react/tools/auto-exports.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/tools/jest.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/vite.config.d.mts +2 -0
- package/lib/types.js +39 -39
- package/lib/utils.js +61 -175
- package/package.json +28 -34
- package/src/ComponentInstaller/ComponentInstaller.stories.jsx +16 -0
- package/src/ComponentInstaller/index.jsx +11 -27
- package/src/ComponentInstaller/installer-item.jsx +1 -5
- package/src/ComponentManager/components/add-component.tsx +3 -3
- package/src/ComponentManager/components/publish-component.tsx +3 -3
- package/src/Dashboard/Dashboard.stories.jsx +20 -0
- package/src/Dashboard/index.jsx +16 -27
- package/src/Footer/Footer.stories.jsx +32 -0
- package/src/Footer/brand.jsx +1 -7
- package/src/Footer/copyright.jsx +1 -6
- package/src/Footer/index.jsx +1 -6
- package/src/Footer/internal-footer.jsx +26 -16
- package/src/Footer/layout/row.jsx +2 -7
- package/src/Footer/layout/standard.jsx +12 -2
- package/src/Footer/links.jsx +2 -7
- package/src/Footer/social-media.jsx +1 -5
- package/src/Header/Header.stories.jsx +30 -0
- package/src/Header/index.tsx +1 -1
- package/src/Icon/Icon.stories.jsx +12 -0
- package/src/Notifications/Snackbar.tsx +119 -126
- package/src/Notifications/hooks/use-title.tsx +5 -2
- package/src/Notifications/hooks/use-width.tsx +1 -1
- package/src/UserCenter/components/config-profile.tsx +0 -1
- package/src/UserCenter/components/danger-zone.tsx +7 -3
- package/src/UserCenter/components/editable-field.tsx +45 -44
- package/src/UserCenter/components/nft.tsx +21 -9
- package/src/UserCenter/components/notification.tsx +22 -6
- package/src/UserCenter/components/privacy.tsx +1 -1
- package/src/UserCenter/components/settings.tsx +6 -1
- package/src/UserCenter/components/status-dialog/date-picker.tsx +10 -7
- package/src/UserCenter/components/status-dialog/index.tsx +11 -4
- package/src/UserCenter/components/status-selector/duration-menu.tsx +7 -2
- package/src/UserCenter/components/status-selector/index.tsx +7 -1
- package/src/UserCenter/components/status-selector/menu-item.tsx +1 -2
- package/src/UserCenter/components/storage/action.tsx +1 -2
- package/src/UserCenter/components/storage/connected.tsx +18 -5
- package/src/UserCenter/components/storage/delete.tsx +1 -1
- package/src/UserCenter/components/storage/disconnect.tsx +10 -2
- package/src/UserCenter/components/storage/index.tsx +6 -1
- package/src/UserCenter/components/storage/preview-nft.tsx +1 -1
- package/src/UserCenter/components/third-party-login/index.tsx +2 -2
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +11 -7
- package/src/UserCenter/components/user-center.tsx +10 -5
- package/src/UserCenter/components/user-info/address.tsx +12 -6
- package/src/UserCenter/components/user-info/link-preview-input.tsx +36 -51
- package/src/UserCenter/components/user-info/metadata.tsx +45 -39
- package/src/UserCenter/components/user-info/timezone-select.tsx +2 -5
- package/src/UserCenter/components/user-info/user-basic-info.tsx +24 -8
- package/src/UserCenter/components/user-info/user-info-item.tsx +7 -2
- package/src/UserCenter/components/user-info/user-status.tsx +7 -9
- package/src/UserCenter/components/user-info/utils.ts +77 -11
- package/src/UserCenter/components/webhook-item.tsx +4 -2
- package/src/UserSessions/components/user-sessions.tsx +1 -1
- package/src/common/domain-warning.jsx +2 -14
- package/src/common/header-addons.jsx +8 -11
- package/src/common/notification-addon.jsx +1 -7
- package/src/common/overridable-theme-provider.jsx +1 -5
- package/src/common/ws.js +2 -2
- package/src/contexts/config-user-space.tsx +3 -3
- package/vite.config.mjs +31 -0
- package/lib/@types/shims.d.ts +0 -18
- package/lib/ComponentInstaller/index.d.ts +0 -37
- package/lib/ComponentInstaller/installer-item.d.ts +0 -21
- package/lib/ComponentManager/components/check-component.d.ts +0 -2
- package/lib/Dashboard/index.d.ts +0 -44
- package/lib/Footer/brand.d.ts +0 -22
- package/lib/Footer/copyright.d.ts +0 -18
- package/lib/Footer/index.d.ts +0 -6
- package/lib/Footer/internal-footer.d.ts +0 -29
- package/lib/Footer/layout/plain.d.ts +0 -15
- package/lib/Footer/layout/row.d.ts +0 -18
- package/lib/Footer/layout/standard.d.ts +0 -17
- package/lib/Footer/links.d.ts +0 -23
- package/lib/Footer/social-media.d.ts +0 -14
- package/lib/Notifications/Snackbar.d.ts +0 -14
- package/lib/UserCenter/components/danger-zone.d.ts +0 -1
- package/lib/UserCenter/components/passport.d.ts +0 -5
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +0 -7
- package/lib/UserCenter/components/storage/disconnect.d.ts +0 -2
- package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
- package/lib/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/lib/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/lib/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/lib/UserCenter/components/storage/index.d.ts +0 -2
- package/lib/UserCenter/components/third-party-login/index.d.ts +0 -4
- package/lib/UserCenter/components/user-info/switch-role.d.ts +0 -7
- package/lib/UserCenter/components/user-info/user-info.d.ts +0 -6
- package/lib/common/domain-warning.d.ts +0 -17
- package/lib/common/header-addons.d.ts +0 -27
- package/lib/types.d.ts +0 -2
- /package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/locales.d.ts +0 -0
- /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/index.d.ts +0 -0
- /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/libs/locales.d.ts +0 -0
- /package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-width.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/index.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/index.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/locales.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/index.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/locales.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/utils.d.ts +0 -0
- /package/lib/{blocklets.d.ts → packages/blocklet-ui-react/src/blocklets.d.ts} +0 -0
- /package/lib/{common → packages/blocklet-ui-react/src/common}/wallet-hidden-topbar.d.ts +0 -0
- /package/lib/{common → packages/blocklet-ui-react/src/common}/ws.d.ts +0 -0
- /package/lib/{hooks → packages/blocklet-ui-react/src/hooks}/use-mobile.d.ts +0 -0
- /package/lib/{index.d.ts → packages/blocklet-ui-react/src/index.d.ts} +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/client.d.ts +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/constant.d.ts +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/spaces.d.ts +0 -0
- /package/lib/{utils.d.ts → packages/blocklet-ui-react/src/utils.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { use } from 'react';
|
|
2
2
|
import { Box, CircularProgress, Divider, Typography } from '@mui/material';
|
|
3
3
|
import type { BoxProps } from '@mui/material';
|
|
4
4
|
import { useCreation, useMemoizedFn, useRequest } from 'ahooks';
|
|
@@ -111,7 +111,7 @@ export default function UserCenter({
|
|
|
111
111
|
const t = useMemoizedFn((key, data = {}) => {
|
|
112
112
|
return translate(translations, key, locale, 'en', data);
|
|
113
113
|
});
|
|
114
|
-
const sessionCtx: TSessionContext =
|
|
114
|
+
const sessionCtx: TSessionContext = use(SessionContext);
|
|
115
115
|
const session = sessionCtx?.session;
|
|
116
116
|
|
|
117
117
|
const currentDid = useCreation(() => {
|
|
@@ -502,12 +502,17 @@ export default function UserCenter({
|
|
|
502
502
|
|
|
503
503
|
return (
|
|
504
504
|
<ContentWrapper display="flex" flexDirection={isMobile ? 'column' : 'row'}>
|
|
505
|
-
<Box
|
|
505
|
+
<Box
|
|
506
|
+
className="user-center-tabs"
|
|
507
|
+
sx={{
|
|
508
|
+
flex: '1',
|
|
509
|
+
order: isMobile ? 2 : 'unset',
|
|
510
|
+
}}>
|
|
506
511
|
{userCenterTabs.length > 0 && currentTab ? (
|
|
507
512
|
<Box
|
|
508
|
-
display="flex"
|
|
509
|
-
flexDirection="column"
|
|
510
513
|
sx={{
|
|
514
|
+
display: 'flex',
|
|
515
|
+
flexDirection: 'column',
|
|
511
516
|
height: '100%',
|
|
512
517
|
overflow: 'auto',
|
|
513
518
|
padding: '1px',
|
|
@@ -58,7 +58,13 @@ export default function AddressEditor({
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
|
-
<Box
|
|
61
|
+
<Box
|
|
62
|
+
sx={{
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flexDirection: 'column',
|
|
65
|
+
gap: 2,
|
|
66
|
+
mt: 2,
|
|
67
|
+
}}>
|
|
62
68
|
<EditableField
|
|
63
69
|
placeholder={t('profile.address.country')}
|
|
64
70
|
value={address.country || defaultCountry}
|
|
@@ -76,8 +82,11 @@ export default function AddressEditor({
|
|
|
76
82
|
sx={selectStyle}
|
|
77
83
|
/>
|
|
78
84
|
</EditableField>
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
<Box
|
|
86
|
+
sx={{
|
|
87
|
+
display: 'flex',
|
|
88
|
+
gap: 2,
|
|
89
|
+
}}>
|
|
81
90
|
<EditableField
|
|
82
91
|
value={address.province || ''}
|
|
83
92
|
onChange={(value) => handleChange('province', value)}
|
|
@@ -96,7 +105,6 @@ export default function AddressEditor({
|
|
|
96
105
|
errorMsg={errors.city}
|
|
97
106
|
/>
|
|
98
107
|
</Box>
|
|
99
|
-
|
|
100
108
|
<EditableField
|
|
101
109
|
value={address.line1 || ''}
|
|
102
110
|
onChange={(value) => handleChange('line1', value)}
|
|
@@ -107,7 +115,6 @@ export default function AddressEditor({
|
|
|
107
115
|
rows={2}
|
|
108
116
|
errorMsg={errors.line1}
|
|
109
117
|
/>
|
|
110
|
-
|
|
111
118
|
<EditableField
|
|
112
119
|
value={address.line2 || ''}
|
|
113
120
|
onChange={(value) => handleChange('line2', value)}
|
|
@@ -118,7 +125,6 @@ export default function AddressEditor({
|
|
|
118
125
|
rows={2}
|
|
119
126
|
errorMsg={errors.line2}
|
|
120
127
|
/>
|
|
121
|
-
|
|
122
128
|
<EditableField
|
|
123
129
|
value={address.postalCode || ''}
|
|
124
130
|
onChange={(value) => handleChange('postalCode', value)}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import AddIcon from '@mui/icons-material
|
|
4
|
-
import useTheme from '@mui/material/styles/useTheme';
|
|
5
|
-
import { ChangeEvent, useEffect, useMemo, useState } from 'react';
|
|
1
|
+
import { ChangeEvent, useMemo, useState } from 'react';
|
|
2
|
+
import { Box, Button, FormControl, IconButton, styled, TextField, Typography, useTheme } from '@mui/material';
|
|
3
|
+
import { Remove as RemoveIcon, Add as AddIcon } from '@mui/icons-material';
|
|
6
4
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
7
5
|
import { useMemoizedFn } from 'ahooks';
|
|
8
6
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
7
|
import LinkIcon from '@arcblock/icons/lib/Link';
|
|
11
8
|
import { mergeSx } from '@arcblock/ux/lib/Util/style';
|
|
12
|
-
import {
|
|
9
|
+
import { withoutProtocol } from 'ufo';
|
|
13
10
|
import { isValidUrl } from './utils';
|
|
14
11
|
import { translations } from '../../libs/locales';
|
|
15
12
|
import { commonInputStyle, inputFieldStyle } from '../editable-field';
|
|
@@ -96,15 +93,30 @@ function DynamicLinkForm({ links = [], onChange }: { links: string[]; onChange:
|
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
return (
|
|
99
|
-
<Box
|
|
100
|
-
|
|
96
|
+
<Box
|
|
97
|
+
sx={{
|
|
98
|
+
width: '100%',
|
|
99
|
+
}}>
|
|
100
|
+
<Box
|
|
101
|
+
sx={{
|
|
102
|
+
display: 'flex',
|
|
103
|
+
justifyContent: 'space-between',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
gap: 1,
|
|
106
|
+
}}>
|
|
101
107
|
<Typography variant="subtitle1" gutterBottom sx={{ mb: 0, fontSize: '12px', color: 'text.primary' }}>
|
|
102
108
|
{t('profile.socialMedia')}
|
|
103
109
|
</Typography>
|
|
104
110
|
</Box>
|
|
105
111
|
{links.map((link, index) => (
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
<Box
|
|
113
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
114
|
+
key={index}
|
|
115
|
+
sx={{
|
|
116
|
+
display: 'flex',
|
|
117
|
+
alignItems: 'flex-start',
|
|
118
|
+
mb: 1,
|
|
119
|
+
}}>
|
|
108
120
|
<LinkInput
|
|
109
121
|
value={link}
|
|
110
122
|
onChange={(value) => handleInputChange(index, value)}
|
|
@@ -146,49 +158,16 @@ function DynamicLinkForm({ links = [], onChange }: { links: string[]; onChange:
|
|
|
146
158
|
* favicon 预览
|
|
147
159
|
*/
|
|
148
160
|
function FaviconPreview({ link }: { link: string }) {
|
|
149
|
-
const [favicon, setFavicon] = useState('');
|
|
150
|
-
const [iconError, setIconError] = useState(false); // 控制是否显示默认图标
|
|
151
161
|
const theme = useTheme();
|
|
152
162
|
const isDark = theme.palette.mode === 'dark';
|
|
153
163
|
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
try {
|
|
156
|
-
if (link) {
|
|
157
|
-
const url = new URL(link);
|
|
158
|
-
const faviconUrl = joinURL(url.origin, 'favicon.ico');
|
|
159
|
-
|
|
160
|
-
// 尝试加载 Favicon
|
|
161
|
-
const img = new Image();
|
|
162
|
-
img.src = faviconUrl;
|
|
163
|
-
// TODO: CSP 导致解析失败
|
|
164
|
-
img.onload = () => {
|
|
165
|
-
setFavicon(faviconUrl);
|
|
166
|
-
setIconError(false);
|
|
167
|
-
};
|
|
168
|
-
img.onerror = () => {
|
|
169
|
-
setIconError(true);
|
|
170
|
-
setFavicon('');
|
|
171
|
-
};
|
|
172
|
-
} else {
|
|
173
|
-
setIconError(true);
|
|
174
|
-
setFavicon('');
|
|
175
|
-
}
|
|
176
|
-
} catch (error) {
|
|
177
|
-
setIconError(true); // URL 解析失败,直接回退到默认图标
|
|
178
|
-
}
|
|
179
|
-
}, [link]);
|
|
180
|
-
|
|
181
164
|
if (!link) {
|
|
182
165
|
return null;
|
|
183
166
|
}
|
|
184
167
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return <img src={favicon} alt="Favicon" width={20} height={20} />;
|
|
168
|
+
return (
|
|
169
|
+
<LinkIcon width={20} height={20} style={{ filter: isDark ? 'brightness(0) saturate(100%) invert(1)' : 'none' }} />
|
|
170
|
+
);
|
|
192
171
|
}
|
|
193
172
|
|
|
194
173
|
export function LinkPreviewInput({
|
|
@@ -205,14 +184,20 @@ export function LinkPreviewInput({
|
|
|
205
184
|
}
|
|
206
185
|
|
|
207
186
|
return (
|
|
208
|
-
<Box
|
|
187
|
+
<Box
|
|
188
|
+
sx={{
|
|
189
|
+
width: '100%',
|
|
190
|
+
display: 'flex',
|
|
191
|
+
flexDirection: 'column',
|
|
192
|
+
gap: 2,
|
|
193
|
+
}}>
|
|
209
194
|
{links.map((link) => (
|
|
210
195
|
<Box
|
|
211
196
|
key={link}
|
|
212
|
-
display="flex"
|
|
213
|
-
alignItems="center"
|
|
214
|
-
gap={1}
|
|
215
197
|
sx={{
|
|
198
|
+
display: 'flex',
|
|
199
|
+
alignItems: 'center',
|
|
200
|
+
gap: 1,
|
|
216
201
|
overflow: 'hidden',
|
|
217
202
|
width: '100%',
|
|
218
203
|
}}>
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/* eslint-disable react/no-unstable-nested-components */
|
|
2
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
1
|
import { Icon } from '@iconify/react';
|
|
4
2
|
import { Box, Backdrop, useMediaQuery, SwipeableDrawer, Typography, Tooltip } from '@mui/material';
|
|
5
3
|
import type { BackdropProps } from '@mui/material';
|
|
6
4
|
|
|
7
5
|
import styled from '@emotion/styled';
|
|
8
|
-
import { joinURL } from 'ufo';
|
|
9
6
|
import Button from '@arcblock/ux/lib/Button';
|
|
10
7
|
import PhoneInput, {
|
|
11
8
|
PhoneValue,
|
|
@@ -19,7 +16,7 @@ import omit from 'lodash/omit';
|
|
|
19
16
|
import { mergeSx } from '@arcblock/ux/lib/Util/style';
|
|
20
17
|
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
21
18
|
import { useCreation, useMemoizedFn, useReactive } from 'ahooks';
|
|
22
|
-
import { useMemo, useRef, useState, memo,
|
|
19
|
+
import { useMemo, useRef, useState, memo, useEffect, lazy } from 'react';
|
|
23
20
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
24
21
|
import isEmail from 'validator/lib/isEmail';
|
|
25
22
|
import isPostalCode from 'validator/lib/isPostalCode';
|
|
@@ -47,23 +44,27 @@ const iconSize = {
|
|
|
47
44
|
|
|
48
45
|
const bioMaxLength = 200;
|
|
49
46
|
|
|
50
|
-
const BackdropWrap = memo(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
const BackdropWrap = memo(function BackdropWrap({
|
|
48
|
+
ref,
|
|
49
|
+
...backdropProps
|
|
50
|
+
}: BackdropProps & {
|
|
51
|
+
// eslint-disable-next-line react/require-default-props
|
|
52
|
+
ref?: React.Ref<unknown>;
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<Backdrop
|
|
56
|
+
ref={ref}
|
|
57
|
+
component="div"
|
|
58
|
+
style={{
|
|
59
|
+
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
60
|
+
backdropFilter: 'blur(3px)',
|
|
61
|
+
touchAction: 'none',
|
|
62
|
+
}}
|
|
63
|
+
{...backdropProps}
|
|
64
|
+
key="background"
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
});
|
|
67
68
|
|
|
68
69
|
// 添加 displayName
|
|
69
70
|
BackdropWrap.displayName = 'BackdropWrap';
|
|
@@ -269,7 +270,7 @@ export default function UserMetadataComponent({
|
|
|
269
270
|
}
|
|
270
271
|
return {
|
|
271
272
|
url: link,
|
|
272
|
-
favicon:
|
|
273
|
+
favicon: link,
|
|
273
274
|
};
|
|
274
275
|
});
|
|
275
276
|
onChange(newLinks, 'links');
|
|
@@ -363,7 +364,6 @@ export default function UserMetadataComponent({
|
|
|
363
364
|
{t('profile.editProfile')}
|
|
364
365
|
</Button>
|
|
365
366
|
) : null}
|
|
366
|
-
|
|
367
367
|
{editing && isMyself && isSupportAddress ? (
|
|
368
368
|
<AddressEditor
|
|
369
369
|
address={address}
|
|
@@ -388,7 +388,13 @@ export default function UserMetadataComponent({
|
|
|
388
388
|
}
|
|
389
389
|
return (
|
|
390
390
|
<Box key={k}>
|
|
391
|
-
<Typography
|
|
391
|
+
<Typography
|
|
392
|
+
variant="caption"
|
|
393
|
+
component="p"
|
|
394
|
+
sx={{
|
|
395
|
+
fontWeight: 600,
|
|
396
|
+
mb: 0,
|
|
397
|
+
}}>
|
|
392
398
|
{t(`profile.address.${k}`)}
|
|
393
399
|
</Typography>
|
|
394
400
|
<Typography variant="caption" component="span">
|
|
@@ -410,7 +416,6 @@ export default function UserMetadataComponent({
|
|
|
410
416
|
icon={<LocationIcon {...iconSize} />}
|
|
411
417
|
/>
|
|
412
418
|
)}
|
|
413
|
-
|
|
414
419
|
<EditableField
|
|
415
420
|
value={metadata.timezone || currentTimezone}
|
|
416
421
|
onChange={(value) => onChange(value, 'timezone')}
|
|
@@ -428,7 +433,6 @@ export default function UserMetadataComponent({
|
|
|
428
433
|
mode={mode}
|
|
429
434
|
/>
|
|
430
435
|
</EditableField>
|
|
431
|
-
|
|
432
436
|
<EditableField
|
|
433
437
|
value={metadata.email ?? user?.email ?? ''}
|
|
434
438
|
editable={editing}
|
|
@@ -477,7 +481,6 @@ export default function UserMetadataComponent({
|
|
|
477
481
|
validateMsg.email = msg;
|
|
478
482
|
}}
|
|
479
483
|
/>
|
|
480
|
-
|
|
481
484
|
<EditableField
|
|
482
485
|
value={phoneValue.phone}
|
|
483
486
|
editable={editing}
|
|
@@ -519,15 +522,16 @@ export default function UserMetadataComponent({
|
|
|
519
522
|
}}
|
|
520
523
|
/>
|
|
521
524
|
</EditableField>
|
|
522
|
-
|
|
523
525
|
<LinkPreviewInput editable={editing} links={links} onChange={handleLinksChange} />
|
|
524
526
|
{editing && isMyself ? (
|
|
525
527
|
<Box
|
|
526
|
-
display="flex"
|
|
527
|
-
gap={1}
|
|
528
528
|
style={{ width: '100%' }}
|
|
529
|
-
|
|
530
|
-
|
|
529
|
+
sx={{
|
|
530
|
+
display: 'flex',
|
|
531
|
+
gap: 1,
|
|
532
|
+
justifyContent: 'flex-end',
|
|
533
|
+
flexDirection: mode === 'drawer' ? 'column' : 'row',
|
|
534
|
+
}}>
|
|
531
535
|
<Button
|
|
532
536
|
fullWidth={mode === 'drawer'}
|
|
533
537
|
size="small"
|
|
@@ -573,12 +577,14 @@ export default function UserMetadataComponent({
|
|
|
573
577
|
slots={{
|
|
574
578
|
backdrop: BackdropWrap,
|
|
575
579
|
}}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
slotProps={{
|
|
581
|
+
paper: {
|
|
582
|
+
sx: {
|
|
583
|
+
boxShadow: '0px -2px 16px 0px rgba(0, 0, 0, 0.08)',
|
|
584
|
+
borderRadius: 1.5, // 保持跟 DID Wallet 一致
|
|
585
|
+
borderBottomLeftRadius: 0,
|
|
586
|
+
borderBottomRightRadius: 0,
|
|
587
|
+
},
|
|
582
588
|
},
|
|
583
589
|
}}>
|
|
584
590
|
<Box
|
|
@@ -598,8 +604,8 @@ export default function UserMetadataComponent({
|
|
|
598
604
|
/>
|
|
599
605
|
</Box>
|
|
600
606
|
<Box
|
|
601
|
-
p={2}
|
|
602
607
|
sx={{
|
|
608
|
+
p: 2,
|
|
603
609
|
maxHeight: '500px',
|
|
604
610
|
overflowY: 'auto',
|
|
605
611
|
}}>
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo } from 'react';
|
|
2
|
-
import MenuItem from '@mui/material
|
|
3
|
-
import Select, { SelectChangeEvent } from '@mui/material/Select';
|
|
4
|
-
import ListSubheader from '@mui/material/ListSubheader';
|
|
5
|
-
import TextField from '@mui/material/TextField';
|
|
2
|
+
import { MenuItem, Select, SelectChangeEvent, ListSubheader, TextField } from '@mui/material';
|
|
6
3
|
import debounce from 'lodash/debounce';
|
|
7
|
-
import KeyboardArrowDownIcon from '@mui/icons-material
|
|
4
|
+
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
8
5
|
import { getTimezones } from './utils';
|
|
9
6
|
|
|
10
7
|
const timezones = getTimezones();
|
|
@@ -10,8 +10,10 @@ import { useEffect, useState } from 'react';
|
|
|
10
10
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
11
11
|
import type { AxiosError } from 'axios';
|
|
12
12
|
import { parseURL, joinURL } from 'ufo';
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
KeyboardArrowDown as KeyboardArrowDownIcon,
|
|
15
|
+
KeyboardArrowUp as KeyboardArrowUpIcon,
|
|
16
|
+
} from '@mui/icons-material';
|
|
15
17
|
|
|
16
18
|
import { translations } from '../../libs/locales';
|
|
17
19
|
import type { User, UserAddress, UserMetadata } from '../../../@types';
|
|
@@ -134,13 +136,21 @@ export default function UserBasicInfo({
|
|
|
134
136
|
position: 'relative',
|
|
135
137
|
...(rest.sx ?? {}),
|
|
136
138
|
}}>
|
|
137
|
-
<Box
|
|
139
|
+
<Box
|
|
140
|
+
className="user-info"
|
|
141
|
+
sx={{
|
|
142
|
+
display: 'flex',
|
|
143
|
+
flexDirection: isMobile ? 'row' : 'column',
|
|
144
|
+
gap: 2,
|
|
145
|
+
}}>
|
|
138
146
|
<Box
|
|
139
147
|
className="user-avatar"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
sx={{
|
|
149
|
+
position: 'relative',
|
|
150
|
+
display: 'flex',
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
justifyContent: 'space-between',
|
|
153
|
+
}}>
|
|
144
154
|
<Avatar
|
|
145
155
|
// @ts-ignore
|
|
146
156
|
src={user?.avatar}
|
|
@@ -241,7 +251,13 @@ export default function UserBasicInfo({
|
|
|
241
251
|
</Box>
|
|
242
252
|
) : null}
|
|
243
253
|
<Collapse in={expanded} timeout="auto">
|
|
244
|
-
<Typography
|
|
254
|
+
<Typography
|
|
255
|
+
component="p"
|
|
256
|
+
sx={{
|
|
257
|
+
color: 'text.secondary',
|
|
258
|
+
fontSize: '14px',
|
|
259
|
+
mb: 2,
|
|
260
|
+
}}>
|
|
245
261
|
{t('profile.justForYou')}
|
|
246
262
|
</Typography>
|
|
247
263
|
<UserInfo user={user} isMySelf={isMyself} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, BoxProps, Typography } from '@mui/material';
|
|
2
|
-
import VerifiedIcon from '@mui/icons-material
|
|
2
|
+
import { Verified as VerifiedIcon } from '@mui/icons-material';
|
|
3
3
|
|
|
4
4
|
type TUserInfoItemProps = {
|
|
5
5
|
data: {
|
|
@@ -32,7 +32,12 @@ export default function UserInfoItem({ data, verified, ...rest }: TUserInfoItemP
|
|
|
32
32
|
{data.icon}
|
|
33
33
|
{data.title}
|
|
34
34
|
</Typography>
|
|
35
|
-
<Box
|
|
35
|
+
<Box
|
|
36
|
+
sx={{
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
}}>
|
|
36
41
|
<Typography
|
|
37
42
|
sx={{
|
|
38
43
|
color: 'text.secondary',
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import Badge from '@mui/material/Badge';
|
|
3
|
-
import Box from '@mui/material/Box';
|
|
1
|
+
import { Box, Badge, Tooltip, type SvgIconProps } from '@mui/material';
|
|
4
2
|
import styled from '@emotion/styled';
|
|
5
3
|
import { lazy, Suspense, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
4
|
import { useCreation, useMemoizedFn, useInterval, useUnmount } from 'ahooks';
|
|
7
5
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
8
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
9
6
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
10
|
-
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
11
7
|
import { formatToDatetime } from '@arcblock/ux/lib/Util';
|
|
12
8
|
import type { UserMetadata } from '../../../@types';
|
|
13
9
|
import { DurationEnum, StatusEnum } from '../../../@types';
|
|
@@ -184,10 +180,12 @@ export default function UserStatus({
|
|
|
184
180
|
<Tooltip title={tooltipTitle}>
|
|
185
181
|
<Box
|
|
186
182
|
className="status-icon"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
183
|
+
onClick={onOpenStatusSelector}
|
|
184
|
+
sx={{
|
|
185
|
+
display: 'flex',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
justifyContent: 'center',
|
|
188
|
+
}}>
|
|
191
189
|
{StatusIcon ? (
|
|
192
190
|
<Suspense fallback={null}>
|
|
193
191
|
<StatusIcon style={{ width: 16, height: 16 }} />
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import moment from 'moment-timezone';
|
|
2
1
|
import dayjs from 'dayjs';
|
|
2
|
+
import timezone from 'dayjs/plugin/timezone';
|
|
3
|
+
import utc from 'dayjs/plugin/utc';
|
|
3
4
|
import { DurationEnum, UserMetadata } from '../../../@types';
|
|
4
5
|
|
|
6
|
+
// 扩展 dayjs 插件
|
|
7
|
+
dayjs.extend(utc);
|
|
8
|
+
dayjs.extend(timezone);
|
|
9
|
+
|
|
5
10
|
const HOUR = 3600;
|
|
6
11
|
const MINUTES_30 = 1800;
|
|
7
12
|
const MINUTES_10 = 600;
|
|
@@ -9,19 +14,80 @@ const MINUTES_5 = 300;
|
|
|
9
14
|
const MINUTES_1 = 60;
|
|
10
15
|
const SECOND = 1;
|
|
11
16
|
|
|
12
|
-
export const currentTimezone =
|
|
17
|
+
export const currentTimezone = dayjs.tz.guess();
|
|
18
|
+
|
|
19
|
+
// 常用时区列表,作为兼容性 fallback
|
|
20
|
+
const COMMON_TIMEZONES = [
|
|
21
|
+
'America/New_York',
|
|
22
|
+
'America/Chicago',
|
|
23
|
+
'America/Denver',
|
|
24
|
+
'America/Los_Angeles',
|
|
25
|
+
'Europe/London',
|
|
26
|
+
'Europe/Paris',
|
|
27
|
+
'Europe/Berlin',
|
|
28
|
+
'Europe/Rome',
|
|
29
|
+
'Asia/Tokyo',
|
|
30
|
+
'Asia/Shanghai',
|
|
31
|
+
'Asia/Hong_Kong',
|
|
32
|
+
'Asia/Singapore',
|
|
33
|
+
'Asia/Seoul',
|
|
34
|
+
'Asia/Kolkata',
|
|
35
|
+
'Australia/Sydney',
|
|
36
|
+
'Australia/Melbourne',
|
|
37
|
+
'Pacific/Auckland',
|
|
38
|
+
'America/Sao_Paulo',
|
|
39
|
+
'America/Mexico_City',
|
|
40
|
+
'Africa/Cairo',
|
|
41
|
+
'UTC',
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// 获取时区列表的兼容性函数
|
|
45
|
+
const getTimezoneList = () => {
|
|
46
|
+
// 优先使用现代 API
|
|
47
|
+
if (typeof Intl !== 'undefined' && Intl.supportedValuesOf) {
|
|
48
|
+
try {
|
|
49
|
+
return Intl.supportedValuesOf('timeZone');
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.warn('Intl.supportedValuesOf not supported, falling back to common timezones');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
13
54
|
|
|
14
|
-
|
|
15
|
-
|
|
55
|
+
// 尝试使用 Intl.DateTimeFormat 获取时区
|
|
56
|
+
if (typeof Intl !== 'undefined' && Intl.DateTimeFormat) {
|
|
57
|
+
try {
|
|
58
|
+
// 使用 resolvedOptions 检测当前时区是否可用
|
|
59
|
+
const formatter = new Intl.DateTimeFormat('en', { timeZone: 'UTC' });
|
|
60
|
+
if (formatter.resolvedOptions().timeZone) {
|
|
61
|
+
return COMMON_TIMEZONES;
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.warn('Intl.DateTimeFormat timezone support limited');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
16
67
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const minutes = (offset % 1) * 60;
|
|
21
|
-
const label = `GMT${hours >= 0 ? '+' : ''}${hours}:${minutes === 30 ? '30' : '00'}`;
|
|
68
|
+
// 最后的 fallback
|
|
69
|
+
return COMMON_TIMEZONES;
|
|
70
|
+
};
|
|
22
71
|
|
|
23
|
-
|
|
24
|
-
|
|
72
|
+
export const getTimezones = () => {
|
|
73
|
+
const timezones = getTimezoneList();
|
|
74
|
+
|
|
75
|
+
const formattedTimezones = timezones
|
|
76
|
+
.map((tz) => {
|
|
77
|
+
try {
|
|
78
|
+
const offset = dayjs.tz(dayjs(), tz).utcOffset() / 60; // 计算 UTC 偏移 (小时)
|
|
79
|
+
const hours = Math.floor(offset);
|
|
80
|
+
const minutes = (offset % 1) * 60;
|
|
81
|
+
const label = `GMT${hours >= 0 ? '+' : ''}${hours}:${minutes === 30 ? '30' : '00'}`;
|
|
82
|
+
|
|
83
|
+
return { label, value: tz };
|
|
84
|
+
} catch (error) {
|
|
85
|
+
// 如果时区不支持,跳过
|
|
86
|
+
console.warn(`Timezone ${tz} not supported, skipping`);
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
.filter((tz): tz is { label: string; value: string } => tz !== null); // 类型守卫
|
|
25
91
|
|
|
26
92
|
return formattedTimezones
|
|
27
93
|
.sort((a, b) => {
|
|
@@ -177,8 +177,10 @@ export default function WebhookItem({
|
|
|
177
177
|
checkUrl();
|
|
178
178
|
}}
|
|
179
179
|
error={!!currentState.error}
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
slotProps={{
|
|
181
|
+
input: {
|
|
182
|
+
endAdornment: <InputAdornment position="end">{inputAdornment}</InputAdornment>,
|
|
183
|
+
},
|
|
182
184
|
}}
|
|
183
185
|
/>
|
|
184
186
|
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState, useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import Box from '@mui/material/Box';
|
|
5
|
-
import Typography from '@mui/material/Typography';
|
|
6
|
-
import Button from '@mui/material/Button';
|
|
7
|
-
import Dialog from '@mui/material/Dialog';
|
|
8
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
9
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
10
|
-
|
|
3
|
+
import { Box, Typography, Button, Dialog, DialogActions, DialogContent } from '@mui/material';
|
|
11
4
|
import { useMemoizedFn } from 'ahooks';
|
|
12
5
|
import { translate } from '@arcblock/ux/lib/Locale/util';
|
|
13
6
|
import { joinURL } from 'ufo';
|
|
@@ -67,7 +60,7 @@ const ONE_MONTH = 1000 * 60 * 60 * 24 * 30;
|
|
|
67
60
|
|
|
68
61
|
const DASHBOARD_DOMAIN = '.well-known/service/admin/domains';
|
|
69
62
|
|
|
70
|
-
export default function DomainWarning({ locale, session }) {
|
|
63
|
+
export default function DomainWarning({ locale = 'en', session = {} }) {
|
|
71
64
|
const user = session?.user;
|
|
72
65
|
const isMobile = useMobile();
|
|
73
66
|
|
|
@@ -183,8 +176,3 @@ DomainWarning.propTypes = {
|
|
|
183
176
|
locale: PropTypes.string,
|
|
184
177
|
session: PropTypes.object,
|
|
185
178
|
};
|
|
186
|
-
|
|
187
|
-
DomainWarning.defaultProps = {
|
|
188
|
-
locale: 'en',
|
|
189
|
-
session: {},
|
|
190
|
-
};
|