@shijiu/jsview-vue 1.9.888 → 1.9.921

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 (44) hide show
  1. package/package.json +1 -1
  2. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +36 -67
  3. package/utils/JsViewEngineWidget/TemplateParser.js +146 -138
  4. package/utils/JsViewEngineWidget/WidgetCommon.js +2 -11
  5. package/utils/JsViewPlugin/BrowserPluginLoader.js +14 -0
  6. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
  7. package/utils/JsViewPlugin/JsvPlayer/version.js +19 -0
  8. package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +1 -101
  9. package/utils/JsViewVueTools/JsvHashHistory.js +10 -10
  10. package/utils/JsViewVueTools/JsvImpactTracer.js +1 -1
  11. package/utils/JsViewVueTools/JsvStyleClass.js +1 -10
  12. package/utils/JsViewVueTools/JsvTextTools.js +7 -2
  13. package/utils/JsViewVueTools/TypeCheckAndSet.js +5 -5
  14. package/utils/JsViewVueTools/index.d.ts +1 -5
  15. package/utils/JsViewVueTools/index.js +0 -2
  16. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +173 -152
  17. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
  18. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +88 -51
  19. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +65 -63
  20. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +45 -82
  21. package/utils/JsViewVueWidget/JsvFilterView.vue +12 -17
  22. package/utils/JsViewVueWidget/JsvGrid.vue +10 -2
  23. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +7 -5
  24. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +8 -60
  25. package/utils/JsViewVueWidget/JsvMarquee.vue +9 -12
  26. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +30 -24
  27. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +1 -1
  28. package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -2
  29. package/utils/JsViewVueWidget/JsvPosterImage.vue +4 -4
  30. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +8 -8
  31. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +4 -4
  32. package/utils/JsViewVueWidget/JsvScaleTextBox.vue +1 -1
  33. package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
  34. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -15
  35. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +1 -1
  36. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +115 -111
  37. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
  38. package/utils/JsViewVueWidget/JsvTextBox.vue +38 -16
  39. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +16 -12
  40. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  41. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +3 -3
  42. package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +0 -3
  43. package/utils/JsViewVueWidget/index.js +8 -13
  44. package/utils/JsViewVueWidget/utils/text.js +3 -4
@@ -2,7 +2,7 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2020-12-30 14:08:38
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-01 16:49:21
5
+ * @LastEditTime: 2022-11-09 09:33:15
6
6
  * @Description: file content
7
7
  */
