@matchain/matchid-sdk-react 0.1.56-alpha.13 → 0.1.56-alpha.15

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/hooks.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  useTransaction,
15
15
  useUserInfo,
16
16
  useWallet
17
- } from "./chunk-RPATABCS.mjs";
17
+ } from "./chunk-A47WTLYD.mjs";
18
18
  import "./chunk-UA6XHZHX.mjs";
19
19
  import "./chunk-IZOOVZAD.mjs";
20
20
  import "./chunk-FQ6PYZPD.mjs";
@@ -92,6 +92,7 @@ declare function useUserInfo(): {
92
92
  bind: (method: LoginMethodType | "wallet", extra?: {
93
93
  [key: string]: any;
94
94
  }) => Promise<string | void | Window | null>;
95
+ getBindEmailCode: (email: string) => Promise<string>;
95
96
  bindByEmail: ({ email, code }: {
96
97
  email: string;
97
98
  code: string;
@@ -92,6 +92,7 @@ declare function useUserInfo(): {
92
92
  bind: (method: LoginMethodType | "wallet", extra?: {
93
93
  [key: string]: any;
94
94
  }) => Promise<string | void | Window | null>;
95
+ getBindEmailCode: (email: string) => Promise<string>;
95
96
  bindByEmail: ({ email, code }: {
96
97
  email: string;
97
98
  code: string;
package/dist/index.css CHANGED
@@ -395,7 +395,7 @@ body {
395
395
  }
396
396
 
397
397
  .matchid-login-panel-box {
398
- max-height: 683px;
398
+ max-height: 520px;
399
399
  overflow-y: auto;
400
400
 
401
401
  &::-webkit-scrollbar {
package/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import * as wagmi_chains from 'wagmi/chains';
5
5
  import * as viem from 'viem';
6
6
  import React__default, { ReactNode } from 'react';
7
7
  import { I as IMatchEvents, L as LocaleType, a as IEnvConfigType, W as WalletConfigType } from './types-C8FLH1yn.mjs';
8
- export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-Bjb30oE3.mjs';
8
+ export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-BIVGhRja.mjs';
9
9
  export { i as Components } from './index-CqHlL6ue.mjs';
10
10
  export { i as UI } from './index-BLjGmf9p.mjs';
11
11
  export { i as Api } from './index-De8efmdb.mjs';
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import * as wagmi_chains from 'wagmi/chains';
5
5
  import * as viem from 'viem';
6
6
  import React__default, { ReactNode } from 'react';
7
7
  import { I as IMatchEvents, L as LocaleType, a as IEnvConfigType, W as WalletConfigType } from './types-C8FLH1yn.js';
8
- export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-CPnKc6o4.js';
8
+ export { i as Hooks, M as ModalProvider, T as ToastProvider } from './index-BINNnZNA.js';
9
9
  export { i as Components } from './index-DZpXCByF.js';
10
10
  export { i as UI } from './index-DQYg6bEA.js';
11
11
  export { i as Api } from './index-CpJtux-G.js';
package/dist/index.js CHANGED
@@ -2515,6 +2515,7 @@ function useUserInfo() {
2515
2515
  auth,
2516
2516
  login: loginMethod,
2517
2517
  bind,
2518
+ getBindEmailCode: getLoginEmailCode,
2518
2519
  bindByEmail,
2519
2520
  getAuthInfo,
2520
2521
  invite
@@ -2999,6 +3000,13 @@ function EmailModal({
2999
3000
  setEmailVal("");
3000
3001
  }
3001
3002
  }, [isOpen]);
3003
+ const verifySuccess = () => {
3004
+ if (onLogin) {
3005
+ onLogin();
3006
+ } else {
3007
+ onClose && onClose();
3008
+ }
3009
+ };
3002
3010
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
3003
3011
  ModalWithHeader,
3004
3012
  {
@@ -3012,7 +3020,7 @@ function EmailModal({
3012
3020
  children: step === "input" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepEmail, { email: emailVal, onContinue: (email) => {
3013
3021
  setEmailVal(email);
3014
3022
  setStep("verify");
3015
- } }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepVerify, { email: emailVal, type, onSuccess: onLogin })
3023
+ } }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StepVerify, { email: emailVal, type, onSuccess: verifySuccess })
3016
3024
  }
3017
3025
  );
3018
3026
  }
@@ -3162,7 +3170,7 @@ function LoginBox({
3162
3170
  walletMethods: walletMethodList
3163
3171
  };
3164
3172
  }, [config.platform, recommendMethods, methods, walletMethods]);
3165
- const { open: emailOpen } = useEmailModalStore();
3173
+ const { isOpen: emailIsOpen, open: emailOpen } = useEmailModalStore();
3166
3174
  const { login } = useUserInfo();
3167
3175
  const [showWallet, setShowWallet] = (0, import_react10.useState)(false);
3168
3176
  const intl = (0, import_react_intl4.useIntl)();
@@ -3228,7 +3236,7 @@ function LoginBox({
3228
3236
  }
3229
3237
  };
3230
3238
  const { walletMap } = useWalletConfig();
3231
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: (!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-box", children: [
3239
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_jsx_runtime67.Fragment, { children: (!inModal || !emailIsOpen) && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "matchid-login-box", children: [
3232
3240
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
3233
3241
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3234
3242
  RecommendItem,
@@ -7890,7 +7898,7 @@ function BusinessProvider({ children }) {
7890
7898
  {
7891
7899
  isOpen: EmailModalStore.isOpen && (EmailModalStore.type == "login" && !overview && !token || EmailModalStore.type == "bind" && !!token && !!overview),
7892
7900
  onClose: EmailModalStore.close,
7893
- onLogin: () => EmailModalStore.close,
7901
+ onLogin: EmailModalStore.close,
7894
7902
  type: EmailModalStore.type,
7895
7903
  zIndex: 199
7896
7904
  }