@dynamic-labs/sdk-react-core 0.17.0-RC.23 → 0.17.0-RC.25

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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +7 -7
  5. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -1
  6. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -1
  7. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
  8. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
  9. package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +2 -2
  10. package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.d.ts +2 -0
  11. package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +2 -2
  12. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
  13. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
  14. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +7 -0
  15. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +7 -0
  16. package/src/lib/shared/assets/add.cjs +8 -9
  17. package/src/lib/shared/assets/add.js +8 -9
  18. package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.cjs +27 -0
  19. package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.d.ts +6 -0
  20. package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.js +23 -0
  21. package/src/lib/styles/index.shadow.cjs +1 -1
  22. package/src/lib/styles/index.shadow.js +1 -1
  23. package/src/lib/utils/functions/hasWalletGroupFlag/hasWalletGroupFlag.d.ts +1 -0
  24. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +2 -1
  25. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +2 -1
  26. package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -1
  27. package/src/lib/views/EmailVerification/EmailVerification.js +2 -1
  28. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +3 -2
  29. package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +3 -2
  30. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +2 -2
  31. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +2 -2
  32. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +12 -1
  33. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +12 -1
  34. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +6 -1
  35. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +7 -2
package/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
 
2
+ ## [0.17.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.24...v0.17.0-RC.25) (2023-06-05)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **EmailOTPMagicWalletConnector:** allow user to reconnect with email wallet ([#2230](https://github.com/dynamic-labs/DynamicAuth/issues/2230)) ([6059886](https://github.com/dynamic-labs/DynamicAuth/commit/605988650a783ae824bb8c45edc5533fecf8726a))
8
+ * only set wagmi connector if connected chain is evm ([#2237](https://github.com/dynamic-labs/DynamicAuth/issues/2237)) ([a7be7d3](https://github.com/dynamic-labs/DynamicAuth/commit/a7be7d302d1e74088b0aa2b6848c879079e6f963))
9
+ * Revert "fix(ViewContext): only set view when on wallet list" ([#2235](https://github.com/dynamic-labs/DynamicAuth/issues/2235)) ([e790315](https://github.com/dynamic-labs/DynamicAuth/commit/e79031577f640161cc5f0b9b2e695e22d9a98901)), closes [#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)
10
+ * set view to social-redirect-view while waiting to process magic redirect ([#2229](https://github.com/dynamic-labs/DynamicAuth/issues/2229)) ([f50a29c](https://github.com/dynamic-labs/DynamicAuth/commit/f50a29c0b9623c703f1577c7a41fcc5aee58abb8))
11
+ * user profile does not extend on mobile ([#2236](https://github.com/dynamic-labs/DynamicAuth/issues/2236)) ([5bb7912](https://github.com/dynamic-labs/DynamicAuth/commit/5bb7912a865338fdf6eca1a19ff4b74a3fb18eeb))
12
+ * **ViewContext:** only set view when on wallet list ([#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)) ([85e8fc1](https://github.com/dynamic-labs/DynamicAuth/commit/85e8fc140069cabff41f4067ac93ea0c5cfaa161))
13
+
14
+ ## [0.17.0-RC.24](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.23...v0.17.0-RC.24) (2023-06-02)
15
+
2
16
  ## [0.17.0-RC.23](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.22...v0.17.0-RC.23) (2023-06-02)
3
17
 
4
18
 
package/package.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.17.0-RC.23";
5
+ var version = "0.17.0-RC.25";
6
6
  var dependencies = {
7
7
  "react-focus-lock": "2.9.2",
8
8
  "@dynamic-labs/iconic": "0.1.19",
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.17.0-RC.23";
1
+ var version = "0.17.0-RC.25";
2
2
  var dependencies = {
3
3
  "react-focus-lock": "2.9.2",
4
4
  "@dynamic-labs/iconic": "0.1.19",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.17.0-RC.23",
3
+ "version": "0.17.0-RC.25",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -17,12 +17,12 @@
17
17
  "formik": "2.2.9",
18
18
  "qrcode": "1.5.1",
19
19
  "ethers": "5.7.2",
20
- "@dynamic-labs/logger": "0.17.0-RC.23",
21
- "@dynamic-labs/multi-wallet": "0.17.0-RC.23",
22
- "@dynamic-labs/rpc-providers": "0.17.0-RC.23",
23
- "@dynamic-labs/types": "0.17.0-RC.23",
24
- "@dynamic-labs/utils": "0.17.0-RC.23",
25
- "@dynamic-labs/wallet-connector-core": "0.17.0-RC.23"
20
+ "@dynamic-labs/logger": "0.17.0-RC.25",
21
+ "@dynamic-labs/multi-wallet": "0.17.0-RC.25",
22
+ "@dynamic-labs/rpc-providers": "0.17.0-RC.25",
23
+ "@dynamic-labs/types": "0.17.0-RC.25",
24
+ "@dynamic-labs/utils": "0.17.0-RC.25",
25
+ "@dynamic-labs/wallet-connector-core": "0.17.0-RC.25"
26
26
  },
27
27
  "devDependencies": {
28
28
  "semver": "7.3.8"
@@ -43,6 +43,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
43
43
  var TosAndPp = require('../TosAndPp/TosAndPp.cjs');
44
44
  var PinField = require('../PinField/PinField.cjs');
45
45
  var ModalHeaderBanner = require('../ModalHeaderBanner/ModalHeaderBanner.cjs');
46
+ var shortenEmail = require('../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
46
47
  require('../Popper/Popper/Popper.cjs');
47
48
  require('../Popper/PopperContext/PopperContext.cjs');
48
49
  require('@dynamic-labs/wallet-book');
@@ -50,7 +51,7 @@ require('../SendBalanceForm/SendBalanceForm.cjs');
50
51
 
51
52
  const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, termsOfServiceUrl, privacyPolicyUrl, onPinChange, displayPoweredByDynamic = false, }) => {
52
53
  const backButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
53
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: email })), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) })))] }))] }))] })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsxRuntime.jsx(TosAndPp.TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })));
54
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail.shortenEmail(email) })), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) })))] }))] }))] })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsxRuntime.jsx(TosAndPp.TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })));
54
55
  };
