@depay/widgets 6.31.1 → 7.0.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/README.md +9 -9
- package/dist/esm/index.bundle.js +26 -44
- package/dist/esm/index.js +69 -78
- package/dist/umd/index.bundle.js +26 -44
- package/dist/umd/index.js +73 -82
- package/package.json +12 -13
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import { Currency } from '@depay/local-currency';
|
|
|
12
12
|
import { setProviderEndpoints, request, provider } from '@depay/web3-client';
|
|
13
13
|
import { Blockchain } from '@depay/web3-blockchains';
|
|
14
14
|
import { route as route$1 } from '@depay/web3-payments';
|
|
15
|
-
import Slider from 'react-rangeslider';
|
|
16
15
|
import { TokenImage } from '@depay/react-token-image';
|
|
17
16
|
|
|
18
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -727,34 +726,37 @@ var SelectWalletDialog = (function (props) {
|
|
|
727
726
|
navigate = _useContext.navigate;
|
|
728
727
|
|
|
729
728
|
var wallet = getWallet();
|
|
730
|
-
useEffect(
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
729
|
+
useEffect(function () {
|
|
730
|
+
_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
731
|
+
var accounts;
|
|
732
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
733
|
+
while (1) {
|
|
734
|
+
switch (_context.prev = _context.next) {
|
|
735
|
+
case 0:
|
|
736
|
+
if (!wallet) {
|
|
737
|
+
_context.next = 5;
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
740
|
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
_context.next = 3;
|
|
742
|
+
return wallet.accounts();
|
|
743
743
|
|
|
744
|
-
|
|
745
|
-
|
|
744
|
+
case 3:
|
|
745
|
+
accounts = _context.sent;
|
|
746
746
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
747
|
+
if (accounts == undefined || accounts.length == 0) {
|
|
748
|
+
navigate('ConnectingWallet');
|
|
749
|
+
props.connect(wallet);
|
|
750
|
+
}
|
|
750
751
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
case 5:
|
|
753
|
+
case "end":
|
|
754
|
+
return _context.stop();
|
|
755
|
+
}
|
|
754
756
|
}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
}
|
|
757
|
+
}, _callee);
|
|
758
|
+
}))();
|
|
759
|
+
}, [wallet]);
|
|
758
760
|
|
|
759
761
|
var connect = function connect(walletClass) {
|
|
760
762
|
var wallet = new walletClass();
|
|
@@ -838,6 +840,7 @@ var ConnectStack = (function (props) {
|
|
|
838
840
|
setWallet = _useState4[1];
|
|
839
841
|
|
|
840
842
|
var connect = function connect(wallet) {
|
|
843
|
+
console.log('CONNECT');
|
|
841
844
|
wallet.connect().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
842
845
|
var accounts;
|
|
843
846
|
return regenerator.wrap(function _callee$(_context) {
|
|
@@ -888,40 +891,40 @@ var ConnectStack = (function (props) {
|
|
|
888
891
|
setWallet(wallet);
|
|
889
892
|
}
|
|
890
893
|
}, []);
|
|
891
|
-
useEffect(
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
894
|
+
useEffect(function () {
|
|
895
|
+
_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
896
|
+
var accounts;
|
|
897
|
+
return regenerator.wrap(function _callee2$(_context2) {
|
|
898
|
+
while (1) {
|
|
899
|
+
switch (_context2.prev = _context2.next) {
|
|
900
|
+
case 0:
|
|
901
|
+
if (!wallet) {
|
|
902
|
+
_context2.next = 5;
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
901
905
|
|
|
902
|
-
|
|
903
|
-
|
|
906
|
+
_context2.next = 3;
|
|
907
|
+
return wallet.accounts();
|
|
904
908
|
|
|
905
|
-
|
|
906
|
-
|
|
909
|
+
case 3:
|
|
910
|
+
accounts = _context2.sent;
|
|
907
911
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
connect(wallet);
|
|
916
|
-
}
|
|
912
|
+
if (accounts instanceof Array && accounts.length > 0) {
|
|
913
|
+
if (props.resolve) props.resolve({
|
|
914
|
+
wallet: wallet,
|
|
915
|
+
account: accounts[0],
|
|
916
|
+
accounts: accounts
|
|
917
|
+
});
|
|
918
|
+
}
|
|
917
919
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
920
|
+
case 5:
|
|
921
|
+
case "end":
|
|
922
|
+
return _context2.stop();
|
|
923
|
+
}
|
|
921
924
|
}
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
+
}, _callee2);
|
|
926
|
+
}))();
|
|
927
|
+
}, [wallet]);
|
|
925
928
|
return /*#__PURE__*/React.createElement(ReactDialogStack, {
|
|
926
929
|
open: open,
|
|
927
930
|
close: close,
|
|
@@ -1091,7 +1094,7 @@ function ReactDialogStyle (styles) {
|
|
|
1091
1094
|
`
|
|
1092
1095
|
}
|
|
1093
1096
|
|
|
1094
|
-
const _jsxFileName = "/home/runner/work/react-dialog/react-dialog/src/components/Dialog.jsx";
|
|
1097
|
+
const _jsxFileName$1 = "/home/runner/work/react-dialog/react-dialog/src/components/Dialog.jsx";
|
|
1095
1098
|
class Dialog extends React.Component {
|
|
1096
1099
|
constructor(props) {
|
|
1097
1100
|
super(props);
|
|
@@ -1142,10 +1145,10 @@ class Dialog extends React.Component {
|
|
|
1142
1145
|
const classNames = ['ReactDialog', this.state.open ? 'ReactDialogOpen' : ''];
|
|
1143
1146
|
const style = ReactDialogStyle({ background: this.props.background });
|
|
1144
1147
|
return (
|
|
1145
|
-
React.createElement('div', { className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
1146
|
-
, React.createElement('style', {__self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
1147
|
-
, React.createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
1148
|
-
, React.createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
1148
|
+
React.createElement('div', { className: classNames.join(' '), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 55}}
|
|
1149
|
+
, React.createElement('style', {__self: this, __source: {fileName: _jsxFileName$1, lineNumber: 56}}, style)
|
|
1150
|
+
, React.createElement('div', { className: "ReactDialogInner", __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 57}}
|
|
1151
|
+
, React.createElement('div', { className: "ReactDialogBackground", onClick: this.onClickBackground.bind(this), __self: this, __source: {fileName: _jsxFileName$1, lineNumber: 58}} )
|
|
1149
1152
|
, this.props.children
|
|
1150
1153
|
)
|
|
1151
1154
|
)
|
|
@@ -1153,7 +1156,7 @@ class Dialog extends React.Component {
|
|
|
1153
1156
|
}
|
|
1154
1157
|
}
|
|
1155
1158
|
|
|
1156
|
-
const _jsxFileName
|
|
1159
|
+
const _jsxFileName = "/home/runner/work/react-dialog/react-dialog/src/index.jsx";
|
|
1157
1160
|
class ReactDialog extends React.Component {
|
|
1158
1161
|
constructor(props) {
|
|
1159
1162
|
super(props);
|
|
@@ -1182,7 +1185,7 @@ class ReactDialog extends React.Component {
|
|
|
1182
1185
|
background: this.props.background,
|
|
1183
1186
|
close: this.props.close,
|
|
1184
1187
|
document: _document,
|
|
1185
|
-
open: this.props.open, __self: this, __source: {fileName: _jsxFileName
|
|
1188
|
+
open: this.props.open, __self: this, __source: {fileName: _jsxFileName, lineNumber: 29}}
|
|
1186
1189
|
|
|
1187
1190
|
, this.props.children
|
|
1188
1191
|
),
|
|
@@ -1325,7 +1328,7 @@ var DialogStyle = (function (style) {
|
|
|
1325
1328
|
});
|
|
1326
1329
|
|
|
1327
1330
|
var FontStyle = (function (style) {
|
|
1328
|
-
return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 16px;\n }\n\n .FontSizeM {\n font-size: 19px;\n }\n\n .FontSizeL {\n font-size: 23px;\n }\n\n .FontSizeXL {\n font-size: 32px;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
|
|
1331
|
+
return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 16px;\n }\n\n .FontSizeM {\n font-size: 19px;\n }\n\n .FontSizeL {\n font-size: 23px;\n }\n\n .FontSizeXL {\n font-size: 32px;\n }\n\n .FontSizeXXL {\n font-size: 42px;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
|
|
1329
1332
|
});
|
|
1330
1333
|
|
|
1331
1334
|
var GraphicStyle = (function () {
|
|
@@ -1418,7 +1421,7 @@ var styleRenderer = (function (style) {
|
|
|
1418
1421
|
},
|
|
1419
1422
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
1420
1423
|
}, style);
|
|
1421
|
-
return [ResetStyle(), DialogStyle(
|
|
1424
|
+
return [ResetStyle(), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), FontStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle(), SearchStyle(style), TokenImageStyle(), AlertStyle(), TableStyle(), LinkStyle(style), TooltipStyle(style)].join('');
|
|
1422
1425
|
});
|
|
1423
1426
|
|
|
1424
1427
|
var mount = (function (_ref, content) {
|
|
@@ -2692,15 +2695,14 @@ var ChangeAmountDialog = (function (props) {
|
|
|
2692
2695
|
className: "PaddingLeftM PaddingRightM"
|
|
2693
2696
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2694
2697
|
className: "PaddingTopS TextCenter PaddingBottomL"
|
|
2695
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2696
|
-
className: "FontSizeL"
|
|
2697
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
2698
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
2698
2699
|
max: parseFloat(maxAmount),
|
|
2699
2700
|
min: min,
|
|
2700
2701
|
step: step,
|
|
2701
|
-
className: "Input
|
|
2702
|
+
className: "Input FontSizeXXL TextAlignCenter",
|
|
2702
2703
|
type: "number",
|
|
2703
2704
|
name: "amount",
|
|
2705
|
+
autoFocus: true,
|
|
2704
2706
|
value: parseFloat(inputAmount),
|
|
2705
2707
|
onChange: function onChange(event) {
|
|
2706
2708
|
changeAmount(event.target.value);
|
|
@@ -2708,18 +2710,7 @@ var ChangeAmountDialog = (function (props) {
|
|
|
2708
2710
|
onBlur: function onBlur(event) {
|
|
2709
2711
|
setValidValue(event.target.value);
|
|
2710
2712
|
}
|
|
2711
|
-
})), /*#__PURE__*/React.createElement(
|
|
2712
|
-
max: parseFloat(maxAmount),
|
|
2713
|
-
min: min,
|
|
2714
|
-
step: step,
|
|
2715
|
-
value: parseFloat(inputAmount),
|
|
2716
|
-
onChange: function onChange(value) {
|
|
2717
|
-
changeAmount(toValidStep(value));
|
|
2718
|
-
},
|
|
2719
|
-
onChangeComplete: function onChangeComplete() {
|
|
2720
|
-
setValidValue(inputAmount);
|
|
2721
|
-
}
|
|
2722
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2713
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2723
2714
|
style: {
|
|
2724
2715
|
height: '40px'
|
|
2725
2716
|
}
|