@dynamic-labs/sdk-react-core 1.0.6 → 1.0.8
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 +19 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +12 -12
- package/src/index.cjs +10 -8
- package/src/index.js +5 -4
- package/src/lib/Main.cjs +1 -1
- package/src/lib/Main.js +1 -1
- package/src/lib/components/InlineWidget/components/InlineWidgetButton/InlineWidgetButton.d.ts +2 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +2 -2
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +2 -2
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +3 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.d.ts +2 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +3 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -2
- package/src/lib/data/api.cjs +2 -2
- package/src/lib/data/api.d.ts +1 -0
- package/src/lib/data/api.js +2 -2
- package/src/lib/locale/en/translation.cjs +34 -0
- package/src/lib/locale/en/translation.d.ts +34 -0
- package/src/lib/locale/en/translation.js +34 -0
- package/src/lib/shared/utils/hooks/index.d.ts +5 -4
- package/src/lib/shared/utils/hooks/useThrottle/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.cjs +29 -0
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.d.ts +8 -0
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.js +25 -0
- package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.cjs +1 -1
- package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.d.ts +1 -1
- package/src/lib/utils/functions/getWalletIdentifier/getWalletIdentifier.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +13 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +13 -2
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.cjs +1 -1
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.js +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +14 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +14 -6
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +15 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +16 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +8 -8
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +8 -8
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -3
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +65 -45
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +5 -7
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +66 -46
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +3 -2
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +3 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +10 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +11 -6
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +6 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +6 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +5 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +5 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +3 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +3 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactI18next = require('react-i18next');
|
|
6
7
|
var UserProfile = require('../../../../components/UserProfile/UserProfile.cjs');
|
|
7
8
|
var DynamicWidgetFooter = require('../../../DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.cjs');
|
|
8
9
|
var DynamicBridgeWidgetContext = require('../../context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.cjs');
|
|
@@ -17,6 +18,7 @@ var useInternalDynamicContext = require('../../../../context/DynamicContext/useI
|
|
|
17
18
|
var getUserProfileFields = require('../../../../utils/functions/getUserProfileFields/getUserProfileFields.cjs');
|
|
18
19
|
|
|
19
20
|
const ProfileView = () => {
|
|
21
|
+
const { t } = reactI18next.useTranslation();
|
|
20
22
|
const { setBridgeWidgetView } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
|
|
21
23
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
22
24
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
@@ -24,7 +26,7 @@ const ProfileView = () => {
|
|
|
24
26
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(UserProfile.UserProfile, { rootClassName: 'profile-view' }), jsxRuntime.jsx(DynamicWidgetFooter.DynamicWidgetFooter, { children: jsxRuntime.jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsxRuntime.jsx(Button.Button, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
25
27
|
color: 'secondary',
|
|
26
28
|
variant: 'button_tertiary',
|
|
27
|
-
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsxRuntime.jsx(pencil.ReactComponent, {}), children:
|
|
29
|
+
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsxRuntime.jsx(pencil.ReactComponent, {}), copykey: 'dyn_bridge.widget.edit_profile', children: t('dyn_bridge.widget.edit_profile') })), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: true, buttonClassName: classNames.classNames('dynamic-widget-footer__button', {
|
|
28
30
|
'dynamic-widget-footer__button-align-right': !(editableUserFields === null || editableUserFields === void 0 ? void 0 : editableUserFields.length),
|
|
29
31
|
}) })] }) })] }));
|
|
30
32
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { UserProfile } from '../../../../components/UserProfile/UserProfile.js';
|
|
3
4
|
import { DynamicWidgetFooter } from '../../../DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.js';
|
|
4
5
|
import { useDynamicBridgeWidgetContext } from '../../context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.js';
|
|
@@ -13,6 +14,7 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
|
|
|
13
14
|
import { getEditableUserProfileFields } from '../../../../utils/functions/getUserProfileFields/getUserProfileFields.js';
|
|
14
15
|
|
|
15
16
|
const ProfileView = () => {
|
|
17
|
+
const { t } = useTranslation();
|
|
16
18
|
const { setBridgeWidgetView } = useDynamicBridgeWidgetContext();
|
|
17
19
|
const { projectSettings } = useInternalDynamicContext();
|
|
18
20
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
@@ -20,7 +22,7 @@ const ProfileView = () => {
|
|
|
20
22
|
return (jsxs(Fragment, { children: [jsx(UserProfile, { rootClassName: 'profile-view' }), jsx(DynamicWidgetFooter, { children: jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsx(Button, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
21
23
|
color: 'secondary',
|
|
22
24
|
variant: 'button_tertiary',
|
|
23
|
-
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsx(SvgPencil, {}), children:
|
|
25
|
+
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsx(SvgPencil, {}), copykey: 'dyn_bridge.widget.edit_profile', children: t('dyn_bridge.widget.edit_profile') })), jsx(LogoutButton, { isTextButton: true, buttonClassName: classNames('dynamic-widget-footer__button', {
|
|
24
26
|
'dynamic-widget-footer__button-align-right': !(editableUserFields === null || editableUserFields === void 0 ? void 0 : editableUserFields.length),
|
|
25
27
|
}) })] }) })] }));
|
|
26
28
|
};
|