@dynamic-labs/sdk-react-core 2.1.0-alpha.1 → 2.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [2.1.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.1...v2.1.0-alpha.2) (2024-04-19)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * buffer polyfill for utils package ([#5404](https://github.com/dynamic-labs/DynamicAuth/issues/5404)) ([bd40441](https://github.com/dynamic-labs/DynamicAuth/commit/bd404414a2e51d79fad86d7603dae89628c225b9))
8
+
2
9
  ## [2.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.0...v2.1.0-alpha.1) (2024-04-18)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.1.0-alpha.1";
6
+ var version = "2.1.0-alpha.2";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.422",
8
+ "@dynamic-labs/sdk-api-core": "0.0.423",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "country-list": "2.3.0",
11
11
  formik: "2.2.9",
package/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
- var version = "2.1.0-alpha.1";
2
+ var version = "2.1.0-alpha.2";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.422",
4
+ "@dynamic-labs/sdk-api-core": "0.0.423",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
6
6
  "country-list": "2.3.0",
7
7
  formik: "2.2.9",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.1.0-alpha.1",
3
+ "version": "2.1.0-alpha.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
7
7
  "directory": "packages/sdk-react-core"
8
8
  },
9
9
  "dependencies": {
10
- "@dynamic-labs/sdk-api-core": "0.0.422",
10
+ "@dynamic-labs/sdk-api-core": "0.0.423",
11
11
  "@hcaptcha/react-hcaptcha": "1.4.4",
12
12
  "country-list": "2.3.0",
13
13
  "formik": "2.2.9",
@@ -17,18 +17,18 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/ethereum": "2.1.0-alpha.1",
21
- "@dynamic-labs/iconic": "2.1.0-alpha.1",
22
- "@dynamic-labs/logger": "2.1.0-alpha.1",
23
- "@dynamic-labs/multi-wallet": "2.1.0-alpha.1",
24
- "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.1",
25
- "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.1",
26
- "@dynamic-labs/rpc-providers": "2.1.0-alpha.1",
27
- "@dynamic-labs/types": "2.1.0-alpha.1",
28
- "@dynamic-labs/utils": "2.1.0-alpha.1",
29
- "@dynamic-labs/viem-utils": "2.1.0-alpha.1",
30
- "@dynamic-labs/wallet-book": "2.1.0-alpha.1",
31
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.1",
20
+ "@dynamic-labs/ethereum": "2.1.0-alpha.2",
21
+ "@dynamic-labs/iconic": "2.1.0-alpha.2",
22
+ "@dynamic-labs/logger": "2.1.0-alpha.2",
23
+ "@dynamic-labs/multi-wallet": "2.1.0-alpha.2",
24
+ "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.2",
25
+ "@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.2",
26
+ "@dynamic-labs/rpc-providers": "2.1.0-alpha.2",
27
+ "@dynamic-labs/types": "2.1.0-alpha.2",
28
+ "@dynamic-labs/utils": "2.1.0-alpha.2",
29
+ "@dynamic-labs/viem-utils": "2.1.0-alpha.2",
30
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.2",
31
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.2",
32
32
  "eventemitter3": "5.0.1"
33
33
  },
34
34
  "devDependencies": {
@@ -48,7 +48,11 @@ const linkWallet = (environmentId_1, _a, userJwt_1) => _tslib.__awaiter(void 0,
48
48
  throw new utils.WalletUsedError(data.code);
49
49
  }
50
50
  if (data.code === 'merge_accounts_confirmation') {
51
- throw new utils.MergeAccountsConfirmationError(data.code, data.payload.mergeUserConflicts);
51
+ throw new utils.MergeAccountsConfirmationError({
52
+ code: data.code,
53
+ mergeConflicts: data.payload.mergeConflicts,
54
+ walletAddress: publicWalletAddress,
55
+ });
52
56
  }
53
57
  return undefined;
54
58
  }
@@ -44,7 +44,11 @@ const linkWallet = (environmentId_1, _a, userJwt_1) => __awaiter(void 0, [enviro
44
44
  throw new WalletUsedError(data.code);
45
45
  }
46
46
  if (data.code === 'merge_accounts_confirmation') {
47
- throw new MergeAccountsConfirmationError(data.code, data.payload.mergeUserConflicts);
47
+ throw new MergeAccountsConfirmationError({
48
+ code: data.code,
49
+ mergeConflicts: data.payload.mergeConflicts,
50
+ walletAddress: publicWalletAddress,
51
+ });
48
52
  }
49
53
  return undefined;
50
54
  }
@@ -869,7 +869,7 @@ const translation = {
869
869
  },
870
870
  },
