@shijiu/jsview-vue 0.9.684 → 0.9.783

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.
Files changed (154) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/bin/jsview-engine-js-browser.min.js +1 -1
  4. package/dom/bin/jsview-forge-define.min.js +1 -1
  5. package/dom/jsv-engine-js-browser.js +6 -0
  6. package/dom/target_core_revision.js +4 -4
  7. package/loader/loader.js +4 -0
  8. package/package.json +1 -1
  9. package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
  10. package/samples/AnimPicture/App.vue +5 -5
  11. package/samples/Basic/components/div/DivLayout.vue +1 -1
  12. package/samples/Basic/components/img/ImageGroup.vue +2 -2
  13. package/samples/Basic/components/img/ImgLayout.vue +79 -15
  14. package/samples/Basic/components/text/TextDirection.vue +104 -0
  15. package/samples/Basic/components/text/TextEmoji.vue +1 -1
  16. package/samples/Basic/components/text/TextGroup1.vue +1 -1
  17. package/samples/Basic/components/text/TextGroup2.vue +11 -1
  18. package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
  19. package/samples/Collision/App.vue +11 -11
  20. package/samples/DemoHomepage/App.vue +67 -8
  21. package/samples/DemoHomepage/components/TabFrame.vue +7 -0
  22. package/samples/DemoHomepage/router.js +27 -26
  23. package/samples/DemoHomepage/views/Homepage.vue +89 -98
  24. package/samples/FilterDemo/App.vue +1 -1
  25. package/samples/FlipCard/App.vue +2 -2
  26. package/samples/FlipCard/FlipCard.vue +3 -3
  27. package/samples/FocusBlockDemos/AutoFocus/App.vue +51 -0
  28. package/samples/FocusBlockDemos/AutoFocus/BaseBlock.vue +82 -0
  29. package/samples/FocusBlockDemos/AutoFocus/DialogBlock.vue +89 -0
  30. package/samples/FocusBlockDemos/AutoFocus/DialogContorls.js +42 -0
  31. package/samples/FocusBlockDemos/AutoFocus/FocusNamesDefine.js +9 -0
  32. package/samples/FocusBlockDemos/AutoFocus/PlaneBlock.vue +71 -0
  33. package/samples/FocusBlockDemos/ProgressiveFocusControl/App.vue +78 -0
  34. package/samples/FocusBlockDemos/ProgressiveFocusControl/BaseBlock.vue +77 -0
  35. package/samples/FocusBlockDemos/ProgressiveFocusControl/DownPlaneBlock.vue +83 -0
  36. package/samples/FocusBlockDemos/ProgressiveFocusControl/FocusNamesDefine.js +12 -0
  37. package/samples/FocusBlockDemos/ProgressiveFocusControl/UpPlaneBlock.vue +83 -0
  38. package/samples/GridDemo/App.vue +3 -3
  39. package/samples/GridDemo/ButtonBlock.vue +2 -2
  40. package/samples/GridDemo/FocusItem.vue +2 -2
  41. package/samples/GridDemo/Item.vue +1 -1
  42. package/samples/HashHistory/App.vue +10 -3
  43. package/samples/HashHistory/components/Item.vue +1 -1
  44. package/samples/ImpactStop/App.vue +15 -11
  45. package/samples/Input/InputPanel.vue +1 -1
  46. package/samples/LongImage/Button.vue +1 -1
  47. package/samples/LongImage/ButtonItem.vue +1 -1
  48. package/samples/LongImage/LongImageScroll.vue +2 -2
  49. package/samples/LongText/App.vue +1 -1
  50. package/samples/LongText/Button.vue +1 -1
  51. package/samples/LongText/ButtonItem.vue +1 -1
  52. package/samples/LongText/LongTextScroll.vue +3 -3
  53. package/samples/Marquee/App.vue +34 -3
  54. package/samples/Marquee/longText.js +2 -2
  55. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
  56. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
  57. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
  58. package/samples/MetroWidgetDemos/PingPong/App.vue +22 -11
  59. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +5 -5
  60. package/samples/MetroWidgetDemos/{Item.vue → PingPong/Item.vue} +3 -21
  61. package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
  62. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +5 -5
  63. package/samples/MetroWidgetDemos/{WidgetItem.vue → PingPong/WidgetItem.vue} +8 -4
  64. package/samples/MetroWidgetDemos/basic/App.vue +162 -0
  65. package/samples/MetroWidgetDemos/basic/Item.vue +43 -0
  66. package/samples/MetroWidgetDemos/direction/App.vue +158 -0
  67. package/samples/MetroWidgetDemos/direction/Item.vue +45 -0
  68. package/samples/MetroWidgetDemos/focusableItemBasic/App.vue +67 -0
  69. package/samples/MetroWidgetDemos/{Advanced → focusableItemBasic}/ButtonItem.vue +17 -21
  70. package/samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue +74 -0
  71. package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/Item.vue +13 -32
  72. package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/WidgetItem.vue +12 -12
  73. package/samples/MetroWidgetDemos/focusableItemMix/App.vue +88 -0
  74. package/samples/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +86 -0
  75. package/samples/MetroWidgetDemos/focusableItemMix/Item.vue +43 -0
  76. package/samples/MetroWidgetDemos/index.js +6 -0
  77. package/samples/MetroWidgetDemos/layoutType/App.vue +180 -0
  78. package/samples/MetroWidgetDemos/layoutType/Item.vue +45 -0
  79. package/samples/MetroWidgetDemos/padding/App.vue +222 -0
  80. package/samples/MetroWidgetDemos/padding/Item.vue +64 -0
  81. package/samples/MetroWidgetDemos/routeList.js +64 -0
  82. package/samples/MetroWidgetDemos/slideSetting/App.vue +225 -0
  83. package/samples/MetroWidgetDemos/slideSetting/Item.vue +45 -0
  84. package/samples/NinePatchDemo/App.vue +78 -122
  85. package/samples/NinePatchDemo/Item.vue +29 -27
  86. package/samples/Preload/App.vue +1 -1
  87. package/samples/Preload/Item.vue +1 -1
  88. package/samples/QrcodeDemo/App.vue +1 -1
  89. package/samples/SoundPool/App.vue +3 -3
  90. package/samples/SpriteImage/App.vue +5 -0
  91. package/samples/Swiper/App.vue +148 -0
  92. package/samples/TextBox/App.vue +2 -1
  93. package/samples/TextureAnimation/App2.vue +1 -1
  94. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
  95. package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
  96. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  97. package/samples/TransitPage/App.vue +1 -1
  98. package/samples/VideoDemo/App.vue +8 -8
  99. package/samples/VideoDemo/components/Button.vue +1 -1
  100. package/samples/VideoDemo/components/Controllor.vue +1 -1
  101. package/samples/VisibleSensorDemo/App.vue +3 -3
  102. package/scripts/jsview-run-android.js +5 -4
  103. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
  104. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +79 -50
  105. package/utils/JsViewEngineWidget/TemplateParser.js +144 -147
  106. package/utils/JsViewEngineWidget/WidgetCommon.js +12 -3
  107. package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
  108. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
  109. package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
  110. package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
  111. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
  112. package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
  113. package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
  114. package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
  115. package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
  116. package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
  117. package/utils/JsViewPlugin/JsvPlayer/index.js +1 -1
  118. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  119. package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
  120. package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
  121. package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
  122. package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
  123. package/utils/{JsViewVueWidget/utils/text.js → JsViewVueTools/JsvTextTools.js} +24 -4
  124. package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
  125. package/utils/JsViewVueTools/index.js +2 -1
  126. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
  127. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
  128. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
  129. package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
  130. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
  131. package/utils/JsViewVueWidget/JsvMarquee.vue +91 -20
  132. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
  133. package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
  134. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
  135. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
  136. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +116 -80
  137. package/utils/JsViewVueWidget/JsvSwiper/index.js +3 -2
  138. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
  139. package/utils/JsViewVueWidget/JsvTextBox.vue +11 -31
  140. package/utils/JsViewVueWidget/JsvTouchContainer.vue +2 -2
  141. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  142. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
  143. package/utils/JsViewVueWidget/index.js +8 -8
  144. package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
  145. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
  146. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
  147. package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
  148. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  149. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
  150. package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
  151. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
  152. package/samples/MetroWidgetDemos/data.js +0 -205
  153. package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +0 -35
  154. package/utils/JsViewVueWidget/utils/index.js +0 -8
