@extscreen/es-core 1.1.27 → 1.1.28
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.js +45 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1701,45 +1701,46 @@ var ESDisplayManager$1 = new ESDisplayManager();
|
|
1701
1701
|
class ESManager {
|
1702
1702
|
|
1703
1703
|
_esSdkVersionCode = null;
|
1704
|
+
_esSdkVersionName = null;
|
1704
1705
|
_esSdkPackageName = null;
|
1705
1706
|
_esMiniProgramPath = null;
|
1707
|
+
_esKitVersionCode = -1;
|
1708
|
+
|
1709
|
+
_esSdkInfo = null;
|
1710
|
+
|
1706
1711
|
|
1707
1712
|
init() {
|
1708
1713
|
return Promise.resolve()
|
1709
|
-
.then(() => this.
|
1710
|
-
.then(() => this.initESPackageNamePromise())
|
1711
|
-
.then(() => this.initESMiniProgramPathPromise())
|
1714
|
+
.then(() => this.initESInfoPromise())
|
1712
1715
|
}
|
1713
1716
|
|
1714
|
-
|
1715
|
-
|
1716
|
-
return ESModule$1.getESSDKVersionCode()
|
1717
|
+
initESInfoPromise() {
|
1718
|
+
return ESModule$1.getESSDKInfo()
|
1717
1719
|
.then((result) => {
|
1718
|
-
this.
|
1720
|
+
this._esSdkInfo = result;
|
1721
|
+
if (result) {
|
1722
|
+
this._esSdkVersionCode = result.versionCode;
|
1723
|
+
this._esSdkVersionName = result.versionName;
|
1724
|
+
this._esSdkPackageName = result.packageName;
|
1725
|
+
this._esMiniProgramPath = result.miniProgramPath;
|
1726
|
+
if (result.eskit_ver_code) {
|
1727
|
+
this._esKitVersionCode = result.eskit_ver_code;
|
1728
|
+
}
|
1729
|
+
}
|
1719
1730
|
return Promise.resolve();
|
1720
1731
|
}
|
1721
1732
|
);
|
1722
1733
|
}
|
1723
1734
|
|
1724
|
-
|
1725
|
-
return
|
1726
|
-
.then((result) => {
|
1727
|
-
this._esSdkPackageName = result;
|
1728
|
-
return Promise.resolve();
|
1729
|
-
}
|
1730
|
-
);
|
1735
|
+
getESSDKInfo() {
|
1736
|
+
return this._esSdkInfo;
|
1731
1737
|
}
|
1732
1738
|
|
1733
|
-
|
1734
|
-
return
|
1735
|
-
.then((result) => {
|
1736
|
-
this._esMiniProgramPath = result;
|
1737
|
-
return Promise.resolve();
|
1738
|
-
}
|
1739
|
-
);
|
1739
|
+
getESSDKVersionCode() {
|
1740
|
+
return this._esKitVersionCode;
|
1740
1741
|
}
|
1741
1742
|
|
1742
|
-
|
1743
|
+
getESVersionCode() {
|
1743
1744
|
return this._esSdkVersionCode;
|
1744
1745
|
}
|
1745
1746
|
|
@@ -1754,6 +1755,8 @@ class ESManager {
|
|
1754
1755
|
|
1755
1756
|
var ESManager$1 = new ESManager();
|
1756
1757
|
|
1758
|
+
const ES_SDK_VERSION_21 = 2.1;
|
1759
|
+
|
1757
1760
|
/**
|
1758
1761
|
*
|
1759
1762
|
*/
|
@@ -1763,42 +1766,49 @@ class ESLaunchManager {
|
|
1763
1766
|
|
1764
1767
|
_ESRouter = null;
|
1765
1768
|
_ESRouterEnabled = true;
|
1769
|
+
_ESPageRouterViewEnabled = false;
|
1766
1770
|
_launchLimit = 10;
|
1767
1771
|
|
1768
1772
|
init(router) {
|
1769
1773
|
try {
|
1770
1774
|
this._ESRouter = router;
|
1771
|
-
this.
|
1775
|
+
this._ESPageRouterViewEnabled = this.isESPageRouterViewSupported();
|
1772
1776
|
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
1773
1777
|
ESLog.d('ESRouter', '#------init--------->>' + '\n' +
|
1774
|
-
'
|
1778
|
+
'_ESPageRouterViewEnabled: ' + this._ESPageRouterViewEnabled + '\n' +
|
1775
1779
|
'_ESRouter: ' + this._ESRouter
|
1776
1780
|
);
|
1777
1781
|
}
|
1778
1782
|
} catch (e) {
|
1779
1783
|
}
|
1780
1784
|
//
|
1781
|
-
|
1782
|
-
this._ESRouter.setEnabled(this._ESRouterEnabled);
|
1783
|
-
} catch (e) {
|
1784
|
-
}
|
1785
|
+
this._setESPageRouterViewSupported(this._ESPageRouterViewEnabled);
|
1785
1786
|
return Promise.resolve();
|
1786
1787
|
}
|
1787
1788
|
|
1788
|
-
|
1789
|
-
|
1789
|
+
//----------------------ESPageRouterView--------------------------
|
1790
|
+
_setESPageRouterViewSupported(enabled) {
|
1791
|
+
this._ESPageRouterViewEnabled = enabled;
|
1790
1792
|
try {
|
1791
|
-
this._ESRouter
|
1793
|
+
if (this._ESRouter) {
|
1794
|
+
this._ESRouter.setESPageRouterViewSupported(this._ESPageRouterViewEnabled);
|
1795
|
+
}
|
1792
1796
|
} catch (e) {
|
1793
1797
|
}
|
1794
1798
|
}
|
1795
1799
|
|
1800
|
+
isESPageRouterViewSupported() {
|
1801
|
+
return ESManager$1.getESSDKVersionCode() >= ES_SDK_VERSION_21;
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
//---------------------------------------------------------
|
1805
|
+
|
1796
1806
|
isESRouterEnabled() {
|
1797
|
-
return this._ESRouterEnabled
|
1807
|
+
return this._ESRouterEnabled;
|
1798
1808
|
}
|
1799
1809
|
|
1800
|
-
|
1801
|
-
|
1810
|
+
setESRouterEnabled(enabled) {
|
1811
|
+
this._ESRouterEnabled = enabled;
|
1802
1812
|
}
|
1803
1813
|
|
1804
1814
|
setLaunchLimit(limit) {
|
@@ -1822,9 +1832,7 @@ class ESLaunchManager {
|
|
1822
1832
|
}
|
1823
1833
|
|
1824
1834
|
launchESPage(intent) {
|
1825
|
-
|
1826
|
-
if (this.isESRouterEnabled() && this._ESRouter
|
1827
|
-
&& this.isESRouterSupported()) {
|
1835
|
+
if (this.isESRouterEnabled() && this._ESRouter) {
|
1828
1836
|
this._ESRouter.push({
|
1829
1837
|
name: intent.url,
|
1830
1838
|
params: intent.params,
|