@extscreen/es-core 2.3.17 → 2.3.19
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 +162 -154
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1455,6 +1455,151 @@ class ESFileModule {
|
|
1455
1455
|
|
1456
1456
|
var ESFileModule$1 = new ESFileModule();
|
1457
1457
|
|
1458
|
+
const ES_SDK_VERSION_20 = -1;
|
1459
|
+
const ES_SDK_VERSION_21 = 2.1;
|
1460
|
+
const ES_SDK_VERSION_22 = 2.2;
|
1461
|
+
const ES_SDK_VERSION_22_1 = 2.21;
|
1462
|
+
const ES_SDK_VERSION_23 = 2.3;
|
1463
|
+
const ES_SDK_VERSION_24 = 2.4;
|
1464
|
+
const ES_SDK_VERSION_25 = 2.5;
|
1465
|
+
const ES_SDK_VERSION_26 = 2.6;
|
1466
|
+
const ES_SDK_VERSION_27 = 2.7;
|
1467
|
+
const ES_SDK_VERSION_28 = 2.8;
|
1468
|
+
const ES_SDK_VERSION_29 = 2.9;
|
1469
|
+
const ES_SDK_VERSION_30 = 3.0;
|
1470
|
+
|
1471
|
+
/**
|
1472
|
+
*
|
1473
|
+
*/
|
1474
|
+
|
1475
|
+
class ESManager {
|
1476
|
+
|
1477
|
+
_esSdkCid = null;
|
1478
|
+
_esSdkVersionCode = null;
|
1479
|
+
_esSdkVersionName = null;
|
1480
|
+
_esSdkPackageName = null;
|
1481
|
+
_esMiniProgramPath = null;
|
1482
|
+
_esKitVersionCode = -1;
|
1483
|
+
_esSdkSchemes = [];
|
1484
|
+
_runtimePath = null;
|
1485
|
+
|
1486
|
+
_esSdkInfo = null;
|
1487
|
+
|
1488
|
+
|
1489
|
+
init() {
|
1490
|
+
return Promise.resolve()
|
1491
|
+
.then(() => this.initESInfoPromise())
|
1492
|
+
}
|
1493
|
+
|
1494
|
+
initESInfoPromise() {
|
1495
|
+
return ESModule$1.getESSDKInfo()
|
1496
|
+
.then((result) => {
|
1497
|
+
this._esSdkInfo = result;
|
1498
|
+
if (result) {
|
1499
|
+
this._esSdkVersionCode = result.versionCode;
|
1500
|
+
this._esSdkVersionName = result.versionName;
|
1501
|
+
this._esSdkPackageName = result.packageName;
|
1502
|
+
this._esMiniProgramPath = result.miniProgramPath;
|
1503
|
+
this._esSdkSchemes = result.schemes;
|
1504
|
+
if (result.eskit_ver_code) {
|
1505
|
+
this._esKitVersionCode = result.eskit_ver_code;
|
1506
|
+
}
|
1507
|
+
//
|
1508
|
+
this._runtimePath = result.runtimePath;
|
1509
|
+
}
|
1510
|
+
return ESModule$1.getESDeviceInfo();
|
1511
|
+
}
|
1512
|
+
)
|
1513
|
+
//获取cid
|
1514
|
+
.then((result) => {
|
1515
|
+
if (result) {
|
1516
|
+
this._esSdkCid = result.cid;
|
1517
|
+
}
|
1518
|
+
return Promise.resolve();
|
1519
|
+
}
|
1520
|
+
);
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
getESSDKInfo() {
|
1524
|
+
return this._esSdkInfo;
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
getESSDKCid() {
|
1528
|
+
return this._esSdkCid;
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
getESSDKVersionCode() {
|
1532
|
+
return this._esKitVersionCode;
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
getESSDKVersionName() {
|
1536
|
+
return this._esSdkVersionName;
|
1537
|
+
}
|
1538
|
+
|
1539
|
+
getESPackageName() {
|
1540
|
+
return this._esSdkPackageName;
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
getESVersionCode() {
|
1544
|
+
return this._esSdkVersionCode;
|
1545
|
+
}
|
1546
|
+
|
1547
|
+
getESVersionName() {
|
1548
|
+
return this._esSdkVersionName;
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
/**
|
1552
|
+
* 获取EsApp路径, 用于文件存储管理
|
1553
|
+
* @return
|
1554
|
+
* /data/data/APK包名/app_rpk/apps/小程序包名/files
|
1555
|
+
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/files
|
1556
|
+
*/
|
1557
|
+
getESMiniProgramPath() {
|
1558
|
+
return this._esMiniProgramPath;
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
/**
|
1562
|
+
* 获取EsApp路径, 用于文件存储管理
|
1563
|
+
* @return
|
1564
|
+
* /data/data/APK包名/app_rpk/apps/小程序包名/files
|
1565
|
+
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/files
|
1566
|
+
*/
|
1567
|
+
getESAppPath() {
|
1568
|
+
return this._esMiniProgramPath;
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
/**
|
1572
|
+
* 获取EsApp运行时路径, 通常用于获取代码包里的assets
|
1573
|
+
* @return
|
1574
|
+
* /data/data/APK包名/app_rpk/apps/小程序包名/版本号/android
|
1575
|
+
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/2.2.2203/android
|
1576
|
+
*/
|
1577
|
+
getESAppRuntimePath() {
|
1578
|
+
if (this.getESSDKVersionCode() > ES_SDK_VERSION_22) {
|
1579
|
+
return this._runtimePath;
|
1580
|
+
}
|
1581
|
+
//
|
1582
|
+
else {
|
1583
|
+
return this._esMiniProgramPath;
|
1584
|
+
}
|
1585
|
+
}
|
1586
|
+
|
1587
|
+
getESSDKSupportSchemes() {
|
1588
|
+
return this._esSdkSchemes;
|
1589
|
+
}
|
1590
|
+
|
1591
|
+
//----------------------------组件和模块注册相关--------------------------------------------
|
1592
|
+
isModuleRegistered(className) {
|
1593
|
+
return ESModule$1.isModuleRegistered(className);
|
1594
|
+
}
|
1595
|
+
|
1596
|
+
isComponentRegistered(className) {
|
1597
|
+
return ESModule$1.isComponentRegistered(className);
|
1598
|
+
}
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
var ESManager$1 = new ESManager();
|
1602
|
+
|
1458
1603
|
/**
|
1459
1604
|
*
|
1460
1605
|
*/
|
@@ -1476,11 +1621,19 @@ class ESFile {
|
|
1476
1621
|
}
|
1477
1622
|
|
1478
1623
|
newESFile(pathname) {
|
1479
|
-
|
1480
|
-
.
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1624
|
+
if (ESManager$1.getESSDKVersionCode() < ES_SDK_VERSION_22) {
|
1625
|
+
return ESFileModule$1.newFile(pathname)
|
1626
|
+
.then((fileId) => {
|
1627
|
+
this._fileId = fileId;
|
1628
|
+
return Promise.resolve(fileId);
|
1629
|
+
});
|
1630
|
+
} else {
|
1631
|
+
return ESFileModule$1.newESFile(pathname)
|
1632
|
+
.then((fileId) => {
|
1633
|
+
this._fileId = fileId;
|
1634
|
+
return Promise.resolve(fileId);
|
1635
|
+
});
|
1636
|
+
}
|
1484
1637
|
}
|
1485
1638
|
|
1486
1639
|
getFileId() {
|
@@ -1802,151 +1955,6 @@ class ESSharedPreferencesModule {
|
|
1802
1955
|
|
1803
1956
|
var ESSharedPreferencesModule$1 = new ESSharedPreferencesModule();
|
1804
1957
|
|
1805
|
-
const ES_SDK_VERSION_20 = -1;
|
1806
|
-
const ES_SDK_VERSION_21 = 2.1;
|
1807
|
-
const ES_SDK_VERSION_22 = 2.2;
|
1808
|
-
const ES_SDK_VERSION_22_1 = 2.21;
|
1809
|
-
const ES_SDK_VERSION_23 = 2.3;
|
1810
|
-
const ES_SDK_VERSION_24 = 2.4;
|
1811
|
-
const ES_SDK_VERSION_25 = 2.5;
|
1812
|
-
const ES_SDK_VERSION_26 = 2.6;
|
1813
|
-
const ES_SDK_VERSION_27 = 2.7;
|
1814
|
-
const ES_SDK_VERSION_28 = 2.8;
|
1815
|
-
const ES_SDK_VERSION_29 = 2.9;
|
1816
|
-
const ES_SDK_VERSION_30 = 3.0;
|
1817
|
-
|
1818
|
-
/**
|
1819
|
-
*
|
1820
|
-
*/
|
1821
|
-
|
1822
|
-
class ESManager {
|
1823
|
-
|
1824
|
-
_esSdkCid = null;
|
1825
|
-
_esSdkVersionCode = null;
|
1826
|
-
_esSdkVersionName = null;
|
1827
|
-
_esSdkPackageName = null;
|
1828
|
-
_esMiniProgramPath = null;
|
1829
|
-
_esKitVersionCode = -1;
|
1830
|
-
_esSdkSchemes = [];
|
1831
|
-
_runtimePath = null;
|
1832
|
-
|
1833
|
-
_esSdkInfo = null;
|
1834
|
-
|
1835
|
-
|
1836
|
-
init() {
|
1837
|
-
return Promise.resolve()
|
1838
|
-
.then(() => this.initESInfoPromise())
|
1839
|
-
}
|
1840
|
-
|
1841
|
-
initESInfoPromise() {
|
1842
|
-
return ESModule$1.getESSDKInfo()
|
1843
|
-
.then((result) => {
|
1844
|
-
this._esSdkInfo = result;
|
1845
|
-
if (result) {
|
1846
|
-
this._esSdkVersionCode = result.versionCode;
|
1847
|
-
this._esSdkVersionName = result.versionName;
|
1848
|
-
this._esSdkPackageName = result.packageName;
|
1849
|
-
this._esMiniProgramPath = result.miniProgramPath;
|
1850
|
-
this._esSdkSchemes = result.schemes;
|
1851
|
-
if (result.eskit_ver_code) {
|
1852
|
-
this._esKitVersionCode = result.eskit_ver_code;
|
1853
|
-
}
|
1854
|
-
//
|
1855
|
-
this._runtimePath = result.runtimePath;
|
1856
|
-
}
|
1857
|
-
return ESModule$1.getESDeviceInfo();
|
1858
|
-
}
|
1859
|
-
)
|
1860
|
-
//获取cid
|
1861
|
-
.then((result) => {
|
1862
|
-
if (result) {
|
1863
|
-
this._esSdkCid = result.cid;
|
1864
|
-
}
|
1865
|
-
return Promise.resolve();
|
1866
|
-
}
|
1867
|
-
);
|
1868
|
-
}
|
1869
|
-
|
1870
|
-
getESSDKInfo() {
|
1871
|
-
return this._esSdkInfo;
|
1872
|
-
}
|
1873
|
-
|
1874
|
-
getESSDKCid() {
|
1875
|
-
return this._esSdkCid;
|
1876
|
-
}
|
1877
|
-
|
1878
|
-
getESSDKVersionCode() {
|
1879
|
-
return this._esKitVersionCode;
|
1880
|
-
}
|
1881
|
-
|
1882
|
-
getESSDKVersionName() {
|
1883
|
-
return this._esSdkVersionName;
|
1884
|
-
}
|
1885
|
-
|
1886
|
-
getESPackageName() {
|
1887
|
-
return this._esSdkPackageName;
|
1888
|
-
}
|
1889
|
-
|
1890
|
-
getESVersionCode() {
|
1891
|
-
return this._esSdkVersionCode;
|
1892
|
-
}
|
1893
|
-
|
1894
|
-
getESVersionName() {
|
1895
|
-
return this._esSdkVersionName;
|
1896
|
-
}
|
1897
|
-
|
1898
|
-
/**
|
1899
|
-
* 获取EsApp路径, 用于文件存储管理
|
1900
|
-
* @return
|
1901
|
-
* /data/data/APK包名/app_rpk/apps/小程序包名/files
|
1902
|
-
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/files
|
1903
|
-
*/
|
1904
|
-
getESMiniProgramPath() {
|
1905
|
-
return this._esMiniProgramPath;
|
1906
|
-
}
|
1907
|
-
|
1908
|
-
/**
|
1909
|
-
* 获取EsApp路径, 用于文件存储管理
|
1910
|
-
* @return
|
1911
|
-
* /data/data/APK包名/app_rpk/apps/小程序包名/files
|
1912
|
-
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/files
|
1913
|
-
*/
|
1914
|
-
getESAppPath() {
|
1915
|
-
return this._esMiniProgramPath;
|
1916
|
-
}
|
1917
|
-
|
1918
|
-
/**
|
1919
|
-
* 获取EsApp运行时路径, 通常用于获取代码包里的assets
|
1920
|
-
* @return
|
1921
|
-
* /data/data/APK包名/app_rpk/apps/小程序包名/版本号/android
|
1922
|
-
* 示例:/data/data/com.extscreen.runtime/app_rpk/apps/es.com.baduanjin.tv/2.2.2203/android
|
1923
|
-
*/
|
1924
|
-
getESAppRuntimePath() {
|
1925
|
-
if (this.getESSDKVersionCode() > ES_SDK_VERSION_22) {
|
1926
|
-
return this._runtimePath;
|
1927
|
-
}
|
1928
|
-
//
|
1929
|
-
else {
|
1930
|
-
return this._esMiniProgramPath;
|
1931
|
-
}
|
1932
|
-
}
|
1933
|
-
|
1934
|
-
getESSDKSupportSchemes() {
|
1935
|
-
return this._esSdkSchemes;
|
1936
|
-
}
|
1937
|
-
|
1938
|
-
//----------------------------组件和模块注册相关--------------------------------------------
|
1939
|
-
isModuleRegistered(className) {
|
1940
|
-
return ESModule$1.isModuleRegistered(className);
|
1941
|
-
}
|
1942
|
-
|
1943
|
-
isComponentRegistered(className) {
|
1944
|
-
return ESModule$1.isComponentRegistered(className);
|
1945
|
-
}
|
1946
|
-
}
|
1947
|
-
|
1948
|
-
var ESManager$1 = new ESManager();
|
1949
|
-
|
1950
1958
|
/**
|
1951
1959
|
*
|
1952
1960
|
*/
|
@@ -3264,11 +3272,11 @@ class ESRouterLifecycleManager {
|
|
3264
3272
|
* @param route
|
3265
3273
|
* @param params
|
3266
3274
|
*/
|
3267
|
-
onESRouterLifecycleNewIntent(route, params) {
|
3275
|
+
onESRouterLifecycleNewIntent(route, params, intent) {
|
3268
3276
|
let componentInstance = this.getComponentInstance(route);
|
3269
3277
|
let lifecycleChanged = this.isFunction(componentInstance.onESNewIntent);
|
3270
3278
|
if (componentInstance && lifecycleChanged) {
|
3271
|
-
componentInstance.onESNewIntent(params);
|
3279
|
+
componentInstance.onESNewIntent(params, intent);
|
3272
3280
|
} else {
|
3273
3281
|
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
3274
3282
|
ESLog.d(TAG$5, '#-------onESRouterLifecycleNewIntent-----实例对象为空------>>>>>');
|
@@ -3349,7 +3357,7 @@ var ESRouter = {
|
|
3349
3357
|
if (router && router.history && router.history.stack
|
3350
3358
|
&& router.history.stack.length > 0) {
|
3351
3359
|
let route = router.currentRoute;
|
3352
|
-
ESRouterLifecycleManager$1.onESRouterLifecycleNewIntent(route, intent.params);
|
3360
|
+
ESRouterLifecycleManager$1.onESRouterLifecycleNewIntent(route, intent.params, intent);
|
3353
3361
|
}
|
3354
3362
|
}
|
3355
3363
|
},
|
@@ -3430,7 +3438,7 @@ var ESPageLifecycle = {
|
|
3430
3438
|
onESDestroy() {
|
3431
3439
|
|
3432
3440
|
},
|
3433
|
-
onESNewIntent(intent) {
|
3441
|
+
onESNewIntent(params, intent) {
|
3434
3442
|
|
3435
3443
|
},
|
3436
3444
|
onESSaveInstanceState(savedInstanceState) {
|