@arcblock/ux 2.10.67 → 2.10.69
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/Address/did-address.d.ts +6 -5
- package/lib/Address/index.d.ts +1 -1
- package/lib/Avatar/index.d.ts +10 -8
- package/lib/Avatar/index.js +6 -4
- package/lib/Blocklet/blocklet.d.ts +4 -4
- package/lib/Blocklet/blocklet.js +2 -2
- package/lib/BlockletContext/index.d.ts +3 -3
- package/lib/BlockletNFT/index.d.ts +6 -6
- package/lib/BlockletNFT/index.js +3 -3
- package/lib/BlockletV2/blocklet.d.ts +2 -2
- package/lib/Button/wrap.d.ts +4 -4
- package/lib/Button/wrap.js +2 -2
- package/lib/CardSelector/index.js +0 -1
- package/lib/Center/index.d.ts +1 -1
- package/lib/ClickToCopy/copy-button.d.ts +5 -4
- package/lib/ClickToCopy/copy-button.js +0 -1
- package/lib/ClickToCopy/hook.d.ts +3 -8
- package/lib/ClickToCopy/index.d.ts +6 -4
- package/lib/CodeBlock/index.d.ts +3 -1
- package/lib/CookieConsent/index.d.ts +8 -29
- package/lib/CookieConsent/index.js +3 -17
- package/lib/CountDown/index.d.ts +21 -25
- package/lib/CountDown/index.js +12 -11
- package/lib/DID/index.d.ts +9 -8
- package/lib/Datatable/index.d.ts +5 -5
- package/lib/Datatable/index.js +5 -5
- package/lib/Dialog/confirm.d.ts +6 -6
- package/lib/Dialog/confirm.js +3 -3
- package/lib/Dialog/types.d.ts +1 -1
- package/lib/DidLogo/index.d.ts +5 -25
- package/lib/DidLogo/index.js +4 -15
- package/lib/DriftBot/index.d.ts +13 -19
- package/lib/DriftBot/index.js +5 -6
- package/lib/Earth/index.d.ts +28 -10
- package/lib/Earth/index.js +12 -52
- package/lib/Earth/util.d.ts +10 -5
- package/lib/Earth/util.js +1 -0
- package/lib/ErrorBoundary/fallback.d.ts +12 -19
- package/lib/ErrorBoundary/fallback.js +2 -19
- package/lib/ErrorBoundary/index.d.ts +1 -1
- package/lib/Footer/index.d.ts +17 -24
- package/lib/Footer/index.js +2 -11
- package/lib/Header/header.d.ts +2 -2
- package/lib/Icon/image.d.ts +3 -2
- package/lib/Icon/index.d.ts +6 -4
- package/lib/Img/index.d.ts +1 -1
- package/lib/Img/index.js +1 -1
- package/lib/InfoRow/index.d.ts +9 -32
- package/lib/InfoRow/index.js +10 -23
- package/lib/Layout/dashboard/external-link.d.ts +13 -14
- package/lib/Layout/dashboard/external-link.js +5 -22
- package/lib/Layout/dashboard/full-page.d.ts +19 -11
- package/lib/Layout/dashboard/full-page.js +2 -6
- package/lib/Layout/dashboard/index.d.ts +20 -39
- package/lib/Layout/dashboard/index.js +10 -38
- package/lib/Layout/dashboard/sidebar.d.ts +17 -20
- package/lib/Layout/dashboard/sidebar.js +3 -16
- package/lib/Layout/dashboard-legacy/header.d.ts +10 -36
- package/lib/Layout/dashboard-legacy/header.js +5 -24
- package/lib/Layout/dashboard-legacy/index.d.ts +17 -56
- package/lib/Layout/dashboard-legacy/index.js +12 -41
- package/lib/Layout/dashboard-legacy/sidebar.d.ts +15 -26
- package/lib/Layout/dashboard-legacy/sidebar.js +5 -15
- package/lib/Layout/index.d.ts +17 -56
- package/lib/Layout/index.js +24 -50
- package/lib/LoadingMask/index.d.ts +8 -31
- package/lib/LoadingMask/index.js +3 -19
- package/lib/Locale/browser-lang.d.ts +4 -1
- package/lib/Locale/browser-lang.js +8 -3
- package/lib/Locale/context.d.ts +18 -8
- package/lib/Locale/context.js +1 -1
- package/lib/Locale/languages.d.ts +9 -55
- package/lib/Locale/selector.d.ts +10 -26
- package/lib/Locale/selector.js +8 -25
- package/lib/Locale/util.d.ts +4 -3
- package/lib/Locale/util.js +0 -1
- package/lib/Logo/index.d.ts +9 -40
- package/lib/Logo/index.js +88 -46
- package/lib/Metric/index.d.ts +9 -31
- package/lib/Metric/index.js +5 -20
- package/lib/NFTDisplay/aspect-ratio-container.d.ts +5 -12
- package/lib/NFTDisplay/aspect-ratio-container.js +0 -5
- package/lib/NFTDisplay/broken.d.ts +3 -13
- package/lib/NFTDisplay/broken.js +80 -10
- package/lib/NFTDisplay/displayApi.d.ts +1 -1
- package/lib/NFTDisplay/index.d.ts +28 -6
- package/lib/NFTDisplay/index.js +17 -51
- package/lib/NFTDisplay/svg-embedder/img.d.ts +8 -23
- package/lib/NFTDisplay/svg-embedder/img.js +3 -17
- package/lib/NFTDisplay/svg-embedder/inline-svg.d.ts +7 -13
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +1 -8
- package/lib/NavMenu/nav-menu.d.ts +2 -0
- package/lib/NavMenu/nav-menu.js +0 -1
- package/lib/PageScroller/index.d.ts +14 -13
- package/lib/PageScroller/index.js +12 -37
- package/lib/PageScroller/usePrevValue.d.ts +1 -1
- package/lib/PageScroller/usePrevValue.js +1 -2
- package/lib/Passport/index.d.ts +1 -1
- package/lib/Passport/passport.d.ts +10 -30
- package/lib/Passport/passport.js +5 -19
- package/lib/PoweredByArcBlock/index.d.ts +4 -14
- package/lib/PoweredByArcBlock/index.js +1 -8
- package/lib/PricingTable/PricingPlan.d.ts +11 -9
- package/lib/PricingTable/PricingPlan.js +0 -4
- package/lib/PricingTable/index.d.ts +5 -3
- package/lib/PricingTable/index.js +1 -5
- package/lib/QRCode/index.d.ts +11 -22
- package/lib/QRCode/index.js +2 -17
- package/lib/RelativeTime/index.d.ts +12 -40
- package/lib/RelativeTime/index.js +7 -27
- package/lib/Result/common.d.ts +26 -45
- package/lib/Result/common.js +2 -4
- package/lib/Result/index.d.ts +5 -18
- package/lib/Result/index.js +1 -9
- package/lib/Result/result.d.ts +7 -29
- package/lib/Result/result.js +2 -17
- package/lib/Result/translations.d.ts +2 -54
- package/lib/Screenshot/BaseScreenshot/index.d.ts +7 -24
- package/lib/Screenshot/BaseScreenshot/index.js +2 -15
- package/lib/Screenshot/BaseScreenshot/shells/Macbook.d.ts +25 -19
- package/lib/Screenshot/BaseScreenshot/shells/Phone.d.ts +25 -19
- package/lib/Screenshot/index.d.ts +84 -28
- package/lib/Screenshot/index.js +14 -43
- package/lib/SessionBlocklet/index.d.ts +6 -19
- package/lib/SessionBlocklet/index.js +5 -15
- package/lib/SessionManager/index.d.ts +1 -1
- package/lib/SessionPermission/index.d.ts +9 -17
- package/lib/SessionPermission/index.js +3 -11
- package/lib/SessionUser/components/logged-in.d.ts +9 -31
- package/lib/SessionUser/components/logged-in.js +13 -29
- package/lib/SessionUser/components/session-user-item.d.ts +8 -1
- package/lib/SessionUser/components/session-user-item.js +2 -12
- package/lib/SessionUser/components/session-user-switch.d.ts +9 -21
- package/lib/SessionUser/components/session-user-switch.js +3 -15
- package/lib/SessionUser/components/un-login.d.ts +7 -23
- package/lib/SessionUser/components/un-login.js +4 -16
- package/lib/SessionUser/components/user-info.d.ts +12 -29
- package/lib/SessionUser/components/user-info.js +4 -19
- package/lib/SessionUser/index.d.ts +7 -30
- package/lib/SessionUser/index.js +5 -26
- package/lib/SessionUser/libs/translation.d.ts +2 -31
- package/lib/SessionUser/libs/translation.js +1 -0
- package/lib/SessionUser/libs/utils.d.ts +10 -9
- package/lib/Sparkline/index.d.ts +22 -1
- package/lib/Sparkline/index.js +25 -17
- package/lib/Spinner/index.d.ts +6 -1
- package/lib/Spinner/index.js +4 -11
- package/lib/Success/index.d.ts +5 -21
- package/lib/Success/index.js +10 -19
- package/lib/Tabs/index.d.ts +12 -26
- package/lib/Tabs/index.js +7 -37
- package/lib/TextCollapse/index.d.ts +10 -10
- package/lib/TextCollapse/index.js +4 -21
- package/lib/Theme/index.js +0 -2
- package/lib/Theme/theme-provider.d.ts +1 -1
- package/lib/Theme/theme.d.ts +4 -1
- package/lib/Theme/theme.js +1 -2
- package/lib/Typography/index.d.ts +5 -24
- package/lib/Typography/index.js +5 -17
- package/lib/Util/index.d.ts +17 -8
- package/lib/Util/index.js +22 -3
- package/lib/Video/index.d.ts +12 -16
- package/lib/Video/index.js +0 -14
- package/lib/Wallet/Action.d.ts +13 -18
- package/lib/Wallet/Action.js +0 -7
- package/lib/Wallet/Download.d.ts +24 -30
- package/lib/Wallet/Download.js +201 -18
- package/lib/Wallet/Open.d.ts +5 -15
- package/lib/Wallet/Open.js +5 -11
- package/lib/WalletOSIcon/index.d.ts +6 -25
- package/lib/WalletOSIcon/index.js +3 -16
- package/lib/WebWalletSWKeeper/index.d.ts +8 -20
- package/lib/WebWalletSWKeeper/index.js +14 -19
- package/lib/WechatPrompt/index.js +2 -0
- package/lib/global.d.ts +15 -0
- package/lib/type.d.ts +12 -3
- package/lib/withTheme/index.d.ts +8 -6
- package/lib/withTracker/index.d.ts +1 -1
- package/lib/withTracker/index.js +3 -0
- package/package.json +9 -5
- package/src/Address/did-address.tsx +7 -6
- package/src/Address/index.tsx +1 -1
- package/src/Avatar/index.jsx +6 -4
- package/src/Blocklet/blocklet.jsx +2 -2
- package/src/BlockletContext/index.tsx +3 -3
- package/src/BlockletNFT/index.jsx +3 -3
- package/src/BlockletV2/blocklet.tsx +2 -2
- package/src/Button/wrap.jsx +2 -2
- package/src/CardSelector/index.tsx +0 -1
- package/src/Center/index.tsx +1 -1
- package/src/ClickToCopy/copy-button.tsx +4 -4
- package/src/ClickToCopy/hook.ts +3 -2
- package/src/ClickToCopy/index.tsx +6 -5
- package/src/CodeBlock/index.tsx +3 -1
- package/src/CookieConsent/{index.jsx → index.tsx} +16 -19
- package/src/CountDown/{index.jsx → index.tsx} +30 -16
- package/src/DID/index.tsx +9 -8
- package/src/Datatable/index.jsx +5 -5
- package/src/Dialog/confirm.jsx +3 -3
- package/src/Dialog/types.d.ts +1 -1
- package/src/DidLogo/{index.jsx → index.tsx} +7 -14
- package/src/DriftBot/{index.jsx → index.tsx} +13 -11
- package/src/Earth/{index.jsx → index.tsx} +94 -66
- package/src/Earth/{util.js → util.ts} +20 -17
- package/src/ErrorBoundary/{fallback.jsx → fallback.tsx} +20 -21
- package/src/Footer/{index.jsx → index.tsx} +17 -14
- package/src/Header/header.tsx +2 -3
- package/src/Header/responsive-header.tsx +0 -1
- package/src/Icon/image.tsx +3 -3
- package/src/Icon/index.tsx +7 -4
- package/src/Img/index.jsx +1 -1
- package/src/InfoRow/{index.jsx → index.tsx} +32 -25
- package/src/Layout/dashboard/external-link.tsx +46 -0
- package/src/Layout/dashboard/{full-page.jsx → full-page.tsx} +20 -9
- package/src/Layout/dashboard/{index.jsx → index.tsx} +42 -44
- package/src/Layout/dashboard/{sidebar.jsx → sidebar.tsx} +23 -20
- package/src/Layout/dashboard-legacy/{header.jsx → header.tsx} +16 -26
- package/src/Layout/dashboard-legacy/{index.jsx → index.tsx} +32 -46
- package/src/Layout/dashboard-legacy/{sidebar.jsx → sidebar.tsx} +27 -19
- package/src/Layout/{index.jsx → index.tsx} +41 -47
- package/src/LoadingMask/{index.jsx → index.tsx} +18 -20
- package/src/Locale/{browser-lang.js → browser-lang.ts} +9 -7
- package/src/Locale/context.tsx +18 -11
- package/src/Locale/{languages.js → languages.ts} +1 -1
- package/src/Locale/{selector.jsx → selector.tsx} +32 -29
- package/src/Locale/{util.js → util.ts} +9 -2
- package/src/Logo/index.tsx +58 -0
- package/src/Metric/{index.jsx → index.tsx} +23 -18
- package/src/NFTDisplay/{aspect-ratio-container.jsx → aspect-ratio-container.tsx} +9 -7
- package/src/NFTDisplay/{broken.jsx → broken.tsx} +7 -12
- package/src/NFTDisplay/{displayApi.js → displayApi.ts} +4 -4
- package/src/NFTDisplay/{index.jsx → index.tsx} +59 -64
- package/src/NFTDisplay/svg-embedder/{img.jsx → img.tsx} +10 -18
- package/src/NFTDisplay/svg-embedder/{inline-svg.jsx → inline-svg.tsx} +8 -9
- package/src/NavMenu/nav-menu.tsx +2 -3
- package/src/PageScroller/{index.jsx → index.tsx} +40 -53
- package/src/PageScroller/{usePrevValue.js → usePrevValue.ts} +2 -3
- package/src/Passport/{passport.jsx → passport.tsx} +22 -19
- package/src/PoweredByArcBlock/{index.jsx → index.tsx} +6 -11
- package/src/PricingTable/{PricingPlan.jsx → PricingPlan.tsx} +15 -5
- package/src/PricingTable/{index.jsx → index.tsx} +9 -6
- package/src/QRCode/{index.jsx → index.tsx} +14 -19
- package/src/RelativeTime/{index.jsx → index.tsx} +24 -24
- package/src/Result/{common.jsx → common.tsx} +17 -13
- package/src/Result/index.tsx +30 -0
- package/src/Result/{result.jsx → result.tsx} +8 -17
- package/src/Result/{translations.js → translations.ts} +3 -1
- package/src/Screenshot/BaseScreenshot/{index.jsx → index.tsx} +9 -15
- package/src/Screenshot/BaseScreenshot/shells/{Macbook.jsx → Macbook.tsx} +3 -1
- package/src/Screenshot/BaseScreenshot/shells/{Phone.jsx → Phone.tsx} +3 -1
- package/src/Screenshot/{index.jsx → index.tsx} +60 -54
- package/src/SessionBlocklet/{index.jsx → index.tsx} +9 -14
- package/src/SessionPermission/index.tsx +25 -0
- package/src/SessionUser/components/{logged-in.jsx → logged-in.tsx} +49 -31
- package/src/SessionUser/components/session-user-item.tsx +97 -0
- package/src/SessionUser/components/{session-user-switch.jsx → session-user-switch.tsx} +16 -21
- package/src/SessionUser/components/{un-login.jsx → un-login.tsx} +10 -15
- package/src/SessionUser/components/{user-info.jsx → user-info.tsx} +16 -22
- package/src/SessionUser/index.tsx +26 -0
- package/src/SessionUser/libs/{translation.js → translation.ts} +3 -1
- package/src/SessionUser/libs/utils.ts +39 -0
- package/src/Sparkline/{index.jsx → index.tsx} +38 -22
- package/src/Spinner/index.tsx +20 -0
- package/src/Success/{index.jsx → index.tsx} +13 -16
- package/src/Tabs/{index.jsx → index.tsx} +26 -40
- package/src/TextCollapse/{index.jsx → index.tsx} +26 -21
- package/src/Theme/index.ts +0 -1
- package/src/Theme/theme-provider.tsx +1 -1
- package/src/Theme/theme.ts +6 -3
- package/src/Typography/{index.jsx → index.tsx} +19 -22
- package/src/Util/index.ts +26 -9
- package/src/Video/{index.jsx → index.tsx} +7 -10
- package/src/Wallet/{Action.jsx → Action.tsx} +16 -12
- package/src/Wallet/{Download.jsx → Download.tsx} +25 -21
- package/src/Wallet/{Open.jsx → Open.tsx} +8 -11
- package/src/WalletOSIcon/{index.jsx → index.tsx} +8 -16
- package/src/WebWalletSWKeeper/{index.jsx → index.tsx} +21 -24
- package/src/WechatPrompt/{index.jsx → index.tsx} +1 -0
- package/src/global.d.ts +15 -0
- package/src/type.d.ts +12 -3
- package/src/withTheme/{index.jsx → index.tsx} +12 -2
- package/src/withTracker/{index.jsx → index.tsx} +6 -4
- package/src/Layout/dashboard/external-link.jsx +0 -47
- package/src/Logo/index.jsx +0 -66
- package/src/Result/index.jsx +0 -33
- package/src/SessionPermission/index.jsx +0 -28
- package/src/SessionUser/components/session-user-item.jsx +0 -93
- package/src/SessionUser/index.jsx +0 -38
- package/src/SessionUser/libs/utils.js +0 -37
- package/src/Spinner/index.jsx +0 -21
- /package/src/ErrorBoundary/{index.jsx → index.ts} +0 -0
- /package/src/NFTDisplay/{loading.jsx → loading.tsx} +0 -0
- /package/src/Passport/{index.jsx → index.ts} +0 -0
- /package/src/SessionManager/{index.jsx → index.tsx} +0 -0
@@ -1,31 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
declare namespace SessionUser {
|
8
|
-
namespace propTypes {
|
9
|
-
let session: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
10
|
-
user: PropTypes.Requireable<PropTypes.InferProps<{
|
11
|
-
did: PropTypes.Validator<string>;
|
12
|
-
fullName: PropTypes.Validator<string>;
|
13
|
-
avatar: PropTypes.Validator<string>;
|
14
|
-
email: PropTypes.Requireable<string>;
|
15
|
-
}>>;
|
16
|
-
}>>>;
|
17
|
-
let onBindWallet: PropTypes.Requireable<(...args: any[]) => any>;
|
18
|
-
let locale: PropTypes.Requireable<string>;
|
19
|
-
let size: PropTypes.Requireable<number>;
|
20
|
-
}
|
21
|
-
namespace defaultProps {
|
22
|
-
export { noop as onBindWallet };
|
23
|
-
let locale_1: string;
|
24
|
-
export { locale_1 as locale };
|
25
|
-
let size_1: number;
|
26
|
-
export { size_1 as size };
|
27
|
-
}
|
1
|
+
import type { Locale, Session } from '../type';
|
2
|
+
export interface SessionUserProps {
|
3
|
+
session: Session;
|
4
|
+
onBindWallet?: () => void;
|
5
|
+
locale?: Locale;
|
6
|
+
size?: number;
|
28
7
|
}
|
29
|
-
export default SessionUser;
|
30
|
-
import PropTypes from 'prop-types';
|
31
|
-
import noop from 'lodash/noop';
|
8
|
+
export default function SessionUser({ session, onBindWallet, locale, size }: SessionUserProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/SessionUser/index.js
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import PropTypes from 'prop-types';
|
3
2
|
import noop from 'lodash/noop';
|
4
3
|
import { useCreation } from 'ahooks';
|
5
4
|
import LoggedIn from './components/logged-in';
|
6
5
|
import UnLogin from './components/un-login';
|
7
6
|
export default function SessionUser({
|
8
7
|
session,
|
9
|
-
onBindWallet,
|
10
|
-
locale,
|
11
|
-
size
|
8
|
+
onBindWallet = noop,
|
9
|
+
locale = 'en',
|
10
|
+
size = 24
|
12
11
|
}) {
|
13
12
|
const isBlocklet = useCreation(() => {
|
14
13
|
return !!globalThis?.blocklet;
|
15
|
-
});
|
14
|
+
}, []);
|
16
15
|
if (session.user) {
|
17
16
|
return /*#__PURE__*/_jsx(LoggedIn, {
|
18
17
|
isBlocklet: isBlocklet,
|
@@ -24,26 +23,6 @@ export default function SessionUser({
|
|
24
23
|
}
|
25
24
|
return /*#__PURE__*/_jsx(UnLogin, {
|
26
25
|
session: session,
|
27
|
-
isBlocklet: isBlocklet,
|
28
|
-
locale: locale,
|
29
26
|
size: size
|
30
27
|
});
|
31
|
-
}
|
32
|
-
SessionUser.propTypes = {
|
33
|
-
session: PropTypes.shape({
|
34
|
-
user: PropTypes.shape({
|
35
|
-
did: PropTypes.string.isRequired,
|
36
|
-
fullName: PropTypes.string.isRequired,
|
37
|
-
avatar: PropTypes.string.isRequired,
|
38
|
-
email: PropTypes.string
|
39
|
-
})
|
40
|
-
}).isRequired,
|
41
|
-
onBindWallet: PropTypes.func,
|
42
|
-
locale: PropTypes.string,
|
43
|
-
size: PropTypes.number
|
44
|
-
};
|
45
|
-
SessionUser.defaultProps = {
|
46
|
-
onBindWallet: noop,
|
47
|
-
locale: 'en',
|
48
|
-
size: 24
|
49
|
-
};
|
28
|
+
}
|
@@ -1,31 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export let connectDIDWallet: string;
|
4
|
-
let _switch: string;
|
5
|
-
export { _switch as switch };
|
6
|
-
export let profile: string;
|
7
|
-
export let invite: string;
|
8
|
-
export let inviteCopied: string;
|
9
|
-
export let dashboard: string;
|
10
|
-
export let logout: string;
|
11
|
-
export let addAnotherAccount: string;
|
12
|
-
}
|
13
|
-
namespace zh {
|
14
|
-
let connectDIDWallet_1: string;
|
15
|
-
export { connectDIDWallet_1 as connectDIDWallet };
|
16
|
-
let _switch_1: string;
|
17
|
-
export { _switch_1 as switch };
|
18
|
-
let profile_1: string;
|
19
|
-
export { profile_1 as profile };
|
20
|
-
let invite_1: string;
|
21
|
-
export { invite_1 as invite };
|
22
|
-
let inviteCopied_1: string;
|
23
|
-
export { inviteCopied_1 as inviteCopied };
|
24
|
-
let dashboard_1: string;
|
25
|
-
export { dashboard_1 as dashboard };
|
26
|
-
let logout_1: string;
|
27
|
-
export { logout_1 as logout };
|
28
|
-
let addAnotherAccount_1: string;
|
29
|
-
export { addAnotherAccount_1 as addAnotherAccount };
|
30
|
-
}
|
31
|
-
}
|
1
|
+
import type { Translations } from '../../type';
|
2
|
+
export declare const translations: Translations;
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export function
|
5
|
-
export function
|
6
|
-
export function
|
7
|
-
export function
|
8
|
-
export function
|
9
|
-
export function
|
1
|
+
import { User } from '../../type';
|
2
|
+
export declare const getSourceAppPid: (user: User) => any;
|
3
|
+
export declare const getCurrentAppPid: (user: User) => any;
|
4
|
+
export declare function getPermanentDid(user: User): any;
|
5
|
+
export declare function getConnectedAccounts(user: User): any;
|
6
|
+
export declare function getSourceProvider(user: User): any;
|
7
|
+
export declare function getSourceProviders(user: User): any;
|
8
|
+
export declare function getConnectedDids(user: User): any;
|
9
|
+
export declare function getWallet(user: User): any;
|
10
|
+
export declare function getWalletDid(user: User): any;
|
package/lib/Sparkline/index.d.ts
CHANGED
@@ -1 +1,22 @@
|
|
1
|
-
export
|
1
|
+
export interface SparklineProps {
|
2
|
+
svg: SVGElement;
|
3
|
+
entries?: number[] | {
|
4
|
+
value: number;
|
5
|
+
}[];
|
6
|
+
options?: {
|
7
|
+
fetch?: (entry: {
|
8
|
+
value: number;
|
9
|
+
}) => number;
|
10
|
+
interactive?: boolean;
|
11
|
+
onmousemove?: (event: MouseEvent, currentDataPoint: {
|
12
|
+
value: number;
|
13
|
+
index: number;
|
14
|
+
x: number;
|
15
|
+
y: number;
|
16
|
+
}) => void;
|
17
|
+
onmouseout?: (event: MouseEvent) => void;
|
18
|
+
spotRadius?: number;
|
19
|
+
cursorWidth?: number;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
export default function sparkline({ svg, entries: _entries, options }: SparklineProps): void;
|
package/lib/Sparkline/index.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
/* eslint-disable guard-for-in */
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
3
1
|
// origin: https://github.com/fnando/sparkline
|
4
2
|
function getY(max, height, diff, value) {
|
5
3
|
return parseFloat((height - value * height / max + diff).toFixed(2));
|
@@ -12,26 +10,31 @@ function defaultFetch(entry) {
|
|
12
10
|
}
|
13
11
|
function buildElement(tag, attrs) {
|
14
12
|
const element = document.createElementNS('http://www.w3.org/2000/svg', tag);
|
13
|
+
|
14
|
+
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
15
15
|
for (const name in attrs) {
|
16
16
|
element.setAttribute(name, attrs[name]);
|
17
17
|
}
|
18
18
|
return element;
|
19
19
|
}
|
20
|
-
export default function sparkline(
|
20
|
+
export default function sparkline({
|
21
|
+
svg,
|
22
|
+
entries: _entries = [],
|
23
|
+
options = {}
|
24
|
+
}) {
|
21
25
|
removeChildren(svg);
|
22
|
-
if (
|
26
|
+
if (_entries.length <= 1) {
|
23
27
|
return;
|
24
28
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
if (typeof entries[0] === 'number') {
|
29
|
-
// eslint-disable-next-line no-param-reassign
|
30
|
-
entries = entries.map(entry => {
|
29
|
+
let entries = [];
|
30
|
+
if (typeof _entries[0] === 'number') {
|
31
|
+
entries = _entries.map(entry => {
|
31
32
|
return {
|
32
33
|
value: entry
|
33
34
|
};
|
34
35
|
});
|
36
|
+
} else {
|
37
|
+
entries = _entries;
|
35
38
|
}
|
36
39
|
|
37
40
|
// This function will be called whenever the mouse moves
|
@@ -60,6 +63,7 @@ export default function sparkline(svg, entries, options) {
|
|
60
63
|
|
61
64
|
// Get the stroke width; this is used to compute the
|
62
65
|
// rendering offset.
|
66
|
+
// @ts-expect-error
|
63
67
|
const strokeWidth = parseFloat(svg.attributes['stroke-width'].value);
|
64
68
|
|
65
69
|
// By default, data must be formatted as an array of numbers or
|
@@ -72,10 +76,12 @@ export default function sparkline(svg, entries, options) {
|
|
72
76
|
const values = entries.map(entry => fetch(entry));
|
73
77
|
|
74
78
|
// The rendering width will account for the spot size.
|
79
|
+
// @ts-expect-error
|
75
80
|
const width = parseFloat(svg.attributes.width.value) - spotDiameter * 2;
|
76
81
|
|
77
82
|
// Get the SVG element's full height.
|
78
83
|
// This is used
|
84
|
+
// @ts-expect-error
|
79
85
|
const fullHeight = parseFloat(svg.attributes.height.value);
|
80
86
|
|
81
87
|
// The rendering height accounts for stroke width and spot size.
|
@@ -145,16 +151,18 @@ export default function sparkline(svg, entries, options) {
|
|
145
151
|
svg.appendChild(cursor);
|
146
152
|
svg.appendChild(spot);
|
147
153
|
const interactionLayer = buildElement('rect', {
|
154
|
+
// @ts-expect-error
|
148
155
|
width: svg.attributes.width.value,
|
156
|
+
// @ts-expect-error
|
149
157
|
height: svg.attributes.height.value,
|
150
158
|
style: 'fill: transparent; stroke: transparent',
|
151
159
|
class: 'sparkline--interaction-layer'
|
152
160
|
});
|
153
161
|
svg.appendChild(interactionLayer);
|
154
162
|
interactionLayer.addEventListener('mouseout', event => {
|
155
|
-
cursor.setAttribute('x1', offscreen);
|
156
|
-
cursor.setAttribute('x2', offscreen);
|
157
|
-
spot.setAttribute('cx', offscreen);
|
163
|
+
cursor.setAttribute('x1', offscreen.toString());
|
164
|
+
cursor.setAttribute('x2', offscreen.toString());
|
165
|
+
spot.setAttribute('cx', offscreen.toString());
|
158
166
|
if (onmouseout) {
|
159
167
|
onmouseout(event);
|
160
168
|
}
|
@@ -182,10 +190,10 @@ export default function sparkline(svg, entries, options) {
|
|
182
190
|
const {
|
183
191
|
y
|
184
192
|
} = currentDataPoint;
|
185
|
-
spot.setAttribute('cx', x);
|
186
|
-
spot.setAttribute('cy', y);
|
187
|
-
cursor.setAttribute('x1', x);
|
188
|
-
cursor.setAttribute('x2', x);
|
193
|
+
spot.setAttribute('cx', x.toString());
|
194
|
+
spot.setAttribute('cy', y.toString());
|
195
|
+
cursor.setAttribute('x1', x.toString());
|
196
|
+
cursor.setAttribute('x2', x.toString());
|
189
197
|
if (onmousemove) {
|
190
198
|
onmousemove(event, currentDataPoint);
|
191
199
|
}
|
package/lib/Spinner/index.d.ts
CHANGED
@@ -1,2 +1,7 @@
|
|
1
|
-
|
1
|
+
import { type CircularProgressProps } from '@mui/material/CircularProgress';
|
2
|
+
export interface SpinnerProps extends Omit<CircularProgressProps, 'size'> {
|
3
|
+
/** 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容 */
|
4
|
+
size?: number | [number, number];
|
5
|
+
}
|
6
|
+
declare const _default: (props: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
2
7
|
export default _default;
|
package/lib/Spinner/index.js
CHANGED
@@ -1,22 +1,15 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import CircularProgress from '@mui/material/CircularProgress';
|
3
3
|
import { withDeprecated } from '../Util/deprecate';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Spinner
|
7
|
-
*
|
8
|
-
* 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现
|
9
|
-
*
|
10
|
-
* - 之前 size prop 是 array 类型, 需要与 CircularProgress#size 兼容
|
11
|
-
* - color 默认使用 #4598fa, 如果调用方传入了 color prop 或 style#color, 则默认 color 被覆盖
|
12
|
-
*/
|
4
|
+
/** 之前的 Spinner 实现由内外 2 个环构成, 现在改为基于 @mui/material/CircularProgress 的实现 */
|
13
5
|
function Spinner(props) {
|
14
6
|
const _props = {
|
15
7
|
...props
|
16
8
|
};
|
9
|
+
|
17
10
|
// 兼容之前的 size prop (设置外圈/内圈的尺寸)
|
18
|
-
if (_props.size && Array.isArray(
|
19
|
-
[_props.size] =
|
11
|
+
if (_props.size && Array.isArray(props.size)) {
|
12
|
+
[_props.size] = props.size;
|
20
13
|
}
|
21
14
|
return /*#__PURE__*/_jsx(CircularProgress, {
|
22
15
|
..._props
|
package/lib/Success/index.d.ts
CHANGED
@@ -1,22 +1,6 @@
|
|
1
|
-
|
2
|
-
size
|
3
|
-
backgroundColor
|
4
|
-
borderWidth
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
6
|
-
declare namespace Success {
|
7
|
-
namespace propTypes {
|
8
|
-
let size: PropTypes.Requireable<number>;
|
9
|
-
let borderWidth: PropTypes.Requireable<number>;
|
10
|
-
let backgroundColor: PropTypes.Requireable<string>;
|
11
|
-
}
|
12
|
-
namespace defaultProps {
|
13
|
-
let size_1: number;
|
14
|
-
export { size_1 as size };
|
15
|
-
let borderWidth_1: number;
|
16
|
-
export { borderWidth_1 as borderWidth };
|
17
|
-
let backgroundColor_1: string;
|
18
|
-
export { backgroundColor_1 as backgroundColor };
|
19
|
-
}
|
1
|
+
export interface SuccessProps {
|
2
|
+
size?: number;
|
3
|
+
backgroundColor?: string;
|
4
|
+
borderWidth?: number;
|
20
5
|
}
|
21
|
-
export default Success;
|
22
|
-
import PropTypes from 'prop-types';
|
6
|
+
export default function Success({ size, backgroundColor, borderWidth }: SuccessProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/Success/index.js
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import PropTypes from 'prop-types';
|
3
2
|
import { Box } from '@mui/material';
|
4
|
-
|
5
3
|
// FIXME: @zhanghan 目前无法适配各种 size,后续优化
|
6
4
|
export default function Success({
|
7
|
-
size,
|
8
|
-
backgroundColor,
|
9
|
-
borderWidth
|
5
|
+
size = 64,
|
6
|
+
backgroundColor = 'white',
|
7
|
+
borderWidth = 4
|
10
8
|
}) {
|
11
9
|
const contentSize = size - borderWidth * 2;
|
12
10
|
return /*#__PURE__*/_jsxs(Box, {
|
@@ -19,7 +17,8 @@ export default function Success({
|
|
19
17
|
'&, *, *::before, *::after': {
|
20
18
|
boxSizing: 'content-box !important'
|
21
19
|
},
|
22
|
-
|
20
|
+
// 转圈边框的颜色
|
21
|
+
border: theme => `${borderWidth}px solid ${theme.palette.success.light}`,
|
23
22
|
'&::before, &::after': {
|
24
23
|
content: '""',
|
25
24
|
height: '125%',
|
@@ -44,7 +43,8 @@ export default function Success({
|
|
44
43
|
},
|
45
44
|
'.icon-line': {
|
46
45
|
height: `${borderWidth + 1}px`,
|
47
|
-
|
46
|
+
// 对勾的颜色
|
47
|
+
backgroundColor: theme => theme.palette.success.light,
|
48
48
|
display: 'block',
|
49
49
|
borderRadius: '100vw',
|
50
50
|
position: 'absolute',
|
@@ -145,7 +145,8 @@ export default function Success({
|
|
145
145
|
borderRadius: '100%',
|
146
146
|
position: 'absolute',
|
147
147
|
boxSizing: 'contentBox',
|
148
|
-
|
148
|
+
// 圆环的颜色
|
149
|
+
border: `${borderWidth}px solid rgba(76, 175, 80, 0.63)`
|
149
150
|
}
|
150
151
|
}), /*#__PURE__*/_jsx(Box, {
|
151
152
|
className: "icon-fix",
|
@@ -161,14 +162,4 @@ export default function Success({
|
|
161
162
|
}
|
162
163
|
})]
|
163
164
|
});
|
164
|
-
}
|
165
|
-
Success.propTypes = {
|
166
|
-
size: PropTypes.number,
|
167
|
-
borderWidth: PropTypes.number,
|
168
|
-
backgroundColor: PropTypes.string
|
169
|
-
};
|
170
|
-
Success.defaultProps = {
|
171
|
-
size: 64,
|
172
|
-
borderWidth: 4,
|
173
|
-
backgroundColor: 'white'
|
174
|
-
};
|
165
|
+
}
|
package/lib/Tabs/index.d.ts
CHANGED
@@ -1,27 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
* @return {import('react').ReactNode}
|
12
|
-
*/
|
13
|
-
declare function Tabs({ tabs, current, onChange, ...rest }: TabsProps): import("react").ReactNode;
|
14
|
-
declare namespace Tabs {
|
15
|
-
namespace propTypes {
|
16
|
-
let tabs: PropTypes.Validator<any[]>;
|
17
|
-
let current: PropTypes.Validator<string>;
|
18
|
-
let onChange: PropTypes.Validator<(...args: any[]) => any>;
|
19
|
-
}
|
1
|
+
import { type TabsProps as MuiTabsProps } from '@mui/material';
|
2
|
+
interface TabsProps extends Omit<MuiTabsProps, 'variant' | 'onChange'> {
|
3
|
+
tabs: {
|
4
|
+
value: any;
|
5
|
+
label: React.ReactNode;
|
6
|
+
icon?: string | React.ReactElement;
|
7
|
+
}[];
|
8
|
+
current: any;
|
9
|
+
onChange: (value: string) => void;
|
10
|
+
variant?: 'card' | 'line' | MuiTabsProps['variant'];
|
20
11
|
}
|
21
|
-
export default Tabs;
|
22
|
-
export
|
23
|
-
tabs: string[];
|
24
|
-
onChange: (value: any) => {};
|
25
|
-
variant: "line" | "card" | "fullWidth" | "scrollable" | "standard";
|
26
|
-
};
|
27
|
-
import PropTypes from 'prop-types';
|
12
|
+
export default function Tabs({ tabs, current, onChange, variant, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
13
|
+
export {};
|
package/lib/Tabs/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import PropTypes from 'prop-types';
|
3
2
|
import { Tabs as MuiTabs, Tab as MuiTab } from '@mui/material';
|
4
3
|
import { temp as colors } from '../Colors';
|
5
4
|
import { styled } from '../Theme';
|
@@ -76,15 +75,10 @@ function CardTabs({
|
|
76
75
|
className: classes.tab,
|
77
76
|
value: x.value,
|
78
77
|
label: x.label,
|
79
|
-
icon: x.icon
|
78
|
+
icon: x.icon
|
80
79
|
}, x.value))
|
81
80
|
});
|
82
81
|
}
|
83
|
-
CardTabs.propTypes = {
|
84
|
-
tabs: PropTypes.array.isRequired,
|
85
|
-
current: PropTypes.string.isRequired,
|
86
|
-
onChange: PropTypes.func.isRequired
|
87
|
-
};
|
88
82
|
function LineTabs({
|
89
83
|
tabs,
|
90
84
|
current,
|
@@ -145,37 +139,18 @@ function LineTabs({
|
|
145
139
|
className: classes.tab,
|
146
140
|
value: x.value,
|
147
141
|
label: x.label,
|
148
|
-
icon: x.icon
|
142
|
+
icon: x.icon
|
149
143
|
}, x.value))
|
150
144
|
});
|
151
145
|
}
|
152
|
-
LineTabs.propTypes = {
|
153
|
-
tabs: PropTypes.array.isRequired,
|
154
|
-
current: PropTypes.string.isRequired,
|
155
|
-
onChange: PropTypes.func.isRequired
|
156
|
-
};
|
157
|
-
|
158
|
-
/**
|
159
|
-
* @typedef {import('@mui/material').TabsProps & {
|
160
|
-
* tabs: string[];
|
161
|
-
* onChange: (value) => {};
|
162
|
-
* variant: 'line' | 'card' | 'fullWidth' | 'scrollable' | 'standard'
|
163
|
-
* }} TabsProps
|
164
|
-
*/
|
165
|
-
|
166
|
-
/**
|
167
|
-
* @description
|
168
|
-
* @param {TabsProps} props
|
169
|
-
* @return {import('react').ReactNode}
|
170
|
-
*/
|
171
|
-
|
172
146
|
export default function Tabs({
|
173
147
|
tabs,
|
174
148
|
current,
|
175
149
|
onChange,
|
150
|
+
variant,
|
176
151
|
...rest
|
177
152
|
}) {
|
178
|
-
if (
|
153
|
+
if (variant === 'card') {
|
179
154
|
return /*#__PURE__*/_jsx(CardTabs, {
|
180
155
|
...rest,
|
181
156
|
tabs: tabs,
|
@@ -183,7 +158,7 @@ export default function Tabs({
|
|
183
158
|
onChange: onChange
|
184
159
|
});
|
185
160
|
}
|
186
|
-
if (
|
161
|
+
if (variant === 'line') {
|
187
162
|
return /*#__PURE__*/_jsx(LineTabs, {
|
188
163
|
...rest,
|
189
164
|
tabs: tabs,
|
@@ -203,12 +178,7 @@ export default function Tabs({
|
|
203
178
|
className: classes.tab,
|
204
179
|
value: x.value,
|
205
180
|
label: x.label,
|
206
|
-
icon: x.icon
|
181
|
+
icon: x.icon
|
207
182
|
}, x.value))
|
208
183
|
});
|
209
|
-
}
|
210
|
-
Tabs.propTypes = {
|
211
|
-
tabs: PropTypes.array.isRequired,
|
212
|
-
current: PropTypes.string.isRequired,
|
213
|
-
onChange: PropTypes.func.isRequired
|
214
|
-
};
|
184
|
+
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
startChars
|
5
|
-
endChars
|
6
|
-
scaleFactor
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
export interface TextCollapseProps {
|
2
|
+
children: string;
|
3
|
+
maxWidth: string | number;
|
4
|
+
startChars?: number;
|
5
|
+
endChars?: number;
|
6
|
+
scaleFactor?: number;
|
7
|
+
style?: React.CSSProperties;
|
8
|
+
fontType?: 'monospace' | 'normal';
|
9
|
+
}
|
10
|
+
declare const _default: (props: TextCollapseProps) => import("react/jsx-runtime").JSX.Element;
|
11
11
|
export default _default;
|
@@ -1,16 +1,15 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import PropTypes from 'prop-types';
|
3
2
|
import Typography from '@mui/material/Typography';
|
4
3
|
import { styled } from '../Theme';
|
5
4
|
import { withDeprecated } from '../Util/deprecate';
|
6
5
|
function TextCollapse({
|
7
6
|
children,
|
8
|
-
startChars,
|
9
|
-
endChars,
|
10
|
-
scaleFactor,
|
11
7
|
maxWidth,
|
8
|
+
startChars = 5,
|
9
|
+
endChars = 5,
|
10
|
+
scaleFactor = 0.45,
|
12
11
|
style,
|
13
|
-
fontType,
|
12
|
+
fontType = 'normal',
|
14
13
|
...rest
|
15
14
|
}) {
|
16
15
|
if (typeof children !== 'string') {
|
@@ -45,22 +44,6 @@ function TextCollapse({
|
|
45
44
|
})]
|
46
45
|
});
|
47
46
|
}
|
48
|
-
TextCollapse.propTypes = {
|
49
|
-
children: PropTypes.string.isRequired,
|
50
|
-
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
51
|
-
fontType: PropTypes.oneOf(['monospace', 'normal']),
|
52
|
-
style: PropTypes.object,
|
53
|
-
startChars: PropTypes.number,
|
54
|
-
endChars: PropTypes.number,
|
55
|
-
scaleFactor: PropTypes.number
|
56
|
-
};
|
57
|
-
TextCollapse.defaultProps = {
|
58
|
-
style: {},
|
59
|
-
startChars: 5,
|
60
|
-
endChars: 5,
|
61
|
-
scaleFactor: 0.45,
|
62
|
-
fontType: 'normal'
|
63
|
-
};
|
64
47
|
export default withDeprecated(TextCollapse, {
|
65
48
|
name: 'TextCollapse'
|
66
49
|
});
|
package/lib/Theme/index.js
CHANGED
@@ -4,7 +4,7 @@ import { Theme } from '@mui/material/styles';
|
|
4
4
|
* 默认的 theme provider, 可以为 webapp/blocklet 快捷的配置好 mui theme provider
|
5
5
|
*/
|
6
6
|
declare function ThemeProvider({ children, theme, injectFirst, }: {
|
7
|
-
children
|
7
|
+
children?: React.ReactNode;
|
8
8
|
theme: Theme;
|
9
9
|
injectFirst: boolean;
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
package/lib/Theme/theme.d.ts
CHANGED
@@ -8,7 +8,7 @@ import '@fontsource/inter/latin-ext-300.css';
|
|
8
8
|
import '@fontsource/inter/latin-ext-400.css';
|
9
9
|
import '@fontsource/inter/latin-ext-500.css';
|
10
10
|
import '@fontsource/inter/latin-ext-700.css';
|
11
|
-
declare module '@mui/material/styles
|
11
|
+
declare module '@mui/material/styles' {
|
12
12
|
interface Theme {
|
13
13
|
mode?: string;
|
14
14
|
themeName?: string;
|
@@ -28,6 +28,9 @@ declare module '@mui/material/styles/createTheme' {
|
|
28
28
|
pageWidth?: string;
|
29
29
|
colors?: Record<string, string>;
|
30
30
|
}
|
31
|
+
interface TypeText {
|
32
|
+
hint: string;
|
33
|
+
}
|
31
34
|
}
|
32
35
|
export declare const create: ({ mode, pageWidth, typography, overrides, palette, components, ...rest }?: {
|
33
36
|
mode?: string;
|
package/lib/Theme/theme.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
/* eslint-disable no-unused-vars */
|
2
1
|
/* eslint-disable no-shadow */
|
3
2
|
// https://app.zeplin.io/styleguide/5d1436f1e97c2156f49c0725/colors
|
4
3
|
import { createTheme as _createTheme, responsiveFontSizes } from '@mui/material/styles';
|
@@ -13,7 +12,7 @@ import '@fontsource/inter/latin-ext-500.css';
|
|
13
12
|
import '@fontsource/inter/latin-ext-700.css';
|
14
13
|
import colors from '../Colors';
|
15
14
|
|
16
|
-
// 扩展 Theme
|
15
|
+
// 扩展 Theme
|
17
16
|
|
18
17
|
const muiDarkTheme = _createTheme({
|
19
18
|
palette: {
|