@dynamic-labs/sdk-react-core 0.19.0-alpha.24 → 0.19.0-alpha.26

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +8 -8
  5. package/src/lib/components/LogoutButton/LogoutButton.cjs +3 -1
  6. package/src/lib/components/LogoutButton/LogoutButton.js +3 -1
  7. package/src/lib/components/SocialSignIn/SocialSignIn.cjs +16 -6
  8. package/src/lib/components/SocialSignIn/SocialSignIn.d.ts +1 -1
  9. package/src/lib/components/SocialSignIn/SocialSignIn.js +16 -6
  10. package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -0
  11. package/src/lib/context/DynamicContext/DynamicContext.js +1 -0
  12. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +8 -8
  13. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +8 -8
  14. package/src/lib/shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.cjs +2 -1
  15. package/src/lib/shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.js +2 -1
  16. package/src/lib/shared/utils/hooks/useOnClickOutside/index.cjs +2 -2
  17. package/src/lib/shared/utils/hooks/useOnClickOutside/index.js +2 -2
  18. package/src/lib/styles/index.shadow.cjs +1 -1
  19. package/src/lib/styles/index.shadow.js +1 -1
  20. package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.cjs +26 -0
  21. package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.d.ts +1 -0
  22. package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.js +22 -0
  23. package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/index.d.ts +1 -0
  24. package/src/lib/utils/functions/index.d.ts +1 -0
  25. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +5 -4
  26. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.d.ts +2 -1
  27. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +5 -4
  28. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +12 -6
  29. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +12 -6
  30. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +14 -8
  31. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +14 -8
  32. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
  33. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
  34. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +7 -1
  35. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +7 -1
  36. package/src/lib/views/EmailVerification/EmailVerification.cjs +10 -6
  37. package/src/lib/views/EmailVerification/EmailVerification.js +10 -6
  38. package/src/lib/views/LoginView/LoginView.cjs +4 -1
  39. package/src/lib/views/LoginView/LoginView.js +4 -1
  40. package/src/lib/views/LoginView/sections/LoginWidget.d.ts +1 -0
  41. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +2 -2
  42. package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +2 -2
  43. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +3 -5
  44. package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +3 -5
  45. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -1
  46. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.d.ts +2 -1
  47. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -1
  48. package/src/lib/views/LoginView/useLoginView.cjs +33 -19
  49. package/src/lib/views/LoginView/useLoginView.js +34 -20
  50. package/src/lib/views/WalletList/WalletList.cjs +2 -1
  51. package/src/lib/views/WalletList/WalletList.js +2 -1
@@ -24,10 +24,11 @@ var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnable
24
24
  var isEmbeddedWalletPresent = require('../../functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.cjs');
25
25
  var findEmbeddedWalletFromVerifiedCredentials = require('../../functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs');
26
26
  var findTurnkeyWallet = require('../../functions/findTurnkeyWallet/findTurnkeyWallet.cjs');
27
+ var getUserWalletsFromVerifiedCredentials = require('../../functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.cjs');
27
28
 
28
29
  // Hook exposed to customers and used internally to trigger embedded wallet creation
29
30
  const useEmbeddedWallet = () => {
30
- const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, wallets, internalSetShowAuthFlow, internalEvents, } = useInternalDynamicContext.useInternalDynamicContext();
31
+ const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, wallets, internalSetShowAuthFlow, internalEvents, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
31
32
  const { setView } = ViewContext.useViewContext();
