@blocklet/ui-react 2.13.70 → 3.0.0
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 +90 -66
- 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 +159 -156
- package/lib/UserCenter/components/user-info/metadata.js +291 -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 +52 -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 +29 -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 +23 -5
- 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 +31 -13
- package/src/UserCenter/components/user-info/metadata.tsx +44 -37
- 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/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,142 +1,129 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Alert, Box, CircularProgress
|
|
3
|
-
import {
|
|
4
|
-
import { Icon } from "@iconify/react";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { getWalletDid } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
10
|
-
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
11
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
12
|
-
import
|
|
13
|
-
import { translations } from "../libs/locales.js";
|
|
14
|
-
import
|
|
15
|
-
import { formatAxiosError } from "../libs/utils.js";
|
|
16
|
-
import { client } from "../../libs/client.js";
|
|
17
|
-
function
|
|
18
|
-
title,
|
|
19
|
-
description,
|
|
20
|
-
value,
|
|
21
|
-
onChange,
|
|
22
|
-
isMobile
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { Alert as T, Box as w, CircularProgress as j, Typography as S, Stack as F } from "@mui/material";
|
|
3
|
+
import { useMemoizedFn as c, useReactive as B, useRequest as E, useCreation as C } from "ahooks";
|
|
4
|
+
import { Icon as G } from "@iconify/react";
|
|
5
|
+
import L from "@iconify-icons/material-symbols/add-rounded";
|
|
6
|
+
import M from "@arcblock/ux/lib/Switch";
|
|
7
|
+
import P from "@arcblock/ux/lib/Button";
|
|
8
|
+
import f from "@arcblock/ux/lib/Toast";
|
|
9
|
+
import { getWalletDid as A } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
10
|
+
import { translate as U } from "@arcblock/ux/lib/Locale/util";
|
|
11
|
+
import { useLocaleContext as _ } from "@arcblock/ux/lib/Locale/context";
|
|
12
|
+
import $ from "@arcblock/ux/lib/DID";
|
|
13
|
+
import { translations as q } from "../libs/locales.js";
|
|
14
|
+
import D from "./webhook-item.js";
|
|
15
|
+
import { formatAxiosError as I } from "../libs/utils.js";
|
|
16
|
+
import { client as y } from "../../libs/client.js";
|
|
17
|
+
function g({
|
|
18
|
+
title: a,
|
|
19
|
+
description: s,
|
|
20
|
+
value: m,
|
|
21
|
+
onChange: i,
|
|
22
|
+
isMobile: n
|
|
23
23
|
}) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const t = c((l) => {
|
|
25
|
+
l.stopPropagation();
|
|
26
26
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
return /* @__PURE__ */ h(
|
|
28
|
+
w,
|
|
29
|
+
{
|
|
30
|
+
sx: {
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
gap: 1
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ r(M, { checked: m, size: "small", onChange: i }),
|
|
37
|
+
/* @__PURE__ */ h(
|
|
38
|
+
S,
|
|
39
|
+
{
|
|
40
|
+
onClick: t,
|
|
41
|
+
sx: {
|
|
42
|
+
color: "text.primary",
|
|
43
|
+
fontSize: 14,
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexWrap: n ? "wrap" : "nowrap",
|
|
46
|
+
columnGap: 1,
|
|
47
|
+
flex: 1,
|
|
48
|
+
whiteSpace: n ? "normal" : "nowrap"
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
a,
|
|
52
|
+
s
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
49
59
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
showAdd: false
|
|
57
|
-
});
|
|
58
|
-
const notificationConfigState = useRequest(
|
|
59
|
-
async () => {
|
|
60
|
-
const data = await client.user.getUserNotificationConfig();
|
|
61
|
-
return data;
|
|
62
|
-
},
|
|
60
|
+
function ne({ user: a, isMobile: s }) {
|
|
61
|
+
var b, v;
|
|
62
|
+
const { locale: m } = _(), i = c((e, o = {}) => U(q, e, m, "en", o)), n = B({
|
|
63
|
+
showAdd: !1
|
|
64
|
+
}), t = E(
|
|
65
|
+
async () => await y.user.getUserNotificationConfig(),
|
|
63
66
|
{
|
|
64
|
-
refreshDeps: [
|
|
67
|
+
refreshDeps: [a],
|
|
65
68
|
loadingDelay: 300
|
|
66
69
|
}
|
|
67
|
-
)
|
|
68
|
-
|
|
70
|
+
), l = C(() => {
|
|
71
|
+
var e;
|
|
69
72
|
return {
|
|
70
|
-
wallet:
|
|
71
|
-
email:
|
|
72
|
-
phone:
|
|
73
|
-
push:
|
|
74
|
-
...
|
|
73
|
+
wallet: !0,
|
|
74
|
+
email: !0,
|
|
75
|
+
phone: !1,
|
|
76
|
+
push: !0,
|
|
77
|
+
...((e = t == null ? void 0 : t.data) == null ? void 0 : e.notifications) || {}
|
|
75
78
|
};
|
|
76
|
-
}, [
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
}, [
|
|
80
|
-
const onSaveChanges = useMemoizedFn(async (values) => {
|
|
79
|
+
}, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.notifications]), p = C(() => {
|
|
80
|
+
var e;
|
|
81
|
+
return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.webhooks) || [];
|
|
82
|
+
}, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.webhooks]), u = c(async (e) => {
|
|
81
83
|
try {
|
|
82
|
-
await
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} catch (err) {
|
|
86
|
-
Toast.error(formatAxiosError(err));
|
|
84
|
+
await y.user.saveUserNotificationConfig(e), f.success(i("saveSuccess")), t.run();
|
|
85
|
+
} catch (o) {
|
|
86
|
+
f.error(I(o));
|
|
87
87
|
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
await onSaveChanges({
|
|
88
|
+
}), x = c(async (e, o) => {
|
|
89
|
+
await u({
|
|
91
90
|
notifications: {
|
|
92
|
-
[
|
|
91
|
+
[e]: o
|
|
93
92
|
}
|
|
94
93
|
});
|
|
95
|
-
})
|
|
96
|
-
const handleTestWebhook = async (data) => {
|
|
94
|
+
}), k = async (e) => {
|
|
97
95
|
try {
|
|
98
|
-
await
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Toast.error(formatAxiosError(err));
|
|
96
|
+
await y.user.testNotificationWebhook(e), f.success(i("webhookTested"));
|
|
97
|
+
} catch (o) {
|
|
98
|
+
f.error(I(o));
|
|
102
99
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
webhooks: webhooks.filter((_, i) => i !== index)
|
|
100
|
+
}, W = c(async (e) => {
|
|
101
|
+
await u({
|
|
102
|
+
webhooks: p.filter((o, d) => d !== e)
|
|
107
103
|
});
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
webhooks: webhooks.map((item, i) => i === index ? webhook : item)
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
const handleAddWebhook = useMemoizedFn(async (webhook) => {
|
|
115
|
-
await onSaveChanges({
|
|
116
|
-
webhooks: [...webhooks, webhook]
|
|
104
|
+
}), N = c(async (e, o) => {
|
|
105
|
+
await u({
|
|
106
|
+
webhooks: p.map((d, R) => R === e ? o : d)
|
|
117
107
|
});
|
|
118
|
-
|
|
108
|
+
}), z = c(async (e) => {
|
|
109
|
+
await u({
|
|
110
|
+
webhooks: [...p, e]
|
|
111
|
+
}), n.showAdd = !1;
|
|
119
112
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
138
|
-
/* @__PURE__ */ jsxs(
|
|
139
|
-
Box,
|
|
113
|
+
return t.error ? /* @__PURE__ */ r(T, { severity: "error", children: t.error.message }) : t.loading || !t.data ? /* @__PURE__ */ r(
|
|
114
|
+
w,
|
|
115
|
+
{
|
|
116
|
+
sx: {
|
|
117
|
+
display: "flex",
|
|
118
|
+
justifyContent: "center",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
height: "100px"
|
|
121
|
+
},
|
|
122
|
+
children: /* @__PURE__ */ r(j, {})
|
|
123
|
+
}
|
|
124
|
+
) : /* @__PURE__ */ h(w, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
125
|
+
/* @__PURE__ */ h(
|
|
126
|
+
w,
|
|
140
127
|
{
|
|
141
128
|
sx: {
|
|
142
129
|
display: "flex",
|
|
@@ -171,96 +158,120 @@ export default function Notification({ user, isMobile }) {
|
|
|
171
158
|
}
|
|
172
159
|
},
|
|
173
160
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
161
|
+
/* @__PURE__ */ r(
|
|
162
|
+
g,
|
|
176
163
|
{
|
|
177
|
-
value:
|
|
178
|
-
isMobile,
|
|
179
|
-
title:
|
|
180
|
-
onChange: (
|
|
181
|
-
description:
|
|
182
|
-
|
|
164
|
+
value: l.wallet,
|
|
165
|
+
isMobile: s,
|
|
166
|
+
title: i("walletNotification"),
|
|
167
|
+
onChange: (e) => x("wallet", e.target.checked),
|
|
168
|
+
description: A(a) && /* @__PURE__ */ r(
|
|
169
|
+
$,
|
|
183
170
|
{
|
|
184
|
-
did:
|
|
185
|
-
showQrcode:
|
|
186
|
-
showAvatar: !
|
|
187
|
-
copyable:
|
|
188
|
-
compact:
|
|
189
|
-
responsive:
|
|
190
|
-
locale,
|
|
191
|
-
startChars:
|
|
171
|
+
did: A(a),
|
|
172
|
+
showQrcode: !1,
|
|
173
|
+
showAvatar: !s,
|
|
174
|
+
copyable: !0,
|
|
175
|
+
compact: !0,
|
|
176
|
+
responsive: !0,
|
|
177
|
+
locale: m,
|
|
178
|
+
startChars: s ? 2 : 6
|
|
192
179
|
}
|
|
193
180
|
)
|
|
194
181
|
}
|
|
195
182
|
),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
183
|
+
/* @__PURE__ */ r(
|
|
184
|
+
g,
|
|
198
185
|
{
|
|
199
|
-
value:
|
|
200
|
-
isMobile,
|
|
201
|
-
onChange: (
|
|
202
|
-
title:
|
|
203
|
-
description:
|
|
186
|
+
value: l.email,
|
|
187
|
+
isMobile: s,
|
|
188
|
+
onChange: (e) => x("email", e.target.checked),
|
|
189
|
+
title: i("emailNotification"),
|
|
190
|
+
description: (a == null ? void 0 : a.email) && /* @__PURE__ */ r(
|
|
191
|
+
S,
|
|
192
|
+
{
|
|
193
|
+
component: "span",
|
|
194
|
+
sx: {
|
|
195
|
+
color: "text.secondary",
|
|
196
|
+
fontSize: 13
|
|
197
|
+
},
|
|
198
|
+
children: a == null ? void 0 : a.email
|
|
199
|
+
}
|
|
200
|
+
)
|
|
204
201
|
}
|
|
205
202
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
|
|
203
|
+
/* @__PURE__ */ r(
|
|
204
|
+
g,
|
|
208
205
|
{
|
|
209
|
-
isMobile,
|
|
210
|
-
value:
|
|
211
|
-
title:
|
|
212
|
-
onChange: (
|
|
206
|
+
isMobile: s,
|
|
207
|
+
value: l.push,
|
|
208
|
+
title: i("pushNotification"),
|
|
209
|
+
onChange: (e) => x("push", e.target.checked)
|
|
213
210
|
}
|
|
214
211
|
)
|
|
215
212
|
]
|
|
216
213
|
}
|
|
217
214
|
),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
url: item.url,
|
|
227
|
-
edit: false
|
|
228
|
-
},
|
|
229
|
-
`${index}_${item.url}`
|
|
230
|
-
)),
|
|
231
|
-
currentState.showAdd && /* @__PURE__ */ jsx(
|
|
232
|
-
WebhookItem,
|
|
233
|
-
{
|
|
234
|
-
onTest: handleTestWebhook,
|
|
235
|
-
onCancel: () => {
|
|
236
|
-
currentState.showAdd = false;
|
|
237
|
-
},
|
|
238
|
-
onSave: (...args) => handleAddWebhook(...args),
|
|
239
|
-
edit: true
|
|
215
|
+
/* @__PURE__ */ h(
|
|
216
|
+
F,
|
|
217
|
+
{
|
|
218
|
+
spacing: 1.5,
|
|
219
|
+
useFlexGap: !0,
|
|
220
|
+
direction: "column",
|
|
221
|
+
sx: {
|
|
222
|
+
alignItems: "start"
|
|
240
223
|
},
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
"&:hover": {
|
|
252
|
-
borderColor: "divider"
|
|
224
|
+
children: [
|
|
225
|
+
p.map((e, o) => /* @__PURE__ */ r(
|
|
226
|
+
D,
|
|
227
|
+
{
|
|
228
|
+
onTest: k,
|
|
229
|
+
onDelete: () => W(o),
|
|
230
|
+
onSave: (...d) => N(o, ...d),
|
|
231
|
+
type: e.type,
|
|
232
|
+
url: e.url,
|
|
233
|
+
edit: !1
|
|
253
234
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
235
|
+
`${o}_${e.url}`
|
|
236
|
+
)),
|
|
237
|
+
n.showAdd && /* @__PURE__ */ r(
|
|
238
|
+
D,
|
|
239
|
+
{
|
|
240
|
+
onTest: k,
|
|
241
|
+
onCancel: () => {
|
|
242
|
+
n.showAdd = !1;
|
|
243
|
+
},
|
|
244
|
+
onSave: (...e) => z(...e),
|
|
245
|
+
edit: !0
|
|
246
|
+
},
|
|
247
|
+
"add"
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ r(
|
|
250
|
+
P,
|
|
251
|
+
{
|
|
252
|
+
variant: "outlined",
|
|
253
|
+
size: "small",
|
|
254
|
+
sx: {
|
|
255
|
+
color: "text.primary",
|
|
256
|
+
borderColor: "divider",
|
|
257
|
+
"&:hover": {
|
|
258
|
+
borderColor: "divider"
|
|
259
|
+
},
|
|
260
|
+
py: 0.5,
|
|
261
|
+
borderRadius: 1
|
|
262
|
+
},
|
|
263
|
+
startIcon: /* @__PURE__ */ r(G, { icon: L }),
|
|
264
|
+
onClick: () => {
|
|
265
|
+
n.showAdd = !0;
|
|
266
|
+
},
|
|
267
|
+
children: i("addWebhook")
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
265
273
|
] });
|
|
266
274
|
}
|
|
275
|
+
export {
|
|
276
|
+
ne as default
|
|
277
|
+
};
|
|
@@ -1,54 +1,35 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { useTheme } from "@arcblock/ux/lib/Theme";
|
|
5
|
-
import
|
|
6
|
-
import { PASSPORT_STATUS } from "@arcblock/ux/lib/Util/constant";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
10
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
11
|
-
import { translations } from "../libs/locales.js";
|
|
12
|
-
import { createPassportSvg } from "../libs/utils.js";
|
|
13
|
-
|
|
14
|
-
const { locale } =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const theme = useTheme();
|
|
19
|
-
const passports = useCreation(() => {
|
|
20
|
-
const passportList = (user?.passports || []).map((x) => ({
|
|
21
|
-
...x,
|
|
22
|
-
revoked: x.status === PASSPORT_STATUS.REVOKED
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Box as s } from "@mui/material";
|
|
3
|
+
import y from "@arcblock/ux/lib/Empty";
|
|
4
|
+
import { useTheme as g } from "@arcblock/ux/lib/Theme";
|
|
5
|
+
import h from "@arcblock/ux/lib/Passport";
|
|
6
|
+
import { PASSPORT_STATUS as u } from "@arcblock/ux/lib/Util/constant";
|
|
7
|
+
import { useMemoizedFn as C, useCreation as l } from "ahooks";
|
|
8
|
+
import f from "lodash/uniqBy";
|
|
9
|
+
import { translate as P } from "@arcblock/ux/lib/Locale/util";
|
|
10
|
+
import { useLocaleContext as k } from "@arcblock/ux/lib/Locale/context";
|
|
11
|
+
import { translations as v } from "../libs/locales.js";
|
|
12
|
+
import { createPassportSvg as S } from "../libs/utils.js";
|
|
13
|
+
function D({ user: o, ...a }) {
|
|
14
|
+
const { locale: c } = k(), m = C((t, r = {}) => P(v, t, c, "en", r)), d = g(), e = l(() => {
|
|
15
|
+
const t = ((o == null ? void 0 : o.passports) || []).map((r) => ({
|
|
16
|
+
...r,
|
|
17
|
+
revoked: r.status === u.REVOKED
|
|
23
18
|
}));
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return 0;
|
|
27
|
-
}
|
|
28
|
-
if (a.revoked) {
|
|
29
|
-
return 1;
|
|
30
|
-
}
|
|
31
|
-
return -1;
|
|
32
|
-
});
|
|
33
|
-
return uniqBy(
|
|
34
|
-
passportList.filter((x) => !x.display),
|
|
19
|
+
return t.sort((r, x) => r.revoked === x.revoked ? 0 : r.revoked ? 1 : -1), f(
|
|
20
|
+
t.filter((r) => !r.display),
|
|
35
21
|
"role"
|
|
36
22
|
).concat(
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
f(
|
|
24
|
+
t.filter((r) => r.display),
|
|
39
25
|
"display.content"
|
|
40
26
|
)
|
|
41
27
|
);
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (passports.length === 0) {
|
|
46
|
-
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Empty, { children: t("noPassport") }) });
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
Box,
|
|
28
|
+
}, [o == null ? void 0 : o.passports]), p = l(() => e == null ? void 0 : e.find((t) => t.name === o.role), [e, o == null ? void 0 : o.role]), n = d.palette.primary.main;
|
|
29
|
+
return e.length === 0 ? /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(y, { children: m("noPassport") }) }) : /* @__PURE__ */ i(
|
|
30
|
+
s,
|
|
50
31
|
{
|
|
51
|
-
...
|
|
32
|
+
...a,
|
|
52
33
|
sx: {
|
|
53
34
|
display: "grid",
|
|
54
35
|
justifyItems: "start",
|
|
@@ -59,16 +40,16 @@ export default function Passport({ user, ...rest }) {
|
|
|
59
40
|
lg: "repeat(5, 1fr)"
|
|
60
41
|
},
|
|
61
42
|
gap: 2.5,
|
|
62
|
-
...
|
|
43
|
+
...a.sx
|
|
63
44
|
},
|
|
64
|
-
children:
|
|
65
|
-
|
|
45
|
+
children: e.map((t) => /* @__PURE__ */ i(
|
|
46
|
+
h,
|
|
66
47
|
{
|
|
67
|
-
passport:
|
|
68
|
-
user,
|
|
48
|
+
passport: t,
|
|
49
|
+
user: o,
|
|
69
50
|
color: window.blocklet.passportColor,
|
|
70
|
-
createPassportSvg,
|
|
71
|
-
title:
|
|
51
|
+
createPassportSvg: S,
|
|
52
|
+
title: p && p.role === t.role ? m("currentPassport") : "",
|
|
72
53
|
sx: {
|
|
73
54
|
flexDirection: "column",
|
|
74
55
|
alignItems: "center",
|
|
@@ -81,15 +62,18 @@ export default function Passport({ user, ...rest }) {
|
|
|
81
62
|
display: "flex",
|
|
82
63
|
justifyContent: "center",
|
|
83
64
|
backgroundColor: "grey.50",
|
|
84
|
-
boxShadow:
|
|
65
|
+
boxShadow: p && p.role === t.role ? `0px 2px 4px 0px ${n}, 0px 1px 2px -1px ${n}, 0px 0px 0px 1px ${n} !important` : "unset"
|
|
85
66
|
},
|
|
86
67
|
".passport-item__body": {
|
|
87
68
|
marginLeft: "0 !important"
|
|
88
69
|
}
|
|
89
70
|
}
|
|
90
71
|
},
|
|
91
|
-
|
|
72
|
+
t.id
|
|
92
73
|
))
|
|
93
74
|
}
|
|
94
75
|
);
|
|
95
76
|
}
|
|
77
|
+
export {
|
|
78
|
+
D as default
|
|
79
|
+
};
|