@tonconnect/ui 2.0.1-beta.3 → 2.0.1-beta.4

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.mjs CHANGED
@@ -1869,11 +1869,15 @@ function isNodeJs() {
1869
1869
  return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
1870
1870
  }
1871
1871
  function getUserAgent() {
1872
- var _a2, _b2;
1872
+ var _a2, _b2, _c2;
1873
1873
  const results = new UAParser().getResult();
1874
1874
  const osName = (_a2 = results.os.name) == null ? void 0 : _a2.toLowerCase();
1875
+ const deviceModel = (_b2 = results.device.model) == null ? void 0 : _b2.toLowerCase();
1875
1876
  let os;
1876
1877
  switch (true) {
1878
+ case deviceModel === "ipad":
1879
+ os = "ipad";
1880
+ break;
1877
1881
  case osName === "ios":
1878
1882
  os = "ios";
1879
1883
  break;
@@ -1890,7 +1894,7 @@ function getUserAgent() {
1890
1894
  os = "windows";
1891
1895
  break;
1892
1896
  }
1893
- const browserName = (_b2 = results.browser.name) == null ? void 0 : _b2.toLowerCase();
1897
+ const browserName = (_c2 = results.browser.name) == null ? void 0 : _c2.toLowerCase();
1894
1898
  let browser;
1895
1899
  switch (true) {
1896
1900
  case browserName === "chrome":
@@ -2830,7 +2834,7 @@ function isDevice(device) {
2830
2834
  return width > maxWidth.mobile;
2831
2835
  default:
2832
2836
  case "mobile":
2833
- return width <= maxWidth.mobile || isOS("ios", "android");
2837
+ return width <= maxWidth.mobile || isOS("ios", "android", "ipad");
2834
2838
  }
2835
2839
  }
2836
2840
  function media(device) {
@@ -8369,6 +8373,27 @@ function redirectToTelegram(universalLink, options) {
8369
8373
  );
8370
8374
  openLinkBlank(linkWithStrategy);
8371
8375
  }
8376
+ } else if (isOS("ipad")) {
8377
+ if (options.returnStrategy === "back") {
8378
+ options.returnStrategy = "back";
8379
+ }
8380
+ const isChrome = isBrowser("chrome");
8381
+ const isFirefox = isBrowser("firefox");
8382
+ const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect;
8383
+ if (useDeepLink) {
8384
+ const linkWithStrategy = addReturnStrategy(
8385
+ directLinkUrl.toString(),
8386
+ options.returnStrategy
8387
+ );
8388
+ const deepLink = convertToTGDeepLink(linkWithStrategy);
8389
+ openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy));
8390
+ } else {
8391
+ const linkWithStrategy = addReturnStrategy(
8392
+ directLinkUrl.toString(),
8393
+ options.returnStrategy
8394
+ );
8395
+ openLinkBlank(linkWithStrategy);
8396
+ }
8372
8397
  } else if (isOS("macos", "windows", "linux")) {
8373
8398
  options.returnStrategy = "none";
8374
8399
  options.twaReturnUrl = void 0;
@@ -8506,6 +8531,17 @@ function redirectToWallet(universalLink, deepLink, options, setOpenMethod) {
8506
8531
  }
8507
8532
  setOpenMethod("universal-link");
8508
8533
  openLinkBlank(addReturnStrategy(universalLink, options.returnStrategy));
8534
+ } else if (isOS("ipad")) {
8535
+ if (options.returnStrategy === "back") {
8536
+ options.returnStrategy = "back";
8537
+ }
8538
+ if (isBrowser("chrome")) {
8539
+ setOpenMethod("universal-link");
8540
+ openLink(addReturnStrategy(universalLink, options.returnStrategy), "_self");
8541
+ } else {
8542
+ setOpenMethod("universal-link");
8543
+ openLinkBlank(addReturnStrategy(universalLink, options.returnStrategy));
8544
+ }
8509
8545
  } else if (isOS("macos", "windows", "linux")) {
8510
8546
  if (options.returnStrategy === "back") {
8511
8547
  if (isBrowser("safari")) {