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