@wowlabtech/mini-app-adapter 0.2.5 → 0.2.7
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/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -583,8 +583,13 @@ var BaseMiniAppAdapter = class {
|
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
supports(
|
|
587
|
-
|
|
586
|
+
supports(capability) {
|
|
587
|
+
switch (capability) {
|
|
588
|
+
case "openExternalLink":
|
|
589
|
+
return true;
|
|
590
|
+
default:
|
|
591
|
+
return false;
|
|
592
|
+
}
|
|
588
593
|
}
|
|
589
594
|
get platform() {
|
|
590
595
|
return this.environment.platform;
|
|
@@ -1327,6 +1332,8 @@ var TelegramMiniAppAdapter = class extends BaseMiniAppAdapter {
|
|
|
1327
1332
|
return import_sdk_react.backButton.hide.isSupported();
|
|
1328
1333
|
case "bindCssVariables":
|
|
1329
1334
|
return true;
|
|
1335
|
+
case "openExternalLink":
|
|
1336
|
+
return isFeatureAvailable(import_sdk_react.openLink);
|
|
1330
1337
|
case "openInternalLink":
|
|
1331
1338
|
return true;
|
|
1332
1339
|
case "requestFullscreen":
|
|
@@ -1958,6 +1965,16 @@ var VKMiniAppAdapter = class extends BaseMiniAppAdapter {
|
|
|
1958
1965
|
queryParams: this.queryParams
|
|
1959
1966
|
};
|
|
1960
1967
|
}
|
|
1968
|
+
async openExternalLink(url) {
|
|
1969
|
+
const a = document.createElement("a");
|
|
1970
|
+
a.href = url;
|
|
1971
|
+
a.target = "_blank";
|
|
1972
|
+
a.rel = "noopener noreferrer";
|
|
1973
|
+
a.style.display = "none";
|
|
1974
|
+
document.body.appendChild(a);
|
|
1975
|
+
a.click();
|
|
1976
|
+
a.remove();
|
|
1977
|
+
}
|
|
1961
1978
|
async supports(capability) {
|
|
1962
1979
|
switch (capability) {
|
|
1963
1980
|
case "haptics": {
|
|
@@ -1989,6 +2006,8 @@ var VKMiniAppAdapter = class extends BaseMiniAppAdapter {
|
|
|
1989
2006
|
return this.supportsBridgeMethod("VKWebAppAddToHomeScreen");
|
|
1990
2007
|
case "denyNotifications":
|
|
1991
2008
|
return this.supportsBridgeMethod("VKWebAppDenyNotifications");
|
|
2009
|
+
case "openExternalLink":
|
|
2010
|
+
return true;
|
|
1992
2011
|
case "viewVisibility":
|
|
1993
2012
|
return true;
|
|
1994
2013
|
default:
|