@dynamic-labs/sdk-react-core 4.0.0-alpha.40 → 4.0.0-alpha.41
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 +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +8 -3
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +8 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +1 -0
- package/src/lib/views/SelectWalletInWalletGroupView/SelectWalletInWalletGroupView.cjs +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/SelectWalletInWalletGroupView.js +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.js +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.41](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.40...v4.0.0-alpha.41) (2024-12-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add shopify login ([04c6a9e](https://github.com/dynamic-labs/dynamic-auth/commit/04c6a9ee9d039d1480aa3b476ab382d7ea6dbaf2))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* wallet group icon not rendering properly when no wallets with that same id are found ([#7543](https://github.com/dynamic-labs/dynamic-auth/issues/7543)) ([a26a629](https://github.com/dynamic-labs/dynamic-auth/commit/a26a6294bbe845147245cccc60a7fded49196db6))
|
|
13
|
+
|
|
2
14
|
## [4.0.0-alpha.40](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.39...v4.0.0-alpha.40) (2024-12-03)
|
|
3
15
|
|
|
4
16
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.41",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.570",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"react-i18next": "13.5.0",
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
17
|
-
"@dynamic-labs/iconic": "4.0.0-alpha.
|
|
18
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
19
|
-
"@dynamic-labs/multi-wallet": "4.0.0-alpha.
|
|
20
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/store": "4.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
16
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.41",
|
|
17
|
+
"@dynamic-labs/iconic": "4.0.0-alpha.41",
|
|
18
|
+
"@dynamic-labs/logger": "4.0.0-alpha.41",
|
|
19
|
+
"@dynamic-labs/multi-wallet": "4.0.0-alpha.41",
|
|
20
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.41",
|
|
21
|
+
"@dynamic-labs/store": "4.0.0-alpha.41",
|
|
22
|
+
"@dynamic-labs/types": "4.0.0-alpha.41",
|
|
23
|
+
"@dynamic-labs/utils": "4.0.0-alpha.41",
|
|
24
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.41",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.41",
|
|
26
26
|
"bs58": "5.0.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
@@ -20,7 +20,7 @@ const getMobileOauthUrl = (provider, loginData) => {
|
|
|
20
20
|
return provider.redirectUrl.replace('redirect', 'authorizeHtml');
|
|
21
21
|
};
|
|
22
22
|
const getOauthLoginUrl = (providers, providerType) => {
|
|
23
|
-
var _a, _b;
|
|
23
|
+
var _a, _b, _c;
|
|
24
24
|
const provider = getProviderByType.getProviderByType(providers, providerType);
|
|
25
25
|
if (!(provider === null || provider === void 0 ? void 0 : provider.clientId)) {
|
|
26
26
|
return '';
|
|
@@ -34,7 +34,12 @@ const getOauthLoginUrl = (providers, providerType) => {
|
|
|
34
34
|
loginBaseUrl = (_a = provider.authorizationUrl) !== null && _a !== void 0 ? _a : '';
|
|
35
35
|
}
|
|
36
36
|
else if (provider.baseAuthUrl) {
|
|
37
|
-
|
|
37
|
+
if (providerType === sdkApiCore.ProviderEnum.Shopify) {
|
|
38
|
+
loginBaseUrl = provider.baseAuthUrl.replace('{{shopifyStore}}', (_b = provider.shopifyStore) !== null && _b !== void 0 ? _b : '');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
loginBaseUrl = provider.baseAuthUrl;
|
|
42
|
+
}
|
|
38
43
|
}
|
|
39
44
|
else {
|
|
40
45
|
return '';
|
|
@@ -42,7 +47,7 @@ const getOauthLoginUrl = (providers, providerType) => {
|
|
|
42
47
|
const mobileUrl = getMobileOauthUrl(provider, loginData);
|
|
43
48
|
const baseProps = {
|
|
44
49
|
client_id: provider.clientId,
|
|
45
|
-
redirect_uri: (
|
|
50
|
+
redirect_uri: (_c = provider.redirectUrl) !== null && _c !== void 0 ? _c : '',
|
|
46
51
|
response_type: 'code',
|
|
47
52
|
};
|
|
48
53
|
if (providerType === sdkApiCore.ProviderEnum.Tiktok) {
|
|
@@ -16,7 +16,7 @@ const getMobileOauthUrl = (provider, loginData) => {
|
|
|
16
16
|
return provider.redirectUrl.replace('redirect', 'authorizeHtml');
|
|
17
17
|
};
|
|
18
18
|
const getOauthLoginUrl = (providers, providerType) => {
|
|
19
|
-
var _a, _b;
|
|
19
|
+
var _a, _b, _c;
|
|
20
20
|
const provider = getProviderByType(providers, providerType);
|
|
21
21
|
if (!(provider === null || provider === void 0 ? void 0 : provider.clientId)) {
|
|
22
22
|
return '';
|
|
@@ -30,7 +30,12 @@ const getOauthLoginUrl = (providers, providerType) => {
|
|
|
30
30
|
loginBaseUrl = (_a = provider.authorizationUrl) !== null && _a !== void 0 ? _a : '';
|
|
31
31
|
}
|
|
32
32
|
else if (provider.baseAuthUrl) {
|
|
33
|
-
|
|
33
|
+
if (providerType === ProviderEnum.Shopify) {
|
|
34
|
+
loginBaseUrl = provider.baseAuthUrl.replace('{{shopifyStore}}', (_b = provider.shopifyStore) !== null && _b !== void 0 ? _b : '');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
loginBaseUrl = provider.baseAuthUrl;
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
else {
|
|
36
41
|
return '';
|
|
@@ -38,7 +43,7 @@ const getOauthLoginUrl = (providers, providerType) => {
|
|
|
38
43
|
const mobileUrl = getMobileOauthUrl(provider, loginData);
|
|
39
44
|
const baseProps = {
|
|
40
45
|
client_id: provider.clientId,
|
|
41
|
-
redirect_uri: (
|
|
46
|
+
redirect_uri: (_c = provider.redirectUrl) !== null && _c !== void 0 ? _c : '',
|
|
42
47
|
response_type: 'code',
|
|
43
48
|
};
|
|
44
49
|
if (providerType === ProviderEnum.Tiktok) {
|
|
@@ -94,7 +94,7 @@ const SelectWalletInWalletGroupView = () => {
|
|
|
94
94
|
if (!selectedWalletGroup)
|
|
95
95
|
throw new Error('Could not access WalletGroup view without selected group');
|
|
96
96
|
const walletBookData = walletBook.getWalletGroup(walletBook$1, selectedWalletGroup === null || selectedWalletGroup === void 0 ? void 0 : selectedWalletGroup.key);
|
|
97
|
-
return (jsxRuntime.jsx(WalletGroupViewLayout.WalletGroupViewLayout, { icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletBookData.key }), title: t('dyn_select_wallet.description', {
|
|
97
|
+
return (jsxRuntime.jsx(WalletGroupViewLayout.WalletGroupViewLayout, { icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletBookData.key, isGroup: true }), title: t('dyn_select_wallet.description', {
|
|
98
98
|
walletName: walletBookData.name,
|
|
99
99
|
}), titleCopyKey: 'dyn_select_wallet.description', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsxRuntime.jsx(WalletGroupItem.WalletGroupItem, { groupKey: selectedWalletGroup.key, wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) }));
|
|
100
100
|
};
|
|
@@ -90,7 +90,7 @@ const SelectWalletInWalletGroupView = () => {
|
|
|
90
90
|
if (!selectedWalletGroup)
|
|
91
91
|
throw new Error('Could not access WalletGroup view without selected group');
|
|
92
92
|
const walletBookData = getWalletGroup(walletBook, selectedWalletGroup === null || selectedWalletGroup === void 0 ? void 0 : selectedWalletGroup.key);
|
|
93
|
-
return (jsx(WalletGroupViewLayout, { icon: jsx(WalletIcon, { walletKey: walletBookData.key }), title: t('dyn_select_wallet.description', {
|
|
93
|
+
return (jsx(WalletGroupViewLayout, { icon: jsx(WalletIcon, { walletKey: walletBookData.key, isGroup: true }), title: t('dyn_select_wallet.description', {
|
|
94
94
|
walletName: walletBookData.name,
|
|
95
95
|
}), titleCopyKey: 'dyn_select_wallet.description', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsx(WalletGroupItem, { groupKey: selectedWalletGroup.key, wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) }));
|
|
96
96
|
};
|
|
@@ -100,7 +100,7 @@ const WalletGroupView = () => {
|
|
|
100
100
|
.map(({ walletConnector }) => walletConnector)
|
|
101
101
|
.filter((connector) => walletConnectorCore.isHardwareWalletConnector(connector) &&
|
|
102
102
|
connector.canConnectWithHardwareWallet());
|
|
103
|
-
return (jsxRuntime.jsx(WalletGroupViewLayout.WalletGroupViewLayout, { icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletBookData.key }), title: t('dyn_select_chain.description'), titleCopyKey: 'dyn_select_chain.description', children: jsxRuntime.jsxs("div", { className: 'wallet-group__list', children: [Boolean(hardwareWalletConnectors.length) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(HardwareWalletToggle.HardwareWalletToggle, { connectors: hardwareWalletConnectors, copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') }), jsxRuntime.jsx(Divider.Divider, {})] })), jsxRuntime.jsx("div", { className: 'wallet-group-view-layout__list', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsxRuntime.jsx(WalletGroupItem.WalletGroupItem, { wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) })] }) }));
|
|
103
|
+
return (jsxRuntime.jsx(WalletGroupViewLayout.WalletGroupViewLayout, { icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletBookData.key, isGroup: true }), title: t('dyn_select_chain.description'), titleCopyKey: 'dyn_select_chain.description', children: jsxRuntime.jsxs("div", { className: 'wallet-group__list', children: [Boolean(hardwareWalletConnectors.length) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(HardwareWalletToggle.HardwareWalletToggle, { connectors: hardwareWalletConnectors, copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') }), jsxRuntime.jsx(Divider.Divider, {})] })), jsxRuntime.jsx("div", { className: 'wallet-group-view-layout__list', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsxRuntime.jsx(WalletGroupItem.WalletGroupItem, { wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) })] }) }));
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
exports.WalletGroupView = WalletGroupView;
|
|
@@ -96,7 +96,7 @@ const WalletGroupView = () => {
|
|
|
96
96
|
.map(({ walletConnector }) => walletConnector)
|
|
97
97
|
.filter((connector) => isHardwareWalletConnector(connector) &&
|
|
98
98
|
connector.canConnectWithHardwareWallet());
|
|
99
|
-
return (jsx(WalletGroupViewLayout, { icon: jsx(WalletIcon, { walletKey: walletBookData.key }), title: t('dyn_select_chain.description'), titleCopyKey: 'dyn_select_chain.description', children: jsxs("div", { className: 'wallet-group__list', children: [Boolean(hardwareWalletConnectors.length) && (jsxs(Fragment, { children: [jsx(HardwareWalletToggle, { connectors: hardwareWalletConnectors, copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') }), jsx(Divider, {})] })), jsx("div", { className: 'wallet-group-view-layout__list', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsx(WalletGroupItem, { wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) })] }) }));
|
|
99
|
+
return (jsx(WalletGroupViewLayout, { icon: jsx(WalletIcon, { walletKey: walletBookData.key, isGroup: true }), title: t('dyn_select_chain.description'), titleCopyKey: 'dyn_select_chain.description', children: jsxs("div", { className: 'wallet-group__list', children: [Boolean(hardwareWalletConnectors.length) && (jsxs(Fragment, { children: [jsx(HardwareWalletToggle, { connectors: hardwareWalletConnectors, copykey: 'dyn_select_chain.using_hardware_wallet_toggle_label', label: t('dyn_select_chain.using_hardware_wallet_toggle_label') }), jsx(Divider, {})] })), jsx("div", { className: 'wallet-group-view-layout__list', children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsx(WalletGroupItem, { wallet: wallet, onClick: () => handleWalletItemClick(wallet) }, `${wallet.key}_${index}`))) })] }) }));
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
export { WalletGroupView };
|
|
@@ -126,7 +126,7 @@ const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommen
|
|
|
126
126
|
const name = _isWalletGroup
|
|
127
127
|
? walletBook.getWalletGroup(walletBook$1, wallet.key).name
|
|
128
128
|
: wallet.walletConnector.metadata.name;
|
|
129
|
-
const leading = (jsxRuntime.jsx(walletBook.WalletIcon, { className: 'wallet-list-item__leading', icon: (_a = wallet.walletConnector) === null || _a === void 0 ? void 0 : _a.metadata.icon, walletKey: wallet.key, style: { height: pixelToRem.pixelToRem(28), width: pixelToRem.pixelToRem(28) } }));
|
|
129
|
+
const leading = (jsxRuntime.jsx(walletBook.WalletIcon, { className: 'wallet-list-item__leading', icon: (_a = wallet.walletConnector) === null || _a === void 0 ? void 0 : _a.metadata.icon, walletKey: wallet.key, style: { height: pixelToRem.pixelToRem(28), width: pixelToRem.pixelToRem(28) }, isGroup: _isWalletGroup }));
|
|
130
130
|
const trailing = (jsxRuntime.jsx(ListTileAnimatedTrailing.ListTileAnimatedTrailing, { hoverElement:
|
|
131
131
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
132
132
|
jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', size: 'mini', children: jsxRuntime.jsx(stroke.ReactComponent, {}) }), children: labelSettings && (jsxRuntime.jsx(Badge.Badge, { dot: !labelSettings.isRecommended, variant: labelSettings.isRecommended ? 'primary' : 'secondary', text: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: labelSettings.label }) })) }));
|
|
@@ -122,7 +122,7 @@ const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommen
|
|
|
122
122
|
const name = _isWalletGroup
|
|
123
123
|
? getWalletGroup(walletBook, wallet.key).name
|
|
124
124
|
: wallet.walletConnector.metadata.name;
|
|
125
|
-
const leading = (jsx(WalletIcon, { className: 'wallet-list-item__leading', icon: (_a = wallet.walletConnector) === null || _a === void 0 ? void 0 : _a.metadata.icon, walletKey: wallet.key, style: { height: pixelToRem(28), width: pixelToRem(28) } }));
|
|
125
|
+
const leading = (jsx(WalletIcon, { className: 'wallet-list-item__leading', icon: (_a = wallet.walletConnector) === null || _a === void 0 ? void 0 : _a.metadata.icon, walletKey: wallet.key, style: { height: pixelToRem(28), width: pixelToRem(28) }, isGroup: _isWalletGroup }));
|
|
126
126
|
const trailing = (jsx(ListTileAnimatedTrailing, { hoverElement:
|
|
127
127
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
128
128
|
jsx(Icon, { color: 'text-tertiary', size: 'mini', children: jsx(SvgStroke, {}) }), children: labelSettings && (jsx(Badge, { dot: !labelSettings.isRecommended, variant: labelSettings.isRecommended ? 'primary' : 'secondary', text: jsx(Typography, { variant: 'body_small', children: labelSettings.label }) })) }));
|