55
56
 
56
57
  exports.OTPVerificationView = OTPVerificationView;
@@ -39,6 +39,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
39
39
  import { TosAndPp } from '../TosAndPp/TosAndPp.js';
40
40
  import { PinField } from '../PinField/PinField.js';
41
41
  import { ModalHeaderBanner } from '../ModalHeaderBanner/ModalHeaderBanner.js';
42
+ import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
42
43
  import '../Popper/Popper/Popper.js';
43
44
  import '../Popper/PopperContext/PopperContext.js';
44
45
  import '@dynamic-labs/wallet-book';
@@ -46,7 +47,7 @@ import '../SendBalanceForm/SendBalanceForm.js';
46
47
 
47
48
  const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, termsOfServiceUrl, privacyPolicyUrl, onPinChange, displayPoweredByDynamic = false, }) => {
48
49
  const backButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
49
- return (jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: email })), onClickEditEmail && (jsx(IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) })))] }))] }))] })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsx(TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsx(PoweredByDynamic, {})] }))] })));
50
+ return (jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail(email) })), onClickEditEmail && (jsx(IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) })))] }))] }))] })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsx(TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsx(PoweredByDynamic, {})] }))] })));
50
51
  };
51
52
 
52
53
  export { OTPVerificationView };
@@ -41,7 +41,7 @@ var VerifiedEmailIcon = require('./components/VerifiedEmailIcon/VerifiedEmailIco
41
41
  const UserProfileField = ({ name, label, value, }) => {
42
42
  const isEmpty = value === '';
43
43
  const isEmailField = name === 'email';
44
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'span', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsxRuntime.jsx(VerifiedEmailIcon.VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon' }))] })));
44
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field__value' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsxRuntime.jsx(VerifiedEmailIcon.VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] }))] })));
45
45
  };
46
46
 
47
47
  exports.UserProfileField = UserProfileField;
@@ -37,7 +37,7 @@ import { VerifiedEmailIcon } from './components/VerifiedEmailIcon/VerifiedEmailI
37
37
  const UserProfileField = ({ name, label, value, }) => {
38
38
  const isEmpty = value === '';
39
39
  const isEmailField = name === 'email';
40
- return (jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsx(Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsx(Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'span', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsx(VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon' }))] })));
40
+ return (jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsx(Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxs("div", Object.assign({ className: 'user-profile-field__value' }, { children: [jsx(Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsx(VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] }))] })));
41
41
  };
42
42
 
43
43
  export { UserProfileField };
@@ -20,14 +20,14 @@ var Tooltip = require('../../../../../Tooltip/Tooltip.cjs');
20
20
  var Typography = require('../../../../../Typography/Typography.cjs');
21
21
 
22
22
  const VerifiedEmailTooltip = (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'numbers_small', color: 'tooltip' }, { children: "This email is verified" })));
23
- const VerifiedEmailIcon = ({ className, }) => {
23
+ const VerifiedEmailIcon = ({ className, overwriteTooltipProps, }) => {
24
24
  const { user } = useInternalDynamicContext.useInternalDynamicContext();
25
25
  if (!(user === null || user === void 0 ? void 0 : user.email))
26
26
  return null;
27
27
  const isVerified = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some(({ email }) => email === user.email);
28
28
  if (!isVerified)
29
29
  return null;
30
- return (jsxRuntime.jsx(Tooltip.Tooltip, Object.assign({ content: VerifiedEmailTooltip }, { children: jsxRuntime.jsx(checkCircle.ReactComponent, { className: classNames.classNames('dynamic-verified-email-icon', className) }) })));
30
+ return (jsxRuntime.jsx(Tooltip.Tooltip, Object.assign({ content: VerifiedEmailTooltip }, overwriteTooltipProps, { children: jsxRuntime.jsx(checkCircle.ReactComponent, { className: classNames.classNames('dynamic-verified-email-icon', className) }) })));
31
31
  };
32
32
 
33
33
  exports.VerifiedEmailIcon = VerifiedEmailIcon;
@@ -1,5 +1,7 @@
1
1
  import { FC } from 'react';
2
+ import { TooltipProps } from '../../../../../Tooltip/Tooltip';
2
3
  export type VerifiedEmailIconProps = {
3
4
  className?: string;
5
+ overwriteTooltipProps?: Partial<TooltipProps>;
4
6
  };
5
7
  export declare const VerifiedEmailIcon: FC<VerifiedEmailIconProps>;
@@ -16,14 +16,14 @@ import { Tooltip } from '../../../../../Tooltip/Tooltip.js';
16
16
  import { Typography } from '../../../../../Typography/Typography.js';
17
17
 
18
18
  const VerifiedEmailTooltip = (jsx(Typography, Object.assign({ variant: 'numbers_small', color: 'tooltip' }, { children: "This email is verified" })));
19
- const VerifiedEmailIcon = ({ className, }) => {
19
+ const VerifiedEmailIcon = ({ className, overwriteTooltipProps, }) => {
20
20
  const { user } = useInternalDynamicContext();
21
21
  if (!(user === null || user === void 0 ? void 0 : user.email))
22
22
  return null;
23
23
  const isVerified = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some(({ email }) => email === user.email);
24
24
  if (!isVerified)
25
25
  return null;
26
- return (jsx(Tooltip, Object.assign({ content: VerifiedEmailTooltip }, { children: jsx(SvgCheckCircle, { className: classNames('dynamic-verified-email-icon', className) }) })));
26
+ return (jsx(Tooltip, Object.assign({ content: VerifiedEmailTooltip }, overwriteTooltipProps, { children: jsx(SvgCheckCircle, { className: classNames('dynamic-verified-email-icon', className) }) })));
27
27
  };
28
28
 
29
29
  export { VerifiedEmailIcon };
@@ -103,7 +103,7 @@ const UserProfileSocialAccount = ({ provider, authorizationUrl, verifiedCredenti
103
103
  weight: 'medium',
104
104
  }, startSlot:
105
105
  // eslint-disable-next-line react/jsx-wrap-multilines
106
- jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: 'xsmall' }, { children: jsxRuntime.jsx(add.ReactComponent, {}) })) }, { children: "Connect" })))] })));
106
+ jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsxRuntime.jsx(add.ReactComponent, {}) })) }, { children: "Connect" })))] })));
107
107
  };
