@reown/appkit-react-native 0.0.0-feat-multi-siwe-20250623183423 → 0.0.0-feat-multi-social-20250630195637

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 (101) hide show
  1. package/lib/commonjs/connectors/WalletConnectConnector.js +1 -1
  2. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
  3. package/lib/commonjs/index.js +9 -58
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/modal/w3m-modal/index.js +1 -14
  6. package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
  7. package/lib/commonjs/modal/w3m-router/index.js +1 -7
  8. package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
  9. package/lib/commonjs/partials/w3m-header/index.js +3 -12
  10. package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
  11. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +1 -1
  12. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  13. package/lib/commonjs/views/w3m-connect-socials-view/index.js +3 -10
  14. package/lib/commonjs/views/w3m-connect-socials-view/index.js.map +1 -1
  15. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +3 -7
  16. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  17. package/lib/commonjs/views/w3m-connect-view/index.js +9 -32
  18. package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
  19. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +2 -0
  20. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
  21. package/lib/commonjs/views/w3m-connecting-social-view/index.js +39 -61
  22. package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
  23. package/lib/module/connectors/WalletConnectConnector.js +1 -1
  24. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  25. package/lib/module/index.js +11 -6
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/modal/w3m-modal/index.js +2 -15
  28. package/lib/module/modal/w3m-modal/index.js.map +1 -1
  29. package/lib/module/modal/w3m-router/index.js +1 -7
  30. package/lib/module/modal/w3m-router/index.js.map +1 -1
  31. package/lib/module/partials/w3m-header/index.js +4 -13
  32. package/lib/module/partials/w3m-header/index.js.map +1 -1
  33. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +1 -1
  34. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  35. package/lib/module/views/w3m-connect-socials-view/index.js +4 -11
  36. package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
  37. package/lib/module/views/w3m-connect-view/components/social-login-list.js +4 -8
  38. package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  39. package/lib/module/views/w3m-connect-view/index.js +11 -34
  40. package/lib/module/views/w3m-connect-view/index.js.map +1 -1
  41. package/lib/module/views/w3m-connecting-siwe-view/index.js +2 -0
  42. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  43. package/lib/module/views/w3m-connecting-social-view/index.js +41 -63
  44. package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
  45. package/lib/typescript/index.d.ts +7 -6
  46. package/lib/typescript/index.d.ts.map +1 -1
  47. package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
  48. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  49. package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
  50. package/lib/typescript/views/w3m-connect-socials-view/index.d.ts.map +1 -1
  51. package/lib/typescript/views/w3m-connect-view/components/social-login-list.d.ts.map +1 -1
  52. package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
  53. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  54. package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
  55. package/package.json +5 -5
  56. package/src/connectors/WalletConnectConnector.ts +1 -1
  57. package/src/index.ts +10 -10
  58. package/src/modal/w3m-modal/index.tsx +0 -12
  59. package/src/modal/w3m-router/index.tsx +1 -7
  60. package/src/partials/w3m-header/index.tsx +5 -22
  61. package/src/views/w3m-account-default-view/components/auth-buttons.tsx +1 -1
  62. package/src/views/w3m-connect-socials-view/index.tsx +3 -14
  63. package/src/views/w3m-connect-view/components/social-login-list.tsx +2 -14
  64. package/src/views/w3m-connect-view/index.tsx +9 -25
  65. package/src/views/w3m-connecting-siwe-view/index.tsx +1 -0
  66. package/src/views/w3m-connecting-social-view/index.tsx +44 -96
  67. package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js +0 -73
  68. package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
  69. package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js +0 -55
  70. package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
  71. package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js +0 -124
  72. package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js.map +0 -1
  73. package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js +0 -24
  74. package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
  75. package/lib/commonjs/views/w3m-create-view/index.js +0 -57
  76. package/lib/commonjs/views/w3m-create-view/index.js.map +0 -1
  77. package/lib/module/views/w3m-connect-view/components/connect-email-input.js +0 -67
  78. package/lib/module/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
  79. package/lib/module/views/w3m-connect-view/components/wallet-guide.js +0 -49
  80. package/lib/module/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
  81. package/lib/module/views/w3m-connecting-farcaster-view/index.js +0 -117
  82. package/lib/module/views/w3m-connecting-farcaster-view/index.js.map +0 -1
  83. package/lib/module/views/w3m-connecting-farcaster-view/styles.js +0 -18
  84. package/lib/module/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
  85. package/lib/module/views/w3m-create-view/index.js +0 -51
  86. package/lib/module/views/w3m-create-view/index.js.map +0 -1
  87. package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts +0 -6
  88. package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts.map +0 -1
  89. package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts +0 -5
  90. package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts.map +0 -1
  91. package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts +0 -2
  92. package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts.map +0 -1
  93. package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts +0 -17
  94. package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts.map +0 -1
  95. package/lib/typescript/views/w3m-create-view/index.d.ts +0 -2
  96. package/lib/typescript/views/w3m-create-view/index.d.ts.map +0 -1
  97. package/src/views/w3m-connect-view/components/connect-email-input.tsx +0 -69
  98. package/src/views/w3m-connect-view/components/wallet-guide.tsx +0 -50
  99. package/src/views/w3m-connecting-farcaster-view/index.tsx +0 -140
  100. package/src/views/w3m-connecting-farcaster-view/styles.ts +0 -18
  101. package/src/views/w3m-create-view/index.tsx +0 -35
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect-email-input.d.ts","sourceRoot":"","sources":["../../../../../src/views/w3m-connect-view/components/connect-email-input.tsx"],"names":[],"mappings":"AAYA,UAAU,KAAK;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,2CAoDnD"}
@@ -1,5 +0,0 @@
1
- export interface WalletGuideProps {
2
- guide: 'explore' | 'get-started';
3
- }
4
- export declare function WalletGuide({ guide }: WalletGuideProps): import("react/jsx-runtime").JSX.Element;
5
- //# sourceMappingURL=wallet-guide.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-guide.d.ts","sourceRoot":"","sources":["../../../../../src/views/w3m-connect-view/components/wallet-guide.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,SAAS,GAAG,aAAa,CAAC;CAClC;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CAgCtD"}
@@ -1,2 +0,0 @@
1
- export declare function ConnectingFarcasterView(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connecting-farcaster-view/index.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,uBAAuB,4CAoHtC"}
@@ -1,17 +0,0 @@
1
- declare const _default: {
2
- errorIcon: {
3
- position: "absolute";
4
- bottom: number;
5
- right: number;
6
- zIndex: number;
7
- };
8
- continueText: {
9
- marginTop: number;
10
- marginBottom: number;
11
- };
12
- copyButton: {
13
- marginTop: number;
14
- };
15
- };
16
- export default _default;
17
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connecting-farcaster-view/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,wBAcG"}
@@ -1,2 +0,0 @@
1
- export declare function CreateView(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-create-view/index.tsx"],"names":[],"mappings":"AAUA,wBAAgB,UAAU,4CAwBzB"}
@@ -1,69 +0,0 @@
1
- import { useSnapshot } from 'valtio';
2
- import { useState } from 'react';
3
- import { EmailInput, FlexView } from '@reown/appkit-ui-react-native';
4
- import {
5
- ConnectorController,
6
- CoreHelperUtil,
7
- EventsController,
8
- RouterController,
9
- SnackController,
10
- type AppKitFrameProvider
11
- } from '@reown/appkit-core-react-native';
12
-
13
- interface Props {
14
- loading?: boolean;
15
- }
16
-
17
- export function ConnectEmailInput({ loading }: Props) {
18
- const { connectors } = useSnapshot(ConnectorController.state);
19
- const [inputLoading, setInputLoading] = useState(false);
20
- const [error, setError] = useState('');
21
- const [isValidEmail, setIsValidEmail] = useState(false);
22
- const authProvider = connectors.find(c => c.type === 'AUTH')?.provider as AppKitFrameProvider;
23
-
24
- const onChangeText = (value: string) => {
25
- setIsValidEmail(CoreHelperUtil.isValidEmail(value));
26
- setError('');
27
- };
28
-
29
- const onEmailFocus = () => {
30
- EventsController.sendEvent({ type: 'track', event: 'EMAIL_LOGIN_SELECTED' });
31
- };
32
-
33
- const onEmailSubmit = async (email: string) => {
34
- try {
35
- if (email.length === 0) return;
36
-
37
- setInputLoading(true);
38
- const response = await authProvider.connectEmail({ email });
39
- EventsController.sendEvent({ type: 'track', event: 'EMAIL_SUBMITTED' });
40
- if (response.action === 'VERIFY_DEVICE') {
41
- RouterController.push('EmailVerifyDevice', { email });
42
- } else if (response.action === 'VERIFY_OTP') {
43
- RouterController.push('EmailVerifyOtp', { email });
44
- }
45
- } catch (e: any) {
46
- const parsedError = CoreHelperUtil.parseError(e);
47
- if (parsedError?.includes('valid email')) {
48
- setError('Invalid email. Try again.');
49
- } else {
50
- SnackController.showError(parsedError);
51
- }
52
- } finally {
53
- setInputLoading(false);
54
- }
55
- };
56
-
57
- return (
58
- <FlexView padding={['0', 's', '0', 's']}>
59
- <EmailInput
60
- onSubmit={onEmailSubmit}
61
- onFocus={onEmailFocus}
62
- loading={inputLoading || loading}
63
- errorMessage={error}
64
- onChangeText={onChangeText}
65
- submitEnabled={isValidEmail}
66
- />
67
- </FlexView>
68
- );
69
- }
@@ -1,50 +0,0 @@
1
- import { RouterController } from '@reown/appkit-core-react-native';
2
- import { Chip, FlexView, Link, Separator, Spacing, Text } from '@reown/appkit-ui-react-native';
3
- import { Linking, StyleSheet } from 'react-native';
4
-
5
- export interface WalletGuideProps {
6
- guide: 'explore' | 'get-started';
7
- }
8
-
9
- export function WalletGuide({ guide }: WalletGuideProps) {
10
- const onExplorerPress = () => {
11
- Linking.openURL('https://explorer.walletconnect.com');
12
- };
13
-
14
- const onGetStartedPress = () => {
15
- RouterController.push('Create');
16
- };
17
-
18
- return guide === 'explore' ? (
19
- <FlexView alignItems="center" justifyContent="center">
20
- <Separator text="or" style={styles.socialSeparator} />
21
- <Text variant="small-400" style={styles.text}>
22
- Looking for a self-custody wallet?
23
- </Text>
24
- <Chip
25
- label="Visit our explorer"
26
- variant="transparent"
27
- rightIcon="externalLink"
28
- leftIcon="walletConnectLightBrown"
29
- size="sm"
30
- onPress={onExplorerPress}
31
- />
32
- </FlexView>
33
- ) : (
34
- <FlexView alignItems="center" justifyContent="center" margin="m" flexDirection="row">
35
- <Text variant="small-400">Haven't got a wallet?</Text>
36
- <Link onPress={onGetStartedPress} size="sm">
37
- Get started
38
- </Link>
39
- </FlexView>
40
- );
41
- }
42
-
43
- const styles = StyleSheet.create({
44
- text: {
45
- marginBottom: Spacing.xs
46
- },
47
- socialSeparator: {
48
- marginVertical: Spacing.l
49
- }
50
- });
@@ -1,140 +0,0 @@
1
- import { Linking } from 'react-native';
2
- import { useCallback, useEffect, useState } from 'react';
3
- import {
4
- ConnectionController,
5
- ConnectorController,
6
- EventsController,
7
- ModalController,
8
- OptionsController,
9
- SnackController,
10
- type AppKitFrameProvider
11
- } from '@reown/appkit-core-react-native';
12
- import {
13
- FlexView,
14
- LoadingThumbnail,
15
- IconBox,
16
- Logo,
17
- Text,
18
- Link
19
- } from '@reown/appkit-ui-react-native';
20
-
21
- import { useCustomDimensions } from '../../hooks/useCustomDimensions';
22
- import styles from './styles';
23
-
24
- export function ConnectingFarcasterView() {
25
- const { maxWidth: width } = useCustomDimensions();
26
- const authConnector = ConnectorController.getAuthConnector();
27
- const [error, setError] = useState(false);
28
- const [processing, setProcessing] = useState(false);
29
- const [url, setUrl] = useState<string | undefined>();
30
- const showCopy = OptionsController.isClipboardAvailable();
31
- const provider = authConnector?.provider as AppKitFrameProvider;
32
-
33
- const onConnect = useCallback(async () => {
34
- try {
35
- if (provider && authConnector) {
36
- setError(false);
37
- const { url: farcasterUrl } = await provider.getFarcasterUri();
38
- setUrl(farcasterUrl);
39
- Linking.openURL(farcasterUrl);
40
-
41
- await provider.connectFarcaster();
42
- EventsController.sendEvent({
43
- type: 'track',
44
- event: 'SOCIAL_LOGIN_REQUEST_USER_DATA',
45
- properties: { provider: 'farcaster' }
46
- });
47
- setProcessing(true);
48
- await ConnectionController.connectExternal(authConnector);
49
- ConnectionController.setConnectedSocialProvider('farcaster');
50
- EventsController.sendEvent({
51
- type: 'track',
52
- event: 'SOCIAL_LOGIN_SUCCESS',
53
- properties: { provider: 'farcaster' }
54
- });
55
-
56
- setProcessing(false);
57
- ModalController.close();
58
- }
59
- } catch (e) {
60
- EventsController.sendEvent({
61
- type: 'track',
62
- event: 'SOCIAL_LOGIN_ERROR',
63
- properties: { provider: 'farcaster' }
64
- });
65
- // TODO: remove this once Farcaster session refresh is implemented
66
- // @ts-expect-error
67
- provider?.webviewRef?.current?.reload();
68
- SnackController.showError('Something went wrong');
69
- setError(true);
70
- setProcessing(false);
71
- }
72
- }, [provider, authConnector]);
73
-
74
- const onCopyUrl = () => {
75
- if (url) {
76
- OptionsController.copyToClipboard(url);
77
- SnackController.showSuccess('Link copied');
78
- }
79
- };
80
-
81
- useEffect(() => {
82
- return () => {
83
- // TODO: remove this once Farcaster session refresh is implemented
84
- if (!ModalController.state.open) {
85
- // @ts-expect-error
86
- provider.webviewRef?.current?.reload();
87
- }
88
- };
89
- // @ts-expect-error
90
- }, [provider.webviewRef]);
91
-
92
- useEffect(() => {
93
- onConnect();
94
- }, [onConnect]);
95
-
96
- return (
97
- <FlexView
98
- alignItems="center"
99
- alignSelf="center"
100
- padding={['2xl', 'l', '3xl', 'l']}
101
- style={{ width }}
102
- >
103
- <>
104
- <LoadingThumbnail paused={!!error}>
105
- <Logo logo="farcasterSquare" height={72} width={72} />
106
- {error && (
107
- <IconBox
108
- icon={'close'}
109
- border
110
- background
111
- backgroundColor="icon-box-bg-error-100"
112
- size="sm"
113
- iconColor="error-100"
114
- style={styles.errorIcon}
115
- />
116
- )}
117
- </LoadingThumbnail>
118
- <Text style={styles.continueText} variant="paragraph-500">
119
- {processing ? 'Loading user data' : 'Continue in Farcaster'}
120
- </Text>
121
- <Text variant="small-400" color="fg-200">
122
- {processing
123
- ? 'Please wait a moment while we load your data'
124
- : 'Connect in the Farcaster app'}
125
- </Text>
126
- {showCopy && (
127
- <Link
128
- iconLeft="copySmall"
129
- color="fg-200"
130
- style={styles.copyButton}
131
- onPress={onCopyUrl}
132
- testID="copy-link"
133
- >
134
- Copy link
135
- </Link>
136
- )}
137
- </>
138
- </FlexView>
139
- );
140
- }
@@ -1,18 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- import { Spacing } from '@reown/appkit-ui-react-native';
3
-
4
- export default StyleSheet.create({
5
- errorIcon: {
6
- position: 'absolute',
7
- bottom: 8,
8
- right: 8,
9
- zIndex: 2
10
- },
11
- continueText: {
12
- marginTop: Spacing.m,
13
- marginBottom: Spacing.xs
14
- },
15
- copyButton: {
16
- marginTop: Spacing.m
17
- }
18
- });
@@ -1,35 +0,0 @@
1
- import { Platform, ScrollView } from 'react-native';
2
- import { useSnapshot } from 'valtio';
3
- import { FlexView, Spacing } from '@reown/appkit-ui-react-native';
4
- import { ConnectEmailInput } from '../w3m-connect-view/components/connect-email-input';
5
- import { SocialLoginList } from '../w3m-connect-view/components/social-login-list';
6
- import { WalletGuide } from '../w3m-connect-view/components/wallet-guide';
7
- import { useCustomDimensions } from '../../hooks/useCustomDimensions';
8
- import { ConnectorController, OptionsController } from '@reown/appkit-core-react-native';
9
- import { useKeyboard } from '../../hooks/useKeyboard';
10
-
11
- export function CreateView() {
12
- const connectors = ConnectorController.state.connectors;
13
- const { authLoading } = useSnapshot(ConnectorController.state);
14
- const { features } = useSnapshot(OptionsController.state);
15
- const { padding } = useCustomDimensions();
16
- const { keyboardShown, keyboardHeight } = useKeyboard();
17
- const isAuthEnabled = connectors.some(c => c.type === 'AUTH');
18
- const isEmailEnabled = isAuthEnabled && features?.email;
19
- const isSocialEnabled = isAuthEnabled && features?.socials && features?.socials.length > 0;
20
-
21
- const paddingBottom = Platform.select({
22
- android: keyboardShown ? keyboardHeight + Spacing.xl : Spacing.xl,
23
- default: Spacing.xl
24
- });
25
-
26
- return (
27
- <ScrollView style={{ paddingHorizontal: padding }} bounces={false}>
28
- <FlexView padding={['xs', '0', '0', '0']} style={{ paddingBottom }}>
29
- {isEmailEnabled && <ConnectEmailInput loading={authLoading} />}
30
- {isSocialEnabled && <SocialLoginList options={features?.socials} disabled={authLoading} />}
31
- {isAuthEnabled && <WalletGuide guide="explore" />}
32
- </FlexView>
33
- </ScrollView>
34
- );
35
- }