32
33
  const userHasEmbeddedWallet = () => {
33
34
  var _a;
@@ -46,9 +47,9 @@ const useEmbeddedWallet = () => {
46
47
  if (!isTurnkeyEnabled.isTurnkeyEnabled(projectSettings)) {
47
48
  throw new Error('Passkey embedded wallet is not enabled');
48
49
  }
49
- const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(jwt);
50
- // if user doesn't have an embedded wallet, show the passkey view to create wallet
51
- if (!embeddedWalletVerifiedCredential) {
50
+ const userWaletsCredentials = getUserWalletsFromVerifiedCredentials.getUserWalletsFromVerifiedCredentials(jwt);
51
+ // if user doesn't have a wallet yet, show the passkey view to create an embedded wallet
52
+ if (!(userWaletsCredentials === null || userWaletsCredentials === void 0 ? void 0 : userWaletsCredentials.length)) {
52
53
  internalSetShowAuthFlow(true);
53
54
  setView('passkey-intro');
54
55
  return new Promise((resolve, reject) => {
@@ -56,14 +57,19 @@ const useEmbeddedWallet = () => {
56
57
  internalEvents.current.once('embeddedWalletFailed', (error) => reject(error));
57
58
  });
58
59
  }
59
- const decodedJwt = decodeJwt.decodeJwt(jwt);
60
+ internalSetShowAuthFlow(false);
61
+ const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(jwt);
60
62
  const turnkeyWallet = findTurnkeyWallet.findTurnkeyWallet(wallets);
63
+ // if user logged in with MM for example, just continue the flow
64
+ if (!embeddedWalletVerifiedCredential) {
65
+ return Promise.resolve(primaryWallet);
66
+ }
67
+ const decodedJwt = decodeJwt.decodeJwt(jwt);
61
68
  // if user already has embedded wallet, set it as primary wallet
62
69
  if (decodedJwt) {
63
70
  (_b = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.setVerifiedCredentials(decodedJwt.verifiedCredentials);
64
71
  setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
65
72
  }
66
- internalSetShowAuthFlow(false);
67
73
  const passkeyWallet = {
68
74
  address: (yield ((_c = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _c === void 0 ? void 0 : _c.fetchPublicAddress())) || '',
69
75
  chain: ((_d = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _d === void 0 ? void 0 : _d.connectedChain) || '',
@@ -20,10 +20,11 @@ import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnab
20
20
  import { isEmbeddedWalletPresent } from '../../functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.js';
21
21
  import { findEmbeddedWalletFromVerifiedCredentials } from '../../functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
22
22
  import { findTurnkeyWallet } from '../../functions/findTurnkeyWallet/findTurnkeyWallet.js';
23
+ import { getUserWalletsFromVerifiedCredentials } from '../../functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.js';
23
24
 
24
25
  // Hook exposed to customers and used internally to trigger embedded wallet creation
25
26
  const useEmbeddedWallet = () => {
26
- const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, wallets, internalSetShowAuthFlow, internalEvents, } = useInternalDynamicContext();
27
+ const { projectSettings, onboardingOnlyJwt, setPrimaryWalletId, wallets, internalSetShowAuthFlow, internalEvents, primaryWallet, } = useInternalDynamicContext();
27
28
  const { setView } = useViewContext();
28
29
  const userHasEmbeddedWallet = () => {
29
30
  var _a;
@@ -42,9 +43,9 @@ const useEmbeddedWallet = () => {
42
43
  if (!isTurnkeyEnabled(projectSettings)) {
43
44
  throw new Error('Passkey embedded wallet is not enabled');
44
45
  }
45
- const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(jwt);
46
- // if user doesn't have an embedded wallet, show the passkey view to create wallet
47
- if (!embeddedWalletVerifiedCredential) {
46
+ const userWaletsCredentials = getUserWalletsFromVerifiedCredentials(jwt);
47
+ // if user doesn't have a wallet yet, show the passkey view to create an embedded wallet
48
+ if (!(userWaletsCredentials === null || userWaletsCredentials === void 0 ? void 0 : userWaletsCredentials.length)) {
48
49
  internalSetShowAuthFlow(true);
49
50
  setView('passkey-intro');
50
51
  return new Promise((resolve, reject) => {
@@ -52,14 +53,19 @@ const useEmbeddedWallet = () => {
52
53
  internalEvents.current.once('embeddedWalletFailed', (error) => reject(error));
53
54
  });
54
55
  }
55
- const decodedJwt = decodeJwt(jwt);
56
+ internalSetShowAuthFlow(false);
57
+ const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(jwt);
56
58
  const turnkeyWallet = findTurnkeyWallet(wallets);
59
+ // if user logged in with MM for example, just continue the flow
60
+ if (!embeddedWalletVerifiedCredential) {
61
+ return Promise.resolve(primaryWallet);
62
+ }
63
+ const decodedJwt = decodeJwt(jwt);
57
64
  // if user already has embedded wallet, set it as primary wallet
58
65
  if (decodedJwt) {
59
66
  (_b = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _b === void 0 ? void 0 : _b.setVerifiedCredentials(decodedJwt.verifiedCredentials);
60
67
  setPrimaryWalletId(embeddedWalletVerifiedCredential.id);
61
68
  }
62
- internalSetShowAuthFlow(false);
63
69
  const passkeyWallet = {
64
70
  address: (yield ((_c = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _c === void 0 ? void 0 : _c.fetchPublicAddress())) || '',
65
71
  chain: ((_d = turnkeyWallet === null || turnkeyWallet === void 0 ? void 0 : turnkeyWallet.walletConnector) === null || _d === void 0 ? void 0 : _d.connectedChain) || '',
@@ -126,6 +126,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
126
126
  }
127
127
  });
128
128
  const signInAccount = (provider, code, verifier, state) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
129
+ var _b;
129
130
  try {
130
131
  const jwt = yield api.signInOAuth(environmentId, provider, {
131
132
  code,
@@ -146,6 +147,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
146
147
  }
147
148
  setCallback('authSuccess');
148
149
  yield createUserProfileByJWT(jwt);
150
+ if (!((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation)) {
151
+ setShowAuthFlow(false);
152
+ onSettled === null || onSettled === void 0 ? void 0 : onSettled();
153
+ return;
154
+ }
149
155
  try {
150
156
  // this function will check turnkey wallet enabled and create wallet if needed
151
157
  // if not enabled, it will throw an error.
@@ -165,7 +171,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
165
171
  }
166
172
  });
167
173
  const connectSocialAccount = (provider, validator) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
168
- var _b, _c;
174
+ var _c, _d;
169
175
  clearInterval(authWindowInterval.current);
170
176
  clearError();
171
177
  setIsProcessing(true);
@@ -184,13 +190,13 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
184
190
  providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: false });
185
191
  };
186
192
  const handleAuthWindowMessage = (event) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
187
- var _d, _e;
193
+ var _e, _f;
188
194
  const message = event.data;
189
195
  const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
190
196
  if (isAuthorizationMessage) {
191
197
  logger.logger.debug('Message received', { data: message });
192
198
  }
193
- const apiProvider = getProviderByType.getProviderByType((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _d !== void 0 ? _d : [], provider);
199
+ const apiProvider = getProviderByType.getProviderByType((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _e !== void 0 ? _e : [], provider);
194
200
  if (!(apiProvider === null || apiProvider === void 0 ? void 0 : apiProvider.redirectUrl)) {
195
201
  return;
196
202
  }
@@ -216,7 +222,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
216
222
  return;
217
223
  }
218
224
  setIsProcessing(true);
219
- if (!((_e = providersWaitingOauthMessage.current) === null || _e === void 0 ? void 0 : _e[provider])) {
225
+ if (!((_f = providersWaitingOauthMessage.current) === null || _f === void 0 ? void 0 : _f[provider])) {
220
226
  handleError(types.SocialOAuthErrorCode.SESSION_TIMEOUT, `Connecting ${provider} account session timeout.`);
221
227
  return;
222
228
  }
@@ -244,12 +250,12 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
244
250
  }
245
251
  setIsProcessing(false);
246
252
  });
247
- const loginUrl = getOauthLoginUrl.getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider);
253
+ const loginUrl = getOauthLoginUrl.getOauthLoginUrl((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _c !== void 0 ? _c : [], provider);
248
254
  if (!loginUrl) {
249
255
  handleError(types.SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`);
250
256
  return;
251
257
  }
252
- if (!((_c = providersWaitingOauthMessage.current) === null || _c === void 0 ? void 0 : _c[provider])) {
258
+ if (!((_d = providersWaitingOauthMessage.current) === null || _d === void 0 ? void 0 : _d[provider])) {
253
259
  window.addEventListener('message', handleAuthWindowMessage);
254
260
  providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: true });
255
261
  }
@@ -292,10 +298,10 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
292
298
  shouldPool.current = true;
293
299
  poolOauthResult(provider, state);
294
300
  authWindowInterval.current = setInterval(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
295
- var _f;
301
+ var _g;
296
302
  shouldPool.current = false;
297
303
  // clear all states/listeners, assuming user closed the window before completing oauth
298
- if ((_f = providersWaitingOauthMessage.current) === null || _f === void 0 ? void 0 : _f[provider]) {
304
+ if ((_g = providersWaitingOauthMessage.current) === null || _g === void 0 ? void 0 : _g[provider]) {
299
305
  clearListeners();
300
306
  handleError(types.SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Connecting ${provider} account window timeout.`);
301
307
  }
@@ -122,6 +122,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
122
122
  }
123
123
  });
124
124
  const signInAccount = (provider, code, verifier, state) => __awaiter(void 0, void 0, void 0, function* () {
125
+ var _b;
125
126
  try {
126
127
  const jwt = yield signInOAuth(environmentId, provider, {
127
128
  code,
@@ -142,6 +143,11 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
142
143
  }
143
144
  setCallback('authSuccess');
144
145
  yield createUserProfileByJWT(jwt);
146
+ if (!((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation)) {
147
+ setShowAuthFlow(false);
148
+ onSettled === null || onSettled === void 0 ? void 0 : onSettled();
149
+ return;
150
+ }
145
151
  try {
146
152
  // this function will check turnkey wallet enabled and create wallet if needed
147
153
  // if not enabled, it will throw an error.
@@ -161,7 +167,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
161
167
  }
162
168
  });
163
169
  const connectSocialAccount = (provider, validator) => __awaiter(void 0, void 0, void 0, function* () {
164
- var _b, _c;
170
+ var _c, _d;
165
171
  clearInterval(authWindowInterval.current);
166
172
  clearError();
167
173
  setIsProcessing(true);
@@ -180,13 +186,13 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
180
186
  providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: false });
181
187
  };
182
188
  const handleAuthWindowMessage = (event) => __awaiter(void 0, void 0, void 0, function* () {
183
- var _d, _e;
189
+ var _e, _f;
184
190
  const message = event.data;
185
191
  const isAuthorizationMessage = (message === null || message === void 0 ? void 0 : message.type) === 'authorization_response';
186
192
  if (isAuthorizationMessage) {
187
193
  logger.debug('Message received', { data: message });
188
194
  }
189
- const apiProvider = getProviderByType((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _d !== void 0 ? _d : [], provider);
195
+ const apiProvider = getProviderByType((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _e !== void 0 ? _e : [], provider);
190
196
  if (!(apiProvider === null || apiProvider === void 0 ? void 0 : apiProvider.redirectUrl)) {
191
197
  return;
192
198
  }
@@ -212,7 +218,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
212
218
  return;
213
219
  }
214
220
  setIsProcessing(true);
215
- if (!((_e = providersWaitingOauthMessage.current) === null || _e === void 0 ? void 0 : _e[provider])) {
221
+ if (!((_f = providersWaitingOauthMessage.current) === null || _f === void 0 ? void 0 : _f[provider])) {
216
222
  handleError(SocialOAuthErrorCode.SESSION_TIMEOUT, `Connecting ${provider} account session timeout.`);
217
223
  return;
218
224
  }
@@ -240,12 +246,12 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
240
246
  }
241
247
  setIsProcessing(false);
242
248
  });
243
- const loginUrl = getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider);
249
+ const loginUrl = getOauthLoginUrl((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _c !== void 0 ? _c : [], provider);
244
250
  if (!loginUrl) {
245
251
  handleError(SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`);
246
252
  return;
247
253
  }
248
- if (!((_c = providersWaitingOauthMessage.current) === null || _c === void 0 ? void 0 : _c[provider])) {
254
+ if (!((_d = providersWaitingOauthMessage.current) === null || _d === void 0 ? void 0 : _d[provider])) {
249
255
  window.addEventListener('message', handleAuthWindowMessage);
250
256
  providersWaitingOauthMessage.current = Object.assign(Object.assign({}, providersWaitingOauthMessage.current), { [provider]: true });
251
257
  }
@@ -288,10 +294,10 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
288
294
  shouldPool.current = true;
289
295
  poolOauthResult(provider, state);
290
296
  authWindowInterval.current = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
291
- var _f;
297
+ var _g;
292
298
  shouldPool.current = false;
293
299
  // clear all states/listeners, assuming user closed the window before completing oauth
294
- if ((_f = providersWaitingOauthMessage.current) === null || _f === void 0 ? void 0 : _f[provider]) {
300
+ if ((_g = providersWaitingOauthMessage.current) === null || _g === void 0 ? void 0 : _g[provider]) {
295
301
  clearListeners();
296
302
  handleError(SocialOAuthErrorCode.OAUTH_WINDOW_TIMEOUT, `Connecting ${provider} account window timeout.`);
297
303
  }
@@ -24,7 +24,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
24
24
  React.useEffect(() => {
25
25
  const fetchNetwork = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
26
26
  try {
27
- if (!primaryWallet)
27
+ if (!(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector))
28
28
  return;
29
29
  const network = yield primaryWallet.connector.getNetwork();
30
30
  setNetwork(network);
@@ -38,7 +38,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
38
38
  }
39
39
  });
40
40
  fetchNetwork();
41
- }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id]);
41
+ }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector]);
42
42
  useWalletConnectorEvent.useWalletConnectorEvent(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, 'disconnect', () => {
43
43
  logger.logger.debug('primary wallet disconnect');
44
44
  handleLogOut();
@@ -20,7 +20,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
20
20
  useEffect(() => {
21
21
  const fetchNetwork = () => __awaiter(void 0, void 0, void 0, function* () {
22
22
  try {
23
- if (!primaryWallet)
23
+ if (!(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector))
24
24
  return;
25
25
  const network = yield primaryWallet.connector.getNetwork();
26
26
  setNetwork(network);
@@ -34,7 +34,7 @@ const useWalletEventListeners = ({ computeConnectedStateForWallets, handleLogOut
34
34
  }
35
35
  });
36
36
  fetchNetwork();
37
- }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.id]);
37
+ }, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector]);
38
38
  useWalletConnectorEvent(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, 'disconnect', () => {
39
39
  logger.debug('primary wallet disconnect');
40
40
  handleLogOut();
@@ -64,7 +64,7 @@ require('../../../components/InlineWidget/InlineWidget.cjs');
64
64
  require('../../../components/MenuList/Dropdown/Dropdown.cjs');
65
65
 
66
66
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
67
- const { policiesConsentInnerComponent, onboardingOnlyJwt, setShowAuthFlow, setCallback, } = useInternalDynamicContext.useInternalDynamicContext();
67
+ const { policiesConsentInnerComponent, onboardingOnlyJwt, setShowAuthFlow, setCallback, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
68
68
  const { setView, view } = ViewContext.useViewContext();
69
69
  const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
70
70
  const decodedJwt = decodeJwt.decodeJwt(onboardingOnlyJwt);
@@ -72,6 +72,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
72
72
  validationSchemaStripUnknown: false,
73
73
  });
74
74
  const onSubmit = React.useCallback((formValues) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
75
+ var _a;
75
76
  const { isEmailVerificationRequired, missingFields } = yield updateUser(formValues);
76
77
  if (isEmailVerificationRequired &&
77
78
  missingFields.map((field) => field.name).toString() === 'email') {
@@ -85,6 +86,10 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
85
86
  return;
86
87
  }
87
88
  setCallback('authSuccess');
89
+ if (!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation)) {
90
+ setShowAuthFlow(false);
91
+ return;
92
+ }
88
93
  try {
89
94
  // this function will check turnkey wallet enabled and create wallet if needed
90
95
  // if not enabled, it will throw an error.
@@ -100,6 +105,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
100
105
  view,
101
106
  createEmbeddedWallet,
102
107
  setShowAuthFlow,
108
+ projectSettings,
103
109
  ]);
104
110
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm.useUserDataForm({
105
111
  fields: (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) || [],
@@ -60,7 +60,7 @@ import '../../../components/InlineWidget/InlineWidget.js';
60
60
  import '../../../components/MenuList/Dropdown/Dropdown.js';
61
61
 
62
62
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
63
- const { policiesConsentInnerComponent, onboardingOnlyJwt, setShowAuthFlow, setCallback, } = useInternalDynamicContext();
63
+ const { policiesConsentInnerComponent, onboardingOnlyJwt, setShowAuthFlow, setCallback, projectSettings, } = useInternalDynamicContext();
64
64
  const { setView, view } = useViewContext();
65
65
  const { createEmbeddedWallet } = useEmbeddedWallet();
66
66
  const decodedJwt = decodeJwt(onboardingOnlyJwt);
@@ -68,6 +68,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
68
68
  validationSchemaStripUnknown: false,
69
69
  });
70
70
  const onSubmit = useCallback((formValues) => __awaiter(void 0, void 0, void 0, function* () {
71
+ var _a;
71
72
  const { isEmailVerificationRequired, missingFields } = yield updateUser(formValues);
72
73
  if (isEmailVerificationRequired &&
73
74
  missingFields.map((field) => field.name).toString() === 'email') {
@@ -81,6 +82,10 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
81
82
  return;
82
83
  }
83
84
  setCallback('authSuccess');
85
+ if (!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation)) {
86
+ setShowAuthFlow(false);
87
+ return;
88
+ }
84
89
  try {
85
90
  // this function will check turnkey wallet enabled and create wallet if needed
86
91
  // if not enabled, it will throw an error.
@@ -96,6 +101,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
96
101
  view,
97
102
  createEmbeddedWallet,
98
103
  setShowAuthFlow,
104
+ projectSettings,
99
105
  ]);
100
106
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm({
101
107
  fields: (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) || [],
@@ -138,12 +138,14 @@ const EmailVerification = () => {
138
138
  if (nextView === 'verified-and-transferred') {
139
139
  setShowTransferMessage(true);
140
140
  }
141
+ if (!((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation)) {
142
+ setShowAuthFlow(false);
143
+ return;
144
+ }
141
145
  try {
142
146
  // this function will check turnkey wallet enabled and create wallet if needed
143
147
  // if not enabled, it will throw an error.
144
- if ((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) {
145
- yield createEmbeddedWallet();
146
- }
148
+ yield createEmbeddedWallet();
147
149
  }
148
150
  catch (e) {
149
151
  setShowAuthFlow(false);
@@ -210,12 +212,14 @@ const EmailVerification = () => {
210
212
  // this timeout is set to make sure that the user will see success message
211
213
  yield sleepToShowSuccessMessage();
212
214
  yield createUserProfileByJWT(jwt);
215
+ if (!((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation)) {
216
+ setShowAuthFlow(false);
217
+ return;
218
+ }
213
219
  try {
214
220
  // this function will check turnkey wallet enabled and create wallet if needed
215
221
  // if not enabled, it will throw an error.
216
- if ((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation) {
217
- yield createEmbeddedWallet();
218
- }
222
+ yield createEmbeddedWallet();
219
223
  }
220
224
  catch (e) {
221
225
  setShowAuthFlow(false);
@@ -134,12 +134,14 @@ const EmailVerification = () => {
134
134
  if (nextView === 'verified-and-transferred') {
135
135
  setShowTransferMessage(true);
136
136
  }
137
+ if (!((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation)) {
138
+ setShowAuthFlow(false);
139
+ return;
140
+ }
137
141
  try {
138
142
  // this function will check turnkey wallet enabled and create wallet if needed
139
143
  // if not enabled, it will throw an error.
140
- if ((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) {
141
- yield createEmbeddedWallet();
142
- }
144
+ yield createEmbeddedWallet();
143
145
  }
144
146
  catch (e) {
145
147
  setShowAuthFlow(false);
@@ -206,12 +208,14 @@ const EmailVerification = () => {
206
208
  // this timeout is set to make sure that the user will see success message
207
209
  yield sleepToShowSuccessMessage();
208
210
  yield createUserProfileByJWT(jwt);
211
+ if (!((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation)) {
212
+ setShowAuthFlow(false);
213
+ return;
214
+ }
209
215
  try {
210
216
  // this function will check turnkey wallet enabled and create wallet if needed
211
217
  // if not enabled, it will throw an error.
212
- if ((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation) {
213
- yield createEmbeddedWallet();
214
- }
218
+ yield createEmbeddedWallet();
215
219
  }
216
220
  catch (e) {
217
221
  setShowAuthFlow(false);
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
+ var sdkApi = require('@dynamic-labs/sdk-api');
7
8
  var Divider = require('../../components/Divider/Divider.cjs');
8
9
  var ErrorContext = require('../../context/ErrorContext/ErrorContext.cjs');
9
10
  var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
@@ -17,6 +18,7 @@ var SocialSignInSection = require('./sections/SocialSignInSection/SocialSignInSe
17
18
  var useLoginView = require('./useLoginView.cjs');
18
19
 
19
20
  const LoginView = () => {
21
+ var _a;
20
22
  const { error } = ErrorContext.useErrorContext();
21
23
  const { loading } = LoadingContext.useLoadingContext();
22
24
  const { view, setView } = ViewContext.useViewContext();
@@ -40,6 +42,7 @@ const LoginView = () => {
40
42
  setShowWalletList(false);
41
43
  }
42
44
  }, [isWalletOnly, view]);
45
+ const numOfWallets = ((_a = logingViewSections.find((section) => section.type === sdkApi.SdkViewSectionType.Wallet)) === null || _a === void 0 ? void 0 : _a.numOfItemsToDisplay) || 0;
43
46
  const renderViewSections = React.useMemo(() => logingViewSections.map((viewSection, index) => {
44
47
  switch (viewSection.type) {
45
48
  case 'separator':
@@ -52,7 +55,7 @@ const LoginView = () => {
52
55
  setShowWalletList(true);
53
56
  }, isLoading: isLoading }, `${viewSection.type}_${index}`));
54
57
  case 'social':
55
- return (jsxRuntime.jsx(SocialSignInSection.SocialSignInSection, { sectionData: viewSection }, `${viewSection.type}_${index}`));
58
+ return (jsxRuntime.jsx(SocialSignInSection.SocialSignInSection, { collapsedLayout: numOfWallets > 1, sectionData: viewSection }, `${viewSection.type}_${index}`));
56
59
  default:
57
60
  return null;
58
61
  }
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useState, useEffect, useMemo } from 'react';
3
+ import { SdkViewSectionType } from '@dynamic-labs/sdk-api';
3
4
  import { Divider } from '../../components/Divider/Divider.js';
4
5
  import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
5
6
  import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
@@ -13,6 +14,7 @@ import { SocialSignInSection } from './sections/SocialSignInSection/SocialSignIn
13
14
  import { useLoginView } from './useLoginView.js';
14
15
 
15
16
  const LoginView = () => {
17
+ var _a;
16
18
  const { error } = useErrorContext();
17
19
  const { loading } = useLoadingContext();
18
20
  const { view, setView } = useViewContext();
@@ -36,6 +38,7 @@ const LoginView = () => {
36
38
  setShowWalletList(false);
37
39
  }
38
40
  }, [isWalletOnly, view]);
41
+ const numOfWallets = ((_a = logingViewSections.find((section) => section.type === SdkViewSectionType.Wallet)) === null || _a === void 0 ? void 0 : _a.numOfItemsToDisplay) || 0;
39
42
  const renderViewSections = useMemo(() => logingViewSections.map((viewSection, index) => {
40
43
  switch (viewSection.type) {
41
44
  case 'separator':
@@ -48,7 +51,7 @@ const LoginView = () => {
48
51
  setShowWalletList(true);
49
52
  }, isLoading: isLoading }, `${viewSection.type}_${index}`));
50
53
  case 'social':
51
- return (jsx(SocialSignInSection, { sectionData: viewSection }, `${viewSection.type}_${index}`));
54
+ return (jsx(SocialSignInSection, { collapsedLayout: numOfWallets > 1, sectionData: viewSection }, `${viewSection.type}_${index}`));
52
55
  default:
53
56
  return null;
54
57
  }
@@ -7,4 +7,5 @@ export interface LoginWidgetProps {
7
7
  export interface SocialSectionProps {
8
8
  defaultProvider?: SocialSignInProviderEnum;
9
9
  numOfItemsToDisplay?: number;
10
+ collapsedLayout?: boolean;
10
11
  }
@@ -60,7 +60,7 @@ require('../../../../../components/MenuList/Dropdown/Dropdown.cjs');
60
60
  var SocialSignIn = require('../../../../../components/SocialSignIn/SocialSignIn.cjs');
61
61
  var SocialRedirectContext = require('../../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
62
62
 
63
- const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
63
+ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
64
64
  const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
65
65
  const { setSocialProvider, socialProvider, enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
66
66
  const { setView, goToInitialView } = ViewContext.useViewContext();
@@ -81,7 +81,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
81
81
  setShowAuthFlow(true);
82
82
  connectSocialAccount(providerEnum);
83
83
  };
84
- return (jsxRuntime.jsx(SocialSignIn.SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay }));
84
+ return (jsxRuntime.jsx(SocialSignIn.SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
85
85
  };
86
86
 
87
87
  exports.DynamicSocialSignIn = DynamicSocialSignIn;
@@ -56,7 +56,7 @@ import '../../../../../components/MenuList/Dropdown/Dropdown.js';
56
56
  import { SocialSignIn } from '../../../../../components/SocialSignIn/SocialSignIn.js';
57
57
  import { useSocialRedirectContext } from '../../../../../context/SocialRedirectContext/SocialRedirectContext.js';
58
58
 
59
- const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
59
+ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
60
60
  const { setShowAuthFlow } = useInternalDynamicContext();
61
61
  const { setSocialProvider, socialProvider, enabledSocialProviders } = useSocialRedirectContext();
62
62
  const { setView, goToInitialView } = useViewContext();
@@ -77,7 +77,7 @@ const DynamicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
77
77
  setShowAuthFlow(true);
78
78
  connectSocialAccount(providerEnum);
79
79
  };
80
- return (jsx(SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay }));
80
+ return (jsx(SocialSignIn, { onSelectProvider: onSelectProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isProcessing, testId: 'dynamic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
81
81
  };
82
82
 
83
83
  export { DynamicSocialSignIn };
@@ -16,7 +16,7 @@ require('../../../../../utils/constants/colors.cjs');
16
16
  require('../../../../../shared/utils/classes/storage/localStorage.cjs');
17
17
  require('viem');
18
18
  require('../../../../../shared/consts/index.cjs');
19
- var useInternalDynamicContext = require('../../../../../context/DynamicContext/useInternalDynamicContext.cjs');
19
+ require('../../../../../context/DynamicContext/DynamicContext.cjs');
20
20
  require('@dynamic-labs/multi-wallet');
21
21
  require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
22
22
  require('../../../../../context/ThemeContext/ThemeContext.cjs');
@@ -60,16 +60,14 @@ require('../../../../../components/MenuList/Dropdown/Dropdown.cjs');
60
60
  var SocialSignIn = require('../../../../../components/SocialSignIn/SocialSignIn.cjs');
61
61
  var SocialRedirectContext = require('../../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
62
62
 
63
- const MagicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
64
- const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext.useInternalDynamicContext();
63
+ const MagicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
65
64
  const { socialProvider, setSocialProvider, socialWalletConnector, enabledSocialProviders, } = SocialRedirectContext.useSocialRedirectContext();
66
- const socialProviders = socialProvidersFilter(enabledSocialProviders);
67
65
  const { mutate: onClickProvider, isLoading } = useMutation.useMutation((provider) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
68
66
  setSocialProvider(provider);
69
67
  yield (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.endSession());
70
68
  return socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.connect(provider);
71
69
  }));
72
- return (jsxRuntime.jsx(SocialSignIn.SocialSignIn, { onSelectProvider: onClickProvider, providers: socialProviders, selectedProvider: socialProvider, isLoading: isLoading, testId: 'magic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay }));
70
+ return (jsxRuntime.jsx(SocialSignIn.SocialSignIn, { onSelectProvider: onClickProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isLoading, testId: 'magic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
73
71
  };
74
72
 
75
73
  exports.MagicSocialSignIn = MagicSocialSignIn;
@@ -12,7 +12,7 @@ import '../../../../../utils/constants/colors.js';
12
12
  import '../../../../../shared/utils/classes/storage/localStorage.js';
13
13
  import 'viem';
14
14
  import '../../../../../shared/consts/index.js';
15
- import { useInternalDynamicContext } from '../../../../../context/DynamicContext/useInternalDynamicContext.js';
15
+ import '../../../../../context/DynamicContext/DynamicContext.js';
16
16
  import '@dynamic-labs/multi-wallet';
17
17
  import '../../../../../components/ShadowDOM/ShadowDOM.js';
18
18
  import '../../../../../context/ThemeContext/ThemeContext.js';
@@ -56,16 +56,14 @@ import '../../../../../components/MenuList/Dropdown/Dropdown.js';
56
56
  import { SocialSignIn } from '../../../../../components/SocialSignIn/SocialSignIn.js';
57
57
  import { useSocialRedirectContext } from '../../../../../context/SocialRedirectContext/SocialRedirectContext.js';
58
58
 
59
- const MagicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, }) => {
60
- const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext();
59
+ const MagicSocialSignIn = ({ defaultProvider, numOfItemsToDisplay, collapsedLayout, }) => {
61
60
  const { socialProvider, setSocialProvider, socialWalletConnector, enabledSocialProviders, } = useSocialRedirectContext();
62
- const socialProviders = socialProvidersFilter(enabledSocialProviders);
63
61
  const { mutate: onClickProvider, isLoading } = useMutation((provider) => __awaiter(void 0, void 0, void 0, function* () {
64
62
  setSocialProvider(provider);
65
63
  yield (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.endSession());
66
64
  return socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.connect(provider);
67
65
  }));
68
- return (jsx(SocialSignIn, { onSelectProvider: onClickProvider, providers: socialProviders, selectedProvider: socialProvider, isLoading: isLoading, testId: 'magic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay }));
66
+ return (jsx(SocialSignIn, { onSelectProvider: onClickProvider, providers: enabledSocialProviders, selectedProvider: socialProvider, isLoading: isLoading, testId: 'magic-social-sign-in', defaultProvider: defaultProvider, numOfItemsToDisplay: numOfItemsToDisplay, collapsedLayout: collapsedLayout }));
69
67
  };
70
68
 
71
69
  export { MagicSocialSignIn };