@reown/appkit-react-native 0.0.0-feat-multi-siwe-20250623145640 → 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 (107) hide show
  1. package/lib/commonjs/connectors/WalletConnectConnector.js +5 -2
  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 +2 -15
  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/commonjs/views/w3m-connecting-view/index.js +6 -7
  24. package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
  25. package/lib/module/connectors/WalletConnectConnector.js +5 -2
  26. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  27. package/lib/module/index.js +11 -6
  28. package/lib/module/index.js.map +1 -1
  29. package/lib/module/modal/w3m-modal/index.js +3 -16
  30. package/lib/module/modal/w3m-modal/index.js.map +1 -1
  31. package/lib/module/modal/w3m-router/index.js +1 -7
  32. package/lib/module/modal/w3m-router/index.js.map +1 -1
  33. package/lib/module/partials/w3m-header/index.js +4 -13
  34. package/lib/module/partials/w3m-header/index.js.map +1 -1
  35. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +1 -1
  36. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  37. package/lib/module/views/w3m-connect-socials-view/index.js +4 -11
  38. package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
  39. package/lib/module/views/w3m-connect-view/components/social-login-list.js +4 -8
  40. package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  41. package/lib/module/views/w3m-connect-view/index.js +11 -34
  42. package/lib/module/views/w3m-connect-view/index.js.map +1 -1
  43. package/lib/module/views/w3m-connecting-siwe-view/index.js +2 -0
  44. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  45. package/lib/module/views/w3m-connecting-social-view/index.js +41 -63
  46. package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
  47. package/lib/module/views/w3m-connecting-view/index.js +7 -8
  48. package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
  49. package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
  50. package/lib/typescript/index.d.ts +7 -6
  51. package/lib/typescript/index.d.ts.map +1 -1
  52. package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
  53. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  54. package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
  55. package/lib/typescript/views/w3m-connect-socials-view/index.d.ts.map +1 -1
  56. package/lib/typescript/views/w3m-connect-view/components/social-login-list.d.ts.map +1 -1
  57. package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
  58. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  59. package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
  60. package/package.json +5 -5
  61. package/src/connectors/WalletConnectConnector.ts +5 -2
  62. package/src/index.ts +10 -10
  63. package/src/modal/w3m-modal/index.tsx +1 -12
  64. package/src/modal/w3m-router/index.tsx +1 -7
  65. package/src/partials/w3m-header/index.tsx +5 -22
  66. package/src/views/w3m-account-default-view/components/auth-buttons.tsx +1 -1
  67. package/src/views/w3m-connect-socials-view/index.tsx +3 -14
  68. package/src/views/w3m-connect-view/components/social-login-list.tsx +2 -14
  69. package/src/views/w3m-connect-view/index.tsx +9 -25
  70. package/src/views/w3m-connecting-siwe-view/index.tsx +1 -0
  71. package/src/views/w3m-connecting-social-view/index.tsx +44 -96
  72. package/src/views/w3m-connecting-view/index.tsx +8 -8
  73. package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js +0 -73
  74. package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
  75. package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js +0 -55
  76. package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
  77. package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js +0 -124
  78. package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js.map +0 -1
  79. package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js +0 -24
  80. package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
  81. package/lib/commonjs/views/w3m-create-view/index.js +0 -57
  82. package/lib/commonjs/views/w3m-create-view/index.js.map +0 -1
  83. package/lib/module/views/w3m-connect-view/components/connect-email-input.js +0 -67
  84. package/lib/module/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
  85. package/lib/module/views/w3m-connect-view/components/wallet-guide.js +0 -49
  86. package/lib/module/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
  87. package/lib/module/views/w3m-connecting-farcaster-view/index.js +0 -117
  88. package/lib/module/views/w3m-connecting-farcaster-view/index.js.map +0 -1
  89. package/lib/module/views/w3m-connecting-farcaster-view/styles.js +0 -18
  90. package/lib/module/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
  91. package/lib/module/views/w3m-create-view/index.js +0 -51
  92. package/lib/module/views/w3m-create-view/index.js.map +0 -1
  93. package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts +0 -6
  94. package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts.map +0 -1
  95. package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts +0 -5
  96. package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts.map +0 -1
  97. package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts +0 -2
  98. package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts.map +0 -1
  99. package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts +0 -17
  100. package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts.map +0 -1
  101. package/lib/typescript/views/w3m-create-view/index.d.ts +0 -2
  102. package/lib/typescript/views/w3m-create-view/index.d.ts.map +0 -1
  103. package/src/views/w3m-connect-view/components/connect-email-input.tsx +0 -69
  104. package/src/views/w3m-connect-view/components/wallet-guide.tsx +0 -50
  105. package/src/views/w3m-connecting-farcaster-view/index.tsx +0 -140
  106. package/src/views/w3m-connecting-farcaster-view/styles.ts +0 -18
  107. package/src/views/w3m-create-view/index.tsx +0 -35
