@getpara/react-sdk 2.0.0-alpha.30 → 2.0.0-alpha.32
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/modal/ParaModal.js +4 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.d.ts +1 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.js +12 -0
- package/dist/modal/components/Body/Body.js +4 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +2 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +24 -13
- package/dist/modal/components/Waiting/Waiting.d.ts +1 -1
- package/dist/modal/components/Waiting/Waiting.js +1 -1
- package/dist/modal/constants/constants.js +1 -1
- package/dist/modal/utils/steps.d.ts +6 -3
- package/dist/modal/utils/steps.js +8 -2
- package/dist/provider/providers/AuthProvider.js +33 -3
- package/package.json +8 -8
package/dist/modal/ParaModal.js
CHANGED
|
@@ -49,6 +49,8 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
49
49
|
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
50
50
|
const { signUpOrLogIn, isCreateGuestWalletsPending } = useAuthActions();
|
|
51
51
|
const { isLoading: isAccountLoading, isConnected } = useAccount();
|
|
52
|
+
const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
|
|
53
|
+
const setIsIFrameReady = useModalStore((state) => state.setIsIFrameReady);
|
|
52
54
|
const [isModalMounted, setIsModalMounted] = useState(false);
|
|
53
55
|
const externalWallets = useStore((state) => state.externalWallets);
|
|
54
56
|
const providerProps = useStore((state) => state.providerProps);
|
|
@@ -136,6 +138,8 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
136
138
|
if (!para.isReady) {
|
|
137
139
|
return;
|
|
138
140
|
}
|
|
141
|
+
setIFrameUrl(void 0);
|
|
142
|
+
setIsIFrameReady(false);
|
|
139
143
|
const isAccount = isConnected, isGuest = isAccount && para.isGuestMode || isCreateGuestWalletsPending;
|
|
140
144
|
switch (true) {
|
|
141
145
|
case !!currentStepOverride:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingIFrameStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useModalStore } from "../../stores/index.js";
|
|
5
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingIFrameStep = () => {
|
|
7
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
+
return /* @__PURE__ */ jsx(Waiting, { heading: isLogin ? "Logging you in..." : "Creating your account..." });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
AwaitingIFrameStep
|
|
12
|
+
};
|
|
@@ -43,6 +43,7 @@ import { AccountProfileLinkOptions } from "../Account/AccountProfileLinkOptions.
|
|
|
43
43
|
import { AccountProfileLink } from "../Account/AccountProfileLink.js";
|
|
44
44
|
import { AccountProfileUnlink } from "../Account/AccountProfileUnlink.js";
|
|
45
45
|
import { ExternalWalletNetworkSelectStep } from "../ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js";
|
|
46
|
+
import { AwaitingIFrameStep } from "../AwaitingIFrameStep/AwaitingIFrameStep.js";
|
|
46
47
|
const MIN_HEIGHT = {
|
|
47
48
|
[ModalStep.ADD_FUNDS_AWAITING]: "680px"
|
|
48
49
|
};
|
|
@@ -192,6 +193,9 @@ const Body = ({
|
|
|
192
193
|
case ModalStep.EX_WALLET_NETWORK_SELECT: {
|
|
193
194
|
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, {});
|
|
194
195
|
}
|
|
196
|
+
case ModalStep.AWAITING_IFRAME: {
|
|
197
|
+
return /* @__PURE__ */ jsx(AwaitingIFrameStep, {});
|
|
198
|
+
}
|
|
195
199
|
default: {
|
|
196
200
|
if (IFrameSteps.includes(currentStep)) {
|
|
197
201
|
return null;
|
|
@@ -50,7 +50,8 @@ const useStepTitle = () => {
|
|
|
50
50
|
[ModalStep.ACCOUNT_PROFILE]: isAccountLinkingEnabled ? "Profile" : "Settings",
|
|
51
51
|
[ModalStep.ACCOUNT_PROFILE_LIST]: "Link Account",
|
|
52
52
|
[ModalStep.ACCOUNT_PROFILE_ADD]: "Link Account",
|
|
53
|
-
[ModalStep.ACCOUNT_PROFILE_REMOVE]: "Unlink Account"
|
|
53
|
+
[ModalStep.ACCOUNT_PROFILE_REMOVE]: "Unlink Account",
|
|
54
|
+
[ModalStep.AWAITING_IFRAME]: isLogin ? "Login" : "Sign Up"
|
|
54
55
|
}),
|
|
55
56
|
[isLogin, chainId, hideWallets]
|
|
56
57
|
);
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect } from "react";
|
|
4
5
|
import { useModalStore } from "../../stores/index.js";
|
|
5
6
|
import { IFrameSteps } from "../../utils/steps.js";
|
|
6
7
|
import { safeStyled } from "@getpara/react-common";
|
|
7
8
|
import { SpinnerContainer } from "@getpara/react-common";
|
|
8
9
|
import { CpslSpinner } from "@getpara/react-components";
|
|
10
|
+
import { getPortalBaseURL } from "@getpara/web-sdk";
|
|
9
11
|
import { MOBILE_SIZE } from "../../constants/constants.js";
|
|
10
12
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
13
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
14
|
const IFrameStep = () => {
|
|
12
15
|
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
13
16
|
const setIsReady = useModalStore((state) => state.setIsIFrameReady);
|
|
@@ -17,21 +20,28 @@ const IFrameStep = () => {
|
|
|
17
20
|
var _a;
|
|
18
21
|
return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
|
|
19
22
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const para = useInternalClient();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const handleMessage = (event) => {
|
|
26
|
+
const portalBase = getPortalBaseURL(para.ctx);
|
|
27
|
+
if (!event.origin.startsWith(portalBase)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (event.data && event.data.type === "LOADED") {
|
|
31
|
+
setIsReady(true);
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener("message", handleMessage);
|
|
35
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
36
|
+
}, [setIsReady]);
|
|
37
|
+
return /* @__PURE__ */ jsxs(OuterContainer, { $isVisible: IFrameSteps.includes(currentStep), $embeddedModal: !!embeddedModal, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Container, { $isReady: !!isReady, children: /* @__PURE__ */ jsx("iframe", { src: iFrameUrl }) }),
|
|
39
|
+
!isReady && /* @__PURE__ */ jsx(SpinnerContainer, { style: { width: "100%", height: "100%", flex: 1, position: "absolute" }, children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) })
|
|
31
40
|
] });
|
|
32
41
|
};
|
|
33
42
|
const OuterContainer = safeStyled.div`
|
|
34
|
-
|
|
43
|
+
position: relative;
|
|
44
|
+
height: ${({ $isVisible }) => $isVisible ? "528px" : "0px"};
|
|
35
45
|
width: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
36
46
|
flex: ${({ $isVisible }) => $isVisible ? 1 : "auto"};
|
|
37
47
|
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 72px 32px"};
|
|
@@ -44,14 +54,15 @@ const OuterContainer = safeStyled.div`
|
|
|
44
54
|
}
|
|
45
55
|
`;
|
|
46
56
|
const Container = safeStyled.div`
|
|
47
|
-
height:
|
|
57
|
+
height: 360px;
|
|
48
58
|
width: 100%;
|
|
49
|
-
|
|
59
|
+
opacity: ${({ $isReady }) => $isReady ? 1 : 0};
|
|
50
60
|
|
|
51
61
|
& > iframe {
|
|
52
62
|
height: 360px;
|
|
53
63
|
width: 100%;
|
|
54
64
|
border: none;
|
|
65
|
+
background: transparent;
|
|
55
66
|
}
|
|
56
67
|
`;
|
|
57
68
|
export {
|
|
@@ -8,7 +8,7 @@ const Waiting = ({ heading, subheading }) => {
|
|
|
8
8
|
/* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) }),
|
|
9
9
|
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
10
10
|
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: heading }),
|
|
11
|
-
/* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: subheading })
|
|
11
|
+
subheading && /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: subheading })
|
|
12
12
|
] })
|
|
13
13
|
] });
|
|
14
14
|
};
|
|
@@ -38,7 +38,8 @@ export declare enum ModalStep {
|
|
|
38
38
|
ACCOUNT_PROFILE = "ACCOUNT_PROFILE",
|
|
39
39
|
ACCOUNT_PROFILE_ADD = "ACCOUNT_PROFILE_ADD",
|
|
40
40
|
ACCOUNT_PROFILE_LIST = "ACCOUNT_PROFILE_LIST",
|
|
41
|
-
ACCOUNT_PROFILE_REMOVE = "ACCOUNT_PROFILE_REMOVE"
|
|
41
|
+
ACCOUNT_PROFILE_REMOVE = "ACCOUNT_PROFILE_REMOVE",
|
|
42
|
+
AWAITING_IFRAME = "AWAITING_IFRAME"
|
|
42
43
|
}
|
|
43
44
|
export type ModalStepPropU = keyof typeof ModalStep | ModalStep;
|
|
44
45
|
export type ModalStepPropL = Lowercase<ModalStepPropU>;
|
|
@@ -89,7 +90,8 @@ declare enum SignUpModalStep {
|
|
|
89
90
|
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
90
91
|
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
91
92
|
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
92
|
-
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE"
|
|
93
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE",
|
|
94
|
+
AWAITING_IFRAME = "AWAITING_IFRAME"
|
|
93
95
|
}
|
|
94
96
|
export declare const SignUpPreviousStep: {
|
|
95
97
|
[key in SignUpModalStep]: ModalStep | undefined;
|
|
@@ -122,7 +124,8 @@ declare enum LoginModalStep {
|
|
|
122
124
|
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
123
125
|
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
124
126
|
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
125
|
-
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE"
|
|
127
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE",
|
|
128
|
+
AWAITING_IFRAME = "AWAITING_IFRAME"
|
|
126
129
|
}
|
|
127
130
|
export declare const LoginPreviousStep: {
|
|
128
131
|
[key in LoginModalStep]: ModalStep | undefined;
|
|
@@ -40,6 +40,7 @@ var ModalStep = /* @__PURE__ */ ((ModalStep2) => {
|
|
|
40
40
|
ModalStep2["ACCOUNT_PROFILE_ADD"] = "ACCOUNT_PROFILE_ADD";
|
|
41
41
|
ModalStep2["ACCOUNT_PROFILE_LIST"] = "ACCOUNT_PROFILE_LIST";
|
|
42
42
|
ModalStep2["ACCOUNT_PROFILE_REMOVE"] = "ACCOUNT_PROFILE_REMOVE";
|
|
43
|
+
ModalStep2["AWAITING_IFRAME"] = "AWAITING_IFRAME";
|
|
43
44
|
return ModalStep2;
|
|
44
45
|
})(ModalStep || {});
|
|
45
46
|
var AccountStep = /* @__PURE__ */ ((AccountStep2) => {
|
|
@@ -71,6 +72,7 @@ const RESET_TO_AUTH_STEPS = [
|
|
|
71
72
|
"AWAITING_BIOMETRIC_CREATION" /* AWAITING_BIOMETRIC_CREATION */,
|
|
72
73
|
"PASSWORD_CREATION" /* PASSWORD_CREATION */,
|
|
73
74
|
"AWAITING_PASSWORD_CREATION" /* AWAITING_PASSWORD_CREATION */,
|
|
75
|
+
"AWAITING_IFRAME" /* AWAITING_IFRAME */,
|
|
74
76
|
"BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */,
|
|
75
77
|
"EMBEDDED_PASSWORD_LOGIN" /* EMBEDDED_PASSWORD_LOGIN */,
|
|
76
78
|
"AWAITING_BIOMETRIC_LOGIN" /* AWAITING_BIOMETRIC_LOGIN */,
|
|
@@ -139,6 +141,7 @@ var SignUpModalStep = /* @__PURE__ */ ((SignUpModalStep2) => {
|
|
|
139
141
|
SignUpModalStep2["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
140
142
|
SignUpModalStep2["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
141
143
|
SignUpModalStep2["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
144
|
+
SignUpModalStep2["AWAITING_IFRAME"] = "AWAITING_IFRAME";
|
|
142
145
|
return SignUpModalStep2;
|
|
143
146
|
})(SignUpModalStep || {});
|
|
144
147
|
const SignUpPreviousStep = {
|
|
@@ -167,7 +170,8 @@ const SignUpPreviousStep = {
|
|
|
167
170
|
["ADD_FUNDS_WITHDRAW" /* ADD_FUNDS_WITHDRAW */]: "WALLET_CREATION_DONE" /* WALLET_CREATION_DONE */,
|
|
168
171
|
["ADD_FUNDS_AWAITING" /* ADD_FUNDS_AWAITING */]: "ADD_FUNDS_BUY" /* ADD_FUNDS_BUY */,
|
|
169
172
|
["ADD_FUNDS_SUCCESS" /* ADD_FUNDS_SUCCESS */]: void 0,
|
|
170
|
-
["ADD_FUNDS_FAILURE" /* ADD_FUNDS_FAILURE */]: void 0
|
|
173
|
+
["ADD_FUNDS_FAILURE" /* ADD_FUNDS_FAILURE */]: void 0,
|
|
174
|
+
["AWAITING_IFRAME" /* AWAITING_IFRAME */]: "BIOMETRIC_CREATION" /* BIOMETRIC_CREATION */
|
|
171
175
|
};
|
|
172
176
|
const GuestPreviousStep = Object.fromEntries([
|
|
173
177
|
...Object.entries(SignUpPreviousStep).map(([key, value]) => {
|
|
@@ -204,6 +208,7 @@ var LoginModalStep = /* @__PURE__ */ ((LoginModalStep2) => {
|
|
|
204
208
|
LoginModalStep2["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
205
209
|
LoginModalStep2["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
206
210
|
LoginModalStep2["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
211
|
+
LoginModalStep2["AWAITING_IFRAME"] = "AWAITING_IFRAME";
|
|
207
212
|
return LoginModalStep2;
|
|
208
213
|
})(LoginModalStep || {});
|
|
209
214
|
const LoginPreviousStep = {
|
|
@@ -231,7 +236,8 @@ const LoginPreviousStep = {
|
|
|
231
236
|
["ADD_FUNDS_WITHDRAW" /* ADD_FUNDS_WITHDRAW */]: "LOGIN_DONE" /* LOGIN_DONE */,
|
|
232
237
|
["ADD_FUNDS_AWAITING" /* ADD_FUNDS_AWAITING */]: "ADD_FUNDS_BUY" /* ADD_FUNDS_BUY */,
|
|
233
238
|
["ADD_FUNDS_SUCCESS" /* ADD_FUNDS_SUCCESS */]: void 0,
|
|
234
|
-
["ADD_FUNDS_FAILURE" /* ADD_FUNDS_FAILURE */]: void 0
|
|
239
|
+
["ADD_FUNDS_FAILURE" /* ADD_FUNDS_FAILURE */]: void 0,
|
|
240
|
+
["AWAITING_IFRAME" /* AWAITING_IFRAME */]: "BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */
|
|
235
241
|
};
|
|
236
242
|
const getStepHasFooter = (step) => {
|
|
237
243
|
switch (step) {
|
|
@@ -26,7 +26,8 @@ import { DEFAULTS } from "../../modal/constants/defaults.js";
|
|
|
26
26
|
import { openPopup } from "../../modal/utils/openPopup.js";
|
|
27
27
|
import {
|
|
28
28
|
AuthMethod,
|
|
29
|
-
entityToWallet
|
|
29
|
+
entityToWallet,
|
|
30
|
+
getPortalBaseURL
|
|
30
31
|
} from "@getpara/web-sdk";
|
|
31
32
|
import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
|
|
32
33
|
import { useGoBack } from "../../modal/hooks/useGoBack.js";
|
|
@@ -84,6 +85,7 @@ function AuthProvider({
|
|
|
84
85
|
const setStep = useModalStore((state) => state.setStep);
|
|
85
86
|
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
86
87
|
const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
|
|
88
|
+
const setIsIFrameReady = useModalStore((state) => state.setIsIFrameReady);
|
|
87
89
|
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
88
90
|
const loginState = useModalStore((state) => state.getLoginState());
|
|
89
91
|
const signupState = useModalStore((state) => state.getSignupState());
|
|
@@ -121,6 +123,24 @@ function AuthProvider({
|
|
|
121
123
|
const stepNow = refs.currentStep.current;
|
|
122
124
|
return !!stepNow && !steps.includes(stepNow);
|
|
123
125
|
};
|
|
126
|
+
const setupListener = () => {
|
|
127
|
+
window.addEventListener("message", function handleMessage(event) {
|
|
128
|
+
var _a;
|
|
129
|
+
const portalBase = getPortalBaseURL(para.ctx);
|
|
130
|
+
if (!event.origin.startsWith(portalBase)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (((_a = event.data) == null ? void 0 : _a.type) === "CLOSE_WINDOW") {
|
|
134
|
+
if (event.data.success) {
|
|
135
|
+
setAuthStepRoute();
|
|
136
|
+
setIFrameUrl();
|
|
137
|
+
setIsIFrameReady(false);
|
|
138
|
+
setStep(ModalStep.AWAITING_IFRAME);
|
|
139
|
+
}
|
|
140
|
+
window.removeEventListener("message", handleMessage);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
};
|
|
124
144
|
const signup = () => {
|
|
125
145
|
if (typeof window !== "undefined") {
|
|
126
146
|
refs.poll.current = {
|
|
@@ -131,7 +151,10 @@ function AuthProvider({
|
|
|
131
151
|
isCanceled: () => cancelIfExitedSteps([
|
|
132
152
|
ModalStep.BIOMETRIC_CREATION,
|
|
133
153
|
ModalStep.AWAITING_BIOMETRIC_CREATION,
|
|
134
|
-
ModalStep.PASSWORD_CREATION
|
|
154
|
+
ModalStep.PASSWORD_CREATION,
|
|
155
|
+
ModalStep.AWAITING_IFRAME,
|
|
156
|
+
ModalStep.VERIFICATIONS,
|
|
157
|
+
ModalStep.EXTERNAL_WALLET_VERIFICATION
|
|
135
158
|
]),
|
|
136
159
|
onPoll: () => {
|
|
137
160
|
goBackIfPopupClosedOnSteps([ModalStep.AWAITING_BIOMETRIC_CREATION]);
|
|
@@ -180,10 +203,12 @@ function AuthProvider({
|
|
|
180
203
|
});
|
|
181
204
|
break;
|
|
182
205
|
case AuthMethod.PASSWORD:
|
|
206
|
+
setupListener();
|
|
183
207
|
if (isIFrameReady) {
|
|
184
208
|
setStep(ModalStep.PASSWORD_CREATION);
|
|
185
209
|
} else {
|
|
186
210
|
setIFrameUrl(authState.passwordUrl);
|
|
211
|
+
setIsIFrameReady(false);
|
|
187
212
|
setAuthStepRoute(ModalStep.PASSWORD_CREATION);
|
|
188
213
|
}
|
|
189
214
|
break;
|
|
@@ -195,7 +220,9 @@ function AuthProvider({
|
|
|
195
220
|
if (authState.isWalletSelectionNeeded || authState.passkeyUrl) {
|
|
196
221
|
setStep(ModalStep.BIOMETRIC_LOGIN);
|
|
197
222
|
} else {
|
|
223
|
+
setupListener();
|
|
198
224
|
setIFrameUrl(authState.passwordUrl);
|
|
225
|
+
setIsIFrameReady(false);
|
|
199
226
|
setStep(ModalStep.EMBEDDED_PASSWORD_LOGIN);
|
|
200
227
|
}
|
|
201
228
|
refs.poll.current = {
|
|
@@ -207,7 +234,8 @@ function AuthProvider({
|
|
|
207
234
|
ModalStep.BIOMETRIC_LOGIN,
|
|
208
235
|
ModalStep.EMBEDDED_PASSWORD_LOGIN,
|
|
209
236
|
ModalStep.AWAITING_BIOMETRIC_LOGIN,
|
|
210
|
-
ModalStep.AWAITING_PASSWORD_LOGIN
|
|
237
|
+
ModalStep.AWAITING_PASSWORD_LOGIN,
|
|
238
|
+
ModalStep.AWAITING_IFRAME
|
|
211
239
|
]),
|
|
212
240
|
onPoll: () => {
|
|
213
241
|
goBackIfPopupClosedOnSteps([
|
|
@@ -265,6 +293,7 @@ function AuthProvider({
|
|
|
265
293
|
[loginState, biometricHints]
|
|
266
294
|
);
|
|
267
295
|
const onNewAuthState = (authState) => __async(this, null, function* () {
|
|
296
|
+
refs.popupWindow.current = null;
|
|
268
297
|
setAuthState(authState);
|
|
269
298
|
switch (authState.stage) {
|
|
270
299
|
case "verify":
|
|
@@ -282,6 +311,7 @@ function AuthProvider({
|
|
|
282
311
|
const isPassword = !!authState.passwordUrl, isPasswordOnly = isPassword && (!authState.passkeyUrl || (userAgent == null ? void 0 : userAgent.device.type) === "mobile" && !authState.isPasskeySupported);
|
|
283
312
|
if (isPassword) {
|
|
284
313
|
setIFrameUrl(authState.passwordUrl);
|
|
314
|
+
setIsIFrameReady(false);
|
|
285
315
|
}
|
|
286
316
|
signup();
|
|
287
317
|
if (isPasswordOnly) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.32",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
9
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
10
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
8
|
+
"@getpara/react-common": "2.0.0-alpha.32",
|
|
9
|
+
"@getpara/react-components": "2.0.0-alpha.32",
|
|
10
|
+
"@getpara/web-sdk": "2.0.0-alpha.32",
|
|
11
11
|
"date-fns": "^3.6.0",
|
|
12
12
|
"framer-motion": "^11.3.31",
|
|
13
13
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"zustand-sync-tabs": "^0.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-alpha.
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-alpha.
|
|
19
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.32",
|
|
20
|
+
"@getpara/evm-wallet-connectors": "2.0.0-alpha.32",
|
|
21
|
+
"@getpara/solana-wallet-connectors": "2.0.0-alpha.32",
|
|
22
22
|
"@tanstack/react-query": "^5.74.0",
|
|
23
23
|
"@testing-library/dom": "^10.4.0",
|
|
24
24
|
"@testing-library/react": "^16.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"package.json",
|
|
39
39
|
"styles.css"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "2c1a4e1ef169c177238c8b0358e84dc86f614614",
|
|
42
42
|
"main": "dist/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@getpara/cosmos-wallet-connectors": "^2.0.0-alpha.26",
|