@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,161 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { useCreation, useMemoizedFn } from "ahooks";
|
|
4
|
-
import { useTheme, Link } from "@mui/material";
|
|
5
|
-
import { WELLKNOWN_SERVICE_PATH_PREFIX } from "@abtnode/constant";
|
|
6
|
-
import { joinURL, withQuery } from "ufo";
|
|
7
|
-
import
|
|
8
|
-
import { getActivityLink } from "../utils.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
LIKE: "like",
|
|
12
|
-
FOLLOW: "follow",
|
|
13
|
-
TIPS: "tips",
|
|
14
|
-
MENTION: "mention",
|
|
15
|
-
ASSIGN: "assign"
|
|
16
|
-
};
|
|
17
|
-
const ACTIVITY_DESCRIPTIONS = {
|
|
18
|
-
comment: (targetType, count) => count && count > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1
|
+
import { jsx as s, jsxs as o, Fragment as i } from "react/jsx-runtime";
|
|
2
|
+
import M from "react";
|
|
3
|
+
import { useCreation as f, useMemoizedFn as U } from "ahooks";
|
|
4
|
+
import { useTheme as C, Link as E } from "@mui/material";
|
|
5
|
+
import { WELLKNOWN_SERVICE_PATH_PREFIX as S } from "@abtnode/constant";
|
|
6
|
+
import { joinURL as R, withQuery as v } from "ufo";
|
|
7
|
+
import D from "lodash/isEmpty";
|
|
8
|
+
import { getActivityLink as I } from "../utils.js";
|
|
9
|
+
const P = {
|
|
10
|
+
comment: (r, l) => l && l > 1 ? /* @__PURE__ */ o(i, { children: [
|
|
19
11
|
"left ",
|
|
20
|
-
|
|
12
|
+
l,
|
|
21
13
|
" comments on your ",
|
|
22
|
-
|
|
23
|
-
] }) : /* @__PURE__ */
|
|
14
|
+
r
|
|
15
|
+
] }) : /* @__PURE__ */ o(i, { children: [
|
|
24
16
|
"commented on your ",
|
|
25
|
-
|
|
17
|
+
r
|
|
26
18
|
] }),
|
|
27
|
-
like: (
|
|
19
|
+
like: (r) => /* @__PURE__ */ o(i, { children: [
|
|
28
20
|
"liked your ",
|
|
29
|
-
|
|
21
|
+
r
|
|
30
22
|
] }),
|
|
31
|
-
follow: () => /* @__PURE__ */
|
|
32
|
-
tips: (
|
|
23
|
+
follow: () => /* @__PURE__ */ s(i, { children: "followed you" }),
|
|
24
|
+
tips: (r) => /* @__PURE__ */ o(i, { children: [
|
|
33
25
|
"gave tips to your ",
|
|
34
|
-
|
|
26
|
+
r
|
|
35
27
|
] }),
|
|
36
|
-
mention: (
|
|
28
|
+
mention: (r) => /* @__PURE__ */ o(i, { children: [
|
|
37
29
|
"mentioned you in ",
|
|
38
|
-
|
|
30
|
+
r
|
|
39
31
|
] }),
|
|
40
|
-
assign: () => /* @__PURE__ */
|
|
32
|
+
assign: () => /* @__PURE__ */ s(i, { children: "assigned you a task" })
|
|
41
33
|
};
|
|
42
|
-
function
|
|
43
|
-
const { palette } =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
-
Link,
|
|
34
|
+
function a({ user: r, color: l }) {
|
|
35
|
+
const { palette: d } = C(), h = v(R(S, "user"), { did: r.did }), m = l || d.text.primary;
|
|
36
|
+
return /* @__PURE__ */ s(
|
|
37
|
+
E,
|
|
48
38
|
{
|
|
49
|
-
href:
|
|
50
|
-
color:
|
|
51
|
-
fontWeight: 600,
|
|
39
|
+
href: h,
|
|
40
|
+
color: m,
|
|
52
41
|
target: "_blank",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
onClick: (p) => {
|
|
43
|
+
p.customPreventRedirect = !0;
|
|
44
|
+
},
|
|
45
|
+
sx: {
|
|
46
|
+
fontWeight: 600,
|
|
47
|
+
textDecoration: "none",
|
|
48
|
+
"&:hover": { cursor: "pointer" }
|
|
56
49
|
},
|
|
57
|
-
children:
|
|
50
|
+
children: r.fullName || "System"
|
|
58
51
|
}
|
|
59
52
|
);
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const { palette } =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
users.forEach((user) => {
|
|
72
|
-
if (user?.did && !map.has(user.did)) {
|
|
73
|
-
map.set(user.did, user);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return map;
|
|
77
|
-
}, [users]);
|
|
78
|
-
const uniqueUsers = useCreation(() => {
|
|
79
|
-
if (!Array.isArray(actors))
|
|
80
|
-
return [];
|
|
81
|
-
return actors.map((actorId) => {
|
|
82
|
-
if (!actorId)
|
|
83
|
-
return null;
|
|
84
|
-
return usersMap.get(actorId) || { did: actorId, fullName: "System" };
|
|
85
|
-
}).filter(Boolean);
|
|
86
|
-
}, [actors, usersMap]);
|
|
87
|
-
const formatLinkedUserNames = useMemoizedFn(() => {
|
|
88
|
-
if (!Array.isArray(uniqueUsers) || uniqueUsers.length === 0) {
|
|
54
|
+
a.displayName = "UserLink";
|
|
55
|
+
function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = "" }) {
|
|
56
|
+
const { palette: p } = C(), { type: u, target: g } = r || {}, { type: y } = g || {}, { linkColor: c = p.text.primary } = h || {}, k = f(() => {
|
|
57
|
+
if (!Array.isArray(l)) return /* @__PURE__ */ new Map();
|
|
58
|
+
const e = /* @__PURE__ */ new Map();
|
|
59
|
+
return l.forEach((t) => {
|
|
60
|
+
t != null && t.did && !e.has(t.did) && e.set(t.did, t);
|
|
61
|
+
}), e;
|
|
62
|
+
}, [l]), n = f(() => Array.isArray(d) ? d.map((e) => e ? k.get(e) || { did: e, fullName: "System" } : null).filter(Boolean) : [], [d, k]), L = U(() => {
|
|
63
|
+
if (!Array.isArray(n) || n.length === 0)
|
|
89
64
|
return null;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (uniqueUsers.length === 2) {
|
|
97
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
98
|
-
/* @__PURE__ */ jsx(UserLink, { user: initialUsers[0], color: linkColor }),
|
|
65
|
+
if (n.length === 1)
|
|
66
|
+
return /* @__PURE__ */ s(a, { user: n[0], color: c });
|
|
67
|
+
const e = n.slice(0, -1), t = n[n.length - 1];
|
|
68
|
+
if (n.length === 2)
|
|
69
|
+
return /* @__PURE__ */ o(i, { children: [
|
|
70
|
+
/* @__PURE__ */ s(a, { user: e[0], color: c }),
|
|
99
71
|
" and ",
|
|
100
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ s(a, { user: t, color: c })
|
|
101
73
|
] });
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
] }, user.did)),
|
|
110
|
-
isMoreThanThree ? `, and ${uniqueUsers.length - 2} others` : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
+
const _ = n.length > 3, N = _ ? n.slice(0, 2) : e;
|
|
75
|
+
return /* @__PURE__ */ o(i, { children: [
|
|
76
|
+
N.map((T, F) => /* @__PURE__ */ o(M.Fragment, { children: [
|
|
77
|
+
/* @__PURE__ */ s(a, { user: T, color: c }),
|
|
78
|
+
F < N.length - 1 ? ", " : ""
|
|
79
|
+
] }, T.did)),
|
|
80
|
+
_ ? `, and ${n.length - 2} others` : /* @__PURE__ */ o(i, { children: [
|
|
111
81
|
", and ",
|
|
112
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ s(a, { user: t, color: c })
|
|
113
83
|
] })
|
|
114
84
|
] });
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const description = getActivityDescription();
|
|
123
|
-
if (!linkedNames || !description) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
-
linkedNames,
|
|
85
|
+
}), A = U(() => {
|
|
86
|
+
const e = u ? P[u] : null;
|
|
87
|
+
return e ? e(y, l.length) : null;
|
|
88
|
+
}), w = f(() => {
|
|
89
|
+
const e = L(), t = A();
|
|
90
|
+
return !e || !t ? null : /* @__PURE__ */ o(i, { children: [
|
|
91
|
+
e,
|
|
128
92
|
" ",
|
|
129
|
-
|
|
93
|
+
t
|
|
130
94
|
] });
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
}, [activity, mountPoint]);
|
|
141
|
-
if (!type || isEmpty(target)) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
145
|
-
title,
|
|
95
|
+
}, [u, y, n, L, A]), x = f(() => {
|
|
96
|
+
if (!r) return null;
|
|
97
|
+
const e = I(r);
|
|
98
|
+
return e != null && e.targetLink ? R(m, e.targetLink) : null;
|
|
99
|
+
}, [r, m]);
|
|
100
|
+
return !u || D(g) ? null : /* @__PURE__ */ o(i, { children: [
|
|
101
|
+
w,
|
|
146
102
|
" ",
|
|
147
|
-
|
|
148
|
-
|
|
103
|
+
x && /* @__PURE__ */ s(
|
|
104
|
+
E,
|
|
149
105
|
{
|
|
150
|
-
href:
|
|
151
|
-
color:
|
|
106
|
+
href: x,
|
|
107
|
+
color: c,
|
|
152
108
|
target: "_blank",
|
|
153
109
|
sx: { textDecoration: "none" },
|
|
154
110
|
onClick: (e) => {
|
|
155
|
-
e.customPreventRedirect =
|
|
111
|
+
e.customPreventRedirect = !0;
|
|
156
112
|
},
|
|
157
|
-
children:
|
|
113
|
+
children: g.name
|
|
158
114
|
}
|
|
159
115
|
)
|
|
160
116
|
] });
|
|
161
117
|
}
|
|
118
|
+
export {
|
|
119
|
+
H as default
|
|
120
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useTheme } from "@arcblock/ux/lib/Theme";
|
|
2
|
-
import useMediaQuery from "@mui/material
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return !output && matches ? key : output;
|
|
1
|
+
import { useTheme as n } from "@arcblock/ux/lib/Theme";
|
|
2
|
+
import { useMediaQuery as o } from "@mui/material";
|
|
3
|
+
function a() {
|
|
4
|
+
const e = n();
|
|
5
|
+
return [...e.breakpoints.keys].reverse().reduce((r, s) => {
|
|
6
|
+
const t = o(e.breakpoints.up(s));
|
|
7
|
+
return !r && t ? s : r;
|
|
9
8
|
}, null) || "xs";
|
|
10
9
|
}
|
|
11
|
-
export
|
|
10
|
+
export {
|
|
11
|
+
a as default
|
|
12
|
+
};
|
|
@@ -1,130 +1,90 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { isSameAddr } from "@abtnode/util/lib/notification-preview/func";
|
|
5
|
-
import { client } from "../libs/client.js";
|
|
6
|
-
|
|
7
|
-
if (!
|
|
1
|
+
import L from "lodash/isEmpty";
|
|
2
|
+
import $ from "dompurify";
|
|
3
|
+
import { toTextList as k, Link as v, getLink as i } from "@abtnode/util/lib/notification-preview/highlight";
|
|
4
|
+
import { isSameAddr as h } from "@abtnode/util/lib/notification-preview/func";
|
|
5
|
+
import { client as w } from "../libs/client.js";
|
|
6
|
+
const M = (s) => {
|
|
7
|
+
if (!s || !s.length)
|
|
8
8
|
return [];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (currentGroup) {
|
|
16
|
-
if (groupItems.length === 1) {
|
|
17
|
-
result.push(groupItems[0]);
|
|
18
|
-
} else {
|
|
19
|
-
currentGroup.items = groupItems;
|
|
20
|
-
result.push(currentGroup);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (notification.activity && notification.activity.type) {
|
|
24
|
-
currentGroup = notification;
|
|
25
|
-
groupItems = [notification];
|
|
26
|
-
} else {
|
|
27
|
-
result.push(notification);
|
|
28
|
-
currentGroup = null;
|
|
29
|
-
groupItems = [];
|
|
30
|
-
}
|
|
9
|
+
const t = [];
|
|
10
|
+
let r = null, l = [];
|
|
11
|
+
if (s.forEach((a) => {
|
|
12
|
+
var c, o, g, y;
|
|
13
|
+
if (!a.activity || !a.activity.type || !r) {
|
|
14
|
+
r && (l.length === 1 ? t.push(l[0]) : (r.items = l, t.push(r))), a.activity && a.activity.type ? (r = a, l = [a]) : (t.push(a), r = null, l = []);
|
|
31
15
|
return;
|
|
32
16
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const currentTargetType = currentActivity?.target?.type;
|
|
36
|
-
const currentTargetId = currentActivity?.target?.id;
|
|
37
|
-
const newType = notification.activity.type;
|
|
38
|
-
const newTargetType = notification.activity.target?.type;
|
|
39
|
-
const newTargetId = notification.activity.target?.id;
|
|
40
|
-
const shouldMerge = (
|
|
17
|
+
const e = l[0].activity, n = e == null ? void 0 : e.type, p = (c = e == null ? void 0 : e.target) == null ? void 0 : c.type, u = (o = e == null ? void 0 : e.target) == null ? void 0 : o.id, d = a.activity.type, m = (g = a.activity.target) == null ? void 0 : g.type, f = (y = a.activity.target) == null ? void 0 : y.id;
|
|
18
|
+
if (
|
|
41
19
|
// activity.type 必须相同且不为null或undefined
|
|
42
|
-
|
|
43
|
-
(!
|
|
44
|
-
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
result.push(groupToAdd);
|
|
20
|
+
n && d && n === d && // 如果都没有target,可以合并
|
|
21
|
+
(!(e != null && e.target) && !a.activity.target || // 如果都有target,则target.type和target.id都必须相同
|
|
22
|
+
(e == null ? void 0 : e.target) && a.activity.target && p === m && u === f)
|
|
23
|
+
)
|
|
24
|
+
l.push(a);
|
|
25
|
+
else {
|
|
26
|
+
if (l.length === 1)
|
|
27
|
+
t.push(l[0]);
|
|
28
|
+
else {
|
|
29
|
+
const T = Object.assign({}, r, { items: l });
|
|
30
|
+
t.push(T);
|
|
54
31
|
}
|
|
55
|
-
|
|
56
|
-
groupItems = [notification];
|
|
32
|
+
r = a, l = [a];
|
|
57
33
|
}
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
result.push(groupToAdd);
|
|
34
|
+
}), r)
|
|
35
|
+
if (l.length === 1)
|
|
36
|
+
t.push(l[0]);
|
|
37
|
+
else {
|
|
38
|
+
const a = Object.assign({}, r, { items: l });
|
|
39
|
+
t.push(a);
|
|
65
40
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
export const getActivityLink = (activity) => {
|
|
77
|
-
if (!activity) {
|
|
41
|
+
return t;
|
|
42
|
+
}, z = (s) => {
|
|
43
|
+
var t, r;
|
|
44
|
+
return !L(s.activity) && !!((t = s.activity) != null && t.type) && !!((r = s.activity) != null && r.actor);
|
|
45
|
+
}, D = (s) => {
|
|
46
|
+
const { severity: t } = s || {};
|
|
47
|
+
return !!t && ["normal", "success", "info"].includes(t);
|
|
48
|
+
}, R = (s) => {
|
|
49
|
+
if (!s)
|
|
78
50
|
return null;
|
|
79
|
-
}
|
|
80
|
-
const { meta, target } = activity;
|
|
51
|
+
const { meta: t, target: r } = s;
|
|
81
52
|
return {
|
|
82
|
-
metaLink:
|
|
83
|
-
targetLink:
|
|
53
|
+
metaLink: t == null ? void 0 : t.id,
|
|
54
|
+
targetLink: r == null ? void 0 : r.id
|
|
84
55
|
};
|
|
85
|
-
}
|
|
86
|
-
const getUserProfileUrl = async (did, locale) => {
|
|
56
|
+
}, x = async (s, t) => {
|
|
87
57
|
try {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return void 0;
|
|
58
|
+
return await w.user.getProfileUrl({ did: s, locale: t });
|
|
59
|
+
} catch (r) {
|
|
60
|
+
console.error(r);
|
|
61
|
+
return;
|
|
93
62
|
}
|
|
94
|
-
}
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const result = await Promise.all(
|
|
106
|
-
textList.map(async (item) => {
|
|
107
|
-
if (item instanceof Link) {
|
|
108
|
-
if (isHighLight) {
|
|
109
|
-
const url = await getLink(item, locale);
|
|
110
|
-
const { type, chainId, did } = item;
|
|
111
|
-
if (isSameAddr(type, "dapp")) {
|
|
112
|
-
return `<em class="dapp" data-type="${type}" data-chain-id="${chainId}" data-did="${did}">${item.text}</em>`;
|
|
113
|
-
}
|
|
114
|
-
if (url) {
|
|
115
|
-
return `<a target="_blank" rel="noopener noreferrer" class="link" href="${url}">${item.text}</a>`;
|
|
116
|
-
}
|
|
117
|
-
return `<em class="common" data-type="${type}" data-chain-id="${chainId}" data-did="${did}">${item.text}</em>`;
|
|
63
|
+
}, U = async (s, t) => {
|
|
64
|
+
const { type: r, did: l } = s;
|
|
65
|
+
return h(r, "did") ? await x(l, t) || i(s) : i(s);
|
|
66
|
+
}, S = async (s, t, r = !0) => {
|
|
67
|
+
const l = k(s);
|
|
68
|
+
return await Promise.all(
|
|
69
|
+
l.map(async (e) => {
|
|
70
|
+
if (e instanceof v) {
|
|
71
|
+
if (r) {
|
|
72
|
+
const n = await U(e, t), { type: p, chainId: u, did: d } = e;
|
|
73
|
+
return h(p, "dapp") ? `<em class="dapp" data-type="${p}" data-chain-id="${u}" data-did="${d}">${e.text}</em>` : n ? `<a target="_blank" rel="noopener noreferrer" class="link" href="${n}">${e.text}</a>` : `<em class="common" data-type="${p}" data-chain-id="${u}" data-did="${d}">${e.text}</em>`;
|
|
118
74
|
}
|
|
119
|
-
return
|
|
75
|
+
return e.text;
|
|
120
76
|
}
|
|
121
|
-
return
|
|
77
|
+
return e;
|
|
122
78
|
})
|
|
123
|
-
).then((
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
79
|
+
).then((e) => e.join(""));
|
|
80
|
+
}, _ = (s) => $.sanitize(s, {
|
|
81
|
+
ALLOWED_ATTR: ["href", "target", "rel", "class", "id", "style"]
|
|
82
|
+
});
|
|
83
|
+
export {
|
|
84
|
+
D as canAutoRead,
|
|
85
|
+
R as getActivityLink,
|
|
86
|
+
z as isIncludeActivity,
|
|
87
|
+
M as mergeAdjacentNotifications,
|
|
88
|
+
_ as sanitize,
|
|
89
|
+
S as toClickableSpan
|
|
130
90
|
};
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, TextField } from "@mui/material";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { client } from "../../libs/client.js";
|
|
6
|
-
import { formatAxiosError } from "../libs/utils.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Box as s, TextField as v } from "@mui/material";
|
|
3
|
+
import { useReactive as m, useMemoizedFn as c } from "ahooks";
|
|
4
|
+
import d from "@arcblock/ux/lib/Toast";
|
|
5
|
+
import { client as u } from "../../libs/client.js";
|
|
6
|
+
import { formatAxiosError as g } from "../libs/utils.js";
|
|
7
|
+
function I({ user: t }) {
|
|
8
|
+
var n, r, o;
|
|
9
|
+
const i = m({
|
|
10
|
+
inviter: t == null ? void 0 : t.inviter,
|
|
11
|
+
loading: !1
|
|
12
|
+
}), l = c(async (f) => {
|
|
13
13
|
try {
|
|
14
|
-
const { value } =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} catch (err) {
|
|
19
|
-
Toast.error(formatAxiosError(err));
|
|
14
|
+
const { value: e } = f.target;
|
|
15
|
+
i.loading = !0, await u.user.saveProfile({ inviter: e }), i.inviter = e;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
d.error(g(e));
|
|
20
18
|
} finally {
|
|
21
|
-
|
|
19
|
+
i.loading = !1;
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
|
-
|
|
25
|
-
return "-";
|
|
26
|
-
}
|
|
27
|
-
const inviteEnabled = !!window.blocklet?.settings?.invite?.enabled;
|
|
28
|
-
if (!inviteEnabled) {
|
|
29
|
-
return "-";
|
|
30
|
-
}
|
|
31
|
-
const hasInviter = !!user.inviter;
|
|
32
|
-
if (hasInviter) {
|
|
33
|
-
return "-";
|
|
34
|
-
}
|
|
35
|
-
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(TextField, { size: "small", fullWidth: true, label: "", value: currentState.inviter, onChange: handleChange }) });
|
|
22
|
+
return !t || !!!((o = (r = (n = window.blocklet) == null ? void 0 : n.settings) == null ? void 0 : r.invite) != null && o.enabled) || !!t.inviter ? "-" : /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(v, { size: "small", fullWidth: !0, label: "", value: i.inviter, onChange: l }) });
|
|
36
23
|
}
|
|
24
|
+
export {
|
|
25
|
+
I as default
|
|
26
|
+
};
|