@@ -0,0 +1,140 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-27 20:04:28
4
+ * @Description: file content
5
+ */
6
+ import PluginInfo from './version';
7
+
8
+ class PluginLoader {
9
+ constructor() {
10
+ this.onDoneListener = [];
11
+ this.pluginLoadListener = [];
12
+ this.pluginInfo = this.getPluginInfo();
13
+ /**
14
+ * 0:未加载;
15
+ * 1:开始加载;
16
+ * 2:加载旧插件;
17
+ * 3:加载新插件;
18
+ * 4:加载成功;
19
+ * 5:加载失败。
20
+ */
21
+ this.status = 0;
22
+ }
23
+
24
+ getPluginInfo() {
25
+ let info = PluginInfo;
26
+ /** 获取下载链接 */
27
+ if (typeof window.jJsvRuntimeBridge !== 'undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
28
+ let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
29
+ if (plugin_base_url) {
30
+ info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : (plugin_base_url + "/")) + info.packageName + "/JsvAudio-" + info.versionCodeMax + ".dat?md5=" + info.md5;
31
+ }
32
+ }
33
+ return info;
34
+ }
35
+
36
+ registerOnDoneListener(listener) {
37
+ if (listener) {
38
+ this.onDoneListener.push(listener);
39
+ }
40
+ }
41
+
42
+ /**
43
+ * listener回调处理中参数信息的说明:
44
+ * 插件加载状态回调。
45
+ * 回调函数的参数定义如下:
46
+ * 1:无法正常加载插件。
47
+ * 2:正在加载旧插件,此时插件加载过程很短,可以不用出现用户提示界面。
48
+ * 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
49
+ * 4:插件加载完成。
50
+ * 5:已加载不同版本的插件,此版本无法加载。
51
+ *
52
+ * 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
53
+ */
54
+ loadPlugin(listener) {
55
+ console.log("globalLoadJsvAudioPlugin");
56
+ let plugin_status = 0;
57
+ if (typeof window.jPluginManagerBridge === 'undefined' || !window.jPluginManagerBridge) {
58
+ plugin_status = 1;
59
+ } else if (this.status === 2) {
60
+ plugin_status = 2;
61
+ } else if (this.status === 3) {
62
+ plugin_status = 3;
63
+ } else if (this.status === 4) {
64
+ plugin_status = 4;
65
+ } else if (this.status === 5) {
66
+ plugin_status = 1;
67
+ }
68
+
69
+ if (plugin_status !== 0) {
70
+ if (typeof listener !== "undefined" && listener) {
71
+ setTimeout(() => { listener(plugin_status) }, 0);
72
+ }
73
+ return;
74
+ }
75
+
76
+ if (typeof listener !== "undefined" && listener) {
77
+ this.pluginLoadListener.push(listener);
78
+ }
79
+
80
+ if (this.status > 0) {
81
+ return;
82
+ }
83
+ this.status = 1;
84
+
85
+ window.jPluginManagerBridge.LoadPlugin(JSON.stringify(this.pluginInfo));
86
+ }
87
+
88
+ onStatusChange(status) {
89
+ console.log("JsvAudioPluginStatus: " + status);
90
+ let ret = JSON.parse(status);
91
+
92
+ let plugin_status = 2;
93
+ if (ret && ret.first_load) {
94
+ this.status = 3;
95
+ plugin_status = 3;
96
+ } else {
97
+ this.status = 2;
98
+ }
99
+
100
+ for (let i = 0; i < this.pluginLoadListener.length; i++) {
101
+ this.pluginLoadListener[i](plugin_status);
102
+ }
103
+ }
104
+
105
+ onLoadDone(result) {
106
+ console.log("JsvAudioPluginLoadResult: " + result);
107
+ let ret_obj = JSON.parse(result)
108
+ let plugin_status = 1;
109
+ if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
110
+ this.status = 4;
111
+ plugin_status = 4;
112
+ } else if (ret_obj && ret_obj.status === -12) {
113
+ this.status = 5;
114
+ plugin_status = 5;
115
+ } else {
116
+ this.status = 5;
117
+ }
118
+
119
+ if (this.status === 5) {
120
+ console.log("*************************JsvAudio plugin load failed, error code is " + ret_obj.status + "*************************");
121
+ }
122
+
123
+ for (let i = 0; i < this.pluginLoadListener.length; i++) {
124
+ this.pluginLoadListener[i](plugin_status);
125
+ }
126
+
127
+ for (let listener of this.onDoneListener) {
128
+ listener(plugin_status);
129
+ }
130
+ }
131
+
132
+ registerGlobalListener() {
133
+ window.top.JsvAudioPluginStatus = this.onStatusChange.bind(this);
134
+ window.top.JsvAudioPluginLoadResult = this.onLoadDone.bind(this);
135
+ }
136
+ }
137
+
138
+ const sPluginLoader = new PluginLoader();
139
+ sPluginLoader.registerGlobalListener();
140
+ export default sPluginLoader;
@@ -0,0 +1,26 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-28 10:18:42
4
+ * @Description: file content
5
+ */
6
+ import sPluginLoader from "./PluginLoader.js";
7
+ import JsvAudio from "./JsvAudio.vue"
8
+
9
+ let globalLoadJsvAudioPlugin;
10
+ let _JsvAudio;
11
+ if (window.JsvWidgetWrapperGroup?.BrowserJsvAudio) {
12
+ //browser
13
+ globalLoadJsvAudioPlugin = (listener) => {
14
+ setTimeout(listener, 0);
15
+ };
16
+ _JsvAudio = window.JsvWidgetWrapperGroup.BrowserJsvAudio.default;
17
+ } else {
18
+ //jsview
19
+ globalLoadJsvAudioPlugin = sPluginLoader.loadPlugin.bind(sPluginLoader);
20
+ _JsvAudio = JsvAudio;
21
+ }
22
+
23
+ export {
24
+ _JsvAudio as default,
25
+ globalLoadJsvAudioPlugin,
26
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-22 18:22:26
4
+ * @Description: file content
5
+ */
6
+ let PluginInfo={
7
+ // downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
8
+ packageName:"com.qcode.jsvaudio",
9
+ name:"音频插件",
10
+ version:"1.0.1", //插件需要的版本号
11
+ versionCodeMin:1,
12
+ versionCodeMax:1,
13
+ bridgeName:"jsvAudioBridge", //插件bridge注册到jsview的名称
14
+ className:"com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
15
+ initMethod:"createInstance", //插件初始化方法
16
+ listener:"top.JsvAudioPluginLoadResult", //插件加载结果回调
17
+ listener2: "top.JsvAudioPluginStatus",
18
+ // debug:true,
19
+ // md5:"baafc8ea737adcad5443f44cc0112498"
20
+ };
21
+
22
+ // 不要用export default,update-env脚本不能解析
23
+ // 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
24
+ module.exports = PluginInfo;
@@ -36,7 +36,7 @@ if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
36
36
  }