108
108
 
109
109
  exports.UserProfileSocialAccount = UserProfileSocialAccount;
@@ -99,7 +99,7 @@ const UserProfileSocialAccount = ({ provider, authorizationUrl, verifiedCredenti
99
99
  weight: 'medium',
100
100
  }, startSlot:
101
101
  // eslint-disable-next-line react/jsx-wrap-multilines
102
- jsx(Icon, Object.assign({ color: 'text-tertiary', size: 'xsmall' }, { children: jsx(SvgAdd, {}) })) }, { children: "Connect" })))] })));
102
+ jsx(Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsx(SvgAdd, {}) })) }, { children: "Connect" })))] })));
103
103
  };
104
104
 
105
105
  export { UserProfileSocialAccount };
@@ -83,6 +83,13 @@ const SocialRedirectContextProvider = ({ children, }) => {
83
83
  React.useEffect(() => {
84
84
  var _a, _b;
85
85
  if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
86
+ // todo: we are competing with the useEffect in ViewContext.
87
+ // once that is cleaned up, we can remove this code
88
+ const params = new URLSearchParams(window.location.search);
89
+ if (params.has('magic_oauth_request_id')) {
90
+ setView('social-redirect-view');
91
+ setShowAuthFlow(true);
92
+ }
86
93
  return;
87
94
  }
88
95
  const params = new URLSearchParams(window.location.search);
@@ -79,6 +79,13 @@ const SocialRedirectContextProvider = ({ children, }) => {
79
79
  useEffect(() => {
80
80
  var _a, _b;
81
81
  if (!projectSettings || !socialWalletConnector || !sdkHasLoaded) {
82
+ // todo: we are competing with the useEffect in ViewContext.
83
+ // once that is cleaned up, we can remove this code
84
+ const params = new URLSearchParams(window.location.search);
85
+ if (params.has('magic_oauth_request_id')) {
86
+ setView('social-redirect-view');
87
+ setShowAuthFlow(true);
88
+ }
82
89
  return;
83
90
  }
84
91
  const params = new URLSearchParams(window.location.search);
@@ -34,21 +34,20 @@ var SvgAdd = function SvgAdd(_ref) {
34
34
  titleId = _ref.titleId,
35
35
  props = _objectWithoutProperties(_ref, _excluded);
36
36
  return /*#__PURE__*/React__namespace.createElement("svg", _extends({
37
- width: 10,
38
- height: 10,
39
- viewBox: "0 0 10 10",
37
+ width: 16,
38
+ height: 16,
39
+ viewBox: "0 0 16 16",
40
40
  fill: "none",
41
41
  xmlns: "http://www.w3.org/2000/svg",
42
42
  "aria-labelledby": titleId
43
43
  }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
44
44
  id: titleId
45
45
  }, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
46
- d: "M5 1v4m0 0v4m0-4h4M5 5H1",
47
- stroke: "currentColor",
48
- strokeOpacity: 0.65,
49
- strokeWidth: 2,
50
- strokeLinecap: "round",
51
- strokeLinejoin: "round"
46
+ fillRule: "evenodd",
47
+ clipRule: "evenodd",
48
+ d: "M8 2c.368 0 .667.298.667.667v4.666h4.666a.667.667 0 1 1 0 1.334H8.667v4.666a.667.667 0 1 1-1.334 0V8.667H2.667a.667.667 0 0 1 0-1.334h4.666V2.667C7.333 2.298 7.632 2 8 2Z",
49
+ fill: "currentColor",
50
+ fillOpacity: 0.4
52
51
  })));
53
52
  };
54
53
 
@@ -10,21 +10,20 @@ var SvgAdd = function SvgAdd(_ref) {
10
10
  titleId = _ref.titleId,
11
11
  props = _objectWithoutProperties(_ref, _excluded);
12
12
  return /*#__PURE__*/React.createElement("svg", _extends({
13
- width: 10,
14
- height: 10,
15
- viewBox: "0 0 10 10",
13
+ width: 16,
14
+ height: 16,
15
+ viewBox: "0 0 16 16",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg",
18
18
  "aria-labelledby": titleId
19
19
  }, props), title ? /*#__PURE__*/React.createElement("title", {
20
20
  id: titleId
21
21
  }, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
22
- d: "M5 1v4m0 0v4m0-4h4M5 5H1",
23
- stroke: "currentColor",
24
- strokeOpacity: 0.65,
25
- strokeWidth: 2,
26
- strokeLinecap: "round",
27
- strokeLinejoin: "round"
22
+ fillRule: "evenodd",
23
+ clipRule: "evenodd",
24
+ d: "M8 2c.368 0 .667.298.667.667v4.666h4.666a.667.667 0 1 1 0 1.334H8.667v4.666a.667.667 0 1 1-1.334 0V8.667H2.667a.667.667 0 0 1 0-1.334h4.666V2.667C7.333 2.298 7.632 2 8 2Z",
25
+ fill: "currentColor",
26
+ fillOpacity: 0.4
28
27
  })));
29
28
  };
