@shijiu/jsview-vue 1.9.650 → 1.9.720

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 (157) hide show
  1. package/package.json +7 -18
  2. package/samples/AnimPicture/App.vue +5 -5
  3. package/samples/Basic/components/div/DivLayout.vue +1 -1
  4. package/samples/Basic/components/text/TextOverflow.vue +10 -5
  5. package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
  6. package/samples/Collision/App.vue +452 -0
  7. package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
  8. package/samples/DemoHomepage/router.js +21 -1
  9. package/samples/DemoHomepage/views/Homepage.vue +3 -7
  10. package/samples/FilterDemo/App.vue +1 -1
  11. package/samples/FlipCard/App.vue +2 -2
  12. package/samples/FlipCard/FlipCard.vue +2 -2
  13. package/samples/GridDemo/App.vue +3 -3
  14. package/samples/GridDemo/ButtonBlock.vue +2 -2
  15. package/samples/GridDemo/FocusItem.vue +2 -2
  16. package/samples/GridDemo/Item.vue +1 -1
  17. package/samples/HashHistory/App.vue +10 -3
  18. package/samples/HashHistory/components/Item.vue +1 -1
  19. package/samples/ImpactStop/App.vue +435 -0
  20. package/samples/Input/App.vue +8 -17
  21. package/samples/Input/InputPanel.vue +19 -12
  22. package/samples/LongImage/Button.vue +1 -1
  23. package/samples/LongImage/ButtonItem.vue +1 -1
  24. package/samples/LongImage/LongImageScroll.vue +2 -2
  25. package/samples/LongText/App.vue +1 -1
  26. package/samples/LongText/Button.vue +1 -1
  27. package/samples/LongText/ButtonItem.vue +1 -1
  28. package/samples/LongText/LongTextScroll.vue +3 -3
  29. package/samples/Marquee/App.vue +176 -40
  30. package/samples/Marquee/longText.js +14 -0
  31. package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
  32. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +3 -3
  33. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
  34. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
  35. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
  36. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
  37. package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
  38. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  39. package/samples/MetroWidgetDemos/Item.vue +20 -2
  40. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
  41. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
  42. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +1 -1
  43. package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
  44. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
  45. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
  46. package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +3 -11
  47. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
  48. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
  49. package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
  50. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
  51. package/samples/MetroWidgetDemos/WidgetItem.vue +2 -2
  52. package/samples/MetroWidgetDemos/data.js +2 -1
  53. package/samples/NinePatchDemo/App.vue +2 -2
  54. package/samples/NinePatchDemo/Item.vue +1 -1
  55. package/samples/Preload/App.vue +17 -12
  56. package/samples/Preload/Item.vue +1 -1
  57. package/samples/QrcodeDemo/App.vue +1 -1
  58. package/samples/ScaleDownNeon/App.vue +107 -0
  59. package/samples/SoundPool/App.vue +1 -1
  60. package/samples/TextBox/App.vue +9 -82
  61. package/samples/TextBox/RenderCenter.vue +40 -16
  62. package/samples/TextBox/RenderLeft.vue +48 -19
  63. package/samples/TextBox/RenderOneLine.vue +30 -49
  64. package/samples/TextBox/RenderRight.vue +40 -16
  65. package/samples/TextShadowDemo/App.vue +11 -17
  66. package/samples/TextureAnimation/App2.vue +43 -15
  67. package/samples/TextureAnimation/assets/light.png +0 -0
  68. package/samples/TextureAnimation/assets/light2.png +0 -0
  69. package/samples/TextureSize/App.vue +3 -3
  70. package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
  71. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  72. package/samples/TransitPage/App.vue +1 -1
  73. package/samples/VideoDemo/App.vue +8 -8
  74. package/samples/VideoDemo/components/Button.vue +1 -1
  75. package/samples/VisibleSensorDemo/App.vue +94 -27
  76. package/tsconfig.json +6 -6
  77. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +55 -59
  78. package/utils/JsViewEngineWidget/JsvFocusManager.js +1 -1
  79. package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
  80. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +226 -107
  81. package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
  82. package/utils/JsViewEngineWidget/WidgetCommon.js +13 -5
  83. package/utils/JsViewEngineWidget/index.js +3 -2
  84. package/utils/JsViewPlugin/BrowserPluginLoader.js +1 -1
  85. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
  86. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +23 -2
  87. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +1 -1
  88. package/utils/JsViewPlugin/JsvPlayer/index.js +22 -1
  89. package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
  90. package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
  91. package/utils/JsViewVueTools/JsvStyleClass.js +1 -1
  92. package/utils/JsViewVueTools/index.js +2 -1
  93. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
  94. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
  95. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +7 -9
  96. package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
  97. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +3 -3
  98. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
  99. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
  100. package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
  101. package/utils/JsViewVueWidget/JsvGrid.vue +3 -11
  102. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +5 -3
  103. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +15 -14
  104. package/utils/JsViewVueWidget/JsvMarquee.vue +180 -207
  105. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -2
  106. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
  107. package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
  108. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +38 -42
  109. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
  110. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
  111. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +24 -8
  112. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
  113. package/utils/JsViewVueWidget/JsvTextBox.vue +20 -86
  114. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -9
  115. package/utils/JsViewVueWidget/JsvTouchContainer.vue +6 -7
  116. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  117. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +6 -6
  118. package/utils/JsViewVueWidget/index.js +8 -8
  119. package/utils/JsViewVueWidget/utils/index.js +8 -0
  120. package/utils/JsViewVueWidget/utils/text.js +19 -0
  121. package/dom/bin/jsview-browser-debug-dom.min.js +0 -1
  122. package/dom/bin/jsview-dom.min.js +0 -1
  123. package/dom/bin/jsview-forge-define.min.js +0 -1
  124. package/dom/browser-root-style.css +0 -21
  125. package/dom/jsv-browser-debug-dom.js +0 -8
  126. package/dom/jsv-dom.js +0 -6
  127. package/dom/jsv-forge-define.js +0 -6
  128. package/dom/target_core_revision.mjs +0 -15
  129. package/loader/header_script_loader.js +0 -134
  130. package/loader/jsview-main.js +0 -42
  131. package/loader/jsview.config.default.js +0 -37
  132. package/loader/jsview.default.config.js +0 -37
  133. package/loader/loader.js +0 -179
  134. package/loader/loader_webkit.js +0 -40
  135. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17609
  136. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -335
  137. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +0 -446
  138. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +0 -91
  139. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8038
  140. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1700
  141. package/patches/node_modules/postcss-js/objectifier.js +0 -90
  142. package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +0 -63147
  143. package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -53
  144. package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3595
  145. package/scripts/common.js +0 -58
  146. package/scripts/jsview-install-local-packages.js +0 -73
  147. package/scripts/jsview-jsmap-serve.js +0 -105
  148. package/scripts/jsview-post-build.js +0 -183
  149. package/scripts/jsview-post-install.js +0 -102
  150. package/scripts/jsview-run-android.js +0 -67
  151. package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
  152. package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
  153. package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
  154. package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
  155. package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
  156. package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
  157. package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