37
37
 
38
38
  globalLoadSetOperator = (operator)=>{
39
-
39
+ console.log("operator is "+operator);
40
40
  }
41
41
  }
42
42
 
@@ -1,17 +1,17 @@
1
1
  let PluginInfo={
2
- // downloadUrl:"http://192.168.0.63:8080/plugin/JsvPlayer-164.zip", //插件下载地址
2
+ // downloadUrl:"http://10.61.2.170:8080/plugin/JsvPlayer-194.zip", //插件下载地址
3
3
  packageName:"com.qcode.jsvplayer",
4
4
  name:"播放器插件",
5
- version:"1.8.5", //插件需要的版本号
6
- versionCodeMin:185,
7
- versionCodeMax:185,
5
+ version:"1.9.8", //插件需要的版本号
6
+ versionCodeMin:198,
7
+ versionCodeMax:198,
8
8
  bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
9
9
  className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
10
10
  initMethod:"createInstance", //插件初始化方法
11
11
  listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
12
12
  listener2: "top.JsvPlayerPluginStatus",
13
13
  // debug:true,
14
- md5:"7419da6cf1d0fd294540044e90d1a0e7"
14
+ md5:"2e7ee4fa5776346ecf2d4cecf002d74c"
15
15
  };
16
16
 
17
17
  // 不要用export default,update-env脚本不能解析