30
29
 
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const DEFAULT_BREAKPOINT = 12;
6
+ const DEFAULT_CUT_END = 4;
7
+ const DEFAULT_CUT_START = 4;
8
+ const shortenString = (str, start, end) => str.replace(str.substring(start, end), '...');
9
+ const shortenEmail = (email, options) => {
10
+ if (!email)
11
+ return '';
12
+ const breakpoint = (options === null || options === void 0 ? void 0 : options.breakpoint) || DEFAULT_BREAKPOINT;
13
+ const cutStart = (options === null || options === void 0 ? void 0 : options.cutStart) || DEFAULT_CUT_START;
14
+ const cutEnd = (options === null || options === void 0 ? void 0 : options.cutEnd) || DEFAULT_CUT_END;
15
+ let [username, domain] = email.split('@');
16
+ const shouldShortenUsername = (username === null || username === void 0 ? void 0 : username.length) > breakpoint;
17
+ if (shouldShortenUsername) {
18
+ username = shortenString(username, cutStart, username.length - cutEnd);
19
+ }
20
+ const shouldShortenDomain = (domain === null || domain === void 0 ? void 0 : domain.length) > breakpoint;
21
+ if (shouldShortenDomain) {
22
+ domain = shortenString(domain, cutStart, domain.length - cutEnd);
23
+ }
24
+ return `${username}@${domain}`;
25
+ };
26
+
27
+ exports.shortenEmail = shortenEmail;
@@ -0,0 +1,6 @@
1
+ export type ShortenEmailOptions = {
2
+ breakpoint?: number;
3
+ cutEnd?: number;
4
+ cutStart?: number;
5
+ };
6
+ export declare const shortenEmail: (email?: string, options?: ShortenEmailOptions) => string;
@@ -0,0 +1,23 @@
1
+ const DEFAULT_BREAKPOINT = 12;
2
+ const DEFAULT_CUT_END = 4;
3
+ const DEFAULT_CUT_START = 4;
4
+ const shortenString = (str, start, end) => str.replace(str.substring(start, end), '...');
5
+ const shortenEmail = (email, options) => {
6
+ if (!email)
7
+ return '';
8
+ const breakpoint = (options === null || options === void 0 ? void 0 : options.breakpoint) || DEFAULT_BREAKPOINT;
9
+ const cutStart = (options === null || options === void 0 ? void 0 : options.cutStart) || DEFAULT_CUT_START;
10
+ const cutEnd = (options === null || options === void 0 ? void 0 : options.cutEnd) || DEFAULT_CUT_END;
11
+ let [username, domain] = email.split('@');
12
+ const shouldShortenUsername = (username === null || username === void 0 ? void 0 : username.length) > breakpoint;
13
+ if (shouldShortenUsername) {
14
+ username = shortenString(username, cutStart, username.length - cutEnd);
15
+ }
16
+ const shouldShortenDomain = (domain === null || domain === void 0 ? void 0 : domain.length) > breakpoint;
17
+ if (shouldShortenDomain) {
18
+ domain = shortenString(domain, cutStart, domain.length - cutEnd);
19
+ }
20
+ return `${username}@${domain}`;
21
+ };
22
+
23
+ export { shortenEmail };