871
871
  /**
872
- * @description copy keys for merge user accounts view
872
+ * @description copy keys for merge user accounts view when using email associated to a different account
873
873
  * @default
874
874
  * {
875
875
  cancel_button: "No, I'll use a different email",
@@ -883,7 +883,7 @@ const translation = {
883
883
  },
884
884
  }
885
885
  */
886
- dyn_merge_user_accounts: {
886
+ dyn_merge_user_accounts_with_same_email: {
887
887
  cancel_button: "No, I'll use a different email",
888
888
  confirm_button: 'Yes, link to existing account',
889
889
  errors: {
@@ -865,7 +865,7 @@ export declare const translation: {
865
865
  };
866
866
  };
867
867
  /**
868
- * @description copy keys for merge user accounts view
868
+ * @description copy keys for merge user accounts view when using email associated to a different account
869
869
  * @default
870
870
  * {
871
871
  cancel_button: "No, I'll use a different email",
@@ -879,7 +879,7 @@ export declare const translation: {
879
879
  },
880
880
  }
881
881
  */
882
- dyn_merge_user_accounts: {
882
+ dyn_merge_user_accounts_with_same_email: {
883
883
  cancel_button: string;
884
884
  confirm_button: string;
885
885
  errors: {
@@ -865,7 +865,7 @@ const translation = {
865
865
  },
866
866
  },
867
867
  /**
868
- * @description copy keys for merge user accounts view
868
+ * @description copy keys for merge user accounts view when using email associated to a different account
869
869
  * @default
870
870
  * {
871
871
  cancel_button: "No, I'll use a different email",
@@ -879,7 +879,7 @@ const translation = {
879
879
  },
880
880
  }
881
881
  */
882
- dyn_merge_user_accounts: {
882
+ dyn_merge_user_accounts_with_same_email: {
883
883
  cancel_button: "No, I'll use a different email",
884
884
  confirm_button: 'Yes, link to existing account',
885
885
  errors: {
@@ -77,8 +77,9 @@ require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCa
77
77
  var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
78
78
 
79
79
  const useAuthLayoutChecks = () => {
80
+ var _a;
80
81
  const { view } = ViewContext.useViewContext();
81
- const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
82
+ const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
82
83
  const { isFooterExpanded } = index.useFooterAnimationContext();
83
84
  const { mockedSDK } = MockContext.useMockContext();
84
85
  const { helpHeaderData } = useDynamicLayoutData.useDynamicLayoutData({
@@ -148,22 +149,23 @@ const useAuthLayoutChecks = () => {
148
149
  privacyPolicyUrl ||
149
150
  customPrivacyPolicy ||
150
151
  customTermsOfServices))));
151
- const showDynamicFooter = view.type === 'login-with-email-or-wallet' ||
152
- view.type === 'login-with-email-or-wallet-full-wallet-list' ||
153
- view.type === 'login-with-wallet-only' ||
154
- view.type === 'login-with-email-verification' ||
155
- view.type === 'login-with-sms-verification' ||
156
- view.type === 'verify-email' ||
157
- view.type === 'verify-sms' ||
158
- view.type === 'pending-connect' ||
159
- view.type === 'wallet-group' ||
160
- view.type === 'select-wallet-in-wallet-group' ||
161
- view.type === 'select-hardware-wallet' ||
162
- view.type === 'pending-signature' ||
163
- view.type === 'qr-code' ||
164
- view.type === 'wallet-used' ||
165
- view.type === 'email-wallet-otp-verification-view' ||
166
- view.type === 'farcaster-connect-view';
152
+ const showDynamicFooter = Boolean((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) &&
153
+ (view.type === 'login-with-email-or-wallet' ||
154
+ view.type === 'login-with-email-or-wallet-full-wallet-list' ||
155
+ view.type === 'login-with-wallet-only' ||
156
+ view.type === 'login-with-email-verification' ||
157
+ view.type === 'login-with-sms-verification' ||
158
+ view.type === 'verify-email' ||
159
+ view.type === 'verify-sms' ||
160
+ view.type === 'pending-connect' ||
161
+ view.type === 'wallet-group' ||
162
+ view.type === 'select-wallet-in-wallet-group' ||
163
+ view.type === 'select-hardware-wallet' ||
164
+ view.type === 'pending-signature' ||
165
+ view.type === 'qr-code' ||
166
+ view.type === 'wallet-used' ||
167
+ view.type === 'email-wallet-otp-verification-view' ||
168
+ view.type === 'farcaster-connect-view');
167
169
  const showCloseButton = view.type !== 'login-with-email-or-wallet-full-wallet-list' &&
168
170
  view.type !== 'login-with-email-verification' &&
169
171
  view.type !== 'login-with-sms-verification' &&
@@ -73,8 +73,9 @@ import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCar
73
73
  import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
74
74
 
75
75
  const useAuthLayoutChecks = () => {
76
+ var _a;
76
77
  const { view } = useViewContext();
77
- const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, } = useInternalDynamicContext();
78
+ const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, projectSettings, } = useInternalDynamicContext();
78
79
  const { isFooterExpanded } = useFooterAnimationContext();
79
80
  const { mockedSDK } = useMockContext();
80
81
  const { helpHeaderData } = useDynamicLayoutData({
@@ -144,22 +145,23 @@ const useAuthLayoutChecks = () => {
144
145
  privacyPolicyUrl ||
145
146
  customPrivacyPolicy ||
146
147
  customTermsOfServices))));
147
- const showDynamicFooter = view.type === 'login-with-email-or-wallet' ||
148
- view.type === 'login-with-email-or-wallet-full-wallet-list' ||
149
- view.type === 'login-with-wallet-only' ||
150
- view.type === 'login-with-email-verification' ||
151
- view.type === 'login-with-sms-verification' ||
152
- view.type === 'verify-email' ||
153
- view.type === 'verify-sms' ||
154
- view.type === 'pending-connect' ||
155
- view.type === 'wallet-group' ||
156
- view.type === 'select-wallet-in-wallet-group' ||
157
- view.type === 'select-hardware-wallet' ||
158
- view.type === 'pending-signature' ||
159
- view.type === 'qr-code' ||
160
- view.type === 'wallet-used' ||
161
- view.type === 'email-wallet-otp-verification-view' ||
162
- view.type === 'farcaster-connect-view';
148
+ const showDynamicFooter = Boolean((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) &&
149
+ (view.type === 'login-with-email-or-wallet' ||
150
+ view.type === 'login-with-email-or-wallet-full-wallet-list' ||
151
+ view.type === 'login-with-wallet-only' ||
152
+ view.type === 'login-with-email-verification' ||
153
+ view.type === 'login-with-sms-verification' ||
154
+ view.type === 'verify-email' ||
155
+ view.type === 'verify-sms' ||
156
+ view.type === 'pending-connect' ||
157
+ view.type === 'wallet-group' ||
158
+ view.type === 'select-wallet-in-wallet-group' ||
159
+ view.type === 'select-hardware-wallet' ||
160
+ view.type === 'pending-signature' ||
161
+ view.type === 'qr-code' ||
162
+ view.type === 'wallet-used' ||
163
+ view.type === 'email-wallet-otp-verification-view' ||
164
+ view.type === 'farcaster-connect-view');
163
165
  const showCloseButton = view.type !== 'login-with-email-or-wallet-full-wallet-list' &&
164
166
  view.type !== 'login-with-email-verification' &&
165
167
  view.type !== 'login-with-sms-verification' &&
@@ -111,7 +111,7 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
111
111
  throw new utils.DynamicError('Something went wrong, please try again.');
112
112
  }
113
113
  catch (e) {
114
- setError(t('dyn_merge_user_accounts.errors.merge_error'));
114
+ setError(t('dyn_merge_user_accounts_with_same_email.errors.merge_error'));
115
115
  if (user$1) {
116
116
  setShowAuthFlow(false, { emitCancelAuth: true });
117
117
  return;
@@ -135,9 +135,9 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
135
135
  breakpoint: 4,
136
136
  cutEnd: 1,
137
137
  cutStart: 2,
138
- }) })] })] }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__header', copykey: 'dyn_merge_user_accounts.title', children: t('dyn_merge_user_accounts.title') }), jsxRuntime.jsxs(Typography.Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__body', copykey: 'dyn_merge_user_accounts.existing_account', children: [t('dyn_merge_user_accounts.existing_account'), ' ', jsxRuntime.jsx("span", { className: 'merge-user-accounts-with-same-email__text--bold', children: shortenEmail.shortenEmail(email, {
138
+ }) })] })] }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__header', copykey: 'dyn_merge_user_accounts_with_same_email.title', children: t('dyn_merge_user_accounts_with_same_email.title') }), jsxRuntime.jsxs(Typography.Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__body', copykey: 'dyn_merge_user_accounts_with_same_email.existing_account', children: [t('dyn_merge_user_accounts_with_same_email.existing_account'), ' ', jsxRuntime.jsx("span", { className: 'merge-user-accounts-with-same-email__text--bold', children: shortenEmail.shortenEmail(email, {
139
139
  breakpoint: 14,
140
- }) }), ' ', t('dyn_merge_user_accounts.existing_account_trail')] }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__buttons', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts.confirm_button', children: t('dyn_merge_user_accounts.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts.cancel_button', children: t('dyn_merge_user_accounts.cancel_button') })] })] }));
140
+ }) }), ' ', t('dyn_merge_user_accounts_with_same_email.existing_account_trail')] }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__buttons', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts_with_same_email.confirm_button', children: t('dyn_merge_user_accounts_with_same_email.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts_with_same_email.cancel_button', children: t('dyn_merge_user_accounts_with_same_email.cancel_button') })] })] }));
141
141
  };
