@tonconnect/ui-react 0.0.8 → 0.0.10

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/lib/index.umd.js CHANGED
@@ -6280,9 +6280,7 @@ var __objRest = (source, exclude) => {
6280
6280
  });
6281
6281
  }
6282
6282
  const [walletsModalOpen, setWalletsModalOpen] = createSignal(false);
6283
- const [lastSelectedWalletInfo, setLastSelectedWalletInfo] = createSignal(
6284
- null
6285
- );
6283
+ const [lastSelectedWalletInfo, setLastSelectedWalletInfo] = createSignal(null);
6286
6284
  const [action, setAction] = createSignal(null);
6287
6285
  let e = { data: "" }, t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/| +/g, n = /\n+/g, o = (e2, t2) => {
6288
6286
  let r = "", l2 = "", a2 = "";
@@ -6803,8 +6801,7 @@ var __objRest = (source, exclude) => {
6803
6801
  },
6804
6802
  text: {
6805
6803
  primary: "#0F0F0F",
6806
- secondary: "#7A8999",
6807
- subhead: "#6A7785"
6804
+ secondary: "#7A8999"
6808
6805
  }
6809
6806
  };
6810
6807
  const defaultDarkColorsSet = {
@@ -6829,8 +6826,7 @@ var __objRest = (source, exclude) => {
6829
6826
  },
6830
6827
  text: {
6831
6828
  primary: "#E5E5EA",
6832
- secondary: "#7D7D85",
6833
- subhead: "#8C8C93"
6829
+ secondary: "#7D7D85"
6834
6830
  }
6835
6831
  };
6836
6832
  var isMergeableObject = function isMergeableObject2(value) {
@@ -7075,7 +7071,7 @@ var __objRest = (source, exclude) => {
7075
7071
  padding: 9px 16px;
7076
7072
  border: none;
7077
7073
  border-radius: ${(props) => borders$3[props.theme.borderRadius]};
7078
- cursor: pointer;
7074
+ cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
7079
7075
 
7080
7076
  font-size: 14px;
7081
7077
  font-weight: 590;
@@ -7085,11 +7081,11 @@ var __objRest = (source, exclude) => {
7085
7081
  transition: transform 0.1s ease-in-out;
7086
7082
 
7087
7083
  &:hover {
7088
- transform: scale(1.04);
7084
+ transform: ${(props) => props.disabled ? "unset" : "scale(1.04)"};
7089
7085
  }
7090
7086
 
7091
7087
  &:active {
7092
- transform: scale(0.96);
7088
+ transform: ${(props) => props.disabled ? "unset" : "scale(0.96)"};
7093
7089
  }
7094
7090
  `;
7095
7091
  const Button = (props) => {
@@ -7100,11 +7096,17 @@ var __objRest = (source, exclude) => {
7100
7096
  get id() {
7101
7097
  return props.id;
7102
7098
  },
7103
- onClick: () => props.onClick(),
7099
+ onClick: () => {
7100
+ var _a;
7101
+ return (_a = props.onClick) == null ? void 0 : _a.call(props);
7102
+ },
7104
7103
  ref(r$) {
7105
7104
  const _ref$ = props.ref;
7106
7105
  typeof _ref$ === "function" ? _ref$(r$) : props.ref = r$;
7107
7106
  },
7107
+ get disabled() {
7108
+ return props.disabled;
7109
+ },
7108
7110
  get children() {
7109
7111
  return props.children;
7110
7112
  }
@@ -7892,38 +7894,42 @@ var __objRest = (source, exclude) => {
7892
7894
  return _el$;
7893
7895
  })();
7894
7896
  };
7895
- const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke="white" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7897
+ const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
7896
7898
  const SuccessIcon = (props) => {
7897
7899
  const theme = useTheme();
7898
7900
  const fill = () => props.fill || theme.colors.icon.success;
7899
7901
  return (() => {
7900
- const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild;
7902
+ const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
7901
7903
  createRenderEffect((_p$) => {
7902
- const _v$ = props.class, _v$2 = fill();
7904
+ const _v$ = props.class, _v$2 = fill(), _v$3 = theme.colors.constant.white;
7903
7905
  _v$ !== _p$._v$ && setAttribute(_el$, "class", _p$._v$ = _v$);
7904
7906
  _v$2 !== _p$._v$2 && setAttribute(_el$2, "fill", _p$._v$2 = _v$2);
7907
+ _v$3 !== _p$._v$3 && setAttribute(_el$3, "stroke", _p$._v$3 = _v$3);
7905
7908
  return _p$;
7906
7909
  }, {
7907
7910
  _v$: void 0,
7908
- _v$2: void 0
7911
+ _v$2: void 0,
7912
+ _v$3: void 0
7909
7913
  });
7910
7914
  return _el$;
7911
7915
  })();
7912
7916
  };
7913
- const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z" fill="white"></path></svg>`);
7917
+ const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z"></path></svg>`);
7914
7918
  const ErrorIcon = (props) => {
7915
7919
  const theme = useTheme();
7916
7920
  const fill = () => props.fill || theme.colors.icon.secondary;
7917
7921
  return (() => {
7918
- const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild;
7922
+ const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
7919
7923
  createRenderEffect((_p$) => {
7920
- const _v$ = props.class, _v$2 = fill();
7924
+ const _v$ = props.class, _v$2 = fill(), _v$3 = theme.colors.constant.white;
7921
7925
  _v$ !== _p$._v$ && setAttribute(_el$, "class", _p$._v$ = _v$);
7922
7926
  _v$2 !== _p$._v$2 && setAttribute(_el$2, "fill", _p$._v$2 = _v$2);
7927
+ _v$3 !== _p$._v$3 && setAttribute(_el$3, "fill", _p$._v$3 = _v$3);
7923
7928
  return _p$;
7924
7929
  }, {
7925
7930
  _v$: void 0,
7926
- _v$2: void 0
7931
+ _v$2: void 0,
7932
+ _v$3: void 0
7927
7933
  });
7928
7934
  return _el$;
7929
7935
  })();
@@ -8199,7 +8205,7 @@ var __objRest = (source, exclude) => {
8199
8205
  }
8200
8206
  });
8201
8207
  };
