@matchain/matchid-sdk-react 0.1.32 → 0.1.34
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/dist/index.css +3 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -6
- package/dist/index.mjs.map +1 -1
- package/example/src/components/Login/index.tsx +2 -2
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegra
|
|
|
9
9
|
type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
|
|
10
10
|
type OtherLoginMethodType = 'email' | ISocialLoginMethod
|
|
11
11
|
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
|
|
12
|
+
type WalletType ='evm'|'sol'
|
|
12
13
|
type IEnvConfigType = {
|
|
13
14
|
endpoints: {
|
|
14
15
|
back: string;
|
|
@@ -74,6 +75,7 @@ type LoginBoxProps = {
|
|
|
74
75
|
methods?: OtherLoginMethodType[],
|
|
75
76
|
inModal?: boolean
|
|
76
77
|
recommendMethods?: RecommendLoginMethodType[]
|
|
78
|
+
walletMethods?:WalletType[]
|
|
77
79
|
}
|
|
78
80
|
type LoginPanelProps = {
|
|
79
81
|
header?: React.ReactNode
|
|
@@ -195,12 +197,13 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
|
|
|
195
197
|
|
|
196
198
|
declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
197
199
|
|
|
198
|
-
declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
199
201
|
|
|
200
|
-
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
202
|
+
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, walletMethods, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
201
203
|
loginRender?: ReactNode;
|
|
202
204
|
methods?: OtherLoginMethodType[];
|
|
203
205
|
recommendMethods?: RecommendLoginMethodType[];
|
|
206
|
+
walletMethods?: WalletType[];
|
|
204
207
|
onLoginClick?: () => void;
|
|
205
208
|
popoverPosition?: PopoverPositionType;
|
|
206
209
|
popoverType?: PopoverTypeType;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ type ISocialLoginMethod = 'google' | 'twitter' | 'discord' | 'github' | 'telegra
|
|
|
9
9
|
type LoginMethodType = 'evm' | 'sol' | 'email' | ISocialLoginMethod
|
|
10
10
|
type OtherLoginMethodType = 'email' | ISocialLoginMethod
|
|
11
11
|
type RecommendLoginMethodType = 'wallet' | 'email' | ISocialLoginMethod
|
|
12
|
+
type WalletType ='evm'|'sol'
|
|
12
13
|
type IEnvConfigType = {
|
|
13
14
|
endpoints: {
|
|
14
15
|
back: string;
|
|
@@ -74,6 +75,7 @@ type LoginBoxProps = {
|
|
|
74
75
|
methods?: OtherLoginMethodType[],
|
|
75
76
|
inModal?: boolean
|
|
76
77
|
recommendMethods?: RecommendLoginMethodType[]
|
|
78
|
+
walletMethods?:WalletType[]
|
|
77
79
|
}
|
|
78
80
|
type LoginPanelProps = {
|
|
79
81
|
header?: React.ReactNode
|
|
@@ -195,12 +197,13 @@ declare function ModalWithHeader({ children, onBack, onClose, title, showBorder,
|
|
|
195
197
|
|
|
196
198
|
declare function Popover({ children, content, position, type, className, gap }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
197
199
|
|
|
198
|
-
declare function LoginBox({ recommendMethods, methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
declare function LoginBox({ recommendMethods, methods, walletMethods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
199
201
|
|
|
200
|
-
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
202
|
+
declare function LoginButton({ loginRender, methods, recommendMethods, onLoginClick, popoverPosition, popoverType, popoverGap, walletMethods, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
201
203
|
loginRender?: ReactNode;
|
|
202
204
|
methods?: OtherLoginMethodType[];
|
|
203
205
|
recommendMethods?: RecommendLoginMethodType[];
|
|
206
|
+
walletMethods?: WalletType[];
|
|
204
207
|
onLoginClick?: () => void;
|
|
205
208
|
popoverPosition?: PopoverPositionType;
|
|
206
209
|
popoverType?: PopoverTypeType;
|
package/dist/index.js
CHANGED
|
@@ -1931,6 +1931,7 @@ function StepVerify(props) {
|
|
|
1931
1931
|
placeholder: intl.formatMessage({
|
|
1932
1932
|
id: "codePlaceholder"
|
|
1933
1933
|
}),
|
|
1934
|
+
className: "matchid-email-verify-field",
|
|
1934
1935
|
maxLength: codeLength,
|
|
1935
1936
|
onChange: (e) => setCode(e.target.value),
|
|
1936
1937
|
value: code,
|
|
@@ -2077,6 +2078,7 @@ function LoginBox({
|
|
|
2077
2078
|
"telegram",
|
|
2078
2079
|
"twitter"
|
|
2079
2080
|
],
|
|
2081
|
+
walletMethods = ["evm"],
|
|
2080
2082
|
inModal = false
|
|
2081
2083
|
}) {
|
|
2082
2084
|
const [emailOpen, setEmailOpen] = (0, import_react11.useState)(false);
|
|
@@ -2138,20 +2140,20 @@ function LoginBox({
|
|
|
2138
2140
|
onClick: () => login("youtube")
|
|
2139
2141
|
}
|
|
2140
2142
|
};
|
|
2141
|
-
const
|
|
2142
|
-
{
|
|
2143
|
+
const walletMap = {
|
|
2144
|
+
evm: {
|
|
2143
2145
|
icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EVMDarkIcon, {}),
|
|
2144
2146
|
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EVMLightIcon, {}),
|
|
2145
2147
|
name: "EVM",
|
|
2146
2148
|
onClick: () => login("evm")
|
|
2147
2149
|
},
|
|
2148
|
-
{
|
|
2150
|
+
sol: {
|
|
2149
2151
|
icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SOLDarkIcon, {}),
|
|
2150
2152
|
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SOLLightIcon, {}),
|
|
2151
2153
|
name: "SOL",
|
|
2152
2154
|
onClick: () => login("sol")
|
|
2153
2155
|
}
|
|
2154
|
-
|
|
2156
|
+
};
|
|
2155
2157
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
2156
2158
|
(!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "matchid-login-box", children: [
|
|
2157
2159
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-list", children: recommendMethods.map((m) => {
|
|
@@ -2164,7 +2166,8 @@ function LoginBox({
|
|
|
2164
2166
|
showChildren: m == "wallet" && showWallet,
|
|
2165
2167
|
children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
2166
2168
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
2167
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: walletMethods.map((
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: walletMethods.map((n) => {
|
|
2170
|
+
const m2 = walletMap[n];
|
|
2168
2171
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2169
2172
|
"div",
|
|
2170
2173
|
{
|
|
@@ -2382,6 +2385,7 @@ function LoginButton({
|
|
|
2382
2385
|
popoverPosition = "right",
|
|
2383
2386
|
popoverType = "hover",
|
|
2384
2387
|
popoverGap = 20,
|
|
2388
|
+
walletMethods,
|
|
2385
2389
|
...props
|
|
2386
2390
|
}) {
|
|
2387
2391
|
const intl = (0, import_react_intl9.useIntl)();
|
|
@@ -2389,7 +2393,16 @@ function LoginButton({
|
|
|
2389
2393
|
const [loginOpen, setLoginOpen] = (0, import_react13.useState)(false);
|
|
2390
2394
|
if (!isLogin) {
|
|
2391
2395
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2392
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2397
|
+
LoginModal,
|
|
2398
|
+
{
|
|
2399
|
+
methods,
|
|
2400
|
+
walletMethods,
|
|
2401
|
+
recommendMethods,
|
|
2402
|
+
isOpen: loginOpen,
|
|
2403
|
+
onClose: () => setLoginOpen(false)
|
|
2404
|
+
}
|
|
2405
|
+
),
|
|
2393
2406
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
2394
2407
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UnLoginIcon_default, {}),
|
|
2395
2408
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_intl9.FormattedMessage, { id: "login" }) })
|