142
142
 
143
143
  exports.MergeUserAccountsWithSameEmailView = MergeUserAccountsWithSameEmailView;
@@ -107,7 +107,7 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
107
107
  throw new DynamicError('Something went wrong, please try again.');
108
108
  }
109
109
  catch (e) {
110
- setError(t('dyn_merge_user_accounts.errors.merge_error'));
110
+ setError(t('dyn_merge_user_accounts_with_same_email.errors.merge_error'));
111
111
  if (user) {
112
112
  setShowAuthFlow(false, { emitCancelAuth: true });
113
113
  return;
@@ -131,9 +131,9 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
131
131
  breakpoint: 4,
132
132
  cutEnd: 1,
133
133
  cutStart: 2,
134
- }) })] })] }), jsx(Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__header', copykey: 'dyn_merge_user_accounts.title', children: t('dyn_merge_user_accounts.title') }), jsxs(Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__body', copykey: 'dyn_merge_user_accounts.existing_account', children: [t('dyn_merge_user_accounts.existing_account'), ' ', jsx("span", { className: 'merge-user-accounts-with-same-email__text--bold', children: shortenEmail(email, {
134
+ }) })] })] }), jsx(Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__header', copykey: 'dyn_merge_user_accounts_with_same_email.title', children: t('dyn_merge_user_accounts_with_same_email.title') }), jsxs(Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts-with-same-email__text merge-user-accounts-with-same-email__text__body', copykey: 'dyn_merge_user_accounts_with_same_email.existing_account', children: [t('dyn_merge_user_accounts_with_same_email.existing_account'), ' ', jsx("span", { className: 'merge-user-accounts-with-same-email__text--bold', children: shortenEmail(email, {
135
135
  breakpoint: 14,
136
- }) }), ' ', t('dyn_merge_user_accounts.existing_account_trail')] }), jsxs("div", { className: 'merge-user-accounts-with-same-email__buttons', children: [jsx(TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts.confirm_button', children: t('dyn_merge_user_accounts.confirm_button') }), jsx(TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts.cancel_button', children: t('dyn_merge_user_accounts.cancel_button') })] })] }));
136
+ }) }), ' ', t('dyn_merge_user_accounts_with_same_email.existing_account_trail')] }), jsxs("div", { className: 'merge-user-accounts-with-same-email__buttons', children: [jsx(TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts_with_same_email.confirm_button', children: t('dyn_merge_user_accounts_with_same_email.confirm_button') }), jsx(TypographyButton, { className: 'merge-user-accounts-with-same-email__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', copykey: 'dyn_merge_user_accounts_with_same_email.cancel_button', children: t('dyn_merge_user_accounts_with_same_email.cancel_button') })] })] }));
137
137
  };
138
138
 
139
139
  export { MergeUserAccountsWithSameEmailView };