@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,322 +1,274 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
5
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getVisitorId } from "@arcblock/ux/lib/Util";
|
|
9
|
-
import { useConfirm } from "@arcblock/ux/lib/Dialog";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import { mergeSx } from "@arcblock/ux/lib/Util/style";
|
|
24
|
-
import useMobile from "../../hooks/use-mobile.js";
|
|
25
|
-
import UserSessionInfo from "./user-session-info.js";
|
|
26
|
-
import { client } from "../../libs/client.js";
|
|
27
|
-
import { translations } from "../libs/locales.js";
|
|
28
|
-
import { ip2Region } from "../libs/utils.js";
|
|
29
|
-
const parseUa = (ua) => {
|
|
30
|
-
const parser = new UAParser(ua, {
|
|
31
|
-
// eslint-disable-next-line no-useless-escape
|
|
32
|
-
browser: [[/(ArcWallet)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]]
|
|
33
|
-
});
|
|
34
|
-
const result = parser.getResult();
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
const textRightStyle = {
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import X from "@arcblock/ux/lib/Datatable";
|
|
3
|
+
import { useReactive as L, useMemoizedFn as R, useMount as Y, useRequest as Z, useCreation as B } from "ahooks";
|
|
4
|
+
import { translate as _ } from "@arcblock/ux/lib/Locale/util";
|
|
5
|
+
import { useLocaleContext as N } from "@arcblock/ux/lib/Locale/context";
|
|
6
|
+
import O from "@arcblock/ux/lib/RelativeTime";
|
|
7
|
+
import C from "ua-parser-js";
|
|
8
|
+
import { getVisitorId as ee } from "@arcblock/ux/lib/Util";
|
|
9
|
+
import { useConfirm as te } from "@arcblock/ux/lib/Dialog";
|
|
10
|
+
import oe from "p-queue";
|
|
11
|
+
import { Box as u, Typography as c, CircularProgress as ne, useMediaQuery as re, Tooltip as ie, Button as j, RadioGroup as ae, FormControlLabel as z, Radio as I } from "@mui/material";
|
|
12
|
+
import { memo as se, useEffect as le } from "react";
|
|
13
|
+
import { mergeSx as H } from "@arcblock/ux/lib/Util/style";
|
|
14
|
+
import ce from "../../hooks/use-mobile.js";
|
|
15
|
+
import de from "./user-session-info.js";
|
|
16
|
+
import { client as D } from "../../libs/client.js";
|
|
17
|
+
import { translations as pe } from "../libs/locales.js";
|
|
18
|
+
import { ip2Region as ue } from "../libs/utils.js";
|
|
19
|
+
const E = (m) => new C(m, {
|
|
20
|
+
// eslint-disable-next-line no-useless-escape
|
|
21
|
+
browser: [[/(ArcWallet)\/([\w\.]+)/i], [C.BROWSER.NAME, C.BROWSER.VERSION]]
|
|
22
|
+
}).getResult(), F = {
|
|
38
23
|
display: "flex",
|
|
39
24
|
justifyContent: "flex-end",
|
|
40
25
|
textAlign: "right"
|
|
41
|
-
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const currentState = useReactive({
|
|
45
|
-
loading: true,
|
|
26
|
+
}, me = new oe({ concurrency: 1 }), ge = se(({ userSession: m, isMobile: y = !1 }) => {
|
|
27
|
+
const d = L({
|
|
28
|
+
loading: !0,
|
|
46
29
|
ipRegion: ""
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
queue.add(async () => {
|
|
30
|
+
}), { t: x } = N();
|
|
31
|
+
return le(() => {
|
|
32
|
+
me.add(async () => {
|
|
51
33
|
try {
|
|
52
|
-
|
|
34
|
+
d.ipRegion = await ue(m.lastLoginIp);
|
|
53
35
|
} finally {
|
|
54
|
-
|
|
36
|
+
d.loading = !1;
|
|
55
37
|
}
|
|
56
38
|
});
|
|
57
|
-
}, [
|
|
58
|
-
|
|
59
|
-
Box,
|
|
39
|
+
}, [d, m.lastLoginIp]), /* @__PURE__ */ n(
|
|
40
|
+
u,
|
|
60
41
|
{
|
|
61
|
-
...
|
|
42
|
+
...y && {
|
|
62
43
|
display: "flex",
|
|
63
44
|
alignItems: "center",
|
|
64
45
|
justifyContent: "flex-end",
|
|
65
46
|
gap: 1,
|
|
66
47
|
flexWrap: "wrap"
|
|
67
48
|
},
|
|
68
|
-
children:
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
] }) : /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
49
|
+
children: d.ipRegion ? /* @__PURE__ */ l(W, { children: [
|
|
50
|
+
/* @__PURE__ */ n(c, { variant: "body2", children: d.ipRegion }),
|
|
51
|
+
/* @__PURE__ */ n(c, { variant: "body2", color: "grey", children: m.lastLoginIp || x("unknown") })
|
|
52
|
+
] }) : /* @__PURE__ */ l(W, { children: [
|
|
53
|
+
/* @__PURE__ */ n(c, { children: m.lastLoginIp || x("unknown") }),
|
|
54
|
+
d.loading ? /* @__PURE__ */ n(c, { variant: "body2", color: "grey", sx: { textAlign: "center" }, children: /* @__PURE__ */ n(ne, { size: 12, color: "inherit" }) }) : null
|
|
74
55
|
] })
|
|
75
56
|
}
|
|
76
57
|
);
|
|
77
58
|
});
|
|
78
|
-
|
|
79
|
-
user,
|
|
80
|
-
showAction =
|
|
81
|
-
showUser =
|
|
82
|
-
getUserSessions,
|
|
83
|
-
showOffline =
|
|
59
|
+
function Pe({
|
|
60
|
+
user: m,
|
|
61
|
+
showAction: y = !0,
|
|
62
|
+
showUser: d = !0,
|
|
63
|
+
getUserSessions: x,
|
|
64
|
+
showOffline: A = !1
|
|
84
65
|
}) {
|
|
85
|
-
|
|
66
|
+
var k, M, P;
|
|
67
|
+
const r = L({
|
|
86
68
|
status: "online",
|
|
87
69
|
page: 1,
|
|
88
70
|
pageSize: 10
|
|
89
|
-
})
|
|
90
|
-
const userSessionsCountMap = useReactive({
|
|
71
|
+
}), g = L({
|
|
91
72
|
online: 0,
|
|
92
73
|
expired: 0,
|
|
93
74
|
offline: 0
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const result = await getUserSessions({
|
|
105
|
-
page: filterParams.page,
|
|
106
|
-
pageSize: filterParams.pageSize,
|
|
107
|
-
status: filterParams.status
|
|
108
|
-
});
|
|
109
|
-
const total = result?.paging?.total || 0;
|
|
110
|
-
userSessionsCountMap[filterParams.status] = total;
|
|
111
|
-
return {
|
|
112
|
-
total,
|
|
113
|
-
list: result?.list || []
|
|
75
|
+
}), w = ee(), { locale: v } = N(), f = ce({ key: "md" }), U = re((e) => e.breakpoints.down("lg")), { confirmApi: S, confirmHolder: V } = te(), o = R((e, t = {}) => _(pe, e, v, "en", t)), q = R(async () => {
|
|
76
|
+
var i;
|
|
77
|
+
const e = await x({
|
|
78
|
+
page: r.page,
|
|
79
|
+
pageSize: r.pageSize,
|
|
80
|
+
status: r.status
|
|
81
|
+
}), t = ((i = e == null ? void 0 : e.paging) == null ? void 0 : i.total) || 0;
|
|
82
|
+
return g[r.status] = t, {
|
|
83
|
+
total: t,
|
|
84
|
+
list: (e == null ? void 0 : e.list) || []
|
|
114
85
|
};
|
|
115
86
|
});
|
|
116
|
-
|
|
117
|
-
|
|
87
|
+
Y(async () => {
|
|
88
|
+
var i, s;
|
|
89
|
+
const e = await x({
|
|
118
90
|
page: 1,
|
|
119
91
|
pageSize: 1,
|
|
120
92
|
status: "expired"
|
|
121
93
|
});
|
|
122
|
-
|
|
123
|
-
const
|
|
94
|
+
g.expired = ((i = e == null ? void 0 : e.paging) == null ? void 0 : i.total) || 0;
|
|
95
|
+
const t = await x({
|
|
124
96
|
page: 1,
|
|
125
97
|
pageSize: 1,
|
|
126
98
|
status: "offline"
|
|
127
99
|
});
|
|
128
|
-
|
|
129
|
-
});
|
|
130
|
-
const pageState = useRequest(getData, {
|
|
131
|
-
refreshDeps: [filterParams.status, filterParams.page, filterParams.pageSize]
|
|
100
|
+
g.offline = ((s = t == null ? void 0 : t.paging) == null ? void 0 : s.total) || 0;
|
|
132
101
|
});
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const logout = useMemoizedFn(({ visitorId }) => {
|
|
147
|
-
confirmApi.open({
|
|
148
|
-
title: t("logoutThisSession"),
|
|
149
|
-
content: t("logoutThisSessionConfirm"),
|
|
150
|
-
confirmButtonText: t("confirm"),
|
|
102
|
+
const p = Z(q, {
|
|
103
|
+
refreshDeps: [r.status, r.page, r.pageSize]
|
|
104
|
+
}), a = B(() => {
|
|
105
|
+
var e;
|
|
106
|
+
return ((e = p.data) == null ? void 0 : e.list) || [];
|
|
107
|
+
}, [(k = p.data) == null ? void 0 : k.list]), Q = B(() => {
|
|
108
|
+
const e = r.status;
|
|
109
|
+
return e === "online" ? g[e] <= 1 : g[e] === 0;
|
|
110
|
+
}, [a, w]), h = B(() => H({}, f ? F : {}), [f]), G = R(({ visitorId: e }) => {
|
|
111
|
+
S.open({
|
|
112
|
+
title: o("logoutThisSession"),
|
|
113
|
+
content: o("logoutThisSessionConfirm"),
|
|
114
|
+
confirmButtonText: o("confirm"),
|
|
151
115
|
confirmButtonProps: {
|
|
152
116
|
color: "error"
|
|
153
117
|
},
|
|
154
|
-
cancelButtonText:
|
|
118
|
+
cancelButtonText: o("cancel"),
|
|
155
119
|
onConfirm: async () => {
|
|
156
|
-
await
|
|
157
|
-
visitorId,
|
|
158
|
-
includeFederated:
|
|
120
|
+
await D.user.logout({
|
|
121
|
+
visitorId: e,
|
|
122
|
+
includeFederated: !0
|
|
159
123
|
});
|
|
160
|
-
const { page = 0 } =
|
|
161
|
-
|
|
162
|
-
const currentPageLength = list.length || 0;
|
|
163
|
-
if (page > 1 && currentPageLength === 1) {
|
|
164
|
-
filterParams.page = Math.max(page - 1, 1);
|
|
165
|
-
}
|
|
166
|
-
pageState.refresh();
|
|
167
|
-
confirmApi.close();
|
|
124
|
+
const { page: t = 0 } = r, { list: i = [] } = p.data || {}, s = i.length || 0;
|
|
125
|
+
t > 1 && s === 1 && (r.page = Math.max(t - 1, 1)), p.refresh(), S.close();
|
|
168
126
|
}
|
|
169
127
|
});
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
type: t(filterParams.status)
|
|
128
|
+
}), $ = R(() => {
|
|
129
|
+
S.open({
|
|
130
|
+
title: o("logoutAllSession", {
|
|
131
|
+
type: o(r.status)
|
|
175
132
|
}),
|
|
176
|
-
content:
|
|
177
|
-
type:
|
|
133
|
+
content: o("logoutAllSessionConfirm", {
|
|
134
|
+
type: o(r.status)
|
|
178
135
|
}),
|
|
179
|
-
confirmButtonText:
|
|
136
|
+
confirmButtonText: o("confirm"),
|
|
180
137
|
confirmButtonProps: {
|
|
181
138
|
color: "error"
|
|
182
139
|
},
|
|
183
|
-
cancelButtonText:
|
|
140
|
+
cancelButtonText: o("cancel"),
|
|
184
141
|
onConfirm: async () => {
|
|
185
|
-
await
|
|
186
|
-
status:
|
|
187
|
-
visitorId:
|
|
188
|
-
includeFederated:
|
|
189
|
-
});
|
|
190
|
-
filterParams.page = 1;
|
|
191
|
-
pageState.refresh();
|
|
192
|
-
confirmApi.close();
|
|
142
|
+
await D.user.logout({
|
|
143
|
+
status: r.status,
|
|
144
|
+
visitorId: w,
|
|
145
|
+
includeFederated: !0
|
|
146
|
+
}), r.page = 1, p.refresh(), S.close();
|
|
193
147
|
}
|
|
194
148
|
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
const tableOptions = useCreation(() => {
|
|
149
|
+
}), T = [];
|
|
150
|
+
y && T.push(
|
|
151
|
+
/* @__PURE__ */ n(
|
|
152
|
+
ie,
|
|
153
|
+
{
|
|
154
|
+
title: o("logoutAllTips", {
|
|
155
|
+
type: o(r.status)
|
|
156
|
+
}),
|
|
157
|
+
children: /* @__PURE__ */ n(
|
|
158
|
+
j,
|
|
159
|
+
{
|
|
160
|
+
sx: { ml: 0.5 },
|
|
161
|
+
size: "small",
|
|
162
|
+
variant: "contained",
|
|
163
|
+
color: "error",
|
|
164
|
+
onClick: $,
|
|
165
|
+
disabled: Q,
|
|
166
|
+
children: o("logoutAll", {
|
|
167
|
+
type: o(r.status)
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
},
|
|
172
|
+
"logoutAll"
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
const J = B(() => {
|
|
176
|
+
var e;
|
|
225
177
|
return {
|
|
226
178
|
// viewColumns: false,
|
|
227
|
-
search:
|
|
228
|
-
sort:
|
|
229
|
-
download:
|
|
230
|
-
filter:
|
|
231
|
-
print:
|
|
232
|
-
expandableRowsOnClick:
|
|
179
|
+
search: !1,
|
|
180
|
+
sort: !1,
|
|
181
|
+
download: !1,
|
|
182
|
+
filter: !1,
|
|
183
|
+
print: !1,
|
|
184
|
+
expandableRowsOnClick: !1,
|
|
233
185
|
searchDebounceTime: 600,
|
|
234
|
-
page:
|
|
235
|
-
rowsPerPage:
|
|
236
|
-
count:
|
|
186
|
+
page: r.page - 1,
|
|
187
|
+
rowsPerPage: r.pageSize,
|
|
188
|
+
count: ((e = p.data) == null ? void 0 : e.total) || 0
|
|
237
189
|
};
|
|
238
|
-
}, [
|
|
239
|
-
const columns = [
|
|
190
|
+
}, [(M = p.data) == null ? void 0 : M.total, r.page, r.pageSize]), K = [
|
|
240
191
|
{
|
|
241
|
-
label:
|
|
192
|
+
label: o("platform"),
|
|
242
193
|
name: "platform",
|
|
243
194
|
options: {
|
|
244
|
-
customBodyRenderLite: (
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
return /* @__PURE__ */
|
|
195
|
+
customBodyRenderLite: (e) => {
|
|
196
|
+
var s, b;
|
|
197
|
+
const t = a[e], i = E(t == null ? void 0 : t.ua);
|
|
198
|
+
return /* @__PURE__ */ n(u, { sx: h, children: [(s = i.os) == null ? void 0 : s.name, (b = i.os) == null ? void 0 : b.version].filter(Boolean).join("/") || o("unknown") });
|
|
248
199
|
}
|
|
249
200
|
}
|
|
250
201
|
},
|
|
251
202
|
{
|
|
252
|
-
label:
|
|
203
|
+
label: o("deviceType"),
|
|
253
204
|
name: "deviceType",
|
|
254
205
|
options: {
|
|
255
|
-
customBodyRenderLite: (
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
return /* @__PURE__ */
|
|
206
|
+
customBodyRenderLite: (e) => {
|
|
207
|
+
var s, b;
|
|
208
|
+
const t = a[e], i = E(t == null ? void 0 : t.ua);
|
|
209
|
+
return /* @__PURE__ */ n(u, { sx: h, children: [(s = i.browser) == null ? void 0 : s.name, (b = i.browser) == null ? void 0 : b.version].filter(Boolean).join("/") || o("unknown") });
|
|
259
210
|
}
|
|
260
211
|
}
|
|
261
212
|
},
|
|
262
213
|
{
|
|
263
|
-
label:
|
|
214
|
+
label: o("walletOS"),
|
|
264
215
|
name: "walletOS",
|
|
265
216
|
options: {
|
|
266
|
-
customBodyRenderLite: (
|
|
267
|
-
|
|
268
|
-
|
|
217
|
+
customBodyRenderLite: (e) => {
|
|
218
|
+
var i;
|
|
219
|
+
const t = a[e];
|
|
220
|
+
return /* @__PURE__ */ n(u, { sx: h, children: ((i = t.extra) == null ? void 0 : i.walletOS) || o("unknown") });
|
|
269
221
|
}
|
|
270
222
|
}
|
|
271
223
|
},
|
|
272
|
-
|
|
273
|
-
label:
|
|
224
|
+
d && {
|
|
225
|
+
label: o("user"),
|
|
274
226
|
name: "user",
|
|
275
227
|
options: {
|
|
276
|
-
customBodyRenderLite: (
|
|
277
|
-
const
|
|
278
|
-
return /* @__PURE__ */
|
|
228
|
+
customBodyRenderLite: (e) => {
|
|
229
|
+
const t = a[e];
|
|
230
|
+
return /* @__PURE__ */ n(u, { sx: H({ minWidth: 150, maxWidth: 250 }, f ? F : {}), children: /* @__PURE__ */ n(de, { sessionUser: t.user, user: m }) });
|
|
279
231
|
}
|
|
280
232
|
}
|
|
281
233
|
},
|
|
282
234
|
{
|
|
283
|
-
label:
|
|
235
|
+
label: o("createdAt"),
|
|
284
236
|
name: "createdAt",
|
|
285
237
|
options: {
|
|
286
|
-
customBodyRenderLite: (
|
|
287
|
-
const
|
|
288
|
-
return /* @__PURE__ */
|
|
238
|
+
customBodyRenderLite: (e) => {
|
|
239
|
+
const t = a[e];
|
|
240
|
+
return /* @__PURE__ */ n(u, { sx: h, children: t.createdAt ? /* @__PURE__ */ n(O, { value: t.createdAt, relativeRange: 3 * 86400 * 1e3, locale: v }) : o("unknown") });
|
|
289
241
|
}
|
|
290
242
|
}
|
|
291
243
|
},
|
|
292
|
-
!
|
|
293
|
-
label:
|
|
244
|
+
!A && {
|
|
245
|
+
label: o("updatedAt"),
|
|
294
246
|
name: "updatedAt",
|
|
295
247
|
options: {
|
|
296
|
-
customBodyRenderLite: (
|
|
297
|
-
const
|
|
298
|
-
return /* @__PURE__ */
|
|
248
|
+
customBodyRenderLite: (e) => {
|
|
249
|
+
const t = a[e];
|
|
250
|
+
return /* @__PURE__ */ n(u, { sx: h, children: t.status === "expired" ? o("expired") : /* @__PURE__ */ n(O, { value: t.updatedAt, relativeRange: 3 * 86400 * 1e3, locale: v }) });
|
|
299
251
|
}
|
|
300
252
|
}
|
|
301
253
|
},
|
|
302
254
|
{
|
|
303
|
-
label:
|
|
255
|
+
label: o("lastLoginIp"),
|
|
304
256
|
name: "lastLoginIp",
|
|
305
257
|
options: {
|
|
306
|
-
customBodyRenderLite: (
|
|
307
|
-
const
|
|
308
|
-
return /* @__PURE__ */
|
|
258
|
+
customBodyRenderLite: (e) => {
|
|
259
|
+
const t = a[e];
|
|
260
|
+
return /* @__PURE__ */ n(ge, { userSession: t, isMobile: f });
|
|
309
261
|
}
|
|
310
262
|
}
|
|
311
263
|
},
|
|
312
|
-
|
|
313
|
-
label:
|
|
264
|
+
y && {
|
|
265
|
+
label: o("actions"),
|
|
314
266
|
name: "actions",
|
|
315
267
|
options: {
|
|
316
|
-
customBodyRenderLite: (
|
|
317
|
-
const
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
|
|
268
|
+
customBodyRenderLite: (e) => {
|
|
269
|
+
const t = a[e];
|
|
270
|
+
return /* @__PURE__ */ n(u, { sx: h, children: /* @__PURE__ */ n(
|
|
271
|
+
j,
|
|
320
272
|
{
|
|
321
273
|
sx: {
|
|
322
274
|
whiteSpace: "nowrap",
|
|
@@ -324,25 +276,25 @@ export default function UserSessions({
|
|
|
324
276
|
lineHeight: "1.25",
|
|
325
277
|
px: 1
|
|
326
278
|
},
|
|
327
|
-
disabled:
|
|
279
|
+
disabled: w === t.visitorId,
|
|
328
280
|
variant: "outlined",
|
|
329
281
|
size: "small",
|
|
330
282
|
color: "error",
|
|
331
|
-
onClick: () =>
|
|
332
|
-
children:
|
|
283
|
+
onClick: () => G({ visitorId: t.visitorId }),
|
|
284
|
+
children: t.status === "expired" ? o("remove") : w === t.visitorId ? o("currentSession") : o("logout")
|
|
333
285
|
}
|
|
334
286
|
) });
|
|
335
287
|
}
|
|
336
288
|
}
|
|
337
289
|
}
|
|
338
290
|
].filter(Boolean);
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
|
|
291
|
+
return /* @__PURE__ */ l(
|
|
292
|
+
u,
|
|
341
293
|
{
|
|
342
294
|
className: "pc-user-sessions",
|
|
343
295
|
sx: {
|
|
344
|
-
maxWidth:
|
|
345
|
-
...
|
|
296
|
+
maxWidth: f ? "unset" : U ? "calc(100vw - 300px)" : "100%",
|
|
297
|
+
...f && {
|
|
346
298
|
".pc-user-sessions-table > div:nth-child(2)": {
|
|
347
299
|
border: "1px solid",
|
|
348
300
|
borderColor: "divider",
|
|
@@ -358,7 +310,7 @@ export default function UserSessions({
|
|
|
358
310
|
"&:nth-child(even)": {
|
|
359
311
|
backgroundColor: "grey.50",
|
|
360
312
|
"&:hover": {
|
|
361
|
-
backgroundColor: (
|
|
313
|
+
backgroundColor: (e) => `${e.palette.grey[50]} !important`
|
|
362
314
|
}
|
|
363
315
|
}
|
|
364
316
|
},
|
|
@@ -371,7 +323,7 @@ export default function UserSessions({
|
|
|
371
323
|
paddingRight: "8px",
|
|
372
324
|
paddingLeft: "8px",
|
|
373
325
|
color: "text.secondary",
|
|
374
|
-
...
|
|
326
|
+
...f && {
|
|
375
327
|
padding: "8px !important",
|
|
376
328
|
"&:first-child": {
|
|
377
329
|
paddingTop: "20px!important"
|
|
@@ -383,67 +335,67 @@ export default function UserSessions({
|
|
|
383
335
|
}
|
|
384
336
|
},
|
|
385
337
|
children: [
|
|
386
|
-
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
|
|
338
|
+
V,
|
|
339
|
+
/* @__PURE__ */ n(
|
|
340
|
+
X,
|
|
389
341
|
{
|
|
390
|
-
count:
|
|
391
|
-
locale,
|
|
392
|
-
data:
|
|
393
|
-
columns,
|
|
394
|
-
customButtons,
|
|
395
|
-
options:
|
|
396
|
-
loading:
|
|
342
|
+
count: ((P = p.data) == null ? void 0 : P.total) || 0,
|
|
343
|
+
locale: v,
|
|
344
|
+
data: a,
|
|
345
|
+
columns: K,
|
|
346
|
+
customButtons: T,
|
|
347
|
+
options: J,
|
|
348
|
+
loading: p.loading,
|
|
397
349
|
className: "pc-user-sessions-table",
|
|
398
|
-
title: /* @__PURE__ */
|
|
399
|
-
|
|
350
|
+
title: /* @__PURE__ */ l(
|
|
351
|
+
ae,
|
|
400
352
|
{
|
|
401
|
-
row:
|
|
353
|
+
row: !0,
|
|
402
354
|
sx: { lineHeight: 1, ml: 1 },
|
|
403
355
|
onChange: (e) => {
|
|
404
|
-
|
|
356
|
+
r.status = e.target.value;
|
|
405
357
|
},
|
|
406
358
|
children: [
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
|
|
359
|
+
/* @__PURE__ */ n(
|
|
360
|
+
z,
|
|
409
361
|
{
|
|
410
362
|
value: "online",
|
|
411
|
-
control: /* @__PURE__ */
|
|
412
|
-
label: /* @__PURE__ */
|
|
413
|
-
|
|
414
|
-
/* @__PURE__ */
|
|
363
|
+
control: /* @__PURE__ */ n(I, { size: "small", sx: { lineHeight: 1, fontSize: 0 }, checked: r.status === "online" }),
|
|
364
|
+
label: /* @__PURE__ */ l(c, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
365
|
+
o("online"),
|
|
366
|
+
/* @__PURE__ */ l(c, { component: "span", sx: { ml: 0.5, color: "text.secondary" }, children: [
|
|
415
367
|
"(",
|
|
416
|
-
|
|
368
|
+
g.online,
|
|
417
369
|
")"
|
|
418
370
|
] })
|
|
419
371
|
] })
|
|
420
372
|
}
|
|
421
373
|
),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
374
|
+
/* @__PURE__ */ n(
|
|
375
|
+
z,
|
|
424
376
|
{
|
|
425
377
|
value: "expired",
|
|
426
|
-
control: /* @__PURE__ */
|
|
427
|
-
label: /* @__PURE__ */
|
|
428
|
-
|
|
429
|
-
/* @__PURE__ */
|
|
378
|
+
control: /* @__PURE__ */ n(I, { size: "small", sx: { lineHeight: 1, fontSize: 0 }, checked: r.status === "expired" }),
|
|
379
|
+
label: /* @__PURE__ */ l(c, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
380
|
+
o("expired"),
|
|
381
|
+
/* @__PURE__ */ l(c, { component: "span", sx: { ml: 0.5, color: "text.secondary" }, children: [
|
|
430
382
|
"(",
|
|
431
|
-
|
|
383
|
+
g.expired,
|
|
432
384
|
")"
|
|
433
385
|
] })
|
|
434
386
|
] })
|
|
435
387
|
}
|
|
436
388
|
),
|
|
437
|
-
|
|
438
|
-
|
|
389
|
+
A ? /* @__PURE__ */ n(
|
|
390
|
+
z,
|
|
439
391
|
{
|
|
440
392
|
value: "offline",
|
|
441
|
-
control: /* @__PURE__ */
|
|
442
|
-
label: /* @__PURE__ */
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
393
|
+
control: /* @__PURE__ */ n(I, { size: "small", sx: { lineHeight: 1, fontSize: 0 }, checked: r.status === "offline" }),
|
|
394
|
+
label: /* @__PURE__ */ l(c, { sx: { display: "flex", alignItems: "center" }, children: [
|
|
395
|
+
o("offline"),
|
|
396
|
+
/* @__PURE__ */ l(c, { component: "span", sx: { ml: 0.5, color: "text.secondary" }, children: [
|
|
445
397
|
"(",
|
|
446
|
-
|
|
398
|
+
g.offline,
|
|
447
399
|
")"
|
|
448
400
|
] })
|
|
449
401
|
] })
|
|
@@ -452,9 +404,8 @@ export default function UserSessions({
|
|
|
452
404
|
]
|
|
453
405
|
}
|
|
454
406
|
),
|
|
455
|
-
onChange: (
|
|
456
|
-
|
|
457
|
-
filterParams.pageSize = state.rowsPerPage;
|
|
407
|
+
onChange: (e) => {
|
|
408
|
+
r.page = e.page + 1, r.pageSize = e.rowsPerPage;
|
|
458
409
|
}
|
|
459
410
|
}
|
|
460
411
|
)
|
|
@@ -462,3 +413,6 @@ export default function UserSessions({
|
|
|
462
413
|
}
|
|
463
414
|
);
|
|
464
415
|
}
|
|
416
|
+
export {
|
|
417
|
+
Pe as default
|
|
418
|
+
};
|