@@ -1,67 +0,0 @@
1
- import { useSnapshot } from 'valtio';
2
- import { useState } from 'react';
3
- import { EmailInput, FlexView } from '@reown/appkit-ui-react-native';
4
- import { ConnectorController, CoreHelperUtil, EventsController, RouterController, SnackController } from '@reown/appkit-core-react-native';
5
- export function ConnectEmailInput({
6
- loading
7
- }) {
8
- const {
9
- connectors
10
- } = useSnapshot(ConnectorController.state);
11
- const [inputLoading, setInputLoading] = useState(false);
12
- const [error, setError] = useState('');
13
- const [isValidEmail, setIsValidEmail] = useState(false);
14
- const authProvider = connectors.find(c => c.type === 'AUTH')?.provider;
15
- const onChangeText = value => {
16
- setIsValidEmail(CoreHelperUtil.isValidEmail(value));
17
- setError('');
18
- };
19
- const onEmailFocus = () => {
20
- EventsController.sendEvent({
21
- type: 'track',
22
- event: 'EMAIL_LOGIN_SELECTED'
23
- });
24
- };
25
- const onEmailSubmit = async email => {
26
- try {
27
- if (email.length === 0) return;
28
- setInputLoading(true);
29
- const response = await authProvider.connectEmail({
30
- email
31
- });
32
- EventsController.sendEvent({
33
- type: 'track',
34
- event: 'EMAIL_SUBMITTED'
35
- });
36
- if (response.action === 'VERIFY_DEVICE') {
37
- RouterController.push('EmailVerifyDevice', {
38
- email
39
- });
40
- } else if (response.action === 'VERIFY_OTP') {
41
- RouterController.push('EmailVerifyOtp', {
42
- email
43
- });
44
- }
45
- } catch (e) {
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
- return /*#__PURE__*/React.createElement(FlexView, {
57
- padding: ['0', 's', '0', 's']
58
- }, /*#__PURE__*/React.createElement(EmailInput, {
59
- onSubmit: onEmailSubmit,
60
- onFocus: onEmailFocus,
61
- loading: inputLoading || loading,
62
- errorMessage: error,
63
- onChangeText: onChangeText,
64
- submitEnabled: isValidEmail
65
- }));
66
- }
67
- //# sourceMappingURL=connect-email-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useSnapshot","useState","EmailInput","FlexView","ConnectorController","CoreHelperUtil","EventsController","RouterController","SnackController","ConnectEmailInput","loading","connectors","state","inputLoading","setInputLoading","error","setError","isValidEmail","setIsValidEmail","authProvider","find","c","type","provider","onChangeText","value","onEmailFocus","sendEvent","event","onEmailSubmit","email","length","response","connectEmail","action","push","e","parsedError","parseError","includes","showError","React","createElement","padding","onSubmit","onFocus","errorMessage","submitEnabled"],"sourceRoot":"../../../../../src","sources":["views/w3m-connect-view/components/connect-email-input.tsx"],"mappings":"AAAA,SAASA,WAAW,QAAQ,QAAQ;AACpC,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,UAAU,EAAEC,QAAQ,QAAQ,+BAA+B;AACpE,SACEC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,QAEV,iCAAiC;AAMxC,OAAO,SAASC,iBAAiBA,CAAC;EAAEC;AAAe,CAAC,EAAE;EACpD,MAAM;IAAEC;EAAW,CAAC,GAAGX,WAAW,CAACI,mBAAmB,CAACQ,KAAK,CAAC;EAC7D,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGb,QAAQ,CAAC,KAAK,CAAC;EACvD,MAAM,CAACc,KAAK,EAAEC,QAAQ,CAAC,GAAGf,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAM,CAACgB,YAAY,EAAEC,eAAe,CAAC,GAAGjB,QAAQ,CAAC,KAAK,CAAC;EACvD,MAAMkB,YAAY,GAAGR,UAAU,CAACS,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,KAAK,MAAM,CAAC,EAAEC,QAA+B;EAE7F,MAAMC,YAAY,GAAIC,KAAa,IAAK;IACtCP,eAAe,CAACb,cAAc,CAACY,YAAY,CAACQ,KAAK,CAAC,CAAC;IACnDT,QAAQ,CAAC,EAAE,CAAC;EACd,CAAC;EAED,MAAMU,YAAY,GAAGA,CAAA,KAAM;IACzBpB,gBAAgB,CAACqB,SAAS,CAAC;MAAEL,IAAI,EAAE,OAAO;MAAEM,KAAK,EAAE;IAAuB,CAAC,CAAC;EAC9E,CAAC;EAED,MAAMC,aAAa,GAAG,MAAOC,KAAa,IAAK;IAC7C,IAAI;MACF,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;MAExBjB,eAAe,CAAC,IAAI,CAAC;MACrB,MAAMkB,QAAQ,GAAG,MAAMb,YAAY,CAACc,YAAY,CAAC;QAAEH;MAAM,CAAC,CAAC;MAC3DxB,gBAAgB,CAACqB,SAAS,CAAC;QAAEL,IAAI,EAAE,OAAO;QAAEM,KAAK,EAAE;MAAkB,CAAC,CAAC;MACvE,IAAII,QAAQ,CAACE,MAAM,KAAK,eAAe,EAAE;QACvC3B,gBAAgB,CAAC4B,IAAI,CAAC,mBAAmB,EAAE;UAAEL;QAAM,CAAC,CAAC;MACvD,CAAC,MAAM,IAAIE,QAAQ,CAACE,MAAM,KAAK,YAAY,EAAE;QAC3C3B,gBAAgB,CAAC4B,IAAI,CAAC,gBAAgB,EAAE;UAAEL;QAAM,CAAC,CAAC;MACpD;IACF,CAAC,CAAC,OAAOM,CAAM,EAAE;MACf,MAAMC,WAAW,GAAGhC,cAAc,CAACiC,UAAU,CAACF,CAAC,CAAC;MAChD,IAAIC,WAAW,EAAEE,QAAQ,CAAC,aAAa,CAAC,EAAE;QACxCvB,QAAQ,CAAC,2BAA2B,CAAC;MACvC,CAAC,MAAM;QACLR,eAAe,CAACgC,SAAS,CAACH,WAAW,CAAC;MACxC;IACF,CAAC,SAAS;MACRvB,eAAe,CAAC,KAAK,CAAC;IACxB;EACF,CAAC;EAED,oBACE2B,KAAA,CAAAC,aAAA,CAACvC,QAAQ;IAACwC,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;EAAE,gBACtCF,KAAA,CAAAC,aAAA,CAACxC,UAAU;IACT0C,QAAQ,EAAEf,aAAc;IACxBgB,OAAO,EAAEnB,YAAa;IACtBhB,OAAO,EAAEG,YAAY,IAAIH,OAAQ;IACjCoC,YAAY,EAAE/B,KAAM;IACpBS,YAAY,EAAEA,YAAa;IAC3BuB,aAAa,EAAE9B;EAAa,CAC7B,CACO,CAAC;AAEf"}
@@ -1,49 +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
- export function WalletGuide({
5
- guide
6
- }) {
7
- const onExplorerPress = () => {
8
- Linking.openURL('https://explorer.walletconnect.com');
9
- };
10
- const onGetStartedPress = () => {
11
- RouterController.push('Create');
12
- };
13
- return guide === 'explore' ? /*#__PURE__*/React.createElement(FlexView, {
14
- alignItems: "center",
15
- justifyContent: "center"
16
- }, /*#__PURE__*/React.createElement(Separator, {
17
- text: "or",
18
- style: styles.socialSeparator
19
- }), /*#__PURE__*/React.createElement(Text, {
20
- variant: "small-400",
21
- style: styles.text
22
- }, "Looking for a self-custody wallet?"), /*#__PURE__*/React.createElement(Chip, {
23
- label: "Visit our explorer",
24
- variant: "transparent",
25
- rightIcon: "externalLink",
26
- leftIcon: "walletConnectLightBrown",
27
- size: "sm",
28
- onPress: onExplorerPress
29
- })) : /*#__PURE__*/React.createElement(FlexView, {
30
- alignItems: "center",
31
- justifyContent: "center",
32
- margin: "m",
33
- flexDirection: "row"
34
- }, /*#__PURE__*/React.createElement(Text, {
35
- variant: "small-400"
36
- }, "Haven't got a wallet?"), /*#__PURE__*/React.createElement(Link, {
37
- onPress: onGetStartedPress,
38
- size: "sm"
39
- }, "Get started"));
40
- }
41
- const styles = StyleSheet.create({
42
- text: {
43
- marginBottom: Spacing.xs
44
- },
45
- socialSeparator: {
46
- marginVertical: Spacing.l
47
- }
48
- });
49
- //# sourceMappingURL=wallet-guide.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["RouterController","Chip","FlexView","Link","Separator","Spacing","Text","Linking","StyleSheet","WalletGuide","guide","onExplorerPress","openURL","onGetStartedPress","push","React","createElement","alignItems","justifyContent","text","style","styles","socialSeparator","variant","label","rightIcon","leftIcon","size","onPress","margin","flexDirection","create","marginBottom","xs","marginVertical","l"],"sourceRoot":"../../../../../src","sources":["views/w3m-connect-view/components/wallet-guide.tsx"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,IAAI,EAAEC,QAAQ,E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iBAAkB;IAACc,IAAI,EAAC;EAAI,GAAC,aAEtC,CACE,CACX;AACH;AAEA,MAAMN,MAAM,GAAGb,UAAU,CAACuB,MAAM,CAAC;EAC/BZ,IAAI,EAAE;IACJa,YAAY,EAAE3B,OAAO,CAAC4B;EACxB,CAAC;EACDX,eAAe,EAAE;IACfY,cAAc,EAAE7B,OAAO,CAAC8B;EAC1B;AACF,CAAC,CAAC"}
@@ -1,117 +0,0 @@
1
- import { Linking } from 'react-native';
2
- import { useCallback, useEffect, useState } from 'react';
3
- import { ConnectionController, ConnectorController, EventsController, ModalController, OptionsController, SnackController } from '@reown/appkit-core-react-native';
4
- import { FlexView, LoadingThumbnail, IconBox, Logo, Text, Link } from '@reown/appkit-ui-react-native';
5
- import { useCustomDimensions } from '../../hooks/useCustomDimensions';
6
- import styles from './styles';
7
- export function ConnectingFarcasterView() {
8
- const {
9
- maxWidth: width
10
- } = useCustomDimensions();
11
- const authConnector = ConnectorController.getAuthConnector();
12
- const [error, setError] = useState(false);
13
- const [processing, setProcessing] = useState(false);
14
- const [url, setUrl] = useState();
15
- const showCopy = OptionsController.isClipboardAvailable();
16
- const provider = authConnector?.provider;
17
- const onConnect = useCallback(async () => {
18
- try {
19
- if (provider && authConnector) {
20
- setError(false);
21
- const {
22
- url: farcasterUrl
23
- } = await provider.getFarcasterUri();
24
- setUrl(farcasterUrl);
25
- Linking.openURL(farcasterUrl);
26
- await provider.connectFarcaster();
27
- EventsController.sendEvent({
28
- type: 'track',
29
- event: 'SOCIAL_LOGIN_REQUEST_USER_DATA',
30
- properties: {
31
- provider: 'farcaster'
32
- }
33
- });
34
- setProcessing(true);
35
- await ConnectionController.connectExternal(authConnector);
36
- ConnectionController.setConnectedSocialProvider('farcaster');
37
- EventsController.sendEvent({
38
- type: 'track',
39
- event: 'SOCIAL_LOGIN_SUCCESS',
40
- properties: {
41
- provider: 'farcaster'
42
- }
43
- });
44
- setProcessing(false);
45
- ModalController.close();
46
- }
47
- } catch (e) {
48
- EventsController.sendEvent({
49
- type: 'track',
50
- event: 'SOCIAL_LOGIN_ERROR',
51
- properties: {
52
- provider: 'farcaster'
53
- }
54
- });
55
- // TODO: remove this once Farcaster session refresh is implemented
56
- // @ts-expect-error
57
- provider?.webviewRef?.current?.reload();
58
- SnackController.showError('Something went wrong');
59
- setError(true);
60
- setProcessing(false);
61
- }
62
- }, [provider, authConnector]);
63
- const onCopyUrl = () => {
64
- if (url) {
65
- OptionsController.copyToClipboard(url);
66
- SnackController.showSuccess('Link copied');
67
- }
68
- };
69
- useEffect(() => {
70
- return () => {
71
- // TODO: remove this once Farcaster session refresh is implemented
72
- if (!ModalController.state.open) {
73
- // @ts-expect-error
74
- provider.webviewRef?.current?.reload();
75
- }
76
- };
77
- // @ts-expect-error
78
- }, [provider.webviewRef]);
79
- useEffect(() => {
80
- onConnect();
81
- }, [onConnect]);
82
- return /*#__PURE__*/React.createElement(FlexView, {
83
- alignItems: "center",
84
- alignSelf: "center",
85
- padding: ['2xl', 'l', '3xl', 'l'],
86
- style: {
87
- width
88
- }
89
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoadingThumbnail, {
90
- paused: !!error
91
- }, /*#__PURE__*/React.createElement(Logo, {
92
- logo: "farcasterSquare",
93
- height: 72,
94
- width: 72
95
- }), error && /*#__PURE__*/React.createElement(IconBox, {
96
- icon: 'close',
97
- border: true,
98
- background: true,
99
- backgroundColor: "icon-box-bg-error-100",
100
- size: "sm",
101
- iconColor: "error-100",
102
- style: styles.errorIcon
103
- })), /*#__PURE__*/React.createElement(Text, {
104
- style: styles.continueText,
105
- variant: "paragraph-500"
106
- }, processing ? 'Loading user data' : 'Continue in Farcaster'), /*#__PURE__*/React.createElement(Text, {
107
- variant: "small-400",
108
- color: "fg-200"
109
- }, processing ? 'Please wait a moment while we load your data' : 'Connect in the Farcaster app'), showCopy && /*#__PURE__*/React.createElement(Link, {
110
- iconLeft: "copySmall",
111
- color: "fg-200",
112
- style: styles.copyButton,
113
- onPress: onCopyUrl,
114
- testID: "copy-link"
115
- }, "Copy link")));
116
- }
117
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Linking","useCallback","useEffect","useState","ConnectionController","ConnectorController","EventsController","ModalController","OptionsController","SnackController","FlexView","LoadingThumbnail","IconBox","Logo","Text","Link","useCustomDimensions","styles","ConnectingFarcasterView","maxWidth","width","authConnector","getAuthConnector","error","setError","processing","setProcessing","url","setUrl","showCopy","isClipboardAvailable","provider","onConnect","farcasterUrl","getFarcasterUri","openURL","connectFarcaster","sendEvent","type","event","properties","connectExternal","setConnectedSocialProvider","close","e","webviewRef","current","reload","showError","onCopyUrl","copyToClipboard","showSuccess","state","open","React","createElement","alignItems","alignSelf","padding","style","Fragment","paused","logo","height","icon","border","background","backgroundColor","size","iconColor","errorIcon","continueText","variant","color","iconLeft","copyButton","onPress","testID"],"sourceRoot":"../../../../src","sources":["views/w3m-connecting-farcaster-view/index.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,eAAe,QAEV,iCAAiC;AACxC,SACEC,QAAQ,EACRC,gBAAgB,EAChBC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,IAAI,QACC,+BAA+B;AAEtC,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,OAAOC,MAAM,MAAM,UAAU;AAE7B,OAAO,SAASC,uBAAuBA,CAAA,EAAG;EACxC,MAAM;IAAEC,QAAQ,EAAEC;EAAM,CAAC,GAAGJ,mBAAmB,CAAC,CAAC;EACjD,MAAMK,aAAa,GAAGhB,mBAAmB,CAACiB,gBAAgB,CAAC,CAAC;EAC5D,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC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AAAC,aAAA,CAAC1C,IAAI;IAACiD,IAAI,EAAC,iBAAiB;IAACC,MAAM,EAAE,EAAG;IAAC3C,KAAK,EAAE;EAAG,CAAE,CAAC,EACrDG,KAAK,iBACJ+B,KAAA,CAAAC,aAAA,CAAC3C,OAAO;IACNoD,IAAI,EAAE,OAAQ;IACdC,MAAM;IACNC,UAAU;IACVC,eAAe,EAAC,uBAAuB;IACvCC,IAAI,EAAC,IAAI;IACTC,SAAS,EAAC,WAAW;IACrBV,KAAK,EAAE1C,MAAM,CAACqD;EAAU,CACzB,CAEa,CAAC,eACnBhB,KAAA,CAAAC,aAAA,CAACzC,IAAI;IAAC6C,KAAK,EAAE1C,MAAM,CAACsD,YAAa;IAACC,OAAO,EAAC;EAAe,GACtD/C,UAAU,GAAG,mBAAmB,GAAG,uBAChC,CAAC,eACP6B,KAAA,CAAAC,aAAA,CAACzC,IAAI;IAAC0D,OAAO,EAAC,WAAW;IAACC,KAAK,EAAC;EAAQ,GACrChD,UAAU,GACP,8CAA8C,GAC9C,8BACA,CAAC,EACNI,QAAQ,iBACPyB,KAAA,CAAAC,aAAA,CAACxC,IAAI;IACH2D,QAAQ,EAAC,WAAW;IACpBD,KAAK,EAAC,QAAQ;IACdd,KAAK,EAAE1C,MAAM,CAAC0D,UAAW;IACzBC,OAAO,EAAE3B,SAAU;IACnB4B,MAAM,EAAC;EAAW,GACnB,WAEK,CAER,CACM,CAAC;AAEf"}
@@ -1,18 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- import { Spacing } from '@reown/appkit-ui-react-native';
3
- export default StyleSheet.create({
4
- errorIcon: {
5
- position: 'absolute',
6
- bottom: 8,
7
- right: 8,
8
- zIndex: 2
9
- },
10
- continueText: {
11
- marginTop: Spacing.m,
12
- marginBottom: Spacing.xs
13
- },
14
- copyButton: {
15
- marginTop: Spacing.m
16
- }
17
- });
18
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleSheet","Spacing","create","errorIcon","position","bottom","right","zIndex","continueText","marginTop","m","marginBottom","xs","copyButton"],"sourceRoot":"../../../../src","sources":["views/w3m-connecting-farcaster-view/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,QAAQ,+BAA+B;AAEvD,eAAeD,UAAU,CAACE,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDC,YAAY,EAAE;IACZC,SAAS,EAAER,OAAO,CAACS,CAAC;IACpBC,YAAY,EAAEV,OAAO,CAACW;EACxB,CAAC;EACDC,UAAU,EAAE;IACVJ,SAAS,EAAER,OAAO,CAACS;EACrB;AACF,CAAC,CAAC"}
@@ -1,51 +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
- export function CreateView() {
11
- const connectors = ConnectorController.state.connectors;
12
- const {
13
- authLoading
14
- } = useSnapshot(ConnectorController.state);
15
- const {
16
- features
17
- } = useSnapshot(OptionsController.state);
18
- const {
19
- padding
20
- } = useCustomDimensions();
21
- const {
22
- keyboardShown,
23
- keyboardHeight
24
- } = useKeyboard();
25
- const isAuthEnabled = connectors.some(c => c.type === 'AUTH');
26
- const isEmailEnabled = isAuthEnabled && features?.email;
27
- const isSocialEnabled = isAuthEnabled && features?.socials && features?.socials.length > 0;
28
- const paddingBottom = Platform.select({
29
- android: keyboardShown ? keyboardHeight + Spacing.xl : Spacing.xl,
30
- default: Spacing.xl
31
- });
32
- return /*#__PURE__*/React.createElement(ScrollView, {
33
- style: {
34
- paddingHorizontal: padding
35
- },
36
- bounces: false
37
- }, /*#__PURE__*/React.createElement(FlexView, {
38
- padding: ['xs', '0', '0', '0'],
39
- style: {
40
- paddingBottom
41
- }
42
- }, isEmailEnabled && /*#__PURE__*/React.createElement(ConnectEmailInput, {
43
- loading: authLoading
44
- }), isSocialEnabled && /*#__PURE__*/React.createElement(SocialLoginList, {
45
- options: features?.socials,
46
- disabled: authLoading
47
- }), isAuthEnabled && /*#__PURE__*/React.createElement(WalletGuide, {
48
- guide: "explore"
49
- })));
50
- }
51
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Platform","ScrollView","useSnapshot","FlexView","Spacing","ConnectEmailInput","SocialLoginList","WalletGuide","useCustomDimensions","ConnectorController","OptionsController","useKeyboard","CreateView","connectors","state","authLoading","features","padding","keyboardShown","keyboardHeight","isAuthEnabled","some","c","type","isEmailEnabled","email","isSocialEnabled","socials","length","paddingBottom","select","android","xl","default","React","createElement","style","paddingHorizontal","bounces","loading","options","disabled","guide"],"sourceRoot":"../../../../src","sources":["views/w3m-create-view/index.tsx"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,QAAQ,EAAEC,OAAO,QAAQ,+BAA+B;AACjE,SAASC,iBAAiB,QAAQ,oDAAoD;AACtF,SAASC,eAAe,QAAQ,kDAAkD;AAClF,SAASC,WAAW,QAAQ,6CAA6C;AACzE,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,iCAAiC;AACxF,SAASC,WAAW,QAAQ,yBAAyB;AAErD,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC3B,MAAMC,UAAU,GAAGJ,mBAAmB,CAACK,KAAK,CAACD,UAAU;EACv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AEW,OAAQ;IAACc,QAAQ,EAAE1B;EAAY,CAAE,CAAC,EACzFK,aAAa,iBAAIc,KAAA,CAAAC,aAAA,CAAC5B,WAAW;IAACmC,KAAK,EAAC;EAAS,CAAE,CACxC,CACA,CAAC;AAEjB"}
@@ -1,6 +0,0 @@
1
- interface Props {
2
- loading?: boolean;
3
- }
4
- export declare function ConnectEmailInput({ loading }: Props): import("react/jsx-runtime").JSX.Element;
5
- export {};
6
- //# sourceMappingURL=connect-email-input.d.ts.map
@@ -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
- });