8202
- const LoaderIconStyled$2 = styled(LoaderIcon)`
8208
+ const LoaderIconStyled$3 = styled(LoaderIcon)`
8203
8209
  align-self: center;
8204
8210
  min-width: 22px;
8205
8211
  min-height: 22px;
@@ -8213,7 +8219,7 @@ var __objRest = (source, exclude) => {
8213
8219
  return props.class;
8214
8220
  },
8215
8221
  get icon() {
8216
- return createComponent(LoaderIconStyled$2, {});
8222
+ return createComponent(LoaderIconStyled$3, {});
8217
8223
  },
8218
8224
  children: "Confirm operation in your wallet"
8219
8225
  });
@@ -8378,7 +8384,25 @@ var __objRest = (source, exclude) => {
8378
8384
  }
8379
8385
  `;
8380
8386
  const DropdownButtonStyled = styled(AccountButtonStyled)`
8387
+ width: 140px;
8388
+ gap: 11px;
8389
+ justify-content: center;
8390
+ background-color: ${(props) => props.theme.colors.background.primary};
8391
+ `;
8392
+ const LoaderButtonStyled = styled(Button)`
8393
+ width: 140px;
8394
+
8381
8395
  background-color: ${(props) => props.theme.colors.background.primary};
8396
+ color: ${(props) => props.theme.colors.connectButton.foreground};
8397
+ box-shadow: ${(props) => `0 4px 24px ${rgba(props.theme.colors.constant.black, 0.16)}`};
8398
+
8399
+ display: flex;
8400
+ align-items: center;
8401
+ justify-content: center;
8402
+ `;
8403
+ const LoaderIconStyled$2 = styled(LoaderIcon)`
8404
+ height: 18px;
8405
+ width: 18px;
8382
8406
  `;
8383
8407
  const DropdownContainerStyled = styled.div`
8384
8408
  display: flex;
@@ -9146,6 +9170,7 @@ var __objRest = (source, exclude) => {
9146
9170
  const tonConnectUI2 = useContext(TonConnectUiContext);
9147
9171
  const [isOpened, setIsOpened] = createSignal(false);
9148
9172
  const [account, setAccount] = createSignal(null);
9173
+ const [restoringProcess, setRestoringProcess] = createSignal(true);
9149
9174
  let dropDownRef;
9150
9175
  const [floating, setFloating] = createSignal();
9151
9176
  const [anchor, setAnchor] = createSignal();
@@ -9161,6 +9186,7 @@ var __objRest = (source, exclude) => {
9161
9186
  }
9162
9187
  return "";
9163
9188
  };
