@extscreen/es-core 10000.0.1 → 10000.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/index.js +95 -45
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1693,36 +1693,6 @@ class ESDisplayManager {
1693
1693
 
1694
1694
  var ESDisplayManager$1 = new ESDisplayManager();
1695
1695
 
1696
- /**
1697
- *
1698
- */
1699
-
1700
- class ESLaunchManager {
1701
-
1702
- _ESRouter = null;
1703
-
1704
- init() {
1705
- return Promise.resolve();
1706
- }
1707
-
1708
- setESRouter(ESRouter) {
1709
- this._ESRouter = ESRouter;
1710
- }
1711
-
1712
- launchNativeIntent(paramsArray) {
1713
- ESModule$1.launchNativeApp(paramsArray);
1714
- }
1715
-
1716
- launchESPageIntent(intent) {
1717
- //
1718
- ESModule$1.launchESPage({
1719
- args: intent
1720
- });
1721
- }
1722
- }
1723
-
1724
- var ESLaunchManager$1 = new ESLaunchManager();
1725
-
1726
1696
  /**
1727
1697
  *
1728
1698
  */
@@ -1783,6 +1753,77 @@ class ESManager {
1783
1753
 
1784
1754
  var ESManager$1 = new ESManager();
1785
1755
 
1756
+ /**
1757
+ *
1758
+ */
1759
+
1760
+ class ESLaunchManager {
1761
+
1762
+ _ESRouter = null;
1763
+ _ESRouterEnabled = true;
1764
+
1765
+ init() {
1766
+ this._ESRouterEnabled = this.isESRouterSupported();
1767
+ return Promise.resolve();
1768
+ }
1769
+
1770
+ setESRouter(ESRouter) {
1771
+ this._ESRouter = ESRouter;
1772
+ }
1773
+
1774
+ setESRouterEnabled(enabled) {
1775
+ this._ESRouterEnabled = enabled && this.isESRouterSupported();
1776
+ }
1777
+
1778
+ isESRouterEnabled() {
1779
+ return this._ESRouterEnabled && this.isESRouterSupported();
1780
+ }
1781
+
1782
+ isESRouterSupported() {
1783
+ return ESManager$1.getESSDKVersionCode() > 800;
1784
+ }
1785
+
1786
+ launchNativeApp(paramsArray) {
1787
+ ESModule$1.launchNativeApp(paramsArray);
1788
+ }
1789
+
1790
+ launchNativePage(intent) {
1791
+ ESModule$1.launchESPage({
1792
+ args: intent
1793
+ });
1794
+ }
1795
+
1796
+ launchESPage(intent) {
1797
+ //
1798
+ if (this.isESRouterEnabled() && this._ESRouter
1799
+ && this.isESRouterSupported()) {
1800
+ this._ESRouter.push({
1801
+ name: intent.url,
1802
+ params: intent.params,
1803
+ });
1804
+ }
1805
+ //
1806
+ else {
1807
+ this.launchNativePage(intent);
1808
+ }
1809
+ }
1810
+
1811
+ finishAllESPage() {
1812
+ ESModule$1.finishAll();
1813
+ }
1814
+
1815
+ finishESPage() {
1816
+ if (this.isESRouterEnabled() && this._ESRouter
1817
+ && this._ESRouter.back()) ;
1818
+ //
1819
+ else {
1820
+ ESModule$1.finish();
1821
+ }
1822
+ }
1823
+ }
1824
+
1825
+ var ESLaunchManager$1 = new ESLaunchManager();
1826
+
1786
1827
  /**
1787
1828
  *
1788
1829
  */
@@ -2607,22 +2648,23 @@ var ESBackPressMixin = {
2607
2648
 
2608
2649
  mounted() {
2609
2650
  Vue.Native.callNative('DeviceEventModule', 'setListenBackPress', true);
2610
- ESApp.$on('hardwareBackPress', this.onAndroidBackPressed);
2651
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2652
+ ESApp.$on('hardwareBackPress', this.onESBackPressed);
2653
+ }
2611
2654
  },
2612
2655
  beforeDestroy() {
2613
- ESApp.$off('hardwareBackPress', this.onAndroidBackPressed);
2656
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2657
+ ESApp.$off('hardwareBackPress', this.onESBackPressed);
2658
+ }
2614
2659
  },
2615
2660
 
2616
2661
  methods: {
2617
- onAndroidBackPressed() {
2662
+ onESBackPressed() {
2618
2663
  this.onBackPressed();
2619
2664
  },
2620
2665
  onBackPressed() {
2621
2666
 
2622
2667
  },
2623
- invokeAndroidBackPress() {
2624
- Vue.Native.callNative('DeviceEventModule', 'invokeDefaultBackPressHandler');
2625
- }
2626
2668
  },
2627
2669
  };
2628
2670
 
@@ -2637,14 +2679,18 @@ const KEY_ACTION_UP = 1;
2637
2679
  var ESKeyEventMixin = {
2638
2680
 
2639
2681
  mounted() {
2640
- ESApp.$on('DispatchKeyEvent', this.onAndroidKeyEvent);
2682
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2683
+ ESApp.$on('DispatchKeyEvent', this.onDispatchKeyEvent);
2684
+ }
2641
2685
  },
2642
2686
  beforeDestroy() {
2643
- ESApp.$off('DispatchKeyEvent', this.onAndroidKeyEvent);
2687
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2688
+ ESApp.$off('DispatchKeyEvent', this.onDispatchKeyEvent);
2689
+ }
2644
2690
  },
2645
2691
 
2646
2692
  methods: {
2647
- onAndroidKeyEvent(keyEvent) {
2693
+ onDispatchKeyEvent(keyEvent) {
2648
2694
  if (keyEvent.action === KEY_ACTION_DOWN) {
2649
2695
  this.onKeyDown(keyEvent);
2650
2696
  }
@@ -2669,16 +2715,20 @@ var ESKeyEventMixin = {
2669
2715
  */
2670
2716
  var ESLifecycleMixin = {
2671
2717
  mounted() {
2672
- ESApp.$on('OnNewIntent', this.onActivityNewIntent);
2673
- ESApp.$on('LifecycleChange', this.onActivityLifecycle);
2718
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2719
+ ESApp.$on('OnNewIntent', this.onESLifecycleNewIntent);
2720
+ ESApp.$on('LifecycleChange', this.onESLifecycleChanged);
2721
+ }
2674
2722
  },
2675
2723
  beforeDestroy() {
2676
- ESApp.$off('OnNewIntent', this.onActivityNewIntent);
2677
- ESApp.$off('LifecycleChange', this.onActivityLifecycle);
2724
+ if (!ESLaunchManager$1.isESRouterEnabled()) {
2725
+ ESApp.$off('OnNewIntent', this.onESLifecycleNewIntent);
2726
+ ESApp.$off('LifecycleChange', this.onESLifecycleChanged);
2727
+ }
2678
2728
  },
2679
2729
 
2680
2730
  methods: {
2681
- onActivityLifecycle(event) {
2731
+ onESLifecycleChanged(event) {
2682
2732
  if (event === 'onResume') {
2683
2733
  this.onESResume();
2684
2734
  }
@@ -2695,7 +2745,7 @@ var ESLifecycleMixin = {
2695
2745
  this.onESDestroy();
2696
2746
  }
2697
2747
  },
2698
- onActivityNewIntent(intent) {
2748
+ onESLifecycleNewIntent(intent) {
2699
2749
  this.onESNewIntent(intent);
2700
2750
  },
2701
2751
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extscreen/es-core",
3
- "version": "10000.0.1",
3
+ "version": "10000.0.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {