@dynamic-labs/sdk-react-core 4.59.1 → 4.60.0
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 +23 -0
- package/package.cjs +2 -1
- package/package.js +2 -1
- package/package.json +13 -12
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.cjs +5 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.d.ts +2 -1
- package/src/lib/components/FormFieldLabel/FormFieldLabel.js +5 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/events/embeddedWallet.d.ts +15 -3
- package/src/lib/shared/assets/index.d.ts +1 -1
- package/src/lib/shared/assets/setup-password-terms-illustration.cjs +83 -0
- package/src/lib/shared/assets/setup-password-terms-illustration.js +59 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +48 -6
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +8 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +49 -7
- package/src/lib/utils/hooks/useGetPasswordForSigning/index.d.ts +2 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.cjs +16 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.d.ts +5 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.js +12 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.cjs +144 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.d.ts +5 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.js +140 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +14 -14
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +14 -14
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.cjs +13 -100
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.js +13 -100
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +10 -3
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +10 -3
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +2 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +3 -2
- package/src/lib/utils/hooks/useWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/useWalletUnlock/useWalletUnlock.d.ts +15 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.cjs → UnlockWalletView/UnlockWalletView.cjs} +18 -13
- package/src/lib/views/UnlockWalletView/UnlockWalletView.d.ts +6 -0
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.js → UnlockWalletView/UnlockWalletView.js} +18 -13
- package/src/lib/views/UnlockWalletView/index.d.ts +2 -0
- package/src/lib/views/index.d.ts +3 -3
- package/src/lib/views/viewToComponentMap.cjs +3 -3
- package/src/lib/views/viewToComponentMap.d.ts +1 -1
- package/src/lib/views/viewToComponentMap.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +43 -43
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +43 -43
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +33 -19
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +33 -19
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.cjs +61 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.js +57 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/index.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.js +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.cjs +13 -6
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.js +13 -6
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/shared/assets/warning-circle-orange.cjs +0 -57
- package/src/lib/shared/assets/warning-circle-orange.js +0 -33
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.d.ts +0 -2
- package/src/lib/views/SetupPasswordForWalletCreationView/index.d.ts +0 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useCallback } from 'react';
|
|
4
4
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
5
|
-
import {
|
|
5
|
+
import { SetupPasswordConfirmView } from '../SetupPasswordConfirmView/SetupPasswordConfirmView.js';
|
|
6
6
|
import { SetupPasswordEnterView } from '../SetupPasswordEnterView/SetupPasswordEnterView.js';
|
|
7
7
|
import '../../../../../../_virtual/_tslib.js';
|
|
8
8
|
import '@dynamic-labs/utils';
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
11
|
-
import { SetupPasswordConfirmView } from '../SetupPasswordConfirmView/SetupPasswordConfirmView.js';
|
|
12
11
|
import { SetupPasswordKnowledgeCheckView } from '../SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.js';
|
|
13
12
|
import { SetupPasswordSuccessView } from '../SetupPasswordSuccessView/SetupPasswordSuccessView.js';
|
|
13
|
+
import { SetupPasswordTermsView } from '../SetupPasswordTermsView/SetupPasswordTermsView.js';
|
|
14
14
|
|
|
15
15
|
const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }) => {
|
|
16
16
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
@@ -57,14 +57,21 @@ const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }
|
|
|
57
57
|
const handleKnowledgeCheckReviewTerms = useCallback(() => {
|
|
58
58
|
setCurrentStep('terms');
|
|
59
59
|
}, []);
|
|
60
|
+
const goToWallets = useCallback(() => {
|
|
61
|
+
setDynamicWidgetView('wallets');
|
|
62
|
+
}, [setDynamicWidgetView]);
|
|
60
63
|
const handleSuccess = useCallback(() => {
|
|
61
64
|
onComplete(password);
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
+
// Navigate to appropriate view based on where we came from:
|
|
66
|
+
// - If onCancel was provided (auto-create flow), go to wallets view
|
|
67
|
+
// - If onCancel wasn't provided (settings flow), go to account settings
|
|
68
|
+
if (onCancel) {
|
|
69
|
+
goToWallets();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
65
72
|
goToAccountAndSecurity();
|
|
66
73
|
}
|
|
67
|
-
}, [onComplete, password, onCancel, goToAccountAndSecurity]);
|
|
74
|
+
}, [onComplete, password, onCancel, goToAccountAndSecurity, goToWallets]);
|
|
68
75
|
switch (currentStep) {
|
|
69
76
|
case 'terms':
|
|
70
77
|
return (jsx(SetupPasswordTermsView, { onContinue: handleTermsContinue, onBack: handleCancel }));
|
|
@@ -12,6 +12,7 @@ export { SetupPasswordEnterView } from './SetupPasswordEnterView';
|
|
|
12
12
|
export { SetupPasswordConfirmView } from './SetupPasswordConfirmView';
|
|
13
13
|
export { SetupPasswordKnowledgeCheckView } from './SetupPasswordKnowledgeCheckView';
|
|
14
14
|
export { SetupPasswordSuccessView } from './SetupPasswordSuccessView';
|
|
15
|
+
export { EnterPasswordView } from './EnterPasswordView';
|
|
15
16
|
export { WalletsDelegatedSettingsView } from './WalletsDelegatedSettingsView';
|
|
16
17
|
export { WaasBackupView } from './WaasBackupView';
|
|
17
18
|
export { WaasBackupInfoView } from './WaasBackupView';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n["default"] = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
-
|
|
28
|
-
var _circle, _path;
|
|
29
|
-
var _excluded = ["title", "titleId"];
|
|
30
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
32
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
33
|
-
var SvgWarningCircleOrange = function SvgWarningCircleOrange(_ref) {
|
|
34
|
-
var title = _ref.title,
|
|
35
|
-
titleId = _ref.titleId,
|
|
36
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
38
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
-
width: 69,
|
|
40
|
-
height: 69,
|
|
41
|
-
viewBox: "0 0 69 69",
|
|
42
|
-
fill: "none",
|
|
43
|
-
"aria-labelledby": titleId
|
|
44
|
-
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
45
|
-
id: titleId
|
|
46
|
-
}, title) : null, _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
47
|
-
cx: 34.5,
|
|
48
|
-
cy: 34.5,
|
|
49
|
-
r: 34.5,
|
|
50
|
-
fill: "#DD8500"
|
|
51
|
-
})), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
52
|
-
d: "M38.166 20.7a3.45 3.45 0 1 0-6.9 0v13.8a3.45 3.45 0 1 0 6.9 0V20.7ZM34.716 44.85a3.45 3.45 0 1 0 0 6.9h.034a3.45 3.45 0 1 0 0-6.9h-.034Z",
|
|
53
|
-
fill: "#F9F9FB"
|
|
54
|
-
})));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.ReactComponent = SvgWarningCircleOrange;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
var _circle, _path;
|
|
5
|
-
var _excluded = ["title", "titleId"];
|
|
6
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
7
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
-
var SvgWarningCircleOrange = function SvgWarningCircleOrange(_ref) {
|
|
10
|
-
var title = _ref.title,
|
|
11
|
-
titleId = _ref.titleId,
|
|
12
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
width: 69,
|
|
16
|
-
height: 69,
|
|
17
|
-
viewBox: "0 0 69 69",
|
|
18
|
-
fill: "none",
|
|
19
|
-
"aria-labelledby": titleId
|
|
20
|
-
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
21
|
-
id: titleId
|
|
22
|
-
}, title) : null, _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
|
|
23
|
-
cx: 34.5,
|
|
24
|
-
cy: 34.5,
|
|
25
|
-
r: 34.5,
|
|
26
|
-
fill: "#DD8500"
|
|
27
|
-
})), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
28
|
-
d: "M38.166 20.7a3.45 3.45 0 1 0-6.9 0v13.8a3.45 3.45 0 1 0 6.9 0V20.7ZM34.716 44.85a3.45 3.45 0 1 0 0 6.9h.034a3.45 3.45 0 1 0 0-6.9h-.034Z",
|
|
29
|
-
fill: "#F9F9FB"
|
|
30
|
-
})));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { SvgWarningCircleOrange as ReactComponent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SetupPasswordForWalletCreationView } from './SetupPasswordForWalletCreationView';
|