8
8
  class BaseDispatcher {
@@ -174,7 +174,7 @@ class SeamlessSlide extends SlideSetting {
174
174
  **/
175
175
  class FixPositionSlide extends SlideSetting {
176
176
  constructor({
177
- fixPercent = .5,
177
+ fixPercent,
178
178
  speed = defaultSpeed,
179
179
  easing = defaultEasing,
180
180
  boundaryProtect = SlideSetting.START_PROTECT | SlideSetting.END_PROTECT,
@@ -184,14 +184,6 @@ class FixPositionSlide extends SlideSetting {
184
184
  }
185
185
  }
186
186
 
187
- const FocusMoveType = {
188
- NO_ADJUST: 0x00000000,
189
- COLUMN_LOOP: 0x00000001,
190
- ROW_LOOP: 0x00000001 << 1,
191
- COLUMN_FIND_NEAR: 0x00000001 << 2,
192
- ROW_FIND_NEAR: 0x00000001 << 3,
193
- };
194
-
195
187
  // randomColor() {
196
188
  // let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
197
189
  // return (
@@ -211,5 +203,4 @@ export {
211
203
  WholePageSlide,
212
204
  SeamlessSlide,
213
205
  FixPositionSlide,
214
- FocusMoveType,
215
206
  };
@@ -0,0 +1,14 @@
1
+ /*
2
+ * @Author: LuDonglin
3
+ * @Date: 2022-2-24 14:00:00
4
+ * @LastEditors: LuDonglin
5
+ * @LastEditTime: 2022-2-24 14:00:00
6
+ * @Description: file content
7
+ */
8
+ import { JsvWidgetWrapperGroup } from 'jsview/utils/JsViewVueWidget/BrowserDebugWidget/WidgetWrapper.js';
9
+ //考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
10
+ import * as BrowserJsvPlayer from "./JsvPlayer/JsvPlayerBrowser.vue";
11
+
12
+ JsvWidgetWrapperGroup.BrowserJsvPlayer = BrowserJsvPlayer;
13
+
14
+ console.log("load browser plugin widgets.");
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import {JsvMediaVideo, findMediaObjectByKey, logDebug} from './JsvMedia'
3
- import JsvNativeSharedDiv from '../../JsViewVueWidget/JsvNativeSharedDiv.vue'
3
+ import JsvNativeSharedDiv from 'jsview/utils/JsViewVueWidget/JsvNativeSharedDiv.vue'
4
4
 
5
5
 
6
6
  export default {
@@ -0,0 +1,19 @@
1
+ let PluginInfo={
2
+ // downloadUrl:"http://192.168.0.63:8080/plugin/JsvPlayer-164.zip", //插件下载地址
3
+ packageName:"com.qcode.jsvplayer",
4
+ name:"播放器插件",
5
+ version:"1.8.4", //插件需要的版本号
6
+ versionCodeMin:184,
7
+ versionCodeMax:184,
8
+ bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
9
+ className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
10
+ initMethod:"createInstance", //插件初始化方法
11
+ listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
12
+ listener2: "top.JsvPlayerPluginStatus",
13
+ // debug:true,
14
+ md5:"7d6d28f8eda9c4b2725eecb578b553ab"
15
+ };
16
+
17
+ // 不要用export default,update-env脚本不能解析
18
+ // 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
19
+ module.exports = PluginInfo;
@@ -12,81 +12,6 @@
12
12
  * removeMultiRules(names_array) 批量动态删除keyFrame
13
13
  * hasRule(name) 查询KeyFrame是否存在
14
14
  */
15
- class KeyFrameStyleSheet {
16
- constructor(style_sheet_ref) {
17
- this._SS = style_sheet_ref;
18
- }
19
-
20
- /*
21
- * insertRule 参数说明:
22
- * key_frame_string (String) 要添加的keyFrame声明,
23
- * 格式为"@keyframes name {0%: XXX, 100%:XXX}",同CSS文件中声明
24
- * 请使用者保证不要和其他KeyFrame重名
25
- * 返回值:
26
- * 无
27
- */
28
- insertRule(key_frame_string) {
29
- if (window.jsvInAndroidWebView) {
30
- // Convert keyframe => -webkit-keyframe
31
- // Convert transform => -webkit-transform
32
- // Convert transform-origin => -webkit-transform-origin
33
- key_frame_string = key_frame_string.replace(/@keyframes/, "@-webkit-keyframes");
34
- key_frame_string = key_frame_string.replace(/transform/g, "-webkit-transform");
35
- }
36
-
37
- const index = this._SS.cssRules.length;
38
- this._SS.insertRule(key_frame_string, index);
39
- }
40
-
41
- /*
42
- * hasRule 参数说明:
43
- * name (String) 要动态删除的keyframe的名字
44
- * 返回值:
45
- * boolean 是否含有指定名称的keyframe
46
- */
47
- hasRule(name) {
48
- const css_rules_ref = this._SS.cssRules;
49
- for (let i = css_rules_ref.length - 1; i >= 0; i--) {
50
- if (css_rules_ref[i].name === name) {
51
- // Found
52
- return true;
53
- }
54
- }
55
-
56
- return false;
57
- }
58
-
59
- /*
60
- * removeRule 参数说明:
61
- * name (String) 要动态删除的keyframe的名字
62
- * 返回值:
63
- * 无
64
- */
65
- removeRule(name) {
66
- this.removeMultiRules([name]);
67
- }
68
-
69
- /*
70
- * removeMultiRules 参数说明:
71
- * names_array (Array) Array<String>,要动态删除的keyframe的名字数组
72
- * 返回值:
73
- * 无
74
- */
75
- removeMultiRules(names_array) {
76
- const style_sheet_ref = this._SS;
77
- const css_rules_ref = this._SS.cssRules;
78
- // 对CssRules进行删除操作,倒序轮询
79
- for (let i = css_rules_ref.length - 1; i >= 0; i--) {
80
- for (const j in names_array) {
81
- if (css_rules_ref[i].name === names_array[j]) {
82
- names_array.splice(j, 1);
83
- style_sheet_ref.deleteRule(i);
84
- break;
85
- }
86
- }
87
- }
88
- }
89
- }
90
15
 
91
16
  /*
92
17
  * getKeyFramesGroup 参数说明:
@@ -95,32 +20,7 @@ class KeyFrameStyleSheet {
95
20
  * KeyFrameStyleSheet 以anchor_tag为锚点,找到对应的cssRule,以此cssRule创建出的KeyFrame管理句柄
96
21
  */
97
22
  function getKeyFramesGroup(anchor_tag) {
98
- let style_sheets_ref = null;
99
-
100
- // 获取所有的style
101
- const ss = document.styleSheets;
102
- if (!ss || ss.length === 0) {
103
- console.error("Error: styleSheet empty");
104
- return null;
105
- }
106
-
107
- if (anchor_tag) {
108
- for (let i = 0; i < ss.length; ++i) {
109
- const item = ss[i];
110
- if (item.cssRules[0] && item.cssRules[0].name && item.cssRules[0].name === anchor_tag) {
111
- style_sheets_ref = item;
112
- break;
113
- }
114
- }
115
- if (style_sheets_ref === null) {
116
- console.error(`Error: no found tag=${anchor_tag}`);
117
- return null;
118
- }
119
- } else {
120
- style_sheets_ref = ss[0];
121
- }
122
-
123
- return new KeyFrameStyleSheet(style_sheets_ref);
23
+ return window.JsvCode.Dom.getKeyFrameGroup(anchor_tag);
124
24
  }
125
25
 
126
26
  export {
@@ -5,10 +5,10 @@ class JsvHashHistory {
5
5
  if(window.jsvIsBrowserDebug) {
6
6
  this.#history = createWebHashHistory(base)
7
7
  } else {
8
- this.#history = this._createMockHashHistory(base);
8
+ this.#history = this.#createMockHashHistory(base);
9
9
  }
10
10
  }
11
-
11
+
12
12
  get location() {
13
13
  return this.#history.location;
14
14
  }
@@ -31,24 +31,24 @@ class JsvHashHistory {
31
31
 
32
32
  replace(to, data) {
33
33
  this.#history.replace(to, data);
34
- this._updateLocation(this.#history.location);
34
+ this.#updateLocation(this.#history.location);
35
35
  }
36
36
 
37
37
  push(to, data) {
38
38
  this.#history.push(to, data);
39
- this._updateLocation(this.#history.location);
39
+ this.#updateLocation(this.#history.location);
40
40
  }
41
41
 
42
42
  go(delta, triggerListeners) {
43
43
  this.#history.go(delta, triggerListeners);
44
- this._updateLocation(this.#history.location);
44
+ this.#updateLocation(this.#history.location);
45
45
  }
46
46
 
47
47
  destroy() {
48
48
  this.#history.destroy();
49
49
  }
50
50
 
51
- _createMockHashHistory(base) {
51
+ #createMockHashHistory(base) {
52
52
  // 抄 createWebHashHistory 作业
53
53
  base = location.host ? base || location.pathname + location.search : '';
54
54
  if (!base.includes('#'))
@@ -60,7 +60,7 @@ class JsvHashHistory {
60
60
  this.baseURL = window.location.origin + base;
61
61
 
62
62
  const history = createMemoryHistory(base)
63
- const initHash = this._getInitHash();
63
+ const initHash = this.#getInitHash();
64
64
  if(initHash) {
65
65
  // 已设置hash,替换到hash页面
66
66
  history.replace({
@@ -69,13 +69,13 @@ class JsvHashHistory {
69
69
  });
70
70
  } else {
71
71
  // 未设置hash定位,追加hash根的显示
72
- this._updateLocation(null);
72
+ this.#updateLocation(null);
73
73
  }
74
74
 
75
75
  return history;
76
76
  }
77
77
 
78
- _getInitHash() {
78
+ #getInitHash() {
79
79
  let initHash;
80
80
 
81
81
  // 抓取history hash在启动过程中的变更, 用于warmUp/warmLoad不一致的情况。
@@ -94,7 +94,7 @@ class JsvHashHistory {
94
94
  return initHash;
95
95
  }
96
96
 
97
- _updateLocation(location) {
97
+ #updateLocation(location) {
98
98
  if(!window.jsvIsBrowserDebug) {
99
99
  const url = new window.JsView.Dom.UrlRef(
100
100
  location ? this.baseURL + location : this.baseURL,
@@ -17,7 +17,7 @@
17
17
  * updateImpactAutoFroze: 函数,更新 createImpactAutoFroze 创建的碰撞即停管理对象中管理的运动元素列表
18
18
  */
19
19
 
20
- import { Forge } from "@shijiu/jsview/dom/jsv-forge-define"
20
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
21
21
 
22
22
  /*
23
23
  * createImpactCallback 参数说明:
@@ -32,8 +32,8 @@
32
32
  * 经测试,react中对style属性的解析性能较低,属性大量的时候非常影响性能
33
33
  */
34
34
 
35
- import { Forge } from "@shijiu/jsview/dom/jsv-forge-define"
36
35
  import { getCssStyleGroup } from "./JsvDynamicCssStyle";
36
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
37
37
 
38
38
  let sIdGenerator = 100;
39
39
 
@@ -233,7 +233,6 @@ 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", //文字省略部分
237
236
  };
238
237
  }
239
238
 
@@ -245,10 +244,6 @@ class JsvTextStyleClass extends JsvStyleClass {
245
244
  this.jsvTextAttributes.jsv_text_line_align = new_align;
246
245
  }
247
246
 
248
- setEllipsis(new_ellipsis) {
249
- this.jsvTextAttributes.jsv_text_ellipsis = new_ellipsis;
250
- }
251
-
252
247
  // 注意:此接口仅提供给JsViewReactWidget中的hoc调用,
253
248
  getVerticalAlign() {
254
249
  return this.jsvTextAttributes.jsv_text_vertical_align;
@@ -259,10 +254,6 @@ class JsvTextStyleClass extends JsvStyleClass {
259
254
  return this.jsvTextAttributes.jsv_text_line_align;
260
255
  }
261
256
 
262
- getEllipsis() {
263
- return this.jsvTextAttributes.jsv_text_ellipsis;
264
- }
265
-
266
257
  // Override
267
258
  classType() {
268
259
  return CONST_TYPE_TEXT;
@@ -1,8 +1,13 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-02 10:20:43
4
+ * @Description: file content
5
+ */
1
6
  /*
2
7
  * @Author: ChenChanghua
3
8
  * @Date: 2022-11-29 14:26:20
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-11-29 14:27:03
9
+ * @LastEditors: Please set LastEditors
10
+ * @LastEditTime: 2023-02-02 10:20:45
6
11
  * @Description: file content
7
12
  */
8
13
  const getTextWidth = (text, style) => {
@@ -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;
@@ -13,8 +13,8 @@ function numberCheckSet(number) {
13
13
  function urlCheckSet(origin_url) {
14
14
  if (origin_url && origin_url.indexOf("http") === 0) {
15
15
  return origin_url;
16
- } else if (window.JsView.React.UrlRef) {
17
- return (new window.JsView.React.UrlRef(origin_url)).href;
16
+ } else if (window.JsView.Dom.UrlRef) {
17
+ return (new window.JsView.Dom.UrlRef(origin_url)).href;
18
18
  } else {
19
19
  console.warn(`${origin_url} is not valid url format, default as null`);
20
20
  return null;
@@ -1,7 +1,3 @@
1
- // 添加jsvCreateHashHistory的声明
2
- export declare function jsvCreateHashHistory(): RouterHistory;
3
-
4
-
5
1
  declare module '@shijiu/jsview-vue/utils/JsViewVueTools/JsvRuntimeBridge' {
6
2
  export const jJsvRuntimeBridge: {
7
3
  notifyPageLoaded();
@@ -14,4 +10,4 @@ declare module 'jsview/utils/JsViewVueTools/JsvRuntimeBridge' {
14
10
  }
15
11
  }
16
12
 
17
- declare module '*.js'
13
+ declare module '*.js'
@@ -1,8 +1,6 @@
1
1
  /*
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-07-05 14:09:55
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-11-29 14:34:45
6
4
  * @Description: file content
7
5
  */
8
6