@@ -1,8 +1,8 @@
1
- import { createMemoryHistory, createWebHashHistory } from "vue-router";
1
+ import { createMemoryHistory, createWebHashHistory } from "vue-router";
2
2
 
3
3
  class JsvHashHistory {
4
4
  constructor(base) {
5
- if(window.jsvIsBrowserDebug) {
5
+ if (window.jsvIsBrowserDebug) {
6
6
  this.#history = createWebHashHistory(base)
7
7
  } else {
8
8
  this.#history = this.#createMockHashHistory(base);
@@ -32,7 +32,7 @@ class JsvHashHistory {
32
32
  replace(to, data) {
33
33
  this.#history.replace(to, data);
34
34
  this.#updateLocation(this.#history.location);
35
- }
35
+ }
36
36
 
37
37
  push(to, data) {
38
38
  this.#history.push(to, data);
@@ -52,20 +52,23 @@ class JsvHashHistory {
52
52
  // 抄 createWebHashHistory 作业
53
53
  base = location.host ? base || location.pathname + location.search : '';
54
54
  if (!base.includes('#'))
55
- base += '#';
55
+ base += '#';
56
56
  if (!base.endsWith('#/') && !base.endsWith('#')) {
57
- console.warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, '#')}".`);
57
+ console.warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, '#')}".`);
58
58
  }
59
59
 
60
60
  this.baseURL = window.location.origin + base;
61
61
 
62
62
  const history = createMemoryHistory(base)
63
63
  const initHash = this.#getInitHash();
64
- if(initHash) {
64
+ if (initHash) {
65
65
  // 已设置hash,替换到hash页面
66
66
  history.replace({
67
67
  path: initHash.substring(1),// 去除#
68
- query: window.location.search
68
+
69
+ // 测试链接: http://192.168.2.179:8082/js/main.jsv.js?bcd=333&xyz=456#/feature/Basic?aa=1&bb=2
70
+ // App 中获取的 router.currentRoute.query的内容为 {aa:1, bb:2}
71
+ query: this.#splitSearch(window.location.hash)
69
72
  });
70
73
  } else {
71
74
  // 未设置hash定位,追加hash根的显示
@@ -95,7 +98,7 @@ class JsvHashHistory {
95
98
  }
96
99
 
97
100
  #updateLocation(location) {
98
- if(!window.jsvIsBrowserDebug) {
101
+ if (!window.jsvIsBrowserDebug) {
99
102
  const url = new window.JsView.Dom.UrlRef(
100
103
  location ? this.baseURL + location : this.baseURL,
101
104
  true
@@ -104,6 +107,29 @@ class JsvHashHistory {
104
107
  }
105
108
  }
106
109
 
110
+ #splitSearch(hash) {
111
+ if (!hash || hash.length == 0) {
112
+ return {};
113
+ } else {
114
+ let hashSearchIndex = hash.indexOf('?');
115
+ if (hashSearchIndex >= 0) {
116
+ let arr = hash.substr(hashSearchIndex + 1).split('&');
117
+ let target = {};
118
+ for (let i = 0; i < arr.length; i++) {
119
+ let num = arr[i].indexOf("=");
120
+ if (num > 0) {
121
+ let name = arr[i].substring(0, num);
122
+ let value = arr[i].substr(num + 1);
123
+ target[name] = value;
124
+ }
125
+ }
126
+ return target;
127
+ } else {
128
+ return {};
129
+ }
130
+ }
131
+ }
132
+
107
133
  #history;
108
134
  }
109
135
 
@@ -40,7 +40,7 @@ function createImpactCallback(on_contact, on_dis_contact) {
40
40
  * Object 句柄,提供 Recycle() 函数用于停止碰撞检测,需要再componentWillUnmount进行调用(清理)
41
41
  */
42
42
  function createImpactTracer(ele1, ele2, callback, auto_froze) {
43
- return Forge.sImpactSensorManager.StartTrace(ele1.jsvMainView, ele2.jsvMainView, callback, auto_froze);
43
+ return Forge.sImpactSensorManager.StartTrace(ele1.jsvGetProxyView(), ele2.jsvGetProxyView(), callback, auto_froze);
44
44
  }
45
45
 
46
46
  // 创建用于设置碰撞即停管理对象的参数
@@ -49,7 +49,7 @@ function _ConvertToViewsList(elements_array) {
49
49
  const views_array = [];
50
50
  if (elements_array) {
51
51
  for (const ele of elements_array) {
52
- views_array.push(ele.jsvMainView);
52
+ views_array.push(ele.jsvGetProxyView());
53
53
  }
54
54
  }
55
55
  return views_array;
@@ -96,10 +96,10 @@ function getAndroidId(){
96
96
  */
97
97
  function openWindow(url, startup_image, startup_video, startup_duration, add_history){
98
98
  let setting = {};
99
- if(startup_image !== null && startup_image !== "")
99
+ if(typeof startup_image !== undefined && startup_image !== null && startup_image !== "")
100
100
  setting.startupImage = startup_image;
101
101
 
102
- if(startup_video !== null && startup_video !== ""){
102
+ if(typeof startup_video !== undefined && startup_video !== null && startup_video !== ""){
103
103
  setting.startupVideo = startup_video;
104
104
  }
105
105
 
@@ -148,27 +148,50 @@ function getInstalledApps(){
148
148
  */
149
149
  function startNativeApp(package_name, activity, action, uri, flags, param){
150
150
  var obj = {};
151
- if(package_name !== null && package_name !== "")
151
+ if(typeof package_name != undefined && package_name !== null && package_name !== "")
152
152
  obj.packageName = package_name;
153
153
 
154
- if(activity !== null && activity !== "")
154
+ if(typeof activity != undefined && activity !== null && activity !== "")
155
155
  obj.activity = activity;
156
156
 
157
- if(action !== null && action !== "")
157
+ if(typeof action != undefined && action !== null && action !== "")
158
158
  obj.action = action;
159
159
 
160
- if(uri !== null && uri !== "")
160
+ if(typeof uri != undefined && uri !== null && uri !== "")
161
161
  obj.uri = uri;
162
162
 
163
- if(flags !== null && flags.length > 0)
163
+ if(typeof flags != undefined && flags !== null && flags.length > 0)
164
164
  obj.flags = flags;
165
165
 
166
- if(param !== null && param.length > 0)
166
+ if(typeof param != undefined && param !== null && param.length > 0)
167
167
  obj.param = param;
168
168
 
169
169
  direct_call("startNativeApp", JSON.stringify(obj));
170
170
  }
171
171
 
172
+ function sendNativeBroadcast(package_name, broadcast, action, uri, flags, param){
173
+
174
+ var obj = {};
175
+ if(typeof package_name != undefined && package_name !== null && package_name !== "")
176
+ obj.packageName = package_name;
177
+
178
+ if(typeof broadcast != undefined && broadcast !== null && broadcast !== "")
179
+ obj.broadcast = broadcast;
180
+
181
+ if(typeof action != undefined && action !== null && action !== "")
182
+ obj.action = action;
183
+
184
+ if(typeof uri != undefined && uri !== null && uri !== "")
185
+ obj.uri = uri;
186
+
187
+ if(typeof flags != undefined && flags !== null && flags.length > 0)
188
+ obj.flags = flags;
189
+
190
+ if(typeof param != undefined && param !== null && param.length > 0)
191
+ obj.param = param;
192
+ direct_call("sendNativeBroadcast", JSON.stringify(obj));
193
+ }
194
+
172
195
  /**
173
196
  * 获取设备信息
174
197
  * @returns {string} 终端设备信息,JSON数据结构
@@ -178,6 +201,14 @@ function getDeviceInfo() {
178
201
  return direct_call("getDeviceInfo");
179
202
  }
180
203
 
204
+ /**
205
+ * 获取自己的app信息
206
+ * @returns
207
+ */
208
+ function getAppInfo(){
209
+ return direct_call("getAppInfo");
210
+ }
211
+
181
212
  /**
182
213
  * 页面加载成功后调用去除启动图
183
214
  *
@@ -335,6 +366,10 @@ function popupGainFocus() {
335
366
  direct_call("popupGainFocus");
336
367
  }
337
368
 
369
+ function popupDiscardFocus(){
370
+ direct_call("popupGainFocus");
371
+ }
372
+
338
373
  /**
339
374
  * 页面预热接口,预热页面将会将以一个新的FrameLayout(内含JsView)的方式加载一个新的应用
340
375
  * 但这个应用在warmLoadView之前,不会创建texture/surface的实际描画资源,也不会加载图片
@@ -398,7 +433,9 @@ const bridge = {
398
433
  getSystemProperty,
399
434
  getInstalledApps,
400
435
  startNativeApp,
436
+ sendNativeBroadcast,
401
437
  getDeviceInfo,
438
+ getAppInfo,
402
439
  notifyPageLoadDone,
403
440
  notifyPageLoaded,
404
441
  hasFavouriteFunction,
@@ -410,6 +447,7 @@ const bridge = {
410
447
  setPopupInitSize,
411
448
  popupResizePosition,
412
449
  popupGainFocus,
450
+ popupDiscardFocus,
413
451
  warmUpView,
414
452
  warmLoadView,
415
453
  closeWarmedView
@@ -233,6 +233,7 @@ class JsvTextStyleClass extends JsvStyleClass {
233
233
  this.jsvTextAttributes = {
234
234
  jsv_text_line_align: "middle", // 文字行内垂直对齐方式
235
235
  jsv_text_vertical_align: "top", // 文字区域内垂直对齐方式
236
+ jsv_text_ellipsis: "end", //文字省略部分
236
237
  };
237
238
  }
238
239
 
@@ -244,6 +245,10 @@ class JsvTextStyleClass extends JsvStyleClass {
244
245
  this.jsvTextAttributes.jsv_text_line_align = new_align;
245
246
  }
246
247
 
248
+ setEllipsis(new_ellipsis) {
249
+ this.jsvTextAttributes.jsv_text_ellipsis = new_ellipsis;
250
+ }
251
+
247
252
  // 注意:此接口仅提供给JsViewReactWidget中的hoc调用,
248
253
  getVerticalAlign() {
249
254
  return this.jsvTextAttributes.jsv_text_vertical_align;
@@ -254,6 +259,10 @@ class JsvTextStyleClass extends JsvStyleClass {
254
259
  return this.jsvTextAttributes.jsv_text_line_align;
255
260
  }
256
261
 
262
+ getEllipsis() {
263
+ return this.jsvTextAttributes.jsv_text_ellipsis;
264
+ }
265
+
257
266
  // Override
258
267
  classType() {
259
268
  return CONST_TYPE_TEXT;
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: ChenChanghua
3
- * @Date: 2022-11-09 15:18:43
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-11-10 15:02:54
3
+ * @Date: 2022-11-29 14:26:20
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2023-03-09 13:34:59
6
6
  * @Description: file content
7
7
  */
8
8
  const getTextWidth = (text, style) => {
@@ -16,4 +16,24 @@ const getTextWidth = (text, style) => {
16
16
  return window.PlatformUtils.GetTextWidth(textParams);
17
17
  };
18
18
 
19
- export { getTextWidth };
19
+ const isRtl = (str) => {
20
+ //arabic
21
+ for (let i = 0; i < str.length; i++) {
22
+ let c = str.charCodeAt(i);
23
+ if (c != 32) {
24
+ if (c >= 0x0600 && c <= 0x06ff) {
25
+ return true;
26
+ } else {
27
+ return false;
28
+ }
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+
34
+ const TextTools = {
35
+ getTextWidth,
36
+ isRtl,
37
+ }
38
+
39
+ export { getTextWidth, TextTools };
@@ -1,9 +1,9 @@
1
1
  var number_convert_tmp = new Float32Array(1);
2
2
 
3
3
  function numberCheckSet(number) {
4
- number_convert_tmp = number; // 强制类型转换, 避免JSON化时类型出错,因为 '123' 123 都能通过Nan检测
5
- if (!isNaN(number_convert_tmp)) {
6
- return number_convert_tmp;
4
+ number_convert_tmp[0] = number; // 强制类型转换, 避免JSON化时类型出错,因为 '123' 123 都能通过Nan检测
5
+ if (!isNaN(number_convert_tmp[0])) {
6
+ return number_convert_tmp[0];
7
7
  } else {
8
8
  console.warn(`${number} is not type of number, default as 0`);
9
9
  return 0;
@@ -2,7 +2,7 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-07-05 14:09:55
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-08-30 10:58:14
5
+ * @LastEditTime: 2022-11-29 14:34:45
6
6
  * @Description: file content
7
7
  */
8
8
 
@@ -17,4 +17,5 @@ export * from "./JsvStyleClass.js";
17
17
  export * from "./DebugContentShellJBridge.js";
18
18
  export * from "./DebugTool.js";
19
19
  export * from "./JsvImpactTracer.js";
20
+ export * from "./JsvTextTools.js";
20
21
  export { default as DefaultKeyCodeMap } from "./DefaultKeyMap.js";
@@ -2,11 +2,10 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-02-08 09:29:17
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-08-22 16:00:50
5
+ * @LastEditTime: 2022-11-24 10:15:37
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { ref } from "vue";
10
9
  import { getKeyFramesGroup } from "jsview/utils/JsViewVueTools/JsvDynamicKeyFrames";
11
10
 
12
11
  const DECORATE_BORDER_RADIUS = "BroderRaidus";
@@ -102,7 +101,7 @@ export default {
102
101
  type: Object,
103
102
  },
104
103
  },
105
- setup(props) {
104
+ setup() {
106
105
  let styleShell = getKeyFramesGroup();
107
106
  return {
108
107
  styleShell,
@@ -205,15 +204,14 @@ export default {
205
204
  overflow: 'hidden',
206
205
  };
207
206
  }
208
- } else {
209
- return {
207
+ }
208
+ return {
210
209
  left: this.left + "px",
211
210
  top: this.top + "px",
212
211
  width: this.width + "px",
213
212
  height: this.height + "px",
214
213
  overflow: 'hidden',
215
214
  };
216
- }
217
215
  },
218
216
  },
219
217
  methods: {
@@ -250,7 +248,7 @@ export default {
250
248
 
251
249
  this.animDiv.appendChild(imgDiv);
252
250
  clipDiv.appendChild(this.animDiv);
253
- this.$refs.root.jsvMaskView.Element.appendChild(clipDiv);
251
+ this.$refs.root.jsvGetProxyView(true).Element.appendChild(clipDiv);
254
252
 
255
253
  this.watcherHandlerList.push(
256
254
  this.$watch("left", (newValue) => {
@@ -33,32 +33,30 @@
33
33
  * 功能:暂停动画,并将JsvActorMove保持在暂停的位置上
34
34
 
35
35
  -->
36
- <script>
36
+ <script setup>
37
37
  import JsvActorMoveControl from "./JsvActorMoveControl";
38
- export default {
39
- props: {
40
- control: {
41
- type: JsvActorMoveControl,
42
- required: true,
43
- },
44
- refDefine: Object,
45
- },
46
- mounted() {
47
- this.control._SetView(this.$refs.element.jsvMainView);
48
- if (this.refDefine) {
49
- const type = typeof this.refDefine;
50
- if (type === "object") {
51
- this.refDefine.current = this.$refs.element;
52
- } else if (type === "function") {
53
- this.refDefine(this.$refs.element);
54
- }
55
- }
38
+ import { shallowRef, onMounted } from "vue";
39
+
40
+ const props = defineProps({
41
+ control: {
42
+ type: JsvActorMoveControl,
43
+ required: true,
56
44
  },
57
- };
45
+ });
46
+
47
+ let mainDivRef = shallowRef(null);
48
+
49
+ onMounted(() => {
50
+ props.control._SetView(mainDivRef.value.jsvGetProxyView());
51
+ });
52
+
53
+ defineExpose({
54
+ mainDiv: mainDivRef,
55
+ });
58
56
  </script>
59
57
 
60
58
  <template>
61
- <div ref="element">
59
+ <div ref="mainDivRef">
62
60
  <slot></slot>
63
61
  </div>
64
- </template>
62
+ </template>
@@ -68,7 +68,7 @@ export default {
68
68
  methods: {
69
69
  play() {
70
70
  if (this.$refs.element) {
71
- let main_view = this.$refs.element.jsvMainView;
71
+ let main_view = this.$refs.element.jsvGetProxyView();
72
72
  if (main_view && main_view.ChildViews.length > 0) {
73
73
  let target_view = main_view.ChildViews[0];
74
74
  if (
@@ -106,7 +106,7 @@ export default {
106
106
  },
107
107
  stop() {
108
108
  if (this.$refs.element) {
109
- let main_view = this.$refs.element.jsvMainView;
109
+ let main_view = this.$refs.element.jsvGetProxyView();
110
110
  if (main_view && main_view.ChildViews.length > 0) {
111
111
  let target_view = main_view.ChildViews[0];
112
112
  if (
@@ -130,7 +130,7 @@ export default {
130
130
  }
131
131
  if (this.onLoad) {
132
132
  if (this.$refs.element) {
133
- let main_view = this.$refs.element.jsvMainView;
133
+ let main_view = this.$refs.element.jsvGetProxyView();
134
134
  if (main_view && main_view.ChildViews.length > 0) {
135
135
  let target_view = main_view.ChildViews[0];
136
136
  if (
@@ -151,7 +151,7 @@ export default {
151
151
  beforeUnmount() {
152
152
  this.stop();
153
153
  if (this.$refs.element) {
154
- let main_view = this.$refs.element.jsvMainView;
154
+ let main_view = this.$refs.element.jsvGetProxyView();
155
155
  if (main_view && main_view.ChildViews.length > 0) {
156
156
  let target_view = main_view.ChildViews[0];
157
157
  if (