9189
+ tonConnectUI2.connectionRestored.then(() => setRestoringProcess(false));
9164
9190
  const unsubscribe = connector.onStatusChange((wallet) => {
9165
9191
  if (!wallet) {
9166
9192
  setIsOpened(false);
@@ -9188,123 +9214,144 @@ var __objRest = (source, exclude) => {
9188
9214
  });
9189
9215
  return [createComponent(Show, {
9190
9216
  get when() {
9191
- return !account();
9217
+ return restoringProcess();
9192
9218
  },
9193
9219
  get children() {
9194
- return createComponent(AccountButtonStyled, {
9195
- onClick: () => tonConnectUI2.connectWallet(),
9196
- id: "tc-connect-button",
9220
+ return createComponent(LoaderButtonStyled, {
9221
+ disabled: true,
9222
+ id: "tc-connect-button-loading",
9197
9223
  get children() {
9198
- return [createComponent(TonIcon, {
9199
- get fill() {
9200
- return theme.colors.connectButton.foreground;
9201
- }
9202
- }), createComponent(Text, {
9203
- translationKey: "button.connectWallet",
9204
- fontSize: "15px",
9205
- letterSpacing: "-0.24px",
9206
- fontWeight: "590",
9207
- get color() {
9208
- return theme.colors.connectButton.foreground;
9209
- },
9210
- children: "Connect wallet"
9211
- })];
9224
+ return createComponent(LoaderIconStyled$2, {});
9212
9225
  }
9213
9226
  });
9214
9227
  }
9215
9228
  }), createComponent(Show, {
9216
9229
  get when() {
9217
- return account();
9230
+ return !restoringProcess();
9218
9231
  },
9219
9232
  get children() {
9220
- return createComponent(DropdownContainerStyled, {
9233
+ return [createComponent(Show, {
9234
+ get when() {
9235
+ return !account();
9236
+ },
9221
9237
  get children() {
9222
- return [createComponent(DropdownButtonStyled, {
9223
- onClick: () => setIsOpened((v) => !v),
9224
- ref: setAnchor,
9225
- id: "tc-dropdown-button",
9238
+ return createComponent(AccountButtonStyled, {
9239
+ onClick: () => tonConnectUI2.connectWallet(),
9240
+ id: "tc-connect-button",
9226
9241
  get children() {
9227
- return [createComponent(Text, {
9242
+ return [createComponent(TonIcon, {
9243
+ get fill() {
9244
+ return theme.colors.connectButton.foreground;
9245
+ }
9246
+ }), createComponent(Text, {
9247
+ translationKey: "button.connectWallet",
9228
9248
  fontSize: "15px",
9229
9249
  letterSpacing: "-0.24px",
9230
9250
  fontWeight: "590",
9231
- get children() {
9232
- return normalizedAddress();
9233
- }
9234
- }), createComponent(ArrowIcon, {
9235
- direction: "bottom"
9251
+ get color() {
9252
+ return theme.colors.connectButton.foreground;
9253
+ },
9254
+ children: "Connect wallet"
9236
9255
  })];
9237
9256
  }
9238
- }), createComponent(Portal, {
9257
+ });
9258
+ }
9259
+ }), createComponent(Show, {
9260
+ get when() {
9261
+ return account();
9262
+ },
9263
+ get children() {
9264
+ return createComponent(DropdownContainerStyled, {
9239
9265
  get children() {
9240
- const _el$ = _tmpl$$3.cloneNode(true);
9241
- use(setFloating, _el$);
9242
- _el$.style.setProperty("z-index", "999");
9243
- insert(_el$, createComponent(Transition, {
9244
- onBeforeEnter: (el) => {
9245
- el.animate([{
9246
- opacity: 0,
9247
- transform: "translateY(-8px)"
9248
- }, {
9249
- opacity: 1,
9250
- transform: "translateY(0)"
9251
- }], {
9252
- duration: 150
9253
- });
9254
- },
9255
- onExit: (el, done) => {
9256
- const a2 = el.animate([{
9257
- opacity: 1,
9258
- transform: "translateY(0)"
9259
- }, {
9260
- opacity: 0,
9261
- transform: "translateY(-8px)"
9262
- }], {
9263
- duration: 150
9264
- });
9265
- a2.finished.then(done);
9266
- },
9266
+ return [createComponent(DropdownButtonStyled, {
9267
+ onClick: () => setIsOpened((v) => !v),
9268
+ ref: setAnchor,
9269
+ id: "tc-dropdown-button",
9267
9270
  get children() {
9268
- return createComponent(Show, {
9269
- get when() {
9270
- return isOpened();
9271
+ return [createComponent(Text, {
9272
+ fontSize: "15px",
9273
+ letterSpacing: "-0.24px",
9274
+ fontWeight: "590",
9275
+ lineHeight: "18px",
9276
+ get children() {
9277
+ return normalizedAddress();
9278
+ }
9279
+ }), createComponent(ArrowIcon, {
9280
+ direction: "bottom"
9281
+ })];
9282
+ }
9283
+ }), createComponent(Portal, {
9284
+ get children() {
9285
+ const _el$ = _tmpl$$3.cloneNode(true);
9286
+ use(setFloating, _el$);
9287
+ _el$.style.setProperty("z-index", "999");
9288
+ insert(_el$, createComponent(Transition, {
9289
+ onBeforeEnter: (el) => {
9290
+ el.animate([{
9291
+ opacity: 0,
9292
+ transform: "translateY(-8px)"
9293
+ }, {
9294
+ opacity: 1,
9295
+ transform: "translateY(0)"
9296
+ }], {
9297
+ duration: 150
9298
+ });
9299
+ },
9300
+ onExit: (el, done) => {
9301
+ const a2 = el.animate([{
9302
+ opacity: 1,
9303
+ transform: "translateY(0)"
9304
+ }, {
9305
+ opacity: 0,
9306
+ transform: "translateY(-8px)"
9307
+ }], {
9308
+ duration: 150
9309
+ });
9310
+ a2.finished.then(done);
9271
9311
  },
9272
9312
  get children() {
9273
- return createComponent(DropdownStyled, {
9274
- get hidden() {
9275
- return !isOpened();
9313
+ return createComponent(Show, {
9314
+ get when() {
9315
+ return isOpened();
9276
9316
  },
9277
- onClose: () => setIsOpened(false),
9278
- ref(r$) {
9279
- const _ref$ = dropDownRef;
9280
- typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
9281
- },
9282
- id: "tc-dropdown"
9317
+ get children() {
9318
+ return createComponent(DropdownStyled, {
9319
+ get hidden() {
9320
+ return !isOpened();
9321
+ },
9322
+ onClose: () => setIsOpened(false),
9323
+ ref(r$) {
9324
+ const _ref$ = dropDownRef;
9325
+ typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
9326
+ },
9327
+ id: "tc-dropdown"
9328
+ });
9329
+ }
9283
9330
  });
9284
9331
  }
9332
+ }), null);
9333
+ insert(_el$, createComponent(NotificationsStyled, {
9334
+ id: "tc-notifications"
9335
+ }), null);
9336
+ createRenderEffect((_p$) => {
9337
+ var _a, _b;
9338
+ const _v$ = position.strategy, _v$2 = `${(_a = position.y) != null ? _a : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
9339
+ _v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
9340
+ _v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
9341
+ _v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
9342
+ return _p$;
9343
+ }, {
9344
+ _v$: void 0,
9345
+ _v$2: void 0,
9346
+ _v$3: void 0
9285
9347
  });
9348
+ return _el$;
9286
9349
  }
9287
- }), null);
9288
- insert(_el$, createComponent(NotificationsStyled, {
9289
- id: "tc-notifications"
9290
- }), null);
9291
- createRenderEffect((_p$) => {
9292
- var _a, _b;
9293
- const _v$ = position.strategy, _v$2 = `${(_a = position.y) != null ? _a : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
9294
- _v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
9295
- _v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
9296
- _v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
9297
- return _p$;
9298
- }, {
9299
- _v$: void 0,
9300
- _v$2: void 0,
9301
- _v$3: void 0
9302
- });
9303
- return _el$;
9350
+ })];
9304
9351
  }
9305
- })];
9352
+ });
9306
9353
  }
9307
- });
9354
+ })];
9308
9355
  }
9309
9356
  })];
9310
9357
  };
@@ -11137,7 +11184,12 @@ var __objRest = (source, exclude) => {
11137
11184
  }), createComponent(ButtonsContainerStyled, {
11138
11185
  get children() {
11139
11186
  return [createComponent(ActionButtonStyled, {
11140
- onClick: () => openLink(universalLink),
11187
+ onClick: () => {
11188
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
11189
+ openMethod: "universal-link"
11190
+ }));
11191
+ openLink(universalLink);
11192
+ },
11141
11193
  get children() {
11142
11194
  return createComponent(Translation, {
11143
11195
  translationKey: "walletModal.qrCodeModal.openWallet",
@@ -11157,9 +11209,12 @@ var __objRest = (source, exclude) => {
11157
11209
  },
11158
11210
  get children() {
11159
11211
  return createComponent(ActionButtonStyled, {
11160
- onClick: () => connector.connect({
11161
- jsBridgeKey: props.wallet.jsBridgeKey
11162
- }, props.additionalRequest),
11212
+ onClick: () => {
11213
+ setLastSelectedWalletInfo(props.wallet);
11214
+ connector.connect({
11215
+ jsBridgeKey: props.wallet.jsBridgeKey
11216
+ }, props.additionalRequest);
11217
+ },
11163
11218
  get children() {
11164
11219
  return createComponent(Translation, {
11165
11220
  translationKey: "walletModal.qrCodeModal.openExtension",
@@ -11464,14 +11519,20 @@ var __objRest = (source, exclude) => {
11464
11519
  setSelectedWalletInfo(null);
11465
11520
  };
11466
11521
  const onSelect = (walletInfo) => {
11467
- setLastSelectedWalletInfo(walletInfo);
11468
11522
  if (isDevice("mobile") && "universalLink" in walletInfo) {
11523
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, walletInfo), {
11524
+ openMethod: "universal-link"
11525
+ }));
11469
11526
  return onSelectIfMobile(walletInfo);
11470
11527
  }
11471
11528
  if (isWalletInfoInjected(walletInfo) && walletInfo.injected) {
11529
+ setLastSelectedWalletInfo(walletInfo);
11472
11530
  return onSelectIfInjected(walletInfo);
11473
11531
  }
11474
11532
  if ("bridgeUrl" in walletInfo) {
11533
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, walletInfo), {
11534
+ openMethod: "qrcode"
11535
+ }));
11475
11536
  setSelectedWalletInfo(walletInfo);
11476
11537
  return;
11477
11538
  }
@@ -11802,6 +11863,7 @@ var __objRest = (source, exclude) => {
11802
11863
  __publicField(this, "_walletInfo", null);
11803
11864
  __publicField(this, "systemThemeChangeUnsubscribe", null);
11804
11865
  __publicField(this, "actionsConfiguration");
11866
+ __publicField(this, "connectionRestored", Promise.resolve(false));
11805
11867
  if (options && "connector" in options && options.connector) {
11806
11868
  this.connector = options.connector;
11807
11869
  } else if (options && "manifestUrl" in options && options.manifestUrl) {
@@ -11818,11 +11880,13 @@ var __objRest = (source, exclude) => {
11818
11880
  const rootId = this.normalizeWidgetRoot(options == null ? void 0 : options.widgetRootId);
11819
11881
  this.subscribeToWalletChange();
11820
11882
  if ((options == null ? void 0 : options.restoreConnection) !== false) {
11821
- this.connector.restoreConnection().then(() => {
11883
+ this.connectionRestored = new Promise((resolve) => __async(this, null, function* () {
11884
+ yield this.connector.restoreConnection();
11822
11885
  if (!this.connector.connected) {
11823
11886
  this.walletInfoStorage.removeWalletInfo();
11824
11887
  }
11825
- });
11888
+ resolve(this.connector.connected);
11889
+ }));
11826
11890
  }
11827
11891
  this.uiOptions = mergeOptions(options, { uiPreferences: { theme: "SYSTEM" } });
11828
11892
  setAppState({
@@ -11928,7 +11992,7 @@ var __objRest = (source, exclude) => {
11928
11992
  if (!this.connected || !this.walletInfo) {
11929
11993
  throw new TonConnectUIError("Connect wallet to send a transaction.");
11930
11994
  }
11931
- if (!isDevice("desktop") && "universalLink" in this.walletInfo) {
11995
+ if ("universalLink" in this.walletInfo && this.walletInfo.openMethod === "universal-link") {
11932
11996
  openLink(this.walletInfo.universalLink);
11933
11997
  }
11934
11998
  const { notifications: notifications2, modals } = this.getModalsAndNotificationsConfiguration(options);
@@ -14959,6 +15023,12 @@ var __objRest = (source, exclude) => {
14959
15023
  return "";
14960
15024
  }
14961
15025
  }
15026
+ function useIsConnectionRestored() {
15027
+ const [restored, setRestored] = require$$0$2.useState(false);
15028
+ const [tonConnectUI2] = useTonConnectUI();
15029
+ tonConnectUI2.connectionRestored.then(() => setRestored(true));
15030
+ return restored;
15031
+ }
14962
15032
  exports.THEME = THEME;
14963
15033
  exports.TonConnectButton = TonConnectButton$1;
14964
15034
  exports.TonConnectProviderNotSetError = TonConnectProviderNotSetError;
@@ -14967,6 +15037,7 @@ var __objRest = (source, exclude) => {
14967
15037
  exports.TonConnectUIError = TonConnectUIError;
14968
15038
  exports.TonConnectUIProvider = TonConnectUIProvider$1;
14969
15039
  exports.TonConnectUIReactError = TonConnectUIReactError;
15040
+ exports.useIsConnectionRestored = useIsConnectionRestored;
14970
15041
  exports.useTonAddress = useTonAddress;
14971
15042
  exports.useTonConnectUI = useTonConnectUI;
14972
15043
  exports.useTonWallet = useTonWallet;