@@ -7,42 +7,51 @@
7
7
  * 例如`${window.JsView?.getJsContextId()}_${you_name}`
8
8
  -->
9
9
 
10
- <script>
11
- import { Forge, ForgeExtension } from "../../dom/jsv-forge-define";
10
+ <script>
11
+ import { Forge, ForgeExtension } from "../../../jsview/dom/jsv-forge-define";
12
12
 
13
13
  export default {
14
14
  props: {
15
15
  style: {
16
16
  type: Object,
17
- default: () => { return {} }
17
+ default: () => {
18
+ return {};
19
+ },
18
20
  },
19
21
  getId: Function,
20
22
  setId: String,
23
+ seeThrough: {
24
+ type: Boolean,
25
+ default: true,
26
+ },
21
27
  },
22
28
  setup() {
23
29
  return {
24
30
  isBrowserDebug: window.jsvIsBrowserDebug,
25
31
  jsvMainView: undefined,
26
32
  innerViewId: undefined,
27
- }
33
+ };
28
34
  },
29
35
  beforeMount() {
30
- if(this.isBrowserDebug) {
36
+ if (this.isBrowserDebug) {
31
37
  return;
32
38
  }
33
39
 
34
40
  // 初始化View
35
41
 
36
42
  // 创建JsView图层穿透的texture,抠洞处理
37
- const seeThroughTexture = ForgeExtension.TextureManager.GetColorTexture(
38
- "rgba(0,0,0,0)"
39
- );
40
- const textureSetting = new Forge.TextureSetting(
41
- seeThroughTexture,
42
- null,
43
- null,
44
- false
45
- );
43
+ // 默认为扣洞,有的场景不需要扣洞
44
+ let textureSetting = null;
45
+ if (this.seeThrough) {
46
+ const seeThroughTexture =
47
+ ForgeExtension.TextureManager.GetColorTexture("rgba(0,0,0,0)");
48
+ textureSetting = new Forge.TextureSetting(
49
+ seeThroughTexture,
50
+ null,
51
+ null,
52
+ false
53
+ );
54
+ }
46
55
 
47
56
  // 通过内置函数构造定制的NativeSharedView
48
57
  this.jsvMainView = new Forge.NativeSharedView(textureSetting);
@@ -51,7 +60,7 @@ export default {
51
60
  );
52
61
 
53
62
  // 更新宽高
54
- if(typeof this.jsvMainView!="undefined" && this.jsvMainView){
63
+ if (typeof this.jsvMainView != "undefined" && this.jsvMainView) {
55
64
  if (this.setId) {
56
65
  // 使用设置进来的track id,而非自动生成
57
66
  this.jsvMainView.SetTrackId(this.setId);
@@ -61,7 +70,7 @@ export default {
61
70
  }
62
71
  },
63
72
  beforeUnmount() {
64
- if(this.isBrowserDebug) {
73
+ if (this.isBrowserDebug) {
65
74
  return;
66
75
  }
67
76
 
@@ -75,21 +84,20 @@ export default {
75
84
  };
76
85
  </script>
77
86
 
78
- <template>
79
- <div v-if="!isBrowserDebug"
87
+ <template>
88
+ <div
89
+ v-if="!isBrowserDebug"
80
90
  :style="{
81
- left: style.left,
91
+ left: style.left,
82
92
  top: style.top,
83
93
  width: style.width,
84
- height: style.height
85
- }"
94
+ height: style.height,
95
+ }"
86
96
  :jsv_innerview="innerViewId"
87
97
  >
88
- <slot/>
89
- </div> <div v-else
90
- :style="{...style}"
91
- >
92
- <slot/>
98
+ <slot />
99
+ </div>
100
+ <div v-else :style="{ ...style }">
101
+ <slot />
93
102
  </div>
94
103
  </template>
95
-
@@ -44,7 +44,6 @@ export default {
44
44
  if (!this.waitForInit) {
45
45
  return true;
46
46
  }
47
-
48
47
  return this.style && this.style.width !== 0 && this.style.height !== 0;
49
48
  },
50
49
  getTransition() {
@@ -79,7 +78,7 @@ export default {
79
78
 
80
79
  <template>
81
80
  <div
82
- v-if="isReady"
81
+ v-if="isReady()"
83
82
  :style="{
84
83
  ...style,
85
84
  transition: getTransition(),
@@ -7,8 +7,8 @@
7
7
  * 列表的内容可以是图片,音频等任何网络资源,下载后缓存在本地,归入本地缓存管理(LRU清理策略)
8
8
  * onPreloading {Function(float percent)}: 预加载中回调,返回预加载进度
9
9
  * onPreloadDone {Function(sizeArray)}: 预加载完成回调,sizeArray(格式Object[]),每个的格式为{width, height}
10
- * onDownloadDone {Function(pathesArray)}: 预下载完成回调,pathesArray(格式为String[])为下载好回调的地址,
11
- * 其中pathesArray为存储位置的路径列表
10
+ * onDownloadDone {Function(pathesArray, extra)}: 预下载完成回调,pathesArray(格式为String[])为下载好回调的地址,
11
+ * 其中pathesArray为存储位置的路径列表, extra为额外信息(目前只有下载图片时的尺寸)
12
12
  *
13
13
  * 注意事项:
14
14
  * 指定加载时的尺寸(0为不指定),与img标签中的 jsv_img_scaledown_tex 属性一起使用
@@ -34,7 +34,7 @@
34
34
  * net_setting {object}: (未实现)网络加载参数,cookie, refer等,默认值 null
35
35
  -->
36
36
  <script>
37
- import { Forge, ForgeExtension } from "../../../dom/jsv-forge-define";
37
+ import { Forge, ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
38
38
 
39
39
  const CONST_FORMAT_TOKEN = "_JsvP_";
40
40
  const buildPreloadInfo = (
@@ -54,10 +54,11 @@ const buildPreloadInfo = (
54
54
  };
55
55
  };
56
56
 
57
- const buildDownloadInfo = (url, net_setting = null) => {
57
+ const buildDownloadInfo = (url, net_setting = null, get_image_size) => {
58
58
  return {
59
59
  url,
60
60
  netSetting: net_setting,
61
+ getImageSize: get_image_size,
61
62
  magicToken: CONST_FORMAT_TOKEN, // 用于格式校验
62
63
  };
63
64
  };
@@ -79,6 +80,7 @@ export default {
79
80
  downloadViewList: [],
80
81
  preloadStateList: [],
81
82
  downloadStateList: [],
83
+ downloadResultMap: {},
82
84
  preloadResultMap: {},
83
85
  CONST_FORMAT_TOKEN: "_JsvP_",
84
86
  preloadIsNullNum: 0, // 纪录传入的preload为null的数量,由于vue不支持在子组件修改props值,所有在删除值为null时,需要++,这样才能保证与传入数据的length相等从而触发回调
@@ -136,29 +138,6 @@ export default {
136
138
  }
137
139
  },
138
140
 
139
- // shouldComponentUpdate(nextProps, nextState) {
140
- // if (
141
- // nextProps.preloadList.length === this.preloadList.length &&
142
- // nextProps.downloadList.length === this.downloadList.length
143
- // ) {
144
- // let same = true;
145
- // for (let i = 0; i < nextProps.preloadList.length; i++) {
146
- // if (nextProps.preloadList[i].url !== this.preloadList[i].url) {
147
- // same = false;
148
- // break;
149
- // }
150
- // }
151
- // for (let i = 0; i < nextProps.downloadList.length; i++) {
152
- // if (nextProps.downloadList[i].url !== this.downloadList[i].url) {
153
- // same = false;
154
- // break;
155
- // }
156
- // }
157
- // return !same;
158
- // }
159
- // return true;
160
- // },
161
-
162
141
  _checkPreload() {
163
142
  let loadedNum = 0;
164
143
  this.preloadStateList.forEach((state) => {
@@ -261,7 +240,10 @@ export default {
261
240
  if (!state) return;
262
241
  }
263
242
  if (this.$props.onDownloadDone) {
264
- this.$props.onDownloadDone(this.downloadStateList);
243
+ this.$props.onDownloadDone(
244
+ this.downloadStateList,
245
+ this.downloadResultMap
246
+ );
265
247
  }
266
248
  },
267
249
 
@@ -269,7 +251,6 @@ export default {
269
251
  if (!this.downloadList) {
270
252
  return;
271
253
  }
272
- this.downloadStateList = new Array(this.downloadList.length).fill(null);
273
254
  // 直接在map前将url为null的值清除掉
274
255
  let downloadListData = this.downloadList;
275
256
  for (let i = 0; i < downloadListData.length; i++) {
@@ -277,13 +258,14 @@ export default {
277
258
  downloadListData.splice(i, 1);
278
259
  }
279
260
  }
261
+ this.downloadStateList = new Array(downloadListData.length).fill(null);
280
262
  this.downloadViewList = downloadListData.map((item, index) => {
281
263
  if (item.magicToken !== this.CONST_FORMAT_TOKEN) {
282
264
  console.error(
283
265
  "Error:format mismatch, data should comes from function buildDownloadInfo()"
284
266
  );
285
267
  }
286
- console.log(`OnDownload get${index} url=${item.url}`)
268
+ console.log(`OnDownload get${index} url=${item.url}`);
287
269
  const base_url = item.url;
288
270
  let image_url = base_url;
289
271
  if (base_url && base_url.indexOf("http") < 0) {
@@ -292,19 +274,33 @@ export default {
292
274
  image_url = new window.JsView.Dom.UrlRef(base_url).href;
293
275
  }
294
276
  }
295
- const texture =
296
- ForgeExtension.TextureManager.GetDownloadTexture(image_url);
277
+ const texture = ForgeExtension.TextureManager.GetDownloadTexture(
278
+ image_url,
279
+ null,
280
+ item.getImageSize
281
+ );
297
282
  if (!texture) {
298
- console.error("Error: Down view build texture failed for " + image_url);
299
- // 无法创建texture的图片先认为加载完成
300
- this.downloadStateList[index] = "invalid";
301
- return;
302
- }
303
- const callback_token = texture.RegisterLoadImageCallback(null, (texture_info) => {
304
- console.log(`OnDownload done index${index}`)
305
- this.downloadStateList[index] = texture_info.extra.absolutePath;
306
- this._checkDownload();
307
- });
283
+ console.error(
284
+ "Error: Down view build texture failed for " + image_url
285
+ );
286
+ // 无法创建texture的图片先认为加载完成
287
+ this.downloadStateList[index] = "invalid";
288
+ return;
289
+ }
290
+ const callback_token = texture.RegisterLoadImageCallback(
291
+ null,
292
+ (texture_info) => {
293
+ console.log(`OnDownload done index${index}`);
294
+ this.downloadStateList[index] = texture_info.extra.absolutePath;
295
+ if (item.getImageSize && texture_info.extra.width && texture_info.extra.height) {
296
+ this.downloadResultMap[texture_info.extra.absolutePath] = {
297
+ width: texture_info.extra.width,
298
+ height: texture_info.extra.height,
299
+ };
300
+ }
301
+ this._checkDownload();
302
+ }
303
+ );
308
304
  if (texture.EnableBackgroundLoad) {
309
305
  texture.EnableBackgroundLoad(this);
310
306
  }
@@ -16,7 +16,7 @@
16
16
  */
17
17
  -->
18
18
  <script>
19
- import { Forge, ForgeExtension } from "../../../dom/jsv-forge-define";
19
+ import { Forge, ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
20
20
 
21
21
  export default {
22
22
  props: {
@@ -32,7 +32,7 @@
32
32
  * enableShrink {boolean} 粒子缩小开关, 默认为false
33
33
  -->
34
34
  <script>
35
- import { Forge, ForgeExtension } from "../../../dom/jsv-forge-define";
35
+ import { Forge, ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
36
36
 
37
37
  let buildForgeView = (pointRes, sprayStyle, sizeRef) => {
38
38
  if (!pointRes) {
@@ -30,12 +30,13 @@
30
30
  -->
31
31
 
32
32
  <script>
33
- import { Forge } from "../../../dom/jsv-forge-define";
33
+ import { Forge } from "../../../../jsview/dom/jsv-forge-define";
34
34
  import JsvActorMove, {
35
35
  JsvActorMoveControl,
36
- } from "jsview/utils/JsViewVueWidget/JsvActorMove";
36
+ } from "../../JsViewVueWidget/JsvActorMove";
37
+ import JsvVisibleSensor from "../../JsViewVueWidget/JsvVisibleSensor";
37
38
  import Indicator from "./Indicator.vue";
38
- import { ref } from "vue";
39
+ import { ref, shallowRef } from "vue";
39
40
 
40
41
  const VIEW_NUM = 3;
41
42
 
@@ -50,7 +51,7 @@ function modToRange(value, mod, start = 0) {
50
51
  }
51
52
 
52
53
  export default {
53
- components: { Indicator, JsvActorMove },
54
+ components: { Indicator, JsvActorMove, JsvVisibleSensor },
54
55
  props: {
55
56
  showIndicator: {
56
57
  type: Boolean,
@@ -127,7 +128,7 @@ export default {
127
128
  reverseSwipe: {
128
129
  type: Boolean,
129
130
  default: false,
130
- }
131
+ },
131
132
  },
132
133
  computed: {
133
134
  indicatorLayout() {
@@ -369,12 +370,12 @@ export default {
369
370
  curViewAnimation.SetAnimationListener(
370
371
  new Forge.AnimationListener(null, this._onAnimationEnd, null)
371
372
  );
372
- this.$refs["element" + this.currentViewIndex]?.jsvMaskView.StartAnimation(
373
+ this.$refs["element" + this.currentViewIndex]?.jsvGetProxyView(true).StartAnimation(
373
374
  curViewAnimation
374
375
  );
375
376
  this.$refs[
376
377
  "element" + modToRange(this.currentViewIndex - direction, VIEW_NUM)
377
- ]?.jsvMaskView.StartAnimation(preViewAnimation);
378
+ ]?.jsvGetProxyView(true).StartAnimation(preViewAnimation);
378
379
  },
379
380
  _startSmoothTranslateAnimation() {
380
381
  let curController = this.controllerList[this.currentViewIndex];
@@ -407,6 +408,13 @@ export default {
407
408
  this.offset += direction;
408
409
  this._startAnimation(direction > 0 ? 1 : -1);
409
410
  },
411
+ onBeVisible(old_h, new_h, old_v, new_v) {
412
+ if ((old_h && !new_h) || (old_v && !new_h)) {
413
+ this.stopAutoplay();
414
+ } else if ((!old_h && new_h) || (!old_v && new_h)) {
415
+ this.startAutoplay();
416
+ }
417
+ },
410
418
  },
411
419
  mounted() {
412
420
  if (!this.focused) {
@@ -420,6 +428,14 @@ export default {
420
428
  </script>
421
429
 
422
430
  <template>
431
+ <jsv-visible-sensor
432
+ :horizonShown="0.2"
433
+ :verticalShown="0.2"
434
+ :width="layoutInfo.width"
435
+ :height="layoutInfo.height"
436
+ :enable="true"
437
+ :callback="onBeVisible"
438
+ ></jsv-visible-sensor>
423
439
  <jsv-focus-block
424
440
  :name="name"
425
441
  :onAction="{
@@ -544,4 +560,4 @@ export default {
544
560
  </div>
545
561
  </div>
546
562
  </jsv-focus-block>
547
- </template>
563
+ </template>
@@ -28,7 +28,8 @@
28
28
 
29
29
  <script>
30
30
  import Indicator from "./Indicator.vue";
31
- import { ref } from "vue";
31
+ import { ref, shallowRef } from "vue";
32
+ import JsvVisibleSensor from "jsview/utils/JsViewVueWidget/JsvVisibleSensor";
32
33
 
33
34
  const VIEW_NUM = 4;
34
35
 
@@ -45,7 +46,7 @@ function modToRange(value, mod, start = 0) {
45
46
  window.modToRange = modToRange;
46
47
 
47
48
  export default {
48
- components: { Indicator },
49
+ components: { Indicator, JsvVisibleSensor },
49
50
  props: {
50
51
  showIndicator: {
51
52
  type: Boolean,
@@ -124,7 +125,7 @@ export default {
124
125
  reverseSwipe: {
125
126
  type: Boolean,
126
127
  default: false,
127
- }
128
+ },
128
129
  },
129
130
  computed: {
130
131
  indicatorLayout() {
@@ -320,6 +321,10 @@ export default {
320
321
  }, this.autoplayInterval);
321
322
  }
322
323
  },
324
+ _stopAutoPlay() {
325
+ clearInterval(this.intervalHandler);
326
+ this.intervalHandler = -1;
327
+ },
323
328
  _onFocus() {
324
329
  this.focused = true;
325
330
  clearInterval(this.intervalHandler);
@@ -330,6 +335,13 @@ export default {
330
335
  this._enableAutoplay();
331
336
  this.onBlur?.();
332
337
  },
338
+ onBeVisible(old_h, new_h, old_v, new_v) {
339
+ if ((old_h && !new_h) || (old_v && !new_h)) {
340
+ this._stopAutoPlay();
341
+ } else if ((!old_h && new_h) || (!old_v && new_h)) {
342
+ this._enableAutoplay();
343
+ }
344
+ },
333
345
  },
334
346
  created() {
335
347
  this._enableAutoplay();
@@ -338,6 +350,14 @@ export default {
338
350
  </script>
339
351
 
340
352
  <template>
353
+ <jsv-visible-sensor
354
+ :horizonShown="0.2"
355
+ :verticalShown="0.2"
356
+ :width="layoutInfo.widgetWidth"
357
+ :height="layoutInfo.widgetHeight"
358
+ :enable="true"
359
+ :callback="onBeVisible"
360
+ ></jsv-visible-sensor>
341
361
  <jsv-focus-block
342
362
  :name="name"
343
363
  :onAction="{
@@ -6,106 +6,40 @@
6
6
  * JsvTextBox:Vue高阶组件,文字的垂直对齐方式显示控件
7
7
  * props说明:
8
8
  * verticalAlign {string} 垂直对齐方式 (必需) top、middle、bottom
9
- * stylesList {array} 布局样式(必需),数组中可包含样式对象或者JsvStyleClass,或者JsvTextStyleClass对象,
10
- * 样式对象内容为{left:0, top:0, width:xxx, height:xxx},
11
- * 布局样式为数组中所有样式的合并。
12
- * styleToken {string} 类似于react html元素的key,当style变化时,由使用者改变此Token通知hoc进行style重新识别。
13
- * Token不变的场景,props变化不会引起render,以提高渲染性能
9
+ * style {object} 样式(必需)
14
10
  * enableLatex {bool} 是否启用Latex文字描画模式
15
11
  -->
16
12
 
17
- <script>
18
- import {
19
- JsvTextStyleClass,
20
- combinedStyles,
21
- } from "jsview/utils/JsViewVueTools/JsvStyleClass.js";
13
+ <script setup>
14
+ import { ref, shallowRef, computed } from "vue";
22
15
 
23
- let sAreaAlignStyleMap = new Map();
24
- export default {
25
- props: {
26
- styleToken: String,
27
- stylesList: Object,
28
- verticalAlign: {
29
- type: String,
30
- default: "middle",
31
- },
32
- lineAlign: {
33
- type: String,
34
- default: "middle",
35
- },
36
- enableLatex: Boolean,
16
+ const props = defineProps({
17
+ style: Object,
18
+ verticalAlign: {
19
+ type: String,
20
+ default: "middle",
37
21
  },
38
- data() {
39
- return {
40
- styleCombined: null,
41
- styleClasses: null,
42
- tokenProcesses: null,
43
- };
22
+ lineAlign: {
23
+ type: String,
24
+ default: "middle",
44
25
  },
45
- beforeMount() {
46
- if (this.styleToken !== this.tokenProcesses) {
47
- // Token变化时,重新解析style array
48
- const style_set = combinedStyles(
49
- this.stylesList,
50
- !window.JsvDisableReactWrapper // 无ReactWrapper时,全解析style属性
51
- );
26
+ enableLatex: Boolean,
27
+ className: String,
28
+ });
52
29
 
53
- this.styleCombined = style_set.combinedStyle;
54
- // console.log("styleCombined = ", this.styleCombined);
55
- if (!window.JsvDisableReactWrapper) {
56
- this.styleClasses = style_set.combinedClass;
57
- let key = this.verticalAlign + "_" + this.lineAlign;
58
- if (!sAreaAlignStyleMap.has(key)) {
59
- const text_class = new JsvTextStyleClass({});
60
- text_class.setVerticalAlign(this.verticalAlign);
61
- text_class.setLineAlign(this.lineAlign);
62
- sAreaAlignStyleMap.set(key, text_class);
63
- }
64
- const va_set_class = sAreaAlignStyleMap.get(key);
65
- if (this.styleClasses.length === 0) {
66
- this.styleClasses += va_set_class.getName();
67
- } else {
68
- this.styleClasses = this.styleClasses + " " + va_set_class.getName();
69
- }
70
- }
71
- this.tokenProcesses = this.styleToken;
72
- }
73
- },
74
- methods: {
75
- isJsvDisableReactWrapper() {
76
- if (window.JsvDisableReactWrapper) {
77
- return true;
78
- }
79
- return false;
80
- },
81
- },
82
- };
83
30
  </script>
84
31
 
85
32
  <template>
86
33
  <div>
87
- <div v-if="isJsvDisableReactWrapper()" :style="styleCombined">
88
- <div :style="{ position: 'static', display: 'table' }">
89
- <div
90
- :style="{
91
- position: 'static',
92
- display: 'table-cell',
93
- width: styleCombined.width,
94
- height: styleCombined.height,
95
- verticalAlign: verticalAlign,
96
- }"
97
- >
98
- <slot></slot>
99
- </div>
100
- </div>
101
- </div>
102
34
  <div
103
- v-else
104
- :className="styleClasses"
105
- :style="{ ...styleCombined }"
35
+ :className="className"
36
+ :style="style"
106
37
  :jsv_text_latex_enable="enableLatex ? 'true' : ''"
38
+ :jsv_text_vertical_align="verticalAlign"
39
+ :jsv_text_line_align="lineAlign"
40
+ jsv-inherit-class="1"
107
41
  >
108
42
  <slot></slot>
109
43
  </div>
110
44
  </div>
111
- </template>
45
+ </template>
@@ -2,11 +2,11 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-02-07 14:21:37
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-08-23 11:33:56
5
+ * @LastEditTime: 2022-08-24 13:18:21
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { Forge, ForgeExtension } from "../../../dom/jsv-forge-define";
9
+ import { Forge, ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
10
10
  import {
11
11
  numberCheckSet,
12
12
  urlCheckSet,
@@ -117,11 +117,6 @@ export default {
117
117
  type: Object,
118
118
  },
119
119
  },
120
- data() {
121
- return {
122
- test: 0,
123
- }
124
- },
125
120
  watch: {
126
121
  texCoord: {
127
122
  handler(newValue, oldValue) {
@@ -203,7 +198,6 @@ export default {
203
198
  if (decorate_setting.url) {
204
199
  let converted_url = urlCheckSet(decorate_setting.url);
205
200
  let view_texture = textureManager.GetImage2(converted_url);
206
-
207
201
  nine_patch_view.EnableAlphaMix(view_texture);
208
202
  } else {
209
203
  console.error("ninepatch url not set");
@@ -308,7 +302,6 @@ export default {
308
302
  "RGB_8888",
309
303
  null
310
304
  );
311
-
312
305
  // 1.1 兼容border转为decorate
313
306
  let decorate = this.$props.decorate;
314
307
  if (this.$props.borderRadius) {
@@ -2,11 +2,11 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-04-10 20:46:53
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-04-10 23:07:54
5
+ * @LastEditTime: 2022-11-07 14:43:44
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { Forge } from "../../dom/jsv-forge-define";
9
+ import { Forge } from "../../../jsview/dom/jsv-forge-define";
10
10
 
11
11
  const DIRECTION_HORIZONTAL = Forge.DragSetting.DIRECTION_HORIZONTAL;
12
12
  const DIRECTION_VERTICAL = Forge.DragSetting.DIRECTION_VERTICAL;
@@ -66,9 +66,8 @@ export default {
66
66
  },
67
67
  created() {},
68
68
  mounted() {
69
- if (this.$refs.touchContainer && this.$refs.touchContainer.jsvMaskView) {
70
- const view = this.$refs.touchContainer.jsvMaskView;
71
- const view_lp = view.GetLayoutParams();
69
+ const view = this.$refs.touchContainer?.jsvGetProxyView(true);
70
+ if (view) {
72
71
  const page_width = this.flingPageWidth;
73
72
  const page_edge = this.flingPageEdge;
74
73
  const direction = this.direction;
@@ -80,13 +79,13 @@ export default {
80
79
  x: 0,
81
80
  y: 0,
82
81
  width: page_width,
83
- height: view_lp.Height,
82
+ height: this.$refs.touchContainer.style.height,
84
83
  };
85
84
  } else {
86
85
  drag_limit_area = {
87
86
  x: 0,
88
87
  y: 0,
89
- width: view_lp.Width,
88
+ width: this.$refs.touchContainer.style.width,
90
89
  height: page_width,
91
90
  };
92
91
  }
@@ -7,7 +7,7 @@
7
7
  -->
8
8
 
9
9
  <script>
10
- import { Forge, ForgeExtension } from "../../dom/jsv-forge-define";
10
+ import { Forge, ForgeExtension } from "../../../jsview/dom/jsv-forge-define";
11
11
 
12
12
  export default {
13
13
  inheritAttrs: false,