@depay/widgets 12.0.2 → 12.0.3

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.
@@ -21967,7 +21967,28 @@ var ConnectWalletDialog = (function (props) {
21967
21967
  className: "Alert"
21968
21968
  }, /*#__PURE__*/React.createElement("span", {
21969
21969
  className: "FontWeightBold PaddingBottomXS"
21970
- }, "You wallet extension window is already asking to connect. It might be hidden."))), /*#__PURE__*/React.createElement("button", {
21970
+ }, "You wallet extension window is already asking to connect. It might be hidden."))), props.connectingExtension && /*#__PURE__*/React.createElement("div", {
21971
+ className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
21972
+ style: {
21973
+ height: '50px'
21974
+ }
21975
+ }, /*#__PURE__*/React.createElement("div", {
21976
+ className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
21977
+ style: {
21978
+ width: "50px"
21979
+ }
21980
+ }, /*#__PURE__*/React.createElement("div", {
21981
+ className: "Loading Icon medium",
21982
+ style: {
21983
+ position: 'relative',
21984
+ top: '4px',
21985
+ left: '1px'
21986
+ }
21987
+ })), /*#__PURE__*/React.createElement("div", {
21988
+ className: "PaddingLeftS LineHeightXS"
21989
+ }, /*#__PURE__*/React.createElement("div", {
21990
+ className: "CardText FontWeightMedium"
21991
+ }, "Connecting extension"))), !props.connectingExtension && /*#__PURE__*/React.createElement("button", {
21971
21992
  onClick: function onClick() {
21972
21993
  return props.connectExtension(props.wallet);
21973
21994
  },
@@ -21993,7 +22014,28 @@ var ConnectWalletDialog = (function (props) {
21993
22014
  className: "CardText FontWeightMedium"
21994
22015
  }, "Connect extension")))), connectAppIsAvailable && /*#__PURE__*/React.createElement("div", {
21995
22016
  className: "PaddingBottomXS"
21996
- }, /*#__PURE__*/React.createElement("button", {
22017
+ }, props.connectingApp && /*#__PURE__*/React.createElement("div", {
22018
+ className: "Card disabled small PaddingTopS PaddingRightXS PaddingBottomS PaddingLeftXS",
22019
+ style: {
22020
+ height: '50px'
22021
+ }
22022
+ }, /*#__PURE__*/React.createElement("div", {
22023
+ className: "PaddingTopXS PaddingRightXS PaddingLeftS TextCenter",
22024
+ style: {
22025
+ width: "50px"
22026
+ }
22027
+ }, /*#__PURE__*/React.createElement("div", {
22028
+ className: "Loading Icon medium",
22029
+ style: {
22030
+ position: 'relative',
22031
+ top: '4px',
22032
+ left: '1px'
22033
+ }
22034
+ })), /*#__PURE__*/React.createElement("div", {
22035
+ className: "PaddingLeftS LineHeightXS"
22036
+ }, /*#__PURE__*/React.createElement("div", {
22037
+ className: "CardText FontWeightMedium"
22038
+ }, "Connecting app"))), !props.connectingApp && /*#__PURE__*/React.createElement("button", {
21997
22039
  onClick: function onClick() {
21998
22040
  return props.connectViaRedirect(props.wallet);
21999
22041
  },
@@ -22586,20 +22628,28 @@ var ConnectStack = (function (props) {
22586
22628
  _useState4 = _slicedToArray(_useState3, 2),
22587
22629
  platform = _useState4[0],
22588
22630
  setPlatform = _useState4[1];
22589
- var _useState5 = useState(),
22631
+ var _useState5 = useState(false),
22590
22632
  _useState6 = _slicedToArray(_useState5, 2),
22591
- redirectUri = _useState6[0],
22592
- setRedirectUri = _useState6[1];
22593
- var _useState7 = useState({
22633
+ connectingExtension = _useState6[0],
22634
+ setConnectingExtension = _useState6[1];
22635
+ var _useState7 = useState(false),
22636
+ _useState8 = _slicedToArray(_useState7, 2);
22637
+ _useState8[0];
22638
+ var setConnectingApp = _useState8[1];
22639
+ var _useState9 = useState(),
22640
+ _useState10 = _slicedToArray(_useState9, 2),
22641
+ redirectUri = _useState10[0],
22642
+ setRedirectUri = _useState10[1];
22643
+ var _useState11 = useState({
22594
22644
  blockchain: undefined
22595
22645
  }),
22596
- _useState8 = _slicedToArray(_useState7, 2),
22597
- selection = _useState8[0];
22598
- _useState8[1];
22599
- var _useState9 = useState(false),
22600
- _useState10 = _slicedToArray(_useState9, 2),
22601
- showConnectExtensionWarning = _useState10[0],
22602
- setShowConnectExtensionWarning = _useState10[1];
22646
+ _useState12 = _slicedToArray(_useState11, 2),
22647
+ selection = _useState12[0];
22648
+ _useState12[1];
22649
+ var _useState13 = useState(false),
22650
+ _useState14 = _slicedToArray(_useState13, 2),
22651
+ showConnectExtensionWarning = _useState14[0],
22652
+ setShowConnectExtensionWarning = _useState14[1];
22603
22653
  var resolve = function resolve(account, wallet) {
22604
22654
  if (account && wallet) {
22605
22655
  var walletMeta = allWallets.find(function (walletMeta) {
@@ -22617,10 +22667,18 @@ var ConnectStack = (function (props) {
22617
22667
  };
22618
22668
  var connectExtension = function connectExtension(wallet) {
22619
22669
  setShowConnectExtensionWarning(false);
22670
+ setConnectingExtension(true);
22620
22671
  wallet = new wallets[wallet.extension]();
22672
+ var resetConnectingTimeout = setTimeout(function () {
22673
+ setConnectingExtension(false);
22674
+ }, 5000);
22621
22675
  wallet.connect().then(function (account) {
22622
22676
  resolve(account, wallet);
22677
+ setConnectingExtension(false);
22678
+ clearTimeout(resetConnectingTimeout);
22623
22679
  })["catch"](function (error) {
22680
+ setConnectingExtension(false);
22681
+ clearTimeout(resetConnectingTimeout);
22624
22682
  if ((error === null || error === void 0 ? void 0 : error.code) == -32002) {
22625
22683
  // Request of type 'wallet_requestPermissions' already pending...
22626
22684
  setShowConnectExtensionWarning(true);
@@ -22697,6 +22755,10 @@ var ConnectStack = (function (props) {
22697
22755
  if (!platform) {
22698
22756
  return;
22699
22757
  }
22758
+ setConnectingApp(true);
22759
+ setTimeout(function () {
22760
+ setConnectingApp(false);
22761
+ }, 5000);
22700
22762
  if (['WalletConnectV1', 'WalletConnectV2'].includes(platform.connect)) {
22701
22763
  localStorage[atob('ZGVwYXk6d2FsbGV0czp3YzI6cHJvamVjdElk')] = atob('YjFmYzJmMDZlYTIxMDdmY2Q5OWM2OGY0MTI3MTQxYWI=');
22702
22764
  var _wallet = new wallets[platform.connect]();
@@ -22721,7 +22783,10 @@ var ConnectStack = (function (props) {
22721
22783
  });
22722
22784
  }
22723
22785
  }).then(function (account) {
22786
+ setConnectingApp(false);
22724
22787
  resolve(account, _wallet);
22788
+ })["catch"](function () {
22789
+ setConnectingApp(false);
22725
22790
  });
22726
22791
  } else if (platform.connect === 'SolanaMobileWalletAdapter') {
22727
22792
  var _wallet2 = new wallets[platform.connect]();
@@ -22729,7 +22794,10 @@ var ConnectStack = (function (props) {
22729
22794
  name: walletMetaData.name,
22730
22795
  logo: walletMetaData.logo
22731
22796
  }).then(function (account) {
22797
+ setConnectingApp(false);
22732
22798
  resolve(account, _wallet2);
22799
+ })["catch"](function () {
22800
+ setConnectingApp(false);
22733
22801
  });
22734
22802
  }
22735
22803
  };
@@ -22772,6 +22840,7 @@ var ConnectStack = (function (props) {
22772
22840
  openInApp: openInApp,
22773
22841
  connectViaRedirect: connectViaRedirect,
22774
22842
  connectExtension: connectExtension,
22843
+ connectingExtension: connectingExtension,
22775
22844
  showConnectExtensionWarning: showConnectExtensionWarning,
22776
22845
  continueWithSolanaPay: props.continueWithSolanaPay
22777
22846
  })
@@ -23172,7 +23241,7 @@ var HeightStyle = (function () {
23172
23241
  });
23173
23242
 
23174
23243
  var IconStyle = (function (style) {
23175
- return "\n\n .Icon {\n fill: ".concat(style.colors.icons, ";\n stroke: ").concat(style.colors.icons, ";\n }\n\n .QuestionMarkIcon {\n fill: transparent;\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .ChevronLeft.small, .ChevronRight.small {\n height: 12px;\n width: 12px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
23244
+ return "\n\n .Icon {\n fill: ".concat(style.colors.icons, ";\n stroke: ").concat(style.colors.icons, ";\n }\n\n .QuestionMarkIcon {\n fill: transparent;\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .ChevronLeft.small, .ChevronRight.small {\n height: 12px;\n width: 12px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .AlertIcon {\n height: 20px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 20px;\n fill: #e42626;\n stroke: transparent;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n animation: spin 1.5s linear infinite;\n border-radius: 100%;\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n display: inline-block;\n height: 18px;\n left: -1px;\n position: relative;\n width: 18px;\n }\n\n .Loading.medium {\n border: 4px solid ").concat(style.colors.primary, ";\n border-top: 4px solid rgba(0,0,0,0.1);\n display: inline-block;\n height: 22px;\n position: relative;\n width: 22px; \n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
23176
23245
  });
23177
23246
 
23178
23247
  var ImageStyle = (function (style) {
@@ -24198,22 +24267,26 @@ var ChangableAmountProvider = (function (props) {
24198
24267
  });
24199
24268
  };
24200
24269
  var _useContext = useContext(ConfigurationContext),
24201
- accept = _useContext.accept,
24202
24270
  configuredAmount = _useContext.amount;
24203
24271
  _useContext.toAmount;
24204
24272
  var recover = _useContext.recover;
24273
+ var _useContext2 = useContext(ConfigurationContext),
24274
+ accept = _useContext2.accept;
24275
+ if (!accept) {
24276
+ accept = props.accept;
24277
+ }
24205
24278
  useContext(ConfigurationContext);
24206
24279
  var _useState = useState(recover == undefined ? configurationsMissAmounts(accept) : false),
24207
24280
  _useState2 = _slicedToArray(_useState, 2),
24208
24281
  amountsMissing = _useState2[0],
24209
24282
  setAmountsMissing = _useState2[1];
24210
- var _useContext2 = useContext(WalletContext),
24211
- account = _useContext2.account;
24212
- var _useContext3 = useContext(ConversionRateContext),
24213
- conversionRate = _useContext3.conversionRate,
24214
- fixedCurrencyConversionRate = _useContext3.fixedCurrencyConversionRate;
24215
- var _useContext4 = useContext(ErrorContext),
24216
- setError = _useContext4.setError;
24283
+ var _useContext3 = useContext(WalletContext),
24284
+ account = _useContext3.account;
24285
+ var _useContext4 = useContext(ConversionRateContext),
24286
+ conversionRate = _useContext4.conversionRate,
24287
+ fixedCurrencyConversionRate = _useContext4.fixedCurrencyConversionRate;
24288
+ var _useContext5 = useContext(ErrorContext),
24289
+ setError = _useContext5.setError;
24217
24290
  var _useState3 = useState(),
24218
24291
  _useState4 = _slicedToArray(_useState3, 2),
24219
24292
  acceptWithAmount = _useState4[0],